@ainyc/canonry 1.18.0 → 1.19.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,246 @@
1
+ function H_(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 Dx(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var mh={exports:{}},Eo={};var z0;function Z_(){if(z0)return Eo;z0=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 Eo.Fragment=t,Eo.jsx=s,Eo.jsxs=s,Eo}var E0;function F_(){return E0||(E0=1,mh.exports=Z_()),mh.exports}var l=F_(),gh={exports:{}},ze={};var O0;function G_(){if(O0)return ze;O0=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"),m=Symbol.for("react.suspense"),p=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 pe=/\/+/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 ue=!1;if(D===null)ue=!0;else switch(he){case"bigint":case"string":case"number":ue=!0;break;case"object":switch(D.$$typeof){case e:case t:ue=!0;break;case v:return ue=D._init,H(ue(D._payload),G,ne,ae,le)}}if(ue)return le=le(D),ue=ae===""?"."+Ee(D,0):ae,M(le)?(ne="",ue!=null&&(ne=ue.replace(pe,"$&/")+"/"),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(pe,"$&/")+"/")+ue)),G.push(le)),1;ue=0;var Ze=ae===""?".":ae+":";if(M(D))for(var ge=0;ge<D.length;ge++)ae=D[ge],he=Ze+Ee(ae,ge),ue+=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++),ue+=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 ue}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 me=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=m,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 ue=Array(he),Ze=0;Ze<he;Ze++)ue[Ze]=arguments[Ze+2];ae.children=ue}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 ue=arguments.length-2;if(ue===1)le.children=ne;else if(1<ue){for(var Ze=Array(ue),ge=0;ge<ue;ge++)Ze[ge]=arguments[ge+2];le.children=Ze}if(D&&D.defaultProps)for(ae in ue=D.defaultProps,ue)le[ae]===void 0&&(le[ae]=ue[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:p,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,me)}catch(he){me(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 R0;function sl(){return R0||(R0=1,gh.exports=G_()),gh.exports}var N=sl();const ts=Dx(N),Rp=H_({__proto__:null,default:ts},[N]);var yh={exports:{}},Oo={},vh={exports:{}},bh={};var A0;function K_(){return A0||(A0=1,(function(e){function t(H,Z){var oe=H.length;H.push(Z);e:for(;0<oe;){var me=oe-1>>>1,ee=H[me];if(0<r(ee,Z))H[me]=Z,H[oe]=ee,oe=me;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 me=0,ee=H.length,D=ee>>>1;me<D;){var G=2*(me+1)-1,ne=H[G],ae=G+1,le=H[ae];if(0>r(ne,oe))ae<ee&&0>r(le,ne)?(H[me]=le,H[ae]=oe,me=ae):(H[me]=ne,H[G]=oe,me=G);else if(ae<ee&&0>r(le,oe))H[me]=le,H[ae]=oe,me=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 m=[],p=[],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(p);Z!==null;){if(Z.callback===null)a(p);else if(Z.startTime<=H)a(p),Z.sortIndex=Z.expirationTime,t(m,Z);else break;Z=s(p)}}function M(H){if(w=!1,z(H),!j)if(s(m)!==null)j=!0,T||(T=!0,se());else{var Z=s(p);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(m);y!==null&&!(y.expirationTime>H&&ie());){var me=y.callback;if(typeof me=="function"){y.callback=null,b=y.priorityLevel;var ee=me(y.expirationTime<=H);if(H=e.unstable_now(),typeof ee=="function"){y.callback=ee,z(H),Z=!0;break t}y===s(m)&&a(m),z(H)}else a(m);y=s(m)}if(y!==null)Z=!0;else{var D=s(p);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 pe=new MessageChannel,Ee=pe.port2;pe.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 me=e.unstable_now();switch(typeof oe=="object"&&oe!==null?(oe=oe.delay,oe=typeof oe=="number"&&0<oe?me+oe:me):oe=me,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>me?(H.sortIndex=oe,t(p,H),s(m)===null&&H===s(p)&&(w?(E(L),L=-1):w=!0,we(M,oe-me))):(H.sortIndex=ee,t(m,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}}}})(bh)),bh}var T0;function V_(){return T0||(T0=1,vh.exports=K_()),vh.exports}var xh={exports:{}},tn={};var D0;function Q_(){if(D0)return tn;D0=1;var e=sl();function t(m){var p="https://react.dev/errors/"+m;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var v=2;v<arguments.length;v++)p+="&args[]="+encodeURIComponent(arguments[v])}return"Minified React error #"+m+"; visit "+p+" 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(m,p,v){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:r,key:y==null?null:""+y,children:m,containerInfo:p,implementation:v}}var d=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(m,p){if(m==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return tn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,tn.createPortal=function(m,p){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(t(299));return c(m,p,null,v)},tn.flushSync=function(m){var p=d.T,v=a.p;try{if(d.T=null,a.p=2,m)return m()}finally{d.T=p,a.p=v,a.d.f()}},tn.preconnect=function(m,p){typeof m=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,a.d.C(m,p))},tn.prefetchDNS=function(m){typeof m=="string"&&a.d.D(m)},tn.preinit=function(m,p){if(typeof m=="string"&&p&&typeof p.as=="string"){var v=p.as,y=f(v,p.crossOrigin),b=typeof p.integrity=="string"?p.integrity:void 0,x=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;v==="style"?a.d.S(m,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:y,integrity:b,fetchPriority:x}):v==="script"&&a.d.X(m,{crossOrigin:y,integrity:b,fetchPriority:x,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},tn.preinitModule=function(m,p){if(typeof m=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var v=f(p.as,p.crossOrigin);a.d.M(m,{crossOrigin:v,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&a.d.M(m)},tn.preload=function(m,p){if(typeof m=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var v=p.as,y=f(v,p.crossOrigin);a.d.L(m,v,{crossOrigin:y,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},tn.preloadModule=function(m,p){if(typeof m=="string")if(p){var v=f(p.as,p.crossOrigin);a.d.m(m,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:v,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else a.d.m(m)},tn.requestFormReset=function(m){a.d.r(m)},tn.unstable_batchedUpdates=function(m,p){return m(p)},tn.useFormState=function(m,p,v){return d.H.useFormState(m,p,v)},tn.useFormStatus=function(){return d.H.useHostTransitionStatus()},tn.version="19.2.4",tn}var L0;function Lx(){if(L0)return xh.exports;L0=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(),xh.exports=Q_(),xh.exports}var M0;function Y_(){if(M0)return Oo;M0=1;var e=V_(),t=sl(),s=Lx();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 m(n){if(c(n)!==n)throw Error(a(188))}function p(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 m(h),n;if(g===u)return m(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 pe=Symbol.for("react.client.reference");function Ee(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===pe?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},me=[],ee=-1;function D(n){return{current:n}}function G(n){0>ee||(n.current=me[ee],me[ee]=null,ee--)}function ne(n,i){ee++,me[ee]=n.current,n.current=i}var ae=D(null),le=D(null),he=D(null),ue=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)?Xv(n):0;break;default:if(n=i.tagName,i=i.namespaceURI)i=Xv(i),n=Jv(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(ue,n);var i=ae.current,o=Jv(i,n.type);i!==o&&(ne(le,n),ne(ae,o))}function ft(n){le.current===n&&(G(ae),G(le)),ue.current===n&&(G(ue),_o._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,Pe=e.unstable_now,ke=e.unstable_getCurrentPriorityLevel,Te=e.unstable_ImmediatePriority,kt=e.unstable_UserBlockingPriority,Vn=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:dl,$e=Math.log,id=Math.LN2;function dl(n){return n>>>=0,n===0?32:31-($e(n)/id|0)|0}var Ks=256,Ss=262144,Bi=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 za(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 fl(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 hl(){var n=Bi;return Bi<<=1,(Bi&62914560)===0&&(Bi=4194304),n}function Ea(n){for(var i=[],o=0;31>o;o++)i.push(n);return i}function qi(n,i){n.pendingLanes|=i,i!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function ad(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 ml(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 $r(n,i){var o=i&-i;return o=(o&42)!==0?1:P(o),(o&(n.suspendedLanes|i))!==0?0:o}function P(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:S0(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,rd="__reactListeners$"+Dt,Vs="__reactHandles$"+Dt,Qs="__reactResources$"+Dt,us="__reactMarker$"+Dt;function Oa(n){delete n[zt],delete n[wt],delete n[en],delete n[rd],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=a0(n);n!==null;){if(o=n[zt])return o;n=a0(n)}return i}n=o,o=n.parentNode}return null}function Qn(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 Ra=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]*$"),Ir={},qm={};function L1(n){return Ct.call(qm,n)?!0:Ct.call(Ir,n)?!1:Ra.test(n)?qm[n]=!0:(Ir[n]=!0,!1)}function gl(n,i,o){if(L1(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 yl(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 Rn(n){switch(typeof n){case"bigint":case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function Hm(n){var i=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function M1(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 od(n){if(!n._valueTracker){var i=Hm(n)?"checked":"value";n._valueTracker=M1(n,i,""+n[i])}}function Zm(n){if(!n)return!1;var i=n._valueTracker;if(!i)return!0;var o=i.getValue(),u="";return n&&(u=Hm(n)?n.checked?"true":"false":n.value),n=u,n!==o?(i.setValue(n),!0):!1}function vl(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 U1=/[\n"\\]/g;function An(n){return n.replace(U1,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function ld(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=""+Rn(i)):n.value!==""+Rn(i)&&(n.value=""+Rn(i)):S!=="submit"&&S!=="reset"||n.removeAttribute("value"),i!=null?cd(n,S,Rn(i)):o!=null?cd(n,S,Rn(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=""+Rn(k):n.removeAttribute("name")}function Fm(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)){od(n);return}o=o!=null?""+Rn(o):"",i=i!=null?""+Rn(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),od(n)}function cd(n,i,o){i==="number"&&vl(n.ownerDocument)===n||n.defaultValue===""+o||(n.defaultValue=""+o)}function Aa(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=""+Rn(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 Gm(n,i,o){if(i!=null&&(i=""+Rn(i),i!==n.value&&(n.value=i),o==null)){n.defaultValue!==i&&(n.defaultValue=i);return}n.defaultValue=o!=null?""+Rn(o):""}function Km(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=Rn(i),n.defaultValue=o,u=n.textContent,u===o&&u!==""&&u!==null&&(n.value=u),od(n)}function Ta(n,i){if(i){var o=n.firstChild;if(o&&o===n.lastChild&&o.nodeType===3){o.nodeValue=i;return}}n.textContent=i}var P1=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 Vm(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||P1.has(i)?i==="float"?n.cssFloat=o:n[i]=(""+o).trim():n[i]=o+"px"}function Qm(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&&Vm(n,h,u)}else for(var g in i)i.hasOwnProperty(g)&&Vm(n,g,i[g])}function ud(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 $1=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"]]),I1=/^[\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 bl(n){return I1.test(""+n)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":n}function js(){}var dd=null;function fd(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var Da=null,La=null;function Ym(n){var i=Qn(n);if(i&&(n=i.stateNode)){var o=n[wt]||null;e:switch(n=i.stateNode,i.type){case"input":if(ld(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="'+An(""+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));ld(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&&Zm(u)}break e;case"textarea":Gm(n,o.value,o.defaultValue);break e;case"select":i=o.value,i!=null&&Aa(n,!!o.multiple,i,!1)}}}var hd=!1;function Xm(n,i,o){if(hd)return n(i,o);hd=!0;try{var u=n(i);return u}finally{if(hd=!1,(Da!==null||La!==null)&&(rc(),Da&&(i=Da,n=La,La=Da=null,Ym(i),n)))for(i=0;i<n.length;i++)Ym(n[i])}}function Br(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"),pd=!1;if(Ns)try{var qr={};Object.defineProperty(qr,"passive",{get:function(){pd=!0}}),window.addEventListener("test",qr,qr),window.removeEventListener("test",qr,qr)}catch{pd=!1}var Js=null,md=null,xl=null;function Jm(){if(xl)return xl;var n,i=md,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 xl=h.slice(n,1<u?1-u:void 0)}function Sl(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 wl(){return!0}function Wm(){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)?wl:Wm,this.isPropagationStopped=Wm,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=wl)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=wl)},persist:function(){},isPersistent:wl}),i}var Hi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},jl=fn(Hi),Hr=y({},Hi,{view:0,detail:0}),B1=fn(Hr),gd,yd,Zr,Nl=y({},Hr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:bd,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!==Zr&&(Zr&&n.type==="mousemove"?(gd=n.screenX-Zr.screenX,yd=n.screenY-Zr.screenY):yd=gd=0,Zr=n),gd)},movementY:function(n){return"movementY"in n?n.movementY:yd}}),eg=fn(Nl),q1=y({},Nl,{dataTransfer:0}),H1=fn(q1),Z1=y({},Hr,{relatedTarget:0}),vd=fn(Z1),F1=y({},Hi,{animationName:0,elapsedTime:0,pseudoElement:0}),G1=fn(F1),K1=y({},Hi,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),V1=fn(K1),Q1=y({},Hi,{data:0}),tg=fn(Q1),Y1={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},X1={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"},J1={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function W1(n){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(n):(n=J1[n])?!!i[n]:!1}function bd(){return W1}var eN=y({},Hr,{key:function(n){if(n.key){var i=Y1[n.key]||n.key;if(i!=="Unidentified")return i}return n.type==="keypress"?(n=Sl(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?X1[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:bd,charCode:function(n){return n.type==="keypress"?Sl(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?Sl(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),tN=fn(eN),nN=y({},Nl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ng=fn(nN),sN=y({},Hr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:bd}),iN=fn(sN),aN=y({},Hi,{propertyName:0,elapsedTime:0,pseudoElement:0}),rN=fn(aN),oN=y({},Nl,{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}),lN=fn(oN),cN=y({},Hi,{newState:0,oldState:0}),uN=fn(cN),dN=[9,13,27,32],xd=Ns&&"CompositionEvent"in window,Fr=null;Ns&&"documentMode"in document&&(Fr=document.documentMode);var fN=Ns&&"TextEvent"in window&&!Fr,sg=Ns&&(!xd||Fr&&8<Fr&&11>=Fr),ig=" ",ag=!1;function rg(n,i){switch(n){case"keyup":return dN.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function og(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var Ma=!1;function hN(n,i){switch(n){case"compositionend":return og(i);case"keypress":return i.which!==32?null:(ag=!0,ig);case"textInput":return n=i.data,n===ig&&ag?null:n;default:return null}}function pN(n,i){if(Ma)return n==="compositionend"||!xd&&rg(n,i)?(n=Jm(),xl=md=Js=null,Ma=!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 sg&&i.locale!=="ko"?null:i.data;default:return null}}var mN={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 lg(n){var i=n&&n.nodeName&&n.nodeName.toLowerCase();return i==="input"?!!mN[n.type]:i==="textarea"}function cg(n,i,o,u){Da?La?La.push(u):La=[u]:Da=u,i=hc(i,"onChange"),0<i.length&&(o=new jl("onChange","change",null,o,u),n.push({event:o,listeners:i}))}var Gr=null,Kr=null;function gN(n){Fv(n,0)}function _l(n){var i=ds(n);if(Zm(i))return n}function ug(n,i){if(n==="change")return i}var dg=!1;if(Ns){var Sd;if(Ns){var wd="oninput"in document;if(!wd){var fg=document.createElement("div");fg.setAttribute("oninput","return;"),wd=typeof fg.oninput=="function"}Sd=wd}else Sd=!1;dg=Sd&&(!document.documentMode||9<document.documentMode)}function hg(){Gr&&(Gr.detachEvent("onpropertychange",pg),Kr=Gr=null)}function pg(n){if(n.propertyName==="value"&&_l(Kr)){var i=[];cg(i,Kr,n,fd(n)),Xm(gN,i)}}function yN(n,i,o){n==="focusin"?(hg(),Gr=i,Kr=o,Gr.attachEvent("onpropertychange",pg)):n==="focusout"&&hg()}function vN(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return _l(Kr)}function bN(n,i){if(n==="click")return _l(i)}function xN(n,i){if(n==="input"||n==="change")return _l(i)}function SN(n,i){return n===i&&(n!==0||1/n===1/i)||n!==n&&i!==i}var Nn=typeof Object.is=="function"?Object.is:SN;function Vr(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 mg(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function gg(n,i){var o=mg(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=mg(o)}}function yg(n,i){return n&&i?n===i?!0:n&&n.nodeType===3?!1:i&&i.nodeType===3?yg(n,i.parentNode):"contains"in n?n.contains(i):n.compareDocumentPosition?!!(n.compareDocumentPosition(i)&16):!1:!1}function vg(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var i=vl(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=vl(n.document)}return i}function jd(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 wN=Ns&&"documentMode"in document&&11>=document.documentMode,Ua=null,Nd=null,Qr=null,_d=!1;function bg(n,i,o){var u=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;_d||Ua==null||Ua!==vl(u)||(u=Ua,"selectionStart"in u&&jd(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}),Qr&&Vr(Qr,u)||(Qr=u,u=hc(Nd,"onSelect"),0<u.length&&(i=new jl("onSelect","select",null,i,o),n.push({event:i,listeners:u}),i.target=Ua)))}function Zi(n,i){var o={};return o[n.toLowerCase()]=i.toLowerCase(),o["Webkit"+n]="webkit"+i,o["Moz"+n]="moz"+i,o}var Pa={animationend:Zi("Animation","AnimationEnd"),animationiteration:Zi("Animation","AnimationIteration"),animationstart:Zi("Animation","AnimationStart"),transitionrun:Zi("Transition","TransitionRun"),transitionstart:Zi("Transition","TransitionStart"),transitioncancel:Zi("Transition","TransitionCancel"),transitionend:Zi("Transition","TransitionEnd")},Cd={},xg={};Ns&&(xg=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 Fi(n){if(Cd[n])return Cd[n];if(!Pa[n])return n;var i=Pa[n],o;for(o in i)if(i.hasOwnProperty(o)&&o in xg)return Cd[n]=i[o];return n}var Sg=Fi("animationend"),wg=Fi("animationiteration"),jg=Fi("animationstart"),jN=Fi("transitionrun"),NN=Fi("transitionstart"),_N=Fi("transitioncancel"),Ng=Fi("transitionend"),_g=new Map,kd="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(" ");kd.push("scrollEnd");function Yn(n,i){_g.set(n,i),qt(i,[n])}var Cl=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)},Tn=[],$a=0,zd=0;function kl(){for(var n=$a,i=zd=$a=0;i<n;){var o=Tn[i];Tn[i++]=null;var u=Tn[i];Tn[i++]=null;var h=Tn[i];Tn[i++]=null;var g=Tn[i];if(Tn[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&&Cg(o,h,g)}}function zl(n,i,o,u){Tn[$a++]=n,Tn[$a++]=i,Tn[$a++]=o,Tn[$a++]=u,zd|=u,n.lanes|=u,n=n.alternate,n!==null&&(n.lanes|=u)}function Ed(n,i,o,u){return zl(n,i,o,u),El(n)}function Gi(n,i){return zl(n,null,null,i),El(n)}function Cg(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 El(n){if(50<vo)throw vo=0,$f=null,Error(a(185));for(var i=n.return;i!==null;)n=i,i=n.return;return n.tag===3?n.stateNode:null}var Ia={};function CN(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 CN(n,i,o,u)}function Od(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 kg(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 Ol(n,i,o,u,h,g){var S=0;if(u=n,typeof n=="function")Od(n)&&(S=1);else if(typeof n=="string")S=R_(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 Ki(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 Ki(n,i,o,u){return n=_n(7,n,u,i),n.lanes=o,n}function Rd(n,i,o){return n=_n(6,n,null,i),n.lanes=o,n}function zg(n){var i=_n(18,null,null,0);return i.stateNode=n,i}function Ad(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 Eg=new WeakMap;function Dn(n,i){if(typeof n=="object"&&n!==null){var o=Eg.get(n);return o!==void 0?o:(i={value:n,source:i,stack:Gt(i)},Eg.set(n,i),i)}return{value:n,source:i,stack:Gt(i)}}var Ba=[],qa=0,Rl=null,Yr=0,Ln=[],Mn=0,Ws=null,fs=1,hs="";function Cs(n,i){Ba[qa++]=Yr,Ba[qa++]=Rl,Rl=n,Yr=i}function Og(n,i,o){Ln[Mn++]=fs,Ln[Mn++]=hs,Ln[Mn++]=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 Td(n){n.return!==null&&(Cs(n,1),Og(n,1,0))}function Dd(n){for(;n===Rl;)Rl=Ba[--qa],Ba[qa]=null,Yr=Ba[--qa],Ba[qa]=null;for(;n===Ws;)Ws=Ln[--Mn],Ln[Mn]=null,hs=Ln[--Mn],Ln[Mn]=null,fs=Ln[--Mn],Ln[Mn]=null}function Rg(n,i){Ln[Mn++]=fs,Ln[Mn++]=hs,Ln[Mn++]=Ws,fs=i.id,hs=i.overflow,Ws=n}var Vt=null,ct=null,He=!1,ei=null,Un=!1,Ld=Error(a(519));function ti(n){var i=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Xr(Dn(i,n)),Ld}function Ag(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<xo.length;o++)Me(xo[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),Fm(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),Km(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||Qv(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 Tg(n){for(Vt=n.return;Vt;)switch(Vt.tag){case 5:case 31:case 13:Un=!1;return;case 27:case 3:Un=!0;return;default:Vt=Vt.return}}function Ha(n){if(n!==Vt)return!1;if(!He)return Tg(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")||eh(n.type,n.memoizedProps)),o=!o),o&&ct&&ti(n),Tg(n),i===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(a(317));ct=i0(n)}else if(i===31){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(a(317));ct=i0(n)}else i===27?(i=ct,mi(n.type)?(n=ah,ah=null,ct=n):ct=i):ct=Vt?$n(n.stateNode.nextSibling):null;return!0}function Vi(){ct=Vt=null,He=!1}function Md(){var n=ei;return n!==null&&(gn===null?gn=n:gn.push.apply(gn,n),ei=null),n}function Xr(n){ei===null?ei=[n]:ei.push(n)}var Ud=D(null),Qi=null,ks=null;function ni(n,i,o){ne(Ud,i._currentValue),i._currentValue=o}function zs(n){n._currentValue=Ud.current,G(Ud)}function Pd(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 $d(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),Pd(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),Pd(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 Za(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===ue.current){if(S=h.alternate,S===null)throw Error(a(387));S.memoizedState.memoizedState!==h.memoizedState.memoizedState&&(n!==null?n.push(_o):n=[_o])}h=h.return}n!==null&&$d(i,n,o,u),i.flags|=262144}function Al(n){for(n=n.firstContext;n!==null;){if(!Nn(n.context._currentValue,n.memoizedValue))return!0;n=n.next}return!1}function Yi(n){Qi=n,ks=null,n=n.dependencies,n!==null&&(n.firstContext=null)}function Qt(n){return Dg(Qi,n)}function Tl(n,i){return Qi===null&&Yi(n),Dg(n,i)}function Dg(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 kN=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()})}},zN=e.unstable_scheduleCallback,EN=e.unstable_NormalPriority,Mt={$$typeof:O,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Id(){return{controller:new kN,data:new Map,refCount:0}}function Jr(n){n.refCount--,n.refCount===0&&zN(EN,function(){n.controller.abort()})}var Wr=null,Bd=0,Fa=0,Ga=null;function ON(n,i){if(Wr===null){var o=Wr=[];Bd=0,Fa=Ff(),Ga={status:"pending",value:void 0,then:function(u){o.push(u)}}}return Bd++,i.then(Lg,Lg),i}function Lg(){if(--Bd===0&&Wr!==null){Ga!==null&&(Ga.status="fulfilled");var n=Wr;Wr=null,Fa=0,Ga=null;for(var i=0;i<n.length;i++)(0,n[i])()}}function RN(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 Mg=H.S;H.S=function(n,i){bv=Pe(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&ON(n,i),Mg!==null&&Mg(n,i)};var Xi=D(null);function qd(){var n=Xi.current;return n!==null?n:at.pooledCache}function Dl(n,i){i===null?ne(Xi,Xi.current):ne(Xi,i.pool)}function Ug(){var n=qd();return n===null?null:{parent:Mt._currentValue,pool:n}}var Ka=Error(a(460)),Hd=Error(a(474)),Ll=Error(a(542)),Ml={then:function(){}};function Pg(n){return n=n.status,n==="fulfilled"||n==="rejected"}function $g(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,Bg(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,Bg(n),n}throw Wi=i,Ka}}function Ji(n){try{var i=n._init;return i(n._payload)}catch(o){throw o!==null&&typeof o=="object"&&typeof o.then=="function"?(Wi=o,Ka):o}}var Wi=null;function Ig(){if(Wi===null)throw Error(a(459));var n=Wi;return Wi=null,n}function Bg(n){if(n===Ka||n===Ll)throw Error(a(483))}var Va=null,eo=0;function Ul(n){var i=eo;return eo+=1,Va===null&&(Va=[]),$g(Va,n,i)}function to(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 qg(n){function i($,U){if(n){var B=$.deletions;B===null?($.deletions=[U],$.flags|=16):B.push(U)}}function o($,U){if(!n)return null;for(;U!==null;)i($,U),U=U.sibling;return null}function u($){for(var U=new Map;$!==null;)$.key!==null?U.set($.key,$):U.set($.index,$),$=$.sibling;return U}function h($,U){return $=_s($,U),$.index=0,$.sibling=null,$}function g($,U,B){return $.index=B,n?(B=$.alternate,B!==null?(B=B.index,B<U?($.flags|=67108866,U):B):($.flags|=67108866,U)):($.flags|=1048576,U)}function S($){return n&&$.alternate===null&&($.flags|=67108866),$}function k($,U,B,Y){return U===null||U.tag!==6?(U=Rd(B,$.mode,Y),U.return=$,U):(U=h(U,B),U.return=$,U)}function A($,U,B,Y){var je=B.type;return je===w?V($,U,B.props.children,Y,B.key):U!==null&&(U.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===R&&Ji(je)===U.type)?(U=h(U,B.props),to(U,B),U.return=$,U):(U=Ol(B.type,B.key,B.props,null,$.mode,Y),to(U,B),U.return=$,U)}function q($,U,B,Y){return U===null||U.tag!==4||U.stateNode.containerInfo!==B.containerInfo||U.stateNode.implementation!==B.implementation?(U=Ad(B,$.mode,Y),U.return=$,U):(U=h(U,B.children||[]),U.return=$,U)}function V($,U,B,Y,je){return U===null||U.tag!==7?(U=Ki(B,$.mode,Y,je),U.return=$,U):(U=h(U,B),U.return=$,U)}function J($,U,B){if(typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint")return U=Rd(""+U,$.mode,B),U.return=$,U;if(typeof U=="object"&&U!==null){switch(U.$$typeof){case x:return B=Ol(U.type,U.key,U.props,null,$.mode,B),to(B,U),B.return=$,B;case j:return U=Ad(U,$.mode,B),U.return=$,U;case R:return U=Ji(U),J($,U,B)}if(we(U)||se(U))return U=Ki(U,$.mode,B,null),U.return=$,U;if(typeof U.then=="function")return J($,Ul(U),B);if(U.$$typeof===O)return J($,Tl($,U),B);Pl($,U)}return null}function F($,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($,U,""+B,Y);if(typeof B=="object"&&B!==null){switch(B.$$typeof){case x:return B.key===je?A($,U,B,Y):null;case j:return B.key===je?q($,U,B,Y):null;case R:return B=Ji(B),F($,U,B,Y)}if(we(B)||se(B))return je!==null?null:V($,U,B,Y,null);if(typeof B.then=="function")return F($,U,Ul(B),Y);if(B.$$typeof===O)return F($,U,Tl($,B),Y);Pl($,B)}return null}function K($,U,B,Y,je){if(typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint")return $=$.get(B)||null,k(U,$,""+Y,je);if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case x:return $=$.get(Y.key===null?B:Y.key)||null,A(U,$,Y,je);case j:return $=$.get(Y.key===null?B:Y.key)||null,q(U,$,Y,je);case R:return Y=Ji(Y),K($,U,B,Y,je)}if(we(Y)||se(Y))return $=$.get(B)||null,V(U,$,Y,je,null);if(typeof Y.then=="function")return K($,U,B,Ul(Y),je);if(Y.$$typeof===O)return K($,U,B,Tl(U,Y),je);Pl(U,Y)}return null}function ye($,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($,xe,B[Ae],Y);if(Ge===null){xe===null&&(xe=qe);break}n&&xe&&Ge.alternate===null&&i($,xe),U=g(Ge,U,Ae),Fe===null?je=Ge:Fe.sibling=Ge,Fe=Ge,xe=qe}if(Ae===B.length)return o($,xe),He&&Cs($,Ae),je;if(xe===null){for(;Ae<B.length;Ae++)xe=J($,B[Ae],Y),xe!==null&&(U=g(xe,U,Ae),Fe===null?je=xe:Fe.sibling=xe,Fe=xe);return He&&Cs($,Ae),je}for(xe=u(xe);Ae<B.length;Ae++)qe=K(xe,$,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($,xi)}),He&&Cs($,Ae),je}function Ce($,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($,xe,Ge.value,Y);if(xi===null){xe===null&&(xe=qe);break}n&&xe&&xi.alternate===null&&i($,xe),U=g(xi,U,Ae),Fe===null?je=xi:Fe.sibling=xi,Fe=xi,xe=qe}if(Ge.done)return o($,xe),He&&Cs($,Ae),je;if(xe===null){for(;!Ge.done;Ae++,Ge=B.next())Ge=J($,Ge.value,Y),Ge!==null&&(U=g(Ge,U,Ae),Fe===null?je=Ge:Fe.sibling=Ge,Fe=Ge);return He&&Cs($,Ae),je}for(xe=u(xe);!Ge.done;Ae++,Ge=B.next())Ge=K(xe,$,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($,q_)}),He&&Cs($,Ae),je}function it($,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($,U.sibling),Y=h(U,B.props.children),Y.return=$,$=Y;break e}}else if(U.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===R&&Ji(je)===U.type){o($,U.sibling),Y=h(U,B.props),to(Y,B),Y.return=$,$=Y;break e}o($,U);break}else i($,U);U=U.sibling}B.type===w?(Y=Ki(B.props.children,$.mode,Y,B.key),Y.return=$,$=Y):(Y=Ol(B.type,B.key,B.props,null,$.mode,Y),to(Y,B),Y.return=$,$=Y)}return S($);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($,U.sibling),Y=h(U,B.children||[]),Y.return=$,$=Y;break e}else{o($,U);break}else i($,U);U=U.sibling}Y=Ad(B,$.mode,Y),Y.return=$,$=Y}return S($);case R:return B=Ji(B),it($,U,B,Y)}if(we(B))return ye($,U,B,Y);if(se(B)){if(je=se(B),typeof je!="function")throw Error(a(150));return B=je.call(B),Ce($,U,B,Y)}if(typeof B.then=="function")return it($,U,Ul(B),Y);if(B.$$typeof===O)return it($,U,Tl($,B),Y);Pl($,B)}return typeof B=="string"&&B!==""||typeof B=="number"||typeof B=="bigint"?(B=""+B,U!==null&&U.tag===6?(o($,U.sibling),Y=h(U,B),Y.return=$,$=Y):(o($,U),Y=Rd(B,$.mode,Y),Y.return=$,$=Y),S($)):o($,U)}return function($,U,B,Y){try{eo=0;var je=it($,U,B,Y);return Va=null,je}catch(xe){if(xe===Ka||xe===Ll)throw xe;var Fe=_n(29,xe,null,$.mode);return Fe.lanes=Y,Fe.return=$,Fe}}}var ea=qg(!0),Hg=qg(!1),si=!1;function Zd(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Fd(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=El(n),Cg(n,null,o),i}return zl(n,u,i,o),El(n)}function no(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,ml(n,o)}}function Gd(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 Kd=!1;function so(){if(Kd){var n=Ga;if(n!==null)throw n}}function io(n,i,o,u){Kd=!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===Fa&&(Kd=!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 Zg(n,i){if(typeof n!="function")throw Error(a(191,n));n.call(i)}function Fg(n,i){var o=n.callbacks;if(o!==null)for(n.callbacks=null,n=0;n<o.length;n++)Zg(o[n],i)}var Qa=D(null),$l=D(0);function Gg(n,i){n=Us,ne($l,n),ne(Qa,i),Us=n|i.baseLanes}function Vd(){ne($l,Us),ne(Qa,Qa.current)}function Qd(){Us=$l.current,G(Qa),G($l)}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||Qa.current!==null||i.memoizedState!==null)&&(Pn=n)}function Yd(n){ne(Et,Et.current),ne(Cn,n),Pn===null&&(Pn=n)}function Kg(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 Il(n){for(var i=n;i!==null;){if(i.tag===13){var o=i.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||sh(o)||ih(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,Bl=!1,Ya=!1,ta=!1,ql=0,ao=0,Xa=null,AN=0;function jt(){throw Error(a(321))}function Xd(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 Jd(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?Oy:pf,ta=!1,g=o(u,h),ta=!1,Ya&&(g=Qg(i,o,u,h)),Vg(n),g}function Vg(n){H.H=lo;var i=nt!==null&&nt.next!==null;if(Es=0,Ut=nt=Re=null,Bl=!1,ao=0,Xa=null,i)throw Error(a(300));n===null||Pt||(n=n.dependencies,n!==null&&Al(n)&&(Pt=!0))}function Qg(n,i,o,u){Re=n;var h=0;do{if(Ya&&(Xa=null),ao=0,Ya=!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=Ry,g=i(o,u)}while(Ya);return g}function TN(){var n=H.H,i=n.useState()[0];return i=typeof i.then=="function"?ro(i):i,n=n.useState()[0],(nt!==null?nt.memoizedState:null)!==n&&(Re.flags|=1024),i}function Wd(){var n=ql!==0;return ql=0,n}function ef(n,i,o){i.updateQueue=n.updateQueue,i.flags&=-2053,n.lanes&=~o}function tf(n){if(Bl){for(n=n.memoizedState;n!==null;){var i=n.queue;i!==null&&(i.pending=null),n=n.next}Bl=!1}Es=0,Ut=nt=Re=null,Ya=!1,ao=ql=0,Xa=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 Hl(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ro(n){var i=ao;return ao+=1,Xa===null&&(Xa=[]),n=$g(Xa,n,i),i=Re,(Ut===null?i.memoizedState:Ut.next)===null&&(i=i.alternate,H.H=i===null||i.memoizedState===null?Oy:pf),n}function Zl(n){if(n!==null&&typeof n=="object"){if(typeof n.then=="function")return ro(n);if(n.$$typeof===O)return Qt(n)}throw Error(a(438,String(n)))}function nf(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=Hl(),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 Fl(n){var i=Ot();return sf(i,nt,n)}function sf(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===Fa&&(V=!0);else if((Es&F)===F){q=q.next,F===Fa&&(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,ta&&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)&&(Pt=!0,V&&(o=Ga,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 af(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)||(Pt=!0),i.memoizedState=g,i.baseQueue===null&&(i.baseState=g),o.lastRenderedState=g}return[g,u]}function Yg(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,Pt=!0),h=h.queue,lf(Wg.bind(null,u,h,n),[n]),h.getSnapshot!==i||S||Ut!==null&&Ut.memoizedState.tag&1){if(u.flags|=2048,Ja(9,{destroy:void 0},Jg.bind(null,u,h,o,i),null),at===null)throw Error(a(349));g||(Es&127)!==0||Xg(u,i,o)}return o}function Xg(n,i,o){n.flags|=16384,n={getSnapshot:i,value:o},i=Re.updateQueue,i===null?(i=Hl(),Re.updateQueue=i,i.stores=[n]):(o=i.stores,o===null?i.stores=[n]:o.push(n))}function Jg(n,i,o,u){i.value=o,i.getSnapshot=u,ey(i)&&ty(n)}function Wg(n,i,o){return o(function(){ey(i)&&ty(n)})}function ey(n){var i=n.getSnapshot;n=n.value;try{var o=i();return!Nn(n,o)}catch{return!0}}function ty(n){var i=Gi(n,2);i!==null&&yn(i,n,2)}function rf(n){var i=rn();if(typeof n=="function"){var o=n;if(n=o(),ta){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 ny(n,i,o,u){return n.baseState=o,sf(n,nt,typeof u=="function"?u:Os)}function DN(n,i,o,u,h){if(Vl(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,sy(i,g)):(g.next=o.next,i.pending=o.next=g)}}function sy(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),iy(n,i,k)}catch(q){of(n,i,q)}finally{g!==null&&S.types!==null&&(g.types=S.types),H.T=g}}else try{g=o(h,u),iy(n,i,g)}catch(q){of(n,i,q)}}function iy(n,i,o){o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(function(u){ay(n,i,u)},function(u){return of(n,i,u)}):ay(n,i,o)}function ay(n,i,o){i.status="fulfilled",i.value=o,ry(i),n.state=o,i=n.pending,i!==null&&(o=i.next,o===i?n.pending=null:(o=o.next,i.next=o,sy(n,o)))}function of(n,i,o){var u=n.pending;if(n.pending=null,u!==null){u=u.next;do i.status="rejected",i.reason=o,ry(i),i=i.next;while(i!==u)}n.action=null}function ry(n){n=n.listeners;for(var i=0;i<n.length;i++)(0,n[i])()}function oy(n,i){return i}function ly(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=Un;h.nodeType!==8;){if(!g){h=null;break t}if(h=$n(h.nextSibling),h===null){h=null;break t}}g=h.data,h=g==="F!"||g==="F"?h:null}if(h){ct=$n(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:oy,lastRenderedState:i},o.queue=u,o=ky.bind(null,Re,u),u.dispatch=o,u=rf(!1),g=hf.bind(null,Re,!1,u.queue),u=rn(),h={state:i,dispatch:null,action:n,pending:null},u.queue=h,o=DN.bind(null,Re,h,g,o),h.dispatch=o,u.memoizedState=n,[i,o,!1]}function cy(n){var i=Ot();return uy(i,nt,n)}function uy(n,i,o){if(i=sf(n,i,oy)[0],n=Fl(Os)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var u=ro(i)}catch(S){throw S===Ka?Ll:S}else u=i;i=Ot();var h=i.queue,g=h.dispatch;return o!==i.memoizedState&&(Re.flags|=2048,Ja(9,{destroy:void 0},LN.bind(null,h,o),null)),[u,g,n]}function LN(n,i){n.action=i}function dy(n){var i=Ot(),o=nt;if(o!==null)return uy(i,o,n);Ot(),i=i.memoizedState,o=Ot();var u=o.queue.dispatch;return o.memoizedState=n,[i,u,!1]}function Ja(n,i,o,u){return n={tag:n,create:o,deps:u,inst:i,next:null},i=Re.updateQueue,i===null&&(i=Hl(),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 fy(){return Ot().memoizedState}function Gl(n,i,o,u){var h=rn();Re.flags|=n,h.memoizedState=Ja(1|i,{destroy:void 0},o,u===void 0?null:u)}function Kl(n,i,o,u){var h=Ot();u=u===void 0?null:u;var g=h.memoizedState.inst;nt!==null&&u!==null&&Xd(u,nt.memoizedState.deps)?h.memoizedState=Ja(i,g,o,u):(Re.flags|=n,h.memoizedState=Ja(1|i,g,o,u))}function hy(n,i){Gl(8390656,8,n,i)}function lf(n,i){Kl(2048,8,n,i)}function MN(n){Re.flags|=4;var i=Re.updateQueue;if(i===null)i=Hl(),Re.updateQueue=i,i.events=[n];else{var o=i.events;o===null?i.events=[n]:o.push(n)}}function py(n){var i=Ot().memoizedState;return MN({ref:i,nextImpl:n}),function(){if((Ke&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}function my(n,i){return Kl(4,2,n,i)}function gy(n,i){return Kl(4,4,n,i)}function yy(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 vy(n,i,o){o=o!=null?o.concat([n]):null,Kl(4,4,yy.bind(null,i,n),o)}function cf(){}function by(n,i){var o=Ot();i=i===void 0?null:i;var u=o.memoizedState;return i!==null&&Xd(i,u[1])?u[0]:(o.memoizedState=[n,i],n)}function xy(n,i){var o=Ot();i=i===void 0?null:i;var u=o.memoizedState;if(i!==null&&Xd(i,u[1]))return u[0];if(u=n(),ta){wn(!0);try{n()}finally{wn(!1)}}return o.memoizedState=[u,i],u}function uf(n,i,o){return o===void 0||(Es&1073741824)!==0&&(Be&261930)===0?n.memoizedState=i:(n.memoizedState=o,n=Sv(),Re.lanes|=n,ui|=n,o)}function Sy(n,i,o,u){return Nn(o,i)?o:Qa.current!==null?(n=uf(n,o,u),Nn(n,i)||(Pt=!0),n):(Es&42)===0||(Es&1073741824)!==0&&(Be&261930)===0?(Pt=!0,n.memoizedState=o):(n=Sv(),Re.lanes|=n,ui|=n,i)}function wy(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,hf(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=RN(A,u);oo(n,i,V,On(n))}else oo(n,i,u,On(n))}catch(J){oo(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 UN(){}function df(n,i,o,u){if(n.tag!==5)throw Error(a(476));var h=jy(n).queue;wy(n,h,i,oe,o===null?UN:function(){return Ny(n),o(u)})}function jy(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 Ny(n){var i=jy(n);i.next===null&&(i=n.alternate.memoizedState),oo(n,i.next.queue,{},On())}function ff(){return Qt(_o)}function _y(){return Ot().memoizedState}function Cy(){return Ot().memoizedState}function PN(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),no(u,i,o)),i={cache:Id()},n.payload=i;return}i=i.return}}function $N(n,i,o){var u=On();o={lane:u,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},Vl(n)?zy(i,o):(o=Ed(n,i,o,u),o!==null&&(yn(o,n,u),Ey(o,i,u)))}function ky(n,i,o){var u=On();oo(n,i,o,u)}function oo(n,i,o,u){var h={lane:u,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null};if(Vl(n))zy(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 zl(n,i,h,0),at===null&&kl(),!1}catch{}if(o=Ed(n,i,h,u),o!==null)return yn(o,n,u),Ey(o,i,u),!0}return!1}function hf(n,i,o,u){if(u={lane:2,revertLane:Ff(),gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Vl(n)){if(i)throw Error(a(479))}else i=Ed(n,o,u,2),i!==null&&yn(i,n,2)}function Vl(n){var i=n.alternate;return n===Re||i!==null&&i===Re}function zy(n,i){Ya=Bl=!0;var o=n.pending;o===null?i.next=i:(i.next=o.next,o.next=i),n.pending=i}function Ey(n,i,o){if((o&4194048)!==0){var u=i.lanes;u&=n.pendingLanes,o|=u,i.lanes=o,ml(n,o)}}var lo={readContext:Qt,use:Zl,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};lo.useEffectEvent=jt;var Oy={readContext:Qt,use:Zl,useCallback:function(n,i){return rn().memoizedState=[n,i===void 0?null:i],n},useContext:Qt,useEffect:hy,useImperativeHandle:function(n,i,o){o=o!=null?o.concat([n]):null,Gl(4194308,4,yy.bind(null,i,n),o)},useLayoutEffect:function(n,i){return Gl(4194308,4,n,i)},useInsertionEffect:function(n,i){Gl(4,2,n,i)},useMemo:function(n,i){var o=rn();i=i===void 0?null:i;var u=n();if(ta){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(ta){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=$N.bind(null,Re,n),[u.memoizedState,n]},useRef:function(n){var i=rn();return n={current:n},i.memoizedState=n},useState:function(n){n=rf(n);var i=n.queue,o=ky.bind(null,Re,i);return i.dispatch=o,[n.memoizedState,o]},useDebugValue:cf,useDeferredValue:function(n,i){var o=rn();return uf(o,n,i)},useTransition:function(){var n=rf(!1);return n=wy.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||Xg(u,i,o)}h.memoizedState=o;var g={value:o,getSnapshot:i};return h.queue=g,hy(Wg.bind(null,u,g,n),[n]),u.flags|=2048,Ja(9,{destroy:void 0},Jg.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=ql++,0<o&&(i+="H"+o.toString(32)),i+="_"}else o=AN++,i="_"+i+"r_"+o.toString(32)+"_";return n.memoizedState=i},useHostTransitionStatus:ff,useFormState:ly,useActionState:ly,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=hf.bind(null,Re,!0,o),o.dispatch=i,[n,i]},useMemoCache:nf,useCacheRefresh:function(){return rn().memoizedState=PN.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)}}},pf={readContext:Qt,use:Zl,useCallback:by,useContext:Qt,useEffect:lf,useImperativeHandle:vy,useInsertionEffect:my,useLayoutEffect:gy,useMemo:xy,useReducer:Fl,useRef:fy,useState:function(){return Fl(Os)},useDebugValue:cf,useDeferredValue:function(n,i){var o=Ot();return Sy(o,nt.memoizedState,n,i)},useTransition:function(){var n=Fl(Os)[0],i=Ot().memoizedState;return[typeof n=="boolean"?n:ro(n),i]},useSyncExternalStore:Yg,useId:_y,useHostTransitionStatus:ff,useFormState:cy,useActionState:cy,useOptimistic:function(n,i){var o=Ot();return ny(o,nt,n,i)},useMemoCache:nf,useCacheRefresh:Cy};pf.useEffectEvent=py;var Ry={readContext:Qt,use:Zl,useCallback:by,useContext:Qt,useEffect:lf,useImperativeHandle:vy,useInsertionEffect:my,useLayoutEffect:gy,useMemo:xy,useReducer:af,useRef:fy,useState:function(){return af(Os)},useDebugValue:cf,useDeferredValue:function(n,i){var o=Ot();return nt===null?uf(o,n,i):Sy(o,nt.memoizedState,n,i)},useTransition:function(){var n=af(Os)[0],i=Ot().memoizedState;return[typeof n=="boolean"?n:ro(n),i]},useSyncExternalStore:Yg,useId:_y,useHostTransitionStatus:ff,useFormState:dy,useActionState:dy,useOptimistic:function(n,i){var o=Ot();return nt!==null?ny(o,nt,n,i):(o.baseState=n,[n,o.queue.dispatch])},useMemoCache:nf,useCacheRefresh:Cy};Ry.useEffectEvent=py;function mf(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 gf={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),no(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),no(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),no(i,n,o))}};function Ay(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?!Vr(o,u)||!Vr(h,g):!0}function Ty(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&&gf.enqueueReplaceState(i,i.state,null)}function na(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 Dy(n){Cl(n)}function Ly(n){console.error(n)}function My(n){Cl(n)}function Ql(n,i){try{var o=n.onUncaughtError;o(i.value,{componentStack:i.stack})}catch(u){setTimeout(function(){throw u})}}function Uy(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 yf(n,i,o){return o=ii(o),o.tag=3,o.payload={element:null},o.callback=function(){Ql(n,i)},o}function Py(n){return n=ii(n),n.tag=3,n}function $y(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(){Uy(i,o,u)}}var S=o.stateNode;S!==null&&typeof S.componentDidCatch=="function"&&(n.callback=function(){Uy(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 IN(n,i,o,u,h){if(o.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){if(i=o.alternate,i!==null&&Za(i,o,h,!0),o=Cn.current,o!==null){switch(o.tag){case 31:case 13:return Pn===null?oc():o.alternate===null&&Nt===0&&(Nt=3),o.flags&=-257,o.flags|=65536,o.lanes=h,u===Ml?o.flags|=16384:(i=o.updateQueue,i===null?o.updateQueue=new Set([u]):i.add(u),qf(n,u,h)),!1;case 22:return o.flags|=65536,u===Ml?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)),qf(n,u,h)),!1}throw Error(a(435,o.tag))}return qf(n,u,h),oc(),!1}if(He)return i=Cn.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=h,u!==Ld&&(n=Error(a(422),{cause:u}),Xr(Dn(n,o)))):(u!==Ld&&(i=Error(a(423),{cause:u}),Xr(Dn(i,o))),n=n.current.alternate,n.flags|=65536,h&=-h,n.lanes|=h,u=Dn(u,o),h=yf(n.stateNode,u,h),Gd(n,h),Nt!==4&&(Nt=2)),!1;var g=Error(a(520),{cause:u});if(g=Dn(g,o),yo===null?yo=[g]:yo.push(g),Nt!==4&&(Nt=2),i===null)return!0;u=Dn(u,o),o=i;do{switch(o.tag){case 3:return o.flags|=65536,n=h&-h,o.lanes|=n,n=yf(o.stateNode,u,n),Gd(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=Py(h),$y(h,n,o,u),Gd(o,h),!1}o=o.return}while(o!==null);return!1}var vf=Error(a(461)),Pt=!1;function Yt(n,i,o,u){i.child=n===null?Hg(i,null,o,u):ea(i,n.child,o,u)}function Iy(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 Yi(i),u=Jd(n,i,o,S,g,h),k=Wd(),n!==null&&!Pt?(ef(n,i,h),Rs(n,i,h)):(He&&k&&Td(i),i.flags|=1,Yt(n,i,u,h),i.child)}function By(n,i,o,u,h){if(n===null){var g=o.type;return typeof g=="function"&&!Od(g)&&g.defaultProps===void 0&&o.compare===null?(i.tag=15,i.type=g,qy(n,i,g,u,h)):(n=Ol(o.type,null,u,i,i.mode,h),n.ref=i.ref,n.return=i,i.child=n)}if(g=n.child,!Cf(n,h)){var S=g.memoizedProps;if(o=o.compare,o=o!==null?o:Vr,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 qy(n,i,o,u,h){if(n!==null){var g=n.memoizedProps;if(Vr(g,u)&&n.ref===i.ref)if(Pt=!1,i.pendingProps=u=g,Cf(n,h))(n.flags&131072)!==0&&(Pt=!0);else return i.lanes=n.lanes,Rs(n,i,h)}return bf(n,i,o,u,h)}function Hy(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 Zy(n,i,g,o,u)}if((o&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},n!==null&&Dl(i,g!==null?g.cachePool:null),g!==null?Gg(i,g):Vd(),Kg(i);else return u=i.lanes=536870912,Zy(n,i,g!==null?g.baseLanes|o:o,o,u)}else g!==null?(Dl(i,g.cachePool),Gg(i,g),oi(),i.memoizedState=null):(n!==null&&Dl(i,null),Vd(),oi());return Yt(n,i,h,o),i.child}function co(n,i){return n!==null&&n.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function Zy(n,i,o,u,h){var g=qd();return g=g===null?null:{parent:Mt._currentValue,pool:g},i.memoizedState={baseLanes:o,cachePool:g},n!==null&&Dl(i,null),Vd(),Kg(i),n!==null&&Za(n,i,u,!0),i.childLanes=h,null}function Yl(n,i){return i=Jl({mode:i.mode,children:i.children},n.mode),i.ref=n.ref,n.child=i,i.return=n,i}function Fy(n,i,o){return ea(i,n.child,null,o),n=Yl(i,i.pendingProps),n.flags|=2,kn(i),i.memoizedState=null,n}function BN(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=Yl(i,u),i.lanes=536870912,co(null,n);if(Yd(i),(n=ct)?(n=s0(n,Un),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=zg(n),o.return=i,i.child=o,Vt=i,ct=null)):n=null,n===null)throw ti(i);return i.lanes=536870912,null}return Yl(i,u)}var g=n.memoizedState;if(g!==null){var S=g.dehydrated;if(Yd(i),h)if(i.flags&256)i.flags&=-257,i=Fy(n,i,o);else if(i.memoizedState!==null)i.child=n.child,i.flags|=128,i=null;else throw Error(a(558));else if(Pt||Za(n,i,o,!1),h=(o&n.childLanes)!==0,Pt||h){if(u=at,u!==null&&(S=$r(u,o),S!==0&&S!==g.retryLane))throw g.retryLane=S,Gi(n,S),yn(u,n,S),vf;oc(),i=Fy(n,i,o)}else n=g.treeContext,ct=$n(S.nextSibling),Vt=i,He=!0,ei=null,Un=!1,n!==null&&Rg(i,n),i=Yl(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 Xl(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 bf(n,i,o,u,h){return Yi(i),o=Jd(n,i,o,u,void 0,h),u=Wd(),n!==null&&!Pt?(ef(n,i,h),Rs(n,i,h)):(He&&u&&Td(i),i.flags|=1,Yt(n,i,o,h),i.child)}function Gy(n,i,o,u,h,g){return Yi(i),i.updateQueue=null,o=Qg(i,u,o,h),Vg(n),u=Wd(),n!==null&&!Pt?(ef(n,i,g),Rs(n,i,g)):(He&&u&&Td(i),i.flags|=1,Yt(n,i,o,g),i.child)}function Ky(n,i,o,u,h){if(Yi(i),i.stateNode===null){var g=Ia,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=gf,i.stateNode=g,g._reactInternals=i,g=i.stateNode,g.props=u,g.state=i.memoizedState,g.refs={},Zd(i),S=o.contextType,g.context=typeof S=="object"&&S!==null?Qt(S):Ia,g.state=i.memoizedState,S=o.getDerivedStateFromProps,typeof S=="function"&&(mf(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&&gf.enqueueReplaceState(g,g.state,null),io(i,u,g,h),so(),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=na(o,k);g.props=A;var q=g.context,V=o.contextType;S=Ia,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)&&Ty(i,g,u,S),si=!1;var F=i.memoizedState;g.state=F,io(i,u,g,h),so(),q=i.memoizedState,k||F!==q||si?(typeof J=="function"&&(mf(i,o,J,u),q=i.memoizedState),(A=si||Ay(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,Fd(n,i),S=i.memoizedProps,V=na(o,S),g.props=V,J=i.pendingProps,F=g.context,q=o.contextType,A=Ia,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)&&Ty(i,g,u,A),si=!1,F=i.memoizedState,g.state=F,io(i,u,g,h),so();var K=i.memoizedState;S!==J||F!==K||si||n!==null&&n.dependencies!==null&&Al(n.dependencies)?(typeof k=="function"&&(mf(i,o,k,u),K=i.memoizedState),(V=si||Ay(i,o,V,u,F,K,A)||n!==null&&n.dependencies!==null&&Al(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,Xl(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=ea(i,n.child,null,h),i.child=ea(i,null,o,h)):Yt(n,i,o,h),i.memoizedState=g.state,n=i.child):n=Rs(n,i,h),n}function Vy(n,i,o,u){return Vi(),i.flags|=256,Yt(n,i,o,u),i.child}var xf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Sf(n){return{baseLanes:n,cachePool:Ug()}}function wf(n,i,o){return n=n!==null?n.childLanes&~o:0,i&&(n|=En),n}function Qy(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=s0(n,Un),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=zg(n),o.return=i,i.child=o,Vt=i,ct=null)):n=null,n===null)throw ti(i);return ih(n)?i.lanes=32:i.lanes=536870912,null}var k=u.children;return u=u.fallback,h?(oi(),h=i.mode,k=Jl({mode:"hidden",children:k},h),u=Ki(u,h,o,null),k.return=i,u.return=i,k.sibling=u,i.child=k,u=i.child,u.memoizedState=Sf(o),u.childLanes=wf(n,S,o),i.memoizedState=xf,co(null,u)):(ri(i),jf(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=Nf(n,i,o)):i.memoizedState!==null?(oi(),i.child=n.child,i.flags|=128,i=null):(oi(),k=u.fallback,h=i.mode,u=Jl({mode:"visible",children:u.children},h),k=Ki(k,h,o,null),k.flags|=2,u.return=i,k.return=i,u.sibling=k,i.child=u,ea(i,n.child,null,o),u=i.child,u.memoizedState=Sf(o),u.childLanes=wf(n,S,o),i.memoizedState=xf,i=co(null,u));else if(ri(i),ih(k)){if(S=k.nextSibling&&k.nextSibling.dataset,S)var q=S.dgst;S=q,u=Error(a(419)),u.stack="",u.digest=S,Xr({value:u,source:null,stack:null}),i=Nf(n,i,o)}else if(Pt||Za(n,i,o,!1),S=(o&n.childLanes)!==0,Pt||S){if(S=at,S!==null&&(u=$r(S,o),u!==0&&u!==A.retryLane))throw A.retryLane=u,Gi(n,u),yn(S,n,u),vf;sh(k)||oc(),i=Nf(n,i,o)}else sh(k)?(i.flags|=192,i.child=n.child,i=null):(n=A.treeContext,ct=$n(k.nextSibling),Vt=i,He=!0,ei=null,Un=!1,n!==null&&Rg(i,n),i=jf(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=Ki(k,h,o,null),k.flags|=2),k.return=i,u.return=i,u.sibling=k,i.child=u,co(null,u),u=i.child,k=n.child.memoizedState,k===null?k=Sf(o):(h=k.cachePool,h!==null?(A=Mt._currentValue,h=h.parent!==A?{parent:A,pool:A}:h):h=Ug(),k={baseLanes:k.baseLanes|o,cachePool:h}),u.memoizedState=k,u.childLanes=wf(n,S,o),i.memoizedState=xf,co(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 jf(n,i){return i=Jl({mode:"visible",children:i},n.mode),i.return=n,n.child=i}function Jl(n,i){return n=_n(22,n,null,i),n.lanes=0,n}function Nf(n,i,o){return ea(i,n.child,null,o),n=jf(i,i.pendingProps.children),n.flags|=2,i.memoizedState=null,n}function Yy(n,i,o){n.lanes|=i;var u=n.alternate;u!==null&&(u.lanes|=i),Pd(n.return,i,o)}function _f(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 Xy(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?Yr:0,!k&&n!==null&&(n.flags&128)!==0)e:for(n=i.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&Yy(n,o,i);else if(n.tag===19)Yy(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&&Il(n)===null&&(h=o),o=o.sibling;o=h,o===null?(h=i.child,i.child=null):(h=o.sibling,o.sibling=null),_f(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&&Il(n)===null){i.child=h;break}n=h.sibling,h.sibling=o,o=h,h=n}_f(i,!0,o,null,g,u);break;case"together":_f(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(Za(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 Cf(n,i){return(n.lanes&i)!==0?!0:(n=n.dependencies,!!(n!==null&&Al(n)))}function qN(n,i,o){switch(i.tag){case 3:Ze(i,i.stateNode.containerInfo),ni(i,Mt,n.memoizedState.cache),Vi();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,Yd(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?Qy(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||(Za(n,i,o,!1),u=(o&i.childLanes)!==0),h){if(u)return Xy(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,Hy(n,i,o,i.pendingProps);case 24:ni(i,Mt,n.memoizedState.cache)}return Rs(n,i,o)}function Jy(n,i,o){if(n!==null)if(n.memoizedProps!==i.pendingProps)Pt=!0;else{if(!Cf(n,o)&&(i.flags&128)===0)return Pt=!1,qN(n,i,o);Pt=(n.flags&131072)!==0}else Pt=!1,He&&(i.flags&1048576)!==0&&Og(i,Yr,i.index);switch(i.lanes=0,i.tag){case 16:e:{var u=i.pendingProps;if(n=Ji(i.elementType),i.type=n,typeof n=="function")Od(n)?(u=na(n,u),i.tag=1,i=Ky(null,i,n,u,o)):(i.tag=0,i=bf(null,i,n,u,o));else{if(n!=null){var h=n.$$typeof;if(h===z){i.tag=11,i=Iy(null,i,n,u,o);break e}else if(h===L){i.tag=14,i=By(null,i,n,u,o);break e}}throw i=Ee(n)||n,Error(a(306,i,""))}}return i;case 0:return bf(n,i,i.type,i.pendingProps,o);case 1:return u=i.type,h=na(u,i.pendingProps),Ky(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,Fd(n,i),io(i,u,null,o);var S=i.memoizedState;if(u=S.cache,ni(i,Mt,u),u!==g.cache&&$d(i,[Mt],o,!0),so(),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=Vy(n,i,u,o);break e}else if(u!==h){h=Dn(Error(a(424)),i),Xr(h),i=Vy(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=$n(n.firstChild),Vt=i,He=!0,ei=null,Un=!0,o=Hg(i,null,u,o),i.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling;else{if(Vi(),u===h){i=Rs(n,i,o);break e}Yt(n,i,u,o)}i=i.child}return i;case 26:return Xl(n,i),n===null?(o=c0(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=c0(i.type,n.memoizedProps,i.pendingProps,n.memoizedState),null;case 27:return Ye(i),n===null&&He&&(u=i.stateNode=r0(i.type,i.pendingProps,he.current),Vt=i,Un=!0,h=ct,mi(i.type)?(ah=h,ct=$n(u.firstChild)):ct=h),Yt(n,i,i.pendingProps.children,o),Xl(n,i),n===null&&(i.flags|=4194304),i.child;case 5:return n===null&&He&&((h=u=ct)&&(u=v_(u,i.type,i.pendingProps,Un),u!==null?(i.stateNode=u,Vt=i,ct=$n(u.firstChild),Un=!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,eh(h,g)?u=null:S!==null&&eh(h,S)&&(i.flags|=32),i.memoizedState!==null&&(h=Jd(n,i,TN,null,null,o),_o._currentValue=h),Xl(n,i),Yt(n,i,u,o),i.child;case 6:return n===null&&He&&((n=o=ct)&&(o=b_(o,i.pendingProps,Un),o!==null?(i.stateNode=o,Vt=i,ct=null,n=!0):n=!1),n||ti(i)),null;case 13:return Qy(n,i,o);case 4:return Ze(i,i.stateNode.containerInfo),u=i.pendingProps,n===null?i.child=ea(i,null,u,o):Yt(n,i,u,o),i.child;case 11:return Iy(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,Yi(i),h=Qt(h),u=u(h),i.flags|=1,Yt(n,i,u,o),i.child;case 14:return By(n,i,i.type,i.pendingProps,o);case 15:return qy(n,i,i.type,i.pendingProps,o);case 19:return Xy(n,i,o);case 31:return BN(n,i,o);case 22:return Hy(n,i,o,i.pendingProps);case 24:return Yi(i),u=Qt(Mt),n===null?(h=qd(),h===null&&(h=at,g=Id(),h.pooledCache=g,g.refCount++,g!==null&&(h.pooledCacheLanes|=o),h=g),i.memoizedState={parent:u,cache:h},Zd(i),ni(i,Mt,h)):((n.lanes&o)!==0&&(Fd(n,i),io(i,null,null,o),so()),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&&$d(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 kf(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(_v())n.flags|=8192;else throw Wi=Ml,Hd}else n.flags&=-16777217}function Wy(n,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)n.flags&=-16777217;else if(n.flags|=16777216,!p0(i))if(_v())n.flags|=8192;else throw Wi=Ml,Hd}function Wl(n,i){i!==null&&(n.flags|=4),n.flags&16384&&(i=n.tag!==22?hl():536870912,n.lanes|=i,nr|=i)}function uo(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 HN(n,i,o){var u=i.pendingProps;switch(Dd(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)&&(Ha(i)?As(i):n===null||n.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,Md())),ut(i),null;case 26:var h=i.type,g=i.memoizedState;return n===null?(As(i),g!==null?(ut(i),Wy(i,g)):(ut(i),kf(i,h,null,u,o))):g?g!==n.memoizedState?(As(i),ut(i),Wy(i,g)):(ut(i),i.flags&=-16777217):(n=n.memoizedProps,n!==u&&As(i),ut(i),kf(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,Ha(i)?Ag(i):(n=r0(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,Ha(i))Ag(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),kf(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,Ha(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||Qv(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=Ha(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 Vi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;ut(i),n=!1}else o=Md(),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=Ha(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 Vi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;ut(i),h=!1}else h=Md(),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),Wl(i,i.updateQueue),ut(i),null);case 4:return ge(),n===null&&Qf(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)uo(u,!1);else{if(Nt!==0||n!==null&&(n.flags&128)!==0)for(n=i.child;n!==null;){if(g=Il(n),g!==null){for(i.flags|=128,uo(u,!1),n=g.updateQueue,i.updateQueue=n,Wl(i,n),i.subtreeFlags=0,n=o,o=i.child;o!==null;)kg(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&&Pe()>ic&&(i.flags|=128,h=!0,uo(u,!1),i.lanes=4194304)}else{if(!h)if(n=Il(g),n!==null){if(i.flags|=128,h=!0,n=n.updateQueue,i.updateQueue=n,Wl(i,n),uo(u,!0),u.tail===null&&u.tailMode==="hidden"&&!g.alternate&&!He)return ut(i),null}else 2*Pe()-u.renderingStartTime>ic&&o!==536870912&&(i.flags|=128,h=!0,uo(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=Pe(),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),Qd(),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&&Wl(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(Xi),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 ZN(n,i){switch(Dd(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));Vi()}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));Vi()}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),Qd(),n!==null&&G(Xi),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 ev(n,i){switch(Dd(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),Qd(),n!==null&&G(Xi);break;case 24:zs(Mt)}}function fo(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 tv(n){var i=n.updateQueue;if(i!==null){var o=n.stateNode;try{Fg(i,o)}catch(u){Je(n,n.return,u)}}}function nv(n,i,o){o.props=na(n.type,n.memoizedProps),o.state=n.memoizedState;try{o.componentWillUnmount()}catch(u){Je(n,i,u)}}function ho(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 ps(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 sv(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 zf(n,i,o){try{var u=n.stateNode;f_(u,n.type,o,i),u[wt]=i}catch(h){Je(n,n.return,h)}}function iv(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&mi(n.type)||n.tag===4}function Ef(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||iv(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&&mi(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 Of(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&&mi(n.type)&&(o=n.stateNode,i=null),n=n.child,n!==null))for(Of(n,i,o),n=n.sibling;n!==null;)Of(n,i,o),n=n.sibling}function ec(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&&mi(n.type)&&(o=n.stateNode),n=n.child,n!==null))for(ec(n,i,o),n=n.sibling;n!==null;)ec(n,i,o),n=n.sibling}function av(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,$t=!1,Rf=!1,rv=typeof WeakSet=="function"?WeakSet:Set,Ft=null;function FN(n,i){if(n=n.containerInfo,Jf=Sc,n=vg(n),jd(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(Wf={focusedElem:n,selectionRange:o},Sc=!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=na(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)nh(n);else if(o===1)switch(n.nodeName){case"HEAD":case"HTML":case"BODY":nh(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 ov(n,i,o){var u=o.flags;switch(o.tag){case 0:case 11:case 15:Ls(n,o),u&4&&fo(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=na(o.type,i.memoizedProps);i=i.memoizedState;try{n.componentDidUpdate(h,i,n.__reactInternalSnapshotBeforeUpdate)}catch(S){Je(o,o.return,S)}}u&64&&tv(o),u&512&&ho(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{Fg(n,i)}catch(S){Je(o,o.return,S)}}break;case 27:i===null&&u&4&&av(o);case 26:case 5:Ls(n,o),i===null&&u&4&&sv(o),u&512&&ho(o,o.return);break;case 12:Ls(n,o);break;case 31:Ls(n,o),u&4&&uv(n,o);break;case 13:Ls(n,o),u&4&&dv(n,o),u&64&&(n=o.memoizedState,n!==null&&(n=n.dehydrated,n!==null&&(o=e_.bind(null,o),x_(n,o))));break;case 22:if(u=o.memoizedState!==null||Ts,!u){i=i!==null&&i.memoizedState!==null||$t,h=Ts;var g=$t;Ts=u,($t=i)&&!g?Ms(n,o,(o.subtreeFlags&8772)!==0):Ls(n,o),Ts=h,$t=g}break;case 30:break;default:Ls(n,o)}}function lv(n){var i=n.alternate;i!==null&&(n.alternate=null,lv(i)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(i=n.stateNode,i!==null&&Oa(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;)cv(n,i,o),o=o.sibling}function cv(n,i,o){if(_e&&typeof _e.onCommitFiberUnmount=="function")try{_e.onCommitFiberUnmount(os,o)}catch{}switch(o.tag){case 26:$t||ps(o,i),Ds(n,i,o),o.memoizedState?o.memoizedState.count--:o.stateNode&&(o=o.stateNode,o.parentNode.removeChild(o));break;case 27:$t||ps(o,i);var u=ht,h=hn;mi(o.type)&&(ht=o.stateNode,hn=!1),Ds(n,i,o),wo(o.stateNode),ht=u,hn=h;break;case 5:$t||ps(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,t0(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,o.stateNode),ur(n)):t0(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),$t||li(4,o,i),Ds(n,i,o);break;case 1:$t||(ps(o,i),u=o.stateNode,typeof u.componentWillUnmount=="function"&&nv(o,i,u)),Ds(n,i,o);break;case 21:Ds(n,i,o);break;case 22:$t=(u=$t)||o.memoizedState!==null,Ds(n,i,o),$t=u;break;default:Ds(n,i,o)}}function uv(n,i){if(i.memoizedState===null&&(n=i.alternate,n!==null&&(n=n.memoizedState,n!==null))){n=n.dehydrated;try{ur(n)}catch(o){Je(i,i.return,o)}}}function dv(n,i){if(i.memoizedState===null&&(n=i.alternate,n!==null&&(n=n.memoizedState,n!==null&&(n=n.dehydrated,n!==null))))try{ur(n)}catch(o){Je(i,i.return,o)}}function GN(n){switch(n.tag){case 31:case 13:case 19:var i=n.stateNode;return i===null&&(i=n.stateNode=new rv),i;case 22:return n=n.stateNode,i=n._retryCache,i===null&&(i=n._retryCache=new rv),i;default:throw Error(a(435,n.tag))}}function tc(n,i){var o=GN(n);i.forEach(function(u){if(!o.has(u)){o.add(u);var h=t_.bind(null,n,u);u.then(h,h)}})}function pn(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(mi(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));cv(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;)fv(i,n),i=i.sibling}var Xn=null;function fv(n,i){var o=n.alternate,u=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:pn(i,n),mn(n),u&4&&(li(3,n,n.return),fo(3,n),li(5,n,n.return));break;case 1:pn(i,n),mn(n),u&512&&($t||o===null||ps(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=Xn;if(pn(i,n),mn(n),u&512&&($t||o===null||ps(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=f0("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=f0("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 h0(h,n.type,n.stateNode);else n.stateNode=d0(h,u,n.memoizedProps);else g!==u?(g===null?o.stateNode!==null&&(o=o.stateNode,o.parentNode.removeChild(o)):g.count--,u===null?h0(h,n.type,n.stateNode):d0(h,u,n.memoizedProps)):u===null&&n.stateNode!==null&&zf(n,n.memoizedProps,o.memoizedProps)}break;case 27:pn(i,n),mn(n),u&512&&($t||o===null||ps(o,o.return)),o!==null&&u&4&&zf(n,n.memoizedProps,o.memoizedProps);break;case 5:if(pn(i,n),mn(n),u&512&&($t||o===null||ps(o,o.return)),n.flags&32){h=n.stateNode;try{Ta(h,"")}catch(ye){Je(n,n.return,ye)}}u&4&&n.stateNode!=null&&(h=n.memoizedProps,zf(n,h,o!==null?o.memoizedProps:h)),u&1024&&(Rf=!0);break;case 6:if(pn(i,n),mn(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(yc=null,h=Xn,Xn=mc(i.containerInfo),pn(i,n),Xn=h,mn(n),u&4&&o!==null&&o.memoizedState.isDehydrated)try{ur(i.containerInfo)}catch(ye){Je(n,n.return,ye)}Rf&&(Rf=!1,hv(n));break;case 4:u=Xn,Xn=mc(n.stateNode.containerInfo),pn(i,n),mn(n),Xn=u;break;case 12:pn(i,n),mn(n);break;case 31:pn(i,n),mn(n),u&4&&(u=n.updateQueue,u!==null&&(n.updateQueue=null,tc(n,u)));break;case 13:pn(i,n),mn(n),n.child.flags&8192&&n.memoizedState!==null!=(o!==null&&o.memoizedState!==null)&&(sc=Pe()),u&4&&(u=n.updateQueue,u!==null&&(n.updateQueue=null,tc(n,u)));break;case 22:h=n.memoizedState!==null;var A=o!==null&&o.memoizedState!==null,q=Ts,V=$t;if(Ts=q||h,$t=V||A,pn(i,n),$t=V,Ts=q,mn(n),u&8192)e:for(i=n.stateNode,i._visibility=h?i._visibility&-2:i._visibility|1,h&&(o===null||A||Ts||$t||sa(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?n0(K,!0):n0(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,tc(n,o))));break;case 19:pn(i,n),mn(n),u&4&&(u=n.updateQueue,u!==null&&(n.updateQueue=null,tc(n,u)));break;case 30:break;case 21:break;default:pn(i,n),mn(n)}}function mn(n){var i=n.flags;if(i&2){try{for(var o,u=n.return;u!==null;){if(iv(u)){o=u;break}u=u.return}if(o==null)throw Error(a(160));switch(o.tag){case 27:var h=o.stateNode,g=Ef(n);ec(n,g,h);break;case 5:var S=o.stateNode;o.flags&32&&(Ta(S,""),o.flags&=-33);var k=Ef(n);ec(n,k,S);break;case 3:case 4:var A=o.stateNode.containerInfo,q=Ef(n);Of(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 hv(n){if(n.subtreeFlags&1024)for(n=n.child;n!==null;){var i=n;hv(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;)ov(n,i.alternate,i),i=i.sibling}function sa(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),sa(i);break;case 1:ps(i,i.return);var o=i.stateNode;typeof o.componentWillUnmount=="function"&&nv(i,i.return,o),sa(i);break;case 27:wo(i.stateNode);case 26:case 5:ps(i,i.return),sa(i);break;case 22:i.memoizedState===null&&sa(i);break;case 30:sa(i);break;default:sa(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),fo(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++)Zg(A[h],k)}catch(q){Je(u,u.return,q)}}o&&S&64&&tv(g),ho(g,g.return);break;case 27:av(g);case 26:case 5:Ms(h,g,o),o&&u===null&&S&4&&sv(g),ho(g,g.return);break;case 12:Ms(h,g,o);break;case 31:Ms(h,g,o),o&&S&4&&uv(h,g);break;case 13:Ms(h,g,o),o&&S&4&&dv(h,g);break;case 22:g.memoizedState===null&&Ms(h,g,o),ho(g,g.return);break;case 30:break;default:Ms(h,g,o)}i=i.sibling}}function Af(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&&Jr(o))}function Tf(n,i){n=null,i.alternate!==null&&(n=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==n&&(i.refCount++,n!=null&&Jr(n))}function Jn(n,i,o,u){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)pv(n,i,o,u),i=i.sibling}function pv(n,i,o,u){var h=i.flags;switch(i.tag){case 0:case 11:case 15:Jn(n,i,o,u),h&2048&&fo(9,i);break;case 1:Jn(n,i,o,u);break;case 3:Jn(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&&Jr(n)));break;case 12:if(h&2048){Jn(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 Jn(n,i,o,u);break;case 31:Jn(n,i,o,u);break;case 13:Jn(n,i,o,u);break;case 23:break;case 22:g=i.stateNode,S=i.alternate,i.memoizedState!==null?g._visibility&2?Jn(n,i,o,u):po(n,i):g._visibility&2?Jn(n,i,o,u):(g._visibility|=2,Wa(n,i,o,u,(i.subtreeFlags&10256)!==0||!1)),h&2048&&Af(S,i);break;case 24:Jn(n,i,o,u),h&2048&&Tf(i.alternate,i);break;default:Jn(n,i,o,u)}}function Wa(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:Wa(g,S,k,A,h),fo(8,S);break;case 23:break;case 22:var V=S.stateNode;S.memoizedState!==null?V._visibility&2?Wa(g,S,k,A,h):po(g,S):(V._visibility|=2,Wa(g,S,k,A,h)),h&&q&2048&&Af(S.alternate,S);break;case 24:Wa(g,S,k,A,h),h&&q&2048&&Tf(S.alternate,S);break;default:Wa(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&&Af(u.alternate,u);break;case 24:po(o,u),h&2048&&Tf(u.alternate,u);break;default:po(o,u)}i=i.sibling}}var mo=8192;function er(n,i,o){if(n.subtreeFlags&mo)for(n=n.child;n!==null;)mv(n,i,o),n=n.sibling}function mv(n,i,o){switch(n.tag){case 26:er(n,i,o),n.flags&mo&&n.memoizedState!==null&&A_(o,Xn,n.memoizedState,n.memoizedProps);break;case 5:er(n,i,o);break;case 3:case 4:var u=Xn;Xn=mc(n.stateNode.containerInfo),er(n,i,o),Xn=u;break;case 22:n.memoizedState===null&&(u=n.alternate,u!==null&&u.memoizedState!==null?(u=mo,mo=16777216,er(n,i,o),mo=u):er(n,i,o));break;default:er(n,i,o)}}function gv(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 go(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,vv(u,n)}gv(n)}if(n.subtreeFlags&10256)for(n=n.child;n!==null;)yv(n),n=n.sibling}function yv(n){switch(n.tag){case 0:case 11:case 15:go(n),n.flags&2048&&li(9,n,n.return);break;case 3:go(n);break;case 12:go(n);break;case 22:var i=n.stateNode;n.memoizedState!==null&&i._visibility&2&&(n.return===null||n.return.tag!==13)?(i._visibility&=-3,nc(n)):go(n);break;default:go(n)}}function nc(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,vv(u,n)}gv(n)}for(n=n.child;n!==null;){switch(i=n,i.tag){case 0:case 11:case 15:li(8,i,i.return),nc(i);break;case 22:o=i.stateNode,o._visibility&2&&(o._visibility&=-3,nc(i));break;default:nc(i)}n=n.sibling}}function vv(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:Jr(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(lv(u),u===o){Ft=null;break e}if(h!==null){h.return=g,Ft=h;break e}Ft=g}}}var KN={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}},VN=typeof WeakMap=="function"?WeakMap:Map,Ke=0,at=null,Le=null,Be=0,Xe=0,zn=null,ci=!1,tr=!1,Df=!1,Us=0,Nt=0,ui=0,ia=0,Lf=0,En=0,nr=0,yo=null,gn=null,Mf=!1,sc=0,bv=0,ic=1/0,ac=null,di=null,Ht=0,fi=null,sr=null,Ps=0,Uf=0,Pf=null,xv=null,vo=0,$f=null;function On(){return(Ke&2)!==0&&Be!==0?Be&-Be:H.T!==null?Ff():et()}function Sv(){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)&&(ir(n,0),hi(n,Be,En,!1)),qi(n,o),((Ke&2)===0||n!==at)&&(n===at&&((Ke&2)===0&&(ia|=o),Nt===4&&hi(n,Be,En,!1)),ms(n))}function wv(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?XN(n,i):Bf(n,i,!0),g=u;do{if(h===0){tr&&!u&&hi(n,i,0,!1);break}else{if(o=n.current.alternate,g&&!QN(o)){h=Bf(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=yo;var A=k.current.memoizedState.isDehydrated;if(A&&(ir(k,S).flags|=256),S=Bf(k,S,!1),S!==2){if(Df&&!A){k.errorRecoveryDisabledLanes|=g,ia|=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){ir(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=sc+300-Pe(),10<h)){if(hi(u,i,En,!ci),za(u,0,!0)!==0)break e;Ps=i,u.timeoutHandle=Wv(jv.bind(null,u,o,gn,ac,Mf,i,En,ia,nr,ci,g,"Throttled",-0,0),h);break e}jv(u,o,gn,ac,Mf,i,En,ia,nr,ci,g,null,-0,0)}}break}while(!0);ms(n)}function jv(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},mv(i,g,J);var ye=(g&62914560)===g?sc-Pe():(g&4194048)===g?bv-Pe():0;if(ye=T_(J,ye),ye!==null){Ps=g,n.cancelPendingCommit=ye(Rv.bind(null,n,i,g,o,u,h,S,k,A,V,J,null,F,K)),hi(n,g,S,!q);return}}Rv(n,i,g,o,u,h,S,k,A)}function QN(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&=~Lf,i&=~ia,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 rc(){return(Ke&6)===0?(bo(0),!1):!0}function If(){if(Le!==null){if(Xe===0)var n=Le.return;else n=Le,ks=Qi=null,tf(n),Va=null,eo=0,n=Le;for(;n!==null;)ev(n.alternate,n),n=n.return;Le=null}}function ir(n,i){var o=n.timeoutHandle;o!==-1&&(n.timeoutHandle=-1,m_(o)),o=n.cancelPendingCommit,o!==null&&(n.cancelPendingCommit=null,o()),Ps=0,If(),at=n,Le=o=_s(n.current,null),Be=i,Xe=0,zn=null,ci=!1,tr=cs(n,i),Df=!1,nr=En=Lf=ia=ui=Nt=0,gn=yo=null,Mf=!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,kl(),o}function Nv(n,i){Re=null,H.H=lo,i===Ka||i===Ll?(i=Ig(),Xe=3):i===Hd?(i=Ig(),Xe=4):Xe=i===vf?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,zn=i,Le===null&&(Nt=1,Ql(n,Dn(i,n.current)))}function _v(){var n=Cn.current;return n===null?!0:(Be&4194048)===Be?Pn===null:(Be&62914560)===Be||(Be&536870912)!==0?n===Pn:!1}function Cv(){var n=H.H;return H.H=lo,n===null?lo:n}function kv(){var n=H.A;return H.A=KN,n}function oc(){Nt=4,ci||(Be&4194048)!==Be&&Cn.current!==null||(tr=!0),(ui&134217727)===0&&(ia&134217727)===0||at===null||hi(at,Be,En,!1)}function Bf(n,i,o){var u=Ke;Ke|=2;var h=Cv(),g=kv();(at!==n||Be!==i)&&(ac=null,ir(n,i)),i=!1;var S=Nt;e:do try{if(Xe!==0&&Le!==null){var k=Le,A=zn;switch(Xe){case 8:If(),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,ar(n,k,A,q),o&&tr){S=0;break e}break;default:q=Xe,Xe=0,zn=null,ar(n,k,A,q)}}YN(),S=Nt;break}catch(V){Nv(n,V)}while(!0);return i&&n.shellSuspendCounter++,ks=Qi=null,Ke=u,H.H=h,H.A=g,Le===null&&(at=null,Be=0,kl()),S}function YN(){for(;Le!==null;)zv(Le)}function XN(n,i){var o=Ke;Ke|=2;var u=Cv(),h=kv();at!==n||Be!==i?(ac=null,ic=Pe()+500,ir(n,i)):tr=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,ar(n,i,g,1);break;case 2:case 9:if(Pg(g)){Xe=0,zn=null,Ev(i);break}i=function(){Xe!==2&&Xe!==9||at!==n||(Xe=7),ms(n)},g.then(i,i);break e;case 3:Xe=7;break e;case 4:Xe=5;break e;case 7:Pg(g)?(Xe=0,zn=null,Ev(i)):(Xe=0,zn=null,ar(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?p0(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,lc(q)):Le=null}break t}}Xe=0,zn=null,ar(n,i,g,5);break;case 6:Xe=0,zn=null,ar(n,i,g,6);break;case 8:If(),Nt=6;break e;default:throw Error(a(462))}}JN();break}catch(V){Nv(n,V)}while(!0);return ks=Qi=null,H.H=u,H.A=h,Ke=o,Le!==null?0:(at=null,Be=0,kl(),Nt)}function JN(){for(;Le!==null&&!re();)zv(Le)}function zv(n){var i=Jy(n.alternate,n,Us);n.memoizedProps=n.pendingProps,i===null?lc(n):Le=i}function Ev(n){var i=n,o=i.alternate;switch(i.tag){case 15:case 0:i=Gy(o,i,i.pendingProps,i.type,void 0,Be);break;case 11:i=Gy(o,i,i.pendingProps,i.type.render,i.ref,Be);break;case 5:tf(i);default:ev(o,i),i=Le=kg(i,Us),i=Jy(o,i,Us)}n.memoizedProps=n.pendingProps,i===null?lc(n):Le=i}function ar(n,i,o,u){ks=Qi=null,tf(i),Va=null,eo=0;var h=i.return;try{if(IN(n,h,i,o,Be)){Nt=1,Ql(n,Dn(o,n.current)),Le=null;return}}catch(g){if(h!==null)throw Le=h,g;Nt=1,Ql(n,Dn(o,n.current)),Le=null;return}i.flags&32768?(He||u===1?n=!0:tr||(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))),Ov(i,n)):lc(i)}function lc(n){var i=n;do{if((i.flags&32768)!==0){Ov(i,ci);return}n=i.return;var o=HN(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 Ov(n,i){do{var o=ZN(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 Rv(n,i,o,u,h,g,S,k,A){n.cancelPendingCommit=null;do cc();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|=zd,ad(n,o,g,S,k,A),n===at&&(Le=at=null,Be=0),sr=i,fi=n,Ps=o,Uf=g,Pf=h,xv=u,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(n.callbackNode=null,n.callbackPriority=0,n_(Vn,function(){return Mv(),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{FN(n,i,o)}finally{Ke=S,Z.p=h,H.T=u}}Ht=1,Av(),Tv(),Dv()}}function Av(){if(Ht===1){Ht=0;var n=fi,i=sr,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{fv(i,n);var g=Wf,S=vg(n.containerInfo),k=g.focusedElem,A=g.selectionRange;if(S!==k&&k&&k.ownerDocument&&yg(k.ownerDocument.documentElement,k)){if(A!==null&&jd(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 $=gg(k,Ce),U=gg(k,it);if($&&U&&(K.rangeCount!==1||K.anchorNode!==$.node||K.anchorOffset!==$.offset||K.focusNode!==U.node||K.focusOffset!==U.offset)){var B=J.createRange();B.setStart($.node,$.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}}Sc=!!Jf,Wf=Jf=null}finally{Ke=h,Z.p=u,H.T=o}}n.current=i,Ht=2}}function Tv(){if(Ht===2){Ht=0;var n=fi,i=sr,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{ov(n,i.alternate,i)}finally{Ke=h,Z.p=u,H.T=o}}Ht=3}}function Dv(){if(Ht===4||Ht===3){Ht=0,Ue();var n=fi,i=sr,o=Ps,u=xv;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?Ht=5:(Ht=0,sr=fi=null,Lv(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}}(Ps&3)!==0&&cc(),ms(n),h=n.pendingLanes,(o&261930)!==0&&(h&42)!==0?n===$f?vo++:(vo=0,$f=n):vo=0,bo(0)}}function Lv(n,i){(n.pooledCacheLanes&=i)===0&&(i=n.pooledCache,i!=null&&(n.pooledCache=null,Jr(i)))}function cc(){return Av(),Tv(),Dv(),Mv()}function Mv(){if(Ht!==5)return!1;var n=fi,i=Uf;Uf=0;var o=ce(Ps),u=H.T,h=Z.p;try{Z.p=32>o?32:o,H.T=null,o=Pf,Pf=null;var g=fi,S=Ps;if(Ht=0,sr=fi=null,Ps=0,(Ke&6)!==0)throw Error(a(331));var k=Ke;if(Ke|=4,yv(g.current),pv(g,g.current,S,o),Ke=k,bo(0,!1),_e&&typeof _e.onPostCommitFiberRoot=="function")try{_e.onPostCommitFiberRoot(os,g)}catch{}return!0}finally{Z.p=h,H.T=u,Lv(n,i)}}function Uv(n,i,o){i=Dn(o,i),i=yf(n.stateNode,i,2),n=ai(n,i,2),n!==null&&(qi(n,2),ms(n))}function Je(n,i,o){if(n.tag===3)Uv(n,n,o);else for(;i!==null;){if(i.tag===3){Uv(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=Dn(o,n),o=Py(2),u=ai(i,o,2),u!==null&&($y(o,u,i,n),qi(u,2),ms(u));break}}i=i.return}}function qf(n,i,o){var u=n.pingCache;if(u===null){u=n.pingCache=new VN;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)||(Df=!0,h.add(o),n=WN.bind(null,n,i,o),i.then(n,n))}function WN(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>Pe()-sc?(Ke&2)===0&&ir(n,0):Lf|=o,nr===Be&&(nr=0)),ms(n)}function Pv(n,i){i===0&&(i=hl()),n=Gi(n,i),n!==null&&(qi(n,i),ms(n))}function e_(n){var i=n.memoizedState,o=0;i!==null&&(o=i.retryLane),Pv(n,o)}function t_(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),Pv(n,o)}function n_(n,i){return St(n,i)}var uc=null,rr=null,Hf=!1,dc=!1,Zf=!1,pi=0;function ms(n){n!==rr&&n.next===null&&(rr===null?uc=rr=n:rr=rr.next=n),dc=!0,Hf||(Hf=!0,i_())}function bo(n,i){if(!Zf&&dc){Zf=!0;do for(var o=!1,u=uc;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,qv(u,g))}else g=Be,g=za(u,u===at?g:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),(g&3)===0||cs(u,g)||(o=!0,qv(u,g));u=u.next}while(o);Zf=!1}}function s_(){$v()}function $v(){dc=Hf=!1;var n=0;pi!==0&&p_()&&(n=pi);for(var i=Pe(),o=null,u=uc;u!==null;){var h=u.next,g=Iv(u,i);g===0?(u.next=null,o===null?uc=h:o.next=h,h===null&&(rr=o)):(o=u,(n!==0||(g&3)!==0)&&(dc=!0)),u=h}Ht!==0&&Ht!==5||bo(n),pi!==0&&(pi=0)}function Iv(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]=fl(k,i)):A<=i&&(n.expiredLanes|=k),g&=~k}if(i=at,o=Be,o=za(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=Vn;break;case 268435456:o=Fs;break;default:o=Vn}return u=Bv.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 Bv(n,i){if(Ht!==0&&Ht!==5)return n.callbackNode=null,n.callbackPriority=0,null;var o=n.callbackNode;if(cc()&&n.callbackNode!==o)return null;var u=Be;return u=za(n,n===at?u:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),u===0?null:(wv(n,u,i),Iv(n,Pe()),n.callbackNode!=null&&n.callbackNode===o?Bv.bind(null,n):null)}function qv(n,i){if(cc())return null;wv(n,i,!0)}function i_(){g_(function(){(Ke&6)!==0?St(Te,s_):$v()})}function Ff(){if(pi===0){var n=Fa;n===0&&(n=Ks,Ks<<=1,(Ks&261888)===0&&(Ks=256)),pi=n}return pi}function Hv(n){return n==null||typeof n=="symbol"||typeof n=="boolean"?null:typeof n=="function"?n:bl(""+n)}function Zv(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 a_(n,i,o,u,h){if(i==="submit"&&o&&o.stateNode===h){var g=Hv((h[wt]||null).action),S=u.submitter;S&&(i=(i=S[wt]||null)?Hv(i.formAction):S.getAttribute("formAction"),i!==null&&(g=i,S=null));var k=new jl("action","action",null,u,h);n.push({event:k,listeners:[{instance:null,listener:function(){if(u.defaultPrevented){if(pi!==0){var A=S?Zv(h,S):new FormData(h);df(o,{pending:!0,data:A,method:h.method,action:g},null,A)}}else typeof g=="function"&&(k.preventDefault(),A=S?Zv(h,S):new FormData(h),df(o,{pending:!0,data:A,method:h.method,action:g},g,A))},currentTarget:h}]})}}for(var Gf=0;Gf<kd.length;Gf++){var Kf=kd[Gf],r_=Kf.toLowerCase(),o_=Kf[0].toUpperCase()+Kf.slice(1);Yn(r_,"on"+o_)}Yn(Sg,"onAnimationEnd"),Yn(wg,"onAnimationIteration"),Yn(jg,"onAnimationStart"),Yn("dblclick","onDoubleClick"),Yn("focusin","onFocus"),Yn("focusout","onBlur"),Yn(jN,"onTransitionRun"),Yn(NN,"onTransitionStart"),Yn(_N,"onTransitionCancel"),Yn(Ng,"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 xo="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(" "),l_=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(xo));function Fv(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){Cl(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){Cl(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)||(Gv(i,n,2,!1),o.add(u))}function Vf(n,i,o){var u=0;i&&(u|=4),Gv(o,n,u,i)}var fc="_reactListening"+Math.random().toString(36).slice(2);function Qf(n){if(!n[fc]){n[fc]=!0,Ie.forEach(function(o){o!=="selectionchange"&&(l_.has(o)||Vf(o,!1,n),Vf(o,!0,n))});var i=n.nodeType===9?n:n.ownerDocument;i===null||i[fc]||(i[fc]=!0,Vf("selectionchange",!1,i))}}function Gv(n,i,o,u){switch(S0(i)){case 2:var h=M_;break;case 8:h=U_;break;default:h=uh}o=h.bind(null,i,o,n),h=void 0,!pd||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 Yf(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}Xm(function(){var q=g,V=fd(o),J=[];e:{var F=_g.get(n);if(F!==void 0){var K=jl,ye=n;switch(n){case"keypress":if(Sl(o)===0)break e;case"keydown":case"keyup":K=tN;break;case"focusin":ye="focus",K=vd;break;case"focusout":ye="blur",K=vd;break;case"beforeblur":case"afterblur":K=vd;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=eg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":K=H1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":K=iN;break;case Sg:case wg:case jg:K=G1;break;case Ng:K=rN;break;case"scroll":case"scrollend":K=B1;break;case"wheel":K=lN;break;case"copy":case"cut":case"paste":K=V1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":K=ng;break;case"toggle":case"beforetoggle":K=uN}var Ce=(i&4)!==0,it=!Ce&&(n==="scroll"||n==="scrollend"),$=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||$===null||(Y=Br(U,$),Y!=null&&Ce.push(So(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!==dd&&(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=eg,Y="onMouseLeave",$="onMouseEnter",U="mouse",(n==="pointerout"||n==="pointerover")&&(Ce=ng,Y="onPointerLeave",$="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($,U+"enter",ye,o,V),Ce.target=B,Ce.relatedTarget=it,Y=Ce),it=Y,K&&ye)t:{for(Ce=c_,$=K,U=ye,B=0,Y=$;Y;Y=Ce(Y))B++;Y=0;for(var je=U;je;je=Ce(je))Y++;for(;0<B-Y;)$=Ce($),B--;for(;0<Y-B;)U=Ce(U),Y--;for(;B--;){if($===U||U!==null&&$===U.alternate){Ce=$;break t}$=Ce($),U=Ce(U)}Ce=null}else Ce=null;K!==null&&Kv(J,F,K,Ce,!1),ye!==null&&it!==null&&Kv(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=ug;else if(lg(F))if(dg)Fe=xN;else{Fe=vN;var xe=yN}else K=F.nodeName,!K||K.toLowerCase()!=="input"||F.type!=="checkbox"&&F.type!=="radio"?q&&ud(q.elementType)&&(Fe=ug):Fe=bN;if(Fe&&(Fe=Fe(n,q))){cg(J,Fe,o,V);break e}xe&&xe(n,F,q),n==="focusout"&&q&&F.type==="number"&&q.memoizedProps.value!=null&&cd(F,"number",F.value)}switch(xe=q?ds(q):window,n){case"focusin":(lg(xe)||xe.contentEditable==="true")&&(Ua=xe,Nd=q,Qr=null);break;case"focusout":Qr=Nd=Ua=null;break;case"mousedown":_d=!0;break;case"contextmenu":case"mouseup":case"dragend":_d=!1,bg(J,o,V);break;case"selectionchange":if(wN)break;case"keydown":case"keyup":bg(J,o,V)}var Ae;if(xd)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 Ma?rg(n,o)&&(qe="onCompositionEnd"):n==="keydown"&&o.keyCode===229&&(qe="onCompositionStart");qe&&(sg&&o.locale!=="ko"&&(Ma||qe!=="onCompositionStart"?qe==="onCompositionEnd"&&Ma&&(Ae=Jm()):(Js=V,md="value"in Js?Js.value:Js.textContent,Ma=!0)),xe=hc(q,qe),0<xe.length&&(qe=new tg(qe,n,null,o,V),J.push({event:qe,listeners:xe}),Ae?qe.data=Ae:(Ae=og(o),Ae!==null&&(qe.data=Ae)))),(Ae=fN?hN(n,o):pN(n,o))&&(qe=hc(q,"onBeforeInput"),0<qe.length&&(xe=new tg("onBeforeInput","beforeinput",null,o,V),J.push({event:xe,listeners:qe}),xe.data=Ae)),a_(J,n,q,o,V)}Fv(J,i)})}function So(n,i,o){return{instance:n,listener:i,currentTarget:o}}function hc(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=Br(n,o),h!=null&&u.unshift(So(n,h,g)),h=Br(n,i),h!=null&&u.push(So(n,h,g))),n.tag===3)return u;n=n.return}return[]}function c_(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5&&n.tag!==27);return n||null}function Kv(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=Br(o,g),q!=null&&S.unshift(So(o,q,A))):h||(q=Br(o,g),q!=null&&S.push(So(o,q,A)))),o=o.return}S.length!==0&&n.push({event:i,listeners:S})}var u_=/\r\n?/g,d_=/\u0000|\uFFFD/g;function Vv(n){return(typeof n=="string"?n:""+n).replace(u_,`
9
+ `).replace(d_,"")}function Qv(n,i){return i=Vv(i),Vv(n)===i}function st(n,i,o,u,h,g){switch(o){case"children":typeof u=="string"?i==="body"||i==="textarea"&&u===""||Ta(n,u):(typeof u=="number"||typeof u=="bigint")&&i!=="body"&&Ta(n,""+u);break;case"className":yl(n,"class",u);break;case"tabIndex":yl(n,"tabindex",u);break;case"dir":case"role":case"viewBox":case"width":case"height":yl(n,o,u);break;case"style":Qm(n,u,g);break;case"data":if(i!=="object"){yl(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=bl(""+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=bl(""+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=bl(""+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),gl(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":gl(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=$1.get(o)||o,gl(n,o,u))}}function Xf(n,i,o,u,h,g){switch(o){case"style":Qm(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"?Ta(n,u):(typeof u=="number"||typeof u=="bigint")&&Ta(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,""):gl(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)}}Fm(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?Aa(n,!!u,i,!1):o!=null&&Aa(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)}Km(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<xo.length;u++)Me(xo[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(ud(i)){for(V in o)o.hasOwnProperty(V)&&(u=o[V],u!==void 0&&Xf(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 f_(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)}}ld(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?Aa(n,!!o,F,!1):!!u!=!!o&&(i!=null?Aa(n,!!o,i,!0):Aa(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)}Gm(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(ud(i)){for(var it in o)F=o[it],o.hasOwnProperty(it)&&F!==void 0&&!u.hasOwnProperty(it)&&Xf(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||Xf(n,i,V,F,u,K);return}}for(var $ in o)F=o[$],o.hasOwnProperty($)&&F!=null&&!u.hasOwnProperty($)&&st(n,i,$,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 Yv(n){switch(n){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function h_(){if(typeof performance.getEntriesByType=="function"){for(var 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&&Yv(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&&Yv(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 Jf=null,Wf=null;function pc(n){return n.nodeType===9?n:n.ownerDocument}function Xv(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 Jv(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 eh(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 th=null;function p_(){var n=window.event;return n&&n.type==="popstate"?n===th?!1:(th=n,!0):(th=null,!1)}var Wv=typeof setTimeout=="function"?setTimeout:void 0,m_=typeof clearTimeout=="function"?clearTimeout:void 0,e0=typeof Promise=="function"?Promise:void 0,g_=typeof queueMicrotask=="function"?queueMicrotask:typeof e0<"u"?function(n){return e0.resolve(null).then(n).catch(y_)}:Wv;function y_(n){setTimeout(function(){throw n})}function mi(n){return n==="head"}function t0(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),ur(i);return}u--}else if(o==="$"||o==="$?"||o==="$~"||o==="$!"||o==="&")u++;else if(o==="html")wo(n.ownerDocument.documentElement);else if(o==="head"){o=n.ownerDocument.head,wo(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"&&wo(n.ownerDocument.body);o=h}while(o);ur(i)}function n0(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 nh(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":nh(o),Oa(o);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(o.rel.toLowerCase()==="stylesheet")continue}n.removeChild(o)}}function v_(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=$n(n.nextSibling),n===null)break}return null}function b_(n,i,o){if(i==="")return null;for(;n.nodeType!==3;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!o||(n=$n(n.nextSibling),n===null))return null;return n}function s0(n,i){for(;n.nodeType!==8;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!i||(n=$n(n.nextSibling),n===null))return null;return n}function sh(n){return n.data==="$?"||n.data==="$~"}function ih(n){return n.data==="$!"||n.data==="$?"&&n.ownerDocument.readyState!=="loading"}function x_(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 $n(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 ah=null;function i0(n){n=n.nextSibling;for(var i=0;n;){if(n.nodeType===8){var o=n.data;if(o==="/$"||o==="/&"){if(i===0)return $n(n.nextSibling);i--}else o!=="$"&&o!=="$!"&&o!=="$?"&&o!=="$~"&&o!=="&"||i++}n=n.nextSibling}return null}function a0(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 r0(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 wo(n){for(var i=n.attributes;i.length;)n.removeAttributeNode(i[0]);Oa(n)}var In=new Map,o0=new Set;function mc(n){return typeof n.getRootNode=="function"?n.getRootNode():n.nodeType===9?n:n.ownerDocument}var $s=Z.d;Z.d={f:S_,r:w_,D:j_,C:N_,L:__,m:C_,X:z_,S:k_,M:E_};function S_(){var n=$s.f(),i=rc();return n||i}function w_(n){var i=Qn(n);i!==null&&i.tag===5&&i.type==="form"?Ny(i):$s.r(n)}var or=typeof document>"u"?null:document;function l0(n,i,o){var u=or;if(u&&typeof i=="string"&&i){var h=An(i);h='link[rel="'+n+'"][href="'+h+'"]',typeof o=="string"&&(h+='[crossorigin="'+o+'"]'),o0.has(h)||(o0.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 j_(n){$s.D(n),l0("dns-prefetch",n,null)}function N_(n,i){$s.C(n,i),l0("preconnect",n,i)}function __(n,i,o){$s.L(n,i,o);var u=or;if(u&&n&&i){var h='link[rel="preload"][as="'+An(i)+'"]';i==="image"&&o&&o.imageSrcSet?(h+='[imagesrcset="'+An(o.imageSrcSet)+'"]',typeof o.imageSizes=="string"&&(h+='[imagesizes="'+An(o.imageSizes)+'"]')):h+='[href="'+An(n)+'"]';var g=h;switch(i){case"style":g=lr(n);break;case"script":g=cr(n)}In.has(g)||(n=y({rel:"preload",href:i==="image"&&o&&o.imageSrcSet?void 0:n,as:i},o),In.set(g,n),u.querySelector(h)!==null||i==="style"&&u.querySelector(jo(g))||i==="script"&&u.querySelector(No(g))||(i=u.createElement("link"),Xt(i,"link",n),Lt(i),u.head.appendChild(i)))}}function C_(n,i){$s.m(n,i);var o=or;if(o&&n){var u=i&&typeof i.as=="string"?i.as:"script",h='link[rel="modulepreload"][as="'+An(u)+'"][href="'+An(n)+'"]',g=h;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":g=cr(n)}if(!In.has(g)&&(n=y({rel:"modulepreload",href:n},i),In.set(g,n),o.querySelector(h)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(o.querySelector(No(g)))return}u=o.createElement("link"),Xt(u,"link",n),Lt(u),o.head.appendChild(u)}}}function k_(n,i,o){$s.S(n,i,o);var u=or;if(u&&n){var h=Xs(u).hoistableStyles,g=lr(n);i=i||"default";var S=h.get(g);if(!S){var k={loading:0,preload:null};if(S=u.querySelector(jo(g)))k.loading=5;else{n=y({rel:"stylesheet",href:n,"data-precedence":i},o),(o=In.get(g))&&rh(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,gc(S,i,u)}S={type:"stylesheet",instance:S,count:1,state:k},h.set(g,S)}}}function z_(n,i){$s.X(n,i);var o=or;if(o&&n){var u=Xs(o).hoistableScripts,h=cr(n),g=u.get(h);g||(g=o.querySelector(No(h)),g||(n=y({src:n,async:!0},i),(i=In.get(h))&&oh(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 E_(n,i){$s.M(n,i);var o=or;if(o&&n){var u=Xs(o).hoistableScripts,h=cr(n),g=u.get(h);g||(g=o.querySelector(No(h)),g||(n=y({src:n,async:!0,type:"module"},i),(i=In.get(h))&&oh(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 c0(n,i,o,u){var h=(h=he.current)?mc(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=lr(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=lr(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(jo(n)))&&!g._p&&(S.instance=g,S.state.loading=5),In.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},In.set(n,o),g||O_(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=cr(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 lr(n){return'href="'+An(n)+'"'}function jo(n){return'link[rel="stylesheet"]['+n+"]"}function u0(n){return y({},n,{"data-precedence":n.precedence,precedence:null})}function O_(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 cr(n){return'[src="'+An(n)+'"]'}function No(n){return"script[async]"+n}function d0(n,i,o){if(i.count++,i.instance===null)switch(i.type){case"style":var u=n.querySelector('style[data-href~="'+An(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),gc(u,o.precedence,n),i.instance=u;case"stylesheet":h=lr(o.href);var g=n.querySelector(jo(h));if(g)return i.state.loading|=4,i.instance=g,Lt(g),g;u=u0(o),(h=In.get(h))&&rh(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,gc(g,o.precedence,n),i.instance=g;case"script":return g=cr(o.src),(h=n.querySelector(No(g)))?(i.instance=h,Lt(h),h):(u=o,(h=In.get(g))&&(u=y({},o),oh(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,gc(u,o.precedence,n));return i.instance}function gc(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 rh(n,i){n.crossOrigin==null&&(n.crossOrigin=i.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=i.referrerPolicy),n.title==null&&(n.title=i.title)}function oh(n,i){n.crossOrigin==null&&(n.crossOrigin=i.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=i.referrerPolicy),n.integrity==null&&(n.integrity=i.integrity)}var yc=null;function f0(n,i,o){if(yc===null){var u=new Map,h=yc=new Map;h.set(o,u)}else h=yc,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 h0(n,i,o){n=n.ownerDocument||n,n.head.insertBefore(o,i==="title"?n.querySelector("head > title"):null)}function R_(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 p0(n){return!(n.type==="stylesheet"&&(n.state.loading&3)===0)}function A_(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=lr(u.href),g=i.querySelector(jo(h));if(g){i=g._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(n.count++,n=vc.bind(n),i.then(n,n)),o.state.loading|=4,o.instance=g,Lt(g);return}g=i.ownerDocument||i,u=u0(u),(h=In.get(h))&&rh(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=vc.bind(n),i.addEventListener("load",o),i.addEventListener("error",o))}}var lh=0;function T_(n,i){return n.stylesheets&&n.count===0&&xc(n,n.stylesheets),0<n.count||0<n.imgCount?function(o){var u=setTimeout(function(){if(n.stylesheets&&xc(n,n.stylesheets),n.unsuspend){var g=n.unsuspend;n.unsuspend=null,g()}},6e4+i);0<n.imgBytes&&lh===0&&(lh=62500*h_());var h=setTimeout(function(){if(n.waitingForImages=!1,n.count===0&&(n.stylesheets&&xc(n,n.stylesheets),n.unsuspend)){var g=n.unsuspend;n.unsuspend=null,g()}},(n.imgBytes>lh?50:800)+i);return n.unsuspend=o,function(){n.unsuspend=null,clearTimeout(u),clearTimeout(h)}}:null}function vc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)xc(this,this.stylesheets);else if(this.unsuspend){var n=this.unsuspend;this.unsuspend=null,n()}}}var bc=null;function xc(n,i){n.stylesheets=null,n.unsuspend!==null&&(n.count++,bc=new Map,i.forEach(D_,n),bc=null,vc.call(n))}function D_(n,i){if(!(i.state.loading&4)){var o=bc.get(n);if(o)var u=o.get(null);else{o=new Map,bc.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=vc.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 _o={$$typeof:O,Provider:null,Consumer:null,_currentValue:oe,_currentValue2:oe,_threadCount:0};function L_(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=Ea(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ea(0),this.hiddenUpdates=Ea(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 m0(n,i,o,u,h,g,S,k,A,q,V,J){return n=new L_(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=Id(),i.refCount++,n.pooledCache=i,i.refCount++,g.memoizedState={element:u,isDehydrated:o,cache:i},Zd(g),n}function g0(n){return n?(n=Ia,n):Ia}function y0(n,i,o,u,h,g){h=g0(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),no(o,n,i))}function v0(n,i){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var o=n.retryLane;n.retryLane=o!==0&&o<i?o:i}}function ch(n,i){v0(n,i),(n=n.alternate)&&v0(n,i)}function b0(n){if(n.tag===13||n.tag===31){var i=Gi(n,67108864);i!==null&&yn(i,n,67108864),ch(n,67108864)}}function x0(n){if(n.tag===13||n.tag===31){var i=On();i=P(i);var o=Gi(n,i);o!==null&&yn(o,n,i),ch(n,i)}}var Sc=!0;function M_(n,i,o,u){var h=H.T;H.T=null;var g=Z.p;try{Z.p=2,uh(n,i,o,u)}finally{Z.p=g,H.T=h}}function U_(n,i,o,u){var h=H.T;H.T=null;var g=Z.p;try{Z.p=8,uh(n,i,o,u)}finally{Z.p=g,H.T=h}}function uh(n,i,o,u){if(Sc){var h=dh(u);if(h===null)Yf(n,i,u,wc,o),w0(n,u);else if($_(h,n,i,o,u))u.stopPropagation();else if(w0(n,u),i&4&&-1<P_.indexOf(n)){for(;h!==null;){var g=Qn(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}ms(g),(Ke&6)===0&&(ic=Pe()+500,bo(0))}}break;case 31:case 13:k=Gi(g,2),k!==null&&yn(k,g,2),rc(),ch(g,2)}if(g=dh(u),g===null&&Yf(n,i,u,wc,o),g===h)break;h=g}h!==null&&u.stopPropagation()}else Yf(n,i,u,null,o)}}function dh(n){return n=fd(n),fh(n)}var wc=null;function fh(n){if(wc=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 wc=n,null}function S0(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 Vn:case bs:return 32;case Fs:return 268435456;default:return 32}default:return 32}}var hh=!1,gi=null,yi=null,vi=null,Co=new Map,ko=new Map,bi=[],P_="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 w0(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":Co.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":ko.delete(i.pointerId)}}function zo(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=Qn(i),i!==null&&b0(i)),n):(n.eventSystemFlags|=u,i=n.targetContainers,h!==null&&i.indexOf(h)===-1&&i.push(h),n)}function $_(n,i,o,u,h){switch(i){case"focusin":return gi=zo(gi,n,i,o,u,h),!0;case"dragenter":return yi=zo(yi,n,i,o,u,h),!0;case"mouseover":return vi=zo(vi,n,i,o,u,h),!0;case"pointerover":var g=h.pointerId;return Co.set(g,zo(Co.get(g)||null,n,i,o,u,h)),!0;case"gotpointercapture":return g=h.pointerId,ko.set(g,zo(ko.get(g)||null,n,i,o,u,h)),!0}return!1}function j0(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(){x0(o)});return}}else if(i===31){if(i=f(o),i!==null){n.blockedOn=i,Kt(n.priority,function(){x0(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 jc(n){if(n.blockedOn!==null)return!1;for(var i=n.targetContainers;0<i.length;){var o=dh(n.nativeEvent);if(o===null){o=n.nativeEvent;var u=new o.constructor(o.type,o);dd=u,o.target.dispatchEvent(u),dd=null}else return i=Qn(o),i!==null&&b0(i),n.blockedOn=o,!1;i.shift()}return!0}function N0(n,i,o){jc(n)&&o.delete(i)}function I_(){hh=!1,gi!==null&&jc(gi)&&(gi=null),yi!==null&&jc(yi)&&(yi=null),vi!==null&&jc(vi)&&(vi=null),Co.forEach(N0),ko.forEach(N0)}function Nc(n,i){n.blockedOn===i&&(n.blockedOn=null,hh||(hh=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,I_)))}var _c=null;function _0(n){_c!==n&&(_c=n,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){_c===n&&(_c=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(fh(u||o)===null)continue;break}var g=Qn(o);g!==null&&(n.splice(i,3),i-=3,df(g,{pending:!0,data:h,method:o.method,action:u},u,h))}}))}function ur(n){function i(A){return Nc(A,n)}gi!==null&&Nc(gi,n),yi!==null&&Nc(yi,n),vi!==null&&Nc(vi,n),Co.forEach(i),ko.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);)j0(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||_0(o);else if(S){var k=null;if(g&&g.hasAttribute("formAction")){if(h=g,S=g[wt]||null)k=S.formAction;else if(fh(h)!==null)continue}else k=S.action;typeof k=="function"?o[u+1]=k:(o.splice(u,3),u-=3),_0(o)}}}function C0(){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 ph(n){this._internalRoot=n}Cc.prototype.render=ph.prototype.render=function(n){var i=this._internalRoot;if(i===null)throw Error(a(409));var o=i.current,u=On();y0(o,u,n,i,null,null)},Cc.prototype.unmount=ph.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var i=n.containerInfo;y0(n.current,2,null,n,null,null),rc(),i[jn]=null}};function Cc(n){this._internalRoot=n}Cc.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&&j0(n)}};var k0=t.version;if(k0!=="19.2.4")throw Error(a(527,k0,"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=p(i),n=n!==null?v(n):null,n=n===null?null:n.stateNode,n};var B_={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:H,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var kc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!kc.isDisabled&&kc.supportsFiber)try{os=kc.inject(B_),_e=kc}catch{}}return Oo.createRoot=function(n,i){if(!r(n))throw Error(a(299));var o=!1,u="",h=Dy,g=Ly,S=My;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=m0(n,1,!1,null,null,o,u,null,h,g,S,C0),n[jn]=i.current,Qf(n),new ph(i)},Oo.hydrateRoot=function(n,i,o){if(!r(n))throw Error(a(299));var u=!1,h="",g=Dy,S=Ly,k=My,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=m0(n,1,!0,i,o??null,u,h,A,g,S,k,C0),i.context=g0(null),o=i.current,u=On(),u=P(u),h=ii(u),h.callback=null,ai(o,h,u),o=u,i.current.lanes=o,qi(i,o),ms(i),n[jn]=i.current,Qf(n),new Cc(i)},Oo.version="19.2.4",Oo}var U0;function X_(){if(U0)return yh.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(),yh.exports=Y_(),yh.exports}var J_=X_(),Tr=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(){}},W_={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},eC=class{#t=W_;#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)}},ca=new eC;function tC(e){setTimeout(e,0)}var ba=typeof window>"u"||"Deno"in globalThis;function ln(){}function nC(e,t){return typeof e=="function"?e(t):e}function Yh(e){return typeof e=="number"&&e>=0&&e!==1/0}function Mx(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ei(e,t){return typeof e=="function"?e(t):e}function Bn(e,t){return typeof e=="function"?e(t):e}function P0(e,t){const{type:s="all",exact:a,fetchStatus:r,predicate:c,queryKey:d,stale:f}=e;if(d){if(a){if(t.queryHash!==Ap(d,t.options))return!1}else if(!Go(t.queryKey,d))return!1}if(s!=="all"){const m=t.isActive();if(s==="active"&&!m||s==="inactive"&&m)return!1}return!(typeof f=="boolean"&&t.isStale()!==f||r&&r!==t.state.fetchStatus||c&&!c(t))}function $0(e,t){const{exact:s,status:a,predicate:r,mutationKey:c}=e;if(c){if(!t.options.mutationKey)return!1;if(s){if(Fo(t.options.mutationKey)!==Fo(c))return!1}else if(!Go(t.options.mutationKey,c))return!1}return!(a&&t.state.status!==a||r&&!r(t))}function Ap(e,t){return(t?.queryKeyHashFn||Fo)(e)}function Fo(e){return JSON.stringify(e,(t,s)=>Xh(s)?Object.keys(s).sort().reduce((a,r)=>(a[r]=s[r],a),{}):s)}function Go(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(s=>Go(e[s],t[s])):!1}var sC=Object.prototype.hasOwnProperty;function Tp(e,t,s=0){if(e===t)return e;if(s>500)return t;const a=I0(e)&&I0(t);if(!a&&!(Xh(e)&&Xh(t)))return t;const c=(a?e:Object.keys(e)).length,d=a?t:Object.keys(t),f=d.length,m=a?new Array(f):{};let p=0;for(let v=0;v<f;v++){const y=a?v:d[v],b=e[y],x=t[y];if(b===x){m[y]=b,(a?v<c:sC.call(e,y))&&p++;continue}if(b===null||x===null||typeof b!="object"||typeof x!="object"){m[y]=x;continue}const j=Tp(b,x,s+1);m[y]=j,j===b&&p++}return c===f&&p===c?e:m}function au(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 I0(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Xh(e){if(!B0(e))return!1;const t=e.constructor;if(t===void 0)return!0;const s=t.prototype;return!(!B0(s)||!s.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function B0(e){return Object.prototype.toString.call(e)==="[object Object]"}function iC(e){return new Promise(t=>{ca.setTimeout(t,e)})}function Jh(e,t,s){return typeof s.structuralSharing=="function"?s.structuralSharing(e,t):s.structuralSharing!==!1?Tp(e,t):t}function aC(e,t,s=0){const a=[...e,t];return s&&a.length>s?a.slice(1):a}function rC(e,t,s=0){const a=[t,...e];return s&&a.length>s?a.slice(0,-1):a}var Dp=Symbol();function Ux(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Dp?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Px(e,t){return typeof e=="function"?e(...t):!!e}function oC(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 lC=class extends Tr{#t;#e;#n;constructor(){super(),this.#n=e=>{if(!ba&&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"}},Lp=new lC;function Wh(){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 cC=tC;function uC(){let e=[],t=0,s=f=>{f()},a=f=>{f()},r=cC;const c=f=>{t?e.push(f):r(()=>{s(f)})},d=()=>{const f=e;e=[],f.length&&r(()=>{a(()=>{f.forEach(m=>{s(m)})})})};return{batch:f=>{let m;t++;try{m=f()}finally{t--,t||d()}return m},batchCalls:f=>(...m)=>{c(()=>{f(...m)})},schedule:c,setNotifyFunction:f=>{s=f},setBatchNotifyFunction:f=>{a=f},setScheduler:f=>{r=f}}}var It=uC(),dC=class extends Tr{#t=!0;#e;#n;constructor(){super(),this.#n=e=>{if(!ba&&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}},ru=new dC;function fC(e){return Math.min(1e3*2**e,3e4)}function $x(e){return(e??"online")==="online"?ru.isOnline():!0}var ep=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function Ix(e){let t=!1,s=0,a;const r=Wh(),c=()=>r.status!=="pending",d=w=>{if(!c()){const _=new ep(w);b(_),e.onCancel?.(_)}},f=()=>{t=!0},m=()=>{t=!1},p=()=>Lp.isFocused()&&(e.networkMode==="always"||ru.isOnline())&&e.canRun(),v=()=>$x(e.networkMode)&&e.canRun(),y=w=>{c()||(a?.(),r.resolve(w))},b=w=>{c()||(a?.(),r.reject(w))},x=()=>new Promise(w=>{a=_=>{(c()||p())&&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??(ba?0:3),O=e.retryDelay??fC,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),iC(z).then(()=>p()?void 0:x()).then(()=>{t?b(C):j()})})};return{promise:r,status:()=>r.status,cancel:d,continue:()=>(a?.(),r),cancelRetry:f,continueRetry:m,canStart:v,start:()=>(v()?j():x().then(j),r)}}var Bx=class{#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Yh(this.gcTime)&&(this.#t=ca.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ba?1/0:300*1e3))}clearGcTimeout(){this.#t&&(ca.clearTimeout(this.#t),this.#t=void 0)}},hC=class extends Bx{#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=H0(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=H0(this.options);t.data!==void 0&&(this.setState(q0(t.data,t.dataUpdatedAt)),this.#t=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const s=Jh(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=>Bn(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Dp||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Ei(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:!Mx(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(m=>m.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=Ux(this.options,t),p=(()=>{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,p,this):f(p)},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=Ix({initialPromise:t?.initialPromise,fn:d.fetchFn,onCancel:f=>{f instanceof ep&&f.revert&&this.setState({...this.#e,fetchStatus:"idle"}),s.abort()},onFail:(f,m)=>{this.#a({type:"failed",failureCount:f,error:m})},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 ep){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,...qx(s.data,this.options),fetchMeta:e.meta??null};case"success":const a={...s,...q0(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 qx(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:$x(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function q0(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function H0(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 Mp=class extends Tr{constructor(e,t){super(),this.options=t,this.#t=e,this.#a=null,this.#o=Wh(),this.bindMethods(),this.setOptions(t)}#t;#e=void 0;#n=void 0;#i=void 0;#s;#r;#o;#a;#p;#d;#f;#c;#u;#l;#h=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#e.addObserver(this),Z0(this.#e,this.options)?this.#m():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return tp(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return tp(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 Bn(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&&!au(this.options,t)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const a=this.hasListeners();a&&F0(this.#e,s,this.options,t)&&this.#m(),this.updateResult(),a&&(this.#e!==s||Bn(this.options.enabled,this.#e)!==Bn(t.enabled,this.#e)||Ei(this.options.staleTime,this.#e)!==Ei(t.staleTime,this.#e))&&this.#g();const r=this.#y();a&&(this.#e!==s||Bn(this.options.enabled,this.#e)!==Bn(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 mC(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.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#i))}#m(e){this.#w();let t=this.#e.fetch(this.options,e);return e?.throwOnError||(t=t.catch(ln)),t}#g(){this.#x();const e=Ei(this.options.staleTime,this.#e);if(ba||this.#i.isStale||!Yh(e))return;const s=Mx(this.#i.dataUpdatedAt,e)+1;this.#c=ca.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,!(ba||Bn(this.options.enabled,this.#e)===!1||!Yh(this.#l)||this.#l===0)&&(this.#u=ca.setInterval(()=>{(this.options.refetchIntervalInBackground||Lp.isFocused())&&this.#m()},this.#l))}#b(){this.#g(),this.#v(this.#y())}#x(){this.#c&&(ca.clearTimeout(this.#c),this.#c=void 0)}#S(){this.#u&&(ca.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,m=e!==s?e.state:this.#n,{state:p}=e;let v={...p},y=!1,b;if(t._optimisticResults){const R=this.hasListeners(),I=!R&&Z0(e,t),ie=R&&F0(e,s,t,a);(I||ie)&&(v={...v,...qx(p.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=Jh(r?.data,R,t),y=!0)}if(t.select&&b!==void 0&&!_)if(r&&b===c?.data&&t.select===this.#p)b=this.#d;else try{this.#p=t.select,b=t.select(b),b=Jh(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>m.dataUpdateCount||v.errorUpdateCount>m.errorUpdateCount,isFetching:C,isRefetching:C&&!E,isLoadingError:O&&!M,isPaused:v.fetchStatus==="paused",isPlaceholderData:y,isRefetchError:O&&M,isStale:Up(e,t),refetch:this.refetch,promise:this.#o,isEnabled:Bn(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const R=L.data!==void 0,I=L.status==="error"&&!R,ie=pe=>{I?pe.reject(L.error):R&&pe.resolve(L.data)},Q=()=>{const pe=this.#o=L.promise=Wh();ie(pe)},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),au(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 pC(e,t){return Bn(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Z0(e,t){return pC(e,t)||e.state.data!==void 0&&tp(e,t,t.refetchOnMount)}function tp(e,t,s){if(Bn(t.enabled,e)!==!1&&Ei(t.staleTime,e)!=="static"){const a=typeof s=="function"?s(e):s;return a==="always"||a!==!1&&Up(e,t)}return!1}function F0(e,t,s,a){return(e!==t||Bn(a.enabled,e)===!1)&&(!s.suspense||e.state.status!=="error")&&Up(e,s)}function Up(e,t){return Bn(t.enabled,e)!==!1&&e.isStaleByTime(Ei(t.staleTime,e))}function mC(e,t){return!au(e.getCurrentResult(),t)}function G0(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:[]},m=0;const p=async()=>{let v=!1;const y=j=>{oC(j,()=>t.signal,()=>v=!0)},b=Ux(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=_?rC:aC;return{pages:M(j.pages,O,z),pageParams:M(j.pageParams,w,z)}};if(r&&c.length){const j=r==="backward",w=j?gC:K0,_={pages:c,pageParams:d},C=w(a,_);f=await x(_,C,j)}else{const j=e??c.length;do{const w=m===0?d[0]??a.initialPageParam:K0(a,f);if(m>0&&w==null)break;f=await x(f,w),m++}while(m<j)}return f};t.options.persister?t.fetchFn=()=>t.options.persister?.(p,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},s):t.fetchFn=p}}}function K0(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 gC(e,{pages:t,pageParams:s}){return t.length>0?e.getPreviousPageParam?.(t[0],t,s[0],s):void 0}var yC=class extends Bx{#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||vC(),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=Ix({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 vC(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var bC=class extends Tr{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 yC({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=zc(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=zc(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=zc(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=zc(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=>$0(t,s))}findAll(e={}){return this.getAll().filter(t=>$0(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 zc(e){return e.options.scope?.id}function V0(e,t){const s=new Set(t);return e.filter(a=>!s.has(a))}function xC(e,t,s){const a=e.slice(0);return a[t]=s,a}var SC=class extends Tr{#t;#e;#n;#i;#s;#r;#o;#a;#p;#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]),m=d||f,p=m?!0:c.some((v,y)=>{const b=this.#e[y];return!b||!au(v,b)});!m&&!p||(m&&(this.#d=a,this.#s=r),this.#e=c,this.hasListeners()&&(m&&(V0(s,r).forEach(v=>{v.destroy()}),V0(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.#p,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.#p=s),this.#r=Tp(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 Mp(this.#t,r);s.push({defaultedQueryOptions:r,observer:d})}),s}#l(e,t){const s=this.#s.indexOf(e);s!==-1&&(this.#e=xC(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)})})}}},wC=class extends Tr{constructor(e={}){super(),this.config=e,this.#t=new Map}#t;build(e,t,s){const a=t.queryKey,r=t.queryHash??Ap(a,t);let c=this.get(r);return c||(c=new hC({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=>P0(t,s))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(s=>P0(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()})})}},jC=class{#t;#e;#n;#i;#s;#r;#o;#a;constructor(e={}){this.#t=e.queryCache||new wC,this.#e=e.mutationCache||new bC,this.#n=e.defaultOptions||{},this.#i=new Map,this.#s=new Map,this.#r=0}mount(){this.#r++,this.#r===1&&(this.#o=Lp.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onFocus())}),this.#a=ru.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(Ei(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=nC(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(Ei(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=G0(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(ln).catch(ln)}ensureInfiniteQueryData(e){return e.behavior=G0(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return ru.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(Fo(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#i.values()],s={};return t.forEach(a=>{Go(e,a.queryKey)&&Object.assign(s,a.defaultOptions)}),s}setMutationDefaults(e,t){this.#s.set(Fo(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#s.values()],s={};return t.forEach(a=>{Go(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=Ap(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===Dp&&(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()}},Hx=N.createContext(void 0),Zx=e=>{const t=N.useContext(Hx);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},NC=({client:e,children:t})=>(N.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),l.jsx(Hx.Provider,{value:e,children:t})),Fx=N.createContext(!1),Gx=()=>N.useContext(Fx);Fx.Provider;function _C(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var CC=N.createContext(_C()),Kx=()=>N.useContext(CC),Vx=(e,t,s)=>{const a=s?.state.error&&typeof e.throwOnError=="function"?Px(e.throwOnError,[s.state.error,s]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||a)&&(t.isReset()||(e.retryOnMount=!1))},Qx=e=>{N.useEffect(()=>{e.clearReset()},[e])},Yx=({result:e,errorResetBoundary:t,throwOnError:s,query:a,suspense:r})=>e.isError&&!t.isReset()&&!e.isFetching&&a&&(r&&e.data===void 0||Px(s,[e.error,a])),Xx=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))}},kC=(e,t)=>e.isLoading&&e.isFetching&&!t,np=(e,t)=>e?.suspense&&t.isPending,sp=(e,t,s)=>t.fetchOptimistic(e).catch(()=>{s.clearReset()});function zC({queries:e,...t},s){const a=Zx(),r=Gx(),c=Kx(),d=N.useMemo(()=>e.map(w=>{const _=a.defaultQueryOptions(w);return _._optimisticResults=r?"isRestoring":"optimistic",_}),[e,a,r]);d.forEach(w=>{Xx(w);const _=a.getQueryCache().get(w.queryHash);Vx(w,c,_)}),Qx(c);const[f]=N.useState(()=>new SC(a,d,t)),[m,p,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=m.some((w,_)=>np(d[_],w))?m.flatMap((w,_)=>{const C=d[_];if(C&&np(C,w)){const E=new Mp(a,C);return sp(C,E,c)}return[]}):[];if(x.length>0)throw Promise.all(x);const j=m.find((w,_)=>{const C=d[_];return C&&Yx({result:w,errorResetBoundary:c,throwOnError:C.throwOnError,query:a.getQueryCache().get(C.queryHash),suspense:C.suspense})});if(j?.error)throw j.error;return p(v())}function EC(e,t,s){const a=Gx(),r=Kx(),c=Zx(),d=c.defaultQueryOptions(e);c.getDefaultOptions().queries?._experimental_beforeQuery?.(d);const f=c.getQueryCache().get(d.queryHash);d._optimisticResults=a?"isRestoring":"optimistic",Xx(d),Vx(d,r,f),Qx(r);const m=!c.getQueryCache().get(d.queryHash),[p]=N.useState(()=>new t(c,d)),v=p.getOptimisticResult(d),y=!a&&e.subscribed!==!1;if(N.useSyncExternalStore(N.useCallback(b=>{const x=y?p.subscribe(It.batchCalls(b)):ln;return p.updateResult(),x},[p,y]),()=>p.getCurrentResult(),()=>p.getCurrentResult()),N.useEffect(()=>{p.setOptions(d)},[d,p]),np(d,v))throw sp(d,p,r);if(Yx({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&&!ba&&kC(v,a)&&(m?sp(d,p,r):f?.promise)?.catch(ln).finally(()=>{p.updateResult()}),d.notifyOnChangeProps?v:p.trackResult(v)}function $o(e,t){return EC(e,Mp)}var Ec=typeof window<"u"?N.useLayoutEffect:N.useEffect;function Sh(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 OC(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 RC(e){const t=N.useRef(null);return N.useImperativeHandle(e,()=>t.current,[]),t}var AC=!1;function Ko(e){return e[e.length-1]}function TC(e){return typeof e=="function"}function Ci(e,t){return TC(e)?e(t):e}var DC=Object.prototype.hasOwnProperty,Q0=Object.prototype.propertyIsEnumerable,LC=()=>Object.create(null),aa=(e,t)=>ua(e,t,LC);function ua(e,t,s=()=>({}),a=0){if(e===t)return e;if(a>500)return t;const r=t,c=J0(e)&&J0(r);if(!c&&!(ou(e)&&ou(r)))return r;const d=c?e:Y0(e);if(!d)return r;const f=c?r:Y0(r);if(!f)return r;const m=d.length,p=f.length,v=c?new Array(p):s();let y=0;for(let b=0;b<p;b++){const x=c?b:f[b],j=e[x],w=r[x];if(j===w){v[x]=j,(c?b<m:DC.call(e,x))&&y++;continue}if(j===null||w===null||typeof j!="object"||typeof w!="object"){v[x]=w;continue}const _=ua(j,w,s,a+1);v[x]=_,_===j&&y++}return m===p&&y===m?e:v}function Y0(e){const t=Object.getOwnPropertyNames(e);for(const r of t)if(!Q0.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(!Q0.call(e,r))return!1;a.push(r)}return a}function ou(e){if(!X0(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const s=t.prototype;return!(!X0(s)||!s.hasOwnProperty("isPrototypeOf"))}function X0(e){return Object.prototype.toString.call(e)==="[object Object]"}function J0(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ma(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(!ma(e[a],t[a],s))return!1;return!0}if(ou(e)&&ou(t)){const a=s?.ignoreUndefined??!0;if(s?.partial){for(const d in t)if((!a||t[d]!==void 0)&&!ma(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||!ma(e[d],t[d],s)))return!1;return r===c}return!1}function zr(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 Vo(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function MC(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function W0(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 MC(t)}var UC=["http:","https:","mailto:","tel:"];function lu(e,t){if(!e)return!1;try{const s=new URL(e);return!t.has(s.protocol)}catch{return!1}}function Ro(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+=W0(e.slice(s,r.index))+r[0],s=t.lastIndex;a=a+W0(s?e.slice(s):e);let c=!1;return a.startsWith("//")&&(c=!0,a="/"+a.replace(/^\/+/,"")),{path:a,handledProtocolRelativeURL:c}}function PC(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function cu(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 m=s;t.delete(m.key),m.next&&(s=m.next,m.next.prev=void 0),m===a&&(a=void 0)}const f=t.get(c);if(f)f.value=d,r(f);else{const m={key:c,value:d,prev:a};a&&(a.next=m),a=m,s||(s=m),t.set(c,m)}},clear(){t.clear(),s=void 0,a=void 0}}}var $C="Invariant failed";function Di(e,t){if(!e)throw new Error($C)}var da=4,Jx=5;function IC(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 Pp(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=IC(c);if(d){const[f,m]=d,p=c.charCodeAt(f+1);if(p===45){if(f+2<c.length&&c.charCodeAt(f+2)===36){const v=f+3,y=m;if(v<y)return s[0]=3,s[1]=t+f,s[2]=t+v,s[3]=t+y,s[4]=t+m+1,s[5]=r,s}}else if(p===36){const v=f+1,y=f+2;return y===m?(s[0]=2,s[1]=t+f,s[2]=t+v,s[3]=t+y,s[4]=t+m+1,s[5]=e.length,s):(s[0]=1,s[1]=t+f,s[2]=t+y,s[3]=t+m,s[4]=t+m+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 zu(e,t,s,a,r,c,d){d?.(s);let f=a;{const m=s.fullPath??s.from,p=m.length,v=s.options?.caseSensitive??e,y=!!(s.options?.params?.parse&&s.options?.skipRouteOnParseError?.params);for(;f<p;){const x=Pp(m,f,t);let j;const w=f,_=x[5];switch(f=_+1,c++,x[0]){case 0:{const C=m.substring(x[2],x[3]);if(v){const E=r.static?.get(C);if(E)j=E;else{r.static??=new Map;const O=fa(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=fa(s.fullPath??s.from);z.parent=r,z.depth=c,j=z,r.staticInsensitive.set(E,z)}}break}case 1:{const C=m.substring(w,x[1]),E=m.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=jh(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=m.substring(w,x[1]),E=m.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=jh(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=m.substring(w,x[1]),E=m.substring(x[4],_),O=v&&!!(C||E),z=C?O?C:C.toLowerCase():void 0,M=E?O?E:E.toLowerCase():void 0,T=jh(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=fa(s.fullPath??s.from);x.kind=Jx,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&&m.endsWith("/")){const x=fa(s.fullPath??s.from);x.kind=da,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 m of s.children)zu(e,t,m,f,r,c,d)}function wh(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(wh);for(const t of e.dynamic)Ni(t)}if(e.optional?.length){e.optional.sort(wh);for(const t of e.optional)Ni(t)}if(e.wildcard?.length){e.wildcard.sort(wh);for(const t of e.wildcard)Ni(t)}}function fa(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 jh(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 BC(e,t){const s=fa("/"),a=new Uint16Array(6);for(const r of e)zu(!1,a,r,1,s,0);Ni(s),t.masksTree=s,t.flatCache=cu(1e3)}function qC(e,t){e||="/";const s=t.flatCache.get(e);if(s)return s;const a=$p(e,t.masksTree);return t.flatCache.set(e,a),a}function HC(e,t,s,a,r){e||="/",a||="/";const c=t?`case\0${e}`:e;let d=r.singleCache.get(c);return d||(d=fa("/"),zu(t,new Uint16Array(6),{from:e},1,d,0),r.singleCache.set(c,d)),$p(a,d,s)}function ZC(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=$p(e,t.segmentTree,s)}catch(d){if(d instanceof URIError)c=null;else throw d}return c&&(c.branch=KC(c.route)),t.matchCache.set(a,c),c}function FC(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function GC(e,t=!1,s){const a=fa(e.fullPath),r=new Uint16Array(6),c={},d={};let f=0;return zu(t,r,e,1,a,0,m=>{if(s?.(m,f),Di(!(m.id in c),`Duplicate routes found with id: ${String(m.id)}`),c[m.id]=m,f!==0&&m.path){const p=FC(m.fullPath);(!d[p]||m.fullPath.endsWith("/"))&&(d[p]=m)}f++}),Ni(a),{processedTree:{segmentTree:a,singleCache:cu(1e3),matchCache:cu(1e3),flatCache:null,masksTree:null},routesById:c,routesByPath:d}}function $p(e,t,s=!1){const a=e.split("/"),r=QC(e,a,t,s);if(!r)return null;const[c]=Wx(e,a,r);return{route:r.node.route,rawParams:c,parsedParams:r.parsedParams}}function Wx(e,t,s){const a=VC(s.node);let r=null;const c=Object.create(null);let d=s.extract?.part??0,f=s.extract?.node??0,m=s.extract?.path??0,p=s.extract?.segment??0;for(;f<a.length;d++,f++,m++,p++){const v=a[f];if(v.kind===da)break;if(v.kind===Jx){p--,d--,m--;continue}const y=t[d],b=m;if(y&&(m+=y.length),v.kind===1){r??=s.node.fullPath.split("/");const x=r[p],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--,m=b-1;continue}r??=s.node.fullPath.split("/");const x=r[p],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:m,segment:p}]}function KC(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function VC(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function QC(e,t,s,a){if(e==="/"&&s.index)return{node:s.index,skipped:0};const r=!Ko(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 m=null,p=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(!Nh(e,t,y))continue;z=y.rawParams,O=y.extract,M=y.parsedParams}a&&b.route&&b.kind!==da&&Ao(p,y)&&(p=y);const T=x===d;if(T&&(b.route&&!c&&Ao(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&&(Nh(e,t,I)||(ie=!1)),ie){if(_===d&&!C&&!E&&!j)return I;Ao(v,I)&&(v=I)}}if(b.wildcard&&Ao(m,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 pe=t.slice(x).join("/").slice(-Q.length);if((I.caseSensitive?pe:pe.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&&!Nh(e,t,se))){m=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:pe,suffix:Ee}=se;if(pe||Ee){const we=se.caseSensitive?L:R??=L.toLowerCase();if(pe&&!we.startsWith(pe)||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 pe=ie.caseSensitive?L:R??=L.toLowerCase();if(Q&&!pe.startsWith(Q)||se&&!pe.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&&m)return Ao(m,v)?v:m;if(v)return v;if(m)return m;if(a&&p){let y=p.index;for(let x=0;x<p.index;x++)y+=t[x].length;const b=y===e.length?"/":e.slice(y);return p.rawParams??=Object.create(null),p.rawParams["**"]=decodeURIComponent(b),p}return null}function Nh(e,t,s){try{const[a,r]=Wx(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 Ao(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===da)>(e.node.kind===da)||t.node.kind===da==(e.node.kind===da)&&t.depth>e.depth))):!0}function Qc(e){return Ip(e.filter(t=>t!==void 0).join("/"))}function Ip(e){return e.replace(/\/{2,}/g,"/")}function eS(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Oi(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function tS(e){return Oi(eS(e))}function uu(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function YC(e,t,s){return uu(e,s)===uu(t,s)}function XC({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&&Ko(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&&(Ko(f)===""?s==="never"&&f.pop():s==="always"&&f.push(""));let m,p="";for(let y=0;y<f.length;y++){y>0&&(p+="/");const b=f[y];if(!b)continue;m=Pp(b,0,m);const x=m[0];if(x===0){p+=b;continue}const j=m[5],w=b.substring(0,m[1]),_=b.substring(m[4],j),C=b.substring(m[2],m[3]);x===1?p+=w||_?`${w}{$${C}}${_}`:`$${C}`:x===2?p+=w||_?`${w}{$}${_}`:"$":p+=`${w}{-$${C}}${_}`}p=Ip(p);const v=p||"/";return d&&a&&a.set(d,v),v}function JC(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 _h(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=>tb(r,s)).join("/"):tb(a,s)}function eb({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,m,p="";for(;f<d;){const v=f;m=Pp(e,v,m);const y=m[5];if(f=y+1,v===y)continue;const b=m[0];if(b===0){p+="/"+e.substring(v,y);continue}if(b===2){const x=t._splat;c._splat=x,c["*"]=x;const j=e.substring(v,m[1]),w=e.substring(m[4],y);if(!x){r=!0,(j||w)&&(p+="/"+j+w);continue}const _=_h("_splat",t,s);p+="/"+j+_+w;continue}if(b===1){const x=e.substring(m[2],m[3]);!r&&!(x in t)&&(r=!0),c[x]=t[x];const j=e.substring(v,m[1]),w=e.substring(m[4],y),_=_h(x,t,s)??"undefined";p+="/"+j+_+w;continue}if(b===3){const x=e.substring(m[2],m[3]),j=t[x];if(j==null)continue;c[x]=j;const w=e.substring(v,m[1]),_=e.substring(m[4],y),C=_h(x,t,s)??"";p+="/"+w+C+_;continue}}return e.endsWith("/")&&(p+="/"),{usedParams:c,interpolatedPath:p||"/",isMissingParams:r}}function tb(e,t){const s=encodeURIComponent(e);return t?.(s)??s}function un(e){return!!e?.isNotFound}function WC(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}var ip="tsr-scroll-restoration-v1_3",ek=(e,t)=>{let s;return(...a)=>{s||(s=setTimeout(()=>{e(...a),s=null},t))}};function tk(){const e=WC();if(!e)return null;const t=e.getItem(ip);let s=t?JSON.parse(t):{};return{state:s,set:a=>{s=Ci(a,s)||s;try{e.setItem(ip,JSON.stringify(s))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}var Oc=tk(),nk=e=>e.state.__TSR_key||e.href;function sk(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 du=!1;function ik({storageKey:e,key:t,behavior:s,shouldScrollRestoration:a,scrollToTopSelectors:r,location:c}){let d;try{d=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(p){console.error(p);return}const f=t||window.history.state?.__TSR_key,m=d[f];du=!0;e:{if(a&&m&&Object.keys(m).length>0){for(const y in m){const b=m[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 p=(c??window.location).hash.split("#",2)[1];if(p){const y=window.history.state?.__hashScrollIntoViewOptions??!0;if(y){const b=document.getElementById(p);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)}}du=!1}function ak(e,t){if(!Oc||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!Oc))return;e.isScrollRestorationSetup=!0,du=!1;const s=e.options.getScrollRestorationKey||nk;window.history.scrollRestoration="manual";const a=r=>{if(du||!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=sk(r.target)}const d=s(e.state.location);Oc.set(f=>{const m=f[d]||={},p=m[c]||={};if(c==="window")p.scrollX=window.scrollX||0,p.scrollY=window.scrollY||0;else if(c){const v=document.querySelector(c);v&&(p.scrollX=v.scrollLeft||0,p.scrollY=v.scrollTop||0)}return f})};typeof document<"u"&&document.addEventListener("scroll",ek(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})||(ik({storageKey:ip,key:c,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&Oc.set(d=>(d[c]||={},d)))})}function rk(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 ok(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 Ch(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function lk(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]=Ch(r):Array.isArray(c)?c.push(Ch(r)):s[a]=[c,Ch(r)]}return s}var ck=dk(JSON.parse),uk=fk(JSON.stringify,JSON.parse);function dk(e){return t=>{t[0]==="?"&&(t=t.substring(1));const s=lk(t);for(const a in s){const r=s[a];if(typeof r=="string")try{s[a]=e(r)}catch{}}return s}}function fk(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=ok(r,a);return c?`?${c}`:""}}var ga="__root__";function Bp(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 hk(e){return{input:({url:t})=>{for(const s of e)t=ap(s,t);return t},output:({url:t})=>{for(let s=e.length-1;s>=0;s--)t=nS(e[s],t);return t}}}function pk(e){const t=tS(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=Qc(["/",t,d.pathname]),d)}}function ap(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 nS(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 mt=(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))(mt||{});function sS({update:e,notify:t,unwatched:s}){return{link:a,unlink:r,propagate:c,checkDirty:d,shallowPropagate:f};function a(p,v,y){const b=v.depsTail;if(b!==void 0&&b.dep===p)return;const x=b!==void 0?b.nextDep:v.deps;if(x!==void 0&&x.dep===p){x.version=y,v.depsTail=x;return}const j=p.subsTail;if(j!==void 0&&j.version===y&&j.sub===v)return;const w=v.depsTail=p.subsTail={version:y,dep:p,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:p.subs=w}function r(p,v=p.sub){const y=p.dep,b=p.prevDep,x=p.nextDep,j=p.nextSub,w=p.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(p){let v=p.nextSub,y;e:do{const b=p.sub;let x=b.flags;if(x&60?x&12?x&4?!(x&48)&&m(p,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=(p=j).nextSub;w!==void 0&&(y={value:v,prev:y},v=w);continue}}if((p=v)!==void 0){v=p.nextSub;continue}for(;y!==void 0;)if(p=y.value,y=y.prev,p!==void 0){v=p.nextSub;continue e}break}while(!0)}function d(p,v){let y,b=0,x=!1;e:do{const j=p.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){(p.nextSub!==void 0||p.prevSub!==void 0)&&(y={value:p,prev:y}),p=j.deps,v=j,++b;continue}if(!x){const _=p.nextDep;if(_!==void 0){p=_;continue}}for(;b--;){const _=v.subs,C=_.nextSub!==void 0;if(C?(p=y.value,y=y.prev):p=_,x){if(e(v)){C&&f(_),v=p.sub;continue}x=!1}else v.flags&=-33;v=p.sub;const E=p.nextDep;if(E!==void 0){p=E;continue e}}return x}while(!0)}function f(p){do{const v=p.sub,y=v.flags;(y&48)===32&&(v.flags=y|16,(y&6)===2&&t(v))}while((p=p.nextSub)!==void 0)}function m(p,v){let y=v.depsTail;for(;y!==void 0;){if(y===p)return!0;y=y.prevDep}return!1}}let qp=0,ra=0,Io=0;const Bs=[],{link:V4,unlink:iS,propagate:Q4,checkDirty:mk,shallowPropagate:Y4}=sS({update(e){return e.depsTail!==void 0?bk(e):xk(e)},notify(e){let t=Io,s=t;do if(Bs[t++]=e,e.flags&=-3,e=e.subs?.sub,e===void 0||!(e.flags&2))break;while(!0);for(Io=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,Eu(e)):jk.call(e)}});function gk(){return qp}function yk(){++qp}function vk(){--qp||wk()}function bk(e){e.depsTail=void 0,e.flags=5;try{const t=e.value;return t!==(e.value=e.getter(t))}finally{e.flags&=-5,Eu(e)}}function xk(e){return e.flags=1,e.currentValue!==(e.currentValue=e.pendingValue)}function Sk(e){const t=e.flags;if(t&16||t&32&&mk(e.deps,e)){e.depsTail=void 0,e.flags=6;try{e.fn()}finally{e.flags&=-5,Eu(e)}}else e.flags=2}function wk(){try{for(;ra<Io;){const e=Bs[ra];Bs[ra++]=void 0,Sk(e)}}finally{for(;ra<Io;){const e=Bs[ra];Bs[ra++]=void 0,e.flags|=10}ra=0,Io=0}}function jk(){this.depsTail=void 0,this.flags=0,Eu(this);const e=this.subs;e!==void 0&&iS(e)}function Eu(e){const t=e.depsTail;let s=t!==void 0?t.nextDep:e.deps;for(;s!==void 0;)s=iS(s,e)}function Hp(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 rp=[];let Yc=0;const{link:nb,unlink:Nk,propagate:_k,checkDirty:aS,shallowPropagate:sb}=sS({update(e){return e._update()},notify(e){rp[op++]=e,e.flags&=~mt.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=mt.Mutable|mt.Dirty,fu(e))}});let Rc=0,op=0,gs;function fu(e){const t=e.depsTail;let s=t!==void 0?t.nextDep:e.deps;for(;s!==void 0;)s=Nk(s,e)}function rS(){if(!(gk()>0)){for(;Rc<op;){const e=rp[Rc];rp[Rc++]=void 0,e.notify()}Rc=0,op=0}}function oS(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?mt.None:mt.Mutable,get(){return gs!==void 0&&nb(r,gs,Yc),r._snapshot},subscribe(c){const d=Hp(c),f={current:!1},m=Ck(()=>{r.get(),f.current?d.next?.(r._snapshot):f.current=!0});return{unsubscribe:()=>{m.stop()}}},_update(c){const d=gs,f=Object.is;if(s)gs=r,++Yc,r.depsTail=void 0;else if(c===void 0)return!1;s&&(r.flags=mt.Mutable|mt.RecursedCheck);try{const m=r._snapshot,p=typeof c=="function"?c(m):c===void 0&&s?a(m):c;return m===void 0||!f(m,p)?(r._snapshot=p,!0):!1}finally{gs=d,s&&(r.flags&=~mt.RecursedCheck),fu(r)}}};return s?(r.flags=mt.Mutable|mt.Dirty,r.get=function(){const c=r.flags;if(c&mt.Dirty||c&mt.Pending&&aS(r.deps,r)){if(r._update()){const d=r.subs;d!==void 0&&sb(d)}}else c&mt.Pending&&(r.flags=c&~mt.Pending);return gs!==void 0&&nb(r,gs,Yc),r._snapshot}):r.set=function(c){if(r._update(c)){const d=r.subs;d!==void 0&&(_k(d),sb(d),rS())}},r}function Ck(e){const t=()=>{const a=gs;gs=s,++Yc,s.depsTail=void 0,s.flags=mt.Watching|mt.RecursedCheck;try{return e()}finally{gs=a,s.flags&=~mt.RecursedCheck,fu(s)}},s={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:mt.Watching|mt.RecursedCheck,notify(){const a=this.flags;a&mt.Dirty||a&mt.Pending&&aS(this.deps,this)?t():this.flags=mt.Watching},stop(){this.flags=mt.None,this.depsTail=void 0,fu(this)}};return t(),s}class kk{constructor(t){this.atom=oS(t)}setState(t){this.atom.set(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(Hp(t))}}class zk{constructor(t){this.atom=oS(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(Hp(t))}}function Ek(e){return typeof e=="function"?new zk(e):new kk(e)}function Ok(e){try{yk(),e()}finally{vk(),rS()}}function Bo(e){let t;return Ok(()=>{t=e()}),t}var lp=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},Ou=(e,t)=>!!(e.preload&&!e.router.state.matches.some(s=>s.id===t)),ya=(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},ib=(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:ya(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},lS=(e,t)=>{const s=e.router.getMatch(t);return!!(!s||s._nonReactive.dehydrated)},ab=(e,t,s)=>{const a=ya(e,s);e.updateMatch(t,r=>({...r,context:a}))},To=(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)},cS=(e,t,s,a)=>{if(a._nonReactive.pendingTimeout!==void 0)return;const r=s.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!Ou(e,t)&&(s.options.loader||s.options.beforeLoad||dS(s))&&typeof r=="number"&&r!==1/0&&(s.options.pendingComponent??e.router.options?.defaultPendingComponent)){const c=setTimeout(()=>{lp(e)},r);a._nonReactive.pendingTimeout=c}},Rk=(e,t,s)=>{const a=e.router.getMatch(t);if(!a._nonReactive.beforeLoadPromise&&!a._nonReactive.loaderPromise)return;cS(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()},Ak=(e,t,s,a)=>{const r=e.router.getMatch(t);let c=r._nonReactive.loadPromise;r._nonReactive.loadPromise=zr(()=>{c?.resolve(),c=void 0});const{paramsError:d,searchError:f}=r;d&&To(e,s,d,"PARSE_PARAMS"),f&&To(e,s,f,"VALIDATE_SEARCH"),cS(e,t,a,r);const m=new AbortController;let p=!1;const v=()=>{p||(p=!0,e.updateMatch(t,z=>({...z,isFetching:"beforeLoad",fetchCount:z.fetchCount+1,abortController:m})))},y=()=>{r._nonReactive.beforeLoadPromise?.resolve(),r._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,z=>({...z,isFetching:!1}))};if(!a.options.beforeLoad){Bo(()=>{v(),y()});return}r._nonReactive.beforeLoadPromise=zr();const b={...ya(e,s,!1),...r.__routeContext},{search:x,params:j,cause:w}=r,_=Ou(e,t),C={search:x,abortController:m,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){Bo(()=>{v(),y()});return}(vn(z)||un(z))&&(v(),To(e,s,z,"BEFORE_LOAD")),Bo(()=>{v(),e.updateMatch(t,M=>({...M,__beforeLoadContext:z})),y()})};let O;try{if(O=a.options.beforeLoad(C),Vo(O))return v(),O.catch(z=>{To(e,s,z,"BEFORE_LOAD")}).then(E)}catch(z){v(),To(e,s,z,"BEFORE_LOAD")}E(O)},Tk=(e,t)=>{const{id:s,routeId:a}=e.matches[t],r=e.router.looseRoutesById[a],c=()=>f(),d=()=>Ak(e,s,t,r),f=()=>{if(lS(e,s))return;const m=Rk(e,s,r);return Vo(m)?m.then(d):d()};return c()},Dk=(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}))},uS=(e,t,s,a,r)=>{const c=t[a-1],{params:d,loaderDeps:f,abortController:m,cause:p}=e.router.getMatch(s),v=ya(e,a),y=Ou(e,s);return{params:d,deps:f,preload:!!y,parentMatchPromise:c,abortController:m,context:v,location:e.location,navigate:b=>e.router.navigate({...b,_fromLocation:e.location}),cause:y?"preload":p,route:r,...e.router.options.additionalContext}},rb=async(e,t,s,a,r)=>{try{const c=e.router.getMatch(s);try{(!(AC??e.router.isServer)||c.ssr===!0)&&Qo(r);const d=r.options.loader,f=typeof d=="function"?d:d?.handler,m=f?.(uS(e,t,s,a,r)),p=!!f&&Vo(m);if((p||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=p?await m:m;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:ya(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,p=>({...p,status:p.status==="pending"?"success":p.status,isFetching:!1,context:ya(e,a)}));return}const m=c._nonReactive.minPendingPromise;m&&await m,un(d)&&await r.options.notFoundComponent?.preload?.(),ki(e,e.router.getMatch(s),d);try{r.options.onError?.(d)}catch(p){f=p,ki(e,e.router.getMatch(s),p)}!vn(f)&&!un(f)&&await Qo(r,["errorComponent"]),e.updateMatch(s,p=>({...p,error:f,context:ya(e,a),status:"error",isFetching:!1}))}}catch(c){const d=e.router.getMatch(s);d&&(d._nonReactive.loaderPromise=void 0),ki(e,d,c)}},Lk=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(uS(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 rb(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 rb(e,t,r,s,C):ab(e,r,s))}const{id:r,routeId:c}=e.matches[s];let d=!1,f=!1;const m=e.router.looseRoutesById[c],p=m.options.loader,v=((typeof p=="function"?void 0:p?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!=="blocking";if(lS(e,r)){if(!e.router.getMatch(r))return e.matches[s];ab(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=Ou(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,_,m)}else{const _=w&&!e.router.state.matches.some(E=>E.id===r),C=e.router.getMatch(r);C._nonReactive.loaderPromise=zr(),_!==C.preload&&e.updateMatch(r,E=>({...E,preload:_})),await a(w,x,j,C,m)}}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 ob(e){const t=e,s=[];t.router.state.matches.some(b=>b._forcePending)&&lp(t);let a;for(let b=0;b<t.matches.length;b++){try{const x=Tk(t,b);Vo(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?ib(t,a):void 0,d=a&&t.preload?0:c!==void 0?Math.min(c+1,r):r;let f,m;for(let b=0;b<d;b++)s.push(Lk(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:m??=j}if(m!==void 0)throw m}const p=f??(a&&!t.preload?a:void 0);let v=t.serialError?t.firstBadMatchIndex??0:t.matches.length-1;if(!p&&a&&t.preload)return t.matches;if(p){const b=ib(t,p);Di(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),p.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:p},isFetching:!1})),v=b,await Qo(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 Qo(b,["errorComponent"])}for(let b=0;b<=v;b++){const{id:x,routeId:j}=t.matches[b],w=t.router.looseRoutesById[j];try{const _=Dk(t,x,w);if(_){const C=await _;t.updateMatch(x,E=>({...E,...C}))}}catch(_){console.error(`Error executing head for route ${j}:`,_)}}const y=lp(t);if(Vo(y)&&await y,p)throw p;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function lb(e,t){const s=t.map(a=>e.options[a]?.preload?.()).filter(Boolean);if(s.length!==0)return Promise.all(s)}function Qo(e,t=Xc){!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===Xc?(()=>{if(e._componentsPromise===void 0){const a=lb(e,Xc);a?e._componentsPromise=a.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():lb(e,t);return e._lazyPromise?e._lazyPromise.then(s):s()}function dS(e){for(const t of Xc)if(e.options[t]?.preload)return!0;return!1}var Xc=["component","errorComponent","pendingComponent","notFoundComponent"],Ri="__TSR_index",cb="popstate",ub="beforeunload";function Mk(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,...m})=>{if(f?.ignoreBlocker??!1){d();return}const p=e.getBlockers?.()??[],v=m.type==="PUSH"||m.type==="REPLACE";if(typeof document<"u"&&p.length&&v)for(const y of p){const b=hu(m.path,m.state);if(await y.blockerFn({currentLocation:t,nextLocation:b,action:m.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,m)=>{const p=t.state[Ri];f=db(p+1,f),c({task:()=>{e.pushState(d,f),a({type:"PUSH"})},navigateOpts:m,type:"PUSH",path:d,state:f})},replace:(d,f,m)=>{const p=t.state[Ri];f=db(p,f),c({task:()=>{e.replaceState(d,f),a({type:"REPLACE"})},navigateOpts:m,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[Ri]!==0,createHref:d=>e.createHref(d),block:d=>{if(!e.setBlockers)return()=>{};const f=e.getBlockers?.()??[];return e.setBlockers([...f,d]),()=>{const m=e.getBlockers?.()??[];e.setBlockers?.(m.filter(p=>p!==d))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:a}}function db(e,t){t||(t={});const s=Zp();return{...t,key:s,__TSR_key:s,[Ri]:e}}function Uk(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),m=(()=>hu(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const R=Zp();t.history.replaceState({[Ri]:0,key:R,__TSR_key:R},"")}let p=m(),v,y=!1,b=!1,x=!1,j=!1;const w=()=>p;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=p),p=hu(I,ie),_={href:Q,state:ie,isPush:_?.isPush||R==="push"},C||(C=Promise.resolve().then(()=>E()))},z=R=>{p=m(),L.notify({type:R})},M=async()=>{if(b){b=!1;return}const R=m(),I=R.state[Ri]-p.state[Ri],ie=I===1,Q=I===-1,se=!ie&&!Q||y;y=!1;const pe=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:p,nextLocation:R,action:pe})){b=!0,t.history.go(1),L.notify(Ee);return}}}p=m(),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=Mk({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(ub,T,{capture:!0}),t.removeEventListener(cb,M)},onBlocked:()=>{v&&p!==v&&(p=v)},getBlockers:c,setBlockers:d,notifyOnIndexChange:!1});return t.addEventListener(ub,T,{capture:!0}),t.addEventListener(cb,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 Pk(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function hu(e,t){const s=Pk(e),a=s.indexOf("#"),r=s.indexOf("?"),c=Zp();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||{[Ri]:0,key:c,__TSR_key:c}}}function Zp(){return(Math.random()+1).toString(36).substring(7)}function va(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 $k(e){const t=e.filter(s=>s.status!=="redirected");return t.length===e.length?e:t}var Ik=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=JC(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=Uk()),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 p;this.resolvePathCache=cu(1e3),p=this.buildRouteTree(),this.setRoutes(p)}!this.__store&&this.latestLocation&&(this.__store=Ek(qk(this.latestLocation)),ak(this));let d=!1;const f=this.options.basepath??"/",m=this.options.rewrite;if(r||a!==f||c!==m){this.basepath=f;const p=[],v=tS(f);v&&v!=="/"&&p.push(pk({basepath:f})),m&&p.push(m),this.rewrite=p.length===0?void 0:p.length===1?p[0]:hk(p),this.history&&this.updateLatestLocation(),d=!0}d&&this.__store&&this.__store.setState(p=>({...p,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=GC(this.routeTree,this.options.caseSensitive,(s,a)=>{s.init({originalIndex:a})});return this.options.routeMasks&&BC(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:m,hash:p,href:v,state:y})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(f)){const _=this.options.parseSearch(m),C=this.options.stringifySearch(_);return{href:f+C+p,publicHref:v,pathname:Ro(f).path,external:!1,searchStr:C,search:aa(s?.search,_),hash:Ro(p.slice(1)).path,state:ua(s?.state,y)}}const b=new URL(v,this.origin),x=ap(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:Ro(x.pathname).path,external:!!this.rewrite&&x.origin!==this.origin,searchStr:w,search:aa(s?.search,j),hash:Ro(x.hash.slice(1)).path,state:ua(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)=>XC({base:t,to:Ip(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=>Hk({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,m=this.resolvePathWithBase(f,"."),p=d.search,v=Object.assign(Object.create(null),d.params),y=r.to?this.resolvePathWithBase(m,`${r.to}`):this.resolvePathWithBase(m,"."),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:Ro(eb({path:y,params:b,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let _=p;if(t._includeValidateSearch&&this.options.search?.strict){const I={};j.forEach(ie=>{if(ie.options.validateSearch)try{Object.assign(I,Jc(ie.options.validateSearch,{...I,..._}))}catch{}}),_=I}_=Zk({search:_,dest:r,destRoutes:j,_includeValidateSearch:t._includeValidateSearch}),_=aa(p,_);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=ua(c.state,z);const M=`${w}${C}${O}`;let T,L,R=!1;if(this.rewrite){const I=new URL(M,this.origin),ie=nS(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=PC(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 m=Object.create(null);if(this.options.routeMasks){const p=qC(d.pathname,this.processedTree);if(p){Object.assign(m,p.rawParams);const{from:v,params:y,...b}=p.route,x=y===!1||y===null?Object.create(null):(y??!0)===!0?m:Object.assign(m,Ci(y,m));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(p=>{a.state[p]=this.latestLocation.state[p]});const m=ma(a.state,this.latestLocation.state);return f.forEach(p=>{delete a.state[p]}),m},c=Oi(this.latestLocation.href)===Oi(a.href);let d=this.commitLocationPromise;if(this.commitLocationPromise=zr(()=>{d?.resolve(),d=void 0}),c&&r())this.load();else{let{maskedLocation:f,hashScrollIntoView:m,...p}=a;f&&(p={...f,state:{...f.state,__tempKey:void 0,__tempLocation:{...p,search:p.searchStr,state:{...p.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(p.unmaskOnReload??this.options.unmaskOnReload??!1)&&(p.state.__tempKey=this.tempLocationKey)),p.state.__hashScrollIntoViewOptions=m??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=t,this.history[a.replace?"replace":"push"](p.publicHref,p.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=hu(d,{__TSR_index:t?v:v+1}),b=new URL(y.pathname,this.origin);f.to=ap(this.rewrite,b).pathname,f.search=this.options.parseSearch(y.search),f.hash=y.hash.slice(1)}const m=this.buildLocation({...f,_includeValidateSearch:!0});this.pendingBuiltLocation=m;const p=this.commitLocation({...m,viewTransition:r,replace:t,resetScroll:s,hashScrollIntoView:a,ignoreBlocker:c});return Promise.resolve().then(()=>{this.pendingBuiltLocation===m&&(this.pendingBuiltLocation=void 0)}),p},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 m=this.buildLocation({to:t,...c});a=a??m.publicHref,r=r??m.publicHref}const f=!d&&r?r:a;if(lu(f,this.protocolAllowlist))return Promise.resolve();if(!c.ignoreBlocker){const m=this.history.getBlockers?.()??[];for(const p of m)if(p?.blockerFn&&await p.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 m=this.latestLocation,p=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...va({resolvedLocation:p,location:m})}),this.emit({type:"onBeforeLoad",...va({resolvedLocation:p,location:m})}),await ob({router:this,sync:t?.sync,forceStaleReload:c.href===m.href,matches:this.state.pendingMatches,location:m,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let v=[],y=[],b=[],x=[];Bo(()=>{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(m){vn(m)?(s=m,this.navigate({...s.options,replace:!0,ignoreBlocker:!0})):un(m)&&(a=m),this.__store.setState(p=>({...p,statusCode:s?s.status:a?404:p.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(va({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:$k(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&&lu(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=Qo,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)]);Bo(()=>{a.forEach(d=>{c.has(d.id)||this.__store.setState(f=>({...f,cachedMatches:[...f.cachedMatches,d]}))})});try{return a=await ob({router:this,matches:a,location:s,preload:!0,updateMatch:(d,f)=>{r.has(d)?a=a.map(m=>m.id===d?f(m):m):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=HC(r.pathname,s?.caseSensitive??!1,s?.fuzzy??!1,c.pathname,this.processedTree);return!d||t.params&&!ma(d.rawParams,t.params,{partial:!0})?!1:s?.includeSearch??!0?ma(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??uk,parseSearch:e.parseSearch??ck,protocolAllowlist:e.protocolAllowlist??UC}),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["**"]:Oi(e.pathname))&&(this.options.notFoundRoute?d=[...d,this.options.notFoundRoute]:f=!0);const m=f?Gk(this.options.notFoundMode,d):void 0,p=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=p[y-1];let j,w,_;{const pe=x?.search??e.search,Ee=x?._strictSearch??void 0;try{const we=Jc(b.options.validateSearch,{...pe})??void 0;j={...pe,...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=pe,w={},_=H}}const C=b.options.loaderDeps?.({search:j})??"",E=C?JSON.stringify(C):"",{interpolatedPath:O,usedParams:z}=eb({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{fb(b,z,c,R)}catch(pe){if(un(pe)||vn(pe)?I=pe:I=new Bk(pe.message,{cause:pe}),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:aa(L?L.search:T.search,j),_strictSearch:w};else{const pe=b.options.loader||b.options.beforeLoad||b.lazyFn||dS(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?aa(L.search,j):j,_strictSearch:w,searchError:void 0,status:pe,isFetching:!1,error:void 0,paramsError:I,__routeContext:void 0,_nonReactive:{loadPromise:zr()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:ie,loaderDeps:L?ua(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=m===b.id),Q.searchError=_;const se=this.getParentContext(x);Q.context={...se,...Q.__routeContext,...Q.__beforeLoadContext},p[y]=Q}for(let y=0;y<p.length;y++){const b=p[y],x=this.looseRoutesById[b.routeId],j=this.getMatch(b.id),w=v.get(b.routeId);if(b.params=w?aa(w.params,r):r,!j){const _=p[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:p,routeId:x.id};b.__routeContext=x.options.context(E)??void 0}b.context={...C,...b.__routeContext,...b.__beforeLoadContext}}}return p}matchRoutesLightweight(e){const{matchedRoutes:t,routeParams:s,parsedParams:a}=this.getMatchedRoutes(e.pathname),r=Ko(t),c={...e.search};for(const p of t)try{Object.assign(c,Jc(p.options.validateSearch,c))}catch{}const d=Ko(this.state.matches),f=d&&d.routeId===r.id&&e.pathname===this.state.location.pathname;let m;if(f)m=d.params;else{const p=Object.assign(Object.create(null),s);for(const v of t)try{fb(v,s,a??{},p)}catch{}m=p}return{matchedRoutes:t,fullPath:r.fullPath,search:c,params:m}}},pu=class extends Error{},Bk=class extends Error{};function qk(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function Jc(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 Hk({pathname:e,routesById:t,processedTree:s}){const a=Object.create(null),r=Oi(e);let c,d;const f=ZC(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 Zk({search:e,dest:t,destRoutes:s,_includeValidateSearch:a}){return Fk(s)(e,t,a??!1)}function Fk(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 m=d;"preSearchFilters"in r.options&&r.options.preSearchFilters&&(m=r.options.preSearchFilters.reduce((v,y)=>y(v),d));const p=f(m);return"postSearchFilters"in r.options&&r.options.postSearchFilters?r.options.postSearchFilters.reduce((v,y)=>y(v),p):p};t.middlewares.push(c)}if(r.options.validateSearch){const c=({search:d,next:f})=>{const m=f(d);if(!t._includeValidateSearch)return m;try{return{...m,...Jc(r.options.validateSearch,m)??void 0}}catch{return m}};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:p=>a(r+1,p,d)})};return function(c,d,f){return t.dest=d,t._includeValidateSearch=f,a(0,c,t.middlewares)}}function Gk(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 ga}function fb(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 Kk="Error preloading route! ☝️",fS=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=ga:this.parentRoute||Di(!1);let r=a?ga:s?.path;r&&r!=="/"&&(r=eS(r));const c=s?.id||r;let d=a?ga:Qc([this.parentRoute.id==="__root__"?"":this.parentRoute.id,c]);r==="__root__"&&(r="/"),d!=="__root__"&&(d=Qc(["/",d]));const f=d==="__root__"?"/":Qc([this.parentRoute.fullPath,r]);this._path=r,this._id=d,this._fullPath=f,this._to=Oi(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=>Bp({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.")}},Vk=class extends fS{constructor(e){super(e)}};function Fp(e){const t=e.errorComponent??Gp;return l.jsx(Qk,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:s,reset:a})=>s?N.createElement(t,{error:s,reset:a}):e.children})}var Qk=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 Gp({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 Yk({children:e,fallback:t=null}){return hS()?l.jsx(ts.Fragment,{children:e}):l.jsx(ts.Fragment,{children:t})}function hS(){return ts.useSyncExternalStore(Xk,()=>!0,()=>!1)}function Xk(){return()=>{}}var pS=N.createContext(null);function Fn(e){const t=N.useContext(pS);return e?.warn,t}var kh={exports:{}},zh={},Eh={exports:{}},Oh={};var hb;function Jk(){if(hb)return Oh;hb=1;var e=sl();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,m(w)&&_({inst:w})},[y,x,b]),r(function(){return m(w)&&_({inst:w}),y(function(){m(w)&&_({inst:w})})},[y]),d(x),x}function m(y){var b=y.getSnapshot;y=y.value;try{var x=b();return!s(y,x)}catch{return!0}}function p(y,b){return b()}var v=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?p:f;return Oh.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:v,Oh}var pb;function Wk(){return pb||(pb=1,Eh.exports=Jk()),Eh.exports}var mb;function ez(){if(mb)return zh;mb=1;var e=sl(),t=Wk();function s(p,v){return p===v&&(p!==0||1/p===1/v)||p!==p&&v!==v}var a=typeof Object.is=="function"?Object.is:s,r=t.useSyncExternalStore,c=e.useRef,d=e.useEffect,f=e.useMemo,m=e.useDebugValue;return zh.useSyncExternalStoreWithSelector=function(p,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(p,j[0],j[1]);return d(function(){w.hasValue=!0,w.value=_},[_]),m(_),_},zh}var gb;function tz(){return gb||(gb=1,kh.exports=ez()),kh.exports}var nz=tz();function sz(e,t){return e===t}function iz(e,t,s=sz){const a=N.useCallback(d=>{if(!e)return()=>{};const{unsubscribe:f}=e.subscribe(d);return f},[e]),r=N.useCallback(()=>e?.get(),[e]);return nz.useSyncExternalStoreWithSelector(a,r,r,t,s)}function bn(e){const t=Fn({warn:e?.router===void 0}),s=e?.router||t,a=N.useRef(void 0);return iz(s.__store,r=>{if(e?.select){if(e.structuralSharing??s.options.defaultStructuralSharing){const c=ua(a.current,e.select(r));return a.current=c,c}return e.select(r)}return r})}var Ru=N.createContext(void 0),az=N.createContext(void 0);function Ui(e){const t=N.useContext(e.from?az:Ru);return bn({select:s=>{const a=s.matches.find(r=>e.from?e.from===r.routeId:r.id===t);if(Di(!((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 Kp(e){return Ui({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Vp(e){const{select:t,...s}=e;return Ui({...s,select:a=>t?t(a.loaderDeps):a.loaderDeps})}function Au(e){return Ui({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 Tu(e){return Ui({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function wa(e){const t=Fn();return N.useCallback(s=>t.navigate({...s,from:s.from??e?.from}),[e?.from,t])}function Qp(e){return Ui({...e,select:t=>e.select?e.select(t.context):t.context})}var Yp=Lx();const rz=Dx(Yp);function oz(e,t){const s=Fn(),a=RC(t),{activeProps:r,inactiveProps:c,activeOptions:d,to:f,preload:m,preloadDelay:p,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:pe,state:Ee,mask:we,reloadDocument:H,unsafeRelative:Z,from:oe,_fromLocation:me,...ee}=e,D=hS(),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,ue=le.maskedLocation?le.maskedLocation.external:le.external,Ze=N.useMemo(()=>hz(he,ue,s.history,C),[C,ue,he,s.history]),ge=N.useMemo(()=>{if(Ze?.external)return lu(Ze.href,s.protocolAllowlist)?void 0:Ze.href;if(!pz(f)&&!(typeof f!="string"||f.indexOf(":")===-1))try{return new URL(f),lu(f,s.protocolAllowlist)?void 0:f}catch{}},[f,Ze,s.protocolAllowlist]),Ye=bn({select:ke=>{if(ge)return!1;if(d?.exact){if(!YC(ke.location.pathname,le.pathname,s.basepath))return!1}else{const Te=uu(ke.location.pathname,s.basepath),kt=uu(le.pathname,s.basepath);if(!(Te.startsWith(kt)&&(Te.length===kt.length||Te[kt.length]==="/")))return!1}return(d?.includeSearch??!0)&&!ma(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,{})??lz:Rh,fe=Ye?Rh:Ci(c,{})??Rh,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:m??s.options.defaultPreload,Ct=p??s.options.defaultPreloadDelay??0,St=N.useCallback(()=>{s.preloadRoute({...ae,_builtLocation:le}).catch(ke=>{console.warn(ke),console.warn(Kk)})},[s,ae,le]);OC(a,N.useCallback(ke=>{ke?.isIntersecting&&St()},[St]),fz,{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&&!mz(ke)&&!ke.defaultPrevented&&(!kt||kt==="_self")&&ke.button===0){ke.preventDefault(),Yp.flushSync(()=>{_t(!0)});const Vn=s.subscribe("onResolved",()=>{Vn(),_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(Do.has(Te))return;const kt=setTimeout(()=>{Do.delete(Te),St()},Ct);Do.set(Te,kt)},Ue=ke=>{C||Gt!=="intent"||St()},Pe=ke=>{if(C||!Gt||!Ct)return;const Te=ke.currentTarget,kt=Do.get(Te);kt&&(clearTimeout(kt),Do.delete(Te))};return{...ee,...ft,...fe,href:Ze?.href,ref:a,onClick:dr([z,sn]),onBlur:dr([M,Pe]),onFocus:dr([T,re]),onMouseEnter:dr([L,re]),onMouseLeave:dr([R,Pe]),onTouchStart:dr([I,Ue]),disabled:!!C,target:_,...lt&&{style:lt},...Qe&&{className:Qe},...C&&cz,...Ye&&uz,...D&&Wt&&dz}}var Rh={},lz={className:"active"},cz={role:"link","aria-disabled":!0},uz={"data-status":"active","aria-current":"page"},dz={"data-transitioning":"transitioning"},Do=new WeakMap,fz={rootMargin:"100px"},dr=e=>t=>{for(const s of e)if(s){if(t.defaultPrevented)return;s(t)}};function hz(e,t,s,a){if(!a)return t?{href:e,external:!0}:{href:s.createHref(e)||"/",external:!1}}function pz(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var pt=N.forwardRef((e,t)=>{const{_asChild:s,...a}=e,{type:r,...c}=oz(a,t),d=typeof a.children=="function"?a.children({isActive:c["data-status"]==="active"}):a.children;if(!s){const{disabled:f,...m}=c;return N.createElement("a",m,d)}return N.createElement(s,c,d)});function mz(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var gz=class extends fS{constructor(e){super(e),this.useMatch=t=>Ui({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>Qp({...t,from:this.id}),this.useSearch=t=>Tu({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>Au({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>Vp({...t,from:this.id}),this.useLoaderData=t=>Kp({...t,from:this.id}),this.useNavigate=()=>wa({from:this.fullPath}),this.Link=ts.forwardRef((t,s)=>l.jsx(pt,{ref:s,from:this.fullPath,...t})),this.$$typeof=Symbol.for("react.memo")}};function ss(e){return new gz(e)}function yz(){return e=>bz(e)}var vz=class extends Vk{constructor(e){super(e),this.useMatch=t=>Ui({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>Qp({...t,from:this.id}),this.useSearch=t=>Tu({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>Au({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>Vp({...t,from:this.id}),this.useLoaderData=t=>Kp({...t,from:this.id}),this.useNavigate=()=>wa({from:this.fullPath}),this.Link=ts.forwardRef((t,s)=>l.jsx(pt,{ref:s,from:this.fullPath,...t})),this.$$typeof=Symbol.for("react.memo")}};function bz(e){return new vz(e)}function yb(e){return typeof e=="object"?new vb(e,{silent:!0}).createRoute(e):new vb(e,{silent:!0}).createRoute}var vb=class{constructor(e,t){this.path=e,this.createRoute=s=>{const a=ss(s);return a.isRoot=!1,a},this.silent=t?.silent}},bb=class{constructor(e){this.useMatch=t=>Ui({select:t?.select,from:this.options.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>Qp({...t,from:this.options.id}),this.useSearch=t=>Tu({select:t?.select,structuralSharing:t?.structuralSharing,from:this.options.id}),this.useParams=t=>Au({select:t?.select,structuralSharing:t?.structuralSharing,from:this.options.id}),this.useLoaderDeps=t=>Vp({...t,from:this.options.id}),this.useLoaderData=t=>Kp({...t,from:this.options.id}),this.useNavigate=()=>wa({from:Fn().routesById[this.options.id].fullPath}),this.options=e,this.$$typeof=Symbol.for("react.memo")}};function xb(e){return typeof e=="object"?new bb(e):t=>new bb({id:e,...t})}function xz(e){const t=bn({select:s=>`not-found-${s.location.pathname}-${s.status}`});return l.jsx(Fp,{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 Sz(){return l.jsx("p",{children:"Not Found"})}function yr(e){return l.jsx(l.Fragment,{children:e.children})}function mS(e,t,s){return t.options.notFoundComponent?l.jsx(t.options.notFoundComponent,{...s}):e.options.defaultNotFoundComponent?l.jsx(e.options.defaultNotFoundComponent,{...s}):l.jsx(Sz,{})}function wz(){return Fn().isScrollRestoring,null}var gS=N.memo(function({matchId:t}){const s=Fn(),a=bn({select:j=>{const w=j.matches.findIndex(C=>C.id===t),_=j.matches[w];return Di(_),{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,m=r.options.onCatch??s.options.defaultOnCatch,p=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:yr,b=f?Fp:yr,x=p?xz:yr;return l.jsxs(r.isRoot?r.options.shellComponent??yr:yr,{children:[l.jsx(Ru.Provider,{value:t,children:l.jsx(y,{fallback:d,children:l.jsx(b,{getResetKey:()=>a.resetKey,errorComponent:f||Gp,onCatch:(j,w)=>{if(un(j))throw j;m?.(j,w)},children:l.jsx(x,{fallback:j=>{if(!p||j.routeId&&j.routeId!==a.routeId||!j.routeId&&!r.isRoot)throw j;return N.createElement(p,j)},children:v||a._displayPending?l.jsx(Yk,{fallback:d,children:l.jsx(Sb,{matchId:t})}):l.jsx(Sb,{matchId:t})})})})}),a.parentRouteId===ga&&s.options.scrollRestoration?l.jsxs(l.Fragment,{children:[l.jsx(jz,{}),l.jsx(wz,{})]}):null]})});function jz(){const e=Fn(),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",...va(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}var Sb=N.memo(function({matchId:t}){const s=Fn(),{match:a,key:r,routeId:c}=bn({select:m=>{const p=m.matches.find(b=>b.id===t),v=p.routeId,y=(s.routesById[v].options.remountDeps??s.options.defaultRemountDeps)?.({routeId:v,loaderDeps:p.loaderDeps,params:p._strictParams,search:p._strictSearch});return{key:y?JSON.stringify(y):void 0,routeId:v,match:{id:p.id,status:p.status,error:p.error,_forcePending:p._forcePending,_displayPending:p._displayPending}}},structuralSharing:!0}),d=s.routesById[c],f=N.useMemo(()=>{const m=d.options.component??s.options.defaultComponent;return m?l.jsx(m,{},r):l.jsx(Xp,{})},[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 m=d.options.pendingMinMs??s.options.defaultPendingMinMs;if(m){const p=s.getMatch(a.id);if(p&&!p._nonReactive.minPendingPromise){const v=zr();p._nonReactive.minPendingPromise=v,setTimeout(()=>{v.resolve(),p._nonReactive.minPendingPromise=void 0},m)}}throw s.getMatch(a.id)?._nonReactive.loadPromise}if(a.status==="notFound")return Di(un(a.error)),mS(s,d,a.error);if(a.status==="redirected")throw Di(vn(a.error)),s.getMatch(a.id)?._nonReactive.loadPromise;if(a.status==="error")throw a.error;return f}),Xp=N.memo(function(){const t=Fn(),s=N.useContext(Ru),a=bn({select:p=>p.matches.find(v=>v.id===s)?.routeId}),r=t.routesById[a],c=bn({select:p=>{const v=p.matches.find(y=>y.id===s);return Di(v),v.globalNotFound}}),d=bn({select:p=>{const v=p.matches;return v[v.findIndex(y=>y.id===s)+1]?.id}}),f=t.options.defaultPendingComponent?l.jsx(t.options.defaultPendingComponent,{}):null;if(c)return mS(t,r,void 0);if(!d)return null;const m=l.jsx(gS,{matchId:d});return a===ga?l.jsx(N.Suspense,{fallback:f,children:m}):m});function Nz(){const e=Fn(),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=Sh(c),f=c||s||r,m=Sh(f),p=c||r,v=Sh(p);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 Oi(e.latestLocation.publicHref)!==Oi(b.publicHref)&&e.commitLocation({...b,replace:!0}),()=>{y()}},[e,e.history]),Ec(()=>{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]),Ec(()=>{d&&!c&&e.emit({type:"onLoad",...va(e.state)})},[d,e,c]),Ec(()=>{v&&!p&&e.emit({type:"onBeforeRouteMount",...va(e.state)})},[p,v,e]),Ec(()=>{if(m&&!f){const y=va(e.state);e.emit({type:"onResolved",...y}),e.__store.setState(b=>({...b,status:"idle",resolvedLocation:b.location})),y.hrefChanged&&rk(e)}},[f,m,e]),null}function _z(){const e=Fn(),t=e.routesById[ga].options.pendingComponent??e.options.defaultPendingComponent,s=t?l.jsx(t,{}):null,a=l.jsxs(typeof document<"u"&&e.ssr?yr:N.Suspense,{fallback:s,children:[l.jsx(Nz,{}),l.jsx(Cz,{})]});return e.options.InnerWrap?l.jsx(e.options.InnerWrap,{children:a}):a}function Cz(){const e=Fn(),t=bn({select:r=>r.matches[0]?.id}),s=bn({select:r=>r.loadedAt}),a=t?l.jsx(gS,{matchId:t}):null;return l.jsx(Ru.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?a:l.jsx(Fp,{getResetKey:()=>s,errorComponent:Gp,onCatch:void 0,children:a})})}var kz=e=>new zz(e),zz=class extends Ik{constructor(e){super(e)}};typeof globalThis<"u"?(globalThis.createFileRoute=yb,globalThis.createLazyFileRoute=xb):typeof window<"u"&&(window.createFileRoute=yb,window.createLazyFileRoute=xb);function Ez({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(pS.Provider,{value:e,children:t});return e.options.Wrap?l.jsx(e.options.Wrap,{children:a}):a}function Oz({router:e,...t}){return l.jsx(Ez,{router:e,...t,children:l.jsx(_z,{})})}function Rz(e){return bn({select:t=>t.location})}function Az(){return new jC({defaultOptions:{queries:{staleTime:3e4,retry:1,refetchOnWindowFocus:!1}}})}const Tz=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Dz=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,s,a)=>a?a.toUpperCase():s.toLowerCase()),wb=e=>{const t=Dz(e);return t.charAt(0).toUpperCase()+t.slice(1)},yS=(...e)=>e.filter((t,s,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===s).join(" ").trim(),Lz=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var Mz={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 Uz=N.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:s=2,absoluteStrokeWidth:a,className:r="",children:c,iconNode:d,...f},m)=>N.createElement("svg",{ref:m,...Mz,width:t,height:t,stroke:e,strokeWidth:a?Number(s)*24/Number(t):s,className:yS("lucide",r),...!c&&!Lz(f)&&{"aria-hidden":"true"},...f},[...d.map(([p,v])=>N.createElement(p,v)),...Array.isArray(c)?c:[c]]));const is=(e,t)=>{const s=N.forwardRef(({className:a,...r},c)=>N.createElement(Uz,{ref:c,iconNode:t,className:yS(`lucide-${Tz(wb(e))}`,`lucide-${e}`,a),...r}));return s.displayName=wb(e),s};const Pz=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Du=is("chevron-right",Pz);const $z=[["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"}]],Iz=is("download",$z);const Bz=[["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"}]],qz=is("globe",Bz);const Hz=[["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"}]],Zz=is("layout-dashboard",Hz);const Fz=[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]],Gz=is("menu",Fz);const Kz=[["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"}]],Vz=is("play",Kz);const Qz=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],jb=is("plus",Qz);const Yz=[["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"}]],Xz=is("rocket",Yz);const Jz=[["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"}]],Wz=is("settings",Jz);const e2=[["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"}]],t2=is("trash-2",e2);const n2=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Jp=is("x",n2);function s2(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 Lu(e){return e.split("-").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function Ac(e){if(!e)return"—";try{return new Date(e).toLocaleString()}catch{return e}}function Nb(e){return e===null?"Unknown":e?"Pass":"Fail"}function cp(e){return e===0?"12:00 AM":e<12?`${e}:00 AM`:e===12?"12:00 PM":`${e-12}:00 PM`}function i2(e,t){return e==="twice-daily"?"twice-daily":e.startsWith("weekly@")?`${e}@${t}`:`daily@${t}`}function a2(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 r2(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 ${cp(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 ${cp(f)} · ${a}`}return`${e} · ${a}`}function _b(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Wp(...e){return t=>{let s=!1;const a=e.map(r=>{const c=_b(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():_b(e[r],null)}}}}function ja(...e){return N.useCallback(Wp(...e),e)}var o2=Symbol.for("react.lazy"),mu=Rp[" use ".trim().toString()];function l2(e){return typeof e=="object"&&e!==null&&"then"in e}function vS(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===o2&&"_payload"in e&&l2(e._payload)}function c2(e){const t=d2(e),s=N.forwardRef((a,r)=>{let{children:c,...d}=a;vS(c)&&typeof mu=="function"&&(c=mu(c._payload));const f=N.Children.toArray(c),m=f.find(h2);if(m){const p=m.props.children,v=f.map(y=>y===m?N.Children.count(p)>1?N.Children.only(null):N.isValidElement(p)?p.props.children:null:y);return l.jsx(t,{...d,ref:r,children:N.isValidElement(p)?N.cloneElement(p,void 0,v):null})}return l.jsx(t,{...d,ref:r,children:c})});return s.displayName=`${e}.Slot`,s}var u2=c2("Slot");function d2(e){const t=N.forwardRef((s,a)=>{let{children:r,...c}=s;if(vS(r)&&typeof mu=="function"&&(r=mu(r._payload)),N.isValidElement(r)){const d=m2(r),f=p2(c,r.props);return r.type!==N.Fragment&&(f.ref=a?Wp(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 f2=Symbol("radix.slottable");function h2(e){return N.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===f2}function p2(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 m=c(...f);return r(...f),m}:r&&(s[a]=r):a==="style"?s[a]={...r,...c}:a==="className"&&(s[a]=[r,c].filter(Boolean).join(" "))}return{...e,...s}}function m2(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 bS(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=bS(e[t]))&&(a&&(a+=" "),a+=s)}else for(s in e)e[s]&&(a&&(a+=" "),a+=s);return a}function xS(){for(var e,t,s=0,a="",r=arguments.length;s<r;s++)(e=arguments[s])&&(t=bS(e))&&(a&&(a+=" "),a+=t);return a}const Cb=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,kb=xS,SS=(e,t)=>s=>{var a;if(t?.variants==null)return kb(e,s?.class,s?.className);const{variants:r,defaultVariants:c}=t,d=Object.keys(r).map(p=>{const v=s?.[p],y=c?.[p];if(v===null)return null;const b=Cb(v)||Cb(y);return r[p][b]}),f=s&&Object.entries(s).reduce((p,v)=>{let[y,b]=v;return b===void 0||(p[y]=b),p},{}),m=t==null||(a=t.compoundVariants)===null||a===void 0?void 0:a.reduce((p,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]===_})?[...p,y,b]:p},[]);return kb(e,d,m,s?.class,s?.className)},g2=(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},y2=(e,t)=>({classGroupId:e,validator:t}),wS=(e=new Map,t=null,s)=>({nextPart:e,validators:t,classGroupId:s}),gu="-",zb=[],v2="arbitrary..",b2=e=>{const t=S2(e),{conflictingClassGroups:s,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:d=>{if(d.startsWith("[")&&d.endsWith("]"))return x2(d);const f=d.split(gu),m=f[0]===""&&f.length>1?1:0;return jS(f,m,t)},getConflictingClassGroupIds:(d,f)=>{if(f){const m=a[d],p=s[d];return m?p?g2(p,m):m:p||zb}return s[d]||zb}}},jS=(e,t,s)=>{if(e.length-t===0)return s.classGroupId;const r=e[t],c=s.nextPart.get(r);if(c){const p=jS(e,t+1,c);if(p)return p}const d=s.validators;if(d===null)return;const f=t===0?e.join(gu):e.slice(t).join(gu),m=d.length;for(let p=0;p<m;p++){const v=d[p];if(v.validator(f))return v.classGroupId}},x2=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?v2+a:void 0})(),S2=e=>{const{theme:t,classGroups:s}=e;return w2(s,t)},w2=(e,t)=>{const s=wS();for(const a in e){const r=e[a];em(r,s,a,t)}return s},em=(e,t,s,a)=>{const r=e.length;for(let c=0;c<r;c++){const d=e[c];j2(d,t,s,a)}},j2=(e,t,s,a)=>{if(typeof e=="string"){N2(e,t,s);return}if(typeof e=="function"){_2(e,t,s,a);return}C2(e,t,s,a)},N2=(e,t,s)=>{const a=e===""?t:NS(t,e);a.classGroupId=s},_2=(e,t,s,a)=>{if(k2(e)){em(e(a),t,s,a);return}t.validators===null&&(t.validators=[]),t.validators.push(y2(s,e))},C2=(e,t,s,a)=>{const r=Object.entries(e),c=r.length;for(let d=0;d<c;d++){const[f,m]=r[d];em(m,NS(t,f),s,a)}},NS=(e,t)=>{let s=e;const a=t.split(gu),r=a.length;for(let c=0;c<r;c++){const d=a[c];let f=s.nextPart.get(d);f||(f=wS(),s.nextPart.set(d,f)),s=f}return s},k2=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,z2=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)}}},up="!",Eb=":",E2=[],Ob=(e,t,s,a,r)=>({modifiers:e,hasImportantModifier:t,baseClassName:s,maybePostfixModifierPosition:a,isExternal:r}),O2=e=>{const{prefix:t,experimentalParseClassName:s}=e;let a=r=>{const c=[];let d=0,f=0,m=0,p;const v=r.length;for(let w=0;w<v;w++){const _=r[w];if(d===0&&f===0){if(_===Eb){c.push(r.slice(m,w)),m=w+1;continue}if(_==="/"){p=w;continue}}_==="["?d++:_==="]"?d--:_==="("?f++:_===")"&&f--}const y=c.length===0?r:r.slice(m);let b=y,x=!1;y.endsWith(up)?(b=y.slice(0,-1),x=!0):y.startsWith(up)&&(b=y.slice(1),x=!0);const j=p&&p>m?p-m:void 0;return Ob(c,x,b,j)};if(t){const r=t+Eb,c=a;a=d=>d.startsWith(r)?c(d.slice(r.length)):Ob(E2,!1,d,void 0,!0)}if(s){const r=a;a=c=>s({className:c,parseClassName:r})}return a},R2=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]==="[",m=t.has(d);f||m?(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}},A2=e=>({cache:z2(e.cacheSize),parseClassName:O2(e),sortModifiers:R2(e),...b2(e)}),T2=/\s+/,D2=(e,t)=>{const{parseClassName:s,getClassGroupId:a,getConflictingClassGroupIds:r,sortModifiers:c}=t,d=[],f=e.trim().split(T2);let m="";for(let p=f.length-1;p>=0;p-=1){const v=f[p],{isExternal:y,modifiers:b,hasImportantModifier:x,baseClassName:j,maybePostfixModifierPosition:w}=s(v);if(y){m=v+(m.length>0?" "+m:m);continue}let _=!!w,C=a(_?j.substring(0,w):j);if(!C){if(!_){m=v+(m.length>0?" "+m:m);continue}if(C=a(j),!C){m=v+(m.length>0?" "+m:m);continue}_=!1}const E=b.length===0?"":b.length===1?b[0]:c(b).join(":"),O=x?E+up: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)}m=v+(m.length>0?" "+m:m)}return m},L2=(...e)=>{let t=0,s,a,r="";for(;t<e.length;)(s=e[t++])&&(a=_S(s))&&(r&&(r+=" "),r+=a);return r},_S=e=>{if(typeof e=="string")return e;let t,s="";for(let a=0;a<e.length;a++)e[a]&&(t=_S(e[a]))&&(s&&(s+=" "),s+=t);return s},M2=(e,...t)=>{let s,a,r,c;const d=m=>{const p=t.reduce((v,y)=>y(v),e());return s=A2(p),a=s.cache.get,r=s.cache.set,c=f,f(m)},f=m=>{const p=a(m);if(p)return p;const v=D2(m,s);return r(m,v),v};return c=d,(...m)=>c(L2(...m))},U2=[],Zt=e=>{const t=s=>s[e]||U2;return t.isThemeGetter=!0,t},CS=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,kS=/^\((?:(\w[\w-]*):)?(.+)\)$/i,P2=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,$2=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,I2=/\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$/,B2=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,q2=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,H2=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Si=e=>P2.test(e),De=e=>!!e&&!Number.isNaN(Number(e)),wi=e=>!!e&&Number.isInteger(Number(e)),Ah=e=>e.endsWith("%")&&De(e.slice(0,-1)),Is=e=>$2.test(e),zS=()=>!0,Z2=e=>I2.test(e)&&!B2.test(e),tm=()=>!1,F2=e=>q2.test(e),G2=e=>H2.test(e),K2=e=>!ve(e)&&!be(e),V2=e=>Pi(e,RS,tm),ve=e=>CS.test(e),oa=e=>Pi(e,AS,Z2),Rb=e=>Pi(e,nE,De),Q2=e=>Pi(e,DS,zS),Y2=e=>Pi(e,TS,tm),Ab=e=>Pi(e,ES,tm),X2=e=>Pi(e,OS,G2),Tc=e=>Pi(e,LS,F2),be=e=>kS.test(e),Lo=e=>Na(e,AS),J2=e=>Na(e,TS),Tb=e=>Na(e,ES),W2=e=>Na(e,RS),eE=e=>Na(e,OS),Dc=e=>Na(e,LS,!0),tE=e=>Na(e,DS,!0),Pi=(e,t,s)=>{const a=CS.exec(e);return a?a[1]?t(a[1]):s(a[2]):!1},Na=(e,t,s=!1)=>{const a=kS.exec(e);return a?a[1]?t(a[1]):s:!1},ES=e=>e==="position"||e==="percentage",OS=e=>e==="image"||e==="url",RS=e=>e==="length"||e==="size"||e==="bg-size",AS=e=>e==="length",nE=e=>e==="number",TS=e=>e==="family-name",DS=e=>e==="number"||e==="weight",LS=e=>e==="shadow",sE=()=>{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"),m=Zt("spacing"),p=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,m],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],pe=()=>["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()],me=()=>[Si,"screen","full","lh","dvh","lvh","svh","min","max","fit",...R()],ee=()=>[e,be,ve],D=()=>[...z(),Tb,Ab,{position:[be,ve]}],G=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ne=()=>["auto","cover","contain",W2,V2,{size:[be,ve]}],ae=()=>[Ah,Lo,oa],le=()=>["","none","full",p,be,ve],he=()=>["",De,Lo,oa],ue=()=>["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,Ah,Tb,Ab],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:[zS],container:[Is],"drop-shadow":[Is],ease:["in","out","in-out"],font:[K2],"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":pe()}],"auto-rows":[{"auto-rows":pe()}],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",...me()]}],"min-block-size":[{"min-block":["auto",...me()]}],"max-block-size":[{"max-block":["none",...me()]}],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,Lo,oa]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,tE,Q2]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Ah,ve]}],"font-family":[{font:[J2,Y2,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,Rb]}],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:[...ue(),"wavy"]}],"text-decoration-thickness":[{decoration:[De,"from-font","auto",be,oa]}],"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]},eE,X2]}],"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:[...ue(),"hidden","none"]}],"divide-style":[{divide:[...ue(),"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:[...ue(),"none","hidden"]}],"outline-offset":[{"outline-offset":[De,be,ve]}],"outline-w":[{outline:["",De,Lo,oa]}],"outline-color":[{outline:ee()}],shadow:[{shadow:["","none",v,Dc,Tc]}],"shadow-color":[{shadow:ee()}],"inset-shadow":[{"inset-shadow":["none",y,Dc,Tc]}],"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,oa]}],"ring-offset-color":[{"ring-offset":ee()}],"inset-ring-w":[{"inset-ring":he()}],"inset-ring-color":[{"inset-ring":ee()}],"text-shadow":[{"text-shadow":["none",b,Dc,Tc]}],"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,Dc,Tc]}],"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,Lo,oa,Rb]}],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"]}},iE=M2(sE);function Gn(...e){return iE(xS(e))}const aE=SS("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"}}),de=N.forwardRef(({className:e,variant:t,size:s,asChild:a=!1,...r},c)=>{const d=a?u2:"button";return l.jsx(d,{ref:c,className:Gn(aE({variant:t,size:s,className:e})),...r})});de.displayName="Button";const rE=SS("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 MS({className:e,variant:t,...s}){return l.jsx("div",{className:Gn(rE({variant:t}),e),...s})}function Db({compact:e=!1}){return l.jsxs(pt,{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 Yo({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 yu(e){return e.state==="ok"?"positive":e.state==="checking"?"neutral":"negative"}function US(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 oE(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 lE(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(MS,{variant:s,children:t})}function Mu({status:e}){return l.jsx(yt,{tone:US(e),children:Lu(e)})}function Ai(e,t,{checkForDefaultPrevented:s=!0}={}){return function(r){if(e?.(r),s===!1||!r.defaultPrevented)return t?.(r)}}function cE(e,t){const s=N.createContext(t),a=c=>{const{children:d,...f}=c,m=N.useMemo(()=>f,Object.values(f));return l.jsx(s.Provider,{value:m,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 uE(e,t=[]){let s=[];function a(c,d){const f=N.createContext(d),m=s.length;s=[...s,d];const p=y=>{const{scope:b,children:x,...j}=y,w=b?.[e]?.[m]||f,_=N.useMemo(()=>j,Object.values(j));return l.jsx(w.Provider,{value:_,children:x})};p.displayName=c+"Provider";function v(y,b){const x=b?.[e]?.[m]||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[p,v]}const r=()=>{const c=s.map(d=>N.createContext(d));return function(f){const m=f?.[e]||c;return N.useMemo(()=>({[`__scope${e}`]:{...f,[e]:m}}),[f,m])}};return r.scopeName=e,[a,dE(r,...t)]}function dE(...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:m,scopeName:p})=>{const y=m(c)[`__scope${p}`];return{...f,...y}},{});return N.useMemo(()=>({[`__scope${t.scopeName}`]:d}),[d])}};return s.scopeName=t.scopeName,s}var Xo=globalThis?.document?N.useLayoutEffect:()=>{},fE=Rp[" useId ".trim().toString()]||(()=>{}),hE=0;function Th(e){const[t,s]=N.useState(fE());return Xo(()=>{s(a=>a??String(hE++))},[e]),e||(t?`radix-${t}`:"")}var pE=Rp[" useInsertionEffect ".trim().toString()]||Xo;function mE({prop:e,defaultProp:t,onChange:s=()=>{},caller:a}){const[r,c,d]=gE({defaultProp:t,onChange:s}),f=e!==void 0,m=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 p=N.useCallback(v=>{if(f){const y=yE(v)?v(e):v;y!==e&&d.current?.(y)}else c(v)},[f,e,c,d]);return[m,p]}function gE({defaultProp:e,onChange:t}){const[s,a]=N.useState(e),r=N.useRef(s),c=N.useRef(t);return pE(()=>{c.current=t},[t]),N.useEffect(()=>{r.current!==s&&(c.current?.(s),r.current=s)},[s,r]),[s,a,c]}function yE(e){return typeof e=="function"}function PS(e){const t=vE(e),s=N.forwardRef((a,r)=>{const{children:c,...d}=a,f=N.Children.toArray(c),m=f.find(xE);if(m){const p=m.props.children,v=f.map(y=>y===m?N.Children.count(p)>1?N.Children.only(null):N.isValidElement(p)?p.props.children:null:y);return l.jsx(t,{...d,ref:r,children:N.isValidElement(p)?N.cloneElement(p,void 0,v):null})}return l.jsx(t,{...d,ref:r,children:c})});return s.displayName=`${e}.Slot`,s}function vE(e){const t=N.forwardRef((s,a)=>{const{children:r,...c}=s;if(N.isValidElement(r)){const d=wE(r),f=SE(c,r.props);return r.type!==N.Fragment&&(f.ref=a?Wp(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 bE=Symbol("radix.slottable");function xE(e){return N.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===bE}function SE(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 m=c(...f);return r(...f),m}:r&&(s[a]=r):a==="style"?s[a]={...r,...c}:a==="className"&&(s[a]=[r,c].filter(Boolean).join(" "))}return{...e,...s}}function wE(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 jE=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Zs=jE.reduce((e,t)=>{const s=PS(`Primitive.${t}`),a=N.forwardRef((r,c)=>{const{asChild:d,...f}=r,m=d?s:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(m,{...f,ref:c})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{});function NE(e,t){e&&Yp.flushSync(()=>e.dispatchEvent(t))}function Jo(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=Jo(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 CE="DismissableLayer",dp="dismissableLayer.update",kE="dismissableLayer.pointerDownOutside",zE="dismissableLayer.focusOutside",Lb,$S=N.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),IS=N.forwardRef((e,t)=>{const{disableOutsidePointerEvents:s=!1,onEscapeKeyDown:a,onPointerDownOutside:r,onFocusOutside:c,onInteractOutside:d,onDismiss:f,...m}=e,p=N.useContext($S),[v,y]=N.useState(null),b=v?.ownerDocument??globalThis?.document,[,x]=N.useState({}),j=ja(t,L=>y(L)),w=Array.from(p.layers),[_]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),C=w.indexOf(_),E=v?w.indexOf(v):-1,O=p.layersWithOutsidePointerEventsDisabled.size>0,z=E>=C,M=RE(L=>{const R=L.target,I=[...p.branches].some(ie=>ie.contains(R));!z||I||(r?.(L),d?.(L),L.defaultPrevented||f?.())},b),T=AE(L=>{const R=L.target;[...p.branches].some(ie=>ie.contains(R))||(c?.(L),d?.(L),L.defaultPrevented||f?.())},b);return _E(L=>{E===p.layers.size-1&&(a?.(L),!L.defaultPrevented&&f&&(L.preventDefault(),f()))},b),N.useEffect(()=>{if(v)return s&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(Lb=b.body.style.pointerEvents,b.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(v)),p.layers.add(v),Mb(),()=>{s&&p.layersWithOutsidePointerEventsDisabled.size===1&&(b.body.style.pointerEvents=Lb)}},[v,b,s,p]),N.useEffect(()=>()=>{v&&(p.layers.delete(v),p.layersWithOutsidePointerEventsDisabled.delete(v),Mb())},[v,p]),N.useEffect(()=>{const L=()=>x({});return document.addEventListener(dp,L),()=>document.removeEventListener(dp,L)},[]),l.jsx(Zs.div,{...m,ref:j,style:{pointerEvents:O?z?"auto":"none":void 0,...e.style},onFocusCapture:Ai(e.onFocusCapture,T.onFocusCapture),onBlurCapture:Ai(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:Ai(e.onPointerDownCapture,M.onPointerDownCapture)})});IS.displayName=CE;var EE="DismissableLayerBranch",OE=N.forwardRef((e,t)=>{const s=N.useContext($S),a=N.useRef(null),r=ja(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})});OE.displayName=EE;function RE(e,t=globalThis?.document){const s=Jo(e),a=N.useRef(!1),r=N.useRef(()=>{});return N.useEffect(()=>{const c=f=>{if(f.target&&!a.current){let m=function(){BS(kE,s,p,{discrete:!0})};const p={originalEvent:f};f.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=m,t.addEventListener("click",r.current,{once:!0})):m()}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 AE(e,t=globalThis?.document){const s=Jo(e),a=N.useRef(!1);return N.useEffect(()=>{const r=c=>{c.target&&!a.current&&BS(zE,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 Mb(){const e=new CustomEvent(dp);document.dispatchEvent(e)}function BS(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?NE(r,c):r.dispatchEvent(c)}var Dh="focusScope.autoFocusOnMount",Lh="focusScope.autoFocusOnUnmount",Ub={bubbles:!1,cancelable:!0},TE="FocusScope",qS=N.forwardRef((e,t)=>{const{loop:s=!1,trapped:a=!1,onMountAutoFocus:r,onUnmountAutoFocus:c,...d}=e,[f,m]=N.useState(null),p=Jo(r),v=Jo(c),y=N.useRef(null),b=ja(t,w=>m(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){$b.add(x);const w=document.activeElement;if(!f.contains(w)){const C=new CustomEvent(Dh,Ub);f.addEventListener(Dh,p),f.dispatchEvent(C),C.defaultPrevented||(DE($E(HS(f)),{select:!0}),document.activeElement===w&&ji(f))}return()=>{f.removeEventListener(Dh,p),setTimeout(()=>{const C=new CustomEvent(Lh,Ub);f.addEventListener(Lh,v),f.dispatchEvent(C),C.defaultPrevented||ji(w??document.body,{select:!0}),f.removeEventListener(Lh,v),$b.remove(x)},0)}}},[f,p,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]=LE(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})});qS.displayName=TE;function DE(e,{select:t=!1}={}){const s=document.activeElement;for(const a of e)if(ji(a,{select:t}),document.activeElement!==s)return}function LE(e){const t=HS(e),s=Pb(t,e),a=Pb(t.reverse(),e);return[s,a]}function HS(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 Pb(e,t){for(const s of e)if(!ME(s,{upTo:t}))return s}function ME(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 UE(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&&UE(e)&&t&&e.select()}}var $b=PE();function PE(){let e=[];return{add(t){const s=e[0];t!==s&&s?.pause(),e=Ib(e,t),e.unshift(t)},remove(t){e=Ib(e,t),e[0]?.resume()}}}function Ib(e,t){const s=[...e],a=s.indexOf(t);return a!==-1&&s.splice(a,1),s}function $E(e){return e.filter(t=>t.tagName!=="A")}var IE="Portal",ZS=N.forwardRef((e,t)=>{const{container:s,...a}=e,[r,c]=N.useState(!1);Xo(()=>c(!0),[]);const d=s||r&&globalThis?.document?.body;return d?rz.createPortal(l.jsx(Zs.div,{...a,ref:t}),d):null});ZS.displayName=IE;function BE(e,t){return N.useReducer((s,a)=>t[s][a]??s,e)}var Uu=e=>{const{present:t,children:s}=e,a=qE(t),r=typeof s=="function"?s({present:a.isPresent}):N.Children.only(s),c=ja(a.ref,HE(r));return typeof s=="function"||a.isPresent?N.cloneElement(r,{ref:c}):null};Uu.displayName="Presence";function qE(e){const[t,s]=N.useState(),a=N.useRef(null),r=N.useRef(e),c=N.useRef("none"),d=e?"mounted":"unmounted",[f,m]=BE(d,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return N.useEffect(()=>{const p=Lc(a.current);c.current=f==="mounted"?p:"none"},[f]),Xo(()=>{const p=a.current,v=r.current;if(v!==e){const b=c.current,x=Lc(p);e?m("MOUNT"):x==="none"||p?.display==="none"?m("UNMOUNT"):m(v&&b!==x?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,m]),Xo(()=>{if(t){let p;const v=t.ownerDocument.defaultView??window,y=x=>{const w=Lc(a.current).includes(CSS.escape(x.animationName));if(x.target===t&&w&&(m("ANIMATION_END"),!r.current)){const _=t.style.animationFillMode;t.style.animationFillMode="forwards",p=v.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=_)})}},b=x=>{x.target===t&&(c.current=Lc(a.current))};return t.addEventListener("animationstart",b),t.addEventListener("animationcancel",y),t.addEventListener("animationend",y),()=>{v.clearTimeout(p),t.removeEventListener("animationstart",b),t.removeEventListener("animationcancel",y),t.removeEventListener("animationend",y)}}else m("ANIMATION_END")},[t,m]),{isPresent:["mounted","unmountSuspended"].includes(f),ref:N.useCallback(p=>{a.current=p?getComputedStyle(p):null,s(p)},[])}}function Lc(e){return e?.animationName||"none"}function HE(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 Mh=0;function ZE(){N.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Bb()),document.body.insertAdjacentElement("beforeend",e[1]??Bb()),Mh++,()=>{Mh===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Mh--}},[])}function Bb(){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 FS(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 FE(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 Wc="right-scroll-bar-position",eu="width-before-scroll-bar",GE="with-scroll-bars-hidden",KE="--removed-body-scroll-bar-size";function Uh(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function VE(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 QE=typeof window<"u"?N.useLayoutEffect:N.useEffect,qb=new WeakMap;function YE(e,t){var s=VE(null,function(a){return e.forEach(function(r){return Uh(r,a)})});return QE(function(){var a=qb.get(s);if(a){var r=new Set(a),c=new Set(e),d=s.current;r.forEach(function(f){c.has(f)||Uh(f,null)}),c.forEach(function(f){r.has(f)||Uh(f,d)})}qb.set(s,e)},[e]),s}function XE(e){return e}function JE(e,t){t===void 0&&(t=XE);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 m=function(){var v=d;d=[],v.forEach(c)},p=function(){return Promise.resolve().then(m)};p(),s={push:function(v){d.push(v),p()},filter:function(v){return d=d.filter(v),s}}}};return r}function WE(e){e===void 0&&(e={});var t=JE(null);return t.options=ys({async:!0,ssr:!1},e),t}var GS=function(e){var t=e.sideCar,s=FS(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))};GS.isSideCarExport=!0;function eO(e,t){return e.useMedium(t),GS}var KS=WE(),Ph=function(){},Pu=N.forwardRef(function(e,t){var s=N.useRef(null),a=N.useState({onScrollCapture:Ph,onWheelCapture:Ph,onTouchMoveCapture:Ph}),r=a[0],c=a[1],d=e.forwardProps,f=e.children,m=e.className,p=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=FS(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),M=b,T=YE([s,t]),L=ys(ys({},z),r);return N.createElement(N.Fragment,null,v&&N.createElement(M,{sideCar:KS,removeScrollBar:p,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:m,ref:T}),f))});Pu.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Pu.classNames={fullWidth:eu,zeroRight:Wc};var tO=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function nO(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=tO();return t&&e.setAttribute("nonce",t),e}function sO(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function iO(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var aO=function(){var e=0,t=null;return{add:function(s){e==0&&(t=nO())&&(sO(t,s),iO(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},rO=function(){var e=aO();return function(t,s){N.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&s])}},VS=function(){var e=rO(),t=function(s){var a=s.styles,r=s.dynamic;return e(a,r),null};return t},oO={left:0,top:0,right:0,gap:0},$h=function(e){return parseInt(e||"",10)||0},lO=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[$h(s),$h(a),$h(r)]},cO=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return oO;var t=lO(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])}},uO=VS(),jr="data-scroll-locked",dO=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(GE,` {
14
+ overflow: hidden `).concat(a,`;
15
+ padding-right: `).concat(f,"px ").concat(a,`;
16
+ }
17
+ body[`).concat(jr,`] {
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(Wc,` {
31
+ right: `).concat(f,"px ").concat(a,`;
32
+ }
33
+
34
+ .`).concat(eu,` {
35
+ margin-right: `).concat(f,"px ").concat(a,`;
36
+ }
37
+
38
+ .`).concat(Wc," .").concat(Wc,` {
39
+ right: 0 `).concat(a,`;
40
+ }
41
+
42
+ .`).concat(eu," .").concat(eu,` {
43
+ margin-right: 0 `).concat(a,`;
44
+ }
45
+
46
+ body[`).concat(jr,`] {
47
+ `).concat(KE,": ").concat(f,`px;
48
+ }
49
+ `)},Hb=function(){var e=parseInt(document.body.getAttribute(jr)||"0",10);return isFinite(e)?e:0},fO=function(){N.useEffect(function(){return document.body.setAttribute(jr,(Hb()+1).toString()),function(){var e=Hb()-1;e<=0?document.body.removeAttribute(jr):document.body.setAttribute(jr,e.toString())}},[])},hO=function(e){var t=e.noRelative,s=e.noImportant,a=e.gapMode,r=a===void 0?"margin":a;fO();var c=N.useMemo(function(){return cO(r)},[r]);return N.createElement(uO,{styles:dO(c,!t,r,s?"":"!important")})},fp=!1;if(typeof window<"u")try{var Mc=Object.defineProperty({},"passive",{get:function(){return fp=!0,!0}});window.addEventListener("test",Mc,Mc),window.removeEventListener("test",Mc,Mc)}catch{fp=!1}var fr=fp?{passive:!1}:!1,pO=function(e){return e.tagName==="TEXTAREA"},QS=function(e,t){if(!(e instanceof Element))return!1;var s=window.getComputedStyle(e);return s[t]!=="hidden"&&!(s.overflowY===s.overflowX&&!pO(e)&&s[t]==="visible")},mO=function(e){return QS(e,"overflowY")},gO=function(e){return QS(e,"overflowX")},Zb=function(e,t){var s=t.ownerDocument,a=t;do{typeof ShadowRoot<"u"&&a instanceof ShadowRoot&&(a=a.host);var r=YS(e,a);if(r){var c=XS(e,a),d=c[1],f=c[2];if(d>f)return!0}a=a.parentNode}while(a&&a!==s.body);return!1},yO=function(e){var t=e.scrollTop,s=e.scrollHeight,a=e.clientHeight;return[t,s,a]},vO=function(e){var t=e.scrollLeft,s=e.scrollWidth,a=e.clientWidth;return[t,s,a]},YS=function(e,t){return e==="v"?mO(t):gO(t)},XS=function(e,t){return e==="v"?yO(t):vO(t)},bO=function(e,t){return e==="h"&&t==="rtl"?-1:1},xO=function(e,t,s,a,r){var c=bO(e,window.getComputedStyle(t).direction),d=c*a,f=s.target,m=t.contains(f),p=!1,v=d>0,y=0,b=0;do{if(!f)break;var x=XS(e,f),j=x[0],w=x[1],_=x[2],C=w-_-c*j;(j||C)&&YS(e,f)&&(y+=C,b+=j);var E=f.parentNode;f=E&&E.nodeType===Node.DOCUMENT_FRAGMENT_NODE?E.host:E}while(!m&&f!==document.body||m&&(t.contains(f)||t===f));return(v&&Math.abs(y)<1||!v&&Math.abs(b)<1)&&(p=!0),p},Uc=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Fb=function(e){return[e.deltaX,e.deltaY]},Gb=function(e){return e&&"current"in e?e.current:e},SO=function(e,t){return e[0]===t[0]&&e[1]===t[1]},wO=function(e){return`
50
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
51
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
52
+ `)},jO=0,hr=[];function NO(e){var t=N.useRef([]),s=N.useRef([0,0]),a=N.useRef(),r=N.useState(jO++)[0],c=N.useState(VS)[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=FE([e.lockRef.current],(e.shards||[]).map(Gb),!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=Uc(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=Zb(L,T);if(!Q)return!0;if(Q?M=L:(M=L==="v"?"h":"v",Q=Zb(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 xO(se,_,w,se==="h"?O:z)},[]),m=N.useCallback(function(w){var _=w;if(!(!hr.length||hr[hr.length-1]!==c)){var C="deltaY"in _?Fb(_):Uc(_),E=t.current.filter(function(M){return M.name===_.type&&(M.target===_.target||_.target===M.shadowParent)&&SO(M.delta,C)})[0];if(E&&E.should){_.cancelable&&_.preventDefault();return}if(!E){var O=(d.current.shards||[]).map(Gb).filter(Boolean).filter(function(M){return M.contains(_.target)}),z=O.length>0?f(_,O[0]):!d.current.noIsolation;z&&_.cancelable&&_.preventDefault()}}},[]),p=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=Uc(w),a.current=void 0},[]),y=N.useCallback(function(w){p(w.type,Fb(w),w.target,f(w,e.lockRef.current))},[]),b=N.useCallback(function(w){p(w.type,Uc(w),w.target,f(w,e.lockRef.current))},[]);N.useEffect(function(){return hr.push(c),e.setCallbacks({onScrollCapture:y,onWheelCapture:y,onTouchMoveCapture:b}),document.addEventListener("wheel",m,fr),document.addEventListener("touchmove",m,fr),document.addEventListener("touchstart",v,fr),function(){hr=hr.filter(function(w){return w!==c}),document.removeEventListener("wheel",m,fr),document.removeEventListener("touchmove",m,fr),document.removeEventListener("touchstart",v,fr)}},[]);var x=e.removeScrollBar,j=e.inert;return N.createElement(N.Fragment,null,j?N.createElement(c,{styles:wO(r)}):null,x?N.createElement(hO,{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 CO=eO(KS,NO);var JS=N.forwardRef(function(e,t){return N.createElement(Pu,ys({},e,{ref:t,sideCar:CO}))});JS.classNames=Pu.classNames;var kO=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,$c={},Ih=0,WS=function(e){return e&&(e.host||WS(e.parentNode))},zO=function(e,t){return t.map(function(s){if(e.contains(s))return s;var a=WS(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})},EO=function(e,t,s,a){var r=zO(t,Array.isArray(e)?e:[e]);$c[s]||($c[s]=new WeakMap);var c=$c[s],d=[],f=new Set,m=new Set(r),p=function(y){!y||f.has(y)||(f.add(y),p(y.parentNode))};r.forEach(p);var v=function(y){!y||m.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(),Ih++,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)}),Ih--,Ih||(pr=new WeakMap,pr=new WeakMap,Pc=new WeakMap,$c={})}},OO=function(e,t,s){s===void 0&&(s="data-aria-hidden");var a=Array.from(Array.isArray(e)?e:[e]),r=kO(e);return r?(a.push.apply(a,Array.from(r.querySelectorAll("[aria-live], script"))),EO(a,r,s,"aria-hidden")):function(){return null}},$u="Dialog",[ew]=uE($u),[RO,as]=ew($u),tw=e=>{const{__scopeDialog:t,children:s,open:a,defaultOpen:r,onOpenChange:c,modal:d=!0}=e,f=N.useRef(null),m=N.useRef(null),[p,v]=mE({prop:a,defaultProp:r??!1,onChange:c,caller:$u});return l.jsx(RO,{scope:t,triggerRef:f,contentRef:m,contentId:Th(),titleId:Th(),descriptionId:Th(),open:p,onOpenChange:v,onOpenToggle:N.useCallback(()=>v(y=>!y),[v]),modal:d,children:s})};tw.displayName=$u;var nw="DialogTrigger",AO=N.forwardRef((e,t)=>{const{__scopeDialog:s,...a}=e,r=as(nw,s),c=ja(t,r.triggerRef);return l.jsx(Zs.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":im(r.open),...a,ref:c,onClick:Ai(e.onClick,r.onOpenToggle)})});AO.displayName=nw;var nm="DialogPortal",[TO,sw]=ew(nm,{forceMount:void 0}),iw=e=>{const{__scopeDialog:t,forceMount:s,children:a,container:r}=e,c=as(nm,t);return l.jsx(TO,{scope:t,forceMount:s,children:N.Children.map(a,d=>l.jsx(Uu,{present:s||c.open,children:l.jsx(ZS,{asChild:!0,container:r,children:d})}))})};iw.displayName=nm;var vu="DialogOverlay",aw=N.forwardRef((e,t)=>{const s=sw(vu,e.__scopeDialog),{forceMount:a=s.forceMount,...r}=e,c=as(vu,e.__scopeDialog);return c.modal?l.jsx(Uu,{present:a||c.open,children:l.jsx(LO,{...r,ref:t})}):null});aw.displayName=vu;var DO=PS("DialogOverlay.RemoveScroll"),LO=N.forwardRef((e,t)=>{const{__scopeDialog:s,...a}=e,r=as(vu,s);return l.jsx(JS,{as:DO,allowPinchZoom:!0,shards:[r.contentRef],children:l.jsx(Zs.div,{"data-state":im(r.open),...a,ref:t,style:{pointerEvents:"auto",...a.style}})})}),xa="DialogContent",rw=N.forwardRef((e,t)=>{const s=sw(xa,e.__scopeDialog),{forceMount:a=s.forceMount,...r}=e,c=as(xa,e.__scopeDialog);return l.jsx(Uu,{present:a||c.open,children:c.modal?l.jsx(MO,{...r,ref:t}):l.jsx(UO,{...r,ref:t})})});rw.displayName=xa;var MO=N.forwardRef((e,t)=>{const s=as(xa,e.__scopeDialog),a=N.useRef(null),r=ja(t,s.contentRef,a);return N.useEffect(()=>{const c=a.current;if(c)return OO(c)},[]),l.jsx(ow,{...e,ref:r,trapFocus:s.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ai(e.onCloseAutoFocus,c=>{c.preventDefault(),s.triggerRef.current?.focus()}),onPointerDownOutside:Ai(e.onPointerDownOutside,c=>{const d=c.detail.originalEvent,f=d.button===0&&d.ctrlKey===!0;(d.button===2||f)&&c.preventDefault()}),onFocusOutside:Ai(e.onFocusOutside,c=>c.preventDefault())})}),UO=N.forwardRef((e,t)=>{const s=as(xa,e.__scopeDialog),a=N.useRef(!1),r=N.useRef(!1);return l.jsx(ow,{...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()}})}),ow=N.forwardRef((e,t)=>{const{__scopeDialog:s,trapFocus:a,onOpenAutoFocus:r,onCloseAutoFocus:c,...d}=e,f=as(xa,s),m=N.useRef(null),p=ja(t,m);return ZE(),l.jsxs(l.Fragment,{children:[l.jsx(qS,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:r,onUnmountAutoFocus:c,children:l.jsx(IS,{role:"dialog",id:f.contentId,"aria-describedby":f.descriptionId,"aria-labelledby":f.titleId,"data-state":im(f.open),...d,ref:p,onDismiss:()=>f.onOpenChange(!1)})}),l.jsxs(l.Fragment,{children:[l.jsx(PO,{titleId:f.titleId}),l.jsx(IO,{contentRef:m,descriptionId:f.descriptionId})]})]})}),sm="DialogTitle",lw=N.forwardRef((e,t)=>{const{__scopeDialog:s,...a}=e,r=as(sm,s);return l.jsx(Zs.h2,{id:r.titleId,...a,ref:t})});lw.displayName=sm;var cw="DialogDescription",uw=N.forwardRef((e,t)=>{const{__scopeDialog:s,...a}=e,r=as(cw,s);return l.jsx(Zs.p,{id:r.descriptionId,...a,ref:t})});uw.displayName=cw;var dw="DialogClose",fw=N.forwardRef((e,t)=>{const{__scopeDialog:s,...a}=e,r=as(dw,s);return l.jsx(Zs.button,{type:"button",...a,ref:t,onClick:Ai(e.onClick,()=>r.onOpenChange(!1))})});fw.displayName=dw;function im(e){return e?"open":"closed"}var hw="DialogTitleWarning",[X4,pw]=cE(hw,{contentName:xa,titleName:sm,docsSlug:"dialog"}),PO=({titleId:e})=>{const t=pw(hw),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},$O="DialogDescriptionWarning",IO=({contentRef:e,descriptionId:t})=>{const a=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${pw($O).contentName}}.`;return N.useEffect(()=>{const r=e.current?.getAttribute("aria-describedby");t&&r&&(document.getElementById(t)||console.warn(a))},[a,e,t]),null},mw=tw,gw=iw,am=aw,rm=rw,om=lw,yw=uw,vw=fw;const BO=mw,qO=gw,bw=N.forwardRef(({className:e,...t},s)=>l.jsx(am,{ref:s,className:Gn("fixed inset-0 z-50 bg-black/70 backdrop-blur-sm",e),...t}));bw.displayName=am.displayName;const HO=400,ZO=1200,FO=720,xw=N.forwardRef(({className:e,children:t,...s},a)=>{const[r,c]=N.useState(FO),d=N.useRef(!1),f=N.useRef(0),m=N.useRef(0),p=N.useCallback(b=>{d.current=!0,f.current=b.clientX,m.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(ZO,Math.max(HO,m.current+x));c(j)},[]),y=N.useCallback(()=>{d.current=!1},[]);return l.jsxs(qO,{children:[l.jsx(bw,{}),l.jsxs(rm,{ref:a,className:Gn("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:p,onPointerMove:v,onPointerUp:y}),t,l.jsxs(vw,{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(Jp,{className:"size-4"}),l.jsx("span",{className:"sr-only",children:"Close"})]})]})]})});xw.displayName=rm.displayName;const GO=({className:e,...t})=>l.jsx("div",{className:Gn("flex flex-col gap-1.5 pr-10",e),...t}),Sw=N.forwardRef(({className:e,...t},s)=>l.jsx(om,{ref:s,className:Gn("text-lg font-medium text-zinc-50",e),...t}));Sw.displayName=om.displayName;const ww=N.forwardRef(({className:e,...t},s)=>l.jsx(yw,{ref:s,className:Gn("text-sm text-zinc-500",e),...t}));ww.displayName=yw.displayName;function KO({title:e,subtitle:t,children:s,open:a,onClose:r}){return l.jsx(BO,{open:a,onOpenChange:c=>c?void 0:r(),children:l.jsxs(xw,{children:[l.jsxs(GO,{className:"drawer-head",children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:t}),l.jsx(Sw,{id:"drawer-title",children:e}),l.jsx(ww,{className:"sr-only",children:t})]}),l.jsx("div",{className:"drawer-body",children:s})]})})}function X(e,t,s){function a(f,m){if(f._zod||Object.defineProperty(f,"_zod",{value:{def:m,constr:d,traits:new Set},enumerable:!1}),f._zod.traits.has(e))return;f._zod.traits.add(e),t(f,m);const p=d.prototype,v=Object.keys(p);for(let y=0;y<v.length;y++){const b=v[y];b in f||(f[b]=p[b].bind(f))}}const r=s?.Parent??Object;class c extends r{}Object.defineProperty(c,"name",{value:e});function d(f){var m;const p=s?.Parent?new c:this;a(p,f),(m=p._zod).deferred??(m.deferred=[]);for(const v of p._zod.deferred)v();return p}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 Nr extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class jw extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const Nw={};function Li(e){return Nw}function _w(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 hp(e,t){return typeof t=="bigint"?t.toString():t}function lm(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function cm(e){return e==null}function um(e){const t=e.startsWith("^")?1:0,s=e.endsWith("$")?e.length-1:e.length;return e.slice(t,s)}function VO(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 m=a.match(/\d?e-(\d?)/);m?.[1]&&(r=Number.parseInt(m[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 Kb=Symbol("evaluating");function We(e,t,s){let a;Object.defineProperty(e,t,{get(){if(a!==Kb)return a===void 0&&(a=Kb,a=s()),a},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function _a(e,t,s){Object.defineProperty(e,t,{value:s,writable:!0,enumerable:!0,configurable:!0})}function $i(...e){const t={};for(const s of e){const a=Object.getOwnPropertyDescriptors(s);Object.assign(t,a)}return Object.defineProperties({},t)}function Vb(e){return JSON.stringify(e)}function QO(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Cw="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function bu(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const YO=lm(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Er(e){if(bu(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const s=t.prototype;return!(bu(s)===!1||Object.prototype.hasOwnProperty.call(s,"isPrototypeOf")===!1)}function kw(e){return Er(e)?{...e}:Array.isArray(e)?[...e]:e}const XO=new Set(["string","number","symbol"]);function Or(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ii(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 JO(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const WO={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 eR(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=$i(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 _a(this,"shape",d),d},checks:[]});return Ii(e,c)}function tR(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=$i(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 _a(this,"shape",d),d},checks:[]});return Ii(e,c)}function nR(e,t){if(!Er(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=$i(e._zod.def,{get shape(){const c={...e._zod.def.shape,...t};return _a(this,"shape",c),c}});return Ii(e,r)}function sR(e,t){if(!Er(t))throw new Error("Invalid input to safeExtend: expected a plain object");const s=$i(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return _a(this,"shape",a),a}});return Ii(e,s)}function iR(e,t){const s=$i(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t._zod.def.shape};return _a(this,"shape",a),a},get catchall(){return t._zod.def.catchall},checks:[]});return Ii(e,s)}function aR(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=$i(t._zod.def,{get shape(){const f=t._zod.def.shape,m={...f};if(s)for(const p in s){if(!(p in f))throw new Error(`Unrecognized key: "${p}"`);s[p]&&(m[p]=e?new e({type:"optional",innerType:f[p]}):f[p])}else for(const p in f)m[p]=e?new e({type:"optional",innerType:f[p]}):f[p];return _a(this,"shape",m),m},checks:[]});return Ii(t,d)}function rR(e,t,s){const a=$i(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 _a(this,"shape",c),c}});return Ii(t,a)}function vr(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 br(e,t){return t.map(s=>{var a;return(a=s).path??(a.path=[]),s.path.unshift(e),s})}function Ic(e){return typeof e=="string"?e:e?.message}function Mi(e,t,s){const a={...e,path:e.path??[]};if(!e.message){const r=Ic(e.inst?._zod.def?.error?.(e))??Ic(t?.error?.(e))??Ic(s.customError?.(e))??Ic(s.localeError?.(e))??"Invalid input";a.message=r}return delete a.inst,delete a.continue,t?.reportInput||delete a.input,a}function dm(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Wo(...e){const[t,s,a]=e;return typeof t=="string"?{message:t,code:"custom",input:s,inst:a}:{...t}}const zw=(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,hp,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Ew=X("$ZodError",zw),Ow=X("$ZodError",zw,{Parent:Error});function oR(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 lR(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 m=c.path[f];f===c.path.length-1?(d[m]=d[m]||{_errors:[]},d[m]._errors.push(t(c))):d[m]=d[m]||{_errors:[]},d=d[m],f++}}};return a(e),s}const fm=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 Nr;if(d.issues.length){const f=new(r?.Err??e)(d.issues.map(m=>Mi(m,c,Li())));throw Cw(f,r?.callee),f}return d.value},hm=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(m=>Mi(m,c,Li())));throw Cw(f,r?.callee),f}return d.value},Iu=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 Nr;return c.issues.length?{success:!1,error:new(e??Ew)(c.issues.map(d=>Mi(d,r,Li())))}:{success:!0,data:c.value}},cR=Iu(Ow),Bu=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=>Mi(d,r,Li())))}:{success:!0,data:c.value}},uR=Bu(Ow),dR=e=>(t,s,a)=>{const r=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return fm(e)(t,s,r)},fR=e=>(t,s,a)=>fm(e)(t,s,a),hR=e=>async(t,s,a)=>{const r=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return hm(e)(t,s,r)},pR=e=>async(t,s,a)=>hm(e)(t,s,a),mR=e=>(t,s,a)=>{const r=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Iu(e)(t,s,r)},gR=e=>(t,s,a)=>Iu(e)(t,s,a),yR=e=>async(t,s,a)=>{const r=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Bu(e)(t,s,r)},vR=e=>async(t,s,a)=>Bu(e)(t,s,a),bR=/^[cC][^\s-]{8,}$/,xR=/^[0-9a-z]+$/,SR=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,wR=/^[0-9a-vA-V]{20}$/,jR=/^[A-Za-z0-9]{27}$/,NR=/^[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)?)?)$/,CR=/^([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})$/,Qb=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)$/,kR=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,zR="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function ER(){return new RegExp(zR,"u")}const OR=/^(?:(?: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])$/,RR=/^(([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}|:))$/,AR=/^((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])$/,TR=/^(([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])$/,DR=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Rw=/^[A-Za-z0-9_-]*$/,LR=/^\+[1-9]\d{6,14}$/,Aw="(?:(?:\\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])))",MR=new RegExp(`^${Aw}$`);function Tw(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 UR(e){return new RegExp(`^${Tw(e)}$`)}function PR(e){const t=Tw({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(`^${Aw}T(?:${a})$`)}const $R=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},IR=/^-?\d+$/,Dw=/^-?\d+(?:\.\d+)?$/,BR=/^(?:true|false)$/i,qR=/^[^A-Z]*$/,HR=/^[^a-z]*$/,Sn=X("$ZodCheck",(e,t)=>{var s;e._zod??(e._zod={}),e._zod.def=t,(s=e._zod).onattach??(s.onattach=[])}),Lw={number:"number",bigint:"bigint",object:"date"},Mw=X("$ZodCheckLessThan",(e,t)=>{Sn.init(e,t);const s=Lw[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})}}),Uw=X("$ZodCheckGreaterThan",(e,t)=>{Sn.init(e,t);const s=Lw[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})}}),ZR=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):VO(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})}}),FR=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]=WO[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=IR)}),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})}}),GR=X("$ZodCheckMaxLength",(e,t)=>{var s;Sn.init(e,t),(s=e._zod.def).when??(s.when=a=>{const r=a.value;return!cm(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=dm(r);a.issues.push({origin:d,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),KR=X("$ZodCheckMinLength",(e,t)=>{var s;Sn.init(e,t),(s=e._zod.def).when??(s.when=a=>{const r=a.value;return!cm(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=dm(r);a.issues.push({origin:d,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),VR=X("$ZodCheckLengthEquals",(e,t)=>{var s;Sn.init(e,t),(s=e._zod.def).when??(s.when=a=>{const r=a.value;return!cm(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=dm(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})}}),qu=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=()=>{})}),QR=X("$ZodCheckRegex",(e,t)=>{qu.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})}}),YR=X("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=qR),qu.init(e,t)}),XR=X("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=HR),qu.init(e,t)}),JR=X("$ZodCheckIncludes",(e,t)=>{Sn.init(e,t);const s=Or(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})}}),WR=X("$ZodCheckStartsWith",(e,t)=>{Sn.init(e,t);const s=new RegExp(`^${Or(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})}}),eA=X("$ZodCheckEndsWith",(e,t)=>{Sn.init(e,t);const s=new RegExp(`.*${Or(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})}}),tA=X("$ZodCheckOverwrite",(e,t)=>{Sn.init(e,t),e._zod.check=s=>{s.value=t.tx(s.value)}});class nA{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 sA={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=sA;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,m)=>{let p=vr(d),v;for(const y of f){if(y._zod.def.when){if(!y._zod.def.when(d))continue}else if(p)continue;const b=d.issues.length,x=y._zod.check(d);if(x instanceof Promise&&m?.async===!1)throw new Nr;if(v||x instanceof Promise)v=(v??Promise.resolve()).then(async()=>{await x,d.issues.length!==b&&(p||(p=vr(d,b)))});else{if(d.issues.length===b)continue;p||(p=vr(d,b))}}return v?v.then(()=>d):d},c=(d,f,m)=>{if(vr(d))return d.aborted=!0,d;const p=r(f,a,m);if(p instanceof Promise){if(m.async===!1)throw new Nr;return p.then(v=>e._zod.parse(v,m))}return e._zod.parse(p,m)};e._zod.run=(d,f)=>{if(f.skipChecks)return e._zod.parse(d,f);if(f.direction==="backward"){const p=e._zod.parse({value:d.value,issues:[]},{...f,skipChecks:!0});return p instanceof Promise?p.then(v=>c(v,d,f)):c(p,d,f)}const m=e._zod.parse(d,f);if(m instanceof Promise){if(f.async===!1)throw new Nr;return m.then(p=>r(p,a,f))}return r(m,a,f)}}We(e,"~standard",()=>({validate:r=>{try{const c=cR(e,r);return c.success?{value:c.data}:{issues:c.error?.issues}}catch{return uR(e,r).then(d=>d.success?{value:d.data}:{issues:d.error?.issues})}},vendor:"zod",version:1}))}),pm=X("$ZodString",(e,t)=>{vt.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??$R(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)=>{qu.init(e,t),pm.init(e,t)}),iA=X("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=CR),gt.init(e,t)}),aA=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=Qb(a))}else t.pattern??(t.pattern=Qb());gt.init(e,t)}),rA=X("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=kR),gt.init(e,t)}),oA=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})}}}),lA=X("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=ER()),gt.init(e,t)}),cA=X("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=NR),gt.init(e,t)}),uA=X("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=bR),gt.init(e,t)}),dA=X("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=xR),gt.init(e,t)}),fA=X("$ZodULID",(e,t)=>{t.pattern??(t.pattern=SR),gt.init(e,t)}),hA=X("$ZodXID",(e,t)=>{t.pattern??(t.pattern=wR),gt.init(e,t)}),pA=X("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=jR),gt.init(e,t)}),mA=X("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=PR(t)),gt.init(e,t)}),gA=X("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=MR),gt.init(e,t)}),yA=X("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=UR(t)),gt.init(e,t)}),vA=X("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=_R),gt.init(e,t)}),bA=X("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=OR),gt.init(e,t),e._zod.bag.format="ipv4"}),xA=X("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=RR),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})}}}),SA=X("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=AR),gt.init(e,t)}),wA=X("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=TR),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 Pw(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const jA=X("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=DR),gt.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=s=>{Pw(s.value)||s.issues.push({code:"invalid_format",format:"base64",input:s.value,inst:e,continue:!t.abort})}});function NA(e){if(!Rw.test(e))return!1;const t=e.replace(/[-_]/g,a=>a==="-"?"+":"/"),s=t.padEnd(Math.ceil(t.length/4)*4,"=");return Pw(s)}const _A=X("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Rw),gt.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=s=>{NA(s.value)||s.issues.push({code:"invalid_format",format:"base64url",input:s.value,inst:e,continue:!t.abort})}}),CA=X("$ZodE164",(e,t)=>{t.pattern??(t.pattern=LR),gt.init(e,t)});function kA(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 zA=X("$ZodJWT",(e,t)=>{gt.init(e,t),e._zod.check=s=>{kA(s.value,t.alg)||s.issues.push({code:"invalid_format",format:"jwt",input:s.value,inst:e,continue:!t.abort})}}),$w=X("$ZodNumber",(e,t)=>{vt.init(e,t),e._zod.pattern=e._zod.bag.pattern??Dw,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}}),EA=X("$ZodNumberFormat",(e,t)=>{FR.init(e,t),$w.init(e,t)}),OA=X("$ZodBoolean",(e,t)=>{vt.init(e,t),e._zod.pattern=BR,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}}),RA=X("$ZodUnknown",(e,t)=>{vt.init(e,t),e._zod.parse=s=>s}),AA=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 Yb(e,t,s){e.issues.length&&t.issues.push(...br(s,e.issues)),t.value[s]=e.value}const TA=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],m=t.element._zod.run({value:f,issues:[]},a);m instanceof Promise?c.push(m.then(p=>Yb(p,s,d))):Yb(m,s,d)}return c.length?Promise.all(c).then(()=>s):s}});function xu(e,t,s,a,r){if(e.issues.length){if(r&&!(s in a))return;t.issues.push(...br(s,e.issues))}e.value===void 0?s in a&&(t.value[s]=void 0):t.value[s]=e.value}function Iw(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=JO(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(s)}}function Bw(e,t,s,a,r,c){const d=[],f=r.keySet,m=r.catchall._zod,p=m.def.type,v=m.optout==="optional";for(const y in t){if(f.has(y))continue;if(p==="never"){d.push(y);continue}const b=m.run({value:t[y],issues:[]},a);b instanceof Promise?e.push(b.then(x=>xu(x,s,y,t,v))):xu(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 DA=X("$ZodObject",(e,t)=>{if(vt.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const f=t.shape;Object.defineProperty(t,"shape",{get:()=>{const m={...f};return Object.defineProperty(t,"shape",{value:m}),m}})}const a=lm(()=>Iw(t));We(e._zod,"propValues",()=>{const f=t.shape,m={};for(const p in f){const v=f[p]._zod;if(v.values){m[p]??(m[p]=new Set);for(const y of v.values)m[p].add(y)}}return m});const r=bu,c=t.catchall;let d;e._zod.parse=(f,m)=>{d??(d=a.value);const p=f.value;if(!r(p))return f.issues.push({expected:"object",code:"invalid_type",input:p,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:p[b],issues:[]},m);w instanceof Promise?v.push(w.then(_=>xu(_,f,b,p,j))):xu(w,f,b,p,j)}return c?Bw(v,p,f,m,a.value,e):v.length?Promise.all(v).then(()=>f):f}}),LA=X("$ZodObjectJIT",(e,t)=>{DA.init(e,t);const s=e._zod.parse,a=lm(()=>Iw(t)),r=b=>{const x=new nA(["shape","payload","ctx"]),j=a.value,w=O=>{const z=Vb(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=Vb(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=bu,f=!Nw.jitless,p=f&&YO.value,v=t.catchall;let y;e._zod.parse=(b,x)=>{y??(y=a.value);const j=b.value;return d(j)?f&&p&&x?.async===!1&&x.jitless!==!0?(c||(c=r(t.shape)),b=c(b,x),v?Bw([],j,b,x,y,e):b):s(b,x):(b.issues.push({expected:"object",code:"invalid_type",input:j,inst:e}),b)}});function Xb(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=>!vr(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=>Mi(d,a,Li())))}),t)}const MA=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=>um(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 m of t.options){const p=m._zod.run({value:r.value,issues:[]},c);if(p instanceof Promise)f.push(p),d=!0;else{if(p.issues.length===0)return p;f.push(p)}}return d?Promise.all(f).then(m=>Xb(m,r,e,c)):Xb(f,r,e,c)}}),UA=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(([m,p])=>Jb(s,m,p)):Jb(s,c,d)}});function pp(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(Er(e)&&Er(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=pp(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=pp(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 Jb(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 m of f.keys)a.has(m)||a.set(m,{}),a.get(m).l=!0}else e.issues.push(f);for(const f of s.issues)if(f.code==="unrecognized_keys")for(const m of f.keys)a.has(m)||a.set(m,{}),a.get(m).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}),vr(e))return e;const d=pp(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 PA=X("$ZodRecord",(e,t)=>{vt.init(e,t),e._zod.parse=(s,a)=>{const r=s.value;if(!Er(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 p of d)if(typeof p=="string"||typeof p=="number"||typeof p=="symbol"){f.add(typeof p=="number"?p.toString():p);const v=t.valueType._zod.run({value:r[p],issues:[]},a);v instanceof Promise?c.push(v.then(y=>{y.issues.length&&s.issues.push(...br(p,y.issues)),s.value[p]=y.value})):(v.issues.length&&s.issues.push(...br(p,v.issues)),s.value[p]=v.value)}let m;for(const p in r)f.has(p)||(m=m??[],m.push(p));m&&m.length>0&&s.issues.push({code:"unrecognized_keys",input:r,inst:e,keys:m})}else{s.value={};for(const f of Reflect.ownKeys(r)){if(f==="__proto__")continue;let m=t.keyType._zod.run({value:f,issues:[]},a);if(m instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof f=="string"&&Dw.test(f)&&m.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&&(m=y)}if(m.issues.length){t.mode==="loose"?s.value[f]=r[f]:s.issues.push({code:"invalid_key",origin:"record",issues:m.issues.map(y=>Mi(y,a,Li())),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(...br(f,y.issues)),s.value[m.value]=y.value})):(v.issues.length&&s.issues.push(...br(f,v.issues)),s.value[m.value]=v.value)}}return c.length?Promise.all(c).then(()=>s):s}}),$A=X("$ZodEnum",(e,t)=>{vt.init(e,t);const s=_w(t.entries),a=new Set(s);e._zod.values=a,e._zod.pattern=new RegExp(`^(${s.filter(r=>XO.has(typeof r)).map(r=>typeof r=="string"?Or(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}}),IA=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"?Or(a):a?Or(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}}),BA=X("$ZodTransform",(e,t)=>{vt.init(e,t),e._zod.parse=(s,a)=>{if(a.direction==="backward")throw new jw(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 Nr;return s.value=r,s}});function Wb(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const qw=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(`^(${um(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=>Wb(c,s.value)):Wb(r,s.value)}return s.value===void 0?s:t.innerType._zod.run(s,a)}}),qA=X("$ZodExactOptional",(e,t)=>{qw.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)}),HA=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(`^(${um(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)}),ZA=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=>ex(c,t)):ex(r,t)}});function ex(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const FA=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))}),GA=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=>tx(c,e)):tx(r,e)}});function tx(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 KA=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=>Mi(d,a,Li()))},input:s.value}),s.issues=[]),s)):(s.value=r.value,r.issues.length&&(s.value=t.catchValue({...s,error:{issues:r.issues.map(c=>Mi(c,a,Li()))},input:s.value}),s.issues=[]),s)}}),VA=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=>Bc(d,t.in,a)):Bc(c,t.in,a)}const r=t.in._zod.run(s,a);return r instanceof Promise?r.then(c=>Bc(c,t.out,a)):Bc(r,t.out,a)}});function Bc(e,t,s){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},s)}const QA=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(nx):nx(r)}});function nx(e){return e.value=Object.freeze(e.value),e}const YA=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=>sx(c,s,a,e));sx(r,s,a,e)}});function sx(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(Wo(r))}}var ix;class XA{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 JA(){return new XA}(ix=globalThis).__zod_globalRegistry??(ix.__zod_globalRegistry=JA());const Uo=globalThis.__zod_globalRegistry;function WA(e,t){return new e({type:"string",...Se(t)})}function eT(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Se(t)})}function ax(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Se(t)})}function tT(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Se(t)})}function nT(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Se(t)})}function sT(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Se(t)})}function iT(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Se(t)})}function aT(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Se(t)})}function rT(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Se(t)})}function oT(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Se(t)})}function lT(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Se(t)})}function cT(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Se(t)})}function uT(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Se(t)})}function dT(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Se(t)})}function fT(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Se(t)})}function hT(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Se(t)})}function pT(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Se(t)})}function mT(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Se(t)})}function gT(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Se(t)})}function yT(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Se(t)})}function vT(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Se(t)})}function bT(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Se(t)})}function xT(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Se(t)})}function ST(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Se(t)})}function wT(e,t){return new e({type:"string",format:"date",check:"string_format",...Se(t)})}function jT(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Se(t)})}function NT(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 CT(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Se(t)})}function kT(e,t){return new e({type:"boolean",...Se(t)})}function zT(e){return new e({type:"unknown"})}function ET(e,t){return new e({type:"never",...Se(t)})}function rx(e,t){return new Mw({check:"less_than",...Se(t),value:e,inclusive:!1})}function Bh(e,t){return new Mw({check:"less_than",...Se(t),value:e,inclusive:!0})}function ox(e,t){return new Uw({check:"greater_than",...Se(t),value:e,inclusive:!1})}function qh(e,t){return new Uw({check:"greater_than",...Se(t),value:e,inclusive:!0})}function lx(e,t){return new ZR({check:"multiple_of",...Se(t),value:e})}function Hw(e,t){return new GR({check:"max_length",...Se(t),maximum:e})}function Su(e,t){return new KR({check:"min_length",...Se(t),minimum:e})}function Zw(e,t){return new VR({check:"length_equals",...Se(t),length:e})}function OT(e,t){return new QR({check:"string_format",format:"regex",...Se(t),pattern:e})}function RT(e){return new YR({check:"string_format",format:"lowercase",...Se(e)})}function AT(e){return new XR({check:"string_format",format:"uppercase",...Se(e)})}function TT(e,t){return new JR({check:"string_format",format:"includes",...Se(t),includes:e})}function DT(e,t){return new WR({check:"string_format",format:"starts_with",...Se(t),prefix:e})}function LT(e,t){return new eA({check:"string_format",format:"ends_with",...Se(t),suffix:e})}function Dr(e){return new tA({check:"overwrite",tx:e})}function MT(e){return Dr(t=>t.normalize(e))}function UT(){return Dr(e=>e.trim())}function PT(){return Dr(e=>e.toLowerCase())}function $T(){return Dr(e=>e.toUpperCase())}function IT(){return Dr(e=>QO(e))}function BT(e,t,s){return new e({type:"array",element:t,...Se(s)})}function qT(e,t,s){return new e({type:"custom",check:"custom",fn:t,...Se(s)})}function HT(e){const t=ZT(s=>(s.addIssue=a=>{if(typeof a=="string")s.issues.push(Wo(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(Wo(r))}},e(s.value,s)));return t}function ZT(e,t){const s=new Sn({check:"custom",...Se(t)});return s._zod.check=e,s}function Fw(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??Uo,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 m=t.metadataRegistry.get(e);return m&&Object.assign(d.schema,m),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 Gw(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 m=a.get(f);if(m&&m!==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 p=`#/${f}/`,v=d[1].schema.id??`__schema${e.counter++}`;return{defId:v,ref:p+v}},c=d=>{if(d[1].schema.$ref)return;const f=d[1],{ref:m,defId:p}=r(d);f.def={...f.schema},p&&(f.defId=p);const v=f.schema;for(const y in v)delete v[y];v.$ref=m};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 p=e.external.registry.get(d[0])?.id;if(t!==d[0]&&p){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 Kw(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 m=f.def??f.schema,p={...m},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")?(m.allOf=m.allOf??[],m.allOf.push(x)):Object.assign(m,x),Object.assign(m,p),d._zod.parent===v)for(const w in m)w==="$ref"||w==="allOf"||w in p||delete m[w];if(x.$ref&&b.def)for(const w in m)w==="$ref"||w==="allOf"||w in b.def&&JSON.stringify(m[w])===JSON.stringify(b.def[w])&&delete m[w]}const y=d._zod.parent;if(y&&y!==v){a(y);const b=e.seen.get(y);if(b?.schema.$ref&&(m.$ref=b.schema.$ref,b.def))for(const x in m)x==="$ref"||x==="allOf"||x in b.def&&JSON.stringify(m[x])===JSON.stringify(b.def[x])&&delete m[x]}e.override({zodSchema:d,jsonSchema:m,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:wu(t,"input",e.processors),output:wu(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 FT=(e,t={})=>s=>{const a=Fw({...s,processors:t});return Bt(e,a),Gw(a,e),Kw(a,e)},wu=(e,t,s={})=>a=>{const{libraryOptions:r,target:c}=a??{},d=Fw({...r??{},target:c,io:t,processors:s});return Bt(e,d),Gw(d,e),Kw(d,e)},GT={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},KT=(e,t,s,a)=>{const r=s;r.type="string";const{minimum:c,maximum:d,format:f,patterns:m,contentEncoding:p}=e._zod.bag;if(typeof c=="number"&&(r.minLength=c),typeof d=="number"&&(r.maxLength=d),f&&(r.format=GT[f]??f,r.format===""&&delete r.format,f==="time"&&delete r.format),p&&(r.contentEncoding=p),m&&m.size>0){const v=[...m];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}))])}},VT=(e,t,s,a)=>{const r=s,{minimum:c,maximum:d,format:f,multipleOf:m,exclusiveMaximum:p,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 p=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(r.maximum=p,r.exclusiveMaximum=!0):r.exclusiveMaximum=p),typeof d=="number"&&(r.maximum=d,typeof p=="number"&&t.target!=="draft-04"&&(p<=d?delete r.maximum:delete r.exclusiveMaximum)),typeof m=="number"&&(r.multipleOf=m)},QT=(e,t,s,a)=>{s.type="boolean"},YT=(e,t,s,a)=>{s.not={}},XT=(e,t,s,a)=>{},JT=(e,t,s,a)=>{const r=e._zod.def,c=_w(r.entries);c.every(d=>typeof d=="number")&&(s.type="number"),c.every(d=>typeof d=="string")&&(s.type="string"),s.enum=c},WT=(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},eD=(e,t,s,a)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},tD=(e,t,s,a)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},nD=(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"]})},sD=(e,t,s,a)=>{const r=s,c=e._zod.def;r.type="object",r.properties={};const d=c.shape;for(const p in d)r.properties[p]=Bt(d[p],t,{...a,path:[...a.path,"properties",p]});const f=new Set(Object.keys(d)),m=new Set([...f].filter(p=>{const v=c.shape[p]._zod;return t.io==="input"?v.optin===void 0:v.optout===void 0}));m.size>0&&(r.required=Array.from(m)),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)},iD=(e,t,s,a)=>{const r=e._zod.def,c=r.inclusive===!1,d=r.options.map((f,m)=>Bt(f,t,{...a,path:[...a.path,c?"oneOf":"anyOf",m]}));c?s.oneOf=d:s.anyOf=d},aD=(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=p=>"allOf"in p&&Object.keys(p).length===1,m=[...f(c)?c.allOf:[c],...f(d)?d.allOf:[d]];s.allOf=m},rD=(e,t,s,a)=>{const r=s,c=e._zod.def;r.type="object";const d=c.keyType,m=d._zod.bag?.patterns;if(c.mode==="loose"&&m&&m.size>0){const v=Bt(c.valueType,t,{...a,path:[...a.path,"patternProperties","*"]});r.patternProperties={};for(const y of m)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 p=d._zod.values;if(p){const v=[...p].filter(y=>typeof y=="string"||typeof y=="number");v.length>0&&(r.required=v)}},oD=(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"}]},lD=(e,t,s,a)=>{const r=e._zod.def;Bt(r.innerType,t,a);const c=t.seen.get(e);c.ref=r.innerType},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.default=JSON.parse(JSON.stringify(r.defaultValue))},uD=(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)))},dD=(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},fD=(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},hD=(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},Vw=(e,t,s,a)=>{const r=e._zod.def;Bt(r.innerType,t,a);const c=t.seen.get(e);c.ref=r.innerType},pD=X("ZodISODateTime",(e,t)=>{mA.init(e,t),xt.init(e,t)});function mD(e){return ST(pD,e)}const gD=X("ZodISODate",(e,t)=>{gA.init(e,t),xt.init(e,t)});function yD(e){return wT(gD,e)}const vD=X("ZodISOTime",(e,t)=>{yA.init(e,t),xt.init(e,t)});function bD(e){return jT(vD,e)}const xD=X("ZodISODuration",(e,t)=>{vA.init(e,t),xt.init(e,t)});function SD(e){return NT(xD,e)}const wD=(e,t)=>{Ew.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:s=>lR(e,s)},flatten:{value:s=>oR(e,s)},addIssue:{value:s=>{e.issues.push(s),e.message=JSON.stringify(e.issues,hp,2)}},addIssues:{value:s=>{e.issues.push(...s),e.message=JSON.stringify(e.issues,hp,2)}},isEmpty:{get(){return e.issues.length===0}}})},Kn=X("ZodError",wD,{Parent:Error}),jD=fm(Kn),ND=hm(Kn),_D=Iu(Kn),CD=Bu(Kn),kD=dR(Kn),zD=fR(Kn),ED=hR(Kn),OD=pR(Kn),RD=mR(Kn),AD=gR(Kn),TD=yR(Kn),DD=vR(Kn),bt=X("ZodType",(e,t)=>(vt.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:wu(e,"input"),output:wu(e,"output")}}),e.toJSONSchema=FT(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...s)=>e.clone($i(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)=>Ii(e,s,a),e.brand=()=>e,e.register=((s,a)=>(s.add(e,a),e)),e.parse=(s,a)=>jD(e,s,a,{callee:e.parse}),e.safeParse=(s,a)=>_D(e,s,a),e.parseAsync=async(s,a)=>ND(e,s,a,{callee:e.parseAsync}),e.safeParseAsync=async(s,a)=>CD(e,s,a),e.spa=e.safeParseAsync,e.encode=(s,a)=>kD(e,s,a),e.decode=(s,a)=>zD(e,s,a),e.encodeAsync=async(s,a)=>ED(e,s,a),e.decodeAsync=async(s,a)=>OD(e,s,a),e.safeEncode=(s,a)=>RD(e,s,a),e.safeDecode=(s,a)=>AD(e,s,a),e.safeEncodeAsync=async(s,a)=>TD(e,s,a),e.safeDecodeAsync=async(s,a)=>DD(e,s,a),e.refine=(s,a)=>e.check(zL(s,a)),e.superRefine=s=>e.check(EL(s)),e.overwrite=s=>e.check(Dr(s)),e.optional=()=>dx(e),e.exactOptional=()=>mL(e),e.nullable=()=>fx(e),e.nullish=()=>dx(fx(e)),e.nonoptional=s=>SL(e,s),e.array=()=>dt(e),e.or=s=>oL([e,s]),e.and=s=>cL(e,s),e.transform=s=>hx(e,hL(s)),e.default=s=>vL(e,s),e.prefault=s=>xL(e,s),e.catch=s=>jL(e,s),e.pipe=s=>hx(e,s),e.readonly=()=>CL(e),e.describe=s=>{const a=e.clone();return Uo.add(a,{description:s}),a},Object.defineProperty(e,"description",{get(){return Uo.get(e)?.description},configurable:!0}),e.meta=(...s)=>{if(s.length===0)return Uo.get(e);const a=e.clone();return Uo.add(a,s[0]),a},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=s=>s(e),e)),Qw=X("_ZodString",(e,t)=>{pm.init(e,t),bt.init(e,t),e._zod.processJSONSchema=(a,r,c)=>KT(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(OT(...a)),e.includes=(...a)=>e.check(TT(...a)),e.startsWith=(...a)=>e.check(DT(...a)),e.endsWith=(...a)=>e.check(LT(...a)),e.min=(...a)=>e.check(Su(...a)),e.max=(...a)=>e.check(Hw(...a)),e.length=(...a)=>e.check(Zw(...a)),e.nonempty=(...a)=>e.check(Su(1,...a)),e.lowercase=a=>e.check(RT(a)),e.uppercase=a=>e.check(AT(a)),e.trim=()=>e.check(UT()),e.normalize=(...a)=>e.check(MT(...a)),e.toLowerCase=()=>e.check(PT()),e.toUpperCase=()=>e.check($T()),e.slugify=()=>e.check(IT())}),LD=X("ZodString",(e,t)=>{pm.init(e,t),Qw.init(e,t),e.email=s=>e.check(eT(MD,s)),e.url=s=>e.check(aT(UD,s)),e.jwt=s=>e.check(xT(JD,s)),e.emoji=s=>e.check(rT(PD,s)),e.guid=s=>e.check(ax(cx,s)),e.uuid=s=>e.check(tT(qc,s)),e.uuidv4=s=>e.check(nT(qc,s)),e.uuidv6=s=>e.check(sT(qc,s)),e.uuidv7=s=>e.check(iT(qc,s)),e.nanoid=s=>e.check(oT($D,s)),e.guid=s=>e.check(ax(cx,s)),e.cuid=s=>e.check(lT(ID,s)),e.cuid2=s=>e.check(cT(BD,s)),e.ulid=s=>e.check(uT(qD,s)),e.base64=s=>e.check(yT(QD,s)),e.base64url=s=>e.check(vT(YD,s)),e.xid=s=>e.check(dT(HD,s)),e.ksuid=s=>e.check(fT(ZD,s)),e.ipv4=s=>e.check(hT(FD,s)),e.ipv6=s=>e.check(pT(GD,s)),e.cidrv4=s=>e.check(mT(KD,s)),e.cidrv6=s=>e.check(gT(VD,s)),e.e164=s=>e.check(bT(XD,s)),e.datetime=s=>e.check(mD(s)),e.date=s=>e.check(yD(s)),e.time=s=>e.check(bD(s)),e.duration=s=>e.check(SD(s))});function W(e){return WA(LD,e)}const xt=X("ZodStringFormat",(e,t)=>{gt.init(e,t),Qw.init(e,t)}),MD=X("ZodEmail",(e,t)=>{rA.init(e,t),xt.init(e,t)}),cx=X("ZodGUID",(e,t)=>{iA.init(e,t),xt.init(e,t)}),qc=X("ZodUUID",(e,t)=>{aA.init(e,t),xt.init(e,t)}),UD=X("ZodURL",(e,t)=>{oA.init(e,t),xt.init(e,t)}),PD=X("ZodEmoji",(e,t)=>{lA.init(e,t),xt.init(e,t)}),$D=X("ZodNanoID",(e,t)=>{cA.init(e,t),xt.init(e,t)}),ID=X("ZodCUID",(e,t)=>{uA.init(e,t),xt.init(e,t)}),BD=X("ZodCUID2",(e,t)=>{dA.init(e,t),xt.init(e,t)}),qD=X("ZodULID",(e,t)=>{fA.init(e,t),xt.init(e,t)}),HD=X("ZodXID",(e,t)=>{hA.init(e,t),xt.init(e,t)}),ZD=X("ZodKSUID",(e,t)=>{pA.init(e,t),xt.init(e,t)}),FD=X("ZodIPv4",(e,t)=>{bA.init(e,t),xt.init(e,t)}),GD=X("ZodIPv6",(e,t)=>{xA.init(e,t),xt.init(e,t)}),KD=X("ZodCIDRv4",(e,t)=>{SA.init(e,t),xt.init(e,t)}),VD=X("ZodCIDRv6",(e,t)=>{wA.init(e,t),xt.init(e,t)}),QD=X("ZodBase64",(e,t)=>{jA.init(e,t),xt.init(e,t)}),YD=X("ZodBase64URL",(e,t)=>{_A.init(e,t),xt.init(e,t)}),XD=X("ZodE164",(e,t)=>{CA.init(e,t),xt.init(e,t)}),JD=X("ZodJWT",(e,t)=>{zA.init(e,t),xt.init(e,t)}),Yw=X("ZodNumber",(e,t)=>{$w.init(e,t),bt.init(e,t),e._zod.processJSONSchema=(a,r,c)=>VT(e,a,r),e.gt=(a,r)=>e.check(ox(a,r)),e.gte=(a,r)=>e.check(qh(a,r)),e.min=(a,r)=>e.check(qh(a,r)),e.lt=(a,r)=>e.check(rx(a,r)),e.lte=(a,r)=>e.check(Bh(a,r)),e.max=(a,r)=>e.check(Bh(a,r)),e.int=a=>e.check(ux(a)),e.safe=a=>e.check(ux(a)),e.positive=a=>e.check(ox(0,a)),e.nonnegative=a=>e.check(qh(0,a)),e.negative=a=>e.check(rx(0,a)),e.nonpositive=a=>e.check(Bh(0,a)),e.multipleOf=(a,r)=>e.check(lx(a,r)),e.step=(a,r)=>e.check(lx(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(Yw,e)}const WD=X("ZodNumberFormat",(e,t)=>{EA.init(e,t),Yw.init(e,t)});function ux(e){return CT(WD,e)}const eL=X("ZodBoolean",(e,t)=>{OA.init(e,t),bt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>QT(e,s,a)});function mm(e){return kT(eL,e)}const tL=X("ZodUnknown",(e,t)=>{RA.init(e,t),bt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>XT()});function mp(){return zT(tL)}const nL=X("ZodNever",(e,t)=>{AA.init(e,t),bt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>YT(e,s,a)});function sL(e){return ET(nL,e)}const iL=X("ZodArray",(e,t)=>{TA.init(e,t),bt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>nD(e,s,a,r),e.element=t.element,e.min=(s,a)=>e.check(Su(s,a)),e.nonempty=s=>e.check(Su(1,s)),e.max=(s,a)=>e.check(Hw(s,a)),e.length=(s,a)=>e.check(Zw(s,a)),e.unwrap=()=>e.element});function dt(e,t){return BT(iL,e,t)}const aL=X("ZodObject",(e,t)=>{LA.init(e,t),bt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>sD(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:mp()}),e.loose=()=>e.clone({...e._zod.def,catchall:mp()}),e.strict=()=>e.clone({...e._zod.def,catchall:sL()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=s=>nR(e,s),e.safeExtend=s=>sR(e,s),e.merge=s=>iR(e,s),e.pick=s=>eR(e,s),e.omit=s=>tR(e,s),e.partial=(...s)=>aR(Xw,e,s[0]),e.required=(...s)=>rR(Jw,e,s[0])});function rt(e,t){const s={type:"object",shape:e??{},...Se(t)};return new aL(s)}const rL=X("ZodUnion",(e,t)=>{MA.init(e,t),bt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>iD(e,s,a,r),e.options=t.options});function oL(e,t){return new rL({type:"union",options:e,...Se(t)})}const lL=X("ZodIntersection",(e,t)=>{UA.init(e,t),bt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>aD(e,s,a,r)});function cL(e,t){return new lL({type:"intersection",left:e,right:t})}const uL=X("ZodRecord",(e,t)=>{PA.init(e,t),bt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>rD(e,s,a,r),e.keyType=t.keyType,e.valueType=t.valueType});function gm(e,t,s){return new uL({type:"record",keyType:e,valueType:t,...Se(s)})}const gp=X("ZodEnum",(e,t)=>{$A.init(e,t),bt.init(e,t),e._zod.processJSONSchema=(a,r,c)=>JT(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 gp({...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 gp({...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 gp({type:"enum",entries:s,...Se(t)})}const dL=X("ZodLiteral",(e,t)=>{IA.init(e,t),bt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>WT(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 ju(e,t){return new dL({type:"literal",values:Array.isArray(e)?e:[e],...Se(t)})}const fL=X("ZodTransform",(e,t)=>{BA.init(e,t),bt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>tD(e,s),e._zod.parse=(s,a)=>{if(a.direction==="backward")throw new jw(e.constructor.name);s.addIssue=c=>{if(typeof c=="string")s.issues.push(Wo(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(Wo(d))}};const r=t.transform(s.value,s);return r instanceof Promise?r.then(c=>(s.value=c,s)):(s.value=r,s)}});function hL(e){return new fL({type:"transform",transform:e})}const Xw=X("ZodOptional",(e,t)=>{qw.init(e,t),bt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>Vw(e,s,a,r),e.unwrap=()=>e._zod.def.innerType});function dx(e){return new Xw({type:"optional",innerType:e})}const pL=X("ZodExactOptional",(e,t)=>{qA.init(e,t),bt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>Vw(e,s,a,r),e.unwrap=()=>e._zod.def.innerType});function mL(e){return new pL({type:"optional",innerType:e})}const gL=X("ZodNullable",(e,t)=>{HA.init(e,t),bt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>oD(e,s,a,r),e.unwrap=()=>e._zod.def.innerType});function fx(e){return new gL({type:"nullable",innerType:e})}const yL=X("ZodDefault",(e,t)=>{ZA.init(e,t),bt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>cD(e,s,a,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function vL(e,t){return new yL({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():kw(t)}})}const bL=X("ZodPrefault",(e,t)=>{FA.init(e,t),bt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>uD(e,s,a,r),e.unwrap=()=>e._zod.def.innerType});function xL(e,t){return new bL({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():kw(t)}})}const Jw=X("ZodNonOptional",(e,t)=>{GA.init(e,t),bt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>lD(e,s,a,r),e.unwrap=()=>e._zod.def.innerType});function SL(e,t){return new Jw({type:"nonoptional",innerType:e,...Se(t)})}const wL=X("ZodCatch",(e,t)=>{KA.init(e,t),bt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>dD(e,s,a,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function jL(e,t){return new wL({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const NL=X("ZodPipe",(e,t)=>{VA.init(e,t),bt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>fD(e,s,a,r),e.in=t.in,e.out=t.out});function hx(e,t){return new NL({type:"pipe",in:e,out:t})}const _L=X("ZodReadonly",(e,t)=>{QA.init(e,t),bt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>hD(e,s,a,r),e.unwrap=()=>e._zod.def.innerType});function CL(e){return new _L({type:"readonly",innerType:e})}const kL=X("ZodCustom",(e,t)=>{YA.init(e,t),bt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>eD(e,s)});function zL(e,t={}){return qT(kL,e,t)}function EL(e){return HT(e)}rt({maxConcurrency:Jt().int().positive(),maxRequestsPerMinute:Jt().int().positive(),maxRequestsPerDay:Jt().int().positive()});const OL=["gemini","openai","claude","local","cdp:chatgpt"],Hu=xn(OL),Ww=rt({label:W().min(1),city:W().min(1),region:W().min(1),country:W().length(2),timezone:W().optional()}),ej=xn(["citation.lost","citation.gained","run.completed","run.failed"]);rt({id:W(),projectId:W(),channel:ju("webhook"),url:W().url(),events:dt(ej),enabled:mm().default(!0),webhookSecret:W().optional(),createdAt:W(),updatedAt:W()});const RL=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:gm(W(),W()).optional().default({})}),AL=rt({preset:W().optional(),cron:W().optional(),timezone:W().optional().default("UTC"),providers:dt(Hu).optional().default([])}).refine(e=>e.preset&&!e.cron||!e.preset&&e.cron,{message:'Exactly one of "preset" or "cron" must be provided'}).optional(),TL=rt({channel:ju("webhook"),url:W().url(),events:dt(ej).min(1)}),DL=rt({gsc:rt({propertyUrl:W()}).optional(),syncSchedule:rt({preset:W().optional(),cron:W().optional()}).optional()}).optional(),LL=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(Hu).optional().default([]),locations:dt(Ww).optional().default([]),defaultLocation:W().optional(),schedule:AL,notifications:dt(TL).optional().default([]),google:DL});rt({apiVersion:ju("canonry/v1"),kind:ju("Project"),metadata:RL,spec:LL});const ML=xn(["gsc","ga4"]);rt({id:W(),domain:W(),connectionType:ML,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 yp=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:mm().nullable().optional(),richResults:dt(W()).default([]),inspectedAt:W()});xn(["stable","reindexed","deindexed","still-missing","new"]);const UL=rt({url:W(),previousState:W().nullable(),currentState:W().nullable(),transitionDate:W()}),PL=rt({reason:W(),count:Jt(),urls:dt(yp).default([])});rt({summary:rt({total:Jt(),indexed:Jt(),notIndexed:Jt(),deindexed:Jt(),percentage:Jt()}),lastInspectedAt:W().nullable(),indexed:dt(yp).default([]),notIndexed:dt(yp).default([]),deindexed:dt(UL).default([]),reasonGroups:dt(PL).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:gm(W(),Jt()).default({})});const $L=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:gm(W(),W()).default({}),locations:dt(Ww).default([]),defaultLocation:W().nullable().optional(),configSource:$L.default("cli"),configRevision:Jt().int().positive().default(1),createdAt:W().optional(),updatedAt:W().optional()});function vp(e){let t=e.trim().toLowerCase();try{t.includes("://")&&(t=new URL(t).hostname.toLowerCase())}catch{}return t.replace(/^www\./,"")}function IL(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=vp(c);s.has(d)||(s.add(d),a.push(c))}return a}const BL=xn(["queued","running","completed","partial","failed"]),qL=xn(["answer-visibility","site-audit","gsc-sync","inspect-sitemap"]),HL=xn(["manual","scheduled","config-apply"]),ZL=xn(["cited","not-cited"]),FL=xn(["new","cited","lost","emerging","not-cited"]);rt({id:W(),projectId:W(),kind:qL,status:BL,trigger:HL.default("manual"),location:W().nullable().optional(),startedAt:W().nullable().optional(),finishedAt:W().nullable().optional(),error:W().nullable().optional(),createdAt:W()});const GL=rt({uri:W(),title:W()});rt({id:W(),runId:W(),keywordId:W(),keyword:W().optional(),provider:Hu,citationState:ZL,transition:FL.optional(),answerText:W().nullable().optional(),citedDomains:dt(W()).default([]),competitorOverlap:dt(W()).default([]),groundingSources:dt(GL).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:mp().optional(),createdAt:W()});rt({id:W(),projectId:W(),cronExpr:W(),preset:W().nullable().optional(),timezone:W().default("UTC"),enabled:mm().default(!0),providers:dt(Hu).default([]),lastRunAt:W().nullable().optional(),nextRunAt:W().nullable().optional(),createdAt:W(),updatedAt:W()});function bp({state:e}){return l.jsx(yt,{tone:oE(e),children:Lu(e)})}function px(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"?ts.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((p,v)=>p?v%2===1?d.type==="bold"?ts.createElement("mark",{key:`hl-${f}-${v}`,className:"answer-highlight"},ts.createElement("strong",{className:"text-zinc-200 font-semibold"},p)):ts.createElement("mark",{key:`hl-${f}-${v}`,className:"answer-highlight"},p):d.type==="bold"?ts.createElement("strong",{key:`b-${f}-${v}`,className:"text-zinc-200 font-semibold"},p):p:null)).filter(Boolean)}function KL(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,"")+"/api/v1":"/api/v1"}const VL=KL();function QL(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.apiKey?window.__CANONRY_CONFIG__.apiKey:""}async function Ne(e,t){const s=QL(),a=await fetch(`${VL}${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}`;if(r)try{const d=JSON.parse(r);typeof d.error=="string"?c=d.error:d.error?.message?c=d.error.message:d.message&&(c=d.message)}catch{c=r}throw new Error(c)}if(a.status!==204)return a.json()}function tj(){return Ne("/projects")}function ym(e){return Ne(`/projects/${encodeURIComponent(e)}`)}function nj(){return Ne("/runs")}function el(e){return Ne(`/runs/${encodeURIComponent(e)}`)}function sj(e){return Ne(`/projects/${encodeURIComponent(e)}/keywords`)}function vm(e){return Ne(`/projects/${encodeURIComponent(e)}/competitors`)}function bm(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 il(e,t){return Ne(`/projects/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}function ij(e,t){return Ne(`/projects/${encodeURIComponent(e)}/keywords`,{method:"PUT",body:JSON.stringify({keywords:t})})}function aj(e,t){return Ne(`/projects/${encodeURIComponent(e)}/keywords`,{method:"POST",body:JSON.stringify({keywords:t})})}function xm(e,t){return Ne(`/projects/${encodeURIComponent(e)}/competitors`,{method:"PUT",body:JSON.stringify({competitors:t})})}async function xp(e,t){const s=await ym(e);return il(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 rj(e,t){const s=await ym(e);return il(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 Sm(e,t){const s={};return Ne(`/projects/${encodeURIComponent(e)}/runs`,{method:"POST",body:JSON.stringify(s)})}function oj(e,t){return Ne(`/projects/${encodeURIComponent(e)}/locations`,{method:"POST",body:JSON.stringify(t)})}async function lj(e,t){await Ne(`/projects/${encodeURIComponent(e)}/locations/${encodeURIComponent(t)}`,{method:"DELETE"})}function cj(e,t){return Ne(`/projects/${encodeURIComponent(e)}/locations/default`,{method:"PUT",body:JSON.stringify({label:t})})}async function uj(e){await Ne(`/projects/${encodeURIComponent(e)}`,{method:"DELETE",body:"{}"})}function dj(e){return Ne(`/projects/${encodeURIComponent(e)}/export`)}function wm(){return Ne("/settings")}function fj(e,t){return Ne(`/settings/providers/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}function hj(e){return Ne("/settings/google",{method:"PUT",body:JSON.stringify(e)})}async function pj(e){try{return await Ne(`/projects/${encodeURIComponent(e)}/schedule`)}catch(t){if(t instanceof Error&&t.message.includes("404"))return null;throw t}}function Sp(e,t){return Ne(`/projects/${encodeURIComponent(e)}/schedule`,{method:"PUT",body:JSON.stringify(t)})}async function mj(e){await Ne(`/projects/${encodeURIComponent(e)}/schedule`,{method:"DELETE",body:"{}"})}function gj(e){return Ne(`/projects/${encodeURIComponent(e)}/notifications`)}function yj(e,t){return Ne(`/projects/${encodeURIComponent(e)}/notifications`,{method:"POST",body:JSON.stringify(t)})}async function vj(e,t){await Ne(`/projects/${encodeURIComponent(e)}/notifications/${encodeURIComponent(t)}`,{method:"DELETE",body:"{}"})}function bj(e,t){return Ne(`/projects/${encodeURIComponent(e)}/notifications/${encodeURIComponent(t)}/test`,{method:"POST",body:"{}"})}function xj(e,t,s){return Ne(`/projects/${encodeURIComponent(e)}/keywords/generate`,{method:"POST",body:JSON.stringify({provider:t,count:s})})}function Sj(e){return Ne("/apply",{method:"POST",body:JSON.stringify(e)})}function YL(e){return Ne("/runs",{method:"POST",body:JSON.stringify(e??{})})}function wj(e){return Ne(`/projects/${encodeURIComponent(e)}/google/connections`)}function jj(e,t){return Ne(`/projects/${encodeURIComponent(e)}/google/connect`,{method:"POST",body:JSON.stringify({type:t})})}function Nj(e,t){return Ne(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}`,{method:"DELETE",body:"{}"})}function _j(e){return Ne(`/projects/${encodeURIComponent(e)}/google/properties`)}function Cj(e,t,s){return Ne(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}/property`,{method:"PUT",body:JSON.stringify({propertyId:s})})}function kj(e,t,s){return Ne(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}/sitemap`,{method:"PUT",body:JSON.stringify({sitemapUrl:s})})}function zj(e,t){return Ne(`/projects/${encodeURIComponent(e)}/google/gsc/sync`,{method:"POST",body:JSON.stringify(t??{})})}function Ej(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 Oj(e,t){return Ne(`/projects/${encodeURIComponent(e)}/google/gsc/inspect`,{method:"POST",body:JSON.stringify({url:t})})}function Rj(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 Aj(e){return Ne(`/projects/${encodeURIComponent(e)}/google/gsc/deindexed`)}function Tj(e){return Ne(`/projects/${encodeURIComponent(e)}/google/gsc/coverage`)}function Dj(e,t){const s=new URLSearchParams,a=s.toString()?`?${s.toString()}`:"";return Ne(`/projects/${encodeURIComponent(e)}/google/gsc/coverage/history${a}`)}function Lj(e,t){return Ne(`/projects/${encodeURIComponent(e)}/google/gsc/inspect-sitemap`,{method:"POST",body:JSON.stringify(t??{})})}function Mj(e){return Ne(`/projects/${encodeURIComponent(e)}/google/gsc/sitemaps`)}function Uj(e){return Ne(`/projects/${encodeURIComponent(e)}/google/gsc/discover-sitemaps`,{method:"POST",body:"{}"})}function wp(){return Ne("/cdp/status")}function Pj(e,t){return Ne("/settings/cdp",{method:"PUT",body:JSON.stringify({host:e,port:t})})}function jp(e,t){return Ne(`/projects/${encodeURIComponent(e)}/google/indexing/request`,{method:"POST",body:JSON.stringify(t)})}function $j(e,t){const s=t?`?window=${t}`:"";return Ne(`/projects/${encodeURIComponent(e)}/analytics/metrics${s}`)}function Ij(e,t){const s=t?`?window=${t}`:"";return Ne(`/projects/${encodeURIComponent(e)}/analytics/gaps${s}`)}function Bj(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 XL=Object.freeze(Object.defineProperty({__proto__:null,addLocation:oj,addNotification:yj,appendKeywords:aj,applyProjectConfig:Sj,configureCdp:Pj,createProject:il,deleteProject:uj,fetchAllRuns:nj,fetchAnalyticsGaps:Ij,fetchAnalyticsMetrics:$j,fetchAnalyticsSources:Bj,fetchCdpStatus:wp,fetchCompetitors:vm,fetchExport:dj,fetchGoogleConnections:wj,fetchGoogleProperties:_j,fetchGscCoverage:Tj,fetchGscCoverageHistory:Dj,fetchGscDeindexed:Aj,fetchGscInspections:Rj,fetchGscPerformance:Ej,fetchGscSitemaps:Mj,fetchKeywords:sj,fetchProject:ym,fetchProjects:tj,fetchRunDetail:el,fetchSchedule:pj,fetchServiceStatus:qj,fetchSettings:wm,fetchTimeline:bm,generateKeywords:xj,googleConnect:jj,googleDisconnect:Nj,inspectGscUrl:Oj,listNotifications:gj,removeLocation:lj,removeNotification:vj,removeSchedule:mj,requestIndexing:jp,saveGoogleProperty:Cj,saveSchedule:Sp,saveSitemapUrl:kj,sendTestNotification:bj,setCompetitors:xm,setDefaultLocation:cj,setKeywords:ij,triggerAllRuns:YL,triggerDiscoverSitemaps:Uj,triggerGscSync:zj,triggerInspectSitemap:Lj,triggerRun:Sm,updateGoogleAuthConfig:hj,updateOwnedDomains:xp,updateProject:rj,updateProviderConfig:fj},Symbol.toStringTag,{value:"Module"}));function JL({evidence:e,project:t,onClose:s}){const[a,r]=N.useState(!1),[c,d]=N.useState(-1),[f,m]=N.useState(null),[p,v]=N.useState(!1),[y,b]=N.useState({}),x=IL(t.project),j=new Set(x.map(vp)),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(vp),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),m(null),r(!1);return}d(Z),r(!1);const me=w[Z],ee=`${me.runId}::${e.keyword}::${e.provider}`;if(y[ee]){m(y[ee]);return}v(!0);try{const D=await el(me.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:me.citationState,summary:""}:{citationState:me.citationState,provider:e.provider,model:me.model??null,answerSnippet:"",citedDomains:[],competitorDomains:[],groundingSources:[],evidenceUrls:[],changeLabel:me.citationState,summary:"Snapshot data not available for this run."};b(ae=>({...ae,[ee]:ne})),m(ne)}catch{if(oe!==ie.current)return;m({citationState:me.citationState,provider:e.provider,model:me.model??null,answerSnippet:"",citedDomains:[],competitorDomains:[],groundingSources:[],evidenceUrls:[],changeLabel:me.citationState,summary:"Failed to load historical run data."})}finally{oe===ie.current&&v(!1)}},[w,e.keyword,e.provider,y]),pe=(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:pe}:O?{label:"Citation confirmed",title:"Cited in this answer",meta:pe}:E.citationState==="lost"?{label:"Citation lost",title:T>0?`${T} domain${T!==1?"s":""} cited instead`:"No longer appearing in this answer",meta:pe}: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:pe},H=()=>{if(!E.answerSnippet)return null;const Z=E.answerSnippet.split(`
95
+ `),oe=[];let me=[],ee=0;const D=()=>{if(me.length===0)return;const G=me.join(" ").trim();G&&oe.push(l.jsx("p",{className:oe.length>0?"mt-2.5":"",children:px(G,R)},ee++)),me=[]};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],ue=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:ue,children:px(he,R)},ee++));continue}if(ne===""){D();continue}me.push(ne)}return D(),oe};return l.jsx(mw,{open:!0,onOpenChange:Z=>{Z||s()},children:l.jsxs(gw,{children:[l.jsx(am,{className:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm"}),l.jsxs(rm,{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(om,{className:"text-lg font-semibold text-zinc-50 truncate",children:e.keyword})]}),l.jsxs(vw,{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(Jp,{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 me=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 ${me?"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":me,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:[p&&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"}),!p&&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&&!p&&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 me=Z.toLowerCase().replace(/^www\./,""),ee=j.has(me),D=!ee&&E.competitorDomains.some(ne=>ne.toLowerCase().replace(/^www\./,"")===me),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 es(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 _r=[{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 Zu(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 Nu=Zu({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"}),jm=Zu({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"}),Nm=Zu({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"}),_u=Zu({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"}),WL=[jm,Nu,Nm,_u],eM=[{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:es(["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:es(["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:es(["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:es(["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:es(["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:es(["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:es(["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:es(["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:es(["not-cited","not-cited","not-cited","not-cited","not-cited","cited"])}],tM=[{project:_r[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:eM,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:[jm,Nu]},{project:_r[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:es(["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:[Nm]},{project:_r[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:es(["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:[_u]}],nM={portfolioOverview:{projects:[{project:_r[0],visibilityScore:61,visibilityDelta:"-8 this week",lastRun:Nu,insight:"Lost emergency-intent citations after competitors refreshed availability pages.",trend:[73,71,69,66,61],competitorPressureLabel:"High"},{project:_r[1],visibilityScore:74,visibilityDelta:"+2 this week",lastRun:Nm,insight:"Practice-area consolidation is stabilizing branded and informational prompts.",trend:[68,70,71,73,74],competitorPressureLabel:"Moderate"},{project:_r[2],visibilityScore:58,visibilityDelta:"Run in progress",lastRun:_u,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:[jm,_u,Nu],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:tM,runs:WL,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."}},sM={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 Fu(e={}){const t=structuredClone(nM),s=structuredClone(sM);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 iM(e,t){return e.projects.find(s=>s.project.id===t)}function aM(e,t){return e.runs.find(s=>s.id===t)}function rM(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 Hj(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 mx(e){try{return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}catch{return e}}function oM(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 Zj(e){return e==="answer-visibility"?"Answer visibility sweep":e}function lM(e){return e==="manual"?"Manual":e==="scheduled"?"Scheduled":e==="config-apply"?"Config apply":e}function _m(e,t){return{id:e.id,projectId:e.projectId,projectName:t,kind:e.kind,kindLabel:Zj(e.kind),status:e.status,trigger:e.trigger??"manual",location:e.location??null,createdAt:e.createdAt,startedAt:e.startedAt?mx(e.startedAt):mx(e.createdAt),duration:oM(e.startedAt,e.finishedAt),statusDetail:e.error?Fj(e.error):cM(e),summary:uM(e),triggerLabel:lM(e.trigger)}}function Fj(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 cM(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?Fj(e.error):"Run failed.";default:return""}}function uM(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 Gj(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 dM(e){return e>=70?"positive":e>=40?"caution":"negative"}function fM(e){return e==="High"?"negative":e==="Moderate"?"caution":"neutral"}function Kj(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 hM(e,t,s,a){const r=[];let c=0;const d=new Set;if(s){const f=new Map;for(const p of s.snapshots)if(p.keyword){const v=`${p.keyword}::${p.provider}`;f.set(v,p)}const m=[...new Set(s.snapshots.map(p=>p.provider))].sort();m.length===0&&m.push("gemini");for(const p of t){if(p.runs.length===0)continue;d.add(p.keyword);const y=p.runs.at(-1)?.transition??"not-cited",b=y==="lost"?"lost":y==="emerging"?"emerging":y==="cited"?"cited":"not-cited";for(const x of m){const j=f.get(`${p.keyword}::${x}`);if(!j&&m.length>1)continue;const w=j?.model??null,_=w?`${x}:${w}`:null,C=_?p.modelRuns?.[_]:void 0,E=p.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=Np(O||p.runs),R=pM(p,x),I=(O??p.runs).map(pe=>({runId:pe.runId,citationState:pe.citationState,createdAt:pe.createdAt,model:R.get(pe.runId)??null})),ie=mM(I),Q=z==="provider"&&ie.length<=1?"model":z,se=gM(I);r.push({id:`evidence_${e}_${c++}`,keyword:p.keyword,provider:j?.provider??x,model:j?.model??null,location:j?.location??null,citationState:T,changeLabel:yM(M,L),answerSnippet:j?.answerText??"",citedDomains:j?.citedDomains??[],evidenceUrls:[],competitorDomains:j?.competitorOverlap??[],relatedTechnicalSignals:[],groundingSources:j?.groundingSources??[],summary:vM(T,p.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 pM(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 m of c)s.set(m.runId,f)}return s}function mM(e){const t=new Set;for(const s of e)s.model&&t.add(s.model);return[...t]}function gM(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 Np(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 yM(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 vM(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 gx(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 Hh=3;function bM(e){const{evidence:t,timeline:s,latestSnapshots:a,previousSnapshots:r,trackedCompetitors:c}=e,d=[],f=[],m=new Set;for(const C of t)C.citationState==="lost"&&(m.has(C.keyword)||(m.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 p=gx(a,c),v=gx(r,c);for(const C of c){const E=p.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<Hh||C.runs.at(-1)?.citationState!=="not-cited")continue;if(Np(C.runs)>=Hh){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 ${Hh}+ 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=p.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 xM(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: ${Zj(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 SM(e){const t=Hj(e.project),s=hM(t.name,e.timeline,e.latestRunDetail,e.keywords),a=e.latestRunDetail?.snapshots??[],r=Gj(a),c=Kj(a,e.competitors.map(y=>y.domain)),d=bM({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)),m=f.map(y=>_m(y,e.project.displayName||e.project.name)),p=new Map;for(const y of a){const b=y.provider||"gemini",x=y.model??null,j=`${b}::${x??"unknown"}`,w=p.get(j)??{provider:b,model:x,cited:0,total:0};w.total++,y.citationState==="cited"&&w.cited++,p.set(j,w)}const v=[...p.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?dM(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:fM(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:xM(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:m.slice(0,5)}}function wM(e){const t=Hj(e.project),s=e.latestRunDetail?.snapshots??[],a=Gj(s),r=Kj(s,e.competitors.map(m=>m.domain)),d=[...e.runs].sort((m,p)=>p.createdAt.localeCompare(m.createdAt))[0],f=d?_m(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(m=>m.provider)).size} provider${new Set(s.map(m=>m.provider)).size>1?"s":""}.`:"No runs completed yet.",trend:[],competitorPressureLabel:r.label}}function jM(e,t){const s=[],a=[],r=[];for(const d of e){a.push(SM(d)),r.push(wM(d));const f=[...d.runs].sort((m,p)=>p.createdAt.localeCompare(m.createdAt));for(const m of f)s.push(_m(m,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?NM(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 NM(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 zi={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"]},Vj=N.createContext(null);Vj.Provider;function al(){return N.useContext(Vj)}function Ca(e){const s=al()?.dashboard??null,a=$o({queryKey:zi.projects.all,queryFn:tj,enabled:!s}),r=$o({queryKey:zi.runs.all,queryFn:nj,enabled:!s,refetchInterval:j=>j.state.data?.some(C=>C.status==="running"||C.status==="queued")?3e3:!1}),c=$o({queryKey:zi.settings,queryFn:()=>wm().catch(()=>null),enabled:!s}),d=a.data??[],f=r.data??[],m=zC({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:zi.projects.detail(j.id),queryFn:async()=>{const[C,E,O,z,M]=await Promise.all([sj(j.name).catch(()=>[]),vm(j.name).catch(()=>[]),bm(j.name).catch(()=>[]),_[0]?el(_[0].id).catch(()=>null):Promise.resolve(null),_[1]?el(_[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}})}),p=m.every(j=>j.isSuccess),v=N.useMemo(()=>{if(s)return s;if(!a.data||!r.data||d.length>0&&!p)return null;const j=m.map(w=>w.data).filter(w=>w!=null);return jM(j,c.data??null)},[s,a.data,r.data,c.data,p,m,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 Gu(e,t){return $o({queryKey:zi.health,queryFn:_M,enabled:e,refetchInterval:15e3,initialData:t})}function CM(e){return $o({queryKey:zi.runs.detail(e??""),queryFn:()=>el(e),enabled:!!e,refetchInterval:t=>{const s=t.state.data?.status;return s==="running"||s==="queued"?3e3:!1}})}function rl(){const e=wa(),t=Tu({strict:!1}),s=bn({select:m=>m.location.pathname}),a=t.runId??null,r=t.evidenceId??null;return{runId:a,evidenceId:r,openRun:m=>e({to:s,from:ns.to,search:p=>({...p,runId:m,evidenceId:void 0})}),openEvidence:m=>e({to:s,from:ns.to,search:p=>({...p,evidenceId:m,runId:void 0})}),closeDrawer:()=>e({to:s,from:ns.to,search:m=>({...m,runId:void 0,evidenceId:void 0})})}}const yx=[{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"}],kM=Fu(),vx=e=>({label:e,state:"checking",detail:"Checking service health"}),zM={apiStatus:vx("API"),workerStatus:vx("Worker")};function EM(){const e=al(),{dashboard:t,isLoading:s,refetch:a}=Ca(),d=Gu(!e,e?.health).data??e?.health??zM,f=Rz(),{runId:m,evidenceId:p,closeDrawer:v}=rl(),[y,b]=N.useState(!1),x=CM(m),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"||!m&&!p)return;const z=M=>{M.key==="Escape"&&v()};return window.addEventListener("keydown",z),()=>{window.removeEventListener("keydown",z)}},[m,p,v]);const _=t??e?.dashboard??kM.dashboard,C=m?aM(_,m):void 0,E=p?rM(_,p):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(Db,{})}),l.jsxs("nav",{className:"sidebar-nav",children:[l.jsxs(pt,{to:"/",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[l.jsx(Zz,{className:"sidebar-icon"}),l.jsx("span",{children:"Overview"})]}),l.jsxs(pt,{to:"/projects",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!1},children:[l.jsx(qz,{className:"sidebar-icon"}),l.jsx("span",{children:"Projects"})]}),l.jsxs(pt,{to:"/runs",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[l.jsx(Vz,{className:"sidebar-icon"}),l.jsx("span",{children:"Runs"})]}),l.jsxs(pt,{to:"/settings",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[l.jsx(Wz,{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(pt,{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(pt,{to:"/setup",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[l.jsx(Xz,{className:"sidebar-icon"}),l.jsx("span",{children:"Setup"})]})]}):null]}),l.jsx("div",{className:"sidebar-footer",children:yx.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(Db,{compact:!0})}),l.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[l.jsx(pt,{to:"/",children:"Home"}),l.jsx(Du,{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(de,{className:"nav-toggle",variant:"secondary",size:"icon",type:"button","aria-expanded":y,"aria-controls":"mobile-nav",onClick:()=>b(z=>!z),children:[l.jsx(Gz,{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(de,{className:"mobile-nav-close",variant:"ghost",size:"icon",type:"button",onClick:()=>b(!1),children:[l.jsx(Jp,{className:"size-5"}),l.jsx("span",{className:"sr-only",children:"Close navigation"})]}),l.jsx(pt,{to:"/",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Overview"}),l.jsx(pt,{to:"/projects",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!1},children:"Projects"}),l.jsx(pt,{to:"/runs",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Runs"}),l.jsx(pt,{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(pt,{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(Xp,{})}),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:yx.map(z=>l.jsx("a",{href:z.href,target:"_blank",rel:"noreferrer",children:z.label},z.href))})]})]}),C?l.jsxs(KO,{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(Mu,{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(Yo,{provider:z.provider}),l.jsx(MS,{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:s2(j.error)})]}):l.jsx("p",{className:"text-sm text-zinc-500",children:"No snapshot data available."})]})]}):null,E?l.jsx(JL,{evidence:E.evidence,project:E.project,onClose:v}):null]})}const Ve=N.forwardRef(({className:e,...t},s)=>l.jsx("div",{ref:s,className:Gn("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 OM=N.forwardRef(({className:e,...t},s)=>l.jsx("div",{ref:s,className:Gn("flex flex-col gap-1.5 p-5",e),...t}));OM.displayName="CardHeader";const RM=N.forwardRef(({className:e,...t},s)=>l.jsx("h3",{ref:s,className:Gn("font-medium tracking-tight text-zinc-50",e),...t}));RM.displayName="CardTitle";const AM=N.forwardRef(({className:e,...t},s)=>l.jsx("p",{ref:s,className:Gn("text-sm text-zinc-500",e),...t}));AM.displayName="CardDescription";const TM=N.forwardRef(({className:e,...t},s)=>l.jsx("div",{ref:s,className:Gn("p-5 pt-0",e),...t}));TM.displayName="CardContent";function DM({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),m=Math.max(...e)-d||1,p=r-c*2,v=a-c*2,y=e.map((b,x)=>{const j=c+x/Math.max(e.length-1,1)*p,w=c+(1-(b-d)/m)*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:p,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 LM={gemini:"Gemini",openai:"OpenAI",claude:"Claude",local:"Local"};function MM(e,t,s){return e.map(a=>{if(a.id==="api")return{...a,tone:yu(t.apiStatus),detail:t.apiStatus.state==="ok"?"Healthy":"Needs attention",meta:t.apiStatus.detail};if(a.id==="worker")return{...a,tone:yu(t.workerStatus),detail:t.workerStatus.state==="ok"?"Healthy":"Needs attention",meta:t.workerStatus.detail};const r=s.providerStatuses.filter(m=>m.state==="ready").length,c=s.providerStatuses.length,d=r>0,f=s.providerStatuses.filter(m=>m.state==="ready").map(m=>LM[m.name]??m.name).join(" · ");return{...a,label:"Providers",tone:d?"positive":"caution",detail:`${r} of ${c} configured`,meta:f||"None configured"}})}function UM(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 PM(e,t,s){const a=UM(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 $M=Fu();function IM({project:e}){return l.jsxs(pt,{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," · ",Lu(e.lastRun.status)]})]})}),l.jsx("div",{className:"project-row-chart",children:l.jsx(DM,{points:e.trend,tone:US(e.lastRun.status)})}),l.jsx("span",{className:"project-row-link",children:l.jsx(Du,{className:"h-4 w-4 text-zinc-500"})})]})}function BM(){const e=al(),{dashboard:t}=Ca(),s=t??e?.dashboard??$M.dashboard,a=s.portfolioOverview,d=Gu(!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=MM(a.systemHealth,d,s.settings),{openRun:m}=rl();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(p=>l.jsx(IM,{project:p},p.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(de,{size:"sm",asChild:!0,children:l.jsx(pt,{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(p=>l.jsxs(pt,{to:p.href,className:`attention-item attention-item-${p.tone}`,children:[l.jsxs("div",{children:[l.jsx("p",{className:"attention-title",children:p.title}),l.jsx("p",{className:"attention-detail",children:p.detail})]}),l.jsx("span",{className:"attention-action",children:p.actionLabel})]},p.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(p=>l.jsxs("button",{className:"compact-run",type:"button",onClick:()=>m(p.id),children:[l.jsxs("div",{children:[l.jsx("p",{className:"compact-run-title",children:p.projectName}),l.jsx("p",{className:"compact-run-detail",children:p.summary})]}),l.jsx(Mu,{status:p.status})]},p.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(p=>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:p.label}),l.jsx("h3",{children:p.detail})]}),l.jsx(yt,{tone:p.tone,children:p.label})]}),l.jsx("p",{className:"supporting-copy",children:p.meta})]},p.id))})]})]})}const Cm=Symbol.for("yaml.alias"),_p=Symbol.for("yaml.document"),Ti=Symbol.for("yaml.map"),Qj=Symbol.for("yaml.pair"),vs=Symbol.for("yaml.scalar"),Lr=Symbol.for("yaml.seq"),Zn=Symbol.for("yaml.node.type"),ka=e=>!!e&&typeof e=="object"&&e[Zn]===Cm,Ku=e=>!!e&&typeof e=="object"&&e[Zn]===_p,ol=e=>!!e&&typeof e=="object"&&e[Zn]===Ti,Tt=e=>!!e&&typeof e=="object"&&e[Zn]===Qj,ot=e=>!!e&&typeof e=="object"&&e[Zn]===vs,ll=e=>!!e&&typeof e=="object"&&e[Zn]===Lr;function Rt(e){if(e&&typeof e=="object")switch(e[Zn]){case Ti:case Lr:return!0}return!1}function At(e){if(e&&typeof e=="object")switch(e[Zn]){case Cm:case Ti:case vs:case Lr:return!0}return!1}const Yj=e=>(ot(e)||Rt(e))&&!!e.anchor,la=Symbol("break visit"),qM=Symbol("skip children"),qo=Symbol("remove node");function Mr(e,t){const s=HM(t);Ku(e)?xr(null,e.contents,s,Object.freeze([e]))===qo&&(e.contents=null):xr(null,e,s,Object.freeze([]))}Mr.BREAK=la;Mr.SKIP=qM;Mr.REMOVE=qo;function xr(e,t,s,a){const r=ZM(e,t,s,a);if(At(r)||Tt(r))return FM(e,a,r),xr(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=xr(c,t.items[c],s,a);if(typeof d=="number")c=d-1;else{if(d===la)return la;d===qo&&(t.items.splice(c,1),c-=1)}}}else if(Tt(t)){a=Object.freeze(a.concat(t));const c=xr("key",t.key,s,a);if(c===la)return la;c===qo&&(t.key=null);const d=xr("value",t.value,s,a);if(d===la)return la;d===qo&&(t.value=null)}}return r}function HM(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 ZM(e,t,s,a){if(typeof s=="function")return s(e,t,a);if(ol(t))return s.Map?.(e,t,a);if(ll(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(ka(t))return s.Alias?.(e,t,a)}function FM(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(Ku(a))a.contents=s;else{const r=ka(a)?"alias":"scalar";throw new Error(`Cannot replace node with ${r} parent`)}}const GM={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},KM=e=>e.replace(/[!,[\]{}]/g,t=>GM[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+KM(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={};Mr(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 Xj(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 Jj(e){const t=new Set;return Mr(e,{Value(s,a){a.anchor&&t.add(a.anchor)}}),t}function Wj(e,t){for(let s=1;;++s){const a=`${e}${s}`;if(!t.has(a))return a}}function VM(e,t){const s=[],a=new Map;let r=null;return{onAnchor:c=>{s.push(c),r??(r=Jj(e));const d=Wj(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 Sr(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=Sr(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=Sr(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=Sr(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=Sr(e,a,r,c);d===void 0?delete a[r]:d!==c&&(a[r]=d)}return e.call(t,s,a)}function Hn(e,t,s){if(Array.isArray(e))return e.map((a,r)=>Hn(a,String(r),s));if(e&&typeof e.toJSON=="function"){if(!s||!Yj(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 km{constructor(t){Object.defineProperty(this,Zn,{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(!Ku(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=Hn(this,"",d);if(typeof r=="function")for(const{count:m,res:p}of d.anchors.values())r(p,m);return typeof c=="function"?Sr(c,{"":f},"",f):f}}class zm extends km{constructor(t){super(Cm),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=[],Mr(t,{Node:(c,d)=>{(ka(d)||Yj(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 m=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(m)}let f=a.get(d);if(f||(Hn(d,null,s),f=a.get(d)),f?.res===void 0){const m="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(m)}if(c>=0&&(f.count+=1,f.aliasCount===0&&(f.aliasCount=tu(r,d,a)),f.count*f.aliasCount>c)){const m="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(m)}return f.res}toString(t,s,a){const r=`*${this.source}`;if(t){if(Xj(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 tu(e,t,s){if(ka(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=tu(e,r,s);c>a&&(a=c)}return a}else if(Tt(t)){const a=tu(e,t.key,s),r=tu(e,t.value,s);return Math.max(a,r)}return 1}const e1=e=>!e||typeof e!="function"&&typeof e!="object";class Oe extends km{constructor(t){super(vs),this.value=t}toJSON(t,s){return s?.keep?this.value:Hn(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 QM="tag:yaml.org,2002:";function YM(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 tl(e,t,s){if(Ku(e)&&(e=e.contents),At(e))return e;if(Tt(e)){const y=s.schema[Ti].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 m;if(a&&e&&typeof e=="object"){if(m=f.get(e),m)return m.anchor??(m.anchor=r(e)),new zm(m.anchor);m={anchor:null,node:null},f.set(e,m)}t?.startsWith("!!")&&(t=QM+t.slice(2));let p=YM(e,t,d.tags);if(!p){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const y=new Oe(e);return m&&(m.node=y),y}p=e instanceof Map?d[Ti]:Symbol.iterator in Object(e)?d[Lr]:d[Ti]}c&&(c(p),delete s.onTagObj);const v=p?.createNode?p.createNode(s.schema,e,s):typeof p?.nodeClass?.from=="function"?p.nodeClass.from(s.schema,e,s):new Oe(e);return t?v.tag=t:p.default||(v.tag=p.tag),m&&(m.node=v),v}function Cu(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 tl(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 t1 extends km{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,Cu(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,Cu(this.schema,r,s));else throw new Error(`Expected YAML collection at ${a}. Remaining path: ${r}`)}}}const XM=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function qs(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const ha=(e,t,s)=>e.endsWith(`
97
+ `)?qs(s,t):s.includes(`
98
+ `)?`
99
+ `+qs(s,t):(e.endsWith(" ")?"":" ")+s,n1="flow",Cp="block",nu="quoted";function Vu(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 m=Math.max(1+c,1+r-t.length);if(e.length<=m)return e;const p=[],v={};let y=r-t.length;typeof a=="number"&&(a>r-Math.max(2,c)?p.push(0):y=r-a);let b,x,j=!1,w=-1,_=-1,C=-1;s===Cp&&(w=bx(e,w,t.length),w!==-1&&(y=w+m));for(let O;O=e[w+=1];){if(s===nu&&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===Cp&&(w=bx(e,w,t.length)),y=w+t.length+m,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)p.push(b),y=b+m,b=void 0;else if(s===nu){for(;x===" "||x===" ";)x=O,O=e[w+=1],j=!0;const z=w>C+1?w-2:_-1;if(v[z])return e;p.push(z),v[z]=!0,y=z+m,b=void 0}else j=!0}x=O}if(j&&f&&f(),p.length===0)return e;d&&d();let E=e.slice(0,p[0]);for(let O=0;O<p.length;++O){const z=p[O],M=p[O+1]||e.length;z===0?E=`
103
+ ${t}${e.slice(0,M)}`:(s===nu&&v[z]&&(E+=`${e[z]}\\`),E+=`
104
+ ${t}${e.slice(z+1,M)}`)}return E}function bx(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 Qu=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),Yu=e=>/^(%|---|\.\.\.)/m.test(e);function JM(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 Ho(e,t){const s=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return s;const{implicitKey:a}=t,r=t.options.doubleQuotedMinMultiLineLength,c=t.indent||(Yu(e)?" ":"");let d="",f=0;for(let m=0,p=s[m];p;p=s[++m])if(p===" "&&s[m+1]==="\\"&&s[m+2]==="n"&&(d+=s.slice(f,m)+"\\ ",m+=1,f=m,p="\\"),p==="\\")switch(s[m+1]){case"u":{d+=s.slice(f,m);const v=s.substr(m+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(m,6)}m+=5,f=m+1}break;case"n":if(a||s[m+2]==='"'||s.length<r)m+=1;else{for(d+=s.slice(f,m)+`
107
+
108
+ `;s[m+2]==="\\"&&s[m+3]==="n"&&s[m+4]!=='"';)d+=`
109
+ `,m+=2;d+=c,s[m+2]===" "&&(d+="\\"),m+=1,f=m+1}break;default:m+=1}return d=f?d+s.slice(f):s,a?d:Vu(d,c,nu,Qu(t,!1))}function kp(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
110
+ `)||/[ \t]\n|\n[ \t]/.test(e))return Ho(e,t);const s=t.indent||(Yu(e)?" ":""),a="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
111
+ ${s}`)+"'";return t.implicitKey?a:Vu(a,s,n1,Qu(t,!1))}function wr(e,t){const{singleQuote:s}=t.options;let a;if(s===!1)a=Ho;else{const r=e.includes('"'),c=e.includes("'");r&&!c?a=kp:c&&!r?a=Ho:a=s?kp:Ho}return a(e,t)}let zp;try{zp=new RegExp(`(^|(?<!
112
+ ))
113
+ +(?!
114
+ |$)`,"g")}catch{zp=/\n+(?!\n|$)/g}function su({comment:e,type:t,value:s},a,r,c){const{blockQuote:d,commentString:f,lineWidth:m}=a.options;if(!d||/\n[\t ]+$/.test(s))return wr(s,a);const p=a.indent||(a.forceBlockIndent||Yu(s)?" ":""),v=d==="literal"?!0:d==="folded"||t===Oe.BLOCK_FOLDED?!1:t===Oe.BLOCK_LITERAL?!0:!JM(s,m,p.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(zp,`$&${p}`));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,`$&${p}`));let z=(w?p?"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,`$&${p}`);let T=!1;const L=Qu(a,!0);d!=="folded"&&t!==Oe.BLOCK_FOLDED&&(L.onOverflow=()=>{T=!0});const R=Vu(`${E}${M}${x}`,p,Cp,L);if(!T)return`>${z}
122
+ ${p}${R}`}return s=s.replace(/\n+/g,`$&${p}`),`|${z}
123
+ ${p}${E}${s}${x}`}function WM(e,t,s,a){const{type:r,value:c}=e,{actualString:d,implicitKey:f,indent:m,indentStep:p,inFlow:v}=t;if(f&&c.includes(`
124
+ `)||v&&/[[\]{},]/.test(c))return wr(c,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(c))return f||v||!c.includes(`
125
+ `)?wr(c,t):su(e,t,s,a);if(!f&&!v&&r!==Oe.PLAIN&&c.includes(`
126
+ `))return su(e,t,s,a);if(Yu(c)){if(m==="")return t.forceBlockIndent=!0,su(e,t,s,a);if(f&&m===p)return wr(c,t)}const y=c.replace(/\n+/g,`$&
127
+ ${m}`);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 wr(c,t)}return f?y:Vu(y,m,n1,Qu(t,!1))}function Em(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 m=v=>{switch(v){case Oe.BLOCK_FOLDED:case Oe.BLOCK_LITERAL:return r||c?wr(d.value,t):su(d,t,s,a);case Oe.QUOTE_DOUBLE:return Ho(d.value,t);case Oe.QUOTE_SINGLE:return kp(d.value,t);case Oe.PLAIN:return WM(d,t,s,a);default:return null}};let p=m(f);if(p===null){const{defaultKeyType:v,defaultStringType:y}=t.options,b=r&&v||y;if(p=m(b),p===null)throw new Error(`Unsupported default string type ${b}`)}return p}function s1(e,t){const s=Object.assign({blockQuote:!0,commentString:XM,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 e5(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 t5(e,t,{anchors:s,doc:a}){if(!a.directives)return"";const r=[],c=(ot(e)||Rt(e))&&e.anchor;c&&Xj(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 Rr(e,t,s,a){if(Tt(e))return e.toString(t,s,a);if(ka(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:m=>r=m});r??(r=e5(t.doc.schema.tags,c));const d=t5(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)?Em(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 n5({key:e,value:t},s,a,r){const{allNullValues:c,doc:d,indent:f,indentStep:m,options:{commentString:p,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+m});let j=!1,w=!1,_=Rr(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?_+=ha(_,s.indent,p(b)):w&&r&&r(),_;j&&(b=null),x?(b&&(_+=ha(_,s.indent,p(b))),_=`? ${_}
129
+ ${f}:`):(_=`${_}:`,b&&(_+=ha(_,s.indent,p(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&&m.length>=2&&!s.inFlow&&!x&&ll(t)&&!t.flow&&!t.tag&&!t.anchor&&(s.indent=s.indent.substring(2));let z=!1;const M=Rr(t,s,()=>z=!0,()=>w=!0);let T=" ";if(b||C||E){if(T=C?`
130
+ `:"",E){const L=p(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?_+=ha(_,s.indent,p(O)):w&&r&&r(),_}function s5(e,t){(e==="debug"||e==="warn")&&console.warn(t)}const Hc="<<",Hs={identify:e=>e===Hc||typeof e=="symbol"&&e.description===Hc,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Oe(Symbol(Hc)),{addToJSMap:i1}),stringify:()=>Hc},i5=(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 i1(e,t,s){if(s=e&&ka(s)?s.resolve(e.doc):s,ll(s))for(const a of s.items)Zh(e,t,a);else if(Array.isArray(s))for(const a of s)Zh(e,t,a);else Zh(e,t,s)}function Zh(e,t,s){const a=e&&ka(s)?s.resolve(e.doc):s;if(!ol(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 a1(e,t,{key:s,value:a}){if(At(s)&&s.addToJSMap)s.addToJSMap(e,t,a);else if(i5(e,s))i1(e,t,a);else{const r=Hn(s,"",e);if(t instanceof Map)t.set(r,Hn(a,r,e));else if(t instanceof Set)t.add(r);else{const c=a5(s,r,e),d=Hn(a,c,e);c in t?Object.defineProperty(t,c,{value:d,writable:!0,enumerable:!0,configurable:!0}):t[c]=d}}return t}function a5(e,t,s){if(t===null)return"";if(typeof t!="object")return String(t);if(At(e)&&s?.doc){const a=s1(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)+'..."'),s5(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 Om(e,t,s){const a=tl(e,void 0,s),r=tl(t,void 0,s);return new dn(a,r)}class dn{constructor(t,s=null){Object.defineProperty(this,Zn,{value:Qj}),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 a1(s,a,this)}toString(t,s,a){return t?.doc?n5(this,t,s,a):JSON.stringify(this)}}function r1(e,t,s){return(t.inFlow??e.flow?o5:r5)(e,t,s)}function r5({comment:e,items:t},s,{blockItemPrefix:a,flowChars:r,itemIndent:c,onChompKeep:d,onComment:f}){const{indent:m,options:{commentString:p}}=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(""),ku(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(""),ku(s,b,E.commentBefore,y))}y=!1;let C=Rr(w,v,()=>_=null,()=>y=!0);_&&(C+=ha(C,c,p(_))),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
+ ${m}${w}`:`
140
+ `}}return e?(x+=`
141
+ `+qs(p(e),m),f&&f()):y&&d&&d(),x}function o5({items:e},t,{flowChars:s,itemIndent:a}){const{indent:r,indentStep:c,flowCollectionPadding:d,options:{commentString:f}}=t;a+=c;const m=Object.assign({},t,{indent:a,inFlow:!0,type:null});let p=!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(""),ku(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(""),ku(t,y,E.commentBefore,!1),E.comment&&(p=!0));const O=At(w.value)?w.value:null;O?(O.comment&&(_=O.comment),O.commentBefore&&(p=!0)):w.value==null&&E?.comment&&(_=E.comment)}_&&(p=!0);let C=Rr(w,m,()=>_=null);j<e.length-1&&(C+=","),_&&(C+=ha(C,a,f(_))),!p&&(y.length>v||C.includes(`
142
+ `))&&(p=!0),y.push(C),v=y.length}const{start:b,end:x}=s;if(y.length===0)return b+x;if(!p){const j=y.reduce((w,_)=>w+_.length+2,2);p=t.options.lineWidth>0&&j>t.options.lineWidth}if(p){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 ku({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 qn extends t1{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(Ti,t),this.items=[]}static from(t,s,a){const{keepUndefined:r,replacer:c}=a,d=new this(t),f=(m,p)=>{if(typeof c=="function")p=c.call(s,m,p);else if(Array.isArray(c)&&!c.includes(m))return;(p!==void 0||r)&&d.items.push(Om(m,p,a))};if(s instanceof Map)for(const[m,p]of s)f(m,p);else if(s&&typeof s=="object")for(const m of Object.keys(s))f(m,s[m]);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)&&e1(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)a1(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})),r1(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:a,onComment:s})}}const Ur={collection:"map",default:!0,nodeClass:qn,tag:"tag:yaml.org,2002:map",resolve(e,t){return ol(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,s)=>qn.from(e,t,s)};class Sa extends t1{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(Lr,t),this.items=[]}add(t){this.items.push(t)}delete(t){const s=Zc(t);return typeof s!="number"?!1:this.items.splice(s,1).length>0}get(t,s){const a=Zc(t);if(typeof a!="number")return;const r=this.items[a];return!s&&ot(r)?r.value:r}has(t){const s=Zc(t);return typeof s=="number"&&s<this.items.length}set(t,s){const a=Zc(t);if(typeof a!="number")throw new Error(`Expected a valid index, not ${t}.`);const r=this.items[a];ot(r)&&e1(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(Hn(c,String(r++),s));return a}toString(t,s,a){return t?r1(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 m=s instanceof Set?f:String(d++);f=r.call(s,m,f)}c.items.push(tl(f,void 0,a))}}return c}}function Zc(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:Sa,tag:"tag:yaml.org,2002:seq",resolve(e,t){return ll(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,s)=>Sa.from(e,t,s)},Xu={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),Em(e,t,s,a)}},Ju={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"&&Ju.test.test(e)?e:t.options.nullStr},Rm={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&&Rm.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 o1={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},l1={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)}},c1={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},Wu=e=>typeof e=="bigint"||Number.isInteger(e),Am=(e,t,s,{intAsBigInt:a})=>a?BigInt(e):parseInt(e.substring(t),s);function u1(e,t,s){const{value:a}=e;return Wu(a)&&a>=0?s+a.toString(t):rs(e)}const d1={identify:e=>Wu(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,s)=>Am(e,2,8,s),stringify:e=>u1(e,8,"0o")},f1={identify:Wu,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,s)=>Am(e,0,10,s),stringify:rs},h1={identify:e=>Wu(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,s)=>Am(e,2,16,s),stringify:e=>u1(e,16,"0x")},l5=[Ur,Pr,Xu,Ju,Rm,d1,f1,h1,o1,l1,c1];function xx(e){return typeof e=="bigint"||Number.isInteger(e)}const Fc=({value:e})=>JSON.stringify(e),c5=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:Fc},{identify:e=>e==null,createNode:()=>new Oe(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Fc},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:Fc},{identify:xx,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})=>xx(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:Fc}],u5={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},d5=[Ur,Pr].concat(c5,u5),Tm={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 m="";for(let p=0;p<d.length;++p)m+=String.fromCharCode(d[p]);f=btoa(m)}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 m=Math.max(a.options.lineWidth-a.indent.length,a.options.minContentWidth),p=Math.ceil(f.length/m),v=new Array(p);for(let y=0,b=0;y<p;++y,b+=m)v[y]=f.substr(b,m);f=v.join(t===Oe.BLOCK_LITERAL?`
146
+ `:" ")}return Em({comment:e,type:t,value:f},a,r,c)}};function p1(e,t){if(ll(e))for(let s=0;s<e.items.length;++s){let a=e.items[s];if(!Tt(a)){if(ol(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 m1(e,t,s){const{replacer:a}=s,r=new Sa(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,m;if(Array.isArray(d))if(d.length===2)f=d[0],m=d[1];else throw new TypeError(`Expected [key, value] tuple: ${d}`);else if(d&&d instanceof Object){const p=Object.keys(d);if(p.length===1)f=p[0],m=d[f];else throw new TypeError(`Expected tuple with one key, not ${p.length} keys`)}else f=d;r.items.push(Om(f,m,s))}return r}const Dm={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:p1,createNode:m1};class Cr extends Sa{constructor(){super(),this.add=qn.prototype.add.bind(this),this.delete=qn.prototype.delete.bind(this),this.get=qn.prototype.get.bind(this),this.has=qn.prototype.has.bind(this),this.set=qn.prototype.set.bind(this),this.tag=Cr.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=Hn(r.key,"",s),d=Hn(r.value,c,s)):c=Hn(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=m1(t,s,a),c=new this;return c.items=r.items,c}}Cr.tag="tag:yaml.org,2002:omap";const Lm={collection:"seq",identify:e=>e instanceof Map,nodeClass:Cr,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const s=p1(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 Cr,s)},createNode:(e,t,s)=>Cr.from(e,t,s)};function g1({value:e,source:t},s){return t&&(e?y1:v1).test.test(t)?t:e?s.options.trueStr:s.options.falseStr}const y1={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:g1},v1={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:g1},f5={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},h5={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)}},p5={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},cl=e=>typeof e=="bigint"||Number.isInteger(e);function ed(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 Mm(e,t,s){const{value:a}=e;if(cl(a)){const r=a.toString(t);return a<0?"-"+s+r.substr(1):s+r}return rs(e)}const m5={identify:cl,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,s)=>ed(e,2,2,s),stringify:e=>Mm(e,2,"0b")},g5={identify:cl,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,s)=>ed(e,1,8,s),stringify:e=>Mm(e,8,"0")},y5={identify:cl,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,s)=>ed(e,0,10,s),stringify:rs},v5={identify:cl,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,s)=>ed(e,2,16,s),stringify:e=>Mm(e,16,"0x")};class kr extends qn{constructor(t){super(t),this.tag=kr.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(Om(d,null,a));return c}}kr.tag="tag:yaml.org,2002:set";const Um={collection:"map",identify:e=>e instanceof Set,nodeClass:kr,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,s)=>kr.from(e,t,s),resolve(e,t){if(ol(e)){if(e.hasAllNullValues(!0))return Object.assign(new kr,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function Pm(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 b1(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 x1={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})=>Pm(e,s),stringify:b1},S1={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=>Pm(e,!1),stringify:b1},td={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(td.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),m=t[7]?Number((t[7]+"00").substr(1,3)):0;let p=Date.UTC(s,a-1,r,c||0,d||0,f||0,m);const v=t[8];if(v&&v!=="Z"){let y=Pm(v,!1);Math.abs(y)<30&&(y*=60),p-=6e4*y}return new Date(p)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""},Sx=[Ur,Pr,Xu,Ju,y1,v1,m5,g5,y5,v5,f5,h5,p5,Tm,Hs,Lm,Dm,Um,x1,S1,td],wx=new Map([["core",l5],["failsafe",[Ur,Pr,Xu]],["json",d5],["yaml11",Sx],["yaml-1.1",Sx]]),jx={binary:Tm,bool:Rm,float:c1,floatExp:l1,floatNaN:o1,floatTime:S1,int:f1,intHex:h1,intOct:d1,intTime:x1,map:Ur,merge:Hs,null:Ju,omap:Lm,pairs:Dm,seq:Pr,set:Um,timestamp:td},b5={"tag:yaml.org,2002:binary":Tm,"tag:yaml.org,2002:merge":Hs,"tag:yaml.org,2002:omap":Lm,"tag:yaml.org,2002:pairs":Dm,"tag:yaml.org,2002:set":Um,"tag:yaml.org,2002:timestamp":td};function Fh(e,t,s){const a=wx.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(wx.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"?jx[d]:d;if(!f){const m=JSON.stringify(d),p=Object.keys(jx).map(v=>JSON.stringify(v)).join(", ");throw new Error(`Unknown custom tag ${m}; use one of ${p}`)}return c.includes(f)||c.push(f),c},[])}const x5=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class $m{constructor({compat:t,customTags:s,merge:a,resolveKnownTags:r,schema:c,sortMapEntries:d,toStringDefaults:f}){this.compat=Array.isArray(t)?Fh(t,"compat"):t?Fh(null,t):null,this.name=typeof c=="string"&&c||"core",this.knownTags=r?b5:{},this.tags=Fh(s,this.name,a),this.toStringOptions=f??null,Object.defineProperty(this,Ti,{value:Ur}),Object.defineProperty(this,vs,{value:Xu}),Object.defineProperty(this,Lr,{value:Pr}),this.sortMapEntries=typeof d=="function"?d:d===!0?x5:null}clone(){const t=Object.create($m.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function S5(e,t){const s=[];let a=t.directives===!0;if(t.directives!==!1&&e.directives){const m=e.directives.toString(e);m?(s.push(m),a=!0):e.directives.docStart&&(a=!0)}a&&s.push("---");const r=s1(e,t),{commentString:c}=r.options;if(e.commentBefore){s.length!==1&&s.unshift("");const m=c(e.commentBefore);s.unshift(qs(m,""))}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 m=f?void 0:()=>d=!0;let p=Rr(e.contents,r,()=>f=null,m);f&&(p+=ha(p,"",c(f))),(p[0]==="|"||p[0]===">")&&s[s.length-1]==="---"?s[s.length-1]=`--- ${p}`:s.push(p)}else s.push(Rr(e.contents,r));if(e.directives?.docEnd)if(e.comment){const m=c(e.comment);m.includes(`
149
+ `)?(s.push("..."),s.push(qs(m,""))):s.push(`... ${m}`)}else s.push("...");else{let m=e.comment;m&&d&&(m=m.replace(/^\n+/,"")),m&&((!d||f)&&s[s.length-1]!==""&&s.push(""),s.push(qs(c(m),"")))}return s.join(`
150
+ `)+`
151
+ `}class nd{constructor(t,s,a){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Zn,{value:_p});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(nd.prototype,{[Zn]:{value:_p}});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){mr(this.contents)&&this.contents.add(t)}addIn(t,s){mr(this.contents)&&this.contents.addIn(t,s)}createAlias(t,s){if(!t.anchor){const a=Jj(this);t.anchor=!s||a.has(s)?Wj(s||"a",a):s}return new zm(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:m,onTagObj:p,tag:v}=a??{},{onAnchor:y,setAnchors:b,sourceObjects:x}=VM(this,d||"a"),j={aliasDuplicateObjects:c??!0,keepUndefined:m??!1,onAnchor:y,onTagObj:p,replacer:r,schema:this.schema,sourceObjects:x},w=tl(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 mr(this.contents)?this.contents.delete(t):!1}deleteIn(t){return Po(t)?this.contents==null?!1:(this.contents=null,!0):mr(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=Cu(this.schema,[t],s):mr(this.contents)&&this.contents.set(t,s)}setIn(t,s){Po(t)?this.contents=s:this.contents==null?this.contents=Cu(this.schema,Array.from(t),s):mr(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 $m(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},m=Hn(this.contents,s??"",f);if(typeof c=="function")for(const{count:p,res:v}of f.anchors.values())c(v,p);return typeof d=="function"?Sr(d,{"":m},"",m):m}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 S5(this,t)}}function mr(e){if(Rt(e))return!0;throw new Error("Expected a YAML collection as document contents")}class w1 extends Error{constructor(t,s,a,r){super(),this.name=t,this.code=a,this.message=r,this.pos=s}}class Gc extends w1{constructor(t,s,a){super("YAMLParseError",t,s,a)}}class w5 extends w1{constructor(t,s,a){super("YAMLWarning",t,s,a)}}const Nx=(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 m=s.linePos[1];m?.line===a&&m.col>r&&(f=Math.max(1,Math.min(m.col-r,80-c)));const p=" ".repeat(c)+"^".repeat(f);s.message+=`:
153
+
154
+ ${d}
155
+ ${p}
156
+ `}};function Ar(e,{flow:t,indicator:s,next:a,offset:r,onError:c,parentIndent:d,startOnNewline:f}){let m=!1,p=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&&(p&&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="",p=!1;break}case"newline":p?y?y+=R.source:(!z||s!=="seq-item-ind")&&(m=!0):b+=R.source,p=!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),p=!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),p=!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,p=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,p=!1,v=!1;break}default:c(R,"UNEXPECTED_TOKEN",`Unexpected ${R.type} token`),p=!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&&(p&&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:m,comment:y,hasNewline:x,anchor:_,tag:C,newlineAfterProp:E,end:L,start:M??L}}function nl(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(nl(t.key)||nl(t.value))return!0}return!1;default:return!0}}function Ep(e,t,s){if(t?.type==="flow-collection"){const a=t.end[0];a.indent===e&&(a.source==="]"||a.source==="}")&&nl(t)&&s(a,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function j1(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 _x="All mapping items must start at the same column";function j5({composeNode:e,composeEmptyNode:t},s,a,r,c){const d=c?.nodeClass??qn,f=new d(s.schema);s.atRoot&&(s.atRoot=!1);let m=a.offset,p=null;for(const v of a.items){const{start:y,key:b,sep:x,value:j}=v,w=Ar(y,{indicator:"explicit-key-ind",next:b??x?.[0],offset:m,onError:r,parentIndent:a.indent,startOnNewline:!0}),_=!w.found;if(_){if(b&&(b.type==="block-seq"?r(m,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in b&&b.indent!==a.indent&&r(m,"BAD_INDENT",_x)),!w.anchor&&!w.tag&&!x){p=w.end,w.comment&&(f.comment?f.comment+=`
158
+ `+w.comment:f.comment=w.comment);continue}(w.newlineAfterProp||nl(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(m,"BAD_INDENT",_x);s.atKey=!0;const C=w.end,E=b?e(s,b,w,r):t(s,C,y,null,w,r);s.schema.compat&&Ep(a.indent,b,r),s.atKey=!1,j1(s,f.items,E)&&r(C,"DUPLICATE_KEY","Map keys must be unique");const O=Ar(x??[],{indicator:"map-value-ind",next:j,offset:E.range[2],onError:r,parentIndent:a.indent,startOnNewline:!b||b.type==="block-scalar"});if(m=O.end,O.found){_&&(j?.type==="block-map"&&!O.hasNewline&&r(m,"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,m,x,null,O,r);s.schema.compat&&Ep(a.indent,j,r),m=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 p&&p<m&&r(p,"IMPOSSIBLE","Map comment with trailing content"),f.range=[a.offset,m,p??m],f}function N5({composeNode:e,composeEmptyNode:t},s,a,r,c){const d=c?.nodeClass??Sa,f=new d(s.schema);s.atRoot&&(s.atRoot=!1),s.atKey&&(s.atKey=!1);let m=a.offset,p=null;for(const{start:v,value:y}of a.items){const b=Ar(v,{indicator:"seq-item-ind",next:y,offset:m,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(m,"MISSING_CHAR","Sequence item without - indicator");else{p=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&&Ep(a.indent,y,r),m=x.range[2],f.items.push(x)}return f.range=[a.offset,m,p??m],f}function ul(e,t,s,a){let r="";if(e){let c=!1,d="";for(const f of e){const{source:m,type:p}=f;switch(p){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=m.substring(1)||" ";r?r+=d+v:r=v,d="";break}case"newline":r&&(d+=m),c=!0;break;default:a(f,"UNEXPECTED_TOKEN",`Unexpected ${p} at node end`)}t+=m.length}}return{comment:r,offset:t}}const Gh="Block collections are not allowed within flow collections",Kh=e=>e&&(e.type==="block-map"||e.type==="block-seq");function _5({composeNode:e,composeEmptyNode:t},s,a,r,c){const d=a.start.source==="{",f=d?"flow map":"flow sequence",m=c?.nodeClass??(d?qn:Sa),p=new m(s.schema);p.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=Ar(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&&(p.comment?p.comment+=`
160
+ `+T.comment:p.comment=T.comment),y=T.end;continue}!d&&s.options.strict&&nl(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=p.items[p.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);p.items.push(L),y=L.range[2],Kh(M)&&r(L.range,"BLOCK_IN_FLOW",Gh)}else{s.atKey=!0;const L=T.end,R=O?e(s,O,T,r):t(s,L,E,null,T,r);Kh(O)&&r(R.range,"BLOCK_IN_FLOW",Gh),s.atKey=!1;const I=Ar(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?Kh(M)&&r(ie.range,"BLOCK_IN_FLOW",Gh):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=p;j1(s,se.items,R)&&r(L,"DUPLICATE_KEY","Map keys must be unique"),se.items.push(Q)}else{const se=new qn(s.schema);se.flow=!0,se.items.push(Q);const pe=(ie??R).range;se.range=[R.range[0],pe[1],pe[2]],p.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 _=ul(j,w,s.options.strict,r);_.comment&&(p.comment?p.comment+=`
163
+ `+_.comment:p.comment=_.comment),p.range=[a.offset,w,_.offset]}else p.range=[a.offset,w,w];return p}function Vh(e,t,s,a,r,c){const d=s.type==="block-map"?j5(e,t,s,a,c):s.type==="block-seq"?N5(e,t,s,a,c):_5(e,t,s,a,c),f=d.constructor;return r==="!"||r===f.tagName?(d.tag=f.tagName,d):(r&&(d.tag=r),d)}function C5(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===qn.tagName&&f==="map"||d===Sa.tagName&&f==="seq")return Vh(e,t,s,r,d);let m=t.schema.tags.find(b=>b.tag===d&&b.collection===f);if(!m){const b=t.schema.knownTags[d];if(b?.collection===f)t.schema.tags.push(Object.assign({},b,{default:!1})),m=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),Vh(e,t,s,r,d)}const p=Vh(e,t,s,r,d,m),v=m.resolve?.(p,b=>r(c,"TAG_RESOLVE_FAILED",b),t.options)??p,y=At(v)?v:new Oe(v);return y.range=p.range,y.tag=d,m?.format&&(y.format=m.format),y}function k5(e,t,s){const a=t.offset,r=z5(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?E5(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 m=t.indent+r.indent,p=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>m&&(m=_.length);else{_.length<m&&s(p+_.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),r.indent===0&&(m=_.length),v=w,m===0&&!e.atRoot&&s(p,"BAD_INDENT","Block scalar values in collections must be indented");break}p+=_.length+C.length+1}for(let w=d.length-1;w>=f;--w)d[w][0].length>m&&(f=w+1);let y="",b="",x=!1;for(let w=0;w<v;++w)y+=d[w][0].slice(m)+`
165
+ `;for(let w=v;w<f;++w){let[_,C]=d[w];p+=_.length+C.length+1;const E=C[C.length-1]==="\r";if(E&&(C=C.slice(0,-1)),C&&_.length<m){const z=`Block scalar lines must not be less indented than their ${r.indent?"explicit indentation indicator":"first line"}`;s(p-C.length-(E?2:1),"BAD_INDENT",z),_=""}c===Oe.BLOCK_LITERAL?(y+=b+_.slice(m)+C,b=`
166
+ `):_.length>m||C[0]===" "?(b===" "?b=`
167
+ `:!x&&b===`
168
+ `&&(b=`
169
+
170
+ `),y+=b+_.slice(m)+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(m);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 z5({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="",m=-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:m===-1&&(m=e+b)}}m!==-1&&a(m,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${r}`);let p=!1,v="",y=r.length;for(let b=1;b<t.length;++b){const x=t[b];switch(x.type){case"space":p=!0;case"newline":y+=x.source.length;break;case"comment":s&&!p&&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 E5(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 O5(e,t,s){const{offset:a,type:r,source:c,end:d}=e;let f,m;const p=(b,x,j)=>s(a+b,x,j);switch(r){case"scalar":f=Oe.PLAIN,m=R5(c,p);break;case"single-quoted-scalar":f=Oe.QUOTE_SINGLE,m=A5(c,p);break;case"double-quoted-scalar":f=Oe.QUOTE_DOUBLE,m=T5(c,p);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=ul(d,v,t,s);return{value:m,type:f,comment:y.comment,range:[a,v,y.offset]}}function R5(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}`),N1(e)}function A5(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),N1(e.slice(1,-1)).replace(/''/g,"'")}function N1(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 T5(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}=D5(e,a);s+=c,a=d}else if(r==="\\"){let c=e[++a];const d=L5[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+=M5(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 D5(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 L5={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
193
+ `,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function M5(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 _1(e,t,s,a){const{value:r,type:c,comment:d,range:f}=t.type==="block-scalar"?k5(e,t,a):O5(t,e.options.strict,a),m=s?e.directives.tagName(s.source,y=>a(s,"TAG_RESOLVE_FAILED",y)):null;let p;e.options.stringKeys&&e.atKey?p=e.schema[vs]:m?p=U5(e.schema,r,m,s,a):t.type==="scalar"?p=P5(e,r,t,a):p=e.schema[vs];let v;try{const y=p.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),m&&(v.tag=m),p.format&&(v.format=p.format),d&&(v.comment=d),v}function U5(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 P5({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(m=>m.default&&m.test?.test(a))??s[vs];if(d.tag!==f.tag){const m=t.tagString(d.tag),p=t.tagString(f.tag),v=`Value may be parsed as either ${m} or ${p}`;c(r,"TAG_RESOLVE_FAILED",v,!0)}}return d}function $5(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 I5={composeNode:C1,composeEmptyNode:Im};function C1(e,t,s,a){const r=e.atKey,{spaceBefore:c,comment:d,anchor:f,tag:m}=s;let p,v=!0;switch(t.type){case"alias":p=B5(e,t,a),(f||m)&&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":p=_1(e,t,m,a),f&&(p.anchor=f.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":p=C5(I5,e,t,s,a),f&&(p.anchor=f.source.substring(1));break;default:{const y=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;a(t,"UNEXPECTED_TOKEN",y),p=Im(e,t.offset,void 0,null,s,a),v=!1}}return f&&p.anchor===""&&a(f,"BAD_ALIAS","Anchor cannot be an empty string"),r&&e.options.stringKeys&&(!ot(p)||typeof p.value!="string"||p.tag&&p.tag!=="tag:yaml.org,2002:str")&&a(m??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),c&&(p.spaceBefore=!0),d&&(t.type==="scalar"&&t.source===""?p.comment=d:p.commentBefore=d),e.options.keepSourceTokens&&v&&(p.srcToken=t),p}function Im(e,t,s,a,{spaceBefore:r,comment:c,anchor:d,tag:f,end:m},p){const v={type:"scalar",offset:$5(t,s,a),indent:-1,source:""},y=_1(e,v,f,p);return d&&(y.anchor=d.source.substring(1),y.anchor===""&&p(d,"BAD_ALIAS","Anchor cannot be an empty string")),r&&(y.spaceBefore=!0),c&&(y.comment=c,y.range[2]=m),y}function B5({options:e},{offset:t,source:s,end:a},r){const c=new zm(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=ul(a,d,e.strict,r);return c.range=[t,d,f.offset],f.comment&&(c.comment=f.comment),c}function q5(e,t,{offset:s,start:a,value:r,end:c},d){const f=Object.assign({_directives:t},e),m=new nd(void 0,f),p={atKey:!1,atRoot:!0,directives:m.directives,options:m.options,schema:m.schema},v=Ar(a,{indicator:"doc-start",next:r??c?.[0],offset:s,onError:d,parentIndent:0,startOnNewline:!0});v.found&&(m.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")),m.contents=r?C1(p,r,v,d):Im(p,v.end,a,null,v,d);const y=m.contents.range[2],b=ul(c,y,!1,d);return b.comment&&(m.comment=b.comment),m.range=[s,y,b.offset],m}function Mo(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 Cx(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 H5{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(s,a,r,c)=>{const d=Mo(s);c?this.warnings.push(new w5(d,a,r)):this.errors.push(new Gc(d,a,r))},this.directives=new cn({version:t.version||"1.2"}),this.options=t}decorate(t,s){const{comment:a,afterEmptyLine:r}=Cx(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:Cx(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=Mo(t);c[0]+=s,this.onError(c,"BAD_DIRECTIVE",a,r)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const s=q5(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 Gc(Mo(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 Gc(Mo(t),"UNEXPECTED_TOKEN",a));break}this.doc.directives.docEnd=!0;const s=ul(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 Gc(Mo(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 nd(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 k1="\uFEFF",z1="",E1="",Op="";function Z5(e){switch(e){case k1:return"byte-order-mark";case z1:return"doc-mode";case E1:return"flow-error-end";case Op: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 Wn(e){switch(e){case void 0:case" ":case`
203
+ `:case"\r":case" ":return!0;default:return!1}}const kx=new Set("0123456789ABCDEFabcdef"),F5=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Kc=new Set(",[]{}"),G5=new Set(` ,[]{}
204
+ \r `),Qh=e=>!e||G5.has(e);class K5{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==="...")&&Wn(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]===k1&&(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 z1,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==="...")&&Wn(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&&!Wn(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===":")&&Wn(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(Qh),"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("..."))&&Wn(r[3]))&&!(a===this.indentNext-1&&this.flowLevel===1&&(r[0]==="]"||r[0]==="}")))return this.flowLevel=0,yield E1,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(Qh),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const d=this.charAt(1);if(this.flowKey||Wn(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=>Wn(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 Op,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(Wn(c)||t&&Kc.has(c))break;s=a}else if(Wn(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&&Kc.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&&Kc.has(r))break;s=a}return!r&&!this.atEnd?this.setNext("plain-scalar"):(yield Op,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(Qh))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const t=this.flowLevel>0,s=this.charAt(1);if(Wn(s)||t&&Kc.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(;!Wn(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(F5.has(s))s=this.buffer[++t];else if(s==="%"&&kx.has(this.buffer[t+1])&&kx.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 V5{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 zx(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 O1(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 Vc(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 gr(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 Ex(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,O1(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 Q5{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 K5,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=Z5(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"&&Ex(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&&zx(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":{zx(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=Vc(this.peek(2)),a=gr(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 m=s.sep[f];switch(m.type){case"newline":d.push(f);break;case"space":break;case"comment":m.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(O1(s.key)&&!_i(s.sep,"newline")){const d=gr(s.start),f=s.key,m=s.sep;m.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:m}]})}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=gr(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=Vc(a),c=gr(r);Ex(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=Vc(t),a=gr(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=Vc(t),a=gr(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 Y5(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new V5||null,prettyErrors:t}}function X5(e,t={}){const{lineCounter:s,prettyErrors:a}=Y5(t),r=new Q5(s?.addNewLine),c=new H5(t),d=Array.from(c.compose(r.parse(e)));if(a&&s)for(const f of d)f.errors.forEach(Nx(e,s)),f.warnings.forEach(Nx(e,s));return d.length>0?d:Object.assign([],{empty:!0},c.streamInfo())}function J5({onApplied:e}){const[t,s]=N.useState(""),[a,r]=N.useState(!1),[c,d]=N.useState([]),[f,m]=N.useState([]),p=async()=>{if(!t.trim())return;r(!0),d([]),m([]);const v=X5(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 Sj(w);b.push(`Applied "${_.displayName||_.name}" (revision ${_.configRevision})`)}catch(_){y.push(`Document ${x+1}: ${_ instanceof Error?_.message:String(_)}`)}}d(b),m(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(de,{type:"button",disabled:!t.trim()||a,onClick:p,children:a?"Applying...":"Apply"})})]})}function W5(){const{dashboard:e,refetch:t}=Ca(),s=e?.projects??[],a=wa(),[r,c]=N.useState(!1),[d,f]=N.useState(""),[m,p]=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 il(z,{displayName:m||d,canonicalDomain:v,country:b,language:j});t(),f(""),p(""),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(de,{type:"button",onClick:()=>c(T=>!T),children:[l.jsx(jb,{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:m,onChange:T=>p(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(de,{type:"button",disabled:!z||!v||_,onClick:M,children:_?"Creating...":"Create project"}),l.jsx(de,{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(pt,{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(Mu,{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(de,{type:"button",onClick:()=>c(!0),children:[l.jsx(jb,{className:"size-4 mr-1.5"}),"Add project"]})]}),l.jsx(J5,{onApplied:()=>{t()}})]})}function Zo({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 R1({run:e}){const{openRun:t}=rl();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(Mu,{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(de,{variant:"outline",size:"sm",type:"button",onClick:()=>t(e.id),children:"View run"})]})}function iu({value:e,label:t,delta:s,tone:a,description:r,tooltip:c,isNumeric:d=!0}){const p=2*Math.PI*48,v=Number.parseInt(e,10),y=d&&!Number.isNaN(v)?Math.min(v/100,1):.5,b=p*(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:p,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(Zo,{text:c})]}),l.jsx("p",{className:"gauge-delta",children:s}),l.jsx("p",{className:"gauge-description",children:r})]})}function Ox({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 e4(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 t4({evidence:e}){const{openEvidence:t}=rl(),[s,a]=N.useState(new Set),r=N.useMemo(()=>{const d=new Map;for(const f of e){const m=d.get(f.keyword)??[];d.set(f.keyword,[...m,f])}return[...d.entries()].map(([f,m])=>({phrase:f,items:m}))},[e]),c=d=>{a(f=>{const m=new Set(f);return m.has(d)?m.delete(d):m.add(d),m})};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 m=s.has(d),p=f.map(j=>j.citationState),v=p.includes("cited")?"cited":p.includes("emerging")?"emerging":p.includes("lost")?"lost":p.every(j=>j==="pending")?"pending":"not-cited",y=e4(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":m,children:[l.jsx("td",{children:l.jsx(Du,{size:14,className:`transition-transform duration-150 text-zinc-500 ${m?"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(Yo,{provider:j.provider},j.id))})]})}),l.jsx("td",{children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(bp,{state:v}),l.jsxs("span",{className:"text-[11px] text-zinc-500",children:[b,"/",f.length]})]})}),l.jsx("td",{children:l.jsx(Ox,{history:y})}),l.jsx("td",{className:"evidence-change-cell",children:x}),l.jsx("td",{})]}),m&&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(Yo,{provider:j.provider})}),l.jsx("td",{children:l.jsx(bp,{state:j.citationState})}),l.jsx("td",{children:l.jsx(Ox,{history:j.runHistory})}),l.jsx("td",{className:"evidence-change-cell",children:j.changeLabel}),l.jsx("td",{children:l.jsx(de,{variant:"ghost",size:"sm",type:"button",onClick:w=>{w.stopPropagation(),t(j.id)},children:"View"})})]},j.id))]},d)})})]})})}function n4({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:lE(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 s4=["7d","30d","90d","all"],i4=["gap","cited","uncited"],A1={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 a4({projectName:e}){const[t,s]=N.useState("30d"),[a,r]=N.useState(null),[c,d]=N.useState(null),[f,m]=N.useState(null),[p,v]=N.useState(null),[y,b]=N.useState(!0);return N.useEffect(()=>{let x=!1;return b(!0),Promise.all([$j(e,t),Ij(e,t),Bj(e,t)]).then(([j,w,_])=>{x||(r(j),d(w),m(_),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(Zo,{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:s4.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(iu,{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(r4,{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(Zo,{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:i4.map(x=>{const j=x==="cited"?c.cited.length:x==="gap"?c.gap.length:c.uncited.length,w=p===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(o4,{gaps:c,filter:p})]})]}),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(Zo,{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(l4,{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 ${A1[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 r4({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,m=1,p=e.map((y,b)=>{const x=c.left+(e.length>1?b/(e.length-1)*d:d/2),j=c.top+f-y.citationRate/m*f;return{x,y:j}}),v=p.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:[(m*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:p[t].x,y1:c.top,x2:p[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}=p[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}=p[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=p[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 o4({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 l4({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:`${A1[s.category]??"bg-zinc-600"} transition-all`,style:{width:`${a}%`},title:`${s.label}: ${(s.percentage*100).toFixed(1)}%`},s.category)})})}function c4({projectName:e}){const[t,s]=N.useState(!1),[a,r]=N.useState([]),[c,d]=N.useState([]),[f,m]=N.useState([]),[p,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),[pe,Ee]=N.useState(!1),[we,H]=N.useState(!1),[Z,oe]=N.useState(!1),[me,ee]=N.useState(!1),[D,G]=N.useState(!1),[ne,ae]=N.useState(!1),[le,he]=N.useState(!1),[ue,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,Pe]=N.useState(!1),[ke,Te]=N.useState("indexed"),[kt,Vn]=N.useState([]),[bs,Fs]=N.useState(null),[xs,Gs]=N.useState(!1),[os,_e]=N.useState(null),[wn,te]=N.useState(null),$e=a.find(P=>P.connectionType==="gsc"),id=f.length>0||p.length>0||y.length>0;async function dl(P){if(!P){d([]),_("");return}oe(!0);try{const{sites:ce}=await _j(e);d(ce),_(P.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 P=await Ej(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});m(P)}catch(P){m([]),_e(P instanceof Error?P.message:"Failed to load GSC performance data")}finally{G(!1)}}async function Ss(){ae(!0);try{const[P,ce]=await Promise.all([Rj(e,{url:I.trim()||void 0,limit:20}),Aj(e)]);v(P),b(ce)}catch(P){v([]),b([]),_e(P instanceof Error?P.message:"Failed to load GSC inspection history")}finally{ae(!1)}}async function Bi(){Ye(!0);try{const[P,ce]=await Promise.all([Tj(e),Dj(e).catch(()=>[])]);Ze(P),Vn(ce)}catch(P){Ze(null),Vn([]),_e(P instanceof Error?P.message:"Failed to load coverage data")}finally{Ye(!1)}}async function ls(P){Gs(!0),_e(null);try{const ce=await jp(e,{urls:P}),{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 za(){Gs(!0),_e(null);try{const P=await jp(e,{urls:[],allUnindexed:!0}),{succeeded:ce,failed:et,total:Kt}=P.summary;te(et===0?`Indexing requested for ${ce} unindexed URL${ce!==1?"s":""}.`:`Indexing requested: ${ce}/${Kt} succeeded, ${et} failed.`)}catch(P){_e(P instanceof Error?P.message:"Failed to request indexing")}finally{Gs(!1)}}async function cs(){if(Ct.trim()){re(!0),_e(null);try{await kj(e,"gsc",Ct.trim()),r(P=>P.map(ce=>ce.connectionType==="gsc"?{...ce,sitemapUrl:Ct.trim()}:ce)),te("Sitemap URL saved."),St("")}catch(P){_e(P instanceof Error?P.message:"Failed to save sitemap URL")}finally{re(!1)}}}async function fl(){lt(!0),_e(null);try{const P=await Uj(e);Gt(P.sitemaps),r(ce=>ce.map(et=>et.connectionType==="gsc"?{...et,sitemapUrl:P.primarySitemapUrl}:et)),te(`Discovered ${P.sitemaps.length} sitemap(s). Primary sitemap saved and inspection queued (run ${P.run.id}).`)}catch(P){_e(P instanceof Error?P.message:"Failed to discover sitemaps")}finally{lt(!1)}}async function hl(){_t(!0),_e(null);try{const P=await Mj(e);Gt(P.sitemaps),P.sitemaps.length===0&&te("No sitemaps found in this GSC property. Submit a sitemap in Google Search Console first.")}catch(P){_e(P instanceof Error?P.message:"Failed to list sitemaps")}finally{_t(!1)}}async function Ea(){se(!0),_e(null);try{const[P,ce]=await Promise.all([wm().catch(()=>null),wj(e).catch(()=>[])]);s(!!P?.google?.configured),r(ce);const et=ce.find(Kt=>Kt.connectionType==="gsc");await Promise.all([dl(et),Ks(),Ss(),Bi()])}finally{se(!1)}}N.useEffect(()=>{Ea()},[e]);async function qi(){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:P}=await jj(e,"gsc");if(!P.startsWith("https://accounts.google.com/")){_e("Unexpected OAuth redirect URL. Please try again.");return}const ce=window.open(P,"_blank","width=600,height=700");if(!ce){window.location.assign(P);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),Ea())},1e3)}catch(P){_e(P instanceof Error?P.message:"Failed to start OAuth flow")}finally{Ee(!1)}}async function ad(){_e(null),te(null);try{await Nj(e,"gsc"),r(P=>P.filter(ce=>ce.connectionType!=="gsc")),d([]),_("")}catch(P){_e(P instanceof Error?P.message:"Failed to disconnect")}}async function pl(){if(w){ee(!0),_e(null);try{await Cj(e,"gsc",w),r(P=>P.map(ce=>ce.connectionType==="gsc"?{...ce,propertyId:w}:ce)),te("GSC property updated.")}catch(P){_e(P instanceof Error?P.message:"Failed to save GSC property")}finally{ee(!1)}}}async function ml(){H(!0),_e(null),te(null);try{await zj(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(P){_e(P instanceof Error?P.message:"Failed to trigger sync")}finally{H(!1)}}async function $r(){if(C.trim()){he(!0),_e(null),te(null);try{const P=await Oj(e,C.trim());j(P),E(""),await Ss()}catch(P){_e(P instanceof Error?P.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:$e&&l.jsx(de,{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:$e?"positive":t?"caution":"negative",children:$e?"Connected":t?"Ready to connect":"App credentials missing"})]}),$e?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:$e.domain}),l.jsx("button",{type:"button",className:"ml-auto text-xs text-zinc-500 hover:text-rose-400 transition-colors",onClick:ad,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:$e.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:$e.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:Ac($e.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(de,{type:"button",variant:"outline",size:"sm",disabled:pe,onClick:qi,children:pe?"Opening…":"Connect Google Search Console"}):l.jsx(de,{type:"button",variant:"outline",size:"sm",asChild:!0,children:l.jsx(pt,{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."})]})]})]}),$e&&!$e.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(de,{type:"button",size:"sm",disabled:Qe||!$e.propertyId,onClick:fl,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:P=>St(P.target.value),onKeyDown:P=>P.key==="Enter"&&void cs()}),l.jsx(de,{type:"button",size:"sm",variant:"outline",disabled:sn||!Ct.trim(),onClick:cs,children:sn?"Saving…":"Save sitemap URL"})]})]})]})]})}),($e||id)&&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:[ue&&ue.notIndexed.length>0&&l.jsx(de,{type:"button",variant:"outline",size:"sm",disabled:xs,onClick:()=>{za()},children:xs?"Requesting…":`Request indexing (${ue.notIndexed.length})`}),l.jsx(de,{type:"button",variant:"outline",size:"sm",disabled:ge,onClick:()=>{Bi()},children:ge?"Loading…":"Refresh coverage"})]})]}),ue&&ue.summary.total>0?l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"mt-6 flex flex-col items-center",children:(()=>{const P=ue.summary.indexed+ue.summary.notIndexed,ce=P>0?ue.summary.indexed/P:0,et=P>0?ue.summary.notIndexed/P: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"}}),ue.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:ue.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:ue.summary.notIndexed.toLocaleString()}),l.jsxs("p",{className:"text-[11px] uppercase tracking-wide text-zinc-500",children:["Not indexed",(ue.reasonGroups??[]).length>0&&l.jsxs("span",{className:"ml-1 text-zinc-600",children:["· ",(ue.reasonGroups??[]).length," ",(ue.reasonGroups??[]).length===1?"reason":"reasons"]})]})]})]}),ue.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:ue.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(P=>{const ce=P==="indexed"?ue.indexed.length:P==="notIndexed"?ue.notIndexed.length:ue.deindexed.length,et=P==="indexed"?"Indexed":P==="notIndexed"?"Not Indexed":"Deindexed";return l.jsxs("button",{type:"button",className:`rounded-full px-3 py-1 text-xs font-medium transition-colors ${ke===P?"bg-zinc-700 text-zinc-100":"text-zinc-400 hover:bg-zinc-800 hover:text-zinc-200"}`,onClick:()=>{Te(P),Fs(null)},children:[et," (",ce,")"]},P)})}),l.jsxs("div",{className:"mt-3 overflow-x-auto",children:[ke==="indexed"&&ue.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:ue.indexed.map(P=>l.jsxs("tr",{children:[l.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:P.url}),l.jsx("td",{className:"text-zinc-400",children:P.verdict??"Unknown"}),l.jsx("td",{className:"text-zinc-400",children:P.crawlTime?P.crawlTime.split("T")[0]:"—"}),l.jsx("td",{className:"text-zinc-400",children:P.isMobileFriendly===!0?"Yes":P.isMobileFriendly===!1?"No":"—"})]},P.id))})]}),ke==="notIndexed"&&!bs&&(ue.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:(ue.reasonGroups??[]).map(P=>l.jsxs("tr",{className:"cursor-pointer hover:bg-zinc-800/40",onClick:()=>Fs(P.reason),children:[l.jsx("td",{className:"text-zinc-200",children:P.reason}),l.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:P.count})]},P.reason))})]}),ke==="notIndexed"&&!bs&&(ue.reasonGroups??[]).length===0&&ue.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:ue.notIndexed.map(P=>l.jsxs("tr",{children:[l.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:P.url}),l.jsx("td",{className:"text-zinc-400",children:P.indexingState??"Unknown"}),l.jsx("td",{className:"text-zinc-400",children:P.coverageState??"Unknown"})]},P.id))})]}),ke==="notIndexed"&&bs&&(()=>{const P=(ue.reasonGroups??[]).find(ce=>ce.reason===bs);return P?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:P.reason}),l.jsxs("p",{className:"mt-1 text-xs text-zinc-500",children:[P.count," affected page",P.count!==1?"s":""]})]}),l.jsx(de,{type:"button",variant:"outline",size:"sm",disabled:xs,onClick:()=>{ls(P.urls.map(ce=>ce.url))},children:xs?"Requesting…":`Request indexing (${P.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:P.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"&&ue.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:ue.deindexed.map((P,ce)=>l.jsxs("tr",{children:[l.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:P.url}),l.jsx("td",{className:"text-zinc-400",children:P.previousState}),l.jsx("td",{className:"text-zinc-400",children:P.currentState}),l.jsx("td",{className:"text-zinc-400",children:P.transitionDate.split("T")[0]})]},`${P.url}-${ce}`))})]}),(ke==="indexed"&&ue.indexed.length===0||ke==="notIndexed"&&!bs&&ue.notIndexed.length===0||ke==="deindexed"&&ue.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(de,{type:"button",variant:"outline",size:"sm",disabled:D,onClick:()=>{Ks()},children:D?"Loading…":"Apply filters"})]}),f.length>0&&(()=>{const P=new Map;for(const Ie of f){const tt=P.get(Ie.date);tt?(tt.clicks+=Ie.clicks,tt.impressions+=Ie.impressions):P.set(Ie.date,{clicks:Ie.clicks,impressions:Ie.impressions})}const ce=[...P.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},rd=wt-en.left-en.right,Vs=jn-en.top-en.bottom,Qs=rd/ce.length,us=Math.max(Math.min(Qs*.35,24),4),Oa=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)},Qn=4,ds=Math.ceil(Ys(et)/Qn)*Qn,Xs=Array.from({length:Qn+1},(Ie,tt)=>ds/Qn*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,Ra=tt.impressions/ds*Vs,Ir=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-Oa/2,y:en.top+Vs-Ra,width:us,height:Math.max(Ra,1),rx:2,fill:"#3b82f6",opacity:.85}),l.jsx("rect",{x:an+Oa/2,y:en.top+Vs-Ir,width:us,height:Math.max(Ir,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)),Ra=en.left+Qs*an+Qs/2;return l.jsx("text",{x:Ra,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:P=>R(ce=>({...ce,startDate:P.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:P=>R(ce=>({...ce,endDate:P.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:P=>R(ce=>({...ce,query:P.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:P=>R(ce=>({...ce,page:P.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:P=>R(ce=>({...ce,limit:P.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((P,ce)=>l.jsxs("tr",{children:[l.jsx("td",{className:"text-zinc-400",children:P.date}),l.jsx("td",{className:"max-w-xs truncate text-zinc-200",children:P.query}),l.jsx("td",{className:"max-w-xs truncate text-zinc-400",children:P.page}),l.jsx("td",{className:"text-right tabular-nums text-zinc-300",children:P.clicks.toLocaleString()}),l.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:P.impressions.toLocaleString()}),l.jsxs("td",{className:"text-right tabular-nums text-zinc-400",children:[(P.ctr*100).toFixed(1),"%"]}),l.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:P.position.toFixed(1)})]},`${P.date}:${P.query}:${P.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:P=>E(P.target.value),onKeyDown:P=>P.key==="Enter"&&void $r()}),l.jsx(de,{type:"button",size:"sm",disabled:le||!$e?.propertyId||!C.trim(),onClick:$r,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:Nb(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:Ac(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(de,{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:P=>ie(P.target.value)}),l.jsx(de,{type:"button",size:"sm",variant:"outline",disabled:ne,onClick:()=>{Ss()},children:"Apply filter"})]}),p.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:p.map(P=>l.jsxs("tr",{children:[l.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:P.url}),l.jsx("td",{className:"text-zinc-300",children:P.indexingState??"Unknown"}),l.jsx("td",{className:"text-zinc-400",children:P.verdict??"Unknown"}),l.jsx("td",{className:"text-zinc-400",children:P.coverageState??"Unknown"}),l.jsx("td",{className:"text-zinc-400",children:Nb(P.isMobileFriendly)}),l.jsx("td",{className:"text-zinc-400",children:Ac(P.inspectedAt)})]},P.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(P=>l.jsxs("tr",{children:[l.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:P.url}),l.jsx("td",{className:"text-zinc-400",children:P.previousState??"Unknown"}),l.jsx("td",{className:"text-zinc-300",children:P.currentState??"Unknown"}),l.jsx("td",{className:"text-zinc-400",children:Ac(P.transitionDate)})]},`${P.url}:${P.transitionDate}`))})]})}):l.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No deindexed transitions recorded."})]})]}),$e&&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:()=>Pe(P=>!P),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:P=>_(P.target.value),children:c.length===0?l.jsx("option",{value:"",children:Z?"Loading properties…":"No properties available"}):c.map(P=>l.jsxs("option",{value:P.siteUrl,children:[P.siteUrl," · ",P.permissionLevel]},P.siteUrl))}),l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsx(de,{type:"button",size:"sm",variant:"outline",disabled:Z,onClick:()=>{dl($e)},children:Z?"Refreshing…":"Refresh properties"}),l.jsx(de,{type:"button",size:"sm",disabled:!w||me,onClick:pl,children:me?"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:P=>z(P.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:P=>T(P.target.checked)}),"Replace existing imported rows for the requested range"]})]}),l.jsx(de,{type:"button",size:"sm",disabled:we||!$e.propertyId,onClick:ml,children:we?"Queueing…":"Queue sync"}),!$e.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:[$e.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:$e.sitemapUrl})]}),l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsx(de,{type:"button",size:"sm",variant:"outline",disabled:Wt||!$e.propertyId,onClick:()=>{hl()},children:Wt?"Loading…":"Browse sitemaps from GSC"}),l.jsx(de,{type:"button",size:"sm",variant:"outline",disabled:Qe||!$e.propertyId,onClick:fl,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(P=>{const ce=P.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:P.path}),P.lastSubmitted&&l.jsxs("p",{className:"text-zinc-500",children:["Submitted: ",P.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(P.path),children:"Use"})]})]},P.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:$e.sitemapUrl?"Update sitemap URL…":"https://example.com/sitemap.xml",value:Ct,onChange:P=>St(P.target.value),onKeyDown:P=>P.key==="Enter"&&Ct.trim()&&void cs()}),l.jsx(de,{type:"button",size:"sm",disabled:sn||!Ct.trim(),onClick:cs,children:sn?"Saving…":$e.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(de,{type:"button",size:"sm",variant:"outline",disabled:ft||!$e.propertyId,onClick:()=>{const ce=document.getElementById(`gsc-sitemap-inspect-${e}`)?.value?.trim()||$e.sitemapUrl||void 0;fe(!0),Lj(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"})]}),!$e.propertyId&&l.jsx("p",{className:"text-xs text-amber-400",children:"Select a Search Console property first."})]})]})]})]})]})]})}function u4({project:e,onUpdateProject:t,onRefresh:s}){const[a,r]=N.useState(!1),[c,d]=N.useState(!1),[f,m]=N.useState(null),[p,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(""),[pe,Ee]=N.useState(""),[we,H]=N.useState(""),[Z,oe]=N.useState(""),[me,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),m(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(!(!p.trim()||!y.trim()||!x.trim()||!w.trim())){d(!0),m(null);try{await t(e.name,{displayName:p.trim(),canonicalDomain:y.trim(),ownedDomains:C,country:x.trim(),language:w.trim()}),r(!1)}catch(fe){m(fe instanceof Error?fe.message:"Failed to save")}finally{d(!1)}}}async function le(){const fe=Q.trim(),Qe=pe.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};me.trim()&&(_t.timezone=me.trim()),await oj(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 lj(e.name,fe),s()}catch(Qe){T(Qe instanceof Error?Qe.message:"Failed to remove location")}finally{R(!1)}}async function ue(fe){R(!0),T(null);try{await cj(e.name,fe),s()}catch(Qe){T(Qe instanceof Error?Qe.message:"Failed to set default location")}finally{R(!1)}}const Ze=p!==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()&&pe.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(de,{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:()=>m(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:p,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(de,{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(de,{type:"button",disabled:c||!Ze||!p.trim()||!y.trim(),onClick:ae,children:c?"Saving...":"Save changes"}),l.jsx(de,{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:()=>ue(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:pe,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:me,onChange:fe=>ee(fe.target.value),placeholder:"America/New_York"})]})]}),l.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[l.jsx(de,{type:"button",size:"sm",disabled:L||!ft,onClick:le,children:L?"Adding...":"Add location"}),l.jsx(de,{type:"button",size:"sm",variant:"outline",disabled:L,onClick:()=>{ie(!1),T(null)},children:"Cancel"})]})]}):l.jsx(de,{type:"button",size:"sm",variant:"outline",onClick:()=>ie(!0),children:"+ Add location"})]})]})]})})})]})}const d4=[{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"}],Rx=["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 f4({projectName:e}){const[t,s]=N.useState("loading"),[a,r]=N.useState(!1),[c,d]=N.useState("daily"),[f,m]=N.useState(6),[p,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(()=>{pj(e).then(s).catch(()=>s(null))},[e]);const L=()=>{if(t&&t!=="loading"){const Q=a2(t.preset??null,t.cronExpr);d(Q.freq),m(Q.hour),v(Q.customCron);const se=Rx.includes(t.timezone);b(se?t.timezone:"Other"),j(!se),_(se?"":t.timezone)}else d("daily"),m(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=p.trim():se.preset=i2(c,f);const pe=await Sp(e,se);s(pe),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 Sp(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 mj(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(de,{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:r2(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(de,{type:"button",variant:"outline",size:"sm",disabled:C,onClick:I,children:t.enabled?"Pause":"Resume"}),l.jsx(de,{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:d4.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=>m(parseInt(Q.target.value)),children:Array.from({length:24},(Q,se)=>l.jsx("option",{value:se,children:cp(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:p,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:[Rx.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(de,{type:"button",variant:"outline",size:"sm",onClick:()=>{r(!1),T(null)},children:"Cancel"}),l.jsx(de,{type:"button",size:"sm",disabled:C||c==="custom"&&!p.trim(),onClick:R,children:C?"Saving...":"Save schedule"})]})]})]})}const h4=[{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 p4({projectName:e}){const[t,s]=N.useState("loading"),[a,r]=N.useState(!1),[c,d]=N.useState(""),[f,m]=N.useState(["citation.lost","citation.gained"]),[p,v]=N.useState(!1),[y,b]=N.useState(null),[x,j]=N.useState({});N.useEffect(()=>{gj(e).then(s).catch(()=>s([]))},[e]);const w=O=>{m(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 yj(e,{channel:"webhook",url:c.trim(),events:f});s(z=>z==="loading"?[O]:[...z,O]),d(""),m(["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 vj(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 bj(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(de,{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:h4.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(de,{type:"button",variant:"outline",size:"sm",onClick:()=>{r(!1),b(null)},children:"Cancel"}),l.jsx(de,{type:"button",size:"sm",disabled:p||!c.trim()||f.length===0,onClick:_,children:p?"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(de,{variant:"ghost",size:"sm",type:"button",disabled:x[O.id]?.state==="testing",onClick:()=>E(O.id),children:"Test"}),l.jsx(de,{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 m4=Fu();function g4({insights:e}){const{openEvidence:t}=rl(),[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(Du,{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(bp,{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(Yo,{provider:f.provider})})]}),l.jsx("button",{type:"button",className:"text-xs text-zinc-400 hover:text-zinc-200 whitespace-nowrap transition-colors",onClick:m=>{m.stopPropagation(),t(f.evidenceId)},children:"View →"})]},f.evidenceId))})]},r.id)})})}function Bm({tab:e}){const{projectId:t}=Au({from:"/projects/$projectId"}),s=wa(),{dashboard:a,refetch:r}=Ca(),c=a??m4.dashboard,d=iM(c,t),[f,m]=N.useState(!1),[p,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),[pe,Ee]=N.useState(""),[we,H]=N.useState(!1),[Z,oe]=N.useState(void 0),[me,ee]=N.useState(!1),[D,G]=N.useState(null),[ne,ae]=N.useState(!1),le=d?.visibilityEvidence??[],he=d?.project.name??"",ue=N.useMemo(()=>new Set(le.map(re=>re.location??"")),[le]),Ze=ue.has(""),ge=N.useMemo(()=>[...ue].filter(Boolean),[ue]);N.useEffect(()=>{if(Z===void 0||Z===""||!he){G(null),ae(!1);return}ae(!0),bm(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[Pe,ke]of Object.entries(Ue.providerRuns??{}))re.set(`${Ue.keyword}::${Pe}`,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(Pe=>({runId:Pe.runId,citationState:Pe.citationState,createdAt:Pe.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 Pe=Ye.get(`${Ue.keyword}::${Ue.provider}`)??Ye.get(`${Ue.keyword}::`);return Pe?{...Ue,runHistory:Pe}: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(de,{asChild:!0,children:l.jsx(pt,{to:"/",children:"Return to overview"})})]})});async function fe(){b(!0),j(null);try{await Sm(he),r()}catch(re){j(re instanceof Error?re.message:"Failed to trigger run")}finally{b(!1)}}async function Qe(){v(!0);try{await uj(he),s({to:"/"}),r()}catch(re){console.error("Failed to delete project:",re)}finally{v(!1)}}async function lt(){const re=await dj(he),Ue=typeof re=="string"?re:JSON.stringify(re,null,2),Pe=new Blob([Ue],{type:"text/yaml"}),ke=URL.createObjectURL(Pe),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 aj(he,re),r(),E(""),_(!1)}finally{z(!1)}}}async function _t(){const re=L.trim();if(re){ie(!0);try{const Pe=(await vm(he)).map(Te=>Te.domain),ke=[...new Set([...Pe,re])];await xm(he,ke),r(),R(""),T(!1)}finally{ie(!1)}}}async function nn(){const re=pe.trim();if(re){H(!0);try{const Ue=d?.project.ownedDomains??[];await xp(he,[...Ue,re]),r(),Ee(""),se(!1)}finally{H(!1)}}}async function Gt(re){H(!0);try{const Ue=d?.project.ownedDomains??[];await xp(he,Ue.filter(Pe=>Pe!==re)),r()}finally{H(!1)}}async function Ct(re,Ue){await rj(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(de,{type:"button",variant:"destructive",disabled:p,onClick:Qe,children:p?"Deleting...":"Yes, delete project"}),l.jsx(de,{type:"button",variant:"outline",disabled:p,onClick:()=>m(!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:pe,onChange:re=>Ee(re.target.value),onKeyDown:re=>re.key==="Enter"&&nn(),autoFocus:!0}),l.jsx(de,{type:"button",size:"sm",disabled:!pe.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(de,{type:"button",variant:"outline",size:"icon",onClick:lt,"aria-label":"Export project as YAML",children:l.jsx(Iz,{className:"h-4 w-4 text-zinc-400"})}),l.jsx(de,{type:"button",variant:"outline",size:"icon",onClick:()=>m(!0),"aria-label":"Delete project",children:l.jsx(t2,{className:"h-4 w-4 text-zinc-400"})}),l.jsx(de,{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(pt,{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(iu,{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(iu,{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(iu,{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(Zo,{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 gap-0.5",children:[l.jsx(Yo,{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(g4,{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(de,{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(de,{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=>ue.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 ${me?"filter-chip-active":""}`,type:"button","aria-pressed":me,onClick:()=>ee(re=>!re),title:"Side-by-side location comparison",children:"Compare"})]}),l.jsx(t4,{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(de,{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(de,{type:"button",size:"sm",disabled:!L.trim()||I,onClick:_t,children:I?"Adding...":"Add"})]}),l.jsx(n4,{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(R1,{run:re},re.id))})]}),l.jsx(u4,{project:{...d.project,displayName:d.project.displayName??d.project.name,defaultLocation:d.project.defaultLocation??null},onUpdateProject:Ct,onRefresh:()=>{r()}}),l.jsx(f4,{projectName:d.project.name}),l.jsx(p4,{projectName:d.project.name})]}):e==="analytics"?l.jsx(a4,{projectName:d.project.name}):l.jsx(c4,{projectName:d.project.name})]})}const y4="modulepreload",v4=function(e,t){return new URL(e,t).href},Ax={},b4=function(t,s,a){let r=Promise.resolve();if(s&&s.length>0){let p=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]"),m=f?.nonce||f?.getAttribute("nonce");r=p(s.map(v=>{if(v=v4(v,a),v in Ax)return;Ax[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":y4,y||(x.as="script"),x.crossOrigin="",x.href=v,m&&x.setAttribute("nonce",m),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 x4(){const{dashboard:e}=Ca(),t=e?.runs??[],[s,a]=N.useState("all"),r=s==="all"?t:t.filter(d=>d.status===s),c=()=>{b4(async()=>{const{triggerAllRuns:d}=await Promise.resolve().then(()=>XL);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(de,{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":Lu(d)},d))}),l.jsx("div",{className:"run-list",children:r.length>0?r.map(d=>l.jsx(R1,{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 S4={openai:"https://platform.openai.com/api-keys",claude:"https://platform.claude.com/settings/keys"},w4={gemini:"Gemini",openai:"OpenAI",claude:"Claude",local:"Local"},j4={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 N4({providerName:e,onSaved:t}){const s=e.toLowerCase()==="local",[a,r]=N.useState(""),[c,d]=N.useState(""),[f,m]=N.useState(""),[p,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(p);Q!==void 0&&(ie.maxConcurrency=Q);const se=I(y);se!==void 0&&(ie.maxRequestsPerMinute=se);const pe=I(x);pe!==void 0&&(ie.maxRequestsPerDay=pe),await fj(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(""),m(""),v(""),b(""),j(""),z(!0),t()}catch(I){E(I instanceof Error?I.message:"Failed to update provider")}finally{_(!1)}}}const L=S4[e.toLowerCase()],R=j4[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=>m(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:p,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(de,{type:"button",size:"sm",disabled:!M||w,onClick:T,children:w?"Saving...":"Save"})]})}function _4({onSaved:e}){const[t,s]=N.useState(""),[a,r]=N.useState(""),[c,d]=N.useState(!1),[f,m]=N.useState(null),[p,v]=N.useState(!1),y=t.trim().length>0&&a.trim().length>0;async function b(){if(y){d(!0),m(null),v(!1);try{await hj({clientId:t.trim(),clientSecret:a.trim()}),s(""),r(""),v(!0),e()}catch(x){m(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}),p&&l.jsx("p",{className:"text-xs text-emerald-400",children:"Google OAuth credentials updated."}),l.jsx(de,{type:"button",size:"sm",disabled:!y||c,onClick:b,children:c?"Saving...":"Save Google OAuth app"})]})}function C4(){const[e,t]=N.useState(null),[s,a]=N.useState(null),[r,c]=N.useState(!1),[d,f]=N.useState("localhost"),[m,p]=N.useState("9222"),[v,y]=N.useState(!1);return N.useEffect(()=>{wp().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(de,{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 Pj(d,parseInt(m,10)||9222);const x=await wp().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:m,onChange:b=>p(b.target.value),"aria-label":"CDP port"})]}),l.jsx("div",{children:l.jsx(de,{type:"submit",size:"sm",disabled:v,children:v?"Saving…":"Save endpoint"})})]})]})}const k4={apiStatus:{state:"checking",detail:"Checking service health"},workerStatus:{state:"checking",detail:"Checking service health"}};function z4(){const e=al(),{dashboard:t}=Ca(),s=t?.settings??e?.dashboard?.settings,c=Gu(!e,e?.health).data??e?.health??k4,[d,f]=N.useState(null),[m,p]=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(de,{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(N4,{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(de,{type:"button",variant:"outline",size:"sm",onClick:()=>p(!m),children:m?"Cancel":s.google.state==="ready"?"Update OAuth app":"Configure Google OAuth"})}),m&&l.jsx(_4,{onSaved:()=>{p(!1)}})]}),l.jsx(C4,{}),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:yu(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:yu(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 E4=Fu(),O4=[{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 R4({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 A4(){const e=al(),{dashboard:t,refetch:s}=Ca(),a=t??e?.dashboard??E4.dashboard,r=a.settings,f=Gu(!e,e?.health).data??e?.health??{apiStatus:{label:"API",state:"checking",detail:"Checking service health"},workerStatus:{label:"Worker",state:"checking",detail:"Checking service health"}},m=PM(a.setup,f,r),p=wa(),[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,pe]=N.useState(!1),[Ee,we]=N.useState(""),[H,Z]=N.useState(!1),[oe,me]=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),[ue,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,Pe]=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),Vn=m.healthChecks.some(te=>te.id==="api"&&te.state==="ready"),bs=async()=>{if(!(!ke||!_)){pe(!0),Q(null);try{const te=await il(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{pe(!1)}}},Fs=async()=>{if(!T)return;const te=Te;if(te.length!==0){D(!0),me(null);try{await ij(T,te),Z(!0),s(),y(3)}catch($e){me($e instanceof Error?$e.message:"Failed to save key phrases")}finally{D(!1)}}},xs=async()=>{if(!(!T||!ne)){Ze(!0),Ye(null);try{const te=await xj(T,ne,le);if(te.keywords.length>0){const $e=Ee?Ee.trimEnd()+`
241
+ `+te.keywords.join(`
242
+ `):te.keywords.join(`
243
+ `);we($e)}}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 xm(T,te),lt(!0),s(),y(4)}catch($e){_t($e instanceof Error?$e.message:"Failed to save competitors")}finally{Gt(!1)}}},os=async()=>{if(T){Pe(!0),re(null);try{await Sm(T),St(!0),s()}catch(te){re(te instanceof Error?te.message:"Failed to trigger run")}finally{Pe(!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:m.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(pt,{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(de,{type:"button",disabled:!Vn,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(de,{type:"button",variant:"outline",onClick:_e,children:"Back"}),l.jsx(de,{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(de,{type:"button",variant:"outline",onClick:_e,children:"Back"}),l.jsx(de,{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(de,{type:"button",variant:"outline",onClick:_e,children:"Back"}),l.jsx(de,{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:[w4[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(de,{type:"button",variant:"outline",disabled:ue||!ne,onClick:xs,children:ue?"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(de,{type:"button",variant:"outline",onClick:_e,children:"Back"}),l.jsx(de,{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(de,{type:"button",variant:"outline",onClick:_e,children:"Back"}),l.jsx(de,{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(de,{type:"button",variant:"outline",onClick:_e,children:"Back"}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx(de,{type:"button",variant:"outline",onClick:()=>y(4),children:"Skip"}),l.jsx(de,{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(de,{type:"button",onClick:()=>p({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(de,{type:"button",variant:"outline",onClick:_e,children:"Back"}),l.jsx(de,{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(R4,{current:v,labels:O4}),l.jsx("section",{className:"setup-wizard",children:wn})]})}function T4(){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(de,{asChild:!0,children:l.jsx(pt,{to:"/",children:"Return to overview"})})]})})})}const ns=yz()({component:EM,validateSearch:e=>({runId:typeof e.runId=="string"?e.runId:void 0,evidenceId:typeof e.evidenceId=="string"?e.evidenceId:void 0})}),D4=ss({getParentRoute:()=>ns,path:"/",component:BM,beforeLoad:({context:e})=>{const t=e.queryClient.getQueryData(zi.projects.all);if(t&&t.length===0)throw Bp({to:"/setup"})}}),L4=ss({getParentRoute:()=>ns,path:"/projects",component:W5}),sd=ss({getParentRoute:()=>ns,path:"/projects/$projectId",component:()=>l.jsx(Xp,{})}),M4=ss({getParentRoute:()=>sd,path:"/",component:()=>l.jsx(Bm,{tab:"overview"})}),U4=ss({getParentRoute:()=>sd,path:"/search-console",component:()=>l.jsx(Bm,{tab:"search-console"})}),P4=ss({getParentRoute:()=>sd,path:"/analytics",component:()=>l.jsx(Bm,{tab:"analytics"})}),$4=ss({getParentRoute:()=>ns,path:"/runs",component:x4}),I4=ss({getParentRoute:()=>ns,path:"/settings",component:z4,beforeLoad:({context:e})=>{}}),B4=ss({getParentRoute:()=>ns,path:"/setup",component:A4,beforeLoad:({context:e})=>{const t=e.queryClient.getQueryData(zi.projects.all);if(t&&t.length>0)throw Bp({to:"/"})}}),q4=ss({getParentRoute:()=>ns,path:"*",component:T4}),H4=ns.addChildren([D4,L4,sd.addChildren([M4,U4,P4]),$4,I4,B4,q4]);function Z4(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath:"/"}const Tx=Z4(),F4=Tx==="/"?"":Tx.replace(/\/$/,"");function G4(e,t){return kz({routeTree:H4,basepath:F4||"/",context:{queryClient:e},...t?.initialEntries})}const T1=Az(),K4=G4(T1),D1=document.getElementById("root");if(!D1)throw new Error("Expected #root element for web app bootstrap.");J_.createRoot(D1).render(l.jsx(N.StrictMode,{children:l.jsx(NC,{client:T1,children:l.jsx(Oz,{router:K4})})}));