@ainyc/canonry 1.19.4 → 1.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,246 +0,0 @@
1
- function Y_(e,t){for(var s=0;s<t.length;s++){const a=t[s];if(typeof a!="string"&&!Array.isArray(a)){for(const r in a)if(r!=="default"&&!(r in e)){const c=Object.getOwnPropertyDescriptor(a,r);c&&Object.defineProperty(e,r,c.get?c:{enumerable:!0,get:()=>a[r]})}}}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 r of document.querySelectorAll('link[rel="modulepreload"]'))a(r);new MutationObserver(r=>{for(const c of r)if(c.type==="childList")for(const d of c.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&a(d)}).observe(document,{childList:!0,subtree:!0});function s(r){const c={};return r.integrity&&(c.integrity=r.integrity),r.referrerPolicy&&(c.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?c.credentials="include":r.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function a(r){if(r.ep)return;r.ep=!0;const c=s(r);fetch(r.href,c)}})();function Ux(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var yh={exports:{}},Oo={};var O0;function X_(){if(O0)return Oo;O0=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function s(a,r,c){var d=null;if(c!==void 0&&(d=""+c),r.key!==void 0&&(d=""+r.key),"key"in r){c={};for(var f in r)f!=="key"&&(c[f]=r[f])}else c=r;return r=c.ref,{$$typeof:e,type:a,key:d,ref:r!==void 0?r:null,props:c}}return Oo.Fragment=t,Oo.jsx=s,Oo.jsxs=s,Oo}var R0;function J_(){return R0||(R0=1,yh.exports=X_()),yh.exports}var l=J_(),vh={exports:{}},ze={};var A0;function W_(){if(A0)return ze;A0=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),d=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),b=Symbol.iterator;function x(D){return D===null||typeof D!="object"?null:(D=b&&D[b]||D["@@iterator"],typeof D=="function"?D:null)}var j={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,_={};function C(D,G,ne){this.props=D,this.context=G,this.refs=_,this.updater=ne||j}C.prototype.isReactComponent={},C.prototype.setState=function(D,G){if(typeof D!="object"&&typeof D!="function"&&D!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,D,G,"setState")},C.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function E(){}E.prototype=C.prototype;function O(D,G,ne){this.props=D,this.context=G,this.refs=_,this.updater=ne||j}var z=O.prototype=new E;z.constructor=O,w(z,C.prototype),z.isPureReactComponent=!0;var M=Array.isArray;function T(){}var L={H:null,A:null,T:null,S:null},R=Object.prototype.hasOwnProperty;function I(D,G,ne){var ae=ne.ref;return{$$typeof:e,type:D,key:G,ref:ae!==void 0?ae:null,props:ne}}function ie(D,G){return I(D.type,G,D.props)}function Q(D){return typeof D=="object"&&D!==null&&D.$$typeof===e}function se(D){var G={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(ne){return G[ne]})}var me=/\/+/g;function Ee(D,G){return typeof D=="object"&&D!==null&&D.key!=null?se(""+D.key):G.toString(36)}function we(D){switch(D.status){case"fulfilled":return D.value;case"rejected":throw D.reason;default:switch(typeof D.status=="string"?D.then(T,T):(D.status="pending",D.then(function(G){D.status==="pending"&&(D.status="fulfilled",D.value=G)},function(G){D.status==="pending"&&(D.status="rejected",D.reason=G)})),D.status){case"fulfilled":return D.value;case"rejected":throw D.reason}}throw D}function H(D,G,ne,ae,le){var he=typeof D;(he==="undefined"||he==="boolean")&&(D=null);var de=!1;if(D===null)de=!0;else switch(he){case"bigint":case"string":case"number":de=!0;break;case"object":switch(D.$$typeof){case e:case t:de=!0;break;case v:return de=D._init,H(de(D._payload),G,ne,ae,le)}}if(de)return le=le(D),de=ae===""?"."+Ee(D,0):ae,M(le)?(ne="",de!=null&&(ne=de.replace(me,"$&/")+"/"),H(le,G,ne,"",function(Ye){return Ye})):le!=null&&(Q(le)&&(le=ie(le,ne+(le.key==null||D&&D.key===le.key?"":(""+le.key).replace(me,"$&/")+"/")+de)),G.push(le)),1;de=0;var Ze=ae===""?".":ae+":";if(M(D))for(var ge=0;ge<D.length;ge++)ae=D[ge],he=Ze+Ee(ae,ge),de+=H(ae,G,ne,he,le);else if(ge=x(D),typeof ge=="function")for(D=ge.call(D),ge=0;!(ae=D.next()).done;)ae=ae.value,he=Ze+Ee(ae,ge++),de+=H(ae,G,ne,he,le);else if(he==="object"){if(typeof D.then=="function")return H(we(D),G,ne,ae,le);throw G=String(D),Error("Objects are not valid as a React child (found: "+(G==="[object Object]"?"object with keys {"+Object.keys(D).join(", ")+"}":G)+"). If you meant to render a collection of children, use an array instead.")}return de}function Z(D,G,ne){if(D==null)return D;var ae=[],le=0;return H(D,ae,"","",function(he){return G.call(ne,he,le++)}),ae}function oe(D){if(D._status===-1){var G=D._result;G=G(),G.then(function(ne){(D._status===0||D._status===-1)&&(D._status=1,D._result=ne)},function(ne){(D._status===0||D._status===-1)&&(D._status=2,D._result=ne)}),D._status===-1&&(D._status=0,D._result=G)}if(D._status===1)return D._result.default;throw D._result}var pe=typeof reportError=="function"?reportError:function(D){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var G=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof D=="object"&&D!==null&&typeof D.message=="string"?String(D.message):String(D),error:D});if(!window.dispatchEvent(G))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",D);return}console.error(D)},ee={map:Z,forEach:function(D,G,ne){Z(D,function(){G.apply(this,arguments)},ne)},count:function(D){var G=0;return Z(D,function(){G++}),G},toArray:function(D){return Z(D,function(G){return G})||[]},only:function(D){if(!Q(D))throw Error("React.Children.only expected to receive a single React element child.");return D}};return ze.Activity=y,ze.Children=ee,ze.Component=C,ze.Fragment=s,ze.Profiler=r,ze.PureComponent=O,ze.StrictMode=a,ze.Suspense=p,ze.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=L,ze.__COMPILER_RUNTIME={__proto__:null,c:function(D){return L.H.useMemoCache(D)}},ze.cache=function(D){return function(){return D.apply(null,arguments)}},ze.cacheSignal=function(){return null},ze.cloneElement=function(D,G,ne){if(D==null)throw Error("The argument must be a React element, but you passed "+D+".");var ae=w({},D.props),le=D.key;if(G!=null)for(he in G.key!==void 0&&(le=""+G.key),G)!R.call(G,he)||he==="key"||he==="__self"||he==="__source"||he==="ref"&&G.ref===void 0||(ae[he]=G[he]);var he=arguments.length-2;if(he===1)ae.children=ne;else if(1<he){for(var de=Array(he),Ze=0;Ze<he;Ze++)de[Ze]=arguments[Ze+2];ae.children=de}return I(D.type,le,ae)},ze.createContext=function(D){return D={$$typeof:d,_currentValue:D,_currentValue2:D,_threadCount:0,Provider:null,Consumer:null},D.Provider=D,D.Consumer={$$typeof:c,_context:D},D},ze.createElement=function(D,G,ne){var ae,le={},he=null;if(G!=null)for(ae in G.key!==void 0&&(he=""+G.key),G)R.call(G,ae)&&ae!=="key"&&ae!=="__self"&&ae!=="__source"&&(le[ae]=G[ae]);var de=arguments.length-2;if(de===1)le.children=ne;else if(1<de){for(var Ze=Array(de),ge=0;ge<de;ge++)Ze[ge]=arguments[ge+2];le.children=Ze}if(D&&D.defaultProps)for(ae in de=D.defaultProps,de)le[ae]===void 0&&(le[ae]=de[ae]);return I(D,he,le)},ze.createRef=function(){return{current:null}},ze.forwardRef=function(D){return{$$typeof:f,render:D}},ze.isValidElement=Q,ze.lazy=function(D){return{$$typeof:v,_payload:{_status:-1,_result:D},_init:oe}},ze.memo=function(D,G){return{$$typeof:m,type:D,compare:G===void 0?null:G}},ze.startTransition=function(D){var G=L.T,ne={};L.T=ne;try{var ae=D(),le=L.S;le!==null&&le(ne,ae),typeof ae=="object"&&ae!==null&&typeof ae.then=="function"&&ae.then(T,pe)}catch(he){pe(he)}finally{G!==null&&ne.types!==null&&(G.types=ne.types),L.T=G}},ze.unstable_useCacheRefresh=function(){return L.H.useCacheRefresh()},ze.use=function(D){return L.H.use(D)},ze.useActionState=function(D,G,ne){return L.H.useActionState(D,G,ne)},ze.useCallback=function(D,G){return L.H.useCallback(D,G)},ze.useContext=function(D){return L.H.useContext(D)},ze.useDebugValue=function(){},ze.useDeferredValue=function(D,G){return L.H.useDeferredValue(D,G)},ze.useEffect=function(D,G){return L.H.useEffect(D,G)},ze.useEffectEvent=function(D){return L.H.useEffectEvent(D)},ze.useId=function(){return L.H.useId()},ze.useImperativeHandle=function(D,G,ne){return L.H.useImperativeHandle(D,G,ne)},ze.useInsertionEffect=function(D,G){return L.H.useInsertionEffect(D,G)},ze.useLayoutEffect=function(D,G){return L.H.useLayoutEffect(D,G)},ze.useMemo=function(D,G){return L.H.useMemo(D,G)},ze.useOptimistic=function(D,G){return L.H.useOptimistic(D,G)},ze.useReducer=function(D,G,ne){return L.H.useReducer(D,G,ne)},ze.useRef=function(D){return L.H.useRef(D)},ze.useState=function(D){return L.H.useState(D)},ze.useSyncExternalStore=function(D,G,ne){return L.H.useSyncExternalStore(D,G,ne)},ze.useTransition=function(){return L.H.useTransition()},ze.version="19.2.4",ze}var T0;function il(){return T0||(T0=1,vh.exports=W_()),vh.exports}var N=il();const ns=Ux(N),Dm=Y_({__proto__:null,default:ns},[N]);var bh={exports:{}},Ro={},xh={exports:{}},Sh={};var D0;function eC(){return D0||(D0=1,(function(e){function t(H,Z){var oe=H.length;H.push(Z);e:for(;0<oe;){var pe=oe-1>>>1,ee=H[pe];if(0<r(ee,Z))H[pe]=Z,H[oe]=ee,oe=pe;else break e}}function s(H){return H.length===0?null:H[0]}function a(H){if(H.length===0)return null;var Z=H[0],oe=H.pop();if(oe!==Z){H[0]=oe;e:for(var pe=0,ee=H.length,D=ee>>>1;pe<D;){var G=2*(pe+1)-1,ne=H[G],ae=G+1,le=H[ae];if(0>r(ne,oe))ae<ee&&0>r(le,ne)?(H[pe]=le,H[ae]=oe,pe=ae):(H[pe]=ne,H[G]=oe,pe=G);else if(ae<ee&&0>r(le,oe))H[pe]=le,H[ae]=oe,pe=ae;else break e}}return Z}function r(H,Z){var oe=H.sortIndex-Z.sortIndex;return oe!==0?oe:H.id-Z.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var d=Date,f=d.now();e.unstable_now=function(){return d.now()-f}}var p=[],m=[],v=1,y=null,b=3,x=!1,j=!1,w=!1,_=!1,C=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,O=typeof setImmediate<"u"?setImmediate:null;function z(H){for(var Z=s(m);Z!==null;){if(Z.callback===null)a(m);else if(Z.startTime<=H)a(m),Z.sortIndex=Z.expirationTime,t(p,Z);else break;Z=s(m)}}function M(H){if(w=!1,z(H),!j)if(s(p)!==null)j=!0,T||(T=!0,se());else{var Z=s(m);Z!==null&&we(M,Z.startTime-H)}}var T=!1,L=-1,R=5,I=-1;function ie(){return _?!0:!(e.unstable_now()-I<R)}function Q(){if(_=!1,T){var H=e.unstable_now();I=H;var Z=!0;try{e:{j=!1,w&&(w=!1,E(L),L=-1),x=!0;var oe=b;try{t:{for(z(H),y=s(p);y!==null&&!(y.expirationTime>H&&ie());){var pe=y.callback;if(typeof pe=="function"){y.callback=null,b=y.priorityLevel;var ee=pe(y.expirationTime<=H);if(H=e.unstable_now(),typeof ee=="function"){y.callback=ee,z(H),Z=!0;break t}y===s(p)&&a(p),z(H)}else a(p);y=s(p)}if(y!==null)Z=!0;else{var D=s(m);D!==null&&we(M,D.startTime-H),Z=!1}}break e}finally{y=null,b=oe,x=!1}Z=void 0}}finally{Z?se():T=!1}}}var se;if(typeof O=="function")se=function(){O(Q)};else if(typeof MessageChannel<"u"){var me=new MessageChannel,Ee=me.port2;me.port1.onmessage=Q,se=function(){Ee.postMessage(null)}}else se=function(){C(Q,0)};function we(H,Z){L=C(function(){H(e.unstable_now())},Z)}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"):R=0<H?Math.floor(1e3/H):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_next=function(H){switch(b){case 1:case 2:case 3:var Z=3;break;default:Z=b}var oe=b;b=Z;try{return H()}finally{b=oe}},e.unstable_requestPaint=function(){_=!0},e.unstable_runWithPriority=function(H,Z){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var oe=b;b=H;try{return Z()}finally{b=oe}},e.unstable_scheduleCallback=function(H,Z,oe){var pe=e.unstable_now();switch(typeof oe=="object"&&oe!==null?(oe=oe.delay,oe=typeof oe=="number"&&0<oe?pe+oe:pe):oe=pe,H){case 1:var ee=-1;break;case 2:ee=250;break;case 5:ee=1073741823;break;case 4:ee=1e4;break;default:ee=5e3}return ee=oe+ee,H={id:v++,callback:Z,priorityLevel:H,startTime:oe,expirationTime:ee,sortIndex:-1},oe>pe?(H.sortIndex=oe,t(m,H),s(p)===null&&H===s(m)&&(w?(E(L),L=-1):w=!0,we(M,oe-pe))):(H.sortIndex=ee,t(p,H),j||x||(j=!0,T||(T=!0,se()))),H},e.unstable_shouldYield=ie,e.unstable_wrapCallback=function(H){var Z=b;return function(){var oe=b;b=Z;try{return H.apply(this,arguments)}finally{b=oe}}}})(Sh)),Sh}var L0;function tC(){return L0||(L0=1,xh.exports=eC()),xh.exports}var wh={exports:{}},tn={};var M0;function nC(){if(M0)return tn;M0=1;var e=il();function t(p){var m="https://react.dev/errors/"+p;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var v=2;v<arguments.length;v++)m+="&args[]="+encodeURIComponent(arguments[v])}return"Minified React error #"+p+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(){}var a={d:{f:s,r:function(){throw Error(t(522))},D:s,C:s,L:s,m:s,X:s,S:s,M:s},p:0,findDOMNode:null},r=Symbol.for("react.portal");function c(p,m,v){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:r,key:y==null?null:""+y,children:p,containerInfo:m,implementation:v}}var d=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(p,m){if(p==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return tn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,tn.createPortal=function(p,m){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(t(299));return c(p,m,null,v)},tn.flushSync=function(p){var m=d.T,v=a.p;try{if(d.T=null,a.p=2,p)return p()}finally{d.T=m,a.p=v,a.d.f()}},tn.preconnect=function(p,m){typeof p=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,a.d.C(p,m))},tn.prefetchDNS=function(p){typeof p=="string"&&a.d.D(p)},tn.preinit=function(p,m){if(typeof p=="string"&&m&&typeof m.as=="string"){var v=m.as,y=f(v,m.crossOrigin),b=typeof m.integrity=="string"?m.integrity:void 0,x=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;v==="style"?a.d.S(p,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:y,integrity:b,fetchPriority:x}):v==="script"&&a.d.X(p,{crossOrigin:y,integrity:b,fetchPriority:x,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},tn.preinitModule=function(p,m){if(typeof p=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var v=f(m.as,m.crossOrigin);a.d.M(p,{crossOrigin:v,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&a.d.M(p)},tn.preload=function(p,m){if(typeof p=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var v=m.as,y=f(v,m.crossOrigin);a.d.L(p,v,{crossOrigin:y,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,type:typeof m.type=="string"?m.type:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0,referrerPolicy:typeof m.referrerPolicy=="string"?m.referrerPolicy:void 0,imageSrcSet:typeof m.imageSrcSet=="string"?m.imageSrcSet:void 0,imageSizes:typeof m.imageSizes=="string"?m.imageSizes:void 0,media:typeof m.media=="string"?m.media:void 0})}},tn.preloadModule=function(p,m){if(typeof p=="string")if(m){var v=f(m.as,m.crossOrigin);a.d.m(p,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:v,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else a.d.m(p)},tn.requestFormReset=function(p){a.d.r(p)},tn.unstable_batchedUpdates=function(p,m){return p(m)},tn.useFormState=function(p,m,v){return d.H.useFormState(p,m,v)},tn.useFormStatus=function(){return d.H.useHostTransitionStatus()},tn.version="19.2.4",tn}var U0;function $x(){if(U0)return wh.exports;U0=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(),wh.exports=nC(),wh.exports}var $0;function sC(){if($0)return Ro;$0=1;var e=tC(),t=il(),s=$x();function a(n){var i="https://react.dev/errors/"+n;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var o=2;o<arguments.length;o++)i+="&args[]="+encodeURIComponent(arguments[o])}return"Minified React error #"+n+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function c(n){var i=n,o=n;if(n.alternate)for(;i.return;)i=i.return;else{n=i;do i=n,(i.flags&4098)!==0&&(o=i.return),n=i.return;while(n)}return i.tag===3?o:null}function d(n){if(n.tag===13){var i=n.memoizedState;if(i===null&&(n=n.alternate,n!==null&&(i=n.memoizedState)),i!==null)return i.dehydrated}return null}function f(n){if(n.tag===31){var i=n.memoizedState;if(i===null&&(n=n.alternate,n!==null&&(i=n.memoizedState)),i!==null)return i.dehydrated}return null}function p(n){if(c(n)!==n)throw Error(a(188))}function m(n){var i=n.alternate;if(!i){if(i=c(n),i===null)throw Error(a(188));return i!==n?null:n}for(var o=n,u=i;;){var h=o.return;if(h===null)break;var g=h.alternate;if(g===null){if(u=h.return,u!==null){o=u;continue}break}if(h.child===g.child){for(g=h.child;g;){if(g===o)return p(h),n;if(g===u)return p(h),i;g=g.sibling}throw Error(a(188))}if(o.return!==u.return)o=h,u=g;else{for(var S=!1,k=h.child;k;){if(k===o){S=!0,o=h,u=g;break}if(k===u){S=!0,u=h,o=g;break}k=k.sibling}if(!S){for(k=g.child;k;){if(k===o){S=!0,o=g,u=h;break}if(k===u){S=!0,u=g,o=h;break}k=k.sibling}if(!S)throw Error(a(189))}}if(o.alternate!==u)throw Error(a(190))}if(o.tag!==3)throw Error(a(188));return o.stateNode.current===o?n:i}function v(n){var i=n.tag;if(i===5||i===26||i===27||i===6)return n;for(n=n.child;n!==null;){if(i=v(n),i!==null)return i;n=n.sibling}return null}var y=Object.assign,b=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),j=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),_=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),O=Symbol.for("react.context"),z=Symbol.for("react.forward_ref"),M=Symbol.for("react.suspense"),T=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),I=Symbol.for("react.activity"),ie=Symbol.for("react.memo_cache_sentinel"),Q=Symbol.iterator;function se(n){return n===null||typeof n!="object"?null:(n=Q&&n[Q]||n["@@iterator"],typeof n=="function"?n:null)}var me=Symbol.for("react.client.reference");function Ee(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===me?null:n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case w:return"Fragment";case C:return"Profiler";case _:return"StrictMode";case M:return"Suspense";case T:return"SuspenseList";case I:return"Activity"}if(typeof n=="object")switch(n.$$typeof){case j:return"Portal";case O:return n.displayName||"Context";case E:return(n._context.displayName||"Context")+".Consumer";case z:var i=n.render;return n=n.displayName,n||(n=i.displayName||i.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case L:return i=n.displayName||null,i!==null?i:Ee(n.type)||"Memo";case R:i=n._payload,n=n._init;try{return Ee(n(i))}catch{}}return null}var we=Array.isArray,H=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Z=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,oe={pending:!1,data:null,method:null,action:null},pe=[],ee=-1;function D(n){return{current:n}}function G(n){0>ee||(n.current=pe[ee],pe[ee]=null,ee--)}function ne(n,i){ee++,pe[ee]=n.current,n.current=i}var ae=D(null),le=D(null),he=D(null),de=D(null);function Ze(n,i){switch(ne(he,i),ne(le,n),ne(ae,null),i.nodeType){case 9:case 11:n=(n=i.documentElement)&&(n=n.namespaceURI)?Wv(n):0;break;default:if(n=i.tagName,i=i.namespaceURI)i=Wv(i),n=e0(i,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}G(ae),ne(ae,n)}function ge(){G(ae),G(le),G(he)}function Ye(n){n.memoizedState!==null&&ne(de,n);var i=ae.current,o=e0(i,n.type);i!==o&&(ne(le,n),ne(ae,o))}function ft(n){le.current===n&&(G(ae),G(le)),de.current===n&&(G(de),Co._currentValue=oe)}var fe,Qe;function lt(n){if(fe===void 0)try{throw Error()}catch(o){var i=o.stack.trim().match(/\n( *(at )?)/);fe=i&&i[1]||"",Qe=-1<o.stack.indexOf(`
2
- at`)?" (<anonymous>)":-1<o.stack.indexOf("@")?"@unknown:0:0":""}return`
3
- `+fe+n+Qe}var Wt=!1;function _t(n,i){if(!n||Wt)return"";Wt=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var u={DetermineComponentFrameRoot:function(){try{if(i){var J=function(){throw Error()};if(Object.defineProperty(J.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(J,[])}catch(K){var F=K}Reflect.construct(n,[],J)}else{try{J.call()}catch(K){F=K}n.call(J.prototype)}}else{try{throw Error()}catch(K){F=K}(J=n())&&typeof J.catch=="function"&&J.catch(function(){})}}catch(K){if(K&&F&&typeof K.stack=="string")return[K.stack,F.stack]}return[null,null]}};u.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var h=Object.getOwnPropertyDescriptor(u.DetermineComponentFrameRoot,"name");h&&h.configurable&&Object.defineProperty(u.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var g=u.DetermineComponentFrameRoot(),S=g[0],k=g[1];if(S&&k){var A=S.split(`
4
- `),q=k.split(`
5
- `);for(h=u=0;u<A.length&&!A[u].includes("DetermineComponentFrameRoot");)u++;for(;h<q.length&&!q[h].includes("DetermineComponentFrameRoot");)h++;if(u===A.length||h===q.length)for(u=A.length-1,h=q.length-1;1<=u&&0<=h&&A[u]!==q[h];)h--;for(;1<=u&&0<=h;u--,h--)if(A[u]!==q[h]){if(u!==1||h!==1)do if(u--,h--,0>h||A[u]!==q[h]){var V=`
6
- `+A[u].replace(" at new "," at ");return n.displayName&&V.includes("<anonymous>")&&(V=V.replace("<anonymous>",n.displayName)),V}while(1<=u&&0<=h);break}}}finally{Wt=!1,Error.prepareStackTrace=o}return(o=n?n.displayName||n.name:"")?lt(o):""}function nn(n,i){switch(n.tag){case 26:case 27:case 5:return lt(n.type);case 16:return lt("Lazy");case 13:return n.child!==i&&i!==null?lt("Suspense Fallback"):lt("Suspense");case 19:return lt("SuspenseList");case 0:case 15:return _t(n.type,!1);case 11:return _t(n.type.render,!1);case 1:return _t(n.type,!0);case 31:return lt("Activity");default:return""}}function Gt(n){try{var i="",o=null;do i+=nn(n,o),o=n,n=n.return;while(n);return i}catch(u){return`
7
- Error generating stack: `+u.message+`
8
- `+u.stack}}var Ct=Object.prototype.hasOwnProperty,St=e.unstable_scheduleCallback,sn=e.unstable_cancelCallback,re=e.unstable_shouldYield,Ue=e.unstable_requestPaint,$e=e.unstable_now,ke=e.unstable_getCurrentPriorityLevel,Te=e.unstable_ImmediatePriority,kt=e.unstable_UserBlockingPriority,Qn=e.unstable_NormalPriority,bs=e.unstable_LowPriority,Fs=e.unstable_IdlePriority,xs=e.log,Gs=e.unstable_setDisableYieldValue,os=null,_e=null;function wn(n){if(typeof xs=="function"&&Gs(n),_e&&typeof _e.setStrictMode=="function")try{_e.setStrictMode(os,n)}catch{}}var te=Math.clz32?Math.clz32:fl,Pe=Math.log,rd=Math.LN2;function fl(n){return n>>>=0,n===0?32:31-(Pe(n)/rd|0)|0}var Ks=256,Ss=262144,qi=4194304;function ls(n){var i=n&42;if(i!==0)return i;switch(n&-n){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 n&261888;case 262144:case 524288:case 1048576:case 2097152:return n&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return n&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return n}}function Ea(n,i,o){var u=n.pendingLanes;if(u===0)return 0;var h=0,g=n.suspendedLanes,S=n.pingedLanes;n=n.warmLanes;var k=u&134217727;return k!==0?(u=k&~g,u!==0?h=ls(u):(S&=k,S!==0?h=ls(S):o||(o=k&~n,o!==0&&(h=ls(o))))):(k=u&~g,k!==0?h=ls(k):S!==0?h=ls(S):o||(o=u&~n,o!==0&&(h=ls(o)))),h===0?0:i!==0&&i!==h&&(i&g)===0&&(g=h&-h,o=i&-i,g>=o||g===32&&(o&4194048)!==0)?i:h}function cs(n,i){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&i)===0}function hl(n,i){switch(n){case 1:case 2:case 4:case 8:case 64:return i+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 i+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 ml(){var n=qi;return qi<<=1,(qi&62914560)===0&&(qi=4194304),n}function Oa(n){for(var i=[],o=0;31>o;o++)i.push(n);return i}function Hi(n,i){n.pendingLanes|=i,i!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function od(n,i,o,u,h,g){var S=n.pendingLanes;n.pendingLanes=o,n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0,n.expiredLanes&=o,n.entangledLanes&=o,n.errorRecoveryDisabledLanes&=o,n.shellSuspendCounter=0;var k=n.entanglements,A=n.expirationTimes,q=n.hiddenUpdates;for(o=S&~o;0<o;){var V=31-te(o),J=1<<V;k[V]=0,A[V]=-1;var F=q[V];if(F!==null)for(q[V]=null,V=0;V<F.length;V++){var K=F[V];K!==null&&(K.lane&=-536870913)}o&=~J}u!==0&&pl(n,u,0),g!==0&&h===0&&n.tag!==0&&(n.suspendedLanes|=g&~(S&~i))}function pl(n,i,o){n.pendingLanes|=i,n.suspendedLanes&=~i;var u=31-te(i);n.entangledLanes|=i,n.entanglements[u]=n.entanglements[u]|1073741824|o&261930}function gl(n,i){var o=n.entangledLanes|=i;for(n=n.entanglements;o;){var u=31-te(o),h=1<<u;h&i|n[u]&i&&(n[u]|=i),o&=~h}}function Ir(n,i){var o=i&-i;return o=(o&42)!==0?1:$(o),(o&(n.suspendedLanes|i))!==0?0:o}function $(n){switch(n){case 2:n=1;break;case 8:n=4;break;case 32:n=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:n=128;break;case 268435456:n=134217728;break;default:n=0}return n}function ce(n){return n&=-n,2<n?8<n?(n&134217727)!==0?32:268435456:8:2}function et(){var n=Z.p;return n!==0?n:(n=window.event,n===void 0?32:j0(n.type))}function Kt(n,i){var o=Z.p;try{return Z.p=n,i()}finally{Z.p=o}}var Dt=Math.random().toString(36).slice(2),zt="__reactFiber$"+Dt,wt="__reactProps$"+Dt,jn="__reactContainer$"+Dt,en="__reactEvents$"+Dt,ld="__reactListeners$"+Dt,Vs="__reactHandles$"+Dt,Qs="__reactResources$"+Dt,us="__reactMarker$"+Dt;function Ra(n){delete n[zt],delete n[wt],delete n[en],delete n[ld],delete n[Vs]}function Ys(n){var i=n[zt];if(i)return i;for(var o=n.parentNode;o;){if(i=o[jn]||o[zt]){if(o=i.alternate,i.child!==null||o!==null&&o.child!==null)for(n=o0(n);n!==null;){if(o=n[zt])return o;n=o0(n)}return i}n=o,o=n.parentNode}return null}function Yn(n){if(n=n[zt]||n[jn]){var i=n.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return n}return null}function ds(n){var i=n.tag;if(i===5||i===26||i===27||i===6)return n.stateNode;throw Error(a(33))}function Xs(n){var i=n[Qs];return i||(i=n[Qs]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function Lt(n){n[us]=!0}var Ie=new Set,tt={};function qt(n,i){an(n,i),an(n+"Capture",i)}function an(n,i){for(tt[n]=i,n=0;n<i.length;n++)Ie.add(i[n])}var Aa=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Br={},Zp={};function q1(n){return Ct.call(Zp,n)?!0:Ct.call(Br,n)?!1:Aa.test(n)?Zp[n]=!0:(Br[n]=!0,!1)}function yl(n,i,o){if(q1(i))if(o===null)n.removeAttribute(i);else{switch(typeof o){case"undefined":case"function":case"symbol":n.removeAttribute(i);return;case"boolean":var u=i.toLowerCase().slice(0,5);if(u!=="data-"&&u!=="aria-"){n.removeAttribute(i);return}}n.setAttribute(i,""+o)}}function vl(n,i,o){if(o===null)n.removeAttribute(i);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(i);return}n.setAttribute(i,""+o)}}function ws(n,i,o,u){if(u===null)n.removeAttribute(o);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(o);return}n.setAttributeNS(i,o,""+u)}}function An(n){switch(typeof n){case"bigint":case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function Fp(n){var i=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function H1(n,i,o){var u=Object.getOwnPropertyDescriptor(n.constructor.prototype,i);if(!n.hasOwnProperty(i)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var h=u.get,g=u.set;return Object.defineProperty(n,i,{configurable:!0,get:function(){return h.call(this)},set:function(S){o=""+S,g.call(this,S)}}),Object.defineProperty(n,i,{enumerable:u.enumerable}),{getValue:function(){return o},setValue:function(S){o=""+S},stopTracking:function(){n._valueTracker=null,delete n[i]}}}}function cd(n){if(!n._valueTracker){var i=Fp(n)?"checked":"value";n._valueTracker=H1(n,i,""+n[i])}}function Gp(n){if(!n)return!1;var i=n._valueTracker;if(!i)return!0;var o=i.getValue(),u="";return n&&(u=Fp(n)?n.checked?"true":"false":n.value),n=u,n!==o?(i.setValue(n),!0):!1}function bl(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}var Z1=/[\n"\\]/g;function Tn(n){return n.replace(Z1,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function ud(n,i,o,u,h,g,S,k){n.name="",S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?n.type=S:n.removeAttribute("type"),i!=null?S==="number"?(i===0&&n.value===""||n.value!=i)&&(n.value=""+An(i)):n.value!==""+An(i)&&(n.value=""+An(i)):S!=="submit"&&S!=="reset"||n.removeAttribute("value"),i!=null?dd(n,S,An(i)):o!=null?dd(n,S,An(o)):u!=null&&n.removeAttribute("value"),h==null&&g!=null&&(n.defaultChecked=!!g),h!=null&&(n.checked=h&&typeof h!="function"&&typeof h!="symbol"),k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"?n.name=""+An(k):n.removeAttribute("name")}function Kp(n,i,o,u,h,g,S,k){if(g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(n.type=g),i!=null||o!=null){if(!(g!=="submit"&&g!=="reset"||i!=null)){cd(n);return}o=o!=null?""+An(o):"",i=i!=null?""+An(i):o,k||i===n.value||(n.value=i),n.defaultValue=i}u=u??h,u=typeof u!="function"&&typeof u!="symbol"&&!!u,n.checked=k?n.checked:!!u,n.defaultChecked=!!u,S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(n.name=S),cd(n)}function dd(n,i,o){i==="number"&&bl(n.ownerDocument)===n||n.defaultValue===""+o||(n.defaultValue=""+o)}function Ta(n,i,o,u){if(n=n.options,i){i={};for(var h=0;h<o.length;h++)i["$"+o[h]]=!0;for(o=0;o<n.length;o++)h=i.hasOwnProperty("$"+n[o].value),n[o].selected!==h&&(n[o].selected=h),h&&u&&(n[o].defaultSelected=!0)}else{for(o=""+An(o),i=null,h=0;h<n.length;h++){if(n[h].value===o){n[h].selected=!0,u&&(n[h].defaultSelected=!0);return}i!==null||n[h].disabled||(i=n[h])}i!==null&&(i.selected=!0)}}function Vp(n,i,o){if(i!=null&&(i=""+An(i),i!==n.value&&(n.value=i),o==null)){n.defaultValue!==i&&(n.defaultValue=i);return}n.defaultValue=o!=null?""+An(o):""}function Qp(n,i,o,u){if(i==null){if(u!=null){if(o!=null)throw Error(a(92));if(we(u)){if(1<u.length)throw Error(a(93));u=u[0]}o=u}o==null&&(o=""),i=o}o=An(i),n.defaultValue=o,u=n.textContent,u===o&&u!==""&&u!==null&&(n.value=u),cd(n)}function Da(n,i){if(i){var o=n.firstChild;if(o&&o===n.lastChild&&o.nodeType===3){o.nodeValue=i;return}}n.textContent=i}var F1=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 Yp(n,i,o){var u=i.indexOf("--")===0;o==null||typeof o=="boolean"||o===""?u?n.setProperty(i,""):i==="float"?n.cssFloat="":n[i]="":u?n.setProperty(i,o):typeof o!="number"||o===0||F1.has(i)?i==="float"?n.cssFloat=o:n[i]=(""+o).trim():n[i]=o+"px"}function Xp(n,i,o){if(i!=null&&typeof i!="object")throw Error(a(62));if(n=n.style,o!=null){for(var u in o)!o.hasOwnProperty(u)||i!=null&&i.hasOwnProperty(u)||(u.indexOf("--")===0?n.setProperty(u,""):u==="float"?n.cssFloat="":n[u]="");for(var h in i)u=i[h],i.hasOwnProperty(h)&&o[h]!==u&&Yp(n,h,u)}else for(var g in i)i.hasOwnProperty(g)&&Yp(n,g,i[g])}function fd(n){if(n.indexOf("-")===-1)return!1;switch(n){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 G1=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"]]),K1=/^[\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 xl(n){return K1.test(""+n)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":n}function js(){}var hd=null;function md(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var La=null,Ma=null;function Jp(n){var i=Yn(n);if(i&&(n=i.stateNode)){var o=n[wt]||null;e:switch(n=i.stateNode,i.type){case"input":if(ud(n,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name),i=o.name,o.type==="radio"&&i!=null){for(o=n;o.parentNode;)o=o.parentNode;for(o=o.querySelectorAll('input[name="'+Tn(""+i)+'"][type="radio"]'),i=0;i<o.length;i++){var u=o[i];if(u!==n&&u.form===n.form){var h=u[wt]||null;if(!h)throw Error(a(90));ud(u,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name)}}for(i=0;i<o.length;i++)u=o[i],u.form===n.form&&Gp(u)}break e;case"textarea":Vp(n,o.value,o.defaultValue);break e;case"select":i=o.value,i!=null&&Ta(n,!!o.multiple,i,!1)}}}var pd=!1;function Wp(n,i,o){if(pd)return n(i,o);pd=!0;try{var u=n(i);return u}finally{if(pd=!1,(La!==null||Ma!==null)&&(oc(),La&&(i=La,n=Ma,Ma=La=null,Jp(i),n)))for(i=0;i<n.length;i++)Jp(n[i])}}function qr(n,i){var o=n.stateNode;if(o===null)return null;var u=o[wt]||null;if(u===null)return null;o=u[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(u=!u.disabled)||(n=n.type,u=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!u;break e;default:n=!1}if(n)return null;if(o&&typeof o!="function")throw Error(a(231,i,typeof o));return o}var Ns=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),gd=!1;if(Ns)try{var Hr={};Object.defineProperty(Hr,"passive",{get:function(){gd=!0}}),window.addEventListener("test",Hr,Hr),window.removeEventListener("test",Hr,Hr)}catch{gd=!1}var Js=null,yd=null,Sl=null;function eg(){if(Sl)return Sl;var n,i=yd,o=i.length,u,h="value"in Js?Js.value:Js.textContent,g=h.length;for(n=0;n<o&&i[n]===h[n];n++);var S=o-n;for(u=1;u<=S&&i[o-u]===h[g-u];u++);return Sl=h.slice(n,1<u?1-u:void 0)}function wl(n){var i=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&i===13&&(n=13)):n=i,n===10&&(n=13),32<=n||n===13?n:0}function jl(){return!0}function tg(){return!1}function fn(n){function i(o,u,h,g,S){this._reactName=o,this._targetInst=h,this.type=u,this.nativeEvent=g,this.target=S,this.currentTarget=null;for(var k in n)n.hasOwnProperty(k)&&(o=n[k],this[k]=o?o(g):g[k]);return this.isDefaultPrevented=(g.defaultPrevented!=null?g.defaultPrevented:g.returnValue===!1)?jl:tg,this.isPropagationStopped=tg,this}return y(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var o=this.nativeEvent;o&&(o.preventDefault?o.preventDefault():typeof o.returnValue!="unknown"&&(o.returnValue=!1),this.isDefaultPrevented=jl)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=jl)},persist:function(){},isPersistent:jl}),i}var Zi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Nl=fn(Zi),Zr=y({},Zi,{view:0,detail:0}),V1=fn(Zr),vd,bd,Fr,_l=y({},Zr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Sd,button:0,buttons:0,relatedTarget:function(n){return n.relatedTarget===void 0?n.fromElement===n.srcElement?n.toElement:n.fromElement:n.relatedTarget},movementX:function(n){return"movementX"in n?n.movementX:(n!==Fr&&(Fr&&n.type==="mousemove"?(vd=n.screenX-Fr.screenX,bd=n.screenY-Fr.screenY):bd=vd=0,Fr=n),vd)},movementY:function(n){return"movementY"in n?n.movementY:bd}}),ng=fn(_l),Q1=y({},_l,{dataTransfer:0}),Y1=fn(Q1),X1=y({},Zr,{relatedTarget:0}),xd=fn(X1),J1=y({},Zi,{animationName:0,elapsedTime:0,pseudoElement:0}),W1=fn(J1),eN=y({},Zi,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),tN=fn(eN),nN=y({},Zi,{data:0}),sg=fn(nN),sN={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},iN={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"},aN={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function rN(n){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(n):(n=aN[n])?!!i[n]:!1}function Sd(){return rN}var oN=y({},Zr,{key:function(n){if(n.key){var i=sN[n.key]||n.key;if(i!=="Unidentified")return i}return n.type==="keypress"?(n=wl(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?iN[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Sd,charCode:function(n){return n.type==="keypress"?wl(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?wl(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),lN=fn(oN),cN=y({},_l,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ig=fn(cN),uN=y({},Zr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Sd}),dN=fn(uN),fN=y({},Zi,{propertyName:0,elapsedTime:0,pseudoElement:0}),hN=fn(fN),mN=y({},_l,{deltaX:function(n){return"deltaX"in n?n.deltaX:"wheelDeltaX"in n?-n.wheelDeltaX:0},deltaY:function(n){return"deltaY"in n?n.deltaY:"wheelDeltaY"in n?-n.wheelDeltaY:"wheelDelta"in n?-n.wheelDelta:0},deltaZ:0,deltaMode:0}),pN=fn(mN),gN=y({},Zi,{newState:0,oldState:0}),yN=fn(gN),vN=[9,13,27,32],wd=Ns&&"CompositionEvent"in window,Gr=null;Ns&&"documentMode"in document&&(Gr=document.documentMode);var bN=Ns&&"TextEvent"in window&&!Gr,ag=Ns&&(!wd||Gr&&8<Gr&&11>=Gr),rg=" ",og=!1;function lg(n,i){switch(n){case"keyup":return vN.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function cg(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var Ua=!1;function xN(n,i){switch(n){case"compositionend":return cg(i);case"keypress":return i.which!==32?null:(og=!0,rg);case"textInput":return n=i.data,n===rg&&og?null:n;default:return null}}function SN(n,i){if(Ua)return n==="compositionend"||!wd&&lg(n,i)?(n=eg(),Sl=yd=Js=null,Ua=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return ag&&i.locale!=="ko"?null:i.data;default:return null}}var wN={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 ug(n){var i=n&&n.nodeName&&n.nodeName.toLowerCase();return i==="input"?!!wN[n.type]:i==="textarea"}function dg(n,i,o,u){La?Ma?Ma.push(u):Ma=[u]:La=u,i=mc(i,"onChange"),0<i.length&&(o=new Nl("onChange","change",null,o,u),n.push({event:o,listeners:i}))}var Kr=null,Vr=null;function jN(n){Kv(n,0)}function Cl(n){var i=ds(n);if(Gp(i))return n}function fg(n,i){if(n==="change")return i}var hg=!1;if(Ns){var jd;if(Ns){var Nd="oninput"in document;if(!Nd){var mg=document.createElement("div");mg.setAttribute("oninput","return;"),Nd=typeof mg.oninput=="function"}jd=Nd}else jd=!1;hg=jd&&(!document.documentMode||9<document.documentMode)}function pg(){Kr&&(Kr.detachEvent("onpropertychange",gg),Vr=Kr=null)}function gg(n){if(n.propertyName==="value"&&Cl(Vr)){var i=[];dg(i,Vr,n,md(n)),Wp(jN,i)}}function NN(n,i,o){n==="focusin"?(pg(),Kr=i,Vr=o,Kr.attachEvent("onpropertychange",gg)):n==="focusout"&&pg()}function _N(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return Cl(Vr)}function CN(n,i){if(n==="click")return Cl(i)}function kN(n,i){if(n==="input"||n==="change")return Cl(i)}function zN(n,i){return n===i&&(n!==0||1/n===1/i)||n!==n&&i!==i}var Nn=typeof Object.is=="function"?Object.is:zN;function Qr(n,i){if(Nn(n,i))return!0;if(typeof n!="object"||n===null||typeof i!="object"||i===null)return!1;var o=Object.keys(n),u=Object.keys(i);if(o.length!==u.length)return!1;for(u=0;u<o.length;u++){var h=o[u];if(!Ct.call(i,h)||!Nn(n[h],i[h]))return!1}return!0}function yg(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function vg(n,i){var o=yg(n);n=0;for(var u;o;){if(o.nodeType===3){if(u=n+o.textContent.length,n<=i&&u>=i)return{node:o,offset:i-n};n=u}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=yg(o)}}function bg(n,i){return n&&i?n===i?!0:n&&n.nodeType===3?!1:i&&i.nodeType===3?bg(n,i.parentNode):"contains"in n?n.contains(i):n.compareDocumentPosition?!!(n.compareDocumentPosition(i)&16):!1:!1}function xg(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var i=bl(n.document);i instanceof n.HTMLIFrameElement;){try{var o=typeof i.contentWindow.location.href=="string"}catch{o=!1}if(o)n=i.contentWindow;else break;i=bl(n.document)}return i}function _d(n){var i=n&&n.nodeName&&n.nodeName.toLowerCase();return i&&(i==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||i==="textarea"||n.contentEditable==="true")}var EN=Ns&&"documentMode"in document&&11>=document.documentMode,$a=null,Cd=null,Yr=null,kd=!1;function Sg(n,i,o){var u=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;kd||$a==null||$a!==bl(u)||(u=$a,"selectionStart"in u&&_d(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),Yr&&Qr(Yr,u)||(Yr=u,u=mc(Cd,"onSelect"),0<u.length&&(i=new Nl("onSelect","select",null,i,o),n.push({event:i,listeners:u}),i.target=$a)))}function Fi(n,i){var o={};return o[n.toLowerCase()]=i.toLowerCase(),o["Webkit"+n]="webkit"+i,o["Moz"+n]="moz"+i,o}var Pa={animationend:Fi("Animation","AnimationEnd"),animationiteration:Fi("Animation","AnimationIteration"),animationstart:Fi("Animation","AnimationStart"),transitionrun:Fi("Transition","TransitionRun"),transitionstart:Fi("Transition","TransitionStart"),transitioncancel:Fi("Transition","TransitionCancel"),transitionend:Fi("Transition","TransitionEnd")},zd={},wg={};Ns&&(wg=document.createElement("div").style,"AnimationEvent"in window||(delete Pa.animationend.animation,delete Pa.animationiteration.animation,delete Pa.animationstart.animation),"TransitionEvent"in window||delete Pa.transitionend.transition);function Gi(n){if(zd[n])return zd[n];if(!Pa[n])return n;var i=Pa[n],o;for(o in i)if(i.hasOwnProperty(o)&&o in wg)return zd[n]=i[o];return n}var jg=Gi("animationend"),Ng=Gi("animationiteration"),_g=Gi("animationstart"),ON=Gi("transitionrun"),RN=Gi("transitionstart"),AN=Gi("transitioncancel"),Cg=Gi("transitionend"),kg=new Map,Ed="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(" ");Ed.push("scrollEnd");function Xn(n,i){kg.set(n,i),qt(i,[n])}var kl=typeof reportError=="function"?reportError:function(n){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof n=="object"&&n!==null&&typeof n.message=="string"?String(n.message):String(n),error:n});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",n);return}console.error(n)},Dn=[],Ia=0,Od=0;function zl(){for(var n=Ia,i=Od=Ia=0;i<n;){var o=Dn[i];Dn[i++]=null;var u=Dn[i];Dn[i++]=null;var h=Dn[i];Dn[i++]=null;var g=Dn[i];if(Dn[i++]=null,u!==null&&h!==null){var S=u.pending;S===null?h.next=h:(h.next=S.next,S.next=h),u.pending=h}g!==0&&zg(o,h,g)}}function El(n,i,o,u){Dn[Ia++]=n,Dn[Ia++]=i,Dn[Ia++]=o,Dn[Ia++]=u,Od|=u,n.lanes|=u,n=n.alternate,n!==null&&(n.lanes|=u)}function Rd(n,i,o,u){return El(n,i,o,u),Ol(n)}function Ki(n,i){return El(n,null,null,i),Ol(n)}function zg(n,i,o){n.lanes|=o;var u=n.alternate;u!==null&&(u.lanes|=o);for(var h=!1,g=n.return;g!==null;)g.childLanes|=o,u=g.alternate,u!==null&&(u.childLanes|=o),g.tag===22&&(n=g.stateNode,n===null||n._visibility&1||(h=!0)),n=g,g=g.return;return n.tag===3?(g=n.stateNode,h&&i!==null&&(h=31-te(o),n=g.hiddenUpdates,u=n[h],u===null?n[h]=[i]:u.push(i),i.lane=o|536870912),g):null}function Ol(n){if(50<bo)throw bo=0,Bf=null,Error(a(185));for(var i=n.return;i!==null;)n=i,i=n.return;return n.tag===3?n.stateNode:null}var Ba={};function TN(n,i,o,u){this.tag=n,this.key=o,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=u,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function _n(n,i,o,u){return new TN(n,i,o,u)}function Ad(n){return n=n.prototype,!(!n||!n.isReactComponent)}function _s(n,i){var o=n.alternate;return o===null?(o=_n(n.tag,i,n.key,n.mode),o.elementType=n.elementType,o.type=n.type,o.stateNode=n.stateNode,o.alternate=n,n.alternate=o):(o.pendingProps=i,o.type=n.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=n.flags&65011712,o.childLanes=n.childLanes,o.lanes=n.lanes,o.child=n.child,o.memoizedProps=n.memoizedProps,o.memoizedState=n.memoizedState,o.updateQueue=n.updateQueue,i=n.dependencies,o.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},o.sibling=n.sibling,o.index=n.index,o.ref=n.ref,o.refCleanup=n.refCleanup,o}function Eg(n,i){n.flags&=65011714;var o=n.alternate;return o===null?(n.childLanes=0,n.lanes=i,n.child=null,n.subtreeFlags=0,n.memoizedProps=null,n.memoizedState=null,n.updateQueue=null,n.dependencies=null,n.stateNode=null):(n.childLanes=o.childLanes,n.lanes=o.lanes,n.child=o.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=o.memoizedProps,n.memoizedState=o.memoizedState,n.updateQueue=o.updateQueue,n.type=o.type,i=o.dependencies,n.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),n}function Rl(n,i,o,u,h,g){var S=0;if(u=n,typeof n=="function")Ad(n)&&(S=1);else if(typeof n=="string")S=$_(n,o,ae.current)?26:n==="html"||n==="head"||n==="body"?27:5;else e:switch(n){case I:return n=_n(31,o,i,h),n.elementType=I,n.lanes=g,n;case w:return Vi(o.children,h,g,i);case _:S=8,h|=24;break;case C:return n=_n(12,o,i,h|2),n.elementType=C,n.lanes=g,n;case M:return n=_n(13,o,i,h),n.elementType=M,n.lanes=g,n;case T:return n=_n(19,o,i,h),n.elementType=T,n.lanes=g,n;default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case O:S=10;break e;case E:S=9;break e;case z:S=11;break e;case L:S=14;break e;case R:S=16,u=null;break e}S=29,o=Error(a(130,n===null?"null":typeof n,"")),u=null}return i=_n(S,o,i,h),i.elementType=n,i.type=u,i.lanes=g,i}function Vi(n,i,o,u){return n=_n(7,n,u,i),n.lanes=o,n}function Td(n,i,o){return n=_n(6,n,null,i),n.lanes=o,n}function Og(n){var i=_n(18,null,null,0);return i.stateNode=n,i}function Dd(n,i,o){return i=_n(4,n.children!==null?n.children:[],n.key,i),i.lanes=o,i.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},i}var Rg=new WeakMap;function Ln(n,i){if(typeof n=="object"&&n!==null){var o=Rg.get(n);return o!==void 0?o:(i={value:n,source:i,stack:Gt(i)},Rg.set(n,i),i)}return{value:n,source:i,stack:Gt(i)}}var qa=[],Ha=0,Al=null,Xr=0,Mn=[],Un=0,Ws=null,fs=1,hs="";function Cs(n,i){qa[Ha++]=Xr,qa[Ha++]=Al,Al=n,Xr=i}function Ag(n,i,o){Mn[Un++]=fs,Mn[Un++]=hs,Mn[Un++]=Ws,Ws=n;var u=fs;n=hs;var h=32-te(u)-1;u&=~(1<<h),o+=1;var g=32-te(i)+h;if(30<g){var S=h-h%5;g=(u&(1<<S)-1).toString(32),u>>=S,h-=S,fs=1<<32-te(i)+h|o<<h|u,hs=g+n}else fs=1<<g|o<<h|u,hs=n}function Ld(n){n.return!==null&&(Cs(n,1),Ag(n,1,0))}function Md(n){for(;n===Al;)Al=qa[--Ha],qa[Ha]=null,Xr=qa[--Ha],qa[Ha]=null;for(;n===Ws;)Ws=Mn[--Un],Mn[Un]=null,hs=Mn[--Un],Mn[Un]=null,fs=Mn[--Un],Mn[Un]=null}function Tg(n,i){Mn[Un++]=fs,Mn[Un++]=hs,Mn[Un++]=Ws,fs=i.id,hs=i.overflow,Ws=n}var Vt=null,ct=null,He=!1,ei=null,$n=!1,Ud=Error(a(519));function ti(n){var i=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Jr(Ln(i,n)),Ud}function Dg(n){var i=n.stateNode,o=n.type,u=n.memoizedProps;switch(i[zt]=n,i[wt]=u,o){case"dialog":Me("cancel",i),Me("close",i);break;case"iframe":case"object":case"embed":Me("load",i);break;case"video":case"audio":for(o=0;o<So.length;o++)Me(So[o],i);break;case"source":Me("error",i);break;case"img":case"image":case"link":Me("error",i),Me("load",i);break;case"details":Me("toggle",i);break;case"input":Me("invalid",i),Kp(i,u.value,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name,!0);break;case"select":Me("invalid",i);break;case"textarea":Me("invalid",i),Qp(i,u.value,u.defaultValue,u.children)}o=u.children,typeof o!="string"&&typeof o!="number"&&typeof o!="bigint"||i.textContent===""+o||u.suppressHydrationWarning===!0||Xv(i.textContent,o)?(u.popover!=null&&(Me("beforetoggle",i),Me("toggle",i)),u.onScroll!=null&&Me("scroll",i),u.onScrollEnd!=null&&Me("scrollend",i),u.onClick!=null&&(i.onclick=js),i=!0):i=!1,i||ti(n,!0)}function Lg(n){for(Vt=n.return;Vt;)switch(Vt.tag){case 5:case 31:case 13:$n=!1;return;case 27:case 3:$n=!0;return;default:Vt=Vt.return}}function Za(n){if(n!==Vt)return!1;if(!He)return Lg(n),He=!0,!1;var i=n.tag,o;if((o=i!==3&&i!==27)&&((o=i===5)&&(o=n.type,o=!(o!=="form"&&o!=="button")||nh(n.type,n.memoizedProps)),o=!o),o&&ct&&ti(n),Lg(n),i===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(a(317));ct=r0(n)}else if(i===31){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(a(317));ct=r0(n)}else i===27?(i=ct,pi(n.type)?(n=oh,oh=null,ct=n):ct=i):ct=Vt?In(n.stateNode.nextSibling):null;return!0}function Qi(){ct=Vt=null,He=!1}function $d(){var n=ei;return n!==null&&(gn===null?gn=n:gn.push.apply(gn,n),ei=null),n}function Jr(n){ei===null?ei=[n]:ei.push(n)}var Pd=D(null),Yi=null,ks=null;function ni(n,i,o){ne(Pd,i._currentValue),i._currentValue=o}function zs(n){n._currentValue=Pd.current,G(Pd)}function Id(n,i,o){for(;n!==null;){var u=n.alternate;if((n.childLanes&i)!==i?(n.childLanes|=i,u!==null&&(u.childLanes|=i)):u!==null&&(u.childLanes&i)!==i&&(u.childLanes|=i),n===o)break;n=n.return}}function Bd(n,i,o,u){var h=n.child;for(h!==null&&(h.return=n);h!==null;){var g=h.dependencies;if(g!==null){var S=h.child;g=g.firstContext;e:for(;g!==null;){var k=g;g=h;for(var A=0;A<i.length;A++)if(k.context===i[A]){g.lanes|=o,k=g.alternate,k!==null&&(k.lanes|=o),Id(g.return,o,n),u||(S=null);break e}g=k.next}}else if(h.tag===18){if(S=h.return,S===null)throw Error(a(341));S.lanes|=o,g=S.alternate,g!==null&&(g.lanes|=o),Id(S,o,n),S=null}else S=h.child;if(S!==null)S.return=h;else for(S=h;S!==null;){if(S===n){S=null;break}if(h=S.sibling,h!==null){h.return=S.return,S=h;break}S=S.return}h=S}}function Fa(n,i,o,u){n=null;for(var h=i,g=!1;h!==null;){if(!g){if((h.flags&524288)!==0)g=!0;else if((h.flags&262144)!==0)break}if(h.tag===10){var S=h.alternate;if(S===null)throw Error(a(387));if(S=S.memoizedProps,S!==null){var k=h.type;Nn(h.pendingProps.value,S.value)||(n!==null?n.push(k):n=[k])}}else if(h===de.current){if(S=h.alternate,S===null)throw Error(a(387));S.memoizedState.memoizedState!==h.memoizedState.memoizedState&&(n!==null?n.push(Co):n=[Co])}h=h.return}n!==null&&Bd(i,n,o,u),i.flags|=262144}function Tl(n){for(n=n.firstContext;n!==null;){if(!Nn(n.context._currentValue,n.memoizedValue))return!0;n=n.next}return!1}function Xi(n){Yi=n,ks=null,n=n.dependencies,n!==null&&(n.firstContext=null)}function Qt(n){return Mg(Yi,n)}function Dl(n,i){return Yi===null&&Xi(n),Mg(n,i)}function Mg(n,i){var o=i._currentValue;if(i={context:i,memoizedValue:o,next:null},ks===null){if(n===null)throw Error(a(308));ks=i,n.dependencies={lanes:0,firstContext:i},n.flags|=524288}else ks=ks.next=i;return o}var DN=typeof AbortController<"u"?AbortController:function(){var n=[],i=this.signal={aborted:!1,addEventListener:function(o,u){n.push(u)}};this.abort=function(){i.aborted=!0,n.forEach(function(o){return o()})}},LN=e.unstable_scheduleCallback,MN=e.unstable_NormalPriority,Mt={$$typeof:O,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function qd(){return{controller:new DN,data:new Map,refCount:0}}function Wr(n){n.refCount--,n.refCount===0&&LN(MN,function(){n.controller.abort()})}var eo=null,Hd=0,Ga=0,Ka=null;function UN(n,i){if(eo===null){var o=eo=[];Hd=0,Ga=Kf(),Ka={status:"pending",value:void 0,then:function(u){o.push(u)}}}return Hd++,i.then(Ug,Ug),i}function Ug(){if(--Hd===0&&eo!==null){Ka!==null&&(Ka.status="fulfilled");var n=eo;eo=null,Ga=0,Ka=null;for(var i=0;i<n.length;i++)(0,n[i])()}}function $N(n,i){var o=[],u={status:"pending",value:null,reason:null,then:function(h){o.push(h)}};return n.then(function(){u.status="fulfilled",u.value=i;for(var h=0;h<o.length;h++)(0,o[h])(i)},function(h){for(u.status="rejected",u.reason=h,h=0;h<o.length;h++)(0,o[h])(void 0)}),u}var $g=H.S;H.S=function(n,i){Sv=$e(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&UN(n,i),$g!==null&&$g(n,i)};var Ji=D(null);function Zd(){var n=Ji.current;return n!==null?n:at.pooledCache}function Ll(n,i){i===null?ne(Ji,Ji.current):ne(Ji,i.pool)}function Pg(){var n=Zd();return n===null?null:{parent:Mt._currentValue,pool:n}}var Va=Error(a(460)),Fd=Error(a(474)),Ml=Error(a(542)),Ul={then:function(){}};function Ig(n){return n=n.status,n==="fulfilled"||n==="rejected"}function Bg(n,i,o){switch(o=n[o],o===void 0?n.push(i):o!==i&&(i.then(js,js),i=o),i.status){case"fulfilled":return i.value;case"rejected":throw n=i.reason,Hg(n),n;default:if(typeof i.status=="string")i.then(js,js);else{if(n=at,n!==null&&100<n.shellSuspendCounter)throw Error(a(482));n=i,n.status="pending",n.then(function(u){if(i.status==="pending"){var h=i;h.status="fulfilled",h.value=u}},function(u){if(i.status==="pending"){var h=i;h.status="rejected",h.reason=u}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw n=i.reason,Hg(n),n}throw ea=i,Va}}function Wi(n){try{var i=n._init;return i(n._payload)}catch(o){throw o!==null&&typeof o=="object"&&typeof o.then=="function"?(ea=o,Va):o}}var ea=null;function qg(){if(ea===null)throw Error(a(459));var n=ea;return ea=null,n}function Hg(n){if(n===Va||n===Ml)throw Error(a(483))}var Qa=null,to=0;function $l(n){var i=to;return to+=1,Qa===null&&(Qa=[]),Bg(Qa,n,i)}function no(n,i){i=i.props.ref,n.ref=i!==void 0?i:null}function Pl(n,i){throw i.$$typeof===b?Error(a(525)):(n=Object.prototype.toString.call(i),Error(a(31,n==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":n)))}function Zg(n){function i(P,U){if(n){var B=P.deletions;B===null?(P.deletions=[U],P.flags|=16):B.push(U)}}function o(P,U){if(!n)return null;for(;U!==null;)i(P,U),U=U.sibling;return null}function u(P){for(var U=new Map;P!==null;)P.key!==null?U.set(P.key,P):U.set(P.index,P),P=P.sibling;return U}function h(P,U){return P=_s(P,U),P.index=0,P.sibling=null,P}function g(P,U,B){return P.index=B,n?(B=P.alternate,B!==null?(B=B.index,B<U?(P.flags|=67108866,U):B):(P.flags|=67108866,U)):(P.flags|=1048576,U)}function S(P){return n&&P.alternate===null&&(P.flags|=67108866),P}function k(P,U,B,Y){return U===null||U.tag!==6?(U=Td(B,P.mode,Y),U.return=P,U):(U=h(U,B),U.return=P,U)}function A(P,U,B,Y){var je=B.type;return je===w?V(P,U,B.props.children,Y,B.key):U!==null&&(U.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===R&&Wi(je)===U.type)?(U=h(U,B.props),no(U,B),U.return=P,U):(U=Rl(B.type,B.key,B.props,null,P.mode,Y),no(U,B),U.return=P,U)}function q(P,U,B,Y){return U===null||U.tag!==4||U.stateNode.containerInfo!==B.containerInfo||U.stateNode.implementation!==B.implementation?(U=Dd(B,P.mode,Y),U.return=P,U):(U=h(U,B.children||[]),U.return=P,U)}function V(P,U,B,Y,je){return U===null||U.tag!==7?(U=Vi(B,P.mode,Y,je),U.return=P,U):(U=h(U,B),U.return=P,U)}function J(P,U,B){if(typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint")return U=Td(""+U,P.mode,B),U.return=P,U;if(typeof U=="object"&&U!==null){switch(U.$$typeof){case x:return B=Rl(U.type,U.key,U.props,null,P.mode,B),no(B,U),B.return=P,B;case j:return U=Dd(U,P.mode,B),U.return=P,U;case R:return U=Wi(U),J(P,U,B)}if(we(U)||se(U))return U=Vi(U,P.mode,B,null),U.return=P,U;if(typeof U.then=="function")return J(P,$l(U),B);if(U.$$typeof===O)return J(P,Dl(P,U),B);Pl(P,U)}return null}function F(P,U,B,Y){var je=U!==null?U.key:null;if(typeof B=="string"&&B!==""||typeof B=="number"||typeof B=="bigint")return je!==null?null:k(P,U,""+B,Y);if(typeof B=="object"&&B!==null){switch(B.$$typeof){case x:return B.key===je?A(P,U,B,Y):null;case j:return B.key===je?q(P,U,B,Y):null;case R:return B=Wi(B),F(P,U,B,Y)}if(we(B)||se(B))return je!==null?null:V(P,U,B,Y,null);if(typeof B.then=="function")return F(P,U,$l(B),Y);if(B.$$typeof===O)return F(P,U,Dl(P,B),Y);Pl(P,B)}return null}function K(P,U,B,Y,je){if(typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint")return P=P.get(B)||null,k(U,P,""+Y,je);if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case x:return P=P.get(Y.key===null?B:Y.key)||null,A(U,P,Y,je);case j:return P=P.get(Y.key===null?B:Y.key)||null,q(U,P,Y,je);case R:return Y=Wi(Y),K(P,U,B,Y,je)}if(we(Y)||se(Y))return P=P.get(B)||null,V(U,P,Y,je,null);if(typeof Y.then=="function")return K(P,U,B,$l(Y),je);if(Y.$$typeof===O)return K(P,U,B,Dl(U,Y),je);Pl(U,Y)}return null}function ye(P,U,B,Y){for(var je=null,Fe=null,xe=U,Ae=U=0,qe=null;xe!==null&&Ae<B.length;Ae++){xe.index>Ae?(qe=xe,xe=null):qe=xe.sibling;var Ge=F(P,xe,B[Ae],Y);if(Ge===null){xe===null&&(xe=qe);break}n&&xe&&Ge.alternate===null&&i(P,xe),U=g(Ge,U,Ae),Fe===null?je=Ge:Fe.sibling=Ge,Fe=Ge,xe=qe}if(Ae===B.length)return o(P,xe),He&&Cs(P,Ae),je;if(xe===null){for(;Ae<B.length;Ae++)xe=J(P,B[Ae],Y),xe!==null&&(U=g(xe,U,Ae),Fe===null?je=xe:Fe.sibling=xe,Fe=xe);return He&&Cs(P,Ae),je}for(xe=u(xe);Ae<B.length;Ae++)qe=K(xe,P,Ae,B[Ae],Y),qe!==null&&(n&&qe.alternate!==null&&xe.delete(qe.key===null?Ae:qe.key),U=g(qe,U,Ae),Fe===null?je=qe:Fe.sibling=qe,Fe=qe);return n&&xe.forEach(function(xi){return i(P,xi)}),He&&Cs(P,Ae),je}function Ce(P,U,B,Y){if(B==null)throw Error(a(151));for(var je=null,Fe=null,xe=U,Ae=U=0,qe=null,Ge=B.next();xe!==null&&!Ge.done;Ae++,Ge=B.next()){xe.index>Ae?(qe=xe,xe=null):qe=xe.sibling;var xi=F(P,xe,Ge.value,Y);if(xi===null){xe===null&&(xe=qe);break}n&&xe&&xi.alternate===null&&i(P,xe),U=g(xi,U,Ae),Fe===null?je=xi:Fe.sibling=xi,Fe=xi,xe=qe}if(Ge.done)return o(P,xe),He&&Cs(P,Ae),je;if(xe===null){for(;!Ge.done;Ae++,Ge=B.next())Ge=J(P,Ge.value,Y),Ge!==null&&(U=g(Ge,U,Ae),Fe===null?je=Ge:Fe.sibling=Ge,Fe=Ge);return He&&Cs(P,Ae),je}for(xe=u(xe);!Ge.done;Ae++,Ge=B.next())Ge=K(xe,P,Ae,Ge.value,Y),Ge!==null&&(n&&Ge.alternate!==null&&xe.delete(Ge.key===null?Ae:Ge.key),U=g(Ge,U,Ae),Fe===null?je=Ge:Fe.sibling=Ge,Fe=Ge);return n&&xe.forEach(function(Q_){return i(P,Q_)}),He&&Cs(P,Ae),je}function it(P,U,B,Y){if(typeof B=="object"&&B!==null&&B.type===w&&B.key===null&&(B=B.props.children),typeof B=="object"&&B!==null){switch(B.$$typeof){case x:e:{for(var je=B.key;U!==null;){if(U.key===je){if(je=B.type,je===w){if(U.tag===7){o(P,U.sibling),Y=h(U,B.props.children),Y.return=P,P=Y;break e}}else if(U.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===R&&Wi(je)===U.type){o(P,U.sibling),Y=h(U,B.props),no(Y,B),Y.return=P,P=Y;break e}o(P,U);break}else i(P,U);U=U.sibling}B.type===w?(Y=Vi(B.props.children,P.mode,Y,B.key),Y.return=P,P=Y):(Y=Rl(B.type,B.key,B.props,null,P.mode,Y),no(Y,B),Y.return=P,P=Y)}return S(P);case j:e:{for(je=B.key;U!==null;){if(U.key===je)if(U.tag===4&&U.stateNode.containerInfo===B.containerInfo&&U.stateNode.implementation===B.implementation){o(P,U.sibling),Y=h(U,B.children||[]),Y.return=P,P=Y;break e}else{o(P,U);break}else i(P,U);U=U.sibling}Y=Dd(B,P.mode,Y),Y.return=P,P=Y}return S(P);case R:return B=Wi(B),it(P,U,B,Y)}if(we(B))return ye(P,U,B,Y);if(se(B)){if(je=se(B),typeof je!="function")throw Error(a(150));return B=je.call(B),Ce(P,U,B,Y)}if(typeof B.then=="function")return it(P,U,$l(B),Y);if(B.$$typeof===O)return it(P,U,Dl(P,B),Y);Pl(P,B)}return typeof B=="string"&&B!==""||typeof B=="number"||typeof B=="bigint"?(B=""+B,U!==null&&U.tag===6?(o(P,U.sibling),Y=h(U,B),Y.return=P,P=Y):(o(P,U),Y=Td(B,P.mode,Y),Y.return=P,P=Y),S(P)):o(P,U)}return function(P,U,B,Y){try{to=0;var je=it(P,U,B,Y);return Qa=null,je}catch(xe){if(xe===Va||xe===Ml)throw xe;var Fe=_n(29,xe,null,P.mode);return Fe.lanes=Y,Fe.return=P,Fe}}}var ta=Zg(!0),Fg=Zg(!1),si=!1;function Gd(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Kd(n,i){n=n.updateQueue,i.updateQueue===n&&(i.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,callbacks:null})}function ii(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function ai(n,i,o){var u=n.updateQueue;if(u===null)return null;if(u=u.shared,(Ke&2)!==0){var h=u.pending;return h===null?i.next=i:(i.next=h.next,h.next=i),u.pending=i,i=Ol(n),zg(n,null,o),i}return El(n,u,i,o),Ol(n)}function so(n,i,o){if(i=i.updateQueue,i!==null&&(i=i.shared,(o&4194048)!==0)){var u=i.lanes;u&=n.pendingLanes,o|=u,i.lanes=o,gl(n,o)}}function Vd(n,i){var o=n.updateQueue,u=n.alternate;if(u!==null&&(u=u.updateQueue,o===u)){var h=null,g=null;if(o=o.firstBaseUpdate,o!==null){do{var S={lane:o.lane,tag:o.tag,payload:o.payload,callback:null,next:null};g===null?h=g=S:g=g.next=S,o=o.next}while(o!==null);g===null?h=g=i:g=g.next=i}else h=g=i;o={baseState:u.baseState,firstBaseUpdate:h,lastBaseUpdate:g,shared:u.shared,callbacks:u.callbacks},n.updateQueue=o;return}n=o.lastBaseUpdate,n===null?o.firstBaseUpdate=i:n.next=i,o.lastBaseUpdate=i}var Qd=!1;function io(){if(Qd){var n=Ka;if(n!==null)throw n}}function ao(n,i,o,u){Qd=!1;var h=n.updateQueue;si=!1;var g=h.firstBaseUpdate,S=h.lastBaseUpdate,k=h.shared.pending;if(k!==null){h.shared.pending=null;var A=k,q=A.next;A.next=null,S===null?g=q:S.next=q,S=A;var V=n.alternate;V!==null&&(V=V.updateQueue,k=V.lastBaseUpdate,k!==S&&(k===null?V.firstBaseUpdate=q:k.next=q,V.lastBaseUpdate=A))}if(g!==null){var J=h.baseState;S=0,V=q=A=null,k=g;do{var F=k.lane&-536870913,K=F!==k.lane;if(K?(Be&F)===F:(u&F)===F){F!==0&&F===Ga&&(Qd=!0),V!==null&&(V=V.next={lane:0,tag:k.tag,payload:k.payload,callback:null,next:null});e:{var ye=n,Ce=k;F=i;var it=o;switch(Ce.tag){case 1:if(ye=Ce.payload,typeof ye=="function"){J=ye.call(it,J,F);break e}J=ye;break e;case 3:ye.flags=ye.flags&-65537|128;case 0:if(ye=Ce.payload,F=typeof ye=="function"?ye.call(it,J,F):ye,F==null)break e;J=y({},J,F);break e;case 2:si=!0}}F=k.callback,F!==null&&(n.flags|=64,K&&(n.flags|=8192),K=h.callbacks,K===null?h.callbacks=[F]:K.push(F))}else K={lane:F,tag:k.tag,payload:k.payload,callback:k.callback,next:null},V===null?(q=V=K,A=J):V=V.next=K,S|=F;if(k=k.next,k===null){if(k=h.shared.pending,k===null)break;K=k,k=K.next,K.next=null,h.lastBaseUpdate=K,h.shared.pending=null}}while(!0);V===null&&(A=J),h.baseState=A,h.firstBaseUpdate=q,h.lastBaseUpdate=V,g===null&&(h.shared.lanes=0),ui|=S,n.lanes=S,n.memoizedState=J}}function Gg(n,i){if(typeof n!="function")throw Error(a(191,n));n.call(i)}function Kg(n,i){var o=n.callbacks;if(o!==null)for(n.callbacks=null,n=0;n<o.length;n++)Gg(o[n],i)}var Ya=D(null),Il=D(0);function Vg(n,i){n=Us,ne(Il,n),ne(Ya,i),Us=n|i.baseLanes}function Yd(){ne(Il,Us),ne(Ya,Ya.current)}function Xd(){Us=Il.current,G(Ya),G(Il)}var Cn=D(null),Pn=null;function ri(n){var i=n.alternate;ne(Et,Et.current&1),ne(Cn,n),Pn===null&&(i===null||Ya.current!==null||i.memoizedState!==null)&&(Pn=n)}function Jd(n){ne(Et,Et.current),ne(Cn,n),Pn===null&&(Pn=n)}function Qg(n){n.tag===22?(ne(Et,Et.current),ne(Cn,n),Pn===null&&(Pn=n)):oi()}function oi(){ne(Et,Et.current),ne(Cn,Cn.current)}function kn(n){G(Cn),Pn===n&&(Pn=null),G(Et)}var Et=D(0);function Bl(n){for(var i=n;i!==null;){if(i.tag===13){var o=i.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||ah(o)||rh(o)))return i}else if(i.tag===19&&(i.memoizedProps.revealOrder==="forwards"||i.memoizedProps.revealOrder==="backwards"||i.memoizedProps.revealOrder==="unstable_legacy-backwards"||i.memoizedProps.revealOrder==="together")){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===n)break;for(;i.sibling===null;){if(i.return===null||i.return===n)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var Es=0,Re=null,nt=null,Ut=null,ql=!1,Xa=!1,na=!1,Hl=0,ro=0,Ja=null,PN=0;function jt(){throw Error(a(321))}function Wd(n,i){if(i===null)return!1;for(var o=0;o<i.length&&o<n.length;o++)if(!Nn(n[o],i[o]))return!1;return!0}function ef(n,i,o,u,h,g){return Es=g,Re=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,H.H=n===null||n.memoizedState===null?Ay:gf,na=!1,g=o(u,h),na=!1,Xa&&(g=Xg(i,o,u,h)),Yg(n),g}function Yg(n){H.H=co;var i=nt!==null&&nt.next!==null;if(Es=0,Ut=nt=Re=null,ql=!1,ro=0,Ja=null,i)throw Error(a(300));n===null||$t||(n=n.dependencies,n!==null&&Tl(n)&&($t=!0))}function Xg(n,i,o,u){Re=n;var h=0;do{if(Xa&&(Ja=null),ro=0,Xa=!1,25<=h)throw Error(a(301));if(h+=1,Ut=nt=null,n.updateQueue!=null){var g=n.updateQueue;g.lastEffect=null,g.events=null,g.stores=null,g.memoCache!=null&&(g.memoCache.index=0)}H.H=Ty,g=i(o,u)}while(Xa);return g}function IN(){var n=H.H,i=n.useState()[0];return i=typeof i.then=="function"?oo(i):i,n=n.useState()[0],(nt!==null?nt.memoizedState:null)!==n&&(Re.flags|=1024),i}function tf(){var n=Hl!==0;return Hl=0,n}function nf(n,i,o){i.updateQueue=n.updateQueue,i.flags&=-2053,n.lanes&=~o}function sf(n){if(ql){for(n=n.memoizedState;n!==null;){var i=n.queue;i!==null&&(i.pending=null),n=n.next}ql=!1}Es=0,Ut=nt=Re=null,Xa=!1,ro=Hl=0,Ja=null}function rn(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ut===null?Re.memoizedState=Ut=n:Ut=Ut.next=n,Ut}function Ot(){if(nt===null){var n=Re.alternate;n=n!==null?n.memoizedState:null}else n=nt.next;var i=Ut===null?Re.memoizedState:Ut.next;if(i!==null)Ut=i,nt=n;else{if(n===null)throw Re.alternate===null?Error(a(467)):Error(a(310));nt=n,n={memoizedState:nt.memoizedState,baseState:nt.baseState,baseQueue:nt.baseQueue,queue:nt.queue,next:null},Ut===null?Re.memoizedState=Ut=n:Ut=Ut.next=n}return Ut}function Zl(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function oo(n){var i=ro;return ro+=1,Ja===null&&(Ja=[]),n=Bg(Ja,n,i),i=Re,(Ut===null?i.memoizedState:Ut.next)===null&&(i=i.alternate,H.H=i===null||i.memoizedState===null?Ay:gf),n}function Fl(n){if(n!==null&&typeof n=="object"){if(typeof n.then=="function")return oo(n);if(n.$$typeof===O)return Qt(n)}throw Error(a(438,String(n)))}function af(n){var i=null,o=Re.updateQueue;if(o!==null&&(i=o.memoCache),i==null){var u=Re.alternate;u!==null&&(u=u.updateQueue,u!==null&&(u=u.memoCache,u!=null&&(i={data:u.data.map(function(h){return h.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),o===null&&(o=Zl(),Re.updateQueue=o),o.memoCache=i,o=i.data[i.index],o===void 0)for(o=i.data[i.index]=Array(n),u=0;u<n;u++)o[u]=ie;return i.index++,o}function Os(n,i){return typeof i=="function"?i(n):i}function Gl(n){var i=Ot();return rf(i,nt,n)}function rf(n,i,o){var u=n.queue;if(u===null)throw Error(a(311));u.lastRenderedReducer=o;var h=n.baseQueue,g=u.pending;if(g!==null){if(h!==null){var S=h.next;h.next=g.next,g.next=S}i.baseQueue=h=g,u.pending=null}if(g=n.baseState,h===null)n.memoizedState=g;else{i=h.next;var k=S=null,A=null,q=i,V=!1;do{var J=q.lane&-536870913;if(J!==q.lane?(Be&J)===J:(Es&J)===J){var F=q.revertLane;if(F===0)A!==null&&(A=A.next={lane:0,revertLane:0,gesture:null,action:q.action,hasEagerState:q.hasEagerState,eagerState:q.eagerState,next:null}),J===Ga&&(V=!0);else if((Es&F)===F){q=q.next,F===Ga&&(V=!0);continue}else J={lane:0,revertLane:q.revertLane,gesture:null,action:q.action,hasEagerState:q.hasEagerState,eagerState:q.eagerState,next:null},A===null?(k=A=J,S=g):A=A.next=J,Re.lanes|=F,ui|=F;J=q.action,na&&o(g,J),g=q.hasEagerState?q.eagerState:o(g,J)}else F={lane:J,revertLane:q.revertLane,gesture:q.gesture,action:q.action,hasEagerState:q.hasEagerState,eagerState:q.eagerState,next:null},A===null?(k=A=F,S=g):A=A.next=F,Re.lanes|=J,ui|=J;q=q.next}while(q!==null&&q!==i);if(A===null?S=g:A.next=k,!Nn(g,n.memoizedState)&&($t=!0,V&&(o=Ka,o!==null)))throw o;n.memoizedState=g,n.baseState=S,n.baseQueue=A,u.lastRenderedState=g}return h===null&&(u.lanes=0),[n.memoizedState,u.dispatch]}function of(n){var i=Ot(),o=i.queue;if(o===null)throw Error(a(311));o.lastRenderedReducer=n;var u=o.dispatch,h=o.pending,g=i.memoizedState;if(h!==null){o.pending=null;var S=h=h.next;do g=n(g,S.action),S=S.next;while(S!==h);Nn(g,i.memoizedState)||($t=!0),i.memoizedState=g,i.baseQueue===null&&(i.baseState=g),o.lastRenderedState=g}return[g,u]}function Jg(n,i,o){var u=Re,h=Ot(),g=He;if(g){if(o===void 0)throw Error(a(407));o=o()}else o=i();var S=!Nn((nt||h).memoizedState,o);if(S&&(h.memoizedState=o,$t=!0),h=h.queue,uf(ty.bind(null,u,h,n),[n]),h.getSnapshot!==i||S||Ut!==null&&Ut.memoizedState.tag&1){if(u.flags|=2048,Wa(9,{destroy:void 0},ey.bind(null,u,h,o,i),null),at===null)throw Error(a(349));g||(Es&127)!==0||Wg(u,i,o)}return o}function Wg(n,i,o){n.flags|=16384,n={getSnapshot:i,value:o},i=Re.updateQueue,i===null?(i=Zl(),Re.updateQueue=i,i.stores=[n]):(o=i.stores,o===null?i.stores=[n]:o.push(n))}function ey(n,i,o,u){i.value=o,i.getSnapshot=u,ny(i)&&sy(n)}function ty(n,i,o){return o(function(){ny(i)&&sy(n)})}function ny(n){var i=n.getSnapshot;n=n.value;try{var o=i();return!Nn(n,o)}catch{return!0}}function sy(n){var i=Ki(n,2);i!==null&&yn(i,n,2)}function lf(n){var i=rn();if(typeof n=="function"){var o=n;if(n=o(),na){wn(!0);try{o()}finally{wn(!1)}}}return i.memoizedState=i.baseState=n,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Os,lastRenderedState:n},i}function iy(n,i,o,u){return n.baseState=o,rf(n,nt,typeof u=="function"?u:Os)}function BN(n,i,o,u,h){if(Ql(n))throw Error(a(485));if(n=i.action,n!==null){var g={payload:h,action:n,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(S){g.listeners.push(S)}};H.T!==null?o(!0):g.isTransition=!1,u(g),o=i.pending,o===null?(g.next=i.pending=g,ay(i,g)):(g.next=o.next,i.pending=o.next=g)}}function ay(n,i){var o=i.action,u=i.payload,h=n.state;if(i.isTransition){var g=H.T,S={};H.T=S;try{var k=o(h,u),A=H.S;A!==null&&A(S,k),ry(n,i,k)}catch(q){cf(n,i,q)}finally{g!==null&&S.types!==null&&(g.types=S.types),H.T=g}}else try{g=o(h,u),ry(n,i,g)}catch(q){cf(n,i,q)}}function ry(n,i,o){o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(function(u){oy(n,i,u)},function(u){return cf(n,i,u)}):oy(n,i,o)}function oy(n,i,o){i.status="fulfilled",i.value=o,ly(i),n.state=o,i=n.pending,i!==null&&(o=i.next,o===i?n.pending=null:(o=o.next,i.next=o,ay(n,o)))}function cf(n,i,o){var u=n.pending;if(n.pending=null,u!==null){u=u.next;do i.status="rejected",i.reason=o,ly(i),i=i.next;while(i!==u)}n.action=null}function ly(n){n=n.listeners;for(var i=0;i<n.length;i++)(0,n[i])()}function cy(n,i){return i}function uy(n,i){if(He){var o=at.formState;if(o!==null){e:{var u=Re;if(He){if(ct){t:{for(var h=ct,g=$n;h.nodeType!==8;){if(!g){h=null;break t}if(h=In(h.nextSibling),h===null){h=null;break t}}g=h.data,h=g==="F!"||g==="F"?h:null}if(h){ct=In(h.nextSibling),u=h.data==="F!";break e}}ti(u)}u=!1}u&&(i=o[0])}}return o=rn(),o.memoizedState=o.baseState=i,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:cy,lastRenderedState:i},o.queue=u,o=Ey.bind(null,Re,u),u.dispatch=o,u=lf(!1),g=pf.bind(null,Re,!1,u.queue),u=rn(),h={state:i,dispatch:null,action:n,pending:null},u.queue=h,o=BN.bind(null,Re,h,g,o),h.dispatch=o,u.memoizedState=n,[i,o,!1]}function dy(n){var i=Ot();return fy(i,nt,n)}function fy(n,i,o){if(i=rf(n,i,cy)[0],n=Gl(Os)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var u=oo(i)}catch(S){throw S===Va?Ml:S}else u=i;i=Ot();var h=i.queue,g=h.dispatch;return o!==i.memoizedState&&(Re.flags|=2048,Wa(9,{destroy:void 0},qN.bind(null,h,o),null)),[u,g,n]}function qN(n,i){n.action=i}function hy(n){var i=Ot(),o=nt;if(o!==null)return fy(i,o,n);Ot(),i=i.memoizedState,o=Ot();var u=o.queue.dispatch;return o.memoizedState=n,[i,u,!1]}function Wa(n,i,o,u){return n={tag:n,create:o,deps:u,inst:i,next:null},i=Re.updateQueue,i===null&&(i=Zl(),Re.updateQueue=i),o=i.lastEffect,o===null?i.lastEffect=n.next=n:(u=o.next,o.next=n,n.next=u,i.lastEffect=n),n}function my(){return Ot().memoizedState}function Kl(n,i,o,u){var h=rn();Re.flags|=n,h.memoizedState=Wa(1|i,{destroy:void 0},o,u===void 0?null:u)}function Vl(n,i,o,u){var h=Ot();u=u===void 0?null:u;var g=h.memoizedState.inst;nt!==null&&u!==null&&Wd(u,nt.memoizedState.deps)?h.memoizedState=Wa(i,g,o,u):(Re.flags|=n,h.memoizedState=Wa(1|i,g,o,u))}function py(n,i){Kl(8390656,8,n,i)}function uf(n,i){Vl(2048,8,n,i)}function HN(n){Re.flags|=4;var i=Re.updateQueue;if(i===null)i=Zl(),Re.updateQueue=i,i.events=[n];else{var o=i.events;o===null?i.events=[n]:o.push(n)}}function gy(n){var i=Ot().memoizedState;return HN({ref:i,nextImpl:n}),function(){if((Ke&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}function yy(n,i){return Vl(4,2,n,i)}function vy(n,i){return Vl(4,4,n,i)}function by(n,i){if(typeof i=="function"){n=n();var o=i(n);return function(){typeof o=="function"?o():i(null)}}if(i!=null)return n=n(),i.current=n,function(){i.current=null}}function xy(n,i,o){o=o!=null?o.concat([n]):null,Vl(4,4,by.bind(null,i,n),o)}function df(){}function Sy(n,i){var o=Ot();i=i===void 0?null:i;var u=o.memoizedState;return i!==null&&Wd(i,u[1])?u[0]:(o.memoizedState=[n,i],n)}function wy(n,i){var o=Ot();i=i===void 0?null:i;var u=o.memoizedState;if(i!==null&&Wd(i,u[1]))return u[0];if(u=n(),na){wn(!0);try{n()}finally{wn(!1)}}return o.memoizedState=[u,i],u}function ff(n,i,o){return o===void 0||(Es&1073741824)!==0&&(Be&261930)===0?n.memoizedState=i:(n.memoizedState=o,n=jv(),Re.lanes|=n,ui|=n,o)}function jy(n,i,o,u){return Nn(o,i)?o:Ya.current!==null?(n=ff(n,o,u),Nn(n,i)||($t=!0),n):(Es&42)===0||(Es&1073741824)!==0&&(Be&261930)===0?($t=!0,n.memoizedState=o):(n=jv(),Re.lanes|=n,ui|=n,i)}function Ny(n,i,o,u,h){var g=Z.p;Z.p=g!==0&&8>g?g:8;var S=H.T,k={};H.T=k,pf(n,!1,i,o);try{var A=h(),q=H.S;if(q!==null&&q(k,A),A!==null&&typeof A=="object"&&typeof A.then=="function"){var V=$N(A,u);lo(n,i,V,On(n))}else lo(n,i,u,On(n))}catch(J){lo(n,i,{then:function(){},status:"rejected",reason:J},On())}finally{Z.p=g,S!==null&&k.types!==null&&(S.types=k.types),H.T=S}}function ZN(){}function hf(n,i,o,u){if(n.tag!==5)throw Error(a(476));var h=_y(n).queue;Ny(n,h,i,oe,o===null?ZN:function(){return Cy(n),o(u)})}function _y(n){var i=n.memoizedState;if(i!==null)return i;i={memoizedState:oe,baseState:oe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Os,lastRenderedState:oe},next:null};var o={};return i.next={memoizedState:o,baseState:o,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Os,lastRenderedState:o},next:null},n.memoizedState=i,n=n.alternate,n!==null&&(n.memoizedState=i),i}function Cy(n){var i=_y(n);i.next===null&&(i=n.alternate.memoizedState),lo(n,i.next.queue,{},On())}function mf(){return Qt(Co)}function ky(){return Ot().memoizedState}function zy(){return Ot().memoizedState}function FN(n){for(var i=n.return;i!==null;){switch(i.tag){case 24:case 3:var o=On();n=ii(o);var u=ai(i,n,o);u!==null&&(yn(u,i,o),so(u,i,o)),i={cache:qd()},n.payload=i;return}i=i.return}}function GN(n,i,o){var u=On();o={lane:u,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},Ql(n)?Oy(i,o):(o=Rd(n,i,o,u),o!==null&&(yn(o,n,u),Ry(o,i,u)))}function Ey(n,i,o){var u=On();lo(n,i,o,u)}function lo(n,i,o,u){var h={lane:u,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null};if(Ql(n))Oy(i,h);else{var g=n.alternate;if(n.lanes===0&&(g===null||g.lanes===0)&&(g=i.lastRenderedReducer,g!==null))try{var S=i.lastRenderedState,k=g(S,o);if(h.hasEagerState=!0,h.eagerState=k,Nn(k,S))return El(n,i,h,0),at===null&&zl(),!1}catch{}if(o=Rd(n,i,h,u),o!==null)return yn(o,n,u),Ry(o,i,u),!0}return!1}function pf(n,i,o,u){if(u={lane:2,revertLane:Kf(),gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Ql(n)){if(i)throw Error(a(479))}else i=Rd(n,o,u,2),i!==null&&yn(i,n,2)}function Ql(n){var i=n.alternate;return n===Re||i!==null&&i===Re}function Oy(n,i){Xa=ql=!0;var o=n.pending;o===null?i.next=i:(i.next=o.next,o.next=i),n.pending=i}function Ry(n,i,o){if((o&4194048)!==0){var u=i.lanes;u&=n.pendingLanes,o|=u,i.lanes=o,gl(n,o)}}var co={readContext:Qt,use:Fl,useCallback:jt,useContext:jt,useEffect:jt,useImperativeHandle:jt,useLayoutEffect:jt,useInsertionEffect:jt,useMemo:jt,useReducer:jt,useRef:jt,useState:jt,useDebugValue:jt,useDeferredValue:jt,useTransition:jt,useSyncExternalStore:jt,useId:jt,useHostTransitionStatus:jt,useFormState:jt,useActionState:jt,useOptimistic:jt,useMemoCache:jt,useCacheRefresh:jt};co.useEffectEvent=jt;var Ay={readContext:Qt,use:Fl,useCallback:function(n,i){return rn().memoizedState=[n,i===void 0?null:i],n},useContext:Qt,useEffect:py,useImperativeHandle:function(n,i,o){o=o!=null?o.concat([n]):null,Kl(4194308,4,by.bind(null,i,n),o)},useLayoutEffect:function(n,i){return Kl(4194308,4,n,i)},useInsertionEffect:function(n,i){Kl(4,2,n,i)},useMemo:function(n,i){var o=rn();i=i===void 0?null:i;var u=n();if(na){wn(!0);try{n()}finally{wn(!1)}}return o.memoizedState=[u,i],u},useReducer:function(n,i,o){var u=rn();if(o!==void 0){var h=o(i);if(na){wn(!0);try{o(i)}finally{wn(!1)}}}else h=i;return u.memoizedState=u.baseState=h,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:h},u.queue=n,n=n.dispatch=GN.bind(null,Re,n),[u.memoizedState,n]},useRef:function(n){var i=rn();return n={current:n},i.memoizedState=n},useState:function(n){n=lf(n);var i=n.queue,o=Ey.bind(null,Re,i);return i.dispatch=o,[n.memoizedState,o]},useDebugValue:df,useDeferredValue:function(n,i){var o=rn();return ff(o,n,i)},useTransition:function(){var n=lf(!1);return n=Ny.bind(null,Re,n.queue,!0,!1),rn().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,i,o){var u=Re,h=rn();if(He){if(o===void 0)throw Error(a(407));o=o()}else{if(o=i(),at===null)throw Error(a(349));(Be&127)!==0||Wg(u,i,o)}h.memoizedState=o;var g={value:o,getSnapshot:i};return h.queue=g,py(ty.bind(null,u,g,n),[n]),u.flags|=2048,Wa(9,{destroy:void 0},ey.bind(null,u,g,o,i),null),o},useId:function(){var n=rn(),i=at.identifierPrefix;if(He){var o=hs,u=fs;o=(u&~(1<<32-te(u)-1)).toString(32)+o,i="_"+i+"R_"+o,o=Hl++,0<o&&(i+="H"+o.toString(32)),i+="_"}else o=PN++,i="_"+i+"r_"+o.toString(32)+"_";return n.memoizedState=i},useHostTransitionStatus:mf,useFormState:uy,useActionState:uy,useOptimistic:function(n){var i=rn();i.memoizedState=i.baseState=n;var o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=o,i=pf.bind(null,Re,!0,o),o.dispatch=i,[n,i]},useMemoCache:af,useCacheRefresh:function(){return rn().memoizedState=FN.bind(null,Re)},useEffectEvent:function(n){var i=rn(),o={impl:n};return i.memoizedState=o,function(){if((Ke&2)!==0)throw Error(a(440));return o.impl.apply(void 0,arguments)}}},gf={readContext:Qt,use:Fl,useCallback:Sy,useContext:Qt,useEffect:uf,useImperativeHandle:xy,useInsertionEffect:yy,useLayoutEffect:vy,useMemo:wy,useReducer:Gl,useRef:my,useState:function(){return Gl(Os)},useDebugValue:df,useDeferredValue:function(n,i){var o=Ot();return jy(o,nt.memoizedState,n,i)},useTransition:function(){var n=Gl(Os)[0],i=Ot().memoizedState;return[typeof n=="boolean"?n:oo(n),i]},useSyncExternalStore:Jg,useId:ky,useHostTransitionStatus:mf,useFormState:dy,useActionState:dy,useOptimistic:function(n,i){var o=Ot();return iy(o,nt,n,i)},useMemoCache:af,useCacheRefresh:zy};gf.useEffectEvent=gy;var Ty={readContext:Qt,use:Fl,useCallback:Sy,useContext:Qt,useEffect:uf,useImperativeHandle:xy,useInsertionEffect:yy,useLayoutEffect:vy,useMemo:wy,useReducer:of,useRef:my,useState:function(){return of(Os)},useDebugValue:df,useDeferredValue:function(n,i){var o=Ot();return nt===null?ff(o,n,i):jy(o,nt.memoizedState,n,i)},useTransition:function(){var n=of(Os)[0],i=Ot().memoizedState;return[typeof n=="boolean"?n:oo(n),i]},useSyncExternalStore:Jg,useId:ky,useHostTransitionStatus:mf,useFormState:hy,useActionState:hy,useOptimistic:function(n,i){var o=Ot();return nt!==null?iy(o,nt,n,i):(o.baseState=n,[n,o.queue.dispatch])},useMemoCache:af,useCacheRefresh:zy};Ty.useEffectEvent=gy;function yf(n,i,o,u){i=n.memoizedState,o=o(u,i),o=o==null?i:y({},i,o),n.memoizedState=o,n.lanes===0&&(n.updateQueue.baseState=o)}var vf={enqueueSetState:function(n,i,o){n=n._reactInternals;var u=On(),h=ii(u);h.payload=i,o!=null&&(h.callback=o),i=ai(n,h,u),i!==null&&(yn(i,n,u),so(i,n,u))},enqueueReplaceState:function(n,i,o){n=n._reactInternals;var u=On(),h=ii(u);h.tag=1,h.payload=i,o!=null&&(h.callback=o),i=ai(n,h,u),i!==null&&(yn(i,n,u),so(i,n,u))},enqueueForceUpdate:function(n,i){n=n._reactInternals;var o=On(),u=ii(o);u.tag=2,i!=null&&(u.callback=i),i=ai(n,u,o),i!==null&&(yn(i,n,o),so(i,n,o))}};function Dy(n,i,o,u,h,g,S){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(u,g,S):i.prototype&&i.prototype.isPureReactComponent?!Qr(o,u)||!Qr(h,g):!0}function Ly(n,i,o,u){n=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(o,u),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(o,u),i.state!==n&&vf.enqueueReplaceState(i,i.state,null)}function sa(n,i){var o=i;if("ref"in i){o={};for(var u in i)u!=="ref"&&(o[u]=i[u])}if(n=n.defaultProps){o===i&&(o=y({},o));for(var h in n)o[h]===void 0&&(o[h]=n[h])}return o}function My(n){kl(n)}function Uy(n){console.error(n)}function $y(n){kl(n)}function Yl(n,i){try{var o=n.onUncaughtError;o(i.value,{componentStack:i.stack})}catch(u){setTimeout(function(){throw u})}}function Py(n,i,o){try{var u=n.onCaughtError;u(o.value,{componentStack:o.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(h){setTimeout(function(){throw h})}}function bf(n,i,o){return o=ii(o),o.tag=3,o.payload={element:null},o.callback=function(){Yl(n,i)},o}function Iy(n){return n=ii(n),n.tag=3,n}function By(n,i,o,u){var h=o.type.getDerivedStateFromError;if(typeof h=="function"){var g=u.value;n.payload=function(){return h(g)},n.callback=function(){Py(i,o,u)}}var S=o.stateNode;S!==null&&typeof S.componentDidCatch=="function"&&(n.callback=function(){Py(i,o,u),typeof h!="function"&&(di===null?di=new Set([this]):di.add(this));var k=u.stack;this.componentDidCatch(u.value,{componentStack:k!==null?k:""})})}function KN(n,i,o,u,h){if(o.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){if(i=o.alternate,i!==null&&Fa(i,o,h,!0),o=Cn.current,o!==null){switch(o.tag){case 31:case 13:return Pn===null?lc():o.alternate===null&&Nt===0&&(Nt=3),o.flags&=-257,o.flags|=65536,o.lanes=h,u===Ul?o.flags|=16384:(i=o.updateQueue,i===null?o.updateQueue=new Set([u]):i.add(u),Zf(n,u,h)),!1;case 22:return o.flags|=65536,u===Ul?o.flags|=16384:(i=o.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([u])},o.updateQueue=i):(o=i.retryQueue,o===null?i.retryQueue=new Set([u]):o.add(u)),Zf(n,u,h)),!1}throw Error(a(435,o.tag))}return Zf(n,u,h),lc(),!1}if(He)return i=Cn.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=h,u!==Ud&&(n=Error(a(422),{cause:u}),Jr(Ln(n,o)))):(u!==Ud&&(i=Error(a(423),{cause:u}),Jr(Ln(i,o))),n=n.current.alternate,n.flags|=65536,h&=-h,n.lanes|=h,u=Ln(u,o),h=bf(n.stateNode,u,h),Vd(n,h),Nt!==4&&(Nt=2)),!1;var g=Error(a(520),{cause:u});if(g=Ln(g,o),vo===null?vo=[g]:vo.push(g),Nt!==4&&(Nt=2),i===null)return!0;u=Ln(u,o),o=i;do{switch(o.tag){case 3:return o.flags|=65536,n=h&-h,o.lanes|=n,n=bf(o.stateNode,u,n),Vd(o,n),!1;case 1:if(i=o.type,g=o.stateNode,(o.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(di===null||!di.has(g))))return o.flags|=65536,h&=-h,o.lanes|=h,h=Iy(h),By(h,n,o,u),Vd(o,h),!1}o=o.return}while(o!==null);return!1}var xf=Error(a(461)),$t=!1;function Yt(n,i,o,u){i.child=n===null?Fg(i,null,o,u):ta(i,n.child,o,u)}function qy(n,i,o,u,h){o=o.render;var g=i.ref;if("ref"in u){var S={};for(var k in u)k!=="ref"&&(S[k]=u[k])}else S=u;return Xi(i),u=ef(n,i,o,S,g,h),k=tf(),n!==null&&!$t?(nf(n,i,h),Rs(n,i,h)):(He&&k&&Ld(i),i.flags|=1,Yt(n,i,u,h),i.child)}function Hy(n,i,o,u,h){if(n===null){var g=o.type;return typeof g=="function"&&!Ad(g)&&g.defaultProps===void 0&&o.compare===null?(i.tag=15,i.type=g,Zy(n,i,g,u,h)):(n=Rl(o.type,null,u,i,i.mode,h),n.ref=i.ref,n.return=i,i.child=n)}if(g=n.child,!zf(n,h)){var S=g.memoizedProps;if(o=o.compare,o=o!==null?o:Qr,o(S,u)&&n.ref===i.ref)return Rs(n,i,h)}return i.flags|=1,n=_s(g,u),n.ref=i.ref,n.return=i,i.child=n}function Zy(n,i,o,u,h){if(n!==null){var g=n.memoizedProps;if(Qr(g,u)&&n.ref===i.ref)if($t=!1,i.pendingProps=u=g,zf(n,h))(n.flags&131072)!==0&&($t=!0);else return i.lanes=n.lanes,Rs(n,i,h)}return Sf(n,i,o,u,h)}function Fy(n,i,o,u){var h=u.children,g=n!==null?n.memoizedState:null;if(n===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.mode==="hidden"){if((i.flags&128)!==0){if(g=g!==null?g.baseLanes|o:o,n!==null){for(u=i.child=n.child,h=0;u!==null;)h=h|u.lanes|u.childLanes,u=u.sibling;u=h&~g}else u=0,i.child=null;return Gy(n,i,g,o,u)}if((o&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},n!==null&&Ll(i,g!==null?g.cachePool:null),g!==null?Vg(i,g):Yd(),Qg(i);else return u=i.lanes=536870912,Gy(n,i,g!==null?g.baseLanes|o:o,o,u)}else g!==null?(Ll(i,g.cachePool),Vg(i,g),oi(),i.memoizedState=null):(n!==null&&Ll(i,null),Yd(),oi());return Yt(n,i,h,o),i.child}function uo(n,i){return n!==null&&n.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function Gy(n,i,o,u,h){var g=Zd();return g=g===null?null:{parent:Mt._currentValue,pool:g},i.memoizedState={baseLanes:o,cachePool:g},n!==null&&Ll(i,null),Yd(),Qg(i),n!==null&&Fa(n,i,u,!0),i.childLanes=h,null}function Xl(n,i){return i=Wl({mode:i.mode,children:i.children},n.mode),i.ref=n.ref,n.child=i,i.return=n,i}function Ky(n,i,o){return ta(i,n.child,null,o),n=Xl(i,i.pendingProps),n.flags|=2,kn(i),i.memoizedState=null,n}function VN(n,i,o){var u=i.pendingProps,h=(i.flags&128)!==0;if(i.flags&=-129,n===null){if(He){if(u.mode==="hidden")return n=Xl(i,u),i.lanes=536870912,uo(null,n);if(Jd(i),(n=ct)?(n=a0(n,$n),n=n!==null&&n.data==="&"?n:null,n!==null&&(i.memoizedState={dehydrated:n,treeContext:Ws!==null?{id:fs,overflow:hs}:null,retryLane:536870912,hydrationErrors:null},o=Og(n),o.return=i,i.child=o,Vt=i,ct=null)):n=null,n===null)throw ti(i);return i.lanes=536870912,null}return Xl(i,u)}var g=n.memoizedState;if(g!==null){var S=g.dehydrated;if(Jd(i),h)if(i.flags&256)i.flags&=-257,i=Ky(n,i,o);else if(i.memoizedState!==null)i.child=n.child,i.flags|=128,i=null;else throw Error(a(558));else if($t||Fa(n,i,o,!1),h=(o&n.childLanes)!==0,$t||h){if(u=at,u!==null&&(S=Ir(u,o),S!==0&&S!==g.retryLane))throw g.retryLane=S,Ki(n,S),yn(u,n,S),xf;lc(),i=Ky(n,i,o)}else n=g.treeContext,ct=In(S.nextSibling),Vt=i,He=!0,ei=null,$n=!1,n!==null&&Tg(i,n),i=Xl(i,u),i.flags|=4096;return i}return n=_s(n.child,{mode:u.mode,children:u.children}),n.ref=i.ref,i.child=n,n.return=i,n}function Jl(n,i){var o=i.ref;if(o===null)n!==null&&n.ref!==null&&(i.flags|=4194816);else{if(typeof o!="function"&&typeof o!="object")throw Error(a(284));(n===null||n.ref!==o)&&(i.flags|=4194816)}}function Sf(n,i,o,u,h){return Xi(i),o=ef(n,i,o,u,void 0,h),u=tf(),n!==null&&!$t?(nf(n,i,h),Rs(n,i,h)):(He&&u&&Ld(i),i.flags|=1,Yt(n,i,o,h),i.child)}function Vy(n,i,o,u,h,g){return Xi(i),i.updateQueue=null,o=Xg(i,u,o,h),Yg(n),u=tf(),n!==null&&!$t?(nf(n,i,g),Rs(n,i,g)):(He&&u&&Ld(i),i.flags|=1,Yt(n,i,o,g),i.child)}function Qy(n,i,o,u,h){if(Xi(i),i.stateNode===null){var g=Ba,S=o.contextType;typeof S=="object"&&S!==null&&(g=Qt(S)),g=new o(u,g),i.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,g.updater=vf,i.stateNode=g,g._reactInternals=i,g=i.stateNode,g.props=u,g.state=i.memoizedState,g.refs={},Gd(i),S=o.contextType,g.context=typeof S=="object"&&S!==null?Qt(S):Ba,g.state=i.memoizedState,S=o.getDerivedStateFromProps,typeof S=="function"&&(yf(i,o,S,u),g.state=i.memoizedState),typeof o.getDerivedStateFromProps=="function"||typeof g.getSnapshotBeforeUpdate=="function"||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(S=g.state,typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount(),S!==g.state&&vf.enqueueReplaceState(g,g.state,null),ao(i,u,g,h),io(),g.state=i.memoizedState),typeof g.componentDidMount=="function"&&(i.flags|=4194308),u=!0}else if(n===null){g=i.stateNode;var k=i.memoizedProps,A=sa(o,k);g.props=A;var q=g.context,V=o.contextType;S=Ba,typeof V=="object"&&V!==null&&(S=Qt(V));var J=o.getDerivedStateFromProps;V=typeof J=="function"||typeof g.getSnapshotBeforeUpdate=="function",k=i.pendingProps!==k,V||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(k||q!==S)&&Ly(i,g,u,S),si=!1;var F=i.memoizedState;g.state=F,ao(i,u,g,h),io(),q=i.memoizedState,k||F!==q||si?(typeof J=="function"&&(yf(i,o,J,u),q=i.memoizedState),(A=si||Dy(i,o,A,u,F,q,S))?(V||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount()),typeof g.componentDidMount=="function"&&(i.flags|=4194308)):(typeof g.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=u,i.memoizedState=q),g.props=u,g.state=q,g.context=S,u=A):(typeof g.componentDidMount=="function"&&(i.flags|=4194308),u=!1)}else{g=i.stateNode,Kd(n,i),S=i.memoizedProps,V=sa(o,S),g.props=V,J=i.pendingProps,F=g.context,q=o.contextType,A=Ba,typeof q=="object"&&q!==null&&(A=Qt(q)),k=o.getDerivedStateFromProps,(q=typeof k=="function"||typeof g.getSnapshotBeforeUpdate=="function")||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(S!==J||F!==A)&&Ly(i,g,u,A),si=!1,F=i.memoizedState,g.state=F,ao(i,u,g,h),io();var K=i.memoizedState;S!==J||F!==K||si||n!==null&&n.dependencies!==null&&Tl(n.dependencies)?(typeof k=="function"&&(yf(i,o,k,u),K=i.memoizedState),(V=si||Dy(i,o,V,u,F,K,A)||n!==null&&n.dependencies!==null&&Tl(n.dependencies))?(q||typeof g.UNSAFE_componentWillUpdate!="function"&&typeof g.componentWillUpdate!="function"||(typeof g.componentWillUpdate=="function"&&g.componentWillUpdate(u,K,A),typeof g.UNSAFE_componentWillUpdate=="function"&&g.UNSAFE_componentWillUpdate(u,K,A)),typeof g.componentDidUpdate=="function"&&(i.flags|=4),typeof g.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof g.componentDidUpdate!="function"||S===n.memoizedProps&&F===n.memoizedState||(i.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||S===n.memoizedProps&&F===n.memoizedState||(i.flags|=1024),i.memoizedProps=u,i.memoizedState=K),g.props=u,g.state=K,g.context=A,u=V):(typeof g.componentDidUpdate!="function"||S===n.memoizedProps&&F===n.memoizedState||(i.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||S===n.memoizedProps&&F===n.memoizedState||(i.flags|=1024),u=!1)}return g=u,Jl(n,i),u=(i.flags&128)!==0,g||u?(g=i.stateNode,o=u&&typeof o.getDerivedStateFromError!="function"?null:g.render(),i.flags|=1,n!==null&&u?(i.child=ta(i,n.child,null,h),i.child=ta(i,null,o,h)):Yt(n,i,o,h),i.memoizedState=g.state,n=i.child):n=Rs(n,i,h),n}function Yy(n,i,o,u){return Qi(),i.flags|=256,Yt(n,i,o,u),i.child}var wf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function jf(n){return{baseLanes:n,cachePool:Pg()}}function Nf(n,i,o){return n=n!==null?n.childLanes&~o:0,i&&(n|=En),n}function Xy(n,i,o){var u=i.pendingProps,h=!1,g=(i.flags&128)!==0,S;if((S=g)||(S=n!==null&&n.memoizedState===null?!1:(Et.current&2)!==0),S&&(h=!0,i.flags&=-129),S=(i.flags&32)!==0,i.flags&=-33,n===null){if(He){if(h?ri(i):oi(),(n=ct)?(n=a0(n,$n),n=n!==null&&n.data!=="&"?n:null,n!==null&&(i.memoizedState={dehydrated:n,treeContext:Ws!==null?{id:fs,overflow:hs}:null,retryLane:536870912,hydrationErrors:null},o=Og(n),o.return=i,i.child=o,Vt=i,ct=null)):n=null,n===null)throw ti(i);return rh(n)?i.lanes=32:i.lanes=536870912,null}var k=u.children;return u=u.fallback,h?(oi(),h=i.mode,k=Wl({mode:"hidden",children:k},h),u=Vi(u,h,o,null),k.return=i,u.return=i,k.sibling=u,i.child=k,u=i.child,u.memoizedState=jf(o),u.childLanes=Nf(n,S,o),i.memoizedState=wf,uo(null,u)):(ri(i),_f(i,k))}var A=n.memoizedState;if(A!==null&&(k=A.dehydrated,k!==null)){if(g)i.flags&256?(ri(i),i.flags&=-257,i=Cf(n,i,o)):i.memoizedState!==null?(oi(),i.child=n.child,i.flags|=128,i=null):(oi(),k=u.fallback,h=i.mode,u=Wl({mode:"visible",children:u.children},h),k=Vi(k,h,o,null),k.flags|=2,u.return=i,k.return=i,u.sibling=k,i.child=u,ta(i,n.child,null,o),u=i.child,u.memoizedState=jf(o),u.childLanes=Nf(n,S,o),i.memoizedState=wf,i=uo(null,u));else if(ri(i),rh(k)){if(S=k.nextSibling&&k.nextSibling.dataset,S)var q=S.dgst;S=q,u=Error(a(419)),u.stack="",u.digest=S,Jr({value:u,source:null,stack:null}),i=Cf(n,i,o)}else if($t||Fa(n,i,o,!1),S=(o&n.childLanes)!==0,$t||S){if(S=at,S!==null&&(u=Ir(S,o),u!==0&&u!==A.retryLane))throw A.retryLane=u,Ki(n,u),yn(S,n,u),xf;ah(k)||lc(),i=Cf(n,i,o)}else ah(k)?(i.flags|=192,i.child=n.child,i=null):(n=A.treeContext,ct=In(k.nextSibling),Vt=i,He=!0,ei=null,$n=!1,n!==null&&Tg(i,n),i=_f(i,u.children),i.flags|=4096);return i}return h?(oi(),k=u.fallback,h=i.mode,A=n.child,q=A.sibling,u=_s(A,{mode:"hidden",children:u.children}),u.subtreeFlags=A.subtreeFlags&65011712,q!==null?k=_s(q,k):(k=Vi(k,h,o,null),k.flags|=2),k.return=i,u.return=i,u.sibling=k,i.child=u,uo(null,u),u=i.child,k=n.child.memoizedState,k===null?k=jf(o):(h=k.cachePool,h!==null?(A=Mt._currentValue,h=h.parent!==A?{parent:A,pool:A}:h):h=Pg(),k={baseLanes:k.baseLanes|o,cachePool:h}),u.memoizedState=k,u.childLanes=Nf(n,S,o),i.memoizedState=wf,uo(n.child,u)):(ri(i),o=n.child,n=o.sibling,o=_s(o,{mode:"visible",children:u.children}),o.return=i,o.sibling=null,n!==null&&(S=i.deletions,S===null?(i.deletions=[n],i.flags|=16):S.push(n)),i.child=o,i.memoizedState=null,o)}function _f(n,i){return i=Wl({mode:"visible",children:i},n.mode),i.return=n,n.child=i}function Wl(n,i){return n=_n(22,n,null,i),n.lanes=0,n}function Cf(n,i,o){return ta(i,n.child,null,o),n=_f(i,i.pendingProps.children),n.flags|=2,i.memoizedState=null,n}function Jy(n,i,o){n.lanes|=i;var u=n.alternate;u!==null&&(u.lanes|=i),Id(n.return,i,o)}function kf(n,i,o,u,h,g){var S=n.memoizedState;S===null?n.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:u,tail:o,tailMode:h,treeForkCount:g}:(S.isBackwards=i,S.rendering=null,S.renderingStartTime=0,S.last=u,S.tail=o,S.tailMode=h,S.treeForkCount=g)}function Wy(n,i,o){var u=i.pendingProps,h=u.revealOrder,g=u.tail;u=u.children;var S=Et.current,k=(S&2)!==0;if(k?(S=S&1|2,i.flags|=128):S&=1,ne(Et,S),Yt(n,i,u,o),u=He?Xr:0,!k&&n!==null&&(n.flags&128)!==0)e:for(n=i.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&Jy(n,o,i);else if(n.tag===19)Jy(n,o,i);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===i)break e;for(;n.sibling===null;){if(n.return===null||n.return===i)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}switch(h){case"forwards":for(o=i.child,h=null;o!==null;)n=o.alternate,n!==null&&Bl(n)===null&&(h=o),o=o.sibling;o=h,o===null?(h=i.child,i.child=null):(h=o.sibling,o.sibling=null),kf(i,!1,h,o,g,u);break;case"backwards":case"unstable_legacy-backwards":for(o=null,h=i.child,i.child=null;h!==null;){if(n=h.alternate,n!==null&&Bl(n)===null){i.child=h;break}n=h.sibling,h.sibling=o,o=h,h=n}kf(i,!0,o,null,g,u);break;case"together":kf(i,!1,null,null,void 0,u);break;default:i.memoizedState=null}return i.child}function Rs(n,i,o){if(n!==null&&(i.dependencies=n.dependencies),ui|=i.lanes,(o&i.childLanes)===0)if(n!==null){if(Fa(n,i,o,!1),(o&i.childLanes)===0)return null}else return null;if(n!==null&&i.child!==n.child)throw Error(a(153));if(i.child!==null){for(n=i.child,o=_s(n,n.pendingProps),i.child=o,o.return=i;n.sibling!==null;)n=n.sibling,o=o.sibling=_s(n,n.pendingProps),o.return=i;o.sibling=null}return i.child}function zf(n,i){return(n.lanes&i)!==0?!0:(n=n.dependencies,!!(n!==null&&Tl(n)))}function QN(n,i,o){switch(i.tag){case 3:Ze(i,i.stateNode.containerInfo),ni(i,Mt,n.memoizedState.cache),Qi();break;case 27:case 5:Ye(i);break;case 4:Ze(i,i.stateNode.containerInfo);break;case 10:ni(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,Jd(i),null;break;case 13:var u=i.memoizedState;if(u!==null)return u.dehydrated!==null?(ri(i),i.flags|=128,null):(o&i.child.childLanes)!==0?Xy(n,i,o):(ri(i),n=Rs(n,i,o),n!==null?n.sibling:null);ri(i);break;case 19:var h=(n.flags&128)!==0;if(u=(o&i.childLanes)!==0,u||(Fa(n,i,o,!1),u=(o&i.childLanes)!==0),h){if(u)return Wy(n,i,o);i.flags|=128}if(h=i.memoizedState,h!==null&&(h.rendering=null,h.tail=null,h.lastEffect=null),ne(Et,Et.current),u)break;return null;case 22:return i.lanes=0,Fy(n,i,o,i.pendingProps);case 24:ni(i,Mt,n.memoizedState.cache)}return Rs(n,i,o)}function ev(n,i,o){if(n!==null)if(n.memoizedProps!==i.pendingProps)$t=!0;else{if(!zf(n,o)&&(i.flags&128)===0)return $t=!1,QN(n,i,o);$t=(n.flags&131072)!==0}else $t=!1,He&&(i.flags&1048576)!==0&&Ag(i,Xr,i.index);switch(i.lanes=0,i.tag){case 16:e:{var u=i.pendingProps;if(n=Wi(i.elementType),i.type=n,typeof n=="function")Ad(n)?(u=sa(n,u),i.tag=1,i=Qy(null,i,n,u,o)):(i.tag=0,i=Sf(null,i,n,u,o));else{if(n!=null){var h=n.$$typeof;if(h===z){i.tag=11,i=qy(null,i,n,u,o);break e}else if(h===L){i.tag=14,i=Hy(null,i,n,u,o);break e}}throw i=Ee(n)||n,Error(a(306,i,""))}}return i;case 0:return Sf(n,i,i.type,i.pendingProps,o);case 1:return u=i.type,h=sa(u,i.pendingProps),Qy(n,i,u,h,o);case 3:e:{if(Ze(i,i.stateNode.containerInfo),n===null)throw Error(a(387));u=i.pendingProps;var g=i.memoizedState;h=g.element,Kd(n,i),ao(i,u,null,o);var S=i.memoizedState;if(u=S.cache,ni(i,Mt,u),u!==g.cache&&Bd(i,[Mt],o,!0),io(),u=S.element,g.isDehydrated)if(g={element:u,isDehydrated:!1,cache:S.cache},i.updateQueue.baseState=g,i.memoizedState=g,i.flags&256){i=Yy(n,i,u,o);break e}else if(u!==h){h=Ln(Error(a(424)),i),Jr(h),i=Yy(n,i,u,o);break e}else for(n=i.stateNode.containerInfo,n.nodeType===9?n=n.body:n=n.nodeName==="HTML"?n.ownerDocument.body:n,ct=In(n.firstChild),Vt=i,He=!0,ei=null,$n=!0,o=Fg(i,null,u,o),i.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling;else{if(Qi(),u===h){i=Rs(n,i,o);break e}Yt(n,i,u,o)}i=i.child}return i;case 26:return Jl(n,i),n===null?(o=d0(i.type,null,i.pendingProps,null))?i.memoizedState=o:He||(o=i.type,n=i.pendingProps,u=pc(he.current).createElement(o),u[zt]=i,u[wt]=n,Xt(u,o,n),Lt(u),i.stateNode=u):i.memoizedState=d0(i.type,n.memoizedProps,i.pendingProps,n.memoizedState),null;case 27:return Ye(i),n===null&&He&&(u=i.stateNode=l0(i.type,i.pendingProps,he.current),Vt=i,$n=!0,h=ct,pi(i.type)?(oh=h,ct=In(u.firstChild)):ct=h),Yt(n,i,i.pendingProps.children,o),Jl(n,i),n===null&&(i.flags|=4194304),i.child;case 5:return n===null&&He&&((h=u=ct)&&(u=__(u,i.type,i.pendingProps,$n),u!==null?(i.stateNode=u,Vt=i,ct=In(u.firstChild),$n=!1,h=!0):h=!1),h||ti(i)),Ye(i),h=i.type,g=i.pendingProps,S=n!==null?n.memoizedProps:null,u=g.children,nh(h,g)?u=null:S!==null&&nh(h,S)&&(i.flags|=32),i.memoizedState!==null&&(h=ef(n,i,IN,null,null,o),Co._currentValue=h),Jl(n,i),Yt(n,i,u,o),i.child;case 6:return n===null&&He&&((n=o=ct)&&(o=C_(o,i.pendingProps,$n),o!==null?(i.stateNode=o,Vt=i,ct=null,n=!0):n=!1),n||ti(i)),null;case 13:return Xy(n,i,o);case 4:return Ze(i,i.stateNode.containerInfo),u=i.pendingProps,n===null?i.child=ta(i,null,u,o):Yt(n,i,u,o),i.child;case 11:return qy(n,i,i.type,i.pendingProps,o);case 7:return Yt(n,i,i.pendingProps,o),i.child;case 8:return Yt(n,i,i.pendingProps.children,o),i.child;case 12:return Yt(n,i,i.pendingProps.children,o),i.child;case 10:return u=i.pendingProps,ni(i,i.type,u.value),Yt(n,i,u.children,o),i.child;case 9:return h=i.type._context,u=i.pendingProps.children,Xi(i),h=Qt(h),u=u(h),i.flags|=1,Yt(n,i,u,o),i.child;case 14:return Hy(n,i,i.type,i.pendingProps,o);case 15:return Zy(n,i,i.type,i.pendingProps,o);case 19:return Wy(n,i,o);case 31:return VN(n,i,o);case 22:return Fy(n,i,o,i.pendingProps);case 24:return Xi(i),u=Qt(Mt),n===null?(h=Zd(),h===null&&(h=at,g=qd(),h.pooledCache=g,g.refCount++,g!==null&&(h.pooledCacheLanes|=o),h=g),i.memoizedState={parent:u,cache:h},Gd(i),ni(i,Mt,h)):((n.lanes&o)!==0&&(Kd(n,i),ao(i,null,null,o),io()),h=n.memoizedState,g=i.memoizedState,h.parent!==u?(h={parent:u,cache:u},i.memoizedState=h,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=h),ni(i,Mt,u)):(u=g.cache,ni(i,Mt,u),u!==h.cache&&Bd(i,[Mt],o,!0))),Yt(n,i,i.pendingProps.children,o),i.child;case 29:throw i.pendingProps}throw Error(a(156,i.tag))}function As(n){n.flags|=4}function Ef(n,i,o,u,h){if((i=(n.mode&32)!==0)&&(i=!1),i){if(n.flags|=16777216,(h&335544128)===h)if(n.stateNode.complete)n.flags|=8192;else if(kv())n.flags|=8192;else throw ea=Ul,Fd}else n.flags&=-16777217}function tv(n,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)n.flags&=-16777217;else if(n.flags|=16777216,!g0(i))if(kv())n.flags|=8192;else throw ea=Ul,Fd}function ec(n,i){i!==null&&(n.flags|=4),n.flags&16384&&(i=n.tag!==22?ml():536870912,n.lanes|=i,sr|=i)}function fo(n,i){if(!He)switch(n.tailMode){case"hidden":i=n.tail;for(var o=null;i!==null;)i.alternate!==null&&(o=i),i=i.sibling;o===null?n.tail=null:o.sibling=null;break;case"collapsed":o=n.tail;for(var u=null;o!==null;)o.alternate!==null&&(u=o),o=o.sibling;u===null?i||n.tail===null?n.tail=null:n.tail.sibling=null:u.sibling=null}}function ut(n){var i=n.alternate!==null&&n.alternate.child===n.child,o=0,u=0;if(i)for(var h=n.child;h!==null;)o|=h.lanes|h.childLanes,u|=h.subtreeFlags&65011712,u|=h.flags&65011712,h.return=n,h=h.sibling;else for(h=n.child;h!==null;)o|=h.lanes|h.childLanes,u|=h.subtreeFlags,u|=h.flags,h.return=n,h=h.sibling;return n.subtreeFlags|=u,n.childLanes=o,i}function YN(n,i,o){var u=i.pendingProps;switch(Md(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ut(i),null;case 1:return ut(i),null;case 3:return o=i.stateNode,u=null,n!==null&&(u=n.memoizedState.cache),i.memoizedState.cache!==u&&(i.flags|=2048),zs(Mt),ge(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),(n===null||n.child===null)&&(Za(i)?As(i):n===null||n.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,$d())),ut(i),null;case 26:var h=i.type,g=i.memoizedState;return n===null?(As(i),g!==null?(ut(i),tv(i,g)):(ut(i),Ef(i,h,null,u,o))):g?g!==n.memoizedState?(As(i),ut(i),tv(i,g)):(ut(i),i.flags&=-16777217):(n=n.memoizedProps,n!==u&&As(i),ut(i),Ef(i,h,n,u,o)),null;case 27:if(ft(i),o=he.current,h=i.type,n!==null&&i.stateNode!=null)n.memoizedProps!==u&&As(i);else{if(!u){if(i.stateNode===null)throw Error(a(166));return ut(i),null}n=ae.current,Za(i)?Dg(i):(n=l0(h,u,o),i.stateNode=n,As(i))}return ut(i),null;case 5:if(ft(i),h=i.type,n!==null&&i.stateNode!=null)n.memoizedProps!==u&&As(i);else{if(!u){if(i.stateNode===null)throw Error(a(166));return ut(i),null}if(g=ae.current,Za(i))Dg(i);else{var S=pc(he.current);switch(g){case 1:g=S.createElementNS("http://www.w3.org/2000/svg",h);break;case 2:g=S.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;default:switch(h){case"svg":g=S.createElementNS("http://www.w3.org/2000/svg",h);break;case"math":g=S.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;case"script":g=S.createElement("div"),g.innerHTML="<script><\/script>",g=g.removeChild(g.firstChild);break;case"select":g=typeof u.is=="string"?S.createElement("select",{is:u.is}):S.createElement("select"),u.multiple?g.multiple=!0:u.size&&(g.size=u.size);break;default:g=typeof u.is=="string"?S.createElement(h,{is:u.is}):S.createElement(h)}}g[zt]=i,g[wt]=u;e:for(S=i.child;S!==null;){if(S.tag===5||S.tag===6)g.appendChild(S.stateNode);else if(S.tag!==4&&S.tag!==27&&S.child!==null){S.child.return=S,S=S.child;continue}if(S===i)break e;for(;S.sibling===null;){if(S.return===null||S.return===i)break e;S=S.return}S.sibling.return=S.return,S=S.sibling}i.stateNode=g;e:switch(Xt(g,h,u),h){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break e;case"img":u=!0;break e;default:u=!1}u&&As(i)}}return ut(i),Ef(i,i.type,n===null?null:n.memoizedProps,i.pendingProps,o),null;case 6:if(n&&i.stateNode!=null)n.memoizedProps!==u&&As(i);else{if(typeof u!="string"&&i.stateNode===null)throw Error(a(166));if(n=he.current,Za(i)){if(n=i.stateNode,o=i.memoizedProps,u=null,h=Vt,h!==null)switch(h.tag){case 27:case 5:u=h.memoizedProps}n[zt]=i,n=!!(n.nodeValue===o||u!==null&&u.suppressHydrationWarning===!0||Xv(n.nodeValue,o)),n||ti(i,!0)}else n=pc(n).createTextNode(u),n[zt]=i,i.stateNode=n}return ut(i),null;case 31:if(o=i.memoizedState,n===null||n.memoizedState!==null){if(u=Za(i),o!==null){if(n===null){if(!u)throw Error(a(318));if(n=i.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(a(557));n[zt]=i}else Qi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;ut(i),n=!1}else o=$d(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=o),n=!0;if(!n)return i.flags&256?(kn(i),i):(kn(i),null);if((i.flags&128)!==0)throw Error(a(558))}return ut(i),null;case 13:if(u=i.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(h=Za(i),u!==null&&u.dehydrated!==null){if(n===null){if(!h)throw Error(a(318));if(h=i.memoizedState,h=h!==null?h.dehydrated:null,!h)throw Error(a(317));h[zt]=i}else Qi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;ut(i),h=!1}else h=$d(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=h),h=!0;if(!h)return i.flags&256?(kn(i),i):(kn(i),null)}return kn(i),(i.flags&128)!==0?(i.lanes=o,i):(o=u!==null,n=n!==null&&n.memoizedState!==null,o&&(u=i.child,h=null,u.alternate!==null&&u.alternate.memoizedState!==null&&u.alternate.memoizedState.cachePool!==null&&(h=u.alternate.memoizedState.cachePool.pool),g=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(g=u.memoizedState.cachePool.pool),g!==h&&(u.flags|=2048)),o!==n&&o&&(i.child.flags|=8192),ec(i,i.updateQueue),ut(i),null);case 4:return ge(),n===null&&Xf(i.stateNode.containerInfo),ut(i),null;case 10:return zs(i.type),ut(i),null;case 19:if(G(Et),u=i.memoizedState,u===null)return ut(i),null;if(h=(i.flags&128)!==0,g=u.rendering,g===null)if(h)fo(u,!1);else{if(Nt!==0||n!==null&&(n.flags&128)!==0)for(n=i.child;n!==null;){if(g=Bl(n),g!==null){for(i.flags|=128,fo(u,!1),n=g.updateQueue,i.updateQueue=n,ec(i,n),i.subtreeFlags=0,n=o,o=i.child;o!==null;)Eg(o,n),o=o.sibling;return ne(Et,Et.current&1|2),He&&Cs(i,u.treeForkCount),i.child}n=n.sibling}u.tail!==null&&$e()>ac&&(i.flags|=128,h=!0,fo(u,!1),i.lanes=4194304)}else{if(!h)if(n=Bl(g),n!==null){if(i.flags|=128,h=!0,n=n.updateQueue,i.updateQueue=n,ec(i,n),fo(u,!0),u.tail===null&&u.tailMode==="hidden"&&!g.alternate&&!He)return ut(i),null}else 2*$e()-u.renderingStartTime>ac&&o!==536870912&&(i.flags|=128,h=!0,fo(u,!1),i.lanes=4194304);u.isBackwards?(g.sibling=i.child,i.child=g):(n=u.last,n!==null?n.sibling=g:i.child=g,u.last=g)}return u.tail!==null?(n=u.tail,u.rendering=n,u.tail=n.sibling,u.renderingStartTime=$e(),n.sibling=null,o=Et.current,ne(Et,h?o&1|2:o&1),He&&Cs(i,u.treeForkCount),n):(ut(i),null);case 22:case 23:return kn(i),Xd(),u=i.memoizedState!==null,n!==null?n.memoizedState!==null!==u&&(i.flags|=8192):u&&(i.flags|=8192),u?(o&536870912)!==0&&(i.flags&128)===0&&(ut(i),i.subtreeFlags&6&&(i.flags|=8192)):ut(i),o=i.updateQueue,o!==null&&ec(i,o.retryQueue),o=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(o=n.memoizedState.cachePool.pool),u=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(u=i.memoizedState.cachePool.pool),u!==o&&(i.flags|=2048),n!==null&&G(Ji),null;case 24:return o=null,n!==null&&(o=n.memoizedState.cache),i.memoizedState.cache!==o&&(i.flags|=2048),zs(Mt),ut(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function XN(n,i){switch(Md(i),i.tag){case 1:return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 3:return zs(Mt),ge(),n=i.flags,(n&65536)!==0&&(n&128)===0?(i.flags=n&-65537|128,i):null;case 26:case 27:case 5:return ft(i),null;case 31:if(i.memoizedState!==null){if(kn(i),i.alternate===null)throw Error(a(340));Qi()}return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 13:if(kn(i),n=i.memoizedState,n!==null&&n.dehydrated!==null){if(i.alternate===null)throw Error(a(340));Qi()}return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 19:return G(Et),null;case 4:return ge(),null;case 10:return zs(i.type),null;case 22:case 23:return kn(i),Xd(),n!==null&&G(Ji),n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 24:return zs(Mt),null;case 25:return null;default:return null}}function nv(n,i){switch(Md(i),i.tag){case 3:zs(Mt),ge();break;case 26:case 27:case 5:ft(i);break;case 4:ge();break;case 31:i.memoizedState!==null&&kn(i);break;case 13:kn(i);break;case 19:G(Et);break;case 10:zs(i.type);break;case 22:case 23:kn(i),Xd(),n!==null&&G(Ji);break;case 24:zs(Mt)}}function ho(n,i){try{var o=i.updateQueue,u=o!==null?o.lastEffect:null;if(u!==null){var h=u.next;o=h;do{if((o.tag&n)===n){u=void 0;var g=o.create,S=o.inst;u=g(),S.destroy=u}o=o.next}while(o!==h)}}catch(k){Je(i,i.return,k)}}function li(n,i,o){try{var u=i.updateQueue,h=u!==null?u.lastEffect:null;if(h!==null){var g=h.next;u=g;do{if((u.tag&n)===n){var S=u.inst,k=S.destroy;if(k!==void 0){S.destroy=void 0,h=i;var A=o,q=k;try{q()}catch(V){Je(h,A,V)}}}u=u.next}while(u!==g)}}catch(V){Je(i,i.return,V)}}function sv(n){var i=n.updateQueue;if(i!==null){var o=n.stateNode;try{Kg(i,o)}catch(u){Je(n,n.return,u)}}}function iv(n,i,o){o.props=sa(n.type,n.memoizedProps),o.state=n.memoizedState;try{o.componentWillUnmount()}catch(u){Je(n,i,u)}}function mo(n,i){try{var o=n.ref;if(o!==null){switch(n.tag){case 26:case 27:case 5:var u=n.stateNode;break;case 30:u=n.stateNode;break;default:u=n.stateNode}typeof o=="function"?n.refCleanup=o(u):o.current=u}}catch(h){Je(n,i,h)}}function ms(n,i){var o=n.ref,u=n.refCleanup;if(o!==null)if(typeof u=="function")try{u()}catch(h){Je(n,i,h)}finally{n.refCleanup=null,n=n.alternate,n!=null&&(n.refCleanup=null)}else if(typeof o=="function")try{o(null)}catch(h){Je(n,i,h)}else o.current=null}function av(n){var i=n.type,o=n.memoizedProps,u=n.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":o.autoFocus&&u.focus();break e;case"img":o.src?u.src=o.src:o.srcSet&&(u.srcset=o.srcSet)}}catch(h){Je(n,n.return,h)}}function Of(n,i,o){try{var u=n.stateNode;b_(u,n.type,o,i),u[wt]=i}catch(h){Je(n,n.return,h)}}function rv(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&pi(n.type)||n.tag===4}function Rf(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||rv(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.tag===27&&pi(n.type)||n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function Af(n,i,o){var u=n.tag;if(u===5||u===6)n=n.stateNode,i?(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o).insertBefore(n,i):(i=o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,i.appendChild(n),o=o._reactRootContainer,o!=null||i.onclick!==null||(i.onclick=js));else if(u!==4&&(u===27&&pi(n.type)&&(o=n.stateNode,i=null),n=n.child,n!==null))for(Af(n,i,o),n=n.sibling;n!==null;)Af(n,i,o),n=n.sibling}function tc(n,i,o){var u=n.tag;if(u===5||u===6)n=n.stateNode,i?o.insertBefore(n,i):o.appendChild(n);else if(u!==4&&(u===27&&pi(n.type)&&(o=n.stateNode),n=n.child,n!==null))for(tc(n,i,o),n=n.sibling;n!==null;)tc(n,i,o),n=n.sibling}function ov(n){var i=n.stateNode,o=n.memoizedProps;try{for(var u=n.type,h=i.attributes;h.length;)i.removeAttributeNode(h[0]);Xt(i,u,o),i[zt]=n,i[wt]=o}catch(g){Je(n,n.return,g)}}var Ts=!1,Pt=!1,Tf=!1,lv=typeof WeakSet=="function"?WeakSet:Set,Ft=null;function JN(n,i){if(n=n.containerInfo,eh=wc,n=xg(n),_d(n)){if("selectionStart"in n)var o={start:n.selectionStart,end:n.selectionEnd};else e:{o=(o=n.ownerDocument)&&o.defaultView||window;var u=o.getSelection&&o.getSelection();if(u&&u.rangeCount!==0){o=u.anchorNode;var h=u.anchorOffset,g=u.focusNode;u=u.focusOffset;try{o.nodeType,g.nodeType}catch{o=null;break e}var S=0,k=-1,A=-1,q=0,V=0,J=n,F=null;t:for(;;){for(var K;J!==o||h!==0&&J.nodeType!==3||(k=S+h),J!==g||u!==0&&J.nodeType!==3||(A=S+u),J.nodeType===3&&(S+=J.nodeValue.length),(K=J.firstChild)!==null;)F=J,J=K;for(;;){if(J===n)break t;if(F===o&&++q===h&&(k=S),F===g&&++V===u&&(A=S),(K=J.nextSibling)!==null)break;J=F,F=J.parentNode}J=K}o=k===-1||A===-1?null:{start:k,end:A}}else o=null}o=o||{start:0,end:0}}else o=null;for(th={focusedElem:n,selectionRange:o},wc=!1,Ft=i;Ft!==null;)if(i=Ft,n=i.child,(i.subtreeFlags&1028)!==0&&n!==null)n.return=i,Ft=n;else for(;Ft!==null;){switch(i=Ft,g=i.alternate,n=i.flags,i.tag){case 0:if((n&4)!==0&&(n=i.updateQueue,n=n!==null?n.events:null,n!==null))for(o=0;o<n.length;o++)h=n[o],h.ref.impl=h.nextImpl;break;case 11:case 15:break;case 1:if((n&1024)!==0&&g!==null){n=void 0,o=i,h=g.memoizedProps,g=g.memoizedState,u=o.stateNode;try{var ye=sa(o.type,h);n=u.getSnapshotBeforeUpdate(ye,g),u.__reactInternalSnapshotBeforeUpdate=n}catch(Ce){Je(o,o.return,Ce)}}break;case 3:if((n&1024)!==0){if(n=i.stateNode.containerInfo,o=n.nodeType,o===9)ih(n);else if(o===1)switch(n.nodeName){case"HEAD":case"HTML":case"BODY":ih(n);break;default:n.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((n&1024)!==0)throw Error(a(163))}if(n=i.sibling,n!==null){n.return=i.return,Ft=n;break}Ft=i.return}}function cv(n,i,o){var u=o.flags;switch(o.tag){case 0:case 11:case 15:Ls(n,o),u&4&&ho(5,o);break;case 1:if(Ls(n,o),u&4)if(n=o.stateNode,i===null)try{n.componentDidMount()}catch(S){Je(o,o.return,S)}else{var h=sa(o.type,i.memoizedProps);i=i.memoizedState;try{n.componentDidUpdate(h,i,n.__reactInternalSnapshotBeforeUpdate)}catch(S){Je(o,o.return,S)}}u&64&&sv(o),u&512&&mo(o,o.return);break;case 3:if(Ls(n,o),u&64&&(n=o.updateQueue,n!==null)){if(i=null,o.child!==null)switch(o.child.tag){case 27:case 5:i=o.child.stateNode;break;case 1:i=o.child.stateNode}try{Kg(n,i)}catch(S){Je(o,o.return,S)}}break;case 27:i===null&&u&4&&ov(o);case 26:case 5:Ls(n,o),i===null&&u&4&&av(o),u&512&&mo(o,o.return);break;case 12:Ls(n,o);break;case 31:Ls(n,o),u&4&&fv(n,o);break;case 13:Ls(n,o),u&4&&hv(n,o),u&64&&(n=o.memoizedState,n!==null&&(n=n.dehydrated,n!==null&&(o=o_.bind(null,o),k_(n,o))));break;case 22:if(u=o.memoizedState!==null||Ts,!u){i=i!==null&&i.memoizedState!==null||Pt,h=Ts;var g=Pt;Ts=u,(Pt=i)&&!g?Ms(n,o,(o.subtreeFlags&8772)!==0):Ls(n,o),Ts=h,Pt=g}break;case 30:break;default:Ls(n,o)}}function uv(n){var i=n.alternate;i!==null&&(n.alternate=null,uv(i)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(i=n.stateNode,i!==null&&Ra(i)),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}var ht=null,hn=!1;function Ds(n,i,o){for(o=o.child;o!==null;)dv(n,i,o),o=o.sibling}function dv(n,i,o){if(_e&&typeof _e.onCommitFiberUnmount=="function")try{_e.onCommitFiberUnmount(os,o)}catch{}switch(o.tag){case 26:Pt||ms(o,i),Ds(n,i,o),o.memoizedState?o.memoizedState.count--:o.stateNode&&(o=o.stateNode,o.parentNode.removeChild(o));break;case 27:Pt||ms(o,i);var u=ht,h=hn;pi(o.type)&&(ht=o.stateNode,hn=!1),Ds(n,i,o),jo(o.stateNode),ht=u,hn=h;break;case 5:Pt||ms(o,i);case 6:if(u=ht,h=hn,ht=null,Ds(n,i,o),ht=u,hn=h,ht!==null)if(hn)try{(ht.nodeType===9?ht.body:ht.nodeName==="HTML"?ht.ownerDocument.body:ht).removeChild(o.stateNode)}catch(g){Je(o,i,g)}else try{ht.removeChild(o.stateNode)}catch(g){Je(o,i,g)}break;case 18:ht!==null&&(hn?(n=ht,s0(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,o.stateNode),dr(n)):s0(ht,o.stateNode));break;case 4:u=ht,h=hn,ht=o.stateNode.containerInfo,hn=!0,Ds(n,i,o),ht=u,hn=h;break;case 0:case 11:case 14:case 15:li(2,o,i),Pt||li(4,o,i),Ds(n,i,o);break;case 1:Pt||(ms(o,i),u=o.stateNode,typeof u.componentWillUnmount=="function"&&iv(o,i,u)),Ds(n,i,o);break;case 21:Ds(n,i,o);break;case 22:Pt=(u=Pt)||o.memoizedState!==null,Ds(n,i,o),Pt=u;break;default:Ds(n,i,o)}}function fv(n,i){if(i.memoizedState===null&&(n=i.alternate,n!==null&&(n=n.memoizedState,n!==null))){n=n.dehydrated;try{dr(n)}catch(o){Je(i,i.return,o)}}}function hv(n,i){if(i.memoizedState===null&&(n=i.alternate,n!==null&&(n=n.memoizedState,n!==null&&(n=n.dehydrated,n!==null))))try{dr(n)}catch(o){Je(i,i.return,o)}}function WN(n){switch(n.tag){case 31:case 13:case 19:var i=n.stateNode;return i===null&&(i=n.stateNode=new lv),i;case 22:return n=n.stateNode,i=n._retryCache,i===null&&(i=n._retryCache=new lv),i;default:throw Error(a(435,n.tag))}}function nc(n,i){var o=WN(n);i.forEach(function(u){if(!o.has(u)){o.add(u);var h=l_.bind(null,n,u);u.then(h,h)}})}function mn(n,i){var o=i.deletions;if(o!==null)for(var u=0;u<o.length;u++){var h=o[u],g=n,S=i,k=S;e:for(;k!==null;){switch(k.tag){case 27:if(pi(k.type)){ht=k.stateNode,hn=!1;break e}break;case 5:ht=k.stateNode,hn=!1;break e;case 3:case 4:ht=k.stateNode.containerInfo,hn=!0;break e}k=k.return}if(ht===null)throw Error(a(160));dv(g,S,h),ht=null,hn=!1,g=h.alternate,g!==null&&(g.return=null),h.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)mv(i,n),i=i.sibling}var Jn=null;function mv(n,i){var o=n.alternate,u=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:mn(i,n),pn(n),u&4&&(li(3,n,n.return),ho(3,n),li(5,n,n.return));break;case 1:mn(i,n),pn(n),u&512&&(Pt||o===null||ms(o,o.return)),u&64&&Ts&&(n=n.updateQueue,n!==null&&(u=n.callbacks,u!==null&&(o=n.shared.hiddenCallbacks,n.shared.hiddenCallbacks=o===null?u:o.concat(u))));break;case 26:var h=Jn;if(mn(i,n),pn(n),u&512&&(Pt||o===null||ms(o,o.return)),u&4){var g=o!==null?o.memoizedState:null;if(u=n.memoizedState,o===null)if(u===null)if(n.stateNode===null){e:{u=n.type,o=n.memoizedProps,h=h.ownerDocument||h;t:switch(u){case"title":g=h.getElementsByTagName("title")[0],(!g||g[us]||g[zt]||g.namespaceURI==="http://www.w3.org/2000/svg"||g.hasAttribute("itemprop"))&&(g=h.createElement(u),h.head.insertBefore(g,h.querySelector("head > title"))),Xt(g,u,o),g[zt]=n,Lt(g),u=g;break e;case"link":var S=m0("link","href",h).get(u+(o.href||""));if(S){for(var k=0;k<S.length;k++)if(g=S[k],g.getAttribute("href")===(o.href==null||o.href===""?null:o.href)&&g.getAttribute("rel")===(o.rel==null?null:o.rel)&&g.getAttribute("title")===(o.title==null?null:o.title)&&g.getAttribute("crossorigin")===(o.crossOrigin==null?null:o.crossOrigin)){S.splice(k,1);break t}}g=h.createElement(u),Xt(g,u,o),h.head.appendChild(g);break;case"meta":if(S=m0("meta","content",h).get(u+(o.content||""))){for(k=0;k<S.length;k++)if(g=S[k],g.getAttribute("content")===(o.content==null?null:""+o.content)&&g.getAttribute("name")===(o.name==null?null:o.name)&&g.getAttribute("property")===(o.property==null?null:o.property)&&g.getAttribute("http-equiv")===(o.httpEquiv==null?null:o.httpEquiv)&&g.getAttribute("charset")===(o.charSet==null?null:o.charSet)){S.splice(k,1);break t}}g=h.createElement(u),Xt(g,u,o),h.head.appendChild(g);break;default:throw Error(a(468,u))}g[zt]=n,Lt(g),u=g}n.stateNode=u}else p0(h,n.type,n.stateNode);else n.stateNode=h0(h,u,n.memoizedProps);else g!==u?(g===null?o.stateNode!==null&&(o=o.stateNode,o.parentNode.removeChild(o)):g.count--,u===null?p0(h,n.type,n.stateNode):h0(h,u,n.memoizedProps)):u===null&&n.stateNode!==null&&Of(n,n.memoizedProps,o.memoizedProps)}break;case 27:mn(i,n),pn(n),u&512&&(Pt||o===null||ms(o,o.return)),o!==null&&u&4&&Of(n,n.memoizedProps,o.memoizedProps);break;case 5:if(mn(i,n),pn(n),u&512&&(Pt||o===null||ms(o,o.return)),n.flags&32){h=n.stateNode;try{Da(h,"")}catch(ye){Je(n,n.return,ye)}}u&4&&n.stateNode!=null&&(h=n.memoizedProps,Of(n,h,o!==null?o.memoizedProps:h)),u&1024&&(Tf=!0);break;case 6:if(mn(i,n),pn(n),u&4){if(n.stateNode===null)throw Error(a(162));u=n.memoizedProps,o=n.stateNode;try{o.nodeValue=u}catch(ye){Je(n,n.return,ye)}}break;case 3:if(vc=null,h=Jn,Jn=gc(i.containerInfo),mn(i,n),Jn=h,pn(n),u&4&&o!==null&&o.memoizedState.isDehydrated)try{dr(i.containerInfo)}catch(ye){Je(n,n.return,ye)}Tf&&(Tf=!1,pv(n));break;case 4:u=Jn,Jn=gc(n.stateNode.containerInfo),mn(i,n),pn(n),Jn=u;break;case 12:mn(i,n),pn(n);break;case 31:mn(i,n),pn(n),u&4&&(u=n.updateQueue,u!==null&&(n.updateQueue=null,nc(n,u)));break;case 13:mn(i,n),pn(n),n.child.flags&8192&&n.memoizedState!==null!=(o!==null&&o.memoizedState!==null)&&(ic=$e()),u&4&&(u=n.updateQueue,u!==null&&(n.updateQueue=null,nc(n,u)));break;case 22:h=n.memoizedState!==null;var A=o!==null&&o.memoizedState!==null,q=Ts,V=Pt;if(Ts=q||h,Pt=V||A,mn(i,n),Pt=V,Ts=q,pn(n),u&8192)e:for(i=n.stateNode,i._visibility=h?i._visibility&-2:i._visibility|1,h&&(o===null||A||Ts||Pt||ia(n)),o=null,i=n;;){if(i.tag===5||i.tag===26){if(o===null){A=o=i;try{if(g=A.stateNode,h)S=g.style,typeof S.setProperty=="function"?S.setProperty("display","none","important"):S.display="none";else{k=A.stateNode;var J=A.memoizedProps.style,F=J!=null&&J.hasOwnProperty("display")?J.display:null;k.style.display=F==null||typeof F=="boolean"?"":(""+F).trim()}}catch(ye){Je(A,A.return,ye)}}}else if(i.tag===6){if(o===null){A=i;try{A.stateNode.nodeValue=h?"":A.memoizedProps}catch(ye){Je(A,A.return,ye)}}}else if(i.tag===18){if(o===null){A=i;try{var K=A.stateNode;h?i0(K,!0):i0(A.stateNode,!1)}catch(ye){Je(A,A.return,ye)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===n)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===n)break e;for(;i.sibling===null;){if(i.return===null||i.return===n)break e;o===i&&(o=null),i=i.return}o===i&&(o=null),i.sibling.return=i.return,i=i.sibling}u&4&&(u=n.updateQueue,u!==null&&(o=u.retryQueue,o!==null&&(u.retryQueue=null,nc(n,o))));break;case 19:mn(i,n),pn(n),u&4&&(u=n.updateQueue,u!==null&&(n.updateQueue=null,nc(n,u)));break;case 30:break;case 21:break;default:mn(i,n),pn(n)}}function pn(n){var i=n.flags;if(i&2){try{for(var o,u=n.return;u!==null;){if(rv(u)){o=u;break}u=u.return}if(o==null)throw Error(a(160));switch(o.tag){case 27:var h=o.stateNode,g=Rf(n);tc(n,g,h);break;case 5:var S=o.stateNode;o.flags&32&&(Da(S,""),o.flags&=-33);var k=Rf(n);tc(n,k,S);break;case 3:case 4:var A=o.stateNode.containerInfo,q=Rf(n);Af(n,q,A);break;default:throw Error(a(161))}}catch(V){Je(n,n.return,V)}n.flags&=-3}i&4096&&(n.flags&=-4097)}function pv(n){if(n.subtreeFlags&1024)for(n=n.child;n!==null;){var i=n;pv(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),n=n.sibling}}function Ls(n,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)cv(n,i.alternate,i),i=i.sibling}function ia(n){for(n=n.child;n!==null;){var i=n;switch(i.tag){case 0:case 11:case 14:case 15:li(4,i,i.return),ia(i);break;case 1:ms(i,i.return);var o=i.stateNode;typeof o.componentWillUnmount=="function"&&iv(i,i.return,o),ia(i);break;case 27:jo(i.stateNode);case 26:case 5:ms(i,i.return),ia(i);break;case 22:i.memoizedState===null&&ia(i);break;case 30:ia(i);break;default:ia(i)}n=n.sibling}}function Ms(n,i,o){for(o=o&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var u=i.alternate,h=n,g=i,S=g.flags;switch(g.tag){case 0:case 11:case 15:Ms(h,g,o),ho(4,g);break;case 1:if(Ms(h,g,o),u=g,h=u.stateNode,typeof h.componentDidMount=="function")try{h.componentDidMount()}catch(q){Je(u,u.return,q)}if(u=g,h=u.updateQueue,h!==null){var k=u.stateNode;try{var A=h.shared.hiddenCallbacks;if(A!==null)for(h.shared.hiddenCallbacks=null,h=0;h<A.length;h++)Gg(A[h],k)}catch(q){Je(u,u.return,q)}}o&&S&64&&sv(g),mo(g,g.return);break;case 27:ov(g);case 26:case 5:Ms(h,g,o),o&&u===null&&S&4&&av(g),mo(g,g.return);break;case 12:Ms(h,g,o);break;case 31:Ms(h,g,o),o&&S&4&&fv(h,g);break;case 13:Ms(h,g,o),o&&S&4&&hv(h,g);break;case 22:g.memoizedState===null&&Ms(h,g,o),mo(g,g.return);break;case 30:break;default:Ms(h,g,o)}i=i.sibling}}function Df(n,i){var o=null;n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(o=n.memoizedState.cachePool.pool),n=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(n=i.memoizedState.cachePool.pool),n!==o&&(n!=null&&n.refCount++,o!=null&&Wr(o))}function Lf(n,i){n=null,i.alternate!==null&&(n=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==n&&(i.refCount++,n!=null&&Wr(n))}function Wn(n,i,o,u){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)gv(n,i,o,u),i=i.sibling}function gv(n,i,o,u){var h=i.flags;switch(i.tag){case 0:case 11:case 15:Wn(n,i,o,u),h&2048&&ho(9,i);break;case 1:Wn(n,i,o,u);break;case 3:Wn(n,i,o,u),h&2048&&(n=null,i.alternate!==null&&(n=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==n&&(i.refCount++,n!=null&&Wr(n)));break;case 12:if(h&2048){Wn(n,i,o,u),n=i.stateNode;try{var g=i.memoizedProps,S=g.id,k=g.onPostCommit;typeof k=="function"&&k(S,i.alternate===null?"mount":"update",n.passiveEffectDuration,-0)}catch(A){Je(i,i.return,A)}}else Wn(n,i,o,u);break;case 31:Wn(n,i,o,u);break;case 13:Wn(n,i,o,u);break;case 23:break;case 22:g=i.stateNode,S=i.alternate,i.memoizedState!==null?g._visibility&2?Wn(n,i,o,u):po(n,i):g._visibility&2?Wn(n,i,o,u):(g._visibility|=2,er(n,i,o,u,(i.subtreeFlags&10256)!==0||!1)),h&2048&&Df(S,i);break;case 24:Wn(n,i,o,u),h&2048&&Lf(i.alternate,i);break;default:Wn(n,i,o,u)}}function er(n,i,o,u,h){for(h=h&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var g=n,S=i,k=o,A=u,q=S.flags;switch(S.tag){case 0:case 11:case 15:er(g,S,k,A,h),ho(8,S);break;case 23:break;case 22:var V=S.stateNode;S.memoizedState!==null?V._visibility&2?er(g,S,k,A,h):po(g,S):(V._visibility|=2,er(g,S,k,A,h)),h&&q&2048&&Df(S.alternate,S);break;case 24:er(g,S,k,A,h),h&&q&2048&&Lf(S.alternate,S);break;default:er(g,S,k,A,h)}i=i.sibling}}function po(n,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var o=n,u=i,h=u.flags;switch(u.tag){case 22:po(o,u),h&2048&&Df(u.alternate,u);break;case 24:po(o,u),h&2048&&Lf(u.alternate,u);break;default:po(o,u)}i=i.sibling}}var go=8192;function tr(n,i,o){if(n.subtreeFlags&go)for(n=n.child;n!==null;)yv(n,i,o),n=n.sibling}function yv(n,i,o){switch(n.tag){case 26:tr(n,i,o),n.flags&go&&n.memoizedState!==null&&P_(o,Jn,n.memoizedState,n.memoizedProps);break;case 5:tr(n,i,o);break;case 3:case 4:var u=Jn;Jn=gc(n.stateNode.containerInfo),tr(n,i,o),Jn=u;break;case 22:n.memoizedState===null&&(u=n.alternate,u!==null&&u.memoizedState!==null?(u=go,go=16777216,tr(n,i,o),go=u):tr(n,i,o));break;default:tr(n,i,o)}}function vv(n){var i=n.alternate;if(i!==null&&(n=i.child,n!==null)){i.child=null;do i=n.sibling,n.sibling=null,n=i;while(n!==null)}}function yo(n){var i=n.deletions;if((n.flags&16)!==0){if(i!==null)for(var o=0;o<i.length;o++){var u=i[o];Ft=u,xv(u,n)}vv(n)}if(n.subtreeFlags&10256)for(n=n.child;n!==null;)bv(n),n=n.sibling}function bv(n){switch(n.tag){case 0:case 11:case 15:yo(n),n.flags&2048&&li(9,n,n.return);break;case 3:yo(n);break;case 12:yo(n);break;case 22:var i=n.stateNode;n.memoizedState!==null&&i._visibility&2&&(n.return===null||n.return.tag!==13)?(i._visibility&=-3,sc(n)):yo(n);break;default:yo(n)}}function sc(n){var i=n.deletions;if((n.flags&16)!==0){if(i!==null)for(var o=0;o<i.length;o++){var u=i[o];Ft=u,xv(u,n)}vv(n)}for(n=n.child;n!==null;){switch(i=n,i.tag){case 0:case 11:case 15:li(8,i,i.return),sc(i);break;case 22:o=i.stateNode,o._visibility&2&&(o._visibility&=-3,sc(i));break;default:sc(i)}n=n.sibling}}function xv(n,i){for(;Ft!==null;){var o=Ft;switch(o.tag){case 0:case 11:case 15:li(8,o,i);break;case 23:case 22:if(o.memoizedState!==null&&o.memoizedState.cachePool!==null){var u=o.memoizedState.cachePool.pool;u!=null&&u.refCount++}break;case 24:Wr(o.memoizedState.cache)}if(u=o.child,u!==null)u.return=o,Ft=u;else e:for(o=n;Ft!==null;){u=Ft;var h=u.sibling,g=u.return;if(uv(u),u===o){Ft=null;break e}if(h!==null){h.return=g,Ft=h;break e}Ft=g}}}var e_={getCacheForType:function(n){var i=Qt(Mt),o=i.data.get(n);return o===void 0&&(o=n(),i.data.set(n,o)),o},cacheSignal:function(){return Qt(Mt).controller.signal}},t_=typeof WeakMap=="function"?WeakMap:Map,Ke=0,at=null,Le=null,Be=0,Xe=0,zn=null,ci=!1,nr=!1,Mf=!1,Us=0,Nt=0,ui=0,aa=0,Uf=0,En=0,sr=0,vo=null,gn=null,$f=!1,ic=0,Sv=0,ac=1/0,rc=null,di=null,Ht=0,fi=null,ir=null,$s=0,Pf=0,If=null,wv=null,bo=0,Bf=null;function On(){return(Ke&2)!==0&&Be!==0?Be&-Be:H.T!==null?Kf():et()}function jv(){if(En===0)if((Be&536870912)===0||He){var n=Ss;Ss<<=1,(Ss&3932160)===0&&(Ss=262144),En=n}else En=536870912;return n=Cn.current,n!==null&&(n.flags|=32),En}function yn(n,i,o){(n===at&&(Xe===2||Xe===9)||n.cancelPendingCommit!==null)&&(ar(n,0),hi(n,Be,En,!1)),Hi(n,o),((Ke&2)===0||n!==at)&&(n===at&&((Ke&2)===0&&(aa|=o),Nt===4&&hi(n,Be,En,!1)),ps(n))}function Nv(n,i,o){if((Ke&6)!==0)throw Error(a(327));var u=!o&&(i&127)===0&&(i&n.expiredLanes)===0||cs(n,i),h=u?i_(n,i):Hf(n,i,!0),g=u;do{if(h===0){nr&&!u&&hi(n,i,0,!1);break}else{if(o=n.current.alternate,g&&!n_(o)){h=Hf(n,i,!1),g=!1;continue}if(h===2){if(g=i,n.errorRecoveryDisabledLanes&g)var S=0;else S=n.pendingLanes&-536870913,S=S!==0?S:S&536870912?536870912:0;if(S!==0){i=S;e:{var k=n;h=vo;var A=k.current.memoizedState.isDehydrated;if(A&&(ar(k,S).flags|=256),S=Hf(k,S,!1),S!==2){if(Mf&&!A){k.errorRecoveryDisabledLanes|=g,aa|=g,h=4;break e}g=gn,gn=h,g!==null&&(gn===null?gn=g:gn.push.apply(gn,g))}h=S}if(g=!1,h!==2)continue}}if(h===1){ar(n,0),hi(n,i,0,!0);break}e:{switch(u=n,g=h,g){case 0:case 1:throw Error(a(345));case 4:if((i&4194048)!==i)break;case 6:hi(u,i,En,!ci);break e;case 2:gn=null;break;case 3:case 5:break;default:throw Error(a(329))}if((i&62914560)===i&&(h=ic+300-$e(),10<h)){if(hi(u,i,En,!ci),Ea(u,0,!0)!==0)break e;$s=i,u.timeoutHandle=t0(_v.bind(null,u,o,gn,rc,$f,i,En,aa,sr,ci,g,"Throttled",-0,0),h);break e}_v(u,o,gn,rc,$f,i,En,aa,sr,ci,g,null,-0,0)}}break}while(!0);ps(n)}function _v(n,i,o,u,h,g,S,k,A,q,V,J,F,K){if(n.timeoutHandle=-1,J=i.subtreeFlags,J&8192||(J&16785408)===16785408){J={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:js},yv(i,g,J);var ye=(g&62914560)===g?ic-$e():(g&4194048)===g?Sv-$e():0;if(ye=I_(J,ye),ye!==null){$s=g,n.cancelPendingCommit=ye(Tv.bind(null,n,i,g,o,u,h,S,k,A,V,J,null,F,K)),hi(n,g,S,!q);return}}Tv(n,i,g,o,u,h,S,k,A)}function n_(n){for(var i=n;;){var o=i.tag;if((o===0||o===11||o===15)&&i.flags&16384&&(o=i.updateQueue,o!==null&&(o=o.stores,o!==null)))for(var u=0;u<o.length;u++){var h=o[u],g=h.getSnapshot;h=h.value;try{if(!Nn(g(),h))return!1}catch{return!1}}if(o=i.child,i.subtreeFlags&16384&&o!==null)o.return=i,i=o;else{if(i===n)break;for(;i.sibling===null;){if(i.return===null||i.return===n)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function hi(n,i,o,u){i&=~Uf,i&=~aa,n.suspendedLanes|=i,n.pingedLanes&=~i,u&&(n.warmLanes|=i),u=n.expirationTimes;for(var h=i;0<h;){var g=31-te(h),S=1<<g;u[g]=-1,h&=~S}o!==0&&pl(n,o,i)}function oc(){return(Ke&6)===0?(xo(0),!1):!0}function qf(){if(Le!==null){if(Xe===0)var n=Le.return;else n=Le,ks=Yi=null,sf(n),Qa=null,to=0,n=Le;for(;n!==null;)nv(n.alternate,n),n=n.return;Le=null}}function ar(n,i){var o=n.timeoutHandle;o!==-1&&(n.timeoutHandle=-1,w_(o)),o=n.cancelPendingCommit,o!==null&&(n.cancelPendingCommit=null,o()),$s=0,qf(),at=n,Le=o=_s(n.current,null),Be=i,Xe=0,zn=null,ci=!1,nr=cs(n,i),Mf=!1,sr=En=Uf=aa=ui=Nt=0,gn=vo=null,$f=!1,(i&8)!==0&&(i|=i&32);var u=n.entangledLanes;if(u!==0)for(n=n.entanglements,u&=i;0<u;){var h=31-te(u),g=1<<h;i|=n[h],u&=~g}return Us=i,zl(),o}function Cv(n,i){Re=null,H.H=co,i===Va||i===Ml?(i=qg(),Xe=3):i===Fd?(i=qg(),Xe=4):Xe=i===xf?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,zn=i,Le===null&&(Nt=1,Yl(n,Ln(i,n.current)))}function kv(){var n=Cn.current;return n===null?!0:(Be&4194048)===Be?Pn===null:(Be&62914560)===Be||(Be&536870912)!==0?n===Pn:!1}function zv(){var n=H.H;return H.H=co,n===null?co:n}function Ev(){var n=H.A;return H.A=e_,n}function lc(){Nt=4,ci||(Be&4194048)!==Be&&Cn.current!==null||(nr=!0),(ui&134217727)===0&&(aa&134217727)===0||at===null||hi(at,Be,En,!1)}function Hf(n,i,o){var u=Ke;Ke|=2;var h=zv(),g=Ev();(at!==n||Be!==i)&&(rc=null,ar(n,i)),i=!1;var S=Nt;e:do try{if(Xe!==0&&Le!==null){var k=Le,A=zn;switch(Xe){case 8:qf(),S=6;break e;case 3:case 2:case 9:case 6:Cn.current===null&&(i=!0);var q=Xe;if(Xe=0,zn=null,rr(n,k,A,q),o&&nr){S=0;break e}break;default:q=Xe,Xe=0,zn=null,rr(n,k,A,q)}}s_(),S=Nt;break}catch(V){Cv(n,V)}while(!0);return i&&n.shellSuspendCounter++,ks=Yi=null,Ke=u,H.H=h,H.A=g,Le===null&&(at=null,Be=0,zl()),S}function s_(){for(;Le!==null;)Ov(Le)}function i_(n,i){var o=Ke;Ke|=2;var u=zv(),h=Ev();at!==n||Be!==i?(rc=null,ac=$e()+500,ar(n,i)):nr=cs(n,i);e:do try{if(Xe!==0&&Le!==null){i=Le;var g=zn;t:switch(Xe){case 1:Xe=0,zn=null,rr(n,i,g,1);break;case 2:case 9:if(Ig(g)){Xe=0,zn=null,Rv(i);break}i=function(){Xe!==2&&Xe!==9||at!==n||(Xe=7),ps(n)},g.then(i,i);break e;case 3:Xe=7;break e;case 4:Xe=5;break e;case 7:Ig(g)?(Xe=0,zn=null,Rv(i)):(Xe=0,zn=null,rr(n,i,g,7));break;case 5:var S=null;switch(Le.tag){case 26:S=Le.memoizedState;case 5:case 27:var k=Le;if(S?g0(S):k.stateNode.complete){Xe=0,zn=null;var A=k.sibling;if(A!==null)Le=A;else{var q=k.return;q!==null?(Le=q,cc(q)):Le=null}break t}}Xe=0,zn=null,rr(n,i,g,5);break;case 6:Xe=0,zn=null,rr(n,i,g,6);break;case 8:qf(),Nt=6;break e;default:throw Error(a(462))}}a_();break}catch(V){Cv(n,V)}while(!0);return ks=Yi=null,H.H=u,H.A=h,Ke=o,Le!==null?0:(at=null,Be=0,zl(),Nt)}function a_(){for(;Le!==null&&!re();)Ov(Le)}function Ov(n){var i=ev(n.alternate,n,Us);n.memoizedProps=n.pendingProps,i===null?cc(n):Le=i}function Rv(n){var i=n,o=i.alternate;switch(i.tag){case 15:case 0:i=Vy(o,i,i.pendingProps,i.type,void 0,Be);break;case 11:i=Vy(o,i,i.pendingProps,i.type.render,i.ref,Be);break;case 5:sf(i);default:nv(o,i),i=Le=Eg(i,Us),i=ev(o,i,Us)}n.memoizedProps=n.pendingProps,i===null?cc(n):Le=i}function rr(n,i,o,u){ks=Yi=null,sf(i),Qa=null,to=0;var h=i.return;try{if(KN(n,h,i,o,Be)){Nt=1,Yl(n,Ln(o,n.current)),Le=null;return}}catch(g){if(h!==null)throw Le=h,g;Nt=1,Yl(n,Ln(o,n.current)),Le=null;return}i.flags&32768?(He||u===1?n=!0:nr||(Be&536870912)!==0?n=!1:(ci=n=!0,(u===2||u===9||u===3||u===6)&&(u=Cn.current,u!==null&&u.tag===13&&(u.flags|=16384))),Av(i,n)):cc(i)}function cc(n){var i=n;do{if((i.flags&32768)!==0){Av(i,ci);return}n=i.return;var o=YN(i.alternate,i,Us);if(o!==null){Le=o;return}if(i=i.sibling,i!==null){Le=i;return}Le=i=n}while(i!==null);Nt===0&&(Nt=5)}function Av(n,i){do{var o=XN(n.alternate,n);if(o!==null){o.flags&=32767,Le=o;return}if(o=n.return,o!==null&&(o.flags|=32768,o.subtreeFlags=0,o.deletions=null),!i&&(n=n.sibling,n!==null)){Le=n;return}Le=n=o}while(n!==null);Nt=6,Le=null}function Tv(n,i,o,u,h,g,S,k,A){n.cancelPendingCommit=null;do uc();while(Ht!==0);if((Ke&6)!==0)throw Error(a(327));if(i!==null){if(i===n.current)throw Error(a(177));if(g=i.lanes|i.childLanes,g|=Od,od(n,o,g,S,k,A),n===at&&(Le=at=null,Be=0),ir=i,fi=n,$s=o,Pf=g,If=h,wv=u,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(n.callbackNode=null,n.callbackPriority=0,c_(Qn,function(){return $v(),null})):(n.callbackNode=null,n.callbackPriority=0),u=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||u){u=H.T,H.T=null,h=Z.p,Z.p=2,S=Ke,Ke|=4;try{JN(n,i,o)}finally{Ke=S,Z.p=h,H.T=u}}Ht=1,Dv(),Lv(),Mv()}}function Dv(){if(Ht===1){Ht=0;var n=fi,i=ir,o=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||o){o=H.T,H.T=null;var u=Z.p;Z.p=2;var h=Ke;Ke|=4;try{mv(i,n);var g=th,S=xg(n.containerInfo),k=g.focusedElem,A=g.selectionRange;if(S!==k&&k&&k.ownerDocument&&bg(k.ownerDocument.documentElement,k)){if(A!==null&&_d(k)){var q=A.start,V=A.end;if(V===void 0&&(V=q),"selectionStart"in k)k.selectionStart=q,k.selectionEnd=Math.min(V,k.value.length);else{var J=k.ownerDocument||document,F=J&&J.defaultView||window;if(F.getSelection){var K=F.getSelection(),ye=k.textContent.length,Ce=Math.min(A.start,ye),it=A.end===void 0?Ce:Math.min(A.end,ye);!K.extend&&Ce>it&&(S=it,it=Ce,Ce=S);var P=vg(k,Ce),U=vg(k,it);if(P&&U&&(K.rangeCount!==1||K.anchorNode!==P.node||K.anchorOffset!==P.offset||K.focusNode!==U.node||K.focusOffset!==U.offset)){var B=J.createRange();B.setStart(P.node,P.offset),K.removeAllRanges(),Ce>it?(K.addRange(B),K.extend(U.node,U.offset)):(B.setEnd(U.node,U.offset),K.addRange(B))}}}}for(J=[],K=k;K=K.parentNode;)K.nodeType===1&&J.push({element:K,left:K.scrollLeft,top:K.scrollTop});for(typeof k.focus=="function"&&k.focus(),k=0;k<J.length;k++){var Y=J[k];Y.element.scrollLeft=Y.left,Y.element.scrollTop=Y.top}}wc=!!eh,th=eh=null}finally{Ke=h,Z.p=u,H.T=o}}n.current=i,Ht=2}}function Lv(){if(Ht===2){Ht=0;var n=fi,i=ir,o=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||o){o=H.T,H.T=null;var u=Z.p;Z.p=2;var h=Ke;Ke|=4;try{cv(n,i.alternate,i)}finally{Ke=h,Z.p=u,H.T=o}}Ht=3}}function Mv(){if(Ht===4||Ht===3){Ht=0,Ue();var n=fi,i=ir,o=$s,u=wv;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?Ht=5:(Ht=0,ir=fi=null,Uv(n,n.pendingLanes));var h=n.pendingLanes;if(h===0&&(di=null),ce(o),i=i.stateNode,_e&&typeof _e.onCommitFiberRoot=="function")try{_e.onCommitFiberRoot(os,i,void 0,(i.current.flags&128)===128)}catch{}if(u!==null){i=H.T,h=Z.p,Z.p=2,H.T=null;try{for(var g=n.onRecoverableError,S=0;S<u.length;S++){var k=u[S];g(k.value,{componentStack:k.stack})}}finally{H.T=i,Z.p=h}}($s&3)!==0&&uc(),ps(n),h=n.pendingLanes,(o&261930)!==0&&(h&42)!==0?n===Bf?bo++:(bo=0,Bf=n):bo=0,xo(0)}}function Uv(n,i){(n.pooledCacheLanes&=i)===0&&(i=n.pooledCache,i!=null&&(n.pooledCache=null,Wr(i)))}function uc(){return Dv(),Lv(),Mv(),$v()}function $v(){if(Ht!==5)return!1;var n=fi,i=Pf;Pf=0;var o=ce($s),u=H.T,h=Z.p;try{Z.p=32>o?32:o,H.T=null,o=If,If=null;var g=fi,S=$s;if(Ht=0,ir=fi=null,$s=0,(Ke&6)!==0)throw Error(a(331));var k=Ke;if(Ke|=4,bv(g.current),gv(g,g.current,S,o),Ke=k,xo(0,!1),_e&&typeof _e.onPostCommitFiberRoot=="function")try{_e.onPostCommitFiberRoot(os,g)}catch{}return!0}finally{Z.p=h,H.T=u,Uv(n,i)}}function Pv(n,i,o){i=Ln(o,i),i=bf(n.stateNode,i,2),n=ai(n,i,2),n!==null&&(Hi(n,2),ps(n))}function Je(n,i,o){if(n.tag===3)Pv(n,n,o);else for(;i!==null;){if(i.tag===3){Pv(i,n,o);break}else if(i.tag===1){var u=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(di===null||!di.has(u))){n=Ln(o,n),o=Iy(2),u=ai(i,o,2),u!==null&&(By(o,u,i,n),Hi(u,2),ps(u));break}}i=i.return}}function Zf(n,i,o){var u=n.pingCache;if(u===null){u=n.pingCache=new t_;var h=new Set;u.set(i,h)}else h=u.get(i),h===void 0&&(h=new Set,u.set(i,h));h.has(o)||(Mf=!0,h.add(o),n=r_.bind(null,n,i,o),i.then(n,n))}function r_(n,i,o){var u=n.pingCache;u!==null&&u.delete(i),n.pingedLanes|=n.suspendedLanes&o,n.warmLanes&=~o,at===n&&(Be&o)===o&&(Nt===4||Nt===3&&(Be&62914560)===Be&&300>$e()-ic?(Ke&2)===0&&ar(n,0):Uf|=o,sr===Be&&(sr=0)),ps(n)}function Iv(n,i){i===0&&(i=ml()),n=Ki(n,i),n!==null&&(Hi(n,i),ps(n))}function o_(n){var i=n.memoizedState,o=0;i!==null&&(o=i.retryLane),Iv(n,o)}function l_(n,i){var o=0;switch(n.tag){case 31:case 13:var u=n.stateNode,h=n.memoizedState;h!==null&&(o=h.retryLane);break;case 19:u=n.stateNode;break;case 22:u=n.stateNode._retryCache;break;default:throw Error(a(314))}u!==null&&u.delete(i),Iv(n,o)}function c_(n,i){return St(n,i)}var dc=null,or=null,Ff=!1,fc=!1,Gf=!1,mi=0;function ps(n){n!==or&&n.next===null&&(or===null?dc=or=n:or=or.next=n),fc=!0,Ff||(Ff=!0,d_())}function xo(n,i){if(!Gf&&fc){Gf=!0;do for(var o=!1,u=dc;u!==null;){if(n!==0){var h=u.pendingLanes;if(h===0)var g=0;else{var S=u.suspendedLanes,k=u.pingedLanes;g=(1<<31-te(42|n)+1)-1,g&=h&~(S&~k),g=g&201326741?g&201326741|1:g?g|2:0}g!==0&&(o=!0,Zv(u,g))}else g=Be,g=Ea(u,u===at?g:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),(g&3)===0||cs(u,g)||(o=!0,Zv(u,g));u=u.next}while(o);Gf=!1}}function u_(){Bv()}function Bv(){fc=Ff=!1;var n=0;mi!==0&&S_()&&(n=mi);for(var i=$e(),o=null,u=dc;u!==null;){var h=u.next,g=qv(u,i);g===0?(u.next=null,o===null?dc=h:o.next=h,h===null&&(or=o)):(o=u,(n!==0||(g&3)!==0)&&(fc=!0)),u=h}Ht!==0&&Ht!==5||xo(n),mi!==0&&(mi=0)}function qv(n,i){for(var o=n.suspendedLanes,u=n.pingedLanes,h=n.expirationTimes,g=n.pendingLanes&-62914561;0<g;){var S=31-te(g),k=1<<S,A=h[S];A===-1?((k&o)===0||(k&u)!==0)&&(h[S]=hl(k,i)):A<=i&&(n.expiredLanes|=k),g&=~k}if(i=at,o=Be,o=Ea(n,n===i?o:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),u=n.callbackNode,o===0||n===i&&(Xe===2||Xe===9)||n.cancelPendingCommit!==null)return u!==null&&u!==null&&sn(u),n.callbackNode=null,n.callbackPriority=0;if((o&3)===0||cs(n,o)){if(i=o&-o,i===n.callbackPriority)return i;switch(u!==null&&sn(u),ce(o)){case 2:case 8:o=kt;break;case 32:o=Qn;break;case 268435456:o=Fs;break;default:o=Qn}return u=Hv.bind(null,n),o=St(o,u),n.callbackPriority=i,n.callbackNode=o,i}return u!==null&&u!==null&&sn(u),n.callbackPriority=2,n.callbackNode=null,2}function Hv(n,i){if(Ht!==0&&Ht!==5)return n.callbackNode=null,n.callbackPriority=0,null;var o=n.callbackNode;if(uc()&&n.callbackNode!==o)return null;var u=Be;return u=Ea(n,n===at?u:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),u===0?null:(Nv(n,u,i),qv(n,$e()),n.callbackNode!=null&&n.callbackNode===o?Hv.bind(null,n):null)}function Zv(n,i){if(uc())return null;Nv(n,i,!0)}function d_(){j_(function(){(Ke&6)!==0?St(Te,u_):Bv()})}function Kf(){if(mi===0){var n=Ga;n===0&&(n=Ks,Ks<<=1,(Ks&261888)===0&&(Ks=256)),mi=n}return mi}function Fv(n){return n==null||typeof n=="symbol"||typeof n=="boolean"?null:typeof n=="function"?n:xl(""+n)}function Gv(n,i){var o=i.ownerDocument.createElement("input");return o.name=i.name,o.value=i.value,n.id&&o.setAttribute("form",n.id),i.parentNode.insertBefore(o,i),n=new FormData(n),o.parentNode.removeChild(o),n}function f_(n,i,o,u,h){if(i==="submit"&&o&&o.stateNode===h){var g=Fv((h[wt]||null).action),S=u.submitter;S&&(i=(i=S[wt]||null)?Fv(i.formAction):S.getAttribute("formAction"),i!==null&&(g=i,S=null));var k=new Nl("action","action",null,u,h);n.push({event:k,listeners:[{instance:null,listener:function(){if(u.defaultPrevented){if(mi!==0){var A=S?Gv(h,S):new FormData(h);hf(o,{pending:!0,data:A,method:h.method,action:g},null,A)}}else typeof g=="function"&&(k.preventDefault(),A=S?Gv(h,S):new FormData(h),hf(o,{pending:!0,data:A,method:h.method,action:g},g,A))},currentTarget:h}]})}}for(var Vf=0;Vf<Ed.length;Vf++){var Qf=Ed[Vf],h_=Qf.toLowerCase(),m_=Qf[0].toUpperCase()+Qf.slice(1);Xn(h_,"on"+m_)}Xn(jg,"onAnimationEnd"),Xn(Ng,"onAnimationIteration"),Xn(_g,"onAnimationStart"),Xn("dblclick","onDoubleClick"),Xn("focusin","onFocus"),Xn("focusout","onBlur"),Xn(ON,"onTransitionRun"),Xn(RN,"onTransitionStart"),Xn(AN,"onTransitionCancel"),Xn(Cg,"onTransitionEnd"),an("onMouseEnter",["mouseout","mouseover"]),an("onMouseLeave",["mouseout","mouseover"]),an("onPointerEnter",["pointerout","pointerover"]),an("onPointerLeave",["pointerout","pointerover"]),qt("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),qt("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),qt("onBeforeInput",["compositionend","keypress","textInput","paste"]),qt("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),qt("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),qt("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var So="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(" "),p_=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(So));function Kv(n,i){i=(i&4)!==0;for(var o=0;o<n.length;o++){var u=n[o],h=u.event;u=u.listeners;e:{var g=void 0;if(i)for(var S=u.length-1;0<=S;S--){var k=u[S],A=k.instance,q=k.currentTarget;if(k=k.listener,A!==g&&h.isPropagationStopped())break e;g=k,h.currentTarget=q;try{g(h)}catch(V){kl(V)}h.currentTarget=null,g=A}else for(S=0;S<u.length;S++){if(k=u[S],A=k.instance,q=k.currentTarget,k=k.listener,A!==g&&h.isPropagationStopped())break e;g=k,h.currentTarget=q;try{g(h)}catch(V){kl(V)}h.currentTarget=null,g=A}}}}function Me(n,i){var o=i[en];o===void 0&&(o=i[en]=new Set);var u=n+"__bubble";o.has(u)||(Vv(i,n,2,!1),o.add(u))}function Yf(n,i,o){var u=0;i&&(u|=4),Vv(o,n,u,i)}var hc="_reactListening"+Math.random().toString(36).slice(2);function Xf(n){if(!n[hc]){n[hc]=!0,Ie.forEach(function(o){o!=="selectionchange"&&(p_.has(o)||Yf(o,!1,n),Yf(o,!0,n))});var i=n.nodeType===9?n:n.ownerDocument;i===null||i[hc]||(i[hc]=!0,Yf("selectionchange",!1,i))}}function Vv(n,i,o,u){switch(j0(i)){case 2:var h=H_;break;case 8:h=Z_;break;default:h=fh}o=h.bind(null,i,o,n),h=void 0,!gd||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(h=!0),u?h!==void 0?n.addEventListener(i,o,{capture:!0,passive:h}):n.addEventListener(i,o,!0):h!==void 0?n.addEventListener(i,o,{passive:h}):n.addEventListener(i,o,!1)}function Jf(n,i,o,u,h){var g=u;if((i&1)===0&&(i&2)===0&&u!==null)e:for(;;){if(u===null)return;var S=u.tag;if(S===3||S===4){var k=u.stateNode.containerInfo;if(k===h)break;if(S===4)for(S=u.return;S!==null;){var A=S.tag;if((A===3||A===4)&&S.stateNode.containerInfo===h)return;S=S.return}for(;k!==null;){if(S=Ys(k),S===null)return;if(A=S.tag,A===5||A===6||A===26||A===27){u=g=S;continue e}k=k.parentNode}}u=u.return}Wp(function(){var q=g,V=md(o),J=[];e:{var F=kg.get(n);if(F!==void 0){var K=Nl,ye=n;switch(n){case"keypress":if(wl(o)===0)break e;case"keydown":case"keyup":K=lN;break;case"focusin":ye="focus",K=xd;break;case"focusout":ye="blur",K=xd;break;case"beforeblur":case"afterblur":K=xd;break;case"click":if(o.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":K=ng;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":K=Y1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":K=dN;break;case jg:case Ng:case _g:K=W1;break;case Cg:K=hN;break;case"scroll":case"scrollend":K=V1;break;case"wheel":K=pN;break;case"copy":case"cut":case"paste":K=tN;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":K=ig;break;case"toggle":case"beforetoggle":K=yN}var Ce=(i&4)!==0,it=!Ce&&(n==="scroll"||n==="scrollend"),P=Ce?F!==null?F+"Capture":null:F;Ce=[];for(var U=q,B;U!==null;){var Y=U;if(B=Y.stateNode,Y=Y.tag,Y!==5&&Y!==26&&Y!==27||B===null||P===null||(Y=qr(U,P),Y!=null&&Ce.push(wo(U,Y,B))),it)break;U=U.return}0<Ce.length&&(F=new K(F,ye,null,o,V),J.push({event:F,listeners:Ce}))}}if((i&7)===0){e:{if(F=n==="mouseover"||n==="pointerover",K=n==="mouseout"||n==="pointerout",F&&o!==hd&&(ye=o.relatedTarget||o.fromElement)&&(Ys(ye)||ye[jn]))break e;if((K||F)&&(F=V.window===V?V:(F=V.ownerDocument)?F.defaultView||F.parentWindow:window,K?(ye=o.relatedTarget||o.toElement,K=q,ye=ye?Ys(ye):null,ye!==null&&(it=c(ye),Ce=ye.tag,ye!==it||Ce!==5&&Ce!==27&&Ce!==6)&&(ye=null)):(K=null,ye=q),K!==ye)){if(Ce=ng,Y="onMouseLeave",P="onMouseEnter",U="mouse",(n==="pointerout"||n==="pointerover")&&(Ce=ig,Y="onPointerLeave",P="onPointerEnter",U="pointer"),it=K==null?F:ds(K),B=ye==null?F:ds(ye),F=new Ce(Y,U+"leave",K,o,V),F.target=it,F.relatedTarget=B,Y=null,Ys(V)===q&&(Ce=new Ce(P,U+"enter",ye,o,V),Ce.target=B,Ce.relatedTarget=it,Y=Ce),it=Y,K&&ye)t:{for(Ce=g_,P=K,U=ye,B=0,Y=P;Y;Y=Ce(Y))B++;Y=0;for(var je=U;je;je=Ce(je))Y++;for(;0<B-Y;)P=Ce(P),B--;for(;0<Y-B;)U=Ce(U),Y--;for(;B--;){if(P===U||U!==null&&P===U.alternate){Ce=P;break t}P=Ce(P),U=Ce(U)}Ce=null}else Ce=null;K!==null&&Qv(J,F,K,Ce,!1),ye!==null&&it!==null&&Qv(J,it,ye,Ce,!0)}}e:{if(F=q?ds(q):window,K=F.nodeName&&F.nodeName.toLowerCase(),K==="select"||K==="input"&&F.type==="file")var Fe=fg;else if(ug(F))if(hg)Fe=kN;else{Fe=_N;var xe=NN}else K=F.nodeName,!K||K.toLowerCase()!=="input"||F.type!=="checkbox"&&F.type!=="radio"?q&&fd(q.elementType)&&(Fe=fg):Fe=CN;if(Fe&&(Fe=Fe(n,q))){dg(J,Fe,o,V);break e}xe&&xe(n,F,q),n==="focusout"&&q&&F.type==="number"&&q.memoizedProps.value!=null&&dd(F,"number",F.value)}switch(xe=q?ds(q):window,n){case"focusin":(ug(xe)||xe.contentEditable==="true")&&($a=xe,Cd=q,Yr=null);break;case"focusout":Yr=Cd=$a=null;break;case"mousedown":kd=!0;break;case"contextmenu":case"mouseup":case"dragend":kd=!1,Sg(J,o,V);break;case"selectionchange":if(EN)break;case"keydown":case"keyup":Sg(J,o,V)}var Ae;if(wd)e:{switch(n){case"compositionstart":var qe="onCompositionStart";break e;case"compositionend":qe="onCompositionEnd";break e;case"compositionupdate":qe="onCompositionUpdate";break e}qe=void 0}else Ua?lg(n,o)&&(qe="onCompositionEnd"):n==="keydown"&&o.keyCode===229&&(qe="onCompositionStart");qe&&(ag&&o.locale!=="ko"&&(Ua||qe!=="onCompositionStart"?qe==="onCompositionEnd"&&Ua&&(Ae=eg()):(Js=V,yd="value"in Js?Js.value:Js.textContent,Ua=!0)),xe=mc(q,qe),0<xe.length&&(qe=new sg(qe,n,null,o,V),J.push({event:qe,listeners:xe}),Ae?qe.data=Ae:(Ae=cg(o),Ae!==null&&(qe.data=Ae)))),(Ae=bN?xN(n,o):SN(n,o))&&(qe=mc(q,"onBeforeInput"),0<qe.length&&(xe=new sg("onBeforeInput","beforeinput",null,o,V),J.push({event:xe,listeners:qe}),xe.data=Ae)),f_(J,n,q,o,V)}Kv(J,i)})}function wo(n,i,o){return{instance:n,listener:i,currentTarget:o}}function mc(n,i){for(var o=i+"Capture",u=[];n!==null;){var h=n,g=h.stateNode;if(h=h.tag,h!==5&&h!==26&&h!==27||g===null||(h=qr(n,o),h!=null&&u.unshift(wo(n,h,g)),h=qr(n,i),h!=null&&u.push(wo(n,h,g))),n.tag===3)return u;n=n.return}return[]}function g_(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5&&n.tag!==27);return n||null}function Qv(n,i,o,u,h){for(var g=i._reactName,S=[];o!==null&&o!==u;){var k=o,A=k.alternate,q=k.stateNode;if(k=k.tag,A!==null&&A===u)break;k!==5&&k!==26&&k!==27||q===null||(A=q,h?(q=qr(o,g),q!=null&&S.unshift(wo(o,q,A))):h||(q=qr(o,g),q!=null&&S.push(wo(o,q,A)))),o=o.return}S.length!==0&&n.push({event:i,listeners:S})}var y_=/\r\n?/g,v_=/\u0000|\uFFFD/g;function Yv(n){return(typeof n=="string"?n:""+n).replace(y_,`
9
- `).replace(v_,"")}function Xv(n,i){return i=Yv(i),Yv(n)===i}function st(n,i,o,u,h,g){switch(o){case"children":typeof u=="string"?i==="body"||i==="textarea"&&u===""||Da(n,u):(typeof u=="number"||typeof u=="bigint")&&i!=="body"&&Da(n,""+u);break;case"className":vl(n,"class",u);break;case"tabIndex":vl(n,"tabindex",u);break;case"dir":case"role":case"viewBox":case"width":case"height":vl(n,o,u);break;case"style":Xp(n,u,g);break;case"data":if(i!=="object"){vl(n,"data",u);break}case"src":case"href":if(u===""&&(i!=="a"||o!=="href")){n.removeAttribute(o);break}if(u==null||typeof u=="function"||typeof u=="symbol"||typeof u=="boolean"){n.removeAttribute(o);break}u=xl(""+u),n.setAttribute(o,u);break;case"action":case"formAction":if(typeof u=="function"){n.setAttribute(o,"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 g=="function"&&(o==="formAction"?(i!=="input"&&st(n,i,"name",h.name,h,null),st(n,i,"formEncType",h.formEncType,h,null),st(n,i,"formMethod",h.formMethod,h,null),st(n,i,"formTarget",h.formTarget,h,null)):(st(n,i,"encType",h.encType,h,null),st(n,i,"method",h.method,h,null),st(n,i,"target",h.target,h,null)));if(u==null||typeof u=="symbol"||typeof u=="boolean"){n.removeAttribute(o);break}u=xl(""+u),n.setAttribute(o,u);break;case"onClick":u!=null&&(n.onclick=js);break;case"onScroll":u!=null&&Me("scroll",n);break;case"onScrollEnd":u!=null&&Me("scrollend",n);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(a(61));if(o=u.__html,o!=null){if(h.children!=null)throw Error(a(60));n.innerHTML=o}}break;case"multiple":n.multiple=u&&typeof u!="function"&&typeof u!="symbol";break;case"muted":n.muted=u&&typeof u!="function"&&typeof u!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(u==null||typeof u=="function"||typeof u=="boolean"||typeof u=="symbol"){n.removeAttribute("xlink:href");break}o=xl(""+u),n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",o);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":u!=null&&typeof u!="function"&&typeof u!="symbol"?n.setAttribute(o,""+u):n.removeAttribute(o);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":u&&typeof u!="function"&&typeof u!="symbol"?n.setAttribute(o,""):n.removeAttribute(o);break;case"capture":case"download":u===!0?n.setAttribute(o,""):u!==!1&&u!=null&&typeof u!="function"&&typeof u!="symbol"?n.setAttribute(o,u):n.removeAttribute(o);break;case"cols":case"rows":case"size":case"span":u!=null&&typeof u!="function"&&typeof u!="symbol"&&!isNaN(u)&&1<=u?n.setAttribute(o,u):n.removeAttribute(o);break;case"rowSpan":case"start":u==null||typeof u=="function"||typeof u=="symbol"||isNaN(u)?n.removeAttribute(o):n.setAttribute(o,u);break;case"popover":Me("beforetoggle",n),Me("toggle",n),yl(n,"popover",u);break;case"xlinkActuate":ws(n,"http://www.w3.org/1999/xlink","xlink:actuate",u);break;case"xlinkArcrole":ws(n,"http://www.w3.org/1999/xlink","xlink:arcrole",u);break;case"xlinkRole":ws(n,"http://www.w3.org/1999/xlink","xlink:role",u);break;case"xlinkShow":ws(n,"http://www.w3.org/1999/xlink","xlink:show",u);break;case"xlinkTitle":ws(n,"http://www.w3.org/1999/xlink","xlink:title",u);break;case"xlinkType":ws(n,"http://www.w3.org/1999/xlink","xlink:type",u);break;case"xmlBase":ws(n,"http://www.w3.org/XML/1998/namespace","xml:base",u);break;case"xmlLang":ws(n,"http://www.w3.org/XML/1998/namespace","xml:lang",u);break;case"xmlSpace":ws(n,"http://www.w3.org/XML/1998/namespace","xml:space",u);break;case"is":yl(n,"is",u);break;case"innerText":case"textContent":break;default:(!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")&&(o=G1.get(o)||o,yl(n,o,u))}}function Wf(n,i,o,u,h,g){switch(o){case"style":Xp(n,u,g);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(a(61));if(o=u.__html,o!=null){if(h.children!=null)throw Error(a(60));n.innerHTML=o}}break;case"children":typeof u=="string"?Da(n,u):(typeof u=="number"||typeof u=="bigint")&&Da(n,""+u);break;case"onScroll":u!=null&&Me("scroll",n);break;case"onScrollEnd":u!=null&&Me("scrollend",n);break;case"onClick":u!=null&&(n.onclick=js);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!tt.hasOwnProperty(o))e:{if(o[0]==="o"&&o[1]==="n"&&(h=o.endsWith("Capture"),i=o.slice(2,h?o.length-7:void 0),g=n[wt]||null,g=g!=null?g[o]:null,typeof g=="function"&&n.removeEventListener(i,g,h),typeof u=="function")){typeof g!="function"&&g!==null&&(o in n?n[o]=null:n.hasAttribute(o)&&n.removeAttribute(o)),n.addEventListener(i,u,h);break e}o in n?n[o]=u:u===!0?n.setAttribute(o,""):yl(n,o,u)}}}function Xt(n,i,o){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Me("error",n),Me("load",n);var u=!1,h=!1,g;for(g in o)if(o.hasOwnProperty(g)){var S=o[g];if(S!=null)switch(g){case"src":u=!0;break;case"srcSet":h=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:st(n,i,g,S,o,null)}}h&&st(n,i,"srcSet",o.srcSet,o,null),u&&st(n,i,"src",o.src,o,null);return;case"input":Me("invalid",n);var k=g=S=h=null,A=null,q=null;for(u in o)if(o.hasOwnProperty(u)){var V=o[u];if(V!=null)switch(u){case"name":h=V;break;case"type":S=V;break;case"checked":A=V;break;case"defaultChecked":q=V;break;case"value":g=V;break;case"defaultValue":k=V;break;case"children":case"dangerouslySetInnerHTML":if(V!=null)throw Error(a(137,i));break;default:st(n,i,u,V,o,null)}}Kp(n,g,k,A,q,S,h,!1);return;case"select":Me("invalid",n),u=S=g=null;for(h in o)if(o.hasOwnProperty(h)&&(k=o[h],k!=null))switch(h){case"value":g=k;break;case"defaultValue":S=k;break;case"multiple":u=k;default:st(n,i,h,k,o,null)}i=g,o=S,n.multiple=!!u,i!=null?Ta(n,!!u,i,!1):o!=null&&Ta(n,!!u,o,!0);return;case"textarea":Me("invalid",n),g=h=u=null;for(S in o)if(o.hasOwnProperty(S)&&(k=o[S],k!=null))switch(S){case"value":u=k;break;case"defaultValue":h=k;break;case"children":g=k;break;case"dangerouslySetInnerHTML":if(k!=null)throw Error(a(91));break;default:st(n,i,S,k,o,null)}Qp(n,u,h,g);return;case"option":for(A in o)o.hasOwnProperty(A)&&(u=o[A],u!=null)&&(A==="selected"?n.selected=u&&typeof u!="function"&&typeof u!="symbol":st(n,i,A,u,o,null));return;case"dialog":Me("beforetoggle",n),Me("toggle",n),Me("cancel",n),Me("close",n);break;case"iframe":case"object":Me("load",n);break;case"video":case"audio":for(u=0;u<So.length;u++)Me(So[u],n);break;case"image":Me("error",n),Me("load",n);break;case"details":Me("toggle",n);break;case"embed":case"source":case"link":Me("error",n),Me("load",n);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(q in o)if(o.hasOwnProperty(q)&&(u=o[q],u!=null))switch(q){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:st(n,i,q,u,o,null)}return;default:if(fd(i)){for(V in o)o.hasOwnProperty(V)&&(u=o[V],u!==void 0&&Wf(n,i,V,u,o,void 0));return}}for(k in o)o.hasOwnProperty(k)&&(u=o[k],u!=null&&st(n,i,k,u,o,null))}function b_(n,i,o,u){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var h=null,g=null,S=null,k=null,A=null,q=null,V=null;for(K in o){var J=o[K];if(o.hasOwnProperty(K)&&J!=null)switch(K){case"checked":break;case"value":break;case"defaultValue":A=J;default:u.hasOwnProperty(K)||st(n,i,K,null,u,J)}}for(var F in u){var K=u[F];if(J=o[F],u.hasOwnProperty(F)&&(K!=null||J!=null))switch(F){case"type":g=K;break;case"name":h=K;break;case"checked":q=K;break;case"defaultChecked":V=K;break;case"value":S=K;break;case"defaultValue":k=K;break;case"children":case"dangerouslySetInnerHTML":if(K!=null)throw Error(a(137,i));break;default:K!==J&&st(n,i,F,K,u,J)}}ud(n,S,k,A,q,V,g,h);return;case"select":K=S=k=F=null;for(g in o)if(A=o[g],o.hasOwnProperty(g)&&A!=null)switch(g){case"value":break;case"multiple":K=A;default:u.hasOwnProperty(g)||st(n,i,g,null,u,A)}for(h in u)if(g=u[h],A=o[h],u.hasOwnProperty(h)&&(g!=null||A!=null))switch(h){case"value":F=g;break;case"defaultValue":k=g;break;case"multiple":S=g;default:g!==A&&st(n,i,h,g,u,A)}i=k,o=S,u=K,F!=null?Ta(n,!!o,F,!1):!!u!=!!o&&(i!=null?Ta(n,!!o,i,!0):Ta(n,!!o,o?[]:"",!1));return;case"textarea":K=F=null;for(k in o)if(h=o[k],o.hasOwnProperty(k)&&h!=null&&!u.hasOwnProperty(k))switch(k){case"value":break;case"children":break;default:st(n,i,k,null,u,h)}for(S in u)if(h=u[S],g=o[S],u.hasOwnProperty(S)&&(h!=null||g!=null))switch(S){case"value":F=h;break;case"defaultValue":K=h;break;case"children":break;case"dangerouslySetInnerHTML":if(h!=null)throw Error(a(91));break;default:h!==g&&st(n,i,S,h,u,g)}Vp(n,F,K);return;case"option":for(var ye in o)F=o[ye],o.hasOwnProperty(ye)&&F!=null&&!u.hasOwnProperty(ye)&&(ye==="selected"?n.selected=!1:st(n,i,ye,null,u,F));for(A in u)F=u[A],K=o[A],u.hasOwnProperty(A)&&F!==K&&(F!=null||K!=null)&&(A==="selected"?n.selected=F&&typeof F!="function"&&typeof F!="symbol":st(n,i,A,F,u,K));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 Ce in o)F=o[Ce],o.hasOwnProperty(Ce)&&F!=null&&!u.hasOwnProperty(Ce)&&st(n,i,Ce,null,u,F);for(q in u)if(F=u[q],K=o[q],u.hasOwnProperty(q)&&F!==K&&(F!=null||K!=null))switch(q){case"children":case"dangerouslySetInnerHTML":if(F!=null)throw Error(a(137,i));break;default:st(n,i,q,F,u,K)}return;default:if(fd(i)){for(var it in o)F=o[it],o.hasOwnProperty(it)&&F!==void 0&&!u.hasOwnProperty(it)&&Wf(n,i,it,void 0,u,F);for(V in u)F=u[V],K=o[V],!u.hasOwnProperty(V)||F===K||F===void 0&&K===void 0||Wf(n,i,V,F,u,K);return}}for(var P in o)F=o[P],o.hasOwnProperty(P)&&F!=null&&!u.hasOwnProperty(P)&&st(n,i,P,null,u,F);for(J in u)F=u[J],K=o[J],!u.hasOwnProperty(J)||F===K||F==null&&K==null||st(n,i,J,F,u,K)}function Jv(n){switch(n){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function x_(){if(typeof performance.getEntriesByType=="function"){for(var n=0,i=0,o=performance.getEntriesByType("resource"),u=0;u<o.length;u++){var h=o[u],g=h.transferSize,S=h.initiatorType,k=h.duration;if(g&&k&&Jv(S)){for(S=0,k=h.responseEnd,u+=1;u<o.length;u++){var A=o[u],q=A.startTime;if(q>k)break;var V=A.transferSize,J=A.initiatorType;V&&Jv(J)&&(A=A.responseEnd,S+=V*(A<k?1:(k-q)/(A-q)))}if(--u,i+=8*(g+S)/(h.duration/1e3),n++,10<n)break}}if(0<n)return i/n/1e6}return navigator.connection&&(n=navigator.connection.downlink,typeof n=="number")?n:5}var eh=null,th=null;function pc(n){return n.nodeType===9?n:n.ownerDocument}function Wv(n){switch(n){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function e0(n,i){if(n===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return n===1&&i==="foreignObject"?0:n}function nh(n,i){return n==="textarea"||n==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.children=="bigint"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var sh=null;function S_(){var n=window.event;return n&&n.type==="popstate"?n===sh?!1:(sh=n,!0):(sh=null,!1)}var t0=typeof setTimeout=="function"?setTimeout:void 0,w_=typeof clearTimeout=="function"?clearTimeout:void 0,n0=typeof Promise=="function"?Promise:void 0,j_=typeof queueMicrotask=="function"?queueMicrotask:typeof n0<"u"?function(n){return n0.resolve(null).then(n).catch(N_)}:t0;function N_(n){setTimeout(function(){throw n})}function pi(n){return n==="head"}function s0(n,i){var o=i,u=0;do{var h=o.nextSibling;if(n.removeChild(o),h&&h.nodeType===8)if(o=h.data,o==="/$"||o==="/&"){if(u===0){n.removeChild(h),dr(i);return}u--}else if(o==="$"||o==="$?"||o==="$~"||o==="$!"||o==="&")u++;else if(o==="html")jo(n.ownerDocument.documentElement);else if(o==="head"){o=n.ownerDocument.head,jo(o);for(var g=o.firstChild;g;){var S=g.nextSibling,k=g.nodeName;g[us]||k==="SCRIPT"||k==="STYLE"||k==="LINK"&&g.rel.toLowerCase()==="stylesheet"||o.removeChild(g),g=S}}else o==="body"&&jo(n.ownerDocument.body);o=h}while(o);dr(i)}function i0(n,i){var o=n;n=0;do{var u=o.nextSibling;if(o.nodeType===1?i?(o._stashedDisplay=o.style.display,o.style.display="none"):(o.style.display=o._stashedDisplay||"",o.getAttribute("style")===""&&o.removeAttribute("style")):o.nodeType===3&&(i?(o._stashedText=o.nodeValue,o.nodeValue=""):o.nodeValue=o._stashedText||""),u&&u.nodeType===8)if(o=u.data,o==="/$"){if(n===0)break;n--}else o!=="$"&&o!=="$?"&&o!=="$~"&&o!=="$!"||n++;o=u}while(o)}function ih(n){var i=n.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var o=i;switch(i=i.nextSibling,o.nodeName){case"HTML":case"HEAD":case"BODY":ih(o),Ra(o);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(o.rel.toLowerCase()==="stylesheet")continue}n.removeChild(o)}}function __(n,i,o,u){for(;n.nodeType===1;){var h=o;if(n.nodeName.toLowerCase()!==i.toLowerCase()){if(!u&&(n.nodeName!=="INPUT"||n.type!=="hidden"))break}else if(u){if(!n[us])switch(i){case"meta":if(!n.hasAttribute("itemprop"))break;return n;case"link":if(g=n.getAttribute("rel"),g==="stylesheet"&&n.hasAttribute("data-precedence"))break;if(g!==h.rel||n.getAttribute("href")!==(h.href==null||h.href===""?null:h.href)||n.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin)||n.getAttribute("title")!==(h.title==null?null:h.title))break;return n;case"style":if(n.hasAttribute("data-precedence"))break;return n;case"script":if(g=n.getAttribute("src"),(g!==(h.src==null?null:h.src)||n.getAttribute("type")!==(h.type==null?null:h.type)||n.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin))&&g&&n.hasAttribute("async")&&!n.hasAttribute("itemprop"))break;return n;default:return n}}else if(i==="input"&&n.type==="hidden"){var g=h.name==null?null:""+h.name;if(h.type==="hidden"&&n.getAttribute("name")===g)return n}else return n;if(n=In(n.nextSibling),n===null)break}return null}function C_(n,i,o){if(i==="")return null;for(;n.nodeType!==3;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!o||(n=In(n.nextSibling),n===null))return null;return n}function a0(n,i){for(;n.nodeType!==8;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!i||(n=In(n.nextSibling),n===null))return null;return n}function ah(n){return n.data==="$?"||n.data==="$~"}function rh(n){return n.data==="$!"||n.data==="$?"&&n.ownerDocument.readyState!=="loading"}function k_(n,i){var o=n.ownerDocument;if(n.data==="$~")n._reactRetry=i;else if(n.data!=="$?"||o.readyState!=="loading")i();else{var u=function(){i(),o.removeEventListener("DOMContentLoaded",u)};o.addEventListener("DOMContentLoaded",u),n._reactRetry=u}}function In(n){for(;n!=null;n=n.nextSibling){var i=n.nodeType;if(i===1||i===3)break;if(i===8){if(i=n.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return n}var oh=null;function r0(n){n=n.nextSibling;for(var i=0;n;){if(n.nodeType===8){var o=n.data;if(o==="/$"||o==="/&"){if(i===0)return In(n.nextSibling);i--}else o!=="$"&&o!=="$!"&&o!=="$?"&&o!=="$~"&&o!=="&"||i++}n=n.nextSibling}return null}function o0(n){n=n.previousSibling;for(var i=0;n;){if(n.nodeType===8){var o=n.data;if(o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"){if(i===0)return n;i--}else o!=="/$"&&o!=="/&"||i++}n=n.previousSibling}return null}function l0(n,i,o){switch(i=pc(o),n){case"html":if(n=i.documentElement,!n)throw Error(a(452));return n;case"head":if(n=i.head,!n)throw Error(a(453));return n;case"body":if(n=i.body,!n)throw Error(a(454));return n;default:throw Error(a(451))}}function jo(n){for(var i=n.attributes;i.length;)n.removeAttributeNode(i[0]);Ra(n)}var Bn=new Map,c0=new Set;function gc(n){return typeof n.getRootNode=="function"?n.getRootNode():n.nodeType===9?n:n.ownerDocument}var Ps=Z.d;Z.d={f:z_,r:E_,D:O_,C:R_,L:A_,m:T_,X:L_,S:D_,M:M_};function z_(){var n=Ps.f(),i=oc();return n||i}function E_(n){var i=Yn(n);i!==null&&i.tag===5&&i.type==="form"?Cy(i):Ps.r(n)}var lr=typeof document>"u"?null:document;function u0(n,i,o){var u=lr;if(u&&typeof i=="string"&&i){var h=Tn(i);h='link[rel="'+n+'"][href="'+h+'"]',typeof o=="string"&&(h+='[crossorigin="'+o+'"]'),c0.has(h)||(c0.add(h),n={rel:n,crossOrigin:o,href:i},u.querySelector(h)===null&&(i=u.createElement("link"),Xt(i,"link",n),Lt(i),u.head.appendChild(i)))}}function O_(n){Ps.D(n),u0("dns-prefetch",n,null)}function R_(n,i){Ps.C(n,i),u0("preconnect",n,i)}function A_(n,i,o){Ps.L(n,i,o);var u=lr;if(u&&n&&i){var h='link[rel="preload"][as="'+Tn(i)+'"]';i==="image"&&o&&o.imageSrcSet?(h+='[imagesrcset="'+Tn(o.imageSrcSet)+'"]',typeof o.imageSizes=="string"&&(h+='[imagesizes="'+Tn(o.imageSizes)+'"]')):h+='[href="'+Tn(n)+'"]';var g=h;switch(i){case"style":g=cr(n);break;case"script":g=ur(n)}Bn.has(g)||(n=y({rel:"preload",href:i==="image"&&o&&o.imageSrcSet?void 0:n,as:i},o),Bn.set(g,n),u.querySelector(h)!==null||i==="style"&&u.querySelector(No(g))||i==="script"&&u.querySelector(_o(g))||(i=u.createElement("link"),Xt(i,"link",n),Lt(i),u.head.appendChild(i)))}}function T_(n,i){Ps.m(n,i);var o=lr;if(o&&n){var u=i&&typeof i.as=="string"?i.as:"script",h='link[rel="modulepreload"][as="'+Tn(u)+'"][href="'+Tn(n)+'"]',g=h;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":g=ur(n)}if(!Bn.has(g)&&(n=y({rel:"modulepreload",href:n},i),Bn.set(g,n),o.querySelector(h)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(o.querySelector(_o(g)))return}u=o.createElement("link"),Xt(u,"link",n),Lt(u),o.head.appendChild(u)}}}function D_(n,i,o){Ps.S(n,i,o);var u=lr;if(u&&n){var h=Xs(u).hoistableStyles,g=cr(n);i=i||"default";var S=h.get(g);if(!S){var k={loading:0,preload:null};if(S=u.querySelector(No(g)))k.loading=5;else{n=y({rel:"stylesheet",href:n,"data-precedence":i},o),(o=Bn.get(g))&&lh(n,o);var A=S=u.createElement("link");Lt(A),Xt(A,"link",n),A._p=new Promise(function(q,V){A.onload=q,A.onerror=V}),A.addEventListener("load",function(){k.loading|=1}),A.addEventListener("error",function(){k.loading|=2}),k.loading|=4,yc(S,i,u)}S={type:"stylesheet",instance:S,count:1,state:k},h.set(g,S)}}}function L_(n,i){Ps.X(n,i);var o=lr;if(o&&n){var u=Xs(o).hoistableScripts,h=ur(n),g=u.get(h);g||(g=o.querySelector(_o(h)),g||(n=y({src:n,async:!0},i),(i=Bn.get(h))&&ch(n,i),g=o.createElement("script"),Lt(g),Xt(g,"link",n),o.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},u.set(h,g))}}function M_(n,i){Ps.M(n,i);var o=lr;if(o&&n){var u=Xs(o).hoistableScripts,h=ur(n),g=u.get(h);g||(g=o.querySelector(_o(h)),g||(n=y({src:n,async:!0,type:"module"},i),(i=Bn.get(h))&&ch(n,i),g=o.createElement("script"),Lt(g),Xt(g,"link",n),o.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},u.set(h,g))}}function d0(n,i,o,u){var h=(h=he.current)?gc(h):null;if(!h)throw Error(a(446));switch(n){case"meta":case"title":return null;case"style":return typeof o.precedence=="string"&&typeof o.href=="string"?(i=cr(o.href),o=Xs(h).hoistableStyles,u=o.get(i),u||(u={type:"style",instance:null,count:0,state:null},o.set(i,u)),u):{type:"void",instance:null,count:0,state:null};case"link":if(o.rel==="stylesheet"&&typeof o.href=="string"&&typeof o.precedence=="string"){n=cr(o.href);var g=Xs(h).hoistableStyles,S=g.get(n);if(S||(h=h.ownerDocument||h,S={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},g.set(n,S),(g=h.querySelector(No(n)))&&!g._p&&(S.instance=g,S.state.loading=5),Bn.has(n)||(o={rel:"preload",as:"style",href:o.href,crossOrigin:o.crossOrigin,integrity:o.integrity,media:o.media,hrefLang:o.hrefLang,referrerPolicy:o.referrerPolicy},Bn.set(n,o),g||U_(h,n,o,S.state))),i&&u===null)throw Error(a(528,""));return S}if(i&&u!==null)throw Error(a(529,""));return null;case"script":return i=o.async,o=o.src,typeof o=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=ur(o),o=Xs(h).hoistableScripts,u=o.get(i),u||(u={type:"script",instance:null,count:0,state:null},o.set(i,u)),u):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,n))}}function cr(n){return'href="'+Tn(n)+'"'}function No(n){return'link[rel="stylesheet"]['+n+"]"}function f0(n){return y({},n,{"data-precedence":n.precedence,precedence:null})}function U_(n,i,o,u){n.querySelector('link[rel="preload"][as="style"]['+i+"]")?u.loading=1:(i=n.createElement("link"),u.preload=i,i.addEventListener("load",function(){return u.loading|=1}),i.addEventListener("error",function(){return u.loading|=2}),Xt(i,"link",o),Lt(i),n.head.appendChild(i))}function ur(n){return'[src="'+Tn(n)+'"]'}function _o(n){return"script[async]"+n}function h0(n,i,o){if(i.count++,i.instance===null)switch(i.type){case"style":var u=n.querySelector('style[data-href~="'+Tn(o.href)+'"]');if(u)return i.instance=u,Lt(u),u;var h=y({},o,{"data-href":o.href,"data-precedence":o.precedence,href:null,precedence:null});return u=(n.ownerDocument||n).createElement("style"),Lt(u),Xt(u,"style",h),yc(u,o.precedence,n),i.instance=u;case"stylesheet":h=cr(o.href);var g=n.querySelector(No(h));if(g)return i.state.loading|=4,i.instance=g,Lt(g),g;u=f0(o),(h=Bn.get(h))&&lh(u,h),g=(n.ownerDocument||n).createElement("link"),Lt(g);var S=g;return S._p=new Promise(function(k,A){S.onload=k,S.onerror=A}),Xt(g,"link",u),i.state.loading|=4,yc(g,o.precedence,n),i.instance=g;case"script":return g=ur(o.src),(h=n.querySelector(_o(g)))?(i.instance=h,Lt(h),h):(u=o,(h=Bn.get(g))&&(u=y({},o),ch(u,h)),n=n.ownerDocument||n,h=n.createElement("script"),Lt(h),Xt(h,"link",u),n.head.appendChild(h),i.instance=h);case"void":return null;default:throw Error(a(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(u=i.instance,i.state.loading|=4,yc(u,o.precedence,n));return i.instance}function yc(n,i,o){for(var u=o.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),h=u.length?u[u.length-1]:null,g=h,S=0;S<u.length;S++){var k=u[S];if(k.dataset.precedence===i)g=k;else if(g!==h)break}g?g.parentNode.insertBefore(n,g.nextSibling):(i=o.nodeType===9?o.head:o,i.insertBefore(n,i.firstChild))}function lh(n,i){n.crossOrigin==null&&(n.crossOrigin=i.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=i.referrerPolicy),n.title==null&&(n.title=i.title)}function ch(n,i){n.crossOrigin==null&&(n.crossOrigin=i.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=i.referrerPolicy),n.integrity==null&&(n.integrity=i.integrity)}var vc=null;function m0(n,i,o){if(vc===null){var u=new Map,h=vc=new Map;h.set(o,u)}else h=vc,u=h.get(o),u||(u=new Map,h.set(o,u));if(u.has(n))return u;for(u.set(n,null),o=o.getElementsByTagName(n),h=0;h<o.length;h++){var g=o[h];if(!(g[us]||g[zt]||n==="link"&&g.getAttribute("rel")==="stylesheet")&&g.namespaceURI!=="http://www.w3.org/2000/svg"){var S=g.getAttribute(i)||"";S=n+S;var k=u.get(S);k?k.push(g):u.set(S,[g])}}return u}function p0(n,i,o){n=n.ownerDocument||n,n.head.insertBefore(o,i==="title"?n.querySelector("head > title"):null)}function $_(n,i,o){if(o===1||i.itemProp!=null)return!1;switch(n){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;return i.rel==="stylesheet"?(n=i.disabled,typeof i.precedence=="string"&&n==null):!0;case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function g0(n){return!(n.type==="stylesheet"&&(n.state.loading&3)===0)}function P_(n,i,o,u){if(o.type==="stylesheet"&&(typeof u.media!="string"||matchMedia(u.media).matches!==!1)&&(o.state.loading&4)===0){if(o.instance===null){var h=cr(u.href),g=i.querySelector(No(h));if(g){i=g._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(n.count++,n=bc.bind(n),i.then(n,n)),o.state.loading|=4,o.instance=g,Lt(g);return}g=i.ownerDocument||i,u=f0(u),(h=Bn.get(h))&&lh(u,h),g=g.createElement("link"),Lt(g);var S=g;S._p=new Promise(function(k,A){S.onload=k,S.onerror=A}),Xt(g,"link",u),o.instance=g}n.stylesheets===null&&(n.stylesheets=new Map),n.stylesheets.set(o,i),(i=o.state.preload)&&(o.state.loading&3)===0&&(n.count++,o=bc.bind(n),i.addEventListener("load",o),i.addEventListener("error",o))}}var uh=0;function I_(n,i){return n.stylesheets&&n.count===0&&Sc(n,n.stylesheets),0<n.count||0<n.imgCount?function(o){var u=setTimeout(function(){if(n.stylesheets&&Sc(n,n.stylesheets),n.unsuspend){var g=n.unsuspend;n.unsuspend=null,g()}},6e4+i);0<n.imgBytes&&uh===0&&(uh=62500*x_());var h=setTimeout(function(){if(n.waitingForImages=!1,n.count===0&&(n.stylesheets&&Sc(n,n.stylesheets),n.unsuspend)){var g=n.unsuspend;n.unsuspend=null,g()}},(n.imgBytes>uh?50:800)+i);return n.unsuspend=o,function(){n.unsuspend=null,clearTimeout(u),clearTimeout(h)}}:null}function bc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Sc(this,this.stylesheets);else if(this.unsuspend){var n=this.unsuspend;this.unsuspend=null,n()}}}var xc=null;function Sc(n,i){n.stylesheets=null,n.unsuspend!==null&&(n.count++,xc=new Map,i.forEach(B_,n),xc=null,bc.call(n))}function B_(n,i){if(!(i.state.loading&4)){var o=xc.get(n);if(o)var u=o.get(null);else{o=new Map,xc.set(n,o);for(var h=n.querySelectorAll("link[data-precedence],style[data-precedence]"),g=0;g<h.length;g++){var S=h[g];(S.nodeName==="LINK"||S.getAttribute("media")!=="not all")&&(o.set(S.dataset.precedence,S),u=S)}u&&o.set(null,u)}h=i.instance,S=h.getAttribute("data-precedence"),g=o.get(S)||u,g===u&&o.set(null,h),o.set(S,h),this.count++,u=bc.bind(this),h.addEventListener("load",u),h.addEventListener("error",u),g?g.parentNode.insertBefore(h,g.nextSibling):(n=n.nodeType===9?n.head:n,n.insertBefore(h,n.firstChild)),i.state.loading|=4}}var Co={$$typeof:O,Provider:null,Consumer:null,_currentValue:oe,_currentValue2:oe,_threadCount:0};function q_(n,i,o,u,h,g,S,k,A){this.tag=1,this.containerInfo=n,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=Oa(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Oa(0),this.hiddenUpdates=Oa(null),this.identifierPrefix=u,this.onUncaughtError=h,this.onCaughtError=g,this.onRecoverableError=S,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=A,this.incompleteTransitions=new Map}function y0(n,i,o,u,h,g,S,k,A,q,V,J){return n=new q_(n,i,o,S,A,q,V,J,k),i=1,g===!0&&(i|=24),g=_n(3,null,null,i),n.current=g,g.stateNode=n,i=qd(),i.refCount++,n.pooledCache=i,i.refCount++,g.memoizedState={element:u,isDehydrated:o,cache:i},Gd(g),n}function v0(n){return n?(n=Ba,n):Ba}function b0(n,i,o,u,h,g){h=v0(h),u.context===null?u.context=h:u.pendingContext=h,u=ii(i),u.payload={element:o},g=g===void 0?null:g,g!==null&&(u.callback=g),o=ai(n,u,i),o!==null&&(yn(o,n,i),so(o,n,i))}function x0(n,i){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var o=n.retryLane;n.retryLane=o!==0&&o<i?o:i}}function dh(n,i){x0(n,i),(n=n.alternate)&&x0(n,i)}function S0(n){if(n.tag===13||n.tag===31){var i=Ki(n,67108864);i!==null&&yn(i,n,67108864),dh(n,67108864)}}function w0(n){if(n.tag===13||n.tag===31){var i=On();i=$(i);var o=Ki(n,i);o!==null&&yn(o,n,i),dh(n,i)}}var wc=!0;function H_(n,i,o,u){var h=H.T;H.T=null;var g=Z.p;try{Z.p=2,fh(n,i,o,u)}finally{Z.p=g,H.T=h}}function Z_(n,i,o,u){var h=H.T;H.T=null;var g=Z.p;try{Z.p=8,fh(n,i,o,u)}finally{Z.p=g,H.T=h}}function fh(n,i,o,u){if(wc){var h=hh(u);if(h===null)Jf(n,i,u,jc,o),N0(n,u);else if(G_(h,n,i,o,u))u.stopPropagation();else if(N0(n,u),i&4&&-1<F_.indexOf(n)){for(;h!==null;){var g=Yn(h);if(g!==null)switch(g.tag){case 3:if(g=g.stateNode,g.current.memoizedState.isDehydrated){var S=ls(g.pendingLanes);if(S!==0){var k=g;for(k.pendingLanes|=2,k.entangledLanes|=2;S;){var A=1<<31-te(S);k.entanglements[1]|=A,S&=~A}ps(g),(Ke&6)===0&&(ac=$e()+500,xo(0))}}break;case 31:case 13:k=Ki(g,2),k!==null&&yn(k,g,2),oc(),dh(g,2)}if(g=hh(u),g===null&&Jf(n,i,u,jc,o),g===h)break;h=g}h!==null&&u.stopPropagation()}else Jf(n,i,u,null,o)}}function hh(n){return n=md(n),mh(n)}var jc=null;function mh(n){if(jc=null,n=Ys(n),n!==null){var i=c(n);if(i===null)n=null;else{var o=i.tag;if(o===13){if(n=d(i),n!==null)return n;n=null}else if(o===31){if(n=f(i),n!==null)return n;n=null}else if(o===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;n=null}else i!==n&&(n=null)}}return jc=n,null}function j0(n){switch(n){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(ke()){case Te:return 2;case kt:return 8;case Qn:case bs:return 32;case Fs:return 268435456;default:return 32}default:return 32}}var ph=!1,gi=null,yi=null,vi=null,ko=new Map,zo=new Map,bi=[],F_="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 N0(n,i){switch(n){case"focusin":case"focusout":gi=null;break;case"dragenter":case"dragleave":yi=null;break;case"mouseover":case"mouseout":vi=null;break;case"pointerover":case"pointerout":ko.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":zo.delete(i.pointerId)}}function Eo(n,i,o,u,h,g){return n===null||n.nativeEvent!==g?(n={blockedOn:i,domEventName:o,eventSystemFlags:u,nativeEvent:g,targetContainers:[h]},i!==null&&(i=Yn(i),i!==null&&S0(i)),n):(n.eventSystemFlags|=u,i=n.targetContainers,h!==null&&i.indexOf(h)===-1&&i.push(h),n)}function G_(n,i,o,u,h){switch(i){case"focusin":return gi=Eo(gi,n,i,o,u,h),!0;case"dragenter":return yi=Eo(yi,n,i,o,u,h),!0;case"mouseover":return vi=Eo(vi,n,i,o,u,h),!0;case"pointerover":var g=h.pointerId;return ko.set(g,Eo(ko.get(g)||null,n,i,o,u,h)),!0;case"gotpointercapture":return g=h.pointerId,zo.set(g,Eo(zo.get(g)||null,n,i,o,u,h)),!0}return!1}function _0(n){var i=Ys(n.target);if(i!==null){var o=c(i);if(o!==null){if(i=o.tag,i===13){if(i=d(o),i!==null){n.blockedOn=i,Kt(n.priority,function(){w0(o)});return}}else if(i===31){if(i=f(o),i!==null){n.blockedOn=i,Kt(n.priority,function(){w0(o)});return}}else if(i===3&&o.stateNode.current.memoizedState.isDehydrated){n.blockedOn=o.tag===3?o.stateNode.containerInfo:null;return}}}n.blockedOn=null}function Nc(n){if(n.blockedOn!==null)return!1;for(var i=n.targetContainers;0<i.length;){var o=hh(n.nativeEvent);if(o===null){o=n.nativeEvent;var u=new o.constructor(o.type,o);hd=u,o.target.dispatchEvent(u),hd=null}else return i=Yn(o),i!==null&&S0(i),n.blockedOn=o,!1;i.shift()}return!0}function C0(n,i,o){Nc(n)&&o.delete(i)}function K_(){ph=!1,gi!==null&&Nc(gi)&&(gi=null),yi!==null&&Nc(yi)&&(yi=null),vi!==null&&Nc(vi)&&(vi=null),ko.forEach(C0),zo.forEach(C0)}function _c(n,i){n.blockedOn===i&&(n.blockedOn=null,ph||(ph=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,K_)))}var Cc=null;function k0(n){Cc!==n&&(Cc=n,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Cc===n&&(Cc=null);for(var i=0;i<n.length;i+=3){var o=n[i],u=n[i+1],h=n[i+2];if(typeof u!="function"){if(mh(u||o)===null)continue;break}var g=Yn(o);g!==null&&(n.splice(i,3),i-=3,hf(g,{pending:!0,data:h,method:o.method,action:u},u,h))}}))}function dr(n){function i(A){return _c(A,n)}gi!==null&&_c(gi,n),yi!==null&&_c(yi,n),vi!==null&&_c(vi,n),ko.forEach(i),zo.forEach(i);for(var o=0;o<bi.length;o++){var u=bi[o];u.blockedOn===n&&(u.blockedOn=null)}for(;0<bi.length&&(o=bi[0],o.blockedOn===null);)_0(o),o.blockedOn===null&&bi.shift();if(o=(n.ownerDocument||n).$$reactFormReplay,o!=null)for(u=0;u<o.length;u+=3){var h=o[u],g=o[u+1],S=h[wt]||null;if(typeof g=="function")S||k0(o);else if(S){var k=null;if(g&&g.hasAttribute("formAction")){if(h=g,S=g[wt]||null)k=S.formAction;else if(mh(h)!==null)continue}else k=S.action;typeof k=="function"?o[u+1]=k:(o.splice(u,3),u-=3),k0(o)}}}function z0(){function n(g){g.canIntercept&&g.info==="react-transition"&&g.intercept({handler:function(){return new Promise(function(S){return h=S})},focusReset:"manual",scroll:"manual"})}function i(){h!==null&&(h(),h=null),u||setTimeout(o,20)}function o(){if(!u&&!navigation.transition){var g=navigation.currentEntry;g&&g.url!=null&&navigation.navigate(g.url,{state:g.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var u=!1,h=null;return navigation.addEventListener("navigate",n),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(o,100),function(){u=!0,navigation.removeEventListener("navigate",n),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),h!==null&&(h(),h=null)}}}function gh(n){this._internalRoot=n}kc.prototype.render=gh.prototype.render=function(n){var i=this._internalRoot;if(i===null)throw Error(a(409));var o=i.current,u=On();b0(o,u,n,i,null,null)},kc.prototype.unmount=gh.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var i=n.containerInfo;b0(n.current,2,null,n,null,null),oc(),i[jn]=null}};function kc(n){this._internalRoot=n}kc.prototype.unstable_scheduleHydration=function(n){if(n){var i=et();n={blockedOn:null,target:n,priority:i};for(var o=0;o<bi.length&&i!==0&&i<bi[o].priority;o++);bi.splice(o,0,n),o===0&&_0(n)}};var E0=t.version;if(E0!=="19.2.4")throw Error(a(527,E0,"19.2.4"));Z.findDOMNode=function(n){var i=n._reactInternals;if(i===void 0)throw typeof n.render=="function"?Error(a(188)):(n=Object.keys(n).join(","),Error(a(268,n)));return n=m(i),n=n!==null?v(n):null,n=n===null?null:n.stateNode,n};var V_={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:H,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var zc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!zc.isDisabled&&zc.supportsFiber)try{os=zc.inject(V_),_e=zc}catch{}}return Ro.createRoot=function(n,i){if(!r(n))throw Error(a(299));var o=!1,u="",h=My,g=Uy,S=$y;return i!=null&&(i.unstable_strictMode===!0&&(o=!0),i.identifierPrefix!==void 0&&(u=i.identifierPrefix),i.onUncaughtError!==void 0&&(h=i.onUncaughtError),i.onCaughtError!==void 0&&(g=i.onCaughtError),i.onRecoverableError!==void 0&&(S=i.onRecoverableError)),i=y0(n,1,!1,null,null,o,u,null,h,g,S,z0),n[jn]=i.current,Xf(n),new gh(i)},Ro.hydrateRoot=function(n,i,o){if(!r(n))throw Error(a(299));var u=!1,h="",g=My,S=Uy,k=$y,A=null;return o!=null&&(o.unstable_strictMode===!0&&(u=!0),o.identifierPrefix!==void 0&&(h=o.identifierPrefix),o.onUncaughtError!==void 0&&(g=o.onUncaughtError),o.onCaughtError!==void 0&&(S=o.onCaughtError),o.onRecoverableError!==void 0&&(k=o.onRecoverableError),o.formState!==void 0&&(A=o.formState)),i=y0(n,1,!0,i,o??null,u,h,A,g,S,k,z0),i.context=v0(null),o=i.current,u=On(),u=$(u),h=ii(u),h.callback=null,ai(o,h,u),o=u,i.current.lanes=o,Hi(i,o),ps(i),n[jn]=i.current,Xf(n),new kc(i)},Ro.version="19.2.4",Ro}var P0;function iC(){if(P0)return bh.exports;P0=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(),bh.exports=sC(),bh.exports}var aC=iC(),Dr=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(){}},rC={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},oC=class{#t=rC;#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)}},ua=new oC;function lC(e){setTimeout(e,0)}var xa=typeof window>"u"||"Deno"in globalThis;function ln(){}function cC(e,t){return typeof e=="function"?e(t):e}function Jh(e){return typeof e=="number"&&e>=0&&e!==1/0}function Px(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Oi(e,t){return typeof e=="function"?e(t):e}function qn(e,t){return typeof e=="function"?e(t):e}function I0(e,t){const{type:s="all",exact:a,fetchStatus:r,predicate:c,queryKey:d,stale:f}=e;if(d){if(a){if(t.queryHash!==Lm(d,t.options))return!1}else if(!Ko(t.queryKey,d))return!1}if(s!=="all"){const p=t.isActive();if(s==="active"&&!p||s==="inactive"&&p)return!1}return!(typeof f=="boolean"&&t.isStale()!==f||r&&r!==t.state.fetchStatus||c&&!c(t))}function B0(e,t){const{exact:s,status:a,predicate:r,mutationKey:c}=e;if(c){if(!t.options.mutationKey)return!1;if(s){if(Go(t.options.mutationKey)!==Go(c))return!1}else if(!Ko(t.options.mutationKey,c))return!1}return!(a&&t.state.status!==a||r&&!r(t))}function Lm(e,t){return(t?.queryKeyHashFn||Go)(e)}function Go(e){return JSON.stringify(e,(t,s)=>Wh(s)?Object.keys(s).sort().reduce((a,r)=>(a[r]=s[r],a),{}):s)}function Ko(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(s=>Ko(e[s],t[s])):!1}var uC=Object.prototype.hasOwnProperty;function Mm(e,t,s=0){if(e===t)return e;if(s>500)return t;const a=q0(e)&&q0(t);if(!a&&!(Wh(e)&&Wh(t)))return t;const c=(a?e:Object.keys(e)).length,d=a?t:Object.keys(t),f=d.length,p=a?new Array(f):{};let m=0;for(let v=0;v<f;v++){const y=a?v:d[v],b=e[y],x=t[y];if(b===x){p[y]=b,(a?v<c:uC.call(e,y))&&m++;continue}if(b===null||x===null||typeof b!="object"||typeof x!="object"){p[y]=x;continue}const j=Mm(b,x,s+1);p[y]=j,j===b&&m++}return c===f&&m===c?e:p}function ru(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const s in e)if(e[s]!==t[s])return!1;return!0}function q0(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Wh(e){if(!H0(e))return!1;const t=e.constructor;if(t===void 0)return!0;const s=t.prototype;return!(!H0(s)||!s.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function H0(e){return Object.prototype.toString.call(e)==="[object Object]"}function dC(e){return new Promise(t=>{ua.setTimeout(t,e)})}function em(e,t,s){return typeof s.structuralSharing=="function"?s.structuralSharing(e,t):s.structuralSharing!==!1?Mm(e,t):t}function fC(e,t,s=0){const a=[...e,t];return s&&a.length>s?a.slice(1):a}function hC(e,t,s=0){const a=[t,...e];return s&&a.length>s?a.slice(0,-1):a}var Um=Symbol();function Ix(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Um?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Bx(e,t){return typeof e=="function"?e(...t):!!e}function mC(e,t,s){let a=!1,r;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(r??=t(),a||(a=!0,r.aborted?s():r.addEventListener("abort",s,{once:!0})),r)}),e}var pC=class extends Dr{#t;#e;#n;constructor(){super(),this.#n=e=>{if(!xa&&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"}},$m=new pC;function tm(){let e,t;const s=new Promise((r,c)=>{e=r,t=c});s.status="pending",s.catch(()=>{});function a(r){Object.assign(s,r),delete s.resolve,delete s.reject}return s.resolve=r=>{a({status:"fulfilled",value:r}),e(r)},s.reject=r=>{a({status:"rejected",reason:r}),t(r)},s}var gC=lC;function yC(){let e=[],t=0,s=f=>{f()},a=f=>{f()},r=gC;const c=f=>{t?e.push(f):r(()=>{s(f)})},d=()=>{const f=e;e=[],f.length&&r(()=>{a(()=>{f.forEach(p=>{s(p)})})})};return{batch:f=>{let p;t++;try{p=f()}finally{t--,t||d()}return p},batchCalls:f=>(...p)=>{c(()=>{f(...p)})},schedule:c,setNotifyFunction:f=>{s=f},setBatchNotifyFunction:f=>{a=f},setScheduler:f=>{r=f}}}var It=yC(),vC=class extends Dr{#t=!0;#e;#n;constructor(){super(),this.#n=e=>{if(!xa&&window.addEventListener){const t=()=>e(!0),s=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",s)}}}}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(s=>{s(e)}))}isOnline(){return this.#t}},ou=new vC;function bC(e){return Math.min(1e3*2**e,3e4)}function qx(e){return(e??"online")==="online"?ou.isOnline():!0}var nm=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function Hx(e){let t=!1,s=0,a;const r=tm(),c=()=>r.status!=="pending",d=w=>{if(!c()){const _=new nm(w);b(_),e.onCancel?.(_)}},f=()=>{t=!0},p=()=>{t=!1},m=()=>$m.isFocused()&&(e.networkMode==="always"||ou.isOnline())&&e.canRun(),v=()=>qx(e.networkMode)&&e.canRun(),y=w=>{c()||(a?.(),r.resolve(w))},b=w=>{c()||(a?.(),r.reject(w))},x=()=>new Promise(w=>{a=_=>{(c()||m())&&w(_)},e.onPause?.()}).then(()=>{a=void 0,c()||e.onContinue?.()}),j=()=>{if(c())return;let w;const _=s===0?e.initialPromise:void 0;try{w=_??e.fn()}catch(C){w=Promise.reject(C)}Promise.resolve(w).then(y).catch(C=>{if(c())return;const E=e.retry??(xa?0:3),O=e.retryDelay??bC,z=typeof O=="function"?O(s,C):O,M=E===!0||typeof E=="number"&&s<E||typeof E=="function"&&E(s,C);if(t||!M){b(C);return}s++,e.onFail?.(s,C),dC(z).then(()=>m()?void 0:x()).then(()=>{t?b(C):j()})})};return{promise:r,status:()=>r.status,cancel:d,continue:()=>(a?.(),r),cancelRetry:f,continueRetry:p,canStart:v,start:()=>(v()?j():x().then(j),r)}}var Zx=class{#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Jh(this.gcTime)&&(this.#t=ua.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(xa?1/0:300*1e3))}clearGcTimeout(){this.#t&&(ua.clearTimeout(this.#t),this.#t=void 0)}},xC=class extends Zx{#t;#e;#n;#i;#s;#r;#o;constructor(e){super(),this.#o=!1,this.#r=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=F0(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#s?.promise}setOptions(e){if(this.options={...this.#r,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=F0(this.options);t.data!==void 0&&(this.setState(Z0(t.data,t.dataUpdatedAt)),this.#t=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const s=em(this.state.data,e,this.options);return this.#a({data:s,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),s}setState(e,t){this.#a({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#s?.promise;return this.#s?.cancel(e),t?t.then(ln).catch(ln):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#t)}isActive(){return this.observers.some(e=>qn(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Um||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Oi(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:!Px(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#s?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#s?.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.#s&&(this.#o?this.#s.cancel({revert:!0}):this.#s.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#a({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#s?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#s)return this.#s.continueRetry(),this.#s.promise}if(e&&this.setOptions(e),!this.options.queryFn){const f=this.observers.find(p=>p.options.queryFn);f&&this.setOptions(f.options)}const s=new AbortController,a=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(this.#o=!0,s.signal)})},r=()=>{const f=Ix(this.options,t),m=(()=>{const v={client:this.#i,queryKey:this.queryKey,meta:this.meta};return a(v),v})();return this.#o=!1,this.options.persister?this.options.persister(f,m,this):f(m)},d=(()=>{const f={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:r};return a(f),f})();this.options.behavior?.onFetch(d,this),this.#e=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==d.fetchOptions?.meta)&&this.#a({type:"fetch",meta:d.fetchOptions?.meta}),this.#s=Hx({initialPromise:t?.initialPromise,fn:d.fetchFn,onCancel:f=>{f instanceof nm&&f.revert&&this.setState({...this.#e,fetchStatus:"idle"}),s.abort()},onFail:(f,p)=>{this.#a({type:"failed",failureCount:f,error:p})},onPause:()=>{this.#a({type:"pause"})},onContinue:()=>{this.#a({type:"continue"})},retry:d.options.retry,retryDelay:d.options.retryDelay,networkMode:d.options.networkMode,canRun:()=>!0});try{const f=await this.#s.start();if(f===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(f),this.#n.config.onSuccess?.(f,this),this.#n.config.onSettled?.(f,this.state.error,this),f}catch(f){if(f instanceof nm){if(f.silent)return this.#s.promise;if(f.revert){if(this.state.data===void 0)throw f;return this.state.data}}throw this.#a({type:"error",error:f}),this.#n.config.onError?.(f,this),this.#n.config.onSettled?.(this.state.data,f,this),f}finally{this.scheduleGc()}}#a(e){const t=s=>{switch(e.type){case"failed":return{...s,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...s,fetchStatus:"paused"};case"continue":return{...s,fetchStatus:"fetching"};case"fetch":return{...s,...Fx(s.data,this.options),fetchMeta:e.meta??null};case"success":const a={...s,...Z0(e.data,e.dataUpdatedAt),dataUpdateCount:s.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#e=e.manual?a:void 0,a;case"error":const r=e.error;return{...s,error:r,errorUpdateCount:s.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:s.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...s,isInvalidated:!0};case"setState":return{...s,...e.state}}};this.state=t(this.state),It.batch(()=>{this.observers.forEach(s=>{s.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function Fx(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:qx(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Z0(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function F0(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,s=t!==void 0,a=s?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:s?a??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}var Pm=class extends Dr{constructor(e,t){super(),this.options=t,this.#t=e,this.#a=null,this.#o=tm(),this.bindMethods(),this.setOptions(t)}#t;#e=void 0;#n=void 0;#i=void 0;#s;#r;#o;#a;#m;#d;#f;#c;#u;#l;#h=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#e.addObserver(this),G0(this.#e,this.options)?this.#p():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return sm(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return sm(this.#e,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#S(),this.#e.removeObserver(this)}setOptions(e){const t=this.options,s=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 qn(this.options.enabled,this.#e)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#w(),this.#e.setOptions(this.options),t._defaulted&&!ru(this.options,t)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const a=this.hasListeners();a&&K0(this.#e,s,this.options,t)&&this.#p(),this.updateResult(),a&&(this.#e!==s||qn(this.options.enabled,this.#e)!==qn(t.enabled,this.#e)||Oi(this.options.staleTime,this.#e)!==Oi(t.staleTime,this.#e))&&this.#g();const r=this.#y();a&&(this.#e!==s||qn(this.options.enabled,this.#e)!==qn(t.enabled,this.#e)||r!==this.#l)&&this.#v(r)}getOptimisticResult(e){const t=this.#t.getQueryCache().build(this.#t,e),s=this.createResult(t,e);return wC(this,s)&&(this.#i=s,this.#r=this.options,this.#s=this.#e.state),s}getCurrentResult(){return this.#i}trackResult(e,t){return new Proxy(e,{get:(s,a)=>(this.trackProp(a),t?.(a),a==="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(s,a))})}trackProp(e){this.#h.add(e)}getCurrentQuery(){return this.#e}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#t.defaultQueryOptions(e),s=this.#t.getQueryCache().build(this.#t,t);return s.fetch().then(()=>this.createResult(s,t))}fetch(e){return this.#p({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#i))}#p(e){this.#w();let t=this.#e.fetch(this.options,e);return e?.throwOnError||(t=t.catch(ln)),t}#g(){this.#x();const e=Oi(this.options.staleTime,this.#e);if(xa||this.#i.isStale||!Jh(e))return;const s=Px(this.#i.dataUpdatedAt,e)+1;this.#c=ua.setTimeout(()=>{this.#i.isStale||this.updateResult()},s)}#y(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#e):this.options.refetchInterval)??!1}#v(e){this.#S(),this.#l=e,!(xa||qn(this.options.enabled,this.#e)===!1||!Jh(this.#l)||this.#l===0)&&(this.#u=ua.setInterval(()=>{(this.options.refetchIntervalInBackground||$m.isFocused())&&this.#p()},this.#l))}#b(){this.#g(),this.#v(this.#y())}#x(){this.#c&&(ua.clearTimeout(this.#c),this.#c=void 0)}#S(){this.#u&&(ua.clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const s=this.#e,a=this.options,r=this.#i,c=this.#s,d=this.#r,p=e!==s?e.state:this.#n,{state:m}=e;let v={...m},y=!1,b;if(t._optimisticResults){const R=this.hasListeners(),I=!R&&G0(e,t),ie=R&&K0(e,s,t,a);(I||ie)&&(v={...v,...Fx(m.data,e.options)}),t._optimisticResults==="isRestoring"&&(v.fetchStatus="idle")}let{error:x,errorUpdatedAt:j,status:w}=v;b=v.data;let _=!1;if(t.placeholderData!==void 0&&b===void 0&&w==="pending"){let R;r?.isPlaceholderData&&t.placeholderData===d?.placeholderData?(R=r.data,_=!0):R=typeof t.placeholderData=="function"?t.placeholderData(this.#f?.state.data,this.#f):t.placeholderData,R!==void 0&&(w="success",b=em(r?.data,R,t),y=!0)}if(t.select&&b!==void 0&&!_)if(r&&b===c?.data&&t.select===this.#m)b=this.#d;else try{this.#m=t.select,b=t.select(b),b=em(r?.data,b,t),this.#d=b,this.#a=null}catch(R){this.#a=R}this.#a&&(x=this.#a,b=this.#d,j=Date.now(),w="error");const C=v.fetchStatus==="fetching",E=w==="pending",O=w==="error",z=E&&C,M=b!==void 0,L={status:w,fetchStatus:v.fetchStatus,isPending:E,isSuccess:w==="success",isError:O,isInitialLoading:z,isLoading:z,data:b,dataUpdatedAt:v.dataUpdatedAt,error:x,errorUpdatedAt:j,failureCount:v.fetchFailureCount,failureReason:v.fetchFailureReason,errorUpdateCount:v.errorUpdateCount,isFetched:v.dataUpdateCount>0||v.errorUpdateCount>0,isFetchedAfterMount:v.dataUpdateCount>p.dataUpdateCount||v.errorUpdateCount>p.errorUpdateCount,isFetching:C,isRefetching:C&&!E,isLoadingError:O&&!M,isPaused:v.fetchStatus==="paused",isPlaceholderData:y,isRefetchError:O&&M,isStale:Im(e,t),refetch:this.refetch,promise:this.#o,isEnabled:qn(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const R=L.data!==void 0,I=L.status==="error"&&!R,ie=me=>{I?me.reject(L.error):R&&me.resolve(L.data)},Q=()=>{const me=this.#o=L.promise=tm();ie(me)},se=this.#o;switch(se.status){case"pending":e.queryHash===s.queryHash&&ie(se);break;case"fulfilled":(I||L.data!==se.value)&&Q();break;case"rejected":(!I||L.error!==se.reason)&&Q();break}}return L}updateResult(){const e=this.#i,t=this.createResult(this.#e,this.options);if(this.#s=this.#e.state,this.#r=this.options,this.#s.data!==void 0&&(this.#f=this.#e),ru(t,e))return;this.#i=t;const s=()=>{if(!e)return!0;const{notifyOnChangeProps:a}=this.options,r=typeof a=="function"?a():a;if(r==="all"||!r&&!this.#h.size)return!0;const c=new Set(r??this.#h);return this.options.throwOnError&&c.add("error"),Object.keys(this.#i).some(d=>{const f=d;return this.#i[f]!==e[f]&&c.has(f)})};this.#j({listeners:s()})}#w(){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){It.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#i)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function SC(e,t){return qn(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function G0(e,t){return SC(e,t)||e.state.data!==void 0&&sm(e,t,t.refetchOnMount)}function sm(e,t,s){if(qn(t.enabled,e)!==!1&&Oi(t.staleTime,e)!=="static"){const a=typeof s=="function"?s(e):s;return a==="always"||a!==!1&&Im(e,t)}return!1}function K0(e,t,s,a){return(e!==t||qn(a.enabled,e)===!1)&&(!s.suspense||e.state.status!=="error")&&Im(e,s)}function Im(e,t){return qn(t.enabled,e)!==!1&&e.isStaleByTime(Oi(t.staleTime,e))}function wC(e,t){return!ru(e.getCurrentResult(),t)}function V0(e){return{onFetch:(t,s)=>{const a=t.options,r=t.fetchOptions?.meta?.fetchMore?.direction,c=t.state.data?.pages||[],d=t.state.data?.pageParams||[];let f={pages:[],pageParams:[]},p=0;const m=async()=>{let v=!1;const y=j=>{mC(j,()=>t.signal,()=>v=!0)},b=Ix(t.options,t.fetchOptions),x=async(j,w,_)=>{if(v)return Promise.reject();if(w==null&&j.pages.length)return Promise.resolve(j);const E=(()=>{const T={client:t.client,queryKey:t.queryKey,pageParam:w,direction:_?"backward":"forward",meta:t.options.meta};return y(T),T})(),O=await b(E),{maxPages:z}=t.options,M=_?hC:fC;return{pages:M(j.pages,O,z),pageParams:M(j.pageParams,w,z)}};if(r&&c.length){const j=r==="backward",w=j?jC:Q0,_={pages:c,pageParams:d},C=w(a,_);f=await x(_,C,j)}else{const j=e??c.length;do{const w=p===0?d[0]??a.initialPageParam:Q0(a,f);if(p>0&&w==null)break;f=await x(f,w),p++}while(p<j)}return f};t.options.persister?t.fetchFn=()=>t.options.persister?.(m,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},s):t.fetchFn=m}}}function Q0(e,{pages:t,pageParams:s}){const a=t.length-1;return t.length>0?e.getNextPageParam(t[a],t,s[a],s):void 0}function jC(e,{pages:t,pageParams:s}){return t.length>0?e.getPreviousPageParam?.(t[0],t,s[0],s):void 0}var NC=class extends Zx{#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||_C(),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.#s({type:"continue"})},s={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#i=Hx({fn:()=>this.options.mutationFn?this.options.mutationFn(e,s):Promise.reject(new Error("No mutationFn found")),onFail:(c,d)=>{this.#s({type:"failed",failureCount:c,error:d})},onPause:()=>{this.#s({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const a=this.state.status==="pending",r=!this.#i.canStart();try{if(a)t();else{this.#s({type:"pending",variables:e,isPaused:r}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,s);const d=await this.options.onMutate?.(e,s);d!==this.state.context&&this.#s({type:"pending",context:d,variables:e,isPaused:r})}const c=await this.#i.start();return await this.#n.config.onSuccess?.(c,e,this.state.context,this,s),await this.options.onSuccess?.(c,e,this.state.context,s),await this.#n.config.onSettled?.(c,null,this.state.variables,this.state.context,this,s),await this.options.onSettled?.(c,null,e,this.state.context,s),this.#s({type:"success",data:c}),c}catch(c){try{await this.#n.config.onError?.(c,e,this.state.context,this,s)}catch(d){Promise.reject(d)}try{await this.options.onError?.(c,e,this.state.context,s)}catch(d){Promise.reject(d)}try{await this.#n.config.onSettled?.(void 0,c,this.state.variables,this.state.context,this,s)}catch(d){Promise.reject(d)}try{await this.options.onSettled?.(void 0,c,e,this.state.context,s)}catch(d){Promise.reject(d)}throw this.#s({type:"error",error:c}),c}finally{this.#n.runNext(this)}}#s(e){const t=s=>{switch(e.type){case"failed":return{...s,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...s,isPaused:!0};case"continue":return{...s,isPaused:!1};case"pending":return{...s,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{...s,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...s,data:void 0,error:e.error,failureCount:s.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),It.batch(()=>{this.#e.forEach(s=>{s.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function _C(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Gx=class extends Dr{constructor(e={}){super(),this.config=e,this.#t=new Set,this.#e=new Map,this.#n=0}#t;#e;#n;build(e,t,s){const a=new NC({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:s});return this.add(a),a}add(e){this.#t.add(e);const t=Ec(e);if(typeof t=="string"){const s=this.#e.get(t);s?s.push(e):this.#e.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#t.delete(e)){const t=Ec(e);if(typeof t=="string"){const s=this.#e.get(t);if(s)if(s.length>1){const a=s.indexOf(e);a!==-1&&s.splice(a,1)}else s[0]===e&&this.#e.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=Ec(e);if(typeof t=="string"){const a=this.#e.get(t)?.find(r=>r.state.status==="pending");return!a||a===e}else return!0}runNext(e){const t=Ec(e);return typeof t=="string"?this.#e.get(t)?.find(a=>a!==e&&a.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){It.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(s=>B0(t,s))}findAll(e={}){return this.getAll().filter(t=>B0(e,t))}notify(e){It.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return It.batch(()=>Promise.all(e.map(t=>t.continue().catch(ln))))}};function Ec(e){return e.options.scope?.id}function Y0(e,t){const s=new Set(t);return e.filter(a=>!s.has(a))}function CC(e,t,s){const a=e.slice(0);return a[t]=s,a}var kC=class extends Dr{#t;#e;#n;#i;#s;#r;#o;#a;#m;#d=[];constructor(e,t,s){super(),this.#t=e,this.#i=s,this.#n=[],this.#s=[],this.#e=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#s.forEach(e=>{e.subscribe(t=>{this.#l(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#s.forEach(e=>{e.destroy()})}setQueries(e,t){this.#n=e,this.#i=t,It.batch(()=>{const s=this.#s,a=this.#u(this.#n);a.forEach(v=>v.observer.setOptions(v.defaultedQueryOptions));const r=a.map(v=>v.observer),c=r.map(v=>v.getCurrentResult()),d=s.length!==r.length,f=r.some((v,y)=>v!==s[y]),p=d||f,m=p?!0:c.some((v,y)=>{const b=this.#e[y];return!b||!ru(v,b)});!p&&!m||(p&&(this.#d=a,this.#s=r),this.#e=c,this.hasListeners()&&(p&&(Y0(s,r).forEach(v=>{v.destroy()}),Y0(r,s).forEach(v=>{v.subscribe(y=>{this.#l(v,y)})})),this.#h()))})}getCurrentResult(){return this.#e}getQueries(){return this.#s.map(e=>e.getCurrentQuery())}getObservers(){return this.#s}getOptimisticResult(e,t){const s=this.#u(e),a=s.map(c=>c.observer.getOptimisticResult(c.defaultedQueryOptions)),r=s.map(c=>c.defaultedQueryOptions.queryHash);return[a,c=>this.#c(c??a,t,r),()=>this.#f(a,s)]}#f(e,t){return t.map((s,a)=>{const r=e[a];return s.defaultedQueryOptions.notifyOnChangeProps?r:s.observer.trackResult(r,c=>{t.forEach(d=>{d.observer.trackProp(c)})})})}#c(e,t,s){if(t){const a=this.#m,r=s!==void 0&&a!==void 0&&(a.length!==s.length||s.some((c,d)=>c!==a[d]));return(!this.#r||this.#e!==this.#a||r||t!==this.#o)&&(this.#o=t,this.#a=this.#e,s!==void 0&&(this.#m=s),this.#r=Mm(this.#r,t(e))),this.#r}return e}#u(e){const t=new Map;this.#s.forEach(a=>{const r=a.options.queryHash;if(!r)return;const c=t.get(r);c?c.push(a):t.set(r,[a])});const s=[];return e.forEach(a=>{const r=this.#t.defaultQueryOptions(a),d=t.get(r.queryHash)?.shift()??new Pm(this.#t,r);s.push({defaultedQueryOptions:r,observer:d})}),s}#l(e,t){const s=this.#s.indexOf(e);s!==-1&&(this.#e=CC(this.#e,s,t),this.#h())}#h(){if(this.hasListeners()){const e=this.#r,t=this.#f(this.#e,this.#d),s=this.#c(t,this.#i?.combine);e!==s&&It.batch(()=>{this.listeners.forEach(a=>{a(this.#e)})})}}},zC=class extends Dr{constructor(e={}){super(),this.config=e,this.#t=new Map}#t;build(e,t,s){const a=t.queryKey,r=t.queryHash??Lm(a,t);let c=this.get(r);return c||(c=new xC({client:e,queryKey:a,queryHash:r,options:e.defaultQueryOptions(t),state:s,defaultOptions:e.getQueryDefaults(a)}),this.add(c)),c}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(){It.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(s=>I0(t,s))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(s=>I0(e,s)):t}notify(e){It.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){It.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){It.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},EC=class{#t;#e;#n;#i;#s;#r;#o;#a;constructor(e={}){this.#t=e.queryCache||new zC,this.#e=e.mutationCache||new Gx,this.#n=e.defaultOptions||{},this.#i=new Map,this.#s=new Map,this.#r=0}mount(){this.#r++,this.#r===1&&(this.#o=$m.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onFocus())}),this.#a=ou.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onOnline())}))}unmount(){this.#r--,this.#r===0&&(this.#o?.(),this.#o=void 0,this.#a?.(),this.#a=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),s=this.#t.build(this,t),a=s.state.data;return a===void 0?this.fetchQuery(e):(e.revalidateIfStale&&s.isStaleByTime(Oi(t.staleTime,s))&&this.prefetchQuery(t),Promise.resolve(a))}getQueriesData(e){return this.#t.findAll(e).map(({queryKey:t,state:s})=>{const a=s.data;return[t,a]})}setQueryData(e,t,s){const a=this.defaultQueryOptions({queryKey:e}),c=this.#t.get(a.queryHash)?.state.data,d=cC(t,c);if(d!==void 0)return this.#t.build(this,a).setData(d,{...s,manual:!0})}setQueriesData(e,t,s){return It.batch(()=>this.#t.findAll(e).map(({queryKey:a})=>[a,this.setQueryData(a,t,s)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#t.get(t.queryHash)?.state}removeQueries(e){const t=this.#t;It.batch(()=>{t.findAll(e).forEach(s=>{t.remove(s)})})}resetQueries(e,t){const s=this.#t;return It.batch(()=>(s.findAll(e).forEach(a=>{a.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const s={revert:!0,...t},a=It.batch(()=>this.#t.findAll(e).map(r=>r.cancel(s)));return Promise.all(a).then(ln).catch(ln)}invalidateQueries(e,t={}){return It.batch(()=>(this.#t.findAll(e).forEach(s=>{s.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const s={...t,cancelRefetch:t.cancelRefetch??!0},a=It.batch(()=>this.#t.findAll(e).filter(r=>!r.isDisabled()&&!r.isStatic()).map(r=>{let c=r.fetch(void 0,s);return s.throwOnError||(c=c.catch(ln)),r.state.fetchStatus==="paused"?Promise.resolve():c}));return Promise.all(a).then(ln)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const s=this.#t.build(this,t);return s.isStaleByTime(Oi(t.staleTime,s))?s.fetch(t):Promise.resolve(s.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(ln).catch(ln)}fetchInfiniteQuery(e){return e.behavior=V0(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(ln).catch(ln)}ensureInfiniteQueryData(e){return e.behavior=V0(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return ou.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(Go(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#i.values()],s={};return t.forEach(a=>{Ko(e,a.queryKey)&&Object.assign(s,a.defaultOptions)}),s}setMutationDefaults(e,t){this.#s.set(Go(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#s.values()],s={};return t.forEach(a=>{Ko(e,a.mutationKey)&&Object.assign(s,a.defaultOptions)}),s}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Lm(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===Um&&(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()}},Kx=N.createContext(void 0),Vx=e=>{const t=N.useContext(Kx);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},OC=({client:e,children:t})=>(N.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),l.jsx(Kx.Provider,{value:e,children:t})),Qx=N.createContext(!1),Yx=()=>N.useContext(Qx);Qx.Provider;function RC(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var AC=N.createContext(RC()),Xx=()=>N.useContext(AC),Jx=(e,t,s)=>{const a=s?.state.error&&typeof e.throwOnError=="function"?Bx(e.throwOnError,[s.state.error,s]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||a)&&(t.isReset()||(e.retryOnMount=!1))},Wx=e=>{N.useEffect(()=>{e.clearReset()},[e])},eS=({result:e,errorResetBoundary:t,throwOnError:s,query:a,suspense:r})=>e.isError&&!t.isReset()&&!e.isFetching&&a&&(r&&e.data===void 0||Bx(s,[e.error,a])),tS=e=>{if(e.suspense){const s=r=>r==="static"?r:Math.max(r??1e3,1e3),a=e.staleTime;e.staleTime=typeof a=="function"?(...r)=>s(a(...r)):s(a),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},TC=(e,t)=>e.isLoading&&e.isFetching&&!t,im=(e,t)=>e?.suspense&&t.isPending,am=(e,t,s)=>t.fetchOptimistic(e).catch(()=>{s.clearReset()});function DC({queries:e,...t},s){const a=Vx(),r=Yx(),c=Xx(),d=N.useMemo(()=>e.map(w=>{const _=a.defaultQueryOptions(w);return _._optimisticResults=r?"isRestoring":"optimistic",_}),[e,a,r]);d.forEach(w=>{tS(w);const _=a.getQueryCache().get(w.queryHash);Jx(w,c,_)}),Wx(c);const[f]=N.useState(()=>new kC(a,d,t)),[p,m,v]=f.getOptimisticResult(d,t.combine),y=!r&&t.subscribed!==!1;N.useSyncExternalStore(N.useCallback(w=>y?f.subscribe(It.batchCalls(w)):ln,[f,y]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),N.useEffect(()=>{f.setQueries(d,t)},[d,t,f]);const x=p.some((w,_)=>im(d[_],w))?p.flatMap((w,_)=>{const C=d[_];if(C&&im(C,w)){const E=new Pm(a,C);return am(C,E,c)}return[]}):[];if(x.length>0)throw Promise.all(x);const j=p.find((w,_)=>{const C=d[_];return C&&eS({result:w,errorResetBoundary:c,throwOnError:C.throwOnError,query:a.getQueryCache().get(C.queryHash),suspense:C.suspense})});if(j?.error)throw j.error;return m(v())}function LC(e,t,s){const a=Yx(),r=Xx(),c=Vx(),d=c.defaultQueryOptions(e);c.getDefaultOptions().queries?._experimental_beforeQuery?.(d);const f=c.getQueryCache().get(d.queryHash);d._optimisticResults=a?"isRestoring":"optimistic",tS(d),Jx(d,r,f),Wx(r);const p=!c.getQueryCache().get(d.queryHash),[m]=N.useState(()=>new t(c,d)),v=m.getOptimisticResult(d),y=!a&&e.subscribed!==!1;if(N.useSyncExternalStore(N.useCallback(b=>{const x=y?m.subscribe(It.batchCalls(b)):ln;return m.updateResult(),x},[m,y]),()=>m.getCurrentResult(),()=>m.getCurrentResult()),N.useEffect(()=>{m.setOptions(d)},[d,m]),im(d,v))throw am(d,m,r);if(eS({result:v,errorResetBoundary:r,throwOnError:d.throwOnError,query:f,suspense:d.suspense}))throw v.error;return c.getDefaultOptions().queries?._experimental_afterQuery?.(d,v),d.experimental_prefetchInRender&&!xa&&TC(v,a)&&(p?am(d,m,r):f?.promise)?.catch(ln).finally(()=>{m.updateResult()}),d.notifyOnChangeProps?v:m.trackResult(v)}function Io(e,t){return LC(e,Pm)}var Oc=typeof window<"u"?N.useLayoutEffect:N.useEffect;function jh(e){const t=N.useRef({value:e,prev:null}),s=t.current.value;return e!==s&&(t.current={value:e,prev:s}),t.current.prev}function MC(e,t,s={},a={}){N.useEffect(()=>{if(!e.current||a.disabled||typeof IntersectionObserver!="function")return;const r=new IntersectionObserver(([c])=>{t(c)},s);return r.observe(e.current),()=>{r.disconnect()}},[t,s,a.disabled,e])}function UC(e){const t=N.useRef(null);return N.useImperativeHandle(e,()=>t.current,[]),t}var $C=!1;function Vo(e){return e[e.length-1]}function PC(e){return typeof e=="function"}function Ci(e,t){return PC(e)?e(t):e}var IC=Object.prototype.hasOwnProperty,X0=Object.prototype.propertyIsEnumerable,BC=()=>Object.create(null),ra=(e,t)=>da(e,t,BC);function da(e,t,s=()=>({}),a=0){if(e===t)return e;if(a>500)return t;const r=t,c=eb(e)&&eb(r);if(!c&&!(lu(e)&&lu(r)))return r;const d=c?e:J0(e);if(!d)return r;const f=c?r:J0(r);if(!f)return r;const p=d.length,m=f.length,v=c?new Array(m):s();let y=0;for(let b=0;b<m;b++){const x=c?b:f[b],j=e[x],w=r[x];if(j===w){v[x]=j,(c?b<p:IC.call(e,x))&&y++;continue}if(j===null||w===null||typeof j!="object"||typeof w!="object"){v[x]=w;continue}const _=da(j,w,s,a+1);v[x]=_,_===j&&y++}return p===m&&y===p?e:v}function J0(e){const t=Object.getOwnPropertyNames(e);for(const r of t)if(!X0.call(e,r))return!1;const s=Object.getOwnPropertySymbols(e);if(s.length===0)return t;const a=t;for(const r of s){if(!X0.call(e,r))return!1;a.push(r)}return a}function lu(e){if(!W0(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const s=t.prototype;return!(!W0(s)||!s.hasOwnProperty("isPrototypeOf"))}function W0(e){return Object.prototype.toString.call(e)==="[object Object]"}function eb(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ga(e,t,s){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 a=0,r=e.length;a<r;a++)if(!ga(e[a],t[a],s))return!1;return!0}if(lu(e)&&lu(t)){const a=s?.ignoreUndefined??!0;if(s?.partial){for(const d in t)if((!a||t[d]!==void 0)&&!ga(e[d],t[d],s))return!1;return!0}let r=0;if(!a)r=Object.keys(e).length;else for(const d in e)e[d]!==void 0&&r++;let c=0;for(const d in t)if((!a||t[d]!==void 0)&&(c++,c>r||!ga(e[d],t[d],s)))return!1;return r===c}return!1}function Er(e){let t,s;const a=new Promise((r,c)=>{t=r,s=c});return a.status="pending",a.resolve=r=>{a.status="resolved",a.value=r,t(r),e?.(r)},a.reject=r=>{a.status="rejected",s(r)},a}function Qo(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function qC(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function tb(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,s=>{try{return decodeURI(s)}catch{return s}})}return qC(t)}var HC=["http:","https:","mailto:","tel:"];function cu(e,t){if(!e)return!1;try{const s=new URL(e);return!t.has(s.protocol)}catch{return!1}}function Ao(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 s=0,a="",r;for(;(r=t.exec(e))!==null;)a+=tb(e.slice(s,r.index))+r[0],s=t.lastIndex;a=a+tb(s?e.slice(s):e);let c=!1;return a.startsWith("//")&&(c=!0,a="/"+a.replace(/^\/+/,"")),{path:a,handledProtocolRelativeURL:c}}function ZC(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function uu(e){const t=new Map;let s,a;const r=c=>{c.next&&(c.prev?(c.prev.next=c.next,c.next.prev=c.prev,c.next=void 0,a&&(a.next=c,c.prev=a)):(c.next.prev=void 0,s=c.next,c.next=void 0,a&&(c.prev=a,a.next=c)),a=c)};return{get(c){const d=t.get(c);if(d)return r(d),d.value},set(c,d){if(t.size>=e&&s){const p=s;t.delete(p.key),p.next&&(s=p.next,p.next.prev=void 0),p===a&&(a=void 0)}const f=t.get(c);if(f)f.value=d,r(f);else{const p={key:c,value:d,prev:a};a&&(a.next=p),a=p,s||(s=p),t.set(c,p)}},clear(){t.clear(),s=void 0,a=void 0}}}var FC="Invariant failed";function Li(e,t){if(!e)throw new Error(FC)}var fa=4,nS=5;function GC(e){const t=e.indexOf("{");if(t===-1)return null;const s=e.indexOf("}",t);return s===-1||t+1>=e.length?null:[t,s]}function Bm(e,t,s=new Uint16Array(6)){const a=e.indexOf("/",t),r=a===-1?e.length:a,c=e.substring(t,r);if(!c||!c.includes("$"))return s[0]=0,s[1]=t,s[2]=t,s[3]=r,s[4]=r,s[5]=r,s;if(c==="$"){const f=e.length;return s[0]=2,s[1]=t,s[2]=t,s[3]=f,s[4]=f,s[5]=f,s}if(c.charCodeAt(0)===36)return s[0]=1,s[1]=t,s[2]=t+1,s[3]=r,s[4]=r,s[5]=r,s;const d=GC(c);if(d){const[f,p]=d,m=c.charCodeAt(f+1);if(m===45){if(f+2<c.length&&c.charCodeAt(f+2)===36){const v=f+3,y=p;if(v<y)return s[0]=3,s[1]=t+f,s[2]=t+v,s[3]=t+y,s[4]=t+p+1,s[5]=r,s}}else if(m===36){const v=f+1,y=f+2;return y===p?(s[0]=2,s[1]=t+f,s[2]=t+v,s[3]=t+y,s[4]=t+p+1,s[5]=e.length,s):(s[0]=1,s[1]=t+f,s[2]=t+y,s[3]=t+p,s[4]=t+p+1,s[5]=r,s)}}return s[0]=0,s[1]=t,s[2]=t,s[3]=r,s[4]=r,s[5]=r,s}function Eu(e,t,s,a,r,c,d){d?.(s);let f=a;{const p=s.fullPath??s.from,m=p.length,v=s.options?.caseSensitive??e,y=!!(s.options?.params?.parse&&s.options?.skipRouteOnParseError?.params);for(;f<m;){const x=Bm(p,f,t);let j;const w=f,_=x[5];switch(f=_+1,c++,x[0]){case 0:{const C=p.substring(x[2],x[3]);if(v){const E=r.static?.get(C);if(E)j=E;else{r.static??=new Map;const O=ha(s.fullPath??s.from);O.parent=r,O.depth=c,j=O,r.static.set(C,O)}}else{const E=C.toLowerCase(),O=r.staticInsensitive?.get(E);if(O)j=O;else{r.staticInsensitive??=new Map;const z=ha(s.fullPath??s.from);z.parent=r,z.depth=c,j=z,r.staticInsensitive.set(E,z)}}break}case 1:{const C=p.substring(w,x[1]),E=p.substring(x[4],_),O=v&&!!(C||E),z=C?O?C:C.toLowerCase():void 0,M=E?O?E:E.toLowerCase():void 0,T=!y&&r.dynamic?.find(L=>!L.skipOnParamError&&L.caseSensitive===O&&L.prefix===z&&L.suffix===M);if(T)j=T;else{const L=_h(1,s.fullPath??s.from,O,z,M);j=L,L.depth=c,L.parent=r,r.dynamic??=[],r.dynamic.push(L)}break}case 3:{const C=p.substring(w,x[1]),E=p.substring(x[4],_),O=v&&!!(C||E),z=C?O?C:C.toLowerCase():void 0,M=E?O?E:E.toLowerCase():void 0,T=!y&&r.optional?.find(L=>!L.skipOnParamError&&L.caseSensitive===O&&L.prefix===z&&L.suffix===M);if(T)j=T;else{const L=_h(3,s.fullPath??s.from,O,z,M);j=L,L.parent=r,L.depth=c,r.optional??=[],r.optional.push(L)}break}case 2:{const C=p.substring(w,x[1]),E=p.substring(x[4],_),O=v&&!!(C||E),z=C?O?C:C.toLowerCase():void 0,M=E?O?E:E.toLowerCase():void 0,T=_h(2,s.fullPath??s.from,O,z,M);j=T,T.parent=r,T.depth=c,r.wildcard??=[],r.wildcard.push(T)}}r=j}if(y&&s.children&&!s.isRoot&&s.id&&s.id.charCodeAt(s.id.lastIndexOf("/")+1)===95){const x=ha(s.fullPath??s.from);x.kind=nS,x.parent=r,c++,x.depth=c,r.pathless??=[],r.pathless.push(x),r=x}const b=(s.path||!s.children)&&!s.isRoot;if(b&&p.endsWith("/")){const x=ha(s.fullPath??s.from);x.kind=fa,x.parent=r,c++,x.depth=c,r.index=x,r=x}r.parse=s.options?.params?.parse??null,r.skipOnParamError=y,r.parsingPriority=s.options?.skipRouteOnParseError?.priority??0,b&&!r.route&&(r.route=s,r.fullPath=s.fullPath??s.from)}if(s.children)for(const p of s.children)Eu(e,t,p,f,r,c,d)}function Nh(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 Ni(e){if(e.pathless)for(const t of e.pathless)Ni(t);if(e.static)for(const t of e.static.values())Ni(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())Ni(t);if(e.dynamic?.length){e.dynamic.sort(Nh);for(const t of e.dynamic)Ni(t)}if(e.optional?.length){e.optional.sort(Nh);for(const t of e.optional)Ni(t)}if(e.wildcard?.length){e.wildcard.sort(Nh);for(const t of e.wildcard)Ni(t)}}function ha(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 _h(e,t,s,a,r){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:s,prefix:a,suffix:r}}function KC(e,t){const s=ha("/"),a=new Uint16Array(6);for(const r of e)Eu(!1,a,r,1,s,0);Ni(s),t.masksTree=s,t.flatCache=uu(1e3)}function VC(e,t){e||="/";const s=t.flatCache.get(e);if(s)return s;const a=qm(e,t.masksTree);return t.flatCache.set(e,a),a}function QC(e,t,s,a,r){e||="/",a||="/";const c=t?`case\0${e}`:e;let d=r.singleCache.get(c);return d||(d=ha("/"),Eu(t,new Uint16Array(6),{from:e},1,d,0),r.singleCache.set(c,d)),qm(a,d,s)}function YC(e,t,s=!1){const a=s?e:`nofuzz\0${e}`,r=t.matchCache.get(a);if(r!==void 0)return r;e||="/";let c;try{c=qm(e,t.segmentTree,s)}catch(d){if(d instanceof URIError)c=null;else throw d}return c&&(c.branch=WC(c.route)),t.matchCache.set(a,c),c}function XC(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function JC(e,t=!1,s){const a=ha(e.fullPath),r=new Uint16Array(6),c={},d={};let f=0;return Eu(t,r,e,1,a,0,p=>{if(s?.(p,f),Li(!(p.id in c),`Duplicate routes found with id: ${String(p.id)}`),c[p.id]=p,f!==0&&p.path){const m=XC(p.fullPath);(!d[m]||p.fullPath.endsWith("/"))&&(d[m]=p)}f++}),Ni(a),{processedTree:{segmentTree:a,singleCache:uu(1e3),matchCache:uu(1e3),flatCache:null,masksTree:null},routesById:c,routesByPath:d}}function qm(e,t,s=!1){const a=e.split("/"),r=tk(e,a,t,s);if(!r)return null;const[c]=sS(e,a,r);return{route:r.node.route,rawParams:c,parsedParams:r.parsedParams}}function sS(e,t,s){const a=ek(s.node);let r=null;const c=Object.create(null);let d=s.extract?.part??0,f=s.extract?.node??0,p=s.extract?.path??0,m=s.extract?.segment??0;for(;f<a.length;d++,f++,p++,m++){const v=a[f];if(v.kind===fa)break;if(v.kind===nS){m--,d--,p--;continue}const y=t[d],b=p;if(y&&(p+=y.length),v.kind===1){r??=s.node.fullPath.split("/");const x=r[m],j=v.prefix?.length??0;if(x.charCodeAt(j)===123){const w=v.suffix?.length??0,_=x.substring(j+2,x.length-w-1),C=y.substring(j,y.length-w);c[_]=decodeURIComponent(C)}else{const w=x.substring(1);c[w]=decodeURIComponent(y)}}else if(v.kind===3){if(s.skipped&1<<f){d--,p=b-1;continue}r??=s.node.fullPath.split("/");const x=r[m],j=v.prefix?.length??0,w=v.suffix?.length??0,_=x.substring(j+3,x.length-w-1),C=v.suffix||v.prefix?y.substring(j,y.length-w):y;C&&(c[_]=decodeURIComponent(C))}else if(v.kind===2){const x=v,j=e.substring(b+(x.prefix?.length??0),e.length-(x.suffix?.length??0)),w=decodeURIComponent(j);c["*"]=w,c._splat=w;break}}return s.rawParams&&Object.assign(c,s.rawParams),[c,{part:d,node:f,path:p,segment:m}]}function WC(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function ek(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function tk(e,t,s,a){if(e==="/"&&s.index)return{node:s.index,skipped:0};const r=!Vo(t),c=r&&e!=="/",d=t.length-(r?1:0),f=[{node:s,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let p=null,m=null,v=null;for(;f.length;){const y=f.pop(),{node:b,index:x,skipped:j,depth:w,statics:_,dynamics:C,optionals:E}=y;let{extract:O,rawParams:z,parsedParams:M}=y;if(b.skipOnParamError){if(!Ch(e,t,y))continue;z=y.rawParams,O=y.extract,M=y.parsedParams}a&&b.route&&b.kind!==fa&&To(m,y)&&(m=y);const T=x===d;if(T&&(b.route&&!c&&To(v,y)&&(v=y),!b.optional&&!b.wildcard&&!b.index&&!b.pathless))continue;const L=T?void 0:t[x];let R;if(T&&b.index){const I={node:b.index,index:x,skipped:j,depth:w+1,statics:_,dynamics:C,optionals:E,extract:O,rawParams:z,parsedParams:M};let ie=!0;if(b.index.skipOnParamError&&(Ch(e,t,I)||(ie=!1)),ie){if(_===d&&!C&&!E&&!j)return I;To(v,I)&&(v=I)}}if(b.wildcard&&To(p,y))for(const I of b.wildcard){const{prefix:ie,suffix:Q}=I;if(ie&&(T||!(I.caseSensitive?L:R??=L.toLowerCase()).startsWith(ie)))continue;if(Q){if(T)continue;const me=t.slice(x).join("/").slice(-Q.length);if((I.caseSensitive?me:me.toLowerCase())!==Q)continue}const se={node:I,index:d,skipped:j,depth:w,statics:_,dynamics:C,optionals:E,extract:O,rawParams:z,parsedParams:M};if(!(I.skipOnParamError&&!Ch(e,t,se))){p=se;break}}if(b.optional){const I=j|1<<w,ie=w+1;for(let Q=b.optional.length-1;Q>=0;Q--){const se=b.optional[Q];f.push({node:se,index:x,skipped:I,depth:ie,statics:_,dynamics:C,optionals:E,extract:O,rawParams:z,parsedParams:M})}if(!T)for(let Q=b.optional.length-1;Q>=0;Q--){const se=b.optional[Q],{prefix:me,suffix:Ee}=se;if(me||Ee){const we=se.caseSensitive?L:R??=L.toLowerCase();if(me&&!we.startsWith(me)||Ee&&!we.endsWith(Ee))continue}f.push({node:se,index:x+1,skipped:j,depth:ie,statics:_,dynamics:C,optionals:E+1,extract:O,rawParams:z,parsedParams:M})}}if(!T&&b.dynamic&&L)for(let I=b.dynamic.length-1;I>=0;I--){const ie=b.dynamic[I],{prefix:Q,suffix:se}=ie;if(Q||se){const me=ie.caseSensitive?L:R??=L.toLowerCase();if(Q&&!me.startsWith(Q)||se&&!me.endsWith(se))continue}f.push({node:ie,index:x+1,skipped:j,depth:w+1,statics:_,dynamics:C+1,optionals:E,extract:O,rawParams:z,parsedParams:M})}if(!T&&b.staticInsensitive){const I=b.staticInsensitive.get(R??=L.toLowerCase());I&&f.push({node:I,index:x+1,skipped:j,depth:w+1,statics:_+1,dynamics:C,optionals:E,extract:O,rawParams:z,parsedParams:M})}if(!T&&b.static){const I=b.static.get(L);I&&f.push({node:I,index:x+1,skipped:j,depth:w+1,statics:_+1,dynamics:C,optionals:E,extract:O,rawParams:z,parsedParams:M})}if(b.pathless){const I=w+1;for(let ie=b.pathless.length-1;ie>=0;ie--){const Q=b.pathless[ie];f.push({node:Q,index:x,skipped:j,depth:I,statics:_,dynamics:C,optionals:E,extract:O,rawParams:z,parsedParams:M})}}}if(v&&p)return To(p,v)?v:p;if(v)return v;if(p)return p;if(a&&m){let y=m.index;for(let x=0;x<m.index;x++)y+=t[x].length;const b=y===e.length?"/":e.slice(y);return m.rawParams??=Object.create(null),m.rawParams["**"]=decodeURIComponent(b),m}return null}function Ch(e,t,s){try{const[a,r]=sS(e,t,s);s.rawParams=a,s.extract=r;const c=s.node.parse(a);return s.parsedParams=Object.assign(Object.create(null),s.parsedParams,c),!0}catch{return null}}function To(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===fa)>(e.node.kind===fa)||t.node.kind===fa==(e.node.kind===fa)&&t.depth>e.depth))):!0}function Yc(e){return Hm(e.filter(t=>t!==void 0).join("/"))}function Hm(e){return e.replace(/\/{2,}/g,"/")}function iS(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Ri(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function aS(e){return Ri(iS(e))}function du(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function nk(e,t,s){return du(e,s)===du(t,s)}function sk({base:e,to:t,trailingSlash:s="never",cache:a}){const r=t.startsWith("/"),c=!r&&t===".";let d;if(a){d=r?t:c?e:e+"\0"+t;const y=a.get(d);if(y)return y}let f;if(c)f=e.split("/");else if(r)f=t.split("/");else{for(f=e.split("/");f.length>1&&Vo(f)==="";)f.pop();const y=t.split("/");for(let b=0,x=y.length;b<x;b++){const j=y[b];j===""?b?b===x-1&&f.push(j):f=[j]:j===".."?f.pop():j==="."||f.push(j)}}f.length>1&&(Vo(f)===""?s==="never"&&f.pop():s==="always"&&f.push(""));let p,m="";for(let y=0;y<f.length;y++){y>0&&(m+="/");const b=f[y];if(!b)continue;p=Bm(b,0,p);const x=p[0];if(x===0){m+=b;continue}const j=p[5],w=b.substring(0,p[1]),_=b.substring(p[4],j),C=b.substring(p[2],p[3]);x===1?m+=w||_?`${w}{$${C}}${_}`:`$${C}`:x===2?m+=w||_?`${w}{$}${_}`:"$":m+=`${w}{-$${C}}${_}`}m=Hm(m);const v=m||"/";return d&&a&&a.set(d,v),v}function ik(e){const t=new Map(e.map(r=>[encodeURIComponent(r),r])),s=Array.from(t.keys()).map(r=>r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),a=new RegExp(s,"g");return r=>r.replace(a,c=>t.get(c)??c)}function kh(e,t,s){const a=t[e];return typeof a!="string"?a:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(a)?a:a.split("/").map(r=>sb(r,s)).join("/"):sb(a,s)}function nb({path:e,params:t,decoder:s,...a}){let r=!1;const c=Object.create(null);if(!e||e==="/")return{interpolatedPath:"/",usedParams:c,isMissingParams:r};if(!e.includes("$"))return{interpolatedPath:e,usedParams:c,isMissingParams:r};const d=e.length;let f=0,p,m="";for(;f<d;){const v=f;p=Bm(e,v,p);const y=p[5];if(f=y+1,v===y)continue;const b=p[0];if(b===0){m+="/"+e.substring(v,y);continue}if(b===2){const x=t._splat;c._splat=x,c["*"]=x;const j=e.substring(v,p[1]),w=e.substring(p[4],y);if(!x){r=!0,(j||w)&&(m+="/"+j+w);continue}const _=kh("_splat",t,s);m+="/"+j+_+w;continue}if(b===1){const x=e.substring(p[2],p[3]);!r&&!(x in t)&&(r=!0),c[x]=t[x];const j=e.substring(v,p[1]),w=e.substring(p[4],y),_=kh(x,t,s)??"undefined";m+="/"+j+_+w;continue}if(b===3){const x=e.substring(p[2],p[3]),j=t[x];if(j==null)continue;c[x]=j;const w=e.substring(v,p[1]),_=e.substring(p[4],y),C=kh(x,t,s)??"";m+="/"+w+C+_;continue}}return e.endsWith("/")&&(m+="/"),{usedParams:c,interpolatedPath:m||"/",isMissingParams:r}}function sb(e,t){const s=encodeURIComponent(e);return t?.(s)??s}function un(e){return!!e?.isNotFound}function ak(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}var rm="tsr-scroll-restoration-v1_3",rk=(e,t)=>{let s;return(...a)=>{s||(s=setTimeout(()=>{e(...a),s=null},t))}};function ok(){const e=ak();if(!e)return null;const t=e.getItem(rm);let s=t?JSON.parse(t):{};return{state:s,set:a=>{s=Ci(a,s)||s;try{e.setItem(rm,JSON.stringify(s))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}var Rc=ok(),lk=e=>e.state.__TSR_key||e.href;function ck(e){const t=[];let s;for(;s=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(s.children,e)+1})`),e=s;return`${t.reverse().join(" > ")}`.toLowerCase()}var fu=!1;function uk({storageKey:e,key:t,behavior:s,shouldScrollRestoration:a,scrollToTopSelectors:r,location:c}){let d;try{d=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(m){console.error(m);return}const f=t||window.history.state?.__TSR_key,p=d[f];fu=!0;e:{if(a&&p&&Object.keys(p).length>0){for(const y in p){const b=p[y];if(y==="window")window.scrollTo({top:b.scrollY,left:b.scrollX,behavior:s});else if(y){const x=document.querySelector(y);x&&(x.scrollLeft=b.scrollX,x.scrollTop=b.scrollY)}}break e}const m=(c??window.location).hash.split("#",2)[1];if(m){const y=window.history.state?.__hashScrollIntoViewOptions??!0;if(y){const b=document.getElementById(m);b&&b.scrollIntoView(y)}break e}const v={top:0,left:0,behavior:s};if(window.scrollTo(v),r)for(const y of r){if(y==="window")continue;const b=typeof y=="function"?y():document.querySelector(y);b&&b.scrollTo(v)}}fu=!1}function dk(e,t){if(!Rc||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!Rc))return;e.isScrollRestorationSetup=!0,fu=!1;const s=e.options.getScrollRestorationKey||lk;window.history.scrollRestoration="manual";const a=r=>{if(fu||!e.isScrollRestoring)return;let c="";if(r.target===document||r.target===window)c="window";else{const f=r.target.getAttribute("data-scroll-restoration-id");f?c=`[data-scroll-restoration-id="${f}"]`:c=ck(r.target)}const d=s(e.state.location);Rc.set(f=>{const p=f[d]||={},m=p[c]||={};if(c==="window")m.scrollX=window.scrollX||0,m.scrollY=window.scrollY||0;else if(c){const v=document.querySelector(c);v&&(m.scrollX=v.scrollLeft||0,m.scrollY=v.scrollTop||0)}return f})};typeof document<"u"&&document.addEventListener("scroll",rk(a,100),!0),e.subscribe("onRendered",r=>{const c=s(r.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation})||(uk({storageKey:rm,key:c,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&Rc.set(d=>(d[c]||={},d)))})}function fk(e){if(typeof document<"u"&&document.querySelector){const t=e.state.location.state.__hashScrollIntoViewOptions??!0;if(t&&e.state.location.hash!==""){const s=document.getElementById(e.state.location.hash);s&&s.scrollIntoView(t)}}}function hk(e,t=String){const s=new URLSearchParams;for(const a in e){const r=e[a];r!==void 0&&s.set(a,t(r))}return s.toString()}function zh(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function mk(e){const t=new URLSearchParams(e),s=Object.create(null);for(const[a,r]of t.entries()){const c=s[a];c==null?s[a]=zh(r):Array.isArray(c)?c.push(zh(r)):s[a]=[c,zh(r)]}return s}var pk=yk(JSON.parse),gk=vk(JSON.stringify,JSON.parse);function yk(e){return t=>{t[0]==="?"&&(t=t.substring(1));const s=mk(t);for(const a in s){const r=s[a];if(typeof r=="string")try{s[a]=e(r)}catch{}}return s}}function vk(e,t){const s=typeof t=="function";function a(r){if(typeof r=="object"&&r!==null)try{return e(r)}catch{}else if(s&&typeof r=="string")try{return t(r),e(r)}catch{}return r}return r=>{const c=hk(r,a);return c?`?${c}`:""}}var ya="__root__";function Zm(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 s=new Response(null,{status:e.statusCode,headers:t});if(s.options=e,e.throw)throw s;return s}function vn(e){return e instanceof Response&&!!e.options}function bk(e){return{input:({url:t})=>{for(const s of e)t=om(s,t);return t},output:({url:t})=>{for(let s=e.length-1;s>=0;s--)t=rS(e[s],t);return t}}}function xk(e){const t=aS(e.basepath),s=`/${t}`,a=`${s}/`,r=e.caseSensitive?s:s.toLowerCase(),c=e.caseSensitive?a:a.toLowerCase();return{input:({url:d})=>{const f=e.caseSensitive?d.pathname:d.pathname.toLowerCase();return f===r?d.pathname="/":f.startsWith(c)&&(d.pathname=d.pathname.slice(s.length)),d},output:({url:d})=>(d.pathname=Yc(["/",t,d.pathname]),d)}}function om(e,t){const s=e?.input?.({url:t});if(s){if(typeof s=="string")return new URL(s);if(s instanceof URL)return s}return t}function rS(e,t){const s=e?.output?.({url:t});if(s){if(typeof s=="string")return new URL(s);if(s instanceof URL)return s}return t}var pt=(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))(pt||{});function oS({update:e,notify:t,unwatched:s}){return{link:a,unlink:r,propagate:c,checkDirty:d,shallowPropagate:f};function a(m,v,y){const b=v.depsTail;if(b!==void 0&&b.dep===m)return;const x=b!==void 0?b.nextDep:v.deps;if(x!==void 0&&x.dep===m){x.version=y,v.depsTail=x;return}const j=m.subsTail;if(j!==void 0&&j.version===y&&j.sub===v)return;const w=v.depsTail=m.subsTail={version:y,dep:m,sub:v,prevDep:b,nextDep:x,prevSub:j,nextSub:void 0};x!==void 0&&(x.prevDep=w),b!==void 0?b.nextDep=w:v.deps=w,j!==void 0?j.nextSub=w:m.subs=w}function r(m,v=m.sub){const y=m.dep,b=m.prevDep,x=m.nextDep,j=m.nextSub,w=m.prevSub;return x!==void 0?x.prevDep=b:v.depsTail=b,b!==void 0?b.nextDep=x:v.deps=x,j!==void 0?j.prevSub=w:y.subsTail=w,w!==void 0?w.nextSub=j:(y.subs=j)===void 0&&s(y),x}function c(m){let v=m.nextSub,y;e:do{const b=m.sub;let x=b.flags;if(x&60?x&12?x&4?!(x&48)&&p(m,b)?(b.flags=x|40,x&=1):x=0:b.flags=x&-9|32:x=0:b.flags=x|32,x&2&&t(b),x&1){const j=b.subs;if(j!==void 0){const w=(m=j).nextSub;w!==void 0&&(y={value:v,prev:y},v=w);continue}}if((m=v)!==void 0){v=m.nextSub;continue}for(;y!==void 0;)if(m=y.value,y=y.prev,m!==void 0){v=m.nextSub;continue e}break}while(!0)}function d(m,v){let y,b=0,x=!1;e:do{const j=m.dep,w=j.flags;if(v.flags&16)x=!0;else if((w&17)===17){if(e(j)){const _=j.subs;_.nextSub!==void 0&&f(_),x=!0}}else if((w&33)===33){(m.nextSub!==void 0||m.prevSub!==void 0)&&(y={value:m,prev:y}),m=j.deps,v=j,++b;continue}if(!x){const _=m.nextDep;if(_!==void 0){m=_;continue}}for(;b--;){const _=v.subs,C=_.nextSub!==void 0;if(C?(m=y.value,y=y.prev):m=_,x){if(e(v)){C&&f(_),v=m.sub;continue}x=!1}else v.flags&=-33;v=m.sub;const E=m.nextDep;if(E!==void 0){m=E;continue e}}return x}while(!0)}function f(m){do{const v=m.sub,y=v.flags;(y&48)===32&&(v.flags=y|16,(y&6)===2&&t(v))}while((m=m.nextSub)!==void 0)}function p(m,v){let y=v.depsTail;for(;y!==void 0;){if(y===m)return!0;y=y.prevDep}return!1}}let Fm=0,oa=0,Bo=0;const Bs=[],{link:d3,unlink:lS,propagate:f3,checkDirty:Sk,shallowPropagate:h3}=oS({update(e){return e.depsTail!==void 0?_k(e):Ck(e)},notify(e){let t=Bo,s=t;do if(Bs[t++]=e,e.flags&=-3,e=e.subs?.sub,e===void 0||!(e.flags&2))break;while(!0);for(Bo=t;s<--t;){const a=Bs[s];Bs[s++]=Bs[t],Bs[t]=a}},unwatched(e){e.flags&1?e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,Ou(e)):Ek.call(e)}});function wk(){return Fm}function jk(){++Fm}function Nk(){--Fm||zk()}function _k(e){e.depsTail=void 0,e.flags=5;try{const t=e.value;return t!==(e.value=e.getter(t))}finally{e.flags&=-5,Ou(e)}}function Ck(e){return e.flags=1,e.currentValue!==(e.currentValue=e.pendingValue)}function kk(e){const t=e.flags;if(t&16||t&32&&Sk(e.deps,e)){e.depsTail=void 0,e.flags=6;try{e.fn()}finally{e.flags&=-5,Ou(e)}}else e.flags=2}function zk(){try{for(;oa<Bo;){const e=Bs[oa];Bs[oa++]=void 0,kk(e)}}finally{for(;oa<Bo;){const e=Bs[oa];Bs[oa++]=void 0,e.flags|=10}oa=0,Bo=0}}function Ek(){this.depsTail=void 0,this.flags=0,Ou(this);const e=this.subs;e!==void 0&&lS(e)}function Ou(e){const t=e.depsTail;let s=t!==void 0?t.nextDep:e.deps;for(;s!==void 0;)s=lS(s,e)}function Gm(e,t,s){const a=typeof e=="object",r=a?e:void 0;return{next:(a?e.next:e)?.bind(r),error:(a?e.error:t)?.bind(r),complete:(a?e.complete:s)?.bind(r)}}const lm=[];let Xc=0;const{link:ib,unlink:Ok,propagate:Rk,checkDirty:cS,shallowPropagate:ab}=oS({update(e){return e._update()},notify(e){lm[cm++]=e,e.flags&=~pt.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=pt.Mutable|pt.Dirty,hu(e))}});let Ac=0,cm=0,gs;function hu(e){const t=e.depsTail;let s=t!==void 0?t.nextDep:e.deps;for(;s!==void 0;)s=Ok(s,e)}function uS(){if(!(wk()>0)){for(;Ac<cm;){const e=lm[Ac];lm[Ac++]=void 0,e.notify()}Ac=0,cm=0}}function dS(e,t){const s=typeof e=="function",a=e,r={_snapshot:s?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:s?pt.None:pt.Mutable,get(){return gs!==void 0&&ib(r,gs,Xc),r._snapshot},subscribe(c){const d=Gm(c),f={current:!1},p=Ak(()=>{r.get(),f.current?d.next?.(r._snapshot):f.current=!0});return{unsubscribe:()=>{p.stop()}}},_update(c){const d=gs,f=Object.is;if(s)gs=r,++Xc,r.depsTail=void 0;else if(c===void 0)return!1;s&&(r.flags=pt.Mutable|pt.RecursedCheck);try{const p=r._snapshot,m=typeof c=="function"?c(p):c===void 0&&s?a(p):c;return p===void 0||!f(p,m)?(r._snapshot=m,!0):!1}finally{gs=d,s&&(r.flags&=~pt.RecursedCheck),hu(r)}}};return s?(r.flags=pt.Mutable|pt.Dirty,r.get=function(){const c=r.flags;if(c&pt.Dirty||c&pt.Pending&&cS(r.deps,r)){if(r._update()){const d=r.subs;d!==void 0&&ab(d)}}else c&pt.Pending&&(r.flags=c&~pt.Pending);return gs!==void 0&&ib(r,gs,Xc),r._snapshot}):r.set=function(c){if(r._update(c)){const d=r.subs;d!==void 0&&(Rk(d),ab(d),uS())}},r}function Ak(e){const t=()=>{const a=gs;gs=s,++Xc,s.depsTail=void 0,s.flags=pt.Watching|pt.RecursedCheck;try{return e()}finally{gs=a,s.flags&=~pt.RecursedCheck,hu(s)}},s={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:pt.Watching|pt.RecursedCheck,notify(){const a=this.flags;a&pt.Dirty||a&pt.Pending&&cS(this.deps,this)?t():this.flags=pt.Watching},stop(){this.flags=pt.None,this.depsTail=void 0,hu(this)}};return t(),s}class Tk{constructor(t){this.atom=dS(t)}setState(t){this.atom.set(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(Gm(t))}}class Dk{constructor(t){this.atom=dS(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(Gm(t))}}function Lk(e){return typeof e=="function"?new Dk(e):new Tk(e)}function Mk(e){try{jk(),e()}finally{Nk(),uS()}}function qo(e){let t;return Mk(()=>{t=e()}),t}var um=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},Ru=(e,t)=>!!(e.preload&&!e.router.state.matches.some(s=>s.id===t)),va=(e,t,s=!0)=>{const a={...e.router.options.context??{}},r=s?t:t-1;for(let c=0;c<=r;c++){const d=e.matches[c];if(!d)continue;const f=e.router.getMatch(d.id);f&&Object.assign(a,f.__routeContext,f.__beforeLoadContext)}return a},rb=(e,t)=>{if(!e.matches.length)return;const s=t.routeId,a=e.matches.findIndex(d=>d.routeId===e.router.routeTree.id),r=a>=0?a:0;let c=s?e.matches.findIndex(d=>d.routeId===s):e.firstBadMatchIndex??e.matches.length-1;c<0&&(c=r);for(let d=c;d>=0;d--){const f=e.matches[d];if(e.router.looseRoutesById[f.routeId].options.notFoundComponent)return d}return s?c:r},ki=(e,t,s)=>{if(!(!vn(s)&&!un(s)))throw vn(s)&&s.redirectHandled&&!s.options.reloadDocument||(t&&(t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=s,e.updateMatch(t.id,a=>({...a,status:vn(s)?"redirected":a.status==="pending"?"success":a.status,context:va(e,t.index),isFetching:!1,error:s})),un(s)&&!s.routeId&&(s.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),vn(s)&&(e.rendered=!0,s.options._fromLocation=e.location,s.redirectHandled=!0,s=e.router.resolveRedirect(s))),s},fS=(e,t)=>{const s=e.router.getMatch(t);return!!(!s||s._nonReactive.dehydrated)},ob=(e,t,s)=>{const a=va(e,s);e.updateMatch(t,r=>({...r,context:a}))},Do=(e,t,s,a)=>{const{id:r,routeId:c}=e.matches[t],d=e.router.looseRoutesById[c];if(s instanceof Promise)throw s;s.routerCode=a,e.firstBadMatchIndex??=t,ki(e,e.router.getMatch(r),s);try{d.options.onError?.(s)}catch(f){s=f,ki(e,e.router.getMatch(r),s)}e.updateMatch(r,f=>(f._nonReactive.beforeLoadPromise?.resolve(),f._nonReactive.beforeLoadPromise=void 0,f._nonReactive.loadPromise?.resolve(),{...f,error:s,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!vn(s)&&!un(s)&&(e.serialError??=s)},hS=(e,t,s,a)=>{if(a._nonReactive.pendingTimeout!==void 0)return;const r=s.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!Ru(e,t)&&(s.options.loader||s.options.beforeLoad||pS(s))&&typeof r=="number"&&r!==1/0&&(s.options.pendingComponent??e.router.options?.defaultPendingComponent)){const c=setTimeout(()=>{um(e)},r);a._nonReactive.pendingTimeout=c}},Uk=(e,t,s)=>{const a=e.router.getMatch(t);if(!a._nonReactive.beforeLoadPromise&&!a._nonReactive.loaderPromise)return;hS(e,t,s,a);const r=()=>{const c=e.router.getMatch(t);c.preload&&(c.status==="redirected"||c.status==="notFound")&&ki(e,c,c.error)};return a._nonReactive.beforeLoadPromise?a._nonReactive.beforeLoadPromise.then(r):r()},$k=(e,t,s,a)=>{const r=e.router.getMatch(t);let c=r._nonReactive.loadPromise;r._nonReactive.loadPromise=Er(()=>{c?.resolve(),c=void 0});const{paramsError:d,searchError:f}=r;d&&Do(e,s,d,"PARSE_PARAMS"),f&&Do(e,s,f,"VALIDATE_SEARCH"),hS(e,t,a,r);const p=new AbortController;let m=!1;const v=()=>{m||(m=!0,e.updateMatch(t,z=>({...z,isFetching:"beforeLoad",fetchCount:z.fetchCount+1,abortController:p})))},y=()=>{r._nonReactive.beforeLoadPromise?.resolve(),r._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,z=>({...z,isFetching:!1}))};if(!a.options.beforeLoad){qo(()=>{v(),y()});return}r._nonReactive.beforeLoadPromise=Er();const b={...va(e,s,!1),...r.__routeContext},{search:x,params:j,cause:w}=r,_=Ru(e,t),C={search:x,abortController:p,params:j,preload:_,context:b,location:e.location,navigate:z=>e.router.navigate({...z,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:_?"preload":w,matches:e.matches,routeId:a.id,...e.router.options.additionalContext},E=z=>{if(z===void 0){qo(()=>{v(),y()});return}(vn(z)||un(z))&&(v(),Do(e,s,z,"BEFORE_LOAD")),qo(()=>{v(),e.updateMatch(t,M=>({...M,__beforeLoadContext:z})),y()})};let O;try{if(O=a.options.beforeLoad(C),Qo(O))return v(),O.catch(z=>{Do(e,s,z,"BEFORE_LOAD")}).then(E)}catch(z){v(),Do(e,s,z,"BEFORE_LOAD")}E(O)},Pk=(e,t)=>{const{id:s,routeId:a}=e.matches[t],r=e.router.looseRoutesById[a],c=()=>f(),d=()=>$k(e,s,t,r),f=()=>{if(fS(e,s))return;const p=Uk(e,s,r);return Qo(p)?p.then(d):d()};return c()},Ik=(e,t,s)=>{const a=e.router.getMatch(t);if(!a||!s.options.head&&!s.options.scripts&&!s.options.headers)return;const r={ssr:e.router.options.ssr,matches:e.matches,match:a,params:a.params,loaderData:a.loaderData};return Promise.all([s.options.head?.(r),s.options.scripts?.(r),s.options.headers?.(r)]).then(([c,d,f])=>({meta:c?.meta,links:c?.links,headScripts:c?.scripts,headers:f,scripts:d,styles:c?.styles}))},mS=(e,t,s,a,r)=>{const c=t[a-1],{params:d,loaderDeps:f,abortController:p,cause:m}=e.router.getMatch(s),v=va(e,a),y=Ru(e,s);return{params:d,deps:f,preload:!!y,parentMatchPromise:c,abortController:p,context:v,location:e.location,navigate:b=>e.router.navigate({...b,_fromLocation:e.location}),cause:y?"preload":m,route:r,...e.router.options.additionalContext}},lb=async(e,t,s,a,r)=>{try{const c=e.router.getMatch(s);try{(!($C??e.router.isServer)||c.ssr===!0)&&Yo(r);const d=r.options.loader,f=typeof d=="function"?d:d?.handler,p=f?.(mS(e,t,s,a,r)),m=!!f&&Qo(p);if((m||r._lazyPromise||r._componentsPromise||r.options.head||r.options.scripts||r.options.headers||c._nonReactive.minPendingPromise)&&e.updateMatch(s,y=>({...y,isFetching:"loader"})),f){const y=m?await p:p;ki(e,e.router.getMatch(s),y),y!==void 0&&e.updateMatch(s,b=>({...b,loaderData:y}))}r._lazyPromise&&await r._lazyPromise;const v=c._nonReactive.minPendingPromise;v&&await v,r._componentsPromise&&await r._componentsPromise,e.updateMatch(s,y=>({...y,error:void 0,context:va(e,a),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(d){let f=d;if(f?.name==="AbortError"){if(c.abortController.signal.aborted){c._nonReactive.loaderPromise?.resolve(),c._nonReactive.loaderPromise=void 0;return}e.updateMatch(s,m=>({...m,status:m.status==="pending"?"success":m.status,isFetching:!1,context:va(e,a)}));return}const p=c._nonReactive.minPendingPromise;p&&await p,un(d)&&await r.options.notFoundComponent?.preload?.(),ki(e,e.router.getMatch(s),d);try{r.options.onError?.(d)}catch(m){f=m,ki(e,e.router.getMatch(s),m)}!vn(f)&&!un(f)&&await Yo(r,["errorComponent"]),e.updateMatch(s,m=>({...m,error:f,context:va(e,a),status:"error",isFetching:!1}))}}catch(c){const d=e.router.getMatch(s);d&&(d._nonReactive.loaderPromise=void 0),ki(e,d,c)}},Bk=async(e,t,s)=>{async function a(x,j,w,_,C){const E=Date.now()-j.updatedAt,O=x?C.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:C.options.staleTime??e.router.options.defaultStaleTime??0,z=C.options.shouldReload,M=typeof z=="function"?z(mS(e,t,r,s,C)):z,{status:T,invalid:L}=_,R=E>O&&(!!e.forceStaleReload||_.cause==="enter"||w!==void 0&&w!==_.id);d=T==="success"&&(L||(M??R)),x&&C.options.preload===!1||(d&&!e.sync&&v?(f=!0,(async()=>{try{await lb(e,t,r,s,C);const I=e.router.getMatch(r);I._nonReactive.loaderPromise?.resolve(),I._nonReactive.loadPromise?.resolve(),I._nonReactive.loaderPromise=void 0,I._nonReactive.loadPromise=void 0}catch(I){vn(I)&&await e.router.navigate(I.options)}})()):T!=="success"||d?await lb(e,t,r,s,C):ob(e,r,s))}const{id:r,routeId:c}=e.matches[s];let d=!1,f=!1;const p=e.router.looseRoutesById[c],m=p.options.loader,v=((typeof m=="function"?void 0:m?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!=="blocking";if(fS(e,r)){if(!e.router.getMatch(r))return e.matches[s];ob(e,r,s)}else{const x=e.router.getMatch(r),j=e.router.state.matches[s]?.routeId===c?e.router.state.matches[s].id:e.router.state.matches.find(_=>_.routeId===c)?.id,w=Ru(e,r);if(x._nonReactive.loaderPromise){if(x.status==="success"&&!e.sync&&!x.preload&&v)return x;await x._nonReactive.loaderPromise;const _=e.router.getMatch(r),C=_._nonReactive.error||_.error;C&&ki(e,_,C),_.status==="pending"&&await a(w,x,j,_,p)}else{const _=w&&!e.router.state.matches.some(E=>E.id===r),C=e.router.getMatch(r);C._nonReactive.loaderPromise=Er(),_!==C.preload&&e.updateMatch(r,E=>({...E,preload:_})),await a(w,x,j,C,p)}}const y=e.router.getMatch(r);f||(y._nonReactive.loaderPromise?.resolve(),y._nonReactive.loadPromise?.resolve(),y._nonReactive.loadPromise=void 0),clearTimeout(y._nonReactive.pendingTimeout),y._nonReactive.pendingTimeout=void 0,f||(y._nonReactive.loaderPromise=void 0),y._nonReactive.dehydrated=void 0;const b=f?y.isFetching:!1;return b!==y.isFetching||y.invalid!==!1?(e.updateMatch(r,x=>({...x,isFetching:b,invalid:!1})),e.router.getMatch(r)):y};async function cb(e){const t=e,s=[];t.router.state.matches.some(b=>b._forcePending)&&um(t);let a;for(let b=0;b<t.matches.length;b++){try{const x=Pk(t,b);Qo(x)&&await x}catch(x){if(vn(x))throw x;if(un(x))a=x;else if(!t.preload)throw x;break}if(t.serialError)break}const r=t.firstBadMatchIndex??t.matches.length,c=a&&!t.preload?rb(t,a):void 0,d=a&&t.preload?0:c!==void 0?Math.min(c+1,r):r;let f,p;for(let b=0;b<d;b++)s.push(Bk(t,s,b));try{await Promise.all(s)}catch{const b=await Promise.allSettled(s);for(const x of b){if(x.status!=="rejected")continue;const j=x.reason;if(vn(j))throw j;un(j)?f??=j:p??=j}if(p!==void 0)throw p}const m=f??(a&&!t.preload?a:void 0);let v=t.serialError?t.firstBadMatchIndex??0:t.matches.length-1;if(!m&&a&&t.preload)return t.matches;if(m){const b=rb(t,m);Li(b!==void 0);const x=t.matches[b],j=t.router.looseRoutesById[x.routeId],w=t.router.options?.defaultNotFoundComponent;!j.options.notFoundComponent&&w&&(j.options.notFoundComponent=w),m.routeId=x.routeId;const _=x.routeId===t.router.routeTree.id;t.updateMatch(x.id,C=>({...C,..._?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:m},isFetching:!1})),v=b,await Yo(j,["notFoundComponent"])}else if(!t.preload){const b=t.matches[0];b.globalNotFound||t.router.getMatch(b.id)?.globalNotFound&&t.updateMatch(b.id,x=>({...x,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){const b=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await Yo(b,["errorComponent"])}for(let b=0;b<=v;b++){const{id:x,routeId:j}=t.matches[b],w=t.router.looseRoutesById[j];try{const _=Ik(t,x,w);if(_){const C=await _;t.updateMatch(x,E=>({...E,...C}))}}catch(_){console.error(`Error executing head for route ${j}:`,_)}}const y=um(t);if(Qo(y)&&await y,m)throw m;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function ub(e,t){const s=t.map(a=>e.options[a]?.preload?.()).filter(Boolean);if(s.length!==0)return Promise.all(s)}function Yo(e,t=Jc){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(a=>{const{id:r,...c}=a.options;Object.assign(e.options,c),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);const s=()=>e._componentsLoaded?void 0:t===Jc?(()=>{if(e._componentsPromise===void 0){const a=ub(e,Jc);a?e._componentsPromise=a.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():ub(e,t);return e._lazyPromise?e._lazyPromise.then(s):s()}function pS(e){for(const t of Jc)if(e.options[t]?.preload)return!0;return!1}var Jc=["component","errorComponent","pendingComponent","notFoundComponent"],Ai="__TSR_index",db="popstate",fb="beforeunload";function qk(e){let t=e.getLocation();const s=new Set,a=d=>{t=e.getLocation(),s.forEach(f=>f({location:t,action:d}))},r=d=>{e.notifyOnIndexChange??!0?a(d):t=e.getLocation()},c=async({task:d,navigateOpts:f,...p})=>{if(f?.ignoreBlocker??!1){d();return}const m=e.getBlockers?.()??[],v=p.type==="PUSH"||p.type==="REPLACE";if(typeof document<"u"&&m.length&&v)for(const y of m){const b=mu(p.path,p.state);if(await y.blockerFn({currentLocation:t,nextLocation:b,action:p.type})){e.onBlocked?.();return}}d()};return{get location(){return t},get length(){return e.getLength()},subscribers:s,subscribe:d=>(s.add(d),()=>{s.delete(d)}),push:(d,f,p)=>{const m=t.state[Ai];f=hb(m+1,f),c({task:()=>{e.pushState(d,f),a({type:"PUSH"})},navigateOpts:p,type:"PUSH",path:d,state:f})},replace:(d,f,p)=>{const m=t.state[Ai];f=hb(m,f),c({task:()=>{e.replaceState(d,f),a({type:"REPLACE"})},navigateOpts:p,type:"REPLACE",path:d,state:f})},go:(d,f)=>{c({task:()=>{e.go(d),r({type:"GO",index:d})},navigateOpts:f,type:"GO"})},back:d=>{c({task:()=>{e.back(d?.ignoreBlocker??!1),r({type:"BACK"})},navigateOpts:d,type:"BACK"})},forward:d=>{c({task:()=>{e.forward(d?.ignoreBlocker??!1),r({type:"FORWARD"})},navigateOpts:d,type:"FORWARD"})},canGoBack:()=>t.state[Ai]!==0,createHref:d=>e.createHref(d),block:d=>{if(!e.setBlockers)return()=>{};const f=e.getBlockers?.()??[];return e.setBlockers([...f,d]),()=>{const p=e.getBlockers?.()??[];e.setBlockers?.(p.filter(m=>m!==d))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:a}}function hb(e,t){t||(t={});const s=Km();return{...t,key:s,__TSR_key:s,[Ai]:e}}function Hk(e){const t=typeof document<"u"?window:void 0,s=t.history.pushState,a=t.history.replaceState;let r=[];const c=()=>r,d=R=>r=R,f=(R=>R),p=(()=>mu(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const R=Km();t.history.replaceState({[Ai]:0,key:R,__TSR_key:R},"")}let m=p(),v,y=!1,b=!1,x=!1,j=!1;const w=()=>m;let _,C;const E=()=>{_&&(L._ignoreSubscribers=!0,(_.isPush?t.history.pushState:t.history.replaceState)(_.state,"",_.href),L._ignoreSubscribers=!1,_=void 0,C=void 0,v=void 0)},O=(R,I,ie)=>{const Q=f(I);C||(v=m),m=mu(I,ie),_={href:Q,state:ie,isPush:_?.isPush||R==="push"},C||(C=Promise.resolve().then(()=>E()))},z=R=>{m=p(),L.notify({type:R})},M=async()=>{if(b){b=!1;return}const R=p(),I=R.state[Ai]-m.state[Ai],ie=I===1,Q=I===-1,se=!ie&&!Q||y;y=!1;const me=se?"GO":Q?"BACK":"FORWARD",Ee=se?{type:"GO",index:I}:{type:Q?"BACK":"FORWARD"};if(x)x=!1;else{const we=c();if(typeof document<"u"&&we.length){for(const H of we)if(await H.blockerFn({currentLocation:m,nextLocation:R,action:me})){b=!0,t.history.go(1),L.notify(Ee);return}}}m=p(),L.notify(Ee)},T=R=>{if(j){j=!1;return}let I=!1;const ie=c();if(typeof document<"u"&&ie.length)for(const Q of ie){const se=Q.enableBeforeUnload??!0;if(se===!0){I=!0;break}if(typeof se=="function"&&se()===!0){I=!0;break}}if(I)return R.preventDefault(),R.returnValue=""},L=qk({getLocation:w,getLength:()=>t.history.length,pushState:(R,I)=>O("push",R,I),replaceState:(R,I)=>O("replace",R,I),back:R=>(R&&(x=!0),j=!0,t.history.back()),forward:R=>{R&&(x=!0),j=!0,t.history.forward()},go:R=>{y=!0,t.history.go(R)},createHref:R=>f(R),flush:E,destroy:()=>{t.history.pushState=s,t.history.replaceState=a,t.removeEventListener(fb,T,{capture:!0}),t.removeEventListener(db,M)},onBlocked:()=>{v&&m!==v&&(m=v)},getBlockers:c,setBlockers:d,notifyOnIndexChange:!1});return t.addEventListener(fb,T,{capture:!0}),t.addEventListener(db,M),t.history.pushState=function(...R){const I=s.apply(t.history,R);return L._ignoreSubscribers||z("PUSH"),I},t.history.replaceState=function(...R){const I=a.apply(t.history,R);return L._ignoreSubscribers||z("REPLACE"),I},L}function Zk(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function mu(e,t){const s=Zk(e),a=s.indexOf("#"),r=s.indexOf("?"),c=Km();return{href:s,pathname:s.substring(0,a>0?r>0?Math.min(a,r):a:r>0?r:s.length),hash:a>-1?s.substring(a):"",search:r>-1?s.slice(r,a===-1?void 0:a):"",state:t||{[Ai]:0,key:c,__TSR_key:c}}}function Km(){return(Math.random()+1).toString(36).substring(7)}function ba(e){const t=e.resolvedLocation,s=e.location;return{fromLocation:t,toLocation:s,pathChanged:t?.pathname!==s.pathname,hrefChanged:t?.href!==s.href,hashChanged:t?.hash!==s.hash}}function Fk(e){const t=e.filter(s=>s.status!=="redirected");return t.length===e.length?e:t}var Gk=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 s=this.options,a=this.basepath??s?.basepath??"/",r=this.basepath===void 0,c=s?.rewrite;if(this.options={...s,...t},this.isServer=this.options.isServer??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=ik(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=Hk()),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 m;this.resolvePathCache=uu(1e3),m=this.buildRouteTree(),this.setRoutes(m)}!this.__store&&this.latestLocation&&(this.__store=Lk(Vk(this.latestLocation)),dk(this));let d=!1;const f=this.options.basepath??"/",p=this.options.rewrite;if(r||a!==f||c!==p){this.basepath=f;const m=[],v=aS(f);v&&v!=="/"&&m.push(xk({basepath:f})),p&&m.push(p),this.rewrite=m.length===0?void 0:m.length===1?m[0]:bk(m),this.history&&this.updateLatestLocation(),d=!0}d&&this.__store&&this.__store.setState(m=>({...m,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=JC(this.routeTree,this.options.caseSensitive,(s,a)=>{s.init({originalIndex:a})});return this.options.routeMasks&&KC(this.options.routeMasks,t.processedTree),t},this.subscribe=(t,s)=>{const a={eventType:t,fn:s};return this.subscribers.add(a),()=>{this.subscribers.delete(a)}},this.emit=t=>{this.subscribers.forEach(s=>{s.eventType===t.type&&s.fn(t)})},this.parseLocation=(t,s)=>{const a=({pathname:f,search:p,hash:m,href:v,state:y})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(f)){const _=this.options.parseSearch(p),C=this.options.stringifySearch(_);return{href:f+C+m,publicHref:v,pathname:Ao(f).path,external:!1,searchStr:C,search:ra(s?.search,_),hash:Ao(m.slice(1)).path,state:da(s?.state,y)}}const b=new URL(v,this.origin),x=om(this.rewrite,b),j=this.options.parseSearch(x.search),w=this.options.stringifySearch(j);return x.search=w,{href:x.href.replace(x.origin,""),publicHref:v,pathname:Ao(x.pathname).path,external:!!this.rewrite&&x.origin!==this.origin,searchStr:w,search:ra(s?.search,j),hash:Ao(x.hash.slice(1)).path,state:da(s?.state,y)}},r=a(t),{__tempLocation:c,__tempKey:d}=r.state;if(c&&(!d||d===this.tempLocationKey)){const f=a(c);return f.state.key=r.state.key,f.state.__TSR_key=r.state.__TSR_key,delete f.state.__tempLocation,{...f,maskedLocation:r}}return r},this.resolvePathWithBase=(t,s)=>sk({base:t,to:Hm(s),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(t,s,a)=>typeof t=="string"?this.matchRoutesInternal({pathname:t,search:s},a):this.matchRoutesInternal(t,s),this.getMatchedRoutes=t=>Qk({pathname:t,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=t=>{const s=this.getMatch(t);s&&(s.abortController.abort(),clearTimeout(s._nonReactive.pendingTimeout),s._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const t=this.state.matches.filter(a=>a.status==="pending"),s=this.state.matches.filter(a=>a.isFetching==="loader");new Set([...this.state.pendingMatches??[],...t,...s]).forEach(a=>{this.cancelMatch(a.id)})},this.buildLocation=t=>{const s=(r={})=>{const c=r._fromLocation||this.pendingBuiltLocation||this.latestLocation,d=this.matchRoutesLightweight(c);r.from;const f=r.unsafeRelative==="path"?c.pathname:r.from??d.fullPath,p=this.resolvePathWithBase(f,"."),m=d.search,v=Object.assign(Object.create(null),d.params),y=r.to?this.resolvePathWithBase(p,`${r.to}`):this.resolvePathWithBase(p,"."),b=r.params===!1||r.params===null?Object.create(null):(r.params??!0)===!0?v:Object.assign(v,Ci(r.params,v)),x=this.getMatchedRoutes(y);let j=x.matchedRoutes;if((!x.foundRoute||x.foundRoute.path!=="/"&&x.routeParams["**"])&&this.options.notFoundRoute&&(j=[...j,this.options.notFoundRoute]),Object.keys(b).length>0)for(const I of j){const ie=I.options.params?.stringify??I.options.stringifyParams;if(ie)try{Object.assign(b,ie(b))}catch{}}const w=t.leaveParams?y:Ao(nb({path:y,params:b,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let _=m;if(t._includeValidateSearch&&this.options.search?.strict){const I={};j.forEach(ie=>{if(ie.options.validateSearch)try{Object.assign(I,Wc(ie.options.validateSearch,{...I,..._}))}catch{}}),_=I}_=Yk({search:_,dest:r,destRoutes:j,_includeValidateSearch:t._includeValidateSearch}),_=ra(m,_);const C=this.options.stringifySearch(_),E=r.hash===!0?c.hash:r.hash?Ci(r.hash,c.hash):void 0,O=E?`#${E}`:"";let z=r.state===!0?c.state:r.state?Ci(r.state,c.state):{};z=da(c.state,z);const M=`${w}${C}${O}`;let T,L,R=!1;if(this.rewrite){const I=new URL(M,this.origin),ie=rS(this.rewrite,I);T=I.href.replace(I.origin,""),ie.origin!==this.origin?(L=ie.href,R=!0):L=ie.pathname+ie.search+ie.hash}else T=ZC(M),L=T;return{publicHref:L,href:T,pathname:w,search:_,searchStr:C,state:z,hash:E??"",external:R,unmaskOnReload:r.unmaskOnReload}},a=(r={},c)=>{const d=s(r);let f=c?s(c):void 0;if(!f){const p=Object.create(null);if(this.options.routeMasks){const m=VC(d.pathname,this.processedTree);if(m){Object.assign(p,m.rawParams);const{from:v,params:y,...b}=m.route,x=y===!1||y===null?Object.create(null):(y??!0)===!0?p:Object.assign(p,Ci(y,p));c={from:t.from,...b,params:x},f=s(c)}}}return f&&(d.maskedLocation=f),d};return t.mask?a(t,{from:t.from,...t.mask}):a(t)},this.commitLocation=async({viewTransition:t,ignoreBlocker:s,...a})=>{const r=()=>{const f=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];f.forEach(m=>{a.state[m]=this.latestLocation.state[m]});const p=ga(a.state,this.latestLocation.state);return f.forEach(m=>{delete a.state[m]}),p},c=Ri(this.latestLocation.href)===Ri(a.href);let d=this.commitLocationPromise;if(this.commitLocationPromise=Er(()=>{d?.resolve(),d=void 0}),c&&r())this.load();else{let{maskedLocation:f,hashScrollIntoView:p,...m}=a;f&&(m={...f,state:{...f.state,__tempKey:void 0,__tempLocation:{...m,search:m.searchStr,state:{...m.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(m.unmaskOnReload??this.options.unmaskOnReload??!1)&&(m.state.__tempKey=this.tempLocationKey)),m.state.__hashScrollIntoViewOptions=p??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=t,this.history[a.replace?"replace":"push"](m.publicHref,m.state,{ignoreBlocker:s})}return this.resetNextScroll=a.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:t,resetScroll:s,hashScrollIntoView:a,viewTransition:r,ignoreBlocker:c,href:d,...f}={})=>{if(d){const v=this.history.location.state.__TSR_index,y=mu(d,{__TSR_index:t?v:v+1}),b=new URL(y.pathname,this.origin);f.to=om(this.rewrite,b).pathname,f.search=this.options.parseSearch(y.search),f.hash=y.hash.slice(1)}const p=this.buildLocation({...f,_includeValidateSearch:!0});this.pendingBuiltLocation=p;const m=this.commitLocation({...p,viewTransition:r,replace:t,resetScroll:s,hashScrollIntoView:a,ignoreBlocker:c});return Promise.resolve().then(()=>{this.pendingBuiltLocation===p&&(this.pendingBuiltLocation=void 0)}),m},this.navigate=async({to:t,reloadDocument:s,href:a,publicHref:r,...c})=>{let d=!1;if(a)try{new URL(`${a}`),d=!0}catch{}if(d&&!s&&(s=!0),s){if(t!==void 0||!a){const p=this.buildLocation({to:t,...c});a=a??p.publicHref,r=r??p.publicHref}const f=!d&&r?r:a;if(cu(f,this.protocolAllowlist))return Promise.resolve();if(!c.ignoreBlocker){const p=this.history.getBlockers?.()??[];for(const m of p)if(m?.blockerFn&&await m.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return c.replace?window.location.replace(f):window.location.href=f,Promise.resolve()}return this.buildAndCommitLocation({...c,href:a,to:t,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const t=this.matchRoutes(this.latestLocation);this.__store.setState(s=>({...s,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:t,cachedMatches:s.cachedMatches.filter(a=>!t.some(r=>r.id===a.id))}))},this.load=async t=>{let s,a,r;const c=this.state.resolvedLocation??this.state.location;for(r=new Promise(f=>{this.startTransition(async()=>{try{this.beforeLoad();const p=this.latestLocation,m=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...ba({resolvedLocation:m,location:p})}),this.emit({type:"onBeforeLoad",...ba({resolvedLocation:m,location:p})}),await cb({router:this,sync:t?.sync,forceStaleReload:c.href===p.href,matches:this.state.pendingMatches,location:p,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let v=[],y=[],b=[],x=[];qo(()=>{this.__store.setState(j=>{const w=j.matches,_=j.pendingMatches||j.matches;return v=w.filter(C=>!_.some(E=>E.id===C.id)),y=w.filter(C=>!_.some(E=>E.routeId===C.routeId)),b=_.filter(C=>!w.some(E=>E.routeId===C.routeId)),x=_.filter(C=>w.some(E=>E.routeId===C.routeId)),{...j,isLoading:!1,loadedAt:Date.now(),matches:_,pendingMatches:void 0,cachedMatches:[...j.cachedMatches,...v.filter(C=>C.status!=="error"&&C.status!=="notFound"&&C.status!=="redirected")]}}),this.clearExpiredCache()}),[[y,"onLeave"],[b,"onEnter"],[x,"onStay"]].forEach(([j,w])=>{j.forEach(_=>{this.looseRoutesById[_.routeId].options[w]?.(_)})})})})}})}catch(p){vn(p)?(s=p,this.navigate({...s.options,replace:!0,ignoreBlocker:!0})):un(p)&&(a=p),this.__store.setState(m=>({...m,statusCode:s?s.status:a?404:m.matches.some(v=>v.status==="error")?500:200,redirect:s}))}this.latestLoadPromise===r&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),f()})}),this.latestLoadPromise=r,await r;this.latestLoadPromise&&r!==this.latestLoadPromise;)await this.latestLoadPromise;let d;this.hasNotFoundMatch()?d=404:this.__store.state.matches.some(f=>f.status==="error")&&(d=500),d!==void 0&&this.__store.setState(f=>({...f,statusCode:d}))},this.startViewTransition=t=>{const s=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,s&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let a;if(typeof s=="object"&&this.isViewTransitionTypesSupported){const r=this.latestLocation,c=this.state.resolvedLocation,d=typeof s.types=="function"?s.types(ba({resolvedLocation:c,location:r})):s.types;if(d===!1){t();return}a={update:t,types:d}}else a=t;document.startViewTransition(a)}else t()},this.updateMatch=(t,s)=>{this.startTransition(()=>{const a=this.state.pendingMatches?.some(r=>r.id===t)?"pendingMatches":this.state.matches.some(r=>r.id===t)?"matches":this.state.cachedMatches.some(r=>r.id===t)?"cachedMatches":"";a&&(a==="cachedMatches"?this.__store.setState(r=>({...r,cachedMatches:Fk(r.cachedMatches.map(c=>c.id===t?s(c):c))})):this.__store.setState(r=>({...r,[a]:r[a]?.map(c=>c.id===t?s(c):c)})))})},this.getMatch=t=>{const s=a=>a.id===t;return this.state.cachedMatches.find(s)??this.state.pendingMatches?.find(s)??this.state.matches.find(s)},this.invalidate=t=>{const s=a=>t?.filter?.(a)??!0?{...a,invalid:!0,...t?.forcePending||a.status==="error"||a.status==="notFound"?{status:"pending",error:void 0}:void 0}:a;return this.__store.setState(a=>({...a,matches:a.matches.map(s),cachedMatches:a.cachedMatches.map(s),pendingMatches:a.pendingMatches?.map(s)})),this.shouldViewTransition=!1,this.load({sync:t?.sync})},this.getParsedLocationHref=t=>t.publicHref||"/",this.resolveRedirect=t=>{const s=t.headers.get("Location");if(!t.options.href||t.options._builtLocation){const a=t.options._builtLocation??this.buildLocation(t.options),r=this.getParsedLocationHref(a);t.options.href=r,t.headers.set("Location",r)}else if(s)try{const a=new URL(s);if(this.origin&&a.origin===this.origin){const r=a.pathname+a.search+a.hash;t.options.href=r,t.headers.set("Location",r)}}catch{}if(t.options.href&&!t.options._builtLocation&&cu(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 s=t?.filter;s!==void 0?this.__store.setState(a=>({...a,cachedMatches:a.cachedMatches.filter(r=>!s(r))})):this.__store.setState(a=>({...a,cachedMatches:[]}))},this.clearExpiredCache=()=>{const t=s=>{const a=this.looseRoutesById[s.routeId];if(!a.options.loader)return!0;const r=(s.preload?a.options.preloadGcTime??this.options.defaultPreloadGcTime:a.options.gcTime??this.options.defaultGcTime)??300*1e3;return s.status==="error"?!0:Date.now()-s.updatedAt>=r};this.clearCache({filter:t})},this.loadRouteChunk=Yo,this.preloadRoute=async t=>{const s=t._builtLocation??this.buildLocation(t);let a=this.matchRoutes(s,{throwOnError:!0,preload:!0,dest:t});const r=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(d=>d.id)),c=new Set([...r,...this.state.cachedMatches.map(d=>d.id)]);qo(()=>{a.forEach(d=>{c.has(d.id)||this.__store.setState(f=>({...f,cachedMatches:[...f.cachedMatches,d]}))})});try{return a=await cb({router:this,matches:a,location:s,preload:!0,updateMatch:(d,f)=>{r.has(d)?a=a.map(p=>p.id===d?f(p):p):this.updateMatch(d,f)}}),a}catch(d){if(vn(d))return d.options.reloadDocument?void 0:await this.preloadRoute({...d.options,_fromLocation:s});un(d)||console.error(d);return}},this.matchRoute=(t,s)=>{const a={...t,to:t.to?this.resolvePathWithBase(t.from||"",t.to):void 0,params:t.params||{},leaveParams:!0},r=this.buildLocation(a);if(s?.pending&&this.state.status!=="pending")return!1;const c=(s?.pending===void 0?!this.state.isLoading:s.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,d=QC(r.pathname,s?.caseSensitive??!1,s?.fuzzy??!1,c.pathname,this.processedTree);return!d||t.params&&!ga(d.rawParams,t.params,{partial:!0})?!1:s?.includeSearch??!0?ga(c.search,r.search,{partial:!0})?d.rawParams:!1:d.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??gk,parseSearch:e.parseSearch??pk,protocolAllowlist:e.protocolAllowlist??HC}),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:s}){this.routesById=e,this.routesByPath=t,this.processedTree=s;const a=this.options.notFoundRoute;a&&(a.init({originalIndex:99999999999}),this.routesById[a.id]=a)}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 s=this.getMatchedRoutes(e.pathname),{foundRoute:a,routeParams:r,parsedParams:c}=s;let{matchedRoutes:d}=s,f=!1;(a?a.path!=="/"&&r["**"]:Ri(e.pathname))&&(this.options.notFoundRoute?d=[...d,this.options.notFoundRoute]:f=!0);const p=f?Jk(this.options.notFoundMode,d):void 0,m=new Array(d.length),v=new Map(this.state.matches.map(y=>[y.routeId,y]));for(let y=0;y<d.length;y++){const b=d[y],x=m[y-1];let j,w,_;{const me=x?.search??e.search,Ee=x?._strictSearch??void 0;try{const we=Wc(b.options.validateSearch,{...me})??void 0;j={...me,...we},w={...Ee,...we},_=void 0}catch(we){let H=we;if(we instanceof pu||(H=new pu(we.message,{cause:we})),t?.throwOnError)throw H;j=me,w={},_=H}}const C=b.options.loaderDeps?.({search:j})??"",E=C?JSON.stringify(C):"",{interpolatedPath:O,usedParams:z}=nb({path:b.fullPath,params:r,decoder:this.pathParamsDecoder,server:this.isServer}),M=b.id+O+E,T=this.getMatch(M),L=v.get(b.id),R=T?._strictParams??z;let I;if(!T)try{mb(b,z,c,R)}catch(me){if(un(me)||vn(me)?I=me:I=new Kk(me.message,{cause:me}),t?.throwOnError)throw I}Object.assign(r,R);const ie=L?"stay":"enter";let Q;if(T)Q={...T,cause:ie,params:L?.params??r,_strictParams:R,search:ra(L?L.search:T.search,j),_strictSearch:w};else{const me=b.options.loader||b.options.beforeLoad||b.lazyFn||pS(b)?"pending":"success";Q={id:M,ssr:b.options.ssr,index:y,routeId:b.id,params:L?.params??r,_strictParams:R,pathname:O,updatedAt:Date.now(),search:L?ra(L.search,j):j,_strictSearch:w,searchError:void 0,status:me,isFetching:!1,error:void 0,paramsError:I,__routeContext:void 0,_nonReactive:{loadPromise:Er()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:ie,loaderDeps:L?da(L.loaderDeps,C):C,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:b.options.staticData||{},fullPath:b.fullPath}}t?.preload||(Q.globalNotFound=p===b.id),Q.searchError=_;const se=this.getParentContext(x);Q.context={...se,...Q.__routeContext,...Q.__beforeLoadContext},m[y]=Q}for(let y=0;y<m.length;y++){const b=m[y],x=this.looseRoutesById[b.routeId],j=this.getMatch(b.id),w=v.get(b.routeId);if(b.params=w?ra(w.params,r):r,!j){const _=m[y-1],C=this.getParentContext(_);if(x.options.context){const E={deps:b.loaderDeps,params:b.params,context:C??{},location:e,navigate:O=>this.navigate({...O,_fromLocation:e}),buildLocation:this.buildLocation,cause:b.cause,abortController:b.abortController,preload:!!b.preload,matches:m,routeId:x.id};b.__routeContext=x.options.context(E)??void 0}b.context={...C,...b.__routeContext,...b.__beforeLoadContext}}}return m}matchRoutesLightweight(e){const{matchedRoutes:t,routeParams:s,parsedParams:a}=this.getMatchedRoutes(e.pathname),r=Vo(t),c={...e.search};for(const m of t)try{Object.assign(c,Wc(m.options.validateSearch,c))}catch{}const d=Vo(this.state.matches),f=d&&d.routeId===r.id&&e.pathname===this.state.location.pathname;let p;if(f)p=d.params;else{const m=Object.assign(Object.create(null),s);for(const v of t)try{mb(v,s,a??{},m)}catch{}p=m}return{matchedRoutes:t,fullPath:r.fullPath,search:c,params:p}}},pu=class extends Error{},Kk=class extends Error{};function Vk(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function Wc(e,t){if(e==null)return{};if("~standard"in e){const s=e["~standard"].validate(t);if(s instanceof Promise)throw new pu("Async validation not supported");if(s.issues)throw new pu(JSON.stringify(s.issues,void 0,2),{cause:s});return s.value}return"parse"in e?e.parse(t):typeof e=="function"?e(t):{}}function Qk({pathname:e,routesById:t,processedTree:s}){const a=Object.create(null),r=Ri(e);let c,d;const f=YC(r,s,!0);return f&&(c=f.route,Object.assign(a,f.rawParams),d=Object.assign(Object.create(null),f.parsedParams)),{matchedRoutes:f?.branch||[t.__root__],routeParams:a,foundRoute:c,parsedParams:d}}function Yk({search:e,dest:t,destRoutes:s,_includeValidateSearch:a}){return Xk(s)(e,t,a??!1)}function Xk(e){const t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const r of e){if("search"in r.options)r.options.search?.middlewares&&t.middlewares.push(...r.options.search.middlewares);else if(r.options.preSearchFilters||r.options.postSearchFilters){const c=({search:d,next:f})=>{let p=d;"preSearchFilters"in r.options&&r.options.preSearchFilters&&(p=r.options.preSearchFilters.reduce((v,y)=>y(v),d));const m=f(p);return"postSearchFilters"in r.options&&r.options.postSearchFilters?r.options.postSearchFilters.reduce((v,y)=>y(v),m):m};t.middlewares.push(c)}if(r.options.validateSearch){const c=({search:d,next:f})=>{const p=f(d);if(!t._includeValidateSearch)return p;try{return{...p,...Wc(r.options.validateSearch,p)??void 0}}catch{return p}};t.middlewares.push(c)}}const s=({search:r})=>{const c=t.dest;return c.search?c.search===!0?r:Ci(c.search,r):{}};t.middlewares.push(s);const a=(r,c,d)=>{if(r>=d.length)return c;const f=d[r];return f({search:c,next:m=>a(r+1,m,d)})};return function(c,d,f){return t.dest=d,t._includeValidateSearch=f,a(0,c,t.middlewares)}}function Jk(e,t){if(e!=="root")for(let s=t.length-1;s>=0;s--){const a=t[s];if(a.children)return a.id}return ya}function mb(e,t,s,a){const r=e.options.params?.parse??e.options.parseParams;if(r)if(e.options.skipRouteOnParseError)for(const c in t)c in s&&(a[c]=s[c]);else{const c=r(a);Object.assign(a,c)}}var Wk="Error preloading route! ☝️",gS=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 s=this.options,a=!s?.path&&!s?.id;this.parentRoute=this.options.getParentRoute?.(),a?this._path=ya:this.parentRoute||Li(!1);let r=a?ya:s?.path;r&&r!=="/"&&(r=iS(r));const c=s?.id||r;let d=a?ya:Yc([this.parentRoute.id==="__root__"?"":this.parentRoute.id,c]);r==="__root__"&&(r="/"),d!=="__root__"&&(d=Yc(["/",d]));const f=d==="__root__"?"/":Yc([this.parentRoute.fullPath,r]);this._path=r,this._id=d,this._fullPath=f,this._to=Ri(f)},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=>Zm({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.")}},ez=class extends gS{constructor(e){super(e)}};function Vm(e){const t=e.errorComponent??Qm;return l.jsx(tz,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:s,reset:a})=>s?N.createElement(t,{error:s,reset:a}):e.children})}var tz=class extends N.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 Qm({error:e}){const[t,s]=N.useState(!1);return l.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[l.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),l.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>s(a=>!a),children:t?"Hide Error":"Show Error"})]}),l.jsx("div",{style:{height:".25rem"}}),t?l.jsx("div",{children:l.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?l.jsx("code",{children:e.message}):null})}):null]})}function nz({children:e,fallback:t=null}){return yS()?l.jsx(ns.Fragment,{children:e}):l.jsx(ns.Fragment,{children:t})}function yS(){return ns.useSyncExternalStore(sz,()=>!0,()=>!1)}function sz(){return()=>{}}var vS=N.createContext(null);function Gn(e){const t=N.useContext(vS);return e?.warn,t}var Eh={exports:{}},Oh={},Rh={exports:{}},Ah={};var pb;function iz(){if(pb)return Ah;pb=1;var e=il();function t(y,b){return y===b&&(y!==0||1/y===1/b)||y!==y&&b!==b}var s=typeof Object.is=="function"?Object.is:t,a=e.useState,r=e.useEffect,c=e.useLayoutEffect,d=e.useDebugValue;function f(y,b){var x=b(),j=a({inst:{value:x,getSnapshot:b}}),w=j[0].inst,_=j[1];return c(function(){w.value=x,w.getSnapshot=b,p(w)&&_({inst:w})},[y,x,b]),r(function(){return p(w)&&_({inst:w}),y(function(){p(w)&&_({inst:w})})},[y]),d(x),x}function p(y){var b=y.getSnapshot;y=y.value;try{var x=b();return!s(y,x)}catch{return!0}}function m(y,b){return b()}var v=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?m:f;return Ah.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:v,Ah}var gb;function az(){return gb||(gb=1,Rh.exports=iz()),Rh.exports}var yb;function rz(){if(yb)return Oh;yb=1;var e=il(),t=az();function s(m,v){return m===v&&(m!==0||1/m===1/v)||m!==m&&v!==v}var a=typeof Object.is=="function"?Object.is:s,r=t.useSyncExternalStore,c=e.useRef,d=e.useEffect,f=e.useMemo,p=e.useDebugValue;return Oh.useSyncExternalStoreWithSelector=function(m,v,y,b,x){var j=c(null);if(j.current===null){var w={hasValue:!1,value:null};j.current=w}else w=j.current;j=f(function(){function C(T){if(!E){if(E=!0,O=T,T=b(T),x!==void 0&&w.hasValue){var L=w.value;if(x(L,T))return z=L}return z=T}if(L=z,a(O,T))return L;var R=b(T);return x!==void 0&&x(L,R)?(O=T,L):(O=T,z=R)}var E=!1,O,z,M=y===void 0?null:y;return[function(){return C(v())},M===null?void 0:function(){return C(M())}]},[v,y,b,x]);var _=r(m,j[0],j[1]);return d(function(){w.hasValue=!0,w.value=_},[_]),p(_),_},Oh}var vb;function oz(){return vb||(vb=1,Eh.exports=rz()),Eh.exports}var lz=oz();function cz(e,t){return e===t}function uz(e,t,s=cz){const a=N.useCallback(d=>{if(!e)return()=>{};const{unsubscribe:f}=e.subscribe(d);return f},[e]),r=N.useCallback(()=>e?.get(),[e]);return lz.useSyncExternalStoreWithSelector(a,r,r,t,s)}function bn(e){const t=Gn({warn:e?.router===void 0}),s=e?.router||t,a=N.useRef(void 0);return uz(s.__store,r=>{if(e?.select){if(e.structuralSharing??s.options.defaultStructuralSharing){const c=da(a.current,e.select(r));return a.current=c,c}return e.select(r)}return r})}var Au=N.createContext(void 0),dz=N.createContext(void 0);function $i(e){const t=N.useContext(e.from?dz:Au);return bn({select:s=>{const a=s.matches.find(r=>e.from?e.from===r.routeId:r.id===t);if(Li(!((e.shouldThrow??!0)&&!a),`Could not find ${e.from?`an active match from "${e.from}"`:"a nearest match!"}`),a!==void 0)return e.select?e.select(a):a},structuralSharing:e.structuralSharing})}function Ym(e){return $i({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Xm(e){const{select:t,...s}=e;return $i({...s,select:a=>t?t(a.loaderDeps):a.loaderDeps})}function Tu(e){return $i({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const s=e.strict===!1?t.params:t._strictParams;return e.select?e.select(s):s}})}function Du(e){return $i({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function ja(e){const t=Gn();return N.useCallback(s=>t.navigate({...s,from:s.from??e?.from}),[e?.from,t])}function Jm(e){return $i({...e,select:t=>e.select?e.select(t.context):t.context})}var Wm=$x();const fz=Ux(Wm);function hz(e,t){const s=Gn(),a=UC(t),{activeProps:r,inactiveProps:c,activeOptions:d,to:f,preload:p,preloadDelay:m,hashScrollIntoView:v,replace:y,startTransition:b,resetScroll:x,viewTransition:j,children:w,target:_,disabled:C,style:E,className:O,onClick:z,onBlur:M,onFocus:T,onMouseEnter:L,onMouseLeave:R,onTouchStart:I,ignoreBlocker:ie,params:Q,search:se,hash:me,state:Ee,mask:we,reloadDocument:H,unsafeRelative:Z,from:oe,_fromLocation:pe,...ee}=e,D=yS(),G=bn({select:ke=>{const Te=ke.matches[ke.matches.length-1];return{search:Te?.search,hash:ke.location.hash,path:Te?.pathname}},structuralSharing:!0}),ne=e.from,ae=N.useMemo(()=>({...e,from:ne}),[s,G,ne,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),le=N.useMemo(()=>s.buildLocation({...ae}),[s,ae]),he=le.maskedLocation?le.maskedLocation.publicHref:le.publicHref,de=le.maskedLocation?le.maskedLocation.external:le.external,Ze=N.useMemo(()=>bz(he,de,s.history,C),[C,de,he,s.history]),ge=N.useMemo(()=>{if(Ze?.external)return cu(Ze.href,s.protocolAllowlist)?void 0:Ze.href;if(!xz(f)&&!(typeof f!="string"||f.indexOf(":")===-1))try{return new URL(f),cu(f,s.protocolAllowlist)?void 0:f}catch{}},[f,Ze,s.protocolAllowlist]),Ye=bn({select:ke=>{if(ge)return!1;if(d?.exact){if(!nk(ke.location.pathname,le.pathname,s.basepath))return!1}else{const Te=du(ke.location.pathname,s.basepath),kt=du(le.pathname,s.basepath);if(!(Te.startsWith(kt)&&(Te.length===kt.length||Te[kt.length]==="/")))return!1}return(d?.includeSearch??!0)&&!ga(ke.location.search,le.search,{partial:!d?.exact,ignoreUndefined:!d?.explicitUndefined})?!1:d?.includeHash?D&&ke.location.hash===le.hash:!0}}),ft=Ye?Ci(r,{})??mz:Th,fe=Ye?Th:Ci(c,{})??Th,Qe=[O,ft.className,fe.className].filter(Boolean).join(" "),lt=(E||ft.style||fe.style)&&{...E,...ft.style,...fe.style},[Wt,_t]=N.useState(!1),nn=N.useRef(!1),Gt=e.reloadDocument||ge?!1:p??s.options.defaultPreload,Ct=m??s.options.defaultPreloadDelay??0,St=N.useCallback(()=>{s.preloadRoute({...ae,_builtLocation:le}).catch(ke=>{console.warn(ke),console.warn(Wk)})},[s,ae,le]);MC(a,N.useCallback(ke=>{ke?.isIntersecting&&St()},[St]),vz,{disabled:!!C||Gt!=="viewport"}),N.useEffect(()=>{nn.current||!C&&Gt==="render"&&(St(),nn.current=!0)},[C,St,Gt]);const sn=ke=>{const Te=ke.currentTarget.getAttribute("target"),kt=_!==void 0?_:Te;if(!C&&!Sz(ke)&&!ke.defaultPrevented&&(!kt||kt==="_self")&&ke.button===0){ke.preventDefault(),Wm.flushSync(()=>{_t(!0)});const Qn=s.subscribe("onResolved",()=>{Qn(),_t(!1)});s.navigate({...ae,replace:y,resetScroll:x,hashScrollIntoView:v,startTransition:b,viewTransition:j,ignoreBlocker:ie})}};if(ge)return{...ee,ref:a,href:ge,...w&&{children:w},..._&&{target:_},...C&&{disabled:C},...E&&{style:E},...O&&{className:O},...z&&{onClick:z},...M&&{onBlur:M},...T&&{onFocus:T},...L&&{onMouseEnter:L},...R&&{onMouseLeave:R},...I&&{onTouchStart:I}};const re=ke=>{if(C||Gt!=="intent")return;if(!Ct){St();return}const Te=ke.currentTarget;if(Lo.has(Te))return;const kt=setTimeout(()=>{Lo.delete(Te),St()},Ct);Lo.set(Te,kt)},Ue=ke=>{C||Gt!=="intent"||St()},$e=ke=>{if(C||!Gt||!Ct)return;const Te=ke.currentTarget,kt=Lo.get(Te);kt&&(clearTimeout(kt),Lo.delete(Te))};return{...ee,...ft,...fe,href:Ze?.href,ref:a,onClick:fr([z,sn]),onBlur:fr([M,$e]),onFocus:fr([T,re]),onMouseEnter:fr([L,re]),onMouseLeave:fr([R,$e]),onTouchStart:fr([I,Ue]),disabled:!!C,target:_,...lt&&{style:lt},...Qe&&{className:Qe},...C&&pz,...Ye&&gz,...D&&Wt&&yz}}var Th={},mz={className:"active"},pz={role:"link","aria-disabled":!0},gz={"data-status":"active","aria-current":"page"},yz={"data-transitioning":"transitioning"},Lo=new WeakMap,vz={rootMargin:"100px"},fr=e=>t=>{for(const s of e)if(s){if(t.defaultPrevented)return;s(t)}};function bz(e,t,s,a){if(!a)return t?{href:e,external:!0}:{href:s.createHref(e)||"/",external:!1}}function xz(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var mt=N.forwardRef((e,t)=>{const{_asChild:s,...a}=e,{type:r,...c}=hz(a,t),d=typeof a.children=="function"?a.children({isActive:c["data-status"]==="active"}):a.children;if(!s){const{disabled:f,...p}=c;return N.createElement("a",p,d)}return N.createElement(s,c,d)});function Sz(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var wz=class extends gS{constructor(e){super(e),this.useMatch=t=>$i({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>Jm({...t,from:this.id}),this.useSearch=t=>Du({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>Tu({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>Xm({...t,from:this.id}),this.useLoaderData=t=>Ym({...t,from:this.id}),this.useNavigate=()=>ja({from:this.fullPath}),this.Link=ns.forwardRef((t,s)=>l.jsx(mt,{ref:s,from:this.fullPath,...t})),this.$$typeof=Symbol.for("react.memo")}};function is(e){return new wz(e)}function jz(){return e=>_z(e)}var Nz=class extends ez{constructor(e){super(e),this.useMatch=t=>$i({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>Jm({...t,from:this.id}),this.useSearch=t=>Du({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>Tu({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>Xm({...t,from:this.id}),this.useLoaderData=t=>Ym({...t,from:this.id}),this.useNavigate=()=>ja({from:this.fullPath}),this.Link=ns.forwardRef((t,s)=>l.jsx(mt,{ref:s,from:this.fullPath,...t})),this.$$typeof=Symbol.for("react.memo")}};function _z(e){return new Nz(e)}function bb(e){return typeof e=="object"?new xb(e,{silent:!0}).createRoute(e):new xb(e,{silent:!0}).createRoute}var xb=class{constructor(e,t){this.path=e,this.createRoute=s=>{const a=is(s);return a.isRoot=!1,a},this.silent=t?.silent}},Sb=class{constructor(e){this.useMatch=t=>$i({select:t?.select,from:this.options.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>Jm({...t,from:this.options.id}),this.useSearch=t=>Du({select:t?.select,structuralSharing:t?.structuralSharing,from:this.options.id}),this.useParams=t=>Tu({select:t?.select,structuralSharing:t?.structuralSharing,from:this.options.id}),this.useLoaderDeps=t=>Xm({...t,from:this.options.id}),this.useLoaderData=t=>Ym({...t,from:this.options.id}),this.useNavigate=()=>ja({from:Gn().routesById[this.options.id].fullPath}),this.options=e,this.$$typeof=Symbol.for("react.memo")}};function wb(e){return typeof e=="object"?new Sb(e):t=>new Sb({id:e,...t})}function Cz(e){const t=bn({select:s=>`not-found-${s.location.pathname}-${s.status}`});return l.jsx(Vm,{getResetKey:()=>t,onCatch:(s,a)=>{if(un(s))e.onCatch?.(s,a);else throw s},errorComponent:({error:s})=>{if(un(s))return e.fallback?.(s);throw s},children:e.children})}function kz(){return l.jsx("p",{children:"Not Found"})}function vr(e){return l.jsx(l.Fragment,{children:e.children})}function bS(e,t,s){return t.options.notFoundComponent?l.jsx(t.options.notFoundComponent,{...s}):e.options.defaultNotFoundComponent?l.jsx(e.options.defaultNotFoundComponent,{...s}):l.jsx(kz,{})}function zz(){return Gn().isScrollRestoring,null}var xS=N.memo(function({matchId:t}){const s=Gn(),a=bn({select:j=>{const w=j.matches.findIndex(C=>C.id===t),_=j.matches[w];return Li(_),{routeId:_.routeId,ssr:_.ssr,_displayPending:_._displayPending,resetKey:j.loadedAt,parentRouteId:j.matches[w-1]?.routeId}},structuralSharing:!0}),r=s.routesById[a.routeId],c=r.options.pendingComponent??s.options.defaultPendingComponent,d=c?l.jsx(c,{}):null,f=r.options.errorComponent??s.options.defaultErrorComponent,p=r.options.onCatch??s.options.defaultOnCatch,m=r.isRoot?r.options.notFoundComponent??s.options.notFoundRoute?.options.component:r.options.notFoundComponent,v=a.ssr===!1||a.ssr==="data-only",y=(!r.isRoot||r.options.wrapInSuspense||v)&&(r.options.wrapInSuspense??c??(r.options.errorComponent?.preload||v))?N.Suspense:vr,b=f?Vm:vr,x=m?Cz:vr;return l.jsxs(r.isRoot?r.options.shellComponent??vr:vr,{children:[l.jsx(Au.Provider,{value:t,children:l.jsx(y,{fallback:d,children:l.jsx(b,{getResetKey:()=>a.resetKey,errorComponent:f||Qm,onCatch:(j,w)=>{if(un(j))throw j;p?.(j,w)},children:l.jsx(x,{fallback:j=>{if(!m||j.routeId&&j.routeId!==a.routeId||!j.routeId&&!r.isRoot)throw j;return N.createElement(m,j)},children:v||a._displayPending?l.jsx(nz,{fallback:d,children:l.jsx(jb,{matchId:t})}):l.jsx(jb,{matchId:t})})})})}),a.parentRouteId===ya&&s.options.scrollRestoration?l.jsxs(l.Fragment,{children:[l.jsx(Ez,{}),l.jsx(zz,{})]}):null]})});function Ez(){const e=Gn(),t=N.useRef(void 0);return l.jsx("script",{suppressHydrationWarning:!0,ref:s=>{s&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...ba(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}var jb=N.memo(function({matchId:t}){const s=Gn(),{match:a,key:r,routeId:c}=bn({select:p=>{const m=p.matches.find(b=>b.id===t),v=m.routeId,y=(s.routesById[v].options.remountDeps??s.options.defaultRemountDeps)?.({routeId:v,loaderDeps:m.loaderDeps,params:m._strictParams,search:m._strictSearch});return{key:y?JSON.stringify(y):void 0,routeId:v,match:{id:m.id,status:m.status,error:m.error,_forcePending:m._forcePending,_displayPending:m._displayPending}}},structuralSharing:!0}),d=s.routesById[c],f=N.useMemo(()=>{const p=d.options.component??s.options.defaultComponent;return p?l.jsx(p,{},r):l.jsx(ep,{})},[r,d.options.component,s.options.defaultComponent]);if(a._displayPending)throw s.getMatch(a.id)?._nonReactive.displayPendingPromise;if(a._forcePending)throw s.getMatch(a.id)?._nonReactive.minPendingPromise;if(a.status==="pending"){const p=d.options.pendingMinMs??s.options.defaultPendingMinMs;if(p){const m=s.getMatch(a.id);if(m&&!m._nonReactive.minPendingPromise){const v=Er();m._nonReactive.minPendingPromise=v,setTimeout(()=>{v.resolve(),m._nonReactive.minPendingPromise=void 0},p)}}throw s.getMatch(a.id)?._nonReactive.loadPromise}if(a.status==="notFound")return Li(un(a.error)),bS(s,d,a.error);if(a.status==="redirected")throw Li(vn(a.error)),s.getMatch(a.id)?._nonReactive.loadPromise;if(a.status==="error")throw a.error;return f}),ep=N.memo(function(){const t=Gn(),s=N.useContext(Au),a=bn({select:m=>m.matches.find(v=>v.id===s)?.routeId}),r=t.routesById[a],c=bn({select:m=>{const v=m.matches.find(y=>y.id===s);return Li(v),v.globalNotFound}}),d=bn({select:m=>{const v=m.matches;return v[v.findIndex(y=>y.id===s)+1]?.id}}),f=t.options.defaultPendingComponent?l.jsx(t.options.defaultPendingComponent,{}):null;if(c)return bS(t,r,void 0);if(!d)return null;const p=l.jsx(xS,{matchId:d});return a===ya?l.jsx(N.Suspense,{fallback:f,children:p}):p});function Oz(){const e=Gn(),t=N.useRef({router:e,mounted:!1}),[s,a]=N.useState(!1),{hasPendingMatches:r,isLoading:c}=bn({select:y=>({isLoading:y.isLoading,hasPendingMatches:y.matches.some(b=>b.status==="pending")}),structuralSharing:!0}),d=jh(c),f=c||s||r,p=jh(f),m=c||r,v=jh(m);return e.startTransition=y=>{a(!0),N.startTransition(()=>{y(),a(!1)})},N.useEffect(()=>{const y=e.history.subscribe(e.load),b=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Ri(e.latestLocation.publicHref)!==Ri(b.publicHref)&&e.commitLocation({...b,replace:!0}),()=>{y()}},[e,e.history]),Oc(()=>{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(b){console.error(b)}})()},[e]),Oc(()=>{d&&!c&&e.emit({type:"onLoad",...ba(e.state)})},[d,e,c]),Oc(()=>{v&&!m&&e.emit({type:"onBeforeRouteMount",...ba(e.state)})},[m,v,e]),Oc(()=>{if(p&&!f){const y=ba(e.state);e.emit({type:"onResolved",...y}),e.__store.setState(b=>({...b,status:"idle",resolvedLocation:b.location})),y.hrefChanged&&fk(e)}},[f,p,e]),null}function Rz(){const e=Gn(),t=e.routesById[ya].options.pendingComponent??e.options.defaultPendingComponent,s=t?l.jsx(t,{}):null,a=l.jsxs(typeof document<"u"&&e.ssr?vr:N.Suspense,{fallback:s,children:[l.jsx(Oz,{}),l.jsx(Az,{})]});return e.options.InnerWrap?l.jsx(e.options.InnerWrap,{children:a}):a}function Az(){const e=Gn(),t=bn({select:r=>r.matches[0]?.id}),s=bn({select:r=>r.loadedAt}),a=t?l.jsx(xS,{matchId:t}):null;return l.jsx(Au.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?a:l.jsx(Vm,{getResetKey:()=>s,errorComponent:Qm,onCatch:void 0,children:a})})}var Tz=e=>new Dz(e),Dz=class extends Gk{constructor(e){super(e)}};typeof globalThis<"u"?(globalThis.createFileRoute=bb,globalThis.createLazyFileRoute=wb):typeof window<"u"&&(window.createFileRoute=bb,window.createLazyFileRoute=wb);function Lz({router:e,children:t,...s}){Object.keys(s).length>0&&e.update({...e.options,...s,context:{...e.options.context,...s.context}});const a=l.jsx(vS.Provider,{value:e,children:t});return e.options.Wrap?l.jsx(e.options.Wrap,{children:a}):a}function Mz({router:e,...t}){return l.jsx(Lz,{router:e,...t,children:l.jsx(Rz,{})})}function Uz(e){return bn({select:t=>t.location})}let zi=[],$z=0;const dm=new Set;function SS(){const e=[...zi];for(const t of dm)t(e)}function Pz(e,t="negative",s=6e3){const a=String(++$z),r={id:a,message:e,tone:t,expiresAt:Date.now()+s};return zi=[...zi,r],SS(),setTimeout(()=>{wS(a)},s),a}function wS(e){const t=zi.length;zi=zi.filter(s=>s.id!==e),zi.length!==t&&SS()}function Iz(e){return dm.add(e),()=>{dm.delete(e)}}function Nb(){return zi}function Bz(){return new EC({defaultOptions:{queries:{staleTime:3e4,retry:1,refetchOnWindowFocus:!1}},mutationCache:new Gx({onError:e=>{Pz(e instanceof Error?e.message:"An unexpected error occurred","negative")}})})}const qz=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Hz=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,s,a)=>a?a.toUpperCase():s.toLowerCase()),_b=e=>{const t=Hz(e);return t.charAt(0).toUpperCase()+t.slice(1)},jS=(...e)=>e.filter((t,s,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===s).join(" ").trim(),Zz=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var Fz={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 Gz=N.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:s=2,absoluteStrokeWidth:a,className:r="",children:c,iconNode:d,...f},p)=>N.createElement("svg",{ref:p,...Fz,width:t,height:t,stroke:e,strokeWidth:a?Number(s)*24/Number(t):s,className:jS("lucide",r),...!c&&!Zz(f)&&{"aria-hidden":"true"},...f},[...d.map(([m,v])=>N.createElement(m,v)),...Array.isArray(c)?c:[c]]));const Rn=(e,t)=>{const s=N.forwardRef(({className:a,...r},c)=>N.createElement(Gz,{ref:c,iconNode:t,className:jS(`lucide-${qz(_b(e))}`,`lucide-${e}`,a),...r}));return s.displayName=_b(e),s};const Kz=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Lu=Rn("chevron-right",Kz);const Vz=[["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"}]],Qz=Rn("download",Vz);const Yz=[["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"}]],Xz=Rn("globe",Yz);const Jz=[["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"}]],Wz=Rn("layout-dashboard",Jz);const e2=[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]],t2=Rn("menu",e2);const n2=[["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"}]],s2=Rn("play",n2);const i2=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Cb=Rn("plus",i2);const a2=[["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"}]],r2=Rn("rocket",a2);const o2=[["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"}]],l2=Rn("rotate-ccw",o2);const c2=[["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"}]],u2=Rn("settings",c2);const d2=[["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"}]],f2=Rn("trash-2",d2);const h2=[["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"}]],m2=Rn("triangle-alert",h2);const p2=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Mu=Rn("x",p2);function g2(e){const t=e.match(/^(\[.*?\])\s*(.+)/);if(t){const s=t[1],a=t[2],r=a.indexOf("{");if(r>=0){const c=a.slice(0,r).trim(),d=a.slice(r);try{const f=JSON.parse(d);return`${s} ${c}
10
-
11
- ${JSON.stringify(f,null,2)}`}catch{}}return`${s}
12
- ${a}`}try{const s=JSON.parse(e);return JSON.stringify(s,null,2)}catch{return e}}function Uu(e){return e.split("-").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function Tc(e){if(!e)return"—";try{return new Date(e).toLocaleString()}catch{return e}}function kb(e){return e===null?"Unknown":e?"Pass":"Fail"}function fm(e){return e===0?"12:00 AM":e<12?`${e}:00 AM`:e===12?"12:00 PM":`${e-12}:00 PM`}function y2(e,t){return e==="twice-daily"?"twice-daily":e.startsWith("weekly@")?`${e}@${t}`:`daily@${t}`}function v2(e,t){if(!e)return{freq:"custom",hour:6,customCron:t};if(e==="twice-daily")return{freq:"twice-daily",hour:6,customCron:""};const s=e.match(/^daily(?:@(\d+))?$/);if(s)return{freq:"daily",hour:s[1]?parseInt(s[1]):6,customCron:""};const a=e.match(/^(weekly@(?:mon|tue|wed|thu|fri|sat|sun))(?:@(\d+))?$/);return a?{freq:a[1],hour:a[2]?parseInt(a[2]):6,customCron:""}:{freq:"custom",hour:6,customCron:t}}function b2(e,t,s){const a=s==="UTC"?"UTC":s.split("/").pop()?.replace(/_/g," ")??s;if(!e)return`Custom: ${t} · ${a}`;if(e==="twice-daily")return`Twice a day (6am & 6pm) · ${a}`;const r=e.match(/^daily(?:@(\d+))?$/);if(r){const d=r[1]?parseInt(r[1]):6;return`Every day at ${fm(d)} · ${a}`}const c=e.match(/^weekly@(mon|tue|wed|thu|fri|sat|sun)(?:@(\d+))?$/);if(c){const d={mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday",sun:"Sunday"},f=c[2]?parseInt(c[2]):6;return`Every ${d[c[1]]} at ${fm(f)} · ${a}`}return`${e} · ${a}`}function zb(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function tp(...e){return t=>{let s=!1;const a=e.map(r=>{const c=zb(r,t);return!s&&typeof c=="function"&&(s=!0),c});if(s)return()=>{for(let r=0;r<a.length;r++){const c=a[r];typeof c=="function"?c():zb(e[r],null)}}}}function Na(...e){return N.useCallback(tp(...e),e)}var x2=Symbol.for("react.lazy"),gu=Dm[" use ".trim().toString()];function S2(e){return typeof e=="object"&&e!==null&&"then"in e}function NS(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===x2&&"_payload"in e&&S2(e._payload)}function w2(e){const t=N2(e),s=N.forwardRef((a,r)=>{let{children:c,...d}=a;NS(c)&&typeof gu=="function"&&(c=gu(c._payload));const f=N.Children.toArray(c),p=f.find(C2);if(p){const m=p.props.children,v=f.map(y=>y===p?N.Children.count(m)>1?N.Children.only(null):N.isValidElement(m)?m.props.children:null:y);return l.jsx(t,{...d,ref:r,children:N.isValidElement(m)?N.cloneElement(m,void 0,v):null})}return l.jsx(t,{...d,ref:r,children:c})});return s.displayName=`${e}.Slot`,s}var j2=w2("Slot");function N2(e){const t=N.forwardRef((s,a)=>{let{children:r,...c}=s;if(NS(r)&&typeof gu=="function"&&(r=gu(r._payload)),N.isValidElement(r)){const d=z2(r),f=k2(c,r.props);return r.type!==N.Fragment&&(f.ref=a?tp(a,d):d),N.cloneElement(r,f)}return N.Children.count(r)>1?N.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var _2=Symbol("radix.slottable");function C2(e){return N.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===_2}function k2(e,t){const s={...t};for(const a in t){const r=e[a],c=t[a];/^on[A-Z]/.test(a)?r&&c?s[a]=(...f)=>{const p=c(...f);return r(...f),p}:r&&(s[a]=r):a==="style"?s[a]={...r,...c}:a==="className"&&(s[a]=[r,c].filter(Boolean).join(" "))}return{...e,...s}}function z2(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,s=t&&"isReactWarning"in t&&t.isReactWarning;return s?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,s=t&&"isReactWarning"in t&&t.isReactWarning,s?e.props.ref:e.props.ref||e.ref)}function _S(e){var t,s,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(s=_S(e[t]))&&(a&&(a+=" "),a+=s)}else for(s in e)e[s]&&(a&&(a+=" "),a+=s);return a}function CS(){for(var e,t,s=0,a="",r=arguments.length;s<r;s++)(e=arguments[s])&&(t=_S(e))&&(a&&(a+=" "),a+=t);return a}const Eb=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Ob=CS,kS=(e,t)=>s=>{var a;if(t?.variants==null)return Ob(e,s?.class,s?.className);const{variants:r,defaultVariants:c}=t,d=Object.keys(r).map(m=>{const v=s?.[m],y=c?.[m];if(v===null)return null;const b=Eb(v)||Eb(y);return r[m][b]}),f=s&&Object.entries(s).reduce((m,v)=>{let[y,b]=v;return b===void 0||(m[y]=b),m},{}),p=t==null||(a=t.compoundVariants)===null||a===void 0?void 0:a.reduce((m,v)=>{let{class:y,className:b,...x}=v;return Object.entries(x).every(j=>{let[w,_]=j;return Array.isArray(_)?_.includes({...c,...f}[w]):{...c,...f}[w]===_})?[...m,y,b]:m},[]);return Ob(e,d,p,s?.class,s?.className)},E2=(e,t)=>{const s=new Array(e.length+t.length);for(let a=0;a<e.length;a++)s[a]=e[a];for(let a=0;a<t.length;a++)s[e.length+a]=t[a];return s},O2=(e,t)=>({classGroupId:e,validator:t}),zS=(e=new Map,t=null,s)=>({nextPart:e,validators:t,classGroupId:s}),yu="-",Rb=[],R2="arbitrary..",A2=e=>{const t=D2(e),{conflictingClassGroups:s,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:d=>{if(d.startsWith("[")&&d.endsWith("]"))return T2(d);const f=d.split(yu),p=f[0]===""&&f.length>1?1:0;return ES(f,p,t)},getConflictingClassGroupIds:(d,f)=>{if(f){const p=a[d],m=s[d];return p?m?E2(m,p):p:m||Rb}return s[d]||Rb}}},ES=(e,t,s)=>{if(e.length-t===0)return s.classGroupId;const r=e[t],c=s.nextPart.get(r);if(c){const m=ES(e,t+1,c);if(m)return m}const d=s.validators;if(d===null)return;const f=t===0?e.join(yu):e.slice(t).join(yu),p=d.length;for(let m=0;m<p;m++){const v=d[m];if(v.validator(f))return v.classGroupId}},T2=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),s=t.indexOf(":"),a=t.slice(0,s);return a?R2+a:void 0})(),D2=e=>{const{theme:t,classGroups:s}=e;return L2(s,t)},L2=(e,t)=>{const s=zS();for(const a in e){const r=e[a];np(r,s,a,t)}return s},np=(e,t,s,a)=>{const r=e.length;for(let c=0;c<r;c++){const d=e[c];M2(d,t,s,a)}},M2=(e,t,s,a)=>{if(typeof e=="string"){U2(e,t,s);return}if(typeof e=="function"){$2(e,t,s,a);return}P2(e,t,s,a)},U2=(e,t,s)=>{const a=e===""?t:OS(t,e);a.classGroupId=s},$2=(e,t,s,a)=>{if(I2(e)){np(e(a),t,s,a);return}t.validators===null&&(t.validators=[]),t.validators.push(O2(s,e))},P2=(e,t,s,a)=>{const r=Object.entries(e),c=r.length;for(let d=0;d<c;d++){const[f,p]=r[d];np(p,OS(t,f),s,a)}},OS=(e,t)=>{let s=e;const a=t.split(yu),r=a.length;for(let c=0;c<r;c++){const d=a[c];let f=s.nextPart.get(d);f||(f=zS(),s.nextPart.set(d,f)),s=f}return s},I2=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,B2=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,s=Object.create(null),a=Object.create(null);const r=(c,d)=>{s[c]=d,t++,t>e&&(t=0,a=s,s=Object.create(null))};return{get(c){let d=s[c];if(d!==void 0)return d;if((d=a[c])!==void 0)return r(c,d),d},set(c,d){c in s?s[c]=d:r(c,d)}}},hm="!",Ab=":",q2=[],Tb=(e,t,s,a,r)=>({modifiers:e,hasImportantModifier:t,baseClassName:s,maybePostfixModifierPosition:a,isExternal:r}),H2=e=>{const{prefix:t,experimentalParseClassName:s}=e;let a=r=>{const c=[];let d=0,f=0,p=0,m;const v=r.length;for(let w=0;w<v;w++){const _=r[w];if(d===0&&f===0){if(_===Ab){c.push(r.slice(p,w)),p=w+1;continue}if(_==="/"){m=w;continue}}_==="["?d++:_==="]"?d--:_==="("?f++:_===")"&&f--}const y=c.length===0?r:r.slice(p);let b=y,x=!1;y.endsWith(hm)?(b=y.slice(0,-1),x=!0):y.startsWith(hm)&&(b=y.slice(1),x=!0);const j=m&&m>p?m-p:void 0;return Tb(c,x,b,j)};if(t){const r=t+Ab,c=a;a=d=>d.startsWith(r)?c(d.slice(r.length)):Tb(q2,!1,d,void 0,!0)}if(s){const r=a;a=c=>s({className:c,parseClassName:r})}return a},Z2=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((s,a)=>{t.set(s,1e6+a)}),s=>{const a=[];let r=[];for(let c=0;c<s.length;c++){const d=s[c],f=d[0]==="[",p=t.has(d);f||p?(r.length>0&&(r.sort(),a.push(...r),r=[]),a.push(d)):r.push(d)}return r.length>0&&(r.sort(),a.push(...r)),a}},F2=e=>({cache:B2(e.cacheSize),parseClassName:H2(e),sortModifiers:Z2(e),...A2(e)}),G2=/\s+/,K2=(e,t)=>{const{parseClassName:s,getClassGroupId:a,getConflictingClassGroupIds:r,sortModifiers:c}=t,d=[],f=e.trim().split(G2);let p="";for(let m=f.length-1;m>=0;m-=1){const v=f[m],{isExternal:y,modifiers:b,hasImportantModifier:x,baseClassName:j,maybePostfixModifierPosition:w}=s(v);if(y){p=v+(p.length>0?" "+p:p);continue}let _=!!w,C=a(_?j.substring(0,w):j);if(!C){if(!_){p=v+(p.length>0?" "+p:p);continue}if(C=a(j),!C){p=v+(p.length>0?" "+p:p);continue}_=!1}const E=b.length===0?"":b.length===1?b[0]:c(b).join(":"),O=x?E+hm:E,z=O+C;if(d.indexOf(z)>-1)continue;d.push(z);const M=r(C,_);for(let T=0;T<M.length;++T){const L=M[T];d.push(O+L)}p=v+(p.length>0?" "+p:p)}return p},V2=(...e)=>{let t=0,s,a,r="";for(;t<e.length;)(s=e[t++])&&(a=RS(s))&&(r&&(r+=" "),r+=a);return r},RS=e=>{if(typeof e=="string")return e;let t,s="";for(let a=0;a<e.length;a++)e[a]&&(t=RS(e[a]))&&(s&&(s+=" "),s+=t);return s},Q2=(e,...t)=>{let s,a,r,c;const d=p=>{const m=t.reduce((v,y)=>y(v),e());return s=F2(m),a=s.cache.get,r=s.cache.set,c=f,f(p)},f=p=>{const m=a(p);if(m)return m;const v=K2(p,s);return r(p,v),v};return c=d,(...p)=>c(V2(...p))},Y2=[],Zt=e=>{const t=s=>s[e]||Y2;return t.isThemeGetter=!0,t},AS=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,TS=/^\((?:(\w[\w-]*):)?(.+)\)$/i,X2=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,J2=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,W2=/\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$/,eE=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,tE=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,nE=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Si=e=>X2.test(e),De=e=>!!e&&!Number.isNaN(Number(e)),wi=e=>!!e&&Number.isInteger(Number(e)),Dh=e=>e.endsWith("%")&&De(e.slice(0,-1)),Is=e=>J2.test(e),DS=()=>!0,sE=e=>W2.test(e)&&!eE.test(e),sp=()=>!1,iE=e=>tE.test(e),aE=e=>nE.test(e),rE=e=>!ve(e)&&!be(e),oE=e=>Pi(e,US,sp),ve=e=>AS.test(e),la=e=>Pi(e,$S,sE),Db=e=>Pi(e,pE,De),lE=e=>Pi(e,IS,DS),cE=e=>Pi(e,PS,sp),Lb=e=>Pi(e,LS,sp),uE=e=>Pi(e,MS,aE),Dc=e=>Pi(e,BS,iE),be=e=>TS.test(e),Mo=e=>_a(e,$S),dE=e=>_a(e,PS),Mb=e=>_a(e,LS),fE=e=>_a(e,US),hE=e=>_a(e,MS),Lc=e=>_a(e,BS,!0),mE=e=>_a(e,IS,!0),Pi=(e,t,s)=>{const a=AS.exec(e);return a?a[1]?t(a[1]):s(a[2]):!1},_a=(e,t,s=!1)=>{const a=TS.exec(e);return a?a[1]?t(a[1]):s:!1},LS=e=>e==="position"||e==="percentage",MS=e=>e==="image"||e==="url",US=e=>e==="length"||e==="size"||e==="bg-size",$S=e=>e==="length",pE=e=>e==="number",PS=e=>e==="family-name",IS=e=>e==="number"||e==="weight",BS=e=>e==="shadow",gE=()=>{const e=Zt("color"),t=Zt("font"),s=Zt("text"),a=Zt("font-weight"),r=Zt("tracking"),c=Zt("leading"),d=Zt("breakpoint"),f=Zt("container"),p=Zt("spacing"),m=Zt("radius"),v=Zt("shadow"),y=Zt("inset-shadow"),b=Zt("text-shadow"),x=Zt("drop-shadow"),j=Zt("blur"),w=Zt("perspective"),_=Zt("aspect"),C=Zt("ease"),E=Zt("animate"),O=()=>["auto","avoid","all","avoid-page","page","left","right","column"],z=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],M=()=>[...z(),be,ve],T=()=>["auto","hidden","clip","visible","scroll"],L=()=>["auto","contain","none"],R=()=>[be,ve,p],I=()=>[Si,"full","auto",...R()],ie=()=>[wi,"none","subgrid",be,ve],Q=()=>["auto",{span:["full",wi,be,ve]},wi,be,ve],se=()=>[wi,"auto",be,ve],me=()=>["auto","min","max","fr",be,ve],Ee=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],we=()=>["start","end","center","stretch","center-safe","end-safe"],H=()=>["auto",...R()],Z=()=>[Si,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...R()],oe=()=>[Si,"screen","full","dvw","lvw","svw","min","max","fit",...R()],pe=()=>[Si,"screen","full","lh","dvh","lvh","svh","min","max","fit",...R()],ee=()=>[e,be,ve],D=()=>[...z(),Mb,Lb,{position:[be,ve]}],G=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ne=()=>["auto","cover","contain",fE,oE,{size:[be,ve]}],ae=()=>[Dh,Mo,la],le=()=>["","none","full",m,be,ve],he=()=>["",De,Mo,la],de=()=>["solid","dashed","dotted","double"],Ze=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ge=()=>[De,Dh,Mb,Lb],Ye=()=>["","none",j,be,ve],ft=()=>["none",De,be,ve],fe=()=>["none",De,be,ve],Qe=()=>[De,be,ve],lt=()=>[Si,"full",...R()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Is],breakpoint:[Is],color:[DS],container:[Is],"drop-shadow":[Is],ease:["in","out","in-out"],font:[rE],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Is],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Is],shadow:[Is],spacing:["px",De],text:[Is],"text-shadow":[Is],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Si,ve,be,_]}],container:["container"],columns:[{columns:[De,ve,be,f]}],"break-after":[{"break-after":O()}],"break-before":[{"break-before":O()}],"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:M()}],overflow:[{overflow:T()}],"overflow-x":[{"overflow-x":T()}],"overflow-y":[{"overflow-y":T()}],overscroll:[{overscroll:L()}],"overscroll-x":[{"overscroll-x":L()}],"overscroll-y":[{"overscroll-y":L()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:I()}],"inset-x":[{"inset-x":I()}],"inset-y":[{"inset-y":I()}],start:[{"inset-s":I(),start:I()}],end:[{"inset-e":I(),end:I()}],"inset-bs":[{"inset-bs":I()}],"inset-be":[{"inset-be":I()}],top:[{top:I()}],right:[{right:I()}],bottom:[{bottom:I()}],left:[{left:I()}],visibility:["visible","invisible","collapse"],z:[{z:[wi,"auto",be,ve]}],basis:[{basis:[Si,"full","auto",f,...R()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[De,Si,"auto","initial","none",ve]}],grow:[{grow:["",De,be,ve]}],shrink:[{shrink:["",De,be,ve]}],order:[{order:[wi,"first","last","none",be,ve]}],"grid-cols":[{"grid-cols":ie()}],"col-start-end":[{col:Q()}],"col-start":[{"col-start":se()}],"col-end":[{"col-end":se()}],"grid-rows":[{"grid-rows":ie()}],"row-start-end":[{row:Q()}],"row-start":[{"row-start":se()}],"row-end":[{"row-end":se()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":me()}],"auto-rows":[{"auto-rows":me()}],gap:[{gap:R()}],"gap-x":[{"gap-x":R()}],"gap-y":[{"gap-y":R()}],"justify-content":[{justify:[...Ee(),"normal"]}],"justify-items":[{"justify-items":[...we(),"normal"]}],"justify-self":[{"justify-self":["auto",...we()]}],"align-content":[{content:["normal",...Ee()]}],"align-items":[{items:[...we(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...we(),{baseline:["","last"]}]}],"place-content":[{"place-content":Ee()}],"place-items":[{"place-items":[...we(),"baseline"]}],"place-self":[{"place-self":["auto",...we()]}],p:[{p:R()}],px:[{px:R()}],py:[{py:R()}],ps:[{ps:R()}],pe:[{pe:R()}],pbs:[{pbs:R()}],pbe:[{pbe:R()}],pt:[{pt:R()}],pr:[{pr:R()}],pb:[{pb:R()}],pl:[{pl:R()}],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":R()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":R()}],"space-y-reverse":["space-y-reverse"],size:[{size:Z()}],"inline-size":[{inline:["auto",...oe()]}],"min-inline-size":[{"min-inline":["auto",...oe()]}],"max-inline-size":[{"max-inline":["none",...oe()]}],"block-size":[{block:["auto",...pe()]}],"min-block-size":[{"min-block":["auto",...pe()]}],"max-block-size":[{"max-block":["none",...pe()]}],w:[{w:[f,"screen",...Z()]}],"min-w":[{"min-w":[f,"screen","none",...Z()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[d]},...Z()]}],h:[{h:["screen","lh",...Z()]}],"min-h":[{"min-h":["screen","lh","none",...Z()]}],"max-h":[{"max-h":["screen","lh",...Z()]}],"font-size":[{text:["base",s,Mo,la]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,mE,lE]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Dh,ve]}],"font-family":[{font:[dE,cE,t]}],"font-features":[{"font-features":[ve]}],"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:[r,be,ve]}],"line-clamp":[{"line-clamp":[De,"none",be,Db]}],leading:[{leading:[c,...R()]}],"list-image":[{"list-image":["none",be,ve]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",be,ve]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:ee()}],"text-color":[{text:ee()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...de(),"wavy"]}],"text-decoration-thickness":[{decoration:[De,"from-font","auto",be,la]}],"text-decoration-color":[{decoration:ee()}],"underline-offset":[{"underline-offset":[De,"auto",be,ve]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:R()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",be,ve]}],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",be,ve]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:D()}],"bg-repeat":[{bg:G()}],"bg-size":[{bg:ne()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},wi,be,ve],radial:["",be,ve],conic:[wi,be,ve]},hE,uE]}],"bg-color":[{bg:ee()}],"gradient-from-pos":[{from:ae()}],"gradient-via-pos":[{via:ae()}],"gradient-to-pos":[{to:ae()}],"gradient-from":[{from:ee()}],"gradient-via":[{via:ee()}],"gradient-to":[{to:ee()}],rounded:[{rounded:le()}],"rounded-s":[{"rounded-s":le()}],"rounded-e":[{"rounded-e":le()}],"rounded-t":[{"rounded-t":le()}],"rounded-r":[{"rounded-r":le()}],"rounded-b":[{"rounded-b":le()}],"rounded-l":[{"rounded-l":le()}],"rounded-ss":[{"rounded-ss":le()}],"rounded-se":[{"rounded-se":le()}],"rounded-ee":[{"rounded-ee":le()}],"rounded-es":[{"rounded-es":le()}],"rounded-tl":[{"rounded-tl":le()}],"rounded-tr":[{"rounded-tr":le()}],"rounded-br":[{"rounded-br":le()}],"rounded-bl":[{"rounded-bl":le()}],"border-w":[{border:he()}],"border-w-x":[{"border-x":he()}],"border-w-y":[{"border-y":he()}],"border-w-s":[{"border-s":he()}],"border-w-e":[{"border-e":he()}],"border-w-bs":[{"border-bs":he()}],"border-w-be":[{"border-be":he()}],"border-w-t":[{"border-t":he()}],"border-w-r":[{"border-r":he()}],"border-w-b":[{"border-b":he()}],"border-w-l":[{"border-l":he()}],"divide-x":[{"divide-x":he()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":he()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...de(),"hidden","none"]}],"divide-style":[{divide:[...de(),"hidden","none"]}],"border-color":[{border:ee()}],"border-color-x":[{"border-x":ee()}],"border-color-y":[{"border-y":ee()}],"border-color-s":[{"border-s":ee()}],"border-color-e":[{"border-e":ee()}],"border-color-bs":[{"border-bs":ee()}],"border-color-be":[{"border-be":ee()}],"border-color-t":[{"border-t":ee()}],"border-color-r":[{"border-r":ee()}],"border-color-b":[{"border-b":ee()}],"border-color-l":[{"border-l":ee()}],"divide-color":[{divide:ee()}],"outline-style":[{outline:[...de(),"none","hidden"]}],"outline-offset":[{"outline-offset":[De,be,ve]}],"outline-w":[{outline:["",De,Mo,la]}],"outline-color":[{outline:ee()}],shadow:[{shadow:["","none",v,Lc,Dc]}],"shadow-color":[{shadow:ee()}],"inset-shadow":[{"inset-shadow":["none",y,Lc,Dc]}],"inset-shadow-color":[{"inset-shadow":ee()}],"ring-w":[{ring:he()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:ee()}],"ring-offset-w":[{"ring-offset":[De,la]}],"ring-offset-color":[{"ring-offset":ee()}],"inset-ring-w":[{"inset-ring":he()}],"inset-ring-color":[{"inset-ring":ee()}],"text-shadow":[{"text-shadow":["none",b,Lc,Dc]}],"text-shadow-color":[{"text-shadow":ee()}],opacity:[{opacity:[De,be,ve]}],"mix-blend":[{"mix-blend":[...Ze(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Ze()}],"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":[De]}],"mask-image-linear-from-pos":[{"mask-linear-from":ge()}],"mask-image-linear-to-pos":[{"mask-linear-to":ge()}],"mask-image-linear-from-color":[{"mask-linear-from":ee()}],"mask-image-linear-to-color":[{"mask-linear-to":ee()}],"mask-image-t-from-pos":[{"mask-t-from":ge()}],"mask-image-t-to-pos":[{"mask-t-to":ge()}],"mask-image-t-from-color":[{"mask-t-from":ee()}],"mask-image-t-to-color":[{"mask-t-to":ee()}],"mask-image-r-from-pos":[{"mask-r-from":ge()}],"mask-image-r-to-pos":[{"mask-r-to":ge()}],"mask-image-r-from-color":[{"mask-r-from":ee()}],"mask-image-r-to-color":[{"mask-r-to":ee()}],"mask-image-b-from-pos":[{"mask-b-from":ge()}],"mask-image-b-to-pos":[{"mask-b-to":ge()}],"mask-image-b-from-color":[{"mask-b-from":ee()}],"mask-image-b-to-color":[{"mask-b-to":ee()}],"mask-image-l-from-pos":[{"mask-l-from":ge()}],"mask-image-l-to-pos":[{"mask-l-to":ge()}],"mask-image-l-from-color":[{"mask-l-from":ee()}],"mask-image-l-to-color":[{"mask-l-to":ee()}],"mask-image-x-from-pos":[{"mask-x-from":ge()}],"mask-image-x-to-pos":[{"mask-x-to":ge()}],"mask-image-x-from-color":[{"mask-x-from":ee()}],"mask-image-x-to-color":[{"mask-x-to":ee()}],"mask-image-y-from-pos":[{"mask-y-from":ge()}],"mask-image-y-to-pos":[{"mask-y-to":ge()}],"mask-image-y-from-color":[{"mask-y-from":ee()}],"mask-image-y-to-color":[{"mask-y-to":ee()}],"mask-image-radial":[{"mask-radial":[be,ve]}],"mask-image-radial-from-pos":[{"mask-radial-from":ge()}],"mask-image-radial-to-pos":[{"mask-radial-to":ge()}],"mask-image-radial-from-color":[{"mask-radial-from":ee()}],"mask-image-radial-to-color":[{"mask-radial-to":ee()}],"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":z()}],"mask-image-conic-pos":[{"mask-conic":[De]}],"mask-image-conic-from-pos":[{"mask-conic-from":ge()}],"mask-image-conic-to-pos":[{"mask-conic-to":ge()}],"mask-image-conic-from-color":[{"mask-conic-from":ee()}],"mask-image-conic-to-color":[{"mask-conic-to":ee()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:D()}],"mask-repeat":[{mask:G()}],"mask-size":[{mask:ne()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",be,ve]}],filter:[{filter:["","none",be,ve]}],blur:[{blur:Ye()}],brightness:[{brightness:[De,be,ve]}],contrast:[{contrast:[De,be,ve]}],"drop-shadow":[{"drop-shadow":["","none",x,Lc,Dc]}],"drop-shadow-color":[{"drop-shadow":ee()}],grayscale:[{grayscale:["",De,be,ve]}],"hue-rotate":[{"hue-rotate":[De,be,ve]}],invert:[{invert:["",De,be,ve]}],saturate:[{saturate:[De,be,ve]}],sepia:[{sepia:["",De,be,ve]}],"backdrop-filter":[{"backdrop-filter":["","none",be,ve]}],"backdrop-blur":[{"backdrop-blur":Ye()}],"backdrop-brightness":[{"backdrop-brightness":[De,be,ve]}],"backdrop-contrast":[{"backdrop-contrast":[De,be,ve]}],"backdrop-grayscale":[{"backdrop-grayscale":["",De,be,ve]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[De,be,ve]}],"backdrop-invert":[{"backdrop-invert":["",De,be,ve]}],"backdrop-opacity":[{"backdrop-opacity":[De,be,ve]}],"backdrop-saturate":[{"backdrop-saturate":[De,be,ve]}],"backdrop-sepia":[{"backdrop-sepia":["",De,be,ve]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":R()}],"border-spacing-x":[{"border-spacing-x":R()}],"border-spacing-y":[{"border-spacing-y":R()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",be,ve]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[De,"initial",be,ve]}],ease:[{ease:["linear","initial",C,be,ve]}],delay:[{delay:[De,be,ve]}],animate:[{animate:["none",E,be,ve]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,be,ve]}],"perspective-origin":[{"perspective-origin":M()}],rotate:[{rotate:ft()}],"rotate-x":[{"rotate-x":ft()}],"rotate-y":[{"rotate-y":ft()}],"rotate-z":[{"rotate-z":ft()}],scale:[{scale:fe()}],"scale-x":[{"scale-x":fe()}],"scale-y":[{"scale-y":fe()}],"scale-z":[{"scale-z":fe()}],"scale-3d":["scale-3d"],skew:[{skew:Qe()}],"skew-x":[{"skew-x":Qe()}],"skew-y":[{"skew-y":Qe()}],transform:[{transform:[be,ve,"","none","gpu","cpu"]}],"transform-origin":[{origin:M()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:lt()}],"translate-x":[{"translate-x":lt()}],"translate-y":[{"translate-y":lt()}],"translate-z":[{"translate-z":lt()}],"translate-none":["translate-none"],accent:[{accent:ee()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:ee()}],"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",be,ve]}],"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":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mbs":[{"scroll-mbs":R()}],"scroll-mbe":[{"scroll-mbe":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pbs":[{"scroll-pbs":R()}],"scroll-pbe":[{"scroll-pbe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"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",be,ve]}],fill:[{fill:["none",...ee()]}],"stroke-w":[{stroke:[De,Mo,la,Db]}],stroke:[{stroke:["none",...ee()]}],"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"]}},yE=Q2(gE);function Kn(...e){return yE(CS(e))}const vE=kS("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"}}),ue=N.forwardRef(({className:e,variant:t,size:s,asChild:a=!1,...r},c)=>{const d=a?j2:"button";return l.jsx(d,{ref:c,className:Kn(vE({variant:t,size:s,className:e})),...r})});ue.displayName="Button";const bE=kS("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 qS({className:e,variant:t,...s}){return l.jsx("div",{className:Kn(bE({variant:t}),e),...s})}function Ub({compact:e=!1}){return l.jsxs(mt,{to:"/",className:`brand-lockup ${e?"brand-lockup-compact":""}`,"aria-label":"Canonry home",children:[l.jsx("img",{className:"brand-icon",src:"./favicon.svg",alt:"","aria-hidden":"true"}),l.jsxs("span",{className:"brand-copy",children:[l.jsx("span",{className:"brand-mark",children:"Canonry"}),e?null:l.jsx("span",{className:"brand-subtitle",children:"AEO Monitor"})]})]})}function Xo({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",local:"border-purple-800/50 bg-purple-950/40 text-purple-300"};return l.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 vu(e){return e.state==="ok"?"positive":e.state==="checking"?"neutral":"negative"}function HS(e){switch(e){case"completed":return"positive";case"partial":return"caution";case"failed":return"negative";case"queued":case"running":return"neutral";default:return"neutral"}}function xE(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 SE(e){return e==="High"?"negative":e==="Moderate"?"caution":"neutral"}function yt({tone:e,children:t}){const s=e==="positive"?"success":e==="caution"?"warning":e==="negative"?"destructive":"neutral";return l.jsx(qS,{variant:s,children:t})}function $u({status:e}){return l.jsx(yt,{tone:HS(e),children:Uu(e)})}function Ti(e,t,{checkForDefaultPrevented:s=!0}={}){return function(r){if(e?.(r),s===!1||!r.defaultPrevented)return t?.(r)}}function wE(e,t){const s=N.createContext(t),a=c=>{const{children:d,...f}=c,p=N.useMemo(()=>f,Object.values(f));return l.jsx(s.Provider,{value:p,children:d})};a.displayName=e+"Provider";function r(c){const d=N.useContext(s);if(d)return d;if(t!==void 0)return t;throw new Error(`\`${c}\` must be used within \`${e}\``)}return[a,r]}function jE(e,t=[]){let s=[];function a(c,d){const f=N.createContext(d),p=s.length;s=[...s,d];const m=y=>{const{scope:b,children:x,...j}=y,w=b?.[e]?.[p]||f,_=N.useMemo(()=>j,Object.values(j));return l.jsx(w.Provider,{value:_,children:x})};m.displayName=c+"Provider";function v(y,b){const x=b?.[e]?.[p]||f,j=N.useContext(x);if(j)return j;if(d!==void 0)return d;throw new Error(`\`${y}\` must be used within \`${c}\``)}return[m,v]}const r=()=>{const c=s.map(d=>N.createContext(d));return function(f){const p=f?.[e]||c;return N.useMemo(()=>({[`__scope${e}`]:{...f,[e]:p}}),[f,p])}};return r.scopeName=e,[a,NE(r,...t)]}function NE(...e){const t=e[0];if(e.length===1)return t;const s=()=>{const a=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(c){const d=a.reduce((f,{useScope:p,scopeName:m})=>{const y=p(c)[`__scope${m}`];return{...f,...y}},{});return N.useMemo(()=>({[`__scope${t.scopeName}`]:d}),[d])}};return s.scopeName=t.scopeName,s}var Jo=globalThis?.document?N.useLayoutEffect:()=>{},_E=Dm[" useId ".trim().toString()]||(()=>{}),CE=0;function Lh(e){const[t,s]=N.useState(_E());return Jo(()=>{s(a=>a??String(CE++))},[e]),e||(t?`radix-${t}`:"")}var kE=Dm[" useInsertionEffect ".trim().toString()]||Jo;function zE({prop:e,defaultProp:t,onChange:s=()=>{},caller:a}){const[r,c,d]=EE({defaultProp:t,onChange:s}),f=e!==void 0,p=f?e:r;{const v=N.useRef(e!==void 0);N.useEffect(()=>{const y=v.current;y!==f&&console.warn(`${a} is changing from ${y?"controlled":"uncontrolled"} to ${f?"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.`),v.current=f},[f,a])}const m=N.useCallback(v=>{if(f){const y=OE(v)?v(e):v;y!==e&&d.current?.(y)}else c(v)},[f,e,c,d]);return[p,m]}function EE({defaultProp:e,onChange:t}){const[s,a]=N.useState(e),r=N.useRef(s),c=N.useRef(t);return kE(()=>{c.current=t},[t]),N.useEffect(()=>{r.current!==s&&(c.current?.(s),r.current=s)},[s,r]),[s,a,c]}function OE(e){return typeof e=="function"}function ZS(e){const t=RE(e),s=N.forwardRef((a,r)=>{const{children:c,...d}=a,f=N.Children.toArray(c),p=f.find(TE);if(p){const m=p.props.children,v=f.map(y=>y===p?N.Children.count(m)>1?N.Children.only(null):N.isValidElement(m)?m.props.children:null:y);return l.jsx(t,{...d,ref:r,children:N.isValidElement(m)?N.cloneElement(m,void 0,v):null})}return l.jsx(t,{...d,ref:r,children:c})});return s.displayName=`${e}.Slot`,s}function RE(e){const t=N.forwardRef((s,a)=>{const{children:r,...c}=s;if(N.isValidElement(r)){const d=LE(r),f=DE(c,r.props);return r.type!==N.Fragment&&(f.ref=a?tp(a,d):d),N.cloneElement(r,f)}return N.Children.count(r)>1?N.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var AE=Symbol("radix.slottable");function TE(e){return N.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===AE}function DE(e,t){const s={...t};for(const a in t){const r=e[a],c=t[a];/^on[A-Z]/.test(a)?r&&c?s[a]=(...f)=>{const p=c(...f);return r(...f),p}:r&&(s[a]=r):a==="style"?s[a]={...r,...c}:a==="className"&&(s[a]=[r,c].filter(Boolean).join(" "))}return{...e,...s}}function LE(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,s=t&&"isReactWarning"in t&&t.isReactWarning;return s?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,s=t&&"isReactWarning"in t&&t.isReactWarning,s?e.props.ref:e.props.ref||e.ref)}var ME=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Zs=ME.reduce((e,t)=>{const s=ZS(`Primitive.${t}`),a=N.forwardRef((r,c)=>{const{asChild:d,...f}=r,p=d?s:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(p,{...f,ref:c})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{});function UE(e,t){e&&Wm.flushSync(()=>e.dispatchEvent(t))}function Wo(e){const t=N.useRef(e);return N.useEffect(()=>{t.current=e}),N.useMemo(()=>(...s)=>t.current?.(...s),[])}function $E(e,t=globalThis?.document){const s=Wo(e);N.useEffect(()=>{const a=r=>{r.key==="Escape"&&s(r)};return t.addEventListener("keydown",a,{capture:!0}),()=>t.removeEventListener("keydown",a,{capture:!0})},[s,t])}var PE="DismissableLayer",mm="dismissableLayer.update",IE="dismissableLayer.pointerDownOutside",BE="dismissableLayer.focusOutside",$b,FS=N.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),GS=N.forwardRef((e,t)=>{const{disableOutsidePointerEvents:s=!1,onEscapeKeyDown:a,onPointerDownOutside:r,onFocusOutside:c,onInteractOutside:d,onDismiss:f,...p}=e,m=N.useContext(FS),[v,y]=N.useState(null),b=v?.ownerDocument??globalThis?.document,[,x]=N.useState({}),j=Na(t,L=>y(L)),w=Array.from(m.layers),[_]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),C=w.indexOf(_),E=v?w.indexOf(v):-1,O=m.layersWithOutsidePointerEventsDisabled.size>0,z=E>=C,M=ZE(L=>{const R=L.target,I=[...m.branches].some(ie=>ie.contains(R));!z||I||(r?.(L),d?.(L),L.defaultPrevented||f?.())},b),T=FE(L=>{const R=L.target;[...m.branches].some(ie=>ie.contains(R))||(c?.(L),d?.(L),L.defaultPrevented||f?.())},b);return $E(L=>{E===m.layers.size-1&&(a?.(L),!L.defaultPrevented&&f&&(L.preventDefault(),f()))},b),N.useEffect(()=>{if(v)return s&&(m.layersWithOutsidePointerEventsDisabled.size===0&&($b=b.body.style.pointerEvents,b.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(v)),m.layers.add(v),Pb(),()=>{s&&m.layersWithOutsidePointerEventsDisabled.size===1&&(b.body.style.pointerEvents=$b)}},[v,b,s,m]),N.useEffect(()=>()=>{v&&(m.layers.delete(v),m.layersWithOutsidePointerEventsDisabled.delete(v),Pb())},[v,m]),N.useEffect(()=>{const L=()=>x({});return document.addEventListener(mm,L),()=>document.removeEventListener(mm,L)},[]),l.jsx(Zs.div,{...p,ref:j,style:{pointerEvents:O?z?"auto":"none":void 0,...e.style},onFocusCapture:Ti(e.onFocusCapture,T.onFocusCapture),onBlurCapture:Ti(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:Ti(e.onPointerDownCapture,M.onPointerDownCapture)})});GS.displayName=PE;var qE="DismissableLayerBranch",HE=N.forwardRef((e,t)=>{const s=N.useContext(FS),a=N.useRef(null),r=Na(t,a);return N.useEffect(()=>{const c=a.current;if(c)return s.branches.add(c),()=>{s.branches.delete(c)}},[s.branches]),l.jsx(Zs.div,{...e,ref:r})});HE.displayName=qE;function ZE(e,t=globalThis?.document){const s=Wo(e),a=N.useRef(!1),r=N.useRef(()=>{});return N.useEffect(()=>{const c=f=>{if(f.target&&!a.current){let p=function(){KS(IE,s,m,{discrete:!0})};const m={originalEvent:f};f.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=p,t.addEventListener("click",r.current,{once:!0})):p()}else t.removeEventListener("click",r.current);a.current=!1},d=window.setTimeout(()=>{t.addEventListener("pointerdown",c)},0);return()=>{window.clearTimeout(d),t.removeEventListener("pointerdown",c),t.removeEventListener("click",r.current)}},[t,s]),{onPointerDownCapture:()=>a.current=!0}}function FE(e,t=globalThis?.document){const s=Wo(e),a=N.useRef(!1);return N.useEffect(()=>{const r=c=>{c.target&&!a.current&&KS(BE,s,{originalEvent:c},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,s]),{onFocusCapture:()=>a.current=!0,onBlurCapture:()=>a.current=!1}}function Pb(){const e=new CustomEvent(mm);document.dispatchEvent(e)}function KS(e,t,s,{discrete:a}){const r=s.originalEvent.target,c=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:s});t&&r.addEventListener(e,t,{once:!0}),a?UE(r,c):r.dispatchEvent(c)}var Mh="focusScope.autoFocusOnMount",Uh="focusScope.autoFocusOnUnmount",Ib={bubbles:!1,cancelable:!0},GE="FocusScope",VS=N.forwardRef((e,t)=>{const{loop:s=!1,trapped:a=!1,onMountAutoFocus:r,onUnmountAutoFocus:c,...d}=e,[f,p]=N.useState(null),m=Wo(r),v=Wo(c),y=N.useRef(null),b=Na(t,w=>p(w)),x=N.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;N.useEffect(()=>{if(a){let w=function(O){if(x.paused||!f)return;const z=O.target;f.contains(z)?y.current=z:ji(y.current,{select:!0})},_=function(O){if(x.paused||!f)return;const z=O.relatedTarget;z!==null&&(f.contains(z)||ji(y.current,{select:!0}))},C=function(O){if(document.activeElement===document.body)for(const M of O)M.removedNodes.length>0&&ji(f)};document.addEventListener("focusin",w),document.addEventListener("focusout",_);const E=new MutationObserver(C);return f&&E.observe(f,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",_),E.disconnect()}}},[a,f,x.paused]),N.useEffect(()=>{if(f){qb.add(x);const w=document.activeElement;if(!f.contains(w)){const C=new CustomEvent(Mh,Ib);f.addEventListener(Mh,m),f.dispatchEvent(C),C.defaultPrevented||(KE(JE(QS(f)),{select:!0}),document.activeElement===w&&ji(f))}return()=>{f.removeEventListener(Mh,m),setTimeout(()=>{const C=new CustomEvent(Uh,Ib);f.addEventListener(Uh,v),f.dispatchEvent(C),C.defaultPrevented||ji(w??document.body,{select:!0}),f.removeEventListener(Uh,v),qb.remove(x)},0)}}},[f,m,v,x]);const j=N.useCallback(w=>{if(!s&&!a||x.paused)return;const _=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,C=document.activeElement;if(_&&C){const E=w.currentTarget,[O,z]=VE(E);O&&z?!w.shiftKey&&C===z?(w.preventDefault(),s&&ji(O,{select:!0})):w.shiftKey&&C===O&&(w.preventDefault(),s&&ji(z,{select:!0})):C===E&&w.preventDefault()}},[s,a,x.paused]);return l.jsx(Zs.div,{tabIndex:-1,...d,ref:b,onKeyDown:j})});VS.displayName=GE;function KE(e,{select:t=!1}={}){const s=document.activeElement;for(const a of e)if(ji(a,{select:t}),document.activeElement!==s)return}function VE(e){const t=QS(e),s=Bb(t,e),a=Bb(t.reverse(),e);return[s,a]}function QS(e){const t=[],s=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:a=>{const r=a.tagName==="INPUT"&&a.type==="hidden";return a.disabled||a.hidden||r?NodeFilter.FILTER_SKIP:a.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;s.nextNode();)t.push(s.currentNode);return t}function Bb(e,t){for(const s of e)if(!QE(s,{upTo:t}))return s}function QE(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 YE(e){return e instanceof HTMLInputElement&&"select"in e}function ji(e,{select:t=!1}={}){if(e&&e.focus){const s=document.activeElement;e.focus({preventScroll:!0}),e!==s&&YE(e)&&t&&e.select()}}var qb=XE();function XE(){let e=[];return{add(t){const s=e[0];t!==s&&s?.pause(),e=Hb(e,t),e.unshift(t)},remove(t){e=Hb(e,t),e[0]?.resume()}}}function Hb(e,t){const s=[...e],a=s.indexOf(t);return a!==-1&&s.splice(a,1),s}function JE(e){return e.filter(t=>t.tagName!=="A")}var WE="Portal",YS=N.forwardRef((e,t)=>{const{container:s,...a}=e,[r,c]=N.useState(!1);Jo(()=>c(!0),[]);const d=s||r&&globalThis?.document?.body;return d?fz.createPortal(l.jsx(Zs.div,{...a,ref:t}),d):null});YS.displayName=WE;function eO(e,t){return N.useReducer((s,a)=>t[s][a]??s,e)}var Pu=e=>{const{present:t,children:s}=e,a=tO(t),r=typeof s=="function"?s({present:a.isPresent}):N.Children.only(s),c=Na(a.ref,nO(r));return typeof s=="function"||a.isPresent?N.cloneElement(r,{ref:c}):null};Pu.displayName="Presence";function tO(e){const[t,s]=N.useState(),a=N.useRef(null),r=N.useRef(e),c=N.useRef("none"),d=e?"mounted":"unmounted",[f,p]=eO(d,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return N.useEffect(()=>{const m=Mc(a.current);c.current=f==="mounted"?m:"none"},[f]),Jo(()=>{const m=a.current,v=r.current;if(v!==e){const b=c.current,x=Mc(m);e?p("MOUNT"):x==="none"||m?.display==="none"?p("UNMOUNT"):p(v&&b!==x?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,p]),Jo(()=>{if(t){let m;const v=t.ownerDocument.defaultView??window,y=x=>{const w=Mc(a.current).includes(CSS.escape(x.animationName));if(x.target===t&&w&&(p("ANIMATION_END"),!r.current)){const _=t.style.animationFillMode;t.style.animationFillMode="forwards",m=v.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=_)})}},b=x=>{x.target===t&&(c.current=Mc(a.current))};return t.addEventListener("animationstart",b),t.addEventListener("animationcancel",y),t.addEventListener("animationend",y),()=>{v.clearTimeout(m),t.removeEventListener("animationstart",b),t.removeEventListener("animationcancel",y),t.removeEventListener("animationend",y)}}else p("ANIMATION_END")},[t,p]),{isPresent:["mounted","unmountSuspended"].includes(f),ref:N.useCallback(m=>{a.current=m?getComputedStyle(m):null,s(m)},[])}}function Mc(e){return e?.animationName||"none"}function nO(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,s=t&&"isReactWarning"in t&&t.isReactWarning;return s?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,s=t&&"isReactWarning"in t&&t.isReactWarning,s?e.props.ref:e.props.ref||e.ref)}var $h=0;function sO(){N.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Zb()),document.body.insertAdjacentElement("beforeend",e[1]??Zb()),$h++,()=>{$h===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),$h--}},[])}function Zb(){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 ys=function(){return ys=Object.assign||function(t){for(var s,a=1,r=arguments.length;a<r;a++){s=arguments[a];for(var c in s)Object.prototype.hasOwnProperty.call(s,c)&&(t[c]=s[c])}return t},ys.apply(this,arguments)};function XS(e,t){var s={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(s[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,a=Object.getOwnPropertySymbols(e);r<a.length;r++)t.indexOf(a[r])<0&&Object.prototype.propertyIsEnumerable.call(e,a[r])&&(s[a[r]]=e[a[r]]);return s}function iO(e,t,s){if(s||arguments.length===2)for(var a=0,r=t.length,c;a<r;a++)(c||!(a in t))&&(c||(c=Array.prototype.slice.call(t,0,a)),c[a]=t[a]);return e.concat(c||Array.prototype.slice.call(t))}var eu="right-scroll-bar-position",tu="width-before-scroll-bar",aO="with-scroll-bars-hidden",rO="--removed-body-scroll-bar-size";function Ph(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function oO(e,t){var s=N.useState(function(){return{value:e,callback:t,facade:{get current(){return s.value},set current(a){var r=s.value;r!==a&&(s.value=a,s.callback(a,r))}}}})[0];return s.callback=t,s.facade}var lO=typeof window<"u"?N.useLayoutEffect:N.useEffect,Fb=new WeakMap;function cO(e,t){var s=oO(null,function(a){return e.forEach(function(r){return Ph(r,a)})});return lO(function(){var a=Fb.get(s);if(a){var r=new Set(a),c=new Set(e),d=s.current;r.forEach(function(f){c.has(f)||Ph(f,null)}),c.forEach(function(f){r.has(f)||Ph(f,d)})}Fb.set(s,e)},[e]),s}function uO(e){return e}function dO(e,t){t===void 0&&(t=uO);var s=[],a=!1,r={read:function(){if(a)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return s.length?s[s.length-1]:e},useMedium:function(c){var d=t(c,a);return s.push(d),function(){s=s.filter(function(f){return f!==d})}},assignSyncMedium:function(c){for(a=!0;s.length;){var d=s;s=[],d.forEach(c)}s={push:function(f){return c(f)},filter:function(){return s}}},assignMedium:function(c){a=!0;var d=[];if(s.length){var f=s;s=[],f.forEach(c),d=s}var p=function(){var v=d;d=[],v.forEach(c)},m=function(){return Promise.resolve().then(p)};m(),s={push:function(v){d.push(v),m()},filter:function(v){return d=d.filter(v),s}}}};return r}function fO(e){e===void 0&&(e={});var t=dO(null);return t.options=ys({async:!0,ssr:!1},e),t}var JS=function(e){var t=e.sideCar,s=XS(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var a=t.read();if(!a)throw new Error("Sidecar medium not found");return N.createElement(a,ys({},s))};JS.isSideCarExport=!0;function hO(e,t){return e.useMedium(t),JS}var WS=fO(),Ih=function(){},Iu=N.forwardRef(function(e,t){var s=N.useRef(null),a=N.useState({onScrollCapture:Ih,onWheelCapture:Ih,onTouchMoveCapture:Ih}),r=a[0],c=a[1],d=e.forwardProps,f=e.children,p=e.className,m=e.removeScrollBar,v=e.enabled,y=e.shards,b=e.sideCar,x=e.noRelative,j=e.noIsolation,w=e.inert,_=e.allowPinchZoom,C=e.as,E=C===void 0?"div":C,O=e.gapMode,z=XS(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),M=b,T=cO([s,t]),L=ys(ys({},z),r);return N.createElement(N.Fragment,null,v&&N.createElement(M,{sideCar:WS,removeScrollBar:m,shards:y,noRelative:x,noIsolation:j,inert:w,setCallbacks:c,allowPinchZoom:!!_,lockRef:s,gapMode:O}),d?N.cloneElement(N.Children.only(f),ys(ys({},L),{ref:T})):N.createElement(E,ys({},L,{className:p,ref:T}),f))});Iu.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Iu.classNames={fullWidth:tu,zeroRight:eu};var mO=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function pO(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=mO();return t&&e.setAttribute("nonce",t),e}function gO(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function yO(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var vO=function(){var e=0,t=null;return{add:function(s){e==0&&(t=pO())&&(gO(t,s),yO(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},bO=function(){var e=vO();return function(t,s){N.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&s])}},ew=function(){var e=bO(),t=function(s){var a=s.styles,r=s.dynamic;return e(a,r),null};return t},xO={left:0,top:0,right:0,gap:0},Bh=function(e){return parseInt(e||"",10)||0},SO=function(e){var t=window.getComputedStyle(document.body),s=t[e==="padding"?"paddingLeft":"marginLeft"],a=t[e==="padding"?"paddingTop":"marginTop"],r=t[e==="padding"?"paddingRight":"marginRight"];return[Bh(s),Bh(a),Bh(r)]},wO=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return xO;var t=SO(e),s=document.documentElement.clientWidth,a=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,a-s+t[2]-t[0])}},jO=ew(),Nr="data-scroll-locked",NO=function(e,t,s,a){var r=e.left,c=e.top,d=e.right,f=e.gap;return s===void 0&&(s="margin"),`
13
- .`.concat(aO,` {
14
- overflow: hidden `).concat(a,`;
15
- padding-right: `).concat(f,"px ").concat(a,`;
16
- }
17
- body[`).concat(Nr,`] {
18
- overflow: hidden `).concat(a,`;
19
- overscroll-behavior: contain;
20
- `).concat([t&&"position: relative ".concat(a,";"),s==="margin"&&`
21
- padding-left: `.concat(r,`px;
22
- padding-top: `).concat(c,`px;
23
- padding-right: `).concat(d,`px;
24
- margin-left:0;
25
- margin-top:0;
26
- margin-right: `).concat(f,"px ").concat(a,`;
27
- `),s==="padding"&&"padding-right: ".concat(f,"px ").concat(a,";")].filter(Boolean).join(""),`
28
- }
29
-
30
- .`).concat(eu,` {
31
- right: `).concat(f,"px ").concat(a,`;
32
- }
33
-
34
- .`).concat(tu,` {
35
- margin-right: `).concat(f,"px ").concat(a,`;
36
- }
37
-
38
- .`).concat(eu," .").concat(eu,` {
39
- right: 0 `).concat(a,`;
40
- }
41
-
42
- .`).concat(tu," .").concat(tu,` {
43
- margin-right: 0 `).concat(a,`;
44
- }
45
-
46
- body[`).concat(Nr,`] {
47
- `).concat(rO,": ").concat(f,`px;
48
- }
49
- `)},Gb=function(){var e=parseInt(document.body.getAttribute(Nr)||"0",10);return isFinite(e)?e:0},_O=function(){N.useEffect(function(){return document.body.setAttribute(Nr,(Gb()+1).toString()),function(){var e=Gb()-1;e<=0?document.body.removeAttribute(Nr):document.body.setAttribute(Nr,e.toString())}},[])},CO=function(e){var t=e.noRelative,s=e.noImportant,a=e.gapMode,r=a===void 0?"margin":a;_O();var c=N.useMemo(function(){return wO(r)},[r]);return N.createElement(jO,{styles:NO(c,!t,r,s?"":"!important")})},pm=!1;if(typeof window<"u")try{var Uc=Object.defineProperty({},"passive",{get:function(){return pm=!0,!0}});window.addEventListener("test",Uc,Uc),window.removeEventListener("test",Uc,Uc)}catch{pm=!1}var hr=pm?{passive:!1}:!1,kO=function(e){return e.tagName==="TEXTAREA"},tw=function(e,t){if(!(e instanceof Element))return!1;var s=window.getComputedStyle(e);return s[t]!=="hidden"&&!(s.overflowY===s.overflowX&&!kO(e)&&s[t]==="visible")},zO=function(e){return tw(e,"overflowY")},EO=function(e){return tw(e,"overflowX")},Kb=function(e,t){var s=t.ownerDocument,a=t;do{typeof ShadowRoot<"u"&&a instanceof ShadowRoot&&(a=a.host);var r=nw(e,a);if(r){var c=sw(e,a),d=c[1],f=c[2];if(d>f)return!0}a=a.parentNode}while(a&&a!==s.body);return!1},OO=function(e){var t=e.scrollTop,s=e.scrollHeight,a=e.clientHeight;return[t,s,a]},RO=function(e){var t=e.scrollLeft,s=e.scrollWidth,a=e.clientWidth;return[t,s,a]},nw=function(e,t){return e==="v"?zO(t):EO(t)},sw=function(e,t){return e==="v"?OO(t):RO(t)},AO=function(e,t){return e==="h"&&t==="rtl"?-1:1},TO=function(e,t,s,a,r){var c=AO(e,window.getComputedStyle(t).direction),d=c*a,f=s.target,p=t.contains(f),m=!1,v=d>0,y=0,b=0;do{if(!f)break;var x=sw(e,f),j=x[0],w=x[1],_=x[2],C=w-_-c*j;(j||C)&&nw(e,f)&&(y+=C,b+=j);var E=f.parentNode;f=E&&E.nodeType===Node.DOCUMENT_FRAGMENT_NODE?E.host:E}while(!p&&f!==document.body||p&&(t.contains(f)||t===f));return(v&&Math.abs(y)<1||!v&&Math.abs(b)<1)&&(m=!0),m},$c=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Vb=function(e){return[e.deltaX,e.deltaY]},Qb=function(e){return e&&"current"in e?e.current:e},DO=function(e,t){return e[0]===t[0]&&e[1]===t[1]},LO=function(e){return`
50
- .block-interactivity-`.concat(e,` {pointer-events: none;}
51
- .allow-interactivity-`).concat(e,` {pointer-events: all;}
52
- `)},MO=0,mr=[];function UO(e){var t=N.useRef([]),s=N.useRef([0,0]),a=N.useRef(),r=N.useState(MO++)[0],c=N.useState(ew)[0],d=N.useRef(e);N.useEffect(function(){d.current=e},[e]),N.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var w=iO([e.lockRef.current],(e.shards||[]).map(Qb),!0).filter(Boolean);return w.forEach(function(_){return _.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),w.forEach(function(_){return _.classList.remove("allow-interactivity-".concat(r))})}}},[e.inert,e.lockRef.current,e.shards]);var f=N.useCallback(function(w,_){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!d.current.allowPinchZoom;var C=$c(w),E=s.current,O="deltaX"in w?w.deltaX:E[0]-C[0],z="deltaY"in w?w.deltaY:E[1]-C[1],M,T=w.target,L=Math.abs(O)>Math.abs(z)?"h":"v";if("touches"in w&&L==="h"&&T.type==="range")return!1;var R=window.getSelection(),I=R&&R.anchorNode,ie=I?I===T||I.contains(T):!1;if(ie)return!1;var Q=Kb(L,T);if(!Q)return!0;if(Q?M=L:(M=L==="v"?"h":"v",Q=Kb(L,T)),!Q)return!1;if(!a.current&&"changedTouches"in w&&(O||z)&&(a.current=M),!M)return!0;var se=a.current||M;return TO(se,_,w,se==="h"?O:z)},[]),p=N.useCallback(function(w){var _=w;if(!(!mr.length||mr[mr.length-1]!==c)){var C="deltaY"in _?Vb(_):$c(_),E=t.current.filter(function(M){return M.name===_.type&&(M.target===_.target||_.target===M.shadowParent)&&DO(M.delta,C)})[0];if(E&&E.should){_.cancelable&&_.preventDefault();return}if(!E){var O=(d.current.shards||[]).map(Qb).filter(Boolean).filter(function(M){return M.contains(_.target)}),z=O.length>0?f(_,O[0]):!d.current.noIsolation;z&&_.cancelable&&_.preventDefault()}}},[]),m=N.useCallback(function(w,_,C,E){var O={name:w,delta:_,target:C,should:E,shadowParent:$O(C)};t.current.push(O),setTimeout(function(){t.current=t.current.filter(function(z){return z!==O})},1)},[]),v=N.useCallback(function(w){s.current=$c(w),a.current=void 0},[]),y=N.useCallback(function(w){m(w.type,Vb(w),w.target,f(w,e.lockRef.current))},[]),b=N.useCallback(function(w){m(w.type,$c(w),w.target,f(w,e.lockRef.current))},[]);N.useEffect(function(){return mr.push(c),e.setCallbacks({onScrollCapture:y,onWheelCapture:y,onTouchMoveCapture:b}),document.addEventListener("wheel",p,hr),document.addEventListener("touchmove",p,hr),document.addEventListener("touchstart",v,hr),function(){mr=mr.filter(function(w){return w!==c}),document.removeEventListener("wheel",p,hr),document.removeEventListener("touchmove",p,hr),document.removeEventListener("touchstart",v,hr)}},[]);var x=e.removeScrollBar,j=e.inert;return N.createElement(N.Fragment,null,j?N.createElement(c,{styles:LO(r)}):null,x?N.createElement(CO,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function $O(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const PO=hO(WS,UO);var iw=N.forwardRef(function(e,t){return N.createElement(Iu,ys({},e,{ref:t,sideCar:PO}))});iw.classNames=Iu.classNames;var IO=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},pr=new WeakMap,Pc=new WeakMap,Ic={},qh=0,aw=function(e){return e&&(e.host||aw(e.parentNode))},BO=function(e,t){return t.map(function(s){if(e.contains(s))return s;var a=aw(s);return a&&e.contains(a)?a:(console.error("aria-hidden",s,"in not contained inside",e,". Doing nothing"),null)}).filter(function(s){return!!s})},qO=function(e,t,s,a){var r=BO(t,Array.isArray(e)?e:[e]);Ic[s]||(Ic[s]=new WeakMap);var c=Ic[s],d=[],f=new Set,p=new Set(r),m=function(y){!y||f.has(y)||(f.add(y),m(y.parentNode))};r.forEach(m);var v=function(y){!y||p.has(y)||Array.prototype.forEach.call(y.children,function(b){if(f.has(b))v(b);else try{var x=b.getAttribute(a),j=x!==null&&x!=="false",w=(pr.get(b)||0)+1,_=(c.get(b)||0)+1;pr.set(b,w),c.set(b,_),d.push(b),w===1&&j&&Pc.set(b,!0),_===1&&b.setAttribute(s,"true"),j||b.setAttribute(a,"true")}catch(C){console.error("aria-hidden: cannot operate on ",b,C)}})};return v(t),f.clear(),qh++,function(){d.forEach(function(y){var b=pr.get(y)-1,x=c.get(y)-1;pr.set(y,b),c.set(y,x),b||(Pc.has(y)||y.removeAttribute(a),Pc.delete(y)),x||y.removeAttribute(s)}),qh--,qh||(pr=new WeakMap,pr=new WeakMap,Pc=new WeakMap,Ic={})}},HO=function(e,t,s){s===void 0&&(s="data-aria-hidden");var a=Array.from(Array.isArray(e)?e:[e]),r=IO(e);return r?(a.push.apply(a,Array.from(r.querySelectorAll("[aria-live], script"))),qO(a,r,s,"aria-hidden")):function(){return null}},Bu="Dialog",[rw]=jE(Bu),[ZO,as]=rw(Bu),ow=e=>{const{__scopeDialog:t,children:s,open:a,defaultOpen:r,onOpenChange:c,modal:d=!0}=e,f=N.useRef(null),p=N.useRef(null),[m,v]=zE({prop:a,defaultProp:r??!1,onChange:c,caller:Bu});return l.jsx(ZO,{scope:t,triggerRef:f,contentRef:p,contentId:Lh(),titleId:Lh(),descriptionId:Lh(),open:m,onOpenChange:v,onOpenToggle:N.useCallback(()=>v(y=>!y),[v]),modal:d,children:s})};ow.displayName=Bu;var lw="DialogTrigger",FO=N.forwardRef((e,t)=>{const{__scopeDialog:s,...a}=e,r=as(lw,s),c=Na(t,r.triggerRef);return l.jsx(Zs.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":rp(r.open),...a,ref:c,onClick:Ti(e.onClick,r.onOpenToggle)})});FO.displayName=lw;var ip="DialogPortal",[GO,cw]=rw(ip,{forceMount:void 0}),uw=e=>{const{__scopeDialog:t,forceMount:s,children:a,container:r}=e,c=as(ip,t);return l.jsx(GO,{scope:t,forceMount:s,children:N.Children.map(a,d=>l.jsx(Pu,{present:s||c.open,children:l.jsx(YS,{asChild:!0,container:r,children:d})}))})};uw.displayName=ip;var bu="DialogOverlay",dw=N.forwardRef((e,t)=>{const s=cw(bu,e.__scopeDialog),{forceMount:a=s.forceMount,...r}=e,c=as(bu,e.__scopeDialog);return c.modal?l.jsx(Pu,{present:a||c.open,children:l.jsx(VO,{...r,ref:t})}):null});dw.displayName=bu;var KO=ZS("DialogOverlay.RemoveScroll"),VO=N.forwardRef((e,t)=>{const{__scopeDialog:s,...a}=e,r=as(bu,s);return l.jsx(iw,{as:KO,allowPinchZoom:!0,shards:[r.contentRef],children:l.jsx(Zs.div,{"data-state":rp(r.open),...a,ref:t,style:{pointerEvents:"auto",...a.style}})})}),Sa="DialogContent",fw=N.forwardRef((e,t)=>{const s=cw(Sa,e.__scopeDialog),{forceMount:a=s.forceMount,...r}=e,c=as(Sa,e.__scopeDialog);return l.jsx(Pu,{present:a||c.open,children:c.modal?l.jsx(QO,{...r,ref:t}):l.jsx(YO,{...r,ref:t})})});fw.displayName=Sa;var QO=N.forwardRef((e,t)=>{const s=as(Sa,e.__scopeDialog),a=N.useRef(null),r=Na(t,s.contentRef,a);return N.useEffect(()=>{const c=a.current;if(c)return HO(c)},[]),l.jsx(hw,{...e,ref:r,trapFocus:s.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ti(e.onCloseAutoFocus,c=>{c.preventDefault(),s.triggerRef.current?.focus()}),onPointerDownOutside:Ti(e.onPointerDownOutside,c=>{const d=c.detail.originalEvent,f=d.button===0&&d.ctrlKey===!0;(d.button===2||f)&&c.preventDefault()}),onFocusOutside:Ti(e.onFocusOutside,c=>c.preventDefault())})}),YO=N.forwardRef((e,t)=>{const s=as(Sa,e.__scopeDialog),a=N.useRef(!1),r=N.useRef(!1);return l.jsx(hw,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:c=>{e.onCloseAutoFocus?.(c),c.defaultPrevented||(a.current||s.triggerRef.current?.focus(),c.preventDefault()),a.current=!1,r.current=!1},onInteractOutside:c=>{e.onInteractOutside?.(c),c.defaultPrevented||(a.current=!0,c.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const d=c.target;s.triggerRef.current?.contains(d)&&c.preventDefault(),c.detail.originalEvent.type==="focusin"&&r.current&&c.preventDefault()}})}),hw=N.forwardRef((e,t)=>{const{__scopeDialog:s,trapFocus:a,onOpenAutoFocus:r,onCloseAutoFocus:c,...d}=e,f=as(Sa,s),p=N.useRef(null),m=Na(t,p);return sO(),l.jsxs(l.Fragment,{children:[l.jsx(VS,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:r,onUnmountAutoFocus:c,children:l.jsx(GS,{role:"dialog",id:f.contentId,"aria-describedby":f.descriptionId,"aria-labelledby":f.titleId,"data-state":rp(f.open),...d,ref:m,onDismiss:()=>f.onOpenChange(!1)})}),l.jsxs(l.Fragment,{children:[l.jsx(XO,{titleId:f.titleId}),l.jsx(WO,{contentRef:p,descriptionId:f.descriptionId})]})]})}),ap="DialogTitle",mw=N.forwardRef((e,t)=>{const{__scopeDialog:s,...a}=e,r=as(ap,s);return l.jsx(Zs.h2,{id:r.titleId,...a,ref:t})});mw.displayName=ap;var pw="DialogDescription",gw=N.forwardRef((e,t)=>{const{__scopeDialog:s,...a}=e,r=as(pw,s);return l.jsx(Zs.p,{id:r.descriptionId,...a,ref:t})});gw.displayName=pw;var yw="DialogClose",vw=N.forwardRef((e,t)=>{const{__scopeDialog:s,...a}=e,r=as(yw,s);return l.jsx(Zs.button,{type:"button",...a,ref:t,onClick:Ti(e.onClick,()=>r.onOpenChange(!1))})});vw.displayName=yw;function rp(e){return e?"open":"closed"}var bw="DialogTitleWarning",[m3,xw]=wE(bw,{contentName:Sa,titleName:ap,docsSlug:"dialog"}),XO=({titleId:e})=>{const t=xw(bw),s=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
53
-
54
- If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
55
-
56
- For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return N.useEffect(()=>{e&&(document.getElementById(e)||console.error(s))},[s,e]),null},JO="DialogDescriptionWarning",WO=({contentRef:e,descriptionId:t})=>{const a=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${xw(JO).contentName}}.`;return N.useEffect(()=>{const r=e.current?.getAttribute("aria-describedby");t&&r&&(document.getElementById(t)||console.warn(a))},[a,e,t]),null},Sw=ow,ww=uw,op=dw,lp=fw,cp=mw,jw=gw,Nw=vw;const eR=Sw,tR=ww,_w=N.forwardRef(({className:e,...t},s)=>l.jsx(op,{ref:s,className:Kn("fixed inset-0 z-50 bg-black/70 backdrop-blur-sm",e),...t}));_w.displayName=op.displayName;const nR=400,sR=1200,iR=720,Cw=N.forwardRef(({className:e,children:t,...s},a)=>{const[r,c]=N.useState(iR),d=N.useRef(!1),f=N.useRef(0),p=N.useRef(0),m=N.useCallback(b=>{d.current=!0,f.current=b.clientX,p.current=r,b.target.setPointerCapture(b.pointerId),b.preventDefault()},[r]),v=N.useCallback(b=>{if(!d.current)return;const x=f.current-b.clientX,j=Math.min(sR,Math.max(nR,p.current+x));c(j)},[]),y=N.useCallback(()=>{d.current=!1},[]);return l.jsxs(tR,{children:[l.jsx(_w,{}),l.jsxs(lp,{ref:a,className:Kn("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(${r}px, 100vw)`},...s,children:[l.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:m,onPointerMove:v,onPointerUp:y}),t,l.jsxs(Nw,{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:[l.jsx(Mu,{className:"size-4"}),l.jsx("span",{className:"sr-only",children:"Close"})]})]})]})});Cw.displayName=lp.displayName;const aR=({className:e,...t})=>l.jsx("div",{className:Kn("flex flex-col gap-1.5 pr-10",e),...t}),kw=N.forwardRef(({className:e,...t},s)=>l.jsx(cp,{ref:s,className:Kn("text-lg font-medium text-zinc-50",e),...t}));kw.displayName=cp.displayName;const zw=N.forwardRef(({className:e,...t},s)=>l.jsx(jw,{ref:s,className:Kn("text-sm text-zinc-500",e),...t}));zw.displayName=jw.displayName;function rR({title:e,subtitle:t,children:s,open:a,onClose:r}){return l.jsx(eR,{open:a,onOpenChange:c=>c?void 0:r(),children:l.jsxs(Cw,{children:[l.jsxs(aR,{className:"drawer-head",children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:t}),l.jsx(kw,{id:"drawer-title",children:e}),l.jsx(zw,{className:"sr-only",children:t})]}),l.jsx("div",{className:"drawer-body",children:s})]})})}function X(e,t,s){function a(f,p){if(f._zod||Object.defineProperty(f,"_zod",{value:{def:p,constr:d,traits:new Set},enumerable:!1}),f._zod.traits.has(e))return;f._zod.traits.add(e),t(f,p);const m=d.prototype,v=Object.keys(m);for(let y=0;y<v.length;y++){const b=v[y];b in f||(f[b]=m[b].bind(f))}}const r=s?.Parent??Object;class c extends r{}Object.defineProperty(c,"name",{value:e});function d(f){var p;const m=s?.Parent?new c:this;a(m,f),(p=m._zod).deferred??(p.deferred=[]);for(const v of m._zod.deferred)v();return m}return Object.defineProperty(d,"init",{value:a}),Object.defineProperty(d,Symbol.hasInstance,{value:f=>s?.Parent&&f instanceof s.Parent?!0:f?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}class _r extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Ew extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const Ow={};function Mi(e){return Ow}function Rw(e){const t=Object.values(e).filter(a=>typeof a=="number");return Object.entries(e).filter(([a,r])=>t.indexOf(+a)===-1).map(([a,r])=>r)}function gm(e,t){return typeof t=="bigint"?t.toString():t}function up(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function dp(e){return e==null}function fp(e){const t=e.startsWith("^")?1:0,s=e.endsWith("$")?e.length-1:e.length;return e.slice(t,s)}function oR(e,t){const s=(e.toString().split(".")[1]||"").length,a=t.toString();let r=(a.split(".")[1]||"").length;if(r===0&&/\d?e-\d?/.test(a)){const p=a.match(/\d?e-(\d?)/);p?.[1]&&(r=Number.parseInt(p[1]))}const c=s>r?s:r,d=Number.parseInt(e.toFixed(c).replace(".","")),f=Number.parseInt(t.toFixed(c).replace(".",""));return d%f/10**c}const Yb=Symbol("evaluating");function We(e,t,s){let a;Object.defineProperty(e,t,{get(){if(a!==Yb)return a===void 0&&(a=Yb,a=s()),a},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function Ca(e,t,s){Object.defineProperty(e,t,{value:s,writable:!0,enumerable:!0,configurable:!0})}function Ii(...e){const t={};for(const s of e){const a=Object.getOwnPropertyDescriptors(s);Object.assign(t,a)}return Object.defineProperties({},t)}function Xb(e){return JSON.stringify(e)}function lR(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Aw="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function xu(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const cR=up(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Or(e){if(xu(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const s=t.prototype;return!(xu(s)===!1||Object.prototype.hasOwnProperty.call(s,"isPrototypeOf")===!1)}function Tw(e){return Or(e)?{...e}:Array.isArray(e)?[...e]:e}const uR=new Set(["string","number","symbol"]);function Rr(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Bi(e,t,s){const a=new e._zod.constr(t??e._zod.def);return(!t||s?.parent)&&(a._zod.parent=e),a}function Se(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 dR(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const fR={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 hR(e,t){const s=e._zod.def,a=s.checks;if(a&&a.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const c=Ii(e._zod.def,{get shape(){const d={};for(const f in t){if(!(f in s.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&(d[f]=s.shape[f])}return Ca(this,"shape",d),d},checks:[]});return Bi(e,c)}function mR(e,t){const s=e._zod.def,a=s.checks;if(a&&a.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const c=Ii(e._zod.def,{get shape(){const d={...e._zod.def.shape};for(const f in t){if(!(f in s.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&delete d[f]}return Ca(this,"shape",d),d},checks:[]});return Bi(e,c)}function pR(e,t){if(!Or(t))throw new Error("Invalid input to extend: expected a plain object");const s=e._zod.def.checks;if(s&&s.length>0){const c=e._zod.def.shape;for(const d in t)if(Object.getOwnPropertyDescriptor(c,d)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const r=Ii(e._zod.def,{get shape(){const c={...e._zod.def.shape,...t};return Ca(this,"shape",c),c}});return Bi(e,r)}function gR(e,t){if(!Or(t))throw new Error("Invalid input to safeExtend: expected a plain object");const s=Ii(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return Ca(this,"shape",a),a}});return Bi(e,s)}function yR(e,t){const s=Ii(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t._zod.def.shape};return Ca(this,"shape",a),a},get catchall(){return t._zod.def.catchall},checks:[]});return Bi(e,s)}function vR(e,t,s){const r=t._zod.def.checks;if(r&&r.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const d=Ii(t._zod.def,{get shape(){const f=t._zod.def.shape,p={...f};if(s)for(const m in s){if(!(m in f))throw new Error(`Unrecognized key: "${m}"`);s[m]&&(p[m]=e?new e({type:"optional",innerType:f[m]}):f[m])}else for(const m in f)p[m]=e?new e({type:"optional",innerType:f[m]}):f[m];return Ca(this,"shape",p),p},checks:[]});return Bi(t,d)}function bR(e,t,s){const a=Ii(t._zod.def,{get shape(){const r=t._zod.def.shape,c={...r};if(s)for(const d in s){if(!(d in c))throw new Error(`Unrecognized key: "${d}"`);s[d]&&(c[d]=new e({type:"nonoptional",innerType:r[d]}))}else for(const d in r)c[d]=new e({type:"nonoptional",innerType:r[d]});return Ca(this,"shape",c),c}});return Bi(t,a)}function br(e,t=0){if(e.aborted===!0)return!0;for(let s=t;s<e.issues.length;s++)if(e.issues[s]?.continue!==!0)return!0;return!1}function xr(e,t){return t.map(s=>{var a;return(a=s).path??(a.path=[]),s.path.unshift(e),s})}function Bc(e){return typeof e=="string"?e:e?.message}function Ui(e,t,s){const a={...e,path:e.path??[]};if(!e.message){const r=Bc(e.inst?._zod.def?.error?.(e))??Bc(t?.error?.(e))??Bc(s.customError?.(e))??Bc(s.localeError?.(e))??"Invalid input";a.message=r}return delete a.inst,delete a.continue,t?.reportInput||delete a.input,a}function hp(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function el(...e){const[t,s,a]=e;return typeof t=="string"?{message:t,code:"custom",input:s,inst:a}:{...t}}const Dw=(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,gm,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Lw=X("$ZodError",Dw),Mw=X("$ZodError",Dw,{Parent:Error});function xR(e,t=s=>s.message){const s={},a=[];for(const r of e.issues)r.path.length>0?(s[r.path[0]]=s[r.path[0]]||[],s[r.path[0]].push(t(r))):a.push(t(r));return{formErrors:a,fieldErrors:s}}function SR(e,t=s=>s.message){const s={_errors:[]},a=r=>{for(const c of r.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(d=>a({issues:d}));else if(c.code==="invalid_key")a({issues:c.issues});else if(c.code==="invalid_element")a({issues:c.issues});else if(c.path.length===0)s._errors.push(t(c));else{let d=s,f=0;for(;f<c.path.length;){const p=c.path[f];f===c.path.length-1?(d[p]=d[p]||{_errors:[]},d[p]._errors.push(t(c))):d[p]=d[p]||{_errors:[]},d=d[p],f++}}};return a(e),s}const mp=e=>(t,s,a,r)=>{const c=a?Object.assign(a,{async:!1}):{async:!1},d=t._zod.run({value:s,issues:[]},c);if(d instanceof Promise)throw new _r;if(d.issues.length){const f=new(r?.Err??e)(d.issues.map(p=>Ui(p,c,Mi())));throw Aw(f,r?.callee),f}return d.value},pp=e=>async(t,s,a,r)=>{const c=a?Object.assign(a,{async:!0}):{async:!0};let d=t._zod.run({value:s,issues:[]},c);if(d instanceof Promise&&(d=await d),d.issues.length){const f=new(r?.Err??e)(d.issues.map(p=>Ui(p,c,Mi())));throw Aw(f,r?.callee),f}return d.value},qu=e=>(t,s,a)=>{const r=a?{...a,async:!1}:{async:!1},c=t._zod.run({value:s,issues:[]},r);if(c instanceof Promise)throw new _r;return c.issues.length?{success:!1,error:new(e??Lw)(c.issues.map(d=>Ui(d,r,Mi())))}:{success:!0,data:c.value}},wR=qu(Mw),Hu=e=>async(t,s,a)=>{const r=a?Object.assign(a,{async:!0}):{async:!0};let c=t._zod.run({value:s,issues:[]},r);return c instanceof Promise&&(c=await c),c.issues.length?{success:!1,error:new e(c.issues.map(d=>Ui(d,r,Mi())))}:{success:!0,data:c.value}},jR=Hu(Mw),NR=e=>(t,s,a)=>{const r=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return mp(e)(t,s,r)},_R=e=>(t,s,a)=>mp(e)(t,s,a),CR=e=>async(t,s,a)=>{const r=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return pp(e)(t,s,r)},kR=e=>async(t,s,a)=>pp(e)(t,s,a),zR=e=>(t,s,a)=>{const r=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return qu(e)(t,s,r)},ER=e=>(t,s,a)=>qu(e)(t,s,a),OR=e=>async(t,s,a)=>{const r=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Hu(e)(t,s,r)},RR=e=>async(t,s,a)=>Hu(e)(t,s,a),AR=/^[cC][^\s-]{8,}$/,TR=/^[0-9a-z]+$/,DR=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,LR=/^[0-9a-vA-V]{20}$/,MR=/^[A-Za-z0-9]{27}$/,UR=/^[a-zA-Z0-9_-]{21}$/,$R=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,PR=/^([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})$/,Jb=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)$/,IR=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,BR="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function qR(){return new RegExp(BR,"u")}const HR=/^(?:(?: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])$/,ZR=/^(([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}|:))$/,FR=/^((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])$/,GR=/^(([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])$/,KR=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Uw=/^[A-Za-z0-9_-]*$/,VR=/^\+[1-9]\d{6,14}$/,$w="(?:(?:\\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])))",QR=new RegExp(`^${$w}$`);function Pw(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 YR(e){return new RegExp(`^${Pw(e)}$`)}function XR(e){const t=Pw({precision:e.precision}),s=["Z"];e.local&&s.push(""),e.offset&&s.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const a=`${t}(?:${s.join("|")})`;return new RegExp(`^${$w}T(?:${a})$`)}const JR=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},WR=/^-?\d+$/,Iw=/^-?\d+(?:\.\d+)?$/,eA=/^(?:true|false)$/i,tA=/^[^A-Z]*$/,nA=/^[^a-z]*$/,Sn=X("$ZodCheck",(e,t)=>{var s;e._zod??(e._zod={}),e._zod.def=t,(s=e._zod).onattach??(s.onattach=[])}),Bw={number:"number",bigint:"bigint",object:"date"},qw=X("$ZodCheckLessThan",(e,t)=>{Sn.init(e,t);const s=Bw[typeof t.value];e._zod.onattach.push(a=>{const r=a._zod.bag,c=(t.inclusive?r.maximum:r.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<c&&(t.inclusive?r.maximum=t.value:r.exclusiveMaximum=t.value)}),e._zod.check=a=>{(t.inclusive?a.value<=t.value:a.value<t.value)||a.issues.push({origin:s,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:a.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Hw=X("$ZodCheckGreaterThan",(e,t)=>{Sn.init(e,t);const s=Bw[typeof t.value];e._zod.onattach.push(a=>{const r=a._zod.bag,c=(t.inclusive?r.minimum:r.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>c&&(t.inclusive?r.minimum=t.value:r.exclusiveMinimum=t.value)}),e._zod.check=a=>{(t.inclusive?a.value>=t.value:a.value>t.value)||a.issues.push({origin:s,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:a.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),sA=X("$ZodCheckMultipleOf",(e,t)=>{Sn.init(e,t),e._zod.onattach.push(s=>{var a;(a=s._zod.bag).multipleOf??(a.multipleOf=t.value)}),e._zod.check=s=>{if(typeof s.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof s.value=="bigint"?s.value%t.value===BigInt(0):oR(s.value,t.value)===0)||s.issues.push({origin:typeof s.value,code:"not_multiple_of",divisor:t.value,input:s.value,inst:e,continue:!t.abort})}}),iA=X("$ZodCheckNumberFormat",(e,t)=>{Sn.init(e,t),t.format=t.format||"float64";const s=t.format?.includes("int"),a=s?"int":"number",[r,c]=fR[t.format];e._zod.onattach.push(d=>{const f=d._zod.bag;f.format=t.format,f.minimum=r,f.maximum=c,s&&(f.pattern=WR)}),e._zod.check=d=>{const f=d.value;if(s){if(!Number.isInteger(f)){d.issues.push({expected:a,format:t.format,code:"invalid_type",continue:!1,input:f,inst:e});return}if(!Number.isSafeInteger(f)){f>0?d.issues.push({input:f,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:a,inclusive:!0,continue:!t.abort}):d.issues.push({input:f,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:a,inclusive:!0,continue:!t.abort});return}}f<r&&d.issues.push({origin:"number",input:f,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),f>c&&d.issues.push({origin:"number",input:f,code:"too_big",maximum:c,inclusive:!0,inst:e,continue:!t.abort})}}),aA=X("$ZodCheckMaxLength",(e,t)=>{var s;Sn.init(e,t),(s=e._zod.def).when??(s.when=a=>{const r=a.value;return!dp(r)&&r.length!==void 0}),e._zod.onattach.push(a=>{const r=a._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<r&&(a._zod.bag.maximum=t.maximum)}),e._zod.check=a=>{const r=a.value;if(r.length<=t.maximum)return;const d=hp(r);a.issues.push({origin:d,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),rA=X("$ZodCheckMinLength",(e,t)=>{var s;Sn.init(e,t),(s=e._zod.def).when??(s.when=a=>{const r=a.value;return!dp(r)&&r.length!==void 0}),e._zod.onattach.push(a=>{const r=a._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>r&&(a._zod.bag.minimum=t.minimum)}),e._zod.check=a=>{const r=a.value;if(r.length>=t.minimum)return;const d=hp(r);a.issues.push({origin:d,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),oA=X("$ZodCheckLengthEquals",(e,t)=>{var s;Sn.init(e,t),(s=e._zod.def).when??(s.when=a=>{const r=a.value;return!dp(r)&&r.length!==void 0}),e._zod.onattach.push(a=>{const r=a._zod.bag;r.minimum=t.length,r.maximum=t.length,r.length=t.length}),e._zod.check=a=>{const r=a.value,c=r.length;if(c===t.length)return;const d=hp(r),f=c>t.length;a.issues.push({origin:d,...f?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:a.value,inst:e,continue:!t.abort})}}),Zu=X("$ZodCheckStringFormat",(e,t)=>{var s,a;Sn.init(e,t),e._zod.onattach.push(r=>{const c=r._zod.bag;c.format=t.format,t.pattern&&(c.patterns??(c.patterns=new Set),c.patterns.add(t.pattern))}),t.pattern?(s=e._zod).check??(s.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(a=e._zod).check??(a.check=()=>{})}),lA=X("$ZodCheckRegex",(e,t)=>{Zu.init(e,t),e._zod.check=s=>{t.pattern.lastIndex=0,!t.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:"regex",input:s.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),cA=X("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=tA),Zu.init(e,t)}),uA=X("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=nA),Zu.init(e,t)}),dA=X("$ZodCheckIncludes",(e,t)=>{Sn.init(e,t);const s=Rr(t.includes),a=new RegExp(typeof t.position=="number"?`^.{${t.position}}${s}`:s);t.pattern=a,e._zod.onattach.push(r=>{const c=r._zod.bag;c.patterns??(c.patterns=new Set),c.patterns.add(a)}),e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),fA=X("$ZodCheckStartsWith",(e,t)=>{Sn.init(e,t);const s=new RegExp(`^${Rr(t.prefix)}.*`);t.pattern??(t.pattern=s),e._zod.onattach.push(a=>{const r=a._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(s)}),e._zod.check=a=>{a.value.startsWith(t.prefix)||a.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:a.value,inst:e,continue:!t.abort})}}),hA=X("$ZodCheckEndsWith",(e,t)=>{Sn.init(e,t);const s=new RegExp(`.*${Rr(t.suffix)}$`);t.pattern??(t.pattern=s),e._zod.onattach.push(a=>{const r=a._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(s)}),e._zod.check=a=>{a.value.endsWith(t.suffix)||a.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:a.value,inst:e,continue:!t.abort})}}),mA=X("$ZodCheckOverwrite",(e,t)=>{Sn.init(e,t),e._zod.check=s=>{s.value=t.tx(s.value)}});class pA{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 a=t.split(`
57
- `).filter(d=>d),r=Math.min(...a.map(d=>d.length-d.trimStart().length)),c=a.map(d=>d.slice(r)).map(d=>" ".repeat(this.indent*2)+d);for(const d of c)this.content.push(d)}compile(){const t=Function,s=this?.args,r=[...(this?.content??[""]).map(c=>` ${c}`)];return new t(...s,r.join(`
58
- `))}}const gA={major:4,minor:3,patch:6},vt=X("$ZodType",(e,t)=>{var s;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=gA;const a=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&a.unshift(e);for(const r of a)for(const c of r._zod.onattach)c(e);if(a.length===0)(s=e._zod).deferred??(s.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const r=(d,f,p)=>{let m=br(d),v;for(const y of f){if(y._zod.def.when){if(!y._zod.def.when(d))continue}else if(m)continue;const b=d.issues.length,x=y._zod.check(d);if(x instanceof Promise&&p?.async===!1)throw new _r;if(v||x instanceof Promise)v=(v??Promise.resolve()).then(async()=>{await x,d.issues.length!==b&&(m||(m=br(d,b)))});else{if(d.issues.length===b)continue;m||(m=br(d,b))}}return v?v.then(()=>d):d},c=(d,f,p)=>{if(br(d))return d.aborted=!0,d;const m=r(f,a,p);if(m instanceof Promise){if(p.async===!1)throw new _r;return m.then(v=>e._zod.parse(v,p))}return e._zod.parse(m,p)};e._zod.run=(d,f)=>{if(f.skipChecks)return e._zod.parse(d,f);if(f.direction==="backward"){const m=e._zod.parse({value:d.value,issues:[]},{...f,skipChecks:!0});return m instanceof Promise?m.then(v=>c(v,d,f)):c(m,d,f)}const p=e._zod.parse(d,f);if(p instanceof Promise){if(f.async===!1)throw new _r;return p.then(m=>r(m,a,f))}return r(p,a,f)}}We(e,"~standard",()=>({validate:r=>{try{const c=wR(e,r);return c.success?{value:c.data}:{issues:c.error?.issues}}catch{return jR(e,r).then(d=>d.success?{value:d.data}:{issues:d.error?.issues})}},vendor:"zod",version:1}))}),gp=X("$ZodString",(e,t)=>{vt.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??JR(e._zod.bag),e._zod.parse=(s,a)=>{if(t.coerce)try{s.value=String(s.value)}catch{}return typeof s.value=="string"||s.issues.push({expected:"string",code:"invalid_type",input:s.value,inst:e}),s}}),gt=X("$ZodStringFormat",(e,t)=>{Zu.init(e,t),gp.init(e,t)}),yA=X("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=PR),gt.init(e,t)}),vA=X("$ZodUUID",(e,t)=>{if(t.version){const a={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(a===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Jb(a))}else t.pattern??(t.pattern=Jb());gt.init(e,t)}),bA=X("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=IR),gt.init(e,t)}),xA=X("$ZodURL",(e,t)=>{gt.init(e,t),e._zod.check=s=>{try{const a=s.value.trim(),r=new URL(a);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(r.hostname)||s.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:s.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(r.protocol.endsWith(":")?r.protocol.slice(0,-1):r.protocol)||s.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:s.value,inst:e,continue:!t.abort})),t.normalize?s.value=r.href:s.value=a;return}catch{s.issues.push({code:"invalid_format",format:"url",input:s.value,inst:e,continue:!t.abort})}}}),SA=X("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=qR()),gt.init(e,t)}),wA=X("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=UR),gt.init(e,t)}),jA=X("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=AR),gt.init(e,t)}),NA=X("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=TR),gt.init(e,t)}),_A=X("$ZodULID",(e,t)=>{t.pattern??(t.pattern=DR),gt.init(e,t)}),CA=X("$ZodXID",(e,t)=>{t.pattern??(t.pattern=LR),gt.init(e,t)}),kA=X("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=MR),gt.init(e,t)}),zA=X("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=XR(t)),gt.init(e,t)}),EA=X("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=QR),gt.init(e,t)}),OA=X("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=YR(t)),gt.init(e,t)}),RA=X("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=$R),gt.init(e,t)}),AA=X("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=HR),gt.init(e,t),e._zod.bag.format="ipv4"}),TA=X("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=ZR),gt.init(e,t),e._zod.bag.format="ipv6",e._zod.check=s=>{try{new URL(`http://[${s.value}]`)}catch{s.issues.push({code:"invalid_format",format:"ipv6",input:s.value,inst:e,continue:!t.abort})}}}),DA=X("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=FR),gt.init(e,t)}),LA=X("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=GR),gt.init(e,t),e._zod.check=s=>{const a=s.value.split("/");try{if(a.length!==2)throw new Error;const[r,c]=a;if(!c)throw new Error;const d=Number(c);if(`${d}`!==c)throw new Error;if(d<0||d>128)throw new Error;new URL(`http://[${r}]`)}catch{s.issues.push({code:"invalid_format",format:"cidrv6",input:s.value,inst:e,continue:!t.abort})}}});function Zw(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const MA=X("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=KR),gt.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=s=>{Zw(s.value)||s.issues.push({code:"invalid_format",format:"base64",input:s.value,inst:e,continue:!t.abort})}});function UA(e){if(!Uw.test(e))return!1;const t=e.replace(/[-_]/g,a=>a==="-"?"+":"/"),s=t.padEnd(Math.ceil(t.length/4)*4,"=");return Zw(s)}const $A=X("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Uw),gt.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=s=>{UA(s.value)||s.issues.push({code:"invalid_format",format:"base64url",input:s.value,inst:e,continue:!t.abort})}}),PA=X("$ZodE164",(e,t)=>{t.pattern??(t.pattern=VR),gt.init(e,t)});function IA(e,t=null){try{const s=e.split(".");if(s.length!==3)return!1;const[a]=s;if(!a)return!1;const r=JSON.parse(atob(a));return!("typ"in r&&r?.typ!=="JWT"||!r.alg||t&&(!("alg"in r)||r.alg!==t))}catch{return!1}}const BA=X("$ZodJWT",(e,t)=>{gt.init(e,t),e._zod.check=s=>{IA(s.value,t.alg)||s.issues.push({code:"invalid_format",format:"jwt",input:s.value,inst:e,continue:!t.abort})}}),Fw=X("$ZodNumber",(e,t)=>{vt.init(e,t),e._zod.pattern=e._zod.bag.pattern??Iw,e._zod.parse=(s,a)=>{if(t.coerce)try{s.value=Number(s.value)}catch{}const r=s.value;if(typeof r=="number"&&!Number.isNaN(r)&&Number.isFinite(r))return s;const c=typeof r=="number"?Number.isNaN(r)?"NaN":Number.isFinite(r)?void 0:"Infinity":void 0;return s.issues.push({expected:"number",code:"invalid_type",input:r,inst:e,...c?{received:c}:{}}),s}}),qA=X("$ZodNumberFormat",(e,t)=>{iA.init(e,t),Fw.init(e,t)}),HA=X("$ZodBoolean",(e,t)=>{vt.init(e,t),e._zod.pattern=eA,e._zod.parse=(s,a)=>{if(t.coerce)try{s.value=!!s.value}catch{}const r=s.value;return typeof r=="boolean"||s.issues.push({expected:"boolean",code:"invalid_type",input:r,inst:e}),s}}),ZA=X("$ZodUnknown",(e,t)=>{vt.init(e,t),e._zod.parse=s=>s}),FA=X("$ZodNever",(e,t)=>{vt.init(e,t),e._zod.parse=(s,a)=>(s.issues.push({expected:"never",code:"invalid_type",input:s.value,inst:e}),s)});function Wb(e,t,s){e.issues.length&&t.issues.push(...xr(s,e.issues)),t.value[s]=e.value}const GA=X("$ZodArray",(e,t)=>{vt.init(e,t),e._zod.parse=(s,a)=>{const r=s.value;if(!Array.isArray(r))return s.issues.push({expected:"array",code:"invalid_type",input:r,inst:e}),s;s.value=Array(r.length);const c=[];for(let d=0;d<r.length;d++){const f=r[d],p=t.element._zod.run({value:f,issues:[]},a);p instanceof Promise?c.push(p.then(m=>Wb(m,s,d))):Wb(p,s,d)}return c.length?Promise.all(c).then(()=>s):s}});function Su(e,t,s,a,r){if(e.issues.length){if(r&&!(s in a))return;t.issues.push(...xr(s,e.issues))}e.value===void 0?s in a&&(t.value[s]=void 0):t.value[s]=e.value}function Gw(e){const t=Object.keys(e.shape);for(const a of t)if(!e.shape?.[a]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${a}": expected a Zod schema`);const s=dR(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(s)}}function Kw(e,t,s,a,r,c){const d=[],f=r.keySet,p=r.catchall._zod,m=p.def.type,v=p.optout==="optional";for(const y in t){if(f.has(y))continue;if(m==="never"){d.push(y);continue}const b=p.run({value:t[y],issues:[]},a);b instanceof Promise?e.push(b.then(x=>Su(x,s,y,t,v))):Su(b,s,y,t,v)}return d.length&&s.issues.push({code:"unrecognized_keys",keys:d,input:t,inst:c}),e.length?Promise.all(e).then(()=>s):s}const KA=X("$ZodObject",(e,t)=>{if(vt.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const f=t.shape;Object.defineProperty(t,"shape",{get:()=>{const p={...f};return Object.defineProperty(t,"shape",{value:p}),p}})}const a=up(()=>Gw(t));We(e._zod,"propValues",()=>{const f=t.shape,p={};for(const m in f){const v=f[m]._zod;if(v.values){p[m]??(p[m]=new Set);for(const y of v.values)p[m].add(y)}}return p});const r=xu,c=t.catchall;let d;e._zod.parse=(f,p)=>{d??(d=a.value);const m=f.value;if(!r(m))return f.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),f;f.value={};const v=[],y=d.shape;for(const b of d.keys){const x=y[b],j=x._zod.optout==="optional",w=x._zod.run({value:m[b],issues:[]},p);w instanceof Promise?v.push(w.then(_=>Su(_,f,b,m,j))):Su(w,f,b,m,j)}return c?Kw(v,m,f,p,a.value,e):v.length?Promise.all(v).then(()=>f):f}}),VA=X("$ZodObjectJIT",(e,t)=>{KA.init(e,t);const s=e._zod.parse,a=up(()=>Gw(t)),r=b=>{const x=new pA(["shape","payload","ctx"]),j=a.value,w=O=>{const z=Xb(O);return`shape[${z}]._zod.run({ value: input[${z}], issues: [] }, ctx)`};x.write("const input = payload.value;");const _=Object.create(null);let C=0;for(const O of j.keys)_[O]=`key_${C++}`;x.write("const newResult = {};");for(const O of j.keys){const z=_[O],M=Xb(O),L=b[O]?._zod?.optout==="optional";x.write(`const ${z} = ${w(O)};`),L?x.write(`
59
- if (${z}.issues.length) {
60
- if (${M} in input) {
61
- payload.issues = payload.issues.concat(${z}.issues.map(iss => ({
62
- ...iss,
63
- path: iss.path ? [${M}, ...iss.path] : [${M}]
64
- })));
65
- }
66
- }
67
-
68
- if (${z}.value === undefined) {
69
- if (${M} in input) {
70
- newResult[${M}] = undefined;
71
- }
72
- } else {
73
- newResult[${M}] = ${z}.value;
74
- }
75
-
76
- `):x.write(`
77
- if (${z}.issues.length) {
78
- payload.issues = payload.issues.concat(${z}.issues.map(iss => ({
79
- ...iss,
80
- path: iss.path ? [${M}, ...iss.path] : [${M}]
81
- })));
82
- }
83
-
84
- if (${z}.value === undefined) {
85
- if (${M} in input) {
86
- newResult[${M}] = undefined;
87
- }
88
- } else {
89
- newResult[${M}] = ${z}.value;
90
- }
91
-
92
- `)}x.write("payload.value = newResult;"),x.write("return payload;");const E=x.compile();return(O,z)=>E(b,O,z)};let c;const d=xu,f=!Ow.jitless,m=f&&cR.value,v=t.catchall;let y;e._zod.parse=(b,x)=>{y??(y=a.value);const j=b.value;return d(j)?f&&m&&x?.async===!1&&x.jitless!==!0?(c||(c=r(t.shape)),b=c(b,x),v?Kw([],j,b,x,y,e):b):s(b,x):(b.issues.push({expected:"object",code:"invalid_type",input:j,inst:e}),b)}});function ex(e,t,s,a){for(const c of e)if(c.issues.length===0)return t.value=c.value,t;const r=e.filter(c=>!br(c));return r.length===1?(t.value=r[0].value,r[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:s,errors:e.map(c=>c.issues.map(d=>Ui(d,a,Mi())))}),t)}const QA=X("$ZodUnion",(e,t)=>{vt.init(e,t),We(e._zod,"optin",()=>t.options.some(r=>r._zod.optin==="optional")?"optional":void 0),We(e._zod,"optout",()=>t.options.some(r=>r._zod.optout==="optional")?"optional":void 0),We(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),We(e._zod,"pattern",()=>{if(t.options.every(r=>r._zod.pattern)){const r=t.options.map(c=>c._zod.pattern);return new RegExp(`^(${r.map(c=>fp(c.source)).join("|")})$`)}});const s=t.options.length===1,a=t.options[0]._zod.run;e._zod.parse=(r,c)=>{if(s)return a(r,c);let d=!1;const f=[];for(const p of t.options){const m=p._zod.run({value:r.value,issues:[]},c);if(m instanceof Promise)f.push(m),d=!0;else{if(m.issues.length===0)return m;f.push(m)}}return d?Promise.all(f).then(p=>ex(p,r,e,c)):ex(f,r,e,c)}}),YA=X("$ZodIntersection",(e,t)=>{vt.init(e,t),e._zod.parse=(s,a)=>{const r=s.value,c=t.left._zod.run({value:r,issues:[]},a),d=t.right._zod.run({value:r,issues:[]},a);return c instanceof Promise||d instanceof Promise?Promise.all([c,d]).then(([p,m])=>tx(s,p,m)):tx(s,c,d)}});function ym(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(Or(e)&&Or(t)){const s=Object.keys(t),a=Object.keys(e).filter(c=>s.indexOf(c)!==-1),r={...e,...t};for(const c of a){const d=ym(e[c],t[c]);if(!d.valid)return{valid:!1,mergeErrorPath:[c,...d.mergeErrorPath]};r[c]=d.data}return{valid:!0,data:r}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const s=[];for(let a=0;a<e.length;a++){const r=e[a],c=t[a],d=ym(r,c);if(!d.valid)return{valid:!1,mergeErrorPath:[a,...d.mergeErrorPath]};s.push(d.data)}return{valid:!0,data:s}}return{valid:!1,mergeErrorPath:[]}}function tx(e,t,s){const a=new Map;let r;for(const f of t.issues)if(f.code==="unrecognized_keys"){r??(r=f);for(const p of f.keys)a.has(p)||a.set(p,{}),a.get(p).l=!0}else e.issues.push(f);for(const f of s.issues)if(f.code==="unrecognized_keys")for(const p of f.keys)a.has(p)||a.set(p,{}),a.get(p).r=!0;else e.issues.push(f);const c=[...a].filter(([,f])=>f.l&&f.r).map(([f])=>f);if(c.length&&r&&e.issues.push({...r,keys:c}),br(e))return e;const d=ym(t.value,s.value);if(!d.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(d.mergeErrorPath)}`);return e.value=d.data,e}const XA=X("$ZodRecord",(e,t)=>{vt.init(e,t),e._zod.parse=(s,a)=>{const r=s.value;if(!Or(r))return s.issues.push({expected:"record",code:"invalid_type",input:r,inst:e}),s;const c=[],d=t.keyType._zod.values;if(d){s.value={};const f=new Set;for(const m of d)if(typeof m=="string"||typeof m=="number"||typeof m=="symbol"){f.add(typeof m=="number"?m.toString():m);const v=t.valueType._zod.run({value:r[m],issues:[]},a);v instanceof Promise?c.push(v.then(y=>{y.issues.length&&s.issues.push(...xr(m,y.issues)),s.value[m]=y.value})):(v.issues.length&&s.issues.push(...xr(m,v.issues)),s.value[m]=v.value)}let p;for(const m in r)f.has(m)||(p=p??[],p.push(m));p&&p.length>0&&s.issues.push({code:"unrecognized_keys",input:r,inst:e,keys:p})}else{s.value={};for(const f of Reflect.ownKeys(r)){if(f==="__proto__")continue;let p=t.keyType._zod.run({value:f,issues:[]},a);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof f=="string"&&Iw.test(f)&&p.issues.length){const y=t.keyType._zod.run({value:Number(f),issues:[]},a);if(y instanceof Promise)throw new Error("Async schemas not supported in object keys currently");y.issues.length===0&&(p=y)}if(p.issues.length){t.mode==="loose"?s.value[f]=r[f]:s.issues.push({code:"invalid_key",origin:"record",issues:p.issues.map(y=>Ui(y,a,Mi())),input:f,path:[f],inst:e});continue}const v=t.valueType._zod.run({value:r[f],issues:[]},a);v instanceof Promise?c.push(v.then(y=>{y.issues.length&&s.issues.push(...xr(f,y.issues)),s.value[p.value]=y.value})):(v.issues.length&&s.issues.push(...xr(f,v.issues)),s.value[p.value]=v.value)}}return c.length?Promise.all(c).then(()=>s):s}}),JA=X("$ZodEnum",(e,t)=>{vt.init(e,t);const s=Rw(t.entries),a=new Set(s);e._zod.values=a,e._zod.pattern=new RegExp(`^(${s.filter(r=>uR.has(typeof r)).map(r=>typeof r=="string"?Rr(r):r.toString()).join("|")})$`),e._zod.parse=(r,c)=>{const d=r.value;return a.has(d)||r.issues.push({code:"invalid_value",values:s,input:d,inst:e}),r}}),WA=X("$ZodLiteral",(e,t)=>{if(vt.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const s=new Set(t.values);e._zod.values=s,e._zod.pattern=new RegExp(`^(${t.values.map(a=>typeof a=="string"?Rr(a):a?Rr(a.toString()):String(a)).join("|")})$`),e._zod.parse=(a,r)=>{const c=a.value;return s.has(c)||a.issues.push({code:"invalid_value",values:t.values,input:c,inst:e}),a}}),eT=X("$ZodTransform",(e,t)=>{vt.init(e,t),e._zod.parse=(s,a)=>{if(a.direction==="backward")throw new Ew(e.constructor.name);const r=t.transform(s.value,s);if(a.async)return(r instanceof Promise?r:Promise.resolve(r)).then(d=>(s.value=d,s));if(r instanceof Promise)throw new _r;return s.value=r,s}});function nx(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const Vw=X("$ZodOptional",(e,t)=>{vt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",We(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),We(e._zod,"pattern",()=>{const s=t.innerType._zod.pattern;return s?new RegExp(`^(${fp(s.source)})?$`):void 0}),e._zod.parse=(s,a)=>{if(t.innerType._zod.optin==="optional"){const r=t.innerType._zod.run(s,a);return r instanceof Promise?r.then(c=>nx(c,s.value)):nx(r,s.value)}return s.value===void 0?s:t.innerType._zod.run(s,a)}}),tT=X("$ZodExactOptional",(e,t)=>{Vw.init(e,t),We(e._zod,"values",()=>t.innerType._zod.values),We(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(s,a)=>t.innerType._zod.run(s,a)}),nT=X("$ZodNullable",(e,t)=>{vt.init(e,t),We(e._zod,"optin",()=>t.innerType._zod.optin),We(e._zod,"optout",()=>t.innerType._zod.optout),We(e._zod,"pattern",()=>{const s=t.innerType._zod.pattern;return s?new RegExp(`^(${fp(s.source)}|null)$`):void 0}),We(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(s,a)=>s.value===null?s:t.innerType._zod.run(s,a)}),sT=X("$ZodDefault",(e,t)=>{vt.init(e,t),e._zod.optin="optional",We(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(s,a)=>{if(a.direction==="backward")return t.innerType._zod.run(s,a);if(s.value===void 0)return s.value=t.defaultValue,s;const r=t.innerType._zod.run(s,a);return r instanceof Promise?r.then(c=>sx(c,t)):sx(r,t)}});function sx(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const iT=X("$ZodPrefault",(e,t)=>{vt.init(e,t),e._zod.optin="optional",We(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(s,a)=>(a.direction==="backward"||s.value===void 0&&(s.value=t.defaultValue),t.innerType._zod.run(s,a))}),aT=X("$ZodNonOptional",(e,t)=>{vt.init(e,t),We(e._zod,"values",()=>{const s=t.innerType._zod.values;return s?new Set([...s].filter(a=>a!==void 0)):void 0}),e._zod.parse=(s,a)=>{const r=t.innerType._zod.run(s,a);return r instanceof Promise?r.then(c=>ix(c,e)):ix(r,e)}});function ix(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 rT=X("$ZodCatch",(e,t)=>{vt.init(e,t),We(e._zod,"optin",()=>t.innerType._zod.optin),We(e._zod,"optout",()=>t.innerType._zod.optout),We(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(s,a)=>{if(a.direction==="backward")return t.innerType._zod.run(s,a);const r=t.innerType._zod.run(s,a);return r instanceof Promise?r.then(c=>(s.value=c.value,c.issues.length&&(s.value=t.catchValue({...s,error:{issues:c.issues.map(d=>Ui(d,a,Mi()))},input:s.value}),s.issues=[]),s)):(s.value=r.value,r.issues.length&&(s.value=t.catchValue({...s,error:{issues:r.issues.map(c=>Ui(c,a,Mi()))},input:s.value}),s.issues=[]),s)}}),oT=X("$ZodPipe",(e,t)=>{vt.init(e,t),We(e._zod,"values",()=>t.in._zod.values),We(e._zod,"optin",()=>t.in._zod.optin),We(e._zod,"optout",()=>t.out._zod.optout),We(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(s,a)=>{if(a.direction==="backward"){const c=t.out._zod.run(s,a);return c instanceof Promise?c.then(d=>qc(d,t.in,a)):qc(c,t.in,a)}const r=t.in._zod.run(s,a);return r instanceof Promise?r.then(c=>qc(c,t.out,a)):qc(r,t.out,a)}});function qc(e,t,s){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},s)}const lT=X("$ZodReadonly",(e,t)=>{vt.init(e,t),We(e._zod,"propValues",()=>t.innerType._zod.propValues),We(e._zod,"values",()=>t.innerType._zod.values),We(e._zod,"optin",()=>t.innerType?._zod?.optin),We(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(s,a)=>{if(a.direction==="backward")return t.innerType._zod.run(s,a);const r=t.innerType._zod.run(s,a);return r instanceof Promise?r.then(ax):ax(r)}});function ax(e){return e.value=Object.freeze(e.value),e}const cT=X("$ZodCustom",(e,t)=>{Sn.init(e,t),vt.init(e,t),e._zod.parse=(s,a)=>s,e._zod.check=s=>{const a=s.value,r=t.fn(a);if(r instanceof Promise)return r.then(c=>rx(c,s,a,e));rx(r,s,a,e)}});function rx(e,t,s,a){if(!e){const r={code:"custom",input:s,inst:a,path:[...a._zod.def.path??[]],continue:!a._zod.def.abort};a._zod.def.params&&(r.params=a._zod.def.params),t.issues.push(el(r))}}var ox;class uT{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...s){const a=s[0];return this._map.set(t,a),a&&typeof a=="object"&&"id"in a&&this._idmap.set(a.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const s=this._map.get(t);return s&&typeof s=="object"&&"id"in s&&this._idmap.delete(s.id),this._map.delete(t),this}get(t){const s=t._zod.parent;if(s){const a={...this.get(s)??{}};delete a.id;const r={...a,...this._map.get(t)};return Object.keys(r).length?r:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function dT(){return new uT}(ox=globalThis).__zod_globalRegistry??(ox.__zod_globalRegistry=dT());const $o=globalThis.__zod_globalRegistry;function fT(e,t){return new e({type:"string",...Se(t)})}function hT(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Se(t)})}function lx(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Se(t)})}function mT(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Se(t)})}function pT(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Se(t)})}function gT(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Se(t)})}function yT(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Se(t)})}function vT(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Se(t)})}function bT(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Se(t)})}function xT(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Se(t)})}function ST(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Se(t)})}function wT(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Se(t)})}function jT(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Se(t)})}function NT(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Se(t)})}function _T(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Se(t)})}function CT(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Se(t)})}function kT(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Se(t)})}function zT(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Se(t)})}function ET(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Se(t)})}function OT(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Se(t)})}function RT(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Se(t)})}function AT(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Se(t)})}function TT(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Se(t)})}function DT(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Se(t)})}function LT(e,t){return new e({type:"string",format:"date",check:"string_format",...Se(t)})}function MT(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Se(t)})}function UT(e,t){return new e({type:"string",format:"duration",check:"string_format",...Se(t)})}function $T(e,t){return new e({type:"number",checks:[],...Se(t)})}function PT(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Se(t)})}function IT(e,t){return new e({type:"boolean",...Se(t)})}function BT(e){return new e({type:"unknown"})}function qT(e,t){return new e({type:"never",...Se(t)})}function cx(e,t){return new qw({check:"less_than",...Se(t),value:e,inclusive:!1})}function Hh(e,t){return new qw({check:"less_than",...Se(t),value:e,inclusive:!0})}function ux(e,t){return new Hw({check:"greater_than",...Se(t),value:e,inclusive:!1})}function Zh(e,t){return new Hw({check:"greater_than",...Se(t),value:e,inclusive:!0})}function dx(e,t){return new sA({check:"multiple_of",...Se(t),value:e})}function Qw(e,t){return new aA({check:"max_length",...Se(t),maximum:e})}function wu(e,t){return new rA({check:"min_length",...Se(t),minimum:e})}function Yw(e,t){return new oA({check:"length_equals",...Se(t),length:e})}function HT(e,t){return new lA({check:"string_format",format:"regex",...Se(t),pattern:e})}function ZT(e){return new cA({check:"string_format",format:"lowercase",...Se(e)})}function FT(e){return new uA({check:"string_format",format:"uppercase",...Se(e)})}function GT(e,t){return new dA({check:"string_format",format:"includes",...Se(t),includes:e})}function KT(e,t){return new fA({check:"string_format",format:"starts_with",...Se(t),prefix:e})}function VT(e,t){return new hA({check:"string_format",format:"ends_with",...Se(t),suffix:e})}function Lr(e){return new mA({check:"overwrite",tx:e})}function QT(e){return Lr(t=>t.normalize(e))}function YT(){return Lr(e=>e.trim())}function XT(){return Lr(e=>e.toLowerCase())}function JT(){return Lr(e=>e.toUpperCase())}function WT(){return Lr(e=>lR(e))}function eD(e,t,s){return new e({type:"array",element:t,...Se(s)})}function tD(e,t,s){return new e({type:"custom",check:"custom",fn:t,...Se(s)})}function nD(e){const t=sD(s=>(s.addIssue=a=>{if(typeof a=="string")s.issues.push(el(a,s.value,t._zod.def));else{const r=a;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=s.value),r.inst??(r.inst=t),r.continue??(r.continue=!t._zod.def.abort),s.issues.push(el(r))}},e(s.value,s)));return t}function sD(e,t){const s=new Sn({check:"custom",...Se(t)});return s._zod.check=e,s}function Xw(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??$o,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 Bt(e,t,s={path:[],schemaPath:[]}){var a;const r=e._zod.def,c=t.seen.get(e);if(c)return c.count++,s.schemaPath.includes(e)&&(c.cycle=s.path),c.schema;const d={schema:{},count:1,cycle:void 0,path:s.path};t.seen.set(e,d);const f=e._zod.toJSONSchema?.();if(f)d.schema=f;else{const v={...s,schemaPath:[...s.schemaPath,e],path:s.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,d.schema,v);else{const b=d.schema,x=t.processors[r.type];if(!x)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${r.type}`);x(e,t,b,v)}const y=e._zod.parent;y&&(d.ref||(d.ref=y),Bt(y,t,v),t.seen.get(y).isParent=!0)}const p=t.metadataRegistry.get(e);return p&&Object.assign(d.schema,p),t.io==="input"&&on(e)&&(delete d.schema.examples,delete d.schema.default),t.io==="input"&&d.schema._prefault&&((a=d.schema).default??(a.default=d.schema._prefault)),delete d.schema._prefault,t.seen.get(e).schema}function Jw(e,t){const s=e.seen.get(t);if(!s)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=new Map;for(const d of e.seen.entries()){const f=e.metadataRegistry.get(d[0])?.id;if(f){const p=a.get(f);if(p&&p!==d[0])throw new Error(`Duplicate schema id "${f}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);a.set(f,d[0])}}const r=d=>{const f=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const y=e.external.registry.get(d[0])?.id,b=e.external.uri??(j=>j);if(y)return{ref:b(y)};const x=d[1].defId??d[1].schema.id??`schema${e.counter++}`;return d[1].defId=x,{defId:x,ref:`${b("__shared")}#/${f}/${x}`}}if(d[1]===s)return{ref:"#"};const m=`#/${f}/`,v=d[1].schema.id??`__schema${e.counter++}`;return{defId:v,ref:m+v}},c=d=>{if(d[1].schema.$ref)return;const f=d[1],{ref:p,defId:m}=r(d);f.def={...f.schema},m&&(f.defId=m);const v=f.schema;for(const y in v)delete v[y];v.$ref=p};if(e.cycles==="throw")for(const d of e.seen.entries()){const f=d[1];if(f.cycle)throw new Error(`Cycle detected: #/${f.cycle?.join("/")}/<root>
93
-
94
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const d of e.seen.entries()){const f=d[1];if(t===d[0]){c(d);continue}if(e.external){const m=e.external.registry.get(d[0])?.id;if(t!==d[0]&&m){c(d);continue}}if(e.metadataRegistry.get(d[0])?.id){c(d);continue}if(f.cycle){c(d);continue}if(f.count>1&&e.reused==="ref"){c(d);continue}}}function Ww(e,t){const s=e.seen.get(t);if(!s)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=d=>{const f=e.seen.get(d);if(f.ref===null)return;const p=f.def??f.schema,m={...p},v=f.ref;if(f.ref=null,v){a(v);const b=e.seen.get(v),x=b.schema;if(x.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(p.allOf=p.allOf??[],p.allOf.push(x)):Object.assign(p,x),Object.assign(p,m),d._zod.parent===v)for(const w in p)w==="$ref"||w==="allOf"||w in m||delete p[w];if(x.$ref&&b.def)for(const w in p)w==="$ref"||w==="allOf"||w in b.def&&JSON.stringify(p[w])===JSON.stringify(b.def[w])&&delete p[w]}const y=d._zod.parent;if(y&&y!==v){a(y);const b=e.seen.get(y);if(b?.schema.$ref&&(p.$ref=b.schema.$ref,b.def))for(const x in p)x==="$ref"||x==="allOf"||x in b.def&&JSON.stringify(p[x])===JSON.stringify(b.def[x])&&delete p[x]}e.override({zodSchema:d,jsonSchema:p,path:f.path??[]})};for(const d of[...e.seen.entries()].reverse())a(d[0]);const r={};if(e.target==="draft-2020-12"?r.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?r.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?r.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const d=e.external.registry.get(t)?.id;if(!d)throw new Error("Schema is missing an `id` property");r.$id=e.external.uri(d)}Object.assign(r,s.def??s.schema);const c=e.external?.defs??{};for(const d of e.seen.entries()){const f=d[1];f.def&&f.defId&&(c[f.defId]=f.def)}e.external||Object.keys(c).length>0&&(e.target==="draft-2020-12"?r.$defs=c:r.definitions=c);try{const d=JSON.parse(JSON.stringify(r));return Object.defineProperty(d,"~standard",{value:{...t["~standard"],jsonSchema:{input:ju(t,"input",e.processors),output:ju(t,"output",e.processors)}},enumerable:!1,writable:!1}),d}catch{throw new Error("Error converting schema to JSON.")}}function on(e,t){const s=t??{seen:new Set};if(s.seen.has(e))return!1;s.seen.add(e);const a=e._zod.def;if(a.type==="transform")return!0;if(a.type==="array")return on(a.element,s);if(a.type==="set")return on(a.valueType,s);if(a.type==="lazy")return on(a.getter(),s);if(a.type==="promise"||a.type==="optional"||a.type==="nonoptional"||a.type==="nullable"||a.type==="readonly"||a.type==="default"||a.type==="prefault")return on(a.innerType,s);if(a.type==="intersection")return on(a.left,s)||on(a.right,s);if(a.type==="record"||a.type==="map")return on(a.keyType,s)||on(a.valueType,s);if(a.type==="pipe")return on(a.in,s)||on(a.out,s);if(a.type==="object"){for(const r in a.shape)if(on(a.shape[r],s))return!0;return!1}if(a.type==="union"){for(const r of a.options)if(on(r,s))return!0;return!1}if(a.type==="tuple"){for(const r of a.items)if(on(r,s))return!0;return!!(a.rest&&on(a.rest,s))}return!1}const iD=(e,t={})=>s=>{const a=Xw({...s,processors:t});return Bt(e,a),Jw(a,e),Ww(a,e)},ju=(e,t,s={})=>a=>{const{libraryOptions:r,target:c}=a??{},d=Xw({...r??{},target:c,io:t,processors:s});return Bt(e,d),Jw(d,e),Ww(d,e)},aD={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},rD=(e,t,s,a)=>{const r=s;r.type="string";const{minimum:c,maximum:d,format:f,patterns:p,contentEncoding:m}=e._zod.bag;if(typeof c=="number"&&(r.minLength=c),typeof d=="number"&&(r.maxLength=d),f&&(r.format=aD[f]??f,r.format===""&&delete r.format,f==="time"&&delete r.format),m&&(r.contentEncoding=m),p&&p.size>0){const v=[...p];v.length===1?r.pattern=v[0].source:v.length>1&&(r.allOf=[...v.map(y=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:y.source}))])}},oD=(e,t,s,a)=>{const r=s,{minimum:c,maximum:d,format:f,multipleOf:p,exclusiveMaximum:m,exclusiveMinimum:v}=e._zod.bag;typeof f=="string"&&f.includes("int")?r.type="integer":r.type="number",typeof v=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(r.minimum=v,r.exclusiveMinimum=!0):r.exclusiveMinimum=v),typeof c=="number"&&(r.minimum=c,typeof v=="number"&&t.target!=="draft-04"&&(v>=c?delete r.minimum:delete r.exclusiveMinimum)),typeof m=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(r.maximum=m,r.exclusiveMaximum=!0):r.exclusiveMaximum=m),typeof d=="number"&&(r.maximum=d,typeof m=="number"&&t.target!=="draft-04"&&(m<=d?delete r.maximum:delete r.exclusiveMaximum)),typeof p=="number"&&(r.multipleOf=p)},lD=(e,t,s,a)=>{s.type="boolean"},cD=(e,t,s,a)=>{s.not={}},uD=(e,t,s,a)=>{},dD=(e,t,s,a)=>{const r=e._zod.def,c=Rw(r.entries);c.every(d=>typeof d=="number")&&(s.type="number"),c.every(d=>typeof d=="string")&&(s.type="string"),s.enum=c},fD=(e,t,s,a)=>{const r=e._zod.def,c=[];for(const d of r.values)if(d===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof d=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");c.push(Number(d))}else c.push(d);if(c.length!==0)if(c.length===1){const d=c[0];s.type=d===null?"null":typeof d,t.target==="draft-04"||t.target==="openapi-3.0"?s.enum=[d]:s.const=d}else c.every(d=>typeof d=="number")&&(s.type="number"),c.every(d=>typeof d=="string")&&(s.type="string"),c.every(d=>typeof d=="boolean")&&(s.type="boolean"),c.every(d=>d===null)&&(s.type="null"),s.enum=c},hD=(e,t,s,a)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},mD=(e,t,s,a)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},pD=(e,t,s,a)=>{const r=s,c=e._zod.def,{minimum:d,maximum:f}=e._zod.bag;typeof d=="number"&&(r.minItems=d),typeof f=="number"&&(r.maxItems=f),r.type="array",r.items=Bt(c.element,t,{...a,path:[...a.path,"items"]})},gD=(e,t,s,a)=>{const r=s,c=e._zod.def;r.type="object",r.properties={};const d=c.shape;for(const m in d)r.properties[m]=Bt(d[m],t,{...a,path:[...a.path,"properties",m]});const f=new Set(Object.keys(d)),p=new Set([...f].filter(m=>{const v=c.shape[m]._zod;return t.io==="input"?v.optin===void 0:v.optout===void 0}));p.size>0&&(r.required=Array.from(p)),c.catchall?._zod.def.type==="never"?r.additionalProperties=!1:c.catchall?c.catchall&&(r.additionalProperties=Bt(c.catchall,t,{...a,path:[...a.path,"additionalProperties"]})):t.io==="output"&&(r.additionalProperties=!1)},yD=(e,t,s,a)=>{const r=e._zod.def,c=r.inclusive===!1,d=r.options.map((f,p)=>Bt(f,t,{...a,path:[...a.path,c?"oneOf":"anyOf",p]}));c?s.oneOf=d:s.anyOf=d},vD=(e,t,s,a)=>{const r=e._zod.def,c=Bt(r.left,t,{...a,path:[...a.path,"allOf",0]}),d=Bt(r.right,t,{...a,path:[...a.path,"allOf",1]}),f=m=>"allOf"in m&&Object.keys(m).length===1,p=[...f(c)?c.allOf:[c],...f(d)?d.allOf:[d]];s.allOf=p},bD=(e,t,s,a)=>{const r=s,c=e._zod.def;r.type="object";const d=c.keyType,p=d._zod.bag?.patterns;if(c.mode==="loose"&&p&&p.size>0){const v=Bt(c.valueType,t,{...a,path:[...a.path,"patternProperties","*"]});r.patternProperties={};for(const y of p)r.patternProperties[y.source]=v}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(r.propertyNames=Bt(c.keyType,t,{...a,path:[...a.path,"propertyNames"]})),r.additionalProperties=Bt(c.valueType,t,{...a,path:[...a.path,"additionalProperties"]});const m=d._zod.values;if(m){const v=[...m].filter(y=>typeof y=="string"||typeof y=="number");v.length>0&&(r.required=v)}},xD=(e,t,s,a)=>{const r=e._zod.def,c=Bt(r.innerType,t,a),d=t.seen.get(e);t.target==="openapi-3.0"?(d.ref=r.innerType,s.nullable=!0):s.anyOf=[c,{type:"null"}]},SD=(e,t,s,a)=>{const r=e._zod.def;Bt(r.innerType,t,a);const c=t.seen.get(e);c.ref=r.innerType},wD=(e,t,s,a)=>{const r=e._zod.def;Bt(r.innerType,t,a);const c=t.seen.get(e);c.ref=r.innerType,s.default=JSON.parse(JSON.stringify(r.defaultValue))},jD=(e,t,s,a)=>{const r=e._zod.def;Bt(r.innerType,t,a);const c=t.seen.get(e);c.ref=r.innerType,t.io==="input"&&(s._prefault=JSON.parse(JSON.stringify(r.defaultValue)))},ND=(e,t,s,a)=>{const r=e._zod.def;Bt(r.innerType,t,a);const c=t.seen.get(e);c.ref=r.innerType;let d;try{d=r.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}s.default=d},_D=(e,t,s,a)=>{const r=e._zod.def,c=t.io==="input"?r.in._zod.def.type==="transform"?r.out:r.in:r.out;Bt(c,t,a);const d=t.seen.get(e);d.ref=c},CD=(e,t,s,a)=>{const r=e._zod.def;Bt(r.innerType,t,a);const c=t.seen.get(e);c.ref=r.innerType,s.readOnly=!0},ej=(e,t,s,a)=>{const r=e._zod.def;Bt(r.innerType,t,a);const c=t.seen.get(e);c.ref=r.innerType},kD=X("ZodISODateTime",(e,t)=>{zA.init(e,t),xt.init(e,t)});function zD(e){return DT(kD,e)}const ED=X("ZodISODate",(e,t)=>{EA.init(e,t),xt.init(e,t)});function OD(e){return LT(ED,e)}const RD=X("ZodISOTime",(e,t)=>{OA.init(e,t),xt.init(e,t)});function AD(e){return MT(RD,e)}const TD=X("ZodISODuration",(e,t)=>{RA.init(e,t),xt.init(e,t)});function DD(e){return UT(TD,e)}const LD=(e,t)=>{Lw.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:s=>SR(e,s)},flatten:{value:s=>xR(e,s)},addIssue:{value:s=>{e.issues.push(s),e.message=JSON.stringify(e.issues,gm,2)}},addIssues:{value:s=>{e.issues.push(...s),e.message=JSON.stringify(e.issues,gm,2)}},isEmpty:{get(){return e.issues.length===0}}})},Vn=X("ZodError",LD,{Parent:Error}),MD=mp(Vn),UD=pp(Vn),$D=qu(Vn),PD=Hu(Vn),ID=NR(Vn),BD=_R(Vn),qD=CR(Vn),HD=kR(Vn),ZD=zR(Vn),FD=ER(Vn),GD=OR(Vn),KD=RR(Vn),bt=X("ZodType",(e,t)=>(vt.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:ju(e,"input"),output:ju(e,"output")}}),e.toJSONSchema=iD(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...s)=>e.clone(Ii(t,{checks:[...t.checks??[],...s.map(a=>typeof a=="function"?{_zod:{check:a,def:{check:"custom"},onattach:[]}}:a)]}),{parent:!0}),e.with=e.check,e.clone=(s,a)=>Bi(e,s,a),e.brand=()=>e,e.register=((s,a)=>(s.add(e,a),e)),e.parse=(s,a)=>MD(e,s,a,{callee:e.parse}),e.safeParse=(s,a)=>$D(e,s,a),e.parseAsync=async(s,a)=>UD(e,s,a,{callee:e.parseAsync}),e.safeParseAsync=async(s,a)=>PD(e,s,a),e.spa=e.safeParseAsync,e.encode=(s,a)=>ID(e,s,a),e.decode=(s,a)=>BD(e,s,a),e.encodeAsync=async(s,a)=>qD(e,s,a),e.decodeAsync=async(s,a)=>HD(e,s,a),e.safeEncode=(s,a)=>ZD(e,s,a),e.safeDecode=(s,a)=>FD(e,s,a),e.safeEncodeAsync=async(s,a)=>GD(e,s,a),e.safeDecodeAsync=async(s,a)=>KD(e,s,a),e.refine=(s,a)=>e.check(BL(s,a)),e.superRefine=s=>e.check(qL(s)),e.overwrite=s=>e.check(Lr(s)),e.optional=()=>mx(e),e.exactOptional=()=>zL(e),e.nullable=()=>px(e),e.nullish=()=>mx(px(e)),e.nonoptional=s=>DL(e,s),e.array=()=>dt(e),e.or=s=>xL([e,s]),e.and=s=>wL(e,s),e.transform=s=>gx(e,CL(s)),e.default=s=>RL(e,s),e.prefault=s=>TL(e,s),e.catch=s=>ML(e,s),e.pipe=s=>gx(e,s),e.readonly=()=>PL(e),e.describe=s=>{const a=e.clone();return $o.add(a,{description:s}),a},Object.defineProperty(e,"description",{get(){return $o.get(e)?.description},configurable:!0}),e.meta=(...s)=>{if(s.length===0)return $o.get(e);const a=e.clone();return $o.add(a,s[0]),a},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=s=>s(e),e)),tj=X("_ZodString",(e,t)=>{gp.init(e,t),bt.init(e,t),e._zod.processJSONSchema=(a,r,c)=>rD(e,a,r);const s=e._zod.bag;e.format=s.format??null,e.minLength=s.minimum??null,e.maxLength=s.maximum??null,e.regex=(...a)=>e.check(HT(...a)),e.includes=(...a)=>e.check(GT(...a)),e.startsWith=(...a)=>e.check(KT(...a)),e.endsWith=(...a)=>e.check(VT(...a)),e.min=(...a)=>e.check(wu(...a)),e.max=(...a)=>e.check(Qw(...a)),e.length=(...a)=>e.check(Yw(...a)),e.nonempty=(...a)=>e.check(wu(1,...a)),e.lowercase=a=>e.check(ZT(a)),e.uppercase=a=>e.check(FT(a)),e.trim=()=>e.check(YT()),e.normalize=(...a)=>e.check(QT(...a)),e.toLowerCase=()=>e.check(XT()),e.toUpperCase=()=>e.check(JT()),e.slugify=()=>e.check(WT())}),VD=X("ZodString",(e,t)=>{gp.init(e,t),tj.init(e,t),e.email=s=>e.check(hT(QD,s)),e.url=s=>e.check(vT(YD,s)),e.jwt=s=>e.check(TT(dL,s)),e.emoji=s=>e.check(bT(XD,s)),e.guid=s=>e.check(lx(fx,s)),e.uuid=s=>e.check(mT(Hc,s)),e.uuidv4=s=>e.check(pT(Hc,s)),e.uuidv6=s=>e.check(gT(Hc,s)),e.uuidv7=s=>e.check(yT(Hc,s)),e.nanoid=s=>e.check(xT(JD,s)),e.guid=s=>e.check(lx(fx,s)),e.cuid=s=>e.check(ST(WD,s)),e.cuid2=s=>e.check(wT(eL,s)),e.ulid=s=>e.check(jT(tL,s)),e.base64=s=>e.check(OT(lL,s)),e.base64url=s=>e.check(RT(cL,s)),e.xid=s=>e.check(NT(nL,s)),e.ksuid=s=>e.check(_T(sL,s)),e.ipv4=s=>e.check(CT(iL,s)),e.ipv6=s=>e.check(kT(aL,s)),e.cidrv4=s=>e.check(zT(rL,s)),e.cidrv6=s=>e.check(ET(oL,s)),e.e164=s=>e.check(AT(uL,s)),e.datetime=s=>e.check(zD(s)),e.date=s=>e.check(OD(s)),e.time=s=>e.check(AD(s)),e.duration=s=>e.check(DD(s))});function W(e){return fT(VD,e)}const xt=X("ZodStringFormat",(e,t)=>{gt.init(e,t),tj.init(e,t)}),QD=X("ZodEmail",(e,t)=>{bA.init(e,t),xt.init(e,t)}),fx=X("ZodGUID",(e,t)=>{yA.init(e,t),xt.init(e,t)}),Hc=X("ZodUUID",(e,t)=>{vA.init(e,t),xt.init(e,t)}),YD=X("ZodURL",(e,t)=>{xA.init(e,t),xt.init(e,t)}),XD=X("ZodEmoji",(e,t)=>{SA.init(e,t),xt.init(e,t)}),JD=X("ZodNanoID",(e,t)=>{wA.init(e,t),xt.init(e,t)}),WD=X("ZodCUID",(e,t)=>{jA.init(e,t),xt.init(e,t)}),eL=X("ZodCUID2",(e,t)=>{NA.init(e,t),xt.init(e,t)}),tL=X("ZodULID",(e,t)=>{_A.init(e,t),xt.init(e,t)}),nL=X("ZodXID",(e,t)=>{CA.init(e,t),xt.init(e,t)}),sL=X("ZodKSUID",(e,t)=>{kA.init(e,t),xt.init(e,t)}),iL=X("ZodIPv4",(e,t)=>{AA.init(e,t),xt.init(e,t)}),aL=X("ZodIPv6",(e,t)=>{TA.init(e,t),xt.init(e,t)}),rL=X("ZodCIDRv4",(e,t)=>{DA.init(e,t),xt.init(e,t)}),oL=X("ZodCIDRv6",(e,t)=>{LA.init(e,t),xt.init(e,t)}),lL=X("ZodBase64",(e,t)=>{MA.init(e,t),xt.init(e,t)}),cL=X("ZodBase64URL",(e,t)=>{$A.init(e,t),xt.init(e,t)}),uL=X("ZodE164",(e,t)=>{PA.init(e,t),xt.init(e,t)}),dL=X("ZodJWT",(e,t)=>{BA.init(e,t),xt.init(e,t)}),nj=X("ZodNumber",(e,t)=>{Fw.init(e,t),bt.init(e,t),e._zod.processJSONSchema=(a,r,c)=>oD(e,a,r),e.gt=(a,r)=>e.check(ux(a,r)),e.gte=(a,r)=>e.check(Zh(a,r)),e.min=(a,r)=>e.check(Zh(a,r)),e.lt=(a,r)=>e.check(cx(a,r)),e.lte=(a,r)=>e.check(Hh(a,r)),e.max=(a,r)=>e.check(Hh(a,r)),e.int=a=>e.check(hx(a)),e.safe=a=>e.check(hx(a)),e.positive=a=>e.check(ux(0,a)),e.nonnegative=a=>e.check(Zh(0,a)),e.negative=a=>e.check(cx(0,a)),e.nonpositive=a=>e.check(Hh(0,a)),e.multipleOf=(a,r)=>e.check(dx(a,r)),e.step=(a,r)=>e.check(dx(a,r)),e.finite=()=>e;const s=e._zod.bag;e.minValue=Math.max(s.minimum??Number.NEGATIVE_INFINITY,s.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(s.maximum??Number.POSITIVE_INFINITY,s.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(s.format??"").includes("int")||Number.isSafeInteger(s.multipleOf??.5),e.isFinite=!0,e.format=s.format??null});function Jt(e){return $T(nj,e)}const fL=X("ZodNumberFormat",(e,t)=>{qA.init(e,t),nj.init(e,t)});function hx(e){return PT(fL,e)}const hL=X("ZodBoolean",(e,t)=>{HA.init(e,t),bt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>lD(e,s,a)});function yp(e){return IT(hL,e)}const mL=X("ZodUnknown",(e,t)=>{ZA.init(e,t),bt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>uD()});function vm(){return BT(mL)}const pL=X("ZodNever",(e,t)=>{FA.init(e,t),bt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>cD(e,s,a)});function gL(e){return qT(pL,e)}const yL=X("ZodArray",(e,t)=>{GA.init(e,t),bt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>pD(e,s,a,r),e.element=t.element,e.min=(s,a)=>e.check(wu(s,a)),e.nonempty=s=>e.check(wu(1,s)),e.max=(s,a)=>e.check(Qw(s,a)),e.length=(s,a)=>e.check(Yw(s,a)),e.unwrap=()=>e.element});function dt(e,t){return eD(yL,e,t)}const vL=X("ZodObject",(e,t)=>{VA.init(e,t),bt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>gD(e,s,a,r),We(e,"shape",()=>t.shape),e.keyof=()=>xn(Object.keys(e._zod.def.shape)),e.catchall=s=>e.clone({...e._zod.def,catchall:s}),e.passthrough=()=>e.clone({...e._zod.def,catchall:vm()}),e.loose=()=>e.clone({...e._zod.def,catchall:vm()}),e.strict=()=>e.clone({...e._zod.def,catchall:gL()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=s=>pR(e,s),e.safeExtend=s=>gR(e,s),e.merge=s=>yR(e,s),e.pick=s=>hR(e,s),e.omit=s=>mR(e,s),e.partial=(...s)=>vR(sj,e,s[0]),e.required=(...s)=>bR(ij,e,s[0])});function rt(e,t){const s={type:"object",shape:e??{},...Se(t)};return new vL(s)}const bL=X("ZodUnion",(e,t)=>{QA.init(e,t),bt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>yD(e,s,a,r),e.options=t.options});function xL(e,t){return new bL({type:"union",options:e,...Se(t)})}const SL=X("ZodIntersection",(e,t)=>{YA.init(e,t),bt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>vD(e,s,a,r)});function wL(e,t){return new SL({type:"intersection",left:e,right:t})}const jL=X("ZodRecord",(e,t)=>{XA.init(e,t),bt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>bD(e,s,a,r),e.keyType=t.keyType,e.valueType=t.valueType});function vp(e,t,s){return new jL({type:"record",keyType:e,valueType:t,...Se(s)})}const bm=X("ZodEnum",(e,t)=>{JA.init(e,t),bt.init(e,t),e._zod.processJSONSchema=(a,r,c)=>dD(e,a,r),e.enum=t.entries,e.options=Object.values(t.entries);const s=new Set(Object.keys(t.entries));e.extract=(a,r)=>{const c={};for(const d of a)if(s.has(d))c[d]=t.entries[d];else throw new Error(`Key ${d} not found in enum`);return new bm({...t,checks:[],...Se(r),entries:c})},e.exclude=(a,r)=>{const c={...t.entries};for(const d of a)if(s.has(d))delete c[d];else throw new Error(`Key ${d} not found in enum`);return new bm({...t,checks:[],...Se(r),entries:c})}});function xn(e,t){const s=Array.isArray(e)?Object.fromEntries(e.map(a=>[a,a])):e;return new bm({type:"enum",entries:s,...Se(t)})}const NL=X("ZodLiteral",(e,t)=>{WA.init(e,t),bt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>fD(e,s,a),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 Nu(e,t){return new NL({type:"literal",values:Array.isArray(e)?e:[e],...Se(t)})}const _L=X("ZodTransform",(e,t)=>{eT.init(e,t),bt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>mD(e,s),e._zod.parse=(s,a)=>{if(a.direction==="backward")throw new Ew(e.constructor.name);s.addIssue=c=>{if(typeof c=="string")s.issues.push(el(c,s.value,t));else{const d=c;d.fatal&&(d.continue=!1),d.code??(d.code="custom"),d.input??(d.input=s.value),d.inst??(d.inst=e),s.issues.push(el(d))}};const r=t.transform(s.value,s);return r instanceof Promise?r.then(c=>(s.value=c,s)):(s.value=r,s)}});function CL(e){return new _L({type:"transform",transform:e})}const sj=X("ZodOptional",(e,t)=>{Vw.init(e,t),bt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>ej(e,s,a,r),e.unwrap=()=>e._zod.def.innerType});function mx(e){return new sj({type:"optional",innerType:e})}const kL=X("ZodExactOptional",(e,t)=>{tT.init(e,t),bt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>ej(e,s,a,r),e.unwrap=()=>e._zod.def.innerType});function zL(e){return new kL({type:"optional",innerType:e})}const EL=X("ZodNullable",(e,t)=>{nT.init(e,t),bt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>xD(e,s,a,r),e.unwrap=()=>e._zod.def.innerType});function px(e){return new EL({type:"nullable",innerType:e})}const OL=X("ZodDefault",(e,t)=>{sT.init(e,t),bt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>wD(e,s,a,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function RL(e,t){return new OL({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Tw(t)}})}const AL=X("ZodPrefault",(e,t)=>{iT.init(e,t),bt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>jD(e,s,a,r),e.unwrap=()=>e._zod.def.innerType});function TL(e,t){return new AL({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Tw(t)}})}const ij=X("ZodNonOptional",(e,t)=>{aT.init(e,t),bt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>SD(e,s,a,r),e.unwrap=()=>e._zod.def.innerType});function DL(e,t){return new ij({type:"nonoptional",innerType:e,...Se(t)})}const LL=X("ZodCatch",(e,t)=>{rT.init(e,t),bt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>ND(e,s,a,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function ML(e,t){return new LL({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const UL=X("ZodPipe",(e,t)=>{oT.init(e,t),bt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>_D(e,s,a,r),e.in=t.in,e.out=t.out});function gx(e,t){return new UL({type:"pipe",in:e,out:t})}const $L=X("ZodReadonly",(e,t)=>{lT.init(e,t),bt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>CD(e,s,a,r),e.unwrap=()=>e._zod.def.innerType});function PL(e){return new $L({type:"readonly",innerType:e})}const IL=X("ZodCustom",(e,t)=>{cT.init(e,t),bt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>hD(e,s)});function BL(e,t={}){return tD(IL,e,t)}function qL(e){return nD(e)}rt({maxConcurrency:Jt().int().positive(),maxRequestsPerMinute:Jt().int().positive(),maxRequestsPerDay:Jt().int().positive()});const HL=["gemini","openai","claude","local","cdp:chatgpt"],Fu=xn(HL),aj=rt({label:W().min(1),city:W().min(1),region:W().min(1),country:W().length(2),timezone:W().optional()}),rj=xn(["citation.lost","citation.gained","run.completed","run.failed"]);rt({id:W(),projectId:W(),channel:Nu("webhook"),url:W().url(),events:dt(rj),enabled:yp().default(!0),webhookSecret:W().optional(),createdAt:W(),updatedAt:W()});const ZL=rt({name:W().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:vp(W(),W()).optional().default({})}),FL=rt({preset:W().optional(),cron:W().optional(),timezone:W().optional().default("UTC"),providers:dt(Fu).optional().default([])}).refine(e=>e.preset&&!e.cron||!e.preset&&e.cron,{message:'Exactly one of "preset" or "cron" must be provided'}).optional(),GL=rt({channel:Nu("webhook"),url:W().url(),events:dt(rj).min(1)}),KL=rt({gsc:rt({propertyUrl:W()}).optional(),syncSchedule:rt({preset:W().optional(),cron:W().optional()}).optional()}).optional(),VL=rt({displayName:W().min(1),canonicalDomain:W().min(1),ownedDomains:dt(W().min(1)).optional().default([]),country:W().length(2),language:W().min(2),keywords:dt(W().min(1)).optional().default([]),competitors:dt(W().min(1)).optional().default([]),providers:dt(Fu).optional().default([]),locations:dt(aj).optional().default([]),defaultLocation:W().optional(),schedule:FL,notifications:dt(GL).optional().default([]),google:KL});rt({apiVersion:Nu("canonry/v1"),kind:Nu("Project"),metadata:ZL,spec:VL});const QL=xn(["gsc","ga4"]);rt({id:W(),domain:W(),connectionType:QL,propertyId:W().nullable().optional(),sitemapUrl:W().nullable().optional(),scopes:dt(W()).default([]),createdAt:W(),updatedAt:W()});rt({date:W(),query:W(),page:W(),country:W().nullable().optional(),device:W().nullable().optional(),clicks:Jt(),impressions:Jt(),ctr:Jt(),position:Jt()});const xm=rt({id:W(),url:W(),indexingState:W().nullable().optional(),verdict:W().nullable().optional(),coverageState:W().nullable().optional(),pageFetchState:W().nullable().optional(),robotsTxtState:W().nullable().optional(),crawlTime:W().nullable().optional(),lastCrawlResult:W().nullable().optional(),isMobileFriendly:yp().nullable().optional(),richResults:dt(W()).default([]),inspectedAt:W()});xn(["stable","reindexed","deindexed","still-missing","new"]);const YL=rt({url:W(),previousState:W().nullable(),currentState:W().nullable(),transitionDate:W()}),XL=rt({reason:W(),count:Jt(),urls:dt(xm).default([])});rt({summary:rt({total:Jt(),indexed:Jt(),notIndexed:Jt(),deindexed:Jt(),percentage:Jt()}),lastInspectedAt:W().nullable(),indexed:dt(xm).default([]),notIndexed:dt(xm).default([]),deindexed:dt(YL).default([]),reasonGroups:dt(XL).default([])});rt({url:W(),type:xn(["URL_UPDATED","URL_DELETED"]),notifiedAt:W()});rt({url:W(),type:xn(["URL_UPDATED","URL_DELETED"]),notifiedAt:W(),status:xn(["success","error"]),error:W().optional()});rt({date:W(),indexed:Jt(),notIndexed:Jt(),reasonBreakdown:vp(W(),Jt()).default({})});const JL=xn(["cli","api","config-file"]);rt({id:W(),name:W(),displayName:W().optional(),canonicalDomain:W(),ownedDomains:dt(W()).default([]),country:W().length(2),language:W().min(2),tags:dt(W()).default([]),labels:vp(W(),W()).default({}),locations:dt(aj).default([]),defaultLocation:W().nullable().optional(),configSource:JL.default("cli"),configRevision:Jt().int().positive().default(1),createdAt:W().optional(),updatedAt:W().optional()});function Sm(e){let t=e.trim().toLowerCase();try{t.includes("://")&&(t=new URL(t).hostname.toLowerCase())}catch{}return t.replace(/^www\./,"")}function WL(e){const t=[e.canonicalDomain,...e.ownedDomains??[]],s=new Set,a=[];for(const r of t){const c=r.trim();if(!c)continue;const d=Sm(c);s.has(d)||(s.add(d),a.push(c))}return a}const eM=xn(["queued","running","completed","partial","failed"]),tM=xn(["answer-visibility","site-audit","gsc-sync","inspect-sitemap"]),nM=xn(["manual","scheduled","config-apply"]),sM=xn(["cited","not-cited"]),iM=xn(["new","cited","lost","emerging","not-cited"]);rt({id:W(),projectId:W(),kind:tM,status:eM,trigger:nM.default("manual"),location:W().nullable().optional(),startedAt:W().nullable().optional(),finishedAt:W().nullable().optional(),error:W().nullable().optional(),createdAt:W()});const aM=rt({uri:W(),title:W()});rt({id:W(),runId:W(),keywordId:W(),keyword:W().optional(),provider:Fu,citationState:sM,transition:iM.optional(),answerText:W().nullable().optional(),citedDomains:dt(W()).default([]),competitorOverlap:dt(W()).default([]),groundingSources:dt(aM).default([]),searchQueries:dt(W()).default([]),model:W().nullable().optional(),location:W().nullable().optional(),createdAt:W()});rt({id:W(),projectId:W().nullable().optional(),actor:W(),action:W(),entityType:W(),entityId:W().nullable().optional(),diff:vm().optional(),createdAt:W()});rt({id:W(),projectId:W(),cronExpr:W(),preset:W().nullable().optional(),timezone:W().default("UTC"),enabled:yp().default(!0),providers:dt(Fu).default([]),lastRunAt:W().nullable().optional(),nextRunAt:W().nullable().optional(),createdAt:W(),updatedAt:W()});function wm({state:e}){return l.jsx(yt,{tone:xE(e),children:Uu(e)})}function yx(e,t){const s=t.filter(d=>d.trim().length>1),a=e.split(/(\*\*[^*]+\*\*)/).filter(Boolean).map(d=>d.startsWith("**")&&d.endsWith("**")?{type:"bold",value:d.slice(2,-2)}:{type:"text",value:d});if(s.length===0)return a.map((d,f)=>d.type==="bold"?ns.createElement("strong",{key:`b-${f}`,className:"text-zinc-200 font-semibold"},d.value):d.value).filter(Boolean);const r=s.map(d=>d.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),c=new RegExp(`(${r.join("|")})`,"gi");return a.flatMap((d,f)=>d.value.split(c).map((m,v)=>m?v%2===1?d.type==="bold"?ns.createElement("mark",{key:`hl-${f}-${v}`,className:"answer-highlight"},ns.createElement("strong",{className:"text-zinc-200 font-semibold"},m)):ns.createElement("mark",{key:`hl-${f}-${v}`,className:"answer-highlight"},m):d.type==="bold"?ns.createElement("strong",{key:`b-${f}-${v}`,className:"text-zinc-200 font-semibold"},m):m:null)).filter(Boolean)}class oj extends Error{code;statusCode;constructor(t,s,a){super(t),this.name="ApiError",this.code=a??"UNKNOWN",this.statusCode=s}}function rM(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,"")+"/api/v1":"/api/v1"}const oM=rM();function lM(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.apiKey?window.__CANONRY_CONFIG__.apiKey:""}async function Ne(e,t){const s=lM(),a=await fetch(`${oM}${e}`,{...t,headers:{"Content-Type":"application/json",...s?{Authorization:`Bearer ${s}`}:{},...t?.headers}});if(!a.ok){const r=await a.text();let c=`API ${a.status}: ${a.statusText}`,d;if(r)try{const f=JSON.parse(r);typeof f.error=="string"?c=f.error:f.error?.message?(c=f.error.message,d=f.error.code):f.message&&(c=f.message)}catch{c=r}throw new oj(c,a.status,d)}if(a.status!==204)return a.json()}function lj(){return Ne("/projects")}function bp(e){return Ne(`/projects/${encodeURIComponent(e)}`)}function cj(){return Ne("/runs")}function tl(e){return Ne(`/runs/${encodeURIComponent(e)}`)}function uj(e){return Ne(`/projects/${encodeURIComponent(e)}/keywords`)}function xp(e){return Ne(`/projects/${encodeURIComponent(e)}/competitors`)}function Sp(e,t){const s=new URLSearchParams;t!==void 0&&s.set("location",t);const a=s.toString();return Ne(`/projects/${encodeURIComponent(e)}/timeline${a?`?${a}`:""}`)}function al(e,t){return Ne(`/projects/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}function dj(e,t){return Ne(`/projects/${encodeURIComponent(e)}/keywords`,{method:"PUT",body:JSON.stringify({keywords:t})})}function fj(e,t){return Ne(`/projects/${encodeURIComponent(e)}/keywords`,{method:"POST",body:JSON.stringify({keywords:t})})}function wp(e,t){return Ne(`/projects/${encodeURIComponent(e)}/competitors`,{method:"PUT",body:JSON.stringify({competitors:t})})}async function jm(e,t){const s=await bp(e);return al(e,{displayName:s.displayName,canonicalDomain:s.canonicalDomain,ownedDomains:t,country:s.country,language:s.language,tags:s.tags,labels:s.labels,providers:s.providers,locations:s.locations,defaultLocation:s.defaultLocation})}async function hj(e,t){const s=await bp(e);return al(e,{displayName:t.displayName??s.displayName,canonicalDomain:t.canonicalDomain??s.canonicalDomain,ownedDomains:t.ownedDomains??s.ownedDomains,country:t.country??s.country,language:t.language??s.language,tags:s.tags,labels:s.labels,providers:s.providers,locations:t.locations??s.locations,defaultLocation:t.defaultLocation!==void 0?t.defaultLocation:s.defaultLocation})}function jp(e,t){const s={};return Ne(`/projects/${encodeURIComponent(e)}/runs`,{method:"POST",body:JSON.stringify(s)})}function mj(e,t){return Ne(`/projects/${encodeURIComponent(e)}/locations`,{method:"POST",body:JSON.stringify(t)})}async function pj(e,t){await Ne(`/projects/${encodeURIComponent(e)}/locations/${encodeURIComponent(t)}`,{method:"DELETE"})}function gj(e,t){return Ne(`/projects/${encodeURIComponent(e)}/locations/default`,{method:"PUT",body:JSON.stringify({label:t})})}async function yj(e){await Ne(`/projects/${encodeURIComponent(e)}`,{method:"DELETE",body:"{}"})}function vj(e){return Ne(`/projects/${encodeURIComponent(e)}/export`)}function Np(){return Ne("/settings")}function bj(e,t){return Ne(`/settings/providers/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}function xj(e){return Ne("/settings/google",{method:"PUT",body:JSON.stringify(e)})}async function Sj(e){try{return await Ne(`/projects/${encodeURIComponent(e)}/schedule`)}catch(t){if(t instanceof Error&&t.message.includes("404"))return null;throw t}}function Nm(e,t){return Ne(`/projects/${encodeURIComponent(e)}/schedule`,{method:"PUT",body:JSON.stringify(t)})}async function wj(e){await Ne(`/projects/${encodeURIComponent(e)}/schedule`,{method:"DELETE",body:"{}"})}function jj(e){return Ne(`/projects/${encodeURIComponent(e)}/notifications`)}function Nj(e,t){return Ne(`/projects/${encodeURIComponent(e)}/notifications`,{method:"POST",body:JSON.stringify(t)})}async function _j(e,t){await Ne(`/projects/${encodeURIComponent(e)}/notifications/${encodeURIComponent(t)}`,{method:"DELETE",body:"{}"})}function Cj(e,t){return Ne(`/projects/${encodeURIComponent(e)}/notifications/${encodeURIComponent(t)}/test`,{method:"POST",body:"{}"})}function kj(e,t,s){return Ne(`/projects/${encodeURIComponent(e)}/keywords/generate`,{method:"POST",body:JSON.stringify({provider:t,count:s})})}function zj(e){return Ne("/apply",{method:"POST",body:JSON.stringify(e)})}function cM(e){return Ne("/runs",{method:"POST",body:JSON.stringify(e??{})})}function Ej(e){return Ne(`/projects/${encodeURIComponent(e)}/google/connections`)}function Oj(e,t){return Ne(`/projects/${encodeURIComponent(e)}/google/connect`,{method:"POST",body:JSON.stringify({type:t})})}function Rj(e,t){return Ne(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}`,{method:"DELETE",body:"{}"})}function Aj(e){return Ne(`/projects/${encodeURIComponent(e)}/google/properties`)}function Tj(e,t,s){return Ne(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}/property`,{method:"PUT",body:JSON.stringify({propertyId:s})})}function Dj(e,t,s){return Ne(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}/sitemap`,{method:"PUT",body:JSON.stringify({sitemapUrl:s})})}function Lj(e,t){return Ne(`/projects/${encodeURIComponent(e)}/google/gsc/sync`,{method:"POST",body:JSON.stringify(t??{})})}function Mj(e,t){const s=new URLSearchParams;t?.startDate&&s.set("startDate",t.startDate),t?.endDate&&s.set("endDate",t.endDate),t?.query&&s.set("query",t.query),t?.page&&s.set("page",t.page),t?.limit!==void 0&&s.set("limit",String(t.limit));const a=s.toString()?`?${s.toString()}`:"";return Ne(`/projects/${encodeURIComponent(e)}/google/gsc/performance${a}`)}function Uj(e,t){return Ne(`/projects/${encodeURIComponent(e)}/google/gsc/inspect`,{method:"POST",body:JSON.stringify({url:t})})}function $j(e,t){const s=new URLSearchParams;t?.url&&s.set("url",t.url),s.set("limit",String(t.limit));const a=s.toString()?`?${s.toString()}`:"";return Ne(`/projects/${encodeURIComponent(e)}/google/gsc/inspections${a}`)}function Pj(e){return Ne(`/projects/${encodeURIComponent(e)}/google/gsc/deindexed`)}function Ij(e){return Ne(`/projects/${encodeURIComponent(e)}/google/gsc/coverage`)}function Bj(e,t){const s=new URLSearchParams,a=s.toString()?`?${s.toString()}`:"";return Ne(`/projects/${encodeURIComponent(e)}/google/gsc/coverage/history${a}`)}function qj(e,t){return Ne(`/projects/${encodeURIComponent(e)}/google/gsc/inspect-sitemap`,{method:"POST",body:JSON.stringify(t??{})})}function Hj(e){return Ne(`/projects/${encodeURIComponent(e)}/google/gsc/sitemaps`)}function Zj(e){return Ne(`/projects/${encodeURIComponent(e)}/google/gsc/discover-sitemaps`,{method:"POST",body:"{}"})}function _m(){return Ne("/cdp/status")}function Fj(e,t){return Ne("/settings/cdp",{method:"PUT",body:JSON.stringify({host:e,port:t})})}function Cm(e,t){return Ne(`/projects/${encodeURIComponent(e)}/google/indexing/request`,{method:"POST",body:JSON.stringify(t)})}function Gj(e,t){const s=t?`?window=${t}`:"";return Ne(`/projects/${encodeURIComponent(e)}/analytics/metrics${s}`)}function Kj(e,t){const s=t?`?window=${t}`:"";return Ne(`/projects/${encodeURIComponent(e)}/analytics/gaps${s}`)}function Vj(e,t){const s=t?`?window=${t}`:"";return Ne(`/projects/${encodeURIComponent(e)}/analytics/sources${s}`)}async function Qj(e,t){try{const s=await fetch(e);if(!s.ok)return{label:t,state:"error",detail:`HTTP ${s.status}`};const a=await s.json(),r=typeof a.version=="string"?a.version:"unknown",c=typeof a.databaseUrlConfigured=="boolean"?a.databaseUrlConfigured:void 0,d=typeof a.lastHeartbeatAt=="string"?a.lastHeartbeatAt:void 0,f=[r,c===!1?"database not configured":"database configured",d?`heartbeat ${d}`:void 0].filter(Boolean).join(" · ");return{label:t,state:"ok",detail:f,version:r,databaseConfigured:c,lastHeartbeatAt:d}}catch(s){return{label:t,state:"error",detail:s instanceof Error?s.message:"unreachable"}}}const uM=Object.freeze(Object.defineProperty({__proto__:null,ApiError:oj,addLocation:mj,addNotification:Nj,appendKeywords:fj,applyProjectConfig:zj,configureCdp:Fj,createProject:al,deleteProject:yj,fetchAllRuns:cj,fetchAnalyticsGaps:Kj,fetchAnalyticsMetrics:Gj,fetchAnalyticsSources:Vj,fetchCdpStatus:_m,fetchCompetitors:xp,fetchExport:vj,fetchGoogleConnections:Ej,fetchGoogleProperties:Aj,fetchGscCoverage:Ij,fetchGscCoverageHistory:Bj,fetchGscDeindexed:Pj,fetchGscInspections:$j,fetchGscPerformance:Mj,fetchGscSitemaps:Hj,fetchKeywords:uj,fetchProject:bp,fetchProjects:lj,fetchRunDetail:tl,fetchSchedule:Sj,fetchServiceStatus:Qj,fetchSettings:Np,fetchTimeline:Sp,generateKeywords:kj,googleConnect:Oj,googleDisconnect:Rj,inspectGscUrl:Uj,listNotifications:jj,removeLocation:pj,removeNotification:_j,removeSchedule:wj,requestIndexing:Cm,saveGoogleProperty:Tj,saveSchedule:Nm,saveSitemapUrl:Dj,sendTestNotification:Cj,setCompetitors:wp,setDefaultLocation:gj,setKeywords:dj,triggerAllRuns:cM,triggerDiscoverSitemaps:Zj,triggerGscSync:Lj,triggerInspectSitemap:qj,triggerRun:jp,updateGoogleAuthConfig:xj,updateOwnedDomains:jm,updateProject:hj,updateProviderConfig:bj},Symbol.toStringTag,{value:"Module"}));function dM({evidence:e,project:t,onClose:s}){const[a,r]=N.useState(!1),[c,d]=N.useState(-1),[f,p]=N.useState(null),[m,v]=N.useState(!1),[y,b]=N.useState({}),x=WL(t.project),j=new Set(x.map(Sm)),w=e.runHistory,_=w.length>1,C=c>=0&&f!==null,E=C?f:{citationState:e.citationState,provider:e.provider,model:e.model,answerSnippet:e.answerSnippet,citedDomains:e.citedDomains,competitorDomains:e.competitorDomains,groundingSources:e.groundingSources,evidenceUrls:e.evidenceUrls,changeLabel:e.changeLabel,summary:e.summary},O=E.citationState==="cited"||E.citationState==="emerging",M=E.citedDomains.findIndex(Z=>j.has(Z.toLowerCase().replace(/^www\./,"")))+1,T=E.citedDomains.length,L=t.project.displayName||t.project.name,R=[...x.map(Sm),L,L.split(" ").slice(0,2).join(" ")].filter(Z=>Z.trim().length>2),I=O?"cited":E.citationState==="lost"?"lost":E.citationState==="pending"?"pending":"not-cited",ie=N.useRef(0),Q=N.useCallback(async Z=>{const oe=++ie.current;if(Z===-1||Z===w.length-1){d(-1),p(null),r(!1);return}d(Z),r(!1);const pe=w[Z],ee=`${pe.runId}::${e.keyword}::${e.provider}`;if(y[ee]){p(y[ee]);return}v(!0);try{const D=await tl(pe.runId);if(oe!==ie.current)return;const G=D.snapshots.find(ae=>ae.keyword===e.keyword&&ae.provider===e.provider)??D.snapshots.find(ae=>ae.keyword===e.keyword),ne=G?{citationState:G.citationState,provider:G.provider,model:G.model??null,answerSnippet:G.answerText??"",citedDomains:G.citedDomains,competitorDomains:G.competitorOverlap,groundingSources:G.groundingSources,evidenceUrls:[],changeLabel:pe.citationState,summary:""}:{citationState:pe.citationState,provider:e.provider,model:pe.model??null,answerSnippet:"",citedDomains:[],competitorDomains:[],groundingSources:[],evidenceUrls:[],changeLabel:pe.citationState,summary:"Snapshot data not available for this run."};b(ae=>({...ae,[ee]:ne})),p(ne)}catch{if(oe!==ie.current)return;p({citationState:pe.citationState,provider:e.provider,model:pe.model??null,answerSnippet:"",citedDomains:[],competitorDomains:[],groundingSources:[],evidenceUrls:[],changeLabel:pe.citationState,summary:"Failed to load historical run data."})}finally{oe===ie.current&&v(!1)}},[w,e.keyword,e.provider,y]),me=(C||e.historyScope!=="provider")&&E.model?`${E.provider} (${E.model}) · ${E.changeLabel.toLowerCase()}`:`${E.provider} · ${E.changeLabel.toLowerCase()}`,Ee=!C&&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(" · "):"",we=O&&M>0?{label:"Citation confirmed",title:`Cited #${M} of ${T} domain${T!==1?"s":""}`,meta:me}:O?{label:"Citation confirmed",title:"Cited in this answer",meta:me}:E.citationState==="lost"?{label:"Citation lost",title:T>0?`${T} domain${T!==1?"s":""} cited instead`:"No longer appearing in this answer",meta:me}:E.citationState==="pending"?{label:"Pending",title:"Awaiting first visibility run",meta:"No provider data yet"}:{label:"Not in this answer",title:T>0?`${T} domain${T!==1?"s":""} cited instead`:"No domains cited for this query",meta:me},H=()=>{if(!E.answerSnippet)return null;const Z=E.answerSnippet.split(`
95
- `),oe=[];let pe=[],ee=0;const D=()=>{if(pe.length===0)return;const G=pe.join(" ").trim();G&&oe.push(l.jsx("p",{className:oe.length>0?"mt-2.5":"",children:yx(G,R)},ee++)),pe=[]};for(const G of Z){const ne=G.trim();if(/^[-\u2013\u2014]{3,}$/.test(ne)){D(),oe.push(l.jsx("hr",{className:"border-zinc-800/60 my-3"},ee++));continue}const ae=ne.match(/^(#{1,3})\s+(.+)$/);if(ae){D();const le=ae[1].length,he=ae[2].replace(/^[\p{Emoji}\p{Emoji_Component}\s#]+/u,"").trim()||ae[2],de=le===1?"text-[13px] font-semibold text-zinc-100 mt-4 mb-1":le===2?"text-xs font-semibold text-zinc-200 mt-3 mb-0.5":"text-xs font-medium text-zinc-300 mt-2";oe.push(l.jsx("p",{className:de,children:yx(he,R)},ee++));continue}if(ne===""){D();continue}pe.push(ne)}return D(),oe};return l.jsx(Sw,{open:!0,onOpenChange:Z=>{Z||s()},children:l.jsxs(ww,{children:[l.jsx(op,{className:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm"}),l.jsxs(lp,{className:"evidence-modal","aria-describedby":void 0,children:[l.jsxs("div",{className:"evidence-modal-header",children:[l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsxs("p",{className:"eyebrow eyebrow-soft",children:[t.project.name," \\u00b7 ",E.provider||"All providers"]}),l.jsx(cp,{className:"text-lg font-semibold text-zinc-50 truncate",children:e.keyword})]}),l.jsxs(Nw,{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:[l.jsx(Mu,{className:"size-4"}),l.jsx("span",{className:"sr-only",children:"Close"})]})]}),_&&l.jsxs("div",{className:"evidence-modal-timeline",children:[l.jsx("p",{className:"drawer-section-label mb-1.5",children:"Run history"}),l.jsx("div",{className:"flex items-center gap-1 overflow-x-auto pb-1",children:w.map((Z,oe)=>{const pe=c===-1&&oe===w.length-1||c===oe,ee=Z.citationState==="cited"?"bg-emerald-400":Z.citationState==="emerging"?"bg-amber-400":Z.citationState==="lost"?"bg-rose-400":"bg-zinc-600",G=new Date(Z.createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"}),ne=!!(Z.model&&oe>0&&w[oe-1]?.model&&w[oe-1].model!==Z.model);return l.jsxs("button",{type:"button",className:`evidence-run-dot ${pe?"evidence-run-dot--selected":""}`,onClick:()=>Q(oe===w.length-1?-1:oe),"aria-label":[`Run ${G}: ${Z.citationState}`,Z.model?`model ${Z.model}`:null,ne?"model changed":null].filter(Boolean).join(" — "),"aria-pressed":pe,children:[l.jsx("span",{className:`size-2 rounded-full ${ee} ${ne?"ring-1 ring-amber-300/80 ring-offset-2 ring-offset-zinc-950":""}`,"aria-hidden":"true"}),l.jsx("span",{className:"text-[10px] text-zinc-500",children:G})]},oe)})}),c>=0&&c<w.length&&l.jsxs("p",{className:"text-[11px] text-zinc-500 mt-1",children:["Viewing run from ",new Date(w[c].createdAt).toLocaleString()," \\u2014 ",l.jsx("span",{className:"capitalize",children:w[c].citationState}),l.jsx("button",{type:"button",className:"text-zinc-400 hover:text-zinc-200 ml-2",onClick:()=>Q(-1),children:"\\u2190 Back to latest"})]}),!C&&(e.modelTransitions?.length??0)>0&&l.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:e.modelTransitions.map(Z=>l.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:`${Z.fromModel??"unknown"} -> ${Z.toModel??"unknown"} on ${new Date(Z.createdAt).toLocaleDateString()}`},`${Z.runId}:${Z.toModel??"unknown"}`))})]}),l.jsxs("div",{className:"evidence-modal-body",children:[m&&l.jsx("div",{className:"md:col-span-2 flex items-center justify-center py-12 text-zinc-500 text-sm",children:"Loading historical run data\\u2026"}),!m&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"evidence-modal-main",children:[l.jsxs("div",{className:`evidence-position-hero evidence-position-hero--${I}`,children:[l.jsx("p",{className:`evidence-position-label evidence-position-label--${I}`,children:we.label}),l.jsx("p",{className:`evidence-position-title evidence-position-title--${I}`,children:we.title}),l.jsx("p",{className:"evidence-position-meta",children:we.meta}),Ee&&l.jsx("p",{className:"mt-1 text-[11px] text-zinc-500",children:Ee})]}),E.answerSnippet&&l.jsxs("div",{children:[l.jsx("p",{className:"drawer-section-label",children:"What the AI said"}),l.jsx("div",{className:`answer-snippet-block ${a?"evidence-answer-expanded":"evidence-answer-collapsed"}`,children:H()}),E.answerSnippet.length>280&&l.jsx("button",{type:"button",className:"mt-1.5 text-xs text-zinc-500 hover:text-zinc-300 transition-colors",onClick:()=>r(!a),children:a?"↑ Collapse":"↓ Show full answer"})]}),!E.answerSnippet&&!m&&l.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"}),!C&&e.relatedTechnicalSignals.length>0&&l.jsxs("div",{children:[l.jsx("p",{className:"drawer-section-label",children:O?"Why you're cited":"What to fix"}),l.jsx("div",{className:"action-items-list",children:e.relatedTechnicalSignals.map((Z,oe)=>l.jsxs("div",{className:"action-item",children:[l.jsx("svg",{className:`action-item-icon ${O?"text-emerald-400":"text-amber-400"}`,viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:O?l.jsx("path",{d:"M3 8l3.5 3.5L13 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}):l.jsxs(l.Fragment,{children:[l.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.5"}),l.jsx("path",{d:"M8 5v3.5M8 10.5v0",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}),l.jsx("span",{className:"action-item-text",children:Z})]},oe))})]}),E.summary&&l.jsx("p",{className:"text-xs text-zinc-600 border-t border-zinc-800/40 pt-3 mt-1",children:E.summary})]}),l.jsxs("div",{className:"evidence-modal-sidebar",children:[E.citedDomains.length>0&&l.jsxs("div",{children:[l.jsx("p",{className:"drawer-section-label",children:"Who was cited \\u2014 in order"}),l.jsxs("div",{className:"citation-leaderboard",children:[E.citedDomains.map((Z,oe)=>{const pe=Z.toLowerCase().replace(/^www\./,""),ee=j.has(pe),D=!ee&&E.competitorDomains.some(ne=>ne.toLowerCase().replace(/^www\./,"")===pe),G=ee?"you":D?"competitor":"other";return l.jsxs("div",{className:`citation-leaderboard-item citation-leaderboard-item--${G}`,children:[l.jsxs("span",{className:"citation-leaderboard-rank",children:["#",oe+1]}),l.jsx("span",{className:"citation-leaderboard-domain",children:Z}),ee&&l.jsx("span",{className:"citation-leaderboard-tag",children:"You"}),D&&l.jsx("span",{className:"citation-leaderboard-tag",children:"Competitor"})]},Z)}),!O&&l.jsxs("div",{className:"citation-leaderboard-item citation-leaderboard-item--not-cited border-dashed",children:[l.jsx("span",{className:"citation-leaderboard-rank text-zinc-600",children:"\\u2014"}),l.jsx("span",{className:"citation-leaderboard-domain text-zinc-600",children:t.project.canonicalDomain}),l.jsx("span",{className:"citation-leaderboard-tag text-zinc-600",children:"Not cited"})]})]})]}),E.groundingSources.length>0&&l.jsxs("div",{children:[l.jsxs("p",{className:"drawer-section-label",children:["Grounding sources (",E.groundingSources.length,")"]}),l.jsx("ul",{className:"grid gap-0.5",children:E.groundingSources.map((Z,oe)=>l.jsx("li",{className:"truncate text-sm",children:l.jsx("a",{href:Z.uri,target:"_blank",rel:"noreferrer",className:"text-zinc-400 hover:text-zinc-200 transition-colors",children:Z.title||Z.uri})},oe))})]}),E.evidenceUrls.length>0&&l.jsxs("div",{children:[l.jsx("p",{className:"drawer-section-label",children:"Evidence URLs"}),l.jsx("ul",{className:"grid gap-1",children:E.evidenceUrls.map(Z=>l.jsx("li",{className:"truncate text-sm",children:l.jsx("a",{href:Z,target:"_blank",rel:"noreferrer",className:"text-zinc-400 hover:text-zinc-200 transition-colors",children:Z})},Z))})]}),E.citedDomains.length===0&&E.groundingSources.length===0&&E.evidenceUrls.length===0&&l.jsxs("div",{className:"flex items-center justify-center h-24 text-zinc-600 text-sm",children:["No citation data ",C?"for this run":"yet"]})]})]})]})]})]})})}function ts(e){const t=new Date("2026-02-20");return e.map((s,a)=>({runId:`run_mock_${a+1}`,citationState:s,createdAt:new Date(t.getTime()+a*2*24*60*60*1e3).toISOString()}))}const Cr=[{id:"project_citypoint",name:"Citypoint Dental NYC",canonicalDomain:"citypointdental.com",ownedDomains:[],country:"US",language:"en",tags:["local intent","priority"],labels:{},locations:[],defaultLocation:null,configSource:"cli",configRevision:1},{id:"project_harbor",name:"Harbor Legal Group",canonicalDomain:"harborlegal.com",ownedDomains:[],country:"US",language:"en",tags:["lead gen"],labels:{},locations:[],defaultLocation:null,configSource:"cli",configRevision:1},{id:"project_northstar",name:"Northstar Orthopedics",canonicalDomain:"northstarortho.com",ownedDomains:[],country:"US",language:"en",tags:["multi-location"],labels:{},locations:[],defaultLocation:null,configSource:"cli",configRevision:1}];function Gu(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 _u=Gu({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"}),_p=Gu({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"}),Cp=Gu({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"}),Cu=Gu({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"}),fM=[_p,_u,Cp,Cu],hM=[{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:ts(["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:ts(["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:ts(["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:ts(["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:ts(["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:ts(["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:ts(["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:ts(["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:ts(["not-cited","not-cited","not-cited","not-cited","not-cited","cited"])}],mM=[{project:Cr[0],dateRangeLabel:"Last 7 days",contextLabel:"US / English / Local-intent monitoring",visibilitySummary:{label:"Answer Visibility",value:"61 / 100",delta:"-8 this week",tone:"caution",description:"Lost citation share on emergency-intent prompts while Invisalign visibility improved.",trend:[73,71,69,66,61]},providerScores:[{provider:"gemini",model:"gemini-3-flash",score:55,cited:5,total:9},{provider:"openai",model:"gpt-5.4",score:67,cited:6,total:9},{provider:"claude",model:"claude-sonnet-4-6",score:44,cited:4,total:9}],competitorPressure:{label:"Competitor Pressure",value:"High",delta:"2 rivals moved up",tone:"negative",description:"Downtown Smiles and Harbor Dental now own the highest-intent local prompts.",trend:[54,58,61,65,69]},runStatus:{label:"Run Status",value:"Partial",delta:"1 queued follow-up",tone:"caution",description:"Latest visibility sweep completed; next sweep is queued.",trend:[76,74,72,68,67]},insights:[{id:"insight_citypoint_lost_citations",tone:"negative",title:"Lost citation on 1 key phrase",detail:"Emergency-intent prompts stopped grounding Citypoint after competitors refreshed.",actionLabel:"Lost",affectedPhrases:[{keyword:"emergency dentist brooklyn",evidenceId:"evidence_citypoint_emergency_gemini",provider:"gemini",citationState:"lost"}]},{id:"insight_citypoint_emerging",tone:"positive",title:"New citation on 1 key phrase",detail:"Case-study content is earning citations on Invisalign prompts.",actionLabel:"Emerging",affectedPhrases:[{keyword:"best invisalign dentist downtown brooklyn",evidenceId:"evidence_citypoint_invisalign_openai",provider:"openai",citationState:"emerging"}]},{id:"insight_citypoint_content_gap",tone:"caution",title:"1 key phrase not cited by any provider",detail:"No dedicated neighborhood page to support pediatric queries.",actionLabel:"Gap",affectedPhrases:[{keyword:"pediatric dentist brooklyn heights",evidenceId:"evidence_citypoint_children_claude",provider:"claude",citationState:"not-cited"}]}],visibilityEvidence:hM,competitors:[{id:"competitor_citypoint_downtown",domain:"downtownsmiles.com",citationCount:4,totalKeywords:8,pressureLabel:"High",citedKeywords:["emergency dentist","same-day dental","walk-in dentist","tooth pain"],movement:"Up on emergency and availability prompts",notes:"Recently added same-day booking proof and FAQ content."},{id:"competitor_citypoint_harbor",domain:"harbordental.com",citationCount:2,totalKeywords:8,pressureLabel:"Moderate",citedKeywords:["family dentist","emergency dentist"],movement:"Holding citations on family and emergency intents",notes:"Strong appointment and insurance content keeps answers grounded."},{id:"competitor_citypoint_clearline",domain:"clearlineortho.com",citationCount:1,totalKeywords:8,pressureLabel:"Low",citedKeywords:["invisalign near me"],movement:"Softening on Invisalign prompts",notes:"Case-study content is aging, opening room for Citypoint."}],recentRuns:[_p,_u]},{project:Cr[1],dateRangeLabel:"Last 14 days",contextLabel:"US / English / Service-area legal prompts",visibilitySummary:{label:"Answer Visibility",value:"74 / 100",delta:"+2 this week",tone:"positive",description:"Branded prompts are stable and informational queries are gradually improving.",trend:[68,70,71,73,74]},providerScores:[{provider:"gemini",model:"gemini-3-flash",score:75,cited:3,total:4},{provider:"openai",model:"gpt-5.4",score:50,cited:2,total:4}],competitorPressure:{label:"Competitor Pressure",value:"Moderate",delta:"Steady",tone:"neutral",description:"Competitors are stable; no new citation displacement was detected.",trend:[44,46,45,46,46]},runStatus:{label:"Run Status",value:"Healthy",delta:"No failures in 14 days",tone:"positive",description:"Latest visibility runs completed without issues.",trend:[88,89,90,90,91]},insights:[{id:"insight_harbor_cluster",tone:"positive",title:"Practice-area clustering is paying off",detail:"Merged legal service pages now ground broader informational prompts.",actionLabel:"Cited",affectedPhrases:[{keyword:"brooklyn personal injury lawyer",evidenceId:"evidence_harbor_personal_injury",provider:"gemini",citationState:"cited"}]},{id:"insight_harbor_local",tone:"neutral",title:"No significant changes",detail:"No new displacement on borough-specific injury prompts this week.",actionLabel:"Stable",affectedPhrases:[]}],visibilityEvidence:[{id:"evidence_harbor_personal_injury",keyword:"brooklyn personal injury lawyer",provider:"gemini",model:"gemini-3-flash",location:null,citationState:"cited",changeLabel:"Held for 5 runs",answerSnippet:"Harbor Legal Group remains cited for borough-specific personal injury queries due to clear practice-area and case-result content.",citedDomains:["harborlegal.com"],evidenceUrls:["https://harborlegal.com/personal-injury/brooklyn"],competitorDomains:["shorelineinjury.com"],groundingSources:[],relatedTechnicalSignals:["Practice-area schema intact","Case results link directly from service pages"],summary:"Grounding remains durable after the service-page consolidation.",runHistory:ts(["cited","cited","cited","cited","cited"])}],competitors:[{id:"competitor_harbor_shoreline",domain:"shorelineinjury.com",citationCount:2,totalKeywords:6,pressureLabel:"Moderate",citedKeywords:["personal injury lawyer","car accident attorney"],movement:"Stable",notes:"Strong case-result pages keep it in rotation."}],recentRuns:[Cp]},{project:Cr[2],dateRangeLabel:"Last 7 days",contextLabel:"US / English / Multi-location treatment prompts",visibilitySummary:{label:"Answer Visibility",value:"58 / 100",delta:"Run in progress",tone:"neutral",description:"The current run is measuring whether treatment-location pages improved citation breadth.",trend:[52,54,55,57,58]},providerScores:[{provider:"openai",model:"gpt-5.4",score:58,cited:4,total:7}],competitorPressure:{label:"Competitor Pressure",value:"Moderate",delta:"Watching 1 chain",tone:"caution",description:"Regional chain competitors are winning on broad treatment questions.",trend:[49,51,52,54,56]},runStatus:{label:"Run Status",value:"Running",delta:"9 prompts remaining",tone:"neutral",description:"Current answer-visibility sweep is still collecting provider responses.",trend:[63,64,65,67,68]},insights:[{id:"insight_northstar_location_depth",tone:"caution",title:"Location pages need stronger proof",detail:"Answers prefer competitors with physician-specific evidence.",actionLabel:"Gap",affectedPhrases:[{keyword:"knee replacement surgeon westchester",evidenceId:"evidence_northstar_knee",provider:"openai",citationState:"emerging"}]}],visibilityEvidence:[{id:"evidence_northstar_knee",keyword:"knee replacement surgeon westchester",provider:"openai",model:"gpt-5.4",location:null,citationState:"emerging",changeLabel:"Improving",answerSnippet:"Northstar Orthopedics is beginning to appear on location-sensitive treatment prompts when physician bios and treatment pages are tightly linked.",citedDomains:["northstarortho.com","regionaljointcare.com"],evidenceUrls:["https://northstarortho.com/locations/westchester/knee-replacement"],competitorDomains:["regionaljointcare.com"],groundingSources:[],relatedTechnicalSignals:["Physician bios now linked from treatment pages"],summary:"Template cleanup is helping, but proof depth still matters.",runHistory:ts(["not-cited","not-cited","not-cited","cited"])}],competitors:[{id:"competitor_northstar_regional",domain:"regionaljointcare.com",citationCount:5,totalKeywords:7,pressureLabel:"High",citedKeywords:["knee replacement","hip surgery","joint pain treatment","orthopedic surgeon","sports medicine"],movement:"Winning broad treatment prompts",notes:"Heavy physician proof and patient-story content."}],recentRuns:[Cu]}],pM={portfolioOverview:{projects:[{project:Cr[0],visibilityScore:61,visibilityDelta:"-8 this week",lastRun:_u,insight:"Lost emergency-intent citations after competitors refreshed availability pages.",trend:[73,71,69,66,61],competitorPressureLabel:"High"},{project:Cr[1],visibilityScore:74,visibilityDelta:"+2 this week",lastRun:Cp,insight:"Practice-area consolidation is stabilizing branded and informational prompts.",trend:[68,70,71,73,74],competitorPressureLabel:"Moderate"},{project:Cr[2],visibilityScore:58,visibilityDelta:"Run in progress",lastRun:Cu,insight:"Location pages are improving, but local treatment proof still trails competitors.",trend:[52,54,55,57,58],competitorPressureLabel:"Moderate"}],attentionItems:[{id:"attention_citypoint",tone:"negative",title:"Citypoint Dental lost emergency-intent citations",detail:"Three high-intent prompts now cite competitors first.",actionLabel:"Open project",href:"/projects/project_citypoint"},{id:"attention_worker",tone:"neutral",title:"One follow-up run is queued",detail:"Citypoint has a queued visibility sweep waiting on provider quota.",actionLabel:"Open runs",href:"/runs"},{id:"attention_northstar",tone:"caution",title:"Northstar run still in progress",detail:"Nine prompts remain before the current treatment-location sweep finishes.",actionLabel:"View timeline",href:"/runs"}],recentRuns:[_p,Cu,_u],systemHealth:[{id:"api",label:"API",tone:"positive",detail:"Healthy",meta:"phase-1 · database configured"},{id:"worker",label:"Worker",tone:"positive",detail:"Healthy",meta:"heartbeat moments ago"},{id:"providers",label:"Providers",tone:"positive",detail:"2 of 3 configured",meta:"Gemini · OpenAI"}],lastUpdatedAt:"Mar 9, 8:08 AM ET"},projects:mM,runs:fM,setup:{healthChecks:[{id:"api",label:"API reachable",detail:"Primary control plane is responding.",state:"ready",guidance:"Required for project creation and run history."},{id:"worker",label:"Worker heartbeats received",detail:"Background execution loop is alive.",state:"ready",guidance:"Required before any answer-visibility run can start."},{id:"provider",label:"Provider configured",detail:"Gemini key and quota defaults are present.",state:"ready",guidance:"Required for answer-visibility sweeps."}],projectDraft:{name:"Citypoint Dental NYC",canonicalDomain:"citypointdental.com",country:"US",language:"en"},keywordImportState:{mode:"paste",keywordCount:18,preview:["emergency dentist brooklyn","best invisalign dentist downtown brooklyn","pediatric dentist brooklyn heights"]},competitorDraft:{domains:["downtownsmiles.com","harbordental.com","clearlineortho.com"],notes:"Start with the domains that already displace the project on money prompts."},launchState:{enabled:!0,ctaLabel:"Launch first run",summary:"Queue a visibility sweep first, then follow with a site audit to explain movement."}},settings:{providerStatuses:[{name:"Gemini",model:"gemini-3-flash",state:"ready",detail:"API key detected and conservative quota defaults are active.",quota:{maxConcurrency:2,maxRequestsPerMinute:10,maxRequestsPerDay:1e3}},{name:"OpenAI",model:"gpt-5.4",state:"ready",detail:"API key configured.",quota:{maxConcurrency:2,maxRequestsPerMinute:10,maxRequestsPerDay:1e3}},{name:"Claude",model:"claude-sonnet-4-6",state:"needs-config",detail:"API key is missing."}],google:{state:"ready",detail:"Google OAuth app credentials are configured. Project-level GSC connections can be created from the dashboard."},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."}},gM={apiStatus:{label:"API",state:"ok",detail:"phase-1 · database configured",version:"phase-1",databaseConfigured:!0},workerStatus:{label:"Worker",state:"ok",detail:"phase-1 · database configured · heartbeat 2026-03-09T08:07:00.000Z",version:"phase-1",databaseConfigured:!0,lastHeartbeatAt:"2026-03-09T08:07:00.000Z"}};function Ku(e={}){const t=structuredClone(pM),s=structuredClone(gM);if(e.emptyPortfolio&&(t.portfolioOverview.projects=[],t.portfolioOverview.attentionItems=[{id:"attention_setup",tone:"neutral",title:"No projects yet",detail:"Start the guided setup flow to add a domain, import keywords, and launch the first run.",actionLabel:"Open setup",href:"/setup"}],t.portfolioOverview.recentRuns=[],t.portfolioOverview.emptyState={title:"No projects yet",detail:"Canonry becomes useful after one project, a small keyword set, and one competitor list are in place.",ctaLabel:"Launch setup",ctaHref:"/setup"}),e.runScenario==="partial"&&(t.runs[0].status="partial",t.runs[0].duration="7m 24s",t.runs[0].statusDetail="Quota window closed mid-run; 14 of 18 prompts completed before the worker paused.",t.runs[0].summary="Partial visibility sweep after quota cap",t.portfolioOverview.recentRuns[0]=t.runs[0]),e.runScenario==="failed"&&(t.runs[0].status="failed",t.runs[0].duration="1m 43s",t.runs[0].statusDetail="Worker could not reach the provider after repeated retry exhaustion.",t.runs[0].summary="Provider retries exhausted before results were captured",t.portfolioOverview.recentRuns[0]=t.runs[0],t.portfolioOverview.attentionItems.unshift({id:"attention_failed_run",tone:"negative",title:"One queued follow-up failed to start cleanly",detail:"Worker retries exhausted before the provider returned a response.",actionLabel:"Open runs",href:"/runs"})),e.degradedWorker&&(s.workerStatus={label:"Worker",state:"error",detail:"heartbeat stale · last seen 12m ago",version:"phase-1",databaseConfigured:!0,lastHeartbeatAt:"2026-03-09T07:55:00.000Z"}),e.providerNeedsConfig&&(t.settings.providerStatuses=t.settings.providerStatuses.map(a=>({...a,state:"needs-config",detail:"API key is missing, so answer-visibility sweeps are blocked."}))),e.visibilityDropProjectId){const a=t.projects.find(c=>c.project.id===e.visibilityDropProjectId),r=t.portfolioOverview.projects.find(c=>c.project.id===e.visibilityDropProjectId);a&&(a.visibilitySummary.value="49 / 100",a.visibilitySummary.delta="-12 in 48h",a.visibilitySummary.tone="negative",a.visibilitySummary.description="A sharper drop than normal; citations slipped across both local and service-intent prompts.",a.insights.unshift({id:`${a.project.id}_drop`,tone:"negative",title:"Sharp citation drop detected",detail:"Answers that previously cited the domain now ground competitors on both local and service-intent prompts.",actionLabel:"Lost",affectedPhrases:a.visibilityEvidence.filter(c=>c.citationState==="lost").slice(0,5).map(c=>({keyword:c.keyword,evidenceId:c.id,provider:c.provider||void 0,citationState:c.citationState}))})),r&&(r.visibilityScore=49,r.visibilityDelta="-12 in 48h",r.insight="Sharp citation drop detected; grounding now prefers competitors on multiple high-intent prompts.")}return{dashboard:t,health:s}}function yM(e,t){return e.projects.find(s=>s.project.id===t)}function vM(e,t){return e.runs.find(s=>s.id===t)}function bM(e,t){for(const s of e.projects){const a=s.visibilityEvidence.find(r=>r.id===t);if(a)return{project:s,evidence:a}}}function Yj(e){return{id:e.id,name:e.name,displayName:e.displayName,canonicalDomain:e.canonicalDomain,ownedDomains:e.ownedDomains??[],country:e.country,language:e.language,tags:e.tags,labels:e.labels,locations:e.locations??[],defaultLocation:e.defaultLocation??null,configSource:e.configSource,configRevision:e.configRevision,createdAt:e.createdAt,updatedAt:e.updatedAt}}function vx(e){try{return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}catch{return e}}function xM(e,t){if(!e)return"Waiting";if(!t)return"Running";const s=new Date(t).getTime()-new Date(e).getTime();if(s<1e3)return"<1s";const a=Math.floor(s/1e3);if(a<60)return`${a}s`;const r=Math.floor(a/60),c=a%60;return`${r}m ${c}s`}function Xj(e){return e==="answer-visibility"?"Answer visibility sweep":e}function SM(e){return e==="manual"?"Manual":e==="scheduled"?"Scheduled":e==="config-apply"?"Config apply":e}function kp(e,t){return{id:e.id,projectId:e.projectId,projectName:t,kind:e.kind,kindLabel:Xj(e.kind),status:e.status,trigger:e.trigger??"manual",location:e.location??null,createdAt:e.createdAt,startedAt:e.startedAt?vx(e.startedAt):vx(e.createdAt),duration:xM(e.startedAt,e.finishedAt),statusDetail:e.error?Jj(e.error):wM(e),summary:jM(e),triggerLabel:SM(e.trigger)}}function Jj(e){try{const s=JSON.parse(e);if(typeof s=="object"&&s!==null){const a=s.message??s.error?.message??s[0]?.error?.message;if(typeof a=="string"&&a.length>0)return a.length>200?a.slice(0,200)+"…":a}}catch{}const t=e.match(/\[.*?\]\s*(.+)/);if(t){const s=t[1];return s.length>200?s.slice(0,200)+"…":s}return e.length>200?e.slice(0,200)+"…":e}function wM(e){switch(e.status){case"queued":return"Waiting for execution slot.";case"running":return"Provider queries in progress.";case"completed":return"All key phrases checked.";case"partial":return"Run completed with some key phrases skipped.";case"failed":return e.error?Jj(e.error):"Run failed.";default:return""}}function jM(e){switch(e.status){case"queued":return"Queued for execution";case"running":return"In progress";case"completed":return"Visibility sweep completed";case"partial":return"Partial completion";case"failed":return"Run failed";default:return e.status}}function Wj(e){if(e.length===0)return{score:0,citedCount:0,totalCount:0};const t=new Map;for(const c of e){const d=c.keyword??c.id;t.has(d)||t.set(d,!1),c.citationState==="cited"&&t.set(d,!0)}const s=t.size,a=[...t.values()].filter(Boolean).length;return{score:s>0?Math.round(a/s*100):0,citedCount:a,totalCount:s}}function NM(e){return e>=70?"positive":e>=40?"caution":"negative"}function _M(e){return e==="High"?"negative":e==="Moderate"?"caution":"neutral"}function e1(e,t){if(e.length===0||t.length===0)return{label:"None",count:0};const s=new Set(t);let a=0;for(const c of e)c.competitorOverlap.some(d=>s.has(d))&&a++;const r=a/e.length;return r>=.5?{label:"High",count:a}:r>=.2?{label:"Moderate",count:a}:{label:"Low",count:a}}function CM(e,t,s,a){const r=[];let c=0;const d=new Set;if(s){const f=new Map;for(const m of s.snapshots)if(m.keyword){const v=`${m.keyword}::${m.provider}`;f.set(v,m)}const p=[...new Set(s.snapshots.map(m=>m.provider))].sort();p.length===0&&p.push("gemini");for(const m of t){if(m.runs.length===0)continue;d.add(m.keyword);const y=m.runs.at(-1)?.transition??"not-cited",b=y==="lost"?"lost":y==="emerging"?"emerging":y==="cited"?"cited":"not-cited";for(const x of p){const j=f.get(`${m.keyword}::${x}`);if(!j&&p.length>1)continue;const w=j?.model??null,_=w?`${x}:${w}`:null,C=_?m.modelRuns?.[_]:void 0,E=m.providerRuns?.[x],O=(E?.length?E:null)??(C?.length?C:null),z=E?.length?"provider":C?.length?"model":"keyword",M=O?O.at(-1).transition:y,T=M==="lost"?"lost":M==="emerging"?"emerging":j?j.citationState==="cited"?"cited":"not-cited":b,L=km(O||m.runs),R=kM(m,x),I=(O??m.runs).map(me=>({runId:me.runId,citationState:me.citationState,createdAt:me.createdAt,model:R.get(me.runId)??null})),ie=zM(I),Q=z==="provider"&&ie.length<=1?"model":z,se=EM(I);r.push({id:`evidence_${e}_${c++}`,keyword:m.keyword,provider:j?.provider??x,model:j?.model??null,location:j?.location??null,citationState:T,changeLabel:OM(M,L),answerSnippet:j?.answerText??"",citedDomains:j?.citedDomains??[],evidenceUrls:[],competitorDomains:j?.competitorOverlap??[],relatedTechnicalSignals:[],groundingSources:j?.groundingSources??[],summary:RM(T,m.keyword),runHistory:I,historyScope:Q,modelsSeen:ie,modelTransitions:se})}}}for(const f of a)d.has(f.keyword)||r.push({id:`evidence_${e}_${c++}`,keyword:f.keyword,provider:"",model:null,location:null,citationState:"pending",changeLabel:"Awaiting first run",answerSnippet:"",citedDomains:[],evidenceUrls:[],competitorDomains:[],relatedTechnicalSignals:[],groundingSources:[],summary:`"${f.keyword}" has been added but no visibility run has been triggered yet.`,runHistory:[],historyScope:"keyword",modelsSeen:[],modelTransitions:[]});return r}function kM(e,t){const s=new Map,a=`${t}:`;for(const[r,c]of Object.entries(e.modelRuns??{})){if(!r.startsWith(a))continue;const d=r.slice(a.length),f=d==="unknown"?null:d;for(const p of c)s.set(p.runId,f)}return s}function zM(e){const t=new Set;for(const s of e)s.model&&t.add(s.model);return[...t]}function EM(e){const t=[];let s=null;for(const a of e){const r=a.model??null;r!==s&&s!==null&&t.push({runId:a.runId,createdAt:a.createdAt,fromModel:s,toModel:r}),s=r}return t}function km(e){if(e.length===0)return 0;const t=e[e.length-1].citationState;let s=0;for(let a=e.length-1;a>=0&&e[a].citationState===t;a--)s++;return s}function OM(e,t){switch(e){case"new":return"First observation";case"cited":return t<=1?"Cited in latest run":`Cited for ${t} runs`;case"lost":return"Lost since last run";case"emerging":return"First citation";case"not-cited":return t<=1?"Not cited in latest run":`Not cited across ${t} runs`;default:return e}}function RM(e,t){switch(e){case"cited":return`Your domain is cited in AI answers for "${t}".`;case"lost":return`Citation was lost for "${t}". Competitors may have gained ground.`;case"emerging":return`Your domain is starting to appear in answers for "${t}".`;case"not-cited":return`No citation detected for "${t}".`;case"pending":return`"${t}" has been added but no visibility run has been triggered yet.`}}function bx(e,t){const s=new Set(t),a=new Map;for(const r of e)if(r.keyword)for(const c of r.competitorOverlap){if(!s.has(c))continue;const d=a.get(c)??new Set;d.add(r.keyword),a.set(c,d)}return a}const Fh=3;function AM(e){const{evidence:t,timeline:s,latestSnapshots:a,previousSnapshots:r,trackedCompetitors:c}=e,d=[],f=[],p=new Set;for(const C of t)C.citationState==="lost"&&(p.has(C.keyword)||(p.add(C.keyword),f.push({keyword:C.keyword,evidenceId:C.id,provider:C.provider,citationState:"lost"})));f.length>0&&d.push({id:"insight_lost",tone:"negative",title:`Lost citation on ${f.length} keyword${f.length>1?"s":""}`,detail:"Citations dropped since the last run.",actionLabel:"Lost",affectedPhrases:f});const m=bx(a,c),v=bx(r,c);for(const C of c){const E=m.get(C)??new Set,O=v.get(C)??new Set,z=[...E].filter(M=>!O.has(M));z.length>0&&d.push({id:`insight_comp_gained_${C}`,tone:"negative",title:`${C} appeared on ${z.length} keyword${z.length>1?"s":""}`,detail:"A tracked competitor gained new citations.",actionLabel:"Competitor",affectedPhrases:z.map(M=>{const T=t.find(L=>L.keyword===M);return{keyword:M,evidenceId:T?.id??"",citationState:"cited"}})})}const y=new Map;for(const C of s){const E=C.runs.at(-1);E&&y.set(C.keyword,{transition:E.transition,citationState:E.citationState})}const b=[],x=[],j=new Set;for(const[C,{transition:E,citationState:O}]of y){if(!(E==="emerging"||E==="new"&&O==="cited"))continue;j.add(C);const M=t.find(T=>T.keyword===C&&(T.citationState==="emerging"||T.citationState==="cited"));b.push({keyword:C,evidenceId:M?.id??"",provider:M?.provider,citationState:"emerging"})}for(const C of t)C.citationState==="emerging"&&(j.has(C.keyword)||x.push({keyword:C.keyword,evidenceId:C.id,provider:C.provider,citationState:"emerging"}));if(x.length>0){const C=new Set(x.map(E=>E.keyword)).size;d.push({id:"insight_provider_pickup",tone:"positive",title:`Picked up by new provider on ${C} keyword${C>1?"s":""}`,detail:"Your domain started appearing on additional providers.",actionLabel:"Pickup",affectedPhrases:x})}b.length>0&&d.push({id:"insight_first_citation",tone:"positive",title:`First citation on ${j.size} keyword${j.size>1?"s":""}`,detail:"Your domain appeared in AI answers for the first time.",actionLabel:"New",affectedPhrases:b});const w=new Set(t.map(C=>C.keyword)),_=[];for(const C of s){if(!w.has(C.keyword)||C.runs.length<Fh||C.runs.at(-1)?.citationState!=="not-cited")continue;if(km(C.runs)>=Fh){const z=t.find(M=>M.keyword===C.keyword);_.push({keyword:C.keyword,evidenceId:z?.id??"",citationState:"not-cited"})}}_.length>0&&d.push({id:"insight_persistent_gap",tone:"caution",title:`${_.length} keyword${_.length>1?"s":""} uncited for ${Fh}+ runs`,detail:"These keywords have not been cited by any provider across multiple consecutive runs.",actionLabel:"Gap",affectedPhrases:_});for(const C of c){const E=m.get(C)??new Set,z=[...v.get(C)??new Set].filter(M=>!E.has(M));z.length>0&&d.push({id:`insight_comp_lost_${C}`,tone:"neutral",title:`${C} dropped from ${z.length} keyword${z.length>1?"s":""}`,detail:"A tracked competitor lost citations.",actionLabel:"Competitor",affectedPhrases:z.map(M=>{const T=t.find(L=>L.keyword===M);return{keyword:M,evidenceId:T?.id??"",citationState:"not-cited"}})})}return d.length===0&&d.push({id:"insight_stable",tone:"neutral",title:"No significant changes",detail:"Citation state is stable across all tracked key phrases.",actionLabel:"Stable",affectedPhrases:[]}),d}function TM(e){const t=e[0];if(!t)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 s=t.status==="completed"?"Healthy":t.status==="running"?"Running":t.status==="queued"?"Queued":t.status==="partial"?"Partial":"Failed",a=t.status==="completed"?"positive":t.status==="failed"?"negative":t.status==="partial"?"caution":"neutral";return{label:"Run Status",value:s,delta:`${e.length} total runs`,tone:a,description:`Latest: ${Xj(t.kind)} — ${t.status}`,tooltip:"Current execution state of visibility sweeps. Shows the status of the most recent run and total run count.",trend:[]}}function DM(e){const t=Yj(e.project),s=CM(t.name,e.timeline,e.latestRunDetail,e.keywords),a=e.latestRunDetail?.snapshots??[],r=Wj(a),c=e1(a,e.competitors.map(y=>y.domain)),d=AM({evidence:s,timeline:e.timeline,latestSnapshots:e.latestRunDetail?.snapshots??[],previousSnapshots:e.previousRunDetail?.snapshots??[],trackedCompetitors:e.competitors.map(y=>y.domain)}),f=[...e.runs].sort((y,b)=>b.createdAt.localeCompare(y.createdAt)),p=f.map(y=>kp(y,e.project.displayName||e.project.name)),m=new Map;for(const y of a){const b=y.provider||"gemini",x=y.model??null,j=`${b}::${x??"unknown"}`,w=m.get(j)??{provider:b,model:x,cited:0,total:0};w.total++,y.citationState==="cited"&&w.cited++,m.set(j,w)}const v=[...m.values()].sort((y,b)=>y.provider.localeCompare(b.provider)||(y.model??"").localeCompare(b.model??"")).map(({provider:y,model:b,cited:x,total:j})=>({provider:y,model:b,score:j>0?Math.round(x/j*100):0,cited:x,total:j}));return{project:t,dateRangeLabel:"All time",contextLabel:`${t.country} / ${t.language.toUpperCase()}`,visibilitySummary:{label:"Answer Visibility",value:a.length>0?`${r.score}`:"No data",delta:a.length>0?`${r.citedCount} of ${r.totalCount} key phrases visible`:"Run a sweep first",tone:a.length>0?NM(r.score):"neutral",description:a.length>0?`${r.citedCount} of ${r.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:[]},providerScores:v,competitorPressure:{label:"Competitor Pressure",value:c.label,delta:c.count>0?`${c.count} overlapping citations`:"No overlap detected",tone:_M(c.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:TM(f),insights:d,visibilityEvidence:s,competitors:e.competitors.map((y,b)=>{const x=new Set;for(const E of a)(E.competitorOverlap.includes(y.domain)||E.citedDomains.includes(y.domain))&&E.keyword&&x.add(E.keyword);const j=[...x],w=new Set(a.map(E=>E.keyword).filter(Boolean)),_=w.size>0?j.length/w.size:0,C=_>=.5?"High":_>=.2?"Moderate":j.length>0?"Low":"None";return{id:y.id||`comp_${b}`,domain:y.domain,citationCount:j.length,totalKeywords:w.size,pressureLabel:C,citedKeywords:j,movement:"",notes:""}}),recentRuns:p.slice(0,5)}}function LM(e){const t=Yj(e.project),s=e.latestRunDetail?.snapshots??[],a=Wj(s),r=e1(s,e.competitors.map(p=>p.domain)),d=[...e.runs].sort((p,m)=>m.createdAt.localeCompare(p.createdAt))[0],f=d?kp(d,e.project.displayName||e.project.name):{id:"none",projectId:e.project.id,projectName:e.project.displayName||e.project.name,kind:"answer-visibility",kindLabel:"No runs yet",status:"queued",trigger:"manual",createdAt:"",startedAt:"",duration:"",statusDetail:"",summary:"No runs yet",triggerLabel:""};return{project:t,visibilityScore:a.score,visibilityDelta:s.length>0?`${a.citedCount} of ${a.totalCount} key phrases`:"No data",lastRun:f,insight:s.length>0?`${a.citedCount} of ${a.totalCount} key phrases visible across ${new Set(s.map(p=>p.provider)).size} provider${new Set(s.map(p=>p.provider)).size>1?"s":""}.`:"No runs completed yet.",trend:[],competitorPressureLabel:r.label}}function MM(e,t){const s=[],a=[],r=[];for(const d of e){a.push(DM(d)),r.push(LM(d));const f=[...d.runs].sort((p,m)=>m.createdAt.localeCompare(p.createdAt));for(const p of f)s.push(kp(p,d.project.displayName||d.project.name))}s.sort((d,f)=>f.createdAt.localeCompare(d.createdAt));const c=e.length>0;return{portfolioOverview:{projects:r,attentionItems:c?UM(a):[{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:s.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"}),...c?{}:{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:a,runs:s,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:c,ctaLabel:c?"Trigger run":"Create a project first",summary:c?"Ready to run.":"Create a project first to launch a run."}},settings:{providerStatuses:(t?.providers??[]).map(d=>({name:d.name,model:d.model,state:d.configured?"ready":"needs-config",detail:d.configured?"Provider is configured.":"API key is missing.",quota:d.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."},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 UM(e){const t=[];for(const s of e){const a=s.visibilityEvidence.filter(c=>c.citationState==="lost");a.length>0&&t.push({id:`attention_${s.project.id}_lost`,tone:"negative",title:`${s.project.displayName||s.project.name} lost citations`,detail:`${a.length} key phrase${a.length>1?"s":""} lost citation.`,actionLabel:"Open project",href:`/projects/${s.project.id}`});const r=s.recentRuns.filter(c=>c.status==="running"||c.status==="queued");r.length>0&&t.push({id:`attention_${s.project.id}_active`,tone:"neutral",title:`${s.project.displayName||s.project.name} has active runs`,detail:`${r.length} run${r.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 Ei={projects:{all:["projects"],detail:e=>["projects",e],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"]},t1=N.createContext(null);t1.Provider;function rl(){return N.useContext(t1)}function ka(e){const s=rl()?.dashboard??null,a=Io({queryKey:Ei.projects.all,queryFn:lj,enabled:!s}),r=Io({queryKey:Ei.runs.all,queryFn:cj,enabled:!s,refetchInterval:j=>j.state.data?.some(C=>C.status==="running"||C.status==="queued")?3e3:!1}),c=Io({queryKey:Ei.settings,queryFn:()=>Np().catch(()=>null),enabled:!s}),d=a.data??[],f=r.data??[],p=DC({queries:d.map(j=>{const w=f.filter(C=>C.projectId===j.id),_=w.filter(C=>(C.status==="completed"||C.status==="partial")&&C.kind==="answer-visibility").sort((C,E)=>E.createdAt.localeCompare(C.createdAt));return{queryKey:Ei.projects.detail(j.id),queryFn:async()=>{const[C,E,O,z,M]=await Promise.all([uj(j.name).catch(()=>[]),xp(j.name).catch(()=>[]),Sp(j.name).catch(()=>[]),_[0]?tl(_[0].id).catch(()=>null):Promise.resolve(null),_[1]?tl(_[1].id).catch(()=>null):Promise.resolve(null)]);return{project:j,runs:w,keywords:C,competitors:E,timeline:O,latestRunDetail:z,previousRunDetail:M}},enabled:!s&&a.isSuccess&&r.isSuccess}})}),m=p.every(j=>j.isSuccess),v=N.useMemo(()=>{if(s)return s;if(!a.data||!r.data||d.length>0&&!m)return null;const j=p.map(w=>w.data).filter(w=>w!=null);return MM(j,c.data??null)},[s,a.data,r.data,c.data,m,p,d.length]),y=!s&&(a.isLoading||r.isLoading),b=!s&&(a.isError||r.isError),x=N.useCallback(async()=>{await Promise.all([a.refetch(),r.refetch(),c.refetch()])},[a.refetch,r.refetch,c.refetch]);return{dashboard:v,isLoading:y,isError:b,refetch:x}}async function $M(){const e=await Qj("/health","API"),t=e.state==="ok"?{label:"Runner",state:"ok",detail:"In-process job runner"}:{label:"Runner",state:e.state,detail:"Depends on API"};return{apiStatus:e,workerStatus:t}}function Vu(e,t){return Io({queryKey:Ei.health,queryFn:$M,enabled:e,refetchInterval:15e3,initialData:t})}function PM(e){return Io({queryKey:Ei.runs.detail(e??""),queryFn:()=>tl(e),enabled:!!e,refetchInterval:t=>{const s=t.state.data?.status;return s==="running"||s==="queued"?3e3:!1}})}function ol(){const e=ja(),t=Du({strict:!1}),s=bn({select:p=>p.location.pathname}),a=t.runId??null,r=t.evidenceId??null;return{runId:a,evidenceId:r,openRun:p=>e({to:s,from:ss.to,search:m=>({...m,runId:p,evidenceId:void 0})}),openEvidence:p=>e({to:s,from:ss.to,search:m=>({...m,evidenceId:p,runId:void 0})}),closeDrawer:()=>e({to:s,from:ss.to,search:p=>({...p,runId:void 0,evidenceId:void 0})})}}const xx=[{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"}],IM=Ku(),Sx=e=>({label:e,state:"checking",detail:"Checking service health"}),BM={apiStatus:Sx("API"),workerStatus:Sx("Worker")};function qM(){const e=rl(),{dashboard:t,isLoading:s,refetch:a}=ka(),d=Vu(!e,e?.health).data??e?.health??BM,f=Uz(),{runId:p,evidenceId:m,closeDrawer:v}=ol(),[y,b]=N.useState(!1),x=PM(p),j=x.data??null,w=x.isLoading;N.useEffect(()=>{j&&j.status!=="running"&&j.status!=="queued"&&a()},[j?.status,a]),N.useEffect(()=>{b(!1)},[f.pathname]),N.useEffect(()=>{if(typeof window>"u"||!p&&!m)return;const z=M=>{M.key==="Escape"&&v()};return window.addEventListener("keydown",z),()=>{window.removeEventListener("keydown",z)}},[p,m,v]);const _=t??e?.dashboard??IM.dashboard,C=p?vM(_,p):void 0,E=m?bM(_,m):void 0,O=(()=>{const z=f.pathname;if(z==="/")return"Portfolio";if(z==="/projects")return"Projects";if(z==="/runs")return"Runs";if(z==="/settings")return"Settings";if(z==="/setup")return"Setup";if(z.startsWith("/projects/")){const T=z.split("/").filter(Boolean)[1];if(T){const L=_.projects.find(R=>R.project.id===T);if(L)return L.project.name}return"Project"}return"Not found"})();return l.jsxs("div",{className:"app-shell",children:[l.jsx("a",{className:"skip-link",href:"#content",children:"Skip to content"}),l.jsxs("aside",{className:"sidebar","aria-label":"Primary navigation",children:[l.jsx("div",{className:"sidebar-brand",children:l.jsx(Ub,{})}),l.jsxs("nav",{className:"sidebar-nav",children:[l.jsxs(mt,{to:"/",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[l.jsx(Wz,{className:"sidebar-icon"}),l.jsx("span",{children:"Overview"})]}),l.jsxs(mt,{to:"/projects",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!1},children:[l.jsx(Xz,{className:"sidebar-icon"}),l.jsx("span",{children:"Projects"})]}),l.jsxs(mt,{to:"/runs",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[l.jsx(s2,{className:"sidebar-icon"}),l.jsx("span",{children:"Runs"})]}),l.jsxs(mt,{to:"/settings",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[l.jsx(u2,{className:"sidebar-icon"}),l.jsx("span",{children:"Settings"})]}),_.projects.length>0?l.jsxs(l.Fragment,{children:[l.jsx("p",{className:"sidebar-section-title",children:"Projects"}),_.projects.map(z=>{const M=z.visibilitySummary.tone;return l.jsxs(mt,{to:"/projects/$projectId",params:{projectId:z.project.id},className:"sidebar-project",activeProps:{className:"sidebar-project sidebar-project-active"},children:[l.jsx("span",{className:`sidebar-dot sidebar-dot-${M}`}),l.jsx("span",{children:z.project.name})]},z.project.id)})]}):null,_.projects.length===0?l.jsxs(l.Fragment,{children:[l.jsx("p",{className:"sidebar-section-title",children:"Resources"}),l.jsxs(mt,{to:"/setup",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[l.jsx(r2,{className:"sidebar-icon"}),l.jsx("span",{children:"Setup"})]})]}):null]}),l.jsx("div",{className:"sidebar-footer",children:xx.map(z=>l.jsx("a",{className:"sidebar-footer-link",href:z.href,target:"_blank",rel:"noreferrer",children:z.label},z.href))})]}),l.jsxs("div",{className:"main-area",children:[l.jsxs("header",{className:"topbar",children:[l.jsxs("div",{className:"topbar-left",children:[l.jsx("div",{className:"topbar-brand-mobile",children:l.jsx(Ub,{compact:!0})}),l.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[l.jsx(mt,{to:"/",children:"Home"}),l.jsx(Lu,{className:"breadcrumb-sep size-3"}),l.jsx("span",{className:"breadcrumb-current",children:O})]})]}),l.jsxs("div",{className:"topbar-actions",children:[l.jsxs("div",{className:"health-pill-row",children:[l.jsxs("span",{className:`health-pill health-pill-${d.apiStatus.state}`,children:["API ",d.apiStatus.state==="ok"?"ok":d.apiStatus.state]}),l.jsxs("span",{className:`health-pill health-pill-${d.workerStatus.state}`,children:["Worker ",d.workerStatus.state==="ok"?"ok":d.workerStatus.state]})]}),l.jsxs(ue,{className:"nav-toggle",variant:"secondary",size:"icon",type:"button","aria-expanded":y,"aria-controls":"mobile-nav",onClick:()=>b(z=>!z),children:[l.jsx(t2,{className:"size-4"}),l.jsx("span",{className:"sr-only",children:"Open navigation"})]})]})]}),l.jsxs("div",{id:"mobile-nav",className:`mobile-nav ${y?"mobile-nav-open":""}`,children:[l.jsxs(ue,{className:"mobile-nav-close",variant:"ghost",size:"icon",type:"button",onClick:()=>b(!1),children:[l.jsx(Mu,{className:"size-5"}),l.jsx("span",{className:"sr-only",children:"Close navigation"})]}),l.jsx(mt,{to:"/",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Overview"}),l.jsx(mt,{to:"/projects",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!1},children:"Projects"}),l.jsx(mt,{to:"/runs",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Runs"}),l.jsx(mt,{to:"/settings",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Settings"}),_.projects.length>0?l.jsxs("div",{className:"mobile-nav-section",children:[l.jsx("p",{className:"mobile-nav-section-title",children:"Projects"}),_.projects.map(z=>l.jsx(mt,{to:"/projects/$projectId",params:{projectId:z.project.id},className:"mobile-nav-link",children:z.project.name},z.project.id))]}):null]}),l.jsx("main",{id:"content",className:"page-shell",children:s&&!e?l.jsx("div",{className:"page-container",children:l.jsx("div",{className:"page-header",children:l.jsxs("div",{className:"page-header-left",children:[l.jsx("h1",{className:"page-title",children:"Loading"}),l.jsx("p",{className:"page-subtitle",children:"Connecting to API and loading dashboard data..."})]})})}):l.jsx(ep,{})}),l.jsxs("footer",{className:"footer",children:[l.jsx("p",{className:"supporting-copy",children:"Technical readiness and answer visibility stay separate."}),l.jsx("div",{className:"footer-links",children:xx.map(z=>l.jsx("a",{href:z.href,target:"_blank",rel:"noreferrer",children:z.label},z.href))})]})]}),C?l.jsxs(rR,{open:C!==void 0,title:C.summary,subtitle:`${C.projectName} · ${C.kindLabel}`,onClose:v,children:[l.jsxs("div",{className:"flex flex-wrap items-center gap-x-5 gap-y-1 text-sm",children:[l.jsx($u,{status:C.status}),l.jsx("span",{className:"text-zinc-400",children:C.startedAt}),l.jsx("span",{className:"text-zinc-500",children:C.duration}),l.jsx("span",{className:"text-zinc-600",children:C.triggerLabel})]}),C.status==="failed"&&C.statusDetail&&l.jsx("p",{className:"text-sm text-rose-300/80 mt-2",children:C.statusDetail}),l.jsxs("div",{className:"mt-4",children:[l.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-2",children:"Activity Log"}),w?l.jsx("p",{className:"text-sm text-zinc-500",children:"Loading run details..."}):j&&j.snapshots.length>0?l.jsxs("div",{className:"space-y-2",children:[j.snapshots.map(z=>l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 p-3",children:[l.jsxs("div",{className:"flex items-center justify-between gap-2 mb-1",children:[l.jsx("p",{className:"text-sm font-medium text-zinc-200 truncate",children:z.keyword??"Unknown key phrase"}),l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx(Xo,{provider:z.provider}),l.jsx(qS,{variant:z.citationState==="cited"?"success":"neutral",children:z.citationState})]})]}),z.model&&l.jsx("p",{className:"text-[11px] text-zinc-500 font-mono",children:z.model}),z.citedDomains.length>0&&l.jsxs("p",{className:"text-xs text-zinc-500 mt-1",children:[l.jsx("span",{className:"text-zinc-400",children:"Sources:"})," ",z.citedDomains.join(", ")]}),z.competitorOverlap.length>0&&l.jsxs("p",{className:"text-xs text-rose-400/80 mt-0.5",children:["Competitor cited: ",z.competitorOverlap.join(", ")]}),z.groundingSources&&z.groundingSources.length>0&&l.jsxs("details",{className:"mt-2",children:[l.jsxs("summary",{className:"text-xs text-zinc-500 cursor-pointer hover:text-zinc-400",children:[z.groundingSources.length," grounding source",z.groundingSources.length!==1?"s":""]}),l.jsx("ul",{className:"mt-1 space-y-0.5",children:z.groundingSources.map((M,T)=>l.jsx("li",{className:"text-xs text-zinc-500 truncate",children:l.jsx("a",{href:M.uri,target:"_blank",rel:"noreferrer",className:"hover:text-zinc-300",children:M.title||M.uri})},T))})]}),z.answerText&&l.jsxs("details",{className:"mt-1",children:[l.jsx("summary",{className:"text-xs text-zinc-500 cursor-pointer hover:text-zinc-400",children:"Answer preview"}),l.jsx("p",{className:"mt-1 text-xs text-zinc-400 leading-relaxed whitespace-pre-wrap",children:z.answerText})]})]},z.id)),j.status==="running"&&l.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[l.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-amber-500 animate-pulse"}),"Querying remaining key phrases..."]})]}):j&&j.status==="running"?l.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[l.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-amber-500 animate-pulse"}),"Waiting for first key phrase result..."]}):j&&j.status==="queued"?l.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[l.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-zinc-500 animate-pulse"}),"Run queued, waiting for execution slot..."]}):j&&j.error?l.jsxs("div",{className:"rounded-lg border border-rose-800/40 bg-rose-950/20 p-3",children:[l.jsx("p",{className:"text-sm font-medium text-rose-300 mb-2",children:"Run failed"}),l.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:g2(j.error)})]}):l.jsx("p",{className:"text-sm text-zinc-500",children:"No snapshot data available."})]})]}):null,E?l.jsx(dM,{evidence:E.evidence,project:E.project,onClose:v}):null]})}class HM extends N.Component{state={error:null};static getDerivedStateFromError(t){return{error:t}}componentDidCatch(t,s){console.error("[ErrorBoundary]",t,s.componentStack)}handleReset=()=>{this.setState({error:null})};render(){return this.state.error?l.jsx("div",{className:"page-container",children:l.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 py-20 text-center",children:[l.jsx("div",{className:"rounded-full bg-rose-950/40 p-3",children:l.jsx(m2,{className:"size-6 text-rose-400"})}),l.jsx("h2",{className:"text-lg font-semibold text-zinc-100",children:"Something went wrong"}),l.jsx("p",{className:"text-sm text-zinc-400 max-w-md",children:this.state.error.message||"An unexpected error occurred while rendering this page."}),l.jsxs("div",{className:"flex gap-3 mt-2",children:[l.jsxs(ue,{variant:"secondary",size:"sm",onClick:this.handleReset,children:[l.jsx(l2,{className:"size-3.5 mr-1.5"}),"Try again"]}),l.jsx(ue,{variant:"secondary",size:"sm",onClick:()=>{window.location.href="/"},children:"Go home"})]})]})}):this.props.children}}const Ve=N.forwardRef(({className:e,...t},s)=>l.jsx("div",{ref:s,className:Kn("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}));Ve.displayName="Card";const ZM=N.forwardRef(({className:e,...t},s)=>l.jsx("div",{ref:s,className:Kn("flex flex-col gap-1.5 p-5",e),...t}));ZM.displayName="CardHeader";const FM=N.forwardRef(({className:e,...t},s)=>l.jsx("h3",{ref:s,className:Kn("font-medium tracking-tight text-zinc-50",e),...t}));FM.displayName="CardTitle";const GM=N.forwardRef(({className:e,...t},s)=>l.jsx("p",{ref:s,className:Kn("text-sm text-zinc-500",e),...t}));GM.displayName="CardDescription";const KM=N.forwardRef(({className:e,...t},s)=>l.jsx("div",{ref:s,className:Kn("p-5 pt-0",e),...t}));KM.displayName="CardContent";function VM({points:e,tone:t}){const s=N.useId();if(e.length===0)return null;const a=42,r=132,c=5,d=Math.min(...e),p=Math.max(...e)-d||1,m=r-c*2,v=a-c*2,y=e.map((b,x)=>{const j=c+x/Math.max(e.length-1,1)*m,w=c+(1-(b-d)/p)*v;return`${j},${w}`}).join(" ");return l.jsxs("svg",{className:`sparkline sparkline-${t}`,viewBox:`0 0 ${r} ${a}`,"aria-hidden":"true",children:[l.jsx("defs",{children:l.jsx("clipPath",{id:s,children:l.jsx("rect",{x:c,y:c,width:m,height:v,rx:"8"})})}),l.jsx("line",{className:"sparkline-guide",x1:c,x2:r-c,y1:a-c,y2:a-c}),l.jsx("polyline",{clipPath:`url(#${s})`,points:y,vectorEffect:"non-scaling-stroke"})]})}const QM={gemini:"Gemini",openai:"OpenAI",claude:"Claude",local:"Local"};function YM(e,t,s){return e.map(a=>{if(a.id==="api")return{...a,tone:vu(t.apiStatus),detail:t.apiStatus.state==="ok"?"Healthy":"Needs attention",meta:t.apiStatus.detail};if(a.id==="worker")return{...a,tone:vu(t.workerStatus),detail:t.workerStatus.state==="ok"?"Healthy":"Needs attention",meta:t.workerStatus.detail};const r=s.providerStatuses.filter(p=>p.state==="ready").length,c=s.providerStatuses.length,d=r>0,f=s.providerStatuses.filter(p=>p.state==="ready").map(p=>QM[p.name]??p.name).join(" · ");return{...a,label:"Providers",tone:d?"positive":"caution",detail:`${r} of ${c} configured`,meta:f||"None configured"}})}function XM(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(s=>s.state==="ready"))return"Launch is blocked until at least one provider is configured."}function JM(e,t,s){const a=XM(t,s),r=structuredClone(e);return r.healthChecks=r.healthChecks.map(c=>{if(c.id==="api")return{...c,detail:t.apiStatus.detail,state:t.apiStatus.state==="ok"?"ready":"attention"};if(c.id==="worker")return{...c,detail:t.workerStatus.detail,state:t.workerStatus.state==="ok"?"ready":"attention"};const d=s.providerStatuses.some(f=>f.state==="ready");return{...c,detail:d?"At least one provider configured.":"No providers configured.",state:d?"ready":"attention"}}),r.launchState.enabled=a===void 0,r.launchState.blockedReason=a,r.launchState.summary=a??"Queue a visibility sweep first, then follow with a site audit to explain movement.",r}const WM=Ku();function e5({project:e}){return l.jsxs(mt,{to:"/projects/$projectId",params:{projectId:e.project.id},className:"project-row cursor-pointer",children:[l.jsxs("div",{className:"project-row-primary",children:[l.jsxs("div",{children:[l.jsx("p",{className:"project-name",children:e.project.name}),l.jsx("p",{className:"project-domain",children:e.project.canonicalDomain})]}),l.jsx("p",{className:"project-insight",children:e.insight})]}),l.jsx("div",{className:"project-row-stat",children:l.jsxs("div",{className:"metric-inline-block",children:[l.jsx("p",{className:"metric-inline-label",children:"Answer Visibility"}),l.jsx("p",{className:"metric-inline-value",children:e.visibilityScore}),l.jsx("p",{className:"metric-inline-delta",children:e.visibilityDelta})]})}),l.jsx("div",{className:"project-row-stat",children:l.jsxs("div",{className:"metric-inline-block",children:[l.jsx("p",{className:"metric-inline-label",children:"Competitor Pressure"}),l.jsx("p",{className:"metric-inline-value",children:e.competitorPressureLabel}),l.jsxs("p",{className:"metric-inline-delta",children:[e.lastRun.kindLabel," · ",Uu(e.lastRun.status)]})]})}),l.jsx("div",{className:"project-row-chart",children:l.jsx(VM,{points:e.trend,tone:HS(e.lastRun.status)})}),l.jsx("span",{className:"project-row-link",children:l.jsx(Lu,{className:"h-4 w-4 text-zinc-500"})})]})}function t5(){const e=rl(),{dashboard:t}=ka(),s=t??e?.dashboard??WM.dashboard,a=s.portfolioOverview,d=Vu(!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=YM(a.systemHealth,d,s.settings),{openRun:p}=ol();return l.jsxs("div",{className:"page-container",children:[l.jsxs("div",{className:"page-header",children:[l.jsxs("div",{className:"page-header-left",children:[l.jsx("h1",{className:"page-title",children:"Portfolio"}),l.jsx("p",{className:"page-subtitle",children:"Visibility and execution state across all projects"})]}),l.jsx("div",{className:"page-header-right",children:l.jsx("p",{className:"text-[11px] text-zinc-600",children:a.lastUpdatedAt})})]}),a.projects.length>0?l.jsx("div",{className:"project-list project-list-scrollable",children:a.projects.map(m=>l.jsx(e5,{project:m},m.project.id))}):l.jsxs(Ve,{className:"surface-card empty-card",children:[l.jsx("h3",{children:a.emptyState?.title??"No projects yet"}),l.jsx("p",{className:"supporting-copy",children:a.emptyState?.detail}),l.jsx(ue,{size:"sm",asChild:!0,children:l.jsx(mt,{to:a.emptyState?.ctaHref==="/setup"||!a.emptyState?.ctaHref?"/setup":"/",children:a.emptyState?.ctaLabel??"Launch setup"})})]}),l.jsxs("div",{className:"overview-secondary-grid",children:[a.attentionItems.length>0&&l.jsxs("section",{className:"overview-secondary-section",children:[l.jsx("div",{className:"section-head section-head-inline",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Needs attention"}),l.jsx("h2",{className:"section-title-sm",children:"What changed"})]})}),l.jsx("div",{className:"attention-list attention-list-scrollable",children:a.attentionItems.map(m=>l.jsxs(mt,{to:m.href,className:`attention-item attention-item-${m.tone}`,children:[l.jsxs("div",{children:[l.jsx("p",{className:"attention-title",children:m.title}),l.jsx("p",{className:"attention-detail",children:m.detail})]}),l.jsx("span",{className:"attention-action",children:m.actionLabel})]},m.id))})]}),l.jsxs("section",{className:"overview-secondary-section",children:[l.jsx("div",{className:"section-head section-head-inline",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Recent runs"}),l.jsx("h2",{className:"section-title-sm",children:"Activity"})]})}),l.jsx("div",{className:"compact-stack compact-stack-scrollable",children:a.recentRuns.length>0?a.recentRuns.map(m=>l.jsxs("button",{className:"compact-run",type:"button",onClick:()=>p(m.id),children:[l.jsxs("div",{children:[l.jsx("p",{className:"compact-run-title",children:m.projectName}),l.jsx("p",{className:"compact-run-detail",children:m.summary})]}),l.jsx($u,{status:m.status})]},m.id)):l.jsx("p",{className:"supporting-copy",children:"Run history appears here after the first launch."})})]})]}),l.jsxs("section",{className:"page-section",children:[l.jsx("div",{className:"section-head section-head-inline",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"System health"}),l.jsx("h2",{className:"section-title-sm",children:"Infrastructure"})]})}),l.jsx("div",{className:"health-grid",children:f.map(m=>l.jsxs(Ve,{className:"surface-card compact-card",children:[l.jsxs("div",{className:"section-head",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:m.label}),l.jsx("h3",{children:m.detail})]}),l.jsx(yt,{tone:m.tone,children:m.label})]}),l.jsx("p",{className:"supporting-copy",children:m.meta})]},m.id))})]})]})}const zp=Symbol.for("yaml.alias"),zm=Symbol.for("yaml.document"),Di=Symbol.for("yaml.map"),n1=Symbol.for("yaml.pair"),vs=Symbol.for("yaml.scalar"),Mr=Symbol.for("yaml.seq"),Fn=Symbol.for("yaml.node.type"),za=e=>!!e&&typeof e=="object"&&e[Fn]===zp,Qu=e=>!!e&&typeof e=="object"&&e[Fn]===zm,ll=e=>!!e&&typeof e=="object"&&e[Fn]===Di,Tt=e=>!!e&&typeof e=="object"&&e[Fn]===n1,ot=e=>!!e&&typeof e=="object"&&e[Fn]===vs,cl=e=>!!e&&typeof e=="object"&&e[Fn]===Mr;function Rt(e){if(e&&typeof e=="object")switch(e[Fn]){case Di:case Mr:return!0}return!1}function At(e){if(e&&typeof e=="object")switch(e[Fn]){case zp:case Di:case vs:case Mr:return!0}return!1}const s1=e=>(ot(e)||Rt(e))&&!!e.anchor,ca=Symbol("break visit"),n5=Symbol("skip children"),Ho=Symbol("remove node");function Ur(e,t){const s=s5(t);Qu(e)?Sr(null,e.contents,s,Object.freeze([e]))===Ho&&(e.contents=null):Sr(null,e,s,Object.freeze([]))}Ur.BREAK=ca;Ur.SKIP=n5;Ur.REMOVE=Ho;function Sr(e,t,s,a){const r=i5(e,t,s,a);if(At(r)||Tt(r))return a5(e,a,r),Sr(e,r,s,a);if(typeof r!="symbol"){if(Rt(t)){a=Object.freeze(a.concat(t));for(let c=0;c<t.items.length;++c){const d=Sr(c,t.items[c],s,a);if(typeof d=="number")c=d-1;else{if(d===ca)return ca;d===Ho&&(t.items.splice(c,1),c-=1)}}}else if(Tt(t)){a=Object.freeze(a.concat(t));const c=Sr("key",t.key,s,a);if(c===ca)return ca;c===Ho&&(t.key=null);const d=Sr("value",t.value,s,a);if(d===ca)return ca;d===Ho&&(t.value=null)}}return r}function s5(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 i5(e,t,s,a){if(typeof s=="function")return s(e,t,a);if(ll(t))return s.Map?.(e,t,a);if(cl(t))return s.Seq?.(e,t,a);if(Tt(t))return s.Pair?.(e,t,a);if(ot(t))return s.Scalar?.(e,t,a);if(za(t))return s.Alias?.(e,t,a)}function a5(e,t,s){const a=t[t.length-1];if(Rt(a))a.items[e]=s;else if(Tt(a))e==="key"?a.key=s:a.value=s;else if(Qu(a))a.contents=s;else{const r=za(a)?"alias":"scalar";throw new Error(`Cannot replace node with ${r} parent`)}}const r5={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},o5=e=>e.replace(/[!,[\]{}]/g,t=>r5[t]);class cn{constructor(t,s){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},cn.defaultYaml,t),this.tags=Object.assign({},cn.defaultTags,s)}clone(){const t=new cn(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new cn(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:cn.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},cn.defaultTags);break}return t}add(t,s){this.atNextDocument&&(this.yaml={explicit:cn.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},cn.defaultTags),this.atNextDocument=!1);const a=t.trim().split(/[ \t]+/),r=a.shift();switch(r){case"%TAG":{if(a.length!==2&&(s(0,"%TAG directive should contain exactly two parts"),a.length<2))return!1;const[c,d]=a;return this.tags[c]=d,!0}case"%YAML":{if(this.yaml.explicit=!0,a.length!==1)return s(0,"%YAML directive should contain exactly one part"),!1;const[c]=a;if(c==="1.1"||c==="1.2")return this.yaml.version=c,!0;{const d=/^\d+\.\d+$/.test(c);return s(6,`Unsupported YAML version ${c}`,d),!1}}default:return s(0,`Unknown directive ${r}`,!0),!1}}tagName(t,s){if(t==="!")return"!";if(t[0]!=="!")return s(`Not a valid tag: ${t}`),null;if(t[1]==="<"){const d=t.slice(2,-1);return d==="!"||d==="!!"?(s(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&s("Verbatim tags must end with a >"),d)}const[,a,r]=t.match(/^(.*!)([^!]*)$/s);r||s(`The ${t} tag has no suffix`);const c=this.tags[a];if(c)try{return c+decodeURIComponent(r)}catch(d){return s(String(d)),null}return a==="!"?t:(s(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[s,a]of Object.entries(this.tags))if(t.startsWith(a))return s+o5(t.substring(a.length));return t[0]==="!"?t:`!<${t}>`}toString(t){const s=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],a=Object.entries(this.tags);let r;if(t&&a.length>0&&At(t.contents)){const c={};Ur(t.contents,(d,f)=>{At(f)&&f.tag&&(c[f.tag]=!0)}),r=Object.keys(c)}else r=[];for(const[c,d]of a)c==="!!"&&d==="tag:yaml.org,2002:"||(!t||r.some(f=>f.startsWith(d)))&&s.push(`%TAG ${c} ${d}`);return s.join(`
96
- `)}}cn.defaultYaml={explicit:!1,version:"1.2"};cn.defaultTags={"!!":"tag:yaml.org,2002:"};function i1(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const s=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(s)}return!0}function a1(e){const t=new Set;return Ur(e,{Value(s,a){a.anchor&&t.add(a.anchor)}}),t}function r1(e,t){for(let s=1;;++s){const a=`${e}${s}`;if(!t.has(a))return a}}function l5(e,t){const s=[],a=new Map;let r=null;return{onAnchor:c=>{s.push(c),r??(r=a1(e));const d=r1(t,r);return r.add(d),d},setAnchors:()=>{for(const c of s){const d=a.get(c);if(typeof d=="object"&&d.anchor&&(ot(d.node)||Rt(d.node)))d.node.anchor=d.anchor;else{const f=new Error("Failed to resolve repeated object (this should not happen)");throw f.source=c,f}}},sourceObjects:a}}function wr(e,t,s,a){if(a&&typeof a=="object")if(Array.isArray(a))for(let r=0,c=a.length;r<c;++r){const d=a[r],f=wr(e,a,String(r),d);f===void 0?delete a[r]:f!==d&&(a[r]=f)}else if(a instanceof Map)for(const r of Array.from(a.keys())){const c=a.get(r),d=wr(e,a,r,c);d===void 0?a.delete(r):d!==c&&a.set(r,d)}else if(a instanceof Set)for(const r of Array.from(a)){const c=wr(e,a,r,r);c===void 0?a.delete(r):c!==r&&(a.delete(r),a.add(c))}else for(const[r,c]of Object.entries(a)){const d=wr(e,a,r,c);d===void 0?delete a[r]:d!==c&&(a[r]=d)}return e.call(t,s,a)}function Zn(e,t,s){if(Array.isArray(e))return e.map((a,r)=>Zn(a,String(r),s));if(e&&typeof e.toJSON=="function"){if(!s||!s1(e))return e.toJSON(t,s);const a={aliasCount:0,count:1,res:void 0};s.anchors.set(e,a),s.onCreate=c=>{a.res=c,delete s.onCreate};const r=e.toJSON(t,s);return s.onCreate&&s.onCreate(r),r}return typeof e=="bigint"&&!s?.keep?Number(e):e}class Ep{constructor(t){Object.defineProperty(this,Fn,{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:s,maxAliasCount:a,onAnchor:r,reviver:c}={}){if(!Qu(t))throw new TypeError("A document argument is required");const d={anchors:new Map,doc:t,keep:!0,mapAsMap:s===!0,mapKeyWarned:!1,maxAliasCount:typeof a=="number"?a:100},f=Zn(this,"",d);if(typeof r=="function")for(const{count:p,res:m}of d.anchors.values())r(m,p);return typeof c=="function"?wr(c,{"":f},"",f):f}}class Op extends Ep{constructor(t){super(zp),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t,s){let a;s?.aliasResolveCache?a=s.aliasResolveCache:(a=[],Ur(t,{Node:(c,d)=>{(za(d)||s1(d))&&a.push(d)}}),s&&(s.aliasResolveCache=a));let r;for(const c of a){if(c===this)break;c.anchor===this.source&&(r=c)}return r}toJSON(t,s){if(!s)return{source:this.source};const{anchors:a,doc:r,maxAliasCount:c}=s,d=this.resolve(r,s);if(!d){const p=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(p)}let f=a.get(d);if(f||(Zn(d,null,s),f=a.get(d)),f?.res===void 0){const p="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(p)}if(c>=0&&(f.count+=1,f.aliasCount===0&&(f.aliasCount=nu(r,d,a)),f.count*f.aliasCount>c)){const p="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(p)}return f.res}toString(t,s,a){const r=`*${this.source}`;if(t){if(i1(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(c)}if(t.implicitKey)return`${r} `}return r}}function nu(e,t,s){if(za(t)){const a=t.resolve(e),r=s&&a&&s.get(a);return r?r.count*r.aliasCount:0}else if(Rt(t)){let a=0;for(const r of t.items){const c=nu(e,r,s);c>a&&(a=c)}return a}else if(Tt(t)){const a=nu(e,t.key,s),r=nu(e,t.value,s);return Math.max(a,r)}return 1}const o1=e=>!e||typeof e!="function"&&typeof e!="object";class Oe extends Ep{constructor(t){super(vs),this.value=t}toJSON(t,s){return s?.keep?this.value:Zn(this.value,t,s)}toString(){return String(this.value)}}Oe.BLOCK_FOLDED="BLOCK_FOLDED";Oe.BLOCK_LITERAL="BLOCK_LITERAL";Oe.PLAIN="PLAIN";Oe.QUOTE_DOUBLE="QUOTE_DOUBLE";Oe.QUOTE_SINGLE="QUOTE_SINGLE";const c5="tag:yaml.org,2002:";function u5(e,t,s){if(t){const a=s.filter(c=>c.tag===t),r=a.find(c=>!c.format)??a[0];if(!r)throw new Error(`Tag ${t} not found`);return r}return s.find(a=>a.identify?.(e)&&!a.format)}function nl(e,t,s){if(Qu(e)&&(e=e.contents),At(e))return e;if(Tt(e)){const y=s.schema[Di].createNode?.(s.schema,null,s);return y.items.push(e),y}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:a,onAnchor:r,onTagObj:c,schema:d,sourceObjects:f}=s;let p;if(a&&e&&typeof e=="object"){if(p=f.get(e),p)return p.anchor??(p.anchor=r(e)),new Op(p.anchor);p={anchor:null,node:null},f.set(e,p)}t?.startsWith("!!")&&(t=c5+t.slice(2));let m=u5(e,t,d.tags);if(!m){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const y=new Oe(e);return p&&(p.node=y),y}m=e instanceof Map?d[Di]:Symbol.iterator in Object(e)?d[Mr]:d[Di]}c&&(c(m),delete s.onTagObj);const v=m?.createNode?m.createNode(s.schema,e,s):typeof m?.nodeClass?.from=="function"?m.nodeClass.from(s.schema,e,s):new Oe(e);return t?v.tag=t:m.default||(v.tag=m.tag),p&&(p.node=v),v}function ku(e,t,s){let a=s;for(let r=t.length-1;r>=0;--r){const c=t[r];if(typeof c=="number"&&Number.isInteger(c)&&c>=0){const d=[];d[c]=a,a=d}else a=new Map([[c,a]])}return nl(a,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const Po=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class l1 extends Ep{constructor(t,s){super(t),Object.defineProperty(this,"schema",{value:s,configurable:!0,enumerable:!1,writable:!0})}clone(t){const s=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(s.schema=t),s.items=s.items.map(a=>At(a)||Tt(a)?a.clone(t):a),this.range&&(s.range=this.range.slice()),s}addIn(t,s){if(Po(t))this.add(s);else{const[a,...r]=t,c=this.get(a,!0);if(Rt(c))c.addIn(r,s);else if(c===void 0&&this.schema)this.set(a,ku(this.schema,r,s));else throw new Error(`Expected YAML collection at ${a}. Remaining path: ${r}`)}}deleteIn(t){const[s,...a]=t;if(a.length===0)return this.delete(s);const r=this.get(s,!0);if(Rt(r))return r.deleteIn(a);throw new Error(`Expected YAML collection at ${s}. Remaining path: ${a}`)}getIn(t,s){const[a,...r]=t,c=this.get(a,!0);return r.length===0?!s&&ot(c)?c.value:c:Rt(c)?c.getIn(r,s):void 0}hasAllNullValues(t){return this.items.every(s=>{if(!Tt(s))return!1;const a=s.value;return a==null||t&&ot(a)&&a.value==null&&!a.commentBefore&&!a.comment&&!a.tag})}hasIn(t){const[s,...a]=t;if(a.length===0)return this.has(s);const r=this.get(s,!0);return Rt(r)?r.hasIn(a):!1}setIn(t,s){const[a,...r]=t;if(r.length===0)this.set(a,s);else{const c=this.get(a,!0);if(Rt(c))c.setIn(r,s);else if(c===void 0&&this.schema)this.set(a,ku(this.schema,r,s));else throw new Error(`Expected YAML collection at ${a}. Remaining path: ${r}`)}}}const d5=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function qs(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const ma=(e,t,s)=>e.endsWith(`
97
- `)?qs(s,t):s.includes(`
98
- `)?`
99
- `+qs(s,t):(e.endsWith(" ")?"":" ")+s,c1="flow",Em="block",su="quoted";function Yu(e,t,s="flow",{indentAtStart:a,lineWidth:r=80,minContentWidth:c=20,onFold:d,onOverflow:f}={}){if(!r||r<0)return e;r<c&&(c=0);const p=Math.max(1+c,1+r-t.length);if(e.length<=p)return e;const m=[],v={};let y=r-t.length;typeof a=="number"&&(a>r-Math.max(2,c)?m.push(0):y=r-a);let b,x,j=!1,w=-1,_=-1,C=-1;s===Em&&(w=wx(e,w,t.length),w!==-1&&(y=w+p));for(let O;O=e[w+=1];){if(s===su&&O==="\\"){switch(_=w,e[w+1]){case"x":w+=3;break;case"u":w+=5;break;case"U":w+=9;break;default:w+=1}C=w}if(O===`
100
- `)s===Em&&(w=wx(e,w,t.length)),y=w+t.length+p,b=void 0;else{if(O===" "&&x&&x!==" "&&x!==`
101
- `&&x!==" "){const z=e[w+1];z&&z!==" "&&z!==`
102
- `&&z!==" "&&(b=w)}if(w>=y)if(b)m.push(b),y=b+p,b=void 0;else if(s===su){for(;x===" "||x===" ";)x=O,O=e[w+=1],j=!0;const z=w>C+1?w-2:_-1;if(v[z])return e;m.push(z),v[z]=!0,y=z+p,b=void 0}else j=!0}x=O}if(j&&f&&f(),m.length===0)return e;d&&d();let E=e.slice(0,m[0]);for(let O=0;O<m.length;++O){const z=m[O],M=m[O+1]||e.length;z===0?E=`
103
- ${t}${e.slice(0,M)}`:(s===su&&v[z]&&(E+=`${e[z]}\\`),E+=`
104
- ${t}${e.slice(z+1,M)}`)}return E}function wx(e,t,s){let a=t,r=t+1,c=e[r];for(;c===" "||c===" ";)if(t<r+s)c=e[++t];else{do c=e[++t];while(c&&c!==`
105
- `);a=t,r=t+1,c=e[r]}return a}const Xu=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),Ju=e=>/^(%|---|\.\.\.)/m.test(e);function f5(e,t,s){if(!t||t<0)return!1;const a=t-s,r=e.length;if(r<=a)return!1;for(let c=0,d=0;c<r;++c)if(e[c]===`
106
- `){if(c-d>a)return!0;if(d=c+1,r-d<=a)return!1}return!0}function Zo(e,t){const s=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return s;const{implicitKey:a}=t,r=t.options.doubleQuotedMinMultiLineLength,c=t.indent||(Ju(e)?" ":"");let d="",f=0;for(let p=0,m=s[p];m;m=s[++p])if(m===" "&&s[p+1]==="\\"&&s[p+2]==="n"&&(d+=s.slice(f,p)+"\\ ",p+=1,f=p,m="\\"),m==="\\")switch(s[p+1]){case"u":{d+=s.slice(f,p);const v=s.substr(p+2,4);switch(v){case"0000":d+="\\0";break;case"0007":d+="\\a";break;case"000b":d+="\\v";break;case"001b":d+="\\e";break;case"0085":d+="\\N";break;case"00a0":d+="\\_";break;case"2028":d+="\\L";break;case"2029":d+="\\P";break;default:v.substr(0,2)==="00"?d+="\\x"+v.substr(2):d+=s.substr(p,6)}p+=5,f=p+1}break;case"n":if(a||s[p+2]==='"'||s.length<r)p+=1;else{for(d+=s.slice(f,p)+`
107
-
108
- `;s[p+2]==="\\"&&s[p+3]==="n"&&s[p+4]!=='"';)d+=`
109
- `,p+=2;d+=c,s[p+2]===" "&&(d+="\\"),p+=1,f=p+1}break;default:p+=1}return d=f?d+s.slice(f):s,a?d:Yu(d,c,su,Xu(t,!1))}function Om(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
110
- `)||/[ \t]\n|\n[ \t]/.test(e))return Zo(e,t);const s=t.indent||(Ju(e)?" ":""),a="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
111
- ${s}`)+"'";return t.implicitKey?a:Yu(a,s,c1,Xu(t,!1))}function jr(e,t){const{singleQuote:s}=t.options;let a;if(s===!1)a=Zo;else{const r=e.includes('"'),c=e.includes("'");r&&!c?a=Om:c&&!r?a=Zo:a=s?Om:Zo}return a(e,t)}let Rm;try{Rm=new RegExp(`(^|(?<!
112
- ))
113
- +(?!
114
- |$)`,"g")}catch{Rm=/\n+(?!\n|$)/g}function iu({comment:e,type:t,value:s},a,r,c){const{blockQuote:d,commentString:f,lineWidth:p}=a.options;if(!d||/\n[\t ]+$/.test(s))return jr(s,a);const m=a.indent||(a.forceBlockIndent||Ju(s)?" ":""),v=d==="literal"?!0:d==="folded"||t===Oe.BLOCK_FOLDED?!1:t===Oe.BLOCK_LITERAL?!0:!f5(s,p,m.length);if(!s)return v?`|
115
- `:`>
116
- `;let y,b;for(b=s.length;b>0;--b){const M=s[b-1];if(M!==`
117
- `&&M!==" "&&M!==" ")break}let x=s.substring(b);const j=x.indexOf(`
118
- `);j===-1?y="-":s===x||j!==x.length-1?(y="+",c&&c()):y="",x&&(s=s.slice(0,-x.length),x[x.length-1]===`
119
- `&&(x=x.slice(0,-1)),x=x.replace(Rm,`$&${m}`));let w=!1,_,C=-1;for(_=0;_<s.length;++_){const M=s[_];if(M===" ")w=!0;else if(M===`
120
- `)C=_;else break}let E=s.substring(0,C<_?C+1:_);E&&(s=s.substring(E.length),E=E.replace(/\n+/g,`$&${m}`));let z=(w?m?"2":"1":"")+y;if(e&&(z+=" "+f(e.replace(/ ?[\r\n]+/g," ")),r&&r()),!v){const M=s.replace(/\n+/g,`
121
- $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${m}`);let T=!1;const L=Xu(a,!0);d!=="folded"&&t!==Oe.BLOCK_FOLDED&&(L.onOverflow=()=>{T=!0});const R=Yu(`${E}${M}${x}`,m,Em,L);if(!T)return`>${z}
122
- ${m}${R}`}return s=s.replace(/\n+/g,`$&${m}`),`|${z}
123
- ${m}${E}${s}${x}`}function h5(e,t,s,a){const{type:r,value:c}=e,{actualString:d,implicitKey:f,indent:p,indentStep:m,inFlow:v}=t;if(f&&c.includes(`
124
- `)||v&&/[[\]{},]/.test(c))return jr(c,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(c))return f||v||!c.includes(`
125
- `)?jr(c,t):iu(e,t,s,a);if(!f&&!v&&r!==Oe.PLAIN&&c.includes(`
126
- `))return iu(e,t,s,a);if(Ju(c)){if(p==="")return t.forceBlockIndent=!0,iu(e,t,s,a);if(f&&p===m)return jr(c,t)}const y=c.replace(/\n+/g,`$&
127
- ${p}`);if(d){const b=w=>w.default&&w.tag!=="tag:yaml.org,2002:str"&&w.test?.test(y),{compat:x,tags:j}=t.doc.schema;if(j.some(b)||x?.some(b))return jr(c,t)}return f?y:Yu(y,p,c1,Xu(t,!1))}function Rp(e,t,s,a){const{implicitKey:r,inFlow:c}=t,d=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:f}=e;f!==Oe.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(d.value)&&(f=Oe.QUOTE_DOUBLE);const p=v=>{switch(v){case Oe.BLOCK_FOLDED:case Oe.BLOCK_LITERAL:return r||c?jr(d.value,t):iu(d,t,s,a);case Oe.QUOTE_DOUBLE:return Zo(d.value,t);case Oe.QUOTE_SINGLE:return Om(d.value,t);case Oe.PLAIN:return h5(d,t,s,a);default:return null}};let m=p(f);if(m===null){const{defaultKeyType:v,defaultStringType:y}=t.options,b=r&&v||y;if(m=p(b),m===null)throw new Error(`Unsupported default string type ${b}`)}return m}function u1(e,t){const s=Object.assign({blockQuote:!0,commentString:d5,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 a;switch(s.collectionStyle){case"block":a=!1;break;case"flow":a=!0;break;default:a=null}return{anchors:new Set,doc:e,flowCollectionPadding:s.flowCollectionPadding?" ":"",indent:"",indentStep:typeof s.indent=="number"?" ".repeat(s.indent):" ",inFlow:a,options:s}}function m5(e,t){if(t.tag){const r=e.filter(c=>c.tag===t.tag);if(r.length>0)return r.find(c=>c.format===t.format)??r[0]}let s,a;if(ot(t)){a=t.value;let r=e.filter(c=>c.identify?.(a));if(r.length>1){const c=r.filter(d=>d.test);c.length>0&&(r=c)}s=r.find(c=>c.format===t.format)??r.find(c=>!c.format)}else a=t,s=e.find(r=>r.nodeClass&&a instanceof r.nodeClass);if(!s){const r=a?.constructor?.name??(a===null?"null":typeof a);throw new Error(`Tag not resolved for ${r} value`)}return s}function p5(e,t,{anchors:s,doc:a}){if(!a.directives)return"";const r=[],c=(ot(e)||Rt(e))&&e.anchor;c&&i1(c)&&(s.add(c),r.push(`&${c}`));const d=e.tag??(t.default?null:t.tag);return d&&r.push(a.directives.tagString(d)),r.join(" ")}function Ar(e,t,s,a){if(Tt(e))return e.toString(t,s,a);if(za(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 r;const c=At(e)?e:t.doc.createNode(e,{onTagObj:p=>r=p});r??(r=m5(t.doc.schema.tags,c));const d=p5(c,r,t);d.length>0&&(t.indentAtStart=(t.indentAtStart??0)+d.length+1);const f=typeof r.stringify=="function"?r.stringify(c,t,s,a):ot(c)?Rp(c,t,s,a):c.toString(t,s,a);return d?ot(c)||f[0]==="{"||f[0]==="["?`${d} ${f}`:`${d}
128
- ${t.indent}${f}`:f}function g5({key:e,value:t},s,a,r){const{allNullValues:c,doc:d,indent:f,indentStep:p,options:{commentString:m,indentSeq:v,simpleKeys:y}}=s;let b=At(e)&&e.comment||null;if(y){if(b)throw new Error("With simple keys, key nodes cannot have comments");if(Rt(e)||!At(e)&&typeof e=="object"){const L="With simple keys, collection cannot be used as a key value";throw new Error(L)}}let x=!y&&(!e||b&&t==null&&!s.inFlow||Rt(e)||(ot(e)?e.type===Oe.BLOCK_FOLDED||e.type===Oe.BLOCK_LITERAL:typeof e=="object"));s=Object.assign({},s,{allNullValues:!1,implicitKey:!x&&(y||!c),indent:f+p});let j=!1,w=!1,_=Ar(e,s,()=>j=!0,()=>w=!0);if(!x&&!s.inFlow&&_.length>1024){if(y)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");x=!0}if(s.inFlow){if(c||t==null)return j&&a&&a(),_===""?"?":x?`? ${_}`:_}else if(c&&!y||t==null&&x)return _=`? ${_}`,b&&!j?_+=ma(_,s.indent,m(b)):w&&r&&r(),_;j&&(b=null),x?(b&&(_+=ma(_,s.indent,m(b))),_=`? ${_}
129
- ${f}:`):(_=`${_}:`,b&&(_+=ma(_,s.indent,m(b))));let C,E,O;At(t)?(C=!!t.spaceBefore,E=t.commentBefore,O=t.comment):(C=!1,E=null,O=null,t&&typeof t=="object"&&(t=d.createNode(t))),s.implicitKey=!1,!x&&!b&&ot(t)&&(s.indentAtStart=_.length+1),w=!1,!v&&p.length>=2&&!s.inFlow&&!x&&cl(t)&&!t.flow&&!t.tag&&!t.anchor&&(s.indent=s.indent.substring(2));let z=!1;const M=Ar(t,s,()=>z=!0,()=>w=!0);let T=" ";if(b||C||E){if(T=C?`
130
- `:"",E){const L=m(E);T+=`
131
- ${qs(L,s.indent)}`}M===""&&!s.inFlow?T===`
132
- `&&O&&(T=`
133
-
134
- `):T+=`
135
- ${s.indent}`}else if(!x&&Rt(t)){const L=M[0],R=M.indexOf(`
136
- `),I=R!==-1,ie=s.inFlow??t.flow??t.items.length===0;if(I||!ie){let Q=!1;if(I&&(L==="&"||L==="!")){let se=M.indexOf(" ");L==="&"&&se!==-1&&se<R&&M[se+1]==="!"&&(se=M.indexOf(" ",se+1)),(se===-1||R<se)&&(Q=!0)}Q||(T=`
137
- ${s.indent}`)}}else(M===""||M[0]===`
138
- `)&&(T="");return _+=T+M,s.inFlow?z&&a&&a():O&&!z?_+=ma(_,s.indent,m(O)):w&&r&&r(),_}function y5(e,t){(e==="debug"||e==="warn")&&console.warn(t)}const Zc="<<",Hs={identify:e=>e===Zc||typeof e=="symbol"&&e.description===Zc,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Oe(Symbol(Zc)),{addToJSMap:d1}),stringify:()=>Zc},v5=(e,t)=>(Hs.identify(t)||ot(t)&&(!t.type||t.type===Oe.PLAIN)&&Hs.identify(t.value))&&e?.doc.schema.tags.some(s=>s.tag===Hs.tag&&s.default);function d1(e,t,s){if(s=e&&za(s)?s.resolve(e.doc):s,cl(s))for(const a of s.items)Gh(e,t,a);else if(Array.isArray(s))for(const a of s)Gh(e,t,a);else Gh(e,t,s)}function Gh(e,t,s){const a=e&&za(s)?s.resolve(e.doc):s;if(!ll(a))throw new Error("Merge sources must be maps or map aliases");const r=a.toJSON(null,e,Map);for(const[c,d]of r)t instanceof Map?t.has(c)||t.set(c,d):t instanceof Set?t.add(c):Object.prototype.hasOwnProperty.call(t,c)||Object.defineProperty(t,c,{value:d,writable:!0,enumerable:!0,configurable:!0});return t}function f1(e,t,{key:s,value:a}){if(At(s)&&s.addToJSMap)s.addToJSMap(e,t,a);else if(v5(e,s))d1(e,t,a);else{const r=Zn(s,"",e);if(t instanceof Map)t.set(r,Zn(a,r,e));else if(t instanceof Set)t.add(r);else{const c=b5(s,r,e),d=Zn(a,c,e);c in t?Object.defineProperty(t,c,{value:d,writable:!0,enumerable:!0,configurable:!0}):t[c]=d}}return t}function b5(e,t,s){if(t===null)return"";if(typeof t!="object")return String(t);if(At(e)&&s?.doc){const a=u1(s.doc,{});a.anchors=new Set;for(const c of s.anchors.keys())a.anchors.add(c.anchor);a.inFlow=!0,a.inStringifyKey=!0;const r=e.toString(a);if(!s.mapKeyWarned){let c=JSON.stringify(r);c.length>40&&(c=c.substring(0,36)+'..."'),y5(s.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${c}. Set mapAsMap: true to use object keys.`),s.mapKeyWarned=!0}return r}return JSON.stringify(t)}function Ap(e,t,s){const a=nl(e,void 0,s),r=nl(t,void 0,s);return new dn(a,r)}class dn{constructor(t,s=null){Object.defineProperty(this,Fn,{value:n1}),this.key=t,this.value=s}clone(t){let{key:s,value:a}=this;return At(s)&&(s=s.clone(t)),At(a)&&(a=a.clone(t)),new dn(s,a)}toJSON(t,s){const a=s?.mapAsMap?new Map:{};return f1(s,a,this)}toString(t,s,a){return t?.doc?g5(this,t,s,a):JSON.stringify(this)}}function h1(e,t,s){return(t.inFlow??e.flow?S5:x5)(e,t,s)}function x5({comment:e,items:t},s,{blockItemPrefix:a,flowChars:r,itemIndent:c,onChompKeep:d,onComment:f}){const{indent:p,options:{commentString:m}}=s,v=Object.assign({},s,{indent:c,type:null});let y=!1;const b=[];for(let j=0;j<t.length;++j){const w=t[j];let _=null;if(At(w))!y&&w.spaceBefore&&b.push(""),zu(s,b,w.commentBefore,y),w.comment&&(_=w.comment);else if(Tt(w)){const E=At(w.key)?w.key:null;E&&(!y&&E.spaceBefore&&b.push(""),zu(s,b,E.commentBefore,y))}y=!1;let C=Ar(w,v,()=>_=null,()=>y=!0);_&&(C+=ma(C,c,m(_))),y&&_&&(y=!1),b.push(a+C)}let x;if(b.length===0)x=r.start+r.end;else{x=b[0];for(let j=1;j<b.length;++j){const w=b[j];x+=w?`
139
- ${p}${w}`:`
140
- `}}return e?(x+=`
141
- `+qs(m(e),p),f&&f()):y&&d&&d(),x}function S5({items:e},t,{flowChars:s,itemIndent:a}){const{indent:r,indentStep:c,flowCollectionPadding:d,options:{commentString:f}}=t;a+=c;const p=Object.assign({},t,{indent:a,inFlow:!0,type:null});let m=!1,v=0;const y=[];for(let j=0;j<e.length;++j){const w=e[j];let _=null;if(At(w))w.spaceBefore&&y.push(""),zu(t,y,w.commentBefore,!1),w.comment&&(_=w.comment);else if(Tt(w)){const E=At(w.key)?w.key:null;E&&(E.spaceBefore&&y.push(""),zu(t,y,E.commentBefore,!1),E.comment&&(m=!0));const O=At(w.value)?w.value:null;O?(O.comment&&(_=O.comment),O.commentBefore&&(m=!0)):w.value==null&&E?.comment&&(_=E.comment)}_&&(m=!0);let C=Ar(w,p,()=>_=null);j<e.length-1&&(C+=","),_&&(C+=ma(C,a,f(_))),!m&&(y.length>v||C.includes(`
142
- `))&&(m=!0),y.push(C),v=y.length}const{start:b,end:x}=s;if(y.length===0)return b+x;if(!m){const j=y.reduce((w,_)=>w+_.length+2,2);m=t.options.lineWidth>0&&j>t.options.lineWidth}if(m){let j=b;for(const w of y)j+=w?`
143
- ${c}${r}${w}`:`
144
- `;return`${j}
145
- ${r}${x}`}else return`${b}${d}${y.join(" ")}${d}${x}`}function zu({indent:e,options:{commentString:t}},s,a,r){if(a&&r&&(a=a.replace(/^\n+/,"")),a){const c=qs(t(a),e);s.push(c.trimStart())}}function pa(e,t){const s=ot(t)?t.value:t;for(const a of e)if(Tt(a)&&(a.key===t||a.key===s||ot(a.key)&&a.key.value===s))return a}class Hn extends l1{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(Di,t),this.items=[]}static from(t,s,a){const{keepUndefined:r,replacer:c}=a,d=new this(t),f=(p,m)=>{if(typeof c=="function")m=c.call(s,p,m);else if(Array.isArray(c)&&!c.includes(p))return;(m!==void 0||r)&&d.items.push(Ap(p,m,a))};if(s instanceof Map)for(const[p,m]of s)f(p,m);else if(s&&typeof s=="object")for(const p of Object.keys(s))f(p,s[p]);return typeof t.sortMapEntries=="function"&&d.items.sort(t.sortMapEntries),d}add(t,s){let a;Tt(t)?a=t:!t||typeof t!="object"||!("key"in t)?a=new dn(t,t?.value):a=new dn(t.key,t.value);const r=pa(this.items,a.key),c=this.schema?.sortMapEntries;if(r){if(!s)throw new Error(`Key ${a.key} already set`);ot(r.value)&&o1(a.value)?r.value.value=a.value:r.value=a.value}else if(c){const d=this.items.findIndex(f=>c(a,f)<0);d===-1?this.items.push(a):this.items.splice(d,0,a)}else this.items.push(a)}delete(t){const s=pa(this.items,t);return s?this.items.splice(this.items.indexOf(s),1).length>0:!1}get(t,s){const r=pa(this.items,t)?.value;return(!s&&ot(r)?r.value:r)??void 0}has(t){return!!pa(this.items,t)}set(t,s){this.add(new dn(t,s),!0)}toJSON(t,s,a){const r=a?new a:s?.mapAsMap?new Map:{};s?.onCreate&&s.onCreate(r);for(const c of this.items)f1(s,r,c);return r}toString(t,s,a){if(!t)return JSON.stringify(this);for(const r of this.items)if(!Tt(r))throw new Error(`Map items must all be pairs; found ${JSON.stringify(r)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),h1(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:a,onComment:s})}}const $r={collection:"map",default:!0,nodeClass:Hn,tag:"tag:yaml.org,2002:map",resolve(e,t){return ll(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,s)=>Hn.from(e,t,s)};class wa extends l1{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(Mr,t),this.items=[]}add(t){this.items.push(t)}delete(t){const s=Fc(t);return typeof s!="number"?!1:this.items.splice(s,1).length>0}get(t,s){const a=Fc(t);if(typeof a!="number")return;const r=this.items[a];return!s&&ot(r)?r.value:r}has(t){const s=Fc(t);return typeof s=="number"&&s<this.items.length}set(t,s){const a=Fc(t);if(typeof a!="number")throw new Error(`Expected a valid index, not ${t}.`);const r=this.items[a];ot(r)&&o1(s)?r.value=s:this.items[a]=s}toJSON(t,s){const a=[];s?.onCreate&&s.onCreate(a);let r=0;for(const c of this.items)a.push(Zn(c,String(r++),s));return a}toString(t,s,a){return t?h1(this,t,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(t.indent||"")+" ",onChompKeep:a,onComment:s}):JSON.stringify(this)}static from(t,s,a){const{replacer:r}=a,c=new this(t);if(s&&Symbol.iterator in Object(s)){let d=0;for(let f of s){if(typeof r=="function"){const p=s instanceof Set?f:String(d++);f=r.call(s,p,f)}c.items.push(nl(f,void 0,a))}}return c}}function Fc(e){let t=ot(e)?e.value:e;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}const Pr={collection:"seq",default:!0,nodeClass:wa,tag:"tag:yaml.org,2002:seq",resolve(e,t){return cl(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,s)=>wa.from(e,t,s)},Wu={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,s,a){return t=Object.assign({actualString:!0},t),Rp(e,t,s,a)}},ed={identify:e=>e==null,createNode:()=>new Oe(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Oe(null),stringify:({source:e},t)=>typeof e=="string"&&ed.test.test(e)?e:t.options.nullStr},Tp={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new Oe(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},s){if(e&&Tp.test.test(e)){const a=e[0]==="t"||e[0]==="T";if(t===a)return e}return t?s.options.trueStr:s.options.falseStr}};function rs({format:e,minFractionDigits:t,tag:s,value:a}){if(typeof a=="bigint")return String(a);const r=typeof a=="number"?a:Number(a);if(!isFinite(r))return isNaN(r)?".nan":r<0?"-.inf":".inf";let c=Object.is(a,-0)?"-0":JSON.stringify(a);if(!e&&t&&(!s||s==="tag:yaml.org,2002:float")&&/^\d/.test(c)){let d=c.indexOf(".");d<0&&(d=c.length,c+=".");let f=t-(c.length-d-1);for(;f-- >0;)c+="0"}return c}const m1={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:rs},p1={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():rs(e)}},g1={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 Oe(parseFloat(e)),s=e.indexOf(".");return s!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-s-1),t},stringify:rs},td=e=>typeof e=="bigint"||Number.isInteger(e),Dp=(e,t,s,{intAsBigInt:a})=>a?BigInt(e):parseInt(e.substring(t),s);function y1(e,t,s){const{value:a}=e;return td(a)&&a>=0?s+a.toString(t):rs(e)}const v1={identify:e=>td(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,s)=>Dp(e,2,8,s),stringify:e=>y1(e,8,"0o")},b1={identify:td,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,s)=>Dp(e,0,10,s),stringify:rs},x1={identify:e=>td(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,s)=>Dp(e,2,16,s),stringify:e=>y1(e,16,"0x")},w5=[$r,Pr,Wu,ed,Tp,v1,b1,x1,m1,p1,g1];function jx(e){return typeof e=="bigint"||Number.isInteger(e)}const Gc=({value:e})=>JSON.stringify(e),j5=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:Gc},{identify:e=>e==null,createNode:()=>new Oe(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Gc},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:Gc},{identify:jx,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:s})=>s?BigInt(e):parseInt(e,10),stringify:({value:e})=>jx(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:Gc}],N5={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},_5=[$r,Pr].concat(j5,N5),Lp={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof atob=="function"){const s=atob(e.replace(/[\n\r]/g,"")),a=new Uint8Array(s.length);for(let r=0;r<s.length;++r)a[r]=s.charCodeAt(r);return a}else return t("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:t,value:s},a,r,c){if(!s)return"";const d=s;let f;if(typeof btoa=="function"){let p="";for(let m=0;m<d.length;++m)p+=String.fromCharCode(d[m]);f=btoa(p)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=Oe.BLOCK_LITERAL),t!==Oe.QUOTE_DOUBLE){const p=Math.max(a.options.lineWidth-a.indent.length,a.options.minContentWidth),m=Math.ceil(f.length/p),v=new Array(m);for(let y=0,b=0;y<m;++y,b+=p)v[y]=f.substr(b,p);f=v.join(t===Oe.BLOCK_LITERAL?`
146
- `:" ")}return Rp({comment:e,type:t,value:f},a,r,c)}};function S1(e,t){if(cl(e))for(let s=0;s<e.items.length;++s){let a=e.items[s];if(!Tt(a)){if(ll(a)){a.items.length>1&&t("Each pair must have its own sequence indicator");const r=a.items[0]||new dn(new Oe(null));if(a.commentBefore&&(r.key.commentBefore=r.key.commentBefore?`${a.commentBefore}
147
- ${r.key.commentBefore}`:a.commentBefore),a.comment){const c=r.value??r.key;c.comment=c.comment?`${a.comment}
148
- ${c.comment}`:a.comment}a=r}e.items[s]=Tt(a)?a:new dn(a)}}else t("Expected a sequence for this tag");return e}function w1(e,t,s){const{replacer:a}=s,r=new wa(e);r.tag="tag:yaml.org,2002:pairs";let c=0;if(t&&Symbol.iterator in Object(t))for(let d of t){typeof a=="function"&&(d=a.call(t,String(c++),d));let f,p;if(Array.isArray(d))if(d.length===2)f=d[0],p=d[1];else throw new TypeError(`Expected [key, value] tuple: ${d}`);else if(d&&d instanceof Object){const m=Object.keys(d);if(m.length===1)f=m[0],p=d[f];else throw new TypeError(`Expected tuple with one key, not ${m.length} keys`)}else f=d;r.items.push(Ap(f,p,s))}return r}const Mp={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:S1,createNode:w1};class kr extends wa{constructor(){super(),this.add=Hn.prototype.add.bind(this),this.delete=Hn.prototype.delete.bind(this),this.get=Hn.prototype.get.bind(this),this.has=Hn.prototype.has.bind(this),this.set=Hn.prototype.set.bind(this),this.tag=kr.tag}toJSON(t,s){if(!s)return super.toJSON(t);const a=new Map;s?.onCreate&&s.onCreate(a);for(const r of this.items){let c,d;if(Tt(r)?(c=Zn(r.key,"",s),d=Zn(r.value,c,s)):c=Zn(r,"",s),a.has(c))throw new Error("Ordered maps must not include duplicate keys");a.set(c,d)}return a}static from(t,s,a){const r=w1(t,s,a),c=new this;return c.items=r.items,c}}kr.tag="tag:yaml.org,2002:omap";const Up={collection:"seq",identify:e=>e instanceof Map,nodeClass:kr,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const s=S1(e,t),a=[];for(const{key:r}of s.items)ot(r)&&(a.includes(r.value)?t(`Ordered maps must not include duplicate keys: ${r.value}`):a.push(r.value));return Object.assign(new kr,s)},createNode:(e,t,s)=>kr.from(e,t,s)};function j1({value:e,source:t},s){return t&&(e?N1:_1).test.test(t)?t:e?s.options.trueStr:s.options.falseStr}const N1={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 Oe(!0),stringify:j1},_1={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 Oe(!1),stringify:j1},C5={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:rs},k5={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():rs(e)}},z5={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 Oe(parseFloat(e.replace(/_/g,""))),s=e.indexOf(".");if(s!==-1){const a=e.substring(s+1).replace(/_/g,"");a[a.length-1]==="0"&&(t.minFractionDigits=a.length)}return t},stringify:rs},ul=e=>typeof e=="bigint"||Number.isInteger(e);function nd(e,t,s,{intAsBigInt:a}){const r=e[0];if((r==="-"||r==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),a){switch(s){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}const d=BigInt(e);return r==="-"?BigInt(-1)*d:d}const c=parseInt(e,s);return r==="-"?-1*c:c}function $p(e,t,s){const{value:a}=e;if(ul(a)){const r=a.toString(t);return a<0?"-"+s+r.substr(1):s+r}return rs(e)}const E5={identify:ul,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,s)=>nd(e,2,2,s),stringify:e=>$p(e,2,"0b")},O5={identify:ul,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,s)=>nd(e,1,8,s),stringify:e=>$p(e,8,"0")},R5={identify:ul,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,s)=>nd(e,0,10,s),stringify:rs},A5={identify:ul,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,s)=>nd(e,2,16,s),stringify:e=>$p(e,16,"0x")};class zr extends Hn{constructor(t){super(t),this.tag=zr.tag}add(t){let s;Tt(t)?s=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?s=new dn(t.key,null):s=new dn(t,null),pa(this.items,s.key)||this.items.push(s)}get(t,s){const a=pa(this.items,t);return!s&&Tt(a)?ot(a.key)?a.key.value:a.key:a}set(t,s){if(typeof s!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof s}`);const a=pa(this.items,t);a&&!s?this.items.splice(this.items.indexOf(a),1):!a&&s&&this.items.push(new dn(t))}toJSON(t,s){return super.toJSON(t,s,Set)}toString(t,s,a){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),s,a);throw new Error("Set items must all have null values")}static from(t,s,a){const{replacer:r}=a,c=new this(t);if(s&&Symbol.iterator in Object(s))for(let d of s)typeof r=="function"&&(d=r.call(s,d,d)),c.items.push(Ap(d,null,a));return c}}zr.tag="tag:yaml.org,2002:set";const Pp={collection:"map",identify:e=>e instanceof Set,nodeClass:zr,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,s)=>zr.from(e,t,s),resolve(e,t){if(ll(e)){if(e.hasAllNullValues(!0))return Object.assign(new zr,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function Ip(e,t){const s=e[0],a=s==="-"||s==="+"?e.substring(1):e,r=d=>t?BigInt(d):Number(d),c=a.replace(/_/g,"").split(":").reduce((d,f)=>d*r(60)+r(f),r(0));return s==="-"?r(-1)*c:c}function C1(e){let{value:t}=e,s=d=>d;if(typeof t=="bigint")s=d=>BigInt(d);else if(isNaN(t)||!isFinite(t))return rs(e);let a="";t<0&&(a="-",t*=s(-1));const r=s(60),c=[t%r];return t<60?c.unshift(0):(t=(t-c[0])/r,c.unshift(t%r),t>=60&&(t=(t-c[0])/r,c.unshift(t))),a+c.map(d=>String(d).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const k1={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:s})=>Ip(e,s),stringify:C1},z1={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=>Ip(e,!1),stringify:C1},sd={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(sd.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,s,a,r,c,d,f]=t.map(Number),p=t[7]?Number((t[7]+"00").substr(1,3)):0;let m=Date.UTC(s,a-1,r,c||0,d||0,f||0,p);const v=t[8];if(v&&v!=="Z"){let y=Ip(v,!1);Math.abs(y)<30&&(y*=60),m-=6e4*y}return new Date(m)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""},Nx=[$r,Pr,Wu,ed,N1,_1,E5,O5,R5,A5,C5,k5,z5,Lp,Hs,Up,Mp,Pp,k1,z1,sd],_x=new Map([["core",w5],["failsafe",[$r,Pr,Wu]],["json",_5],["yaml11",Nx],["yaml-1.1",Nx]]),Cx={binary:Lp,bool:Tp,float:g1,floatExp:p1,floatNaN:m1,floatTime:z1,int:b1,intHex:x1,intOct:v1,intTime:k1,map:$r,merge:Hs,null:ed,omap:Up,pairs:Mp,seq:Pr,set:Pp,timestamp:sd},T5={"tag:yaml.org,2002:binary":Lp,"tag:yaml.org,2002:merge":Hs,"tag:yaml.org,2002:omap":Up,"tag:yaml.org,2002:pairs":Mp,"tag:yaml.org,2002:set":Pp,"tag:yaml.org,2002:timestamp":sd};function Kh(e,t,s){const a=_x.get(t);if(a&&!e)return s&&!a.includes(Hs)?a.concat(Hs):a.slice();let r=a;if(!r)if(Array.isArray(e))r=[];else{const c=Array.from(_x.keys()).filter(d=>d!=="yaml11").map(d=>JSON.stringify(d)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${c} or define customTags array`)}if(Array.isArray(e))for(const c of e)r=r.concat(c);else typeof e=="function"&&(r=e(r.slice()));return s&&(r=r.concat(Hs)),r.reduce((c,d)=>{const f=typeof d=="string"?Cx[d]:d;if(!f){const p=JSON.stringify(d),m=Object.keys(Cx).map(v=>JSON.stringify(v)).join(", ");throw new Error(`Unknown custom tag ${p}; use one of ${m}`)}return c.includes(f)||c.push(f),c},[])}const D5=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class Bp{constructor({compat:t,customTags:s,merge:a,resolveKnownTags:r,schema:c,sortMapEntries:d,toStringDefaults:f}){this.compat=Array.isArray(t)?Kh(t,"compat"):t?Kh(null,t):null,this.name=typeof c=="string"&&c||"core",this.knownTags=r?T5:{},this.tags=Kh(s,this.name,a),this.toStringOptions=f??null,Object.defineProperty(this,Di,{value:$r}),Object.defineProperty(this,vs,{value:Wu}),Object.defineProperty(this,Mr,{value:Pr}),this.sortMapEntries=typeof d=="function"?d:d===!0?D5:null}clone(){const t=Object.create(Bp.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function L5(e,t){const s=[];let a=t.directives===!0;if(t.directives!==!1&&e.directives){const p=e.directives.toString(e);p?(s.push(p),a=!0):e.directives.docStart&&(a=!0)}a&&s.push("---");const r=u1(e,t),{commentString:c}=r.options;if(e.commentBefore){s.length!==1&&s.unshift("");const p=c(e.commentBefore);s.unshift(qs(p,""))}let d=!1,f=null;if(e.contents){if(At(e.contents)){if(e.contents.spaceBefore&&a&&s.push(""),e.contents.commentBefore){const v=c(e.contents.commentBefore);s.push(qs(v,""))}r.forceBlockIndent=!!e.comment,f=e.contents.comment}const p=f?void 0:()=>d=!0;let m=Ar(e.contents,r,()=>f=null,p);f&&(m+=ma(m,"",c(f))),(m[0]==="|"||m[0]===">")&&s[s.length-1]==="---"?s[s.length-1]=`--- ${m}`:s.push(m)}else s.push(Ar(e.contents,r));if(e.directives?.docEnd)if(e.comment){const p=c(e.comment);p.includes(`
149
- `)?(s.push("..."),s.push(qs(p,""))):s.push(`... ${p}`)}else s.push("...");else{let p=e.comment;p&&d&&(p=p.replace(/^\n+/,"")),p&&((!d||f)&&s[s.length-1]!==""&&s.push(""),s.push(qs(c(p),"")))}return s.join(`
150
- `)+`
151
- `}class id{constructor(t,s,a){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Fn,{value:zm});let r=null;typeof s=="function"||Array.isArray(s)?r=s:a===void 0&&s&&(a=s,s=void 0);const c=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},a);this.options=c;let{version:d}=c;a?._directives?(this.directives=a._directives.atDocument(),this.directives.yaml.explicit&&(d=this.directives.yaml.version)):this.directives=new cn({version:d}),this.setSchema(d,a),this.contents=t===void 0?null:this.createNode(t,r,a)}clone(){const t=Object.create(id.prototype,{[Fn]:{value:zm}});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=At(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){gr(this.contents)&&this.contents.add(t)}addIn(t,s){gr(this.contents)&&this.contents.addIn(t,s)}createAlias(t,s){if(!t.anchor){const a=a1(this);t.anchor=!s||a.has(s)?r1(s||"a",a):s}return new Op(t.anchor)}createNode(t,s,a){let r;if(typeof s=="function")t=s.call({"":t},"",t),r=s;else if(Array.isArray(s)){const _=E=>typeof E=="number"||E instanceof String||E instanceof Number,C=s.filter(_).map(String);C.length>0&&(s=s.concat(C)),r=s}else a===void 0&&s&&(a=s,s=void 0);const{aliasDuplicateObjects:c,anchorPrefix:d,flow:f,keepUndefined:p,onTagObj:m,tag:v}=a??{},{onAnchor:y,setAnchors:b,sourceObjects:x}=l5(this,d||"a"),j={aliasDuplicateObjects:c??!0,keepUndefined:p??!1,onAnchor:y,onTagObj:m,replacer:r,schema:this.schema,sourceObjects:x},w=nl(t,v,j);return f&&Rt(w)&&(w.flow=!0),b(),w}createPair(t,s,a={}){const r=this.createNode(t,null,a),c=this.createNode(s,null,a);return new dn(r,c)}delete(t){return gr(this.contents)?this.contents.delete(t):!1}deleteIn(t){return Po(t)?this.contents==null?!1:(this.contents=null,!0):gr(this.contents)?this.contents.deleteIn(t):!1}get(t,s){return Rt(this.contents)?this.contents.get(t,s):void 0}getIn(t,s){return Po(t)?!s&&ot(this.contents)?this.contents.value:this.contents:Rt(this.contents)?this.contents.getIn(t,s):void 0}has(t){return Rt(this.contents)?this.contents.has(t):!1}hasIn(t){return Po(t)?this.contents!==void 0:Rt(this.contents)?this.contents.hasIn(t):!1}set(t,s){this.contents==null?this.contents=ku(this.schema,[t],s):gr(this.contents)&&this.contents.set(t,s)}setIn(t,s){Po(t)?this.contents=s:this.contents==null?this.contents=ku(this.schema,Array.from(t),s):gr(this.contents)&&this.contents.setIn(t,s)}setSchema(t,s={}){typeof t=="number"&&(t=String(t));let a;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new cn({version:"1.1"}),a={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new cn({version:t}),a={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,a=null;break;default:{const r=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${r}`)}}if(s.schema instanceof Object)this.schema=s.schema;else if(a)this.schema=new Bp(Object.assign(a,s));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:s,mapAsMap:a,maxAliasCount:r,onAnchor:c,reviver:d}={}){const f={anchors:new Map,doc:this,keep:!t,mapAsMap:a===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},p=Zn(this.contents,s??"",f);if(typeof c=="function")for(const{count:m,res:v}of f.anchors.values())c(v,m);return typeof d=="function"?wr(d,{"":p},"",p):p}toJSON(t,s){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:s})}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 s=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${s}`)}return L5(this,t)}}function gr(e){if(Rt(e))return!0;throw new Error("Expected a YAML collection as document contents")}class E1 extends Error{constructor(t,s,a,r){super(),this.name=t,this.code=a,this.message=r,this.pos=s}}class Kc extends E1{constructor(t,s,a){super("YAMLParseError",t,s,a)}}class M5 extends E1{constructor(t,s,a){super("YAMLWarning",t,s,a)}}const kx=(e,t)=>s=>{if(s.pos[0]===-1)return;s.linePos=s.pos.map(f=>t.linePos(f));const{line:a,col:r}=s.linePos[0];s.message+=` at line ${a}, column ${r}`;let c=r-1,d=e.substring(t.lineStarts[a-1],t.lineStarts[a]).replace(/[\n\r]+$/,"");if(c>=60&&d.length>80){const f=Math.min(c-39,d.length-79);d="…"+d.substring(f),c-=f-1}if(d.length>80&&(d=d.substring(0,79)+"…"),a>1&&/^ *$/.test(d.substring(0,c))){let f=e.substring(t.lineStarts[a-2],t.lineStarts[a-1]);f.length>80&&(f=f.substring(0,79)+`…
152
- `),d=f+d}if(/[^ ]/.test(d)){let f=1;const p=s.linePos[1];p?.line===a&&p.col>r&&(f=Math.max(1,Math.min(p.col-r,80-c)));const m=" ".repeat(c)+"^".repeat(f);s.message+=`:
153
-
154
- ${d}
155
- ${m}
156
- `}};function Tr(e,{flow:t,indicator:s,next:a,offset:r,onError:c,parentIndent:d,startOnNewline:f}){let p=!1,m=f,v=f,y="",b="",x=!1,j=!1,w=null,_=null,C=null,E=null,O=null,z=null,M=null;for(const R of e)switch(j&&(R.type!=="space"&&R.type!=="newline"&&R.type!=="comma"&&c(R.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),j=!1),w&&(m&&R.type!=="comment"&&R.type!=="newline"&&c(w,"TAB_AS_INDENT","Tabs are not allowed as indentation"),w=null),R.type){case"space":!t&&(s!=="doc-start"||a?.type!=="flow-collection")&&R.source.includes(" ")&&(w=R),v=!0;break;case"comment":{v||c(R,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const I=R.source.substring(1)||" ";y?y+=b+I:y=I,b="",m=!1;break}case"newline":m?y?y+=R.source:(!z||s!=="seq-item-ind")&&(p=!0):b+=R.source,m=!0,x=!0,(_||C)&&(E=R),v=!0;break;case"anchor":_&&c(R,"MULTIPLE_ANCHORS","A node can have at most one anchor"),R.source.endsWith(":")&&c(R.offset+R.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),_=R,M??(M=R.offset),m=!1,v=!1,j=!0;break;case"tag":{C&&c(R,"MULTIPLE_TAGS","A node can have at most one tag"),C=R,M??(M=R.offset),m=!1,v=!1,j=!0;break}case s:(_||C)&&c(R,"BAD_PROP_ORDER",`Anchors and tags must be after the ${R.source} indicator`),z&&c(R,"UNEXPECTED_TOKEN",`Unexpected ${R.source} in ${t??"collection"}`),z=R,m=s==="seq-item-ind"||s==="explicit-key-ind",v=!1;break;case"comma":if(t){O&&c(R,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),O=R,m=!1,v=!1;break}default:c(R,"UNEXPECTED_TOKEN",`Unexpected ${R.type} token`),m=!1,v=!1}const T=e[e.length-1],L=T?T.offset+T.source.length:r;return j&&a&&a.type!=="space"&&a.type!=="newline"&&a.type!=="comma"&&(a.type!=="scalar"||a.source!=="")&&c(a.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),w&&(m&&w.indent<=d||a?.type==="block-map"||a?.type==="block-seq")&&c(w,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:O,found:z,spaceBefore:p,comment:y,hasNewline:x,anchor:_,tag:C,newlineAfterProp:E,end:L,start:M??L}}function sl(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(`
157
- `))return!0;if(e.end){for(const t of e.end)if(t.type==="newline")return!0}return!1;case"flow-collection":for(const t of e.items){for(const s of t.start)if(s.type==="newline")return!0;if(t.sep){for(const s of t.sep)if(s.type==="newline")return!0}if(sl(t.key)||sl(t.value))return!0}return!1;default:return!0}}function Am(e,t,s){if(t?.type==="flow-collection"){const a=t.end[0];a.indent===e&&(a.source==="]"||a.source==="}")&&sl(t)&&s(a,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function O1(e,t,s){const{uniqueKeys:a}=e.options;if(a===!1)return!1;const r=typeof a=="function"?a:(c,d)=>c===d||ot(c)&&ot(d)&&c.value===d.value;return t.some(c=>r(c.key,s))}const zx="All mapping items must start at the same column";function U5({composeNode:e,composeEmptyNode:t},s,a,r,c){const d=c?.nodeClass??Hn,f=new d(s.schema);s.atRoot&&(s.atRoot=!1);let p=a.offset,m=null;for(const v of a.items){const{start:y,key:b,sep:x,value:j}=v,w=Tr(y,{indicator:"explicit-key-ind",next:b??x?.[0],offset:p,onError:r,parentIndent:a.indent,startOnNewline:!0}),_=!w.found;if(_){if(b&&(b.type==="block-seq"?r(p,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in b&&b.indent!==a.indent&&r(p,"BAD_INDENT",zx)),!w.anchor&&!w.tag&&!x){m=w.end,w.comment&&(f.comment?f.comment+=`
158
- `+w.comment:f.comment=w.comment);continue}(w.newlineAfterProp||sl(b))&&r(b??y[y.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else w.found?.indent!==a.indent&&r(p,"BAD_INDENT",zx);s.atKey=!0;const C=w.end,E=b?e(s,b,w,r):t(s,C,y,null,w,r);s.schema.compat&&Am(a.indent,b,r),s.atKey=!1,O1(s,f.items,E)&&r(C,"DUPLICATE_KEY","Map keys must be unique");const O=Tr(x??[],{indicator:"map-value-ind",next:j,offset:E.range[2],onError:r,parentIndent:a.indent,startOnNewline:!b||b.type==="block-scalar"});if(p=O.end,O.found){_&&(j?.type==="block-map"&&!O.hasNewline&&r(p,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),s.options.strict&&w.start<O.found.offset-1024&&r(E.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const z=j?e(s,j,O,r):t(s,p,x,null,O,r);s.schema.compat&&Am(a.indent,j,r),p=z.range[2];const M=new dn(E,z);s.options.keepSourceTokens&&(M.srcToken=v),f.items.push(M)}else{_&&r(E.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),O.comment&&(E.comment?E.comment+=`
159
- `+O.comment:E.comment=O.comment);const z=new dn(E);s.options.keepSourceTokens&&(z.srcToken=v),f.items.push(z)}}return m&&m<p&&r(m,"IMPOSSIBLE","Map comment with trailing content"),f.range=[a.offset,p,m??p],f}function $5({composeNode:e,composeEmptyNode:t},s,a,r,c){const d=c?.nodeClass??wa,f=new d(s.schema);s.atRoot&&(s.atRoot=!1),s.atKey&&(s.atKey=!1);let p=a.offset,m=null;for(const{start:v,value:y}of a.items){const b=Tr(v,{indicator:"seq-item-ind",next:y,offset:p,onError:r,parentIndent:a.indent,startOnNewline:!0});if(!b.found)if(b.anchor||b.tag||y)y?.type==="block-seq"?r(b.end,"BAD_INDENT","All sequence items must start at the same column"):r(p,"MISSING_CHAR","Sequence item without - indicator");else{m=b.end,b.comment&&(f.comment=b.comment);continue}const x=y?e(s,y,b,r):t(s,b.end,v,null,b,r);s.schema.compat&&Am(a.indent,y,r),p=x.range[2],f.items.push(x)}return f.range=[a.offset,p,m??p],f}function dl(e,t,s,a){let r="";if(e){let c=!1,d="";for(const f of e){const{source:p,type:m}=f;switch(m){case"space":c=!0;break;case"comment":{s&&!c&&a(f,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const v=p.substring(1)||" ";r?r+=d+v:r=v,d="";break}case"newline":r&&(d+=p),c=!0;break;default:a(f,"UNEXPECTED_TOKEN",`Unexpected ${m} at node end`)}t+=p.length}}return{comment:r,offset:t}}const Vh="Block collections are not allowed within flow collections",Qh=e=>e&&(e.type==="block-map"||e.type==="block-seq");function P5({composeNode:e,composeEmptyNode:t},s,a,r,c){const d=a.start.source==="{",f=d?"flow map":"flow sequence",p=c?.nodeClass??(d?Hn:wa),m=new p(s.schema);m.flow=!0;const v=s.atRoot;v&&(s.atRoot=!1),s.atKey&&(s.atKey=!1);let y=a.offset+a.start.source.length;for(let _=0;_<a.items.length;++_){const C=a.items[_],{start:E,key:O,sep:z,value:M}=C,T=Tr(E,{flow:f,indicator:"explicit-key-ind",next:O??z?.[0],offset:y,onError:r,parentIndent:a.indent,startOnNewline:!1});if(!T.found){if(!T.anchor&&!T.tag&&!z&&!M){_===0&&T.comma?r(T.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${f}`):_<a.items.length-1&&r(T.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${f}`),T.comment&&(m.comment?m.comment+=`
160
- `+T.comment:m.comment=T.comment),y=T.end;continue}!d&&s.options.strict&&sl(O)&&r(O,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(_===0)T.comma&&r(T.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${f}`);else if(T.comma||r(T.start,"MISSING_CHAR",`Missing , between ${f} items`),T.comment){let L="";e:for(const R of E)switch(R.type){case"comma":case"space":break;case"comment":L=R.source.substring(1);break e;default:break e}if(L){let R=m.items[m.items.length-1];Tt(R)&&(R=R.value??R.key),R.comment?R.comment+=`
161
- `+L:R.comment=L,T.comment=T.comment.substring(L.length+1)}}if(!d&&!z&&!T.found){const L=M?e(s,M,T,r):t(s,T.end,z,null,T,r);m.items.push(L),y=L.range[2],Qh(M)&&r(L.range,"BLOCK_IN_FLOW",Vh)}else{s.atKey=!0;const L=T.end,R=O?e(s,O,T,r):t(s,L,E,null,T,r);Qh(O)&&r(R.range,"BLOCK_IN_FLOW",Vh),s.atKey=!1;const I=Tr(z??[],{flow:f,indicator:"map-value-ind",next:M,offset:R.range[2],onError:r,parentIndent:a.indent,startOnNewline:!1});if(I.found){if(!d&&!T.found&&s.options.strict){if(z)for(const se of z){if(se===I.found)break;if(se.type==="newline"){r(se,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}T.start<I.found.offset-1024&&r(I.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else M&&("source"in M&&M.source?.[0]===":"?r(M,"MISSING_CHAR",`Missing space after : in ${f}`):r(I.start,"MISSING_CHAR",`Missing , or : between ${f} items`));const ie=M?e(s,M,I,r):I.found?t(s,I.end,z,null,I,r):null;ie?Qh(M)&&r(ie.range,"BLOCK_IN_FLOW",Vh):I.comment&&(R.comment?R.comment+=`
162
- `+I.comment:R.comment=I.comment);const Q=new dn(R,ie);if(s.options.keepSourceTokens&&(Q.srcToken=C),d){const se=m;O1(s,se.items,R)&&r(L,"DUPLICATE_KEY","Map keys must be unique"),se.items.push(Q)}else{const se=new Hn(s.schema);se.flow=!0,se.items.push(Q);const me=(ie??R).range;se.range=[R.range[0],me[1],me[2]],m.items.push(se)}y=ie?ie.range[2]:I.end}}const b=d?"}":"]",[x,...j]=a.end;let w=y;if(x?.source===b)w=x.offset+x.source.length;else{const _=f[0].toUpperCase()+f.substring(1),C=v?`${_} must end with a ${b}`:`${_} in block collection must be sufficiently indented and end with a ${b}`;r(y,v?"MISSING_CHAR":"BAD_INDENT",C),x&&x.source.length!==1&&j.unshift(x)}if(j.length>0){const _=dl(j,w,s.options.strict,r);_.comment&&(m.comment?m.comment+=`
163
- `+_.comment:m.comment=_.comment),m.range=[a.offset,w,_.offset]}else m.range=[a.offset,w,w];return m}function Yh(e,t,s,a,r,c){const d=s.type==="block-map"?U5(e,t,s,a,c):s.type==="block-seq"?$5(e,t,s,a,c):P5(e,t,s,a,c),f=d.constructor;return r==="!"||r===f.tagName?(d.tag=f.tagName,d):(r&&(d.tag=r),d)}function I5(e,t,s,a,r){const c=a.tag,d=c?t.directives.tagName(c.source,b=>r(c,"TAG_RESOLVE_FAILED",b)):null;if(s.type==="block-seq"){const{anchor:b,newlineAfterProp:x}=a,j=b&&c?b.offset>c.offset?b:c:b??c;j&&(!x||x.offset<j.offset)&&r(j,"MISSING_CHAR","Missing newline after block sequence props")}const f=s.type==="block-map"?"map":s.type==="block-seq"?"seq":s.start.source==="{"?"map":"seq";if(!c||!d||d==="!"||d===Hn.tagName&&f==="map"||d===wa.tagName&&f==="seq")return Yh(e,t,s,r,d);let p=t.schema.tags.find(b=>b.tag===d&&b.collection===f);if(!p){const b=t.schema.knownTags[d];if(b?.collection===f)t.schema.tags.push(Object.assign({},b,{default:!1})),p=b;else return b?r(c,"BAD_COLLECTION_TYPE",`${b.tag} used for ${f} collection, but expects ${b.collection??"scalar"}`,!0):r(c,"TAG_RESOLVE_FAILED",`Unresolved tag: ${d}`,!0),Yh(e,t,s,r,d)}const m=Yh(e,t,s,r,d,p),v=p.resolve?.(m,b=>r(c,"TAG_RESOLVE_FAILED",b),t.options)??m,y=At(v)?v:new Oe(v);return y.range=m.range,y.tag=d,p?.format&&(y.format=p.format),y}function B5(e,t,s){const a=t.offset,r=q5(t,e.options.strict,s);if(!r)return{value:"",type:null,comment:"",range:[a,a,a]};const c=r.mode===">"?Oe.BLOCK_FOLDED:Oe.BLOCK_LITERAL,d=t.source?H5(t.source):[];let f=d.length;for(let w=d.length-1;w>=0;--w){const _=d[w][1];if(_===""||_==="\r")f=w;else break}if(f===0){const w=r.chomp==="+"&&d.length>0?`
164
- `.repeat(Math.max(1,d.length-1)):"";let _=a+r.length;return t.source&&(_+=t.source.length),{value:w,type:c,comment:r.comment,range:[a,_,_]}}let p=t.indent+r.indent,m=t.offset+r.length,v=0;for(let w=0;w<f;++w){const[_,C]=d[w];if(C===""||C==="\r")r.indent===0&&_.length>p&&(p=_.length);else{_.length<p&&s(m+_.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),r.indent===0&&(p=_.length),v=w,p===0&&!e.atRoot&&s(m,"BAD_INDENT","Block scalar values in collections must be indented");break}m+=_.length+C.length+1}for(let w=d.length-1;w>=f;--w)d[w][0].length>p&&(f=w+1);let y="",b="",x=!1;for(let w=0;w<v;++w)y+=d[w][0].slice(p)+`
165
- `;for(let w=v;w<f;++w){let[_,C]=d[w];m+=_.length+C.length+1;const E=C[C.length-1]==="\r";if(E&&(C=C.slice(0,-1)),C&&_.length<p){const z=`Block scalar lines must not be less indented than their ${r.indent?"explicit indentation indicator":"first line"}`;s(m-C.length-(E?2:1),"BAD_INDENT",z),_=""}c===Oe.BLOCK_LITERAL?(y+=b+_.slice(p)+C,b=`
166
- `):_.length>p||C[0]===" "?(b===" "?b=`
167
- `:!x&&b===`
168
- `&&(b=`
169
-
170
- `),y+=b+_.slice(p)+C,b=`
171
- `,x=!0):C===""?b===`
172
- `?y+=`
173
- `:b=`
174
- `:(y+=b+C,b=" ",x=!1)}switch(r.chomp){case"-":break;case"+":for(let w=f;w<d.length;++w)y+=`
175
- `+d[w][0].slice(p);y[y.length-1]!==`
176
- `&&(y+=`
177
- `);break;default:y+=`
178
- `}const j=a+r.length+t.source.length;return{value:y,type:c,comment:r.comment,range:[a,j,j]}}function q5({offset:e,props:t},s,a){if(t[0].type!=="block-scalar-header")return a(t[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:r}=t[0],c=r[0];let d=0,f="",p=-1;for(let b=1;b<r.length;++b){const x=r[b];if(!f&&(x==="-"||x==="+"))f=x;else{const j=Number(x);!d&&j?d=j:p===-1&&(p=e+b)}}p!==-1&&a(p,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${r}`);let m=!1,v="",y=r.length;for(let b=1;b<t.length;++b){const x=t[b];switch(x.type){case"space":m=!0;case"newline":y+=x.source.length;break;case"comment":s&&!m&&a(x,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),y+=x.source.length,v=x.source.substring(1);break;case"error":a(x,"UNEXPECTED_TOKEN",x.message),y+=x.source.length;break;default:{const j=`Unexpected token in block scalar header: ${x.type}`;a(x,"UNEXPECTED_TOKEN",j);const w=x.source;w&&typeof w=="string"&&(y+=w.length)}}}return{mode:c,indent:d,chomp:f,comment:v,length:y}}function H5(e){const t=e.split(/\n( *)/),s=t[0],a=s.match(/^( *)/),c=[a?.[1]?[a[1],s.slice(a[1].length)]:["",s]];for(let d=1;d<t.length;d+=2)c.push([t[d],t[d+1]]);return c}function Z5(e,t,s){const{offset:a,type:r,source:c,end:d}=e;let f,p;const m=(b,x,j)=>s(a+b,x,j);switch(r){case"scalar":f=Oe.PLAIN,p=F5(c,m);break;case"single-quoted-scalar":f=Oe.QUOTE_SINGLE,p=G5(c,m);break;case"double-quoted-scalar":f=Oe.QUOTE_DOUBLE,p=K5(c,m);break;default:return s(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${r}`),{value:"",type:null,comment:"",range:[a,a+c.length,a+c.length]}}const v=a+c.length,y=dl(d,v,t,s);return{value:p,type:f,comment:y.comment,range:[a,v,y.offset]}}function F5(e,t){let s="";switch(e[0]){case" ":s="a tab character";break;case",":s="flow indicator character ,";break;case"%":s="directive indicator character %";break;case"|":case">":{s=`block scalar indicator ${e[0]}`;break}case"@":case"`":{s=`reserved character ${e[0]}`;break}}return s&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${s}`),R1(e)}function G5(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),R1(e.slice(1,-1)).replace(/''/g,"'")}function R1(e){let t,s;try{t=new RegExp(`(.*?)(?<![ ])[ ]*\r?
179
- `,"sy"),s=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
180
- `,"sy")}catch{t=/(.*?)[ \t]*\r?\n/sy,s=/[ \t]*(.*?)[ \t]*\r?\n/sy}let a=t.exec(e);if(!a)return e;let r=a[1],c=" ",d=t.lastIndex;for(s.lastIndex=d;a=s.exec(e);)a[1]===""?c===`
181
- `?r+=c:c=`
182
- `:(r+=c+a[1],c=" "),d=s.lastIndex;const f=/[ \t]*(.*)/sy;return f.lastIndex=d,a=f.exec(e),r+c+(a?.[1]??"")}function K5(e,t){let s="";for(let a=1;a<e.length-1;++a){const r=e[a];if(!(r==="\r"&&e[a+1]===`
183
- `))if(r===`
184
- `){const{fold:c,offset:d}=V5(e,a);s+=c,a=d}else if(r==="\\"){let c=e[++a];const d=Q5[c];if(d)s+=d;else if(c===`
185
- `)for(c=e[a+1];c===" "||c===" ";)c=e[++a+1];else if(c==="\r"&&e[a+1]===`
186
- `)for(c=e[++a+1];c===" "||c===" ";)c=e[++a+1];else if(c==="x"||c==="u"||c==="U"){const f={x:2,u:4,U:8}[c];s+=Y5(e,a+1,f,t),a+=f}else{const f=e.substr(a-1,2);t(a-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${f}`),s+=f}}else if(r===" "||r===" "){const c=a;let d=e[a+1];for(;d===" "||d===" ";)d=e[++a+1];d!==`
187
- `&&!(d==="\r"&&e[a+2]===`
188
- `)&&(s+=a>c?e.slice(c,a+1):r)}else s+=r}return(e[e.length-1]!=='"'||e.length===1)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),s}function V5(e,t){let s="",a=e[t+1];for(;(a===" "||a===" "||a===`
189
- `||a==="\r")&&!(a==="\r"&&e[t+2]!==`
190
- `);)a===`
191
- `&&(s+=`
192
- `),t+=1,a=e[t+1];return s||(s=" "),{fold:s,offset:t}}const Q5={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
193
- `,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function Y5(e,t,s,a){const r=e.substr(t,s),d=r.length===s&&/^[0-9a-fA-F]+$/.test(r)?parseInt(r,16):NaN;if(isNaN(d)){const f=e.substr(t-2,s+2);return a(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${f}`),f}return String.fromCodePoint(d)}function A1(e,t,s,a){const{value:r,type:c,comment:d,range:f}=t.type==="block-scalar"?B5(e,t,a):Z5(t,e.options.strict,a),p=s?e.directives.tagName(s.source,y=>a(s,"TAG_RESOLVE_FAILED",y)):null;let m;e.options.stringKeys&&e.atKey?m=e.schema[vs]:p?m=X5(e.schema,r,p,s,a):t.type==="scalar"?m=J5(e,r,t,a):m=e.schema[vs];let v;try{const y=m.resolve(r,b=>a(s??t,"TAG_RESOLVE_FAILED",b),e.options);v=ot(y)?y:new Oe(y)}catch(y){const b=y instanceof Error?y.message:String(y);a(s??t,"TAG_RESOLVE_FAILED",b),v=new Oe(r)}return v.range=f,v.source=r,c&&(v.type=c),p&&(v.tag=p),m.format&&(v.format=m.format),d&&(v.comment=d),v}function X5(e,t,s,a,r){if(s==="!")return e[vs];const c=[];for(const f of e.tags)if(!f.collection&&f.tag===s)if(f.default&&f.test)c.push(f);else return f;for(const f of c)if(f.test?.test(t))return f;const d=e.knownTags[s];return d&&!d.collection?(e.tags.push(Object.assign({},d,{default:!1,test:void 0})),d):(r(a,"TAG_RESOLVE_FAILED",`Unresolved tag: ${s}`,s!=="tag:yaml.org,2002:str"),e[vs])}function J5({atKey:e,directives:t,schema:s},a,r,c){const d=s.tags.find(f=>(f.default===!0||e&&f.default==="key")&&f.test?.test(a))||s[vs];if(s.compat){const f=s.compat.find(p=>p.default&&p.test?.test(a))??s[vs];if(d.tag!==f.tag){const p=t.tagString(d.tag),m=t.tagString(f.tag),v=`Value may be parsed as either ${p} or ${m}`;c(r,"TAG_RESOLVE_FAILED",v,!0)}}return d}function W5(e,t,s){if(t){s??(s=t.length);for(let a=s-1;a>=0;--a){let r=t[a];switch(r.type){case"space":case"comment":case"newline":e-=r.source.length;continue}for(r=t[++a];r?.type==="space";)e+=r.source.length,r=t[++a];break}}return e}const e4={composeNode:T1,composeEmptyNode:qp};function T1(e,t,s,a){const r=e.atKey,{spaceBefore:c,comment:d,anchor:f,tag:p}=s;let m,v=!0;switch(t.type){case"alias":m=t4(e,t,a),(f||p)&&a(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":m=A1(e,t,p,a),f&&(m.anchor=f.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":m=I5(e4,e,t,s,a),f&&(m.anchor=f.source.substring(1));break;default:{const y=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;a(t,"UNEXPECTED_TOKEN",y),m=qp(e,t.offset,void 0,null,s,a),v=!1}}return f&&m.anchor===""&&a(f,"BAD_ALIAS","Anchor cannot be an empty string"),r&&e.options.stringKeys&&(!ot(m)||typeof m.value!="string"||m.tag&&m.tag!=="tag:yaml.org,2002:str")&&a(p??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),c&&(m.spaceBefore=!0),d&&(t.type==="scalar"&&t.source===""?m.comment=d:m.commentBefore=d),e.options.keepSourceTokens&&v&&(m.srcToken=t),m}function qp(e,t,s,a,{spaceBefore:r,comment:c,anchor:d,tag:f,end:p},m){const v={type:"scalar",offset:W5(t,s,a),indent:-1,source:""},y=A1(e,v,f,m);return d&&(y.anchor=d.source.substring(1),y.anchor===""&&m(d,"BAD_ALIAS","Anchor cannot be an empty string")),r&&(y.spaceBefore=!0),c&&(y.comment=c,y.range[2]=p),y}function t4({options:e},{offset:t,source:s,end:a},r){const c=new Op(s.substring(1));c.source===""&&r(t,"BAD_ALIAS","Alias cannot be an empty string"),c.source.endsWith(":")&&r(t+s.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const d=t+s.length,f=dl(a,d,e.strict,r);return c.range=[t,d,f.offset],f.comment&&(c.comment=f.comment),c}function n4(e,t,{offset:s,start:a,value:r,end:c},d){const f=Object.assign({_directives:t},e),p=new id(void 0,f),m={atKey:!1,atRoot:!0,directives:p.directives,options:p.options,schema:p.schema},v=Tr(a,{indicator:"doc-start",next:r??c?.[0],offset:s,onError:d,parentIndent:0,startOnNewline:!0});v.found&&(p.directives.docStart=!0,r&&(r.type==="block-map"||r.type==="block-seq")&&!v.hasNewline&&d(v.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),p.contents=r?T1(m,r,v,d):qp(m,v.end,a,null,v,d);const y=p.contents.range[2],b=dl(c,y,!1,d);return b.comment&&(p.comment=b.comment),p.range=[s,y,b.offset],p}function Uo(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:s}=e;return[t,t+(typeof s=="string"?s.length:1)]}function Ex(e){let t="",s=!1,a=!1;for(let r=0;r<e.length;++r){const c=e[r];switch(c[0]){case"#":t+=(t===""?"":a?`
194
-
195
- `:`
196
- `)+(c.substring(1)||" "),s=!0,a=!1;break;case"%":e[r+1]?.[0]!=="#"&&(r+=1),s=!1;break;default:s||(a=!0),s=!1}}return{comment:t,afterEmptyLine:a}}class s4{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(s,a,r,c)=>{const d=Uo(s);c?this.warnings.push(new M5(d,a,r)):this.errors.push(new Kc(d,a,r))},this.directives=new cn({version:t.version||"1.2"}),this.options=t}decorate(t,s){const{comment:a,afterEmptyLine:r}=Ex(this.prelude);if(a){const c=t.contents;if(s)t.comment=t.comment?`${t.comment}
197
- ${a}`:a;else if(r||t.directives.docStart||!c)t.commentBefore=a;else if(Rt(c)&&!c.flow&&c.items.length>0){let d=c.items[0];Tt(d)&&(d=d.key);const f=d.commentBefore;d.commentBefore=f?`${a}
198
- ${f}`:a}else{const d=c.commentBefore;c.commentBefore=d?`${a}
199
- ${d}`:a}}s?(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:Ex(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(t,s=!1,a=-1){for(const r of t)yield*this.next(r);yield*this.end(s,a)}*next(t){switch(t.type){case"directive":this.directives.add(t.source,(s,a,r)=>{const c=Uo(t);c[0]+=s,this.onError(c,"BAD_DIRECTIVE",a,r)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const s=n4(this.options,this.directives,t,this.onError);this.atDirectives&&!s.directives.docStart&&this.onError(t,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(s,!1),this.doc&&(yield this.doc),this.doc=s,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(t.source);break;case"error":{const s=t.source?`${t.message}: ${JSON.stringify(t.source)}`:t.message,a=new Kc(Uo(t),"UNEXPECTED_TOKEN",s);this.atDirectives||!this.doc?this.errors.push(a):this.doc.errors.push(a);break}case"doc-end":{if(!this.doc){const a="Unexpected doc-end without preceding document";this.errors.push(new Kc(Uo(t),"UNEXPECTED_TOKEN",a));break}this.doc.directives.docEnd=!0;const s=dl(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),s.comment){const a=this.doc.comment;this.doc.comment=a?`${a}
200
- ${s.comment}`:s.comment}this.doc.range[2]=s.offset;break}default:this.errors.push(new Kc(Uo(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(t=!1,s=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(t){const a=Object.assign({_directives:this.directives},this.options),r=new id(void 0,a);this.atDirectives&&this.onError(s,"MISSING_CHAR","Missing directives-end indicator line"),r.range=[0,s,s],this.decorate(r,!1),yield r}}}const D1="\uFEFF",L1="",M1="",Tm="";function i4(e){switch(e){case D1:return"byte-order-mark";case L1:return"doc-mode";case M1:return"flow-error-end";case Tm:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
201
- `:case`\r
202
- `:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}function es(e){switch(e){case void 0:case" ":case`
203
- `:case"\r":case" ":return!0;default:return!1}}const Ox=new Set("0123456789ABCDEFabcdef"),a4=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Vc=new Set(",[]{}"),r4=new Set(` ,[]{}
204
- \r `),Xh=e=>!e||r4.has(e);class o4{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,s=!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=!s;let a=this.next??"stream";for(;a&&(s||this.hasChars(1));)a=yield*this.parseNext(a)}atLineEnd(){let t=this.pos,s=this.buffer[t];for(;s===" "||s===" ";)s=this.buffer[++t];return!s||s==="#"||s===`
205
- `?!0:s==="\r"?this.buffer[t+1]===`
206
- `:!1}charAt(t){return this.buffer[this.pos+t]}continueScalar(t){let s=this.buffer[t];if(this.indentNext>0){let a=0;for(;s===" ";)s=this.buffer[++a+t];if(s==="\r"){const r=this.buffer[a+t+1];if(r===`
207
- `||!r&&!this.atEnd)return t+a+1}return s===`
208
- `||a>=this.indentNext||!s&&!this.atEnd?t+a:-1}if(s==="-"||s==="."){const a=this.buffer.substr(t,3);if((a==="---"||a==="...")&&es(this.buffer[t+3]))return-1}return t}getLine(){let t=this.lineEndPos;return(typeof t!="number"||t!==-1&&t<this.pos)&&(t=this.buffer.indexOf(`
209
- `,this.pos),this.lineEndPos=t),t===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[t-1]==="\r"&&(t-=1),this.buffer.substring(this.pos,t))}hasChars(t){return this.pos+t<=this.buffer.length}setNext(t){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=t,null}peek(t){return this.buffer.substr(this.pos,t)}*parseNext(t){switch(t){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let t=this.getLine();if(t===null)return this.setNext("stream");if(t[0]===D1&&(yield*this.pushCount(1),t=t.substring(1)),t[0]==="%"){let s=t.length,a=t.indexOf("#");for(;a!==-1;){const c=t[a-1];if(c===" "||c===" "){s=a-1;break}else a=t.indexOf("#",a+1)}for(;;){const c=t[s-1];if(c===" "||c===" ")s-=1;else break}const r=(yield*this.pushCount(s))+(yield*this.pushSpaces(!0));return yield*this.pushCount(t.length-r),this.pushNewline(),"stream"}if(this.atLineEnd()){const s=yield*this.pushSpaces(!0);return yield*this.pushCount(t.length-s),yield*this.pushNewline(),"stream"}return yield L1,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 s=this.peek(3);if((s==="---"||s==="...")&&es(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,s==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!es(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[t,s]=this.peek(2);if(!s&&!this.atEnd)return this.setNext("block-start");if((t==="-"||t==="?"||t===":")&&es(s)){const a=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=a,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const t=this.getLine();if(t===null)return this.setNext("doc");let s=yield*this.pushIndicators();switch(t[s]){case"#":yield*this.pushCount(t.length-s);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(Xh),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return s+=yield*this.parseBlockScalarHeader(),s+=yield*this.pushSpaces(!0),yield*this.pushCount(t.length-s),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let t,s,a=-1;do t=yield*this.pushNewline(),t>0?(s=yield*this.pushSpaces(!1),this.indentValue=a=s):s=0,s+=yield*this.pushSpaces(!0);while(t+s>0);const r=this.getLine();if(r===null)return this.setNext("flow");if((a!==-1&&a<this.indentNext&&r[0]!=="#"||a===0&&(r.startsWith("---")||r.startsWith("..."))&&es(r[3]))&&!(a===this.indentNext-1&&this.flowLevel===1&&(r[0]==="]"||r[0]==="}")))return this.flowLevel=0,yield M1,yield*this.parseLineStart();let c=0;for(;r[c]===",";)c+=yield*this.pushCount(1),c+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(c+=yield*this.pushIndicators(),r[c]){case void 0:return"flow";case"#":return yield*this.pushCount(r.length-c),"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(Xh),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const d=this.charAt(1);if(this.flowKey||es(d)||d===",")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 s=this.buffer.indexOf(t,this.pos+1);if(t==="'")for(;s!==-1&&this.buffer[s+1]==="'";)s=this.buffer.indexOf("'",s+2);else for(;s!==-1;){let c=0;for(;this.buffer[s-1-c]==="\\";)c+=1;if(c%2===0)break;s=this.buffer.indexOf('"',s+1)}const a=this.buffer.substring(0,s);let r=a.indexOf(`
210
- `,this.pos);if(r!==-1){for(;r!==-1;){const c=this.continueScalar(r+1);if(c===-1)break;r=a.indexOf(`
211
- `,c)}r!==-1&&(s=r-(a[r-1]==="\r"?2:1))}if(s===-1){if(!this.atEnd)return this.setNext("quoted-scalar");s=this.buffer.length}return yield*this.pushToIndex(s+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let t=this.pos;for(;;){const s=this.buffer[++t];if(s==="+")this.blockScalarKeep=!0;else if(s>"0"&&s<="9")this.blockScalarIndent=Number(s)-1;else if(s!=="-")break}return yield*this.pushUntil(s=>es(s)||s==="#")}*parseBlockScalar(){let t=this.pos-1,s=0,a;e:for(let c=this.pos;a=this.buffer[c];++c)switch(a){case" ":s+=1;break;case`
212
- `:t=c,s=0;break;case"\r":{const d=this.buffer[c+1];if(!d&&!this.atEnd)return this.setNext("block-scalar");if(d===`
213
- `)break}default:break e}if(!a&&!this.atEnd)return this.setNext("block-scalar");if(s>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=s:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{const c=this.continueScalar(t+1);if(c===-1)break;t=this.buffer.indexOf(`
214
- `,c)}while(t!==-1);if(t===-1){if(!this.atEnd)return this.setNext("block-scalar");t=this.buffer.length}}let r=t+1;for(a=this.buffer[r];a===" ";)a=this.buffer[++r];if(a===" "){for(;a===" "||a===" "||a==="\r"||a===`
215
- `;)a=this.buffer[++r];t=r-1}else if(!this.blockScalarKeep)do{let c=t-1,d=this.buffer[c];d==="\r"&&(d=this.buffer[--c]);const f=c;for(;d===" ";)d=this.buffer[--c];if(d===`
216
- `&&c>=this.pos&&c+1+s>f)t=c;else break}while(!0);return yield Tm,yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const t=this.flowLevel>0;let s=this.pos-1,a=this.pos-1,r;for(;r=this.buffer[++a];)if(r===":"){const c=this.buffer[a+1];if(es(c)||t&&Vc.has(c))break;s=a}else if(es(r)){let c=this.buffer[a+1];if(r==="\r"&&(c===`
217
- `?(a+=1,r=`
218
- `,c=this.buffer[a+1]):s=a),c==="#"||t&&Vc.has(c))break;if(r===`
219
- `){const d=this.continueScalar(a+1);if(d===-1)break;a=Math.max(a,d-2)}}else{if(t&&Vc.has(r))break;s=a}return!r&&!this.atEnd?this.setNext("plain-scalar"):(yield Tm,yield*this.pushToIndex(s+1,!0),t?"flow":"doc")}*pushCount(t){return t>0?(yield this.buffer.substr(this.pos,t),this.pos+=t,t):0}*pushToIndex(t,s){const a=this.buffer.slice(this.pos,t);return a?(yield a,this.pos+=a.length,a.length):(s&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(Xh))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const t=this.flowLevel>0,s=this.charAt(1);if(es(s)||t&&Vc.has(s))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,s=this.buffer[t];for(;!es(s)&&s!==">";)s=this.buffer[++t];return yield*this.pushToIndex(s===">"?t+1:t,!1)}else{let t=this.pos+1,s=this.buffer[t];for(;s;)if(a4.has(s))s=this.buffer[++t];else if(s==="%"&&Ox.has(this.buffer[t+1])&&Ox.has(this.buffer[t+2]))s=this.buffer[t+=3];else break;return yield*this.pushToIndex(t,!1)}}*pushNewline(){const t=this.buffer[this.pos];return t===`
220
- `?yield*this.pushCount(1):t==="\r"&&this.charAt(1)===`
221
- `?yield*this.pushCount(2):0}*pushSpaces(t){let s=this.pos-1,a;do a=this.buffer[++s];while(a===" "||t&&a===" ");const r=s-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=s),r}*pushUntil(t){let s=this.pos,a=this.buffer[s];for(;!t(a);)a=this.buffer[++s];return yield*this.pushToIndex(s,!1)}}class l4{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let s=0,a=this.lineStarts.length;for(;s<a;){const c=s+a>>1;this.lineStarts[c]<t?s=c+1:a=c}if(this.lineStarts[s]===t)return{line:s+1,col:1};if(s===0)return{line:0,col:t};const r=this.lineStarts[s-1];return{line:s,col:t-r+1}}}}function _i(e,t){for(let s=0;s<e.length;++s)if(e[s].type===t)return!0;return!1}function Rx(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 U1(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 Qc(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 yr(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 Ax(e){if(e.start.type==="flow-seq-start")for(const t of e.items)t.sep&&!t.value&&!_i(t.start,"explicit-key-ind")&&!_i(t.sep,"map-value-ind")&&(t.key&&(t.value=t.key),delete t.key,U1(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 c4{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 o4,this.onNewLine=t}*parse(t,s=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const a of this.lexer.lex(t,s))yield*this.next(a);s||(yield*this.end())}*next(t){if(this.source=t,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=t.length;return}const s=i4(t);if(s)if(s==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=s,yield*this.step(),s){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 a=`Not a YAML token: ${t}`;yield*this.pop({type:"error",offset:this.offset,message:a,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 s=t??this.stack.pop();if(!s)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield s;else{const a=this.peek(1);switch(s.type==="block-scalar"?s.indent="indent"in a?a.indent:0:s.type==="flow-collection"&&a.type==="document"&&(s.indent=0),s.type==="flow-collection"&&Ax(s),a.type){case"document":a.value=s;break;case"block-scalar":a.props.push(s);break;case"block-map":{const r=a.items[a.items.length-1];if(r.value){a.items.push({start:[],key:s,sep:[]}),this.onKeyLine=!0;return}else if(r.sep)r.value=s;else{Object.assign(r,{key:s,sep:[]}),this.onKeyLine=!r.explicitKey;return}break}case"block-seq":{const r=a.items[a.items.length-1];r.value?a.items.push({start:[],value:s}):r.value=s;break}case"flow-collection":{const r=a.items[a.items.length-1];!r||r.value?a.items.push({start:[],key:s,sep:[]}):r.sep?r.value=s:Object.assign(r,{key:s,sep:[]});return}default:yield*this.pop(),yield*this.pop(s)}if((a.type==="document"||a.type==="block-map"||a.type==="block-seq")&&(s.type==="block-map"||s.type==="block-seq")){const r=s.items[s.items.length-1];r&&!r.sep&&!r.value&&r.start.length>0&&Rx(r.start)===-1&&(s.indent===0||r.start.every(c=>c.type!=="comment"||c.indent<s.indent))&&(a.type==="document"?a.end=r.start:a.items.push({start:r.start}),s.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":{Rx(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 s=this.startBlockValue(t);s?this.stack.push(s):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 s=Qc(this.peek(2)),a=yr(s);let r;t.end?(r=t.end,r.push(this.sourceToken),delete t.end):r=[this.sourceToken];const c={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:a,key:t,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=c}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 s=this.source.indexOf(`
222
- `)+1;for(;s!==0;)this.onNewLine(this.offset+s),s=this.source.indexOf(`
223
- `,s)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(t){const s=t.items[t.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,s.value){const a="end"in s.value?s.value.end:void 0;(Array.isArray(a)?a[a.length-1]:void 0)?.type==="comment"?a?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else s.sep?s.sep.push(this.sourceToken):s.start.push(this.sourceToken);return;case"space":case"comment":if(s.value)t.items.push({start:[this.sourceToken]});else if(s.sep)s.sep.push(this.sourceToken);else{if(this.atIndentedComment(s.start,t.indent)){const r=t.items[t.items.length-2]?.value?.end;if(Array.isArray(r)){Array.prototype.push.apply(r,s.start),r.push(this.sourceToken),t.items.pop();return}}s.start.push(this.sourceToken)}return}if(this.indent>=t.indent){const a=!this.onKeyLine&&this.indent===t.indent,r=a&&(s.sep||s.explicitKey)&&this.type!=="seq-item-ind";let c=[];if(r&&s.sep&&!s.value){const d=[];for(let f=0;f<s.sep.length;++f){const p=s.sep[f];switch(p.type){case"newline":d.push(f);break;case"space":break;case"comment":p.indent>t.indent&&(d.length=0);break;default:d.length=0}}d.length>=2&&(c=s.sep.splice(d[1]))}switch(this.type){case"anchor":case"tag":r||s.value?(c.push(this.sourceToken),t.items.push({start:c}),this.onKeyLine=!0):s.sep?s.sep.push(this.sourceToken):s.start.push(this.sourceToken);return;case"explicit-key-ind":!s.sep&&!s.explicitKey?(s.start.push(this.sourceToken),s.explicitKey=!0):r||s.value?(c.push(this.sourceToken),t.items.push({start:c,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(s.explicitKey)if(s.sep)if(s.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(_i(s.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:c,key:null,sep:[this.sourceToken]}]});else if(U1(s.key)&&!_i(s.sep,"newline")){const d=yr(s.start),f=s.key,p=s.sep;p.push(this.sourceToken),delete s.key,delete s.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:d,key:f,sep:p}]})}else c.length>0?s.sep=s.sep.concat(c,this.sourceToken):s.sep.push(this.sourceToken);else if(_i(s.start,"newline"))Object.assign(s,{key:null,sep:[this.sourceToken]});else{const d=yr(s.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:d,key:null,sep:[this.sourceToken]}]})}else s.sep?s.value||r?t.items.push({start:c,key:null,sep:[this.sourceToken]}):_i(s.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):s.sep.push(this.sourceToken):Object.assign(s,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const d=this.flowScalar(this.type);r||s.value?(t.items.push({start:c,key:d,sep:[]}),this.onKeyLine=!0):s.sep?this.stack.push(d):(Object.assign(s,{key:d,sep:[]}),this.onKeyLine=!0);return}default:{const d=this.startBlockValue(t);if(d){if(d.type==="block-seq"){if(!s.explicitKey&&s.sep&&!_i(s.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 a&&t.items.push({start:c});this.stack.push(d);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){const s=t.items[t.items.length-1];switch(this.type){case"newline":if(s.value){const a="end"in s.value?s.value.end:void 0;(Array.isArray(a)?a[a.length-1]:void 0)?.type==="comment"?a?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else s.start.push(this.sourceToken);return;case"space":case"comment":if(s.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(s.start,t.indent)){const r=t.items[t.items.length-2]?.value?.end;if(Array.isArray(r)){Array.prototype.push.apply(r,s.start),r.push(this.sourceToken),t.items.pop();return}}s.start.push(this.sourceToken)}return;case"anchor":case"tag":if(s.value||this.indent<=t.indent)break;s.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;s.value||_i(s.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):s.start.push(this.sourceToken);return}if(this.indent>t.indent){const a=this.startBlockValue(t);if(a){this.stack.push(a);return}}yield*this.pop(),yield*this.step()}*flowCollection(t){const s=t.items[t.items.length-1];if(this.type==="flow-error-end"){let a;do yield*this.pop(),a=this.peek(1);while(a?.type==="flow-collection")}else if(t.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!s||s.sep?t.items.push({start:[this.sourceToken]}):s.start.push(this.sourceToken);return;case"map-value-ind":!s||s.value?t.items.push({start:[],key:null,sep:[this.sourceToken]}):s.sep?s.sep.push(this.sourceToken):Object.assign(s,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!s||s.value?t.items.push({start:[this.sourceToken]}):s.sep?s.sep.push(this.sourceToken):s.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const r=this.flowScalar(this.type);!s||s.value?t.items.push({start:[],key:r,sep:[]}):s.sep?this.stack.push(r):Object.assign(s,{key:r,sep:[]});return}case"flow-map-end":case"flow-seq-end":t.end.push(this.sourceToken);return}const a=this.startBlockValue(t);a?this.stack.push(a):(yield*this.pop(),yield*this.step())}else{const a=this.peek(2);if(a.type==="block-map"&&(this.type==="map-value-ind"&&a.indent===t.indent||this.type==="newline"&&!a.items[a.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&a.type!=="flow-collection"){const r=Qc(a),c=yr(r);Ax(t);const d=t.end.splice(1,t.end.length);d.push(this.sourceToken);const f={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:c,key:t,sep:d}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=f}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let s=this.source.indexOf(`
224
- `)+1;for(;s!==0;)this.onNewLine(this.offset+s),s=this.source.indexOf(`
225
- `,s)+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 s=Qc(t),a=yr(s);return a.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const s=Qc(t),a=yr(s);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,s){return this.type!=="comment"||this.indent<=s?!1:t.every(a=>a.type==="newline"||a.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 u4(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new l4||null,prettyErrors:t}}function d4(e,t={}){const{lineCounter:s,prettyErrors:a}=u4(t),r=new c4(s?.addNewLine),c=new s4(t),d=Array.from(c.compose(r.parse(e)));if(a&&s)for(const f of d)f.errors.forEach(kx(e,s)),f.warnings.forEach(kx(e,s));return d.length>0?d:Object.assign([],{empty:!0},c.streamInfo())}function f4({onApplied:e}){const[t,s]=N.useState(""),[a,r]=N.useState(!1),[c,d]=N.useState([]),[f,p]=N.useState([]),m=async()=>{if(!t.trim())return;r(!0),d([]),p([]);const v=d4(t),y=[],b=[];for(let x=0;x<v.length;x++){const j=v[x];if(j.errors.length>0){y.push(`Document ${x+1}: ${j.errors[0]?.message}`);continue}const w=j.toJSON();if(!(!w||typeof w!="object"))try{const _=await zj(w);b.push(`Applied "${_.displayName||_.name}" (revision ${_.configRevision})`)}catch(_){y.push(`Document ${x+1}: ${_ instanceof Error?_.message:String(_)}`)}}d(b),p(y),r(!1),b.length>0&&e()};return l.jsxs("section",{className:"mt-8",children:[l.jsx("div",{className:"page-section-divider"}),l.jsx("div",{className:"section-head mt-6",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Config as code"}),l.jsx("h2",{className:"text-sm font-medium text-zinc-200",children:"Apply YAML"})]})}),l.jsxs("p",{className:"text-zinc-500 text-sm mb-3",children:["Paste a ",l.jsx("code",{className:"text-zinc-400",children:"canonry.yaml"})," config (multi-document YAML with ",l.jsx("code",{className:"text-zinc-400",children:"---"})," separators supported)."]}),l.jsx("textarea",{className:"setup-input w-full font-mono text-xs",rows:10,placeholder:`apiVersion: canonry/v1
226
- kind: Project
227
- metadata:
228
- name: my-project
229
- spec:
230
- canonicalDomain: example.com
231
- country: US
232
- language: en
233
- keywords: []`,value:t,onChange:v=>s(v.target.value)}),c.length>0&&l.jsx("ul",{className:"mt-2 space-y-1",children:c.map((v,y)=>l.jsx("li",{className:"text-emerald-400 text-sm",children:v},y))}),f.length>0&&l.jsx("ul",{className:"mt-2 space-y-1",children:f.map((v,y)=>l.jsx("li",{className:"text-rose-400 text-sm",children:v},y))}),l.jsx("div",{className:"mt-3",children:l.jsx(ue,{type:"button",disabled:!t.trim()||a,onClick:m,children:a?"Applying...":"Apply"})})]})}function h4(){const{dashboard:e,refetch:t}=ka(),s=e?.projects??[],a=ja(),[r,c]=N.useState(!1),[d,f]=N.useState(""),[p,m]=N.useState(""),[v,y]=N.useState(""),[b,x]=N.useState("US"),[j,w]=N.useState("en"),[_,C]=N.useState(!1),[E,O]=N.useState(null),z=d.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),M=async()=>{if(!(!z||!v)){C(!0),O(null);try{const T=await al(z,{displayName:p||d,canonicalDomain:v,country:b,language:j});t(),f(""),m(""),y(""),x("US"),w("en"),c(!1),a({to:"/projects/$projectId",params:{projectId:T.id}})}catch(T){O(T instanceof Error?T.message:"Failed to create project")}finally{C(!1)}}};return l.jsxs("div",{className:"page-container",children:[l.jsxs("div",{className:"page-header",children:[l.jsxs("div",{className:"page-header-left",children:[l.jsx("h1",{className:"page-title",children:"Projects"}),l.jsxs("p",{className:"page-subtitle",children:[s.length," project",s.length!==1?"s":""," tracked"]})]}),l.jsx("div",{className:"page-header-right",children:l.jsxs(ue,{type:"button",onClick:()=>c(T=>!T),children:[l.jsx(Cb,{className:"size-4 mr-1.5"}),"Add project"]})})]}),r?l.jsxs(Ve,{className:"surface-card mb-6",children:[l.jsx("div",{className:"section-head",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"New project"}),l.jsx("h2",{className:"text-sm font-medium text-zinc-200",children:"Create a new monitoring project"})]})}),l.jsxs("div",{className:"compact-stack mt-4",children:[l.jsxs("div",{className:"setup-field-row",children:[l.jsxs("div",{className:"setup-field",children:[l.jsx("label",{className:"setup-label",htmlFor:"new-project-name",children:"Project name"}),l.jsx("input",{id:"new-project-name",className:"setup-input",type:"text",placeholder:"my-project",value:d,onChange:T=>f(T.target.value)}),z&&z!==d?l.jsxs("p",{className:"supporting-copy",children:["Slug: ",z]}):null]}),l.jsxs("div",{className:"setup-field",children:[l.jsx("label",{className:"setup-label",htmlFor:"new-display-name",children:"Display name"}),l.jsx("input",{id:"new-display-name",className:"setup-input",type:"text",placeholder:"My Project",value:p,onChange:T=>m(T.target.value)})]})]}),l.jsxs("div",{className:"setup-field",children:[l.jsx("label",{className:"setup-label",htmlFor:"new-domain",children:"Canonical domain"}),l.jsx("input",{id:"new-domain",className:"setup-input",type:"text",placeholder:"example.com",value:v,onChange:T=>y(T.target.value)})]}),l.jsxs("div",{className:"setup-field-row",children:[l.jsxs("div",{className:"setup-field",children:[l.jsx("label",{className:"setup-label",htmlFor:"new-country",children:"Country"}),l.jsx("input",{id:"new-country",className:"setup-input",type:"text",placeholder:"US",maxLength:2,value:b,onChange:T=>x(T.target.value.toUpperCase())})]}),l.jsxs("div",{className:"setup-field",children:[l.jsx("label",{className:"setup-label",htmlFor:"new-language",children:"Language"}),l.jsx("input",{id:"new-language",className:"setup-input",type:"text",placeholder:"en",maxLength:5,value:j,onChange:T=>w(T.target.value.toLowerCase())})]})]})]}),E?l.jsx("p",{className:"text-rose-400 text-sm mt-3",children:E}):null,l.jsxs("div",{className:"flex items-center gap-3 mt-4",children:[l.jsx(ue,{type:"button",disabled:!z||!v||_,onClick:M,children:_?"Creating...":"Create project"}),l.jsx(ue,{type:"button",variant:"ghost",onClick:()=>c(!1),children:"Cancel"})]})]}):null,s.length>0?l.jsx("div",{className:"data-table-wrapper",children:l.jsxs("table",{className:"data-table",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:"Name"}),l.jsx("th",{children:"Domain"}),l.jsx("th",{children:"Visibility"}),l.jsx("th",{children:"Last run"}),l.jsx("th",{className:"text-right",children:"Country"})]})}),l.jsx("tbody",{children:s.map(T=>{const L=T.recentRuns[0];return l.jsxs("tr",{className:"cursor-pointer",onClick:()=>a({to:"/projects/$projectId",params:{projectId:T.project.id}}),children:[l.jsxs("td",{children:[l.jsx(mt,{to:"/projects/$projectId",params:{projectId:T.project.id},className:"text-zinc-100 font-medium hover:underline",onClick:R=>R.stopPropagation(),children:T.project.displayName||T.project.name}),l.jsx("p",{className:"text-[11px] text-zinc-500",children:T.project.name})]}),l.jsx("td",{className:"text-zinc-400",children:T.project.canonicalDomain}),l.jsx("td",{children:l.jsx(yt,{tone:T.visibilitySummary.tone,children:T.visibilitySummary.value})}),l.jsx("td",{className:"text-zinc-500 text-sm",children:L?l.jsx($u,{status:L.status}):l.jsx("span",{className:"text-zinc-600",children:"No runs"})}),l.jsx("td",{className:"text-right text-zinc-500",children:T.project.country})]},T.project.id)})})]})}):r?null:l.jsxs(Ve,{className:"surface-card empty-card",children:[l.jsx("h3",{children:"No projects yet"}),l.jsx("p",{className:"supporting-copy",children:"Create your first monitoring project to start tracking AI visibility."}),l.jsxs(ue,{type:"button",onClick:()=>c(!0),children:[l.jsx(Cb,{className:"size-4 mr-1.5"}),"Add project"]})]}),l.jsx(f4,{onApplied:()=>{t()}})]})}function Fo({text:e}){return l.jsxs("span",{className:"info-tooltip-wrapper",children:[l.jsxs("svg",{className:"info-tooltip-icon",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[l.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.5"}),l.jsx("path",{d:"M8 7v4M8 5.5v0",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),l.jsx("span",{className:"info-tooltip-bubble",role:"tooltip",children:e})]})}function $1({run:e}){const{openRun:t}=ol();return l.jsxs("article",{className:"run-row",children:[l.jsxs("div",{className:"run-row-main",children:[l.jsxs("div",{className:"run-row-head",children:[l.jsxs("div",{children:[l.jsx("p",{className:"run-row-title",children:e.summary}),l.jsxs("p",{className:"run-row-subtitle",children:[e.projectName,e.location?` · ${e.location}`:""," · ",e.kindLabel]})]}),l.jsx($u,{status:e.status})]}),l.jsx("p",{className:"run-row-detail",children:e.statusDetail})]}),l.jsxs("dl",{className:"run-row-meta",children:[l.jsxs("div",{children:[l.jsx("dt",{children:"Started"}),l.jsx("dd",{children:e.startedAt})]}),l.jsxs("div",{children:[l.jsx("dt",{children:"Duration"}),l.jsx("dd",{children:e.duration})]}),l.jsxs("div",{children:[l.jsx("dt",{children:"Trigger"}),l.jsx("dd",{children:e.triggerLabel})]})]}),l.jsx(ue,{variant:"outline",size:"sm",type:"button",onClick:()=>t(e.id),children:"View run"})]})}function au({value:e,label:t,delta:s,tone:a,description:r,tooltip:c,isNumeric:d=!0}){const m=2*Math.PI*48,v=Number.parseInt(e,10),y=d&&!Number.isNaN(v)?Math.min(v/100,1):.5,b=m*(1-y);return l.jsxs("div",{className:"score-gauge",children:[l.jsxs("div",{className:"gauge-ring-wrapper",children:[l.jsxs("svg",{className:"gauge-ring",viewBox:"0 0 120 120","aria-hidden":"true",children:[l.jsx("circle",{className:"gauge-bg",cx:"60",cy:"60",r:48,strokeWidth:6}),l.jsx("circle",{className:`gauge-fill gauge-fill-${a}`,cx:"60",cy:"60",r:48,strokeWidth:6,strokeDasharray:m,strokeDashoffset:b,transform:"rotate(-90 60 60)"})]}),l.jsx("div",{className:"gauge-center",children:l.jsx("span",{className:d?"gauge-value":"gauge-value-text",children:e.split(" / ")[0]})})]}),l.jsxs("p",{className:"gauge-label",children:[t,c&&l.jsx(Fo,{text:c})]}),l.jsx("p",{className:"gauge-delta",children:s}),l.jsx("p",{className:"gauge-description",children:r})]})}function Tx({history:e,maxDots:t=12}){const s=e.slice(-t);if(s.length===0)return l.jsx("span",{className:"text-[11px] text-zinc-600",children:"No data"});const a={cited:"bg-emerald-400","not-cited":"bg-zinc-600",lost:"bg-rose-400",emerging:"bg-amber-400 ring-1 ring-amber-300/60"},r=new Date(s[0].createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"}),c=new Date(s[s.length-1].createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"});return l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx("span",{className:"text-[9px] text-zinc-600 shrink-0",children:r}),l.jsx("div",{className:"flex items-center gap-[3px]",title:`${s.length} runs`,children:s.map((d,f)=>l.jsx("div",{className:`h-2.5 w-2.5 rounded-sm ${a[d.citationState]??"bg-zinc-700"} ${d.model&&f>0&&s[f-1]?.model&&s[f-1].model!==d.model?"ring-1 ring-amber-300/80 ring-offset-1 ring-offset-zinc-950":""}`,title:[d.citationState,new Date(d.createdAt).toLocaleDateString(),d.model?`model ${d.model}`:null,d.model&&f>0&&s[f-1]?.model&&s[f-1].model!==d.model?"model changed":null].filter(Boolean).join(" — ")},f))}),l.jsx("span",{className:"text-[9px] text-zinc-600 shrink-0",children:c})]})}function m4(e){const t=new Map;for(const a of e)for(const r of a.runHistory){const c=t.get(r.createdAt);c?c.states.push(r.citationState):t.set(r.createdAt,{states:[r.citationState],runId:r.runId})}return[...t.entries()].sort(([a],[r])=>a.localeCompare(r)).map(([a,{states:r,runId:c}])=>({runId:c,createdAt:a,citationState:r.includes("cited")?"cited":r.includes("emerging")?"emerging":"not-cited"}))}function p4({evidence:e}){const{openEvidence:t}=ol(),[s,a]=N.useState(new Set),r=N.useMemo(()=>{const d=new Map;for(const f of e){const p=d.get(f.keyword)??[];d.set(f.keyword,[...p,f])}return[...d.entries()].map(([f,p])=>({phrase:f,items:p}))},[e]),c=d=>{a(f=>{const p=new Set(f);return p.has(d)?p.delete(d):p.add(d),p})};return l.jsx("div",{className:"evidence-table-wrap",children:l.jsxs("table",{className:"evidence-table",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{style:{width:"2rem"}}),l.jsx("th",{children:"Key Phrase"}),l.jsx("th",{children:"Status"}),l.jsx("th",{children:"Citation History"}),l.jsx("th",{children:"Change"}),l.jsx("th",{})]})}),l.jsx("tbody",{children:r.map(({phrase:d,items:f})=>{const p=s.has(d),m=f.map(j=>j.citationState),v=m.includes("cited")?"cited":m.includes("emerging")?"emerging":m.includes("lost")?"lost":m.every(j=>j==="pending")?"pending":"not-cited",y=m4(f),b=f.filter(j=>j.citationState==="cited"||j.citationState==="emerging").length,x=(()=>{if(y.length===0)return"Awaiting first run";if(y.length===1)return"First observation";const j=y[y.length-1].citationState,w=y[y.length-2].citationState;if(w!=="cited"&&j==="cited")return"Newly cited";if(w==="cited"&&j!=="cited")return"Lost since last run";let _=0;for(let C=y.length-1;C>=0&&y[C].citationState===j;C--)_++;return j==="cited"?_<=1?"Cited in latest run":`Cited for ${_} runs`:_<=1?"Not cited in latest run":`Not cited across ${_} runs`})();return l.jsxs(N.Fragment,{children:[l.jsxs("tr",{className:"evidence-phrase-row cursor-pointer hover:bg-zinc-800/40",onClick:()=>c(d),"aria-expanded":p,children:[l.jsx("td",{children:l.jsx(Lu,{size:14,className:`transition-transform duration-150 text-zinc-500 ${p?"rotate-90":""}`})}),l.jsx("td",{className:"evidence-keyword-cell",children:l.jsxs("div",{children:[l.jsx("span",{className:"font-medium text-zinc-100",children:d}),l.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:f.map(j=>l.jsx(Xo,{provider:j.provider},j.id))})]})}),l.jsx("td",{children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(wm,{state:v}),l.jsxs("span",{className:"text-[11px] text-zinc-500",children:[b,"/",f.length]})]})}),l.jsx("td",{children:l.jsx(Tx,{history:y})}),l.jsx("td",{className:"evidence-change-cell",children:x}),l.jsx("td",{})]}),p&&f.map(j=>l.jsxs("tr",{className:"bg-zinc-900/30",children:[l.jsx("td",{}),l.jsx("td",{className:"evidence-keyword-cell pl-5",children:l.jsx(Xo,{provider:j.provider})}),l.jsx("td",{children:l.jsx(wm,{state:j.citationState})}),l.jsx("td",{children:l.jsx(Tx,{history:j.runHistory})}),l.jsx("td",{className:"evidence-change-cell",children:j.changeLabel}),l.jsx("td",{children:l.jsx(ue,{variant:"ghost",size:"sm",type:"button",onClick:w=>{w.stopPropagation(),t(j.id)},children:"View"})})]},j.id))]},d)})})]})})}function g4({competitors:e}){return e.length===0?l.jsx("p",{className:"text-sm text-zinc-500",children:"No competitors configured. Add competitors to track overlap."}):l.jsx("div",{className:"competitor-table-wrap",children:l.jsxs("table",{className:"competitor-table",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:"Domain"}),l.jsx("th",{children:"Pressure"}),l.jsx("th",{children:"Citations"}),l.jsx("th",{children:"Key Phrases"})]})}),l.jsx("tbody",{children:e.map(t=>l.jsxs("tr",{children:[l.jsx("td",{className:"font-medium text-zinc-100",children:t.domain}),l.jsx("td",{children:l.jsx(yt,{tone:SE(t.pressureLabel),children:t.pressureLabel})}),l.jsx("td",{className:"text-zinc-300 tabular-nums",children:t.totalKeywords>0?`${t.citationCount} / ${t.totalKeywords}`:"—"}),l.jsx("td",{className:"text-zinc-500 text-xs",children:t.citedKeywords.length>0?t.citedKeywords.join(", "):"Not cited"})]},t.id))})]})})}const y4=["7d","30d","90d","all"],v4=["gap","cited","uncited"],P1={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"};function b4({projectName:e}){const[t,s]=N.useState("30d"),[a,r]=N.useState(null),[c,d]=N.useState(null),[f,p]=N.useState(null),[m,v]=N.useState(null),[y,b]=N.useState(!0);return N.useEffect(()=>{let x=!1;return b(!0),Promise.all([Gj(e,t),Kj(e,t),Vj(e,t)]).then(([j,w,_])=>{x||(r(j),d(w),p(_),b(!1))}).catch(()=>{x||b(!1)}),()=>{x=!0}},[e,t]),y&&!a?l.jsx("p",{className:"text-sm text-zinc-500 py-8 text-center",children:"Loading analytics…"}):l.jsxs(l.Fragment,{children:[l.jsxs("section",{children:[l.jsxs("div",{className:"flex items-center justify-between mb-4",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Citation Metrics"}),l.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Citation Rate Trends ",l.jsx(Fo,{text:"Citation rate over time across all runs within the selected window. Each data point represents the percentage of queries where your brand was cited by AI providers."})]})]}),l.jsx("div",{className:"flex gap-1",children:y4.map(x=>l.jsx("button",{type:"button",className:`px-3 py-1 text-xs rounded-full border transition-colors ${t===x?"bg-zinc-700 border-zinc-600 text-zinc-50":"border-zinc-800 text-zinc-400 hover:border-zinc-700 hover:text-zinc-300"}`,onClick:()=>s(x),children:x==="all"?"All":x},x))})]}),a&&l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"flex items-center gap-6",children:[l.jsx(au,{value:`${Math.round(a.overall.citationRate*100)}`,label:"Citation Rate",delta:`${a.overall.cited} / ${a.overall.total}`,tone:a.trend==="improving"?"positive":a.trend==="declining"?"negative":"neutral",description:`Trend: ${a.trend}`,isNumeric:!0}),l.jsxs("div",{className:"flex-1 space-y-3",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-xs text-zinc-500",children:"Trend"}),l.jsx(yt,{tone:a.trend==="improving"?"positive":a.trend==="declining"?"negative":"neutral",children:a.trend})]}),Object.keys(a.byProvider).length>0&&l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[l.jsx("th",{className:"text-left py-1 font-medium",children:"Provider"}),l.jsx("th",{className:"text-right py-1 font-medium",children:"Rate"}),l.jsx("th",{className:"text-right py-1 font-medium",children:"Cited / Total"})]})}),l.jsx("tbody",{children:Object.entries(a.byProvider).map(([x,j])=>l.jsxs("tr",{className:"border-t border-zinc-800/40",children:[l.jsx("td",{className:"py-1.5 text-zinc-300",children:x}),l.jsxs("td",{className:"py-1.5 text-right text-zinc-200",children:[(j.citationRate*100).toFixed(1),"%"]}),l.jsxs("td",{className:"py-1.5 text-right text-zinc-400",children:[j.cited," / ",j.total]})]},x))})]})]})]}),a.buckets.length>=1&&l.jsx(x4,{buckets:a.buckets})]})]}),l.jsx("div",{className:"page-section-divider"}),l.jsxs("section",{children:[l.jsx("div",{className:"flex items-center justify-between mb-4",children:l.jsxs("div",{children:[l.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Opportunity Analysis"}),l.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Brand Gap Analysis ",l.jsx(Fo,{text:"Classification based on the most recent completed run. Cited: your brand appeared in the AI answer. Gap: a competitor was cited but you were not. Not Cited: neither mentioned. Consistency shows how often each keyword was cited across all runs in the selected window."})]})]})}),c&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"flex gap-1 mb-4",children:v4.map(x=>{const j=x==="cited"?c.cited.length:x==="gap"?c.gap.length:c.uncited.length,w=m===x;return l.jsxs("button",{type:"button",className:`px-3 py-1 text-xs rounded-full border transition-colors ${w?x==="gap"?"bg-amber-900/40 border-amber-700/60 text-amber-300":x==="cited"?"bg-emerald-900/40 border-emerald-700/60 text-emerald-300":"bg-zinc-800/40 border-zinc-700 text-zinc-300":"border-zinc-800 text-zinc-400 hover:border-zinc-700"}`,onClick:()=>v(w?null:x),children:[x==="gap"?"Gap":x==="cited"?"Cited":"Not Cited"," (",j,")"]},x)})}),l.jsx(S4,{gaps:c,filter:m})]})]}),l.jsx("div",{className:"page-section-divider"}),l.jsxs("section",{children:[l.jsxs("div",{className:"mb-4",children:[l.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Source Intelligence"}),l.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Source Origin Breakdown ",l.jsx(Fo,{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&&l.jsxs("div",{className:"space-y-4",children:[l.jsx(w4,{categories:f.overall}),l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[l.jsx("th",{className:"text-left py-1 font-medium",children:"Category"}),l.jsx("th",{className:"text-right py-1 font-medium",children:"Count"}),l.jsx("th",{className:"text-right py-1 font-medium",children:"%"}),l.jsx("th",{className:"text-left py-1 pl-4 font-medium",children:"Top Sources"})]})}),l.jsx("tbody",{children:f.overall.map(x=>l.jsxs("tr",{className:"border-t border-zinc-800/40",children:[l.jsxs("td",{className:"py-1.5 text-zinc-300 flex items-center gap-2",children:[l.jsx("span",{className:`inline-block w-2 h-2 rounded-full ${P1[x.category]??"bg-zinc-600"}`}),x.label]}),l.jsx("td",{className:"py-1.5 text-right text-zinc-200",children:x.count}),l.jsxs("td",{className:"py-1.5 text-right text-zinc-400",children:[(x.percentage*100).toFixed(1),"%"]}),l.jsx("td",{className:"py-1.5 pl-4 text-zinc-500 text-xs truncate max-w-[200px]",children:x.topDomains.slice(0,3).map(j=>j.domain).join(", ")})]},x.category))})]})]}),f&&f.overall.length===0&&l.jsx("p",{className:"text-sm text-zinc-500 py-4",children:"No source data available. Run a visibility sweep first."})]})]})}function x4({buckets:e}){const[t,s]=N.useState(null),a=600,r=140,c={top:24,right:10,bottom:20,left:40},d=a-c.left-c.right,f=r-c.top-c.bottom,p=1,m=e.map((y,b)=>{const x=c.left+(e.length>1?b/(e.length-1)*d:d/2),j=c.top+f-y.citationRate/p*f;return{x,y:j}}),v=m.map(y=>`${y.x},${y.y}`).join(" ");return l.jsx("div",{className:"surface-card rounded-lg p-3 border border-zinc-800/60",children:l.jsxs("svg",{viewBox:`0 0 ${a} ${r}`,className:"w-full h-auto","aria-label":"Citation rate trend chart",onMouseLeave:()=>s(null),children:[l.jsxs("text",{x:c.left-4,y:c.top+4,textAnchor:"end",className:"fill-zinc-500",fontSize:"9",children:[(p*100).toFixed(0),"%"]}),l.jsx("text",{x:c.left-4,y:c.top+f+4,textAnchor:"end",className:"fill-zinc-500",fontSize:"9",children:"0%"}),l.jsx("line",{x1:c.left,y1:c.top+f,x2:c.left+d,y2:c.top+f,stroke:"currentColor",className:"text-zinc-800",strokeWidth:"0.5"}),l.jsx("polyline",{fill:"none",stroke:"currentColor",className:"text-emerald-500",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",points:v}),t!==null&&l.jsx("line",{x1:m[t].x,y1:c.top,x2:m[t].x,y2:c.top+f,stroke:"currentColor",className:"text-zinc-600",strokeWidth:"0.5",strokeDasharray:"3 2"}),e.map((y,b)=>{const{x,y:j}=m[b],w=t===b;return l.jsxs("g",{children:[l.jsx("circle",{cx:x,cy:j,r:"10",fill:"transparent",onMouseEnter:()=>s(b),style:{cursor:"pointer"}}),l.jsx("circle",{cx:x,cy:j,r:w?5:3,className:w?"fill-emerald-400":"fill-emerald-500"})]},b)}),t!==null&&(()=>{const y=e[t],{x:b,y:x}=m[t],j=`${(y.citationRate*100).toFixed(1)}%`,w=y.startDate.slice(5,10),_=56,C=30,E=Math.max(c.left,Math.min(b-_/2,a-c.right-_)),O=x-C-8;return l.jsxs("g",{children:[l.jsx("rect",{x:E,y:O,width:_,height:C,rx:"4",className:"fill-zinc-800",stroke:"currentColor",strokeWidth:"0.5"}),l.jsx("text",{x:E+_/2,y:O+13,textAnchor:"middle",className:"fill-zinc-50",fontSize:"11",fontWeight:"600",children:j}),l.jsx("text",{x:E+_/2,y:O+24,textAnchor:"middle",className:"fill-zinc-400",fontSize:"8",children:w})]})})(),e.map((y,b)=>({b:y,i:b})).filter(({i:y})=>y===0||y===e.length-1||e.length<=7).map(({b:y,i:b})=>{const x=m[b].x;return l.jsx("text",{x,y:r-2,textAnchor:"middle",className:"fill-zinc-500",fontSize:"8",children:y.startDate.slice(5,10)},b)})]})})}function S4({gaps:e,filter:t}){const s=N.useMemo(()=>{const a=[...e.gap.map(r=>({...r,_sort:0})),...e.cited.map(r=>({...r,_sort:1})),...e.uncited.map(r=>({...r,_sort:2}))];return t?a.filter(r=>r.category===t):a.sort((r,c)=>r._sort-c._sort)},[e,t]);return s.length===0?l.jsxs("p",{className:"text-sm text-zinc-500 py-4",children:["No keywords found",t?` with status "${t}"`:"","."]}):l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[l.jsx("th",{className:"text-left py-1 font-medium",children:"Keyword"}),l.jsx("th",{className:"text-left py-1 font-medium",children:"Status"}),l.jsx("th",{className:"text-left py-1 font-medium",children:"Providers Citing"}),l.jsx("th",{className:"text-left py-1 font-medium",children:"Competitors Citing"}),l.jsx("th",{className:"text-right py-1 font-medium",children:"Consistency"})]})}),l.jsx("tbody",{children:s.map(a=>{const r=a.category==="cited"?"positive":a.category==="gap"?"caution":"neutral";return l.jsxs("tr",{className:`border-t border-zinc-800/40 ${a.category==="gap"?"border-l-2 border-l-amber-600/60":""}`,children:[l.jsx("td",{className:"py-1.5 text-zinc-200",children:a.keyword}),l.jsx("td",{className:"py-1.5",children:l.jsx(yt,{tone:r,children:a.category==="gap"?"Gap":a.category==="cited"?"Cited":"Not Cited"})}),l.jsx("td",{className:"py-1.5 text-zinc-400 text-xs",children:a.providers.length>0?a.providers.join(", "):"—"}),l.jsx("td",{className:"py-1.5 text-zinc-400 text-xs",children:a.competitorsCiting.length>0?a.competitorsCiting.join(", "):"—"}),l.jsx("td",{className:"py-1.5 text-right text-zinc-400 text-xs",children:a.consistency.totalRuns>0?`${a.consistency.citedRuns}/${a.consistency.totalRuns} runs`:"—"})]},a.keywordId)})})]})}function w4({categories:e}){const t=e.reduce((s,a)=>s+a.count,0);return t===0?null:l.jsx("div",{className:"flex rounded-full overflow-hidden h-3 bg-zinc-800","aria-label":"Source category distribution",children:e.map(s=>{const a=s.count/t*100;return a<.5?null:l.jsx("div",{className:`${P1[s.category]??"bg-zinc-600"} transition-all`,style:{width:`${a}%`},title:`${s.label}: ${(s.percentage*100).toFixed(1)}%`},s.category)})})}function j4({projectName:e}){const[t,s]=N.useState(!1),[a,r]=N.useState([]),[c,d]=N.useState([]),[f,p]=N.useState([]),[m,v]=N.useState([]),[y,b]=N.useState([]),[x,j]=N.useState(null),[w,_]=N.useState(""),[C,E]=N.useState(""),[O,z]=N.useState("30"),[M,T]=N.useState(!1),[L,R]=N.useState({startDate:"",endDate:"",query:"",page:"",limit:"20"}),[I,ie]=N.useState(""),[Q,se]=N.useState(!0),[me,Ee]=N.useState(!1),[we,H]=N.useState(!1),[Z,oe]=N.useState(!1),[pe,ee]=N.useState(!1),[D,G]=N.useState(!1),[ne,ae]=N.useState(!1),[le,he]=N.useState(!1),[de,Ze]=N.useState(null),[ge,Ye]=N.useState(!1),[ft,fe]=N.useState(!1),[Qe,lt]=N.useState(!1),[Wt,_t]=N.useState(!1),[nn,Gt]=N.useState(null),[Ct,St]=N.useState(""),[sn,re]=N.useState(!1),[Ue,$e]=N.useState(!1),[ke,Te]=N.useState("indexed"),[kt,Qn]=N.useState([]),[bs,Fs]=N.useState(null),[xs,Gs]=N.useState(!1),[os,_e]=N.useState(null),[wn,te]=N.useState(null),Pe=a.find($=>$.connectionType==="gsc"),rd=f.length>0||m.length>0||y.length>0;async function fl($){if(!$){d([]),_("");return}oe(!0);try{const{sites:ce}=await Aj(e);d(ce),_($.propertyId??ce[0]?.siteUrl??"")}catch(ce){d([]),_e(ce instanceof Error?ce.message:"Failed to load Search Console properties")}finally{oe(!1)}}async function Ks(){G(!0);try{const $=await Mj(e,{startDate:L.startDate||void 0,endDate:L.endDate||void 0,query:L.query||void 0,page:L.page||void 0,limit:parseInt(L.limit,10)||20});p($)}catch($){p([]),_e($ instanceof Error?$.message:"Failed to load GSC performance data")}finally{G(!1)}}async function Ss(){ae(!0);try{const[$,ce]=await Promise.all([$j(e,{url:I.trim()||void 0,limit:20}),Pj(e)]);v($),b(ce)}catch($){v([]),b([]),_e($ instanceof Error?$.message:"Failed to load GSC inspection history")}finally{ae(!1)}}async function qi(){Ye(!0);try{const[$,ce]=await Promise.all([Ij(e),Bj(e).catch(()=>[])]);Ze($),Qn(ce)}catch($){Ze(null),Qn([]),_e($ instanceof Error?$.message:"Failed to load coverage data")}finally{Ye(!1)}}async function ls($){Gs(!0),_e(null);try{const ce=await Cm(e,{urls:$}),{succeeded:et,failed:Kt,total:Dt}=ce.summary;te(Kt===0?`Indexing requested for ${et} URL${et!==1?"s":""}.`:`Indexing requested: ${et}/${Dt} succeeded, ${Kt} failed.`)}catch(ce){_e(ce instanceof Error?ce.message:"Failed to request indexing")}finally{Gs(!1)}}async function Ea(){Gs(!0),_e(null);try{const $=await Cm(e,{urls:[],allUnindexed:!0}),{succeeded:ce,failed:et,total:Kt}=$.summary;te(et===0?`Indexing requested for ${ce} unindexed URL${ce!==1?"s":""}.`:`Indexing requested: ${ce}/${Kt} succeeded, ${et} failed.`)}catch($){_e($ instanceof Error?$.message:"Failed to request indexing")}finally{Gs(!1)}}async function cs(){if(Ct.trim()){re(!0),_e(null);try{await Dj(e,"gsc",Ct.trim()),r($=>$.map(ce=>ce.connectionType==="gsc"?{...ce,sitemapUrl:Ct.trim()}:ce)),te("Sitemap URL saved."),St("")}catch($){_e($ instanceof Error?$.message:"Failed to save sitemap URL")}finally{re(!1)}}}async function hl(){lt(!0),_e(null);try{const $=await Zj(e);Gt($.sitemaps),r(ce=>ce.map(et=>et.connectionType==="gsc"?{...et,sitemapUrl:$.primarySitemapUrl}:et)),te(`Discovered ${$.sitemaps.length} sitemap(s). Primary sitemap saved and inspection queued (run ${$.run.id}).`)}catch($){_e($ instanceof Error?$.message:"Failed to discover sitemaps")}finally{lt(!1)}}async function ml(){_t(!0),_e(null);try{const $=await Hj(e);Gt($.sitemaps),$.sitemaps.length===0&&te("No sitemaps found in this GSC property. Submit a sitemap in Google Search Console first.")}catch($){_e($ instanceof Error?$.message:"Failed to list sitemaps")}finally{_t(!1)}}async function Oa(){se(!0),_e(null);try{const[$,ce]=await Promise.all([Np().catch(()=>null),Ej(e).catch(()=>[])]);s(!!$?.google?.configured),r(ce);const et=ce.find(Kt=>Kt.connectionType==="gsc");await Promise.all([fl(et),Ks(),Ss(),qi()])}finally{se(!1)}}N.useEffect(()=>{Oa()},[e]);async function Hi(){if(!t){_e("Google OAuth app credentials are not configured yet. Set them on the Settings page first.");return}Ee(!0),_e(null),te(null);try{const{authUrl:$}=await Oj(e,"gsc");if(!$.startsWith("https://accounts.google.com/")){_e("Unexpected OAuth redirect URL. Please try again.");return}const ce=window.open($,"_blank","width=600,height=700");if(!ce){window.location.assign($);return}te("Finish the Google consent flow in the popup, then close it to refresh this project.");const et=window.setInterval(()=>{ce.closed&&(window.clearInterval(et),te(null),Oa())},1e3)}catch($){_e($ instanceof Error?$.message:"Failed to start OAuth flow")}finally{Ee(!1)}}async function od(){_e(null),te(null);try{await Rj(e,"gsc"),r($=>$.filter(ce=>ce.connectionType!=="gsc")),d([]),_("")}catch($){_e($ instanceof Error?$.message:"Failed to disconnect")}}async function pl(){if(w){ee(!0),_e(null);try{await Tj(e,"gsc",w),r($=>$.map(ce=>ce.connectionType==="gsc"?{...ce,propertyId:w}:ce)),te("GSC property updated.")}catch($){_e($ instanceof Error?$.message:"Failed to save GSC property")}finally{ee(!1)}}}async function gl(){H(!0),_e(null),te(null);try{await Lj(e,{days:parseInt(O,10)||void 0,full:M||void 0}),te("GSC sync queued. Refresh after the run completes to see imported data.")}catch($){_e($ instanceof Error?$.message:"Failed to trigger sync")}finally{H(!1)}}async function Ir(){if(C.trim()){he(!0),_e(null),te(null);try{const $=await Uj(e,C.trim());j($),E(""),await Ss()}catch($){_e($ instanceof Error?$.message:"Failed to inspect URL")}finally{he(!1)}}}return l.jsxs("section",{className:"page-section-divider",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Search Console"}),l.jsx("h2",{children:"Google Search Console"})]}),l.jsx("div",{className:"flex items-center gap-2",children:Pe&&l.jsx(ue,{type:"button",variant:"outline",size:"sm",disabled:D,onClick:()=>{Ks()},children:D?"Refreshing…":"Refresh data"})})]}),os&&l.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:[os,l.jsx("button",{type:"button",className:"ml-2 text-rose-400 hover:text-rose-200",onClick:()=>_e(null),children:"×"})]}),wn&&l.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:[wn,l.jsx("button",{type:"button",className:"ml-2 text-emerald-400 hover:text-emerald-200",onClick:()=>te(null),children:"×"})]}),Q?l.jsx("p",{className:"text-sm text-zinc-500",children:"Loading…"}):l.jsxs("div",{className:"space-y-3",children:[l.jsxs(Ve,{className:"surface-card",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Connection"}),l.jsx("h3",{children:"Domain authorization"})]}),l.jsx(yt,{tone:Pe?"positive":t?"caution":"negative",children:Pe?"Connected":t?"Ready to connect":"App credentials missing"})]}),Pe?l.jsxs("div",{className:"mt-3 space-y-3",children:[l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500"}),l.jsx("span",{className:"text-sm text-zinc-200",children:"Authorized for this project domain"}),l.jsx("span",{className:"text-xs text-zinc-500",children:Pe.domain}),l.jsx("button",{type:"button",className:"ml-auto text-xs text-zinc-500 hover:text-rose-400 transition-colors",onClick:od,children:"Disconnect"})]}),l.jsxs("p",{className:"mt-2 text-xs text-zinc-500",children:["Canonry stores OAuth tokens per canonical domain. This project currently maps to ",l.jsx("code",{children:Pe.domain}),"."]})]}),l.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[l.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Selected property"}),l.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:Pe.propertyId??"No property selected yet"})]}),l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[l.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last auth update"}),l.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:Tc(Pe.updatedAt)})]})]})]}):l.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-5",children:[l.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."}),l.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[t?l.jsx(ue,{type:"button",variant:"outline",size:"sm",disabled:me,onClick:Hi,children:me?"Opening…":"Connect Google Search Console"}):l.jsx(ue,{type:"button",variant:"outline",size:"sm",asChild:!0,children:l.jsx(mt,{to:"/settings",children:"Open Settings"})}),!t&&l.jsx("p",{className:"text-xs text-zinc-500",children:"The same Google OAuth app credentials are shared across all projects."})]})]})]}),Pe&&!Pe.sitemapUrl&&l.jsx("div",{className:"rounded-lg border border-amber-800/40 bg-amber-950/20 px-4 py-3",children:l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsx("span",{className:"mt-0.5 text-amber-400",children:l.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:l.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"})})}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("p",{className:"text-sm font-medium text-amber-300",children:"Set your sitemap URL"}),l.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."}),l.jsxs("div",{className:"mt-2 flex flex-col gap-2",children:[l.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[l.jsx(ue,{type:"button",size:"sm",disabled:Qe||!Pe.propertyId,onClick:hl,children:Qe?"Discovering…":"Auto-discover from GSC"}),l.jsx("span",{className:"self-center text-xs text-amber-400/60",children:"or enter manually:"})]}),l.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[l.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:Ct,onChange:$=>St($.target.value),onKeyDown:$=>$.key==="Enter"&&void cs()}),l.jsx(ue,{type:"button",size:"sm",variant:"outline",disabled:sn||!Ct.trim(),onClick:cs,children:sn?"Saving…":"Save sitemap URL"})]})]})]})]})}),(Pe||rd)&&l.jsxs(l.Fragment,{children:[l.jsxs(Ve,{className:"surface-card",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Coverage"}),l.jsx("h3",{children:"Index coverage"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[de&&de.notIndexed.length>0&&l.jsx(ue,{type:"button",variant:"outline",size:"sm",disabled:xs,onClick:()=>{Ea()},children:xs?"Requesting…":`Request indexing (${de.notIndexed.length})`}),l.jsx(ue,{type:"button",variant:"outline",size:"sm",disabled:ge,onClick:()=>{qi()},children:ge?"Loading…":"Refresh coverage"})]})]}),de&&de.summary.total>0?l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"mt-6 flex flex-col items-center",children:(()=>{const $=de.summary.indexed+de.summary.notIndexed,ce=$>0?de.summary.indexed/$:0,et=$>0?de.summary.notIndexed/$:0,Kt=54,Dt=2*Math.PI*Kt,zt=Dt*(1-ce),wt=Dt*et,jn=Dt*ce;return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"relative h-48 w-48",children:[l.jsxs("svg",{viewBox:"0 0 128 128",className:"h-full w-full","aria-hidden":"true",children:[l.jsx("circle",{cx:"64",cy:"64",r:Kt,fill:"none",stroke:"rgba(255,255,255,0.04)",strokeWidth:"14"}),l.jsx("circle",{cx:"64",cy:"64",r:Kt,fill:"none",stroke:"#10b981",strokeWidth:"14",strokeDasharray:Dt,strokeDashoffset:zt,strokeLinecap:"round",transform:"rotate(-90 64 64)",style:{transition:"stroke-dashoffset 0.6s ease"}}),de.summary.notIndexed>0&&l.jsx("circle",{cx:"64",cy:"64",r:Kt,fill:"none",stroke:"#52525b",strokeWidth:"14",strokeDasharray:`${wt} ${Dt-wt}`,strokeDashoffset:-jn,transform:"rotate(-90 64 64)",style:{transition:"stroke-dasharray 0.6s ease, stroke-dashoffset 0.6s ease"}})]}),l.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[l.jsxs("span",{className:"text-3xl font-bold tabular-nums text-zinc-50",children:[(ce*100).toFixed(0),"%"]}),l.jsx("span",{className:"text-xs uppercase tracking-widest text-zinc-500 mt-0.5",children:"Indexed"})]})]}),l.jsxs("div",{className:"mt-4 flex items-center justify-center gap-8",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full bg-emerald-500"}),l.jsxs("div",{children:[l.jsx("p",{className:"text-2xl font-semibold tabular-nums text-zinc-50",children:de.summary.indexed.toLocaleString()}),l.jsx("p",{className:"text-[11px] uppercase tracking-wide text-zinc-500",children:"Indexed"})]})]}),l.jsx("div",{className:"h-8 w-px bg-zinc-800"}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full bg-zinc-500"}),l.jsxs("div",{children:[l.jsx("p",{className:"text-2xl font-semibold tabular-nums text-zinc-50",children:de.summary.notIndexed.toLocaleString()}),l.jsxs("p",{className:"text-[11px] uppercase tracking-wide text-zinc-500",children:["Not indexed",(de.reasonGroups??[]).length>0&&l.jsxs("span",{className:"ml-1 text-zinc-600",children:["· ",(de.reasonGroups??[]).length," ",(de.reasonGroups??[]).length===1?"reason":"reasons"]})]})]})]}),de.summary.deindexed>0&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"h-8 w-px bg-zinc-800"}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full bg-rose-500"}),l.jsxs("div",{children:[l.jsx("p",{className:"text-2xl font-semibold tabular-nums text-zinc-50",children:de.summary.deindexed.toLocaleString()}),l.jsx("p",{className:"text-[11px] uppercase tracking-wide text-zinc-500",children:"Deindexed"})]})]})]})]})]})})()}),l.jsx("div",{className:"mt-3 flex gap-1",children:["indexed","notIndexed","deindexed"].map($=>{const ce=$==="indexed"?de.indexed.length:$==="notIndexed"?de.notIndexed.length:de.deindexed.length,et=$==="indexed"?"Indexed":$==="notIndexed"?"Not Indexed":"Deindexed";return l.jsxs("button",{type:"button",className:`rounded-full px-3 py-1 text-xs font-medium transition-colors ${ke===$?"bg-zinc-700 text-zinc-100":"text-zinc-400 hover:bg-zinc-800 hover:text-zinc-200"}`,onClick:()=>{Te($),Fs(null)},children:[et," (",ce,")"]},$)})}),l.jsxs("div",{className:"mt-3 overflow-x-auto",children:[ke==="indexed"&&de.indexed.length>0&&l.jsxs("table",{className:"data-table w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{className:"text-left",children:"URL"}),l.jsx("th",{className:"text-left",children:"Verdict"}),l.jsx("th",{className:"text-left",children:"Last Crawl"}),l.jsx("th",{className:"text-left",children:"Mobile"})]})}),l.jsx("tbody",{children:de.indexed.map($=>l.jsxs("tr",{children:[l.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:$.url}),l.jsx("td",{className:"text-zinc-400",children:$.verdict??"Unknown"}),l.jsx("td",{className:"text-zinc-400",children:$.crawlTime?$.crawlTime.split("T")[0]:"—"}),l.jsx("td",{className:"text-zinc-400",children:$.isMobileFriendly===!0?"Yes":$.isMobileFriendly===!1?"No":"—"})]},$.id))})]}),ke==="notIndexed"&&!bs&&(de.reasonGroups??[]).length>0&&l.jsxs("table",{className:"data-table w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{className:"text-left",children:"Reason"}),l.jsx("th",{className:"text-right",children:"Pages"})]})}),l.jsx("tbody",{children:(de.reasonGroups??[]).map($=>l.jsxs("tr",{className:"cursor-pointer hover:bg-zinc-800/40",onClick:()=>Fs($.reason),children:[l.jsx("td",{className:"text-zinc-200",children:$.reason}),l.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:$.count})]},$.reason))})]}),ke==="notIndexed"&&!bs&&(de.reasonGroups??[]).length===0&&de.notIndexed.length>0&&l.jsxs("table",{className:"data-table w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{className:"text-left",children:"URL"}),l.jsx("th",{className:"text-left",children:"Indexing State"}),l.jsx("th",{className:"text-left",children:"Coverage"})]})}),l.jsx("tbody",{children:de.notIndexed.map($=>l.jsxs("tr",{children:[l.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:$.url}),l.jsx("td",{className:"text-zinc-400",children:$.indexingState??"Unknown"}),l.jsx("td",{className:"text-zinc-400",children:$.coverageState??"Unknown"})]},$.id))})]}),ke==="notIndexed"&&bs&&(()=>{const $=(de.reasonGroups??[]).find(ce=>ce.reason===bs);return $?l.jsxs("div",{children:[l.jsx("div",{className:"flex items-center gap-2 mb-3",children:l.jsx("button",{type:"button",className:"text-xs text-zinc-400 hover:text-zinc-200 transition-colors",onClick:()=>Fs(null),children:"\\u2190 Back to reasons"})}),l.jsxs("div",{className:"mb-3 flex items-center justify-between rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium text-zinc-200",children:$.reason}),l.jsxs("p",{className:"mt-1 text-xs text-zinc-500",children:[$.count," affected page",$.count!==1?"s":""]})]}),l.jsx(ue,{type:"button",variant:"outline",size:"sm",disabled:xs,onClick:()=>{ls($.urls.map(ce=>ce.url))},children:xs?"Requesting…":`Request indexing (${$.count})`})]}),l.jsxs("table",{className:"data-table w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{className:"text-left",children:"URL"}),l.jsx("th",{className:"text-left",children:"Last Crawl"}),l.jsx("th",{className:"w-8"})]})}),l.jsx("tbody",{children:$.urls.map(ce=>l.jsxs("tr",{children:[l.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:ce.url}),l.jsx("td",{className:"text-zinc-400",children:ce.crawlTime?ce.crawlTime.split("T")[0]:"—"}),l.jsx("td",{children:l.jsx("button",{type:"button",className:"text-xs text-zinc-500 hover:text-zinc-200 transition-colors",disabled:xs,onClick:()=>{ls([ce.url])},title:"Request indexing",children:"Index"})})]},ce.id))})]})]}):null})(),ke==="deindexed"&&de.deindexed.length>0&&l.jsxs("table",{className:"data-table w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{className:"text-left",children:"URL"}),l.jsx("th",{className:"text-left",children:"Previous"}),l.jsx("th",{className:"text-left",children:"Current"}),l.jsx("th",{className:"text-left",children:"Detected"})]})}),l.jsx("tbody",{children:de.deindexed.map(($,ce)=>l.jsxs("tr",{children:[l.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:$.url}),l.jsx("td",{className:"text-zinc-400",children:$.previousState}),l.jsx("td",{className:"text-zinc-400",children:$.currentState}),l.jsx("td",{className:"text-zinc-400",children:$.transitionDate.split("T")[0]})]},`${$.url}-${ce}`))})]}),(ke==="indexed"&&de.indexed.length===0||ke==="notIndexed"&&!bs&&de.notIndexed.length===0||ke==="deindexed"&&de.deindexed.length===0)&&l.jsx("p",{className:"text-sm text-zinc-500",children:"No URLs in this category."})]})]}):l.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:ge?"Loading coverage data…":"No coverage data yet. Inspect your sitemap to populate this view."})]}),l.jsxs(Ve,{className:"surface-card",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Performance"}),l.jsx("h3",{children:"Search performance"})]}),l.jsx(ue,{type:"button",variant:"outline",size:"sm",disabled:D,onClick:()=>{Ks()},children:D?"Loading…":"Apply filters"})]}),f.length>0&&(()=>{const $=new Map;for(const Ie of f){const tt=$.get(Ie.date);tt?(tt.clicks+=Ie.clicks,tt.impressions+=Ie.impressions):$.set(Ie.date,{clicks:Ie.clicks,impressions:Ie.impressions})}const ce=[...$.entries()].sort(([Ie],[tt])=>Ie.localeCompare(tt));if(ce.length===0)return null;const et=Math.max(...ce.map(([,Ie])=>Ie.impressions),1),Kt=ce.reduce((Ie,[,tt])=>Ie+tt.clicks,0),Dt=ce.reduce((Ie,[,tt])=>Ie+tt.impressions,0),zt=Dt>0?(Kt/Dt*100).toFixed(1):"0.0",wt=700,jn=220,en={top:12,bottom:36,left:48,right:12},ld=wt-en.left-en.right,Vs=jn-en.top-en.bottom,Qs=ld/ce.length,us=Math.max(Math.min(Qs*.35,24),4),Ra=Math.max(us*.15,1),Ys=Ie=>{if(Ie<=0)return 1;const tt=Math.pow(10,Math.floor(Math.log10(Ie))),qt=Ie/tt,an=qt<=1.5?1.5:qt<=3?3:qt<=5?5:10;return Math.ceil(an*tt)},Yn=4,ds=Math.ceil(Ys(et)/Yn)*Yn,Xs=Array.from({length:Yn+1},(Ie,tt)=>ds/Yn*tt),Lt=Ie=>Ie>=1e3?`${(Ie/1e3).toFixed(Ie>=1e4?0:1)}k`:String(Ie);return l.jsxs("div",{className:"mt-3",children:[l.jsxs("div",{className:"flex items-center gap-5 mb-2",children:[l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-sm bg-emerald-500"}),l.jsxs("span",{className:"text-xs text-zinc-400",children:["Clicks ",l.jsx("span",{className:"text-zinc-200 tabular-nums font-medium",children:Kt.toLocaleString()})]})]}),l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-sm bg-blue-500"}),l.jsxs("span",{className:"text-xs text-zinc-400",children:["Impressions ",l.jsx("span",{className:"text-zinc-200 tabular-nums font-medium",children:Dt.toLocaleString()})]})]}),l.jsxs("span",{className:"text-xs text-zinc-500",children:["CTR ",l.jsxs("span",{className:"text-amber-400 tabular-nums font-medium",children:[zt,"%"]})]})]}),l.jsx("div",{className:"relative w-full",style:{aspectRatio:`${wt} / ${jn}`},children:l.jsxs("svg",{viewBox:`0 0 ${wt} ${jn}`,className:"h-full w-full",children:[Xs.map((Ie,tt)=>{const qt=en.top+Vs-Ie/ds*Vs;return l.jsxs("g",{children:[l.jsx("line",{x1:en.left,y1:qt,x2:wt-en.right,y2:qt,stroke:"rgba(255,255,255,0.06)",strokeWidth:"1"}),l.jsx("text",{x:en.left-6,y:qt+3.5,textAnchor:"end",fill:"#a1a1aa",fontSize:"10",fontFamily:"inherit",children:Lt(Ie)})]},`t-${tt}`)}),ce.map(([Ie,tt],qt)=>{const an=en.left+Qs*qt+Qs/2,Aa=tt.impressions/ds*Vs,Br=tt.clicks/ds*Vs;return l.jsxs("g",{children:[l.jsx("title",{children:`${Ie}
234
- Clicks: ${tt.clicks}
235
- Impressions: ${tt.impressions}
236
- CTR: ${tt.impressions>0?(tt.clicks/tt.impressions*100).toFixed(1):0}%`}),l.jsx("rect",{x:an-us-Ra/2,y:en.top+Vs-Aa,width:us,height:Math.max(Aa,1),rx:2,fill:"#3b82f6",opacity:.85}),l.jsx("rect",{x:an+Ra/2,y:en.top+Vs-Br,width:us,height:Math.max(Br,1),rx:2,fill:"#10b981",opacity:.85})]},Ie)}),(()=>{const Ie=Math.min(ce.length,7);return Array.from({length:Ie},(tt,qt)=>{const an=ce.length===1?0:Math.round(qt/(Ie-1)*(ce.length-1)),Aa=en.left+Qs*an+Qs/2;return l.jsx("text",{x:Aa,y:jn-8,textAnchor:"middle",fill:"#71717a",fontSize:"10",fontFamily:"inherit",children:ce[an][0].slice(5)},`xl-${an}`)})})()]})})]})})(),l.jsxs("div",{className:"mt-3 grid gap-2 lg:grid-cols-5",children:[l.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:L.startDate,onChange:$=>R(ce=>({...ce,startDate:$.target.value}))}),l.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:L.endDate,onChange:$=>R(ce=>({...ce,endDate:$.target.value}))}),l.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:L.query,onChange:$=>R(ce=>({...ce,query:$.target.value}))}),l.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:L.page,onChange:$=>R(ce=>({...ce,page:$.target.value}))}),l.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:L.limit,onChange:$=>R(ce=>({...ce,limit:$.target.value}))})]}),f.length>0?l.jsx("div",{className:"mt-3 overflow-x-auto",children:l.jsxs("table",{className:"data-table w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{className:"text-left",children:"Date"}),l.jsx("th",{className:"text-left",children:"Query"}),l.jsx("th",{className:"text-left",children:"Page"}),l.jsx("th",{className:"text-right",children:"Clicks"}),l.jsx("th",{className:"text-right",children:"Impressions"}),l.jsx("th",{className:"text-right",children:"CTR"}),l.jsx("th",{className:"text-right",children:"Position"})]})}),l.jsx("tbody",{children:f.map(($,ce)=>l.jsxs("tr",{children:[l.jsx("td",{className:"text-zinc-400",children:$.date}),l.jsx("td",{className:"max-w-xs truncate text-zinc-200",children:$.query}),l.jsx("td",{className:"max-w-xs truncate text-zinc-400",children:$.page}),l.jsx("td",{className:"text-right tabular-nums text-zinc-300",children:$.clicks.toLocaleString()}),l.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:$.impressions.toLocaleString()}),l.jsxs("td",{className:"text-right tabular-nums text-zinc-400",children:[($.ctr*100).toFixed(1),"%"]}),l.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:$.position.toFixed(1)})]},`${$.date}:${$.query}:${$.page}:${ce}`))})]})}):l.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No performance rows match the current filters yet."})]}),l.jsxs(Ve,{className:"surface-card",children:[l.jsx("div",{className:"section-head",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Inspection"}),l.jsx("h3",{children:"Inspect a URL"})]})}),l.jsxs("div",{className:"mt-3 flex flex-col gap-2 lg:flex-row",children:[l.jsx("input",{className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"url",placeholder:"https://example.com/page",value:C,onChange:$=>E($.target.value),onKeyDown:$=>$.key==="Enter"&&void Ir()}),l.jsx(ue,{type:"button",size:"sm",disabled:le||!Pe?.propertyId||!C.trim(),onClick:Ir,children:le?"Inspecting…":"Inspect URL"})]}),x&&l.jsxs("div",{className:"mt-3 grid gap-3 md:grid-cols-2 xl:grid-cols-4",children:[l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[l.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Indexing state"}),l.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:x.indexingState??"Unknown"})]}),l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[l.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Verdict"}),l.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:x.verdict??"Unknown"})]}),l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[l.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Mobile friendly"}),l.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:kb(x.isMobileFriendly)})]}),l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[l.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last crawl"}),l.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:Tc(x.crawlTime)})]})]})]}),l.jsxs(Ve,{className:"surface-card",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"History"}),l.jsx("h3",{children:"Inspection log"})]}),l.jsx(ue,{type:"button",variant:"outline",size:"sm",disabled:ne,onClick:()=>{Ss()},children:ne?"Loading…":"Refresh history"})]}),l.jsxs("div",{className:"mt-3 flex flex-col gap-2 lg:flex-row",children:[l.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:I,onChange:$=>ie($.target.value)}),l.jsx(ue,{type:"button",size:"sm",variant:"outline",disabled:ne,onClick:()=>{Ss()},children:"Apply filter"})]}),m.length>0?l.jsx("div",{className:"mt-3 overflow-x-auto",children:l.jsxs("table",{className:"data-table w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{className:"text-left",children:"URL"}),l.jsx("th",{className:"text-left",children:"Indexing"}),l.jsx("th",{className:"text-left",children:"Verdict"}),l.jsx("th",{className:"text-left",children:"Coverage"}),l.jsx("th",{className:"text-left",children:"Mobile"}),l.jsx("th",{className:"text-left",children:"Inspected"})]})}),l.jsx("tbody",{children:m.map($=>l.jsxs("tr",{children:[l.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:$.url}),l.jsx("td",{className:"text-zinc-300",children:$.indexingState??"Unknown"}),l.jsx("td",{className:"text-zinc-400",children:$.verdict??"Unknown"}),l.jsx("td",{className:"text-zinc-400",children:$.coverageState??"Unknown"}),l.jsx("td",{className:"text-zinc-400",children:kb($.isMobileFriendly)}),l.jsx("td",{className:"text-zinc-400",children:Tc($.inspectedAt)})]},$.id))})]})}):l.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No inspection history yet."})]}),l.jsxs(Ve,{className:"surface-card",children:[l.jsx("div",{className:"section-head",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Deindexed"}),l.jsx("h3",{children:"Recent indexing losses"})]})}),y.length>0?l.jsx("div",{className:"mt-3 overflow-x-auto",children:l.jsxs("table",{className:"data-table w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{className:"text-left",children:"URL"}),l.jsx("th",{className:"text-left",children:"Previous"}),l.jsx("th",{className:"text-left",children:"Current"}),l.jsx("th",{className:"text-left",children:"Changed at"})]})}),l.jsx("tbody",{children:y.map($=>l.jsxs("tr",{children:[l.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:$.url}),l.jsx("td",{className:"text-zinc-400",children:$.previousState??"Unknown"}),l.jsx("td",{className:"text-zinc-300",children:$.currentState??"Unknown"}),l.jsx("td",{className:"text-zinc-400",children:Tc($.transitionDate)})]},`${$.url}:${$.transitionDate}`))})]})}):l.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No deindexed transitions recorded."})]})]}),Pe&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"border-t border-zinc-800/60 pt-3",children:l.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 text-left",onClick:()=>$e($=>!$),children:[l.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 ${Ue?"rotate-90":""}`,"aria-hidden":"true",children:l.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"})}),l.jsx("span",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Setup & Configuration"})]})}),Ue&&l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"grid gap-3 xl:grid-cols-2",children:[l.jsxs(Ve,{className:"surface-card",children:[l.jsx("div",{className:"section-head",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Property"}),l.jsx("h3",{children:"Pick the Search Console property"})]})}),l.jsxs("div",{className:"mt-3 space-y-2",children:[l.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`gsc-property-${e}`,children:"Property URL"}),l.jsx("select",{id:`gsc-property-${e}`,className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 focus:border-zinc-500 focus:outline-none",value:w,disabled:Z||c.length===0,onChange:$=>_($.target.value),children:c.length===0?l.jsx("option",{value:"",children:Z?"Loading properties…":"No properties available"}):c.map($=>l.jsxs("option",{value:$.siteUrl,children:[$.siteUrl," · ",$.permissionLevel]},$.siteUrl))}),l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsx(ue,{type:"button",size:"sm",variant:"outline",disabled:Z,onClick:()=>{fl(Pe)},children:Z?"Refreshing…":"Refresh properties"}),l.jsx(ue,{type:"button",size:"sm",disabled:!w||pe,onClick:pl,children:pe?"Saving…":"Save property"})]}),l.jsx("p",{className:"text-xs text-zinc-500",children:"The selected property is used for future syncs and URL inspections for this project."})]})]}),l.jsxs(Ve,{className:"surface-card",children:[l.jsx("div",{className:"section-head",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Sync"}),l.jsx("h3",{children:"Import GSC performance data"})]})}),l.jsxs("div",{className:"mt-3 space-y-3",children:[l.jsxs("div",{className:"grid gap-3 sm:grid-cols-[160px_1fr]",children:[l.jsxs("div",{children:[l.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`gsc-sync-days-${e}`,children:"Days"}),l.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:O,onChange:$=>z($.target.value)})]}),l.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:[l.jsx("input",{type:"checkbox",checked:M,onChange:$=>T($.target.checked)}),"Replace existing imported rows for the requested range"]})]}),l.jsx(ue,{type:"button",size:"sm",disabled:we||!Pe.propertyId,onClick:gl,children:we?"Queueing…":"Queue sync"}),!Pe.propertyId&&l.jsx("p",{className:"text-xs text-amber-400",children:"Select a Search Console property before queueing a sync."})]})]})]}),l.jsxs(Ve,{className:"surface-card",children:[l.jsx("div",{className:"section-head",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Sitemap"}),l.jsx("h3",{children:"Sitemap configuration"})]})}),l.jsxs("div",{className:"mt-3 space-y-3",children:[Pe.sitemapUrl&&l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[l.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Current sitemap URL"}),l.jsx("p",{className:"mt-1 text-sm text-zinc-200 break-all",children:Pe.sitemapUrl})]}),l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsx(ue,{type:"button",size:"sm",variant:"outline",disabled:Wt||!Pe.propertyId,onClick:()=>{ml()},children:Wt?"Loading…":"Browse sitemaps from GSC"}),l.jsx(ue,{type:"button",size:"sm",variant:"outline",disabled:Qe||!Pe.propertyId,onClick:hl,children:Qe?"Discovering…":"Auto-discover and queue inspection"})]}),l.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."}),nn&&nn.length>0&&l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3 space-y-2",children:[l.jsxs("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:["Sitemaps (",nn.length,")"]}),nn.map($=>{const ce=$.contents?.[0];return l.jsxs("div",{className:"flex items-start justify-between gap-2 text-xs",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-zinc-200 break-all",children:$.path}),$.lastSubmitted&&l.jsxs("p",{className:"text-zinc-500",children:["Submitted: ",$.lastSubmitted.split("T")[0]]})]}),l.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[ce&&l.jsxs("div",{className:"text-right",children:[l.jsxs("p",{className:"text-zinc-300",children:[ce.indexed," / ",ce.submitted]}),l.jsx("p",{className:"text-zinc-500",children:"indexed"})]}),l.jsx("button",{type:"button",className:"text-xs text-zinc-400 hover:text-zinc-200 transition-colors",onClick:()=>St($.path),children:"Use"})]})]},$.path)})]}),l.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[l.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:Pe.sitemapUrl?"Update sitemap URL…":"https://example.com/sitemap.xml",value:Ct,onChange:$=>St($.target.value),onKeyDown:$=>$.key==="Enter"&&Ct.trim()&&void cs()}),l.jsx(ue,{type:"button",size:"sm",disabled:sn||!Ct.trim(),onClick:cs,children:sn?"Saving…":Pe.sitemapUrl?"Update":"Save"})]}),l.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[l.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}`}),l.jsx(ue,{type:"button",size:"sm",variant:"outline",disabled:ft||!Pe.propertyId,onClick:()=>{const ce=document.getElementById(`gsc-sitemap-inspect-${e}`)?.value?.trim()||Pe.sitemapUrl||void 0;fe(!0),qj(e,{sitemapUrl:ce}).then(et=>{te(`Sitemap inspection queued (run ${et.id}). Refresh coverage after the run completes.`)}).catch(et=>{_e(et instanceof Error?et.message:"Failed to queue sitemap inspection")}).finally(()=>fe(!1))},children:ft?"Queueing…":"Inspect sitemap"})]}),!Pe.propertyId&&l.jsx("p",{className:"text-xs text-amber-400",children:"Select a Search Console property first."})]})]})]})]})]})]})}function N4({project:e,onUpdateProject:t,onRefresh:s}){const[a,r]=N.useState(!1),[c,d]=N.useState(!1),[f,p]=N.useState(null),[m,v]=N.useState(e.displayName),[y,b]=N.useState(e.canonicalDomain),[x,j]=N.useState(e.country),[w,_]=N.useState(e.language),[C,E]=N.useState(e.ownedDomains??[]),[O,z]=N.useState(""),[M,T]=N.useState(null),[L,R]=N.useState(!1),[I,ie]=N.useState(!1),[Q,se]=N.useState(""),[me,Ee]=N.useState(""),[we,H]=N.useState(""),[Z,oe]=N.useState(""),[pe,ee]=N.useState("");N.useEffect(()=>{a||(v(e.displayName),b(e.canonicalDomain),j(e.country),_(e.language),E(e.ownedDomains??[]))},[e,a]);function D(){r(!1),p(null),v(e.displayName),b(e.canonicalDomain),j(e.country),_(e.language),E(e.ownedDomains??[]),z("")}function G(){const fe=O.trim();fe&&(C.includes(fe)||E([...C,fe]),z(""))}function ne(fe){E(C.filter(Qe=>Qe!==fe))}async function ae(){if(!(!m.trim()||!y.trim()||!x.trim()||!w.trim())){d(!0),p(null);try{await t(e.name,{displayName:m.trim(),canonicalDomain:y.trim(),ownedDomains:C,country:x.trim(),language:w.trim()}),r(!1)}catch(fe){p(fe instanceof Error?fe.message:"Failed to save")}finally{d(!1)}}}async function le(){const fe=Q.trim(),Qe=me.trim(),lt=we.trim(),Wt=Z.trim();if(!(!fe||!Qe||!lt||!Wt)){R(!0),T(null);try{const _t={label:fe,city:Qe,region:lt,country:Wt};pe.trim()&&(_t.timezone=pe.trim()),await mj(e.name,_t),s(),se(""),Ee(""),H(""),oe(""),ee(""),ie(!1)}catch(_t){T(_t instanceof Error?_t.message:"Failed to add location")}finally{R(!1)}}}async function he(fe){R(!0),T(null);try{await pj(e.name,fe),s()}catch(Qe){T(Qe instanceof Error?Qe.message:"Failed to remove location")}finally{R(!1)}}async function de(fe){R(!0),T(null);try{await gj(e.name,fe),s()}catch(Qe){T(Qe instanceof Error?Qe.message:"Failed to set default location")}finally{R(!1)}}const Ze=m!==e.displayName||y!==e.canonicalDomain||x!==e.country||w!==e.language||JSON.stringify(C)!==JSON.stringify(e.ownedDomains??[]),ge="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",Ye="block text-xs font-medium text-zinc-400 mb-1",ft=Q.trim()&&me.trim()&&we.trim()&&Z.trim();return l.jsxs("section",{className:"page-section-divider",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Configuration"}),l.jsx("h2",{children:"Project settings"})]}),!a&&l.jsx(ue,{type:"button",variant:"outline",size:"sm",onClick:()=>r(!0),children:"Edit settings"})]}),f&&l.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:[f,l.jsx("button",{type:"button",className:"ml-2 text-rose-400 hover:text-rose-200",onClick:()=>p(null),children:"×"})]}),a?l.jsxs("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900/40 p-4 space-y-4",children:[l.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[l.jsxs("div",{children:[l.jsx("label",{className:Ye,children:"Display name"}),l.jsx("input",{className:ge,type:"text",value:m,onChange:fe=>v(fe.target.value),placeholder:"My Project"})]}),l.jsxs("div",{children:[l.jsx("label",{className:Ye,children:"Canonical domain"}),l.jsx("input",{className:ge,type:"text",value:y,onChange:fe=>b(fe.target.value),placeholder:"example.com"})]}),l.jsxs("div",{children:[l.jsx("label",{className:Ye,children:"Country"}),l.jsx("input",{className:ge,type:"text",value:x,onChange:fe=>j(fe.target.value),placeholder:"US",maxLength:2})]}),l.jsxs("div",{children:[l.jsx("label",{className:Ye,children:"Language"}),l.jsx("input",{className:ge,type:"text",value:w,onChange:fe=>_(fe.target.value),placeholder:"en"})]})]}),l.jsxs("div",{children:[l.jsx("label",{className:Ye,children:"Owned domains"}),l.jsx("div",{className:"flex flex-wrap gap-1.5 mb-2",children:C.map(fe=>l.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-zinc-700/60 bg-zinc-800/40 px-2 py-0.5 text-xs text-zinc-300",children:[fe,l.jsx("button",{type:"button",className:"ml-0.5 text-zinc-500 hover:text-zinc-200 transition-colors",onClick:()=>ne(fe),"aria-label":`Remove ${fe}`,children:"×"})]},fe))}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx("input",{className:`${ge} flex-1`,type:"text",placeholder:"docs.example.com",value:O,onChange:fe=>z(fe.target.value),onKeyDown:fe=>fe.key==="Enter"&&(fe.preventDefault(),G())}),l.jsx(ue,{type:"button",variant:"outline",size:"sm",disabled:!O.trim(),onClick:G,children:"Add"})]})]}),l.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t border-zinc-800/60",children:[l.jsx(ue,{type:"button",disabled:c||!Ze||!m.trim()||!y.trim(),onClick:ae,children:c?"Saving...":"Save changes"}),l.jsx(ue,{type:"button",variant:"outline",disabled:c,onClick:D,children:"Cancel"})]})]}):l.jsx("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 overflow-hidden",children:l.jsx("table",{className:"w-full text-sm",children:l.jsxs("tbody",{children:[l.jsxs("tr",{className:"border-b border-zinc-800/40",children:[l.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium w-40",children:"Display name"}),l.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.displayName||"—"})]}),l.jsxs("tr",{className:"border-b border-zinc-800/40",children:[l.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Canonical domain"}),l.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.canonicalDomain})]}),l.jsxs("tr",{className:"border-b border-zinc-800/40",children:[l.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Owned domains"}),l.jsx("td",{className:"px-4 py-2.5",children:(e.ownedDomains??[]).length>0?l.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.ownedDomains.map(fe=>l.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:fe},fe))}):l.jsx("span",{className:"text-zinc-500",children:"\\u2014"})})]}),l.jsxs("tr",{className:"border-b border-zinc-800/40",children:[l.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Country"}),l.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.country})]}),l.jsxs("tr",{className:"border-b border-zinc-800/40",children:[l.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Language"}),l.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.language})]}),l.jsxs("tr",{children:[l.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium align-top pt-3",children:"Locations"}),l.jsxs("td",{className:"px-4 py-2.5",children:[M&&l.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:[M,l.jsx("button",{type:"button",className:"ml-1 text-rose-400 hover:text-rose-200",onClick:()=>T(null),children:"×"})]}),(e.locations??[]).length>0?l.jsxs("table",{className:"w-full text-xs mb-2",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"text-zinc-600",children:[l.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Label"}),l.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"City"}),l.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Region"}),l.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Country"}),l.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Timezone"}),l.jsx("th",{className:"pb-1"})]})}),l.jsx("tbody",{children:e.locations.map(fe=>l.jsxs("tr",{className:"border-t border-zinc-800/30",children:[l.jsx("td",{className:"py-1.5 pr-3",children:l.jsxs("span",{className:`inline-flex items-center gap-1 rounded-full border px-1.5 py-0.5 text-[10px] font-medium ${fe.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:[fe.label,fe.label===e.defaultLocation?" ★":""]})}),l.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:fe.city}),l.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:fe.region}),l.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:fe.country}),l.jsx("td",{className:"py-1.5 pr-3 text-zinc-500",children:fe.timezone??"—"}),l.jsx("td",{className:"py-1.5",children:l.jsxs("div",{className:"flex items-center gap-1.5",children:[fe.label!==e.defaultLocation&&l.jsx("button",{type:"button",disabled:L,onClick:()=>de(fe.label),className:"text-[10px] text-zinc-500 hover:text-emerald-400 transition-colors disabled:opacity-40","aria-label":`Set ${fe.label} as default location`,children:"Set default"}),l.jsx("button",{type:"button",disabled:L,onClick:()=>he(fe.label),className:"text-[10px] text-zinc-500 hover:text-rose-400 transition-colors disabled:opacity-40","aria-label":`Remove location ${fe.label}`,children:"Remove"})]})})]},fe.label))})]}):l.jsx("p",{className:"text-zinc-500 text-xs mb-2",children:"No locations configured"}),I?l.jsxs("div",{className:"mt-2 rounded border border-zinc-800 bg-zinc-900/50 p-3 space-y-2",children:[l.jsx("p",{className:"text-[10px] font-medium uppercase tracking-wide text-zinc-500",children:"Add location"}),l.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[l.jsxs("div",{children:[l.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Label *"}),l.jsx("input",{className:ge,type:"text",value:Q,onChange:fe=>se(fe.target.value),placeholder:"nyc"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"City *"}),l.jsx("input",{className:ge,type:"text",value:me,onChange:fe=>Ee(fe.target.value),placeholder:"New York"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Region *"}),l.jsx("input",{className:ge,type:"text",value:we,onChange:fe=>H(fe.target.value),placeholder:"NY"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Country *"}),l.jsx("input",{className:ge,type:"text",value:Z,onChange:fe=>oe(fe.target.value),placeholder:"US",maxLength:2})]}),l.jsxs("div",{className:"col-span-2",children:[l.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Timezone (optional)"}),l.jsx("input",{className:ge,type:"text",value:pe,onChange:fe=>ee(fe.target.value),placeholder:"America/New_York"})]})]}),l.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[l.jsx(ue,{type:"button",size:"sm",disabled:L||!ft,onClick:le,children:L?"Adding...":"Add location"}),l.jsx(ue,{type:"button",size:"sm",variant:"outline",disabled:L,onClick:()=>{ie(!1),T(null)},children:"Cancel"})]})]}):l.jsx(ue,{type:"button",size:"sm",variant:"outline",onClick:()=>ie(!0),children:"+ Add location"})]})]})]})})})]})}const _4=[{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"}],Dx=["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 C4({projectName:e}){const[t,s]=N.useState("loading"),[a,r]=N.useState(!1),[c,d]=N.useState("daily"),[f,p]=N.useState(6),[m,v]=N.useState(""),[y,b]=N.useState("UTC"),[x,j]=N.useState(!1),[w,_]=N.useState(""),[C,E]=N.useState(!1),[O,z]=N.useState(!1),[M,T]=N.useState(null);N.useEffect(()=>{Sj(e).then(s).catch(()=>s(null))},[e]);const L=()=>{if(t&&t!=="loading"){const Q=v2(t.preset??null,t.cronExpr);d(Q.freq),p(Q.hour),v(Q.customCron);const se=Dx.includes(t.timezone);b(se?t.timezone:"Other"),j(!se),_(se?"":t.timezone)}else d("daily"),p(6),v(""),b("UTC"),j(!1),_("");T(null),r(!0)},R=async()=>{E(!0),T(null);try{const se={timezone:x?w.trim()||"UTC":y};c==="custom"?se.cron=m.trim():se.preset=y2(c,f);const me=await Nm(e,se);s(me),r(!1)}catch(Q){T(Q instanceof Error?Q.message:"Failed to save schedule")}finally{E(!1)}},I=async()=>{if(!(!t||t==="loading")){E(!0),T(null);try{const Q={timezone:t.timezone,enabled:!t.enabled};t.preset?Q.preset=t.preset:Q.cron=t.cronExpr,s(await Nm(e,Q))}catch(Q){T(Q instanceof Error?Q.message:"Failed to update schedule")}finally{E(!1)}}},ie=async()=>{z(!0),T(null);try{await wj(e),s(null),r(!1)}catch(Q){T(Q instanceof Error?Q.message:"Failed to remove schedule")}finally{z(!1)}};return l.jsxs("section",{className:"page-section-divider",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Automation"}),l.jsx("h2",{children:"Scheduled runs"})]}),t!=="loading"&&!a&&l.jsx(ue,{type:"button",variant:"outline",size:"sm",onClick:L,children:t?"Edit schedule":"+ Set schedule"})]}),t==="loading"&&l.jsx("p",{className:"supporting-copy",children:"Loading..."}),t!=="loading"&&!a&&t===null&&l.jsx(Ve,{className:"surface-card compact-card",children:l.jsx("p",{className:"supporting-copy",children:"No schedule configured. Set one to automatically trigger visibility sweeps."})}),t!=="loading"&&!a&&t!==null&&l.jsxs(Ve,{className:"surface-card compact-card",children:[l.jsxs("div",{className:"flex items-start justify-between gap-4",children:[l.jsxs("div",{className:"space-y-1",children:[l.jsx("p",{className:"text-sm font-medium text-zinc-200",children:b2(t.preset??null,t.cronExpr,t.timezone)}),l.jsxs("p",{className:"text-xs text-zinc-500",children:["Cron: ",l.jsx("span",{className:"font-mono",children:t.cronExpr})]}),t.nextRunAt&&l.jsxs("p",{className:"text-xs text-zinc-500",children:["Next run: ",new Date(t.nextRunAt).toLocaleString()]}),t.lastRunAt&&l.jsxs("p",{className:"text-xs text-zinc-500",children:["Last run: ",new Date(t.lastRunAt).toLocaleString()]})]}),l.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[l.jsx(yt,{tone:t.enabled?"positive":"neutral",children:t.enabled?"Active":"Paused"}),l.jsx(ue,{type:"button",variant:"outline",size:"sm",disabled:C,onClick:I,children:t.enabled?"Pause":"Resume"}),l.jsx(ue,{type:"button",variant:"ghost",size:"sm",disabled:O,onClick:ie,children:O?"Removing...":"Remove"})]})]}),M&&l.jsx("p",{className:"text-rose-400 text-sm mt-2",children:M})]}),a&&l.jsxs("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900/40 p-4 space-y-3",children:[l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Frequency"}),l.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:c,onChange:Q=>d(Q.target.value),children:_4.map(Q=>l.jsx("option",{value:Q.value,children:Q.label},Q.value))})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Time"}),l.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:f,disabled:c==="twice-daily"||c==="custom",onChange:Q=>p(parseInt(Q.target.value)),children:Array.from({length:24},(Q,se)=>l.jsx("option",{value:se,children:fm(se)},se))})]})]}),c==="custom"&&l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Cron expression"}),l.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:m,onChange:Q=>v(Q.target.value)})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Timezone"}),l.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:x?"Other":y,onChange:Q=>{Q.target.value==="Other"?(j(!0),b("Other")):(j(!1),b(Q.target.value))},children:[Dx.map(Q=>l.jsx("option",{value:Q,children:Q},Q)),l.jsx("option",{value:"Other",children:"Other (enter manually)\\u2026"})]}),x&&l.jsx("input",{className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"e.g. America/New_York",value:w,onChange:Q=>_(Q.target.value)})]}),M&&l.jsx("p",{className:"text-rose-400 text-sm",children:M}),l.jsxs("div",{className:"flex gap-2 justify-end",children:[l.jsx(ue,{type:"button",variant:"outline",size:"sm",onClick:()=>{r(!1),T(null)},children:"Cancel"}),l.jsx(ue,{type:"button",size:"sm",disabled:C||c==="custom"&&!m.trim(),onClick:R,children:C?"Saving...":"Save schedule"})]})]})]})}const k4=[{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 z4({projectName:e}){const[t,s]=N.useState("loading"),[a,r]=N.useState(!1),[c,d]=N.useState(""),[f,p]=N.useState(["citation.lost","citation.gained"]),[m,v]=N.useState(!1),[y,b]=N.useState(null),[x,j]=N.useState({});N.useEffect(()=>{jj(e).then(s).catch(()=>s([]))},[e]);const w=O=>{p(z=>z.includes(O)?z.filter(M=>M!==O):[...z,O])},_=async()=>{if(!(!c.trim()||f.length===0)){v(!0),b(null);try{const O=await Nj(e,{channel:"webhook",url:c.trim(),events:f});s(z=>z==="loading"?[O]:[...z,O]),d(""),p(["citation.lost","citation.gained"]),r(!1)}catch(O){b(O instanceof Error?O.message:"Failed to add webhook")}finally{v(!1)}}},C=async O=>{try{await _j(e,O),s(z=>z==="loading"?z:z.filter(M=>M.id!==O))}catch(z){b(z instanceof Error?z.message:"Failed to remove webhook")}},E=async O=>{j(z=>({...z,[O]:{state:"testing"}}));try{const z=await Cj(e,O);j(M=>({...M,[O]:{state:z.ok?"ok":"fail",status:z.status}}))}catch{j(z=>({...z,[O]:{state:"fail"}}))}};return l.jsxs("section",{className:"page-section-divider",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Automation"}),l.jsx("h2",{children:"Notifications"})]}),t!=="loading"&&l.jsx(ue,{type:"button",variant:"outline",size:"sm",onClick:()=>{r(!a),b(null)},children:a?"Cancel":"+ Add webhook"})]}),a&&l.jsxs("div",{className:"mb-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-4 space-y-3",children:[l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Webhook URL"}),l.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:c,onChange:O=>d(O.target.value)})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Trigger on"}),l.jsx("div",{className:"flex flex-wrap gap-3",children:k4.map(O=>l.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer select-none",children:[l.jsx("input",{type:"checkbox",className:"rounded border-zinc-600 bg-zinc-800",checked:f.includes(O.value),onChange:()=>w(O.value)}),l.jsx("span",{className:"text-sm text-zinc-300",children:O.label})]},O.value))})]}),y&&l.jsx("p",{className:"text-rose-400 text-sm",children:y}),l.jsxs("div",{className:"flex gap-2 justify-end",children:[l.jsx(ue,{type:"button",variant:"outline",size:"sm",onClick:()=>{r(!1),b(null)},children:"Cancel"}),l.jsx(ue,{type:"button",size:"sm",disabled:m||!c.trim()||f.length===0,onClick:_,children:m?"Adding...":"Add webhook"})]})]}),t==="loading"&&l.jsx("p",{className:"supporting-copy",children:"Loading..."}),t!=="loading"&&t.length===0&&!a&&l.jsx(Ve,{className:"surface-card compact-card",children:l.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&&l.jsxs("div",{className:"evidence-table-wrap",children:[l.jsxs("table",{className:"evidence-table",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:"URL"}),l.jsx("th",{children:"Events"}),l.jsx("th",{children:"Status"}),l.jsx("th",{})]})}),l.jsx("tbody",{children:t.map(O=>l.jsxs("tr",{children:[l.jsx("td",{className:"evidence-keyword-cell",children:l.jsx("span",{className:"font-mono text-xs text-zinc-300 break-all",children:O.url})}),l.jsx("td",{children:l.jsx("div",{className:"flex flex-wrap gap-1",children:O.events.map(z=>l.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:z.replace("."," ")},z))})}),l.jsx("td",{children:l.jsx(yt,{tone:O.enabled?"positive":"neutral",children:O.enabled?"Active":"Paused"})}),l.jsx("td",{children:l.jsxs("div",{className:"flex items-center gap-1 justify-end",children:[x[O.id]&&(()=>{const z=x[O.id],M=z.state==="testing"?"Sending…":z.state==="ok"?`Delivered${z.status?` (${z.status})`:""}`:`Failed${z.status?` (${z.status})`:""}`;return l.jsx(yt,{tone:z.state==="ok"?"positive":z.state==="fail"?"negative":"neutral",children:M})})(),l.jsx(ue,{variant:"ghost",size:"sm",type:"button",disabled:x[O.id]?.state==="testing",onClick:()=>E(O.id),children:"Test"}),l.jsx(ue,{variant:"ghost",size:"sm",type:"button",onClick:()=>C(O.id),children:"Remove"})]})})]},O.id))})]}),y&&l.jsx("p",{className:"text-rose-400 text-sm mt-2",children:y})]})]})}const E4=Ku();function O4({insights:e}){const{openEvidence:t}=ol(),[s,a]=N.useState(null);return l.jsx("div",{className:"insight-list",children:e.map(r=>{const c=s===r.id,d=r.affectedPhrases.length>0;return l.jsxs("div",{children:[l.jsxs("div",{className:`insight-row insight-row-${r.tone} ${d?"cursor-pointer":""}`,onClick:d?()=>a(c?null:r.id):void 0,children:[l.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[d&&l.jsx(Lu,{size:12,className:`shrink-0 text-zinc-500 transition-transform duration-150 ${c?"rotate-90":""}`}),l.jsx(yt,{tone:r.tone,children:r.actionLabel}),l.jsx("span",{className:"text-sm font-medium text-zinc-100 truncate",children:r.title}),l.jsx("span",{className:"hidden sm:inline text-xs text-zinc-500 truncate",children:r.detail})]}),d&&l.jsxs("span",{className:"text-[11px] text-zinc-600 whitespace-nowrap",children:[r.affectedPhrases.length," phrase",r.affectedPhrases.length>1?"s":""]})]}),c&&l.jsx("div",{className:"divide-y divide-zinc-800/20",children:r.affectedPhrases.map(f=>l.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-2 pl-9 bg-zinc-900/40",children:[l.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[l.jsx(wm,{state:f.citationState}),l.jsx("span",{className:"text-sm text-zinc-200 truncate",children:f.keyword}),l.jsx("div",{className:"hidden sm:flex gap-1",children:f.provider&&l.jsx(Xo,{provider:f.provider})})]}),l.jsx("button",{type:"button",className:"text-xs text-zinc-400 hover:text-zinc-200 whitespace-nowrap transition-colors",onClick:p=>{p.stopPropagation(),t(f.evidenceId)},children:"View →"})]},f.evidenceId))})]},r.id)})})}function Hp({tab:e}){const{projectId:t}=Tu({from:"/projects/$projectId"}),s=ja(),{dashboard:a,refetch:r}=ka(),c=a??E4.dashboard,d=yM(c,t),[f,p]=N.useState(!1),[m,v]=N.useState(!1),[y,b]=N.useState(!1),[x,j]=N.useState(null),[w,_]=N.useState(!1),[C,E]=N.useState(""),[O,z]=N.useState(!1),[M,T]=N.useState(!1),[L,R]=N.useState(""),[I,ie]=N.useState(!1),[Q,se]=N.useState(!1),[me,Ee]=N.useState(""),[we,H]=N.useState(!1),[Z,oe]=N.useState(void 0),[pe,ee]=N.useState(!1),[D,G]=N.useState(null),[ne,ae]=N.useState(!1),le=d?.visibilityEvidence??[],he=d?.project.name??"",de=N.useMemo(()=>new Set(le.map(re=>re.location??"")),[le]),Ze=de.has(""),ge=N.useMemo(()=>[...de].filter(Boolean),[de]);N.useEffect(()=>{if(Z===void 0||Z===""||!he){G(null),ae(!1);return}ae(!0),Sp(he,Z).then(re=>{G(re),ae(!1)}).catch(()=>{G(null),ae(!1)})},[Z,he]);const Ye=N.useMemo(()=>{if(!D)return null;const re=new Map;for(const Ue of D){for(const[$e,ke]of Object.entries(Ue.providerRuns??{}))re.set(`${Ue.keyword}::${$e}`,ke.map(Te=>({runId:Te.runId,citationState:Te.citationState,createdAt:Te.createdAt})));(!Ue.providerRuns||Object.keys(Ue.providerRuns).length===0)&&re.set(`${Ue.keyword}::`,Ue.runs.map($e=>({runId:$e.runId,citationState:$e.citationState,createdAt:$e.createdAt})))}return re},[D]),ft=N.useMemo(()=>{const re=Z!==void 0?le.filter(Ue=>Z===""?!Ue.location:Ue.location===Z):le;return Ye?re.map(Ue=>{const $e=Ye.get(`${Ue.keyword}::${Ue.provider}`)??Ye.get(`${Ue.keyword}::`);return $e?{...Ue,runHistory:$e}:Ue}):re},[le,Z,Ye]);if(!d)return l.jsx("div",{className:"page-container",children:l.jsxs(Ve,{className:"surface-card empty-card",children:[l.jsx("h1",{children:"Project not found"}),l.jsxs("p",{children:['Could not find a project with ID "',t,'".']}),l.jsx(ue,{asChild:!0,children:l.jsx(mt,{to:"/",children:"Return to overview"})})]})});async function fe(){b(!0),j(null);try{await jp(he),r()}catch(re){j(re instanceof Error?re.message:"Failed to trigger run")}finally{b(!1)}}async function Qe(){v(!0);try{await yj(he),s({to:"/"}),r()}catch(re){console.error("Failed to delete project:",re)}finally{v(!1)}}async function lt(){const re=await vj(he),Ue=typeof re=="string"?re:JSON.stringify(re,null,2),$e=new Blob([Ue],{type:"text/yaml"}),ke=URL.createObjectURL($e),Te=document.createElement("a");Te.href=ke,Te.download=`${he}.yaml`,Te.click()}async function Wt(){const re=C.split(`
237
- `).map(Ue=>Ue.trim()).filter(Boolean);if(re.length!==0){z(!0);try{await fj(he,re),r(),E(""),_(!1)}finally{z(!1)}}}async function _t(){const re=L.trim();if(re){ie(!0);try{const $e=(await xp(he)).map(Te=>Te.domain),ke=[...new Set([...$e,re])];await wp(he,ke),r(),R(""),T(!1)}finally{ie(!1)}}}async function nn(){const re=me.trim();if(re){H(!0);try{const Ue=d?.project.ownedDomains??[];await jm(he,[...Ue,re]),r(),Ee(""),se(!1)}finally{H(!1)}}}async function Gt(re){H(!0);try{const Ue=d?.project.ownedDomains??[];await jm(he,Ue.filter($e=>$e!==re)),r()}finally{H(!1)}}async function Ct(re,Ue){await hj(re,Ue),r()}const St=re=>!Number.isNaN(Number.parseInt(re,10)),sn=[{key:"overview",label:"Overview",href:`/projects/${d.project.id}`},{key:"search-console",label:"Search Console",href:`/projects/${d.project.id}/search-console`},{key:"analytics",label:"Analytics",href:`/projects/${d.project.id}/analytics`}];return l.jsxs("div",{className:"page-container",children:[f?l.jsxs(Ve,{className:"surface-card p-6 mb-6 border-rose-800/60",children:[l.jsx("h3",{className:"text-base font-semibold text-rose-400 mb-2",children:"Delete project?"}),l.jsxs("p",{className:"text-sm text-zinc-400 mb-4",children:["This will permanently delete ",l.jsx("strong",{className:"text-zinc-200",children:d.project.displayName||d.project.name})," and all its key phrases, competitors, runs, and snapshots. This cannot be undone."]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(ue,{type:"button",variant:"destructive",disabled:m,onClick:Qe,children:m?"Deleting...":"Yes, delete project"}),l.jsx(ue,{type:"button",variant:"outline",disabled:m,onClick:()=>p(!1),children:"Cancel"})]})]}):null,l.jsxs("div",{className:"page-header",children:[l.jsxs("div",{className:"page-header-left",children:[l.jsx("h1",{className:"page-title",children:d.project.displayName||d.project.name}),l.jsxs("p",{className:"page-subtitle",children:[d.project.canonicalDomain,(d.project.ownedDomains??[]).length===0&&!Q&&l.jsx("button",{type:"button",className:"ml-2 text-[10px] uppercase tracking-wide text-zinc-600 hover:text-zinc-400 transition-colors",onClick:()=>se(!0),children:"+ add domain"})," "," · ",d.contextLabel]}),l.jsxs("div",{className:"tag-row",children:[l.jsx("span",{className:"tag",children:d.project.country}),l.jsx("span",{className:"tag",children:d.project.language.toUpperCase()}),d.project.tags.map(re=>l.jsx("span",{className:"tag",children:re},re))]}),((d.project.ownedDomains??[]).length>0||Q)&&l.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-1.5",children:[l.jsx("span",{className:"text-[10px] uppercase tracking-wide text-zinc-500 mr-1",children:"Also tracking"}),(d.project.ownedDomains??[]).map(re=>l.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:[re,l.jsx("button",{type:"button",className:"ml-0.5 text-zinc-500 hover:text-zinc-200 transition-colors",disabled:we,onClick:()=>Gt(re),"aria-label":`Remove ${re}`,children:"×"})]},re)),Q?l.jsxs("span",{className:"inline-flex items-center gap-1",children:[l.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:me,onChange:re=>Ee(re.target.value),onKeyDown:re=>re.key==="Enter"&&nn(),autoFocus:!0}),l.jsx(ue,{type:"button",size:"sm",disabled:!me.trim()||we,onClick:nn,children:we?"...":"Add"}),l.jsx("button",{type:"button",className:"text-xs text-zinc-500 hover:text-zinc-300",onClick:()=>{se(!1),Ee("")},children:"Cancel"})]}):l.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:()=>se(!0),children:"+ domain"})]})]}),l.jsxs("div",{className:"page-header-right",children:[l.jsx("p",{className:"text-sm text-zinc-500",children:d.dateRangeLabel}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(ue,{type:"button",variant:"outline",size:"icon",onClick:lt,"aria-label":"Export project as YAML",children:l.jsx(Qz,{className:"h-4 w-4 text-zinc-400"})}),l.jsx(ue,{type:"button",variant:"outline",size:"icon",onClick:()=>p(!0),"aria-label":"Delete project",children:l.jsx(f2,{className:"h-4 w-4 text-zinc-400"})}),l.jsx(ue,{type:"button",disabled:y,onClick:fe,children:y?"Starting...":"Run now"})]})]})]}),x&&l.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:[x,l.jsx("button",{type:"button",className:"ml-2 text-rose-400 hover:text-rose-200",onClick:()=>j(null),children:"×"})]}),l.jsx("nav",{className:"project-subnav","aria-label":"Project sections",children:sn.map(re=>l.jsx(mt,{to:re.href,className:`project-subnav-link ${re.key===e?"project-subnav-link-active":""}`,"aria-current":re.key===e?"page":void 0,children:re.label},re.key))}),e==="overview"?l.jsxs(l.Fragment,{children:[l.jsxs("section",{className:"gauge-row",children:[l.jsx(au,{value:d.visibilitySummary.value,label:d.visibilitySummary.label,delta:d.visibilitySummary.delta,tone:d.visibilitySummary.tone,description:d.visibilitySummary.description,tooltip:d.visibilitySummary.tooltip,isNumeric:St(d.visibilitySummary.value)}),l.jsx(au,{value:d.competitorPressure.value,label:d.competitorPressure.label,delta:d.competitorPressure.delta,tone:d.competitorPressure.tone,description:d.competitorPressure.description,tooltip:d.competitorPressure.tooltip,isNumeric:St(d.competitorPressure.value)}),l.jsx(au,{value:d.runStatus.value,label:d.runStatus.label,delta:d.runStatus.delta,tone:d.runStatus.tone,description:d.runStatus.description,tooltip:d.runStatus.tooltip,isNumeric:St(d.runStatus.value)})]}),d.providerScores.length>1&&l.jsxs("section",{className:"page-section-divider",children:[l.jsx("div",{className:"section-head section-head-inline",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Model breakdown"}),l.jsxs("h2",{children:["Visibility by model ",l.jsx(Fo,{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."})]})]})}),l.jsx("div",{className:"evidence-table-wrap",children:l.jsxs("table",{className:"evidence-table",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:"Model"}),l.jsx("th",{children:"Score"}),l.jsx("th",{children:"Cited key phrases"})]})}),l.jsx("tbody",{children:d.providerScores.map(re=>l.jsxs("tr",{children:[l.jsx("td",{children:l.jsxs("div",{className:"flex flex-col items-start gap-0.5",children:[l.jsx(Xo,{provider:re.provider}),re.model&&l.jsx("span",{className:"text-[11px] font-mono text-zinc-500",children:re.model})]})}),l.jsx("td",{children:l.jsxs("span",{className:`font-semibold ${re.score>=70?"text-emerald-400":re.score>=40?"text-amber-400":"text-rose-400"}`,children:[re.score,"%"]})}),l.jsxs("td",{className:"text-zinc-500",children:[re.cited," of ",re.total]})]},`${re.provider}::${re.model??"unknown"}`))})]})})]}),l.jsxs("section",{className:"page-section-divider",children:[l.jsx("div",{className:"section-head section-head-inline",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"What changed"}),l.jsx("h2",{children:"Citation signals"})]})}),l.jsx(O4,{insights:d.insights})]}),l.jsxs("section",{className:"page-section-divider",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Visibility evidence"}),l.jsx("h2",{children:"Key phrase citation tracking"})]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs("p",{className:"supporting-copy",children:[new Set(d.visibilityEvidence.map(re=>re.keyword)).size," key phrases tracked"]}),l.jsx(ue,{type:"button",variant:"outline",size:"sm",onClick:()=>_(!w),children:w?"Cancel":"+ Add key phrases"})]})]}),w&&l.jsxs("div",{className:"mb-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3",children:[l.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:C,onChange:re=>E(re.target.value)}),l.jsxs("div",{className:"mt-2 flex items-center justify-between",children:[l.jsxs("p",{className:"text-xs text-zinc-500",children:[C.split(`
238
- `).filter(re=>re.trim()).length," key phrases"]}),l.jsx(ue,{type:"button",size:"sm",disabled:!C.trim()||O,onClick:Wt,children:O?"Adding...":"Add key phrases"})]})]}),d.project.locations&&d.project.locations.length>0&&l.jsxs("div",{className:"filter-row mb-3",role:"toolbar","aria-label":"Location filters",children:[l.jsx("button",{className:`filter-chip ${Z===void 0?"filter-chip-active":""}`,type:"button","aria-pressed":Z===void 0,onClick:()=>{oe(void 0)},children:"All locations"}),d.project.locations.map(re=>de.has(re.label)&&l.jsx("button",{className:`filter-chip ${Z===re.label?"filter-chip-active":""}`,type:"button","aria-pressed":Z===re.label,onClick:()=>{oe(re.label),ee(!1)},children:re.label},re.label)),Ze&&l.jsx("button",{className:`filter-chip ${Z===""?"filter-chip-active":""}`,type:"button","aria-pressed":Z==="",onClick:()=>{oe(""),ee(!1)},children:"No location"}),ge.length>1&&Z===void 0&&l.jsx("button",{className:`filter-chip filter-chip-compare ${pe?"filter-chip-active":""}`,type:"button","aria-pressed":pe,onClick:()=>ee(re=>!re),title:"Side-by-side location comparison",children:"Compare"})]}),l.jsx(p4,{evidence:ft})]}),l.jsxs("section",{className:"page-section-divider",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Competitors"}),l.jsx("h2",{children:"Competitive landscape"})]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs("p",{className:"supporting-copy",children:[d.competitors.length," tracked"]}),l.jsx(ue,{type:"button",variant:"outline",size:"sm",onClick:()=>T(!M),children:M?"Cancel":"+ Add competitor"})]})]}),M&&l.jsxs("div",{className:"mb-3 flex gap-2 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3",children:[l.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:L,onChange:re=>R(re.target.value),onKeyDown:re=>re.key==="Enter"&&_t()}),l.jsx(ue,{type:"button",size:"sm",disabled:!L.trim()||I,onClick:_t,children:I?"Adding...":"Add"})]}),l.jsx(g4,{competitors:d.competitors})]}),l.jsxs("section",{className:"page-section-divider",children:[l.jsx("div",{className:"section-head section-head-inline",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Run timeline"}),l.jsx("h2",{children:"Recent execution history"})]})}),l.jsx("div",{className:"run-list",children:d.recentRuns.map(re=>l.jsx($1,{run:re},re.id))})]}),l.jsx(N4,{project:{...d.project,displayName:d.project.displayName??d.project.name,defaultLocation:d.project.defaultLocation??null},onUpdateProject:Ct,onRefresh:()=>{r()}}),l.jsx(C4,{projectName:d.project.name}),l.jsx(z4,{projectName:d.project.name})]}):e==="analytics"?l.jsx(b4,{projectName:d.project.name}):l.jsx(j4,{projectName:d.project.name})]})}const R4="modulepreload",A4=function(e,t){return new URL(e,t).href},Lx={},T4=function(t,s,a){let r=Promise.resolve();if(s&&s.length>0){let m=function(v){return Promise.all(v.map(y=>Promise.resolve(y).then(b=>({status:"fulfilled",value:b}),b=>({status:"rejected",reason:b}))))};const d=document.getElementsByTagName("link"),f=document.querySelector("meta[property=csp-nonce]"),p=f?.nonce||f?.getAttribute("nonce");r=m(s.map(v=>{if(v=A4(v,a),v in Lx)return;Lx[v]=!0;const y=v.endsWith(".css"),b=y?'[rel="stylesheet"]':"";if(a)for(let j=d.length-1;j>=0;j--){const w=d[j];if(w.href===v&&(!y||w.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${v}"]${b}`))return;const x=document.createElement("link");if(x.rel=y?"stylesheet":R4,y||(x.as="script"),x.crossOrigin="",x.href=v,p&&x.setAttribute("nonce",p),document.head.appendChild(x),y)return new Promise((j,w)=>{x.addEventListener("load",j),x.addEventListener("error",()=>w(new Error(`Unable to preload CSS for ${v}`)))})}))}function c(d){const f=new Event("vite:preloadError",{cancelable:!0});if(f.payload=d,window.dispatchEvent(f),!f.defaultPrevented)throw d}return r.then(d=>{for(const f of d||[])f.status==="rejected"&&c(f.reason);return t().catch(c)})};function D4(){const{dashboard:e}=ka(),t=e?.runs??[],[s,a]=N.useState("all"),r=s==="all"?t:t.filter(d=>d.status===s),c=()=>{T4(async()=>{const{triggerAllRuns:d}=await Promise.resolve().then(()=>uM);return{triggerAllRuns:d}},void 0,import.meta.url).then(({triggerAllRuns:d})=>d().catch(f=>{console.error("Failed to trigger all runs",f)}))};return l.jsxs("div",{className:"page-container",children:[l.jsxs("div",{className:"page-header",children:[l.jsxs("div",{className:"page-header-left",children:[l.jsx("h1",{className:"page-title",children:"Runs"}),l.jsx("p",{className:"page-subtitle",children:"Status, type, project, duration, and the shortest explanation that makes the outcome trustworthy."})]}),l.jsx(ue,{type:"button",variant:"outline",size:"sm",onClick:c,children:"Run all projects"})]}),l.jsxs("section",{children:[l.jsx("div",{className:"filter-row",role:"toolbar","aria-label":"Run filters",children:["all","queued","running","completed","partial","failed"].map(d=>l.jsx("button",{className:`filter-chip ${s===d?"filter-chip-active":""}`,type:"button","aria-pressed":s===d,onClick:()=>a(d),children:d==="all"?"All runs":Uu(d)},d))}),l.jsx("div",{className:"run-list",children:r.length>0?r.map(d=>l.jsx($1,{run:d},d.id)):l.jsxs(Ve,{className:"surface-card empty-card",children:[l.jsx("h2",{children:"No runs match this filter"}),l.jsx("p",{children:"Try another status filter or queue a new run from a project command center."})]})})]})]})}const L4={openai:"https://platform.openai.com/api-keys",claude:"https://platform.claude.com/settings/keys"},M4={gemini:"Gemini",openai:"OpenAI",claude:"Claude",local:"Local"},U4={gemini:"e.g. gemini-3-flash",openai:"e.g. gpt-5.4",claude:"e.g. claude-sonnet-4-6",local:"e.g. llama3, mistral"};function $4({providerName:e,onSaved:t}){const s=e.toLowerCase()==="local",[a,r]=N.useState(""),[c,d]=N.useState(""),[f,p]=N.useState(""),[m,v]=N.useState(""),[y,b]=N.useState(""),[x,j]=N.useState(""),[w,_]=N.useState(!1),[C,E]=N.useState(null),[O,z]=N.useState(!1),M=s?c.trim().length>0:a.trim().length>0;async function T(){if(M){_(!0),E(null),z(!1);try{const I=Ee=>{const we=parseInt(Ee.trim(),10);return Number.isFinite(we)&&we>0?we:void 0},ie={},Q=I(m);Q!==void 0&&(ie.maxConcurrency=Q);const se=I(y);se!==void 0&&(ie.maxRequestsPerMinute=se);const me=I(x);me!==void 0&&(ie.maxRequestsPerDay=me),await bj(e.toLowerCase(),{...a.trim()?{apiKey:a.trim()}:{},...c.trim()?{baseUrl:c.trim()}:{},...f.trim()?{model:f.trim()}:{},...Object.keys(ie).length>0?{quota:ie}:{}}),r(""),d(""),p(""),v(""),b(""),j(""),z(!0),t()}catch(I){E(I instanceof Error?I.message:"Failed to update provider")}finally{_(!1)}}}const L=L4[e.toLowerCase()],R=U4[e.toLowerCase()]??"Use default model";return l.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3 space-y-2",children:[s&&l.jsxs("div",{children:[l.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`base-url-${e}`,children:"Base URL"}),l.jsx("input",{id:`base-url-${e}`,type:"text",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"http://localhost:11434/v1",value:c,onChange:I=>d(I.target.value)}),l.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Any OpenAI-compatible endpoint — Ollama, LM Studio, llama.cpp, vLLM"})]}),l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("label",{className:"text-xs text-zinc-500",htmlFor:`api-key-${e}`,children:["API Key",s?" (optional)":""]}),L&&l.jsx("a",{href:L,target:"_blank",rel:"noopener noreferrer",className:"text-[10px] text-zinc-500 hover:text-zinc-300 underline underline-offset-2",children:"Get API key \\u2197"})]}),l.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:s?"Optional — most local servers don't need one":`Enter ${e} API key`,value:a,onChange:I=>r(I.target.value)})]}),l.jsxs("div",{children:[l.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`model-${e}`,children:"Model (optional)"}),l.jsx("input",{id:`model-${e}`,type:"text",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:R,value:f,onChange:I=>p(I.target.value)})]}),l.jsxs("div",{children:[l.jsx("label",{className:"text-xs text-zinc-500",children:"Quota (optional)"}),l.jsxs("div",{className:"mt-0.5 grid grid-cols-3 gap-1.5",children:[l.jsxs("div",{children:[l.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:I=>v(I.target.value)}),l.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Max concurrent"})]}),l.jsxs("div",{children:[l.jsx("input",{type:"number",min:"1",className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"/min",value:y,onChange:I=>b(I.target.value)}),l.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Per minute"})]}),l.jsxs("div",{children:[l.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:x,onChange:I=>j(I.target.value)}),l.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Per day"})]})]})]}),C&&l.jsx("p",{className:"text-xs text-rose-400",children:C}),O&&l.jsx("p",{className:"text-xs text-emerald-400",children:"Provider updated."}),l.jsx(ue,{type:"button",size:"sm",disabled:!M||w,onClick:T,children:w?"Saving...":"Save"})]})}function P4({onSaved:e}){const[t,s]=N.useState(""),[a,r]=N.useState(""),[c,d]=N.useState(!1),[f,p]=N.useState(null),[m,v]=N.useState(!1),y=t.trim().length>0&&a.trim().length>0;async function b(){if(y){d(!0),p(null),v(!1);try{await xj({clientId:t.trim(),clientSecret:a.trim()}),s(""),r(""),v(!0),e()}catch(x){p(x instanceof Error?x.message:"Failed to update Google OAuth credentials")}finally{d(!1)}}}return l.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3 space-y-2",children:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"google-client-id",children:"Client ID"}),l.jsx("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 \\u2197"})]}),l.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:x=>s(x.target.value)})]}),l.jsxs("div",{children:[l.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"google-client-secret",children:"Client secret"}),l.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:a,onChange:x=>r(x.target.value)})]}),l.jsxs("p",{className:"text-[11px] text-zinc-500",children:["These credentials are stored in ",l.jsx("code",{children:"~/.canonry/config.yaml"}),". Project-level Search Console connections are created separately per canonical domain."]}),f&&l.jsx("p",{className:"text-xs text-rose-400",children:f}),m&&l.jsx("p",{className:"text-xs text-emerald-400",children:"Google OAuth credentials updated."}),l.jsx(ue,{type:"button",size:"sm",disabled:!y||c,onClick:b,children:c?"Saving...":"Save Google OAuth app"})]})}function I4(){const[e,t]=N.useState(null),[s,a]=N.useState(null),[r,c]=N.useState(!1),[d,f]=N.useState("localhost"),[p,m]=N.useState("9222"),[v,y]=N.useState(!1);return N.useEffect(()=>{_m().then(t).catch(b=>{const x=b instanceof Error?b.message:String(b);x.includes("501")||a(x)})},[]),l.jsxs(Ve,{className:"surface-card",children:[l.jsxs("div",{className:"section-head",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Browser provider"}),l.jsx("h2",{children:"ChatGPT (CDP)"})]}),l.jsx(yt,{tone:e?.connected?"positive":"caution",children:e?.connected?"Connected":"Not connected"})]}),l.jsxs("dl",{className:"definition-list mt-3",children:[e?.endpoint&&l.jsxs("div",{children:[l.jsx("dt",{children:"Endpoint"}),l.jsx("dd",{className:"font-mono text-xs",children:e.endpoint})]}),e?.browserVersion&&l.jsxs("div",{children:[l.jsx("dt",{children:"Browser"}),l.jsx("dd",{className:"text-xs",children:e.browserVersion})]}),e?.targets&&e.targets.length>0&&l.jsxs("div",{children:[l.jsx("dt",{children:"Tabs"}),l.jsx("dd",{children:e.targets.map(b=>l.jsxs("span",{className:"mr-2",children:[b.name,": ",b.alive?"● alive":"○ idle"]},b.name))})]})]}),l.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.":s||"Not configured. Set an endpoint below or run: canonry cdp connect --host localhost --port 9222"}),l.jsx("div",{className:"mt-2",children:l.jsx(ue,{type:"button",variant:"outline",size:"sm",onClick:()=>c(!r),children:r?"Cancel":e?.connected?"Update endpoint":"Configure"})}),r&&l.jsxs("form",{className:"mt-3 flex flex-col gap-2",onSubmit:async b=>{b.preventDefault(),y(!0);try{await Fj(d,parseInt(p,10)||9222);const x=await _m().catch(()=>null);x&&t(x),c(!1)}catch(x){a(x instanceof Error?x.message:String(x))}finally{y(!1)}},children:[l.jsxs("div",{className:"flex gap-2",children:[l.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:d,onChange:b=>f(b.target.value),"aria-label":"CDP host"}),l.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:p,onChange:b=>m(b.target.value),"aria-label":"CDP port"})]}),l.jsx("div",{children:l.jsx(ue,{type:"submit",size:"sm",disabled:v,children:v?"Saving…":"Save endpoint"})})]})]})}const B4={apiStatus:{state:"checking",detail:"Checking service health"},workerStatus:{state:"checking",detail:"Checking service health"}};function q4(){const e=rl(),{dashboard:t}=ka(),s=t?.settings??e?.dashboard?.settings,c=Vu(!e,e?.health).data??e?.health??B4,[d,f]=N.useState(null),[p,m]=N.useState(!1);return s?l.jsxs("div",{className:"page-container",children:[l.jsx("div",{className:"page-header",children:l.jsxs("div",{className:"page-header-left",children:[l.jsx("h1",{className:"page-title",children:"Settings"}),l.jsx("p",{className:"page-subtitle",children:"Provider state, Google OAuth setup, and service health."})]})}),l.jsxs("section",{className:"settings-grid",children:[s.providerStatuses.map(v=>l.jsxs(Ve,{className:"surface-card",children:[l.jsxs("div",{className:"section-head",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Provider"}),l.jsx("h2",{children:v.name})]}),l.jsx(yt,{tone:v.state==="ready"?"positive":"caution",children:v.state==="ready"?"Ready":"Needs config"})]}),l.jsxs("dl",{className:"definition-list mt-3",children:[l.jsxs("div",{children:[l.jsx("dt",{children:"Model"}),l.jsx("dd",{className:"font-mono text-xs",children:v.model})]}),v.quota&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{children:[l.jsx("dt",{children:"Concurrency"}),l.jsx("dd",{children:v.quota.maxConcurrency})]}),l.jsxs("div",{children:[l.jsx("dt",{children:"Rate limit"}),l.jsxs("dd",{children:[v.quota.maxRequestsPerMinute,"/min · ",v.quota.maxRequestsPerDay,"/day"]})]})]})]}),l.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:v.detail}),l.jsx("div",{className:"mt-2",children:l.jsx(ue,{type:"button",variant:"outline",size:"sm",onClick:()=>f(d===v.name?null:v.name),children:d===v.name?"Cancel":v.state==="ready"?v.name.toLowerCase()==="local"?"Update config":"Update key":"Configure"})}),d===v.name&&l.jsx($4,{providerName:v.name,onSaved:()=>{f(null)}})]},v.name)),l.jsxs(Ve,{className:"surface-card",children:[l.jsxs("div",{className:"section-head",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Google"}),l.jsx("h2",{children:"Search Console OAuth"})]}),l.jsx(yt,{tone:s.google.state==="ready"?"positive":"caution",children:s.google.state==="ready"?"Ready":"Needs config"})]}),l.jsxs("dl",{className:"definition-list mt-3",children:[l.jsxs("div",{children:[l.jsx("dt",{children:"Auth model"}),l.jsx("dd",{children:"One app credential set, then one OAuth connection per project domain"})]}),l.jsxs("div",{children:[l.jsx("dt",{children:"Storage"}),l.jsx("dd",{className:"font-mono text-xs",children:"~/.canonry/config.yaml"})]})]}),l.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:s.google.detail}),l.jsx("div",{className:"mt-2",children:l.jsx(ue,{type:"button",variant:"outline",size:"sm",onClick:()=>m(!p),children:p?"Cancel":s.google.state==="ready"?"Update OAuth app":"Configure Google OAuth"})}),p&&l.jsx(P4,{onSaved:()=>{m(!1)}})]}),l.jsx(I4,{}),l.jsxs(Ve,{className:"surface-card",children:[l.jsx("div",{className:"section-head",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Service health"}),l.jsx("h2",{children:"API and worker"})]})}),l.jsxs("div",{className:"compact-stack",children:[l.jsxs("div",{className:"health-row",children:[l.jsxs("div",{children:[l.jsx("p",{className:"run-row-title",children:"API"}),l.jsx("p",{className:"supporting-copy",children:c.apiStatus.detail})]}),l.jsx(yt,{tone:vu(c.apiStatus),children:c.apiStatus.state==="ok"?"Healthy":"Attention"})]}),l.jsxs("div",{className:"health-row",children:[l.jsxs("div",{children:[l.jsx("p",{className:"run-row-title",children:"Worker"}),l.jsx("p",{className:"supporting-copy",children:c.workerStatus.detail})]}),l.jsx(yt,{tone:vu(c.workerStatus),children:c.workerStatus.state==="ok"?"Healthy":"Attention"})]})]})]})]}),l.jsx("section",{className:"page-section",children:l.jsxs(Ve,{className:"surface-card",children:[l.jsx("div",{className:"section-head",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Self-host notes"}),l.jsx("h2",{children:"Operational guidance"})]})}),l.jsx("ul",{className:"detail-list",children:s.selfHostNotes.map(v=>l.jsx("li",{children:v},v))}),l.jsx("p",{className:"supporting-copy",children:s.bootstrapNote})]})})]}):null}const H4=Ku(),Z4=[{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 F4({current:e,labels:t}){return l.jsx("div",{className:"setup-steps",role:"list","aria-label":"Setup progress",children:t.map((s,a)=>{const r=a<e,c=a===e;return l.jsxs("div",{className:`setup-step ${r?"setup-step-done":""} ${c?"setup-step-active":""}`,role:"listitem","aria-current":c?"step":void 0,children:[l.jsx("span",{className:"setup-step-number",children:r?"✓":a+1}),l.jsx("span",{className:"setup-step-label",children:s.label})]},s.label)})})}function G4(){const e=rl(),{dashboard:t,refetch:s}=ka(),a=t??e?.dashboard??H4.dashboard,r=a.settings,f=Vu(!e,e?.health).data??e?.health??{apiStatus:{label:"API",state:"checking",detail:"Checking service health"},workerStatus:{label:"Worker",state:"checking",detail:"Checking service health"}},p=JM(a.setup,f,r),m=ja(),[v,y]=N.useState(0),[b,x]=N.useState(""),[j,w]=N.useState(""),[_,C]=N.useState(""),[E,O]=N.useState("US"),[z,M]=N.useState("en"),[T,L]=N.useState(null),[R,I]=N.useState(null),[ie,Q]=N.useState(null),[se,me]=N.useState(!1),[Ee,we]=N.useState(""),[H,Z]=N.useState(!1),[oe,pe]=N.useState(null),[ee,D]=N.useState(!1),G=r.providerStatuses.filter(te=>te.state==="ready"),[ne,ae]=N.useState(G[0]?.name??""),[le,he]=N.useState(5),[de,Ze]=N.useState(!1),[ge,Ye]=N.useState(null),[ft,fe]=N.useState(""),[Qe,lt]=N.useState(!1),[Wt,_t]=N.useState(null),[nn,Gt]=N.useState(!1),[Ct,St]=N.useState(!1),[sn,re]=N.useState(null),[Ue,$e]=N.useState(!1),ke=b.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),Te=Ee.split(`
239
- `).map(te=>te.trim()).filter(Boolean),kt=ft.split(`
240
- `).map(te=>te.trim()).filter(Boolean),Qn=p.healthChecks.some(te=>te.id==="api"&&te.state==="ready"),bs=async()=>{if(!(!ke||!_)){me(!0),Q(null);try{const te=await al(ke,{displayName:j||b,canonicalDomain:_,country:E,language:z});L(ke),I(te.id),s(),y(2)}catch(te){Q(te instanceof Error?te.message:"Failed to create project")}finally{me(!1)}}},Fs=async()=>{if(!T)return;const te=Te;if(te.length!==0){D(!0),pe(null);try{await dj(T,te),Z(!0),s(),y(3)}catch(Pe){pe(Pe instanceof Error?Pe.message:"Failed to save key phrases")}finally{D(!1)}}},xs=async()=>{if(!(!T||!ne)){Ze(!0),Ye(null);try{const te=await kj(T,ne,le);if(te.keywords.length>0){const Pe=Ee?Ee.trimEnd()+`
241
- `+te.keywords.join(`
242
- `):te.keywords.join(`
243
- `);we(Pe)}}catch(te){Ye(te instanceof Error?te.message:"Failed to generate key phrases")}finally{Ze(!1)}}},Gs=async()=>{if(!T)return;const te=kt;if(te.length!==0){Gt(!0),_t(null);try{await wp(T,te),lt(!0),s(),y(4)}catch(Pe){_t(Pe instanceof Error?Pe.message:"Failed to save competitors")}finally{Gt(!1)}}},os=async()=>{if(T){$e(!0),re(null);try{await jp(T),St(!0),s()}catch(te){re(te instanceof Error?te.message:"Failed to trigger run")}finally{$e(!1)}}},_e=()=>y(te=>Math.max(0,te-1)),wn=(()=>{switch(v){case 0:return l.jsxs(Ve,{className:"surface-card step-card",children:[l.jsx("div",{className:"section-head",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 1 of 5"}),l.jsx("h2",{children:"System ready"})]})}),l.jsx("p",{className:"supporting-copy",children:"Checking that your Canonry instance is configured and reachable."}),l.jsx("div",{className:"compact-stack",children:p.healthChecks.map(te=>l.jsxs("div",{className:"health-check-row",children:[l.jsxs("div",{children:[l.jsx("p",{className:"run-row-title",children:te.label}),l.jsx("p",{className:"supporting-copy",children:te.detail}),te.id==="provider"&&te.state!=="ready"&&l.jsx(mt,{to:"/settings",className:"text-emerald-400 hover:text-emerald-300 text-sm mt-1 underline underline-offset-2 cursor-pointer",children:"Configure providers"})]}),l.jsx(yt,{tone:te.state==="ready"?"positive":"caution",children:te.state==="ready"?"Ready":"Attention"})]},te.id))}),l.jsxs("div",{className:"setup-nav",children:[l.jsx("span",{}),l.jsx(ue,{type:"button",disabled:!Qn,onClick:()=>y(1),children:"Continue"})]})]});case 1:return l.jsxs(Ve,{className:"surface-card step-card",children:[l.jsxs("div",{className:"section-head",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 2 of 5"}),l.jsx("h2",{children:"Create project"})]}),T?l.jsx(yt,{tone:"positive",children:"Created"}):null]}),T?l.jsxs("div",{className:"compact-stack",children:[l.jsxs("p",{className:"text-zinc-300",children:["Project ",l.jsx("span",{className:"text-zinc-100 font-medium",children:T})," created successfully."]}),l.jsxs("div",{className:"setup-nav",children:[l.jsx(ue,{type:"button",variant:"outline",onClick:_e,children:"Back"}),l.jsx(ue,{type:"button",onClick:()=>y(2),children:"Continue"})]})]}):l.jsxs("div",{className:"compact-stack",children:[l.jsxs("div",{className:"setup-field",children:[l.jsx("label",{className:"setup-label",htmlFor:"project-name",children:"Project name"}),l.jsx("input",{id:"project-name",className:"setup-input",type:"text",placeholder:"my-website",value:b,onChange:te=>x(te.target.value)}),ke&&ke!==b?l.jsxs("p",{className:"supporting-copy",children:["Slug: ",ke]}):null]}),l.jsxs("div",{className:"setup-field",children:[l.jsx("label",{className:"setup-label",htmlFor:"display-name",children:"Display name (optional)"}),l.jsx("input",{id:"display-name",className:"setup-input",type:"text",placeholder:"My Website",value:j,onChange:te=>w(te.target.value)})]}),l.jsxs("div",{className:"setup-field",children:[l.jsx("label",{className:"setup-label",htmlFor:"domain",children:"Canonical domain"}),l.jsx("input",{id:"domain",className:"setup-input",type:"text",placeholder:"example.com",value:_,onChange:te=>C(te.target.value)})]}),l.jsxs("div",{className:"setup-field-row",children:[l.jsxs("div",{className:"setup-field",children:[l.jsx("label",{className:"setup-label",htmlFor:"country",children:"Country"}),l.jsx("input",{id:"country",className:"setup-input",type:"text",placeholder:"US",maxLength:2,value:E,onChange:te=>O(te.target.value.toUpperCase())})]}),l.jsxs("div",{className:"setup-field",children:[l.jsx("label",{className:"setup-label",htmlFor:"language",children:"Language"}),l.jsx("input",{id:"language",className:"setup-input",type:"text",placeholder:"en",maxLength:5,value:z,onChange:te=>M(te.target.value.toLowerCase())})]})]}),ie?l.jsx("p",{className:"text-rose-400 text-sm",children:ie}):null,l.jsxs("div",{className:"setup-nav",children:[l.jsx(ue,{type:"button",variant:"outline",onClick:_e,children:"Back"}),l.jsx(ue,{type:"button",disabled:!ke||!_||se,onClick:bs,children:se?"Creating...":"Create project"})]})]})]});case 2:return l.jsxs(Ve,{className:"surface-card step-card",children:[l.jsxs("div",{className:"section-head",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 3 of 5"}),l.jsx("h2",{children:"Add key phrases"})]}),H?l.jsxs(yt,{tone:"positive",children:[Te.length," saved"]}):l.jsxs(yt,{tone:"neutral",children:[Te.length," key phrase",Te.length!==1?"s":""]})]}),l.jsx("p",{className:"supporting-copy",children:"Enter the search queries you want to track. One per line."}),H?l.jsxs("div",{className:"compact-stack",children:[l.jsx("ul",{className:"detail-list",children:Te.map(te=>l.jsx("li",{children:te},te))}),l.jsxs("div",{className:"setup-nav",children:[l.jsx(ue,{type:"button",variant:"outline",onClick:_e,children:"Back"}),l.jsx(ue,{type:"button",onClick:()=>y(3),children:"Continue"})]})]}):l.jsxs("div",{className:"compact-stack",children:[G.length>0?l.jsxs("div",{className:"compact-stack",children:[l.jsxs("div",{className:"flex items-center gap-2 text-zinc-500 text-xs uppercase tracking-wide",children:[l.jsx("span",{className:"flex-1 border-t border-zinc-800"}),"auto-generate",l.jsx("span",{className:"flex-1 border-t border-zinc-800"})]}),l.jsxs("div",{className:"flex items-end gap-2",children:[l.jsxs("div",{className:"setup-field flex-1",children:[l.jsx("label",{className:"setup-label",htmlFor:"gen-provider",children:"Provider"}),l.jsx("select",{id:"gen-provider",className:"setup-input",value:ne,onChange:te=>ae(te.target.value),children:G.map(te=>l.jsxs("option",{value:te.name,children:[M4[te.name]??te.name,te.model?` (${te.model})`:""]},te.name))})]}),l.jsxs("div",{className:"setup-field",children:[l.jsx("label",{className:"setup-label",htmlFor:"gen-count",children:"Count"}),l.jsx("select",{id:"gen-count",className:"setup-input",value:le,onChange:te=>he(Number(te.target.value)),children:[3,5,10,15,20].map(te=>l.jsx("option",{value:te,children:te},te))})]}),l.jsx(ue,{type:"button",variant:"outline",disabled:de||!ne,onClick:xs,children:de?"Analyzing site...":"Generate"})]}),ge?l.jsx("p",{className:"text-rose-400 text-sm",children:ge}):null]}):null,l.jsxs("div",{className:"flex items-center gap-2 text-zinc-500 text-xs uppercase tracking-wide",children:[l.jsx("span",{className:"flex-1 border-t border-zinc-800"}),"or type manually",l.jsx("span",{className:"flex-1 border-t border-zinc-800"})]}),l.jsxs("div",{className:"setup-field",children:[l.jsx("label",{className:"setup-label",htmlFor:"keywords",children:"Key phrases (one per line)"}),l.jsx("textarea",{id:"keywords",className:"setup-textarea",rows:6,placeholder:`emergency dentist brooklyn
244
- best invisalign downtown brooklyn
245
- pediatric dentist brooklyn heights`,value:Ee,onChange:te=>we(te.target.value)})]}),oe?l.jsx("p",{className:"text-rose-400 text-sm",children:oe}):null,l.jsxs("div",{className:"setup-nav",children:[l.jsx(ue,{type:"button",variant:"outline",onClick:_e,children:"Back"}),l.jsx(ue,{type:"button",disabled:Te.length===0||ee,onClick:Fs,children:ee?"Saving...":`Save ${Te.length} key phrase${Te.length!==1?"s":""}`})]})]})]});case 3:return l.jsxs(Ve,{className:"surface-card step-card",children:[l.jsxs("div",{className:"section-head",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 4 of 5"}),l.jsx("h2",{children:"Add competitors"})]}),Qe?l.jsx(yt,{tone:"positive",children:"Saved"}):null]}),l.jsx("p",{className:"supporting-copy",children:"Domains that compete for the same key phrases. One per line."}),Qe?l.jsxs("div",{className:"compact-stack",children:[l.jsx("ul",{className:"detail-list",children:kt.map(te=>l.jsx("li",{children:te},te))}),l.jsxs("div",{className:"setup-nav",children:[l.jsx(ue,{type:"button",variant:"outline",onClick:_e,children:"Back"}),l.jsx(ue,{type:"button",onClick:()=>y(4),children:"Continue"})]})]}):l.jsxs("div",{className:"compact-stack",children:[l.jsxs("div",{className:"setup-field",children:[l.jsx("label",{className:"setup-label",htmlFor:"competitors",children:"Competitor domains (one per line)"}),l.jsx("textarea",{id:"competitors",className:"setup-textarea",rows:4,placeholder:`competitor1.com
246
- competitor2.com`,value:ft,onChange:te=>fe(te.target.value)})]}),Wt?l.jsx("p",{className:"text-rose-400 text-sm",children:Wt}):null,l.jsxs("div",{className:"setup-nav",children:[l.jsx(ue,{type:"button",variant:"outline",onClick:_e,children:"Back"}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx(ue,{type:"button",variant:"outline",onClick:()=>y(4),children:"Skip"}),l.jsx(ue,{type:"button",disabled:kt.length===0||nn,onClick:Gs,children:nn?"Saving...":`Save ${kt.length} competitor${kt.length!==1?"s":""}`})]})]})]})]});case 4:return l.jsxs(Ve,{className:"surface-card step-card",children:[l.jsxs("div",{className:"section-head",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 5 of 5"}),l.jsx("h2",{children:"Launch first run"})]}),Ct?l.jsx(yt,{tone:"positive",children:"Queued"}):null]}),Ct?l.jsxs("div",{className:"compact-stack",children:[l.jsx("p",{className:"text-zinc-300",children:"Visibility sweep has been queued. View progress on the project page."}),l.jsxs("div",{className:"setup-nav",children:[l.jsx("span",{}),l.jsx(ue,{type:"button",onClick:()=>m({to:R?`/projects/${R}`:"/"}),children:"Open project"})]})]}):l.jsxs("div",{className:"compact-stack",children:[l.jsxs("p",{className:"supporting-copy",children:["Everything is configured. Launch an answer-visibility sweep to start tracking citations for ",l.jsx("span",{className:"text-zinc-100 font-medium",children:T}),"."]}),sn?l.jsx("p",{className:"text-rose-400 text-sm",children:sn}):null,l.jsxs("div",{className:"setup-nav",children:[l.jsx(ue,{type:"button",variant:"outline",onClick:_e,children:"Back"}),l.jsx(ue,{type:"button",disabled:Ue,onClick:os,children:Ue?"Launching...":"Launch visibility sweep"})]})]})]});default:return null}})();return l.jsxs("div",{className:"page-container",children:[l.jsx("div",{className:"page-header",children:l.jsxs("div",{className:"page-header-left",children:[l.jsx("h1",{className:"page-title",children:"Setup"}),l.jsx("p",{className:"page-subtitle",children:"Create a project, add key phrases, add competitors, and launch the first run."})]})}),l.jsx(F4,{current:v,labels:Z4}),l.jsx("section",{className:"setup-wizard",children:wn})]})}function K4(){return l.jsx("div",{className:"page-container",children:l.jsx("section",{className:"page-section",children:l.jsxs(Ve,{className:"surface-card empty-card",children:[l.jsx("h1",{children:"Route not found"}),l.jsx("p",{children:"The current path does not map to a dashboard view."}),l.jsx(ue,{asChild:!0,children:l.jsx(mt,{to:"/",children:"Return to overview"})})]})})})}function V4(){return l.jsx(HM,{children:l.jsx(qM,{})})}const ss=jz()({component:V4,validateSearch:e=>({runId:typeof e.runId=="string"?e.runId:void 0,evidenceId:typeof e.evidenceId=="string"?e.evidenceId:void 0})}),Q4=is({getParentRoute:()=>ss,path:"/",component:t5,beforeLoad:({context:e})=>{const t=e.queryClient.getQueryData(Ei.projects.all);if(t&&t.length===0)throw Zm({to:"/setup"})}}),Y4=is({getParentRoute:()=>ss,path:"/projects",component:h4}),ad=is({getParentRoute:()=>ss,path:"/projects/$projectId",component:()=>l.jsx(ep,{})}),X4=is({getParentRoute:()=>ad,path:"/",component:()=>l.jsx(Hp,{tab:"overview"})}),J4=is({getParentRoute:()=>ad,path:"/search-console",component:()=>l.jsx(Hp,{tab:"search-console"})}),W4=is({getParentRoute:()=>ad,path:"/analytics",component:()=>l.jsx(Hp,{tab:"analytics"})}),e3=is({getParentRoute:()=>ss,path:"/runs",component:D4}),t3=is({getParentRoute:()=>ss,path:"/settings",component:q4,beforeLoad:({context:e})=>{}}),n3=is({getParentRoute:()=>ss,path:"/setup",component:G4,beforeLoad:({context:e})=>{const t=e.queryClient.getQueryData(Ei.projects.all);if(t&&t.length>0)throw Zm({to:"/"})}}),s3=is({getParentRoute:()=>ss,path:"*",component:K4}),i3=ss.addChildren([Q4,Y4,ad.addChildren([X4,J4,W4]),e3,t3,n3,s3]);function a3(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath:"/"}const Mx=a3(),r3=Mx==="/"?"":Mx.replace(/\/$/,"");function o3(e,t){return Tz({routeTree:i3,basepath:r3||"/",context:{queryClient:e},...t?.initialEntries})}const l3={negative:"border-rose-700/60 bg-rose-950/80 text-rose-200",caution:"border-amber-700/60 bg-amber-950/80 text-amber-200",positive:"border-emerald-700/60 bg-emerald-950/80 text-emerald-200",neutral:"border-zinc-700/60 bg-zinc-900/80 text-zinc-200"};function c3(){const e=N.useSyncExternalStore(Iz,Nb,Nb),t=N.useCallback(s=>{wS(s)},[]);return e.length===0?null:l.jsx("div",{"aria-live":"polite","aria-label":"Notifications",className:"fixed bottom-4 right-4 z-50 flex flex-col gap-2 max-w-sm",children:e.map(s=>l.jsxs("div",{role:"alert",className:`flex items-start gap-2 rounded-lg border px-3 py-2.5 text-sm shadow-lg backdrop-blur-sm animate-in slide-in-from-bottom-2 ${l3[s.tone]}`,children:[l.jsx("p",{className:"flex-1 leading-snug",children:s.message}),l.jsx("button",{type:"button",onClick:()=>t(s.id),className:"shrink-0 rounded p-0.5 opacity-60 hover:opacity-100 transition-opacity","aria-label":"Dismiss",children:l.jsx(Mu,{className:"size-3.5"})})]},s.id))})}const I1=Bz(),u3=o3(I1),B1=document.getElementById("root");if(!B1)throw new Error("Expected #root element for web app bootstrap.");aC.createRoot(B1).render(l.jsx(N.StrictMode,{children:l.jsxs(OC,{client:I1,children:[l.jsx(Mz,{router:u3}),l.jsx(c3,{})]})}));