@ainyc/canonry 1.20.0 → 1.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +42 -4
- package/assets/assets/index-3PC6-Oip.css +1 -0
- package/assets/assets/index-Bd0xUz_T.js +246 -0
- package/assets/index.html +2 -2
- package/bin/canonry.mjs +1 -1
- package/dist/{chunk-V7JJJDPL.js → chunk-FR3LEBGX.js} +2012 -633
- package/dist/cli.js +4199 -3067
- package/dist/index.d.ts +1 -6
- package/dist/index.js +1 -1
- package/package.json +6 -5
- package/assets/assets/index-BAlQzE7t.js +0 -246
- package/assets/assets/index-D-2VeJdG.css +0 -1
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
function c_(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 Ix(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var bh={exports:{}},Ao={};var Av;function u_(){if(Av)return Ao;Av=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 Ao.Fragment=t,Ao.jsx=s,Ao.jsxs=s,Ao}var Tv;function d_(){return Tv||(Tv=1,bh.exports=u_()),bh.exports}var l=d_(),xh={exports:{}},Ee={};var Dv;function f_(){if(Dv)return Ee;Dv=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),d=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),v=Symbol.iterator;function x(L){return L===null||typeof L!="object"?null:(L=v&&L[v]||L["@@iterator"],typeof L=="function"?L:null)}var j={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,C={};function _(L,G,ie){this.props=L,this.context=G,this.refs=C,this.updater=ie||j}_.prototype.isReactComponent={},_.prototype.setState=function(L,G){if(typeof L!="object"&&typeof L!="function"&&L!=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,L,G,"setState")},_.prototype.forceUpdate=function(L){this.updater.enqueueForceUpdate(this,L,"forceUpdate")};function E(){}E.prototype=_.prototype;function R(L,G,ie){this.props=L,this.context=G,this.refs=C,this.updater=ie||j}var z=R.prototype=new E;z.constructor=R,S(z,_.prototype),z.isPureReactComponent=!0;var U=Array.isArray;function O(){}var M={H:null,A:null,T:null,S:null},A=Object.prototype.hasOwnProperty;function Z(L,G,ie){var re=ie.ref;return{$$typeof:e,type:L,key:G,ref:re!==void 0?re:null,props:ie}}function W(L,G){return Z(L.type,G,L.props)}function Q(L){return typeof L=="object"&&L!==null&&L.$$typeof===e}function se(L){var G={"=":"=0",":":"=2"};return"$"+L.replace(/[=:]/g,function(ie){return G[ie]})}var me=/\/+/g;function ze(L,G){return typeof L=="object"&&L!==null&&L.key!=null?se(""+L.key):G.toString(36)}function je(L){switch(L.status){case"fulfilled":return L.value;case"rejected":throw L.reason;default:switch(typeof L.status=="string"?L.then(O,O):(L.status="pending",L.then(function(G){L.status==="pending"&&(L.status="fulfilled",L.value=G)},function(G){L.status==="pending"&&(L.status="rejected",L.reason=G)})),L.status){case"fulfilled":return L.value;case"rejected":throw L.reason}}throw L}function B(L,G,ie,re,ce){var he=typeof L;(he==="undefined"||he==="boolean")&&(L=null);var de=!1;if(L===null)de=!0;else switch(he){case"bigint":case"string":case"number":de=!0;break;case"object":switch(L.$$typeof){case e:case t:de=!0;break;case b:return de=L._init,B(de(L._payload),G,ie,re,ce)}}if(de)return ce=ce(L),de=re===""?"."+ze(L,0):re,U(ce)?(ie="",de!=null&&(ie=de.replace(me,"$&/")+"/"),B(ce,G,ie,"",function(Xe){return Xe})):ce!=null&&(Q(ce)&&(ce=W(ce,ie+(ce.key==null||L&&L.key===ce.key?"":(""+ce.key).replace(me,"$&/")+"/")+de)),G.push(ce)),1;de=0;var Ge=re===""?".":re+":";if(U(L))for(var ge=0;ge<L.length;ge++)re=L[ge],he=Ge+ze(re,ge),de+=B(re,G,ie,he,ce);else if(ge=x(L),typeof ge=="function")for(L=ge.call(L),ge=0;!(re=L.next()).done;)re=re.value,he=Ge+ze(re,ge++),de+=B(re,G,ie,he,ce);else if(he==="object"){if(typeof L.then=="function")return B(je(L),G,ie,re,ce);throw G=String(L),Error("Objects are not valid as a React child (found: "+(G==="[object Object]"?"object with keys {"+Object.keys(L).join(", ")+"}":G)+"). If you meant to render a collection of children, use an array instead.")}return de}function T(L,G,ie){if(L==null)return L;var re=[],ce=0;return B(L,re,"","",function(he){return G.call(ie,he,ce++)}),re}function ae(L){if(L._status===-1){var G=L._result;G=G(),G.then(function(ie){(L._status===0||L._status===-1)&&(L._status=1,L._result=ie)},function(ie){(L._status===0||L._status===-1)&&(L._status=2,L._result=ie)}),L._status===-1&&(L._status=0,L._result=G)}if(L._status===1)return L._result.default;throw L._result}var pe=typeof reportError=="function"?reportError:function(L){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var G=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof L=="object"&&L!==null&&typeof L.message=="string"?String(L.message):String(L),error:L});if(!window.dispatchEvent(G))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",L);return}console.error(L)},te={map:T,forEach:function(L,G,ie){T(L,function(){G.apply(this,arguments)},ie)},count:function(L){var G=0;return T(L,function(){G++}),G},toArray:function(L){return T(L,function(G){return G})||[]},only:function(L){if(!Q(L))throw Error("React.Children.only expected to receive a single React element child.");return L}};return Ee.Activity=y,Ee.Children=te,Ee.Component=_,Ee.Fragment=s,Ee.Profiler=r,Ee.PureComponent=R,Ee.StrictMode=a,Ee.Suspense=p,Ee.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=M,Ee.__COMPILER_RUNTIME={__proto__:null,c:function(L){return M.H.useMemoCache(L)}},Ee.cache=function(L){return function(){return L.apply(null,arguments)}},Ee.cacheSignal=function(){return null},Ee.cloneElement=function(L,G,ie){if(L==null)throw Error("The argument must be a React element, but you passed "+L+".");var re=S({},L.props),ce=L.key;if(G!=null)for(he in G.key!==void 0&&(ce=""+G.key),G)!A.call(G,he)||he==="key"||he==="__self"||he==="__source"||he==="ref"&&G.ref===void 0||(re[he]=G[he]);var he=arguments.length-2;if(he===1)re.children=ie;else if(1<he){for(var de=Array(he),Ge=0;Ge<he;Ge++)de[Ge]=arguments[Ge+2];re.children=de}return Z(L.type,ce,re)},Ee.createContext=function(L){return L={$$typeof:d,_currentValue:L,_currentValue2:L,_threadCount:0,Provider:null,Consumer:null},L.Provider=L,L.Consumer={$$typeof:c,_context:L},L},Ee.createElement=function(L,G,ie){var re,ce={},he=null;if(G!=null)for(re in G.key!==void 0&&(he=""+G.key),G)A.call(G,re)&&re!=="key"&&re!=="__self"&&re!=="__source"&&(ce[re]=G[re]);var de=arguments.length-2;if(de===1)ce.children=ie;else if(1<de){for(var Ge=Array(de),ge=0;ge<de;ge++)Ge[ge]=arguments[ge+2];ce.children=Ge}if(L&&L.defaultProps)for(re in de=L.defaultProps,de)ce[re]===void 0&&(ce[re]=de[re]);return Z(L,he,ce)},Ee.createRef=function(){return{current:null}},Ee.forwardRef=function(L){return{$$typeof:f,render:L}},Ee.isValidElement=Q,Ee.lazy=function(L){return{$$typeof:b,_payload:{_status:-1,_result:L},_init:ae}},Ee.memo=function(L,G){return{$$typeof:m,type:L,compare:G===void 0?null:G}},Ee.startTransition=function(L){var G=M.T,ie={};M.T=ie;try{var re=L(),ce=M.S;ce!==null&&ce(ie,re),typeof re=="object"&&re!==null&&typeof re.then=="function"&&re.then(O,pe)}catch(he){pe(he)}finally{G!==null&&ie.types!==null&&(G.types=ie.types),M.T=G}},Ee.unstable_useCacheRefresh=function(){return M.H.useCacheRefresh()},Ee.use=function(L){return M.H.use(L)},Ee.useActionState=function(L,G,ie){return M.H.useActionState(L,G,ie)},Ee.useCallback=function(L,G){return M.H.useCallback(L,G)},Ee.useContext=function(L){return M.H.useContext(L)},Ee.useDebugValue=function(){},Ee.useDeferredValue=function(L,G){return M.H.useDeferredValue(L,G)},Ee.useEffect=function(L,G){return M.H.useEffect(L,G)},Ee.useEffectEvent=function(L){return M.H.useEffectEvent(L)},Ee.useId=function(){return M.H.useId()},Ee.useImperativeHandle=function(L,G,ie){return M.H.useImperativeHandle(L,G,ie)},Ee.useInsertionEffect=function(L,G){return M.H.useInsertionEffect(L,G)},Ee.useLayoutEffect=function(L,G){return M.H.useLayoutEffect(L,G)},Ee.useMemo=function(L,G){return M.H.useMemo(L,G)},Ee.useOptimistic=function(L,G){return M.H.useOptimistic(L,G)},Ee.useReducer=function(L,G,ie){return M.H.useReducer(L,G,ie)},Ee.useRef=function(L){return M.H.useRef(L)},Ee.useState=function(L){return M.H.useState(L)},Ee.useSyncExternalStore=function(L,G,ie){return M.H.useSyncExternalStore(L,G,ie)},Ee.useTransition=function(){return M.H.useTransition()},Ee.version="19.2.4",Ee}var Lv;function rl(){return Lv||(Lv=1,xh.exports=f_()),xh.exports}var N=rl();const ns=Ix(N),Um=c_({__proto__:null,default:ns},[N]);var Sh={exports:{}},To={},wh={exports:{}},jh={};var Mv;function h_(){return Mv||(Mv=1,(function(e){function t(B,T){var ae=B.length;B.push(T);e:for(;0<ae;){var pe=ae-1>>>1,te=B[pe];if(0<r(te,T))B[pe]=T,B[ae]=te,ae=pe;else break e}}function s(B){return B.length===0?null:B[0]}function a(B){if(B.length===0)return null;var T=B[0],ae=B.pop();if(ae!==T){B[0]=ae;e:for(var pe=0,te=B.length,L=te>>>1;pe<L;){var G=2*(pe+1)-1,ie=B[G],re=G+1,ce=B[re];if(0>r(ie,ae))re<te&&0>r(ce,ie)?(B[pe]=ce,B[re]=ae,pe=re):(B[pe]=ie,B[G]=ae,pe=G);else if(re<te&&0>r(ce,ae))B[pe]=ce,B[re]=ae,pe=re;else break e}}return T}function r(B,T){var ae=B.sortIndex-T.sortIndex;return ae!==0?ae:B.id-T.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var d=Date,f=d.now();e.unstable_now=function(){return d.now()-f}}var p=[],m=[],b=1,y=null,v=3,x=!1,j=!1,S=!1,C=!1,_=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;function z(B){for(var T=s(m);T!==null;){if(T.callback===null)a(m);else if(T.startTime<=B)a(m),T.sortIndex=T.expirationTime,t(p,T);else break;T=s(m)}}function U(B){if(S=!1,z(B),!j)if(s(p)!==null)j=!0,O||(O=!0,se());else{var T=s(m);T!==null&&je(U,T.startTime-B)}}var O=!1,M=-1,A=5,Z=-1;function W(){return C?!0:!(e.unstable_now()-Z<A)}function Q(){if(C=!1,O){var B=e.unstable_now();Z=B;var T=!0;try{e:{j=!1,S&&(S=!1,E(M),M=-1),x=!0;var ae=v;try{t:{for(z(B),y=s(p);y!==null&&!(y.expirationTime>B&&W());){var pe=y.callback;if(typeof pe=="function"){y.callback=null,v=y.priorityLevel;var te=pe(y.expirationTime<=B);if(B=e.unstable_now(),typeof te=="function"){y.callback=te,z(B),T=!0;break t}y===s(p)&&a(p),z(B)}else a(p);y=s(p)}if(y!==null)T=!0;else{var L=s(m);L!==null&&je(U,L.startTime-B),T=!1}}break e}finally{y=null,v=ae,x=!1}T=void 0}}finally{T?se():O=!1}}}var se;if(typeof R=="function")se=function(){R(Q)};else if(typeof MessageChannel<"u"){var me=new MessageChannel,ze=me.port2;me.port1.onmessage=Q,se=function(){ze.postMessage(null)}}else se=function(){_(Q,0)};function je(B,T){M=_(function(){B(e.unstable_now())},T)}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(B){B.callback=null},e.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):A=0<B?Math.floor(1e3/B):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_next=function(B){switch(v){case 1:case 2:case 3:var T=3;break;default:T=v}var ae=v;v=T;try{return B()}finally{v=ae}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(B,T){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var ae=v;v=B;try{return T()}finally{v=ae}},e.unstable_scheduleCallback=function(B,T,ae){var pe=e.unstable_now();switch(typeof ae=="object"&&ae!==null?(ae=ae.delay,ae=typeof ae=="number"&&0<ae?pe+ae:pe):ae=pe,B){case 1:var te=-1;break;case 2:te=250;break;case 5:te=1073741823;break;case 4:te=1e4;break;default:te=5e3}return te=ae+te,B={id:b++,callback:T,priorityLevel:B,startTime:ae,expirationTime:te,sortIndex:-1},ae>pe?(B.sortIndex=ae,t(m,B),s(p)===null&&B===s(m)&&(S?(E(M),M=-1):S=!0,je(U,ae-pe))):(B.sortIndex=te,t(p,B),j||x||(j=!0,O||(O=!0,se()))),B},e.unstable_shouldYield=W,e.unstable_wrapCallback=function(B){var T=v;return function(){var ae=v;v=T;try{return B.apply(this,arguments)}finally{v=ae}}}})(jh)),jh}var Uv;function m_(){return Uv||(Uv=1,wh.exports=h_()),wh.exports}var Nh={exports:{}},tn={};var Pv;function p_(){if(Pv)return tn;Pv=1;var e=rl();function t(p){var m="https://react.dev/errors/"+p;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var b=2;b<arguments.length;b++)m+="&args[]="+encodeURIComponent(arguments[b])}return"Minified React error #"+p+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(){}var a={d:{f:s,r:function(){throw Error(t(522))},D:s,C:s,L:s,m:s,X:s,S:s,M:s},p:0,findDOMNode:null},r=Symbol.for("react.portal");function c(p,m,b){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:r,key:y==null?null:""+y,children:p,containerInfo:m,implementation:b}}var d=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(p,m){if(p==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return tn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,tn.createPortal=function(p,m){var b=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(t(299));return c(p,m,null,b)},tn.flushSync=function(p){var m=d.T,b=a.p;try{if(d.T=null,a.p=2,p)return p()}finally{d.T=m,a.p=b,a.d.f()}},tn.preconnect=function(p,m){typeof p=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,a.d.C(p,m))},tn.prefetchDNS=function(p){typeof p=="string"&&a.d.D(p)},tn.preinit=function(p,m){if(typeof p=="string"&&m&&typeof m.as=="string"){var b=m.as,y=f(b,m.crossOrigin),v=typeof m.integrity=="string"?m.integrity:void 0,x=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;b==="style"?a.d.S(p,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:y,integrity:v,fetchPriority:x}):b==="script"&&a.d.X(p,{crossOrigin:y,integrity:v,fetchPriority:x,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},tn.preinitModule=function(p,m){if(typeof p=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var b=f(m.as,m.crossOrigin);a.d.M(p,{crossOrigin:b,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&a.d.M(p)},tn.preload=function(p,m){if(typeof p=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var b=m.as,y=f(b,m.crossOrigin);a.d.L(p,b,{crossOrigin:y,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,type:typeof m.type=="string"?m.type:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0,referrerPolicy:typeof m.referrerPolicy=="string"?m.referrerPolicy:void 0,imageSrcSet:typeof m.imageSrcSet=="string"?m.imageSrcSet:void 0,imageSizes:typeof m.imageSizes=="string"?m.imageSizes:void 0,media:typeof m.media=="string"?m.media:void 0})}},tn.preloadModule=function(p,m){if(typeof p=="string")if(m){var b=f(m.as,m.crossOrigin);a.d.m(p,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:b,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else a.d.m(p)},tn.requestFormReset=function(p){a.d.r(p)},tn.unstable_batchedUpdates=function(p,m){return p(m)},tn.useFormState=function(p,m,b){return d.H.useFormState(p,m,b)},tn.useFormStatus=function(){return d.H.useHostTransitionStatus()},tn.version="19.2.4",tn}var $v;function Bx(){if($v)return Nh.exports;$v=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(),Nh.exports=p_(),Nh.exports}var Iv;function g_(){if(Iv)return To;Iv=1;var e=m_(),t=rl(),s=Bx();function a(n){var i="https://react.dev/errors/"+n;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var o=2;o<arguments.length;o++)i+="&args[]="+encodeURIComponent(arguments[o])}return"Minified React error #"+n+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function c(n){var i=n,o=n;if(n.alternate)for(;i.return;)i=i.return;else{n=i;do i=n,(i.flags&4098)!==0&&(o=i.return),n=i.return;while(n)}return i.tag===3?o:null}function d(n){if(n.tag===13){var i=n.memoizedState;if(i===null&&(n=n.alternate,n!==null&&(i=n.memoizedState)),i!==null)return i.dehydrated}return null}function f(n){if(n.tag===31){var i=n.memoizedState;if(i===null&&(n=n.alternate,n!==null&&(i=n.memoizedState)),i!==null)return i.dehydrated}return null}function p(n){if(c(n)!==n)throw Error(a(188))}function m(n){var i=n.alternate;if(!i){if(i=c(n),i===null)throw Error(a(188));return i!==n?null:n}for(var o=n,u=i;;){var h=o.return;if(h===null)break;var g=h.alternate;if(g===null){if(u=h.return,u!==null){o=u;continue}break}if(h.child===g.child){for(g=h.child;g;){if(g===o)return p(h),n;if(g===u)return p(h),i;g=g.sibling}throw Error(a(188))}if(o.return!==u.return)o=h,u=g;else{for(var w=!1,k=h.child;k;){if(k===o){w=!0,o=h,u=g;break}if(k===u){w=!0,u=h,o=g;break}k=k.sibling}if(!w){for(k=g.child;k;){if(k===o){w=!0,o=g,u=h;break}if(k===u){w=!0,u=g,o=h;break}k=k.sibling}if(!w)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 b(n){var i=n.tag;if(i===5||i===26||i===27||i===6)return n;for(n=n.child;n!==null;){if(i=b(n),i!==null)return i;n=n.sibling}return null}var y=Object.assign,v=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),j=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),R=Symbol.for("react.context"),z=Symbol.for("react.forward_ref"),U=Symbol.for("react.suspense"),O=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),Z=Symbol.for("react.activity"),W=Symbol.for("react.memo_cache_sentinel"),Q=Symbol.iterator;function se(n){return n===null||typeof n!="object"?null:(n=Q&&n[Q]||n["@@iterator"],typeof n=="function"?n:null)}var me=Symbol.for("react.client.reference");function ze(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===me?null:n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case S:return"Fragment";case _:return"Profiler";case C:return"StrictMode";case U:return"Suspense";case O:return"SuspenseList";case Z:return"Activity"}if(typeof n=="object")switch(n.$$typeof){case j:return"Portal";case R: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 M:return i=n.displayName||null,i!==null?i:ze(n.type)||"Memo";case A:i=n._payload,n=n._init;try{return ze(n(i))}catch{}}return null}var je=Array.isArray,B=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,T=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ae={pending:!1,data:null,method:null,action:null},pe=[],te=-1;function L(n){return{current:n}}function G(n){0>te||(n.current=pe[te],pe[te]=null,te--)}function ie(n,i){te++,pe[te]=n.current,n.current=i}var re=L(null),ce=L(null),he=L(null),de=L(null);function Ge(n,i){switch(ie(he,i),ie(ce,n),ie(re,null),i.nodeType){case 9:case 11:n=(n=i.documentElement)&&(n=n.namespaceURI)?tv(n):0;break;default:if(n=i.tagName,i=i.namespaceURI)i=tv(i),n=nv(i,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}G(re),ie(re,n)}function ge(){G(re),G(ce),G(he)}function Xe(n){n.memoizedState!==null&&ie(de,n);var i=re.current,o=nv(i,n.type);i!==o&&(ie(ce,n),ie(re,o))}function mt(n){ce.current===n&&(G(re),G(ce)),de.current===n&&(G(de),zo._currentValue=ae)}var fe,Je;function dt(n){if(fe===void 0)try{throw Error()}catch(o){var i=o.stack.trim().match(/\n( *(at )?)/);fe=i&&i[1]||"",Je=-1<o.stack.indexOf(`
|
|
2
|
+
at`)?" (<anonymous>)":-1<o.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
+
`+fe+n+Je}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 ee=function(){throw Error()};if(Object.defineProperty(ee.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ee,[])}catch(V){var F=V}Reflect.construct(n,[],ee)}else{try{ee.call()}catch(V){F=V}n.call(ee.prototype)}}else{try{throw Error()}catch(V){F=V}(ee=n())&&typeof ee.catch=="function"&&ee.catch(function(){})}}catch(V){if(V&&F&&typeof V.stack=="string")return[V.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(),w=g[0],k=g[1];if(w&&k){var D=w.split(`
|
|
4
|
+
`),H=k.split(`
|
|
5
|
+
`);for(h=u=0;u<D.length&&!D[u].includes("DetermineComponentFrameRoot");)u++;for(;h<H.length&&!H[h].includes("DetermineComponentFrameRoot");)h++;if(u===D.length||h===H.length)for(u=D.length-1,h=H.length-1;1<=u&&0<=h&&D[u]!==H[h];)h--;for(;1<=u&&0<=h;u--,h--)if(D[u]!==H[h]){if(u!==1||h!==1)do if(u--,h--,0>h||D[u]!==H[h]){var Y=`
|
|
6
|
+
`+D[u].replace(" at new "," at ");return n.displayName&&Y.includes("<anonymous>")&&(Y=Y.replace("<anonymous>",n.displayName)),Y}while(1<=u&&0<=h);break}}}finally{Wt=!1,Error.prepareStackTrace=o}return(o=n?n.displayName||n.name:"")?dt(o):""}function nn(n,i){switch(n.tag){case 26:case 27:case 5:return dt(n.type);case 16:return dt("Lazy");case 13:return n.child!==i&&i!==null?dt("Suspense Fallback"):dt("Suspense");case 19:return dt("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 dt("Activity");default:return""}}function Kt(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 kt=Object.prototype.hasOwnProperty,wt=e.unstable_scheduleCallback,sn=e.unstable_cancelCallback,oe=e.unstable_shouldYield,Ue=e.unstable_requestPaint,Pe=e.unstable_now,ke=e.unstable_getCurrentPriorityLevel,Te=e.unstable_ImmediatePriority,zt=e.unstable_UserBlockingPriority,Qn=e.unstable_NormalPriority,bs=e.unstable_LowPriority,Fs=e.unstable_IdlePriority,xs=e.log,Gs=e.unstable_setDisableYieldValue,os=null,Ce=null;function wn(n){if(typeof xs=="function"&&Gs(n),Ce&&typeof Ce.setStrictMode=="function")try{Ce.setStrictMode(os,n)}catch{}}var ne=Math.clz32?Math.clz32:pl,$e=Math.log,ld=Math.LN2;function pl(n){return n>>>=0,n===0?32:31-($e(n)/ld|0)|0}var Ks=256,Ss=262144,qi=4194304;function ls(n){var i=n&42;if(i!==0)return i;switch(n&-n){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return n&261888;case 262144:case 524288:case 1048576:case 2097152:return n&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return n&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return n}}function Ea(n,i,o){var u=n.pendingLanes;if(u===0)return 0;var h=0,g=n.suspendedLanes,w=n.pingedLanes;n=n.warmLanes;var k=u&134217727;return k!==0?(u=k&~g,u!==0?h=ls(u):(w&=k,w!==0?h=ls(w):o||(o=k&~n,o!==0&&(h=ls(o))))):(k=u&~g,k!==0?h=ls(k):w!==0?h=ls(w):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 gl(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 yl(){var n=qi;return qi<<=1,(qi&62914560)===0&&(qi=4194304),n}function Ra(n){for(var i=[],o=0;31>o;o++)i.push(n);return i}function Hi(n,i){n.pendingLanes|=i,i!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function cd(n,i,o,u,h,g){var w=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,D=n.expirationTimes,H=n.hiddenUpdates;for(o=w&~o;0<o;){var Y=31-ne(o),ee=1<<Y;k[Y]=0,D[Y]=-1;var F=H[Y];if(F!==null)for(H[Y]=null,Y=0;Y<F.length;Y++){var V=F[Y];V!==null&&(V.lane&=-536870913)}o&=~ee}u!==0&&vl(n,u,0),g!==0&&h===0&&n.tag!==0&&(n.suspendedLanes|=g&~(w&~i))}function vl(n,i,o){n.pendingLanes|=i,n.suspendedLanes&=~i;var u=31-ne(i);n.entangledLanes|=i,n.entanglements[u]=n.entanglements[u]|1073741824|o&261930}function bl(n,i){var o=n.entangledLanes|=i;for(n=n.entanglements;o;){var u=31-ne(o),h=1<<u;h&i|n[u]&i&&(n[u]|=i),o&=~h}}function qr(n,i){var o=i&-i;return o=(o&42)!==0?1:$(o),(o&(n.suspendedLanes|i))!==0?0:o}function $(n){switch(n){case 2:n=1;break;case 8:n=4;break;case 32:n=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:n=128;break;case 268435456:n=134217728;break;default:n=0}return n}function ue(n){return n&=-n,2<n?8<n?(n&134217727)!==0?32:268435456:8:2}function nt(){var n=T.p;return n!==0?n:(n=window.event,n===void 0?32:Cv(n.type))}function Vt(n,i){var o=T.p;try{return T.p=n,i()}finally{T.p=o}}var Lt=Math.random().toString(36).slice(2),Et="__reactFiber$"+Lt,jt="__reactProps$"+Lt,jn="__reactContainer$"+Lt,en="__reactEvents$"+Lt,ud="__reactListeners$"+Lt,Vs="__reactHandles$"+Lt,Qs="__reactResources$"+Lt,us="__reactMarker$"+Lt;function Oa(n){delete n[Et],delete n[jt],delete n[en],delete n[ud],delete n[Vs]}function Ys(n){var i=n[Et];if(i)return i;for(var o=n.parentNode;o;){if(i=o[jn]||o[Et]){if(o=i.alternate,i.child!==null||o!==null&&o.child!==null)for(n=cv(n);n!==null;){if(o=n[Et])return o;n=cv(n)}return i}n=o,o=n.parentNode}return null}function Yn(n){if(n=n[Et]||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 Js(n){var i=n[Qs];return i||(i=n[Qs]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function Mt(n){n[us]=!0}var Ie=new Set,st={};function Ht(n,i){an(n,i),an(n+"Capture",i)}function an(n,i){for(st[n]=i,n=0;n<i.length;n++)Ie.add(i[n])}var Aa=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Hr={},Gp={};function tN(n){return kt.call(Gp,n)?!0:kt.call(Hr,n)?!1:Aa.test(n)?Gp[n]=!0:(Hr[n]=!0,!1)}function xl(n,i,o){if(tN(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 Sl(n,i,o){if(o===null)n.removeAttribute(i);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(i);return}n.setAttribute(i,""+o)}}function ws(n,i,o,u){if(u===null)n.removeAttribute(o);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(o);return}n.setAttributeNS(i,o,""+u)}}function An(n){switch(typeof n){case"bigint":case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function Kp(n){var i=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function nN(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(w){o=""+w,g.call(this,w)}}),Object.defineProperty(n,i,{enumerable:u.enumerable}),{getValue:function(){return o},setValue:function(w){o=""+w},stopTracking:function(){n._valueTracker=null,delete n[i]}}}}function dd(n){if(!n._valueTracker){var i=Kp(n)?"checked":"value";n._valueTracker=nN(n,i,""+n[i])}}function Vp(n){if(!n)return!1;var i=n._valueTracker;if(!i)return!0;var o=i.getValue(),u="";return n&&(u=Kp(n)?n.checked?"true":"false":n.value),n=u,n!==o?(i.setValue(n),!0):!1}function wl(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 sN=/[\n"\\]/g;function Tn(n){return n.replace(sN,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function fd(n,i,o,u,h,g,w,k){n.name="",w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?n.type=w:n.removeAttribute("type"),i!=null?w==="number"?(i===0&&n.value===""||n.value!=i)&&(n.value=""+An(i)):n.value!==""+An(i)&&(n.value=""+An(i)):w!=="submit"&&w!=="reset"||n.removeAttribute("value"),i!=null?hd(n,w,An(i)):o!=null?hd(n,w,An(o)):u!=null&&n.removeAttribute("value"),h==null&&g!=null&&(n.defaultChecked=!!g),h!=null&&(n.checked=h&&typeof h!="function"&&typeof h!="symbol"),k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"?n.name=""+An(k):n.removeAttribute("name")}function Qp(n,i,o,u,h,g,w,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)){dd(n);return}o=o!=null?""+An(o):"",i=i!=null?""+An(i):o,k||i===n.value||(n.value=i),n.defaultValue=i}u=u??h,u=typeof u!="function"&&typeof u!="symbol"&&!!u,n.checked=k?n.checked:!!u,n.defaultChecked=!!u,w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(n.name=w),dd(n)}function hd(n,i,o){i==="number"&&wl(n.ownerDocument)===n||n.defaultValue===""+o||(n.defaultValue=""+o)}function Ta(n,i,o,u){if(n=n.options,i){i={};for(var h=0;h<o.length;h++)i["$"+o[h]]=!0;for(o=0;o<n.length;o++)h=i.hasOwnProperty("$"+n[o].value),n[o].selected!==h&&(n[o].selected=h),h&&u&&(n[o].defaultSelected=!0)}else{for(o=""+An(o),i=null,h=0;h<n.length;h++){if(n[h].value===o){n[h].selected=!0,u&&(n[h].defaultSelected=!0);return}i!==null||n[h].disabled||(i=n[h])}i!==null&&(i.selected=!0)}}function Yp(n,i,o){if(i!=null&&(i=""+An(i),i!==n.value&&(n.value=i),o==null)){n.defaultValue!==i&&(n.defaultValue=i);return}n.defaultValue=o!=null?""+An(o):""}function Jp(n,i,o,u){if(i==null){if(u!=null){if(o!=null)throw Error(a(92));if(je(u)){if(1<u.length)throw Error(a(93));u=u[0]}o=u}o==null&&(o=""),i=o}o=An(i),n.defaultValue=o,u=n.textContent,u===o&&u!==""&&u!==null&&(n.value=u),dd(n)}function Da(n,i){if(i){var o=n.firstChild;if(o&&o===n.lastChild&&o.nodeType===3){o.nodeValue=i;return}}n.textContent=i}var iN=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 Xp(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||iN.has(i)?i==="float"?n.cssFloat=o:n[i]=(""+o).trim():n[i]=o+"px"}function Wp(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&&Xp(n,h,u)}else for(var g in i)i.hasOwnProperty(g)&&Xp(n,g,i[g])}function md(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 aN=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"]]),rN=/^[\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 jl(n){return rN.test(""+n)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":n}function js(){}var pd=null;function gd(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var La=null,Ma=null;function eg(n){var i=Yn(n);if(i&&(n=i.stateNode)){var o=n[jt]||null;e:switch(n=i.stateNode,i.type){case"input":if(fd(n,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name),i=o.name,o.type==="radio"&&i!=null){for(o=n;o.parentNode;)o=o.parentNode;for(o=o.querySelectorAll('input[name="'+Tn(""+i)+'"][type="radio"]'),i=0;i<o.length;i++){var u=o[i];if(u!==n&&u.form===n.form){var h=u[jt]||null;if(!h)throw Error(a(90));fd(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&&Vp(u)}break e;case"textarea":Yp(n,o.value,o.defaultValue);break e;case"select":i=o.value,i!=null&&Ta(n,!!o.multiple,i,!1)}}}var yd=!1;function tg(n,i,o){if(yd)return n(i,o);yd=!0;try{var u=n(i);return u}finally{if(yd=!1,(La!==null||Ma!==null)&&(uc(),La&&(i=La,n=Ma,Ma=La=null,eg(i),n)))for(i=0;i<n.length;i++)eg(n[i])}}function Zr(n,i){var o=n.stateNode;if(o===null)return null;var u=o[jt]||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"),vd=!1;if(Ns)try{var Fr={};Object.defineProperty(Fr,"passive",{get:function(){vd=!0}}),window.addEventListener("test",Fr,Fr),window.removeEventListener("test",Fr,Fr)}catch{vd=!1}var Xs=null,bd=null,Nl=null;function ng(){if(Nl)return Nl;var n,i=bd,o=i.length,u,h="value"in Xs?Xs.value:Xs.textContent,g=h.length;for(n=0;n<o&&i[n]===h[n];n++);var w=o-n;for(u=1;u<=w&&i[o-u]===h[g-u];u++);return Nl=h.slice(n,1<u?1-u:void 0)}function Cl(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 _l(){return!0}function sg(){return!1}function fn(n){function i(o,u,h,g,w){this._reactName=o,this._targetInst=h,this.type=u,this.nativeEvent=g,this.target=w,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)?_l:sg,this.isPropagationStopped=sg,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=_l)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=_l)},persist:function(){},isPersistent:_l}),i}var Zi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},kl=fn(Zi),Gr=y({},Zi,{view:0,detail:0}),oN=fn(Gr),xd,Sd,Kr,zl=y({},Gr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:jd,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!==Kr&&(Kr&&n.type==="mousemove"?(xd=n.screenX-Kr.screenX,Sd=n.screenY-Kr.screenY):Sd=xd=0,Kr=n),xd)},movementY:function(n){return"movementY"in n?n.movementY:Sd}}),ig=fn(zl),lN=y({},zl,{dataTransfer:0}),cN=fn(lN),uN=y({},Gr,{relatedTarget:0}),wd=fn(uN),dN=y({},Zi,{animationName:0,elapsedTime:0,pseudoElement:0}),fN=fn(dN),hN=y({},Zi,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),mN=fn(hN),pN=y({},Zi,{data:0}),ag=fn(pN),gN={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},yN={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"},vN={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function bN(n){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(n):(n=vN[n])?!!i[n]:!1}function jd(){return bN}var xN=y({},Gr,{key:function(n){if(n.key){var i=gN[n.key]||n.key;if(i!=="Unidentified")return i}return n.type==="keypress"?(n=Cl(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?yN[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:jd,charCode:function(n){return n.type==="keypress"?Cl(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?Cl(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),SN=fn(xN),wN=y({},zl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),rg=fn(wN),jN=y({},Gr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:jd}),NN=fn(jN),CN=y({},Zi,{propertyName:0,elapsedTime:0,pseudoElement:0}),_N=fn(CN),kN=y({},zl,{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}),zN=fn(kN),EN=y({},Zi,{newState:0,oldState:0}),RN=fn(EN),ON=[9,13,27,32],Nd=Ns&&"CompositionEvent"in window,Vr=null;Ns&&"documentMode"in document&&(Vr=document.documentMode);var AN=Ns&&"TextEvent"in window&&!Vr,og=Ns&&(!Nd||Vr&&8<Vr&&11>=Vr),lg=" ",cg=!1;function ug(n,i){switch(n){case"keyup":return ON.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function dg(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var Ua=!1;function TN(n,i){switch(n){case"compositionend":return dg(i);case"keypress":return i.which!==32?null:(cg=!0,lg);case"textInput":return n=i.data,n===lg&&cg?null:n;default:return null}}function DN(n,i){if(Ua)return n==="compositionend"||!Nd&&ug(n,i)?(n=ng(),Nl=bd=Xs=null,Ua=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return og&&i.locale!=="ko"?null:i.data;default:return null}}var LN={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 fg(n){var i=n&&n.nodeName&&n.nodeName.toLowerCase();return i==="input"?!!LN[n.type]:i==="textarea"}function hg(n,i,o,u){La?Ma?Ma.push(u):Ma=[u]:La=u,i=yc(i,"onChange"),0<i.length&&(o=new kl("onChange","change",null,o,u),n.push({event:o,listeners:i}))}var Qr=null,Yr=null;function MN(n){Q0(n,0)}function El(n){var i=ds(n);if(Vp(i))return n}function mg(n,i){if(n==="change")return i}var pg=!1;if(Ns){var Cd;if(Ns){var _d="oninput"in document;if(!_d){var gg=document.createElement("div");gg.setAttribute("oninput","return;"),_d=typeof gg.oninput=="function"}Cd=_d}else Cd=!1;pg=Cd&&(!document.documentMode||9<document.documentMode)}function yg(){Qr&&(Qr.detachEvent("onpropertychange",vg),Yr=Qr=null)}function vg(n){if(n.propertyName==="value"&&El(Yr)){var i=[];hg(i,Yr,n,gd(n)),tg(MN,i)}}function UN(n,i,o){n==="focusin"?(yg(),Qr=i,Yr=o,Qr.attachEvent("onpropertychange",vg)):n==="focusout"&&yg()}function PN(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return El(Yr)}function $N(n,i){if(n==="click")return El(i)}function IN(n,i){if(n==="input"||n==="change")return El(i)}function BN(n,i){return n===i&&(n!==0||1/n===1/i)||n!==n&&i!==i}var Nn=typeof Object.is=="function"?Object.is:BN;function Jr(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(!kt.call(i,h)||!Nn(n[h],i[h]))return!1}return!0}function bg(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function xg(n,i){var o=bg(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=bg(o)}}function Sg(n,i){return n&&i?n===i?!0:n&&n.nodeType===3?!1:i&&i.nodeType===3?Sg(n,i.parentNode):"contains"in n?n.contains(i):n.compareDocumentPosition?!!(n.compareDocumentPosition(i)&16):!1:!1}function wg(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var i=wl(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=wl(n.document)}return i}function kd(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 qN=Ns&&"documentMode"in document&&11>=document.documentMode,Pa=null,zd=null,Xr=null,Ed=!1;function jg(n,i,o){var u=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;Ed||Pa==null||Pa!==wl(u)||(u=Pa,"selectionStart"in u&&kd(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}),Xr&&Jr(Xr,u)||(Xr=u,u=yc(zd,"onSelect"),0<u.length&&(i=new kl("onSelect","select",null,i,o),n.push({event:i,listeners:u}),i.target=Pa)))}function Fi(n,i){var o={};return o[n.toLowerCase()]=i.toLowerCase(),o["Webkit"+n]="webkit"+i,o["Moz"+n]="moz"+i,o}var $a={animationend:Fi("Animation","AnimationEnd"),animationiteration:Fi("Animation","AnimationIteration"),animationstart:Fi("Animation","AnimationStart"),transitionrun:Fi("Transition","TransitionRun"),transitionstart:Fi("Transition","TransitionStart"),transitioncancel:Fi("Transition","TransitionCancel"),transitionend:Fi("Transition","TransitionEnd")},Rd={},Ng={};Ns&&(Ng=document.createElement("div").style,"AnimationEvent"in window||(delete $a.animationend.animation,delete $a.animationiteration.animation,delete $a.animationstart.animation),"TransitionEvent"in window||delete $a.transitionend.transition);function Gi(n){if(Rd[n])return Rd[n];if(!$a[n])return n;var i=$a[n],o;for(o in i)if(i.hasOwnProperty(o)&&o in Ng)return Rd[n]=i[o];return n}var Cg=Gi("animationend"),_g=Gi("animationiteration"),kg=Gi("animationstart"),HN=Gi("transitionrun"),ZN=Gi("transitionstart"),FN=Gi("transitioncancel"),zg=Gi("transitionend"),Eg=new Map,Od="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(" ");Od.push("scrollEnd");function Jn(n,i){Eg.set(n,i),Ht(i,[n])}var Rl=typeof reportError=="function"?reportError:function(n){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof n=="object"&&n!==null&&typeof n.message=="string"?String(n.message):String(n),error:n});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",n);return}console.error(n)},Dn=[],Ia=0,Ad=0;function Ol(){for(var n=Ia,i=Ad=Ia=0;i<n;){var o=Dn[i];Dn[i++]=null;var u=Dn[i];Dn[i++]=null;var h=Dn[i];Dn[i++]=null;var g=Dn[i];if(Dn[i++]=null,u!==null&&h!==null){var w=u.pending;w===null?h.next=h:(h.next=w.next,w.next=h),u.pending=h}g!==0&&Rg(o,h,g)}}function Al(n,i,o,u){Dn[Ia++]=n,Dn[Ia++]=i,Dn[Ia++]=o,Dn[Ia++]=u,Ad|=u,n.lanes|=u,n=n.alternate,n!==null&&(n.lanes|=u)}function Td(n,i,o,u){return Al(n,i,o,u),Tl(n)}function Ki(n,i){return Al(n,null,null,i),Tl(n)}function Rg(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-ne(o),n=g.hiddenUpdates,u=n[h],u===null?n[h]=[i]:u.push(i),i.lane=o|536870912),g):null}function Tl(n){if(50<So)throw So=0,Hf=null,Error(a(185));for(var i=n.return;i!==null;)n=i,i=n.return;return n.tag===3?n.stateNode:null}var Ba={};function GN(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 Cn(n,i,o,u){return new GN(n,i,o,u)}function Dd(n){return n=n.prototype,!(!n||!n.isReactComponent)}function Cs(n,i){var o=n.alternate;return o===null?(o=Cn(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 Og(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 Dl(n,i,o,u,h,g){var w=0;if(u=n,typeof n=="function")Dd(n)&&(w=1);else if(typeof n=="string")w=JC(n,o,re.current)?26:n==="html"||n==="head"||n==="body"?27:5;else e:switch(n){case Z:return n=Cn(31,o,i,h),n.elementType=Z,n.lanes=g,n;case S:return Vi(o.children,h,g,i);case C:w=8,h|=24;break;case _:return n=Cn(12,o,i,h|2),n.elementType=_,n.lanes=g,n;case U:return n=Cn(13,o,i,h),n.elementType=U,n.lanes=g,n;case O:return n=Cn(19,o,i,h),n.elementType=O,n.lanes=g,n;default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case R:w=10;break e;case E:w=9;break e;case z:w=11;break e;case M:w=14;break e;case A:w=16,u=null;break e}w=29,o=Error(a(130,n===null?"null":typeof n,"")),u=null}return i=Cn(w,o,i,h),i.elementType=n,i.type=u,i.lanes=g,i}function Vi(n,i,o,u){return n=Cn(7,n,u,i),n.lanes=o,n}function Ld(n,i,o){return n=Cn(6,n,null,i),n.lanes=o,n}function Ag(n){var i=Cn(18,null,null,0);return i.stateNode=n,i}function Md(n,i,o){return i=Cn(4,n.children!==null?n.children:[],n.key,i),i.lanes=o,i.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},i}var Tg=new WeakMap;function Ln(n,i){if(typeof n=="object"&&n!==null){var o=Tg.get(n);return o!==void 0?o:(i={value:n,source:i,stack:Kt(i)},Tg.set(n,i),i)}return{value:n,source:i,stack:Kt(i)}}var qa=[],Ha=0,Ll=null,Wr=0,Mn=[],Un=0,Ws=null,fs=1,hs="";function _s(n,i){qa[Ha++]=Wr,qa[Ha++]=Ll,Ll=n,Wr=i}function Dg(n,i,o){Mn[Un++]=fs,Mn[Un++]=hs,Mn[Un++]=Ws,Ws=n;var u=fs;n=hs;var h=32-ne(u)-1;u&=~(1<<h),o+=1;var g=32-ne(i)+h;if(30<g){var w=h-h%5;g=(u&(1<<w)-1).toString(32),u>>=w,h-=w,fs=1<<32-ne(i)+h|o<<h|u,hs=g+n}else fs=1<<g|o<<h|u,hs=n}function Ud(n){n.return!==null&&(_s(n,1),Dg(n,1,0))}function Pd(n){for(;n===Ll;)Ll=qa[--Ha],qa[Ha]=null,Wr=qa[--Ha],qa[Ha]=null;for(;n===Ws;)Ws=Mn[--Un],Mn[Un]=null,hs=Mn[--Un],Mn[Un]=null,fs=Mn[--Un],Mn[Un]=null}function Lg(n,i){Mn[Un++]=fs,Mn[Un++]=hs,Mn[Un++]=Ws,fs=i.id,hs=i.overflow,Ws=n}var Qt=null,ft=null,Ze=!1,ei=null,Pn=!1,$d=Error(a(519));function ti(n){var i=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw eo(Ln(i,n)),$d}function Mg(n){var i=n.stateNode,o=n.type,u=n.memoizedProps;switch(i[Et]=n,i[jt]=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<jo.length;o++)Me(jo[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),Qp(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),Jp(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||W0(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 Ug(n){for(Qt=n.return;Qt;)switch(Qt.tag){case 5:case 31:case 13:Pn=!1;return;case 27:case 3:Pn=!0;return;default:Qt=Qt.return}}function Za(n){if(n!==Qt)return!1;if(!Ze)return Ug(n),Ze=!0,!1;var i=n.tag,o;if((o=i!==3&&i!==27)&&((o=i===5)&&(o=n.type,o=!(o!=="form"&&o!=="button")||ih(n.type,n.memoizedProps)),o=!o),o&&ft&&ti(n),Ug(n),i===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(a(317));ft=lv(n)}else if(i===31){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(a(317));ft=lv(n)}else i===27?(i=ft,pi(n.type)?(n=ch,ch=null,ft=n):ft=i):ft=Qt?In(n.stateNode.nextSibling):null;return!0}function Qi(){ft=Qt=null,Ze=!1}function Id(){var n=ei;return n!==null&&(gn===null?gn=n:gn.push.apply(gn,n),ei=null),n}function eo(n){ei===null?ei=[n]:ei.push(n)}var Bd=L(null),Yi=null,ks=null;function ni(n,i,o){ie(Bd,i._currentValue),i._currentValue=o}function zs(n){n._currentValue=Bd.current,G(Bd)}function qd(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 Hd(n,i,o,u){var h=n.child;for(h!==null&&(h.return=n);h!==null;){var g=h.dependencies;if(g!==null){var w=h.child;g=g.firstContext;e:for(;g!==null;){var k=g;g=h;for(var D=0;D<i.length;D++)if(k.context===i[D]){g.lanes|=o,k=g.alternate,k!==null&&(k.lanes|=o),qd(g.return,o,n),u||(w=null);break e}g=k.next}}else if(h.tag===18){if(w=h.return,w===null)throw Error(a(341));w.lanes|=o,g=w.alternate,g!==null&&(g.lanes|=o),qd(w,o,n),w=null}else w=h.child;if(w!==null)w.return=h;else for(w=h;w!==null;){if(w===n){w=null;break}if(h=w.sibling,h!==null){h.return=w.return,w=h;break}w=w.return}h=w}}function Fa(n,i,o,u){n=null;for(var h=i,g=!1;h!==null;){if(!g){if((h.flags&524288)!==0)g=!0;else if((h.flags&262144)!==0)break}if(h.tag===10){var w=h.alternate;if(w===null)throw Error(a(387));if(w=w.memoizedProps,w!==null){var k=h.type;Nn(h.pendingProps.value,w.value)||(n!==null?n.push(k):n=[k])}}else if(h===de.current){if(w=h.alternate,w===null)throw Error(a(387));w.memoizedState.memoizedState!==h.memoizedState.memoizedState&&(n!==null?n.push(zo):n=[zo])}h=h.return}n!==null&&Hd(i,n,o,u),i.flags|=262144}function Ml(n){for(n=n.firstContext;n!==null;){if(!Nn(n.context._currentValue,n.memoizedValue))return!0;n=n.next}return!1}function Ji(n){Yi=n,ks=null,n=n.dependencies,n!==null&&(n.firstContext=null)}function Yt(n){return Pg(Yi,n)}function Ul(n,i){return Yi===null&&Ji(n),Pg(n,i)}function Pg(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()})}},VN=e.unstable_scheduleCallback,QN=e.unstable_NormalPriority,Ut={$$typeof:R,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Zd(){return{controller:new KN,data:new Map,refCount:0}}function to(n){n.refCount--,n.refCount===0&&VN(QN,function(){n.controller.abort()})}var no=null,Fd=0,Ga=0,Ka=null;function YN(n,i){if(no===null){var o=no=[];Fd=0,Ga=Qf(),Ka={status:"pending",value:void 0,then:function(u){o.push(u)}}}return Fd++,i.then($g,$g),i}function $g(){if(--Fd===0&&no!==null){Ka!==null&&(Ka.status="fulfilled");var n=no;no=null,Ga=0,Ka=null;for(var i=0;i<n.length;i++)(0,n[i])()}}function JN(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 Ig=B.S;B.S=function(n,i){j0=Pe(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&YN(n,i),Ig!==null&&Ig(n,i)};var Xi=L(null);function Gd(){var n=Xi.current;return n!==null?n:ot.pooledCache}function Pl(n,i){i===null?ie(Xi,Xi.current):ie(Xi,i.pool)}function Bg(){var n=Gd();return n===null?null:{parent:Ut._currentValue,pool:n}}var Va=Error(a(460)),Kd=Error(a(474)),$l=Error(a(542)),Il={then:function(){}};function qg(n){return n=n.status,n==="fulfilled"||n==="rejected"}function Hg(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,Fg(n),n;default:if(typeof i.status=="string")i.then(js,js);else{if(n=ot,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,Fg(n),n}throw ea=i,Va}}function Wi(n){try{var i=n._init;return i(n._payload)}catch(o){throw o!==null&&typeof o=="object"&&typeof o.then=="function"?(ea=o,Va):o}}var ea=null;function Zg(){if(ea===null)throw Error(a(459));var n=ea;return ea=null,n}function Fg(n){if(n===Va||n===$l)throw Error(a(483))}var Qa=null,so=0;function Bl(n){var i=so;return so+=1,Qa===null&&(Qa=[]),Hg(Qa,n,i)}function io(n,i){i=i.props.ref,n.ref=i!==void 0?i:null}function ql(n,i){throw i.$$typeof===v?Error(a(525)):(n=Object.prototype.toString.call(i),Error(a(31,n==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":n)))}function Gg(n){function i(I,P){if(n){var q=I.deletions;q===null?(I.deletions=[P],I.flags|=16):q.push(P)}}function o(I,P){if(!n)return null;for(;P!==null;)i(I,P),P=P.sibling;return null}function u(I){for(var P=new Map;I!==null;)I.key!==null?P.set(I.key,I):P.set(I.index,I),I=I.sibling;return P}function h(I,P){return I=Cs(I,P),I.index=0,I.sibling=null,I}function g(I,P,q){return I.index=q,n?(q=I.alternate,q!==null?(q=q.index,q<P?(I.flags|=67108866,P):q):(I.flags|=67108866,P)):(I.flags|=1048576,P)}function w(I){return n&&I.alternate===null&&(I.flags|=67108866),I}function k(I,P,q,J){return P===null||P.tag!==6?(P=Ld(q,I.mode,J),P.return=I,P):(P=h(P,q),P.return=I,P)}function D(I,P,q,J){var Ne=q.type;return Ne===S?Y(I,P,q.props.children,J,q.key):P!==null&&(P.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===A&&Wi(Ne)===P.type)?(P=h(P,q.props),io(P,q),P.return=I,P):(P=Dl(q.type,q.key,q.props,null,I.mode,J),io(P,q),P.return=I,P)}function H(I,P,q,J){return P===null||P.tag!==4||P.stateNode.containerInfo!==q.containerInfo||P.stateNode.implementation!==q.implementation?(P=Md(q,I.mode,J),P.return=I,P):(P=h(P,q.children||[]),P.return=I,P)}function Y(I,P,q,J,Ne){return P===null||P.tag!==7?(P=Vi(q,I.mode,J,Ne),P.return=I,P):(P=h(P,q),P.return=I,P)}function ee(I,P,q){if(typeof P=="string"&&P!==""||typeof P=="number"||typeof P=="bigint")return P=Ld(""+P,I.mode,q),P.return=I,P;if(typeof P=="object"&&P!==null){switch(P.$$typeof){case x:return q=Dl(P.type,P.key,P.props,null,I.mode,q),io(q,P),q.return=I,q;case j:return P=Md(P,I.mode,q),P.return=I,P;case A:return P=Wi(P),ee(I,P,q)}if(je(P)||se(P))return P=Vi(P,I.mode,q,null),P.return=I,P;if(typeof P.then=="function")return ee(I,Bl(P),q);if(P.$$typeof===R)return ee(I,Ul(I,P),q);ql(I,P)}return null}function F(I,P,q,J){var Ne=P!==null?P.key:null;if(typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint")return Ne!==null?null:k(I,P,""+q,J);if(typeof q=="object"&&q!==null){switch(q.$$typeof){case x:return q.key===Ne?D(I,P,q,J):null;case j:return q.key===Ne?H(I,P,q,J):null;case A:return q=Wi(q),F(I,P,q,J)}if(je(q)||se(q))return Ne!==null?null:Y(I,P,q,J,null);if(typeof q.then=="function")return F(I,P,Bl(q),J);if(q.$$typeof===R)return F(I,P,Ul(I,q),J);ql(I,q)}return null}function V(I,P,q,J,Ne){if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return I=I.get(q)||null,k(P,I,""+J,Ne);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case x:return I=I.get(J.key===null?q:J.key)||null,D(P,I,J,Ne);case j:return I=I.get(J.key===null?q:J.key)||null,H(P,I,J,Ne);case A:return J=Wi(J),V(I,P,q,J,Ne)}if(je(J)||se(J))return I=I.get(q)||null,Y(P,I,J,Ne,null);if(typeof J.then=="function")return V(I,P,q,Bl(J),Ne);if(J.$$typeof===R)return V(I,P,q,Ul(P,J),Ne);ql(P,J)}return null}function ye(I,P,q,J){for(var Ne=null,Ke=null,Se=P,Ae=P=0,qe=null;Se!==null&&Ae<q.length;Ae++){Se.index>Ae?(qe=Se,Se=null):qe=Se.sibling;var Ve=F(I,Se,q[Ae],J);if(Ve===null){Se===null&&(Se=qe);break}n&&Se&&Ve.alternate===null&&i(I,Se),P=g(Ve,P,Ae),Ke===null?Ne=Ve:Ke.sibling=Ve,Ke=Ve,Se=qe}if(Ae===q.length)return o(I,Se),Ze&&_s(I,Ae),Ne;if(Se===null){for(;Ae<q.length;Ae++)Se=ee(I,q[Ae],J),Se!==null&&(P=g(Se,P,Ae),Ke===null?Ne=Se:Ke.sibling=Se,Ke=Se);return Ze&&_s(I,Ae),Ne}for(Se=u(Se);Ae<q.length;Ae++)qe=V(Se,I,Ae,q[Ae],J),qe!==null&&(n&&qe.alternate!==null&&Se.delete(qe.key===null?Ae:qe.key),P=g(qe,P,Ae),Ke===null?Ne=qe:Ke.sibling=qe,Ke=qe);return n&&Se.forEach(function(xi){return i(I,xi)}),Ze&&_s(I,Ae),Ne}function _e(I,P,q,J){if(q==null)throw Error(a(151));for(var Ne=null,Ke=null,Se=P,Ae=P=0,qe=null,Ve=q.next();Se!==null&&!Ve.done;Ae++,Ve=q.next()){Se.index>Ae?(qe=Se,Se=null):qe=Se.sibling;var xi=F(I,Se,Ve.value,J);if(xi===null){Se===null&&(Se=qe);break}n&&Se&&xi.alternate===null&&i(I,Se),P=g(xi,P,Ae),Ke===null?Ne=xi:Ke.sibling=xi,Ke=xi,Se=qe}if(Ve.done)return o(I,Se),Ze&&_s(I,Ae),Ne;if(Se===null){for(;!Ve.done;Ae++,Ve=q.next())Ve=ee(I,Ve.value,J),Ve!==null&&(P=g(Ve,P,Ae),Ke===null?Ne=Ve:Ke.sibling=Ve,Ke=Ve);return Ze&&_s(I,Ae),Ne}for(Se=u(Se);!Ve.done;Ae++,Ve=q.next())Ve=V(Se,I,Ae,Ve.value,J),Ve!==null&&(n&&Ve.alternate!==null&&Se.delete(Ve.key===null?Ae:Ve.key),P=g(Ve,P,Ae),Ke===null?Ne=Ve:Ke.sibling=Ve,Ke=Ve);return n&&Se.forEach(function(l_){return i(I,l_)}),Ze&&_s(I,Ae),Ne}function rt(I,P,q,J){if(typeof q=="object"&&q!==null&&q.type===S&&q.key===null&&(q=q.props.children),typeof q=="object"&&q!==null){switch(q.$$typeof){case x:e:{for(var Ne=q.key;P!==null;){if(P.key===Ne){if(Ne=q.type,Ne===S){if(P.tag===7){o(I,P.sibling),J=h(P,q.props.children),J.return=I,I=J;break e}}else if(P.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===A&&Wi(Ne)===P.type){o(I,P.sibling),J=h(P,q.props),io(J,q),J.return=I,I=J;break e}o(I,P);break}else i(I,P);P=P.sibling}q.type===S?(J=Vi(q.props.children,I.mode,J,q.key),J.return=I,I=J):(J=Dl(q.type,q.key,q.props,null,I.mode,J),io(J,q),J.return=I,I=J)}return w(I);case j:e:{for(Ne=q.key;P!==null;){if(P.key===Ne)if(P.tag===4&&P.stateNode.containerInfo===q.containerInfo&&P.stateNode.implementation===q.implementation){o(I,P.sibling),J=h(P,q.children||[]),J.return=I,I=J;break e}else{o(I,P);break}else i(I,P);P=P.sibling}J=Md(q,I.mode,J),J.return=I,I=J}return w(I);case A:return q=Wi(q),rt(I,P,q,J)}if(je(q))return ye(I,P,q,J);if(se(q)){if(Ne=se(q),typeof Ne!="function")throw Error(a(150));return q=Ne.call(q),_e(I,P,q,J)}if(typeof q.then=="function")return rt(I,P,Bl(q),J);if(q.$$typeof===R)return rt(I,P,Ul(I,q),J);ql(I,q)}return typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint"?(q=""+q,P!==null&&P.tag===6?(o(I,P.sibling),J=h(P,q),J.return=I,I=J):(o(I,P),J=Ld(q,I.mode,J),J.return=I,I=J),w(I)):o(I,P)}return function(I,P,q,J){try{so=0;var Ne=rt(I,P,q,J);return Qa=null,Ne}catch(Se){if(Se===Va||Se===$l)throw Se;var Ke=Cn(29,Se,null,I.mode);return Ke.lanes=J,Ke.return=I,Ke}}}var ta=Gg(!0),Kg=Gg(!1),si=!1;function Vd(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Qd(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,(Ye&2)!==0){var h=u.pending;return h===null?i.next=i:(i.next=h.next,h.next=i),u.pending=i,i=Tl(n),Rg(n,null,o),i}return Al(n,u,i,o),Tl(n)}function ao(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,bl(n,o)}}function Yd(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 w={lane:o.lane,tag:o.tag,payload:o.payload,callback:null,next:null};g===null?h=g=w:g=g.next=w,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 Jd=!1;function ro(){if(Jd){var n=Ka;if(n!==null)throw n}}function oo(n,i,o,u){Jd=!1;var h=n.updateQueue;si=!1;var g=h.firstBaseUpdate,w=h.lastBaseUpdate,k=h.shared.pending;if(k!==null){h.shared.pending=null;var D=k,H=D.next;D.next=null,w===null?g=H:w.next=H,w=D;var Y=n.alternate;Y!==null&&(Y=Y.updateQueue,k=Y.lastBaseUpdate,k!==w&&(k===null?Y.firstBaseUpdate=H:k.next=H,Y.lastBaseUpdate=D))}if(g!==null){var ee=h.baseState;w=0,Y=H=D=null,k=g;do{var F=k.lane&-536870913,V=F!==k.lane;if(V?(Be&F)===F:(u&F)===F){F!==0&&F===Ga&&(Jd=!0),Y!==null&&(Y=Y.next={lane:0,tag:k.tag,payload:k.payload,callback:null,next:null});e:{var ye=n,_e=k;F=i;var rt=o;switch(_e.tag){case 1:if(ye=_e.payload,typeof ye=="function"){ee=ye.call(rt,ee,F);break e}ee=ye;break e;case 3:ye.flags=ye.flags&-65537|128;case 0:if(ye=_e.payload,F=typeof ye=="function"?ye.call(rt,ee,F):ye,F==null)break e;ee=y({},ee,F);break e;case 2:si=!0}}F=k.callback,F!==null&&(n.flags|=64,V&&(n.flags|=8192),V=h.callbacks,V===null?h.callbacks=[F]:V.push(F))}else V={lane:F,tag:k.tag,payload:k.payload,callback:k.callback,next:null},Y===null?(H=Y=V,D=ee):Y=Y.next=V,w|=F;if(k=k.next,k===null){if(k=h.shared.pending,k===null)break;V=k,k=V.next,V.next=null,h.lastBaseUpdate=V,h.shared.pending=null}}while(!0);Y===null&&(D=ee),h.baseState=D,h.firstBaseUpdate=H,h.lastBaseUpdate=Y,g===null&&(h.shared.lanes=0),ui|=w,n.lanes=w,n.memoizedState=ee}}function Vg(n,i){if(typeof n!="function")throw Error(a(191,n));n.call(i)}function Qg(n,i){var o=n.callbacks;if(o!==null)for(n.callbacks=null,n=0;n<o.length;n++)Vg(o[n],i)}var Ya=L(null),Hl=L(0);function Yg(n,i){n=Us,ie(Hl,n),ie(Ya,i),Us=n|i.baseLanes}function Xd(){ie(Hl,Us),ie(Ya,Ya.current)}function Wd(){Us=Hl.current,G(Ya),G(Hl)}var _n=L(null),$n=null;function ri(n){var i=n.alternate;ie(Rt,Rt.current&1),ie(_n,n),$n===null&&(i===null||Ya.current!==null||i.memoizedState!==null)&&($n=n)}function ef(n){ie(Rt,Rt.current),ie(_n,n),$n===null&&($n=n)}function Jg(n){n.tag===22?(ie(Rt,Rt.current),ie(_n,n),$n===null&&($n=n)):oi()}function oi(){ie(Rt,Rt.current),ie(_n,_n.current)}function kn(n){G(_n),$n===n&&($n=null),G(Rt)}var Rt=L(0);function Zl(n){for(var i=n;i!==null;){if(i.tag===13){var o=i.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||oh(o)||lh(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,Oe=null,it=null,Pt=null,Fl=!1,Ja=!1,na=!1,Gl=0,lo=0,Xa=null,XN=0;function Nt(){throw Error(a(321))}function tf(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 nf(n,i,o,u,h,g){return Es=g,Oe=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,B.H=n===null||n.memoizedState===null?Dy:vf,na=!1,g=o(u,h),na=!1,Ja&&(g=Wg(i,o,u,h)),Xg(n),g}function Xg(n){B.H=fo;var i=it!==null&&it.next!==null;if(Es=0,Pt=it=Oe=null,Fl=!1,lo=0,Xa=null,i)throw Error(a(300));n===null||$t||(n=n.dependencies,n!==null&&Ml(n)&&($t=!0))}function Wg(n,i,o,u){Oe=n;var h=0;do{if(Ja&&(Xa=null),lo=0,Ja=!1,25<=h)throw Error(a(301));if(h+=1,Pt=it=null,n.updateQueue!=null){var g=n.updateQueue;g.lastEffect=null,g.events=null,g.stores=null,g.memoCache!=null&&(g.memoCache.index=0)}B.H=Ly,g=i(o,u)}while(Ja);return g}function WN(){var n=B.H,i=n.useState()[0];return i=typeof i.then=="function"?co(i):i,n=n.useState()[0],(it!==null?it.memoizedState:null)!==n&&(Oe.flags|=1024),i}function sf(){var n=Gl!==0;return Gl=0,n}function af(n,i,o){i.updateQueue=n.updateQueue,i.flags&=-2053,n.lanes&=~o}function rf(n){if(Fl){for(n=n.memoizedState;n!==null;){var i=n.queue;i!==null&&(i.pending=null),n=n.next}Fl=!1}Es=0,Pt=it=Oe=null,Ja=!1,lo=Gl=0,Xa=null}function rn(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Pt===null?Oe.memoizedState=Pt=n:Pt=Pt.next=n,Pt}function Ot(){if(it===null){var n=Oe.alternate;n=n!==null?n.memoizedState:null}else n=it.next;var i=Pt===null?Oe.memoizedState:Pt.next;if(i!==null)Pt=i,it=n;else{if(n===null)throw Oe.alternate===null?Error(a(467)):Error(a(310));it=n,n={memoizedState:it.memoizedState,baseState:it.baseState,baseQueue:it.baseQueue,queue:it.queue,next:null},Pt===null?Oe.memoizedState=Pt=n:Pt=Pt.next=n}return Pt}function Kl(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function co(n){var i=lo;return lo+=1,Xa===null&&(Xa=[]),n=Hg(Xa,n,i),i=Oe,(Pt===null?i.memoizedState:Pt.next)===null&&(i=i.alternate,B.H=i===null||i.memoizedState===null?Dy:vf),n}function Vl(n){if(n!==null&&typeof n=="object"){if(typeof n.then=="function")return co(n);if(n.$$typeof===R)return Yt(n)}throw Error(a(438,String(n)))}function of(n){var i=null,o=Oe.updateQueue;if(o!==null&&(i=o.memoCache),i==null){var u=Oe.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=Kl(),Oe.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]=W;return i.index++,o}function Rs(n,i){return typeof i=="function"?i(n):i}function Ql(n){var i=Ot();return lf(i,it,n)}function lf(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 w=h.next;h.next=g.next,g.next=w}i.baseQueue=h=g,u.pending=null}if(g=n.baseState,h===null)n.memoizedState=g;else{i=h.next;var k=w=null,D=null,H=i,Y=!1;do{var ee=H.lane&-536870913;if(ee!==H.lane?(Be&ee)===ee:(Es&ee)===ee){var F=H.revertLane;if(F===0)D!==null&&(D=D.next={lane:0,revertLane:0,gesture:null,action:H.action,hasEagerState:H.hasEagerState,eagerState:H.eagerState,next:null}),ee===Ga&&(Y=!0);else if((Es&F)===F){H=H.next,F===Ga&&(Y=!0);continue}else ee={lane:0,revertLane:H.revertLane,gesture:null,action:H.action,hasEagerState:H.hasEagerState,eagerState:H.eagerState,next:null},D===null?(k=D=ee,w=g):D=D.next=ee,Oe.lanes|=F,ui|=F;ee=H.action,na&&o(g,ee),g=H.hasEagerState?H.eagerState:o(g,ee)}else F={lane:ee,revertLane:H.revertLane,gesture:H.gesture,action:H.action,hasEagerState:H.hasEagerState,eagerState:H.eagerState,next:null},D===null?(k=D=F,w=g):D=D.next=F,Oe.lanes|=ee,ui|=ee;H=H.next}while(H!==null&&H!==i);if(D===null?w=g:D.next=k,!Nn(g,n.memoizedState)&&($t=!0,Y&&(o=Ka,o!==null)))throw o;n.memoizedState=g,n.baseState=w,n.baseQueue=D,u.lastRenderedState=g}return h===null&&(u.lanes=0),[n.memoizedState,u.dispatch]}function cf(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 w=h=h.next;do g=n(g,w.action),w=w.next;while(w!==h);Nn(g,i.memoizedState)||($t=!0),i.memoizedState=g,i.baseQueue===null&&(i.baseState=g),o.lastRenderedState=g}return[g,u]}function ey(n,i,o){var u=Oe,h=Ot(),g=Ze;if(g){if(o===void 0)throw Error(a(407));o=o()}else o=i();var w=!Nn((it||h).memoizedState,o);if(w&&(h.memoizedState=o,$t=!0),h=h.queue,ff(sy.bind(null,u,h,n),[n]),h.getSnapshot!==i||w||Pt!==null&&Pt.memoizedState.tag&1){if(u.flags|=2048,Wa(9,{destroy:void 0},ny.bind(null,u,h,o,i),null),ot===null)throw Error(a(349));g||(Es&127)!==0||ty(u,i,o)}return o}function ty(n,i,o){n.flags|=16384,n={getSnapshot:i,value:o},i=Oe.updateQueue,i===null?(i=Kl(),Oe.updateQueue=i,i.stores=[n]):(o=i.stores,o===null?i.stores=[n]:o.push(n))}function ny(n,i,o,u){i.value=o,i.getSnapshot=u,iy(i)&&ay(n)}function sy(n,i,o){return o(function(){iy(i)&&ay(n)})}function iy(n){var i=n.getSnapshot;n=n.value;try{var o=i();return!Nn(n,o)}catch{return!0}}function ay(n){var i=Ki(n,2);i!==null&&yn(i,n,2)}function uf(n){var i=rn();if(typeof n=="function"){var o=n;if(n=o(),na){wn(!0);try{o()}finally{wn(!1)}}}return i.memoizedState=i.baseState=n,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Rs,lastRenderedState:n},i}function ry(n,i,o,u){return n.baseState=o,lf(n,it,typeof u=="function"?u:Rs)}function eC(n,i,o,u,h){if(Xl(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(w){g.listeners.push(w)}};B.T!==null?o(!0):g.isTransition=!1,u(g),o=i.pending,o===null?(g.next=i.pending=g,oy(i,g)):(g.next=o.next,i.pending=o.next=g)}}function oy(n,i){var o=i.action,u=i.payload,h=n.state;if(i.isTransition){var g=B.T,w={};B.T=w;try{var k=o(h,u),D=B.S;D!==null&&D(w,k),ly(n,i,k)}catch(H){df(n,i,H)}finally{g!==null&&w.types!==null&&(g.types=w.types),B.T=g}}else try{g=o(h,u),ly(n,i,g)}catch(H){df(n,i,H)}}function ly(n,i,o){o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(function(u){cy(n,i,u)},function(u){return df(n,i,u)}):cy(n,i,o)}function cy(n,i,o){i.status="fulfilled",i.value=o,uy(i),n.state=o,i=n.pending,i!==null&&(o=i.next,o===i?n.pending=null:(o=o.next,i.next=o,oy(n,o)))}function df(n,i,o){var u=n.pending;if(n.pending=null,u!==null){u=u.next;do i.status="rejected",i.reason=o,uy(i),i=i.next;while(i!==u)}n.action=null}function uy(n){n=n.listeners;for(var i=0;i<n.length;i++)(0,n[i])()}function dy(n,i){return i}function fy(n,i){if(Ze){var o=ot.formState;if(o!==null){e:{var u=Oe;if(Ze){if(ft){t:{for(var h=ft,g=Pn;h.nodeType!==8;){if(!g){h=null;break t}if(h=In(h.nextSibling),h===null){h=null;break t}}g=h.data,h=g==="F!"||g==="F"?h:null}if(h){ft=In(h.nextSibling),u=h.data==="F!";break e}}ti(u)}u=!1}u&&(i=o[0])}}return o=rn(),o.memoizedState=o.baseState=i,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:dy,lastRenderedState:i},o.queue=u,o=Oy.bind(null,Oe,u),u.dispatch=o,u=uf(!1),g=yf.bind(null,Oe,!1,u.queue),u=rn(),h={state:i,dispatch:null,action:n,pending:null},u.queue=h,o=eC.bind(null,Oe,h,g,o),h.dispatch=o,u.memoizedState=n,[i,o,!1]}function hy(n){var i=Ot();return my(i,it,n)}function my(n,i,o){if(i=lf(n,i,dy)[0],n=Ql(Rs)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var u=co(i)}catch(w){throw w===Va?$l:w}else u=i;i=Ot();var h=i.queue,g=h.dispatch;return o!==i.memoizedState&&(Oe.flags|=2048,Wa(9,{destroy:void 0},tC.bind(null,h,o),null)),[u,g,n]}function tC(n,i){n.action=i}function py(n){var i=Ot(),o=it;if(o!==null)return my(i,o,n);Ot(),i=i.memoizedState,o=Ot();var u=o.queue.dispatch;return o.memoizedState=n,[i,u,!1]}function Wa(n,i,o,u){return n={tag:n,create:o,deps:u,inst:i,next:null},i=Oe.updateQueue,i===null&&(i=Kl(),Oe.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 gy(){return Ot().memoizedState}function Yl(n,i,o,u){var h=rn();Oe.flags|=n,h.memoizedState=Wa(1|i,{destroy:void 0},o,u===void 0?null:u)}function Jl(n,i,o,u){var h=Ot();u=u===void 0?null:u;var g=h.memoizedState.inst;it!==null&&u!==null&&tf(u,it.memoizedState.deps)?h.memoizedState=Wa(i,g,o,u):(Oe.flags|=n,h.memoizedState=Wa(1|i,g,o,u))}function yy(n,i){Yl(8390656,8,n,i)}function ff(n,i){Jl(2048,8,n,i)}function nC(n){Oe.flags|=4;var i=Oe.updateQueue;if(i===null)i=Kl(),Oe.updateQueue=i,i.events=[n];else{var o=i.events;o===null?i.events=[n]:o.push(n)}}function vy(n){var i=Ot().memoizedState;return nC({ref:i,nextImpl:n}),function(){if((Ye&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}function by(n,i){return Jl(4,2,n,i)}function xy(n,i){return Jl(4,4,n,i)}function Sy(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 wy(n,i,o){o=o!=null?o.concat([n]):null,Jl(4,4,Sy.bind(null,i,n),o)}function hf(){}function jy(n,i){var o=Ot();i=i===void 0?null:i;var u=o.memoizedState;return i!==null&&tf(i,u[1])?u[0]:(o.memoizedState=[n,i],n)}function Ny(n,i){var o=Ot();i=i===void 0?null:i;var u=o.memoizedState;if(i!==null&&tf(i,u[1]))return u[0];if(u=n(),na){wn(!0);try{n()}finally{wn(!1)}}return o.memoizedState=[u,i],u}function mf(n,i,o){return o===void 0||(Es&1073741824)!==0&&(Be&261930)===0?n.memoizedState=i:(n.memoizedState=o,n=C0(),Oe.lanes|=n,ui|=n,o)}function Cy(n,i,o,u){return Nn(o,i)?o:Ya.current!==null?(n=mf(n,o,u),Nn(n,i)||($t=!0),n):(Es&42)===0||(Es&1073741824)!==0&&(Be&261930)===0?($t=!0,n.memoizedState=o):(n=C0(),Oe.lanes|=n,ui|=n,i)}function _y(n,i,o,u,h){var g=T.p;T.p=g!==0&&8>g?g:8;var w=B.T,k={};B.T=k,yf(n,!1,i,o);try{var D=h(),H=B.S;if(H!==null&&H(k,D),D!==null&&typeof D=="object"&&typeof D.then=="function"){var Y=JN(D,u);uo(n,i,Y,Rn(n))}else uo(n,i,u,Rn(n))}catch(ee){uo(n,i,{then:function(){},status:"rejected",reason:ee},Rn())}finally{T.p=g,w!==null&&k.types!==null&&(w.types=k.types),B.T=w}}function sC(){}function pf(n,i,o,u){if(n.tag!==5)throw Error(a(476));var h=ky(n).queue;_y(n,h,i,ae,o===null?sC:function(){return zy(n),o(u)})}function ky(n){var i=n.memoizedState;if(i!==null)return i;i={memoizedState:ae,baseState:ae,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Rs,lastRenderedState:ae},next:null};var o={};return i.next={memoizedState:o,baseState:o,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Rs,lastRenderedState:o},next:null},n.memoizedState=i,n=n.alternate,n!==null&&(n.memoizedState=i),i}function zy(n){var i=ky(n);i.next===null&&(i=n.alternate.memoizedState),uo(n,i.next.queue,{},Rn())}function gf(){return Yt(zo)}function Ey(){return Ot().memoizedState}function Ry(){return Ot().memoizedState}function iC(n){for(var i=n.return;i!==null;){switch(i.tag){case 24:case 3:var o=Rn();n=ii(o);var u=ai(i,n,o);u!==null&&(yn(u,i,o),ao(u,i,o)),i={cache:Zd()},n.payload=i;return}i=i.return}}function aC(n,i,o){var u=Rn();o={lane:u,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},Xl(n)?Ay(i,o):(o=Td(n,i,o,u),o!==null&&(yn(o,n,u),Ty(o,i,u)))}function Oy(n,i,o){var u=Rn();uo(n,i,o,u)}function uo(n,i,o,u){var h={lane:u,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null};if(Xl(n))Ay(i,h);else{var g=n.alternate;if(n.lanes===0&&(g===null||g.lanes===0)&&(g=i.lastRenderedReducer,g!==null))try{var w=i.lastRenderedState,k=g(w,o);if(h.hasEagerState=!0,h.eagerState=k,Nn(k,w))return Al(n,i,h,0),ot===null&&Ol(),!1}catch{}if(o=Td(n,i,h,u),o!==null)return yn(o,n,u),Ty(o,i,u),!0}return!1}function yf(n,i,o,u){if(u={lane:2,revertLane:Qf(),gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Xl(n)){if(i)throw Error(a(479))}else i=Td(n,o,u,2),i!==null&&yn(i,n,2)}function Xl(n){var i=n.alternate;return n===Oe||i!==null&&i===Oe}function Ay(n,i){Ja=Fl=!0;var o=n.pending;o===null?i.next=i:(i.next=o.next,o.next=i),n.pending=i}function Ty(n,i,o){if((o&4194048)!==0){var u=i.lanes;u&=n.pendingLanes,o|=u,i.lanes=o,bl(n,o)}}var fo={readContext:Yt,use:Vl,useCallback:Nt,useContext:Nt,useEffect:Nt,useImperativeHandle:Nt,useLayoutEffect:Nt,useInsertionEffect:Nt,useMemo:Nt,useReducer:Nt,useRef:Nt,useState:Nt,useDebugValue:Nt,useDeferredValue:Nt,useTransition:Nt,useSyncExternalStore:Nt,useId:Nt,useHostTransitionStatus:Nt,useFormState:Nt,useActionState:Nt,useOptimistic:Nt,useMemoCache:Nt,useCacheRefresh:Nt};fo.useEffectEvent=Nt;var Dy={readContext:Yt,use:Vl,useCallback:function(n,i){return rn().memoizedState=[n,i===void 0?null:i],n},useContext:Yt,useEffect:yy,useImperativeHandle:function(n,i,o){o=o!=null?o.concat([n]):null,Yl(4194308,4,Sy.bind(null,i,n),o)},useLayoutEffect:function(n,i){return Yl(4194308,4,n,i)},useInsertionEffect:function(n,i){Yl(4,2,n,i)},useMemo:function(n,i){var o=rn();i=i===void 0?null:i;var u=n();if(na){wn(!0);try{n()}finally{wn(!1)}}return o.memoizedState=[u,i],u},useReducer:function(n,i,o){var u=rn();if(o!==void 0){var h=o(i);if(na){wn(!0);try{o(i)}finally{wn(!1)}}}else h=i;return u.memoizedState=u.baseState=h,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:h},u.queue=n,n=n.dispatch=aC.bind(null,Oe,n),[u.memoizedState,n]},useRef:function(n){var i=rn();return n={current:n},i.memoizedState=n},useState:function(n){n=uf(n);var i=n.queue,o=Oy.bind(null,Oe,i);return i.dispatch=o,[n.memoizedState,o]},useDebugValue:hf,useDeferredValue:function(n,i){var o=rn();return mf(o,n,i)},useTransition:function(){var n=uf(!1);return n=_y.bind(null,Oe,n.queue,!0,!1),rn().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,i,o){var u=Oe,h=rn();if(Ze){if(o===void 0)throw Error(a(407));o=o()}else{if(o=i(),ot===null)throw Error(a(349));(Be&127)!==0||ty(u,i,o)}h.memoizedState=o;var g={value:o,getSnapshot:i};return h.queue=g,yy(sy.bind(null,u,g,n),[n]),u.flags|=2048,Wa(9,{destroy:void 0},ny.bind(null,u,g,o,i),null),o},useId:function(){var n=rn(),i=ot.identifierPrefix;if(Ze){var o=hs,u=fs;o=(u&~(1<<32-ne(u)-1)).toString(32)+o,i="_"+i+"R_"+o,o=Gl++,0<o&&(i+="H"+o.toString(32)),i+="_"}else o=XN++,i="_"+i+"r_"+o.toString(32)+"_";return n.memoizedState=i},useHostTransitionStatus:gf,useFormState:fy,useActionState:fy,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=yf.bind(null,Oe,!0,o),o.dispatch=i,[n,i]},useMemoCache:of,useCacheRefresh:function(){return rn().memoizedState=iC.bind(null,Oe)},useEffectEvent:function(n){var i=rn(),o={impl:n};return i.memoizedState=o,function(){if((Ye&2)!==0)throw Error(a(440));return o.impl.apply(void 0,arguments)}}},vf={readContext:Yt,use:Vl,useCallback:jy,useContext:Yt,useEffect:ff,useImperativeHandle:wy,useInsertionEffect:by,useLayoutEffect:xy,useMemo:Ny,useReducer:Ql,useRef:gy,useState:function(){return Ql(Rs)},useDebugValue:hf,useDeferredValue:function(n,i){var o=Ot();return Cy(o,it.memoizedState,n,i)},useTransition:function(){var n=Ql(Rs)[0],i=Ot().memoizedState;return[typeof n=="boolean"?n:co(n),i]},useSyncExternalStore:ey,useId:Ey,useHostTransitionStatus:gf,useFormState:hy,useActionState:hy,useOptimistic:function(n,i){var o=Ot();return ry(o,it,n,i)},useMemoCache:of,useCacheRefresh:Ry};vf.useEffectEvent=vy;var Ly={readContext:Yt,use:Vl,useCallback:jy,useContext:Yt,useEffect:ff,useImperativeHandle:wy,useInsertionEffect:by,useLayoutEffect:xy,useMemo:Ny,useReducer:cf,useRef:gy,useState:function(){return cf(Rs)},useDebugValue:hf,useDeferredValue:function(n,i){var o=Ot();return it===null?mf(o,n,i):Cy(o,it.memoizedState,n,i)},useTransition:function(){var n=cf(Rs)[0],i=Ot().memoizedState;return[typeof n=="boolean"?n:co(n),i]},useSyncExternalStore:ey,useId:Ey,useHostTransitionStatus:gf,useFormState:py,useActionState:py,useOptimistic:function(n,i){var o=Ot();return it!==null?ry(o,it,n,i):(o.baseState=n,[n,o.queue.dispatch])},useMemoCache:of,useCacheRefresh:Ry};Ly.useEffectEvent=vy;function bf(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 xf={enqueueSetState:function(n,i,o){n=n._reactInternals;var u=Rn(),h=ii(u);h.payload=i,o!=null&&(h.callback=o),i=ai(n,h,u),i!==null&&(yn(i,n,u),ao(i,n,u))},enqueueReplaceState:function(n,i,o){n=n._reactInternals;var u=Rn(),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),ao(i,n,u))},enqueueForceUpdate:function(n,i){n=n._reactInternals;var o=Rn(),u=ii(o);u.tag=2,i!=null&&(u.callback=i),i=ai(n,u,o),i!==null&&(yn(i,n,o),ao(i,n,o))}};function My(n,i,o,u,h,g,w){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(u,g,w):i.prototype&&i.prototype.isPureReactComponent?!Jr(o,u)||!Jr(h,g):!0}function Uy(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&&xf.enqueueReplaceState(i,i.state,null)}function sa(n,i){var o=i;if("ref"in i){o={};for(var u in i)u!=="ref"&&(o[u]=i[u])}if(n=n.defaultProps){o===i&&(o=y({},o));for(var h in n)o[h]===void 0&&(o[h]=n[h])}return o}function Py(n){Rl(n)}function $y(n){console.error(n)}function Iy(n){Rl(n)}function Wl(n,i){try{var o=n.onUncaughtError;o(i.value,{componentStack:i.stack})}catch(u){setTimeout(function(){throw u})}}function By(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 Sf(n,i,o){return o=ii(o),o.tag=3,o.payload={element:null},o.callback=function(){Wl(n,i)},o}function qy(n){return n=ii(n),n.tag=3,n}function Hy(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(){By(i,o,u)}}var w=o.stateNode;w!==null&&typeof w.componentDidCatch=="function"&&(n.callback=function(){By(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 rC(n,i,o,u,h){if(o.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){if(i=o.alternate,i!==null&&Fa(i,o,h,!0),o=_n.current,o!==null){switch(o.tag){case 31:case 13:return $n===null?dc():o.alternate===null&&Ct===0&&(Ct=3),o.flags&=-257,o.flags|=65536,o.lanes=h,u===Il?o.flags|=16384:(i=o.updateQueue,i===null?o.updateQueue=new Set([u]):i.add(u),Gf(n,u,h)),!1;case 22:return o.flags|=65536,u===Il?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)),Gf(n,u,h)),!1}throw Error(a(435,o.tag))}return Gf(n,u,h),dc(),!1}if(Ze)return i=_n.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=h,u!==$d&&(n=Error(a(422),{cause:u}),eo(Ln(n,o)))):(u!==$d&&(i=Error(a(423),{cause:u}),eo(Ln(i,o))),n=n.current.alternate,n.flags|=65536,h&=-h,n.lanes|=h,u=Ln(u,o),h=Sf(n.stateNode,u,h),Yd(n,h),Ct!==4&&(Ct=2)),!1;var g=Error(a(520),{cause:u});if(g=Ln(g,o),xo===null?xo=[g]:xo.push(g),Ct!==4&&(Ct=2),i===null)return!0;u=Ln(u,o),o=i;do{switch(o.tag){case 3:return o.flags|=65536,n=h&-h,o.lanes|=n,n=Sf(o.stateNode,u,n),Yd(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=qy(h),Hy(h,n,o,u),Yd(o,h),!1}o=o.return}while(o!==null);return!1}var wf=Error(a(461)),$t=!1;function Jt(n,i,o,u){i.child=n===null?Kg(i,null,o,u):ta(i,n.child,o,u)}function Zy(n,i,o,u,h){o=o.render;var g=i.ref;if("ref"in u){var w={};for(var k in u)k!=="ref"&&(w[k]=u[k])}else w=u;return Ji(i),u=nf(n,i,o,w,g,h),k=sf(),n!==null&&!$t?(af(n,i,h),Os(n,i,h)):(Ze&&k&&Ud(i),i.flags|=1,Jt(n,i,u,h),i.child)}function Fy(n,i,o,u,h){if(n===null){var g=o.type;return typeof g=="function"&&!Dd(g)&&g.defaultProps===void 0&&o.compare===null?(i.tag=15,i.type=g,Gy(n,i,g,u,h)):(n=Dl(o.type,null,u,i,i.mode,h),n.ref=i.ref,n.return=i,i.child=n)}if(g=n.child,!Rf(n,h)){var w=g.memoizedProps;if(o=o.compare,o=o!==null?o:Jr,o(w,u)&&n.ref===i.ref)return Os(n,i,h)}return i.flags|=1,n=Cs(g,u),n.ref=i.ref,n.return=i,i.child=n}function Gy(n,i,o,u,h){if(n!==null){var g=n.memoizedProps;if(Jr(g,u)&&n.ref===i.ref)if($t=!1,i.pendingProps=u=g,Rf(n,h))(n.flags&131072)!==0&&($t=!0);else return i.lanes=n.lanes,Os(n,i,h)}return jf(n,i,o,u,h)}function Ky(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 Vy(n,i,g,o,u)}if((o&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},n!==null&&Pl(i,g!==null?g.cachePool:null),g!==null?Yg(i,g):Xd(),Jg(i);else return u=i.lanes=536870912,Vy(n,i,g!==null?g.baseLanes|o:o,o,u)}else g!==null?(Pl(i,g.cachePool),Yg(i,g),oi(),i.memoizedState=null):(n!==null&&Pl(i,null),Xd(),oi());return Jt(n,i,h,o),i.child}function ho(n,i){return n!==null&&n.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function Vy(n,i,o,u,h){var g=Gd();return g=g===null?null:{parent:Ut._currentValue,pool:g},i.memoizedState={baseLanes:o,cachePool:g},n!==null&&Pl(i,null),Xd(),Jg(i),n!==null&&Fa(n,i,u,!0),i.childLanes=h,null}function ec(n,i){return i=nc({mode:i.mode,children:i.children},n.mode),i.ref=n.ref,n.child=i,i.return=n,i}function Qy(n,i,o){return ta(i,n.child,null,o),n=ec(i,i.pendingProps),n.flags|=2,kn(i),i.memoizedState=null,n}function oC(n,i,o){var u=i.pendingProps,h=(i.flags&128)!==0;if(i.flags&=-129,n===null){if(Ze){if(u.mode==="hidden")return n=ec(i,u),i.lanes=536870912,ho(null,n);if(ef(i),(n=ft)?(n=ov(n,Pn),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=Ag(n),o.return=i,i.child=o,Qt=i,ft=null)):n=null,n===null)throw ti(i);return i.lanes=536870912,null}return ec(i,u)}var g=n.memoizedState;if(g!==null){var w=g.dehydrated;if(ef(i),h)if(i.flags&256)i.flags&=-257,i=Qy(n,i,o);else if(i.memoizedState!==null)i.child=n.child,i.flags|=128,i=null;else throw Error(a(558));else if($t||Fa(n,i,o,!1),h=(o&n.childLanes)!==0,$t||h){if(u=ot,u!==null&&(w=qr(u,o),w!==0&&w!==g.retryLane))throw g.retryLane=w,Ki(n,w),yn(u,n,w),wf;dc(),i=Qy(n,i,o)}else n=g.treeContext,ft=In(w.nextSibling),Qt=i,Ze=!0,ei=null,Pn=!1,n!==null&&Lg(i,n),i=ec(i,u),i.flags|=4096;return i}return n=Cs(n.child,{mode:u.mode,children:u.children}),n.ref=i.ref,i.child=n,n.return=i,n}function tc(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 jf(n,i,o,u,h){return Ji(i),o=nf(n,i,o,u,void 0,h),u=sf(),n!==null&&!$t?(af(n,i,h),Os(n,i,h)):(Ze&&u&&Ud(i),i.flags|=1,Jt(n,i,o,h),i.child)}function Yy(n,i,o,u,h,g){return Ji(i),i.updateQueue=null,o=Wg(i,u,o,h),Xg(n),u=sf(),n!==null&&!$t?(af(n,i,g),Os(n,i,g)):(Ze&&u&&Ud(i),i.flags|=1,Jt(n,i,o,g),i.child)}function Jy(n,i,o,u,h){if(Ji(i),i.stateNode===null){var g=Ba,w=o.contextType;typeof w=="object"&&w!==null&&(g=Yt(w)),g=new o(u,g),i.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,g.updater=xf,i.stateNode=g,g._reactInternals=i,g=i.stateNode,g.props=u,g.state=i.memoizedState,g.refs={},Vd(i),w=o.contextType,g.context=typeof w=="object"&&w!==null?Yt(w):Ba,g.state=i.memoizedState,w=o.getDerivedStateFromProps,typeof w=="function"&&(bf(i,o,w,u),g.state=i.memoizedState),typeof o.getDerivedStateFromProps=="function"||typeof g.getSnapshotBeforeUpdate=="function"||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(w=g.state,typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount(),w!==g.state&&xf.enqueueReplaceState(g,g.state,null),oo(i,u,g,h),ro(),g.state=i.memoizedState),typeof g.componentDidMount=="function"&&(i.flags|=4194308),u=!0}else if(n===null){g=i.stateNode;var k=i.memoizedProps,D=sa(o,k);g.props=D;var H=g.context,Y=o.contextType;w=Ba,typeof Y=="object"&&Y!==null&&(w=Yt(Y));var ee=o.getDerivedStateFromProps;Y=typeof ee=="function"||typeof g.getSnapshotBeforeUpdate=="function",k=i.pendingProps!==k,Y||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(k||H!==w)&&Uy(i,g,u,w),si=!1;var F=i.memoizedState;g.state=F,oo(i,u,g,h),ro(),H=i.memoizedState,k||F!==H||si?(typeof ee=="function"&&(bf(i,o,ee,u),H=i.memoizedState),(D=si||My(i,o,D,u,F,H,w))?(Y||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=H),g.props=u,g.state=H,g.context=w,u=D):(typeof g.componentDidMount=="function"&&(i.flags|=4194308),u=!1)}else{g=i.stateNode,Qd(n,i),w=i.memoizedProps,Y=sa(o,w),g.props=Y,ee=i.pendingProps,F=g.context,H=o.contextType,D=Ba,typeof H=="object"&&H!==null&&(D=Yt(H)),k=o.getDerivedStateFromProps,(H=typeof k=="function"||typeof g.getSnapshotBeforeUpdate=="function")||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(w!==ee||F!==D)&&Uy(i,g,u,D),si=!1,F=i.memoizedState,g.state=F,oo(i,u,g,h),ro();var V=i.memoizedState;w!==ee||F!==V||si||n!==null&&n.dependencies!==null&&Ml(n.dependencies)?(typeof k=="function"&&(bf(i,o,k,u),V=i.memoizedState),(Y=si||My(i,o,Y,u,F,V,D)||n!==null&&n.dependencies!==null&&Ml(n.dependencies))?(H||typeof g.UNSAFE_componentWillUpdate!="function"&&typeof g.componentWillUpdate!="function"||(typeof g.componentWillUpdate=="function"&&g.componentWillUpdate(u,V,D),typeof g.UNSAFE_componentWillUpdate=="function"&&g.UNSAFE_componentWillUpdate(u,V,D)),typeof g.componentDidUpdate=="function"&&(i.flags|=4),typeof g.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof g.componentDidUpdate!="function"||w===n.memoizedProps&&F===n.memoizedState||(i.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||w===n.memoizedProps&&F===n.memoizedState||(i.flags|=1024),i.memoizedProps=u,i.memoizedState=V),g.props=u,g.state=V,g.context=D,u=Y):(typeof g.componentDidUpdate!="function"||w===n.memoizedProps&&F===n.memoizedState||(i.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||w===n.memoizedProps&&F===n.memoizedState||(i.flags|=1024),u=!1)}return g=u,tc(n,i),u=(i.flags&128)!==0,g||u?(g=i.stateNode,o=u&&typeof o.getDerivedStateFromError!="function"?null:g.render(),i.flags|=1,n!==null&&u?(i.child=ta(i,n.child,null,h),i.child=ta(i,null,o,h)):Jt(n,i,o,h),i.memoizedState=g.state,n=i.child):n=Os(n,i,h),n}function Xy(n,i,o,u){return Qi(),i.flags|=256,Jt(n,i,o,u),i.child}var Nf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Cf(n){return{baseLanes:n,cachePool:Bg()}}function _f(n,i,o){return n=n!==null?n.childLanes&~o:0,i&&(n|=En),n}function Wy(n,i,o){var u=i.pendingProps,h=!1,g=(i.flags&128)!==0,w;if((w=g)||(w=n!==null&&n.memoizedState===null?!1:(Rt.current&2)!==0),w&&(h=!0,i.flags&=-129),w=(i.flags&32)!==0,i.flags&=-33,n===null){if(Ze){if(h?ri(i):oi(),(n=ft)?(n=ov(n,Pn),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=Ag(n),o.return=i,i.child=o,Qt=i,ft=null)):n=null,n===null)throw ti(i);return lh(n)?i.lanes=32:i.lanes=536870912,null}var k=u.children;return u=u.fallback,h?(oi(),h=i.mode,k=nc({mode:"hidden",children:k},h),u=Vi(u,h,o,null),k.return=i,u.return=i,k.sibling=u,i.child=k,u=i.child,u.memoizedState=Cf(o),u.childLanes=_f(n,w,o),i.memoizedState=Nf,ho(null,u)):(ri(i),kf(i,k))}var D=n.memoizedState;if(D!==null&&(k=D.dehydrated,k!==null)){if(g)i.flags&256?(ri(i),i.flags&=-257,i=zf(n,i,o)):i.memoizedState!==null?(oi(),i.child=n.child,i.flags|=128,i=null):(oi(),k=u.fallback,h=i.mode,u=nc({mode:"visible",children:u.children},h),k=Vi(k,h,o,null),k.flags|=2,u.return=i,k.return=i,u.sibling=k,i.child=u,ta(i,n.child,null,o),u=i.child,u.memoizedState=Cf(o),u.childLanes=_f(n,w,o),i.memoizedState=Nf,i=ho(null,u));else if(ri(i),lh(k)){if(w=k.nextSibling&&k.nextSibling.dataset,w)var H=w.dgst;w=H,u=Error(a(419)),u.stack="",u.digest=w,eo({value:u,source:null,stack:null}),i=zf(n,i,o)}else if($t||Fa(n,i,o,!1),w=(o&n.childLanes)!==0,$t||w){if(w=ot,w!==null&&(u=qr(w,o),u!==0&&u!==D.retryLane))throw D.retryLane=u,Ki(n,u),yn(w,n,u),wf;oh(k)||dc(),i=zf(n,i,o)}else oh(k)?(i.flags|=192,i.child=n.child,i=null):(n=D.treeContext,ft=In(k.nextSibling),Qt=i,Ze=!0,ei=null,Pn=!1,n!==null&&Lg(i,n),i=kf(i,u.children),i.flags|=4096);return i}return h?(oi(),k=u.fallback,h=i.mode,D=n.child,H=D.sibling,u=Cs(D,{mode:"hidden",children:u.children}),u.subtreeFlags=D.subtreeFlags&65011712,H!==null?k=Cs(H,k):(k=Vi(k,h,o,null),k.flags|=2),k.return=i,u.return=i,u.sibling=k,i.child=u,ho(null,u),u=i.child,k=n.child.memoizedState,k===null?k=Cf(o):(h=k.cachePool,h!==null?(D=Ut._currentValue,h=h.parent!==D?{parent:D,pool:D}:h):h=Bg(),k={baseLanes:k.baseLanes|o,cachePool:h}),u.memoizedState=k,u.childLanes=_f(n,w,o),i.memoizedState=Nf,ho(n.child,u)):(ri(i),o=n.child,n=o.sibling,o=Cs(o,{mode:"visible",children:u.children}),o.return=i,o.sibling=null,n!==null&&(w=i.deletions,w===null?(i.deletions=[n],i.flags|=16):w.push(n)),i.child=o,i.memoizedState=null,o)}function kf(n,i){return i=nc({mode:"visible",children:i},n.mode),i.return=n,n.child=i}function nc(n,i){return n=Cn(22,n,null,i),n.lanes=0,n}function zf(n,i,o){return ta(i,n.child,null,o),n=kf(i,i.pendingProps.children),n.flags|=2,i.memoizedState=null,n}function e0(n,i,o){n.lanes|=i;var u=n.alternate;u!==null&&(u.lanes|=i),qd(n.return,i,o)}function Ef(n,i,o,u,h,g){var w=n.memoizedState;w===null?n.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:u,tail:o,tailMode:h,treeForkCount:g}:(w.isBackwards=i,w.rendering=null,w.renderingStartTime=0,w.last=u,w.tail=o,w.tailMode=h,w.treeForkCount=g)}function t0(n,i,o){var u=i.pendingProps,h=u.revealOrder,g=u.tail;u=u.children;var w=Rt.current,k=(w&2)!==0;if(k?(w=w&1|2,i.flags|=128):w&=1,ie(Rt,w),Jt(n,i,u,o),u=Ze?Wr:0,!k&&n!==null&&(n.flags&128)!==0)e:for(n=i.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&e0(n,o,i);else if(n.tag===19)e0(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&&Zl(n)===null&&(h=o),o=o.sibling;o=h,o===null?(h=i.child,i.child=null):(h=o.sibling,o.sibling=null),Ef(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&&Zl(n)===null){i.child=h;break}n=h.sibling,h.sibling=o,o=h,h=n}Ef(i,!0,o,null,g,u);break;case"together":Ef(i,!1,null,null,void 0,u);break;default:i.memoizedState=null}return i.child}function Os(n,i,o){if(n!==null&&(i.dependencies=n.dependencies),ui|=i.lanes,(o&i.childLanes)===0)if(n!==null){if(Fa(n,i,o,!1),(o&i.childLanes)===0)return null}else return null;if(n!==null&&i.child!==n.child)throw Error(a(153));if(i.child!==null){for(n=i.child,o=Cs(n,n.pendingProps),i.child=o,o.return=i;n.sibling!==null;)n=n.sibling,o=o.sibling=Cs(n,n.pendingProps),o.return=i;o.sibling=null}return i.child}function Rf(n,i){return(n.lanes&i)!==0?!0:(n=n.dependencies,!!(n!==null&&Ml(n)))}function lC(n,i,o){switch(i.tag){case 3:Ge(i,i.stateNode.containerInfo),ni(i,Ut,n.memoizedState.cache),Qi();break;case 27:case 5:Xe(i);break;case 4:Ge(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,ef(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?Wy(n,i,o):(ri(i),n=Os(n,i,o),n!==null?n.sibling:null);ri(i);break;case 19:var h=(n.flags&128)!==0;if(u=(o&i.childLanes)!==0,u||(Fa(n,i,o,!1),u=(o&i.childLanes)!==0),h){if(u)return t0(n,i,o);i.flags|=128}if(h=i.memoizedState,h!==null&&(h.rendering=null,h.tail=null,h.lastEffect=null),ie(Rt,Rt.current),u)break;return null;case 22:return i.lanes=0,Ky(n,i,o,i.pendingProps);case 24:ni(i,Ut,n.memoizedState.cache)}return Os(n,i,o)}function n0(n,i,o){if(n!==null)if(n.memoizedProps!==i.pendingProps)$t=!0;else{if(!Rf(n,o)&&(i.flags&128)===0)return $t=!1,lC(n,i,o);$t=(n.flags&131072)!==0}else $t=!1,Ze&&(i.flags&1048576)!==0&&Dg(i,Wr,i.index);switch(i.lanes=0,i.tag){case 16:e:{var u=i.pendingProps;if(n=Wi(i.elementType),i.type=n,typeof n=="function")Dd(n)?(u=sa(n,u),i.tag=1,i=Jy(null,i,n,u,o)):(i.tag=0,i=jf(null,i,n,u,o));else{if(n!=null){var h=n.$$typeof;if(h===z){i.tag=11,i=Zy(null,i,n,u,o);break e}else if(h===M){i.tag=14,i=Fy(null,i,n,u,o);break e}}throw i=ze(n)||n,Error(a(306,i,""))}}return i;case 0:return jf(n,i,i.type,i.pendingProps,o);case 1:return u=i.type,h=sa(u,i.pendingProps),Jy(n,i,u,h,o);case 3:e:{if(Ge(i,i.stateNode.containerInfo),n===null)throw Error(a(387));u=i.pendingProps;var g=i.memoizedState;h=g.element,Qd(n,i),oo(i,u,null,o);var w=i.memoizedState;if(u=w.cache,ni(i,Ut,u),u!==g.cache&&Hd(i,[Ut],o,!0),ro(),u=w.element,g.isDehydrated)if(g={element:u,isDehydrated:!1,cache:w.cache},i.updateQueue.baseState=g,i.memoizedState=g,i.flags&256){i=Xy(n,i,u,o);break e}else if(u!==h){h=Ln(Error(a(424)),i),eo(h),i=Xy(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,ft=In(n.firstChild),Qt=i,Ze=!0,ei=null,Pn=!0,o=Kg(i,null,u,o),i.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling;else{if(Qi(),u===h){i=Os(n,i,o);break e}Jt(n,i,u,o)}i=i.child}return i;case 26:return tc(n,i),n===null?(o=hv(i.type,null,i.pendingProps,null))?i.memoizedState=o:Ze||(o=i.type,n=i.pendingProps,u=vc(he.current).createElement(o),u[Et]=i,u[jt]=n,Xt(u,o,n),Mt(u),i.stateNode=u):i.memoizedState=hv(i.type,n.memoizedProps,i.pendingProps,n.memoizedState),null;case 27:return Xe(i),n===null&&Ze&&(u=i.stateNode=uv(i.type,i.pendingProps,he.current),Qt=i,Pn=!0,h=ft,pi(i.type)?(ch=h,ft=In(u.firstChild)):ft=h),Jt(n,i,i.pendingProps.children,o),tc(n,i),n===null&&(i.flags|=4194304),i.child;case 5:return n===null&&Ze&&((h=u=ft)&&(u=PC(u,i.type,i.pendingProps,Pn),u!==null?(i.stateNode=u,Qt=i,ft=In(u.firstChild),Pn=!1,h=!0):h=!1),h||ti(i)),Xe(i),h=i.type,g=i.pendingProps,w=n!==null?n.memoizedProps:null,u=g.children,ih(h,g)?u=null:w!==null&&ih(h,w)&&(i.flags|=32),i.memoizedState!==null&&(h=nf(n,i,WN,null,null,o),zo._currentValue=h),tc(n,i),Jt(n,i,u,o),i.child;case 6:return n===null&&Ze&&((n=o=ft)&&(o=$C(o,i.pendingProps,Pn),o!==null?(i.stateNode=o,Qt=i,ft=null,n=!0):n=!1),n||ti(i)),null;case 13:return Wy(n,i,o);case 4:return Ge(i,i.stateNode.containerInfo),u=i.pendingProps,n===null?i.child=ta(i,null,u,o):Jt(n,i,u,o),i.child;case 11:return Zy(n,i,i.type,i.pendingProps,o);case 7:return Jt(n,i,i.pendingProps,o),i.child;case 8:return Jt(n,i,i.pendingProps.children,o),i.child;case 12:return Jt(n,i,i.pendingProps.children,o),i.child;case 10:return u=i.pendingProps,ni(i,i.type,u.value),Jt(n,i,u.children,o),i.child;case 9:return h=i.type._context,u=i.pendingProps.children,Ji(i),h=Yt(h),u=u(h),i.flags|=1,Jt(n,i,u,o),i.child;case 14:return Fy(n,i,i.type,i.pendingProps,o);case 15:return Gy(n,i,i.type,i.pendingProps,o);case 19:return t0(n,i,o);case 31:return oC(n,i,o);case 22:return Ky(n,i,o,i.pendingProps);case 24:return Ji(i),u=Yt(Ut),n===null?(h=Gd(),h===null&&(h=ot,g=Zd(),h.pooledCache=g,g.refCount++,g!==null&&(h.pooledCacheLanes|=o),h=g),i.memoizedState={parent:u,cache:h},Vd(i),ni(i,Ut,h)):((n.lanes&o)!==0&&(Qd(n,i),oo(i,null,null,o),ro()),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,Ut,u)):(u=g.cache,ni(i,Ut,u),u!==h.cache&&Hd(i,[Ut],o,!0))),Jt(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 Of(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(E0())n.flags|=8192;else throw ea=Il,Kd}else n.flags&=-16777217}function s0(n,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)n.flags&=-16777217;else if(n.flags|=16777216,!vv(i))if(E0())n.flags|=8192;else throw ea=Il,Kd}function sc(n,i){i!==null&&(n.flags|=4),n.flags&16384&&(i=n.tag!==22?yl():536870912,n.lanes|=i,sr|=i)}function mo(n,i){if(!Ze)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 ht(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 cC(n,i,o){var u=i.pendingProps;switch(Pd(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ht(i),null;case 1:return ht(i),null;case 3:return o=i.stateNode,u=null,n!==null&&(u=n.memoizedState.cache),i.memoizedState.cache!==u&&(i.flags|=2048),zs(Ut),ge(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),(n===null||n.child===null)&&(Za(i)?As(i):n===null||n.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,Id())),ht(i),null;case 26:var h=i.type,g=i.memoizedState;return n===null?(As(i),g!==null?(ht(i),s0(i,g)):(ht(i),Of(i,h,null,u,o))):g?g!==n.memoizedState?(As(i),ht(i),s0(i,g)):(ht(i),i.flags&=-16777217):(n=n.memoizedProps,n!==u&&As(i),ht(i),Of(i,h,n,u,o)),null;case 27:if(mt(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 ht(i),null}n=re.current,Za(i)?Mg(i):(n=uv(h,u,o),i.stateNode=n,As(i))}return ht(i),null;case 5:if(mt(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 ht(i),null}if(g=re.current,Za(i))Mg(i);else{var w=vc(he.current);switch(g){case 1:g=w.createElementNS("http://www.w3.org/2000/svg",h);break;case 2:g=w.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;default:switch(h){case"svg":g=w.createElementNS("http://www.w3.org/2000/svg",h);break;case"math":g=w.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;case"script":g=w.createElement("div"),g.innerHTML="<script><\/script>",g=g.removeChild(g.firstChild);break;case"select":g=typeof u.is=="string"?w.createElement("select",{is:u.is}):w.createElement("select"),u.multiple?g.multiple=!0:u.size&&(g.size=u.size);break;default:g=typeof u.is=="string"?w.createElement(h,{is:u.is}):w.createElement(h)}}g[Et]=i,g[jt]=u;e:for(w=i.child;w!==null;){if(w.tag===5||w.tag===6)g.appendChild(w.stateNode);else if(w.tag!==4&&w.tag!==27&&w.child!==null){w.child.return=w,w=w.child;continue}if(w===i)break e;for(;w.sibling===null;){if(w.return===null||w.return===i)break e;w=w.return}w.sibling.return=w.return,w=w.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 ht(i),Of(i,i.type,n===null?null:n.memoizedProps,i.pendingProps,o),null;case 6:if(n&&i.stateNode!=null)n.memoizedProps!==u&&As(i);else{if(typeof u!="string"&&i.stateNode===null)throw Error(a(166));if(n=he.current,Za(i)){if(n=i.stateNode,o=i.memoizedProps,u=null,h=Qt,h!==null)switch(h.tag){case 27:case 5:u=h.memoizedProps}n[Et]=i,n=!!(n.nodeValue===o||u!==null&&u.suppressHydrationWarning===!0||W0(n.nodeValue,o)),n||ti(i,!0)}else n=vc(n).createTextNode(u),n[Et]=i,i.stateNode=n}return ht(i),null;case 31:if(o=i.memoizedState,n===null||n.memoizedState!==null){if(u=Za(i),o!==null){if(n===null){if(!u)throw Error(a(318));if(n=i.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(a(557));n[Et]=i}else Qi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;ht(i),n=!1}else o=Id(),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 ht(i),null;case 13:if(u=i.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(h=Za(i),u!==null&&u.dehydrated!==null){if(n===null){if(!h)throw Error(a(318));if(h=i.memoizedState,h=h!==null?h.dehydrated:null,!h)throw Error(a(317));h[Et]=i}else Qi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;ht(i),h=!1}else h=Id(),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),sc(i,i.updateQueue),ht(i),null);case 4:return ge(),n===null&&Wf(i.stateNode.containerInfo),ht(i),null;case 10:return zs(i.type),ht(i),null;case 19:if(G(Rt),u=i.memoizedState,u===null)return ht(i),null;if(h=(i.flags&128)!==0,g=u.rendering,g===null)if(h)mo(u,!1);else{if(Ct!==0||n!==null&&(n.flags&128)!==0)for(n=i.child;n!==null;){if(g=Zl(n),g!==null){for(i.flags|=128,mo(u,!1),n=g.updateQueue,i.updateQueue=n,sc(i,n),i.subtreeFlags=0,n=o,o=i.child;o!==null;)Og(o,n),o=o.sibling;return ie(Rt,Rt.current&1|2),Ze&&_s(i,u.treeForkCount),i.child}n=n.sibling}u.tail!==null&&Pe()>lc&&(i.flags|=128,h=!0,mo(u,!1),i.lanes=4194304)}else{if(!h)if(n=Zl(g),n!==null){if(i.flags|=128,h=!0,n=n.updateQueue,i.updateQueue=n,sc(i,n),mo(u,!0),u.tail===null&&u.tailMode==="hidden"&&!g.alternate&&!Ze)return ht(i),null}else 2*Pe()-u.renderingStartTime>lc&&o!==536870912&&(i.flags|=128,h=!0,mo(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=Rt.current,ie(Rt,h?o&1|2:o&1),Ze&&_s(i,u.treeForkCount),n):(ht(i),null);case 22:case 23:return kn(i),Wd(),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&&(ht(i),i.subtreeFlags&6&&(i.flags|=8192)):ht(i),o=i.updateQueue,o!==null&&sc(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(Ut),ht(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function uC(n,i){switch(Pd(i),i.tag){case 1:return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 3:return zs(Ut),ge(),n=i.flags,(n&65536)!==0&&(n&128)===0?(i.flags=n&-65537|128,i):null;case 26:case 27:case 5:return mt(i),null;case 31:if(i.memoizedState!==null){if(kn(i),i.alternate===null)throw Error(a(340));Qi()}return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 13:if(kn(i),n=i.memoizedState,n!==null&&n.dehydrated!==null){if(i.alternate===null)throw Error(a(340));Qi()}return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 19:return G(Rt),null;case 4:return ge(),null;case 10:return zs(i.type),null;case 22:case 23:return kn(i),Wd(),n!==null&&G(Xi),n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 24:return zs(Ut),null;case 25:return null;default:return null}}function i0(n,i){switch(Pd(i),i.tag){case 3:zs(Ut),ge();break;case 26:case 27:case 5:mt(i);break;case 4:ge();break;case 31:i.memoizedState!==null&&kn(i);break;case 13:kn(i);break;case 19:G(Rt);break;case 10:zs(i.type);break;case 22:case 23:kn(i),Wd(),n!==null&&G(Xi);break;case 24:zs(Ut)}}function po(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,w=o.inst;u=g(),w.destroy=u}o=o.next}while(o!==h)}}catch(k){et(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 w=u.inst,k=w.destroy;if(k!==void 0){w.destroy=void 0,h=i;var D=o,H=k;try{H()}catch(Y){et(h,D,Y)}}}u=u.next}while(u!==g)}}catch(Y){et(i,i.return,Y)}}function a0(n){var i=n.updateQueue;if(i!==null){var o=n.stateNode;try{Qg(i,o)}catch(u){et(n,n.return,u)}}}function r0(n,i,o){o.props=sa(n.type,n.memoizedProps),o.state=n.memoizedState;try{o.componentWillUnmount()}catch(u){et(n,i,u)}}function go(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){et(n,i,h)}}function ms(n,i){var o=n.ref,u=n.refCleanup;if(o!==null)if(typeof u=="function")try{u()}catch(h){et(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){et(n,i,h)}else o.current=null}function o0(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){et(n,n.return,h)}}function Af(n,i,o){try{var u=n.stateNode;AC(u,n.type,o,i),u[jt]=i}catch(h){et(n,n.return,h)}}function l0(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&pi(n.type)||n.tag===4}function Tf(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||l0(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.tag===27&&pi(n.type)||n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function Df(n,i,o){var u=n.tag;if(u===5||u===6)n=n.stateNode,i?(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o).insertBefore(n,i):(i=o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,i.appendChild(n),o=o._reactRootContainer,o!=null||i.onclick!==null||(i.onclick=js));else if(u!==4&&(u===27&&pi(n.type)&&(o=n.stateNode,i=null),n=n.child,n!==null))for(Df(n,i,o),n=n.sibling;n!==null;)Df(n,i,o),n=n.sibling}function ic(n,i,o){var u=n.tag;if(u===5||u===6)n=n.stateNode,i?o.insertBefore(n,i):o.appendChild(n);else if(u!==4&&(u===27&&pi(n.type)&&(o=n.stateNode),n=n.child,n!==null))for(ic(n,i,o),n=n.sibling;n!==null;)ic(n,i,o),n=n.sibling}function c0(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[Et]=n,i[jt]=o}catch(g){et(n,n.return,g)}}var Ts=!1,It=!1,Lf=!1,u0=typeof WeakSet=="function"?WeakSet:Set,Gt=null;function dC(n,i){if(n=n.containerInfo,nh=Cc,n=wg(n),kd(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 w=0,k=-1,D=-1,H=0,Y=0,ee=n,F=null;t:for(;;){for(var V;ee!==o||h!==0&&ee.nodeType!==3||(k=w+h),ee!==g||u!==0&&ee.nodeType!==3||(D=w+u),ee.nodeType===3&&(w+=ee.nodeValue.length),(V=ee.firstChild)!==null;)F=ee,ee=V;for(;;){if(ee===n)break t;if(F===o&&++H===h&&(k=w),F===g&&++Y===u&&(D=w),(V=ee.nextSibling)!==null)break;ee=F,F=ee.parentNode}ee=V}o=k===-1||D===-1?null:{start:k,end:D}}else o=null}o=o||{start:0,end:0}}else o=null;for(sh={focusedElem:n,selectionRange:o},Cc=!1,Gt=i;Gt!==null;)if(i=Gt,n=i.child,(i.subtreeFlags&1028)!==0&&n!==null)n.return=i,Gt=n;else for(;Gt!==null;){switch(i=Gt,g=i.alternate,n=i.flags,i.tag){case 0:if((n&4)!==0&&(n=i.updateQueue,n=n!==null?n.events:null,n!==null))for(o=0;o<n.length;o++)h=n[o],h.ref.impl=h.nextImpl;break;case 11:case 15:break;case 1:if((n&1024)!==0&&g!==null){n=void 0,o=i,h=g.memoizedProps,g=g.memoizedState,u=o.stateNode;try{var ye=sa(o.type,h);n=u.getSnapshotBeforeUpdate(ye,g),u.__reactInternalSnapshotBeforeUpdate=n}catch(_e){et(o,o.return,_e)}}break;case 3:if((n&1024)!==0){if(n=i.stateNode.containerInfo,o=n.nodeType,o===9)rh(n);else if(o===1)switch(n.nodeName){case"HEAD":case"HTML":case"BODY":rh(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,Gt=n;break}Gt=i.return}}function d0(n,i,o){var u=o.flags;switch(o.tag){case 0:case 11:case 15:Ls(n,o),u&4&&po(5,o);break;case 1:if(Ls(n,o),u&4)if(n=o.stateNode,i===null)try{n.componentDidMount()}catch(w){et(o,o.return,w)}else{var h=sa(o.type,i.memoizedProps);i=i.memoizedState;try{n.componentDidUpdate(h,i,n.__reactInternalSnapshotBeforeUpdate)}catch(w){et(o,o.return,w)}}u&64&&a0(o),u&512&&go(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{Qg(n,i)}catch(w){et(o,o.return,w)}}break;case 27:i===null&&u&4&&c0(o);case 26:case 5:Ls(n,o),i===null&&u&4&&o0(o),u&512&&go(o,o.return);break;case 12:Ls(n,o);break;case 31:Ls(n,o),u&4&&m0(n,o);break;case 13:Ls(n,o),u&4&&p0(n,o),u&64&&(n=o.memoizedState,n!==null&&(n=n.dehydrated,n!==null&&(o=xC.bind(null,o),IC(n,o))));break;case 22:if(u=o.memoizedState!==null||Ts,!u){i=i!==null&&i.memoizedState!==null||It,h=Ts;var g=It;Ts=u,(It=i)&&!g?Ms(n,o,(o.subtreeFlags&8772)!==0):Ls(n,o),Ts=h,It=g}break;case 30:break;default:Ls(n,o)}}function f0(n){var i=n.alternate;i!==null&&(n.alternate=null,f0(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 pt=null,hn=!1;function Ds(n,i,o){for(o=o.child;o!==null;)h0(n,i,o),o=o.sibling}function h0(n,i,o){if(Ce&&typeof Ce.onCommitFiberUnmount=="function")try{Ce.onCommitFiberUnmount(os,o)}catch{}switch(o.tag){case 26:It||ms(o,i),Ds(n,i,o),o.memoizedState?o.memoizedState.count--:o.stateNode&&(o=o.stateNode,o.parentNode.removeChild(o));break;case 27:It||ms(o,i);var u=pt,h=hn;pi(o.type)&&(pt=o.stateNode,hn=!1),Ds(n,i,o),Co(o.stateNode),pt=u,hn=h;break;case 5:It||ms(o,i);case 6:if(u=pt,h=hn,pt=null,Ds(n,i,o),pt=u,hn=h,pt!==null)if(hn)try{(pt.nodeType===9?pt.body:pt.nodeName==="HTML"?pt.ownerDocument.body:pt).removeChild(o.stateNode)}catch(g){et(o,i,g)}else try{pt.removeChild(o.stateNode)}catch(g){et(o,i,g)}break;case 18:pt!==null&&(hn?(n=pt,av(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,o.stateNode),dr(n)):av(pt,o.stateNode));break;case 4:u=pt,h=hn,pt=o.stateNode.containerInfo,hn=!0,Ds(n,i,o),pt=u,hn=h;break;case 0:case 11:case 14:case 15:li(2,o,i),It||li(4,o,i),Ds(n,i,o);break;case 1:It||(ms(o,i),u=o.stateNode,typeof u.componentWillUnmount=="function"&&r0(o,i,u)),Ds(n,i,o);break;case 21:Ds(n,i,o);break;case 22:It=(u=It)||o.memoizedState!==null,Ds(n,i,o),It=u;break;default:Ds(n,i,o)}}function m0(n,i){if(i.memoizedState===null&&(n=i.alternate,n!==null&&(n=n.memoizedState,n!==null))){n=n.dehydrated;try{dr(n)}catch(o){et(i,i.return,o)}}}function p0(n,i){if(i.memoizedState===null&&(n=i.alternate,n!==null&&(n=n.memoizedState,n!==null&&(n=n.dehydrated,n!==null))))try{dr(n)}catch(o){et(i,i.return,o)}}function fC(n){switch(n.tag){case 31:case 13:case 19:var i=n.stateNode;return i===null&&(i=n.stateNode=new u0),i;case 22:return n=n.stateNode,i=n._retryCache,i===null&&(i=n._retryCache=new u0),i;default:throw Error(a(435,n.tag))}}function ac(n,i){var o=fC(n);i.forEach(function(u){if(!o.has(u)){o.add(u);var h=SC.bind(null,n,u);u.then(h,h)}})}function mn(n,i){var o=i.deletions;if(o!==null)for(var u=0;u<o.length;u++){var h=o[u],g=n,w=i,k=w;e:for(;k!==null;){switch(k.tag){case 27:if(pi(k.type)){pt=k.stateNode,hn=!1;break e}break;case 5:pt=k.stateNode,hn=!1;break e;case 3:case 4:pt=k.stateNode.containerInfo,hn=!0;break e}k=k.return}if(pt===null)throw Error(a(160));h0(g,w,h),pt=null,hn=!1,g=h.alternate,g!==null&&(g.return=null),h.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)g0(i,n),i=i.sibling}var Xn=null;function g0(n,i){var o=n.alternate,u=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:mn(i,n),pn(n),u&4&&(li(3,n,n.return),po(3,n),li(5,n,n.return));break;case 1:mn(i,n),pn(n),u&512&&(It||o===null||ms(o,o.return)),u&64&&Ts&&(n=n.updateQueue,n!==null&&(u=n.callbacks,u!==null&&(o=n.shared.hiddenCallbacks,n.shared.hiddenCallbacks=o===null?u:o.concat(u))));break;case 26:var h=Xn;if(mn(i,n),pn(n),u&512&&(It||o===null||ms(o,o.return)),u&4){var g=o!==null?o.memoizedState:null;if(u=n.memoizedState,o===null)if(u===null)if(n.stateNode===null){e:{u=n.type,o=n.memoizedProps,h=h.ownerDocument||h;t:switch(u){case"title":g=h.getElementsByTagName("title")[0],(!g||g[us]||g[Et]||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[Et]=n,Mt(g),u=g;break e;case"link":var w=gv("link","href",h).get(u+(o.href||""));if(w){for(var k=0;k<w.length;k++)if(g=w[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)){w.splice(k,1);break t}}g=h.createElement(u),Xt(g,u,o),h.head.appendChild(g);break;case"meta":if(w=gv("meta","content",h).get(u+(o.content||""))){for(k=0;k<w.length;k++)if(g=w[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)){w.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[Et]=n,Mt(g),u=g}n.stateNode=u}else yv(h,n.type,n.stateNode);else n.stateNode=pv(h,u,n.memoizedProps);else g!==u?(g===null?o.stateNode!==null&&(o=o.stateNode,o.parentNode.removeChild(o)):g.count--,u===null?yv(h,n.type,n.stateNode):pv(h,u,n.memoizedProps)):u===null&&n.stateNode!==null&&Af(n,n.memoizedProps,o.memoizedProps)}break;case 27:mn(i,n),pn(n),u&512&&(It||o===null||ms(o,o.return)),o!==null&&u&4&&Af(n,n.memoizedProps,o.memoizedProps);break;case 5:if(mn(i,n),pn(n),u&512&&(It||o===null||ms(o,o.return)),n.flags&32){h=n.stateNode;try{Da(h,"")}catch(ye){et(n,n.return,ye)}}u&4&&n.stateNode!=null&&(h=n.memoizedProps,Af(n,h,o!==null?o.memoizedProps:h)),u&1024&&(Lf=!0);break;case 6:if(mn(i,n),pn(n),u&4){if(n.stateNode===null)throw Error(a(162));u=n.memoizedProps,o=n.stateNode;try{o.nodeValue=u}catch(ye){et(n,n.return,ye)}}break;case 3:if(Sc=null,h=Xn,Xn=bc(i.containerInfo),mn(i,n),Xn=h,pn(n),u&4&&o!==null&&o.memoizedState.isDehydrated)try{dr(i.containerInfo)}catch(ye){et(n,n.return,ye)}Lf&&(Lf=!1,y0(n));break;case 4:u=Xn,Xn=bc(n.stateNode.containerInfo),mn(i,n),pn(n),Xn=u;break;case 12:mn(i,n),pn(n);break;case 31:mn(i,n),pn(n),u&4&&(u=n.updateQueue,u!==null&&(n.updateQueue=null,ac(n,u)));break;case 13:mn(i,n),pn(n),n.child.flags&8192&&n.memoizedState!==null!=(o!==null&&o.memoizedState!==null)&&(oc=Pe()),u&4&&(u=n.updateQueue,u!==null&&(n.updateQueue=null,ac(n,u)));break;case 22:h=n.memoizedState!==null;var D=o!==null&&o.memoizedState!==null,H=Ts,Y=It;if(Ts=H||h,It=Y||D,mn(i,n),It=Y,Ts=H,pn(n),u&8192)e:for(i=n.stateNode,i._visibility=h?i._visibility&-2:i._visibility|1,h&&(o===null||D||Ts||It||ia(n)),o=null,i=n;;){if(i.tag===5||i.tag===26){if(o===null){D=o=i;try{if(g=D.stateNode,h)w=g.style,typeof w.setProperty=="function"?w.setProperty("display","none","important"):w.display="none";else{k=D.stateNode;var ee=D.memoizedProps.style,F=ee!=null&&ee.hasOwnProperty("display")?ee.display:null;k.style.display=F==null||typeof F=="boolean"?"":(""+F).trim()}}catch(ye){et(D,D.return,ye)}}}else if(i.tag===6){if(o===null){D=i;try{D.stateNode.nodeValue=h?"":D.memoizedProps}catch(ye){et(D,D.return,ye)}}}else if(i.tag===18){if(o===null){D=i;try{var V=D.stateNode;h?rv(V,!0):rv(D.stateNode,!1)}catch(ye){et(D,D.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,ac(n,o))));break;case 19:mn(i,n),pn(n),u&4&&(u=n.updateQueue,u!==null&&(n.updateQueue=null,ac(n,u)));break;case 30:break;case 21:break;default:mn(i,n),pn(n)}}function pn(n){var i=n.flags;if(i&2){try{for(var o,u=n.return;u!==null;){if(l0(u)){o=u;break}u=u.return}if(o==null)throw Error(a(160));switch(o.tag){case 27:var h=o.stateNode,g=Tf(n);ic(n,g,h);break;case 5:var w=o.stateNode;o.flags&32&&(Da(w,""),o.flags&=-33);var k=Tf(n);ic(n,k,w);break;case 3:case 4:var D=o.stateNode.containerInfo,H=Tf(n);Df(n,H,D);break;default:throw Error(a(161))}}catch(Y){et(n,n.return,Y)}n.flags&=-3}i&4096&&(n.flags&=-4097)}function y0(n){if(n.subtreeFlags&1024)for(n=n.child;n!==null;){var i=n;y0(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;)d0(n,i.alternate,i),i=i.sibling}function ia(n){for(n=n.child;n!==null;){var i=n;switch(i.tag){case 0:case 11:case 14:case 15:li(4,i,i.return),ia(i);break;case 1:ms(i,i.return);var o=i.stateNode;typeof o.componentWillUnmount=="function"&&r0(i,i.return,o),ia(i);break;case 27:Co(i.stateNode);case 26:case 5:ms(i,i.return),ia(i);break;case 22:i.memoizedState===null&&ia(i);break;case 30:ia(i);break;default:ia(i)}n=n.sibling}}function Ms(n,i,o){for(o=o&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var u=i.alternate,h=n,g=i,w=g.flags;switch(g.tag){case 0:case 11:case 15:Ms(h,g,o),po(4,g);break;case 1:if(Ms(h,g,o),u=g,h=u.stateNode,typeof h.componentDidMount=="function")try{h.componentDidMount()}catch(H){et(u,u.return,H)}if(u=g,h=u.updateQueue,h!==null){var k=u.stateNode;try{var D=h.shared.hiddenCallbacks;if(D!==null)for(h.shared.hiddenCallbacks=null,h=0;h<D.length;h++)Vg(D[h],k)}catch(H){et(u,u.return,H)}}o&&w&64&&a0(g),go(g,g.return);break;case 27:c0(g);case 26:case 5:Ms(h,g,o),o&&u===null&&w&4&&o0(g),go(g,g.return);break;case 12:Ms(h,g,o);break;case 31:Ms(h,g,o),o&&w&4&&m0(h,g);break;case 13:Ms(h,g,o),o&&w&4&&p0(h,g);break;case 22:g.memoizedState===null&&Ms(h,g,o),go(g,g.return);break;case 30:break;default:Ms(h,g,o)}i=i.sibling}}function Mf(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&&to(o))}function Uf(n,i){n=null,i.alternate!==null&&(n=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==n&&(i.refCount++,n!=null&&to(n))}function Wn(n,i,o,u){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)v0(n,i,o,u),i=i.sibling}function v0(n,i,o,u){var h=i.flags;switch(i.tag){case 0:case 11:case 15:Wn(n,i,o,u),h&2048&&po(9,i);break;case 1:Wn(n,i,o,u);break;case 3:Wn(n,i,o,u),h&2048&&(n=null,i.alternate!==null&&(n=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==n&&(i.refCount++,n!=null&&to(n)));break;case 12:if(h&2048){Wn(n,i,o,u),n=i.stateNode;try{var g=i.memoizedProps,w=g.id,k=g.onPostCommit;typeof k=="function"&&k(w,i.alternate===null?"mount":"update",n.passiveEffectDuration,-0)}catch(D){et(i,i.return,D)}}else Wn(n,i,o,u);break;case 31:Wn(n,i,o,u);break;case 13:Wn(n,i,o,u);break;case 23:break;case 22:g=i.stateNode,w=i.alternate,i.memoizedState!==null?g._visibility&2?Wn(n,i,o,u):yo(n,i):g._visibility&2?Wn(n,i,o,u):(g._visibility|=2,er(n,i,o,u,(i.subtreeFlags&10256)!==0||!1)),h&2048&&Mf(w,i);break;case 24:Wn(n,i,o,u),h&2048&&Uf(i.alternate,i);break;default:Wn(n,i,o,u)}}function er(n,i,o,u,h){for(h=h&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var g=n,w=i,k=o,D=u,H=w.flags;switch(w.tag){case 0:case 11:case 15:er(g,w,k,D,h),po(8,w);break;case 23:break;case 22:var Y=w.stateNode;w.memoizedState!==null?Y._visibility&2?er(g,w,k,D,h):yo(g,w):(Y._visibility|=2,er(g,w,k,D,h)),h&&H&2048&&Mf(w.alternate,w);break;case 24:er(g,w,k,D,h),h&&H&2048&&Uf(w.alternate,w);break;default:er(g,w,k,D,h)}i=i.sibling}}function yo(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:yo(o,u),h&2048&&Mf(u.alternate,u);break;case 24:yo(o,u),h&2048&&Uf(u.alternate,u);break;default:yo(o,u)}i=i.sibling}}var vo=8192;function tr(n,i,o){if(n.subtreeFlags&vo)for(n=n.child;n!==null;)b0(n,i,o),n=n.sibling}function b0(n,i,o){switch(n.tag){case 26:tr(n,i,o),n.flags&vo&&n.memoizedState!==null&&XC(o,Xn,n.memoizedState,n.memoizedProps);break;case 5:tr(n,i,o);break;case 3:case 4:var u=Xn;Xn=bc(n.stateNode.containerInfo),tr(n,i,o),Xn=u;break;case 22:n.memoizedState===null&&(u=n.alternate,u!==null&&u.memoizedState!==null?(u=vo,vo=16777216,tr(n,i,o),vo=u):tr(n,i,o));break;default:tr(n,i,o)}}function x0(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 bo(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];Gt=u,w0(u,n)}x0(n)}if(n.subtreeFlags&10256)for(n=n.child;n!==null;)S0(n),n=n.sibling}function S0(n){switch(n.tag){case 0:case 11:case 15:bo(n),n.flags&2048&&li(9,n,n.return);break;case 3:bo(n);break;case 12:bo(n);break;case 22:var i=n.stateNode;n.memoizedState!==null&&i._visibility&2&&(n.return===null||n.return.tag!==13)?(i._visibility&=-3,rc(n)):bo(n);break;default:bo(n)}}function rc(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];Gt=u,w0(u,n)}x0(n)}for(n=n.child;n!==null;){switch(i=n,i.tag){case 0:case 11:case 15:li(8,i,i.return),rc(i);break;case 22:o=i.stateNode,o._visibility&2&&(o._visibility&=-3,rc(i));break;default:rc(i)}n=n.sibling}}function w0(n,i){for(;Gt!==null;){var o=Gt;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:to(o.memoizedState.cache)}if(u=o.child,u!==null)u.return=o,Gt=u;else e:for(o=n;Gt!==null;){u=Gt;var h=u.sibling,g=u.return;if(f0(u),u===o){Gt=null;break e}if(h!==null){h.return=g,Gt=h;break e}Gt=g}}}var hC={getCacheForType:function(n){var i=Yt(Ut),o=i.data.get(n);return o===void 0&&(o=n(),i.data.set(n,o)),o},cacheSignal:function(){return Yt(Ut).controller.signal}},mC=typeof WeakMap=="function"?WeakMap:Map,Ye=0,ot=null,Le=null,Be=0,We=0,zn=null,ci=!1,nr=!1,Pf=!1,Us=0,Ct=0,ui=0,aa=0,$f=0,En=0,sr=0,xo=null,gn=null,If=!1,oc=0,j0=0,lc=1/0,cc=null,di=null,Zt=0,fi=null,ir=null,Ps=0,Bf=0,qf=null,N0=null,So=0,Hf=null;function Rn(){return(Ye&2)!==0&&Be!==0?Be&-Be:B.T!==null?Qf():nt()}function C0(){if(En===0)if((Be&536870912)===0||Ze){var n=Ss;Ss<<=1,(Ss&3932160)===0&&(Ss=262144),En=n}else En=536870912;return n=_n.current,n!==null&&(n.flags|=32),En}function yn(n,i,o){(n===ot&&(We===2||We===9)||n.cancelPendingCommit!==null)&&(ar(n,0),hi(n,Be,En,!1)),Hi(n,o),((Ye&2)===0||n!==ot)&&(n===ot&&((Ye&2)===0&&(aa|=o),Ct===4&&hi(n,Be,En,!1)),ps(n))}function _0(n,i,o){if((Ye&6)!==0)throw Error(a(327));var u=!o&&(i&127)===0&&(i&n.expiredLanes)===0||cs(n,i),h=u?yC(n,i):Ff(n,i,!0),g=u;do{if(h===0){nr&&!u&&hi(n,i,0,!1);break}else{if(o=n.current.alternate,g&&!pC(o)){h=Ff(n,i,!1),g=!1;continue}if(h===2){if(g=i,n.errorRecoveryDisabledLanes&g)var w=0;else w=n.pendingLanes&-536870913,w=w!==0?w:w&536870912?536870912:0;if(w!==0){i=w;e:{var k=n;h=xo;var D=k.current.memoizedState.isDehydrated;if(D&&(ar(k,w).flags|=256),w=Ff(k,w,!1),w!==2){if(Pf&&!D){k.errorRecoveryDisabledLanes|=g,aa|=g,h=4;break e}g=gn,gn=h,g!==null&&(gn===null?gn=g:gn.push.apply(gn,g))}h=w}if(g=!1,h!==2)continue}}if(h===1){ar(n,0),hi(n,i,0,!0);break}e:{switch(u=n,g=h,g){case 0:case 1:throw Error(a(345));case 4:if((i&4194048)!==i)break;case 6:hi(u,i,En,!ci);break e;case 2:gn=null;break;case 3:case 5:break;default:throw Error(a(329))}if((i&62914560)===i&&(h=oc+300-Pe(),10<h)){if(hi(u,i,En,!ci),Ea(u,0,!0)!==0)break e;Ps=i,u.timeoutHandle=sv(k0.bind(null,u,o,gn,cc,If,i,En,aa,sr,ci,g,"Throttled",-0,0),h);break e}k0(u,o,gn,cc,If,i,En,aa,sr,ci,g,null,-0,0)}}break}while(!0);ps(n)}function k0(n,i,o,u,h,g,w,k,D,H,Y,ee,F,V){if(n.timeoutHandle=-1,ee=i.subtreeFlags,ee&8192||(ee&16785408)===16785408){ee={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:js},b0(i,g,ee);var ye=(g&62914560)===g?oc-Pe():(g&4194048)===g?j0-Pe():0;if(ye=WC(ee,ye),ye!==null){Ps=g,n.cancelPendingCommit=ye(L0.bind(null,n,i,g,o,u,h,w,k,D,Y,ee,null,F,V)),hi(n,g,w,!H);return}}L0(n,i,g,o,u,h,w,k,D)}function pC(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&=~$f,i&=~aa,n.suspendedLanes|=i,n.pingedLanes&=~i,u&&(n.warmLanes|=i),u=n.expirationTimes;for(var h=i;0<h;){var g=31-ne(h),w=1<<g;u[g]=-1,h&=~w}o!==0&&vl(n,o,i)}function uc(){return(Ye&6)===0?(wo(0),!1):!0}function Zf(){if(Le!==null){if(We===0)var n=Le.return;else n=Le,ks=Yi=null,rf(n),Qa=null,so=0,n=Le;for(;n!==null;)i0(n.alternate,n),n=n.return;Le=null}}function ar(n,i){var o=n.timeoutHandle;o!==-1&&(n.timeoutHandle=-1,LC(o)),o=n.cancelPendingCommit,o!==null&&(n.cancelPendingCommit=null,o()),Ps=0,Zf(),ot=n,Le=o=Cs(n.current,null),Be=i,We=0,zn=null,ci=!1,nr=cs(n,i),Pf=!1,sr=En=$f=aa=ui=Ct=0,gn=xo=null,If=!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-ne(u),g=1<<h;i|=n[h],u&=~g}return Us=i,Ol(),o}function z0(n,i){Oe=null,B.H=fo,i===Va||i===$l?(i=Zg(),We=3):i===Kd?(i=Zg(),We=4):We=i===wf?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,zn=i,Le===null&&(Ct=1,Wl(n,Ln(i,n.current)))}function E0(){var n=_n.current;return n===null?!0:(Be&4194048)===Be?$n===null:(Be&62914560)===Be||(Be&536870912)!==0?n===$n:!1}function R0(){var n=B.H;return B.H=fo,n===null?fo:n}function O0(){var n=B.A;return B.A=hC,n}function dc(){Ct=4,ci||(Be&4194048)!==Be&&_n.current!==null||(nr=!0),(ui&134217727)===0&&(aa&134217727)===0||ot===null||hi(ot,Be,En,!1)}function Ff(n,i,o){var u=Ye;Ye|=2;var h=R0(),g=O0();(ot!==n||Be!==i)&&(cc=null,ar(n,i)),i=!1;var w=Ct;e:do try{if(We!==0&&Le!==null){var k=Le,D=zn;switch(We){case 8:Zf(),w=6;break e;case 3:case 2:case 9:case 6:_n.current===null&&(i=!0);var H=We;if(We=0,zn=null,rr(n,k,D,H),o&&nr){w=0;break e}break;default:H=We,We=0,zn=null,rr(n,k,D,H)}}gC(),w=Ct;break}catch(Y){z0(n,Y)}while(!0);return i&&n.shellSuspendCounter++,ks=Yi=null,Ye=u,B.H=h,B.A=g,Le===null&&(ot=null,Be=0,Ol()),w}function gC(){for(;Le!==null;)A0(Le)}function yC(n,i){var o=Ye;Ye|=2;var u=R0(),h=O0();ot!==n||Be!==i?(cc=null,lc=Pe()+500,ar(n,i)):nr=cs(n,i);e:do try{if(We!==0&&Le!==null){i=Le;var g=zn;t:switch(We){case 1:We=0,zn=null,rr(n,i,g,1);break;case 2:case 9:if(qg(g)){We=0,zn=null,T0(i);break}i=function(){We!==2&&We!==9||ot!==n||(We=7),ps(n)},g.then(i,i);break e;case 3:We=7;break e;case 4:We=5;break e;case 7:qg(g)?(We=0,zn=null,T0(i)):(We=0,zn=null,rr(n,i,g,7));break;case 5:var w=null;switch(Le.tag){case 26:w=Le.memoizedState;case 5:case 27:var k=Le;if(w?vv(w):k.stateNode.complete){We=0,zn=null;var D=k.sibling;if(D!==null)Le=D;else{var H=k.return;H!==null?(Le=H,fc(H)):Le=null}break t}}We=0,zn=null,rr(n,i,g,5);break;case 6:We=0,zn=null,rr(n,i,g,6);break;case 8:Zf(),Ct=6;break e;default:throw Error(a(462))}}vC();break}catch(Y){z0(n,Y)}while(!0);return ks=Yi=null,B.H=u,B.A=h,Ye=o,Le!==null?0:(ot=null,Be=0,Ol(),Ct)}function vC(){for(;Le!==null&&!oe();)A0(Le)}function A0(n){var i=n0(n.alternate,n,Us);n.memoizedProps=n.pendingProps,i===null?fc(n):Le=i}function T0(n){var i=n,o=i.alternate;switch(i.tag){case 15:case 0:i=Yy(o,i,i.pendingProps,i.type,void 0,Be);break;case 11:i=Yy(o,i,i.pendingProps,i.type.render,i.ref,Be);break;case 5:rf(i);default:i0(o,i),i=Le=Og(i,Us),i=n0(o,i,Us)}n.memoizedProps=n.pendingProps,i===null?fc(n):Le=i}function rr(n,i,o,u){ks=Yi=null,rf(i),Qa=null,so=0;var h=i.return;try{if(rC(n,h,i,o,Be)){Ct=1,Wl(n,Ln(o,n.current)),Le=null;return}}catch(g){if(h!==null)throw Le=h,g;Ct=1,Wl(n,Ln(o,n.current)),Le=null;return}i.flags&32768?(Ze||u===1?n=!0:nr||(Be&536870912)!==0?n=!1:(ci=n=!0,(u===2||u===9||u===3||u===6)&&(u=_n.current,u!==null&&u.tag===13&&(u.flags|=16384))),D0(i,n)):fc(i)}function fc(n){var i=n;do{if((i.flags&32768)!==0){D0(i,ci);return}n=i.return;var o=cC(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);Ct===0&&(Ct=5)}function D0(n,i){do{var o=uC(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);Ct=6,Le=null}function L0(n,i,o,u,h,g,w,k,D){n.cancelPendingCommit=null;do hc();while(Zt!==0);if((Ye&6)!==0)throw Error(a(327));if(i!==null){if(i===n.current)throw Error(a(177));if(g=i.lanes|i.childLanes,g|=Ad,cd(n,o,g,w,k,D),n===ot&&(Le=ot=null,Be=0),ir=i,fi=n,Ps=o,Bf=g,qf=h,N0=u,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(n.callbackNode=null,n.callbackPriority=0,wC(Qn,function(){return I0(),null})):(n.callbackNode=null,n.callbackPriority=0),u=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||u){u=B.T,B.T=null,h=T.p,T.p=2,w=Ye,Ye|=4;try{dC(n,i,o)}finally{Ye=w,T.p=h,B.T=u}}Zt=1,M0(),U0(),P0()}}function M0(){if(Zt===1){Zt=0;var n=fi,i=ir,o=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||o){o=B.T,B.T=null;var u=T.p;T.p=2;var h=Ye;Ye|=4;try{g0(i,n);var g=sh,w=wg(n.containerInfo),k=g.focusedElem,D=g.selectionRange;if(w!==k&&k&&k.ownerDocument&&Sg(k.ownerDocument.documentElement,k)){if(D!==null&&kd(k)){var H=D.start,Y=D.end;if(Y===void 0&&(Y=H),"selectionStart"in k)k.selectionStart=H,k.selectionEnd=Math.min(Y,k.value.length);else{var ee=k.ownerDocument||document,F=ee&&ee.defaultView||window;if(F.getSelection){var V=F.getSelection(),ye=k.textContent.length,_e=Math.min(D.start,ye),rt=D.end===void 0?_e:Math.min(D.end,ye);!V.extend&&_e>rt&&(w=rt,rt=_e,_e=w);var I=xg(k,_e),P=xg(k,rt);if(I&&P&&(V.rangeCount!==1||V.anchorNode!==I.node||V.anchorOffset!==I.offset||V.focusNode!==P.node||V.focusOffset!==P.offset)){var q=ee.createRange();q.setStart(I.node,I.offset),V.removeAllRanges(),_e>rt?(V.addRange(q),V.extend(P.node,P.offset)):(q.setEnd(P.node,P.offset),V.addRange(q))}}}}for(ee=[],V=k;V=V.parentNode;)V.nodeType===1&&ee.push({element:V,left:V.scrollLeft,top:V.scrollTop});for(typeof k.focus=="function"&&k.focus(),k=0;k<ee.length;k++){var J=ee[k];J.element.scrollLeft=J.left,J.element.scrollTop=J.top}}Cc=!!nh,sh=nh=null}finally{Ye=h,T.p=u,B.T=o}}n.current=i,Zt=2}}function U0(){if(Zt===2){Zt=0;var n=fi,i=ir,o=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||o){o=B.T,B.T=null;var u=T.p;T.p=2;var h=Ye;Ye|=4;try{d0(n,i.alternate,i)}finally{Ye=h,T.p=u,B.T=o}}Zt=3}}function P0(){if(Zt===4||Zt===3){Zt=0,Ue();var n=fi,i=ir,o=Ps,u=N0;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?Zt=5:(Zt=0,ir=fi=null,$0(n,n.pendingLanes));var h=n.pendingLanes;if(h===0&&(di=null),ue(o),i=i.stateNode,Ce&&typeof Ce.onCommitFiberRoot=="function")try{Ce.onCommitFiberRoot(os,i,void 0,(i.current.flags&128)===128)}catch{}if(u!==null){i=B.T,h=T.p,T.p=2,B.T=null;try{for(var g=n.onRecoverableError,w=0;w<u.length;w++){var k=u[w];g(k.value,{componentStack:k.stack})}}finally{B.T=i,T.p=h}}(Ps&3)!==0&&hc(),ps(n),h=n.pendingLanes,(o&261930)!==0&&(h&42)!==0?n===Hf?So++:(So=0,Hf=n):So=0,wo(0)}}function $0(n,i){(n.pooledCacheLanes&=i)===0&&(i=n.pooledCache,i!=null&&(n.pooledCache=null,to(i)))}function hc(){return M0(),U0(),P0(),I0()}function I0(){if(Zt!==5)return!1;var n=fi,i=Bf;Bf=0;var o=ue(Ps),u=B.T,h=T.p;try{T.p=32>o?32:o,B.T=null,o=qf,qf=null;var g=fi,w=Ps;if(Zt=0,ir=fi=null,Ps=0,(Ye&6)!==0)throw Error(a(331));var k=Ye;if(Ye|=4,S0(g.current),v0(g,g.current,w,o),Ye=k,wo(0,!1),Ce&&typeof Ce.onPostCommitFiberRoot=="function")try{Ce.onPostCommitFiberRoot(os,g)}catch{}return!0}finally{T.p=h,B.T=u,$0(n,i)}}function B0(n,i,o){i=Ln(o,i),i=Sf(n.stateNode,i,2),n=ai(n,i,2),n!==null&&(Hi(n,2),ps(n))}function et(n,i,o){if(n.tag===3)B0(n,n,o);else for(;i!==null;){if(i.tag===3){B0(i,n,o);break}else if(i.tag===1){var u=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(di===null||!di.has(u))){n=Ln(o,n),o=qy(2),u=ai(i,o,2),u!==null&&(Hy(o,u,i,n),Hi(u,2),ps(u));break}}i=i.return}}function Gf(n,i,o){var u=n.pingCache;if(u===null){u=n.pingCache=new mC;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)||(Pf=!0,h.add(o),n=bC.bind(null,n,i,o),i.then(n,n))}function bC(n,i,o){var u=n.pingCache;u!==null&&u.delete(i),n.pingedLanes|=n.suspendedLanes&o,n.warmLanes&=~o,ot===n&&(Be&o)===o&&(Ct===4||Ct===3&&(Be&62914560)===Be&&300>Pe()-oc?(Ye&2)===0&&ar(n,0):$f|=o,sr===Be&&(sr=0)),ps(n)}function q0(n,i){i===0&&(i=yl()),n=Ki(n,i),n!==null&&(Hi(n,i),ps(n))}function xC(n){var i=n.memoizedState,o=0;i!==null&&(o=i.retryLane),q0(n,o)}function SC(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),q0(n,o)}function wC(n,i){return wt(n,i)}var mc=null,or=null,Kf=!1,pc=!1,Vf=!1,mi=0;function ps(n){n!==or&&n.next===null&&(or===null?mc=or=n:or=or.next=n),pc=!0,Kf||(Kf=!0,NC())}function wo(n,i){if(!Vf&&pc){Vf=!0;do for(var o=!1,u=mc;u!==null;){if(n!==0){var h=u.pendingLanes;if(h===0)var g=0;else{var w=u.suspendedLanes,k=u.pingedLanes;g=(1<<31-ne(42|n)+1)-1,g&=h&~(w&~k),g=g&201326741?g&201326741|1:g?g|2:0}g!==0&&(o=!0,G0(u,g))}else g=Be,g=Ea(u,u===ot?g:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),(g&3)===0||cs(u,g)||(o=!0,G0(u,g));u=u.next}while(o);Vf=!1}}function jC(){H0()}function H0(){pc=Kf=!1;var n=0;mi!==0&&DC()&&(n=mi);for(var i=Pe(),o=null,u=mc;u!==null;){var h=u.next,g=Z0(u,i);g===0?(u.next=null,o===null?mc=h:o.next=h,h===null&&(or=o)):(o=u,(n!==0||(g&3)!==0)&&(pc=!0)),u=h}Zt!==0&&Zt!==5||wo(n),mi!==0&&(mi=0)}function Z0(n,i){for(var o=n.suspendedLanes,u=n.pingedLanes,h=n.expirationTimes,g=n.pendingLanes&-62914561;0<g;){var w=31-ne(g),k=1<<w,D=h[w];D===-1?((k&o)===0||(k&u)!==0)&&(h[w]=gl(k,i)):D<=i&&(n.expiredLanes|=k),g&=~k}if(i=ot,o=Be,o=Ea(n,n===i?o:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),u=n.callbackNode,o===0||n===i&&(We===2||We===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),ue(o)){case 2:case 8:o=zt;break;case 32:o=Qn;break;case 268435456:o=Fs;break;default:o=Qn}return u=F0.bind(null,n),o=wt(o,u),n.callbackPriority=i,n.callbackNode=o,i}return u!==null&&u!==null&&sn(u),n.callbackPriority=2,n.callbackNode=null,2}function F0(n,i){if(Zt!==0&&Zt!==5)return n.callbackNode=null,n.callbackPriority=0,null;var o=n.callbackNode;if(hc()&&n.callbackNode!==o)return null;var u=Be;return u=Ea(n,n===ot?u:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),u===0?null:(_0(n,u,i),Z0(n,Pe()),n.callbackNode!=null&&n.callbackNode===o?F0.bind(null,n):null)}function G0(n,i){if(hc())return null;_0(n,i,!0)}function NC(){MC(function(){(Ye&6)!==0?wt(Te,jC):H0()})}function Qf(){if(mi===0){var n=Ga;n===0&&(n=Ks,Ks<<=1,(Ks&261888)===0&&(Ks=256)),mi=n}return mi}function K0(n){return n==null||typeof n=="symbol"||typeof n=="boolean"?null:typeof n=="function"?n:jl(""+n)}function V0(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 CC(n,i,o,u,h){if(i==="submit"&&o&&o.stateNode===h){var g=K0((h[jt]||null).action),w=u.submitter;w&&(i=(i=w[jt]||null)?K0(i.formAction):w.getAttribute("formAction"),i!==null&&(g=i,w=null));var k=new kl("action","action",null,u,h);n.push({event:k,listeners:[{instance:null,listener:function(){if(u.defaultPrevented){if(mi!==0){var D=w?V0(h,w):new FormData(h);pf(o,{pending:!0,data:D,method:h.method,action:g},null,D)}}else typeof g=="function"&&(k.preventDefault(),D=w?V0(h,w):new FormData(h),pf(o,{pending:!0,data:D,method:h.method,action:g},g,D))},currentTarget:h}]})}}for(var Yf=0;Yf<Od.length;Yf++){var Jf=Od[Yf],_C=Jf.toLowerCase(),kC=Jf[0].toUpperCase()+Jf.slice(1);Jn(_C,"on"+kC)}Jn(Cg,"onAnimationEnd"),Jn(_g,"onAnimationIteration"),Jn(kg,"onAnimationStart"),Jn("dblclick","onDoubleClick"),Jn("focusin","onFocus"),Jn("focusout","onBlur"),Jn(HN,"onTransitionRun"),Jn(ZN,"onTransitionStart"),Jn(FN,"onTransitionCancel"),Jn(zg,"onTransitionEnd"),an("onMouseEnter",["mouseout","mouseover"]),an("onMouseLeave",["mouseout","mouseover"]),an("onPointerEnter",["pointerout","pointerover"]),an("onPointerLeave",["pointerout","pointerover"]),Ht("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ht("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ht("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ht("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ht("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ht("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var jo="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(" "),zC=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(jo));function Q0(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 w=u.length-1;0<=w;w--){var k=u[w],D=k.instance,H=k.currentTarget;if(k=k.listener,D!==g&&h.isPropagationStopped())break e;g=k,h.currentTarget=H;try{g(h)}catch(Y){Rl(Y)}h.currentTarget=null,g=D}else for(w=0;w<u.length;w++){if(k=u[w],D=k.instance,H=k.currentTarget,k=k.listener,D!==g&&h.isPropagationStopped())break e;g=k,h.currentTarget=H;try{g(h)}catch(Y){Rl(Y)}h.currentTarget=null,g=D}}}}function Me(n,i){var o=i[en];o===void 0&&(o=i[en]=new Set);var u=n+"__bubble";o.has(u)||(Y0(i,n,2,!1),o.add(u))}function Xf(n,i,o){var u=0;i&&(u|=4),Y0(o,n,u,i)}var gc="_reactListening"+Math.random().toString(36).slice(2);function Wf(n){if(!n[gc]){n[gc]=!0,Ie.forEach(function(o){o!=="selectionchange"&&(zC.has(o)||Xf(o,!1,n),Xf(o,!0,n))});var i=n.nodeType===9?n:n.ownerDocument;i===null||i[gc]||(i[gc]=!0,Xf("selectionchange",!1,i))}}function Y0(n,i,o,u){switch(Cv(i)){case 2:var h=n_;break;case 8:h=s_;break;default:h=mh}o=h.bind(null,i,o,n),h=void 0,!vd||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 eh(n,i,o,u,h){var g=u;if((i&1)===0&&(i&2)===0&&u!==null)e:for(;;){if(u===null)return;var w=u.tag;if(w===3||w===4){var k=u.stateNode.containerInfo;if(k===h)break;if(w===4)for(w=u.return;w!==null;){var D=w.tag;if((D===3||D===4)&&w.stateNode.containerInfo===h)return;w=w.return}for(;k!==null;){if(w=Ys(k),w===null)return;if(D=w.tag,D===5||D===6||D===26||D===27){u=g=w;continue e}k=k.parentNode}}u=u.return}tg(function(){var H=g,Y=gd(o),ee=[];e:{var F=Eg.get(n);if(F!==void 0){var V=kl,ye=n;switch(n){case"keypress":if(Cl(o)===0)break e;case"keydown":case"keyup":V=SN;break;case"focusin":ye="focus",V=wd;break;case"focusout":ye="blur",V=wd;break;case"beforeblur":case"afterblur":V=wd;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":V=ig;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":V=cN;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":V=NN;break;case Cg:case _g:case kg:V=fN;break;case zg:V=_N;break;case"scroll":case"scrollend":V=oN;break;case"wheel":V=zN;break;case"copy":case"cut":case"paste":V=mN;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":V=rg;break;case"toggle":case"beforetoggle":V=RN}var _e=(i&4)!==0,rt=!_e&&(n==="scroll"||n==="scrollend"),I=_e?F!==null?F+"Capture":null:F;_e=[];for(var P=H,q;P!==null;){var J=P;if(q=J.stateNode,J=J.tag,J!==5&&J!==26&&J!==27||q===null||I===null||(J=Zr(P,I),J!=null&&_e.push(No(P,J,q))),rt)break;P=P.return}0<_e.length&&(F=new V(F,ye,null,o,Y),ee.push({event:F,listeners:_e}))}}if((i&7)===0){e:{if(F=n==="mouseover"||n==="pointerover",V=n==="mouseout"||n==="pointerout",F&&o!==pd&&(ye=o.relatedTarget||o.fromElement)&&(Ys(ye)||ye[jn]))break e;if((V||F)&&(F=Y.window===Y?Y:(F=Y.ownerDocument)?F.defaultView||F.parentWindow:window,V?(ye=o.relatedTarget||o.toElement,V=H,ye=ye?Ys(ye):null,ye!==null&&(rt=c(ye),_e=ye.tag,ye!==rt||_e!==5&&_e!==27&&_e!==6)&&(ye=null)):(V=null,ye=H),V!==ye)){if(_e=ig,J="onMouseLeave",I="onMouseEnter",P="mouse",(n==="pointerout"||n==="pointerover")&&(_e=rg,J="onPointerLeave",I="onPointerEnter",P="pointer"),rt=V==null?F:ds(V),q=ye==null?F:ds(ye),F=new _e(J,P+"leave",V,o,Y),F.target=rt,F.relatedTarget=q,J=null,Ys(Y)===H&&(_e=new _e(I,P+"enter",ye,o,Y),_e.target=q,_e.relatedTarget=rt,J=_e),rt=J,V&&ye)t:{for(_e=EC,I=V,P=ye,q=0,J=I;J;J=_e(J))q++;J=0;for(var Ne=P;Ne;Ne=_e(Ne))J++;for(;0<q-J;)I=_e(I),q--;for(;0<J-q;)P=_e(P),J--;for(;q--;){if(I===P||P!==null&&I===P.alternate){_e=I;break t}I=_e(I),P=_e(P)}_e=null}else _e=null;V!==null&&J0(ee,F,V,_e,!1),ye!==null&&rt!==null&&J0(ee,rt,ye,_e,!0)}}e:{if(F=H?ds(H):window,V=F.nodeName&&F.nodeName.toLowerCase(),V==="select"||V==="input"&&F.type==="file")var Ke=mg;else if(fg(F))if(pg)Ke=IN;else{Ke=PN;var Se=UN}else V=F.nodeName,!V||V.toLowerCase()!=="input"||F.type!=="checkbox"&&F.type!=="radio"?H&&md(H.elementType)&&(Ke=mg):Ke=$N;if(Ke&&(Ke=Ke(n,H))){hg(ee,Ke,o,Y);break e}Se&&Se(n,F,H),n==="focusout"&&H&&F.type==="number"&&H.memoizedProps.value!=null&&hd(F,"number",F.value)}switch(Se=H?ds(H):window,n){case"focusin":(fg(Se)||Se.contentEditable==="true")&&(Pa=Se,zd=H,Xr=null);break;case"focusout":Xr=zd=Pa=null;break;case"mousedown":Ed=!0;break;case"contextmenu":case"mouseup":case"dragend":Ed=!1,jg(ee,o,Y);break;case"selectionchange":if(qN)break;case"keydown":case"keyup":jg(ee,o,Y)}var Ae;if(Nd)e:{switch(n){case"compositionstart":var qe="onCompositionStart";break e;case"compositionend":qe="onCompositionEnd";break e;case"compositionupdate":qe="onCompositionUpdate";break e}qe=void 0}else Ua?ug(n,o)&&(qe="onCompositionEnd"):n==="keydown"&&o.keyCode===229&&(qe="onCompositionStart");qe&&(og&&o.locale!=="ko"&&(Ua||qe!=="onCompositionStart"?qe==="onCompositionEnd"&&Ua&&(Ae=ng()):(Xs=Y,bd="value"in Xs?Xs.value:Xs.textContent,Ua=!0)),Se=yc(H,qe),0<Se.length&&(qe=new ag(qe,n,null,o,Y),ee.push({event:qe,listeners:Se}),Ae?qe.data=Ae:(Ae=dg(o),Ae!==null&&(qe.data=Ae)))),(Ae=AN?TN(n,o):DN(n,o))&&(qe=yc(H,"onBeforeInput"),0<qe.length&&(Se=new ag("onBeforeInput","beforeinput",null,o,Y),ee.push({event:Se,listeners:qe}),Se.data=Ae)),CC(ee,n,H,o,Y)}Q0(ee,i)})}function No(n,i,o){return{instance:n,listener:i,currentTarget:o}}function yc(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=Zr(n,o),h!=null&&u.unshift(No(n,h,g)),h=Zr(n,i),h!=null&&u.push(No(n,h,g))),n.tag===3)return u;n=n.return}return[]}function EC(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5&&n.tag!==27);return n||null}function J0(n,i,o,u,h){for(var g=i._reactName,w=[];o!==null&&o!==u;){var k=o,D=k.alternate,H=k.stateNode;if(k=k.tag,D!==null&&D===u)break;k!==5&&k!==26&&k!==27||H===null||(D=H,h?(H=Zr(o,g),H!=null&&w.unshift(No(o,H,D))):h||(H=Zr(o,g),H!=null&&w.push(No(o,H,D)))),o=o.return}w.length!==0&&n.push({event:i,listeners:w})}var RC=/\r\n?/g,OC=/\u0000|\uFFFD/g;function X0(n){return(typeof n=="string"?n:""+n).replace(RC,`
|
|
9
|
+
`).replace(OC,"")}function W0(n,i){return i=X0(i),X0(n)===i}function at(n,i,o,u,h,g){switch(o){case"children":typeof u=="string"?i==="body"||i==="textarea"&&u===""||Da(n,u):(typeof u=="number"||typeof u=="bigint")&&i!=="body"&&Da(n,""+u);break;case"className":Sl(n,"class",u);break;case"tabIndex":Sl(n,"tabindex",u);break;case"dir":case"role":case"viewBox":case"width":case"height":Sl(n,o,u);break;case"style":Wp(n,u,g);break;case"data":if(i!=="object"){Sl(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=jl(""+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"&&at(n,i,"name",h.name,h,null),at(n,i,"formEncType",h.formEncType,h,null),at(n,i,"formMethod",h.formMethod,h,null),at(n,i,"formTarget",h.formTarget,h,null)):(at(n,i,"encType",h.encType,h,null),at(n,i,"method",h.method,h,null),at(n,i,"target",h.target,h,null)));if(u==null||typeof u=="symbol"||typeof u=="boolean"){n.removeAttribute(o);break}u=jl(""+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=jl(""+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),xl(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":xl(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=aN.get(o)||o,xl(n,o,u))}}function th(n,i,o,u,h,g){switch(o){case"style":Wp(n,u,g);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(a(61));if(o=u.__html,o!=null){if(h.children!=null)throw Error(a(60));n.innerHTML=o}}break;case"children":typeof u=="string"?Da(n,u):(typeof u=="number"||typeof u=="bigint")&&Da(n,""+u);break;case"onScroll":u!=null&&Me("scroll",n);break;case"onScrollEnd":u!=null&&Me("scrollend",n);break;case"onClick":u!=null&&(n.onclick=js);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!st.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[jt]||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,""):xl(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 w=o[g];if(w!=null)switch(g){case"src":u=!0;break;case"srcSet":h=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:at(n,i,g,w,o,null)}}h&&at(n,i,"srcSet",o.srcSet,o,null),u&&at(n,i,"src",o.src,o,null);return;case"input":Me("invalid",n);var k=g=w=h=null,D=null,H=null;for(u in o)if(o.hasOwnProperty(u)){var Y=o[u];if(Y!=null)switch(u){case"name":h=Y;break;case"type":w=Y;break;case"checked":D=Y;break;case"defaultChecked":H=Y;break;case"value":g=Y;break;case"defaultValue":k=Y;break;case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(a(137,i));break;default:at(n,i,u,Y,o,null)}}Qp(n,g,k,D,H,w,h,!1);return;case"select":Me("invalid",n),u=w=g=null;for(h in o)if(o.hasOwnProperty(h)&&(k=o[h],k!=null))switch(h){case"value":g=k;break;case"defaultValue":w=k;break;case"multiple":u=k;default:at(n,i,h,k,o,null)}i=g,o=w,n.multiple=!!u,i!=null?Ta(n,!!u,i,!1):o!=null&&Ta(n,!!u,o,!0);return;case"textarea":Me("invalid",n),g=h=u=null;for(w in o)if(o.hasOwnProperty(w)&&(k=o[w],k!=null))switch(w){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:at(n,i,w,k,o,null)}Jp(n,u,h,g);return;case"option":for(D in o)o.hasOwnProperty(D)&&(u=o[D],u!=null)&&(D==="selected"?n.selected=u&&typeof u!="function"&&typeof u!="symbol":at(n,i,D,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<jo.length;u++)Me(jo[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(H in o)if(o.hasOwnProperty(H)&&(u=o[H],u!=null))switch(H){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:at(n,i,H,u,o,null)}return;default:if(md(i)){for(Y in o)o.hasOwnProperty(Y)&&(u=o[Y],u!==void 0&&th(n,i,Y,u,o,void 0));return}}for(k in o)o.hasOwnProperty(k)&&(u=o[k],u!=null&&at(n,i,k,u,o,null))}function AC(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,w=null,k=null,D=null,H=null,Y=null;for(V in o){var ee=o[V];if(o.hasOwnProperty(V)&&ee!=null)switch(V){case"checked":break;case"value":break;case"defaultValue":D=ee;default:u.hasOwnProperty(V)||at(n,i,V,null,u,ee)}}for(var F in u){var V=u[F];if(ee=o[F],u.hasOwnProperty(F)&&(V!=null||ee!=null))switch(F){case"type":g=V;break;case"name":h=V;break;case"checked":H=V;break;case"defaultChecked":Y=V;break;case"value":w=V;break;case"defaultValue":k=V;break;case"children":case"dangerouslySetInnerHTML":if(V!=null)throw Error(a(137,i));break;default:V!==ee&&at(n,i,F,V,u,ee)}}fd(n,w,k,D,H,Y,g,h);return;case"select":V=w=k=F=null;for(g in o)if(D=o[g],o.hasOwnProperty(g)&&D!=null)switch(g){case"value":break;case"multiple":V=D;default:u.hasOwnProperty(g)||at(n,i,g,null,u,D)}for(h in u)if(g=u[h],D=o[h],u.hasOwnProperty(h)&&(g!=null||D!=null))switch(h){case"value":F=g;break;case"defaultValue":k=g;break;case"multiple":w=g;default:g!==D&&at(n,i,h,g,u,D)}i=k,o=w,u=V,F!=null?Ta(n,!!o,F,!1):!!u!=!!o&&(i!=null?Ta(n,!!o,i,!0):Ta(n,!!o,o?[]:"",!1));return;case"textarea":V=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:at(n,i,k,null,u,h)}for(w in u)if(h=u[w],g=o[w],u.hasOwnProperty(w)&&(h!=null||g!=null))switch(w){case"value":F=h;break;case"defaultValue":V=h;break;case"children":break;case"dangerouslySetInnerHTML":if(h!=null)throw Error(a(91));break;default:h!==g&&at(n,i,w,h,u,g)}Yp(n,F,V);return;case"option":for(var ye in o)F=o[ye],o.hasOwnProperty(ye)&&F!=null&&!u.hasOwnProperty(ye)&&(ye==="selected"?n.selected=!1:at(n,i,ye,null,u,F));for(D in u)F=u[D],V=o[D],u.hasOwnProperty(D)&&F!==V&&(F!=null||V!=null)&&(D==="selected"?n.selected=F&&typeof F!="function"&&typeof F!="symbol":at(n,i,D,F,u,V));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 _e in o)F=o[_e],o.hasOwnProperty(_e)&&F!=null&&!u.hasOwnProperty(_e)&&at(n,i,_e,null,u,F);for(H in u)if(F=u[H],V=o[H],u.hasOwnProperty(H)&&F!==V&&(F!=null||V!=null))switch(H){case"children":case"dangerouslySetInnerHTML":if(F!=null)throw Error(a(137,i));break;default:at(n,i,H,F,u,V)}return;default:if(md(i)){for(var rt in o)F=o[rt],o.hasOwnProperty(rt)&&F!==void 0&&!u.hasOwnProperty(rt)&&th(n,i,rt,void 0,u,F);for(Y in u)F=u[Y],V=o[Y],!u.hasOwnProperty(Y)||F===V||F===void 0&&V===void 0||th(n,i,Y,F,u,V);return}}for(var I in o)F=o[I],o.hasOwnProperty(I)&&F!=null&&!u.hasOwnProperty(I)&&at(n,i,I,null,u,F);for(ee in u)F=u[ee],V=o[ee],!u.hasOwnProperty(ee)||F===V||F==null&&V==null||at(n,i,ee,F,u,V)}function ev(n){switch(n){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function TC(){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,w=h.initiatorType,k=h.duration;if(g&&k&&ev(w)){for(w=0,k=h.responseEnd,u+=1;u<o.length;u++){var D=o[u],H=D.startTime;if(H>k)break;var Y=D.transferSize,ee=D.initiatorType;Y&&ev(ee)&&(D=D.responseEnd,w+=Y*(D<k?1:(k-H)/(D-H)))}if(--u,i+=8*(g+w)/(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 nh=null,sh=null;function vc(n){return n.nodeType===9?n:n.ownerDocument}function tv(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 nv(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 ih(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 ah=null;function DC(){var n=window.event;return n&&n.type==="popstate"?n===ah?!1:(ah=n,!0):(ah=null,!1)}var sv=typeof setTimeout=="function"?setTimeout:void 0,LC=typeof clearTimeout=="function"?clearTimeout:void 0,iv=typeof Promise=="function"?Promise:void 0,MC=typeof queueMicrotask=="function"?queueMicrotask:typeof iv<"u"?function(n){return iv.resolve(null).then(n).catch(UC)}:sv;function UC(n){setTimeout(function(){throw n})}function pi(n){return n==="head"}function av(n,i){var o=i,u=0;do{var h=o.nextSibling;if(n.removeChild(o),h&&h.nodeType===8)if(o=h.data,o==="/$"||o==="/&"){if(u===0){n.removeChild(h),dr(i);return}u--}else if(o==="$"||o==="$?"||o==="$~"||o==="$!"||o==="&")u++;else if(o==="html")Co(n.ownerDocument.documentElement);else if(o==="head"){o=n.ownerDocument.head,Co(o);for(var g=o.firstChild;g;){var w=g.nextSibling,k=g.nodeName;g[us]||k==="SCRIPT"||k==="STYLE"||k==="LINK"&&g.rel.toLowerCase()==="stylesheet"||o.removeChild(g),g=w}}else o==="body"&&Co(n.ownerDocument.body);o=h}while(o);dr(i)}function rv(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 rh(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":rh(o),Oa(o);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(o.rel.toLowerCase()==="stylesheet")continue}n.removeChild(o)}}function PC(n,i,o,u){for(;n.nodeType===1;){var h=o;if(n.nodeName.toLowerCase()!==i.toLowerCase()){if(!u&&(n.nodeName!=="INPUT"||n.type!=="hidden"))break}else if(u){if(!n[us])switch(i){case"meta":if(!n.hasAttribute("itemprop"))break;return n;case"link":if(g=n.getAttribute("rel"),g==="stylesheet"&&n.hasAttribute("data-precedence"))break;if(g!==h.rel||n.getAttribute("href")!==(h.href==null||h.href===""?null:h.href)||n.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin)||n.getAttribute("title")!==(h.title==null?null:h.title))break;return n;case"style":if(n.hasAttribute("data-precedence"))break;return n;case"script":if(g=n.getAttribute("src"),(g!==(h.src==null?null:h.src)||n.getAttribute("type")!==(h.type==null?null:h.type)||n.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin))&&g&&n.hasAttribute("async")&&!n.hasAttribute("itemprop"))break;return n;default:return n}}else if(i==="input"&&n.type==="hidden"){var g=h.name==null?null:""+h.name;if(h.type==="hidden"&&n.getAttribute("name")===g)return n}else return n;if(n=In(n.nextSibling),n===null)break}return null}function $C(n,i,o){if(i==="")return null;for(;n.nodeType!==3;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!o||(n=In(n.nextSibling),n===null))return null;return n}function ov(n,i){for(;n.nodeType!==8;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!i||(n=In(n.nextSibling),n===null))return null;return n}function oh(n){return n.data==="$?"||n.data==="$~"}function lh(n){return n.data==="$!"||n.data==="$?"&&n.ownerDocument.readyState!=="loading"}function IC(n,i){var o=n.ownerDocument;if(n.data==="$~")n._reactRetry=i;else if(n.data!=="$?"||o.readyState!=="loading")i();else{var u=function(){i(),o.removeEventListener("DOMContentLoaded",u)};o.addEventListener("DOMContentLoaded",u),n._reactRetry=u}}function In(n){for(;n!=null;n=n.nextSibling){var i=n.nodeType;if(i===1||i===3)break;if(i===8){if(i=n.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return n}var ch=null;function lv(n){n=n.nextSibling;for(var i=0;n;){if(n.nodeType===8){var o=n.data;if(o==="/$"||o==="/&"){if(i===0)return In(n.nextSibling);i--}else o!=="$"&&o!=="$!"&&o!=="$?"&&o!=="$~"&&o!=="&"||i++}n=n.nextSibling}return null}function cv(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 uv(n,i,o){switch(i=vc(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 Co(n){for(var i=n.attributes;i.length;)n.removeAttributeNode(i[0]);Oa(n)}var Bn=new Map,dv=new Set;function bc(n){return typeof n.getRootNode=="function"?n.getRootNode():n.nodeType===9?n:n.ownerDocument}var $s=T.d;T.d={f:BC,r:qC,D:HC,C:ZC,L:FC,m:GC,X:VC,S:KC,M:QC};function BC(){var n=$s.f(),i=uc();return n||i}function qC(n){var i=Yn(n);i!==null&&i.tag===5&&i.type==="form"?zy(i):$s.r(n)}var lr=typeof document>"u"?null:document;function fv(n,i,o){var u=lr;if(u&&typeof i=="string"&&i){var h=Tn(i);h='link[rel="'+n+'"][href="'+h+'"]',typeof o=="string"&&(h+='[crossorigin="'+o+'"]'),dv.has(h)||(dv.add(h),n={rel:n,crossOrigin:o,href:i},u.querySelector(h)===null&&(i=u.createElement("link"),Xt(i,"link",n),Mt(i),u.head.appendChild(i)))}}function HC(n){$s.D(n),fv("dns-prefetch",n,null)}function ZC(n,i){$s.C(n,i),fv("preconnect",n,i)}function FC(n,i,o){$s.L(n,i,o);var u=lr;if(u&&n&&i){var h='link[rel="preload"][as="'+Tn(i)+'"]';i==="image"&&o&&o.imageSrcSet?(h+='[imagesrcset="'+Tn(o.imageSrcSet)+'"]',typeof o.imageSizes=="string"&&(h+='[imagesizes="'+Tn(o.imageSizes)+'"]')):h+='[href="'+Tn(n)+'"]';var g=h;switch(i){case"style":g=cr(n);break;case"script":g=ur(n)}Bn.has(g)||(n=y({rel:"preload",href:i==="image"&&o&&o.imageSrcSet?void 0:n,as:i},o),Bn.set(g,n),u.querySelector(h)!==null||i==="style"&&u.querySelector(_o(g))||i==="script"&&u.querySelector(ko(g))||(i=u.createElement("link"),Xt(i,"link",n),Mt(i),u.head.appendChild(i)))}}function GC(n,i){$s.m(n,i);var o=lr;if(o&&n){var u=i&&typeof i.as=="string"?i.as:"script",h='link[rel="modulepreload"][as="'+Tn(u)+'"][href="'+Tn(n)+'"]',g=h;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":g=ur(n)}if(!Bn.has(g)&&(n=y({rel:"modulepreload",href:n},i),Bn.set(g,n),o.querySelector(h)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(o.querySelector(ko(g)))return}u=o.createElement("link"),Xt(u,"link",n),Mt(u),o.head.appendChild(u)}}}function KC(n,i,o){$s.S(n,i,o);var u=lr;if(u&&n){var h=Js(u).hoistableStyles,g=cr(n);i=i||"default";var w=h.get(g);if(!w){var k={loading:0,preload:null};if(w=u.querySelector(_o(g)))k.loading=5;else{n=y({rel:"stylesheet",href:n,"data-precedence":i},o),(o=Bn.get(g))&&uh(n,o);var D=w=u.createElement("link");Mt(D),Xt(D,"link",n),D._p=new Promise(function(H,Y){D.onload=H,D.onerror=Y}),D.addEventListener("load",function(){k.loading|=1}),D.addEventListener("error",function(){k.loading|=2}),k.loading|=4,xc(w,i,u)}w={type:"stylesheet",instance:w,count:1,state:k},h.set(g,w)}}}function VC(n,i){$s.X(n,i);var o=lr;if(o&&n){var u=Js(o).hoistableScripts,h=ur(n),g=u.get(h);g||(g=o.querySelector(ko(h)),g||(n=y({src:n,async:!0},i),(i=Bn.get(h))&&dh(n,i),g=o.createElement("script"),Mt(g),Xt(g,"link",n),o.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},u.set(h,g))}}function QC(n,i){$s.M(n,i);var o=lr;if(o&&n){var u=Js(o).hoistableScripts,h=ur(n),g=u.get(h);g||(g=o.querySelector(ko(h)),g||(n=y({src:n,async:!0,type:"module"},i),(i=Bn.get(h))&&dh(n,i),g=o.createElement("script"),Mt(g),Xt(g,"link",n),o.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},u.set(h,g))}}function hv(n,i,o,u){var h=(h=he.current)?bc(h):null;if(!h)throw Error(a(446));switch(n){case"meta":case"title":return null;case"style":return typeof o.precedence=="string"&&typeof o.href=="string"?(i=cr(o.href),o=Js(h).hoistableStyles,u=o.get(i),u||(u={type:"style",instance:null,count:0,state:null},o.set(i,u)),u):{type:"void",instance:null,count:0,state:null};case"link":if(o.rel==="stylesheet"&&typeof o.href=="string"&&typeof o.precedence=="string"){n=cr(o.href);var g=Js(h).hoistableStyles,w=g.get(n);if(w||(h=h.ownerDocument||h,w={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},g.set(n,w),(g=h.querySelector(_o(n)))&&!g._p&&(w.instance=g,w.state.loading=5),Bn.has(n)||(o={rel:"preload",as:"style",href:o.href,crossOrigin:o.crossOrigin,integrity:o.integrity,media:o.media,hrefLang:o.hrefLang,referrerPolicy:o.referrerPolicy},Bn.set(n,o),g||YC(h,n,o,w.state))),i&&u===null)throw Error(a(528,""));return w}if(i&&u!==null)throw Error(a(529,""));return null;case"script":return i=o.async,o=o.src,typeof o=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=ur(o),o=Js(h).hoistableScripts,u=o.get(i),u||(u={type:"script",instance:null,count:0,state:null},o.set(i,u)),u):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,n))}}function cr(n){return'href="'+Tn(n)+'"'}function _o(n){return'link[rel="stylesheet"]['+n+"]"}function mv(n){return y({},n,{"data-precedence":n.precedence,precedence:null})}function YC(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),Mt(i),n.head.appendChild(i))}function ur(n){return'[src="'+Tn(n)+'"]'}function ko(n){return"script[async]"+n}function pv(n,i,o){if(i.count++,i.instance===null)switch(i.type){case"style":var u=n.querySelector('style[data-href~="'+Tn(o.href)+'"]');if(u)return i.instance=u,Mt(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"),Mt(u),Xt(u,"style",h),xc(u,o.precedence,n),i.instance=u;case"stylesheet":h=cr(o.href);var g=n.querySelector(_o(h));if(g)return i.state.loading|=4,i.instance=g,Mt(g),g;u=mv(o),(h=Bn.get(h))&&uh(u,h),g=(n.ownerDocument||n).createElement("link"),Mt(g);var w=g;return w._p=new Promise(function(k,D){w.onload=k,w.onerror=D}),Xt(g,"link",u),i.state.loading|=4,xc(g,o.precedence,n),i.instance=g;case"script":return g=ur(o.src),(h=n.querySelector(ko(g)))?(i.instance=h,Mt(h),h):(u=o,(h=Bn.get(g))&&(u=y({},o),dh(u,h)),n=n.ownerDocument||n,h=n.createElement("script"),Mt(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,xc(u,o.precedence,n));return i.instance}function xc(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,w=0;w<u.length;w++){var k=u[w];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 uh(n,i){n.crossOrigin==null&&(n.crossOrigin=i.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=i.referrerPolicy),n.title==null&&(n.title=i.title)}function dh(n,i){n.crossOrigin==null&&(n.crossOrigin=i.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=i.referrerPolicy),n.integrity==null&&(n.integrity=i.integrity)}var Sc=null;function gv(n,i,o){if(Sc===null){var u=new Map,h=Sc=new Map;h.set(o,u)}else h=Sc,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[Et]||n==="link"&&g.getAttribute("rel")==="stylesheet")&&g.namespaceURI!=="http://www.w3.org/2000/svg"){var w=g.getAttribute(i)||"";w=n+w;var k=u.get(w);k?k.push(g):u.set(w,[g])}}return u}function yv(n,i,o){n=n.ownerDocument||n,n.head.insertBefore(o,i==="title"?n.querySelector("head > title"):null)}function JC(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 vv(n){return!(n.type==="stylesheet"&&(n.state.loading&3)===0)}function XC(n,i,o,u){if(o.type==="stylesheet"&&(typeof u.media!="string"||matchMedia(u.media).matches!==!1)&&(o.state.loading&4)===0){if(o.instance===null){var h=cr(u.href),g=i.querySelector(_o(h));if(g){i=g._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(n.count++,n=wc.bind(n),i.then(n,n)),o.state.loading|=4,o.instance=g,Mt(g);return}g=i.ownerDocument||i,u=mv(u),(h=Bn.get(h))&&uh(u,h),g=g.createElement("link"),Mt(g);var w=g;w._p=new Promise(function(k,D){w.onload=k,w.onerror=D}),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=wc.bind(n),i.addEventListener("load",o),i.addEventListener("error",o))}}var fh=0;function WC(n,i){return n.stylesheets&&n.count===0&&Nc(n,n.stylesheets),0<n.count||0<n.imgCount?function(o){var u=setTimeout(function(){if(n.stylesheets&&Nc(n,n.stylesheets),n.unsuspend){var g=n.unsuspend;n.unsuspend=null,g()}},6e4+i);0<n.imgBytes&&fh===0&&(fh=62500*TC());var h=setTimeout(function(){if(n.waitingForImages=!1,n.count===0&&(n.stylesheets&&Nc(n,n.stylesheets),n.unsuspend)){var g=n.unsuspend;n.unsuspend=null,g()}},(n.imgBytes>fh?50:800)+i);return n.unsuspend=o,function(){n.unsuspend=null,clearTimeout(u),clearTimeout(h)}}:null}function wc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Nc(this,this.stylesheets);else if(this.unsuspend){var n=this.unsuspend;this.unsuspend=null,n()}}}var jc=null;function Nc(n,i){n.stylesheets=null,n.unsuspend!==null&&(n.count++,jc=new Map,i.forEach(e_,n),jc=null,wc.call(n))}function e_(n,i){if(!(i.state.loading&4)){var o=jc.get(n);if(o)var u=o.get(null);else{o=new Map,jc.set(n,o);for(var h=n.querySelectorAll("link[data-precedence],style[data-precedence]"),g=0;g<h.length;g++){var w=h[g];(w.nodeName==="LINK"||w.getAttribute("media")!=="not all")&&(o.set(w.dataset.precedence,w),u=w)}u&&o.set(null,u)}h=i.instance,w=h.getAttribute("data-precedence"),g=o.get(w)||u,g===u&&o.set(null,h),o.set(w,h),this.count++,u=wc.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 zo={$$typeof:R,Provider:null,Consumer:null,_currentValue:ae,_currentValue2:ae,_threadCount:0};function t_(n,i,o,u,h,g,w,k,D){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=Ra(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ra(0),this.hiddenUpdates=Ra(null),this.identifierPrefix=u,this.onUncaughtError=h,this.onCaughtError=g,this.onRecoverableError=w,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=D,this.incompleteTransitions=new Map}function bv(n,i,o,u,h,g,w,k,D,H,Y,ee){return n=new t_(n,i,o,w,D,H,Y,ee,k),i=1,g===!0&&(i|=24),g=Cn(3,null,null,i),n.current=g,g.stateNode=n,i=Zd(),i.refCount++,n.pooledCache=i,i.refCount++,g.memoizedState={element:u,isDehydrated:o,cache:i},Vd(g),n}function xv(n){return n?(n=Ba,n):Ba}function Sv(n,i,o,u,h,g){h=xv(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),ao(o,n,i))}function wv(n,i){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var o=n.retryLane;n.retryLane=o!==0&&o<i?o:i}}function hh(n,i){wv(n,i),(n=n.alternate)&&wv(n,i)}function jv(n){if(n.tag===13||n.tag===31){var i=Ki(n,67108864);i!==null&&yn(i,n,67108864),hh(n,67108864)}}function Nv(n){if(n.tag===13||n.tag===31){var i=Rn();i=$(i);var o=Ki(n,i);o!==null&&yn(o,n,i),hh(n,i)}}var Cc=!0;function n_(n,i,o,u){var h=B.T;B.T=null;var g=T.p;try{T.p=2,mh(n,i,o,u)}finally{T.p=g,B.T=h}}function s_(n,i,o,u){var h=B.T;B.T=null;var g=T.p;try{T.p=8,mh(n,i,o,u)}finally{T.p=g,B.T=h}}function mh(n,i,o,u){if(Cc){var h=ph(u);if(h===null)eh(n,i,u,_c,o),_v(n,u);else if(a_(h,n,i,o,u))u.stopPropagation();else if(_v(n,u),i&4&&-1<i_.indexOf(n)){for(;h!==null;){var g=Yn(h);if(g!==null)switch(g.tag){case 3:if(g=g.stateNode,g.current.memoizedState.isDehydrated){var w=ls(g.pendingLanes);if(w!==0){var k=g;for(k.pendingLanes|=2,k.entangledLanes|=2;w;){var D=1<<31-ne(w);k.entanglements[1]|=D,w&=~D}ps(g),(Ye&6)===0&&(lc=Pe()+500,wo(0))}}break;case 31:case 13:k=Ki(g,2),k!==null&&yn(k,g,2),uc(),hh(g,2)}if(g=ph(u),g===null&&eh(n,i,u,_c,o),g===h)break;h=g}h!==null&&u.stopPropagation()}else eh(n,i,u,null,o)}}function ph(n){return n=gd(n),gh(n)}var _c=null;function gh(n){if(_c=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 _c=n,null}function Cv(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 zt:return 8;case Qn:case bs:return 32;case Fs:return 268435456;default:return 32}default:return 32}}var yh=!1,gi=null,yi=null,vi=null,Eo=new Map,Ro=new Map,bi=[],i_="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 _v(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":Eo.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ro.delete(i.pointerId)}}function Oo(n,i,o,u,h,g){return n===null||n.nativeEvent!==g?(n={blockedOn:i,domEventName:o,eventSystemFlags:u,nativeEvent:g,targetContainers:[h]},i!==null&&(i=Yn(i),i!==null&&jv(i)),n):(n.eventSystemFlags|=u,i=n.targetContainers,h!==null&&i.indexOf(h)===-1&&i.push(h),n)}function a_(n,i,o,u,h){switch(i){case"focusin":return gi=Oo(gi,n,i,o,u,h),!0;case"dragenter":return yi=Oo(yi,n,i,o,u,h),!0;case"mouseover":return vi=Oo(vi,n,i,o,u,h),!0;case"pointerover":var g=h.pointerId;return Eo.set(g,Oo(Eo.get(g)||null,n,i,o,u,h)),!0;case"gotpointercapture":return g=h.pointerId,Ro.set(g,Oo(Ro.get(g)||null,n,i,o,u,h)),!0}return!1}function kv(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,Vt(n.priority,function(){Nv(o)});return}}else if(i===31){if(i=f(o),i!==null){n.blockedOn=i,Vt(n.priority,function(){Nv(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 kc(n){if(n.blockedOn!==null)return!1;for(var i=n.targetContainers;0<i.length;){var o=ph(n.nativeEvent);if(o===null){o=n.nativeEvent;var u=new o.constructor(o.type,o);pd=u,o.target.dispatchEvent(u),pd=null}else return i=Yn(o),i!==null&&jv(i),n.blockedOn=o,!1;i.shift()}return!0}function zv(n,i,o){kc(n)&&o.delete(i)}function r_(){yh=!1,gi!==null&&kc(gi)&&(gi=null),yi!==null&&kc(yi)&&(yi=null),vi!==null&&kc(vi)&&(vi=null),Eo.forEach(zv),Ro.forEach(zv)}function zc(n,i){n.blockedOn===i&&(n.blockedOn=null,yh||(yh=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,r_)))}var Ec=null;function Ev(n){Ec!==n&&(Ec=n,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Ec===n&&(Ec=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(gh(u||o)===null)continue;break}var g=Yn(o);g!==null&&(n.splice(i,3),i-=3,pf(g,{pending:!0,data:h,method:o.method,action:u},u,h))}}))}function dr(n){function i(D){return zc(D,n)}gi!==null&&zc(gi,n),yi!==null&&zc(yi,n),vi!==null&&zc(vi,n),Eo.forEach(i),Ro.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);)kv(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],w=h[jt]||null;if(typeof g=="function")w||Ev(o);else if(w){var k=null;if(g&&g.hasAttribute("formAction")){if(h=g,w=g[jt]||null)k=w.formAction;else if(gh(h)!==null)continue}else k=w.action;typeof k=="function"?o[u+1]=k:(o.splice(u,3),u-=3),Ev(o)}}}function Rv(){function n(g){g.canIntercept&&g.info==="react-transition"&&g.intercept({handler:function(){return new Promise(function(w){return h=w})},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 vh(n){this._internalRoot=n}Rc.prototype.render=vh.prototype.render=function(n){var i=this._internalRoot;if(i===null)throw Error(a(409));var o=i.current,u=Rn();Sv(o,u,n,i,null,null)},Rc.prototype.unmount=vh.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var i=n.containerInfo;Sv(n.current,2,null,n,null,null),uc(),i[jn]=null}};function Rc(n){this._internalRoot=n}Rc.prototype.unstable_scheduleHydration=function(n){if(n){var i=nt();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&&kv(n)}};var Ov=t.version;if(Ov!=="19.2.4")throw Error(a(527,Ov,"19.2.4"));T.findDOMNode=function(n){var i=n._reactInternals;if(i===void 0)throw typeof n.render=="function"?Error(a(188)):(n=Object.keys(n).join(","),Error(a(268,n)));return n=m(i),n=n!==null?b(n):null,n=n===null?null:n.stateNode,n};var o_={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:B,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Oc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Oc.isDisabled&&Oc.supportsFiber)try{os=Oc.inject(o_),Ce=Oc}catch{}}return To.createRoot=function(n,i){if(!r(n))throw Error(a(299));var o=!1,u="",h=Py,g=$y,w=Iy;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&&(w=i.onRecoverableError)),i=bv(n,1,!1,null,null,o,u,null,h,g,w,Rv),n[jn]=i.current,Wf(n),new vh(i)},To.hydrateRoot=function(n,i,o){if(!r(n))throw Error(a(299));var u=!1,h="",g=Py,w=$y,k=Iy,D=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&&(w=o.onCaughtError),o.onRecoverableError!==void 0&&(k=o.onRecoverableError),o.formState!==void 0&&(D=o.formState)),i=bv(n,1,!0,i,o??null,u,h,D,g,w,k,Rv),i.context=xv(null),o=i.current,u=Rn(),u=$(u),h=ii(u),h.callback=null,ai(o,h,u),o=u,i.current.lanes=o,Hi(i,o),ps(i),n[jn]=i.current,Wf(n),new Rc(i)},To.version="19.2.4",To}var Bv;function y_(){if(Bv)return Sh.exports;Bv=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(),Sh.exports=g_(),Sh.exports}var v_=y_(),Lr=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(){}},b_={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},x_=class{#t=b_;#e=!1;setTimeoutProvider(e){this.#t=e}setTimeout(e,t){return this.#t.setTimeout(e,t)}clearTimeout(e){this.#t.clearTimeout(e)}setInterval(e,t){return this.#t.setInterval(e,t)}clearInterval(e){this.#t.clearInterval(e)}},ua=new x_;function S_(e){setTimeout(e,0)}var xa=typeof window>"u"||"Deno"in globalThis;function ln(){}function w_(e,t){return typeof e=="function"?e(t):e}function em(e){return typeof e=="number"&&e>=0&&e!==1/0}function qx(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ri(e,t){return typeof e=="function"?e(t):e}function qn(e,t){return typeof e=="function"?e(t):e}function qv(e,t){const{type:s="all",exact:a,fetchStatus:r,predicate:c,queryKey:d,stale:f}=e;if(d){if(a){if(t.queryHash!==Pm(d,t.options))return!1}else if(!Qo(t.queryKey,d))return!1}if(s!=="all"){const p=t.isActive();if(s==="active"&&!p||s==="inactive"&&p)return!1}return!(typeof f=="boolean"&&t.isStale()!==f||r&&r!==t.state.fetchStatus||c&&!c(t))}function Hv(e,t){const{exact:s,status:a,predicate:r,mutationKey:c}=e;if(c){if(!t.options.mutationKey)return!1;if(s){if(Vo(t.options.mutationKey)!==Vo(c))return!1}else if(!Qo(t.options.mutationKey,c))return!1}return!(a&&t.state.status!==a||r&&!r(t))}function Pm(e,t){return(t?.queryKeyHashFn||Vo)(e)}function Vo(e){return JSON.stringify(e,(t,s)=>tm(s)?Object.keys(s).sort().reduce((a,r)=>(a[r]=s[r],a),{}):s)}function Qo(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(s=>Qo(e[s],t[s])):!1}var j_=Object.prototype.hasOwnProperty;function $m(e,t,s=0){if(e===t)return e;if(s>500)return t;const a=Zv(e)&&Zv(t);if(!a&&!(tm(e)&&tm(t)))return t;const c=(a?e:Object.keys(e)).length,d=a?t:Object.keys(t),f=d.length,p=a?new Array(f):{};let m=0;for(let b=0;b<f;b++){const y=a?b:d[b],v=e[y],x=t[y];if(v===x){p[y]=v,(a?b<c:j_.call(e,y))&&m++;continue}if(v===null||x===null||typeof v!="object"||typeof x!="object"){p[y]=x;continue}const j=$m(v,x,s+1);p[y]=j,j===v&&m++}return c===f&&m===c?e:p}function lu(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 Zv(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function tm(e){if(!Fv(e))return!1;const t=e.constructor;if(t===void 0)return!0;const s=t.prototype;return!(!Fv(s)||!s.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Fv(e){return Object.prototype.toString.call(e)==="[object Object]"}function N_(e){return new Promise(t=>{ua.setTimeout(t,e)})}function nm(e,t,s){return typeof s.structuralSharing=="function"?s.structuralSharing(e,t):s.structuralSharing!==!1?$m(e,t):t}function C_(e,t,s=0){const a=[...e,t];return s&&a.length>s?a.slice(1):a}function __(e,t,s=0){const a=[t,...e];return s&&a.length>s?a.slice(0,-1):a}var Im=Symbol();function Hx(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Im?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Zx(e,t){return typeof e=="function"?e(...t):!!e}function k_(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 z_=class extends Lr{#t;#e;#n;constructor(){super(),this.#n=e=>{if(!xa&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#e||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(e){this.#n=e,this.#e?.(),this.#e=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#t!==e&&(this.#t=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#t=="boolean"?this.#t:globalThis.document?.visibilityState!=="hidden"}},Bm=new z_;function sm(){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 E_=S_;function R_(){let e=[],t=0,s=f=>{f()},a=f=>{f()},r=E_;const c=f=>{t?e.push(f):r(()=>{s(f)})},d=()=>{const f=e;e=[],f.length&&r(()=>{a(()=>{f.forEach(p=>{s(p)})})})};return{batch:f=>{let p;t++;try{p=f()}finally{t--,t||d()}return p},batchCalls:f=>(...p)=>{c(()=>{f(...p)})},schedule:c,setNotifyFunction:f=>{s=f},setBatchNotifyFunction:f=>{a=f},setScheduler:f=>{r=f}}}var Bt=R_(),O_=class extends Lr{#t=!0;#e;#n;constructor(){super(),this.#n=e=>{if(!xa&&window.addEventListener){const t=()=>e(!0),s=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",s)}}}}onSubscribe(){this.#e||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(e){this.#n=e,this.#e?.(),this.#e=e(this.setOnline.bind(this))}setOnline(e){this.#t!==e&&(this.#t=e,this.listeners.forEach(s=>{s(e)}))}isOnline(){return this.#t}},cu=new O_;function A_(e){return Math.min(1e3*2**e,3e4)}function Fx(e){return(e??"online")==="online"?cu.isOnline():!0}var im=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function Gx(e){let t=!1,s=0,a;const r=sm(),c=()=>r.status!=="pending",d=S=>{if(!c()){const C=new im(S);v(C),e.onCancel?.(C)}},f=()=>{t=!0},p=()=>{t=!1},m=()=>Bm.isFocused()&&(e.networkMode==="always"||cu.isOnline())&&e.canRun(),b=()=>Fx(e.networkMode)&&e.canRun(),y=S=>{c()||(a?.(),r.resolve(S))},v=S=>{c()||(a?.(),r.reject(S))},x=()=>new Promise(S=>{a=C=>{(c()||m())&&S(C)},e.onPause?.()}).then(()=>{a=void 0,c()||e.onContinue?.()}),j=()=>{if(c())return;let S;const C=s===0?e.initialPromise:void 0;try{S=C??e.fn()}catch(_){S=Promise.reject(_)}Promise.resolve(S).then(y).catch(_=>{if(c())return;const E=e.retry??(xa?0:3),R=e.retryDelay??A_,z=typeof R=="function"?R(s,_):R,U=E===!0||typeof E=="number"&&s<E||typeof E=="function"&&E(s,_);if(t||!U){v(_);return}s++,e.onFail?.(s,_),N_(z).then(()=>m()?void 0:x()).then(()=>{t?v(_):j()})})};return{promise:r,status:()=>r.status,cancel:d,continue:()=>(a?.(),r),cancelRetry:f,continueRetry:p,canStart:b,start:()=>(b()?j():x().then(j),r)}}var Kx=class{#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),em(this.gcTime)&&(this.#t=ua.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(xa?1/0:300*1e3))}clearGcTimeout(){this.#t&&(ua.clearTimeout(this.#t),this.#t=void 0)}},T_=class extends Kx{#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=Kv(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=Kv(this.options);t.data!==void 0&&(this.setState(Gv(t.data,t.dataUpdatedAt)),this.#t=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const s=nm(this.state.data,e,this.options);return this.#a({data:s,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),s}setState(e,t){this.#a({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#s?.promise;return this.#s?.cancel(e),t?t.then(ln).catch(ln):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#t)}isActive(){return this.observers.some(e=>qn(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Im||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Ri(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:!qx(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#s?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#s?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#s&&(this.#o?this.#s.cancel({revert:!0}):this.#s.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#a({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#s?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#s)return this.#s.continueRetry(),this.#s.promise}if(e&&this.setOptions(e),!this.options.queryFn){const f=this.observers.find(p=>p.options.queryFn);f&&this.setOptions(f.options)}const s=new AbortController,a=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(this.#o=!0,s.signal)})},r=()=>{const f=Hx(this.options,t),m=(()=>{const b={client:this.#i,queryKey:this.queryKey,meta:this.meta};return a(b),b})();return this.#o=!1,this.options.persister?this.options.persister(f,m,this):f(m)},d=(()=>{const f={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:r};return a(f),f})();this.options.behavior?.onFetch(d,this),this.#e=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==d.fetchOptions?.meta)&&this.#a({type:"fetch",meta:d.fetchOptions?.meta}),this.#s=Gx({initialPromise:t?.initialPromise,fn:d.fetchFn,onCancel:f=>{f instanceof im&&f.revert&&this.setState({...this.#e,fetchStatus:"idle"}),s.abort()},onFail:(f,p)=>{this.#a({type:"failed",failureCount:f,error:p})},onPause:()=>{this.#a({type:"pause"})},onContinue:()=>{this.#a({type:"continue"})},retry:d.options.retry,retryDelay:d.options.retryDelay,networkMode:d.options.networkMode,canRun:()=>!0});try{const f=await this.#s.start();if(f===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(f),this.#n.config.onSuccess?.(f,this),this.#n.config.onSettled?.(f,this.state.error,this),f}catch(f){if(f instanceof im){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,...Vx(s.data,this.options),fetchMeta:e.meta??null};case"success":const a={...s,...Gv(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),Bt.batch(()=>{this.observers.forEach(s=>{s.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function Vx(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Fx(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Gv(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Kv(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 qm=class extends Lr{constructor(e,t){super(),this.options=t,this.#t=e,this.#a=null,this.#o=sm(),this.bindMethods(),this.setOptions(t)}#t;#e=void 0;#n=void 0;#i=void 0;#s;#r;#o;#a;#m;#d;#f;#c;#u;#l;#h=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#e.addObserver(this),Vv(this.#e,this.options)?this.#p():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return am(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return am(this.#e,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#S(),this.#e.removeObserver(this)}setOptions(e){const t=this.options,s=this.#e;if(this.options=this.#t.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof qn(this.options.enabled,this.#e)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#w(),this.#e.setOptions(this.options),t._defaulted&&!lu(this.options,t)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const a=this.hasListeners();a&&Qv(this.#e,s,this.options,t)&&this.#p(),this.updateResult(),a&&(this.#e!==s||qn(this.options.enabled,this.#e)!==qn(t.enabled,this.#e)||Ri(this.options.staleTime,this.#e)!==Ri(t.staleTime,this.#e))&&this.#g();const r=this.#y();a&&(this.#e!==s||qn(this.options.enabled,this.#e)!==qn(t.enabled,this.#e)||r!==this.#l)&&this.#v(r)}getOptimisticResult(e){const t=this.#t.getQueryCache().build(this.#t,e),s=this.createResult(t,e);return L_(this,s)&&(this.#i=s,this.#r=this.options,this.#s=this.#e.state),s}getCurrentResult(){return this.#i}trackResult(e,t){return new Proxy(e,{get:(s,a)=>(this.trackProp(a),t?.(a),a==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#o.status==="pending"&&this.#o.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(s,a))})}trackProp(e){this.#h.add(e)}getCurrentQuery(){return this.#e}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#t.defaultQueryOptions(e),s=this.#t.getQueryCache().build(this.#t,t);return s.fetch().then(()=>this.createResult(s,t))}fetch(e){return this.#p({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#i))}#p(e){this.#w();let t=this.#e.fetch(this.options,e);return e?.throwOnError||(t=t.catch(ln)),t}#g(){this.#x();const e=Ri(this.options.staleTime,this.#e);if(xa||this.#i.isStale||!em(e))return;const s=qx(this.#i.dataUpdatedAt,e)+1;this.#c=ua.setTimeout(()=>{this.#i.isStale||this.updateResult()},s)}#y(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#e):this.options.refetchInterval)??!1}#v(e){this.#S(),this.#l=e,!(xa||qn(this.options.enabled,this.#e)===!1||!em(this.#l)||this.#l===0)&&(this.#u=ua.setInterval(()=>{(this.options.refetchIntervalInBackground||Bm.isFocused())&&this.#p()},this.#l))}#b(){this.#g(),this.#v(this.#y())}#x(){this.#c&&(ua.clearTimeout(this.#c),this.#c=void 0)}#S(){this.#u&&(ua.clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const s=this.#e,a=this.options,r=this.#i,c=this.#s,d=this.#r,p=e!==s?e.state:this.#n,{state:m}=e;let b={...m},y=!1,v;if(t._optimisticResults){const A=this.hasListeners(),Z=!A&&Vv(e,t),W=A&&Qv(e,s,t,a);(Z||W)&&(b={...b,...Vx(m.data,e.options)}),t._optimisticResults==="isRestoring"&&(b.fetchStatus="idle")}let{error:x,errorUpdatedAt:j,status:S}=b;v=b.data;let C=!1;if(t.placeholderData!==void 0&&v===void 0&&S==="pending"){let A;r?.isPlaceholderData&&t.placeholderData===d?.placeholderData?(A=r.data,C=!0):A=typeof t.placeholderData=="function"?t.placeholderData(this.#f?.state.data,this.#f):t.placeholderData,A!==void 0&&(S="success",v=nm(r?.data,A,t),y=!0)}if(t.select&&v!==void 0&&!C)if(r&&v===c?.data&&t.select===this.#m)v=this.#d;else try{this.#m=t.select,v=t.select(v),v=nm(r?.data,v,t),this.#d=v,this.#a=null}catch(A){this.#a=A}this.#a&&(x=this.#a,v=this.#d,j=Date.now(),S="error");const _=b.fetchStatus==="fetching",E=S==="pending",R=S==="error",z=E&&_,U=v!==void 0,M={status:S,fetchStatus:b.fetchStatus,isPending:E,isSuccess:S==="success",isError:R,isInitialLoading:z,isLoading:z,data:v,dataUpdatedAt:b.dataUpdatedAt,error:x,errorUpdatedAt:j,failureCount:b.fetchFailureCount,failureReason:b.fetchFailureReason,errorUpdateCount:b.errorUpdateCount,isFetched:b.dataUpdateCount>0||b.errorUpdateCount>0,isFetchedAfterMount:b.dataUpdateCount>p.dataUpdateCount||b.errorUpdateCount>p.errorUpdateCount,isFetching:_,isRefetching:_&&!E,isLoadingError:R&&!U,isPaused:b.fetchStatus==="paused",isPlaceholderData:y,isRefetchError:R&&U,isStale:Hm(e,t),refetch:this.refetch,promise:this.#o,isEnabled:qn(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const A=M.data!==void 0,Z=M.status==="error"&&!A,W=me=>{Z?me.reject(M.error):A&&me.resolve(M.data)},Q=()=>{const me=this.#o=M.promise=sm();W(me)},se=this.#o;switch(se.status){case"pending":e.queryHash===s.queryHash&&W(se);break;case"fulfilled":(Z||M.data!==se.value)&&Q();break;case"rejected":(!Z||M.error!==se.reason)&&Q();break}}return M}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),lu(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){Bt.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#i)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function D_(e,t){return qn(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Vv(e,t){return D_(e,t)||e.state.data!==void 0&&am(e,t,t.refetchOnMount)}function am(e,t,s){if(qn(t.enabled,e)!==!1&&Ri(t.staleTime,e)!=="static"){const a=typeof s=="function"?s(e):s;return a==="always"||a!==!1&&Hm(e,t)}return!1}function Qv(e,t,s,a){return(e!==t||qn(a.enabled,e)===!1)&&(!s.suspense||e.state.status!=="error")&&Hm(e,s)}function Hm(e,t){return qn(t.enabled,e)!==!1&&e.isStaleByTime(Ri(t.staleTime,e))}function L_(e,t){return!lu(e.getCurrentResult(),t)}function Yv(e){return{onFetch:(t,s)=>{const a=t.options,r=t.fetchOptions?.meta?.fetchMore?.direction,c=t.state.data?.pages||[],d=t.state.data?.pageParams||[];let f={pages:[],pageParams:[]},p=0;const m=async()=>{let b=!1;const y=j=>{k_(j,()=>t.signal,()=>b=!0)},v=Hx(t.options,t.fetchOptions),x=async(j,S,C)=>{if(b)return Promise.reject();if(S==null&&j.pages.length)return Promise.resolve(j);const E=(()=>{const O={client:t.client,queryKey:t.queryKey,pageParam:S,direction:C?"backward":"forward",meta:t.options.meta};return y(O),O})(),R=await v(E),{maxPages:z}=t.options,U=C?__:C_;return{pages:U(j.pages,R,z),pageParams:U(j.pageParams,S,z)}};if(r&&c.length){const j=r==="backward",S=j?M_:Jv,C={pages:c,pageParams:d},_=S(a,C);f=await x(C,_,j)}else{const j=e??c.length;do{const S=p===0?d[0]??a.initialPageParam:Jv(a,f);if(p>0&&S==null)break;f=await x(f,S),p++}while(p<j)}return f};t.options.persister?t.fetchFn=()=>t.options.persister?.(m,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},s):t.fetchFn=m}}}function Jv(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 M_(e,{pages:t,pageParams:s}){return t.length>0?e.getPreviousPageParam?.(t[0],t,s[0],s):void 0}var U_=class extends Kx{#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||P_(),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=Gx({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),Bt.batch(()=>{this.#e.forEach(s=>{s.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function P_(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Qx=class extends Lr{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 U_({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=Ac(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=Ac(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=Ac(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=Ac(e);return typeof t=="string"?this.#e.get(t)?.find(a=>a!==e&&a.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Bt.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=>Hv(t,s))}findAll(e={}){return this.getAll().filter(t=>Hv(e,t))}notify(e){Bt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return Bt.batch(()=>Promise.all(e.map(t=>t.continue().catch(ln))))}};function Ac(e){return e.options.scope?.id}function Xv(e,t){const s=new Set(t);return e.filter(a=>!s.has(a))}function $_(e,t,s){const a=e.slice(0);return a[t]=s,a}var I_=class extends Lr{#t;#e;#n;#i;#s;#r;#o;#a;#m;#d=[];constructor(e,t,s){super(),this.#t=e,this.#i=s,this.#n=[],this.#s=[],this.#e=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#s.forEach(e=>{e.subscribe(t=>{this.#l(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#s.forEach(e=>{e.destroy()})}setQueries(e,t){this.#n=e,this.#i=t,Bt.batch(()=>{const s=this.#s,a=this.#u(this.#n);a.forEach(b=>b.observer.setOptions(b.defaultedQueryOptions));const r=a.map(b=>b.observer),c=r.map(b=>b.getCurrentResult()),d=s.length!==r.length,f=r.some((b,y)=>b!==s[y]),p=d||f,m=p?!0:c.some((b,y)=>{const v=this.#e[y];return!v||!lu(b,v)});!p&&!m||(p&&(this.#d=a,this.#s=r),this.#e=c,this.hasListeners()&&(p&&(Xv(s,r).forEach(b=>{b.destroy()}),Xv(r,s).forEach(b=>{b.subscribe(y=>{this.#l(b,y)})})),this.#h()))})}getCurrentResult(){return this.#e}getQueries(){return this.#s.map(e=>e.getCurrentQuery())}getObservers(){return this.#s}getOptimisticResult(e,t){const s=this.#u(e),a=s.map(c=>c.observer.getOptimisticResult(c.defaultedQueryOptions)),r=s.map(c=>c.defaultedQueryOptions.queryHash);return[a,c=>this.#c(c??a,t,r),()=>this.#f(a,s)]}#f(e,t){return t.map((s,a)=>{const r=e[a];return s.defaultedQueryOptions.notifyOnChangeProps?r:s.observer.trackResult(r,c=>{t.forEach(d=>{d.observer.trackProp(c)})})})}#c(e,t,s){if(t){const a=this.#m,r=s!==void 0&&a!==void 0&&(a.length!==s.length||s.some((c,d)=>c!==a[d]));return(!this.#r||this.#e!==this.#a||r||t!==this.#o)&&(this.#o=t,this.#a=this.#e,s!==void 0&&(this.#m=s),this.#r=$m(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 qm(this.#t,r);s.push({defaultedQueryOptions:r,observer:d})}),s}#l(e,t){const s=this.#s.indexOf(e);s!==-1&&(this.#e=$_(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&&Bt.batch(()=>{this.listeners.forEach(a=>{a(this.#e)})})}}},B_=class extends Lr{constructor(e={}){super(),this.config=e,this.#t=new Map}#t;build(e,t,s){const a=t.queryKey,r=t.queryHash??Pm(a,t);let c=this.get(r);return c||(c=new T_({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(){Bt.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=>qv(t,s))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(s=>qv(e,s)):t}notify(e){Bt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Bt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Bt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},q_=class{#t;#e;#n;#i;#s;#r;#o;#a;constructor(e={}){this.#t=e.queryCache||new B_,this.#e=e.mutationCache||new Qx,this.#n=e.defaultOptions||{},this.#i=new Map,this.#s=new Map,this.#r=0}mount(){this.#r++,this.#r===1&&(this.#o=Bm.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onFocus())}),this.#a=cu.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(Ri(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=w_(t,c);if(d!==void 0)return this.#t.build(this,a).setData(d,{...s,manual:!0})}setQueriesData(e,t,s){return Bt.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;Bt.batch(()=>{t.findAll(e).forEach(s=>{t.remove(s)})})}resetQueries(e,t){const s=this.#t;return Bt.batch(()=>(s.findAll(e).forEach(a=>{a.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const s={revert:!0,...t},a=Bt.batch(()=>this.#t.findAll(e).map(r=>r.cancel(s)));return Promise.all(a).then(ln).catch(ln)}invalidateQueries(e,t={}){return Bt.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=Bt.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(Ri(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=Yv(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(ln).catch(ln)}ensureInfiniteQueryData(e){return e.behavior=Yv(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return cu.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(Vo(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#i.values()],s={};return t.forEach(a=>{Qo(e,a.queryKey)&&Object.assign(s,a.defaultOptions)}),s}setMutationDefaults(e,t){this.#s.set(Vo(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#s.values()],s={};return t.forEach(a=>{Qo(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=Pm(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===Im&&(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()}},Yx=N.createContext(void 0),Jx=e=>{const t=N.useContext(Yx);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},H_=({client:e,children:t})=>(N.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),l.jsx(Yx.Provider,{value:e,children:t})),Xx=N.createContext(!1),Wx=()=>N.useContext(Xx);Xx.Provider;function Z_(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var F_=N.createContext(Z_()),eS=()=>N.useContext(F_),tS=(e,t,s)=>{const a=s?.state.error&&typeof e.throwOnError=="function"?Zx(e.throwOnError,[s.state.error,s]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||a)&&(t.isReset()||(e.retryOnMount=!1))},nS=e=>{N.useEffect(()=>{e.clearReset()},[e])},sS=({result:e,errorResetBoundary:t,throwOnError:s,query:a,suspense:r})=>e.isError&&!t.isReset()&&!e.isFetching&&a&&(r&&e.data===void 0||Zx(s,[e.error,a])),iS=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))}},G_=(e,t)=>e.isLoading&&e.isFetching&&!t,rm=(e,t)=>e?.suspense&&t.isPending,om=(e,t,s)=>t.fetchOptimistic(e).catch(()=>{s.clearReset()});function K_({queries:e,...t},s){const a=Jx(),r=Wx(),c=eS(),d=N.useMemo(()=>e.map(S=>{const C=a.defaultQueryOptions(S);return C._optimisticResults=r?"isRestoring":"optimistic",C}),[e,a,r]);d.forEach(S=>{iS(S);const C=a.getQueryCache().get(S.queryHash);tS(S,c,C)}),nS(c);const[f]=N.useState(()=>new I_(a,d,t)),[p,m,b]=f.getOptimisticResult(d,t.combine),y=!r&&t.subscribed!==!1;N.useSyncExternalStore(N.useCallback(S=>y?f.subscribe(Bt.batchCalls(S)):ln,[f,y]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),N.useEffect(()=>{f.setQueries(d,t)},[d,t,f]);const x=p.some((S,C)=>rm(d[C],S))?p.flatMap((S,C)=>{const _=d[C];if(_&&rm(_,S)){const E=new qm(a,_);return om(_,E,c)}return[]}):[];if(x.length>0)throw Promise.all(x);const j=p.find((S,C)=>{const _=d[C];return _&&sS({result:S,errorResetBoundary:c,throwOnError:_.throwOnError,query:a.getQueryCache().get(_.queryHash),suspense:_.suspense})});if(j?.error)throw j.error;return m(b())}function V_(e,t,s){const a=Wx(),r=eS(),c=Jx(),d=c.defaultQueryOptions(e);c.getDefaultOptions().queries?._experimental_beforeQuery?.(d);const f=c.getQueryCache().get(d.queryHash);d._optimisticResults=a?"isRestoring":"optimistic",iS(d),tS(d,r,f),nS(r);const p=!c.getQueryCache().get(d.queryHash),[m]=N.useState(()=>new t(c,d)),b=m.getOptimisticResult(d),y=!a&&e.subscribed!==!1;if(N.useSyncExternalStore(N.useCallback(v=>{const x=y?m.subscribe(Bt.batchCalls(v)):ln;return m.updateResult(),x},[m,y]),()=>m.getCurrentResult(),()=>m.getCurrentResult()),N.useEffect(()=>{m.setOptions(d)},[d,m]),rm(d,b))throw om(d,m,r);if(sS({result:b,errorResetBoundary:r,throwOnError:d.throwOnError,query:f,suspense:d.suspense}))throw b.error;return c.getDefaultOptions().queries?._experimental_afterQuery?.(d,b),d.experimental_prefetchInRender&&!xa&&G_(b,a)&&(p?om(d,m,r):f?.promise)?.catch(ln).finally(()=>{m.updateResult()}),d.notifyOnChangeProps?b:m.trackResult(b)}function qo(e,t){return V_(e,qm)}var Tc=typeof window<"u"?N.useLayoutEffect:N.useEffect;function Ch(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 Q_(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 Y_(e){const t=N.useRef(null);return N.useImperativeHandle(e,()=>t.current,[]),t}var J_=!1;function Yo(e){return e[e.length-1]}function X_(e){return typeof e=="function"}function _i(e,t){return X_(e)?e(t):e}var W_=Object.prototype.hasOwnProperty,Wv=Object.prototype.propertyIsEnumerable,ek=()=>Object.create(null),ra=(e,t)=>da(e,t,ek);function da(e,t,s=()=>({}),a=0){if(e===t)return e;if(a>500)return t;const r=t,c=nb(e)&&nb(r);if(!c&&!(uu(e)&&uu(r)))return r;const d=c?e:eb(e);if(!d)return r;const f=c?r:eb(r);if(!f)return r;const p=d.length,m=f.length,b=c?new Array(m):s();let y=0;for(let v=0;v<m;v++){const x=c?v:f[v],j=e[x],S=r[x];if(j===S){b[x]=j,(c?v<p:W_.call(e,x))&&y++;continue}if(j===null||S===null||typeof j!="object"||typeof S!="object"){b[x]=S;continue}const C=da(j,S,s,a+1);b[x]=C,C===j&&y++}return p===m&&y===p?e:b}function eb(e){const t=Object.getOwnPropertyNames(e);for(const r of t)if(!Wv.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(!Wv.call(e,r))return!1;a.push(r)}return a}function uu(e){if(!tb(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const s=t.prototype;return!(!tb(s)||!s.hasOwnProperty("isPrototypeOf"))}function tb(e){return Object.prototype.toString.call(e)==="[object Object]"}function nb(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ga(e,t,s){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let a=0,r=e.length;a<r;a++)if(!ga(e[a],t[a],s))return!1;return!0}if(uu(e)&&uu(t)){const a=s?.ignoreUndefined??!0;if(s?.partial){for(const d in t)if((!a||t[d]!==void 0)&&!ga(e[d],t[d],s))return!1;return!0}let r=0;if(!a)r=Object.keys(e).length;else for(const d in e)e[d]!==void 0&&r++;let c=0;for(const d in t)if((!a||t[d]!==void 0)&&(c++,c>r||!ga(e[d],t[d],s)))return!1;return r===c}return!1}function Rr(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 Jo(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function tk(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function sb(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 tk(t)}var nk=["http:","https:","mailto:","tel:"];function du(e,t){if(!e)return!1;try{const s=new URL(e);return!t.has(s.protocol)}catch{return!1}}function Do(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+=sb(e.slice(s,r.index))+r[0],s=t.lastIndex;a=a+sb(s?e.slice(s):e);let c=!1;return a.startsWith("//")&&(c=!0,a="/"+a.replace(/^\/+/,"")),{path:a,handledProtocolRelativeURL:c}}function sk(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function fu(e){const t=new Map;let s,a;const r=c=>{c.next&&(c.prev?(c.prev.next=c.next,c.next.prev=c.prev,c.next=void 0,a&&(a.next=c,c.prev=a)):(c.next.prev=void 0,s=c.next,c.next=void 0,a&&(c.prev=a,a.next=c)),a=c)};return{get(c){const d=t.get(c);if(d)return r(d),d.value},set(c,d){if(t.size>=e&&s){const p=s;t.delete(p.key),p.next&&(s=p.next,p.next.prev=void 0),p===a&&(a=void 0)}const f=t.get(c);if(f)f.value=d,r(f);else{const p={key:c,value:d,prev:a};a&&(a.next=p),a=p,s||(s=p),t.set(c,p)}},clear(){t.clear(),s=void 0,a=void 0}}}var ik="Invariant failed";function Li(e,t){if(!e)throw new Error(ik)}var fa=4,aS=5;function ak(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 Zm(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=ak(c);if(d){const[f,p]=d,m=c.charCodeAt(f+1);if(m===45){if(f+2<c.length&&c.charCodeAt(f+2)===36){const b=f+3,y=p;if(b<y)return s[0]=3,s[1]=t+f,s[2]=t+b,s[3]=t+y,s[4]=t+p+1,s[5]=r,s}}else if(m===36){const b=f+1,y=f+2;return y===p?(s[0]=2,s[1]=t+f,s[2]=t+b,s[3]=t+y,s[4]=t+p+1,s[5]=e.length,s):(s[0]=1,s[1]=t+f,s[2]=t+y,s[3]=t+p,s[4]=t+p+1,s[5]=r,s)}}return s[0]=0,s[1]=t,s[2]=t,s[3]=r,s[4]=r,s[5]=r,s}function Ou(e,t,s,a,r,c,d){d?.(s);let f=a;{const p=s.fullPath??s.from,m=p.length,b=s.options?.caseSensitive??e,y=!!(s.options?.params?.parse&&s.options?.skipRouteOnParseError?.params);for(;f<m;){const x=Zm(p,f,t);let j;const S=f,C=x[5];switch(f=C+1,c++,x[0]){case 0:{const _=p.substring(x[2],x[3]);if(b){const E=r.static?.get(_);if(E)j=E;else{r.static??=new Map;const R=ha(s.fullPath??s.from);R.parent=r,R.depth=c,j=R,r.static.set(_,R)}}else{const E=_.toLowerCase(),R=r.staticInsensitive?.get(E);if(R)j=R;else{r.staticInsensitive??=new Map;const z=ha(s.fullPath??s.from);z.parent=r,z.depth=c,j=z,r.staticInsensitive.set(E,z)}}break}case 1:{const _=p.substring(S,x[1]),E=p.substring(x[4],C),R=b&&!!(_||E),z=_?R?_:_.toLowerCase():void 0,U=E?R?E:E.toLowerCase():void 0,O=!y&&r.dynamic?.find(M=>!M.skipOnParamError&&M.caseSensitive===R&&M.prefix===z&&M.suffix===U);if(O)j=O;else{const M=kh(1,s.fullPath??s.from,R,z,U);j=M,M.depth=c,M.parent=r,r.dynamic??=[],r.dynamic.push(M)}break}case 3:{const _=p.substring(S,x[1]),E=p.substring(x[4],C),R=b&&!!(_||E),z=_?R?_:_.toLowerCase():void 0,U=E?R?E:E.toLowerCase():void 0,O=!y&&r.optional?.find(M=>!M.skipOnParamError&&M.caseSensitive===R&&M.prefix===z&&M.suffix===U);if(O)j=O;else{const M=kh(3,s.fullPath??s.from,R,z,U);j=M,M.parent=r,M.depth=c,r.optional??=[],r.optional.push(M)}break}case 2:{const _=p.substring(S,x[1]),E=p.substring(x[4],C),R=b&&!!(_||E),z=_?R?_:_.toLowerCase():void 0,U=E?R?E:E.toLowerCase():void 0,O=kh(2,s.fullPath??s.from,R,z,U);j=O,O.parent=r,O.depth=c,r.wildcard??=[],r.wildcard.push(O)}}r=j}if(y&&s.children&&!s.isRoot&&s.id&&s.id.charCodeAt(s.id.lastIndexOf("/")+1)===95){const x=ha(s.fullPath??s.from);x.kind=aS,x.parent=r,c++,x.depth=c,r.pathless??=[],r.pathless.push(x),r=x}const v=(s.path||!s.children)&&!s.isRoot;if(v&&p.endsWith("/")){const x=ha(s.fullPath??s.from);x.kind=fa,x.parent=r,c++,x.depth=c,r.index=x,r=x}r.parse=s.options?.params?.parse??null,r.skipOnParamError=y,r.parsingPriority=s.options?.skipRouteOnParseError?.priority??0,v&&!r.route&&(r.route=s,r.fullPath=s.fullPath??s.from)}if(s.children)for(const p of s.children)Ou(e,t,p,f,r,c,d)}function _h(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(_h);for(const t of e.dynamic)Ni(t)}if(e.optional?.length){e.optional.sort(_h);for(const t of e.optional)Ni(t)}if(e.wildcard?.length){e.wildcard.sort(_h);for(const t of e.wildcard)Ni(t)}}function ha(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function kh(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 rk(e,t){const s=ha("/"),a=new Uint16Array(6);for(const r of e)Ou(!1,a,r,1,s,0);Ni(s),t.masksTree=s,t.flatCache=fu(1e3)}function ok(e,t){e||="/";const s=t.flatCache.get(e);if(s)return s;const a=Fm(e,t.masksTree);return t.flatCache.set(e,a),a}function lk(e,t,s,a,r){e||="/",a||="/";const c=t?`case\0${e}`:e;let d=r.singleCache.get(c);return d||(d=ha("/"),Ou(t,new Uint16Array(6),{from:e},1,d,0),r.singleCache.set(c,d)),Fm(a,d,s)}function ck(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=Fm(e,t.segmentTree,s)}catch(d){if(d instanceof URIError)c=null;else throw d}return c&&(c.branch=fk(c.route)),t.matchCache.set(a,c),c}function uk(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function dk(e,t=!1,s){const a=ha(e.fullPath),r=new Uint16Array(6),c={},d={};let f=0;return Ou(t,r,e,1,a,0,p=>{if(s?.(p,f),Li(!(p.id in c),`Duplicate routes found with id: ${String(p.id)}`),c[p.id]=p,f!==0&&p.path){const m=uk(p.fullPath);(!d[m]||p.fullPath.endsWith("/"))&&(d[m]=p)}f++}),Ni(a),{processedTree:{segmentTree:a,singleCache:fu(1e3),matchCache:fu(1e3),flatCache:null,masksTree:null},routesById:c,routesByPath:d}}function Fm(e,t,s=!1){const a=e.split("/"),r=mk(e,a,t,s);if(!r)return null;const[c]=rS(e,a,r);return{route:r.node.route,rawParams:c,parsedParams:r.parsedParams}}function rS(e,t,s){const a=hk(s.node);let r=null;const c=Object.create(null);let d=s.extract?.part??0,f=s.extract?.node??0,p=s.extract?.path??0,m=s.extract?.segment??0;for(;f<a.length;d++,f++,p++,m++){const b=a[f];if(b.kind===fa)break;if(b.kind===aS){m--,d--,p--;continue}const y=t[d],v=p;if(y&&(p+=y.length),b.kind===1){r??=s.node.fullPath.split("/");const x=r[m],j=b.prefix?.length??0;if(x.charCodeAt(j)===123){const S=b.suffix?.length??0,C=x.substring(j+2,x.length-S-1),_=y.substring(j,y.length-S);c[C]=decodeURIComponent(_)}else{const S=x.substring(1);c[S]=decodeURIComponent(y)}}else if(b.kind===3){if(s.skipped&1<<f){d--,p=v-1;continue}r??=s.node.fullPath.split("/");const x=r[m],j=b.prefix?.length??0,S=b.suffix?.length??0,C=x.substring(j+3,x.length-S-1),_=b.suffix||b.prefix?y.substring(j,y.length-S):y;_&&(c[C]=decodeURIComponent(_))}else if(b.kind===2){const x=b,j=e.substring(v+(x.prefix?.length??0),e.length-(x.suffix?.length??0)),S=decodeURIComponent(j);c["*"]=S,c._splat=S;break}}return s.rawParams&&Object.assign(c,s.rawParams),[c,{part:d,node:f,path:p,segment:m}]}function fk(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function hk(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function mk(e,t,s,a){if(e==="/"&&s.index)return{node:s.index,skipped:0};const r=!Yo(t),c=r&&e!=="/",d=t.length-(r?1:0),f=[{node:s,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let p=null,m=null,b=null;for(;f.length;){const y=f.pop(),{node:v,index:x,skipped:j,depth:S,statics:C,dynamics:_,optionals:E}=y;let{extract:R,rawParams:z,parsedParams:U}=y;if(v.skipOnParamError){if(!zh(e,t,y))continue;z=y.rawParams,R=y.extract,U=y.parsedParams}a&&v.route&&v.kind!==fa&&Lo(m,y)&&(m=y);const O=x===d;if(O&&(v.route&&!c&&Lo(b,y)&&(b=y),!v.optional&&!v.wildcard&&!v.index&&!v.pathless))continue;const M=O?void 0:t[x];let A;if(O&&v.index){const Z={node:v.index,index:x,skipped:j,depth:S+1,statics:C,dynamics:_,optionals:E,extract:R,rawParams:z,parsedParams:U};let W=!0;if(v.index.skipOnParamError&&(zh(e,t,Z)||(W=!1)),W){if(C===d&&!_&&!E&&!j)return Z;Lo(b,Z)&&(b=Z)}}if(v.wildcard&&Lo(p,y))for(const Z of v.wildcard){const{prefix:W,suffix:Q}=Z;if(W&&(O||!(Z.caseSensitive?M:A??=M.toLowerCase()).startsWith(W)))continue;if(Q){if(O)continue;const me=t.slice(x).join("/").slice(-Q.length);if((Z.caseSensitive?me:me.toLowerCase())!==Q)continue}const se={node:Z,index:d,skipped:j,depth:S,statics:C,dynamics:_,optionals:E,extract:R,rawParams:z,parsedParams:U};if(!(Z.skipOnParamError&&!zh(e,t,se))){p=se;break}}if(v.optional){const Z=j|1<<S,W=S+1;for(let Q=v.optional.length-1;Q>=0;Q--){const se=v.optional[Q];f.push({node:se,index:x,skipped:Z,depth:W,statics:C,dynamics:_,optionals:E,extract:R,rawParams:z,parsedParams:U})}if(!O)for(let Q=v.optional.length-1;Q>=0;Q--){const se=v.optional[Q],{prefix:me,suffix:ze}=se;if(me||ze){const je=se.caseSensitive?M:A??=M.toLowerCase();if(me&&!je.startsWith(me)||ze&&!je.endsWith(ze))continue}f.push({node:se,index:x+1,skipped:j,depth:W,statics:C,dynamics:_,optionals:E+1,extract:R,rawParams:z,parsedParams:U})}}if(!O&&v.dynamic&&M)for(let Z=v.dynamic.length-1;Z>=0;Z--){const W=v.dynamic[Z],{prefix:Q,suffix:se}=W;if(Q||se){const me=W.caseSensitive?M:A??=M.toLowerCase();if(Q&&!me.startsWith(Q)||se&&!me.endsWith(se))continue}f.push({node:W,index:x+1,skipped:j,depth:S+1,statics:C,dynamics:_+1,optionals:E,extract:R,rawParams:z,parsedParams:U})}if(!O&&v.staticInsensitive){const Z=v.staticInsensitive.get(A??=M.toLowerCase());Z&&f.push({node:Z,index:x+1,skipped:j,depth:S+1,statics:C+1,dynamics:_,optionals:E,extract:R,rawParams:z,parsedParams:U})}if(!O&&v.static){const Z=v.static.get(M);Z&&f.push({node:Z,index:x+1,skipped:j,depth:S+1,statics:C+1,dynamics:_,optionals:E,extract:R,rawParams:z,parsedParams:U})}if(v.pathless){const Z=S+1;for(let W=v.pathless.length-1;W>=0;W--){const Q=v.pathless[W];f.push({node:Q,index:x,skipped:j,depth:Z,statics:C,dynamics:_,optionals:E,extract:R,rawParams:z,parsedParams:U})}}}if(b&&p)return Lo(p,b)?b:p;if(b)return b;if(p)return p;if(a&&m){let y=m.index;for(let x=0;x<m.index;x++)y+=t[x].length;const v=y===e.length?"/":e.slice(y);return m.rawParams??=Object.create(null),m.rawParams["**"]=decodeURIComponent(v),m}return null}function zh(e,t,s){try{const[a,r]=rS(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 Lo(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===fa)>(e.node.kind===fa)||t.node.kind===fa==(e.node.kind===fa)&&t.depth>e.depth))):!0}function Xc(e){return Gm(e.filter(t=>t!==void 0).join("/"))}function Gm(e){return e.replace(/\/{2,}/g,"/")}function oS(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 lS(e){return Oi(oS(e))}function hu(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function pk(e,t,s){return hu(e,s)===hu(t,s)}function gk({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&&Yo(f)==="";)f.pop();const y=t.split("/");for(let v=0,x=y.length;v<x;v++){const j=y[v];j===""?v?v===x-1&&f.push(j):f=[j]:j===".."?f.pop():j==="."||f.push(j)}}f.length>1&&(Yo(f)===""?s==="never"&&f.pop():s==="always"&&f.push(""));let p,m="";for(let y=0;y<f.length;y++){y>0&&(m+="/");const v=f[y];if(!v)continue;p=Zm(v,0,p);const x=p[0];if(x===0){m+=v;continue}const j=p[5],S=v.substring(0,p[1]),C=v.substring(p[4],j),_=v.substring(p[2],p[3]);x===1?m+=S||C?`${S}{$${_}}${C}`:`$${_}`:x===2?m+=S||C?`${S}{$}${C}`:"$":m+=`${S}{-$${_}}${C}`}m=Gm(m);const b=m||"/";return d&&a&&a.set(d,b),b}function yk(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 Eh(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=>ab(r,s)).join("/"):ab(a,s)}function ib({path:e,params:t,decoder:s,...a}){let r=!1;const c=Object.create(null);if(!e||e==="/")return{interpolatedPath:"/",usedParams:c,isMissingParams:r};if(!e.includes("$"))return{interpolatedPath:e,usedParams:c,isMissingParams:r};const d=e.length;let f=0,p,m="";for(;f<d;){const b=f;p=Zm(e,b,p);const y=p[5];if(f=y+1,b===y)continue;const v=p[0];if(v===0){m+="/"+e.substring(b,y);continue}if(v===2){const x=t._splat;c._splat=x,c["*"]=x;const j=e.substring(b,p[1]),S=e.substring(p[4],y);if(!x){r=!0,(j||S)&&(m+="/"+j+S);continue}const C=Eh("_splat",t,s);m+="/"+j+C+S;continue}if(v===1){const x=e.substring(p[2],p[3]);!r&&!(x in t)&&(r=!0),c[x]=t[x];const j=e.substring(b,p[1]),S=e.substring(p[4],y),C=Eh(x,t,s)??"undefined";m+="/"+j+C+S;continue}if(v===3){const x=e.substring(p[2],p[3]),j=t[x];if(j==null)continue;c[x]=j;const S=e.substring(b,p[1]),C=e.substring(p[4],y),_=Eh(x,t,s)??"";m+="/"+S+_+C;continue}}return e.endsWith("/")&&(m+="/"),{usedParams:c,interpolatedPath:m||"/",isMissingParams:r}}function ab(e,t){const s=encodeURIComponent(e);return t?.(s)??s}function un(e){return!!e?.isNotFound}function vk(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}var lm="tsr-scroll-restoration-v1_3",bk=(e,t)=>{let s;return(...a)=>{s||(s=setTimeout(()=>{e(...a),s=null},t))}};function xk(){const e=vk();if(!e)return null;const t=e.getItem(lm);let s=t?JSON.parse(t):{};return{state:s,set:a=>{s=_i(a,s)||s;try{e.setItem(lm,JSON.stringify(s))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}var Dc=xk(),Sk=e=>e.state.__TSR_key||e.href;function wk(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 mu=!1;function jk({storageKey:e,key:t,behavior:s,shouldScrollRestoration:a,scrollToTopSelectors:r,location:c}){let d;try{d=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(m){console.error(m);return}const f=t||window.history.state?.__TSR_key,p=d[f];mu=!0;e:{if(a&&p&&Object.keys(p).length>0){for(const y in p){const v=p[y];if(y==="window")window.scrollTo({top:v.scrollY,left:v.scrollX,behavior:s});else if(y){const x=document.querySelector(y);x&&(x.scrollLeft=v.scrollX,x.scrollTop=v.scrollY)}}break e}const m=(c??window.location).hash.split("#",2)[1];if(m){const y=window.history.state?.__hashScrollIntoViewOptions??!0;if(y){const v=document.getElementById(m);v&&v.scrollIntoView(y)}break e}const b={top:0,left:0,behavior:s};if(window.scrollTo(b),r)for(const y of r){if(y==="window")continue;const v=typeof y=="function"?y():document.querySelector(y);v&&v.scrollTo(b)}}mu=!1}function Nk(e,t){if(!Dc||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!Dc))return;e.isScrollRestorationSetup=!0,mu=!1;const s=e.options.getScrollRestorationKey||Sk;window.history.scrollRestoration="manual";const a=r=>{if(mu||!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=wk(r.target)}const d=s(e.state.location);Dc.set(f=>{const p=f[d]||={},m=p[c]||={};if(c==="window")m.scrollX=window.scrollX||0,m.scrollY=window.scrollY||0;else if(c){const b=document.querySelector(c);b&&(m.scrollX=b.scrollLeft||0,m.scrollY=b.scrollTop||0)}return f})};typeof document<"u"&&document.addEventListener("scroll",bk(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})||(jk({storageKey:lm,key:c,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&Dc.set(d=>(d[c]||={},d)))})}function Ck(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 _k(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 Rh(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function kk(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]=Rh(r):Array.isArray(c)?c.push(Rh(r)):s[a]=[c,Rh(r)]}return s}var zk=Rk(JSON.parse),Ek=Ok(JSON.stringify,JSON.parse);function Rk(e){return t=>{t[0]==="?"&&(t=t.substring(1));const s=kk(t);for(const a in s){const r=s[a];if(typeof r=="string")try{s[a]=e(r)}catch{}}return s}}function Ok(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=_k(r,a);return c?`?${c}`:""}}var ya="__root__";function Km(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 Ak(e){return{input:({url:t})=>{for(const s of e)t=cm(s,t);return t},output:({url:t})=>{for(let s=e.length-1;s>=0;s--)t=cS(e[s],t);return t}}}function Tk(e){const t=lS(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=Xc(["/",t,d.pathname]),d)}}function cm(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 cS(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 yt=(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))(yt||{});function uS({update:e,notify:t,unwatched:s}){return{link:a,unlink:r,propagate:c,checkDirty:d,shallowPropagate:f};function a(m,b,y){const v=b.depsTail;if(v!==void 0&&v.dep===m)return;const x=v!==void 0?v.nextDep:b.deps;if(x!==void 0&&x.dep===m){x.version=y,b.depsTail=x;return}const j=m.subsTail;if(j!==void 0&&j.version===y&&j.sub===b)return;const S=b.depsTail=m.subsTail={version:y,dep:m,sub:b,prevDep:v,nextDep:x,prevSub:j,nextSub:void 0};x!==void 0&&(x.prevDep=S),v!==void 0?v.nextDep=S:b.deps=S,j!==void 0?j.nextSub=S:m.subs=S}function r(m,b=m.sub){const y=m.dep,v=m.prevDep,x=m.nextDep,j=m.nextSub,S=m.prevSub;return x!==void 0?x.prevDep=v:b.depsTail=v,v!==void 0?v.nextDep=x:b.deps=x,j!==void 0?j.prevSub=S:y.subsTail=S,S!==void 0?S.nextSub=j:(y.subs=j)===void 0&&s(y),x}function c(m){let b=m.nextSub,y;e:do{const v=m.sub;let x=v.flags;if(x&60?x&12?x&4?!(x&48)&&p(m,v)?(v.flags=x|40,x&=1):x=0:v.flags=x&-9|32:x=0:v.flags=x|32,x&2&&t(v),x&1){const j=v.subs;if(j!==void 0){const S=(m=j).nextSub;S!==void 0&&(y={value:b,prev:y},b=S);continue}}if((m=b)!==void 0){b=m.nextSub;continue}for(;y!==void 0;)if(m=y.value,y=y.prev,m!==void 0){b=m.nextSub;continue e}break}while(!0)}function d(m,b){let y,v=0,x=!1;e:do{const j=m.dep,S=j.flags;if(b.flags&16)x=!0;else if((S&17)===17){if(e(j)){const C=j.subs;C.nextSub!==void 0&&f(C),x=!0}}else if((S&33)===33){(m.nextSub!==void 0||m.prevSub!==void 0)&&(y={value:m,prev:y}),m=j.deps,b=j,++v;continue}if(!x){const C=m.nextDep;if(C!==void 0){m=C;continue}}for(;v--;){const C=b.subs,_=C.nextSub!==void 0;if(_?(m=y.value,y=y.prev):m=C,x){if(e(b)){_&&f(C),b=m.sub;continue}x=!1}else b.flags&=-33;b=m.sub;const E=m.nextDep;if(E!==void 0){m=E;continue e}}return x}while(!0)}function f(m){do{const b=m.sub,y=b.flags;(y&48)===32&&(b.flags=y|16,(y&6)===2&&t(b))}while((m=m.nextSub)!==void 0)}function p(m,b){let y=b.depsTail;for(;y!==void 0;){if(y===m)return!0;y=y.prevDep}return!1}}let Vm=0,oa=0,Ho=0;const Bs=[],{link:w3,unlink:dS,propagate:j3,checkDirty:Dk,shallowPropagate:N3}=uS({update(e){return e.depsTail!==void 0?Pk(e):$k(e)},notify(e){let t=Ho,s=t;do if(Bs[t++]=e,e.flags&=-3,e=e.subs?.sub,e===void 0||!(e.flags&2))break;while(!0);for(Ho=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,Au(e)):qk.call(e)}});function Lk(){return Vm}function Mk(){++Vm}function Uk(){--Vm||Bk()}function Pk(e){e.depsTail=void 0,e.flags=5;try{const t=e.value;return t!==(e.value=e.getter(t))}finally{e.flags&=-5,Au(e)}}function $k(e){return e.flags=1,e.currentValue!==(e.currentValue=e.pendingValue)}function Ik(e){const t=e.flags;if(t&16||t&32&&Dk(e.deps,e)){e.depsTail=void 0,e.flags=6;try{e.fn()}finally{e.flags&=-5,Au(e)}}else e.flags=2}function Bk(){try{for(;oa<Ho;){const e=Bs[oa];Bs[oa++]=void 0,Ik(e)}}finally{for(;oa<Ho;){const e=Bs[oa];Bs[oa++]=void 0,e.flags|=10}oa=0,Ho=0}}function qk(){this.depsTail=void 0,this.flags=0,Au(this);const e=this.subs;e!==void 0&&dS(e)}function Au(e){const t=e.depsTail;let s=t!==void 0?t.nextDep:e.deps;for(;s!==void 0;)s=dS(s,e)}function Qm(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 um=[];let Wc=0;const{link:rb,unlink:Hk,propagate:Zk,checkDirty:fS,shallowPropagate:ob}=uS({update(e){return e._update()},notify(e){um[dm++]=e,e.flags&=~yt.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=yt.Mutable|yt.Dirty,pu(e))}});let Lc=0,dm=0,gs;function pu(e){const t=e.depsTail;let s=t!==void 0?t.nextDep:e.deps;for(;s!==void 0;)s=Hk(s,e)}function hS(){if(!(Lk()>0)){for(;Lc<dm;){const e=um[Lc];um[Lc++]=void 0,e.notify()}Lc=0,dm=0}}function mS(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?yt.None:yt.Mutable,get(){return gs!==void 0&&rb(r,gs,Wc),r._snapshot},subscribe(c){const d=Qm(c),f={current:!1},p=Fk(()=>{r.get(),f.current?d.next?.(r._snapshot):f.current=!0});return{unsubscribe:()=>{p.stop()}}},_update(c){const d=gs,f=Object.is;if(s)gs=r,++Wc,r.depsTail=void 0;else if(c===void 0)return!1;s&&(r.flags=yt.Mutable|yt.RecursedCheck);try{const p=r._snapshot,m=typeof c=="function"?c(p):c===void 0&&s?a(p):c;return p===void 0||!f(p,m)?(r._snapshot=m,!0):!1}finally{gs=d,s&&(r.flags&=~yt.RecursedCheck),pu(r)}}};return s?(r.flags=yt.Mutable|yt.Dirty,r.get=function(){const c=r.flags;if(c&yt.Dirty||c&yt.Pending&&fS(r.deps,r)){if(r._update()){const d=r.subs;d!==void 0&&ob(d)}}else c&yt.Pending&&(r.flags=c&~yt.Pending);return gs!==void 0&&rb(r,gs,Wc),r._snapshot}):r.set=function(c){if(r._update(c)){const d=r.subs;d!==void 0&&(Zk(d),ob(d),hS())}},r}function Fk(e){const t=()=>{const a=gs;gs=s,++Wc,s.depsTail=void 0,s.flags=yt.Watching|yt.RecursedCheck;try{return e()}finally{gs=a,s.flags&=~yt.RecursedCheck,pu(s)}},s={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:yt.Watching|yt.RecursedCheck,notify(){const a=this.flags;a&yt.Dirty||a&yt.Pending&&fS(this.deps,this)?t():this.flags=yt.Watching},stop(){this.flags=yt.None,this.depsTail=void 0,pu(this)}};return t(),s}class Gk{constructor(t){this.atom=mS(t)}setState(t){this.atom.set(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(Qm(t))}}class Kk{constructor(t){this.atom=mS(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(Qm(t))}}function Vk(e){return typeof e=="function"?new Kk(e):new Gk(e)}function Qk(e){try{Mk(),e()}finally{Uk(),hS()}}function Zo(e){let t;return Qk(()=>{t=e()}),t}var fm=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},Tu=(e,t)=>!!(e.preload&&!e.router.state.matches.some(s=>s.id===t)),va=(e,t,s=!0)=>{const a={...e.router.options.context??{}},r=s?t:t-1;for(let c=0;c<=r;c++){const d=e.matches[c];if(!d)continue;const f=e.router.getMatch(d.id);f&&Object.assign(a,f.__routeContext,f.__beforeLoadContext)}return a},lb=(e,t)=>{if(!e.matches.length)return;const s=t.routeId,a=e.matches.findIndex(d=>d.routeId===e.router.routeTree.id),r=a>=0?a:0;let c=s?e.matches.findIndex(d=>d.routeId===s):e.firstBadMatchIndex??e.matches.length-1;c<0&&(c=r);for(let d=c;d>=0;d--){const f=e.matches[d];if(e.router.looseRoutesById[f.routeId].options.notFoundComponent)return d}return s?c:r},ki=(e,t,s)=>{if(!(!vn(s)&&!un(s)))throw vn(s)&&s.redirectHandled&&!s.options.reloadDocument||(t&&(t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=s,e.updateMatch(t.id,a=>({...a,status:vn(s)?"redirected":a.status==="pending"?"success":a.status,context:va(e,t.index),isFetching:!1,error:s})),un(s)&&!s.routeId&&(s.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),vn(s)&&(e.rendered=!0,s.options._fromLocation=e.location,s.redirectHandled=!0,s=e.router.resolveRedirect(s))),s},pS=(e,t)=>{const s=e.router.getMatch(t);return!!(!s||s._nonReactive.dehydrated)},cb=(e,t,s)=>{const a=va(e,s);e.updateMatch(t,r=>({...r,context:a}))},Mo=(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)},gS=(e,t,s,a)=>{if(a._nonReactive.pendingTimeout!==void 0)return;const r=s.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!Tu(e,t)&&(s.options.loader||s.options.beforeLoad||vS(s))&&typeof r=="number"&&r!==1/0&&(s.options.pendingComponent??e.router.options?.defaultPendingComponent)){const c=setTimeout(()=>{fm(e)},r);a._nonReactive.pendingTimeout=c}},Yk=(e,t,s)=>{const a=e.router.getMatch(t);if(!a._nonReactive.beforeLoadPromise&&!a._nonReactive.loaderPromise)return;gS(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()},Jk=(e,t,s,a)=>{const r=e.router.getMatch(t);let c=r._nonReactive.loadPromise;r._nonReactive.loadPromise=Rr(()=>{c?.resolve(),c=void 0});const{paramsError:d,searchError:f}=r;d&&Mo(e,s,d,"PARSE_PARAMS"),f&&Mo(e,s,f,"VALIDATE_SEARCH"),gS(e,t,a,r);const p=new AbortController;let m=!1;const b=()=>{m||(m=!0,e.updateMatch(t,z=>({...z,isFetching:"beforeLoad",fetchCount:z.fetchCount+1,abortController:p})))},y=()=>{r._nonReactive.beforeLoadPromise?.resolve(),r._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,z=>({...z,isFetching:!1}))};if(!a.options.beforeLoad){Zo(()=>{b(),y()});return}r._nonReactive.beforeLoadPromise=Rr();const v={...va(e,s,!1),...r.__routeContext},{search:x,params:j,cause:S}=r,C=Tu(e,t),_={search:x,abortController:p,params:j,preload:C,context:v,location:e.location,navigate:z=>e.router.navigate({...z,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:C?"preload":S,matches:e.matches,routeId:a.id,...e.router.options.additionalContext},E=z=>{if(z===void 0){Zo(()=>{b(),y()});return}(vn(z)||un(z))&&(b(),Mo(e,s,z,"BEFORE_LOAD")),Zo(()=>{b(),e.updateMatch(t,U=>({...U,__beforeLoadContext:z})),y()})};let R;try{if(R=a.options.beforeLoad(_),Jo(R))return b(),R.catch(z=>{Mo(e,s,z,"BEFORE_LOAD")}).then(E)}catch(z){b(),Mo(e,s,z,"BEFORE_LOAD")}E(R)},Xk=(e,t)=>{const{id:s,routeId:a}=e.matches[t],r=e.router.looseRoutesById[a],c=()=>f(),d=()=>Jk(e,s,t,r),f=()=>{if(pS(e,s))return;const p=Yk(e,s,r);return Jo(p)?p.then(d):d()};return c()},Wk=(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}))},yS=(e,t,s,a,r)=>{const c=t[a-1],{params:d,loaderDeps:f,abortController:p,cause:m}=e.router.getMatch(s),b=va(e,a),y=Tu(e,s);return{params:d,deps:f,preload:!!y,parentMatchPromise:c,abortController:p,context:b,location:e.location,navigate:v=>e.router.navigate({...v,_fromLocation:e.location}),cause:y?"preload":m,route:r,...e.router.options.additionalContext}},ub=async(e,t,s,a,r)=>{try{const c=e.router.getMatch(s);try{(!(J_??e.router.isServer)||c.ssr===!0)&&Xo(r);const d=r.options.loader,f=typeof d=="function"?d:d?.handler,p=f?.(yS(e,t,s,a,r)),m=!!f&&Jo(p);if((m||r._lazyPromise||r._componentsPromise||r.options.head||r.options.scripts||r.options.headers||c._nonReactive.minPendingPromise)&&e.updateMatch(s,y=>({...y,isFetching:"loader"})),f){const y=m?await p:p;ki(e,e.router.getMatch(s),y),y!==void 0&&e.updateMatch(s,v=>({...v,loaderData:y}))}r._lazyPromise&&await r._lazyPromise;const b=c._nonReactive.minPendingPromise;b&&await b,r._componentsPromise&&await r._componentsPromise,e.updateMatch(s,y=>({...y,error:void 0,context:va(e,a),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(d){let f=d;if(f?.name==="AbortError"){if(c.abortController.signal.aborted){c._nonReactive.loaderPromise?.resolve(),c._nonReactive.loaderPromise=void 0;return}e.updateMatch(s,m=>({...m,status:m.status==="pending"?"success":m.status,isFetching:!1,context:va(e,a)}));return}const p=c._nonReactive.minPendingPromise;p&&await p,un(d)&&await r.options.notFoundComponent?.preload?.(),ki(e,e.router.getMatch(s),d);try{r.options.onError?.(d)}catch(m){f=m,ki(e,e.router.getMatch(s),m)}!vn(f)&&!un(f)&&await Xo(r,["errorComponent"]),e.updateMatch(s,m=>({...m,error:f,context:va(e,a),status:"error",isFetching:!1}))}}catch(c){const d=e.router.getMatch(s);d&&(d._nonReactive.loaderPromise=void 0),ki(e,d,c)}},ez=async(e,t,s)=>{async function a(x,j,S,C,_){const E=Date.now()-j.updatedAt,R=x?_.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:_.options.staleTime??e.router.options.defaultStaleTime??0,z=_.options.shouldReload,U=typeof z=="function"?z(yS(e,t,r,s,_)):z,{status:O,invalid:M}=C,A=E>R&&(!!e.forceStaleReload||C.cause==="enter"||S!==void 0&&S!==C.id);d=O==="success"&&(M||(U??A)),x&&_.options.preload===!1||(d&&!e.sync&&b?(f=!0,(async()=>{try{await ub(e,t,r,s,_);const Z=e.router.getMatch(r);Z._nonReactive.loaderPromise?.resolve(),Z._nonReactive.loadPromise?.resolve(),Z._nonReactive.loaderPromise=void 0,Z._nonReactive.loadPromise=void 0}catch(Z){vn(Z)&&await e.router.navigate(Z.options)}})()):O!=="success"||d?await ub(e,t,r,s,_):cb(e,r,s))}const{id:r,routeId:c}=e.matches[s];let d=!1,f=!1;const p=e.router.looseRoutesById[c],m=p.options.loader,b=((typeof m=="function"?void 0:m?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!=="blocking";if(pS(e,r)){if(!e.router.getMatch(r))return e.matches[s];cb(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(C=>C.routeId===c)?.id,S=Tu(e,r);if(x._nonReactive.loaderPromise){if(x.status==="success"&&!e.sync&&!x.preload&&b)return x;await x._nonReactive.loaderPromise;const C=e.router.getMatch(r),_=C._nonReactive.error||C.error;_&&ki(e,C,_),C.status==="pending"&&await a(S,x,j,C,p)}else{const C=S&&!e.router.state.matches.some(E=>E.id===r),_=e.router.getMatch(r);_._nonReactive.loaderPromise=Rr(),C!==_.preload&&e.updateMatch(r,E=>({...E,preload:C})),await a(S,x,j,_,p)}}const y=e.router.getMatch(r);f||(y._nonReactive.loaderPromise?.resolve(),y._nonReactive.loadPromise?.resolve(),y._nonReactive.loadPromise=void 0),clearTimeout(y._nonReactive.pendingTimeout),y._nonReactive.pendingTimeout=void 0,f||(y._nonReactive.loaderPromise=void 0),y._nonReactive.dehydrated=void 0;const v=f?y.isFetching:!1;return v!==y.isFetching||y.invalid!==!1?(e.updateMatch(r,x=>({...x,isFetching:v,invalid:!1})),e.router.getMatch(r)):y};async function db(e){const t=e,s=[];t.router.state.matches.some(v=>v._forcePending)&&fm(t);let a;for(let v=0;v<t.matches.length;v++){try{const x=Xk(t,v);Jo(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?lb(t,a):void 0,d=a&&t.preload?0:c!==void 0?Math.min(c+1,r):r;let f,p;for(let v=0;v<d;v++)s.push(ez(t,s,v));try{await Promise.all(s)}catch{const v=await Promise.allSettled(s);for(const x of v){if(x.status!=="rejected")continue;const j=x.reason;if(vn(j))throw j;un(j)?f??=j:p??=j}if(p!==void 0)throw p}const m=f??(a&&!t.preload?a:void 0);let b=t.serialError?t.firstBadMatchIndex??0:t.matches.length-1;if(!m&&a&&t.preload)return t.matches;if(m){const v=lb(t,m);Li(v!==void 0);const x=t.matches[v],j=t.router.looseRoutesById[x.routeId],S=t.router.options?.defaultNotFoundComponent;!j.options.notFoundComponent&&S&&(j.options.notFoundComponent=S),m.routeId=x.routeId;const C=x.routeId===t.router.routeTree.id;t.updateMatch(x.id,_=>({..._,...C?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:m},isFetching:!1})),b=v,await Xo(j,["notFoundComponent"])}else if(!t.preload){const v=t.matches[0];v.globalNotFound||t.router.getMatch(v.id)?.globalNotFound&&t.updateMatch(v.id,x=>({...x,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){const v=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await Xo(v,["errorComponent"])}for(let v=0;v<=b;v++){const{id:x,routeId:j}=t.matches[v],S=t.router.looseRoutesById[j];try{const C=Wk(t,x,S);if(C){const _=await C;t.updateMatch(x,E=>({...E,..._}))}}catch(C){console.error(`Error executing head for route ${j}:`,C)}}const y=fm(t);if(Jo(y)&&await y,m)throw m;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function fb(e,t){const s=t.map(a=>e.options[a]?.preload?.()).filter(Boolean);if(s.length!==0)return Promise.all(s)}function Xo(e,t=eu){!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===eu?(()=>{if(e._componentsPromise===void 0){const a=fb(e,eu);a?e._componentsPromise=a.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():fb(e,t);return e._lazyPromise?e._lazyPromise.then(s):s()}function vS(e){for(const t of eu)if(e.options[t]?.preload)return!0;return!1}var eu=["component","errorComponent","pendingComponent","notFoundComponent"],Ai="__TSR_index",hb="popstate",mb="beforeunload";function tz(e){let t=e.getLocation();const s=new Set,a=d=>{t=e.getLocation(),s.forEach(f=>f({location:t,action:d}))},r=d=>{e.notifyOnIndexChange??!0?a(d):t=e.getLocation()},c=async({task:d,navigateOpts:f,...p})=>{if(f?.ignoreBlocker??!1){d();return}const m=e.getBlockers?.()??[],b=p.type==="PUSH"||p.type==="REPLACE";if(typeof document<"u"&&m.length&&b)for(const y of m){const v=gu(p.path,p.state);if(await y.blockerFn({currentLocation:t,nextLocation:v,action:p.type})){e.onBlocked?.();return}}d()};return{get location(){return t},get length(){return e.getLength()},subscribers:s,subscribe:d=>(s.add(d),()=>{s.delete(d)}),push:(d,f,p)=>{const m=t.state[Ai];f=pb(m+1,f),c({task:()=>{e.pushState(d,f),a({type:"PUSH"})},navigateOpts:p,type:"PUSH",path:d,state:f})},replace:(d,f,p)=>{const m=t.state[Ai];f=pb(m,f),c({task:()=>{e.replaceState(d,f),a({type:"REPLACE"})},navigateOpts:p,type:"REPLACE",path:d,state:f})},go:(d,f)=>{c({task:()=>{e.go(d),r({type:"GO",index:d})},navigateOpts:f,type:"GO"})},back:d=>{c({task:()=>{e.back(d?.ignoreBlocker??!1),r({type:"BACK"})},navigateOpts:d,type:"BACK"})},forward:d=>{c({task:()=>{e.forward(d?.ignoreBlocker??!1),r({type:"FORWARD"})},navigateOpts:d,type:"FORWARD"})},canGoBack:()=>t.state[Ai]!==0,createHref:d=>e.createHref(d),block:d=>{if(!e.setBlockers)return()=>{};const f=e.getBlockers?.()??[];return e.setBlockers([...f,d]),()=>{const p=e.getBlockers?.()??[];e.setBlockers?.(p.filter(m=>m!==d))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:a}}function pb(e,t){t||(t={});const s=Ym();return{...t,key:s,__TSR_key:s,[Ai]:e}}function nz(e){const t=typeof document<"u"?window:void 0,s=t.history.pushState,a=t.history.replaceState;let r=[];const c=()=>r,d=A=>r=A,f=(A=>A),p=(()=>gu(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const A=Ym();t.history.replaceState({[Ai]:0,key:A,__TSR_key:A},"")}let m=p(),b,y=!1,v=!1,x=!1,j=!1;const S=()=>m;let C,_;const E=()=>{C&&(M._ignoreSubscribers=!0,(C.isPush?t.history.pushState:t.history.replaceState)(C.state,"",C.href),M._ignoreSubscribers=!1,C=void 0,_=void 0,b=void 0)},R=(A,Z,W)=>{const Q=f(Z);_||(b=m),m=gu(Z,W),C={href:Q,state:W,isPush:C?.isPush||A==="push"},_||(_=Promise.resolve().then(()=>E()))},z=A=>{m=p(),M.notify({type:A})},U=async()=>{if(v){v=!1;return}const A=p(),Z=A.state[Ai]-m.state[Ai],W=Z===1,Q=Z===-1,se=!W&&!Q||y;y=!1;const me=se?"GO":Q?"BACK":"FORWARD",ze=se?{type:"GO",index:Z}:{type:Q?"BACK":"FORWARD"};if(x)x=!1;else{const je=c();if(typeof document<"u"&&je.length){for(const B of je)if(await B.blockerFn({currentLocation:m,nextLocation:A,action:me})){v=!0,t.history.go(1),M.notify(ze);return}}}m=p(),M.notify(ze)},O=A=>{if(j){j=!1;return}let Z=!1;const W=c();if(typeof document<"u"&&W.length)for(const Q of W){const se=Q.enableBeforeUnload??!0;if(se===!0){Z=!0;break}if(typeof se=="function"&&se()===!0){Z=!0;break}}if(Z)return A.preventDefault(),A.returnValue=""},M=tz({getLocation:S,getLength:()=>t.history.length,pushState:(A,Z)=>R("push",A,Z),replaceState:(A,Z)=>R("replace",A,Z),back:A=>(A&&(x=!0),j=!0,t.history.back()),forward:A=>{A&&(x=!0),j=!0,t.history.forward()},go:A=>{y=!0,t.history.go(A)},createHref:A=>f(A),flush:E,destroy:()=>{t.history.pushState=s,t.history.replaceState=a,t.removeEventListener(mb,O,{capture:!0}),t.removeEventListener(hb,U)},onBlocked:()=>{b&&m!==b&&(m=b)},getBlockers:c,setBlockers:d,notifyOnIndexChange:!1});return t.addEventListener(mb,O,{capture:!0}),t.addEventListener(hb,U),t.history.pushState=function(...A){const Z=s.apply(t.history,A);return M._ignoreSubscribers||z("PUSH"),Z},t.history.replaceState=function(...A){const Z=a.apply(t.history,A);return M._ignoreSubscribers||z("REPLACE"),Z},M}function sz(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function gu(e,t){const s=sz(e),a=s.indexOf("#"),r=s.indexOf("?"),c=Ym();return{href:s,pathname:s.substring(0,a>0?r>0?Math.min(a,r):a:r>0?r:s.length),hash:a>-1?s.substring(a):"",search:r>-1?s.slice(r,a===-1?void 0:a):"",state:t||{[Ai]:0,key:c,__TSR_key:c}}}function Ym(){return(Math.random()+1).toString(36).substring(7)}function ba(e){const t=e.resolvedLocation,s=e.location;return{fromLocation:t,toLocation:s,pathChanged:t?.pathname!==s.pathname,hrefChanged:t?.href!==s.href,hashChanged:t?.hash!==s.hash}}function iz(e){const t=e.filter(s=>s.status!=="redirected");return t.length===e.length?e:t}var az=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=yk(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=nz()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let m;this.resolvePathCache=fu(1e3),m=this.buildRouteTree(),this.setRoutes(m)}!this.__store&&this.latestLocation&&(this.__store=Vk(oz(this.latestLocation)),Nk(this));let d=!1;const f=this.options.basepath??"/",p=this.options.rewrite;if(r||a!==f||c!==p){this.basepath=f;const m=[],b=lS(f);b&&b!=="/"&&m.push(Tk({basepath:f})),p&&m.push(p),this.rewrite=m.length===0?void 0:m.length===1?m[0]:Ak(m),this.history&&this.updateLatestLocation(),d=!0}d&&this.__store&&this.__store.setState(m=>({...m,location:this.latestLocation})),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const t=dk(this.routeTree,this.options.caseSensitive,(s,a)=>{s.init({originalIndex:a})});return this.options.routeMasks&&rk(this.options.routeMasks,t.processedTree),t},this.subscribe=(t,s)=>{const a={eventType:t,fn:s};return this.subscribers.add(a),()=>{this.subscribers.delete(a)}},this.emit=t=>{this.subscribers.forEach(s=>{s.eventType===t.type&&s.fn(t)})},this.parseLocation=(t,s)=>{const a=({pathname:f,search:p,hash:m,href:b,state:y})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(f)){const C=this.options.parseSearch(p),_=this.options.stringifySearch(C);return{href:f+_+m,publicHref:b,pathname:Do(f).path,external:!1,searchStr:_,search:ra(s?.search,C),hash:Do(m.slice(1)).path,state:da(s?.state,y)}}const v=new URL(b,this.origin),x=cm(this.rewrite,v),j=this.options.parseSearch(x.search),S=this.options.stringifySearch(j);return x.search=S,{href:x.href.replace(x.origin,""),publicHref:b,pathname:Do(x.pathname).path,external:!!this.rewrite&&x.origin!==this.origin,searchStr:S,search:ra(s?.search,j),hash:Do(x.hash.slice(1)).path,state:da(s?.state,y)}},r=a(t),{__tempLocation:c,__tempKey:d}=r.state;if(c&&(!d||d===this.tempLocationKey)){const f=a(c);return f.state.key=r.state.key,f.state.__TSR_key=r.state.__TSR_key,delete f.state.__tempLocation,{...f,maskedLocation:r}}return r},this.resolvePathWithBase=(t,s)=>gk({base:t,to:Gm(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=>lz({pathname:t,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=t=>{const s=this.getMatch(t);s&&(s.abortController.abort(),clearTimeout(s._nonReactive.pendingTimeout),s._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const t=this.state.matches.filter(a=>a.status==="pending"),s=this.state.matches.filter(a=>a.isFetching==="loader");new Set([...this.state.pendingMatches??[],...t,...s]).forEach(a=>{this.cancelMatch(a.id)})},this.buildLocation=t=>{const s=(r={})=>{const c=r._fromLocation||this.pendingBuiltLocation||this.latestLocation,d=this.matchRoutesLightweight(c);r.from;const f=r.unsafeRelative==="path"?c.pathname:r.from??d.fullPath,p=this.resolvePathWithBase(f,"."),m=d.search,b=Object.assign(Object.create(null),d.params),y=r.to?this.resolvePathWithBase(p,`${r.to}`):this.resolvePathWithBase(p,"."),v=r.params===!1||r.params===null?Object.create(null):(r.params??!0)===!0?b:Object.assign(b,_i(r.params,b)),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(v).length>0)for(const Z of j){const W=Z.options.params?.stringify??Z.options.stringifyParams;if(W)try{Object.assign(v,W(v))}catch{}}const S=t.leaveParams?y:Do(ib({path:y,params:v,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let C=m;if(t._includeValidateSearch&&this.options.search?.strict){const Z={};j.forEach(W=>{if(W.options.validateSearch)try{Object.assign(Z,tu(W.options.validateSearch,{...Z,...C}))}catch{}}),C=Z}C=cz({search:C,dest:r,destRoutes:j,_includeValidateSearch:t._includeValidateSearch}),C=ra(m,C);const _=this.options.stringifySearch(C),E=r.hash===!0?c.hash:r.hash?_i(r.hash,c.hash):void 0,R=E?`#${E}`:"";let z=r.state===!0?c.state:r.state?_i(r.state,c.state):{};z=da(c.state,z);const U=`${S}${_}${R}`;let O,M,A=!1;if(this.rewrite){const Z=new URL(U,this.origin),W=cS(this.rewrite,Z);O=Z.href.replace(Z.origin,""),W.origin!==this.origin?(M=W.href,A=!0):M=W.pathname+W.search+W.hash}else O=sk(U),M=O;return{publicHref:M,href:O,pathname:S,search:C,searchStr:_,state:z,hash:E??"",external:A,unmaskOnReload:r.unmaskOnReload}},a=(r={},c)=>{const d=s(r);let f=c?s(c):void 0;if(!f){const p=Object.create(null);if(this.options.routeMasks){const m=ok(d.pathname,this.processedTree);if(m){Object.assign(p,m.rawParams);const{from:b,params:y,...v}=m.route,x=y===!1||y===null?Object.create(null):(y??!0)===!0?p:Object.assign(p,_i(y,p));c={from:t.from,...v,params:x},f=s(c)}}}return f&&(d.maskedLocation=f),d};return t.mask?a(t,{from:t.from,...t.mask}):a(t)},this.commitLocation=async({viewTransition:t,ignoreBlocker:s,...a})=>{const r=()=>{const f=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];f.forEach(m=>{a.state[m]=this.latestLocation.state[m]});const p=ga(a.state,this.latestLocation.state);return f.forEach(m=>{delete a.state[m]}),p},c=Oi(this.latestLocation.href)===Oi(a.href);let d=this.commitLocationPromise;if(this.commitLocationPromise=Rr(()=>{d?.resolve(),d=void 0}),c&&r())this.load();else{let{maskedLocation:f,hashScrollIntoView:p,...m}=a;f&&(m={...f,state:{...f.state,__tempKey:void 0,__tempLocation:{...m,search:m.searchStr,state:{...m.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(m.unmaskOnReload??this.options.unmaskOnReload??!1)&&(m.state.__tempKey=this.tempLocationKey)),m.state.__hashScrollIntoViewOptions=p??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=t,this.history[a.replace?"replace":"push"](m.publicHref,m.state,{ignoreBlocker:s})}return this.resetNextScroll=a.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:t,resetScroll:s,hashScrollIntoView:a,viewTransition:r,ignoreBlocker:c,href:d,...f}={})=>{if(d){const b=this.history.location.state.__TSR_index,y=gu(d,{__TSR_index:t?b:b+1}),v=new URL(y.pathname,this.origin);f.to=cm(this.rewrite,v).pathname,f.search=this.options.parseSearch(y.search),f.hash=y.hash.slice(1)}const p=this.buildLocation({...f,_includeValidateSearch:!0});this.pendingBuiltLocation=p;const m=this.commitLocation({...p,viewTransition:r,replace:t,resetScroll:s,hashScrollIntoView:a,ignoreBlocker:c});return Promise.resolve().then(()=>{this.pendingBuiltLocation===p&&(this.pendingBuiltLocation=void 0)}),m},this.navigate=async({to:t,reloadDocument:s,href:a,publicHref:r,...c})=>{let d=!1;if(a)try{new URL(`${a}`),d=!0}catch{}if(d&&!s&&(s=!0),s){if(t!==void 0||!a){const p=this.buildLocation({to:t,...c});a=a??p.publicHref,r=r??p.publicHref}const f=!d&&r?r:a;if(du(f,this.protocolAllowlist))return Promise.resolve();if(!c.ignoreBlocker){const p=this.history.getBlockers?.()??[];for(const m of p)if(m?.blockerFn&&await m.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return c.replace?window.location.replace(f):window.location.href=f,Promise.resolve()}return this.buildAndCommitLocation({...c,href:a,to:t,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const t=this.matchRoutes(this.latestLocation);this.__store.setState(s=>({...s,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:t,cachedMatches:s.cachedMatches.filter(a=>!t.some(r=>r.id===a.id))}))},this.load=async t=>{let s,a,r;const c=this.state.resolvedLocation??this.state.location;for(r=new Promise(f=>{this.startTransition(async()=>{try{this.beforeLoad();const p=this.latestLocation,m=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...ba({resolvedLocation:m,location:p})}),this.emit({type:"onBeforeLoad",...ba({resolvedLocation:m,location:p})}),await db({router:this,sync:t?.sync,forceStaleReload:c.href===p.href,matches:this.state.pendingMatches,location:p,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let b=[],y=[],v=[],x=[];Zo(()=>{this.__store.setState(j=>{const S=j.matches,C=j.pendingMatches||j.matches;return b=S.filter(_=>!C.some(E=>E.id===_.id)),y=S.filter(_=>!C.some(E=>E.routeId===_.routeId)),v=C.filter(_=>!S.some(E=>E.routeId===_.routeId)),x=C.filter(_=>S.some(E=>E.routeId===_.routeId)),{...j,isLoading:!1,loadedAt:Date.now(),matches:C,pendingMatches:void 0,cachedMatches:[...j.cachedMatches,...b.filter(_=>_.status!=="error"&&_.status!=="notFound"&&_.status!=="redirected")]}}),this.clearExpiredCache()}),[[y,"onLeave"],[v,"onEnter"],[x,"onStay"]].forEach(([j,S])=>{j.forEach(C=>{this.looseRoutesById[C.routeId].options[S]?.(C)})})})})}})}catch(p){vn(p)?(s=p,this.navigate({...s.options,replace:!0,ignoreBlocker:!0})):un(p)&&(a=p),this.__store.setState(m=>({...m,statusCode:s?s.status:a?404:m.matches.some(b=>b.status==="error")?500:200,redirect:s}))}this.latestLoadPromise===r&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),f()})}),this.latestLoadPromise=r,await r;this.latestLoadPromise&&r!==this.latestLoadPromise;)await this.latestLoadPromise;let d;this.hasNotFoundMatch()?d=404:this.__store.state.matches.some(f=>f.status==="error")&&(d=500),d!==void 0&&this.__store.setState(f=>({...f,statusCode:d}))},this.startViewTransition=t=>{const s=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,s&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let a;if(typeof s=="object"&&this.isViewTransitionTypesSupported){const r=this.latestLocation,c=this.state.resolvedLocation,d=typeof s.types=="function"?s.types(ba({resolvedLocation:c,location:r})):s.types;if(d===!1){t();return}a={update:t,types:d}}else a=t;document.startViewTransition(a)}else t()},this.updateMatch=(t,s)=>{this.startTransition(()=>{const a=this.state.pendingMatches?.some(r=>r.id===t)?"pendingMatches":this.state.matches.some(r=>r.id===t)?"matches":this.state.cachedMatches.some(r=>r.id===t)?"cachedMatches":"";a&&(a==="cachedMatches"?this.__store.setState(r=>({...r,cachedMatches:iz(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&&du(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=Xo,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)]);Zo(()=>{a.forEach(d=>{c.has(d.id)||this.__store.setState(f=>({...f,cachedMatches:[...f.cachedMatches,d]}))})});try{return a=await db({router:this,matches:a,location:s,preload:!0,updateMatch:(d,f)=>{r.has(d)?a=a.map(p=>p.id===d?f(p):p):this.updateMatch(d,f)}}),a}catch(d){if(vn(d))return d.options.reloadDocument?void 0:await this.preloadRoute({...d.options,_fromLocation:s});un(d)||console.error(d);return}},this.matchRoute=(t,s)=>{const a={...t,to:t.to?this.resolvePathWithBase(t.from||"",t.to):void 0,params:t.params||{},leaveParams:!0},r=this.buildLocation(a);if(s?.pending&&this.state.status!=="pending")return!1;const c=(s?.pending===void 0?!this.state.isLoading:s.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,d=lk(r.pathname,s?.caseSensitive??!1,s?.fuzzy??!1,c.pathname,this.processedTree);return!d||t.params&&!ga(d.rawParams,t.params,{partial:!0})?!1:s?.includeSearch??!0?ga(c.search,r.search,{partial:!0})?d.rawParams:!1:d.rawParams},this.hasNotFoundMatch=()=>this.__store.state.matches.some(t=>t.status==="notFound"||t.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??"fuzzy",stringifySearch:e.stringifySearch??Ek,parseSearch:e.parseSearch??zk,protocolAllowlist:e.protocolAllowlist??nk}),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 p=f?dz(this.options.notFoundMode,d):void 0,m=new Array(d.length),b=new Map(this.state.matches.map(y=>[y.routeId,y]));for(let y=0;y<d.length;y++){const v=d[y],x=m[y-1];let j,S,C;{const me=x?.search??e.search,ze=x?._strictSearch??void 0;try{const je=tu(v.options.validateSearch,{...me})??void 0;j={...me,...je},S={...ze,...je},C=void 0}catch(je){let B=je;if(je instanceof yu||(B=new yu(je.message,{cause:je})),t?.throwOnError)throw B;j=me,S={},C=B}}const _=v.options.loaderDeps?.({search:j})??"",E=_?JSON.stringify(_):"",{interpolatedPath:R,usedParams:z}=ib({path:v.fullPath,params:r,decoder:this.pathParamsDecoder,server:this.isServer}),U=v.id+R+E,O=this.getMatch(U),M=b.get(v.id),A=O?._strictParams??z;let Z;if(!O)try{gb(v,z,c,A)}catch(me){if(un(me)||vn(me)?Z=me:Z=new rz(me.message,{cause:me}),t?.throwOnError)throw Z}Object.assign(r,A);const W=M?"stay":"enter";let Q;if(O)Q={...O,cause:W,params:M?.params??r,_strictParams:A,search:ra(M?M.search:O.search,j),_strictSearch:S};else{const me=v.options.loader||v.options.beforeLoad||v.lazyFn||vS(v)?"pending":"success";Q={id:U,ssr:v.options.ssr,index:y,routeId:v.id,params:M?.params??r,_strictParams:A,pathname:R,updatedAt:Date.now(),search:M?ra(M.search,j):j,_strictSearch:S,searchError:void 0,status:me,isFetching:!1,error:void 0,paramsError:Z,__routeContext:void 0,_nonReactive:{loadPromise:Rr()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:W,loaderDeps:M?da(M.loaderDeps,_):_,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:v.options.staticData||{},fullPath:v.fullPath}}t?.preload||(Q.globalNotFound=p===v.id),Q.searchError=C;const se=this.getParentContext(x);Q.context={...se,...Q.__routeContext,...Q.__beforeLoadContext},m[y]=Q}for(let y=0;y<m.length;y++){const v=m[y],x=this.looseRoutesById[v.routeId],j=this.getMatch(v.id),S=b.get(v.routeId);if(v.params=S?ra(S.params,r):r,!j){const C=m[y-1],_=this.getParentContext(C);if(x.options.context){const E={deps:v.loaderDeps,params:v.params,context:_??{},location:e,navigate:R=>this.navigate({...R,_fromLocation:e}),buildLocation:this.buildLocation,cause:v.cause,abortController:v.abortController,preload:!!v.preload,matches:m,routeId:x.id};v.__routeContext=x.options.context(E)??void 0}v.context={..._,...v.__routeContext,...v.__beforeLoadContext}}}return m}matchRoutesLightweight(e){const{matchedRoutes:t,routeParams:s,parsedParams:a}=this.getMatchedRoutes(e.pathname),r=Yo(t),c={...e.search};for(const m of t)try{Object.assign(c,tu(m.options.validateSearch,c))}catch{}const d=Yo(this.state.matches),f=d&&d.routeId===r.id&&e.pathname===this.state.location.pathname;let p;if(f)p=d.params;else{const m=Object.assign(Object.create(null),s);for(const b of t)try{gb(b,s,a??{},m)}catch{}p=m}return{matchedRoutes:t,fullPath:r.fullPath,search:c,params:p}}},yu=class extends Error{},rz=class extends Error{};function oz(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function tu(e,t){if(e==null)return{};if("~standard"in e){const s=e["~standard"].validate(t);if(s instanceof Promise)throw new yu("Async validation not supported");if(s.issues)throw new yu(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 lz({pathname:e,routesById:t,processedTree:s}){const a=Object.create(null),r=Oi(e);let c,d;const f=ck(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 cz({search:e,dest:t,destRoutes:s,_includeValidateSearch:a}){return uz(s)(e,t,a??!1)}function uz(e){const t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const r of e){if("search"in r.options)r.options.search?.middlewares&&t.middlewares.push(...r.options.search.middlewares);else if(r.options.preSearchFilters||r.options.postSearchFilters){const c=({search:d,next:f})=>{let p=d;"preSearchFilters"in r.options&&r.options.preSearchFilters&&(p=r.options.preSearchFilters.reduce((b,y)=>y(b),d));const m=f(p);return"postSearchFilters"in r.options&&r.options.postSearchFilters?r.options.postSearchFilters.reduce((b,y)=>y(b),m):m};t.middlewares.push(c)}if(r.options.validateSearch){const c=({search:d,next:f})=>{const p=f(d);if(!t._includeValidateSearch)return p;try{return{...p,...tu(r.options.validateSearch,p)??void 0}}catch{return p}};t.middlewares.push(c)}}const s=({search:r})=>{const c=t.dest;return c.search?c.search===!0?r:_i(c.search,r):{}};t.middlewares.push(s);const a=(r,c,d)=>{if(r>=d.length)return c;const f=d[r];return f({search:c,next:m=>a(r+1,m,d)})};return function(c,d,f){return t.dest=d,t._includeValidateSearch=f,a(0,c,t.middlewares)}}function dz(e,t){if(e!=="root")for(let s=t.length-1;s>=0;s--){const a=t[s];if(a.children)return a.id}return ya}function gb(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 fz="Error preloading route! ☝️",bS=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=t=>{this.originalIndex=t.originalIndex;const s=this.options,a=!s?.path&&!s?.id;this.parentRoute=this.options.getParentRoute?.(),a?this._path=ya:this.parentRoute||Li(!1);let r=a?ya:s?.path;r&&r!=="/"&&(r=oS(r));const c=s?.id||r;let d=a?ya:Xc([this.parentRoute.id==="__root__"?"":this.parentRoute.id,c]);r==="__root__"&&(r="/"),d!=="__root__"&&(d=Xc(["/",d]));const f=d==="__root__"?"/":Xc([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=>Km({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.")}},hz=class extends bS{constructor(e){super(e)}};function Jm(e){const t=e.errorComponent??Xm;return l.jsx(mz,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:s,reset:a})=>s?N.createElement(t,{error:s,reset:a}):e.children})}var mz=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 Xm({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 pz({children:e,fallback:t=null}){return xS()?l.jsx(ns.Fragment,{children:e}):l.jsx(ns.Fragment,{children:t})}function xS(){return ns.useSyncExternalStore(gz,()=>!0,()=>!1)}function gz(){return()=>{}}var SS=N.createContext(null);function Gn(e){const t=N.useContext(SS);return e?.warn,t}var Oh={exports:{}},Ah={},Th={exports:{}},Dh={};var yb;function yz(){if(yb)return Dh;yb=1;var e=rl();function t(y,v){return y===v&&(y!==0||1/y===1/v)||y!==y&&v!==v}var s=typeof Object.is=="function"?Object.is:t,a=e.useState,r=e.useEffect,c=e.useLayoutEffect,d=e.useDebugValue;function f(y,v){var x=v(),j=a({inst:{value:x,getSnapshot:v}}),S=j[0].inst,C=j[1];return c(function(){S.value=x,S.getSnapshot=v,p(S)&&C({inst:S})},[y,x,v]),r(function(){return p(S)&&C({inst:S}),y(function(){p(S)&&C({inst:S})})},[y]),d(x),x}function p(y){var v=y.getSnapshot;y=y.value;try{var x=v();return!s(y,x)}catch{return!0}}function m(y,v){return v()}var b=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?m:f;return Dh.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:b,Dh}var vb;function vz(){return vb||(vb=1,Th.exports=yz()),Th.exports}var bb;function bz(){if(bb)return Ah;bb=1;var e=rl(),t=vz();function s(m,b){return m===b&&(m!==0||1/m===1/b)||m!==m&&b!==b}var a=typeof Object.is=="function"?Object.is:s,r=t.useSyncExternalStore,c=e.useRef,d=e.useEffect,f=e.useMemo,p=e.useDebugValue;return Ah.useSyncExternalStoreWithSelector=function(m,b,y,v,x){var j=c(null);if(j.current===null){var S={hasValue:!1,value:null};j.current=S}else S=j.current;j=f(function(){function _(O){if(!E){if(E=!0,R=O,O=v(O),x!==void 0&&S.hasValue){var M=S.value;if(x(M,O))return z=M}return z=O}if(M=z,a(R,O))return M;var A=v(O);return x!==void 0&&x(M,A)?(R=O,M):(R=O,z=A)}var E=!1,R,z,U=y===void 0?null:y;return[function(){return _(b())},U===null?void 0:function(){return _(U())}]},[b,y,v,x]);var C=r(m,j[0],j[1]);return d(function(){S.hasValue=!0,S.value=C},[C]),p(C),C},Ah}var xb;function xz(){return xb||(xb=1,Oh.exports=bz()),Oh.exports}var Sz=xz();function wz(e,t){return e===t}function jz(e,t,s=wz){const a=N.useCallback(d=>{if(!e)return()=>{};const{unsubscribe:f}=e.subscribe(d);return f},[e]),r=N.useCallback(()=>e?.get(),[e]);return Sz.useSyncExternalStoreWithSelector(a,r,r,t,s)}function bn(e){const t=Gn({warn:e?.router===void 0}),s=e?.router||t,a=N.useRef(void 0);return jz(s.__store,r=>{if(e?.select){if(e.structuralSharing??s.options.defaultStructuralSharing){const c=da(a.current,e.select(r));return a.current=c,c}return e.select(r)}return r})}var Du=N.createContext(void 0),Nz=N.createContext(void 0);function Pi(e){const t=N.useContext(e.from?Nz:Du);return bn({select:s=>{const a=s.matches.find(r=>e.from?e.from===r.routeId:r.id===t);if(Li(!((e.shouldThrow??!0)&&!a),`Could not find ${e.from?`an active match from "${e.from}"`:"a nearest match!"}`),a!==void 0)return e.select?e.select(a):a},structuralSharing:e.structuralSharing})}function Wm(e){return Pi({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function ep(e){const{select:t,...s}=e;return Pi({...s,select:a=>t?t(a.loaderDeps):a.loaderDeps})}function Lu(e){return Pi({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 Mu(e){return Pi({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function ja(e){const t=Gn();return N.useCallback(s=>t.navigate({...s,from:s.from??e?.from}),[e?.from,t])}function tp(e){return Pi({...e,select:t=>e.select?e.select(t.context):t.context})}var np=Bx();const Cz=Ix(np);function _z(e,t){const s=Gn(),a=Y_(t),{activeProps:r,inactiveProps:c,activeOptions:d,to:f,preload:p,preloadDelay:m,hashScrollIntoView:b,replace:y,startTransition:v,resetScroll:x,viewTransition:j,children:S,target:C,disabled:_,style:E,className:R,onClick:z,onBlur:U,onFocus:O,onMouseEnter:M,onMouseLeave:A,onTouchStart:Z,ignoreBlocker:W,params:Q,search:se,hash:me,state:ze,mask:je,reloadDocument:B,unsafeRelative:T,from:ae,_fromLocation:pe,...te}=e,L=xS(),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}),ie=e.from,re=N.useMemo(()=>({...e,from:ie}),[s,G,ie,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),ce=N.useMemo(()=>s.buildLocation({...re}),[s,re]),he=ce.maskedLocation?ce.maskedLocation.publicHref:ce.publicHref,de=ce.maskedLocation?ce.maskedLocation.external:ce.external,Ge=N.useMemo(()=>Az(he,de,s.history,_),[_,de,he,s.history]),ge=N.useMemo(()=>{if(Ge?.external)return du(Ge.href,s.protocolAllowlist)?void 0:Ge.href;if(!Tz(f)&&!(typeof f!="string"||f.indexOf(":")===-1))try{return new URL(f),du(f,s.protocolAllowlist)?void 0:f}catch{}},[f,Ge,s.protocolAllowlist]),Xe=bn({select:ke=>{if(ge)return!1;if(d?.exact){if(!pk(ke.location.pathname,ce.pathname,s.basepath))return!1}else{const Te=hu(ke.location.pathname,s.basepath),zt=hu(ce.pathname,s.basepath);if(!(Te.startsWith(zt)&&(Te.length===zt.length||Te[zt.length]==="/")))return!1}return(d?.includeSearch??!0)&&!ga(ke.location.search,ce.search,{partial:!d?.exact,ignoreUndefined:!d?.explicitUndefined})?!1:d?.includeHash?L&&ke.location.hash===ce.hash:!0}}),mt=Xe?_i(r,{})??kz:Lh,fe=Xe?Lh:_i(c,{})??Lh,Je=[R,mt.className,fe.className].filter(Boolean).join(" "),dt=(E||mt.style||fe.style)&&{...E,...mt.style,...fe.style},[Wt,_t]=N.useState(!1),nn=N.useRef(!1),Kt=e.reloadDocument||ge?!1:p??s.options.defaultPreload,kt=m??s.options.defaultPreloadDelay??0,wt=N.useCallback(()=>{s.preloadRoute({...re,_builtLocation:ce}).catch(ke=>{console.warn(ke),console.warn(fz)})},[s,re,ce]);Q_(a,N.useCallback(ke=>{ke?.isIntersecting&&wt()},[wt]),Oz,{disabled:!!_||Kt!=="viewport"}),N.useEffect(()=>{nn.current||!_&&Kt==="render"&&(wt(),nn.current=!0)},[_,wt,Kt]);const sn=ke=>{const Te=ke.currentTarget.getAttribute("target"),zt=C!==void 0?C:Te;if(!_&&!Dz(ke)&&!ke.defaultPrevented&&(!zt||zt==="_self")&&ke.button===0){ke.preventDefault(),np.flushSync(()=>{_t(!0)});const Qn=s.subscribe("onResolved",()=>{Qn(),_t(!1)});s.navigate({...re,replace:y,resetScroll:x,hashScrollIntoView:b,startTransition:v,viewTransition:j,ignoreBlocker:W})}};if(ge)return{...te,ref:a,href:ge,...S&&{children:S},...C&&{target:C},..._&&{disabled:_},...E&&{style:E},...R&&{className:R},...z&&{onClick:z},...U&&{onBlur:U},...O&&{onFocus:O},...M&&{onMouseEnter:M},...A&&{onMouseLeave:A},...Z&&{onTouchStart:Z}};const oe=ke=>{if(_||Kt!=="intent")return;if(!kt){wt();return}const Te=ke.currentTarget;if(Uo.has(Te))return;const zt=setTimeout(()=>{Uo.delete(Te),wt()},kt);Uo.set(Te,zt)},Ue=ke=>{_||Kt!=="intent"||wt()},Pe=ke=>{if(_||!Kt||!kt)return;const Te=ke.currentTarget,zt=Uo.get(Te);zt&&(clearTimeout(zt),Uo.delete(Te))};return{...te,...mt,...fe,href:Ge?.href,ref:a,onClick:fr([z,sn]),onBlur:fr([U,Pe]),onFocus:fr([O,oe]),onMouseEnter:fr([M,oe]),onMouseLeave:fr([A,Pe]),onTouchStart:fr([Z,Ue]),disabled:!!_,target:C,...dt&&{style:dt},...Je&&{className:Je},..._&&zz,...Xe&&Ez,...L&&Wt&&Rz}}var Lh={},kz={className:"active"},zz={role:"link","aria-disabled":!0},Ez={"data-status":"active","aria-current":"page"},Rz={"data-transitioning":"transitioning"},Uo=new WeakMap,Oz={rootMargin:"100px"},fr=e=>t=>{for(const s of e)if(s){if(t.defaultPrevented)return;s(t)}};function Az(e,t,s,a){if(!a)return t?{href:e,external:!0}:{href:s.createHref(e)||"/",external:!1}}function Tz(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var gt=N.forwardRef((e,t)=>{const{_asChild:s,...a}=e,{type:r,...c}=_z(a,t),d=typeof a.children=="function"?a.children({isActive:c["data-status"]==="active"}):a.children;if(!s){const{disabled:f,...p}=c;return N.createElement("a",p,d)}return N.createElement(s,c,d)});function Dz(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var Lz=class extends bS{constructor(e){super(e),this.useMatch=t=>Pi({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>tp({...t,from:this.id}),this.useSearch=t=>Mu({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>Lu({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>ep({...t,from:this.id}),this.useLoaderData=t=>Wm({...t,from:this.id}),this.useNavigate=()=>ja({from:this.fullPath}),this.Link=ns.forwardRef((t,s)=>l.jsx(gt,{ref:s,from:this.fullPath,...t})),this.$$typeof=Symbol.for("react.memo")}};function is(e){return new Lz(e)}function Mz(){return e=>Pz(e)}var Uz=class extends hz{constructor(e){super(e),this.useMatch=t=>Pi({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>tp({...t,from:this.id}),this.useSearch=t=>Mu({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>Lu({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>ep({...t,from:this.id}),this.useLoaderData=t=>Wm({...t,from:this.id}),this.useNavigate=()=>ja({from:this.fullPath}),this.Link=ns.forwardRef((t,s)=>l.jsx(gt,{ref:s,from:this.fullPath,...t})),this.$$typeof=Symbol.for("react.memo")}};function Pz(e){return new Uz(e)}function Sb(e){return typeof e=="object"?new wb(e,{silent:!0}).createRoute(e):new wb(e,{silent:!0}).createRoute}var wb=class{constructor(e,t){this.path=e,this.createRoute=s=>{const a=is(s);return a.isRoot=!1,a},this.silent=t?.silent}},jb=class{constructor(e){this.useMatch=t=>Pi({select:t?.select,from:this.options.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>tp({...t,from:this.options.id}),this.useSearch=t=>Mu({select:t?.select,structuralSharing:t?.structuralSharing,from:this.options.id}),this.useParams=t=>Lu({select:t?.select,structuralSharing:t?.structuralSharing,from:this.options.id}),this.useLoaderDeps=t=>ep({...t,from:this.options.id}),this.useLoaderData=t=>Wm({...t,from:this.options.id}),this.useNavigate=()=>ja({from:Gn().routesById[this.options.id].fullPath}),this.options=e,this.$$typeof=Symbol.for("react.memo")}};function Nb(e){return typeof e=="object"?new jb(e):t=>new jb({id:e,...t})}function $z(e){const t=bn({select:s=>`not-found-${s.location.pathname}-${s.status}`});return l.jsx(Jm,{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 Iz(){return l.jsx("p",{children:"Not Found"})}function vr(e){return l.jsx(l.Fragment,{children:e.children})}function wS(e,t,s){return t.options.notFoundComponent?l.jsx(t.options.notFoundComponent,{...s}):e.options.defaultNotFoundComponent?l.jsx(e.options.defaultNotFoundComponent,{...s}):l.jsx(Iz,{})}function Bz(){return Gn().isScrollRestoring,null}var jS=N.memo(function({matchId:t}){const s=Gn(),a=bn({select:j=>{const S=j.matches.findIndex(_=>_.id===t),C=j.matches[S];return Li(C),{routeId:C.routeId,ssr:C.ssr,_displayPending:C._displayPending,resetKey:j.loadedAt,parentRouteId:j.matches[S-1]?.routeId}},structuralSharing:!0}),r=s.routesById[a.routeId],c=r.options.pendingComponent??s.options.defaultPendingComponent,d=c?l.jsx(c,{}):null,f=r.options.errorComponent??s.options.defaultErrorComponent,p=r.options.onCatch??s.options.defaultOnCatch,m=r.isRoot?r.options.notFoundComponent??s.options.notFoundRoute?.options.component:r.options.notFoundComponent,b=a.ssr===!1||a.ssr==="data-only",y=(!r.isRoot||r.options.wrapInSuspense||b)&&(r.options.wrapInSuspense??c??(r.options.errorComponent?.preload||b))?N.Suspense:vr,v=f?Jm:vr,x=m?$z:vr;return l.jsxs(r.isRoot?r.options.shellComponent??vr:vr,{children:[l.jsx(Du.Provider,{value:t,children:l.jsx(y,{fallback:d,children:l.jsx(v,{getResetKey:()=>a.resetKey,errorComponent:f||Xm,onCatch:(j,S)=>{if(un(j))throw j;p?.(j,S)},children:l.jsx(x,{fallback:j=>{if(!m||j.routeId&&j.routeId!==a.routeId||!j.routeId&&!r.isRoot)throw j;return N.createElement(m,j)},children:b||a._displayPending?l.jsx(pz,{fallback:d,children:l.jsx(Cb,{matchId:t})}):l.jsx(Cb,{matchId:t})})})})}),a.parentRouteId===ya&&s.options.scrollRestoration?l.jsxs(l.Fragment,{children:[l.jsx(qz,{}),l.jsx(Bz,{})]}):null]})});function qz(){const e=Gn(),t=N.useRef(void 0);return l.jsx("script",{suppressHydrationWarning:!0,ref:s=>{s&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...ba(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}var Cb=N.memo(function({matchId:t}){const s=Gn(),{match:a,key:r,routeId:c}=bn({select:p=>{const m=p.matches.find(v=>v.id===t),b=m.routeId,y=(s.routesById[b].options.remountDeps??s.options.defaultRemountDeps)?.({routeId:b,loaderDeps:m.loaderDeps,params:m._strictParams,search:m._strictSearch});return{key:y?JSON.stringify(y):void 0,routeId:b,match:{id:m.id,status:m.status,error:m.error,_forcePending:m._forcePending,_displayPending:m._displayPending}}},structuralSharing:!0}),d=s.routesById[c],f=N.useMemo(()=>{const p=d.options.component??s.options.defaultComponent;return p?l.jsx(p,{},r):l.jsx(sp,{})},[r,d.options.component,s.options.defaultComponent]);if(a._displayPending)throw s.getMatch(a.id)?._nonReactive.displayPendingPromise;if(a._forcePending)throw s.getMatch(a.id)?._nonReactive.minPendingPromise;if(a.status==="pending"){const p=d.options.pendingMinMs??s.options.defaultPendingMinMs;if(p){const m=s.getMatch(a.id);if(m&&!m._nonReactive.minPendingPromise){const b=Rr();m._nonReactive.minPendingPromise=b,setTimeout(()=>{b.resolve(),m._nonReactive.minPendingPromise=void 0},p)}}throw s.getMatch(a.id)?._nonReactive.loadPromise}if(a.status==="notFound")return Li(un(a.error)),wS(s,d,a.error);if(a.status==="redirected")throw Li(vn(a.error)),s.getMatch(a.id)?._nonReactive.loadPromise;if(a.status==="error")throw a.error;return f}),sp=N.memo(function(){const t=Gn(),s=N.useContext(Du),a=bn({select:m=>m.matches.find(b=>b.id===s)?.routeId}),r=t.routesById[a],c=bn({select:m=>{const b=m.matches.find(y=>y.id===s);return Li(b),b.globalNotFound}}),d=bn({select:m=>{const b=m.matches;return b[b.findIndex(y=>y.id===s)+1]?.id}}),f=t.options.defaultPendingComponent?l.jsx(t.options.defaultPendingComponent,{}):null;if(c)return wS(t,r,void 0);if(!d)return null;const p=l.jsx(jS,{matchId:d});return a===ya?l.jsx(N.Suspense,{fallback:f,children:p}):p});function Hz(){const e=Gn(),t=N.useRef({router:e,mounted:!1}),[s,a]=N.useState(!1),{hasPendingMatches:r,isLoading:c}=bn({select:y=>({isLoading:y.isLoading,hasPendingMatches:y.matches.some(v=>v.status==="pending")}),structuralSharing:!0}),d=Ch(c),f=c||s||r,p=Ch(f),m=c||r,b=Ch(m);return e.startTransition=y=>{a(!0),N.startTransition(()=>{y(),a(!1)})},N.useEffect(()=>{const y=e.history.subscribe(e.load),v=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Oi(e.latestLocation.publicHref)!==Oi(v.publicHref)&&e.commitLocation({...v,replace:!0}),()=>{y()}},[e,e.history]),Tc(()=>{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(v){console.error(v)}})()},[e]),Tc(()=>{d&&!c&&e.emit({type:"onLoad",...ba(e.state)})},[d,e,c]),Tc(()=>{b&&!m&&e.emit({type:"onBeforeRouteMount",...ba(e.state)})},[m,b,e]),Tc(()=>{if(p&&!f){const y=ba(e.state);e.emit({type:"onResolved",...y}),e.__store.setState(v=>({...v,status:"idle",resolvedLocation:v.location})),y.hrefChanged&&Ck(e)}},[f,p,e]),null}function Zz(){const e=Gn(),t=e.routesById[ya].options.pendingComponent??e.options.defaultPendingComponent,s=t?l.jsx(t,{}):null,a=l.jsxs(typeof document<"u"&&e.ssr?vr:N.Suspense,{fallback:s,children:[l.jsx(Hz,{}),l.jsx(Fz,{})]});return e.options.InnerWrap?l.jsx(e.options.InnerWrap,{children:a}):a}function Fz(){const e=Gn(),t=bn({select:r=>r.matches[0]?.id}),s=bn({select:r=>r.loadedAt}),a=t?l.jsx(jS,{matchId:t}):null;return l.jsx(Du.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?a:l.jsx(Jm,{getResetKey:()=>s,errorComponent:Xm,onCatch:void 0,children:a})})}var Gz=e=>new Kz(e),Kz=class extends az{constructor(e){super(e)}};typeof globalThis<"u"?(globalThis.createFileRoute=Sb,globalThis.createLazyFileRoute=Nb):typeof window<"u"&&(window.createFileRoute=Sb,window.createLazyFileRoute=Nb);function Vz({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(SS.Provider,{value:e,children:t});return e.options.Wrap?l.jsx(e.options.Wrap,{children:a}):a}function Qz({router:e,...t}){return l.jsx(Vz,{router:e,...t,children:l.jsx(Zz,{})})}function Yz(e){return bn({select:t=>t.location})}let zi=[],Jz=0;const hm=new Set;function NS(){const e=[...zi];for(const t of hm)t(e)}function Xz(e,t="negative",s=6e3){const a=String(++Jz),r={id:a,message:e,tone:t,expiresAt:Date.now()+s};return zi=[...zi,r],NS(),setTimeout(()=>{CS(a)},s),a}function CS(e){const t=zi.length;zi=zi.filter(s=>s.id!==e),zi.length!==t&&NS()}function Wz(e){return hm.add(e),()=>{hm.delete(e)}}function _b(){return zi}function e2(){return new q_({defaultOptions:{queries:{staleTime:3e4,retry:1,refetchOnWindowFocus:!1}},mutationCache:new Qx({onError:e=>{Xz(e instanceof Error?e.message:"An unexpected error occurred","negative")}})})}const t2=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),n2=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,s,a)=>a?a.toUpperCase():s.toLowerCase()),kb=e=>{const t=n2(e);return t.charAt(0).toUpperCase()+t.slice(1)},_S=(...e)=>e.filter((t,s,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===s).join(" ").trim(),s2=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var i2={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 a2=N.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:s=2,absoluteStrokeWidth:a,className:r="",children:c,iconNode:d,...f},p)=>N.createElement("svg",{ref:p,...i2,width:t,height:t,stroke:e,strokeWidth:a?Number(s)*24/Number(t):s,className:_S("lucide",r),...!c&&!s2(f)&&{"aria-hidden":"true"},...f},[...d.map(([m,b])=>N.createElement(m,b)),...Array.isArray(c)?c:[c]]));const On=(e,t)=>{const s=N.forwardRef(({className:a,...r},c)=>N.createElement(a2,{ref:c,iconNode:t,className:_S(`lucide-${t2(kb(e))}`,`lucide-${e}`,a),...r}));return s.displayName=kb(e),s};const r2=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Uu=On("chevron-right",r2);const o2=[["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"}]],l2=On("download",o2);const c2=[["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"}]],u2=On("globe",c2);const d2=[["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"}]],f2=On("layout-dashboard",d2);const h2=[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]],m2=On("menu",h2);const p2=[["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"}]],g2=On("play",p2);const y2=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],zb=On("plus",y2);const v2=[["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"}]],b2=On("rocket",v2);const x2=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],S2=On("rotate-ccw",x2);const w2=[["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"}]],j2=On("settings",w2);const N2=[["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"}]],C2=On("trash-2",N2);const _2=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],k2=On("triangle-alert",_2);const z2=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Pu=On("x",z2);function E2(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 $u(e){return e.split("-").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function br(e){if(!e)return"—";try{return new Date(e).toLocaleString()}catch{return e}}function Eb(e){return e===null?"Unknown":e?"Pass":"Fail"}function mm(e){return e===0?"12:00 AM":e<12?`${e}:00 AM`:e===12?"12:00 PM":`${e-12}:00 PM`}function R2(e,t){return e==="twice-daily"?"twice-daily":e.startsWith("weekly@")?`${e}@${t}`:`daily@${t}`}function O2(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 A2(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 ${mm(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 ${mm(f)} · ${a}`}return`${e} · ${a}`}function Rb(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ip(...e){return t=>{let s=!1;const a=e.map(r=>{const c=Rb(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():Rb(e[r],null)}}}}function Na(...e){return N.useCallback(ip(...e),e)}var T2=Symbol.for("react.lazy"),vu=Um[" use ".trim().toString()];function D2(e){return typeof e=="object"&&e!==null&&"then"in e}function kS(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===T2&&"_payload"in e&&D2(e._payload)}function L2(e){const t=U2(e),s=N.forwardRef((a,r)=>{let{children:c,...d}=a;kS(c)&&typeof vu=="function"&&(c=vu(c._payload));const f=N.Children.toArray(c),p=f.find($2);if(p){const m=p.props.children,b=f.map(y=>y===p?N.Children.count(m)>1?N.Children.only(null):N.isValidElement(m)?m.props.children:null:y);return l.jsx(t,{...d,ref:r,children:N.isValidElement(m)?N.cloneElement(m,void 0,b):null})}return l.jsx(t,{...d,ref:r,children:c})});return s.displayName=`${e}.Slot`,s}var M2=L2("Slot");function U2(e){const t=N.forwardRef((s,a)=>{let{children:r,...c}=s;if(kS(r)&&typeof vu=="function"&&(r=vu(r._payload)),N.isValidElement(r)){const d=B2(r),f=I2(c,r.props);return r.type!==N.Fragment&&(f.ref=a?ip(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 P2=Symbol("radix.slottable");function $2(e){return N.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===P2}function I2(e,t){const s={...t};for(const a in t){const r=e[a],c=t[a];/^on[A-Z]/.test(a)?r&&c?s[a]=(...f)=>{const p=c(...f);return r(...f),p}:r&&(s[a]=r):a==="style"?s[a]={...r,...c}:a==="className"&&(s[a]=[r,c].filter(Boolean).join(" "))}return{...e,...s}}function B2(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 zS(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=zS(e[t]))&&(a&&(a+=" "),a+=s)}else for(s in e)e[s]&&(a&&(a+=" "),a+=s);return a}function ES(){for(var e,t,s=0,a="",r=arguments.length;s<r;s++)(e=arguments[s])&&(t=zS(e))&&(a&&(a+=" "),a+=t);return a}const Ob=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Ab=ES,RS=(e,t)=>s=>{var a;if(t?.variants==null)return Ab(e,s?.class,s?.className);const{variants:r,defaultVariants:c}=t,d=Object.keys(r).map(m=>{const b=s?.[m],y=c?.[m];if(b===null)return null;const v=Ob(b)||Ob(y);return r[m][v]}),f=s&&Object.entries(s).reduce((m,b)=>{let[y,v]=b;return v===void 0||(m[y]=v),m},{}),p=t==null||(a=t.compoundVariants)===null||a===void 0?void 0:a.reduce((m,b)=>{let{class:y,className:v,...x}=b;return Object.entries(x).every(j=>{let[S,C]=j;return Array.isArray(C)?C.includes({...c,...f}[S]):{...c,...f}[S]===C})?[...m,y,v]:m},[]);return Ab(e,d,p,s?.class,s?.className)},q2=(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},H2=(e,t)=>({classGroupId:e,validator:t}),OS=(e=new Map,t=null,s)=>({nextPart:e,validators:t,classGroupId:s}),bu="-",Tb=[],Z2="arbitrary..",F2=e=>{const t=K2(e),{conflictingClassGroups:s,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:d=>{if(d.startsWith("[")&&d.endsWith("]"))return G2(d);const f=d.split(bu),p=f[0]===""&&f.length>1?1:0;return AS(f,p,t)},getConflictingClassGroupIds:(d,f)=>{if(f){const p=a[d],m=s[d];return p?m?q2(m,p):p:m||Tb}return s[d]||Tb}}},AS=(e,t,s)=>{if(e.length-t===0)return s.classGroupId;const r=e[t],c=s.nextPart.get(r);if(c){const m=AS(e,t+1,c);if(m)return m}const d=s.validators;if(d===null)return;const f=t===0?e.join(bu):e.slice(t).join(bu),p=d.length;for(let m=0;m<p;m++){const b=d[m];if(b.validator(f))return b.classGroupId}},G2=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?Z2+a:void 0})(),K2=e=>{const{theme:t,classGroups:s}=e;return V2(s,t)},V2=(e,t)=>{const s=OS();for(const a in e){const r=e[a];ap(r,s,a,t)}return s},ap=(e,t,s,a)=>{const r=e.length;for(let c=0;c<r;c++){const d=e[c];Q2(d,t,s,a)}},Q2=(e,t,s,a)=>{if(typeof e=="string"){Y2(e,t,s);return}if(typeof e=="function"){J2(e,t,s,a);return}X2(e,t,s,a)},Y2=(e,t,s)=>{const a=e===""?t:TS(t,e);a.classGroupId=s},J2=(e,t,s,a)=>{if(W2(e)){ap(e(a),t,s,a);return}t.validators===null&&(t.validators=[]),t.validators.push(H2(s,e))},X2=(e,t,s,a)=>{const r=Object.entries(e),c=r.length;for(let d=0;d<c;d++){const[f,p]=r[d];ap(p,TS(t,f),s,a)}},TS=(e,t)=>{let s=e;const a=t.split(bu),r=a.length;for(let c=0;c<r;c++){const d=a[c];let f=s.nextPart.get(d);f||(f=OS(),s.nextPart.set(d,f)),s=f}return s},W2=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,eE=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)}}},pm="!",Db=":",tE=[],Lb=(e,t,s,a,r)=>({modifiers:e,hasImportantModifier:t,baseClassName:s,maybePostfixModifierPosition:a,isExternal:r}),nE=e=>{const{prefix:t,experimentalParseClassName:s}=e;let a=r=>{const c=[];let d=0,f=0,p=0,m;const b=r.length;for(let S=0;S<b;S++){const C=r[S];if(d===0&&f===0){if(C===Db){c.push(r.slice(p,S)),p=S+1;continue}if(C==="/"){m=S;continue}}C==="["?d++:C==="]"?d--:C==="("?f++:C===")"&&f--}const y=c.length===0?r:r.slice(p);let v=y,x=!1;y.endsWith(pm)?(v=y.slice(0,-1),x=!0):y.startsWith(pm)&&(v=y.slice(1),x=!0);const j=m&&m>p?m-p:void 0;return Lb(c,x,v,j)};if(t){const r=t+Db,c=a;a=d=>d.startsWith(r)?c(d.slice(r.length)):Lb(tE,!1,d,void 0,!0)}if(s){const r=a;a=c=>s({className:c,parseClassName:r})}return a},sE=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((s,a)=>{t.set(s,1e6+a)}),s=>{const a=[];let r=[];for(let c=0;c<s.length;c++){const d=s[c],f=d[0]==="[",p=t.has(d);f||p?(r.length>0&&(r.sort(),a.push(...r),r=[]),a.push(d)):r.push(d)}return r.length>0&&(r.sort(),a.push(...r)),a}},iE=e=>({cache:eE(e.cacheSize),parseClassName:nE(e),sortModifiers:sE(e),...F2(e)}),aE=/\s+/,rE=(e,t)=>{const{parseClassName:s,getClassGroupId:a,getConflictingClassGroupIds:r,sortModifiers:c}=t,d=[],f=e.trim().split(aE);let p="";for(let m=f.length-1;m>=0;m-=1){const b=f[m],{isExternal:y,modifiers:v,hasImportantModifier:x,baseClassName:j,maybePostfixModifierPosition:S}=s(b);if(y){p=b+(p.length>0?" "+p:p);continue}let C=!!S,_=a(C?j.substring(0,S):j);if(!_){if(!C){p=b+(p.length>0?" "+p:p);continue}if(_=a(j),!_){p=b+(p.length>0?" "+p:p);continue}C=!1}const E=v.length===0?"":v.length===1?v[0]:c(v).join(":"),R=x?E+pm:E,z=R+_;if(d.indexOf(z)>-1)continue;d.push(z);const U=r(_,C);for(let O=0;O<U.length;++O){const M=U[O];d.push(R+M)}p=b+(p.length>0?" "+p:p)}return p},oE=(...e)=>{let t=0,s,a,r="";for(;t<e.length;)(s=e[t++])&&(a=DS(s))&&(r&&(r+=" "),r+=a);return r},DS=e=>{if(typeof e=="string")return e;let t,s="";for(let a=0;a<e.length;a++)e[a]&&(t=DS(e[a]))&&(s&&(s+=" "),s+=t);return s},lE=(e,...t)=>{let s,a,r,c;const d=p=>{const m=t.reduce((b,y)=>y(b),e());return s=iE(m),a=s.cache.get,r=s.cache.set,c=f,f(p)},f=p=>{const m=a(p);if(m)return m;const b=rE(p,s);return r(p,b),b};return c=d,(...p)=>c(oE(...p))},cE=[],Ft=e=>{const t=s=>s[e]||cE;return t.isThemeGetter=!0,t},LS=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,MS=/^\((?:(\w[\w-]*):)?(.+)\)$/i,uE=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,dE=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,fE=/\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$/,hE=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,mE=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,pE=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Si=e=>uE.test(e),De=e=>!!e&&!Number.isNaN(Number(e)),wi=e=>!!e&&Number.isInteger(Number(e)),Mh=e=>e.endsWith("%")&&De(e.slice(0,-1)),Is=e=>dE.test(e),US=()=>!0,gE=e=>fE.test(e)&&!hE.test(e),rp=()=>!1,yE=e=>mE.test(e),vE=e=>pE.test(e),bE=e=>!ve(e)&&!be(e),xE=e=>$i(e,IS,rp),ve=e=>LS.test(e),la=e=>$i(e,BS,gE),Mb=e=>$i(e,zE,De),SE=e=>$i(e,HS,US),wE=e=>$i(e,qS,rp),Ub=e=>$i(e,PS,rp),jE=e=>$i(e,$S,vE),Mc=e=>$i(e,ZS,yE),be=e=>MS.test(e),Po=e=>Ca(e,BS),NE=e=>Ca(e,qS),Pb=e=>Ca(e,PS),CE=e=>Ca(e,IS),_E=e=>Ca(e,$S),Uc=e=>Ca(e,ZS,!0),kE=e=>Ca(e,HS,!0),$i=(e,t,s)=>{const a=LS.exec(e);return a?a[1]?t(a[1]):s(a[2]):!1},Ca=(e,t,s=!1)=>{const a=MS.exec(e);return a?a[1]?t(a[1]):s:!1},PS=e=>e==="position"||e==="percentage",$S=e=>e==="image"||e==="url",IS=e=>e==="length"||e==="size"||e==="bg-size",BS=e=>e==="length",zE=e=>e==="number",qS=e=>e==="family-name",HS=e=>e==="number"||e==="weight",ZS=e=>e==="shadow",EE=()=>{const e=Ft("color"),t=Ft("font"),s=Ft("text"),a=Ft("font-weight"),r=Ft("tracking"),c=Ft("leading"),d=Ft("breakpoint"),f=Ft("container"),p=Ft("spacing"),m=Ft("radius"),b=Ft("shadow"),y=Ft("inset-shadow"),v=Ft("text-shadow"),x=Ft("drop-shadow"),j=Ft("blur"),S=Ft("perspective"),C=Ft("aspect"),_=Ft("ease"),E=Ft("animate"),R=()=>["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"],U=()=>[...z(),be,ve],O=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto","contain","none"],A=()=>[be,ve,p],Z=()=>[Si,"full","auto",...A()],W=()=>[wi,"none","subgrid",be,ve],Q=()=>["auto",{span:["full",wi,be,ve]},wi,be,ve],se=()=>[wi,"auto",be,ve],me=()=>["auto","min","max","fr",be,ve],ze=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],je=()=>["start","end","center","stretch","center-safe","end-safe"],B=()=>["auto",...A()],T=()=>[Si,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...A()],ae=()=>[Si,"screen","full","dvw","lvw","svw","min","max","fit",...A()],pe=()=>[Si,"screen","full","lh","dvh","lvh","svh","min","max","fit",...A()],te=()=>[e,be,ve],L=()=>[...z(),Pb,Ub,{position:[be,ve]}],G=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ie=()=>["auto","cover","contain",CE,xE,{size:[be,ve]}],re=()=>[Mh,Po,la],ce=()=>["","none","full",m,be,ve],he=()=>["",De,Po,la],de=()=>["solid","dashed","dotted","double"],Ge=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ge=()=>[De,Mh,Pb,Ub],Xe=()=>["","none",j,be,ve],mt=()=>["none",De,be,ve],fe=()=>["none",De,be,ve],Je=()=>[De,be,ve],dt=()=>[Si,"full",...A()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Is],breakpoint:[Is],color:[US],container:[Is],"drop-shadow":[Is],ease:["in","out","in-out"],font:[bE],"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,C]}],container:["container"],columns:[{columns:[De,ve,be,f]}],"break-after":[{"break-after":R()}],"break-before":[{"break-before":R()}],"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:U()}],overflow:[{overflow:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:Z()}],"inset-x":[{"inset-x":Z()}],"inset-y":[{"inset-y":Z()}],start:[{"inset-s":Z(),start:Z()}],end:[{"inset-e":Z(),end:Z()}],"inset-bs":[{"inset-bs":Z()}],"inset-be":[{"inset-be":Z()}],top:[{top:Z()}],right:[{right:Z()}],bottom:[{bottom:Z()}],left:[{left:Z()}],visibility:["visible","invisible","collapse"],z:[{z:[wi,"auto",be,ve]}],basis:[{basis:[Si,"full","auto",f,...A()]}],"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":W()}],"col-start-end":[{col:Q()}],"col-start":[{"col-start":se()}],"col-end":[{"col-end":se()}],"grid-rows":[{"grid-rows":W()}],"row-start-end":[{row:Q()}],"row-start":[{"row-start":se()}],"row-end":[{"row-end":se()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":me()}],"auto-rows":[{"auto-rows":me()}],gap:[{gap:A()}],"gap-x":[{"gap-x":A()}],"gap-y":[{"gap-y":A()}],"justify-content":[{justify:[...ze(),"normal"]}],"justify-items":[{"justify-items":[...je(),"normal"]}],"justify-self":[{"justify-self":["auto",...je()]}],"align-content":[{content:["normal",...ze()]}],"align-items":[{items:[...je(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...je(),{baseline:["","last"]}]}],"place-content":[{"place-content":ze()}],"place-items":[{"place-items":[...je(),"baseline"]}],"place-self":[{"place-self":["auto",...je()]}],p:[{p:A()}],px:[{px:A()}],py:[{py:A()}],ps:[{ps:A()}],pe:[{pe:A()}],pbs:[{pbs:A()}],pbe:[{pbe:A()}],pt:[{pt:A()}],pr:[{pr:A()}],pb:[{pb:A()}],pl:[{pl:A()}],m:[{m:B()}],mx:[{mx:B()}],my:[{my:B()}],ms:[{ms:B()}],me:[{me:B()}],mbs:[{mbs:B()}],mbe:[{mbe:B()}],mt:[{mt:B()}],mr:[{mr:B()}],mb:[{mb:B()}],ml:[{ml:B()}],"space-x":[{"space-x":A()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":A()}],"space-y-reverse":["space-y-reverse"],size:[{size:T()}],"inline-size":[{inline:["auto",...ae()]}],"min-inline-size":[{"min-inline":["auto",...ae()]}],"max-inline-size":[{"max-inline":["none",...ae()]}],"block-size":[{block:["auto",...pe()]}],"min-block-size":[{"min-block":["auto",...pe()]}],"max-block-size":[{"max-block":["none",...pe()]}],w:[{w:[f,"screen",...T()]}],"min-w":[{"min-w":[f,"screen","none",...T()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[d]},...T()]}],h:[{h:["screen","lh",...T()]}],"min-h":[{"min-h":["screen","lh","none",...T()]}],"max-h":[{"max-h":["screen","lh",...T()]}],"font-size":[{text:["base",s,Po,la]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,kE,SE]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Mh,ve]}],"font-family":[{font:[NE,wE,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,Mb]}],leading:[{leading:[c,...A()]}],"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:te()}],"text-color":[{text:te()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...de(),"wavy"]}],"text-decoration-thickness":[{decoration:[De,"from-font","auto",be,la]}],"text-decoration-color":[{decoration:te()}],"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:A()}],"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:L()}],"bg-repeat":[{bg:G()}],"bg-size":[{bg:ie()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},wi,be,ve],radial:["",be,ve],conic:[wi,be,ve]},_E,jE]}],"bg-color":[{bg:te()}],"gradient-from-pos":[{from:re()}],"gradient-via-pos":[{via:re()}],"gradient-to-pos":[{to:re()}],"gradient-from":[{from:te()}],"gradient-via":[{via:te()}],"gradient-to":[{to:te()}],rounded:[{rounded:ce()}],"rounded-s":[{"rounded-s":ce()}],"rounded-e":[{"rounded-e":ce()}],"rounded-t":[{"rounded-t":ce()}],"rounded-r":[{"rounded-r":ce()}],"rounded-b":[{"rounded-b":ce()}],"rounded-l":[{"rounded-l":ce()}],"rounded-ss":[{"rounded-ss":ce()}],"rounded-se":[{"rounded-se":ce()}],"rounded-ee":[{"rounded-ee":ce()}],"rounded-es":[{"rounded-es":ce()}],"rounded-tl":[{"rounded-tl":ce()}],"rounded-tr":[{"rounded-tr":ce()}],"rounded-br":[{"rounded-br":ce()}],"rounded-bl":[{"rounded-bl":ce()}],"border-w":[{border:he()}],"border-w-x":[{"border-x":he()}],"border-w-y":[{"border-y":he()}],"border-w-s":[{"border-s":he()}],"border-w-e":[{"border-e":he()}],"border-w-bs":[{"border-bs":he()}],"border-w-be":[{"border-be":he()}],"border-w-t":[{"border-t":he()}],"border-w-r":[{"border-r":he()}],"border-w-b":[{"border-b":he()}],"border-w-l":[{"border-l":he()}],"divide-x":[{"divide-x":he()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":he()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...de(),"hidden","none"]}],"divide-style":[{divide:[...de(),"hidden","none"]}],"border-color":[{border:te()}],"border-color-x":[{"border-x":te()}],"border-color-y":[{"border-y":te()}],"border-color-s":[{"border-s":te()}],"border-color-e":[{"border-e":te()}],"border-color-bs":[{"border-bs":te()}],"border-color-be":[{"border-be":te()}],"border-color-t":[{"border-t":te()}],"border-color-r":[{"border-r":te()}],"border-color-b":[{"border-b":te()}],"border-color-l":[{"border-l":te()}],"divide-color":[{divide:te()}],"outline-style":[{outline:[...de(),"none","hidden"]}],"outline-offset":[{"outline-offset":[De,be,ve]}],"outline-w":[{outline:["",De,Po,la]}],"outline-color":[{outline:te()}],shadow:[{shadow:["","none",b,Uc,Mc]}],"shadow-color":[{shadow:te()}],"inset-shadow":[{"inset-shadow":["none",y,Uc,Mc]}],"inset-shadow-color":[{"inset-shadow":te()}],"ring-w":[{ring:he()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:te()}],"ring-offset-w":[{"ring-offset":[De,la]}],"ring-offset-color":[{"ring-offset":te()}],"inset-ring-w":[{"inset-ring":he()}],"inset-ring-color":[{"inset-ring":te()}],"text-shadow":[{"text-shadow":["none",v,Uc,Mc]}],"text-shadow-color":[{"text-shadow":te()}],opacity:[{opacity:[De,be,ve]}],"mix-blend":[{"mix-blend":[...Ge(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Ge()}],"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":te()}],"mask-image-linear-to-color":[{"mask-linear-to":te()}],"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":te()}],"mask-image-t-to-color":[{"mask-t-to":te()}],"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":te()}],"mask-image-r-to-color":[{"mask-r-to":te()}],"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":te()}],"mask-image-b-to-color":[{"mask-b-to":te()}],"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":te()}],"mask-image-l-to-color":[{"mask-l-to":te()}],"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":te()}],"mask-image-x-to-color":[{"mask-x-to":te()}],"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":te()}],"mask-image-y-to-color":[{"mask-y-to":te()}],"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":te()}],"mask-image-radial-to-color":[{"mask-radial-to":te()}],"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":te()}],"mask-image-conic-to-color":[{"mask-conic-to":te()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:L()}],"mask-repeat":[{mask:G()}],"mask-size":[{mask:ie()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",be,ve]}],filter:[{filter:["","none",be,ve]}],blur:[{blur:Xe()}],brightness:[{brightness:[De,be,ve]}],contrast:[{contrast:[De,be,ve]}],"drop-shadow":[{"drop-shadow":["","none",x,Uc,Mc]}],"drop-shadow-color":[{"drop-shadow":te()}],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":Xe()}],"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":A()}],"border-spacing-x":[{"border-spacing-x":A()}],"border-spacing-y":[{"border-spacing-y":A()}],"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",_,be,ve]}],delay:[{delay:[De,be,ve]}],animate:[{animate:["none",E,be,ve]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,be,ve]}],"perspective-origin":[{"perspective-origin":U()}],rotate:[{rotate:mt()}],"rotate-x":[{"rotate-x":mt()}],"rotate-y":[{"rotate-y":mt()}],"rotate-z":[{"rotate-z":mt()}],scale:[{scale:fe()}],"scale-x":[{"scale-x":fe()}],"scale-y":[{"scale-y":fe()}],"scale-z":[{"scale-z":fe()}],"scale-3d":["scale-3d"],skew:[{skew:Je()}],"skew-x":[{"skew-x":Je()}],"skew-y":[{"skew-y":Je()}],transform:[{transform:[be,ve,"","none","gpu","cpu"]}],"transform-origin":[{origin:U()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:dt()}],"translate-x":[{"translate-x":dt()}],"translate-y":[{"translate-y":dt()}],"translate-z":[{"translate-z":dt()}],"translate-none":["translate-none"],accent:[{accent:te()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:te()}],"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":A()}],"scroll-mx":[{"scroll-mx":A()}],"scroll-my":[{"scroll-my":A()}],"scroll-ms":[{"scroll-ms":A()}],"scroll-me":[{"scroll-me":A()}],"scroll-mbs":[{"scroll-mbs":A()}],"scroll-mbe":[{"scroll-mbe":A()}],"scroll-mt":[{"scroll-mt":A()}],"scroll-mr":[{"scroll-mr":A()}],"scroll-mb":[{"scroll-mb":A()}],"scroll-ml":[{"scroll-ml":A()}],"scroll-p":[{"scroll-p":A()}],"scroll-px":[{"scroll-px":A()}],"scroll-py":[{"scroll-py":A()}],"scroll-ps":[{"scroll-ps":A()}],"scroll-pe":[{"scroll-pe":A()}],"scroll-pbs":[{"scroll-pbs":A()}],"scroll-pbe":[{"scroll-pbe":A()}],"scroll-pt":[{"scroll-pt":A()}],"scroll-pr":[{"scroll-pr":A()}],"scroll-pb":[{"scroll-pb":A()}],"scroll-pl":[{"scroll-pl":A()}],"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",...te()]}],"stroke-w":[{stroke:[De,Po,la,Mb]}],stroke:[{stroke:["none",...te()]}],"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"]}},RE=lE(EE);function Kn(...e){return RE(ES(e))}const OE=RS("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"}}),le=N.forwardRef(({className:e,variant:t,size:s,asChild:a=!1,...r},c)=>{const d=a?M2:"button";return l.jsx(d,{ref:c,className:Kn(OE({variant:t,size:s,className:e})),...r})});le.displayName="Button";const AE=RS("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 FS({className:e,variant:t,...s}){return l.jsx("div",{className:Kn(AE({variant:t}),e),...s})}function $b({compact:e=!1}){return l.jsxs(gt,{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 Wo({provider:e}){const t={gemini:"border-blue-800/50 bg-blue-950/40 text-blue-300",openai:"border-green-800/50 bg-green-950/40 text-green-300",claude:"border-amber-800/50 bg-amber-950/40 text-amber-300",perplexity:"border-teal-800/50 bg-teal-950/40 text-teal-300",local:"border-purple-800/50 bg-purple-950/40 text-purple-300"};return 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 xu(e){return e.state==="ok"?"positive":e.state==="checking"?"neutral":"negative"}function GS(e){switch(e){case"completed":return"positive";case"partial":return"caution";case"failed":return"negative";case"cancelled":return"caution";case"queued":case"running":return"neutral";default:return"neutral"}}function TE(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 DE(e){return e==="High"?"negative":e==="Moderate"?"caution":"neutral"}function lt({tone:e,children:t}){const s=e==="positive"?"success":e==="caution"?"warning":e==="negative"?"destructive":"neutral";return l.jsx(FS,{variant:s,children:t})}function Iu({status:e}){return l.jsx(lt,{tone:GS(e),children:$u(e)})}function Ti(e,t,{checkForDefaultPrevented:s=!0}={}){return function(r){if(e?.(r),s===!1||!r.defaultPrevented)return t?.(r)}}function LE(e,t){const s=N.createContext(t),a=c=>{const{children:d,...f}=c,p=N.useMemo(()=>f,Object.values(f));return l.jsx(s.Provider,{value:p,children:d})};a.displayName=e+"Provider";function r(c){const d=N.useContext(s);if(d)return d;if(t!==void 0)return t;throw new Error(`\`${c}\` must be used within \`${e}\``)}return[a,r]}function ME(e,t=[]){let s=[];function a(c,d){const f=N.createContext(d),p=s.length;s=[...s,d];const m=y=>{const{scope:v,children:x,...j}=y,S=v?.[e]?.[p]||f,C=N.useMemo(()=>j,Object.values(j));return l.jsx(S.Provider,{value:C,children:x})};m.displayName=c+"Provider";function b(y,v){const x=v?.[e]?.[p]||f,j=N.useContext(x);if(j)return j;if(d!==void 0)return d;throw new Error(`\`${y}\` must be used within \`${c}\``)}return[m,b]}const r=()=>{const c=s.map(d=>N.createContext(d));return function(f){const p=f?.[e]||c;return N.useMemo(()=>({[`__scope${e}`]:{...f,[e]:p}}),[f,p])}};return r.scopeName=e,[a,UE(r,...t)]}function UE(...e){const t=e[0];if(e.length===1)return t;const s=()=>{const a=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(c){const d=a.reduce((f,{useScope:p,scopeName:m})=>{const y=p(c)[`__scope${m}`];return{...f,...y}},{});return N.useMemo(()=>({[`__scope${t.scopeName}`]:d}),[d])}};return s.scopeName=t.scopeName,s}var el=globalThis?.document?N.useLayoutEffect:()=>{},PE=Um[" useId ".trim().toString()]||(()=>{}),$E=0;function Uh(e){const[t,s]=N.useState(PE());return el(()=>{s(a=>a??String($E++))},[e]),e||(t?`radix-${t}`:"")}var IE=Um[" useInsertionEffect ".trim().toString()]||el;function BE({prop:e,defaultProp:t,onChange:s=()=>{},caller:a}){const[r,c,d]=qE({defaultProp:t,onChange:s}),f=e!==void 0,p=f?e:r;{const b=N.useRef(e!==void 0);N.useEffect(()=>{const y=b.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.`),b.current=f},[f,a])}const m=N.useCallback(b=>{if(f){const y=HE(b)?b(e):b;y!==e&&d.current?.(y)}else c(b)},[f,e,c,d]);return[p,m]}function qE({defaultProp:e,onChange:t}){const[s,a]=N.useState(e),r=N.useRef(s),c=N.useRef(t);return IE(()=>{c.current=t},[t]),N.useEffect(()=>{r.current!==s&&(c.current?.(s),r.current=s)},[s,r]),[s,a,c]}function HE(e){return typeof e=="function"}function KS(e){const t=ZE(e),s=N.forwardRef((a,r)=>{const{children:c,...d}=a,f=N.Children.toArray(c),p=f.find(GE);if(p){const m=p.props.children,b=f.map(y=>y===p?N.Children.count(m)>1?N.Children.only(null):N.isValidElement(m)?m.props.children:null:y);return l.jsx(t,{...d,ref:r,children:N.isValidElement(m)?N.cloneElement(m,void 0,b):null})}return l.jsx(t,{...d,ref:r,children:c})});return s.displayName=`${e}.Slot`,s}function ZE(e){const t=N.forwardRef((s,a)=>{const{children:r,...c}=s;if(N.isValidElement(r)){const d=VE(r),f=KE(c,r.props);return r.type!==N.Fragment&&(f.ref=a?ip(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 FE=Symbol("radix.slottable");function GE(e){return N.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===FE}function KE(e,t){const s={...t};for(const a in t){const r=e[a],c=t[a];/^on[A-Z]/.test(a)?r&&c?s[a]=(...f)=>{const p=c(...f);return r(...f),p}:r&&(s[a]=r):a==="style"?s[a]={...r,...c}:a==="className"&&(s[a]=[r,c].filter(Boolean).join(" "))}return{...e,...s}}function VE(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 QE=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Zs=QE.reduce((e,t)=>{const s=KS(`Primitive.${t}`),a=N.forwardRef((r,c)=>{const{asChild:d,...f}=r,p=d?s:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(p,{...f,ref:c})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{});function YE(e,t){e&&np.flushSync(()=>e.dispatchEvent(t))}function tl(e){const t=N.useRef(e);return N.useEffect(()=>{t.current=e}),N.useMemo(()=>(...s)=>t.current?.(...s),[])}function JE(e,t=globalThis?.document){const s=tl(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 XE="DismissableLayer",gm="dismissableLayer.update",WE="dismissableLayer.pointerDownOutside",eR="dismissableLayer.focusOutside",Ib,VS=N.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),QS=N.forwardRef((e,t)=>{const{disableOutsidePointerEvents:s=!1,onEscapeKeyDown:a,onPointerDownOutside:r,onFocusOutside:c,onInteractOutside:d,onDismiss:f,...p}=e,m=N.useContext(VS),[b,y]=N.useState(null),v=b?.ownerDocument??globalThis?.document,[,x]=N.useState({}),j=Na(t,M=>y(M)),S=Array.from(m.layers),[C]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),_=S.indexOf(C),E=b?S.indexOf(b):-1,R=m.layersWithOutsidePointerEventsDisabled.size>0,z=E>=_,U=sR(M=>{const A=M.target,Z=[...m.branches].some(W=>W.contains(A));!z||Z||(r?.(M),d?.(M),M.defaultPrevented||f?.())},v),O=iR(M=>{const A=M.target;[...m.branches].some(W=>W.contains(A))||(c?.(M),d?.(M),M.defaultPrevented||f?.())},v);return JE(M=>{E===m.layers.size-1&&(a?.(M),!M.defaultPrevented&&f&&(M.preventDefault(),f()))},v),N.useEffect(()=>{if(b)return s&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(Ib=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(b)),m.layers.add(b),Bb(),()=>{s&&m.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=Ib)}},[b,v,s,m]),N.useEffect(()=>()=>{b&&(m.layers.delete(b),m.layersWithOutsidePointerEventsDisabled.delete(b),Bb())},[b,m]),N.useEffect(()=>{const M=()=>x({});return document.addEventListener(gm,M),()=>document.removeEventListener(gm,M)},[]),l.jsx(Zs.div,{...p,ref:j,style:{pointerEvents:R?z?"auto":"none":void 0,...e.style},onFocusCapture:Ti(e.onFocusCapture,O.onFocusCapture),onBlurCapture:Ti(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:Ti(e.onPointerDownCapture,U.onPointerDownCapture)})});QS.displayName=XE;var tR="DismissableLayerBranch",nR=N.forwardRef((e,t)=>{const s=N.useContext(VS),a=N.useRef(null),r=Na(t,a);return N.useEffect(()=>{const c=a.current;if(c)return s.branches.add(c),()=>{s.branches.delete(c)}},[s.branches]),l.jsx(Zs.div,{...e,ref:r})});nR.displayName=tR;function sR(e,t=globalThis?.document){const s=tl(e),a=N.useRef(!1),r=N.useRef(()=>{});return N.useEffect(()=>{const c=f=>{if(f.target&&!a.current){let p=function(){YS(WE,s,m,{discrete:!0})};const m={originalEvent:f};f.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=p,t.addEventListener("click",r.current,{once:!0})):p()}else t.removeEventListener("click",r.current);a.current=!1},d=window.setTimeout(()=>{t.addEventListener("pointerdown",c)},0);return()=>{window.clearTimeout(d),t.removeEventListener("pointerdown",c),t.removeEventListener("click",r.current)}},[t,s]),{onPointerDownCapture:()=>a.current=!0}}function iR(e,t=globalThis?.document){const s=tl(e),a=N.useRef(!1);return N.useEffect(()=>{const r=c=>{c.target&&!a.current&&YS(eR,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 Bb(){const e=new CustomEvent(gm);document.dispatchEvent(e)}function YS(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?YE(r,c):r.dispatchEvent(c)}var Ph="focusScope.autoFocusOnMount",$h="focusScope.autoFocusOnUnmount",qb={bubbles:!1,cancelable:!0},aR="FocusScope",JS=N.forwardRef((e,t)=>{const{loop:s=!1,trapped:a=!1,onMountAutoFocus:r,onUnmountAutoFocus:c,...d}=e,[f,p]=N.useState(null),m=tl(r),b=tl(c),y=N.useRef(null),v=Na(t,S=>p(S)),x=N.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;N.useEffect(()=>{if(a){let S=function(R){if(x.paused||!f)return;const z=R.target;f.contains(z)?y.current=z:ji(y.current,{select:!0})},C=function(R){if(x.paused||!f)return;const z=R.relatedTarget;z!==null&&(f.contains(z)||ji(y.current,{select:!0}))},_=function(R){if(document.activeElement===document.body)for(const U of R)U.removedNodes.length>0&&ji(f)};document.addEventListener("focusin",S),document.addEventListener("focusout",C);const E=new MutationObserver(_);return f&&E.observe(f,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",S),document.removeEventListener("focusout",C),E.disconnect()}}},[a,f,x.paused]),N.useEffect(()=>{if(f){Zb.add(x);const S=document.activeElement;if(!f.contains(S)){const _=new CustomEvent(Ph,qb);f.addEventListener(Ph,m),f.dispatchEvent(_),_.defaultPrevented||(rR(dR(XS(f)),{select:!0}),document.activeElement===S&&ji(f))}return()=>{f.removeEventListener(Ph,m),setTimeout(()=>{const _=new CustomEvent($h,qb);f.addEventListener($h,b),f.dispatchEvent(_),_.defaultPrevented||ji(S??document.body,{select:!0}),f.removeEventListener($h,b),Zb.remove(x)},0)}}},[f,m,b,x]);const j=N.useCallback(S=>{if(!s&&!a||x.paused)return;const C=S.key==="Tab"&&!S.altKey&&!S.ctrlKey&&!S.metaKey,_=document.activeElement;if(C&&_){const E=S.currentTarget,[R,z]=oR(E);R&&z?!S.shiftKey&&_===z?(S.preventDefault(),s&&ji(R,{select:!0})):S.shiftKey&&_===R&&(S.preventDefault(),s&&ji(z,{select:!0})):_===E&&S.preventDefault()}},[s,a,x.paused]);return l.jsx(Zs.div,{tabIndex:-1,...d,ref:v,onKeyDown:j})});JS.displayName=aR;function rR(e,{select:t=!1}={}){const s=document.activeElement;for(const a of e)if(ji(a,{select:t}),document.activeElement!==s)return}function oR(e){const t=XS(e),s=Hb(t,e),a=Hb(t.reverse(),e);return[s,a]}function XS(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 Hb(e,t){for(const s of e)if(!lR(s,{upTo:t}))return s}function lR(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 cR(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&&cR(e)&&t&&e.select()}}var Zb=uR();function uR(){let e=[];return{add(t){const s=e[0];t!==s&&s?.pause(),e=Fb(e,t),e.unshift(t)},remove(t){e=Fb(e,t),e[0]?.resume()}}}function Fb(e,t){const s=[...e],a=s.indexOf(t);return a!==-1&&s.splice(a,1),s}function dR(e){return e.filter(t=>t.tagName!=="A")}var fR="Portal",WS=N.forwardRef((e,t)=>{const{container:s,...a}=e,[r,c]=N.useState(!1);el(()=>c(!0),[]);const d=s||r&&globalThis?.document?.body;return d?Cz.createPortal(l.jsx(Zs.div,{...a,ref:t}),d):null});WS.displayName=fR;function hR(e,t){return N.useReducer((s,a)=>t[s][a]??s,e)}var Bu=e=>{const{present:t,children:s}=e,a=mR(t),r=typeof s=="function"?s({present:a.isPresent}):N.Children.only(s),c=Na(a.ref,pR(r));return typeof s=="function"||a.isPresent?N.cloneElement(r,{ref:c}):null};Bu.displayName="Presence";function mR(e){const[t,s]=N.useState(),a=N.useRef(null),r=N.useRef(e),c=N.useRef("none"),d=e?"mounted":"unmounted",[f,p]=hR(d,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return N.useEffect(()=>{const m=Pc(a.current);c.current=f==="mounted"?m:"none"},[f]),el(()=>{const m=a.current,b=r.current;if(b!==e){const v=c.current,x=Pc(m);e?p("MOUNT"):x==="none"||m?.display==="none"?p("UNMOUNT"):p(b&&v!==x?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,p]),el(()=>{if(t){let m;const b=t.ownerDocument.defaultView??window,y=x=>{const S=Pc(a.current).includes(CSS.escape(x.animationName));if(x.target===t&&S&&(p("ANIMATION_END"),!r.current)){const C=t.style.animationFillMode;t.style.animationFillMode="forwards",m=b.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=C)})}},v=x=>{x.target===t&&(c.current=Pc(a.current))};return t.addEventListener("animationstart",v),t.addEventListener("animationcancel",y),t.addEventListener("animationend",y),()=>{b.clearTimeout(m),t.removeEventListener("animationstart",v),t.removeEventListener("animationcancel",y),t.removeEventListener("animationend",y)}}else p("ANIMATION_END")},[t,p]),{isPresent:["mounted","unmountSuspended"].includes(f),ref:N.useCallback(m=>{a.current=m?getComputedStyle(m):null,s(m)},[])}}function Pc(e){return e?.animationName||"none"}function pR(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 Ih=0;function gR(){N.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Gb()),document.body.insertAdjacentElement("beforeend",e[1]??Gb()),Ih++,()=>{Ih===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Ih--}},[])}function Gb(){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 ew(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 yR(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 nu="right-scroll-bar-position",su="width-before-scroll-bar",vR="with-scroll-bars-hidden",bR="--removed-body-scroll-bar-size";function Bh(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function xR(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 SR=typeof window<"u"?N.useLayoutEffect:N.useEffect,Kb=new WeakMap;function wR(e,t){var s=xR(null,function(a){return e.forEach(function(r){return Bh(r,a)})});return SR(function(){var a=Kb.get(s);if(a){var r=new Set(a),c=new Set(e),d=s.current;r.forEach(function(f){c.has(f)||Bh(f,null)}),c.forEach(function(f){r.has(f)||Bh(f,d)})}Kb.set(s,e)},[e]),s}function jR(e){return e}function NR(e,t){t===void 0&&(t=jR);var s=[],a=!1,r={read:function(){if(a)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return s.length?s[s.length-1]:e},useMedium:function(c){var d=t(c,a);return s.push(d),function(){s=s.filter(function(f){return f!==d})}},assignSyncMedium:function(c){for(a=!0;s.length;){var d=s;s=[],d.forEach(c)}s={push:function(f){return c(f)},filter:function(){return s}}},assignMedium:function(c){a=!0;var d=[];if(s.length){var f=s;s=[],f.forEach(c),d=s}var p=function(){var b=d;d=[],b.forEach(c)},m=function(){return Promise.resolve().then(p)};m(),s={push:function(b){d.push(b),m()},filter:function(b){return d=d.filter(b),s}}}};return r}function CR(e){e===void 0&&(e={});var t=NR(null);return t.options=ys({async:!0,ssr:!1},e),t}var tw=function(e){var t=e.sideCar,s=ew(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))};tw.isSideCarExport=!0;function _R(e,t){return e.useMedium(t),tw}var nw=CR(),qh=function(){},qu=N.forwardRef(function(e,t){var s=N.useRef(null),a=N.useState({onScrollCapture:qh,onWheelCapture:qh,onTouchMoveCapture:qh}),r=a[0],c=a[1],d=e.forwardProps,f=e.children,p=e.className,m=e.removeScrollBar,b=e.enabled,y=e.shards,v=e.sideCar,x=e.noRelative,j=e.noIsolation,S=e.inert,C=e.allowPinchZoom,_=e.as,E=_===void 0?"div":_,R=e.gapMode,z=ew(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),U=v,O=wR([s,t]),M=ys(ys({},z),r);return N.createElement(N.Fragment,null,b&&N.createElement(U,{sideCar:nw,removeScrollBar:m,shards:y,noRelative:x,noIsolation:j,inert:S,setCallbacks:c,allowPinchZoom:!!C,lockRef:s,gapMode:R}),d?N.cloneElement(N.Children.only(f),ys(ys({},M),{ref:O})):N.createElement(E,ys({},M,{className:p,ref:O}),f))});qu.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};qu.classNames={fullWidth:su,zeroRight:nu};var kR=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function zR(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=kR();return t&&e.setAttribute("nonce",t),e}function ER(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function RR(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var OR=function(){var e=0,t=null;return{add:function(s){e==0&&(t=zR())&&(ER(t,s),RR(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},AR=function(){var e=OR();return function(t,s){N.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&s])}},sw=function(){var e=AR(),t=function(s){var a=s.styles,r=s.dynamic;return e(a,r),null};return t},TR={left:0,top:0,right:0,gap:0},Hh=function(e){return parseInt(e||"",10)||0},DR=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[Hh(s),Hh(a),Hh(r)]},LR=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return TR;var t=DR(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])}},MR=sw(),Cr="data-scroll-locked",UR=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(vR,` {
|
|
14
|
+
overflow: hidden `).concat(a,`;
|
|
15
|
+
padding-right: `).concat(f,"px ").concat(a,`;
|
|
16
|
+
}
|
|
17
|
+
body[`).concat(Cr,`] {
|
|
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(nu,` {
|
|
31
|
+
right: `).concat(f,"px ").concat(a,`;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.`).concat(su,` {
|
|
35
|
+
margin-right: `).concat(f,"px ").concat(a,`;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.`).concat(nu," .").concat(nu,` {
|
|
39
|
+
right: 0 `).concat(a,`;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.`).concat(su," .").concat(su,` {
|
|
43
|
+
margin-right: 0 `).concat(a,`;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
body[`).concat(Cr,`] {
|
|
47
|
+
`).concat(bR,": ").concat(f,`px;
|
|
48
|
+
}
|
|
49
|
+
`)},Vb=function(){var e=parseInt(document.body.getAttribute(Cr)||"0",10);return isFinite(e)?e:0},PR=function(){N.useEffect(function(){return document.body.setAttribute(Cr,(Vb()+1).toString()),function(){var e=Vb()-1;e<=0?document.body.removeAttribute(Cr):document.body.setAttribute(Cr,e.toString())}},[])},$R=function(e){var t=e.noRelative,s=e.noImportant,a=e.gapMode,r=a===void 0?"margin":a;PR();var c=N.useMemo(function(){return LR(r)},[r]);return N.createElement(MR,{styles:UR(c,!t,r,s?"":"!important")})},ym=!1;if(typeof window<"u")try{var $c=Object.defineProperty({},"passive",{get:function(){return ym=!0,!0}});window.addEventListener("test",$c,$c),window.removeEventListener("test",$c,$c)}catch{ym=!1}var hr=ym?{passive:!1}:!1,IR=function(e){return e.tagName==="TEXTAREA"},iw=function(e,t){if(!(e instanceof Element))return!1;var s=window.getComputedStyle(e);return s[t]!=="hidden"&&!(s.overflowY===s.overflowX&&!IR(e)&&s[t]==="visible")},BR=function(e){return iw(e,"overflowY")},qR=function(e){return iw(e,"overflowX")},Qb=function(e,t){var s=t.ownerDocument,a=t;do{typeof ShadowRoot<"u"&&a instanceof ShadowRoot&&(a=a.host);var r=aw(e,a);if(r){var c=rw(e,a),d=c[1],f=c[2];if(d>f)return!0}a=a.parentNode}while(a&&a!==s.body);return!1},HR=function(e){var t=e.scrollTop,s=e.scrollHeight,a=e.clientHeight;return[t,s,a]},ZR=function(e){var t=e.scrollLeft,s=e.scrollWidth,a=e.clientWidth;return[t,s,a]},aw=function(e,t){return e==="v"?BR(t):qR(t)},rw=function(e,t){return e==="v"?HR(t):ZR(t)},FR=function(e,t){return e==="h"&&t==="rtl"?-1:1},GR=function(e,t,s,a,r){var c=FR(e,window.getComputedStyle(t).direction),d=c*a,f=s.target,p=t.contains(f),m=!1,b=d>0,y=0,v=0;do{if(!f)break;var x=rw(e,f),j=x[0],S=x[1],C=x[2],_=S-C-c*j;(j||_)&&aw(e,f)&&(y+=_,v+=j);var E=f.parentNode;f=E&&E.nodeType===Node.DOCUMENT_FRAGMENT_NODE?E.host:E}while(!p&&f!==document.body||p&&(t.contains(f)||t===f));return(b&&Math.abs(y)<1||!b&&Math.abs(v)<1)&&(m=!0),m},Ic=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Yb=function(e){return[e.deltaX,e.deltaY]},Jb=function(e){return e&&"current"in e?e.current:e},KR=function(e,t){return e[0]===t[0]&&e[1]===t[1]},VR=function(e){return`
|
|
50
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
51
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
52
|
+
`)},QR=0,mr=[];function YR(e){var t=N.useRef([]),s=N.useRef([0,0]),a=N.useRef(),r=N.useState(QR++)[0],c=N.useState(sw)[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 S=yR([e.lockRef.current],(e.shards||[]).map(Jb),!0).filter(Boolean);return S.forEach(function(C){return C.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),S.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(r))})}}},[e.inert,e.lockRef.current,e.shards]);var f=N.useCallback(function(S,C){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!d.current.allowPinchZoom;var _=Ic(S),E=s.current,R="deltaX"in S?S.deltaX:E[0]-_[0],z="deltaY"in S?S.deltaY:E[1]-_[1],U,O=S.target,M=Math.abs(R)>Math.abs(z)?"h":"v";if("touches"in S&&M==="h"&&O.type==="range")return!1;var A=window.getSelection(),Z=A&&A.anchorNode,W=Z?Z===O||Z.contains(O):!1;if(W)return!1;var Q=Qb(M,O);if(!Q)return!0;if(Q?U=M:(U=M==="v"?"h":"v",Q=Qb(M,O)),!Q)return!1;if(!a.current&&"changedTouches"in S&&(R||z)&&(a.current=U),!U)return!0;var se=a.current||U;return GR(se,C,S,se==="h"?R:z)},[]),p=N.useCallback(function(S){var C=S;if(!(!mr.length||mr[mr.length-1]!==c)){var _="deltaY"in C?Yb(C):Ic(C),E=t.current.filter(function(U){return U.name===C.type&&(U.target===C.target||C.target===U.shadowParent)&&KR(U.delta,_)})[0];if(E&&E.should){C.cancelable&&C.preventDefault();return}if(!E){var R=(d.current.shards||[]).map(Jb).filter(Boolean).filter(function(U){return U.contains(C.target)}),z=R.length>0?f(C,R[0]):!d.current.noIsolation;z&&C.cancelable&&C.preventDefault()}}},[]),m=N.useCallback(function(S,C,_,E){var R={name:S,delta:C,target:_,should:E,shadowParent:JR(_)};t.current.push(R),setTimeout(function(){t.current=t.current.filter(function(z){return z!==R})},1)},[]),b=N.useCallback(function(S){s.current=Ic(S),a.current=void 0},[]),y=N.useCallback(function(S){m(S.type,Yb(S),S.target,f(S,e.lockRef.current))},[]),v=N.useCallback(function(S){m(S.type,Ic(S),S.target,f(S,e.lockRef.current))},[]);N.useEffect(function(){return mr.push(c),e.setCallbacks({onScrollCapture:y,onWheelCapture:y,onTouchMoveCapture:v}),document.addEventListener("wheel",p,hr),document.addEventListener("touchmove",p,hr),document.addEventListener("touchstart",b,hr),function(){mr=mr.filter(function(S){return S!==c}),document.removeEventListener("wheel",p,hr),document.removeEventListener("touchmove",p,hr),document.removeEventListener("touchstart",b,hr)}},[]);var x=e.removeScrollBar,j=e.inert;return N.createElement(N.Fragment,null,j?N.createElement(c,{styles:VR(r)}):null,x?N.createElement($R,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function JR(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const XR=_R(nw,YR);var ow=N.forwardRef(function(e,t){return N.createElement(qu,ys({},e,{ref:t,sideCar:XR}))});ow.classNames=qu.classNames;var WR=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},pr=new WeakMap,Bc=new WeakMap,qc={},Zh=0,lw=function(e){return e&&(e.host||lw(e.parentNode))},eO=function(e,t){return t.map(function(s){if(e.contains(s))return s;var a=lw(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})},tO=function(e,t,s,a){var r=eO(t,Array.isArray(e)?e:[e]);qc[s]||(qc[s]=new WeakMap);var c=qc[s],d=[],f=new Set,p=new Set(r),m=function(y){!y||f.has(y)||(f.add(y),m(y.parentNode))};r.forEach(m);var b=function(y){!y||p.has(y)||Array.prototype.forEach.call(y.children,function(v){if(f.has(v))b(v);else try{var x=v.getAttribute(a),j=x!==null&&x!=="false",S=(pr.get(v)||0)+1,C=(c.get(v)||0)+1;pr.set(v,S),c.set(v,C),d.push(v),S===1&&j&&Bc.set(v,!0),C===1&&v.setAttribute(s,"true"),j||v.setAttribute(a,"true")}catch(_){console.error("aria-hidden: cannot operate on ",v,_)}})};return b(t),f.clear(),Zh++,function(){d.forEach(function(y){var v=pr.get(y)-1,x=c.get(y)-1;pr.set(y,v),c.set(y,x),v||(Bc.has(y)||y.removeAttribute(a),Bc.delete(y)),x||y.removeAttribute(s)}),Zh--,Zh||(pr=new WeakMap,pr=new WeakMap,Bc=new WeakMap,qc={})}},nO=function(e,t,s){s===void 0&&(s="data-aria-hidden");var a=Array.from(Array.isArray(e)?e:[e]),r=WR(e);return r?(a.push.apply(a,Array.from(r.querySelectorAll("[aria-live], script"))),tO(a,r,s,"aria-hidden")):function(){return null}},Hu="Dialog",[cw]=ME(Hu),[sO,as]=cw(Hu),uw=e=>{const{__scopeDialog:t,children:s,open:a,defaultOpen:r,onOpenChange:c,modal:d=!0}=e,f=N.useRef(null),p=N.useRef(null),[m,b]=BE({prop:a,defaultProp:r??!1,onChange:c,caller:Hu});return l.jsx(sO,{scope:t,triggerRef:f,contentRef:p,contentId:Uh(),titleId:Uh(),descriptionId:Uh(),open:m,onOpenChange:b,onOpenToggle:N.useCallback(()=>b(y=>!y),[b]),modal:d,children:s})};uw.displayName=Hu;var dw="DialogTrigger",iO=N.forwardRef((e,t)=>{const{__scopeDialog:s,...a}=e,r=as(dw,s),c=Na(t,r.triggerRef);return l.jsx(Zs.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":cp(r.open),...a,ref:c,onClick:Ti(e.onClick,r.onOpenToggle)})});iO.displayName=dw;var op="DialogPortal",[aO,fw]=cw(op,{forceMount:void 0}),hw=e=>{const{__scopeDialog:t,forceMount:s,children:a,container:r}=e,c=as(op,t);return l.jsx(aO,{scope:t,forceMount:s,children:N.Children.map(a,d=>l.jsx(Bu,{present:s||c.open,children:l.jsx(WS,{asChild:!0,container:r,children:d})}))})};hw.displayName=op;var Su="DialogOverlay",mw=N.forwardRef((e,t)=>{const s=fw(Su,e.__scopeDialog),{forceMount:a=s.forceMount,...r}=e,c=as(Su,e.__scopeDialog);return c.modal?l.jsx(Bu,{present:a||c.open,children:l.jsx(oO,{...r,ref:t})}):null});mw.displayName=Su;var rO=KS("DialogOverlay.RemoveScroll"),oO=N.forwardRef((e,t)=>{const{__scopeDialog:s,...a}=e,r=as(Su,s);return l.jsx(ow,{as:rO,allowPinchZoom:!0,shards:[r.contentRef],children:l.jsx(Zs.div,{"data-state":cp(r.open),...a,ref:t,style:{pointerEvents:"auto",...a.style}})})}),Sa="DialogContent",pw=N.forwardRef((e,t)=>{const s=fw(Sa,e.__scopeDialog),{forceMount:a=s.forceMount,...r}=e,c=as(Sa,e.__scopeDialog);return l.jsx(Bu,{present:a||c.open,children:c.modal?l.jsx(lO,{...r,ref:t}):l.jsx(cO,{...r,ref:t})})});pw.displayName=Sa;var lO=N.forwardRef((e,t)=>{const s=as(Sa,e.__scopeDialog),a=N.useRef(null),r=Na(t,s.contentRef,a);return N.useEffect(()=>{const c=a.current;if(c)return nO(c)},[]),l.jsx(gw,{...e,ref:r,trapFocus:s.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ti(e.onCloseAutoFocus,c=>{c.preventDefault(),s.triggerRef.current?.focus()}),onPointerDownOutside:Ti(e.onPointerDownOutside,c=>{const d=c.detail.originalEvent,f=d.button===0&&d.ctrlKey===!0;(d.button===2||f)&&c.preventDefault()}),onFocusOutside:Ti(e.onFocusOutside,c=>c.preventDefault())})}),cO=N.forwardRef((e,t)=>{const s=as(Sa,e.__scopeDialog),a=N.useRef(!1),r=N.useRef(!1);return l.jsx(gw,{...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()}})}),gw=N.forwardRef((e,t)=>{const{__scopeDialog:s,trapFocus:a,onOpenAutoFocus:r,onCloseAutoFocus:c,...d}=e,f=as(Sa,s),p=N.useRef(null),m=Na(t,p);return gR(),l.jsxs(l.Fragment,{children:[l.jsx(JS,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:r,onUnmountAutoFocus:c,children:l.jsx(QS,{role:"dialog",id:f.contentId,"aria-describedby":f.descriptionId,"aria-labelledby":f.titleId,"data-state":cp(f.open),...d,ref:m,onDismiss:()=>f.onOpenChange(!1)})}),l.jsxs(l.Fragment,{children:[l.jsx(uO,{titleId:f.titleId}),l.jsx(fO,{contentRef:p,descriptionId:f.descriptionId})]})]})}),lp="DialogTitle",yw=N.forwardRef((e,t)=>{const{__scopeDialog:s,...a}=e,r=as(lp,s);return l.jsx(Zs.h2,{id:r.titleId,...a,ref:t})});yw.displayName=lp;var vw="DialogDescription",bw=N.forwardRef((e,t)=>{const{__scopeDialog:s,...a}=e,r=as(vw,s);return l.jsx(Zs.p,{id:r.descriptionId,...a,ref:t})});bw.displayName=vw;var xw="DialogClose",Sw=N.forwardRef((e,t)=>{const{__scopeDialog:s,...a}=e,r=as(xw,s);return l.jsx(Zs.button,{type:"button",...a,ref:t,onClick:Ti(e.onClick,()=>r.onOpenChange(!1))})});Sw.displayName=xw;function cp(e){return e?"open":"closed"}var ww="DialogTitleWarning",[C3,jw]=LE(ww,{contentName:Sa,titleName:lp,docsSlug:"dialog"}),uO=({titleId:e})=>{const t=jw(ww),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},dO="DialogDescriptionWarning",fO=({contentRef:e,descriptionId:t})=>{const a=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${jw(dO).contentName}}.`;return N.useEffect(()=>{const r=e.current?.getAttribute("aria-describedby");t&&r&&(document.getElementById(t)||console.warn(a))},[a,e,t]),null},Nw=uw,Cw=hw,up=mw,dp=pw,fp=yw,_w=bw,kw=Sw;const hO=Nw,mO=Cw,zw=N.forwardRef(({className:e,...t},s)=>l.jsx(up,{ref:s,className:Kn("fixed inset-0 z-50 bg-black/70 backdrop-blur-sm",e),...t}));zw.displayName=up.displayName;const pO=400,gO=1200,yO=720,Ew=N.forwardRef(({className:e,children:t,...s},a)=>{const[r,c]=N.useState(yO),d=N.useRef(!1),f=N.useRef(0),p=N.useRef(0),m=N.useCallback(v=>{d.current=!0,f.current=v.clientX,p.current=r,v.target.setPointerCapture(v.pointerId),v.preventDefault()},[r]),b=N.useCallback(v=>{if(!d.current)return;const x=f.current-v.clientX,j=Math.min(gO,Math.max(pO,p.current+x));c(j)},[]),y=N.useCallback(()=>{d.current=!1},[]);return l.jsxs(mO,{children:[l.jsx(zw,{}),l.jsxs(dp,{ref:a,className:Kn("fixed z-50 flex flex-col bg-zinc-950 px-5 py-4 shadow-2xl overflow-hidden","max-md:inset-x-0 max-md:bottom-0 max-md:top-auto max-md:max-h-[88vh] max-md:rounded-t-2xl max-md:border-t","md:inset-y-0 md:right-0 md:h-full md:border-l","border-zinc-800",e),style:{width:`min(${r}px, 100vw)`},...s,children:[l.jsx("div",{className:"absolute inset-y-0 left-0 w-1.5 cursor-col-resize hover:bg-zinc-700/50 active:bg-zinc-600/50 transition-colors max-md:hidden",onPointerDown:m,onPointerMove:b,onPointerUp:y}),t,l.jsxs(kw,{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(Pu,{className:"size-4"}),l.jsx("span",{className:"sr-only",children:"Close"})]})]})]})});Ew.displayName=dp.displayName;const vO=({className:e,...t})=>l.jsx("div",{className:Kn("flex flex-col gap-1.5 pr-10",e),...t}),Rw=N.forwardRef(({className:e,...t},s)=>l.jsx(fp,{ref:s,className:Kn("text-lg font-medium text-zinc-50",e),...t}));Rw.displayName=fp.displayName;const Ow=N.forwardRef(({className:e,...t},s)=>l.jsx(_w,{ref:s,className:Kn("text-sm text-zinc-500",e),...t}));Ow.displayName=_w.displayName;function bO({title:e,subtitle:t,children:s,open:a,onClose:r}){return l.jsx(hO,{open:a,onOpenChange:c=>c?void 0:r(),children:l.jsxs(Ew,{children:[l.jsxs(vO,{className:"drawer-head",children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:t}),l.jsx(Rw,{id:"drawer-title",children:e}),l.jsx(Ow,{className:"sr-only",children:t})]}),l.jsx("div",{className:"drawer-body",children:s})]})})}function X(e,t,s){function a(f,p){if(f._zod||Object.defineProperty(f,"_zod",{value:{def:p,constr:d,traits:new Set},enumerable:!1}),f._zod.traits.has(e))return;f._zod.traits.add(e),t(f,p);const m=d.prototype,b=Object.keys(m);for(let y=0;y<b.length;y++){const v=b[y];v in f||(f[v]=m[v].bind(f))}}const r=s?.Parent??Object;class c extends r{}Object.defineProperty(c,"name",{value:e});function d(f){var p;const m=s?.Parent?new c:this;a(m,f),(p=m._zod).deferred??(p.deferred=[]);for(const b of m._zod.deferred)b();return m}return Object.defineProperty(d,"init",{value:a}),Object.defineProperty(d,Symbol.hasInstance,{value:f=>s?.Parent&&f instanceof s.Parent?!0:f?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}class _r extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Aw extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const Tw={};function Mi(e){return Tw}function Dw(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 vm(e,t){return typeof t=="bigint"?t.toString():t}function hp(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function mp(e){return e==null}function pp(e){const t=e.startsWith("^")?1:0,s=e.endsWith("$")?e.length-1:e.length;return e.slice(t,s)}function xO(e,t){const s=(e.toString().split(".")[1]||"").length,a=t.toString();let r=(a.split(".")[1]||"").length;if(r===0&&/\d?e-\d?/.test(a)){const p=a.match(/\d?e-(\d?)/);p?.[1]&&(r=Number.parseInt(p[1]))}const c=s>r?s:r,d=Number.parseInt(e.toFixed(c).replace(".","")),f=Number.parseInt(t.toFixed(c).replace(".",""));return d%f/10**c}const Xb=Symbol("evaluating");function tt(e,t,s){let a;Object.defineProperty(e,t,{get(){if(a!==Xb)return a===void 0&&(a=Xb,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 Ii(...e){const t={};for(const s of e){const a=Object.getOwnPropertyDescriptors(s);Object.assign(t,a)}return Object.defineProperties({},t)}function Wb(e){return JSON.stringify(e)}function SO(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Lw="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function wu(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const wO=hp(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Or(e){if(wu(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const s=t.prototype;return!(wu(s)===!1||Object.prototype.hasOwnProperty.call(s,"isPrototypeOf")===!1)}function Mw(e){return Or(e)?{...e}:Array.isArray(e)?[...e]:e}const jO=new Set(["string","number","symbol"]);function Ar(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Bi(e,t,s){const a=new e._zod.constr(t??e._zod.def);return(!t||s?.parent)&&(a._zod.parent=e),a}function we(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 NO(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const CO={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 _O(e,t){const s=e._zod.def,a=s.checks;if(a&&a.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const c=Ii(e._zod.def,{get shape(){const d={};for(const f in t){if(!(f in s.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&(d[f]=s.shape[f])}return _a(this,"shape",d),d},checks:[]});return Bi(e,c)}function kO(e,t){const s=e._zod.def,a=s.checks;if(a&&a.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const c=Ii(e._zod.def,{get shape(){const d={...e._zod.def.shape};for(const f in t){if(!(f in s.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&delete d[f]}return _a(this,"shape",d),d},checks:[]});return Bi(e,c)}function zO(e,t){if(!Or(t))throw new Error("Invalid input to extend: expected a plain object");const s=e._zod.def.checks;if(s&&s.length>0){const c=e._zod.def.shape;for(const d in t)if(Object.getOwnPropertyDescriptor(c,d)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const r=Ii(e._zod.def,{get shape(){const c={...e._zod.def.shape,...t};return _a(this,"shape",c),c}});return Bi(e,r)}function EO(e,t){if(!Or(t))throw new Error("Invalid input to safeExtend: expected a plain object");const s=Ii(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return _a(this,"shape",a),a}});return Bi(e,s)}function RO(e,t){const s=Ii(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 Bi(e,s)}function OO(e,t,s){const r=t._zod.def.checks;if(r&&r.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const d=Ii(t._zod.def,{get shape(){const f=t._zod.def.shape,p={...f};if(s)for(const m in s){if(!(m in f))throw new Error(`Unrecognized key: "${m}"`);s[m]&&(p[m]=e?new e({type:"optional",innerType:f[m]}):f[m])}else for(const m in f)p[m]=e?new e({type:"optional",innerType:f[m]}):f[m];return _a(this,"shape",p),p},checks:[]});return Bi(t,d)}function AO(e,t,s){const a=Ii(t._zod.def,{get shape(){const r=t._zod.def.shape,c={...r};if(s)for(const d in s){if(!(d in c))throw new Error(`Unrecognized key: "${d}"`);s[d]&&(c[d]=new e({type:"nonoptional",innerType:r[d]}))}else for(const d in r)c[d]=new e({type:"nonoptional",innerType:r[d]});return _a(this,"shape",c),c}});return Bi(t,a)}function xr(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 Sr(e,t){return t.map(s=>{var a;return(a=s).path??(a.path=[]),s.path.unshift(e),s})}function Hc(e){return typeof e=="string"?e:e?.message}function Ui(e,t,s){const a={...e,path:e.path??[]};if(!e.message){const r=Hc(e.inst?._zod.def?.error?.(e))??Hc(t?.error?.(e))??Hc(s.customError?.(e))??Hc(s.localeError?.(e))??"Invalid input";a.message=r}return delete a.inst,delete a.continue,t?.reportInput||delete a.input,a}function gp(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function nl(...e){const[t,s,a]=e;return typeof t=="string"?{message:t,code:"custom",input:s,inst:a}:{...t}}const Uw=(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,vm,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Pw=X("$ZodError",Uw),$w=X("$ZodError",Uw,{Parent:Error});function TO(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 DO(e,t=s=>s.message){const s={_errors:[]},a=r=>{for(const c of r.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(d=>a({issues:d}));else if(c.code==="invalid_key")a({issues:c.issues});else if(c.code==="invalid_element")a({issues:c.issues});else if(c.path.length===0)s._errors.push(t(c));else{let d=s,f=0;for(;f<c.path.length;){const p=c.path[f];f===c.path.length-1?(d[p]=d[p]||{_errors:[]},d[p]._errors.push(t(c))):d[p]=d[p]||{_errors:[]},d=d[p],f++}}};return a(e),s}const yp=e=>(t,s,a,r)=>{const c=a?Object.assign(a,{async:!1}):{async:!1},d=t._zod.run({value:s,issues:[]},c);if(d instanceof Promise)throw new _r;if(d.issues.length){const f=new(r?.Err??e)(d.issues.map(p=>Ui(p,c,Mi())));throw Lw(f,r?.callee),f}return d.value},vp=e=>async(t,s,a,r)=>{const c=a?Object.assign(a,{async:!0}):{async:!0};let d=t._zod.run({value:s,issues:[]},c);if(d instanceof Promise&&(d=await d),d.issues.length){const f=new(r?.Err??e)(d.issues.map(p=>Ui(p,c,Mi())));throw Lw(f,r?.callee),f}return d.value},Zu=e=>(t,s,a)=>{const r=a?{...a,async:!1}:{async:!1},c=t._zod.run({value:s,issues:[]},r);if(c instanceof Promise)throw new _r;return c.issues.length?{success:!1,error:new(e??Pw)(c.issues.map(d=>Ui(d,r,Mi())))}:{success:!0,data:c.value}},LO=Zu($w),Fu=e=>async(t,s,a)=>{const r=a?Object.assign(a,{async:!0}):{async:!0};let c=t._zod.run({value:s,issues:[]},r);return c instanceof Promise&&(c=await c),c.issues.length?{success:!1,error:new e(c.issues.map(d=>Ui(d,r,Mi())))}:{success:!0,data:c.value}},MO=Fu($w),UO=e=>(t,s,a)=>{const r=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return yp(e)(t,s,r)},PO=e=>(t,s,a)=>yp(e)(t,s,a),$O=e=>async(t,s,a)=>{const r=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return vp(e)(t,s,r)},IO=e=>async(t,s,a)=>vp(e)(t,s,a),BO=e=>(t,s,a)=>{const r=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Zu(e)(t,s,r)},qO=e=>(t,s,a)=>Zu(e)(t,s,a),HO=e=>async(t,s,a)=>{const r=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Fu(e)(t,s,r)},ZO=e=>async(t,s,a)=>Fu(e)(t,s,a),FO=/^[cC][^\s-]{8,}$/,GO=/^[0-9a-z]+$/,KO=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,VO=/^[0-9a-vA-V]{20}$/,QO=/^[A-Za-z0-9]{27}$/,YO=/^[a-zA-Z0-9_-]{21}$/,JO=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,XO=/^([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})$/,ex=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)$/,WO=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,eA="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function tA(){return new RegExp(eA,"u")}const nA=/^(?:(?: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])$/,sA=/^(([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}|:))$/,iA=/^((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])$/,aA=/^(([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])$/,rA=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Iw=/^[A-Za-z0-9_-]*$/,oA=/^\+[1-9]\d{6,14}$/,Bw="(?:(?:\\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])))",lA=new RegExp(`^${Bw}$`);function qw(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 cA(e){return new RegExp(`^${qw(e)}$`)}function uA(e){const t=qw({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(`^${Bw}T(?:${a})$`)}const dA=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},fA=/^-?\d+$/,Hw=/^-?\d+(?:\.\d+)?$/,hA=/^(?:true|false)$/i,mA=/^[^A-Z]*$/,pA=/^[^a-z]*$/,Sn=X("$ZodCheck",(e,t)=>{var s;e._zod??(e._zod={}),e._zod.def=t,(s=e._zod).onattach??(s.onattach=[])}),Zw={number:"number",bigint:"bigint",object:"date"},Fw=X("$ZodCheckLessThan",(e,t)=>{Sn.init(e,t);const s=Zw[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})}}),Gw=X("$ZodCheckGreaterThan",(e,t)=>{Sn.init(e,t);const s=Zw[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})}}),gA=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):xO(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})}}),yA=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]=CO[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=fA)}),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})}}),vA=X("$ZodCheckMaxLength",(e,t)=>{var s;Sn.init(e,t),(s=e._zod.def).when??(s.when=a=>{const r=a.value;return!mp(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=gp(r);a.issues.push({origin:d,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),bA=X("$ZodCheckMinLength",(e,t)=>{var s;Sn.init(e,t),(s=e._zod.def).when??(s.when=a=>{const r=a.value;return!mp(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=gp(r);a.issues.push({origin:d,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),xA=X("$ZodCheckLengthEquals",(e,t)=>{var s;Sn.init(e,t),(s=e._zod.def).when??(s.when=a=>{const r=a.value;return!mp(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=gp(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})}}),Gu=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=()=>{})}),SA=X("$ZodCheckRegex",(e,t)=>{Gu.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})}}),wA=X("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=mA),Gu.init(e,t)}),jA=X("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=pA),Gu.init(e,t)}),NA=X("$ZodCheckIncludes",(e,t)=>{Sn.init(e,t);const s=Ar(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})}}),CA=X("$ZodCheckStartsWith",(e,t)=>{Sn.init(e,t);const s=new RegExp(`^${Ar(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})}}),_A=X("$ZodCheckEndsWith",(e,t)=>{Sn.init(e,t);const s=new RegExp(`.*${Ar(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})}}),kA=X("$ZodCheckOverwrite",(e,t)=>{Sn.init(e,t),e._zod.check=s=>{s.value=t.tx(s.value)}});class zA{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 EA={major:4,minor:3,patch:6},bt=X("$ZodType",(e,t)=>{var s;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=EA;const a=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&a.unshift(e);for(const r of a)for(const c of r._zod.onattach)c(e);if(a.length===0)(s=e._zod).deferred??(s.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const r=(d,f,p)=>{let m=xr(d),b;for(const y of f){if(y._zod.def.when){if(!y._zod.def.when(d))continue}else if(m)continue;const v=d.issues.length,x=y._zod.check(d);if(x instanceof Promise&&p?.async===!1)throw new _r;if(b||x instanceof Promise)b=(b??Promise.resolve()).then(async()=>{await x,d.issues.length!==v&&(m||(m=xr(d,v)))});else{if(d.issues.length===v)continue;m||(m=xr(d,v))}}return b?b.then(()=>d):d},c=(d,f,p)=>{if(xr(d))return d.aborted=!0,d;const m=r(f,a,p);if(m instanceof Promise){if(p.async===!1)throw new _r;return m.then(b=>e._zod.parse(b,p))}return e._zod.parse(m,p)};e._zod.run=(d,f)=>{if(f.skipChecks)return e._zod.parse(d,f);if(f.direction==="backward"){const m=e._zod.parse({value:d.value,issues:[]},{...f,skipChecks:!0});return m instanceof Promise?m.then(b=>c(b,d,f)):c(m,d,f)}const p=e._zod.parse(d,f);if(p instanceof Promise){if(f.async===!1)throw new _r;return p.then(m=>r(m,a,f))}return r(p,a,f)}}tt(e,"~standard",()=>({validate:r=>{try{const c=LO(e,r);return c.success?{value:c.data}:{issues:c.error?.issues}}catch{return MO(e,r).then(d=>d.success?{value:d.data}:{issues:d.error?.issues})}},vendor:"zod",version:1}))}),bp=X("$ZodString",(e,t)=>{bt.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??dA(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}}),vt=X("$ZodStringFormat",(e,t)=>{Gu.init(e,t),bp.init(e,t)}),RA=X("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=XO),vt.init(e,t)}),OA=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=ex(a))}else t.pattern??(t.pattern=ex());vt.init(e,t)}),AA=X("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=WO),vt.init(e,t)}),TA=X("$ZodURL",(e,t)=>{vt.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})}}}),DA=X("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=tA()),vt.init(e,t)}),LA=X("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=YO),vt.init(e,t)}),MA=X("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=FO),vt.init(e,t)}),UA=X("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=GO),vt.init(e,t)}),PA=X("$ZodULID",(e,t)=>{t.pattern??(t.pattern=KO),vt.init(e,t)}),$A=X("$ZodXID",(e,t)=>{t.pattern??(t.pattern=VO),vt.init(e,t)}),IA=X("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=QO),vt.init(e,t)}),BA=X("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=uA(t)),vt.init(e,t)}),qA=X("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=lA),vt.init(e,t)}),HA=X("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=cA(t)),vt.init(e,t)}),ZA=X("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=JO),vt.init(e,t)}),FA=X("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=nA),vt.init(e,t),e._zod.bag.format="ipv4"}),GA=X("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=sA),vt.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})}}}),KA=X("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=iA),vt.init(e,t)}),VA=X("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=aA),vt.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 Kw(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const QA=X("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=rA),vt.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=s=>{Kw(s.value)||s.issues.push({code:"invalid_format",format:"base64",input:s.value,inst:e,continue:!t.abort})}});function YA(e){if(!Iw.test(e))return!1;const t=e.replace(/[-_]/g,a=>a==="-"?"+":"/"),s=t.padEnd(Math.ceil(t.length/4)*4,"=");return Kw(s)}const JA=X("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Iw),vt.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=s=>{YA(s.value)||s.issues.push({code:"invalid_format",format:"base64url",input:s.value,inst:e,continue:!t.abort})}}),XA=X("$ZodE164",(e,t)=>{t.pattern??(t.pattern=oA),vt.init(e,t)});function WA(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 eT=X("$ZodJWT",(e,t)=>{vt.init(e,t),e._zod.check=s=>{WA(s.value,t.alg)||s.issues.push({code:"invalid_format",format:"jwt",input:s.value,inst:e,continue:!t.abort})}}),Vw=X("$ZodNumber",(e,t)=>{bt.init(e,t),e._zod.pattern=e._zod.bag.pattern??Hw,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}}),tT=X("$ZodNumberFormat",(e,t)=>{yA.init(e,t),Vw.init(e,t)}),nT=X("$ZodBoolean",(e,t)=>{bt.init(e,t),e._zod.pattern=hA,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}}),sT=X("$ZodUnknown",(e,t)=>{bt.init(e,t),e._zod.parse=s=>s}),iT=X("$ZodNever",(e,t)=>{bt.init(e,t),e._zod.parse=(s,a)=>(s.issues.push({expected:"never",code:"invalid_type",input:s.value,inst:e}),s)});function tx(e,t,s){e.issues.length&&t.issues.push(...Sr(s,e.issues)),t.value[s]=e.value}const aT=X("$ZodArray",(e,t)=>{bt.init(e,t),e._zod.parse=(s,a)=>{const r=s.value;if(!Array.isArray(r))return s.issues.push({expected:"array",code:"invalid_type",input:r,inst:e}),s;s.value=Array(r.length);const c=[];for(let d=0;d<r.length;d++){const f=r[d],p=t.element._zod.run({value:f,issues:[]},a);p instanceof Promise?c.push(p.then(m=>tx(m,s,d))):tx(p,s,d)}return c.length?Promise.all(c).then(()=>s):s}});function ju(e,t,s,a,r){if(e.issues.length){if(r&&!(s in a))return;t.issues.push(...Sr(s,e.issues))}e.value===void 0?s in a&&(t.value[s]=void 0):t.value[s]=e.value}function Qw(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=NO(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(s)}}function Yw(e,t,s,a,r,c){const d=[],f=r.keySet,p=r.catchall._zod,m=p.def.type,b=p.optout==="optional";for(const y in t){if(f.has(y))continue;if(m==="never"){d.push(y);continue}const v=p.run({value:t[y],issues:[]},a);v instanceof Promise?e.push(v.then(x=>ju(x,s,y,t,b))):ju(v,s,y,t,b)}return d.length&&s.issues.push({code:"unrecognized_keys",keys:d,input:t,inst:c}),e.length?Promise.all(e).then(()=>s):s}const rT=X("$ZodObject",(e,t)=>{if(bt.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const f=t.shape;Object.defineProperty(t,"shape",{get:()=>{const p={...f};return Object.defineProperty(t,"shape",{value:p}),p}})}const a=hp(()=>Qw(t));tt(e._zod,"propValues",()=>{const f=t.shape,p={};for(const m in f){const b=f[m]._zod;if(b.values){p[m]??(p[m]=new Set);for(const y of b.values)p[m].add(y)}}return p});const r=wu,c=t.catchall;let d;e._zod.parse=(f,p)=>{d??(d=a.value);const m=f.value;if(!r(m))return f.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),f;f.value={};const b=[],y=d.shape;for(const v of d.keys){const x=y[v],j=x._zod.optout==="optional",S=x._zod.run({value:m[v],issues:[]},p);S instanceof Promise?b.push(S.then(C=>ju(C,f,v,m,j))):ju(S,f,v,m,j)}return c?Yw(b,m,f,p,a.value,e):b.length?Promise.all(b).then(()=>f):f}}),oT=X("$ZodObjectJIT",(e,t)=>{rT.init(e,t);const s=e._zod.parse,a=hp(()=>Qw(t)),r=v=>{const x=new zA(["shape","payload","ctx"]),j=a.value,S=R=>{const z=Wb(R);return`shape[${z}]._zod.run({ value: input[${z}], issues: [] }, ctx)`};x.write("const input = payload.value;");const C=Object.create(null);let _=0;for(const R of j.keys)C[R]=`key_${_++}`;x.write("const newResult = {};");for(const R of j.keys){const z=C[R],U=Wb(R),M=v[R]?._zod?.optout==="optional";x.write(`const ${z} = ${S(R)};`),M?x.write(`
|
|
59
|
+
if (${z}.issues.length) {
|
|
60
|
+
if (${U} in input) {
|
|
61
|
+
payload.issues = payload.issues.concat(${z}.issues.map(iss => ({
|
|
62
|
+
...iss,
|
|
63
|
+
path: iss.path ? [${U}, ...iss.path] : [${U}]
|
|
64
|
+
})));
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if (${z}.value === undefined) {
|
|
69
|
+
if (${U} in input) {
|
|
70
|
+
newResult[${U}] = undefined;
|
|
71
|
+
}
|
|
72
|
+
} else {
|
|
73
|
+
newResult[${U}] = ${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 ? [${U}, ...iss.path] : [${U}]
|
|
81
|
+
})));
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
if (${z}.value === undefined) {
|
|
85
|
+
if (${U} in input) {
|
|
86
|
+
newResult[${U}] = undefined;
|
|
87
|
+
}
|
|
88
|
+
} else {
|
|
89
|
+
newResult[${U}] = ${z}.value;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
`)}x.write("payload.value = newResult;"),x.write("return payload;");const E=x.compile();return(R,z)=>E(v,R,z)};let c;const d=wu,f=!Tw.jitless,m=f&&wO.value,b=t.catchall;let y;e._zod.parse=(v,x)=>{y??(y=a.value);const j=v.value;return d(j)?f&&m&&x?.async===!1&&x.jitless!==!0?(c||(c=r(t.shape)),v=c(v,x),b?Yw([],j,v,x,y,e):v):s(v,x):(v.issues.push({expected:"object",code:"invalid_type",input:j,inst:e}),v)}});function nx(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=>!xr(c));return r.length===1?(t.value=r[0].value,r[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:s,errors:e.map(c=>c.issues.map(d=>Ui(d,a,Mi())))}),t)}const lT=X("$ZodUnion",(e,t)=>{bt.init(e,t),tt(e._zod,"optin",()=>t.options.some(r=>r._zod.optin==="optional")?"optional":void 0),tt(e._zod,"optout",()=>t.options.some(r=>r._zod.optout==="optional")?"optional":void 0),tt(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),tt(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=>pp(c.source)).join("|")})$`)}});const s=t.options.length===1,a=t.options[0]._zod.run;e._zod.parse=(r,c)=>{if(s)return a(r,c);let d=!1;const f=[];for(const p of t.options){const m=p._zod.run({value:r.value,issues:[]},c);if(m instanceof Promise)f.push(m),d=!0;else{if(m.issues.length===0)return m;f.push(m)}}return d?Promise.all(f).then(p=>nx(p,r,e,c)):nx(f,r,e,c)}}),cT=X("$ZodIntersection",(e,t)=>{bt.init(e,t),e._zod.parse=(s,a)=>{const r=s.value,c=t.left._zod.run({value:r,issues:[]},a),d=t.right._zod.run({value:r,issues:[]},a);return c instanceof Promise||d instanceof Promise?Promise.all([c,d]).then(([p,m])=>sx(s,p,m)):sx(s,c,d)}});function bm(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Or(e)&&Or(t)){const s=Object.keys(t),a=Object.keys(e).filter(c=>s.indexOf(c)!==-1),r={...e,...t};for(const c of a){const d=bm(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=bm(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 sx(e,t,s){const a=new Map;let r;for(const f of t.issues)if(f.code==="unrecognized_keys"){r??(r=f);for(const p of f.keys)a.has(p)||a.set(p,{}),a.get(p).l=!0}else e.issues.push(f);for(const f of s.issues)if(f.code==="unrecognized_keys")for(const p of f.keys)a.has(p)||a.set(p,{}),a.get(p).r=!0;else e.issues.push(f);const c=[...a].filter(([,f])=>f.l&&f.r).map(([f])=>f);if(c.length&&r&&e.issues.push({...r,keys:c}),xr(e))return e;const d=bm(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 uT=X("$ZodRecord",(e,t)=>{bt.init(e,t),e._zod.parse=(s,a)=>{const r=s.value;if(!Or(r))return s.issues.push({expected:"record",code:"invalid_type",input:r,inst:e}),s;const c=[],d=t.keyType._zod.values;if(d){s.value={};const f=new Set;for(const m of d)if(typeof m=="string"||typeof m=="number"||typeof m=="symbol"){f.add(typeof m=="number"?m.toString():m);const b=t.valueType._zod.run({value:r[m],issues:[]},a);b instanceof Promise?c.push(b.then(y=>{y.issues.length&&s.issues.push(...Sr(m,y.issues)),s.value[m]=y.value})):(b.issues.length&&s.issues.push(...Sr(m,b.issues)),s.value[m]=b.value)}let p;for(const m in r)f.has(m)||(p=p??[],p.push(m));p&&p.length>0&&s.issues.push({code:"unrecognized_keys",input:r,inst:e,keys:p})}else{s.value={};for(const f of Reflect.ownKeys(r)){if(f==="__proto__")continue;let p=t.keyType._zod.run({value:f,issues:[]},a);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof f=="string"&&Hw.test(f)&&p.issues.length){const y=t.keyType._zod.run({value:Number(f),issues:[]},a);if(y instanceof Promise)throw new Error("Async schemas not supported in object keys currently");y.issues.length===0&&(p=y)}if(p.issues.length){t.mode==="loose"?s.value[f]=r[f]:s.issues.push({code:"invalid_key",origin:"record",issues:p.issues.map(y=>Ui(y,a,Mi())),input:f,path:[f],inst:e});continue}const b=t.valueType._zod.run({value:r[f],issues:[]},a);b instanceof Promise?c.push(b.then(y=>{y.issues.length&&s.issues.push(...Sr(f,y.issues)),s.value[p.value]=y.value})):(b.issues.length&&s.issues.push(...Sr(f,b.issues)),s.value[p.value]=b.value)}}return c.length?Promise.all(c).then(()=>s):s}}),dT=X("$ZodEnum",(e,t)=>{bt.init(e,t);const s=Dw(t.entries),a=new Set(s);e._zod.values=a,e._zod.pattern=new RegExp(`^(${s.filter(r=>jO.has(typeof r)).map(r=>typeof r=="string"?Ar(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}}),fT=X("$ZodLiteral",(e,t)=>{if(bt.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"?Ar(a):a?Ar(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}}),hT=X("$ZodTransform",(e,t)=>{bt.init(e,t),e._zod.parse=(s,a)=>{if(a.direction==="backward")throw new Aw(e.constructor.name);const r=t.transform(s.value,s);if(a.async)return(r instanceof Promise?r:Promise.resolve(r)).then(d=>(s.value=d,s));if(r instanceof Promise)throw new _r;return s.value=r,s}});function ix(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const Jw=X("$ZodOptional",(e,t)=>{bt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",tt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),tt(e._zod,"pattern",()=>{const s=t.innerType._zod.pattern;return s?new RegExp(`^(${pp(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=>ix(c,s.value)):ix(r,s.value)}return s.value===void 0?s:t.innerType._zod.run(s,a)}}),mT=X("$ZodExactOptional",(e,t)=>{Jw.init(e,t),tt(e._zod,"values",()=>t.innerType._zod.values),tt(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(s,a)=>t.innerType._zod.run(s,a)}),pT=X("$ZodNullable",(e,t)=>{bt.init(e,t),tt(e._zod,"optin",()=>t.innerType._zod.optin),tt(e._zod,"optout",()=>t.innerType._zod.optout),tt(e._zod,"pattern",()=>{const s=t.innerType._zod.pattern;return s?new RegExp(`^(${pp(s.source)}|null)$`):void 0}),tt(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)}),gT=X("$ZodDefault",(e,t)=>{bt.init(e,t),e._zod.optin="optional",tt(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=>ax(c,t)):ax(r,t)}});function ax(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const yT=X("$ZodPrefault",(e,t)=>{bt.init(e,t),e._zod.optin="optional",tt(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))}),vT=X("$ZodNonOptional",(e,t)=>{bt.init(e,t),tt(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=>rx(c,e)):rx(r,e)}});function rx(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 bT=X("$ZodCatch",(e,t)=>{bt.init(e,t),tt(e._zod,"optin",()=>t.innerType._zod.optin),tt(e._zod,"optout",()=>t.innerType._zod.optout),tt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(s,a)=>{if(a.direction==="backward")return t.innerType._zod.run(s,a);const r=t.innerType._zod.run(s,a);return r instanceof Promise?r.then(c=>(s.value=c.value,c.issues.length&&(s.value=t.catchValue({...s,error:{issues:c.issues.map(d=>Ui(d,a,Mi()))},input:s.value}),s.issues=[]),s)):(s.value=r.value,r.issues.length&&(s.value=t.catchValue({...s,error:{issues:r.issues.map(c=>Ui(c,a,Mi()))},input:s.value}),s.issues=[]),s)}}),xT=X("$ZodPipe",(e,t)=>{bt.init(e,t),tt(e._zod,"values",()=>t.in._zod.values),tt(e._zod,"optin",()=>t.in._zod.optin),tt(e._zod,"optout",()=>t.out._zod.optout),tt(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=>Zc(d,t.in,a)):Zc(c,t.in,a)}const r=t.in._zod.run(s,a);return r instanceof Promise?r.then(c=>Zc(c,t.out,a)):Zc(r,t.out,a)}});function Zc(e,t,s){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},s)}const ST=X("$ZodReadonly",(e,t)=>{bt.init(e,t),tt(e._zod,"propValues",()=>t.innerType._zod.propValues),tt(e._zod,"values",()=>t.innerType._zod.values),tt(e._zod,"optin",()=>t.innerType?._zod?.optin),tt(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(ox):ox(r)}});function ox(e){return e.value=Object.freeze(e.value),e}const wT=X("$ZodCustom",(e,t)=>{Sn.init(e,t),bt.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=>lx(c,s,a,e));lx(r,s,a,e)}});function lx(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(nl(r))}}var cx;class jT{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 NT(){return new jT}(cx=globalThis).__zod_globalRegistry??(cx.__zod_globalRegistry=NT());const Io=globalThis.__zod_globalRegistry;function CT(e,t){return new e({type:"string",...we(t)})}function _T(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...we(t)})}function ux(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...we(t)})}function kT(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...we(t)})}function zT(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...we(t)})}function ET(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...we(t)})}function RT(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...we(t)})}function OT(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...we(t)})}function AT(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...we(t)})}function TT(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...we(t)})}function DT(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...we(t)})}function LT(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...we(t)})}function MT(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...we(t)})}function UT(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...we(t)})}function PT(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...we(t)})}function $T(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...we(t)})}function IT(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...we(t)})}function BT(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...we(t)})}function qT(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...we(t)})}function HT(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...we(t)})}function ZT(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...we(t)})}function FT(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...we(t)})}function GT(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...we(t)})}function KT(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...we(t)})}function VT(e,t){return new e({type:"string",format:"date",check:"string_format",...we(t)})}function QT(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...we(t)})}function YT(e,t){return new e({type:"string",format:"duration",check:"string_format",...we(t)})}function JT(e,t){return new e({type:"number",checks:[],...we(t)})}function XT(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...we(t)})}function WT(e,t){return new e({type:"boolean",...we(t)})}function eD(e){return new e({type:"unknown"})}function tD(e,t){return new e({type:"never",...we(t)})}function dx(e,t){return new Fw({check:"less_than",...we(t),value:e,inclusive:!1})}function Fh(e,t){return new Fw({check:"less_than",...we(t),value:e,inclusive:!0})}function fx(e,t){return new Gw({check:"greater_than",...we(t),value:e,inclusive:!1})}function Gh(e,t){return new Gw({check:"greater_than",...we(t),value:e,inclusive:!0})}function hx(e,t){return new gA({check:"multiple_of",...we(t),value:e})}function Xw(e,t){return new vA({check:"max_length",...we(t),maximum:e})}function Nu(e,t){return new bA({check:"min_length",...we(t),minimum:e})}function Ww(e,t){return new xA({check:"length_equals",...we(t),length:e})}function nD(e,t){return new SA({check:"string_format",format:"regex",...we(t),pattern:e})}function sD(e){return new wA({check:"string_format",format:"lowercase",...we(e)})}function iD(e){return new jA({check:"string_format",format:"uppercase",...we(e)})}function aD(e,t){return new NA({check:"string_format",format:"includes",...we(t),includes:e})}function rD(e,t){return new CA({check:"string_format",format:"starts_with",...we(t),prefix:e})}function oD(e,t){return new _A({check:"string_format",format:"ends_with",...we(t),suffix:e})}function Mr(e){return new kA({check:"overwrite",tx:e})}function lD(e){return Mr(t=>t.normalize(e))}function cD(){return Mr(e=>e.trim())}function uD(){return Mr(e=>e.toLowerCase())}function dD(){return Mr(e=>e.toUpperCase())}function fD(){return Mr(e=>SO(e))}function hD(e,t,s){return new e({type:"array",element:t,...we(s)})}function mD(e,t,s){return new e({type:"custom",check:"custom",fn:t,...we(s)})}function pD(e){const t=gD(s=>(s.addIssue=a=>{if(typeof a=="string")s.issues.push(nl(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(nl(r))}},e(s.value,s)));return t}function gD(e,t){const s=new Sn({check:"custom",...we(t)});return s._zod.check=e,s}function ej(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??Io,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 qt(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 b={...s,schemaPath:[...s.schemaPath,e],path:s.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,d.schema,b);else{const v=d.schema,x=t.processors[r.type];if(!x)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${r.type}`);x(e,t,v,b)}const y=e._zod.parent;y&&(d.ref||(d.ref=y),qt(y,t,b),t.seen.get(y).isParent=!0)}const p=t.metadataRegistry.get(e);return p&&Object.assign(d.schema,p),t.io==="input"&&on(e)&&(delete d.schema.examples,delete d.schema.default),t.io==="input"&&d.schema._prefault&&((a=d.schema).default??(a.default=d.schema._prefault)),delete d.schema._prefault,t.seen.get(e).schema}function tj(e,t){const s=e.seen.get(t);if(!s)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=new Map;for(const d of e.seen.entries()){const f=e.metadataRegistry.get(d[0])?.id;if(f){const p=a.get(f);if(p&&p!==d[0])throw new Error(`Duplicate schema id "${f}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);a.set(f,d[0])}}const r=d=>{const f=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const y=e.external.registry.get(d[0])?.id,v=e.external.uri??(j=>j);if(y)return{ref:v(y)};const x=d[1].defId??d[1].schema.id??`schema${e.counter++}`;return d[1].defId=x,{defId:x,ref:`${v("__shared")}#/${f}/${x}`}}if(d[1]===s)return{ref:"#"};const m=`#/${f}/`,b=d[1].schema.id??`__schema${e.counter++}`;return{defId:b,ref:m+b}},c=d=>{if(d[1].schema.$ref)return;const f=d[1],{ref:p,defId:m}=r(d);f.def={...f.schema},m&&(f.defId=m);const b=f.schema;for(const y in b)delete b[y];b.$ref=p};if(e.cycles==="throw")for(const d of e.seen.entries()){const f=d[1];if(f.cycle)throw new Error(`Cycle detected: #/${f.cycle?.join("/")}/<root>
|
|
93
|
+
|
|
94
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const d of e.seen.entries()){const f=d[1];if(t===d[0]){c(d);continue}if(e.external){const m=e.external.registry.get(d[0])?.id;if(t!==d[0]&&m){c(d);continue}}if(e.metadataRegistry.get(d[0])?.id){c(d);continue}if(f.cycle){c(d);continue}if(f.count>1&&e.reused==="ref"){c(d);continue}}}function nj(e,t){const s=e.seen.get(t);if(!s)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=d=>{const f=e.seen.get(d);if(f.ref===null)return;const p=f.def??f.schema,m={...p},b=f.ref;if(f.ref=null,b){a(b);const v=e.seen.get(b),x=v.schema;if(x.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(p.allOf=p.allOf??[],p.allOf.push(x)):Object.assign(p,x),Object.assign(p,m),d._zod.parent===b)for(const S in p)S==="$ref"||S==="allOf"||S in m||delete p[S];if(x.$ref&&v.def)for(const S in p)S==="$ref"||S==="allOf"||S in v.def&&JSON.stringify(p[S])===JSON.stringify(v.def[S])&&delete p[S]}const y=d._zod.parent;if(y&&y!==b){a(y);const v=e.seen.get(y);if(v?.schema.$ref&&(p.$ref=v.schema.$ref,v.def))for(const x in p)x==="$ref"||x==="allOf"||x in v.def&&JSON.stringify(p[x])===JSON.stringify(v.def[x])&&delete p[x]}e.override({zodSchema:d,jsonSchema:p,path:f.path??[]})};for(const d of[...e.seen.entries()].reverse())a(d[0]);const r={};if(e.target==="draft-2020-12"?r.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?r.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?r.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const d=e.external.registry.get(t)?.id;if(!d)throw new Error("Schema is missing an `id` property");r.$id=e.external.uri(d)}Object.assign(r,s.def??s.schema);const c=e.external?.defs??{};for(const d of e.seen.entries()){const f=d[1];f.def&&f.defId&&(c[f.defId]=f.def)}e.external||Object.keys(c).length>0&&(e.target==="draft-2020-12"?r.$defs=c:r.definitions=c);try{const d=JSON.parse(JSON.stringify(r));return Object.defineProperty(d,"~standard",{value:{...t["~standard"],jsonSchema:{input:Cu(t,"input",e.processors),output:Cu(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 yD=(e,t={})=>s=>{const a=ej({...s,processors:t});return qt(e,a),tj(a,e),nj(a,e)},Cu=(e,t,s={})=>a=>{const{libraryOptions:r,target:c}=a??{},d=ej({...r??{},target:c,io:t,processors:s});return qt(e,d),tj(d,e),nj(d,e)},vD={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},bD=(e,t,s,a)=>{const r=s;r.type="string";const{minimum:c,maximum:d,format:f,patterns:p,contentEncoding:m}=e._zod.bag;if(typeof c=="number"&&(r.minLength=c),typeof d=="number"&&(r.maxLength=d),f&&(r.format=vD[f]??f,r.format===""&&delete r.format,f==="time"&&delete r.format),m&&(r.contentEncoding=m),p&&p.size>0){const b=[...p];b.length===1?r.pattern=b[0].source:b.length>1&&(r.allOf=[...b.map(y=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:y.source}))])}},xD=(e,t,s,a)=>{const r=s,{minimum:c,maximum:d,format:f,multipleOf:p,exclusiveMaximum:m,exclusiveMinimum:b}=e._zod.bag;typeof f=="string"&&f.includes("int")?r.type="integer":r.type="number",typeof b=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(r.minimum=b,r.exclusiveMinimum=!0):r.exclusiveMinimum=b),typeof c=="number"&&(r.minimum=c,typeof b=="number"&&t.target!=="draft-04"&&(b>=c?delete r.minimum:delete r.exclusiveMinimum)),typeof m=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(r.maximum=m,r.exclusiveMaximum=!0):r.exclusiveMaximum=m),typeof d=="number"&&(r.maximum=d,typeof m=="number"&&t.target!=="draft-04"&&(m<=d?delete r.maximum:delete r.exclusiveMaximum)),typeof p=="number"&&(r.multipleOf=p)},SD=(e,t,s,a)=>{s.type="boolean"},wD=(e,t,s,a)=>{s.not={}},jD=(e,t,s,a)=>{},ND=(e,t,s,a)=>{const r=e._zod.def,c=Dw(r.entries);c.every(d=>typeof d=="number")&&(s.type="number"),c.every(d=>typeof d=="string")&&(s.type="string"),s.enum=c},CD=(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},_D=(e,t,s,a)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},kD=(e,t,s,a)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},zD=(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=qt(c.element,t,{...a,path:[...a.path,"items"]})},ED=(e,t,s,a)=>{const r=s,c=e._zod.def;r.type="object",r.properties={};const d=c.shape;for(const m in d)r.properties[m]=qt(d[m],t,{...a,path:[...a.path,"properties",m]});const f=new Set(Object.keys(d)),p=new Set([...f].filter(m=>{const b=c.shape[m]._zod;return t.io==="input"?b.optin===void 0:b.optout===void 0}));p.size>0&&(r.required=Array.from(p)),c.catchall?._zod.def.type==="never"?r.additionalProperties=!1:c.catchall?c.catchall&&(r.additionalProperties=qt(c.catchall,t,{...a,path:[...a.path,"additionalProperties"]})):t.io==="output"&&(r.additionalProperties=!1)},RD=(e,t,s,a)=>{const r=e._zod.def,c=r.inclusive===!1,d=r.options.map((f,p)=>qt(f,t,{...a,path:[...a.path,c?"oneOf":"anyOf",p]}));c?s.oneOf=d:s.anyOf=d},OD=(e,t,s,a)=>{const r=e._zod.def,c=qt(r.left,t,{...a,path:[...a.path,"allOf",0]}),d=qt(r.right,t,{...a,path:[...a.path,"allOf",1]}),f=m=>"allOf"in m&&Object.keys(m).length===1,p=[...f(c)?c.allOf:[c],...f(d)?d.allOf:[d]];s.allOf=p},AD=(e,t,s,a)=>{const r=s,c=e._zod.def;r.type="object";const d=c.keyType,p=d._zod.bag?.patterns;if(c.mode==="loose"&&p&&p.size>0){const b=qt(c.valueType,t,{...a,path:[...a.path,"patternProperties","*"]});r.patternProperties={};for(const y of p)r.patternProperties[y.source]=b}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(r.propertyNames=qt(c.keyType,t,{...a,path:[...a.path,"propertyNames"]})),r.additionalProperties=qt(c.valueType,t,{...a,path:[...a.path,"additionalProperties"]});const m=d._zod.values;if(m){const b=[...m].filter(y=>typeof y=="string"||typeof y=="number");b.length>0&&(r.required=b)}},TD=(e,t,s,a)=>{const r=e._zod.def,c=qt(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"}]},DD=(e,t,s,a)=>{const r=e._zod.def;qt(r.innerType,t,a);const c=t.seen.get(e);c.ref=r.innerType},LD=(e,t,s,a)=>{const r=e._zod.def;qt(r.innerType,t,a);const c=t.seen.get(e);c.ref=r.innerType,s.default=JSON.parse(JSON.stringify(r.defaultValue))},MD=(e,t,s,a)=>{const r=e._zod.def;qt(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)))},UD=(e,t,s,a)=>{const r=e._zod.def;qt(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},PD=(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;qt(c,t,a);const d=t.seen.get(e);d.ref=c},$D=(e,t,s,a)=>{const r=e._zod.def;qt(r.innerType,t,a);const c=t.seen.get(e);c.ref=r.innerType,s.readOnly=!0},sj=(e,t,s,a)=>{const r=e._zod.def;qt(r.innerType,t,a);const c=t.seen.get(e);c.ref=r.innerType},ID=X("ZodISODateTime",(e,t)=>{BA.init(e,t),St.init(e,t)});function BD(e){return KT(ID,e)}const qD=X("ZodISODate",(e,t)=>{qA.init(e,t),St.init(e,t)});function HD(e){return VT(qD,e)}const ZD=X("ZodISOTime",(e,t)=>{HA.init(e,t),St.init(e,t)});function FD(e){return QT(ZD,e)}const GD=X("ZodISODuration",(e,t)=>{ZA.init(e,t),St.init(e,t)});function KD(e){return YT(GD,e)}const VD=(e,t)=>{Pw.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:s=>DO(e,s)},flatten:{value:s=>TO(e,s)},addIssue:{value:s=>{e.issues.push(s),e.message=JSON.stringify(e.issues,vm,2)}},addIssues:{value:s=>{e.issues.push(...s),e.message=JSON.stringify(e.issues,vm,2)}},isEmpty:{get(){return e.issues.length===0}}})},Vn=X("ZodError",VD,{Parent:Error}),QD=yp(Vn),YD=vp(Vn),JD=Zu(Vn),XD=Fu(Vn),WD=UO(Vn),eL=PO(Vn),tL=$O(Vn),nL=IO(Vn),sL=BO(Vn),iL=qO(Vn),aL=HO(Vn),rL=ZO(Vn),xt=X("ZodType",(e,t)=>(bt.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Cu(e,"input"),output:Cu(e,"output")}}),e.toJSONSchema=yD(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...s)=>e.clone(Ii(t,{checks:[...t.checks??[],...s.map(a=>typeof a=="function"?{_zod:{check:a,def:{check:"custom"},onattach:[]}}:a)]}),{parent:!0}),e.with=e.check,e.clone=(s,a)=>Bi(e,s,a),e.brand=()=>e,e.register=((s,a)=>(s.add(e,a),e)),e.parse=(s,a)=>QD(e,s,a,{callee:e.parse}),e.safeParse=(s,a)=>JD(e,s,a),e.parseAsync=async(s,a)=>YD(e,s,a,{callee:e.parseAsync}),e.safeParseAsync=async(s,a)=>XD(e,s,a),e.spa=e.safeParseAsync,e.encode=(s,a)=>WD(e,s,a),e.decode=(s,a)=>eL(e,s,a),e.encodeAsync=async(s,a)=>tL(e,s,a),e.decodeAsync=async(s,a)=>nL(e,s,a),e.safeEncode=(s,a)=>sL(e,s,a),e.safeDecode=(s,a)=>iL(e,s,a),e.safeEncodeAsync=async(s,a)=>aL(e,s,a),e.safeDecodeAsync=async(s,a)=>rL(e,s,a),e.refine=(s,a)=>e.check(eM(s,a)),e.superRefine=s=>e.check(tM(s)),e.overwrite=s=>e.check(Mr(s)),e.optional=()=>gx(e),e.exactOptional=()=>BL(e),e.nullable=()=>yx(e),e.nullish=()=>gx(yx(e)),e.nonoptional=s=>KL(e,s),e.array=()=>Qe(e),e.or=s=>TL([e,s]),e.and=s=>LL(e,s),e.transform=s=>vx(e,$L(s)),e.default=s=>ZL(e,s),e.prefault=s=>GL(e,s),e.catch=s=>QL(e,s),e.pipe=s=>vx(e,s),e.readonly=()=>XL(e),e.describe=s=>{const a=e.clone();return Io.add(a,{description:s}),a},Object.defineProperty(e,"description",{get(){return Io.get(e)?.description},configurable:!0}),e.meta=(...s)=>{if(s.length===0)return Io.get(e);const a=e.clone();return Io.add(a,s[0]),a},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=s=>s(e),e)),ij=X("_ZodString",(e,t)=>{bp.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(a,r,c)=>bD(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(nD(...a)),e.includes=(...a)=>e.check(aD(...a)),e.startsWith=(...a)=>e.check(rD(...a)),e.endsWith=(...a)=>e.check(oD(...a)),e.min=(...a)=>e.check(Nu(...a)),e.max=(...a)=>e.check(Xw(...a)),e.length=(...a)=>e.check(Ww(...a)),e.nonempty=(...a)=>e.check(Nu(1,...a)),e.lowercase=a=>e.check(sD(a)),e.uppercase=a=>e.check(iD(a)),e.trim=()=>e.check(cD()),e.normalize=(...a)=>e.check(lD(...a)),e.toLowerCase=()=>e.check(uD()),e.toUpperCase=()=>e.check(dD()),e.slugify=()=>e.check(fD())}),oL=X("ZodString",(e,t)=>{bp.init(e,t),ij.init(e,t),e.email=s=>e.check(_T(lL,s)),e.url=s=>e.check(OT(cL,s)),e.jwt=s=>e.check(GT(NL,s)),e.emoji=s=>e.check(AT(uL,s)),e.guid=s=>e.check(ux(mx,s)),e.uuid=s=>e.check(kT(Fc,s)),e.uuidv4=s=>e.check(zT(Fc,s)),e.uuidv6=s=>e.check(ET(Fc,s)),e.uuidv7=s=>e.check(RT(Fc,s)),e.nanoid=s=>e.check(TT(dL,s)),e.guid=s=>e.check(ux(mx,s)),e.cuid=s=>e.check(DT(fL,s)),e.cuid2=s=>e.check(LT(hL,s)),e.ulid=s=>e.check(MT(mL,s)),e.base64=s=>e.check(HT(SL,s)),e.base64url=s=>e.check(ZT(wL,s)),e.xid=s=>e.check(UT(pL,s)),e.ksuid=s=>e.check(PT(gL,s)),e.ipv4=s=>e.check($T(yL,s)),e.ipv6=s=>e.check(IT(vL,s)),e.cidrv4=s=>e.check(BT(bL,s)),e.cidrv6=s=>e.check(qT(xL,s)),e.e164=s=>e.check(FT(jL,s)),e.datetime=s=>e.check(BD(s)),e.date=s=>e.check(HD(s)),e.time=s=>e.check(FD(s)),e.duration=s=>e.check(KD(s))});function K(e){return CT(oL,e)}const St=X("ZodStringFormat",(e,t)=>{vt.init(e,t),ij.init(e,t)}),lL=X("ZodEmail",(e,t)=>{AA.init(e,t),St.init(e,t)}),mx=X("ZodGUID",(e,t)=>{RA.init(e,t),St.init(e,t)}),Fc=X("ZodUUID",(e,t)=>{OA.init(e,t),St.init(e,t)}),cL=X("ZodURL",(e,t)=>{TA.init(e,t),St.init(e,t)}),uL=X("ZodEmoji",(e,t)=>{DA.init(e,t),St.init(e,t)}),dL=X("ZodNanoID",(e,t)=>{LA.init(e,t),St.init(e,t)}),fL=X("ZodCUID",(e,t)=>{MA.init(e,t),St.init(e,t)}),hL=X("ZodCUID2",(e,t)=>{UA.init(e,t),St.init(e,t)}),mL=X("ZodULID",(e,t)=>{PA.init(e,t),St.init(e,t)}),pL=X("ZodXID",(e,t)=>{$A.init(e,t),St.init(e,t)}),gL=X("ZodKSUID",(e,t)=>{IA.init(e,t),St.init(e,t)}),yL=X("ZodIPv4",(e,t)=>{FA.init(e,t),St.init(e,t)}),vL=X("ZodIPv6",(e,t)=>{GA.init(e,t),St.init(e,t)}),bL=X("ZodCIDRv4",(e,t)=>{KA.init(e,t),St.init(e,t)}),xL=X("ZodCIDRv6",(e,t)=>{VA.init(e,t),St.init(e,t)}),SL=X("ZodBase64",(e,t)=>{QA.init(e,t),St.init(e,t)}),wL=X("ZodBase64URL",(e,t)=>{JA.init(e,t),St.init(e,t)}),jL=X("ZodE164",(e,t)=>{XA.init(e,t),St.init(e,t)}),NL=X("ZodJWT",(e,t)=>{eT.init(e,t),St.init(e,t)}),aj=X("ZodNumber",(e,t)=>{Vw.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(a,r,c)=>xD(e,a,r),e.gt=(a,r)=>e.check(fx(a,r)),e.gte=(a,r)=>e.check(Gh(a,r)),e.min=(a,r)=>e.check(Gh(a,r)),e.lt=(a,r)=>e.check(dx(a,r)),e.lte=(a,r)=>e.check(Fh(a,r)),e.max=(a,r)=>e.check(Fh(a,r)),e.int=a=>e.check(px(a)),e.safe=a=>e.check(px(a)),e.positive=a=>e.check(fx(0,a)),e.nonnegative=a=>e.check(Gh(0,a)),e.negative=a=>e.check(dx(0,a)),e.nonpositive=a=>e.check(Fh(0,a)),e.multipleOf=(a,r)=>e.check(hx(a,r)),e.step=(a,r)=>e.check(hx(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 ct(e){return JT(aj,e)}const CL=X("ZodNumberFormat",(e,t)=>{tT.init(e,t),aj.init(e,t)});function px(e){return XT(CL,e)}const _L=X("ZodBoolean",(e,t)=>{nT.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>SD(e,s,a)});function ol(e){return WT(_L,e)}const kL=X("ZodUnknown",(e,t)=>{sT.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>jD()});function xm(){return eD(kL)}const zL=X("ZodNever",(e,t)=>{iT.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>wD(e,s,a)});function EL(e){return tD(zL,e)}const RL=X("ZodArray",(e,t)=>{aT.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>zD(e,s,a,r),e.element=t.element,e.min=(s,a)=>e.check(Nu(s,a)),e.nonempty=s=>e.check(Nu(1,s)),e.max=(s,a)=>e.check(Xw(s,a)),e.length=(s,a)=>e.check(Ww(s,a)),e.unwrap=()=>e.element});function Qe(e,t){return hD(RL,e,t)}const OL=X("ZodObject",(e,t)=>{oT.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>ED(e,s,a,r),tt(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:xm()}),e.loose=()=>e.clone({...e._zod.def,catchall:xm()}),e.strict=()=>e.clone({...e._zod.def,catchall:EL()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=s=>zO(e,s),e.safeExtend=s=>EO(e,s),e.merge=s=>RO(e,s),e.pick=s=>_O(e,s),e.omit=s=>kO(e,s),e.partial=(...s)=>OO(rj,e,s[0]),e.required=(...s)=>AO(oj,e,s[0])});function Fe(e,t){const s={type:"object",shape:e??{},...we(t)};return new OL(s)}const AL=X("ZodUnion",(e,t)=>{lT.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>RD(e,s,a,r),e.options=t.options});function TL(e,t){return new AL({type:"union",options:e,...we(t)})}const DL=X("ZodIntersection",(e,t)=>{cT.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>OD(e,s,a,r)});function LL(e,t){return new DL({type:"intersection",left:e,right:t})}const ML=X("ZodRecord",(e,t)=>{uT.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>AD(e,s,a,r),e.keyType=t.keyType,e.valueType=t.valueType});function Ku(e,t,s){return new ML({type:"record",keyType:e,valueType:t,...we(s)})}const Sm=X("ZodEnum",(e,t)=>{dT.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(a,r,c)=>ND(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 Sm({...t,checks:[],...we(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 Sm({...t,checks:[],...we(r),entries:c})}});function xn(e,t){const s=Array.isArray(e)?Object.fromEntries(e.map(a=>[a,a])):e;return new Sm({type:"enum",entries:s,...we(t)})}const UL=X("ZodLiteral",(e,t)=>{fT.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>CD(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 _u(e,t){return new UL({type:"literal",values:Array.isArray(e)?e:[e],...we(t)})}const PL=X("ZodTransform",(e,t)=>{hT.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>kD(e,s),e._zod.parse=(s,a)=>{if(a.direction==="backward")throw new Aw(e.constructor.name);s.addIssue=c=>{if(typeof c=="string")s.issues.push(nl(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(nl(d))}};const r=t.transform(s.value,s);return r instanceof Promise?r.then(c=>(s.value=c,s)):(s.value=r,s)}});function $L(e){return new PL({type:"transform",transform:e})}const rj=X("ZodOptional",(e,t)=>{Jw.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>sj(e,s,a,r),e.unwrap=()=>e._zod.def.innerType});function gx(e){return new rj({type:"optional",innerType:e})}const IL=X("ZodExactOptional",(e,t)=>{mT.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>sj(e,s,a,r),e.unwrap=()=>e._zod.def.innerType});function BL(e){return new IL({type:"optional",innerType:e})}const qL=X("ZodNullable",(e,t)=>{pT.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>TD(e,s,a,r),e.unwrap=()=>e._zod.def.innerType});function yx(e){return new qL({type:"nullable",innerType:e})}const HL=X("ZodDefault",(e,t)=>{gT.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>LD(e,s,a,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function ZL(e,t){return new HL({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Mw(t)}})}const FL=X("ZodPrefault",(e,t)=>{yT.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>MD(e,s,a,r),e.unwrap=()=>e._zod.def.innerType});function GL(e,t){return new FL({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Mw(t)}})}const oj=X("ZodNonOptional",(e,t)=>{vT.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>DD(e,s,a,r),e.unwrap=()=>e._zod.def.innerType});function KL(e,t){return new oj({type:"nonoptional",innerType:e,...we(t)})}const VL=X("ZodCatch",(e,t)=>{bT.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>UD(e,s,a,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function QL(e,t){return new VL({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const YL=X("ZodPipe",(e,t)=>{xT.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>PD(e,s,a,r),e.in=t.in,e.out=t.out});function vx(e,t){return new YL({type:"pipe",in:e,out:t})}const JL=X("ZodReadonly",(e,t)=>{ST.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>$D(e,s,a,r),e.unwrap=()=>e._zod.def.innerType});function XL(e){return new JL({type:"readonly",innerType:e})}const WL=X("ZodCustom",(e,t)=>{wT.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>_D(e,s)});function eM(e,t={}){return mD(WL,e,t)}function tM(e){return pD(e)}Fe({maxConcurrency:ct().int().positive(),maxRequestsPerMinute:ct().int().positive(),maxRequestsPerDay:ct().int().positive()});const Ur=K().min(1);K().min(1);const xp=Fe({label:K().min(1),city:K().min(1),region:K().min(1),country:K().length(2),timezone:K().optional()}),lj=xn(["citation.lost","citation.gained","run.completed","run.failed"]);Fe({id:K(),projectId:K(),channel:_u("webhook"),url:K().url(),events:Qe(lj),enabled:ol().default(!0),webhookSecret:K().optional(),createdAt:K(),updatedAt:K()});const cj=xn(["cli","api","config-file"]);function nM(e){const t=new Set,s=new Set;for(const a of e){if(t.has(a.label)){s.add(a.label);continue}t.add(a.label)}return[...s]}function sM(e,t){return t?e.some(s=>s.label===t):!0}Fe({displayName:K().min(1),canonicalDomain:K().min(1),ownedDomains:Qe(K().min(1)).optional(),country:K().length(2),language:K().min(2),tags:Qe(K()).optional(),labels:Ku(K(),K()).optional(),providers:Qe(Ur).optional(),locations:Qe(xp).optional(),defaultLocation:K().nullable().optional(),configSource:cj.optional()});Fe({id:K(),name:K(),displayName:K().optional(),canonicalDomain:K(),ownedDomains:Qe(K()).default([]),country:K().length(2),language:K().min(2),tags:Qe(K()).default([]),labels:Ku(K(),K()).default({}),locations:Qe(xp).default([]),defaultLocation:K().nullable().optional(),configSource:cj.default("cli"),configRevision:ct().int().positive().default(1),createdAt:K().optional(),updatedAt:K().optional()});function wm(e){let t=e.trim().toLowerCase();try{t.includes("://")&&(t=new URL(t).hostname.toLowerCase())}catch{}return t.replace(/^www\./,"")}function iM(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=wm(c);s.has(d)||(s.add(d),a.push(c))}return a}const aM=Fe({name:K().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:Ku(K(),K()).optional().default({})}),rM=Fe({preset:K().optional(),cron:K().optional(),timezone:K().optional().default("UTC"),providers:Qe(Ur).optional().default([])}).refine(e=>e.preset&&!e.cron||!e.preset&&e.cron,{message:'Exactly one of "preset" or "cron" must be provided'}).optional(),oM=Fe({channel:_u("webhook"),url:K().url(),events:Qe(lj).min(1)}),lM=Fe({gsc:Fe({propertyUrl:K()}).optional(),syncSchedule:Fe({preset:K().optional(),cron:K().optional()}).optional()}).optional(),cM=Fe({displayName:K().min(1),canonicalDomain:K().min(1),ownedDomains:Qe(K().min(1)).optional().default([]),country:K().length(2),language:K().min(2),keywords:Qe(K().min(1)).optional().default([]),competitors:Qe(K().min(1)).optional().default([]),providers:Qe(Ur).optional().default([]),locations:Qe(xp).optional().default([]),defaultLocation:K().optional(),schedule:rM,notifications:Qe(oM).optional().default([]),google:lM}).superRefine((e,t)=>{const s=nM(e.locations);s.length>0&&t.addIssue({code:"custom",message:`Duplicate location labels are not allowed: ${s.join(", ")}`,path:["locations"]}),sM(e.locations,e.defaultLocation)||t.addIssue({code:"custom",message:`defaultLocation "${e.defaultLocation}" must match a configured location label`,path:["defaultLocation"]})});Fe({apiVersion:_u("canonry/v1"),kind:_u("Project"),metadata:aM,spec:cM});const uM=xn(["gsc","ga4"]);Fe({id:K(),domain:K(),connectionType:uM,propertyId:K().nullable().optional(),sitemapUrl:K().nullable().optional(),scopes:Qe(K()).default([]),createdAt:K(),updatedAt:K()});Fe({date:K(),query:K(),page:K(),country:K().nullable().optional(),device:K().nullable().optional(),clicks:ct(),impressions:ct(),ctr:ct(),position:ct()});const jm=Fe({id:K(),url:K(),indexingState:K().nullable().optional(),verdict:K().nullable().optional(),coverageState:K().nullable().optional(),pageFetchState:K().nullable().optional(),robotsTxtState:K().nullable().optional(),crawlTime:K().nullable().optional(),lastCrawlResult:K().nullable().optional(),isMobileFriendly:ol().nullable().optional(),richResults:Qe(K()).default([]),inspectedAt:K()});xn(["stable","reindexed","deindexed","still-missing","new"]);const dM=Fe({url:K(),previousState:K().nullable(),currentState:K().nullable(),transitionDate:K()}),fM=Fe({reason:K(),count:ct(),urls:Qe(jm).default([])});Fe({summary:Fe({total:ct(),indexed:ct(),notIndexed:ct(),deindexed:ct(),percentage:ct()}),lastInspectedAt:K().nullable(),indexed:Qe(jm).default([]),notIndexed:Qe(jm).default([]),deindexed:Qe(dM).default([]),reasonGroups:Qe(fM).default([])});Fe({url:K(),type:xn(["URL_UPDATED","URL_DELETED"]),notifiedAt:K()});Fe({url:K(),type:xn(["URL_UPDATED","URL_DELETED"]),notifiedAt:K(),status:xn(["success","error"]),error:K().optional()});Fe({date:K(),indexed:ct(),notIndexed:ct(),reasonBreakdown:Ku(K(),ct()).default({})});Fe({id:K(),domain:K(),siteUrl:K().nullable().optional(),createdAt:K(),updatedAt:K()});const bx=Fe({id:K(),url:K(),httpCode:ct().nullable().optional(),inIndex:ol().nullable().optional(),lastCrawledDate:K().nullable().optional(),inIndexDate:K().nullable().optional(),inspectedAt:K()});Fe({summary:Fe({total:ct(),indexed:ct(),notIndexed:ct(),percentage:ct()}),lastInspectedAt:K().nullable(),indexed:Qe(bx).default([]),notIndexed:Qe(bx).default([])});Fe({query:K(),impressions:ct(),clicks:ct(),ctr:ct(),averagePosition:ct()});Fe({url:K(),status:xn(["success","error"]),submittedAt:K(),error:K().optional()});const hM=xn(["queued","running","completed","partial","failed","cancelled"]),mM=xn(["answer-visibility","site-audit","gsc-sync","inspect-sitemap"]),pM=xn(["manual","scheduled","config-apply"]),gM=xn(["cited","not-cited"]),yM=xn(["new","cited","lost","emerging","not-cited"]);Fe({id:K(),projectId:K(),kind:mM,status:hM,trigger:pM.default("manual"),location:K().nullable().optional(),startedAt:K().nullable().optional(),finishedAt:K().nullable().optional(),error:K().nullable().optional(),createdAt:K()});const vM=Fe({uri:K(),title:K()});Fe({id:K(),runId:K(),keywordId:K(),keyword:K().optional(),provider:Ur,citationState:gM,transition:yM.optional(),answerText:K().nullable().optional(),citedDomains:Qe(K()).default([]),competitorOverlap:Qe(K()).default([]),groundingSources:Qe(vM).default([]),searchQueries:Qe(K()).default([]),model:K().nullable().optional(),location:K().nullable().optional(),createdAt:K()});Fe({id:K(),projectId:K().nullable().optional(),actor:K(),action:K(),entityType:K(),entityId:K().nullable().optional(),diff:xm().optional(),createdAt:K()});Fe({id:K(),projectId:K(),cronExpr:K(),preset:K().nullable().optional(),timezone:K().default("UTC"),enabled:ol().default(!0),providers:Qe(Ur).default([]),lastRunAt:K().nullable().optional(),nextRunAt:K().nullable().optional(),createdAt:K(),updatedAt:K()});Fe({preset:K().optional(),cron:K().optional(),timezone:K().optional().default("UTC"),enabled:ol().optional().default(!0),providers:Qe(Ur).optional().default([])}).refine(e=>e.preset&&!e.cron||!e.preset&&e.cron,{message:'Exactly one of "preset" or "cron" must be provided'});function Nm({state:e}){return l.jsx(lt,{tone:TE(e),children:$u(e)})}function xx(e,t){const s=t.filter(d=>d.trim().length>1),a=e.split(/(\*\*[^*]+\*\*)/).filter(Boolean).map(d=>d.startsWith("**")&&d.endsWith("**")?{type:"bold",value:d.slice(2,-2)}:{type:"text",value:d});if(s.length===0)return a.map((d,f)=>d.type==="bold"?ns.createElement("strong",{key:`b-${f}`,className:"text-zinc-200 font-semibold"},d.value):d.value).filter(Boolean);const r=s.map(d=>d.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),c=new RegExp(`(${r.join("|")})`,"gi");return a.flatMap((d,f)=>d.value.split(c).map((m,b)=>m?b%2===1?d.type==="bold"?ns.createElement("mark",{key:`hl-${f}-${b}`,className:"answer-highlight"},ns.createElement("strong",{className:"text-zinc-200 font-semibold"},m)):ns.createElement("mark",{key:`hl-${f}-${b}`,className:"answer-highlight"},m):d.type==="bold"?ns.createElement("strong",{key:`b-${f}-${b}`,className:"text-zinc-200 font-semibold"},m):m:null)).filter(Boolean)}class uj extends Error{code;statusCode;constructor(t,s,a){super(t),this.name="ApiError",this.code=a??"UNKNOWN",this.statusCode=s}}function bM(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,"")+"/api/v1":"/api/v1"}const xM=bM();function SM(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.apiKey?window.__CANONRY_CONFIG__.apiKey:""}async function xe(e,t){const s=SM(),a=await fetch(`${xM}${e}`,{...t,headers:{"Content-Type":"application/json",...s?{Authorization:`Bearer ${s}`}:{},...t?.headers}});if(!a.ok){const r=await a.text();let c=`API ${a.status}: ${a.statusText}`,d;if(r)try{const f=JSON.parse(r);typeof f.error=="string"?c=f.error:f.error?.message?(c=f.error.message,d=f.error.code):f.message&&(c=f.message)}catch{c=r}throw new uj(c,a.status,d)}if(a.status!==204)return a.json()}function dj(){return xe("/projects")}function Sp(e){return xe(`/projects/${encodeURIComponent(e)}`)}function fj(){return xe("/runs")}function sl(e){return xe(`/runs/${encodeURIComponent(e)}`)}function hj(e){return xe(`/projects/${encodeURIComponent(e)}/keywords`)}function wp(e){return xe(`/projects/${encodeURIComponent(e)}/competitors`)}function jp(e,t){const s=new URLSearchParams;t!==void 0&&s.set("location",t);const a=s.toString();return xe(`/projects/${encodeURIComponent(e)}/timeline${a?`?${a}`:""}`)}function ll(e,t){return xe(`/projects/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}function mj(e,t){return xe(`/projects/${encodeURIComponent(e)}/keywords`,{method:"PUT",body:JSON.stringify({keywords:t})})}function pj(e,t){return xe(`/projects/${encodeURIComponent(e)}/keywords`,{method:"POST",body:JSON.stringify({keywords:t})})}function Np(e,t){return xe(`/projects/${encodeURIComponent(e)}/competitors`,{method:"PUT",body:JSON.stringify({competitors:t})})}async function Cm(e,t){const s=await Sp(e);return ll(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 gj(e,t){const s=await Sp(e);return ll(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 Cp(e,t){const s={};return xe(`/projects/${encodeURIComponent(e)}/runs`,{method:"POST",body:JSON.stringify(s)})}function yj(e,t){return xe(`/projects/${encodeURIComponent(e)}/locations`,{method:"POST",body:JSON.stringify(t)})}async function vj(e,t){await xe(`/projects/${encodeURIComponent(e)}/locations/${encodeURIComponent(t)}`,{method:"DELETE"})}function bj(e,t){return xe(`/projects/${encodeURIComponent(e)}/locations/default`,{method:"PUT",body:JSON.stringify({label:t})})}async function xj(e){await xe(`/projects/${encodeURIComponent(e)}`,{method:"DELETE",body:"{}"})}function Sj(e){return xe(`/projects/${encodeURIComponent(e)}/export`)}function _p(){return xe("/settings")}function wj(e,t){return xe(`/settings/providers/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}function jj(e){return xe("/settings/google",{method:"PUT",body:JSON.stringify(e)})}async function Nj(e){try{return await xe(`/projects/${encodeURIComponent(e)}/schedule`)}catch(t){if(t instanceof Error&&t.message.includes("404"))return null;throw t}}function _m(e,t){return xe(`/projects/${encodeURIComponent(e)}/schedule`,{method:"PUT",body:JSON.stringify(t)})}async function Cj(e){await xe(`/projects/${encodeURIComponent(e)}/schedule`,{method:"DELETE",body:"{}"})}function _j(e){return xe(`/projects/${encodeURIComponent(e)}/notifications`)}function kj(e,t){return xe(`/projects/${encodeURIComponent(e)}/notifications`,{method:"POST",body:JSON.stringify(t)})}async function zj(e,t){await xe(`/projects/${encodeURIComponent(e)}/notifications/${encodeURIComponent(t)}`,{method:"DELETE",body:"{}"})}function Ej(e,t){return xe(`/projects/${encodeURIComponent(e)}/notifications/${encodeURIComponent(t)}/test`,{method:"POST",body:"{}"})}function Rj(e,t,s){return xe(`/projects/${encodeURIComponent(e)}/keywords/generate`,{method:"POST",body:JSON.stringify({provider:t,count:s})})}function Oj(e){return xe("/apply",{method:"POST",body:JSON.stringify(e)})}function wM(e){return xe("/runs",{method:"POST",body:JSON.stringify(e??{})})}function Aj(e){return xe(`/projects/${encodeURIComponent(e)}/google/connections`)}function Tj(e,t){return xe(`/projects/${encodeURIComponent(e)}/google/connect`,{method:"POST",body:JSON.stringify({type:t})})}function Dj(e,t){return xe(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}`,{method:"DELETE",body:"{}"})}function Lj(e){return xe(`/projects/${encodeURIComponent(e)}/google/properties`)}function Mj(e,t,s){return xe(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}/property`,{method:"PUT",body:JSON.stringify({propertyId:s})})}function Uj(e,t,s){return xe(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}/sitemap`,{method:"PUT",body:JSON.stringify({sitemapUrl:s})})}function Pj(e,t){return xe(`/projects/${encodeURIComponent(e)}/google/gsc/sync`,{method:"POST",body:JSON.stringify(t??{})})}function $j(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 xe(`/projects/${encodeURIComponent(e)}/google/gsc/performance${a}`)}function Ij(e,t){return xe(`/projects/${encodeURIComponent(e)}/google/gsc/inspect`,{method:"POST",body:JSON.stringify({url:t})})}function Bj(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 xe(`/projects/${encodeURIComponent(e)}/google/gsc/inspections${a}`)}function qj(e){return xe(`/projects/${encodeURIComponent(e)}/google/gsc/deindexed`)}function Hj(e){return xe(`/projects/${encodeURIComponent(e)}/google/gsc/coverage`)}function Zj(e,t){const s=new URLSearchParams,a=s.toString()?`?${s.toString()}`:"";return xe(`/projects/${encodeURIComponent(e)}/google/gsc/coverage/history${a}`)}function Fj(e,t){return xe(`/projects/${encodeURIComponent(e)}/google/gsc/inspect-sitemap`,{method:"POST",body:JSON.stringify(t??{})})}function Gj(e){return xe(`/projects/${encodeURIComponent(e)}/google/gsc/sitemaps`)}function Kj(e){return xe(`/projects/${encodeURIComponent(e)}/google/gsc/discover-sitemaps`,{method:"POST",body:"{}"})}function km(){return xe("/cdp/status")}function Vj(e,t){return xe("/settings/cdp",{method:"PUT",body:JSON.stringify({host:e,port:t})})}function zm(e,t){return xe(`/projects/${encodeURIComponent(e)}/google/indexing/request`,{method:"POST",body:JSON.stringify(t)})}function Qj(e){return xe(`/projects/${encodeURIComponent(e)}/bing/status`)}function Yj(e,t){return xe(`/projects/${encodeURIComponent(e)}/bing/connect`,{method:"POST",body:JSON.stringify({apiKey:t})})}function Jj(e){return xe(`/projects/${encodeURIComponent(e)}/bing/disconnect`,{method:"DELETE",body:"{}"})}function Xj(e){return xe(`/projects/${encodeURIComponent(e)}/bing/sites`)}function Wj(e,t){return xe(`/projects/${encodeURIComponent(e)}/bing/set-site`,{method:"POST",body:JSON.stringify({siteUrl:t})})}function e1(e){return xe(`/projects/${encodeURIComponent(e)}/bing/coverage`)}function t1(e,t){const s=new URLSearchParams,a=s.toString()?`?${s.toString()}`:"";return xe(`/projects/${encodeURIComponent(e)}/bing/inspections${a}`)}function n1(e,t){return xe(`/projects/${encodeURIComponent(e)}/bing/inspect-url`,{method:"POST",body:JSON.stringify({url:t})})}function Em(e,t){return xe(`/projects/${encodeURIComponent(e)}/bing/request-indexing`,{method:"POST",body:JSON.stringify(t)})}function s1(e){return xe(`/projects/${encodeURIComponent(e)}/bing/performance`)}function i1(e){return xe("/settings/bing",{method:"PUT",body:JSON.stringify({apiKey:e})})}function a1(e,t){const s=t?`?window=${t}`:"";return xe(`/projects/${encodeURIComponent(e)}/analytics/metrics${s}`)}function r1(e,t){const s=t?`?window=${t}`:"";return xe(`/projects/${encodeURIComponent(e)}/analytics/gaps${s}`)}function o1(e,t){const s=t?`?window=${t}`:"";return xe(`/projects/${encodeURIComponent(e)}/analytics/sources${s}`)}async function l1(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 jM=Object.freeze(Object.defineProperty({__proto__:null,ApiError:uj,addLocation:yj,addNotification:kj,appendKeywords:pj,applyProjectConfig:Oj,bingConnect:Yj,bingDisconnect:Jj,bingRequestIndexing:Em,bingSetSite:Wj,configureCdp:Vj,createProject:ll,deleteProject:xj,fetchAllRuns:fj,fetchAnalyticsGaps:r1,fetchAnalyticsMetrics:a1,fetchAnalyticsSources:o1,fetchBingCoverage:e1,fetchBingInspections:t1,fetchBingPerformance:s1,fetchBingSites:Xj,fetchBingStatus:Qj,fetchCdpStatus:km,fetchCompetitors:wp,fetchExport:Sj,fetchGoogleConnections:Aj,fetchGoogleProperties:Lj,fetchGscCoverage:Hj,fetchGscCoverageHistory:Zj,fetchGscDeindexed:qj,fetchGscInspections:Bj,fetchGscPerformance:$j,fetchGscSitemaps:Gj,fetchKeywords:hj,fetchProject:Sp,fetchProjects:dj,fetchRunDetail:sl,fetchSchedule:Nj,fetchServiceStatus:l1,fetchSettings:_p,fetchTimeline:jp,generateKeywords:Rj,googleConnect:Tj,googleDisconnect:Dj,inspectBingUrl:n1,inspectGscUrl:Ij,listNotifications:_j,removeLocation:vj,removeNotification:zj,removeSchedule:Cj,requestIndexing:zm,saveGoogleProperty:Mj,saveSchedule:_m,saveSitemapUrl:Uj,sendTestNotification:Ej,setCompetitors:Np,setDefaultLocation:bj,setKeywords:mj,triggerAllRuns:wM,triggerDiscoverSitemaps:Kj,triggerGscSync:Pj,triggerInspectSitemap:Fj,triggerRun:Cp,updateBingApiKey:i1,updateGoogleAuthConfig:jj,updateOwnedDomains:Cm,updateProject:gj,updateProviderConfig:wj},Symbol.toStringTag,{value:"Module"}));function NM({evidence:e,project:t,onClose:s}){const[a,r]=N.useState(!1),[c,d]=N.useState(-1),[f,p]=N.useState(null),[m,b]=N.useState(!1),[y,v]=N.useState({}),x=iM(t.project),j=new Set(x.map(wm)),S=e.runHistory,C=S.length>1,_=c>=0&&f!==null,E=_?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},R=E.citationState==="cited"||E.citationState==="emerging",U=E.citedDomains.findIndex(T=>j.has(T.toLowerCase().replace(/^www\./,"")))+1,O=E.citedDomains.length,M=t.project.displayName||t.project.name,A=[...x.map(wm),M,M.split(" ").slice(0,2).join(" ")].filter(T=>T.trim().length>2),Z=R?"cited":E.citationState==="lost"?"lost":E.citationState==="pending"?"pending":"not-cited",W=N.useRef(0),Q=N.useCallback(async T=>{const ae=++W.current;if(T===-1||T===S.length-1){d(-1),p(null),r(!1);return}d(T),r(!1);const pe=S[T],te=`${pe.runId}::${e.keyword}::${e.provider}`;if(y[te]){p(y[te]);return}b(!0);try{const L=await sl(pe.runId);if(ae!==W.current)return;const G=L.snapshots.find(re=>re.keyword===e.keyword&&re.provider===e.provider)??L.snapshots.find(re=>re.keyword===e.keyword),ie=G?{citationState:G.citationState,provider:G.provider,model:G.model??null,answerSnippet:G.answerText??"",citedDomains:G.citedDomains,competitorDomains:G.competitorOverlap,groundingSources:G.groundingSources,evidenceUrls:[],changeLabel:pe.citationState,summary:""}:{citationState:pe.citationState,provider:e.provider,model:pe.model??null,answerSnippet:"",citedDomains:[],competitorDomains:[],groundingSources:[],evidenceUrls:[],changeLabel:pe.citationState,summary:"Snapshot data not available for this run."};v(re=>({...re,[te]:ie})),p(ie)}catch{if(ae!==W.current)return;p({citationState:pe.citationState,provider:e.provider,model:pe.model??null,answerSnippet:"",citedDomains:[],competitorDomains:[],groundingSources:[],evidenceUrls:[],changeLabel:pe.citationState,summary:"Failed to load historical run data."})}finally{ae===W.current&&b(!1)}},[S,e.keyword,e.provider,y]),me=(_||e.historyScope!=="provider")&&E.model?`${E.provider} (${E.model}) · ${E.changeLabel.toLowerCase()}`:`${E.provider} · ${E.changeLabel.toLowerCase()}`,ze=!_&&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(" · "):"",je=R&&U>0?{label:"Citation confirmed",title:`Cited #${U} of ${O} domain${O!==1?"s":""}`,meta:me}:R?{label:"Citation confirmed",title:"Cited in this answer",meta:me}:E.citationState==="lost"?{label:"Citation lost",title:O>0?`${O} domain${O!==1?"s":""} cited instead`:"No longer appearing in this answer",meta:me}:E.citationState==="pending"?{label:"Pending",title:"Awaiting first visibility run",meta:"No provider data yet"}:{label:"Not in this answer",title:O>0?`${O} domain${O!==1?"s":""} cited instead`:"No domains cited for this query",meta:me},B=()=>{if(!E.answerSnippet)return null;const T=E.answerSnippet.split(`
|
|
95
|
+
`),ae=[];let pe=[],te=0;const L=()=>{if(pe.length===0)return;const G=pe.join(" ").trim();G&&ae.push(l.jsx("p",{className:ae.length>0?"mt-2.5":"",children:xx(G,A)},te++)),pe=[]};for(const G of T){const ie=G.trim();if(/^[-\u2013\u2014]{3,}$/.test(ie)){L(),ae.push(l.jsx("hr",{className:"border-zinc-800/60 my-3"},te++));continue}const re=ie.match(/^(#{1,3})\s+(.+)$/);if(re){L();const ce=re[1].length,he=re[2].replace(/^[\p{Emoji}\p{Emoji_Component}\s#]+/u,"").trim()||re[2],de=ce===1?"text-[13px] font-semibold text-zinc-100 mt-4 mb-1":ce===2?"text-xs font-semibold text-zinc-200 mt-3 mb-0.5":"text-xs font-medium text-zinc-300 mt-2";ae.push(l.jsx("p",{className:de,children:xx(he,A)},te++));continue}if(ie===""){L();continue}pe.push(ie)}return L(),ae};return l.jsx(Nw,{open:!0,onOpenChange:T=>{T||s()},children:l.jsxs(Cw,{children:[l.jsx(up,{className:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm"}),l.jsxs(dp,{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(fp,{className:"text-lg font-semibold text-zinc-50 truncate",children:e.keyword})]}),l.jsxs(kw,{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(Pu,{className:"size-4"}),l.jsx("span",{className:"sr-only",children:"Close"})]})]}),C&&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:S.map((T,ae)=>{const pe=c===-1&&ae===S.length-1||c===ae,te=T.citationState==="cited"?"bg-emerald-400":T.citationState==="emerging"?"bg-amber-400":T.citationState==="lost"?"bg-rose-400":"bg-zinc-600",G=new Date(T.createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"}),ie=!!(T.model&&ae>0&&S[ae-1]?.model&&S[ae-1].model!==T.model);return l.jsxs("button",{type:"button",className:`evidence-run-dot ${pe?"evidence-run-dot--selected":""}`,onClick:()=>Q(ae===S.length-1?-1:ae),"aria-label":[`Run ${G}: ${T.citationState}`,T.model?`model ${T.model}`:null,ie?"model changed":null].filter(Boolean).join(" — "),"aria-pressed":pe,children:[l.jsx("span",{className:`size-2 rounded-full ${te} ${ie?"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})]},ae)})}),c>=0&&c<S.length&&l.jsxs("p",{className:"text-[11px] text-zinc-500 mt-1",children:["Viewing run from ",new Date(S[c].createdAt).toLocaleString()," \\u2014 ",l.jsx("span",{className:"capitalize",children:S[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"})]}),!_&&(e.modelTransitions?.length??0)>0&&l.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:e.modelTransitions.map(T=>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:`${T.fromModel??"unknown"} -> ${T.toModel??"unknown"} on ${new Date(T.createdAt).toLocaleDateString()}`},`${T.runId}:${T.toModel??"unknown"}`))})]}),l.jsxs("div",{className:"evidence-modal-body",children:[m&&l.jsx("div",{className:"md:col-span-2 flex items-center justify-center py-12 text-zinc-500 text-sm",children:"Loading historical run data\\u2026"}),!m&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"evidence-modal-main",children:[l.jsxs("div",{className:`evidence-position-hero evidence-position-hero--${Z}`,children:[l.jsx("p",{className:`evidence-position-label evidence-position-label--${Z}`,children:je.label}),l.jsx("p",{className:`evidence-position-title evidence-position-title--${Z}`,children:je.title}),l.jsx("p",{className:"evidence-position-meta",children:je.meta}),ze&&l.jsx("p",{className:"mt-1 text-[11px] text-zinc-500",children:ze})]}),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:B()}),E.answerSnippet.length>280&&l.jsx("button",{type:"button",className:"mt-1.5 text-xs text-zinc-500 hover:text-zinc-300 transition-colors",onClick:()=>r(!a),children:a?"↑ Collapse":"↓ Show full answer"})]}),!E.answerSnippet&&!m&&l.jsx("div",{className:"rounded-lg border border-zinc-800/40 bg-zinc-900/20 px-4 py-8 text-center text-zinc-600 text-sm",children:"No answer text recorded for this run"}),!_&&e.relatedTechnicalSignals.length>0&&l.jsxs("div",{children:[l.jsx("p",{className:"drawer-section-label",children:R?"Why you're cited":"What to fix"}),l.jsx("div",{className:"action-items-list",children:e.relatedTechnicalSignals.map((T,ae)=>l.jsxs("div",{className:"action-item",children:[l.jsx("svg",{className:`action-item-icon ${R?"text-emerald-400":"text-amber-400"}`,viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:R?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:T})]},ae))})]}),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((T,ae)=>{const pe=T.toLowerCase().replace(/^www\./,""),te=j.has(pe),L=!te&&E.competitorDomains.some(ie=>ie.toLowerCase().replace(/^www\./,"")===pe),G=te?"you":L?"competitor":"other";return l.jsxs("div",{className:`citation-leaderboard-item citation-leaderboard-item--${G}`,children:[l.jsxs("span",{className:"citation-leaderboard-rank",children:["#",ae+1]}),l.jsx("span",{className:"citation-leaderboard-domain",children:T}),te&&l.jsx("span",{className:"citation-leaderboard-tag",children:"You"}),L&&l.jsx("span",{className:"citation-leaderboard-tag",children:"Competitor"})]},T)}),!R&&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((T,ae)=>l.jsx("li",{className:"truncate text-sm",children:l.jsx("a",{href:T.uri,target:"_blank",rel:"noreferrer",className:"text-zinc-400 hover:text-zinc-200 transition-colors",children:T.title||T.uri})},ae))})]}),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(T=>l.jsx("li",{className:"truncate text-sm",children:l.jsx("a",{href:T,target:"_blank",rel:"noreferrer",className:"text-zinc-400 hover:text-zinc-200 transition-colors",children:T})},T))})]}),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 ",_?"for this run":"yet"]})]})]})]})]})]})})}function ts(e){const t=new Date("2026-02-20");return e.map((s,a)=>({runId:`run_mock_${a+1}`,citationState:s,createdAt:new Date(t.getTime()+a*2*24*60*60*1e3).toISOString()}))}const kr=[{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 Vu(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 ku=Vu({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"}),kp=Vu({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"}),zp=Vu({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"}),zu=Vu({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"}),CM=[kp,ku,zp,zu],_M=[{id:"evidence_citypoint_emergency_gemini",keyword:"emergency dentist brooklyn",provider:"gemini",model:"gemini-3-flash",location:null,citationState:"lost",changeLabel:"Lost since Mar 5",answerSnippet:"For urgent dental care in Brooklyn, Downtown Smiles and Harbor Dental are now cited first for emergency availability and same-day booking.",citedDomains:["downtownsmiles.com","harbordental.com"],evidenceUrls:["https://downtownsmiles.com/emergency-dentist-brooklyn","https://harbordental.com/same-day-emergency-care"],competitorDomains:["downtownsmiles.com","harbordental.com"],groundingSources:[],relatedTechnicalSignals:["FAQ schema missing on the emergency service page","llms.txt not found during latest site audit","Location pages link weakly into the emergency care hub"],summary:"AI answers now cite two competitors while your emergency page is no longer grounded.",runHistory:ts(["cited","cited","cited","cited","cited","cited","cited","not-cited","not-cited"])},{id:"evidence_citypoint_emergency_openai",keyword:"emergency dentist brooklyn",provider:"openai",model:"gpt-5.4",location:null,citationState:"cited",changeLabel:"Cited for 6 runs",answerSnippet:"Citypoint Dental is listed as a top emergency dentist in Brooklyn for same-day appointments and walk-in availability.",citedDomains:["citypointdental.com","downtownsmiles.com"],evidenceUrls:["https://citypointdental.com/emergency-dentist-brooklyn"],competitorDomains:["downtownsmiles.com"],groundingSources:[],relatedTechnicalSignals:["Emergency page indexed with structured data"],summary:"OpenAI cites your emergency page consistently alongside one competitor.",runHistory:ts(["not-cited","cited","cited","cited","cited","cited","cited"])},{id:"evidence_citypoint_emergency_claude",keyword:"emergency dentist brooklyn",provider:"claude",model:"claude-sonnet-4-6",location:null,citationState:"not-cited",changeLabel:"No citation across 12 runs",answerSnippet:"Based on the search results, top-rated emergency dental practices in Brooklyn include Downtown Smiles and Harbor Dental.",citedDomains:["downtownsmiles.com","harbordental.com"],evidenceUrls:[],competitorDomains:["downtownsmiles.com","harbordental.com"],groundingSources:[],relatedTechnicalSignals:["FAQ schema missing","llms.txt not found"],summary:"Claude does not cite your domain for this emergency query.",runHistory:ts(["not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited"])},{id:"evidence_citypoint_invisalign_openai",keyword:"best invisalign dentist downtown brooklyn",provider:"openai",model:"gpt-5.4",location:null,citationState:"emerging",changeLabel:"First citation in 7 days",answerSnippet:"Citypoint Dental appears as an emerging recommendation for Invisalign in Downtown Brooklyn, supported by recent before-and-after case pages.",citedDomains:["citypointdental.com","clearlineortho.com"],evidenceUrls:["https://citypointdental.com/invisalign-downtown-brooklyn","https://citypointdental.com/case-studies/invisalign-open-bite"],competitorDomains:["clearlineortho.com"],groundingSources:[],relatedTechnicalSignals:["Structured data now present on two case-study pages","Internal links from service pages to case studies improved crawl depth"],summary:"Fresh case-study content is starting to earn citations on Invisalign prompts.",runHistory:ts(["not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","cited"])},{id:"evidence_citypoint_invisalign_gemini",keyword:"best invisalign dentist downtown brooklyn",provider:"gemini",model:"gemini-3-flash",location:null,citationState:"cited",changeLabel:"Cited for 8 runs",answerSnippet:"Citypoint Dental in Downtown Brooklyn is highlighted for its Invisalign expertise and patient outcomes.",citedDomains:["citypointdental.com"],evidenceUrls:["https://citypointdental.com/invisalign-downtown-brooklyn"],competitorDomains:[],groundingSources:[],relatedTechnicalSignals:["Case study pages well-indexed"],summary:"Gemini consistently cites your Invisalign page with no competitor overlap.",runHistory:ts(["cited","cited","cited","cited","cited","cited","cited","cited"])},{id:"evidence_citypoint_invisalign_claude",keyword:"best invisalign dentist downtown brooklyn",provider:"claude",model:"claude-sonnet-4-6",location:null,citationState:"not-cited",changeLabel:"No citation across 12 runs",answerSnippet:"For Invisalign in Downtown Brooklyn, Clear Line Ortho and Brooklyn Smiles are frequently recommended for their experienced orthodontists.",citedDomains:["clearlineortho.com","brooklynsmiles.com"],evidenceUrls:[],competitorDomains:["clearlineortho.com"],groundingSources:[],relatedTechnicalSignals:["No before/after schema on case study pages"],summary:"Claude does not surface your Invisalign content despite strong page quality.",runHistory:ts(["not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited"])},{id:"evidence_citypoint_children_claude",keyword:"pediatric dentist brooklyn heights",provider:"claude",model:"claude-sonnet-4-6",location:null,citationState:"not-cited",changeLabel:"No citation across 4 runs",answerSnippet:"Answers cite neighborhood-specific pediatric practices with stronger family-focused FAQ content and clearer insurance details.",citedDomains:["brightkidsdental.com","parkpediatricdental.com"],evidenceUrls:["https://brightkidsdental.com/pediatric-dentist-brooklyn-heights","https://parkpediatricdental.com/insurance"],competitorDomains:["brightkidsdental.com","parkpediatricdental.com"],groundingSources:[],relatedTechnicalSignals:["No dedicated pediatric service page exists for Brooklyn Heights","Insurance content is buried three clicks deep"],summary:"Coverage gap is content-driven, not purely technical.",runHistory:ts(["not-cited","not-cited","not-cited","not-cited"])},{id:"evidence_citypoint_children_gemini",keyword:"pediatric dentist brooklyn heights",provider:"gemini",model:"gemini-3-flash",location:null,citationState:"not-cited",changeLabel:"No citation across 12 runs",answerSnippet:"For pediatric dentistry in Brooklyn Heights, Bright Kids Dental and Park Pediatric Dental are cited for family-friendly care.",citedDomains:["brightkidsdental.com","parkpediatricdental.com"],evidenceUrls:[],competitorDomains:["brightkidsdental.com","parkpediatricdental.com"],groundingSources:[],relatedTechnicalSignals:["No dedicated pediatric page for Brooklyn Heights"],summary:"Gemini does not surface your domain for pediatric queries in this area.",runHistory:ts(["not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited"])},{id:"evidence_citypoint_children_openai",keyword:"pediatric dentist brooklyn heights",provider:"openai",model:"gpt-5.4",location:null,citationState:"cited",changeLabel:"First citation this month",answerSnippet:"Citypoint Dental is mentioned as offering pediatric services in Brooklyn, though specialized pediatric-only practices are also highlighted.",citedDomains:["citypointdental.com","brightkidsdental.com"],evidenceUrls:["https://citypointdental.com/family-dentistry"],competitorDomains:["brightkidsdental.com"],groundingSources:[],relatedTechnicalSignals:["Family dentistry page recently updated"],summary:"OpenAI recently started citing your family dentistry page for this query.",runHistory:ts(["not-cited","not-cited","not-cited","not-cited","not-cited","cited"])}],kM=[{project:kr[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:_M,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:[kp,ku]},{project:kr[1],dateRangeLabel:"Last 14 days",contextLabel:"US / English / Service-area legal prompts",visibilitySummary:{label:"Answer Visibility",value:"74 / 100",delta:"+2 this week",tone:"positive",description:"Branded prompts are stable and informational queries are gradually improving.",trend:[68,70,71,73,74]},providerScores:[{provider:"gemini",model:"gemini-3-flash",score:75,cited:3,total:4},{provider:"openai",model:"gpt-5.4",score:50,cited:2,total:4}],competitorPressure:{label:"Competitor Pressure",value:"Moderate",delta:"Steady",tone:"neutral",description:"Competitors are stable; no new citation displacement was detected.",trend:[44,46,45,46,46]},runStatus:{label:"Run Status",value:"Healthy",delta:"No failures in 14 days",tone:"positive",description:"Latest visibility runs completed without issues.",trend:[88,89,90,90,91]},insights:[{id:"insight_harbor_cluster",tone:"positive",title:"Practice-area clustering is paying off",detail:"Merged legal service pages now ground broader informational prompts.",actionLabel:"Cited",affectedPhrases:[{keyword:"brooklyn personal injury lawyer",evidenceId:"evidence_harbor_personal_injury",provider:"gemini",citationState:"cited"}]},{id:"insight_harbor_local",tone:"neutral",title:"No significant changes",detail:"No new displacement on borough-specific injury prompts this week.",actionLabel:"Stable",affectedPhrases:[]}],visibilityEvidence:[{id:"evidence_harbor_personal_injury",keyword:"brooklyn personal injury lawyer",provider:"gemini",model:"gemini-3-flash",location:null,citationState:"cited",changeLabel:"Held for 5 runs",answerSnippet:"Harbor Legal Group remains cited for borough-specific personal injury queries due to clear practice-area and case-result content.",citedDomains:["harborlegal.com"],evidenceUrls:["https://harborlegal.com/personal-injury/brooklyn"],competitorDomains:["shorelineinjury.com"],groundingSources:[],relatedTechnicalSignals:["Practice-area schema intact","Case results link directly from service pages"],summary:"Grounding remains durable after the service-page consolidation.",runHistory:ts(["cited","cited","cited","cited","cited"])}],competitors:[{id:"competitor_harbor_shoreline",domain:"shorelineinjury.com",citationCount:2,totalKeywords:6,pressureLabel:"Moderate",citedKeywords:["personal injury lawyer","car accident attorney"],movement:"Stable",notes:"Strong case-result pages keep it in rotation."}],recentRuns:[zp]},{project:kr[2],dateRangeLabel:"Last 7 days",contextLabel:"US / English / Multi-location treatment prompts",visibilitySummary:{label:"Answer Visibility",value:"58 / 100",delta:"Run in progress",tone:"neutral",description:"The current run is measuring whether treatment-location pages improved citation breadth.",trend:[52,54,55,57,58]},providerScores:[{provider:"openai",model:"gpt-5.4",score:58,cited:4,total:7}],competitorPressure:{label:"Competitor Pressure",value:"Moderate",delta:"Watching 1 chain",tone:"caution",description:"Regional chain competitors are winning on broad treatment questions.",trend:[49,51,52,54,56]},runStatus:{label:"Run Status",value:"Running",delta:"9 prompts remaining",tone:"neutral",description:"Current answer-visibility sweep is still collecting provider responses.",trend:[63,64,65,67,68]},insights:[{id:"insight_northstar_location_depth",tone:"caution",title:"Location pages need stronger proof",detail:"Answers prefer competitors with physician-specific evidence.",actionLabel:"Gap",affectedPhrases:[{keyword:"knee replacement surgeon westchester",evidenceId:"evidence_northstar_knee",provider:"openai",citationState:"emerging"}]}],visibilityEvidence:[{id:"evidence_northstar_knee",keyword:"knee replacement surgeon westchester",provider:"openai",model:"gpt-5.4",location:null,citationState:"emerging",changeLabel:"Improving",answerSnippet:"Northstar Orthopedics is beginning to appear on location-sensitive treatment prompts when physician bios and treatment pages are tightly linked.",citedDomains:["northstarortho.com","regionaljointcare.com"],evidenceUrls:["https://northstarortho.com/locations/westchester/knee-replacement"],competitorDomains:["regionaljointcare.com"],groundingSources:[],relatedTechnicalSignals:["Physician bios now linked from treatment pages"],summary:"Template cleanup is helping, but proof depth still matters.",runHistory:ts(["not-cited","not-cited","not-cited","cited"])}],competitors:[{id:"competitor_northstar_regional",domain:"regionaljointcare.com",citationCount:5,totalKeywords:7,pressureLabel:"High",citedKeywords:["knee replacement","hip surgery","joint pain treatment","orthopedic surgeon","sports medicine"],movement:"Winning broad treatment prompts",notes:"Heavy physician proof and patient-story content."}],recentRuns:[zu]}],zM={portfolioOverview:{projects:[{project:kr[0],visibilityScore:61,visibilityDelta:"-8 this week",lastRun:ku,insight:"Lost emergency-intent citations after competitors refreshed availability pages.",trend:[73,71,69,66,61],competitorPressureLabel:"High"},{project:kr[1],visibilityScore:74,visibilityDelta:"+2 this week",lastRun:zp,insight:"Practice-area consolidation is stabilizing branded and informational prompts.",trend:[68,70,71,73,74],competitorPressureLabel:"Moderate"},{project:kr[2],visibilityScore:58,visibilityDelta:"Run in progress",lastRun:zu,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:[kp,zu,ku],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:kM,runs:CM,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."},bing:{state:"needs-config",detail:"Bing Webmaster Tools API key is not configured yet."},selfHostNotes:["Configuration is stored in ~/.canonry/config.yaml.","The local config file is the source of truth for authentication credentials.","Google OAuth app credentials and per-domain Google tokens are stored in local config, not the database.","Database is SQLite at ~/.canonry/data.db.","API key was auto-generated during canonry init."],bootstrapNote:"Use the UI, CLI, or ~/.canonry/config.yaml to manage settings. Authentication credentials persist to local config."}},EM={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 Qu(e={}){const t=structuredClone(zM),s=structuredClone(EM);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 RM(e,t){return e.projects.find(s=>s.project.id===t)}function OM(e,t){return e.runs.find(s=>s.id===t)}function AM(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 c1(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 Sx(e){try{return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}catch{return e}}function TM(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 u1(e){return e==="answer-visibility"?"Answer visibility sweep":e}function DM(e){return e==="manual"?"Manual":e==="scheduled"?"Scheduled":e==="config-apply"?"Config apply":e}function Ep(e,t){return{id:e.id,projectId:e.projectId,projectName:t,kind:e.kind,kindLabel:u1(e.kind),status:e.status,trigger:e.trigger??"manual",location:e.location??null,createdAt:e.createdAt,startedAt:e.startedAt?Sx(e.startedAt):Sx(e.createdAt),duration:TM(e.startedAt,e.finishedAt),statusDetail:e.error?d1(e.error):LM(e),summary:MM(e),triggerLabel:DM(e.trigger)}}function d1(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 LM(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?d1(e.error):"Run failed.";default:return""}}function MM(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 f1(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 UM(e){return e>=70?"positive":e>=40?"caution":"negative"}function PM(e){return e==="High"?"negative":e==="Moderate"?"caution":"neutral"}function h1(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 $M(e,t,s,a){const r=[];let c=0;const d=new Set;if(s){const f=new Map;for(const m of s.snapshots)if(m.keyword){const b=`${m.keyword}::${m.provider}`;f.set(b,m)}const p=[...new Set(s.snapshots.map(m=>m.provider))].sort();p.length===0&&p.push("gemini");for(const m of t){if(m.runs.length===0)continue;d.add(m.keyword);const y=m.runs.at(-1)?.transition??"not-cited",v=y==="lost"?"lost":y==="emerging"?"emerging":y==="cited"?"cited":"not-cited";for(const x of p){const j=f.get(`${m.keyword}::${x}`);if(!j&&p.length>1)continue;const S=j?.model??null,C=S?`${x}:${S}`:null,_=C?m.modelRuns?.[C]:void 0,E=m.providerRuns?.[x],R=(E?.length?E:null)??(_?.length?_:null),z=E?.length?"provider":_?.length?"model":"keyword",U=R?R.at(-1).transition:y,O=U==="lost"?"lost":U==="emerging"?"emerging":j?j.citationState==="cited"?"cited":"not-cited":v,M=Rm(R||m.runs),A=IM(m,x),Z=(R??m.runs).map(me=>({runId:me.runId,citationState:me.citationState,createdAt:me.createdAt,model:A.get(me.runId)??null})),W=BM(Z),Q=z==="provider"&&W.length<=1?"model":z,se=qM(Z);r.push({id:`evidence_${e}_${c++}`,keyword:m.keyword,provider:j?.provider??x,model:j?.model??null,location:j?.location??null,citationState:O,changeLabel:HM(U,M),answerSnippet:j?.answerText??"",citedDomains:j?.citedDomains??[],evidenceUrls:[],competitorDomains:j?.competitorOverlap??[],relatedTechnicalSignals:[],groundingSources:j?.groundingSources??[],summary:ZM(O,m.keyword),runHistory:Z,historyScope:Q,modelsSeen:W,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 IM(e,t){const s=new Map,a=`${t}:`;for(const[r,c]of Object.entries(e.modelRuns??{})){if(!r.startsWith(a))continue;const d=r.slice(a.length),f=d==="unknown"?null:d;for(const p of c)s.set(p.runId,f)}return s}function BM(e){const t=new Set;for(const s of e)s.model&&t.add(s.model);return[...t]}function qM(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 Rm(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 HM(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 ZM(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 wx(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 Kh=3;function FM(e){const{evidence:t,timeline:s,latestSnapshots:a,previousSnapshots:r,trackedCompetitors:c}=e,d=[],f=[],p=new Set;for(const _ of t)_.citationState==="lost"&&(p.has(_.keyword)||(p.add(_.keyword),f.push({keyword:_.keyword,evidenceId:_.id,provider:_.provider,citationState:"lost"})));f.length>0&&d.push({id:"insight_lost",tone:"negative",title:`Lost citation on ${f.length} keyword${f.length>1?"s":""}`,detail:"Citations dropped since the last run.",actionLabel:"Lost",affectedPhrases:f});const m=wx(a,c),b=wx(r,c);for(const _ of c){const E=m.get(_)??new Set,R=b.get(_)??new Set,z=[...E].filter(U=>!R.has(U));z.length>0&&d.push({id:`insight_comp_gained_${_}`,tone:"negative",title:`${_} appeared on ${z.length} keyword${z.length>1?"s":""}`,detail:"A tracked competitor gained new citations.",actionLabel:"Competitor",affectedPhrases:z.map(U=>{const O=t.find(M=>M.keyword===U);return{keyword:U,evidenceId:O?.id??"",citationState:"cited"}})})}const y=new Map;for(const _ of s){const E=_.runs.at(-1);E&&y.set(_.keyword,{transition:E.transition,citationState:E.citationState})}const v=[],x=[],j=new Set;for(const[_,{transition:E,citationState:R}]of y){if(!(E==="emerging"||E==="new"&&R==="cited"))continue;j.add(_);const U=t.find(O=>O.keyword===_&&(O.citationState==="emerging"||O.citationState==="cited"));v.push({keyword:_,evidenceId:U?.id??"",provider:U?.provider,citationState:"emerging"})}for(const _ of t)_.citationState==="emerging"&&(j.has(_.keyword)||x.push({keyword:_.keyword,evidenceId:_.id,provider:_.provider,citationState:"emerging"}));if(x.length>0){const _=new Set(x.map(E=>E.keyword)).size;d.push({id:"insight_provider_pickup",tone:"positive",title:`Picked up by new provider on ${_} keyword${_>1?"s":""}`,detail:"Your domain started appearing on additional providers.",actionLabel:"Pickup",affectedPhrases:x})}v.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:v});const S=new Set(t.map(_=>_.keyword)),C=[];for(const _ of s){if(!S.has(_.keyword)||_.runs.length<Kh||_.runs.at(-1)?.citationState!=="not-cited")continue;if(Rm(_.runs)>=Kh){const z=t.find(U=>U.keyword===_.keyword);C.push({keyword:_.keyword,evidenceId:z?.id??"",citationState:"not-cited"})}}C.length>0&&d.push({id:"insight_persistent_gap",tone:"caution",title:`${C.length} keyword${C.length>1?"s":""} uncited for ${Kh}+ runs`,detail:"These keywords have not been cited by any provider across multiple consecutive runs.",actionLabel:"Gap",affectedPhrases:C});for(const _ of c){const E=m.get(_)??new Set,z=[...b.get(_)??new Set].filter(U=>!E.has(U));z.length>0&&d.push({id:`insight_comp_lost_${_}`,tone:"neutral",title:`${_} dropped from ${z.length} keyword${z.length>1?"s":""}`,detail:"A tracked competitor lost citations.",actionLabel:"Competitor",affectedPhrases:z.map(U=>{const O=t.find(M=>M.keyword===U);return{keyword:U,evidenceId:O?.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 GM(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: ${u1(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 KM(e){const t=c1(e.project),s=$M(t.name,e.timeline,e.latestRunDetail,e.keywords),a=e.latestRunDetail?.snapshots??[],r=f1(a),c=h1(a,e.competitors.map(y=>y.domain)),d=FM({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,v)=>v.createdAt.localeCompare(y.createdAt)),p=f.map(y=>Ep(y,e.project.displayName||e.project.name)),m=new Map;for(const y of a){const v=y.provider||"gemini",x=y.model??null,j=`${v}::${x??"unknown"}`,S=m.get(j)??{provider:v,model:x,cited:0,total:0};S.total++,y.citationState==="cited"&&S.cited++,m.set(j,S)}const b=[...m.values()].sort((y,v)=>y.provider.localeCompare(v.provider)||(y.model??"").localeCompare(v.model??"")).map(({provider:y,model:v,cited:x,total:j})=>({provider:y,model:v,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?UM(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:b,competitorPressure:{label:"Competitor Pressure",value:c.label,delta:c.count>0?`${c.count} overlapping citations`:"No overlap detected",tone:PM(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:GM(f),insights:d,visibilityEvidence:s,competitors:e.competitors.map((y,v)=>{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],S=new Set(a.map(E=>E.keyword).filter(Boolean)),C=S.size>0?j.length/S.size:0,_=C>=.5?"High":C>=.2?"Moderate":j.length>0?"Low":"None";return{id:y.id||`comp_${v}`,domain:y.domain,citationCount:j.length,totalKeywords:S.size,pressureLabel:_,citedKeywords:j,movement:"",notes:""}}),recentRuns:p.slice(0,5)}}function VM(e){const t=c1(e.project),s=e.latestRunDetail?.snapshots??[],a=f1(s),r=h1(s,e.competitors.map(p=>p.domain)),d=[...e.runs].sort((p,m)=>m.createdAt.localeCompare(p.createdAt))[0],f=d?Ep(d,e.project.displayName||e.project.name):{id:"none",projectId:e.project.id,projectName:e.project.displayName||e.project.name,kind:"answer-visibility",kindLabel:"No runs yet",status:"queued",trigger:"manual",createdAt:"",startedAt:"",duration:"",statusDetail:"",summary:"No runs yet",triggerLabel:""};return{project:t,visibilityScore:a.score,visibilityDelta:s.length>0?`${a.citedCount} of ${a.totalCount} key phrases`:"No data",lastRun:f,insight:s.length>0?`${a.citedCount} of ${a.totalCount} key phrases visible across ${new Set(s.map(p=>p.provider)).size} provider${new Set(s.map(p=>p.provider)).size>1?"s":""}.`:"No runs completed yet.",trend:[],competitorPressureLabel:r.label}}function QM(e,t){const s=[],a=[],r=[];for(const d of e){a.push(KM(d)),r.push(VM(d));const f=[...d.runs].sort((p,m)=>m.createdAt.localeCompare(p.createdAt));for(const p of f)s.push(Ep(p,d.project.displayName||d.project.name))}s.sort((d,f)=>f.createdAt.localeCompare(d.createdAt));const c=e.length>0;return{portfolioOverview:{projects:r,attentionItems:c?YM(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,displayName:d.displayName,keyUrl:d.keyUrl,modelHint:d.modelHint,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."},bing:{state:t?.bing?.configured?"ready":"needs-config",detail:t?.bing?.configured?"Bing Webmaster Tools API key is configured. Project-level Bing connections can be created from the dashboard.":"Bing Webmaster Tools API key is not configured yet."},selfHostNotes:["Configuration is stored in ~/.canonry/config.yaml.","The local config file is the source of truth for authentication credentials.","Google OAuth app credentials and per-domain Google tokens are stored in local config, not the database.","Database is SQLite at ~/.canonry/data.db.","API key was auto-generated during canonry init."],bootstrapNote:"Use the UI, CLI, or ~/.canonry/config.yaml to manage settings. Authentication credentials persist to local config."}}}function YM(e){const t=[];for(const s of e){const a=s.visibilityEvidence.filter(c=>c.citationState==="lost");a.length>0&&t.push({id:`attention_${s.project.id}_lost`,tone:"negative",title:`${s.project.displayName||s.project.name} lost citations`,detail:`${a.length} key phrase${a.length>1?"s":""} lost citation.`,actionLabel:"Open project",href:`/projects/${s.project.id}`});const r=s.recentRuns.filter(c=>c.status==="running"||c.status==="queued");r.length>0&&t.push({id:`attention_${s.project.id}_active`,tone:"neutral",title:`${s.project.displayName||s.project.name} has active runs`,detail:`${r.length} run${r.length>1?"s":""} in progress.`,actionLabel:"View runs",href:"/runs"})}return t.length===0&&t.push({id:"attention_stable",tone:"positive",title:"All projects stable",detail:"No citation losses or active runs to flag.",actionLabel:"View portfolio",href:"/"}),t}const Ei={projects:{all:["projects"],detail:e=>["projects",e],keywords:e=>["projects",e,"keywords"],competitors:e=>["projects",e,"competitors"],timeline:(e,t)=>["projects",e,"timeline",t]},runs:{all:["runs"],detail:e=>["runs",e]},settings:["settings"],health:["health"]},m1=N.createContext(null);m1.Provider;function cl(){return N.useContext(m1)}function ka(e){const s=cl()?.dashboard??null,a=qo({queryKey:Ei.projects.all,queryFn:dj,enabled:!s}),r=qo({queryKey:Ei.runs.all,queryFn:fj,enabled:!s,refetchInterval:j=>j.state.data?.some(_=>_.status==="running"||_.status==="queued")?3e3:!1}),c=qo({queryKey:Ei.settings,queryFn:()=>_p().catch(()=>null),enabled:!s}),d=a.data??[],f=r.data??[],p=K_({queries:d.map(j=>{const S=f.filter(_=>_.projectId===j.id),C=S.filter(_=>(_.status==="completed"||_.status==="partial")&&_.kind==="answer-visibility").sort((_,E)=>E.createdAt.localeCompare(_.createdAt));return{queryKey:Ei.projects.detail(j.id),queryFn:async()=>{const[_,E,R,z,U]=await Promise.all([hj(j.name).catch(()=>[]),wp(j.name).catch(()=>[]),jp(j.name).catch(()=>[]),C[0]?sl(C[0].id).catch(()=>null):Promise.resolve(null),C[1]?sl(C[1].id).catch(()=>null):Promise.resolve(null)]);return{project:j,runs:S,keywords:_,competitors:E,timeline:R,latestRunDetail:z,previousRunDetail:U}},enabled:!s&&a.isSuccess&&r.isSuccess}})}),m=p.every(j=>j.isSuccess),b=N.useMemo(()=>{if(s)return s;if(!a.data||!r.data||d.length>0&&!m)return null;const j=p.map(S=>S.data).filter(S=>S!=null);return QM(j,c.data??null)},[s,a.data,r.data,c.data,m,p,d.length]),y=!s&&(a.isLoading||r.isLoading),v=!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:b,isLoading:y,isError:v,refetch:x}}async function JM(){const e=await l1("/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 Yu(e,t){return qo({queryKey:Ei.health,queryFn:JM,enabled:e,refetchInterval:15e3,initialData:t})}function XM(e){return qo({queryKey:Ei.runs.detail(e??""),queryFn:()=>sl(e),enabled:!!e,refetchInterval:t=>{const s=t.state.data?.status;return s==="running"||s==="queued"?3e3:!1}})}function ul(){const e=ja(),t=Mu({strict:!1}),s=bn({select:p=>p.location.pathname}),a=t.runId??null,r=t.evidenceId??null;return{runId:a,evidenceId:r,openRun:p=>e({to:s,from:ss.to,search:m=>({...m,runId:p,evidenceId:void 0})}),openEvidence:p=>e({to:s,from:ss.to,search:m=>({...m,evidenceId:p,runId:void 0})}),closeDrawer:()=>e({to:s,from:ss.to,search:p=>({...p,runId:void 0,evidenceId:void 0})})}}const jx=[{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"}],WM=Qu(),Nx=e=>({label:e,state:"checking",detail:"Checking service health"}),e5={apiStatus:Nx("API"),workerStatus:Nx("Worker")};function t5(){const e=cl(),{dashboard:t,isLoading:s,refetch:a}=ka(),d=Yu(!e,e?.health).data??e?.health??e5,f=Yz(),{runId:p,evidenceId:m,closeDrawer:b}=ul(),[y,v]=N.useState(!1),x=XM(p),j=x.data??null,S=x.isLoading;N.useEffect(()=>{j&&j.status!=="running"&&j.status!=="queued"&&a()},[j?.status,a]),N.useEffect(()=>{v(!1)},[f.pathname]),N.useEffect(()=>{if(typeof window>"u"||!p&&!m)return;const z=U=>{U.key==="Escape"&&b()};return window.addEventListener("keydown",z),()=>{window.removeEventListener("keydown",z)}},[p,m,b]);const C=t??e?.dashboard??WM.dashboard,_=p?OM(C,p):void 0,E=m?AM(C,m):void 0,R=(()=>{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 O=z.split("/").filter(Boolean)[1];if(O){const M=C.projects.find(A=>A.project.id===O);if(M)return M.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($b,{})}),l.jsxs("nav",{className:"sidebar-nav",children:[l.jsxs(gt,{to:"/",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[l.jsx(f2,{className:"sidebar-icon"}),l.jsx("span",{children:"Overview"})]}),l.jsxs(gt,{to:"/projects",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!1},children:[l.jsx(u2,{className:"sidebar-icon"}),l.jsx("span",{children:"Projects"})]}),l.jsxs(gt,{to:"/runs",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[l.jsx(g2,{className:"sidebar-icon"}),l.jsx("span",{children:"Runs"})]}),l.jsxs(gt,{to:"/settings",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[l.jsx(j2,{className:"sidebar-icon"}),l.jsx("span",{children:"Settings"})]}),C.projects.length>0?l.jsxs(l.Fragment,{children:[l.jsx("p",{className:"sidebar-section-title",children:"Projects"}),C.projects.map(z=>{const U=z.visibilitySummary.tone;return l.jsxs(gt,{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-${U}`}),l.jsx("span",{children:z.project.name})]},z.project.id)})]}):null,C.projects.length===0?l.jsxs(l.Fragment,{children:[l.jsx("p",{className:"sidebar-section-title",children:"Resources"}),l.jsxs(gt,{to:"/setup",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[l.jsx(b2,{className:"sidebar-icon"}),l.jsx("span",{children:"Setup"})]})]}):null]}),l.jsx("div",{className:"sidebar-footer",children:jx.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($b,{compact:!0})}),l.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[l.jsx(gt,{to:"/",children:"Home"}),l.jsx(Uu,{className:"breadcrumb-sep size-3"}),l.jsx("span",{className:"breadcrumb-current",children:R})]})]}),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(le,{className:"nav-toggle",variant:"secondary",size:"icon",type:"button","aria-expanded":y,"aria-controls":"mobile-nav",onClick:()=>v(z=>!z),children:[l.jsx(m2,{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(le,{className:"mobile-nav-close",variant:"ghost",size:"icon",type:"button",onClick:()=>v(!1),children:[l.jsx(Pu,{className:"size-5"}),l.jsx("span",{className:"sr-only",children:"Close navigation"})]}),l.jsx(gt,{to:"/",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Overview"}),l.jsx(gt,{to:"/projects",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!1},children:"Projects"}),l.jsx(gt,{to:"/runs",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Runs"}),l.jsx(gt,{to:"/settings",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Settings"}),C.projects.length>0?l.jsxs("div",{className:"mobile-nav-section",children:[l.jsx("p",{className:"mobile-nav-section-title",children:"Projects"}),C.projects.map(z=>l.jsx(gt,{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(sp,{})}),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:jx.map(z=>l.jsx("a",{href:z.href,target:"_blank",rel:"noreferrer",children:z.label},z.href))})]})]}),_?l.jsxs(bO,{open:_!==void 0,title:_.summary,subtitle:`${_.projectName} · ${_.kindLabel}`,onClose:b,children:[l.jsxs("div",{className:"flex flex-wrap items-center gap-x-5 gap-y-1 text-sm",children:[l.jsx(Iu,{status:_.status}),l.jsx("span",{className:"text-zinc-400",children:_.startedAt}),l.jsx("span",{className:"text-zinc-500",children:_.duration}),l.jsx("span",{className:"text-zinc-600",children:_.triggerLabel})]}),_.status==="failed"&&_.statusDetail&&l.jsx("p",{className:"text-sm text-rose-300/80 mt-2",children:_.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"}),S?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(Wo,{provider:z.provider}),l.jsx(FS,{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((U,O)=>l.jsx("li",{className:"text-xs text-zinc-500 truncate",children:l.jsx("a",{href:U.uri,target:"_blank",rel:"noreferrer",className:"hover:text-zinc-300",children:U.title||U.uri})},O))})]}),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:E2(j.error)})]}):l.jsx("p",{className:"text-sm text-zinc-500",children:"No snapshot data available."})]})]}):null,E?l.jsx(NM,{evidence:E.evidence,project:E.project,onClose:b}):null]})}class n5 extends N.Component{state={error:null};static getDerivedStateFromError(t){return{error:t}}componentDidCatch(t,s){console.error("[ErrorBoundary]",t,s.componentStack)}handleReset=()=>{this.setState({error:null})};render(){return this.state.error?l.jsx("div",{className:"page-container",children:l.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 py-20 text-center",children:[l.jsx("div",{className:"rounded-full bg-rose-950/40 p-3",children:l.jsx(k2,{className:"size-6 text-rose-400"})}),l.jsx("h2",{className:"text-lg font-semibold text-zinc-100",children:"Something went wrong"}),l.jsx("p",{className:"text-sm text-zinc-400 max-w-md",children:this.state.error.message||"An unexpected error occurred while rendering this page."}),l.jsxs("div",{className:"flex gap-3 mt-2",children:[l.jsxs(le,{variant:"secondary",size:"sm",onClick:this.handleReset,children:[l.jsx(S2,{className:"size-3.5 mr-1.5"}),"Try again"]}),l.jsx(le,{variant:"secondary",size:"sm",onClick:()=>{window.location.href="/"},children:"Go home"})]})]})}):this.props.children}}const He=N.forwardRef(({className:e,...t},s)=>l.jsx("div",{ref:s,className:Kn("rounded-xl border border-zinc-800 bg-zinc-950/75 shadow-[0_0_0_1px_rgba(255,255,255,0.01)] backdrop-blur",e),...t}));He.displayName="Card";const s5=N.forwardRef(({className:e,...t},s)=>l.jsx("div",{ref:s,className:Kn("flex flex-col gap-1.5 p-5",e),...t}));s5.displayName="CardHeader";const i5=N.forwardRef(({className:e,...t},s)=>l.jsx("h3",{ref:s,className:Kn("font-medium tracking-tight text-zinc-50",e),...t}));i5.displayName="CardTitle";const a5=N.forwardRef(({className:e,...t},s)=>l.jsx("p",{ref:s,className:Kn("text-sm text-zinc-500",e),...t}));a5.displayName="CardDescription";const r5=N.forwardRef(({className:e,...t},s)=>l.jsx("div",{ref:s,className:Kn("p-5 pt-0",e),...t}));r5.displayName="CardContent";function o5({points:e,tone:t}){const s=N.useId();if(e.length===0)return null;const a=42,r=132,c=5,d=Math.min(...e),p=Math.max(...e)-d||1,m=r-c*2,b=a-c*2,y=e.map((v,x)=>{const j=c+x/Math.max(e.length-1,1)*m,S=c+(1-(v-d)/p)*b;return`${j},${S}`}).join(" ");return l.jsxs("svg",{className:`sparkline sparkline-${t}`,viewBox:`0 0 ${r} ${a}`,"aria-hidden":"true",children:[l.jsx("defs",{children:l.jsx("clipPath",{id:s,children:l.jsx("rect",{x:c,y:c,width:m,height:b,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"})]})}function l5(e){return e.displayName??e.name.charAt(0).toUpperCase()+e.name.slice(1)}function c5(e,t,s){return e.map(a=>{if(a.id==="api")return{...a,tone:xu(t.apiStatus),detail:t.apiStatus.state==="ok"?"Healthy":"Needs attention",meta:t.apiStatus.detail};if(a.id==="worker")return{...a,tone:xu(t.workerStatus),detail:t.workerStatus.state==="ok"?"Healthy":"Needs attention",meta:t.workerStatus.detail};const r=s.providerStatuses.filter(p=>p.state==="ready").length,c=s.providerStatuses.length,d=r>0,f=s.providerStatuses.filter(p=>p.state==="ready").map(p=>l5(p)).join(" · ");return{...a,label:"Providers",tone:d?"positive":"caution",detail:`${r} of ${c} configured`,meta:f||"None configured"}})}function u5(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 d5(e,t,s){const a=u5(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 f5=Qu();function h5({project:e}){return l.jsxs(gt,{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," · ",$u(e.lastRun.status)]})]})}),l.jsx("div",{className:"project-row-chart",children:l.jsx(o5,{points:e.trend,tone:GS(e.lastRun.status)})}),l.jsx("span",{className:"project-row-link",children:l.jsx(Uu,{className:"h-4 w-4 text-zinc-500"})})]})}function m5(){const e=cl(),{dashboard:t}=ka(),s=t??e?.dashboard??f5.dashboard,a=s.portfolioOverview,d=Yu(!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=c5(a.systemHealth,d,s.settings),{openRun:p}=ul();return l.jsxs("div",{className:"page-container",children:[l.jsxs("div",{className:"page-header",children:[l.jsxs("div",{className:"page-header-left",children:[l.jsx("h1",{className:"page-title",children:"Portfolio"}),l.jsx("p",{className:"page-subtitle",children:"Visibility and execution state across all projects"})]}),l.jsx("div",{className:"page-header-right",children:l.jsx("p",{className:"text-[11px] text-zinc-600",children:a.lastUpdatedAt})})]}),a.projects.length>0?l.jsx("div",{className:"project-list project-list-scrollable",children:a.projects.map(m=>l.jsx(h5,{project:m},m.project.id))}):l.jsxs(He,{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(le,{size:"sm",asChild:!0,children:l.jsx(gt,{to:a.emptyState?.ctaHref==="/setup"||!a.emptyState?.ctaHref?"/setup":"/",children:a.emptyState?.ctaLabel??"Launch setup"})})]}),l.jsxs("div",{className:"overview-secondary-grid",children:[a.attentionItems.length>0&&l.jsxs("section",{className:"overview-secondary-section",children:[l.jsx("div",{className:"section-head section-head-inline",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Needs attention"}),l.jsx("h2",{className:"section-title-sm",children:"What changed"})]})}),l.jsx("div",{className:"attention-list attention-list-scrollable",children:a.attentionItems.map(m=>l.jsxs(gt,{to:m.href,className:`attention-item attention-item-${m.tone}`,children:[l.jsxs("div",{children:[l.jsx("p",{className:"attention-title",children:m.title}),l.jsx("p",{className:"attention-detail",children:m.detail})]}),l.jsx("span",{className:"attention-action",children:m.actionLabel})]},m.id))})]}),l.jsxs("section",{className:"overview-secondary-section",children:[l.jsx("div",{className:"section-head section-head-inline",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Recent runs"}),l.jsx("h2",{className:"section-title-sm",children:"Activity"})]})}),l.jsx("div",{className:"compact-stack compact-stack-scrollable",children:a.recentRuns.length>0?a.recentRuns.map(m=>l.jsxs("button",{className:"compact-run",type:"button",onClick:()=>p(m.id),children:[l.jsxs("div",{children:[l.jsx("p",{className:"compact-run-title",children:m.projectName}),l.jsx("p",{className:"compact-run-detail",children:m.summary})]}),l.jsx(Iu,{status:m.status})]},m.id)):l.jsx("p",{className:"supporting-copy",children:"Run history appears here after the first launch."})})]})]}),l.jsxs("section",{className:"page-section",children:[l.jsx("div",{className:"section-head section-head-inline",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"System health"}),l.jsx("h2",{className:"section-title-sm",children:"Infrastructure"})]})}),l.jsx("div",{className:"health-grid",children:f.map(m=>l.jsxs(He,{className:"surface-card compact-card",children:[l.jsxs("div",{className:"section-head",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:m.label}),l.jsx("h3",{children:m.detail})]}),l.jsx(lt,{tone:m.tone,children:m.label})]}),l.jsx("p",{className:"supporting-copy",children:m.meta})]},m.id))})]})]})}const Rp=Symbol.for("yaml.alias"),Om=Symbol.for("yaml.document"),Di=Symbol.for("yaml.map"),p1=Symbol.for("yaml.pair"),vs=Symbol.for("yaml.scalar"),Pr=Symbol.for("yaml.seq"),Fn=Symbol.for("yaml.node.type"),za=e=>!!e&&typeof e=="object"&&e[Fn]===Rp,Ju=e=>!!e&&typeof e=="object"&&e[Fn]===Om,dl=e=>!!e&&typeof e=="object"&&e[Fn]===Di,Dt=e=>!!e&&typeof e=="object"&&e[Fn]===p1,ut=e=>!!e&&typeof e=="object"&&e[Fn]===vs,fl=e=>!!e&&typeof e=="object"&&e[Fn]===Pr;function At(e){if(e&&typeof e=="object")switch(e[Fn]){case Di:case Pr:return!0}return!1}function Tt(e){if(e&&typeof e=="object")switch(e[Fn]){case Rp:case Di:case vs:case Pr:return!0}return!1}const g1=e=>(ut(e)||At(e))&&!!e.anchor,ca=Symbol("break visit"),p5=Symbol("skip children"),Fo=Symbol("remove node");function $r(e,t){const s=g5(t);Ju(e)?wr(null,e.contents,s,Object.freeze([e]))===Fo&&(e.contents=null):wr(null,e,s,Object.freeze([]))}$r.BREAK=ca;$r.SKIP=p5;$r.REMOVE=Fo;function wr(e,t,s,a){const r=y5(e,t,s,a);if(Tt(r)||Dt(r))return v5(e,a,r),wr(e,r,s,a);if(typeof r!="symbol"){if(At(t)){a=Object.freeze(a.concat(t));for(let c=0;c<t.items.length;++c){const d=wr(c,t.items[c],s,a);if(typeof d=="number")c=d-1;else{if(d===ca)return ca;d===Fo&&(t.items.splice(c,1),c-=1)}}}else if(Dt(t)){a=Object.freeze(a.concat(t));const c=wr("key",t.key,s,a);if(c===ca)return ca;c===Fo&&(t.key=null);const d=wr("value",t.value,s,a);if(d===ca)return ca;d===Fo&&(t.value=null)}}return r}function g5(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 y5(e,t,s,a){if(typeof s=="function")return s(e,t,a);if(dl(t))return s.Map?.(e,t,a);if(fl(t))return s.Seq?.(e,t,a);if(Dt(t))return s.Pair?.(e,t,a);if(ut(t))return s.Scalar?.(e,t,a);if(za(t))return s.Alias?.(e,t,a)}function v5(e,t,s){const a=t[t.length-1];if(At(a))a.items[e]=s;else if(Dt(a))e==="key"?a.key=s:a.value=s;else if(Ju(a))a.contents=s;else{const r=za(a)?"alias":"scalar";throw new Error(`Cannot replace node with ${r} parent`)}}const b5={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},x5=e=>e.replace(/[!,[\]{}]/g,t=>b5[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+x5(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&&Tt(t.contents)){const c={};$r(t.contents,(d,f)=>{Tt(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 y1(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 v1(e){const t=new Set;return $r(e,{Value(s,a){a.anchor&&t.add(a.anchor)}}),t}function b1(e,t){for(let s=1;;++s){const a=`${e}${s}`;if(!t.has(a))return a}}function S5(e,t){const s=[],a=new Map;let r=null;return{onAnchor:c=>{s.push(c),r??(r=v1(e));const d=b1(t,r);return r.add(d),d},setAnchors:()=>{for(const c of s){const d=a.get(c);if(typeof d=="object"&&d.anchor&&(ut(d.node)||At(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 jr(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=jr(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=jr(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=jr(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=jr(e,a,r,c);d===void 0?delete a[r]:d!==c&&(a[r]=d)}return e.call(t,s,a)}function Zn(e,t,s){if(Array.isArray(e))return e.map((a,r)=>Zn(a,String(r),s));if(e&&typeof e.toJSON=="function"){if(!s||!g1(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 Op{constructor(t){Object.defineProperty(this,Fn,{value:t})}clone(){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:s,maxAliasCount:a,onAnchor:r,reviver:c}={}){if(!Ju(t))throw new TypeError("A document argument is required");const d={anchors:new Map,doc:t,keep:!0,mapAsMap:s===!0,mapKeyWarned:!1,maxAliasCount:typeof a=="number"?a:100},f=Zn(this,"",d);if(typeof r=="function")for(const{count:p,res:m}of d.anchors.values())r(m,p);return typeof c=="function"?jr(c,{"":f},"",f):f}}class Ap extends Op{constructor(t){super(Rp),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=[],$r(t,{Node:(c,d)=>{(za(d)||g1(d))&&a.push(d)}}),s&&(s.aliasResolveCache=a));let r;for(const c of a){if(c===this)break;c.anchor===this.source&&(r=c)}return r}toJSON(t,s){if(!s)return{source:this.source};const{anchors:a,doc:r,maxAliasCount:c}=s,d=this.resolve(r,s);if(!d){const p=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(p)}let f=a.get(d);if(f||(Zn(d,null,s),f=a.get(d)),f?.res===void 0){const p="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(p)}if(c>=0&&(f.count+=1,f.aliasCount===0&&(f.aliasCount=iu(r,d,a)),f.count*f.aliasCount>c)){const p="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(p)}return f.res}toString(t,s,a){const r=`*${this.source}`;if(t){if(y1(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 iu(e,t,s){if(za(t)){const a=t.resolve(e),r=s&&a&&s.get(a);return r?r.count*r.aliasCount:0}else if(At(t)){let a=0;for(const r of t.items){const c=iu(e,r,s);c>a&&(a=c)}return a}else if(Dt(t)){const a=iu(e,t.key,s),r=iu(e,t.value,s);return Math.max(a,r)}return 1}const x1=e=>!e||typeof e!="function"&&typeof e!="object";class Re extends Op{constructor(t){super(vs),this.value=t}toJSON(t,s){return s?.keep?this.value:Zn(this.value,t,s)}toString(){return String(this.value)}}Re.BLOCK_FOLDED="BLOCK_FOLDED";Re.BLOCK_LITERAL="BLOCK_LITERAL";Re.PLAIN="PLAIN";Re.QUOTE_DOUBLE="QUOTE_DOUBLE";Re.QUOTE_SINGLE="QUOTE_SINGLE";const w5="tag:yaml.org,2002:";function j5(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 il(e,t,s){if(Ju(e)&&(e=e.contents),Tt(e))return e;if(Dt(e)){const y=s.schema[Di].createNode?.(s.schema,null,s);return y.items.push(e),y}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:a,onAnchor:r,onTagObj:c,schema:d,sourceObjects:f}=s;let p;if(a&&e&&typeof e=="object"){if(p=f.get(e),p)return p.anchor??(p.anchor=r(e)),new Ap(p.anchor);p={anchor:null,node:null},f.set(e,p)}t?.startsWith("!!")&&(t=w5+t.slice(2));let m=j5(e,t,d.tags);if(!m){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const y=new Re(e);return p&&(p.node=y),y}m=e instanceof Map?d[Di]:Symbol.iterator in Object(e)?d[Pr]:d[Di]}c&&(c(m),delete s.onTagObj);const b=m?.createNode?m.createNode(s.schema,e,s):typeof m?.nodeClass?.from=="function"?m.nodeClass.from(s.schema,e,s):new Re(e);return t?b.tag=t:m.default||(b.tag=m.tag),p&&(p.node=b),b}function Eu(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 il(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 Bo=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class S1 extends Op{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=>Tt(a)||Dt(a)?a.clone(t):a),this.range&&(s.range=this.range.slice()),s}addIn(t,s){if(Bo(t))this.add(s);else{const[a,...r]=t,c=this.get(a,!0);if(At(c))c.addIn(r,s);else if(c===void 0&&this.schema)this.set(a,Eu(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(At(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&&ut(c)?c.value:c:At(c)?c.getIn(r,s):void 0}hasAllNullValues(t){return this.items.every(s=>{if(!Dt(s))return!1;const a=s.value;return a==null||t&&ut(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 At(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(At(c))c.setIn(r,s);else if(c===void 0&&this.schema)this.set(a,Eu(this.schema,r,s));else throw new Error(`Expected YAML collection at ${a}. Remaining path: ${r}`)}}}const N5=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function qs(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const ma=(e,t,s)=>e.endsWith(`
|
|
97
|
+
`)?qs(s,t):s.includes(`
|
|
98
|
+
`)?`
|
|
99
|
+
`+qs(s,t):(e.endsWith(" ")?"":" ")+s,w1="flow",Am="block",au="quoted";function Xu(e,t,s="flow",{indentAtStart:a,lineWidth:r=80,minContentWidth:c=20,onFold:d,onOverflow:f}={}){if(!r||r<0)return e;r<c&&(c=0);const p=Math.max(1+c,1+r-t.length);if(e.length<=p)return e;const m=[],b={};let y=r-t.length;typeof a=="number"&&(a>r-Math.max(2,c)?m.push(0):y=r-a);let v,x,j=!1,S=-1,C=-1,_=-1;s===Am&&(S=Cx(e,S,t.length),S!==-1&&(y=S+p));for(let R;R=e[S+=1];){if(s===au&&R==="\\"){switch(C=S,e[S+1]){case"x":S+=3;break;case"u":S+=5;break;case"U":S+=9;break;default:S+=1}_=S}if(R===`
|
|
100
|
+
`)s===Am&&(S=Cx(e,S,t.length)),y=S+t.length+p,v=void 0;else{if(R===" "&&x&&x!==" "&&x!==`
|
|
101
|
+
`&&x!==" "){const z=e[S+1];z&&z!==" "&&z!==`
|
|
102
|
+
`&&z!==" "&&(v=S)}if(S>=y)if(v)m.push(v),y=v+p,v=void 0;else if(s===au){for(;x===" "||x===" ";)x=R,R=e[S+=1],j=!0;const z=S>_+1?S-2:C-1;if(b[z])return e;m.push(z),b[z]=!0,y=z+p,v=void 0}else j=!0}x=R}if(j&&f&&f(),m.length===0)return e;d&&d();let E=e.slice(0,m[0]);for(let R=0;R<m.length;++R){const z=m[R],U=m[R+1]||e.length;z===0?E=`
|
|
103
|
+
${t}${e.slice(0,U)}`:(s===au&&b[z]&&(E+=`${e[z]}\\`),E+=`
|
|
104
|
+
${t}${e.slice(z+1,U)}`)}return E}function Cx(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 Wu=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),ed=e=>/^(%|---|\.\.\.)/m.test(e);function C5(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 Go(e,t){const s=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return s;const{implicitKey:a}=t,r=t.options.doubleQuotedMinMultiLineLength,c=t.indent||(ed(e)?" ":"");let d="",f=0;for(let p=0,m=s[p];m;m=s[++p])if(m===" "&&s[p+1]==="\\"&&s[p+2]==="n"&&(d+=s.slice(f,p)+"\\ ",p+=1,f=p,m="\\"),m==="\\")switch(s[p+1]){case"u":{d+=s.slice(f,p);const b=s.substr(p+2,4);switch(b){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:b.substr(0,2)==="00"?d+="\\x"+b.substr(2):d+=s.substr(p,6)}p+=5,f=p+1}break;case"n":if(a||s[p+2]==='"'||s.length<r)p+=1;else{for(d+=s.slice(f,p)+`
|
|
107
|
+
|
|
108
|
+
`;s[p+2]==="\\"&&s[p+3]==="n"&&s[p+4]!=='"';)d+=`
|
|
109
|
+
`,p+=2;d+=c,s[p+2]===" "&&(d+="\\"),p+=1,f=p+1}break;default:p+=1}return d=f?d+s.slice(f):s,a?d:Xu(d,c,au,Wu(t,!1))}function Tm(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
|
|
110
|
+
`)||/[ \t]\n|\n[ \t]/.test(e))return Go(e,t);const s=t.indent||(ed(e)?" ":""),a="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
111
|
+
${s}`)+"'";return t.implicitKey?a:Xu(a,s,w1,Wu(t,!1))}function Nr(e,t){const{singleQuote:s}=t.options;let a;if(s===!1)a=Go;else{const r=e.includes('"'),c=e.includes("'");r&&!c?a=Tm:c&&!r?a=Go:a=s?Tm:Go}return a(e,t)}let Dm;try{Dm=new RegExp(`(^|(?<!
|
|
112
|
+
))
|
|
113
|
+
+(?!
|
|
114
|
+
|$)`,"g")}catch{Dm=/\n+(?!\n|$)/g}function ru({comment:e,type:t,value:s},a,r,c){const{blockQuote:d,commentString:f,lineWidth:p}=a.options;if(!d||/\n[\t ]+$/.test(s))return Nr(s,a);const m=a.indent||(a.forceBlockIndent||ed(s)?" ":""),b=d==="literal"?!0:d==="folded"||t===Re.BLOCK_FOLDED?!1:t===Re.BLOCK_LITERAL?!0:!C5(s,p,m.length);if(!s)return b?`|
|
|
115
|
+
`:`>
|
|
116
|
+
`;let y,v;for(v=s.length;v>0;--v){const U=s[v-1];if(U!==`
|
|
117
|
+
`&&U!==" "&&U!==" ")break}let x=s.substring(v);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(Dm,`$&${m}`));let S=!1,C,_=-1;for(C=0;C<s.length;++C){const U=s[C];if(U===" ")S=!0;else if(U===`
|
|
120
|
+
`)_=C;else break}let E=s.substring(0,_<C?_+1:C);E&&(s=s.substring(E.length),E=E.replace(/\n+/g,`$&${m}`));let z=(S?m?"2":"1":"")+y;if(e&&(z+=" "+f(e.replace(/ ?[\r\n]+/g," ")),r&&r()),!b){const U=s.replace(/\n+/g,`
|
|
121
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${m}`);let O=!1;const M=Wu(a,!0);d!=="folded"&&t!==Re.BLOCK_FOLDED&&(M.onOverflow=()=>{O=!0});const A=Xu(`${E}${U}${x}`,m,Am,M);if(!O)return`>${z}
|
|
122
|
+
${m}${A}`}return s=s.replace(/\n+/g,`$&${m}`),`|${z}
|
|
123
|
+
${m}${E}${s}${x}`}function _5(e,t,s,a){const{type:r,value:c}=e,{actualString:d,implicitKey:f,indent:p,indentStep:m,inFlow:b}=t;if(f&&c.includes(`
|
|
124
|
+
`)||b&&/[[\]{},]/.test(c))return Nr(c,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(c))return f||b||!c.includes(`
|
|
125
|
+
`)?Nr(c,t):ru(e,t,s,a);if(!f&&!b&&r!==Re.PLAIN&&c.includes(`
|
|
126
|
+
`))return ru(e,t,s,a);if(ed(c)){if(p==="")return t.forceBlockIndent=!0,ru(e,t,s,a);if(f&&p===m)return Nr(c,t)}const y=c.replace(/\n+/g,`$&
|
|
127
|
+
${p}`);if(d){const v=S=>S.default&&S.tag!=="tag:yaml.org,2002:str"&&S.test?.test(y),{compat:x,tags:j}=t.doc.schema;if(j.some(v)||x?.some(v))return Nr(c,t)}return f?y:Xu(y,p,w1,Wu(t,!1))}function Tp(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!==Re.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(d.value)&&(f=Re.QUOTE_DOUBLE);const p=b=>{switch(b){case Re.BLOCK_FOLDED:case Re.BLOCK_LITERAL:return r||c?Nr(d.value,t):ru(d,t,s,a);case Re.QUOTE_DOUBLE:return Go(d.value,t);case Re.QUOTE_SINGLE:return Tm(d.value,t);case Re.PLAIN:return _5(d,t,s,a);default:return null}};let m=p(f);if(m===null){const{defaultKeyType:b,defaultStringType:y}=t.options,v=r&&b||y;if(m=p(v),m===null)throw new Error(`Unsupported default string type ${v}`)}return m}function j1(e,t){const s=Object.assign({blockQuote:!0,commentString:N5,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 k5(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(ut(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 z5(e,t,{anchors:s,doc:a}){if(!a.directives)return"";const r=[],c=(ut(e)||At(e))&&e.anchor;c&&y1(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 Tr(e,t,s,a){if(Dt(e))return e.toString(t,s,a);if(za(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let r;const c=Tt(e)?e:t.doc.createNode(e,{onTagObj:p=>r=p});r??(r=k5(t.doc.schema.tags,c));const d=z5(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):ut(c)?Tp(c,t,s,a):c.toString(t,s,a);return d?ut(c)||f[0]==="{"||f[0]==="["?`${d} ${f}`:`${d}
|
|
128
|
+
${t.indent}${f}`:f}function E5({key:e,value:t},s,a,r){const{allNullValues:c,doc:d,indent:f,indentStep:p,options:{commentString:m,indentSeq:b,simpleKeys:y}}=s;let v=Tt(e)&&e.comment||null;if(y){if(v)throw new Error("With simple keys, key nodes cannot have comments");if(At(e)||!Tt(e)&&typeof e=="object"){const M="With simple keys, collection cannot be used as a key value";throw new Error(M)}}let x=!y&&(!e||v&&t==null&&!s.inFlow||At(e)||(ut(e)?e.type===Re.BLOCK_FOLDED||e.type===Re.BLOCK_LITERAL:typeof e=="object"));s=Object.assign({},s,{allNullValues:!1,implicitKey:!x&&(y||!c),indent:f+p});let j=!1,S=!1,C=Tr(e,s,()=>j=!0,()=>S=!0);if(!x&&!s.inFlow&&C.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(),C===""?"?":x?`? ${C}`:C}else if(c&&!y||t==null&&x)return C=`? ${C}`,v&&!j?C+=ma(C,s.indent,m(v)):S&&r&&r(),C;j&&(v=null),x?(v&&(C+=ma(C,s.indent,m(v))),C=`? ${C}
|
|
129
|
+
${f}:`):(C=`${C}:`,v&&(C+=ma(C,s.indent,m(v))));let _,E,R;Tt(t)?(_=!!t.spaceBefore,E=t.commentBefore,R=t.comment):(_=!1,E=null,R=null,t&&typeof t=="object"&&(t=d.createNode(t))),s.implicitKey=!1,!x&&!v&&ut(t)&&(s.indentAtStart=C.length+1),S=!1,!b&&p.length>=2&&!s.inFlow&&!x&&fl(t)&&!t.flow&&!t.tag&&!t.anchor&&(s.indent=s.indent.substring(2));let z=!1;const U=Tr(t,s,()=>z=!0,()=>S=!0);let O=" ";if(v||_||E){if(O=_?`
|
|
130
|
+
`:"",E){const M=m(E);O+=`
|
|
131
|
+
${qs(M,s.indent)}`}U===""&&!s.inFlow?O===`
|
|
132
|
+
`&&R&&(O=`
|
|
133
|
+
|
|
134
|
+
`):O+=`
|
|
135
|
+
${s.indent}`}else if(!x&&At(t)){const M=U[0],A=U.indexOf(`
|
|
136
|
+
`),Z=A!==-1,W=s.inFlow??t.flow??t.items.length===0;if(Z||!W){let Q=!1;if(Z&&(M==="&"||M==="!")){let se=U.indexOf(" ");M==="&"&&se!==-1&&se<A&&U[se+1]==="!"&&(se=U.indexOf(" ",se+1)),(se===-1||A<se)&&(Q=!0)}Q||(O=`
|
|
137
|
+
${s.indent}`)}}else(U===""||U[0]===`
|
|
138
|
+
`)&&(O="");return C+=O+U,s.inFlow?z&&a&&a():R&&!z?C+=ma(C,s.indent,m(R)):S&&r&&r(),C}function R5(e,t){(e==="debug"||e==="warn")&&console.warn(t)}const Gc="<<",Hs={identify:e=>e===Gc||typeof e=="symbol"&&e.description===Gc,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Re(Symbol(Gc)),{addToJSMap:N1}),stringify:()=>Gc},O5=(e,t)=>(Hs.identify(t)||ut(t)&&(!t.type||t.type===Re.PLAIN)&&Hs.identify(t.value))&&e?.doc.schema.tags.some(s=>s.tag===Hs.tag&&s.default);function N1(e,t,s){if(s=e&&za(s)?s.resolve(e.doc):s,fl(s))for(const a of s.items)Vh(e,t,a);else if(Array.isArray(s))for(const a of s)Vh(e,t,a);else Vh(e,t,s)}function Vh(e,t,s){const a=e&&za(s)?s.resolve(e.doc):s;if(!dl(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 C1(e,t,{key:s,value:a}){if(Tt(s)&&s.addToJSMap)s.addToJSMap(e,t,a);else if(O5(e,s))N1(e,t,a);else{const r=Zn(s,"",e);if(t instanceof Map)t.set(r,Zn(a,r,e));else if(t instanceof Set)t.add(r);else{const c=A5(s,r,e),d=Zn(a,c,e);c in t?Object.defineProperty(t,c,{value:d,writable:!0,enumerable:!0,configurable:!0}):t[c]=d}}return t}function A5(e,t,s){if(t===null)return"";if(typeof t!="object")return String(t);if(Tt(e)&&s?.doc){const a=j1(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)+'..."'),R5(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 Dp(e,t,s){const a=il(e,void 0,s),r=il(t,void 0,s);return new dn(a,r)}class dn{constructor(t,s=null){Object.defineProperty(this,Fn,{value:p1}),this.key=t,this.value=s}clone(t){let{key:s,value:a}=this;return Tt(s)&&(s=s.clone(t)),Tt(a)&&(a=a.clone(t)),new dn(s,a)}toJSON(t,s){const a=s?.mapAsMap?new Map:{};return C1(s,a,this)}toString(t,s,a){return t?.doc?E5(this,t,s,a):JSON.stringify(this)}}function _1(e,t,s){return(t.inFlow??e.flow?D5:T5)(e,t,s)}function T5({comment:e,items:t},s,{blockItemPrefix:a,flowChars:r,itemIndent:c,onChompKeep:d,onComment:f}){const{indent:p,options:{commentString:m}}=s,b=Object.assign({},s,{indent:c,type:null});let y=!1;const v=[];for(let j=0;j<t.length;++j){const S=t[j];let C=null;if(Tt(S))!y&&S.spaceBefore&&v.push(""),Ru(s,v,S.commentBefore,y),S.comment&&(C=S.comment);else if(Dt(S)){const E=Tt(S.key)?S.key:null;E&&(!y&&E.spaceBefore&&v.push(""),Ru(s,v,E.commentBefore,y))}y=!1;let _=Tr(S,b,()=>C=null,()=>y=!0);C&&(_+=ma(_,c,m(C))),y&&C&&(y=!1),v.push(a+_)}let x;if(v.length===0)x=r.start+r.end;else{x=v[0];for(let j=1;j<v.length;++j){const S=v[j];x+=S?`
|
|
139
|
+
${p}${S}`:`
|
|
140
|
+
`}}return e?(x+=`
|
|
141
|
+
`+qs(m(e),p),f&&f()):y&&d&&d(),x}function D5({items:e},t,{flowChars:s,itemIndent:a}){const{indent:r,indentStep:c,flowCollectionPadding:d,options:{commentString:f}}=t;a+=c;const p=Object.assign({},t,{indent:a,inFlow:!0,type:null});let m=!1,b=0;const y=[];for(let j=0;j<e.length;++j){const S=e[j];let C=null;if(Tt(S))S.spaceBefore&&y.push(""),Ru(t,y,S.commentBefore,!1),S.comment&&(C=S.comment);else if(Dt(S)){const E=Tt(S.key)?S.key:null;E&&(E.spaceBefore&&y.push(""),Ru(t,y,E.commentBefore,!1),E.comment&&(m=!0));const R=Tt(S.value)?S.value:null;R?(R.comment&&(C=R.comment),R.commentBefore&&(m=!0)):S.value==null&&E?.comment&&(C=E.comment)}C&&(m=!0);let _=Tr(S,p,()=>C=null);j<e.length-1&&(_+=","),C&&(_+=ma(_,a,f(C))),!m&&(y.length>b||_.includes(`
|
|
142
|
+
`))&&(m=!0),y.push(_),b=y.length}const{start:v,end:x}=s;if(y.length===0)return v+x;if(!m){const j=y.reduce((S,C)=>S+C.length+2,2);m=t.options.lineWidth>0&&j>t.options.lineWidth}if(m){let j=v;for(const S of y)j+=S?`
|
|
143
|
+
${c}${r}${S}`:`
|
|
144
|
+
`;return`${j}
|
|
145
|
+
${r}${x}`}else return`${v}${d}${y.join(" ")}${d}${x}`}function Ru({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=ut(t)?t.value:t;for(const a of e)if(Dt(a)&&(a.key===t||a.key===s||ut(a.key)&&a.key.value===s))return a}class Hn extends S1{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(Di,t),this.items=[]}static from(t,s,a){const{keepUndefined:r,replacer:c}=a,d=new this(t),f=(p,m)=>{if(typeof c=="function")m=c.call(s,p,m);else if(Array.isArray(c)&&!c.includes(p))return;(m!==void 0||r)&&d.items.push(Dp(p,m,a))};if(s instanceof Map)for(const[p,m]of s)f(p,m);else if(s&&typeof s=="object")for(const p of Object.keys(s))f(p,s[p]);return typeof t.sortMapEntries=="function"&&d.items.sort(t.sortMapEntries),d}add(t,s){let a;Dt(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`);ut(r.value)&&x1(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&&ut(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)C1(s,r,c);return r}toString(t,s,a){if(!t)return JSON.stringify(this);for(const r of this.items)if(!Dt(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})),_1(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:a,onComment:s})}}const Ir={collection:"map",default:!0,nodeClass:Hn,tag:"tag:yaml.org,2002:map",resolve(e,t){return dl(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,s)=>Hn.from(e,t,s)};class wa extends S1{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(Pr,t),this.items=[]}add(t){this.items.push(t)}delete(t){const s=Kc(t);return typeof s!="number"?!1:this.items.splice(s,1).length>0}get(t,s){const a=Kc(t);if(typeof a!="number")return;const r=this.items[a];return!s&&ut(r)?r.value:r}has(t){const s=Kc(t);return typeof s=="number"&&s<this.items.length}set(t,s){const a=Kc(t);if(typeof a!="number")throw new Error(`Expected a valid index, not ${t}.`);const r=this.items[a];ut(r)&&x1(s)?r.value=s:this.items[a]=s}toJSON(t,s){const a=[];s?.onCreate&&s.onCreate(a);let r=0;for(const c of this.items)a.push(Zn(c,String(r++),s));return a}toString(t,s,a){return t?_1(this,t,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(t.indent||"")+" ",onChompKeep:a,onComment:s}):JSON.stringify(this)}static from(t,s,a){const{replacer:r}=a,c=new this(t);if(s&&Symbol.iterator in Object(s)){let d=0;for(let f of s){if(typeof r=="function"){const p=s instanceof Set?f:String(d++);f=r.call(s,p,f)}c.items.push(il(f,void 0,a))}}return c}}function Kc(e){let t=ut(e)?e.value:e;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}const Br={collection:"seq",default:!0,nodeClass:wa,tag:"tag:yaml.org,2002:seq",resolve(e,t){return fl(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,s)=>wa.from(e,t,s)},td={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),Tp(e,t,s,a)}},nd={identify:e=>e==null,createNode:()=>new Re(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Re(null),stringify:({source:e},t)=>typeof e=="string"&&nd.test.test(e)?e:t.options.nullStr},Lp={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new Re(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},s){if(e&&Lp.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 k1={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},z1={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)}},E1={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 Re(parseFloat(e)),s=e.indexOf(".");return s!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-s-1),t},stringify:rs},sd=e=>typeof e=="bigint"||Number.isInteger(e),Mp=(e,t,s,{intAsBigInt:a})=>a?BigInt(e):parseInt(e.substring(t),s);function R1(e,t,s){const{value:a}=e;return sd(a)&&a>=0?s+a.toString(t):rs(e)}const O1={identify:e=>sd(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,s)=>Mp(e,2,8,s),stringify:e=>R1(e,8,"0o")},A1={identify:sd,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,s)=>Mp(e,0,10,s),stringify:rs},T1={identify:e=>sd(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,s)=>Mp(e,2,16,s),stringify:e=>R1(e,16,"0x")},L5=[Ir,Br,td,nd,Lp,O1,A1,T1,k1,z1,E1];function _x(e){return typeof e=="bigint"||Number.isInteger(e)}const Vc=({value:e})=>JSON.stringify(e),M5=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:Vc},{identify:e=>e==null,createNode:()=>new Re(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Vc},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:Vc},{identify:_x,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})=>_x(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:Vc}],U5={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},P5=[Ir,Br].concat(M5,U5),Up={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof atob=="function"){const s=atob(e.replace(/[\n\r]/g,"")),a=new Uint8Array(s.length);for(let r=0;r<s.length;++r)a[r]=s.charCodeAt(r);return a}else return t("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:t,value:s},a,r,c){if(!s)return"";const d=s;let f;if(typeof btoa=="function"){let p="";for(let m=0;m<d.length;++m)p+=String.fromCharCode(d[m]);f=btoa(p)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=Re.BLOCK_LITERAL),t!==Re.QUOTE_DOUBLE){const p=Math.max(a.options.lineWidth-a.indent.length,a.options.minContentWidth),m=Math.ceil(f.length/p),b=new Array(m);for(let y=0,v=0;y<m;++y,v+=p)b[y]=f.substr(v,p);f=b.join(t===Re.BLOCK_LITERAL?`
|
|
146
|
+
`:" ")}return Tp({comment:e,type:t,value:f},a,r,c)}};function D1(e,t){if(fl(e))for(let s=0;s<e.items.length;++s){let a=e.items[s];if(!Dt(a)){if(dl(a)){a.items.length>1&&t("Each pair must have its own sequence indicator");const r=a.items[0]||new dn(new Re(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]=Dt(a)?a:new dn(a)}}else t("Expected a sequence for this tag");return e}function L1(e,t,s){const{replacer:a}=s,r=new wa(e);r.tag="tag:yaml.org,2002:pairs";let c=0;if(t&&Symbol.iterator in Object(t))for(let d of t){typeof a=="function"&&(d=a.call(t,String(c++),d));let f,p;if(Array.isArray(d))if(d.length===2)f=d[0],p=d[1];else throw new TypeError(`Expected [key, value] tuple: ${d}`);else if(d&&d instanceof Object){const m=Object.keys(d);if(m.length===1)f=m[0],p=d[f];else throw new TypeError(`Expected tuple with one key, not ${m.length} keys`)}else f=d;r.items.push(Dp(f,p,s))}return r}const Pp={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:D1,createNode:L1};class zr extends wa{constructor(){super(),this.add=Hn.prototype.add.bind(this),this.delete=Hn.prototype.delete.bind(this),this.get=Hn.prototype.get.bind(this),this.has=Hn.prototype.has.bind(this),this.set=Hn.prototype.set.bind(this),this.tag=zr.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(Dt(r)?(c=Zn(r.key,"",s),d=Zn(r.value,c,s)):c=Zn(r,"",s),a.has(c))throw new Error("Ordered maps must not include duplicate keys");a.set(c,d)}return a}static from(t,s,a){const r=L1(t,s,a),c=new this;return c.items=r.items,c}}zr.tag="tag:yaml.org,2002:omap";const $p={collection:"seq",identify:e=>e instanceof Map,nodeClass:zr,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const s=D1(e,t),a=[];for(const{key:r}of s.items)ut(r)&&(a.includes(r.value)?t(`Ordered maps must not include duplicate keys: ${r.value}`):a.push(r.value));return Object.assign(new zr,s)},createNode:(e,t,s)=>zr.from(e,t,s)};function M1({value:e,source:t},s){return t&&(e?U1:P1).test.test(t)?t:e?s.options.trueStr:s.options.falseStr}const U1={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 Re(!0),stringify:M1},P1={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 Re(!1),stringify:M1},$5={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},I5={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)}},B5={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 Re(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},hl=e=>typeof e=="bigint"||Number.isInteger(e);function id(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 Ip(e,t,s){const{value:a}=e;if(hl(a)){const r=a.toString(t);return a<0?"-"+s+r.substr(1):s+r}return rs(e)}const q5={identify:hl,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,s)=>id(e,2,2,s),stringify:e=>Ip(e,2,"0b")},H5={identify:hl,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,s)=>id(e,1,8,s),stringify:e=>Ip(e,8,"0")},Z5={identify:hl,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,s)=>id(e,0,10,s),stringify:rs},F5={identify:hl,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,s)=>id(e,2,16,s),stringify:e=>Ip(e,16,"0x")};class Er extends Hn{constructor(t){super(t),this.tag=Er.tag}add(t){let s;Dt(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&&Dt(a)?ut(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(Dp(d,null,a));return c}}Er.tag="tag:yaml.org,2002:set";const Bp={collection:"map",identify:e=>e instanceof Set,nodeClass:Er,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,s)=>Er.from(e,t,s),resolve(e,t){if(dl(e)){if(e.hasAllNullValues(!0))return Object.assign(new Er,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function qp(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 $1(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 I1={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})=>qp(e,s),stringify:$1},B1={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=>qp(e,!1),stringify:$1},ad={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(ad.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,s,a,r,c,d,f]=t.map(Number),p=t[7]?Number((t[7]+"00").substr(1,3)):0;let m=Date.UTC(s,a-1,r,c||0,d||0,f||0,p);const b=t[8];if(b&&b!=="Z"){let y=qp(b,!1);Math.abs(y)<30&&(y*=60),m-=6e4*y}return new Date(m)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""},kx=[Ir,Br,td,nd,U1,P1,q5,H5,Z5,F5,$5,I5,B5,Up,Hs,$p,Pp,Bp,I1,B1,ad],zx=new Map([["core",L5],["failsafe",[Ir,Br,td]],["json",P5],["yaml11",kx],["yaml-1.1",kx]]),Ex={binary:Up,bool:Lp,float:E1,floatExp:z1,floatNaN:k1,floatTime:B1,int:A1,intHex:T1,intOct:O1,intTime:I1,map:Ir,merge:Hs,null:nd,omap:$p,pairs:Pp,seq:Br,set:Bp,timestamp:ad},G5={"tag:yaml.org,2002:binary":Up,"tag:yaml.org,2002:merge":Hs,"tag:yaml.org,2002:omap":$p,"tag:yaml.org,2002:pairs":Pp,"tag:yaml.org,2002:set":Bp,"tag:yaml.org,2002:timestamp":ad};function Qh(e,t,s){const a=zx.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(zx.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"?Ex[d]:d;if(!f){const p=JSON.stringify(d),m=Object.keys(Ex).map(b=>JSON.stringify(b)).join(", ");throw new Error(`Unknown custom tag ${p}; use one of ${m}`)}return c.includes(f)||c.push(f),c},[])}const K5=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class Hp{constructor({compat:t,customTags:s,merge:a,resolveKnownTags:r,schema:c,sortMapEntries:d,toStringDefaults:f}){this.compat=Array.isArray(t)?Qh(t,"compat"):t?Qh(null,t):null,this.name=typeof c=="string"&&c||"core",this.knownTags=r?G5:{},this.tags=Qh(s,this.name,a),this.toStringOptions=f??null,Object.defineProperty(this,Di,{value:Ir}),Object.defineProperty(this,vs,{value:td}),Object.defineProperty(this,Pr,{value:Br}),this.sortMapEntries=typeof d=="function"?d:d===!0?K5:null}clone(){const t=Object.create(Hp.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function V5(e,t){const s=[];let a=t.directives===!0;if(t.directives!==!1&&e.directives){const p=e.directives.toString(e);p?(s.push(p),a=!0):e.directives.docStart&&(a=!0)}a&&s.push("---");const r=j1(e,t),{commentString:c}=r.options;if(e.commentBefore){s.length!==1&&s.unshift("");const p=c(e.commentBefore);s.unshift(qs(p,""))}let d=!1,f=null;if(e.contents){if(Tt(e.contents)){if(e.contents.spaceBefore&&a&&s.push(""),e.contents.commentBefore){const b=c(e.contents.commentBefore);s.push(qs(b,""))}r.forceBlockIndent=!!e.comment,f=e.contents.comment}const p=f?void 0:()=>d=!0;let m=Tr(e.contents,r,()=>f=null,p);f&&(m+=ma(m,"",c(f))),(m[0]==="|"||m[0]===">")&&s[s.length-1]==="---"?s[s.length-1]=`--- ${m}`:s.push(m)}else s.push(Tr(e.contents,r));if(e.directives?.docEnd)if(e.comment){const p=c(e.comment);p.includes(`
|
|
149
|
+
`)?(s.push("..."),s.push(qs(p,""))):s.push(`... ${p}`)}else s.push("...");else{let p=e.comment;p&&d&&(p=p.replace(/^\n+/,"")),p&&((!d||f)&&s[s.length-1]!==""&&s.push(""),s.push(qs(c(p),"")))}return s.join(`
|
|
150
|
+
`)+`
|
|
151
|
+
`}class rd{constructor(t,s,a){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Fn,{value:Om});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(rd.prototype,{[Fn]:{value:Om}});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=Tt(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){gr(this.contents)&&this.contents.add(t)}addIn(t,s){gr(this.contents)&&this.contents.addIn(t,s)}createAlias(t,s){if(!t.anchor){const a=v1(this);t.anchor=!s||a.has(s)?b1(s||"a",a):s}return new Ap(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 C=E=>typeof E=="number"||E instanceof String||E instanceof Number,_=s.filter(C).map(String);_.length>0&&(s=s.concat(_)),r=s}else a===void 0&&s&&(a=s,s=void 0);const{aliasDuplicateObjects:c,anchorPrefix:d,flow:f,keepUndefined:p,onTagObj:m,tag:b}=a??{},{onAnchor:y,setAnchors:v,sourceObjects:x}=S5(this,d||"a"),j={aliasDuplicateObjects:c??!0,keepUndefined:p??!1,onAnchor:y,onTagObj:m,replacer:r,schema:this.schema,sourceObjects:x},S=il(t,b,j);return f&&At(S)&&(S.flow=!0),v(),S}createPair(t,s,a={}){const r=this.createNode(t,null,a),c=this.createNode(s,null,a);return new dn(r,c)}delete(t){return gr(this.contents)?this.contents.delete(t):!1}deleteIn(t){return Bo(t)?this.contents==null?!1:(this.contents=null,!0):gr(this.contents)?this.contents.deleteIn(t):!1}get(t,s){return At(this.contents)?this.contents.get(t,s):void 0}getIn(t,s){return Bo(t)?!s&&ut(this.contents)?this.contents.value:this.contents:At(this.contents)?this.contents.getIn(t,s):void 0}has(t){return At(this.contents)?this.contents.has(t):!1}hasIn(t){return Bo(t)?this.contents!==void 0:At(this.contents)?this.contents.hasIn(t):!1}set(t,s){this.contents==null?this.contents=Eu(this.schema,[t],s):gr(this.contents)&&this.contents.set(t,s)}setIn(t,s){Bo(t)?this.contents=s:this.contents==null?this.contents=Eu(this.schema,Array.from(t),s):gr(this.contents)&&this.contents.setIn(t,s)}setSchema(t,s={}){typeof t=="number"&&(t=String(t));let a;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new cn({version:"1.1"}),a={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new cn({version:t}),a={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,a=null;break;default:{const r=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${r}`)}}if(s.schema instanceof Object)this.schema=s.schema;else if(a)this.schema=new Hp(Object.assign(a,s));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:s,mapAsMap:a,maxAliasCount:r,onAnchor:c,reviver:d}={}){const f={anchors:new Map,doc:this,keep:!t,mapAsMap:a===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},p=Zn(this.contents,s??"",f);if(typeof c=="function")for(const{count:m,res:b}of f.anchors.values())c(b,m);return typeof d=="function"?jr(d,{"":p},"",p):p}toJSON(t,s){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:s})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){const s=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${s}`)}return V5(this,t)}}function gr(e){if(At(e))return!0;throw new Error("Expected a YAML collection as document contents")}class q1 extends Error{constructor(t,s,a,r){super(),this.name=t,this.code=a,this.message=r,this.pos=s}}class Qc extends q1{constructor(t,s,a){super("YAMLParseError",t,s,a)}}class Q5 extends q1{constructor(t,s,a){super("YAMLWarning",t,s,a)}}const Rx=(e,t)=>s=>{if(s.pos[0]===-1)return;s.linePos=s.pos.map(f=>t.linePos(f));const{line:a,col:r}=s.linePos[0];s.message+=` at line ${a}, column ${r}`;let c=r-1,d=e.substring(t.lineStarts[a-1],t.lineStarts[a]).replace(/[\n\r]+$/,"");if(c>=60&&d.length>80){const f=Math.min(c-39,d.length-79);d="…"+d.substring(f),c-=f-1}if(d.length>80&&(d=d.substring(0,79)+"…"),a>1&&/^ *$/.test(d.substring(0,c))){let f=e.substring(t.lineStarts[a-2],t.lineStarts[a-1]);f.length>80&&(f=f.substring(0,79)+`…
|
|
152
|
+
`),d=f+d}if(/[^ ]/.test(d)){let f=1;const p=s.linePos[1];p?.line===a&&p.col>r&&(f=Math.max(1,Math.min(p.col-r,80-c)));const m=" ".repeat(c)+"^".repeat(f);s.message+=`:
|
|
153
|
+
|
|
154
|
+
${d}
|
|
155
|
+
${m}
|
|
156
|
+
`}};function Dr(e,{flow:t,indicator:s,next:a,offset:r,onError:c,parentIndent:d,startOnNewline:f}){let p=!1,m=f,b=f,y="",v="",x=!1,j=!1,S=null,C=null,_=null,E=null,R=null,z=null,U=null;for(const A of e)switch(j&&(A.type!=="space"&&A.type!=="newline"&&A.type!=="comma"&&c(A.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),j=!1),S&&(m&&A.type!=="comment"&&A.type!=="newline"&&c(S,"TAB_AS_INDENT","Tabs are not allowed as indentation"),S=null),A.type){case"space":!t&&(s!=="doc-start"||a?.type!=="flow-collection")&&A.source.includes(" ")&&(S=A),b=!0;break;case"comment":{b||c(A,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const Z=A.source.substring(1)||" ";y?y+=v+Z:y=Z,v="",m=!1;break}case"newline":m?y?y+=A.source:(!z||s!=="seq-item-ind")&&(p=!0):v+=A.source,m=!0,x=!0,(C||_)&&(E=A),b=!0;break;case"anchor":C&&c(A,"MULTIPLE_ANCHORS","A node can have at most one anchor"),A.source.endsWith(":")&&c(A.offset+A.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),C=A,U??(U=A.offset),m=!1,b=!1,j=!0;break;case"tag":{_&&c(A,"MULTIPLE_TAGS","A node can have at most one tag"),_=A,U??(U=A.offset),m=!1,b=!1,j=!0;break}case s:(C||_)&&c(A,"BAD_PROP_ORDER",`Anchors and tags must be after the ${A.source} indicator`),z&&c(A,"UNEXPECTED_TOKEN",`Unexpected ${A.source} in ${t??"collection"}`),z=A,m=s==="seq-item-ind"||s==="explicit-key-ind",b=!1;break;case"comma":if(t){R&&c(A,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),R=A,m=!1,b=!1;break}default:c(A,"UNEXPECTED_TOKEN",`Unexpected ${A.type} token`),m=!1,b=!1}const O=e[e.length-1],M=O?O.offset+O.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"),S&&(m&&S.indent<=d||a?.type==="block-map"||a?.type==="block-seq")&&c(S,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:R,found:z,spaceBefore:p,comment:y,hasNewline:x,anchor:C,tag:_,newlineAfterProp:E,end:M,start:U??M}}function al(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(al(t.key)||al(t.value))return!0}return!1;default:return!0}}function Lm(e,t,s){if(t?.type==="flow-collection"){const a=t.end[0];a.indent===e&&(a.source==="]"||a.source==="}")&&al(t)&&s(a,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function H1(e,t,s){const{uniqueKeys:a}=e.options;if(a===!1)return!1;const r=typeof a=="function"?a:(c,d)=>c===d||ut(c)&&ut(d)&&c.value===d.value;return t.some(c=>r(c.key,s))}const Ox="All mapping items must start at the same column";function Y5({composeNode:e,composeEmptyNode:t},s,a,r,c){const d=c?.nodeClass??Hn,f=new d(s.schema);s.atRoot&&(s.atRoot=!1);let p=a.offset,m=null;for(const b of a.items){const{start:y,key:v,sep:x,value:j}=b,S=Dr(y,{indicator:"explicit-key-ind",next:v??x?.[0],offset:p,onError:r,parentIndent:a.indent,startOnNewline:!0}),C=!S.found;if(C){if(v&&(v.type==="block-seq"?r(p,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in v&&v.indent!==a.indent&&r(p,"BAD_INDENT",Ox)),!S.anchor&&!S.tag&&!x){m=S.end,S.comment&&(f.comment?f.comment+=`
|
|
158
|
+
`+S.comment:f.comment=S.comment);continue}(S.newlineAfterProp||al(v))&&r(v??y[y.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else S.found?.indent!==a.indent&&r(p,"BAD_INDENT",Ox);s.atKey=!0;const _=S.end,E=v?e(s,v,S,r):t(s,_,y,null,S,r);s.schema.compat&&Lm(a.indent,v,r),s.atKey=!1,H1(s,f.items,E)&&r(_,"DUPLICATE_KEY","Map keys must be unique");const R=Dr(x??[],{indicator:"map-value-ind",next:j,offset:E.range[2],onError:r,parentIndent:a.indent,startOnNewline:!v||v.type==="block-scalar"});if(p=R.end,R.found){C&&(j?.type==="block-map"&&!R.hasNewline&&r(p,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),s.options.strict&&S.start<R.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,R,r):t(s,p,x,null,R,r);s.schema.compat&&Lm(a.indent,j,r),p=z.range[2];const U=new dn(E,z);s.options.keepSourceTokens&&(U.srcToken=b),f.items.push(U)}else{C&&r(E.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),R.comment&&(E.comment?E.comment+=`
|
|
159
|
+
`+R.comment:E.comment=R.comment);const z=new dn(E);s.options.keepSourceTokens&&(z.srcToken=b),f.items.push(z)}}return m&&m<p&&r(m,"IMPOSSIBLE","Map comment with trailing content"),f.range=[a.offset,p,m??p],f}function J5({composeNode:e,composeEmptyNode:t},s,a,r,c){const d=c?.nodeClass??wa,f=new d(s.schema);s.atRoot&&(s.atRoot=!1),s.atKey&&(s.atKey=!1);let p=a.offset,m=null;for(const{start:b,value:y}of a.items){const v=Dr(b,{indicator:"seq-item-ind",next:y,offset:p,onError:r,parentIndent:a.indent,startOnNewline:!0});if(!v.found)if(v.anchor||v.tag||y)y?.type==="block-seq"?r(v.end,"BAD_INDENT","All sequence items must start at the same column"):r(p,"MISSING_CHAR","Sequence item without - indicator");else{m=v.end,v.comment&&(f.comment=v.comment);continue}const x=y?e(s,y,v,r):t(s,v.end,b,null,v,r);s.schema.compat&&Lm(a.indent,y,r),p=x.range[2],f.items.push(x)}return f.range=[a.offset,p,m??p],f}function ml(e,t,s,a){let r="";if(e){let c=!1,d="";for(const f of e){const{source:p,type:m}=f;switch(m){case"space":c=!0;break;case"comment":{s&&!c&&a(f,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const b=p.substring(1)||" ";r?r+=d+b:r=b,d="";break}case"newline":r&&(d+=p),c=!0;break;default:a(f,"UNEXPECTED_TOKEN",`Unexpected ${m} at node end`)}t+=p.length}}return{comment:r,offset:t}}const Yh="Block collections are not allowed within flow collections",Jh=e=>e&&(e.type==="block-map"||e.type==="block-seq");function X5({composeNode:e,composeEmptyNode:t},s,a,r,c){const d=a.start.source==="{",f=d?"flow map":"flow sequence",p=c?.nodeClass??(d?Hn:wa),m=new p(s.schema);m.flow=!0;const b=s.atRoot;b&&(s.atRoot=!1),s.atKey&&(s.atKey=!1);let y=a.offset+a.start.source.length;for(let C=0;C<a.items.length;++C){const _=a.items[C],{start:E,key:R,sep:z,value:U}=_,O=Dr(E,{flow:f,indicator:"explicit-key-ind",next:R??z?.[0],offset:y,onError:r,parentIndent:a.indent,startOnNewline:!1});if(!O.found){if(!O.anchor&&!O.tag&&!z&&!U){C===0&&O.comma?r(O.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${f}`):C<a.items.length-1&&r(O.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${f}`),O.comment&&(m.comment?m.comment+=`
|
|
160
|
+
`+O.comment:m.comment=O.comment),y=O.end;continue}!d&&s.options.strict&&al(R)&&r(R,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(C===0)O.comma&&r(O.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${f}`);else if(O.comma||r(O.start,"MISSING_CHAR",`Missing , between ${f} items`),O.comment){let M="";e:for(const A of E)switch(A.type){case"comma":case"space":break;case"comment":M=A.source.substring(1);break e;default:break e}if(M){let A=m.items[m.items.length-1];Dt(A)&&(A=A.value??A.key),A.comment?A.comment+=`
|
|
161
|
+
`+M:A.comment=M,O.comment=O.comment.substring(M.length+1)}}if(!d&&!z&&!O.found){const M=U?e(s,U,O,r):t(s,O.end,z,null,O,r);m.items.push(M),y=M.range[2],Jh(U)&&r(M.range,"BLOCK_IN_FLOW",Yh)}else{s.atKey=!0;const M=O.end,A=R?e(s,R,O,r):t(s,M,E,null,O,r);Jh(R)&&r(A.range,"BLOCK_IN_FLOW",Yh),s.atKey=!1;const Z=Dr(z??[],{flow:f,indicator:"map-value-ind",next:U,offset:A.range[2],onError:r,parentIndent:a.indent,startOnNewline:!1});if(Z.found){if(!d&&!O.found&&s.options.strict){if(z)for(const se of z){if(se===Z.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}}O.start<Z.found.offset-1024&&r(Z.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else U&&("source"in U&&U.source?.[0]===":"?r(U,"MISSING_CHAR",`Missing space after : in ${f}`):r(Z.start,"MISSING_CHAR",`Missing , or : between ${f} items`));const W=U?e(s,U,Z,r):Z.found?t(s,Z.end,z,null,Z,r):null;W?Jh(U)&&r(W.range,"BLOCK_IN_FLOW",Yh):Z.comment&&(A.comment?A.comment+=`
|
|
162
|
+
`+Z.comment:A.comment=Z.comment);const Q=new dn(A,W);if(s.options.keepSourceTokens&&(Q.srcToken=_),d){const se=m;H1(s,se.items,A)&&r(M,"DUPLICATE_KEY","Map keys must be unique"),se.items.push(Q)}else{const se=new Hn(s.schema);se.flow=!0,se.items.push(Q);const me=(W??A).range;se.range=[A.range[0],me[1],me[2]],m.items.push(se)}y=W?W.range[2]:Z.end}}const v=d?"}":"]",[x,...j]=a.end;let S=y;if(x?.source===v)S=x.offset+x.source.length;else{const C=f[0].toUpperCase()+f.substring(1),_=b?`${C} must end with a ${v}`:`${C} in block collection must be sufficiently indented and end with a ${v}`;r(y,b?"MISSING_CHAR":"BAD_INDENT",_),x&&x.source.length!==1&&j.unshift(x)}if(j.length>0){const C=ml(j,S,s.options.strict,r);C.comment&&(m.comment?m.comment+=`
|
|
163
|
+
`+C.comment:m.comment=C.comment),m.range=[a.offset,S,C.offset]}else m.range=[a.offset,S,S];return m}function Xh(e,t,s,a,r,c){const d=s.type==="block-map"?Y5(e,t,s,a,c):s.type==="block-seq"?J5(e,t,s,a,c):X5(e,t,s,a,c),f=d.constructor;return r==="!"||r===f.tagName?(d.tag=f.tagName,d):(r&&(d.tag=r),d)}function W5(e,t,s,a,r){const c=a.tag,d=c?t.directives.tagName(c.source,v=>r(c,"TAG_RESOLVE_FAILED",v)):null;if(s.type==="block-seq"){const{anchor:v,newlineAfterProp:x}=a,j=v&&c?v.offset>c.offset?v:c:v??c;j&&(!x||x.offset<j.offset)&&r(j,"MISSING_CHAR","Missing newline after block sequence props")}const f=s.type==="block-map"?"map":s.type==="block-seq"?"seq":s.start.source==="{"?"map":"seq";if(!c||!d||d==="!"||d===Hn.tagName&&f==="map"||d===wa.tagName&&f==="seq")return Xh(e,t,s,r,d);let p=t.schema.tags.find(v=>v.tag===d&&v.collection===f);if(!p){const v=t.schema.knownTags[d];if(v?.collection===f)t.schema.tags.push(Object.assign({},v,{default:!1})),p=v;else return v?r(c,"BAD_COLLECTION_TYPE",`${v.tag} used for ${f} collection, but expects ${v.collection??"scalar"}`,!0):r(c,"TAG_RESOLVE_FAILED",`Unresolved tag: ${d}`,!0),Xh(e,t,s,r,d)}const m=Xh(e,t,s,r,d,p),b=p.resolve?.(m,v=>r(c,"TAG_RESOLVE_FAILED",v),t.options)??m,y=Tt(b)?b:new Re(b);return y.range=m.range,y.tag=d,p?.format&&(y.format=p.format),y}function e4(e,t,s){const a=t.offset,r=t4(t,e.options.strict,s);if(!r)return{value:"",type:null,comment:"",range:[a,a,a]};const c=r.mode===">"?Re.BLOCK_FOLDED:Re.BLOCK_LITERAL,d=t.source?n4(t.source):[];let f=d.length;for(let S=d.length-1;S>=0;--S){const C=d[S][1];if(C===""||C==="\r")f=S;else break}if(f===0){const S=r.chomp==="+"&&d.length>0?`
|
|
164
|
+
`.repeat(Math.max(1,d.length-1)):"";let C=a+r.length;return t.source&&(C+=t.source.length),{value:S,type:c,comment:r.comment,range:[a,C,C]}}let p=t.indent+r.indent,m=t.offset+r.length,b=0;for(let S=0;S<f;++S){const[C,_]=d[S];if(_===""||_==="\r")r.indent===0&&C.length>p&&(p=C.length);else{C.length<p&&s(m+C.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),r.indent===0&&(p=C.length),b=S,p===0&&!e.atRoot&&s(m,"BAD_INDENT","Block scalar values in collections must be indented");break}m+=C.length+_.length+1}for(let S=d.length-1;S>=f;--S)d[S][0].length>p&&(f=S+1);let y="",v="",x=!1;for(let S=0;S<b;++S)y+=d[S][0].slice(p)+`
|
|
165
|
+
`;for(let S=b;S<f;++S){let[C,_]=d[S];m+=C.length+_.length+1;const E=_[_.length-1]==="\r";if(E&&(_=_.slice(0,-1)),_&&C.length<p){const z=`Block scalar lines must not be less indented than their ${r.indent?"explicit indentation indicator":"first line"}`;s(m-_.length-(E?2:1),"BAD_INDENT",z),C=""}c===Re.BLOCK_LITERAL?(y+=v+C.slice(p)+_,v=`
|
|
166
|
+
`):C.length>p||_[0]===" "?(v===" "?v=`
|
|
167
|
+
`:!x&&v===`
|
|
168
|
+
`&&(v=`
|
|
169
|
+
|
|
170
|
+
`),y+=v+C.slice(p)+_,v=`
|
|
171
|
+
`,x=!0):_===""?v===`
|
|
172
|
+
`?y+=`
|
|
173
|
+
`:v=`
|
|
174
|
+
`:(y+=v+_,v=" ",x=!1)}switch(r.chomp){case"-":break;case"+":for(let S=f;S<d.length;++S)y+=`
|
|
175
|
+
`+d[S][0].slice(p);y[y.length-1]!==`
|
|
176
|
+
`&&(y+=`
|
|
177
|
+
`);break;default:y+=`
|
|
178
|
+
`}const j=a+r.length+t.source.length;return{value:y,type:c,comment:r.comment,range:[a,j,j]}}function t4({offset:e,props:t},s,a){if(t[0].type!=="block-scalar-header")return a(t[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:r}=t[0],c=r[0];let d=0,f="",p=-1;for(let v=1;v<r.length;++v){const x=r[v];if(!f&&(x==="-"||x==="+"))f=x;else{const j=Number(x);!d&&j?d=j:p===-1&&(p=e+v)}}p!==-1&&a(p,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${r}`);let m=!1,b="",y=r.length;for(let v=1;v<t.length;++v){const x=t[v];switch(x.type){case"space":m=!0;case"newline":y+=x.source.length;break;case"comment":s&&!m&&a(x,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),y+=x.source.length,b=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 S=x.source;S&&typeof S=="string"&&(y+=S.length)}}}return{mode:c,indent:d,chomp:f,comment:b,length:y}}function n4(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 s4(e,t,s){const{offset:a,type:r,source:c,end:d}=e;let f,p;const m=(v,x,j)=>s(a+v,x,j);switch(r){case"scalar":f=Re.PLAIN,p=i4(c,m);break;case"single-quoted-scalar":f=Re.QUOTE_SINGLE,p=a4(c,m);break;case"double-quoted-scalar":f=Re.QUOTE_DOUBLE,p=r4(c,m);break;default:return s(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${r}`),{value:"",type:null,comment:"",range:[a,a+c.length,a+c.length]}}const b=a+c.length,y=ml(d,b,t,s);return{value:p,type:f,comment:y.comment,range:[a,b,y.offset]}}function i4(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}`),Z1(e)}function a4(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),Z1(e.slice(1,-1)).replace(/''/g,"'")}function Z1(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 r4(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}=o4(e,a);s+=c,a=d}else if(r==="\\"){let c=e[++a];const d=l4[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+=c4(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 o4(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 l4={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
193
|
+
`,r:"\r",t:" ",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function c4(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 F1(e,t,s,a){const{value:r,type:c,comment:d,range:f}=t.type==="block-scalar"?e4(e,t,a):s4(t,e.options.strict,a),p=s?e.directives.tagName(s.source,y=>a(s,"TAG_RESOLVE_FAILED",y)):null;let m;e.options.stringKeys&&e.atKey?m=e.schema[vs]:p?m=u4(e.schema,r,p,s,a):t.type==="scalar"?m=d4(e,r,t,a):m=e.schema[vs];let b;try{const y=m.resolve(r,v=>a(s??t,"TAG_RESOLVE_FAILED",v),e.options);b=ut(y)?y:new Re(y)}catch(y){const v=y instanceof Error?y.message:String(y);a(s??t,"TAG_RESOLVE_FAILED",v),b=new Re(r)}return b.range=f,b.source=r,c&&(b.type=c),p&&(b.tag=p),m.format&&(b.format=m.format),d&&(b.comment=d),b}function u4(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 d4({atKey:e,directives:t,schema:s},a,r,c){const d=s.tags.find(f=>(f.default===!0||e&&f.default==="key")&&f.test?.test(a))||s[vs];if(s.compat){const f=s.compat.find(p=>p.default&&p.test?.test(a))??s[vs];if(d.tag!==f.tag){const p=t.tagString(d.tag),m=t.tagString(f.tag),b=`Value may be parsed as either ${p} or ${m}`;c(r,"TAG_RESOLVE_FAILED",b,!0)}}return d}function f4(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 h4={composeNode:G1,composeEmptyNode:Zp};function G1(e,t,s,a){const r=e.atKey,{spaceBefore:c,comment:d,anchor:f,tag:p}=s;let m,b=!0;switch(t.type){case"alias":m=m4(e,t,a),(f||p)&&a(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":m=F1(e,t,p,a),f&&(m.anchor=f.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":m=W5(h4,e,t,s,a),f&&(m.anchor=f.source.substring(1));break;default:{const y=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;a(t,"UNEXPECTED_TOKEN",y),m=Zp(e,t.offset,void 0,null,s,a),b=!1}}return f&&m.anchor===""&&a(f,"BAD_ALIAS","Anchor cannot be an empty string"),r&&e.options.stringKeys&&(!ut(m)||typeof m.value!="string"||m.tag&&m.tag!=="tag:yaml.org,2002:str")&&a(p??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),c&&(m.spaceBefore=!0),d&&(t.type==="scalar"&&t.source===""?m.comment=d:m.commentBefore=d),e.options.keepSourceTokens&&b&&(m.srcToken=t),m}function Zp(e,t,s,a,{spaceBefore:r,comment:c,anchor:d,tag:f,end:p},m){const b={type:"scalar",offset:f4(t,s,a),indent:-1,source:""},y=F1(e,b,f,m);return d&&(y.anchor=d.source.substring(1),y.anchor===""&&m(d,"BAD_ALIAS","Anchor cannot be an empty string")),r&&(y.spaceBefore=!0),c&&(y.comment=c,y.range[2]=p),y}function m4({options:e},{offset:t,source:s,end:a},r){const c=new Ap(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=ml(a,d,e.strict,r);return c.range=[t,d,f.offset],f.comment&&(c.comment=f.comment),c}function p4(e,t,{offset:s,start:a,value:r,end:c},d){const f=Object.assign({_directives:t},e),p=new rd(void 0,f),m={atKey:!1,atRoot:!0,directives:p.directives,options:p.options,schema:p.schema},b=Dr(a,{indicator:"doc-start",next:r??c?.[0],offset:s,onError:d,parentIndent:0,startOnNewline:!0});b.found&&(p.directives.docStart=!0,r&&(r.type==="block-map"||r.type==="block-seq")&&!b.hasNewline&&d(b.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),p.contents=r?G1(m,r,b,d):Zp(m,b.end,a,null,b,d);const y=p.contents.range[2],v=ml(c,y,!1,d);return v.comment&&(p.comment=v.comment),p.range=[s,y,v.offset],p}function $o(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 Ax(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 g4{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(s,a,r,c)=>{const d=$o(s);c?this.warnings.push(new Q5(d,a,r)):this.errors.push(new Qc(d,a,r))},this.directives=new cn({version:t.version||"1.2"}),this.options=t}decorate(t,s){const{comment:a,afterEmptyLine:r}=Ax(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(At(c)&&!c.flow&&c.items.length>0){let d=c.items[0];Dt(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:Ax(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=$o(t);c[0]+=s,this.onError(c,"BAD_DIRECTIVE",a,r)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const s=p4(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 Qc($o(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 Qc($o(t),"UNEXPECTED_TOKEN",a));break}this.doc.directives.docEnd=!0;const s=ml(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 Qc($o(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 rd(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",V1="",Q1="",Mm="";function y4(e){switch(e){case K1:return"byte-order-mark";case V1:return"doc-mode";case Q1:return"flow-error-end";case Mm:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
201
|
+
`:case`\r
|
|
202
|
+
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}function es(e){switch(e){case void 0:case" ":case`
|
|
203
|
+
`:case"\r":case" ":return!0;default:return!1}}const Tx=new Set("0123456789ABCDEFabcdef"),v4=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Yc=new Set(",[]{}"),b4=new Set(` ,[]{}
|
|
204
|
+
\r `),Wh=e=>!e||b4.has(e);class x4{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(t,s=!1){if(t){if(typeof t!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+t:t,this.lineEndPos=null}this.atEnd=!s;let a=this.next??"stream";for(;a&&(s||this.hasChars(1));)a=yield*this.parseNext(a)}atLineEnd(){let t=this.pos,s=this.buffer[t];for(;s===" "||s===" ";)s=this.buffer[++t];return!s||s==="#"||s===`
|
|
205
|
+
`?!0:s==="\r"?this.buffer[t+1]===`
|
|
206
|
+
`:!1}charAt(t){return this.buffer[this.pos+t]}continueScalar(t){let s=this.buffer[t];if(this.indentNext>0){let a=0;for(;s===" ";)s=this.buffer[++a+t];if(s==="\r"){const r=this.buffer[a+t+1];if(r===`
|
|
207
|
+
`||!r&&!this.atEnd)return t+a+1}return s===`
|
|
208
|
+
`||a>=this.indentNext||!s&&!this.atEnd?t+a:-1}if(s==="-"||s==="."){const a=this.buffer.substr(t,3);if((a==="---"||a==="...")&&es(this.buffer[t+3]))return-1}return t}getLine(){let t=this.lineEndPos;return(typeof t!="number"||t!==-1&&t<this.pos)&&(t=this.buffer.indexOf(`
|
|
209
|
+
`,this.pos),this.lineEndPos=t),t===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[t-1]==="\r"&&(t-=1),this.buffer.substring(this.pos,t))}hasChars(t){return this.pos+t<=this.buffer.length}setNext(t){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=t,null}peek(t){return this.buffer.substr(this.pos,t)}*parseNext(t){switch(t){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let t=this.getLine();if(t===null)return this.setNext("stream");if(t[0]===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 V1,yield*this.parseLineStart()}*parseLineStart(){const t=this.charAt(0);if(!t&&!this.atEnd)return this.setNext("line-start");if(t==="-"||t==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");const s=this.peek(3);if((s==="---"||s==="...")&&es(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,s==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!es(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[t,s]=this.peek(2);if(!s&&!this.atEnd)return this.setNext("block-start");if((t==="-"||t==="?"||t===":")&&es(s)){const a=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=a,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const t=this.getLine();if(t===null)return this.setNext("doc");let s=yield*this.pushIndicators();switch(t[s]){case"#":yield*this.pushCount(t.length-s);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(Wh),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return s+=yield*this.parseBlockScalarHeader(),s+=yield*this.pushSpaces(!0),yield*this.pushCount(t.length-s),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let t,s,a=-1;do t=yield*this.pushNewline(),t>0?(s=yield*this.pushSpaces(!1),this.indentValue=a=s):s=0,s+=yield*this.pushSpaces(!0);while(t+s>0);const r=this.getLine();if(r===null)return this.setNext("flow");if((a!==-1&&a<this.indentNext&&r[0]!=="#"||a===0&&(r.startsWith("---")||r.startsWith("..."))&&es(r[3]))&&!(a===this.indentNext-1&&this.flowLevel===1&&(r[0]==="]"||r[0]==="}")))return this.flowLevel=0,yield Q1,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(Wh),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const d=this.charAt(1);if(this.flowKey||es(d)||d===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){const t=this.charAt(0);let s=this.buffer.indexOf(t,this.pos+1);if(t==="'")for(;s!==-1&&this.buffer[s+1]==="'";)s=this.buffer.indexOf("'",s+2);else for(;s!==-1;){let c=0;for(;this.buffer[s-1-c]==="\\";)c+=1;if(c%2===0)break;s=this.buffer.indexOf('"',s+1)}const a=this.buffer.substring(0,s);let r=a.indexOf(`
|
|
210
|
+
`,this.pos);if(r!==-1){for(;r!==-1;){const c=this.continueScalar(r+1);if(c===-1)break;r=a.indexOf(`
|
|
211
|
+
`,c)}r!==-1&&(s=r-(a[r-1]==="\r"?2:1))}if(s===-1){if(!this.atEnd)return this.setNext("quoted-scalar");s=this.buffer.length}return yield*this.pushToIndex(s+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let t=this.pos;for(;;){const s=this.buffer[++t];if(s==="+")this.blockScalarKeep=!0;else if(s>"0"&&s<="9")this.blockScalarIndent=Number(s)-1;else if(s!=="-")break}return yield*this.pushUntil(s=>es(s)||s==="#")}*parseBlockScalar(){let t=this.pos-1,s=0,a;e:for(let c=this.pos;a=this.buffer[c];++c)switch(a){case" ":s+=1;break;case`
|
|
212
|
+
`:t=c,s=0;break;case"\r":{const d=this.buffer[c+1];if(!d&&!this.atEnd)return this.setNext("block-scalar");if(d===`
|
|
213
|
+
`)break}default:break e}if(!a&&!this.atEnd)return this.setNext("block-scalar");if(s>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=s:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{const c=this.continueScalar(t+1);if(c===-1)break;t=this.buffer.indexOf(`
|
|
214
|
+
`,c)}while(t!==-1);if(t===-1){if(!this.atEnd)return this.setNext("block-scalar");t=this.buffer.length}}let r=t+1;for(a=this.buffer[r];a===" ";)a=this.buffer[++r];if(a===" "){for(;a===" "||a===" "||a==="\r"||a===`
|
|
215
|
+
`;)a=this.buffer[++r];t=r-1}else if(!this.blockScalarKeep)do{let c=t-1,d=this.buffer[c];d==="\r"&&(d=this.buffer[--c]);const f=c;for(;d===" ";)d=this.buffer[--c];if(d===`
|
|
216
|
+
`&&c>=this.pos&&c+1+s>f)t=c;else break}while(!0);return yield Mm,yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const t=this.flowLevel>0;let s=this.pos-1,a=this.pos-1,r;for(;r=this.buffer[++a];)if(r===":"){const c=this.buffer[a+1];if(es(c)||t&&Yc.has(c))break;s=a}else if(es(r)){let c=this.buffer[a+1];if(r==="\r"&&(c===`
|
|
217
|
+
`?(a+=1,r=`
|
|
218
|
+
`,c=this.buffer[a+1]):s=a),c==="#"||t&&Yc.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&&Yc.has(r))break;s=a}return!r&&!this.atEnd?this.setNext("plain-scalar"):(yield Mm,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(Wh))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const t=this.flowLevel>0,s=this.charAt(1);if(es(s)||t&&Yc.has(s))return t?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)==="<"){let t=this.pos+2,s=this.buffer[t];for(;!es(s)&&s!==">";)s=this.buffer[++t];return yield*this.pushToIndex(s===">"?t+1:t,!1)}else{let t=this.pos+1,s=this.buffer[t];for(;s;)if(v4.has(s))s=this.buffer[++t];else if(s==="%"&&Tx.has(this.buffer[t+1])&&Tx.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 S4{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 Ci(e,t){for(let s=0;s<e.length;++s)if(e[s].type===t)return!0;return!1}function Dx(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 Y1(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 Jc(e){switch(e.type){case"document":return e.start;case"block-map":{const t=e.items[e.items.length-1];return t.sep??t.start}case"block-seq":return e.items[e.items.length-1].start;default:return[]}}function yr(e){if(e.length===0)return[];let t=e.length;e:for(;--t>=0;)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;e[++t]?.type==="space";);return e.splice(t,e.length)}function Lx(e){if(e.start.type==="flow-seq-start")for(const t of e.items)t.sep&&!t.value&&!Ci(t.start,"explicit-key-ind")&&!Ci(t.sep,"map-value-ind")&&(t.key&&(t.value=t.key),delete t.key,Y1(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 w4{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 x4,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=y4(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"&&Lx(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&&Dx(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":{Dx(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=Jc(this.peek(2)),a=yr(s);let r;t.end?(r=t.end,r.push(this.sourceToken),delete t.end):r=[this.sourceToken];const c={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:a,key:t,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=c}else yield*this.lineEnd(t)}*blockScalar(t){switch(this.type){case"space":case"comment":case"newline":t.props.push(this.sourceToken);return;case"scalar":if(t.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let s=this.source.indexOf(`
|
|
222
|
+
`)+1;for(;s!==0;)this.onNewLine(this.offset+s),s=this.source.indexOf(`
|
|
223
|
+
`,s)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(t){const s=t.items[t.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,s.value){const a="end"in s.value?s.value.end:void 0;(Array.isArray(a)?a[a.length-1]:void 0)?.type==="comment"?a?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else s.sep?s.sep.push(this.sourceToken):s.start.push(this.sourceToken);return;case"space":case"comment":if(s.value)t.items.push({start:[this.sourceToken]});else if(s.sep)s.sep.push(this.sourceToken);else{if(this.atIndentedComment(s.start,t.indent)){const r=t.items[t.items.length-2]?.value?.end;if(Array.isArray(r)){Array.prototype.push.apply(r,s.start),r.push(this.sourceToken),t.items.pop();return}}s.start.push(this.sourceToken)}return}if(this.indent>=t.indent){const a=!this.onKeyLine&&this.indent===t.indent,r=a&&(s.sep||s.explicitKey)&&this.type!=="seq-item-ind";let c=[];if(r&&s.sep&&!s.value){const d=[];for(let f=0;f<s.sep.length;++f){const p=s.sep[f];switch(p.type){case"newline":d.push(f);break;case"space":break;case"comment":p.indent>t.indent&&(d.length=0);break;default:d.length=0}}d.length>=2&&(c=s.sep.splice(d[1]))}switch(this.type){case"anchor":case"tag":r||s.value?(c.push(this.sourceToken),t.items.push({start:c}),this.onKeyLine=!0):s.sep?s.sep.push(this.sourceToken):s.start.push(this.sourceToken);return;case"explicit-key-ind":!s.sep&&!s.explicitKey?(s.start.push(this.sourceToken),s.explicitKey=!0):r||s.value?(c.push(this.sourceToken),t.items.push({start:c,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(s.explicitKey)if(s.sep)if(s.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Ci(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(Y1(s.key)&&!Ci(s.sep,"newline")){const d=yr(s.start),f=s.key,p=s.sep;p.push(this.sourceToken),delete s.key,delete s.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:d,key:f,sep:p}]})}else c.length>0?s.sep=s.sep.concat(c,this.sourceToken):s.sep.push(this.sourceToken);else if(Ci(s.start,"newline"))Object.assign(s,{key:null,sep:[this.sourceToken]});else{const d=yr(s.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:d,key:null,sep:[this.sourceToken]}]})}else s.sep?s.value||r?t.items.push({start:c,key:null,sep:[this.sourceToken]}):Ci(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&&!Ci(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||Ci(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=Jc(a),c=yr(r);Lx(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=Jc(t),a=yr(s);return a.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const s=Jc(t),a=yr(s);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,s){return this.type!=="comment"||this.indent<=s?!1:t.every(a=>a.type==="newline"||a.type==="space")}*documentEnd(t){this.type!=="doc-mode"&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function j4(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new S4||null,prettyErrors:t}}function N4(e,t={}){const{lineCounter:s,prettyErrors:a}=j4(t),r=new w4(s?.addNewLine),c=new g4(t),d=Array.from(c.compose(r.parse(e)));if(a&&s)for(const f of d)f.errors.forEach(Rx(e,s)),f.warnings.forEach(Rx(e,s));return d.length>0?d:Object.assign([],{empty:!0},c.streamInfo())}function C4({onApplied:e}){const[t,s]=N.useState(""),[a,r]=N.useState(!1),[c,d]=N.useState([]),[f,p]=N.useState([]),m=async()=>{if(!t.trim())return;r(!0),d([]),p([]);const b=N4(t),y=[],v=[];for(let x=0;x<b.length;x++){const j=b[x];if(j.errors.length>0){y.push(`Document ${x+1}: ${j.errors[0]?.message}`);continue}const S=j.toJSON();if(!(!S||typeof S!="object"))try{const C=await Oj(S);v.push(`Applied "${C.displayName||C.name}" (revision ${C.configRevision})`)}catch(C){y.push(`Document ${x+1}: ${C instanceof Error?C.message:String(C)}`)}}d(v),p(y),r(!1),v.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:b=>s(b.target.value)}),c.length>0&&l.jsx("ul",{className:"mt-2 space-y-1",children:c.map((b,y)=>l.jsx("li",{className:"text-emerald-400 text-sm",children:b},y))}),f.length>0&&l.jsx("ul",{className:"mt-2 space-y-1",children:f.map((b,y)=>l.jsx("li",{className:"text-rose-400 text-sm",children:b},y))}),l.jsx("div",{className:"mt-3",children:l.jsx(le,{type:"button",disabled:!t.trim()||a,onClick:m,children:a?"Applying...":"Apply"})})]})}function _4(){const{dashboard:e,refetch:t}=ka(),s=e?.projects??[],a=ja(),[r,c]=N.useState(!1),[d,f]=N.useState(""),[p,m]=N.useState(""),[b,y]=N.useState(""),[v,x]=N.useState("US"),[j,S]=N.useState("en"),[C,_]=N.useState(!1),[E,R]=N.useState(null),z=d.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),U=async()=>{if(!(!z||!b)){_(!0),R(null);try{const O=await ll(z,{displayName:p||d,canonicalDomain:b,country:v,language:j});t(),f(""),m(""),y(""),x("US"),S("en"),c(!1),a({to:"/projects/$projectId",params:{projectId:O.id}})}catch(O){R(O instanceof Error?O.message:"Failed to create project")}finally{_(!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(le,{type:"button",onClick:()=>c(O=>!O),children:[l.jsx(zb,{className:"size-4 mr-1.5"}),"Add project"]})})]}),r?l.jsxs(He,{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:O=>f(O.target.value)}),z&&z!==d?l.jsxs("p",{className:"supporting-copy",children:["Slug: ",z]}):null]}),l.jsxs("div",{className:"setup-field",children:[l.jsx("label",{className:"setup-label",htmlFor:"new-display-name",children:"Display name"}),l.jsx("input",{id:"new-display-name",className:"setup-input",type:"text",placeholder:"My Project",value:p,onChange:O=>m(O.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:b,onChange:O=>y(O.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:v,onChange:O=>x(O.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:O=>S(O.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(le,{type:"button",disabled:!z||!b||C,onClick:U,children:C?"Creating...":"Create project"}),l.jsx(le,{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(O=>{const M=O.recentRuns[0];return l.jsxs("tr",{className:"cursor-pointer",onClick:()=>a({to:"/projects/$projectId",params:{projectId:O.project.id}}),children:[l.jsxs("td",{children:[l.jsx(gt,{to:"/projects/$projectId",params:{projectId:O.project.id},className:"text-zinc-100 font-medium hover:underline",onClick:A=>A.stopPropagation(),children:O.project.displayName||O.project.name}),l.jsx("p",{className:"text-[11px] text-zinc-500",children:O.project.name})]}),l.jsx("td",{className:"text-zinc-400",children:O.project.canonicalDomain}),l.jsx("td",{children:l.jsx(lt,{tone:O.visibilitySummary.tone,children:O.visibilitySummary.value})}),l.jsx("td",{className:"text-zinc-500 text-sm",children:M?l.jsx(Iu,{status:M.status}):l.jsx("span",{className:"text-zinc-600",children:"No runs"})}),l.jsx("td",{className:"text-right text-zinc-500",children:O.project.country})]},O.project.id)})})]})}):r?null:l.jsxs(He,{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(le,{type:"button",onClick:()=>c(!0),children:[l.jsx(zb,{className:"size-4 mr-1.5"}),"Add project"]})]}),l.jsx(C4,{onApplied:()=>{t()}})]})}function Ko({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 J1({run:e}){const{openRun:t}=ul();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(Iu,{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(le,{variant:"outline",size:"sm",type:"button",onClick:()=>t(e.id),children:"View run"})]})}function ou({value:e,label:t,delta:s,tone:a,description:r,tooltip:c,isNumeric:d=!0}){const m=2*Math.PI*48,b=Number.parseInt(e,10),y=d&&!Number.isNaN(b)?Math.min(b/100,1):.5,v=m*(1-y);return l.jsxs("div",{className:"score-gauge",children:[l.jsxs("div",{className:"gauge-ring-wrapper",children:[l.jsxs("svg",{className:"gauge-ring",viewBox:"0 0 120 120","aria-hidden":"true",children:[l.jsx("circle",{className:"gauge-bg",cx:"60",cy:"60",r:48,strokeWidth:6}),l.jsx("circle",{className:`gauge-fill gauge-fill-${a}`,cx:"60",cy:"60",r:48,strokeWidth:6,strokeDasharray:m,strokeDashoffset:v,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(Ko,{text:c})]}),l.jsx("p",{className:"gauge-delta",children:s}),l.jsx("p",{className:"gauge-description",children:r})]})}function Mx({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 k4(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 z4({evidence:e}){const{openEvidence:t}=ul(),[s,a]=N.useState(new Set),r=N.useMemo(()=>{const d=new Map;for(const f of e){const p=d.get(f.keyword)??[];d.set(f.keyword,[...p,f])}return[...d.entries()].map(([f,p])=>({phrase:f,items:p}))},[e]),c=d=>{a(f=>{const p=new Set(f);return p.has(d)?p.delete(d):p.add(d),p})};return l.jsx("div",{className:"evidence-table-wrap",children:l.jsxs("table",{className:"evidence-table",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{style:{width:"2rem"}}),l.jsx("th",{children:"Key Phrase"}),l.jsx("th",{children:"Status"}),l.jsx("th",{children:"Citation History"}),l.jsx("th",{children:"Change"}),l.jsx("th",{})]})}),l.jsx("tbody",{children:r.map(({phrase:d,items:f})=>{const p=s.has(d),m=f.map(j=>j.citationState),b=m.includes("cited")?"cited":m.includes("emerging")?"emerging":m.includes("lost")?"lost":m.every(j=>j==="pending")?"pending":"not-cited",y=k4(f),v=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,S=y[y.length-2].citationState;if(S!=="cited"&&j==="cited")return"Newly cited";if(S==="cited"&&j!=="cited")return"Lost since last run";let C=0;for(let _=y.length-1;_>=0&&y[_].citationState===j;_--)C++;return j==="cited"?C<=1?"Cited in latest run":`Cited for ${C} runs`:C<=1?"Not cited in latest run":`Not cited across ${C} runs`})();return l.jsxs(N.Fragment,{children:[l.jsxs("tr",{className:"evidence-phrase-row cursor-pointer hover:bg-zinc-800/40",onClick:()=>c(d),"aria-expanded":p,children:[l.jsx("td",{children:l.jsx(Uu,{size:14,className:`transition-transform duration-150 text-zinc-500 ${p?"rotate-90":""}`})}),l.jsx("td",{className:"evidence-keyword-cell",children:l.jsxs("div",{children:[l.jsx("span",{className:"font-medium text-zinc-100",children:d}),l.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:f.map(j=>l.jsx(Wo,{provider:j.provider},j.id))})]})}),l.jsx("td",{children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Nm,{state:b}),l.jsxs("span",{className:"text-[11px] text-zinc-500",children:[v,"/",f.length]})]})}),l.jsx("td",{children:l.jsx(Mx,{history:y})}),l.jsx("td",{className:"evidence-change-cell",children:x}),l.jsx("td",{})]}),p&&f.map(j=>l.jsxs("tr",{className:"bg-zinc-900/30",children:[l.jsx("td",{}),l.jsx("td",{className:"evidence-keyword-cell pl-5",children:l.jsx(Wo,{provider:j.provider})}),l.jsx("td",{children:l.jsx(Nm,{state:j.citationState})}),l.jsx("td",{children:l.jsx(Mx,{history:j.runHistory})}),l.jsx("td",{className:"evidence-change-cell",children:j.changeLabel}),l.jsx("td",{children:l.jsx(le,{variant:"ghost",size:"sm",type:"button",onClick:S=>{S.stopPropagation(),t(j.id)},children:"View"})})]},j.id))]},d)})})]})})}function E4({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(lt,{tone:DE(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 R4=["7d","30d","90d","all"],O4=["gap","cited","uncited"],X1={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,p]=N.useState(null),[m,b]=N.useState(null),[y,v]=N.useState(!0);return N.useEffect(()=>{let x=!1;return v(!0),Promise.all([a1(e,t),r1(e,t),o1(e,t)]).then(([j,S,C])=>{x||(r(j),d(S),p(C),v(!1))}).catch(()=>{x||v(!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(Ko,{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:R4.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(ou,{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(lt,{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(T4,{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(Ko,{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:O4.map(x=>{const j=x==="cited"?c.cited.length:x==="gap"?c.gap.length:c.uncited.length,S=m===x;return l.jsxs("button",{type:"button",className:`px-3 py-1 text-xs rounded-full border transition-colors ${S?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:()=>b(S?null:x),children:[x==="gap"?"Gap":x==="cited"?"Cited":"Not Cited"," (",j,")"]},x)})}),l.jsx(D4,{gaps:c,filter:m})]})]}),l.jsx("div",{className:"page-section-divider"}),l.jsxs("section",{children:[l.jsxs("div",{className:"mb-4",children:[l.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Source Intelligence"}),l.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Source Origin Breakdown ",l.jsx(Ko,{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 ${X1[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 T4({buckets:e}){const[t,s]=N.useState(null),a=600,r=140,c={top:24,right:10,bottom:20,left:40},d=a-c.left-c.right,f=r-c.top-c.bottom,p=1,m=e.map((y,v)=>{const x=c.left+(e.length>1?v/(e.length-1)*d:d/2),j=c.top+f-y.citationRate/p*f;return{x,y:j}}),b=m.map(y=>`${y.x},${y.y}`).join(" ");return l.jsx("div",{className:"surface-card rounded-lg p-3 border border-zinc-800/60",children:l.jsxs("svg",{viewBox:`0 0 ${a} ${r}`,className:"w-full h-auto","aria-label":"Citation rate trend chart",onMouseLeave:()=>s(null),children:[l.jsxs("text",{x:c.left-4,y:c.top+4,textAnchor:"end",className:"fill-zinc-500",fontSize:"9",children:[(p*100).toFixed(0),"%"]}),l.jsx("text",{x:c.left-4,y:c.top+f+4,textAnchor:"end",className:"fill-zinc-500",fontSize:"9",children:"0%"}),l.jsx("line",{x1:c.left,y1:c.top+f,x2:c.left+d,y2:c.top+f,stroke:"currentColor",className:"text-zinc-800",strokeWidth:"0.5"}),l.jsx("polyline",{fill:"none",stroke:"currentColor",className:"text-emerald-500",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",points:b}),t!==null&&l.jsx("line",{x1:m[t].x,y1:c.top,x2:m[t].x,y2:c.top+f,stroke:"currentColor",className:"text-zinc-600",strokeWidth:"0.5",strokeDasharray:"3 2"}),e.map((y,v)=>{const{x,y:j}=m[v],S=t===v;return l.jsxs("g",{children:[l.jsx("circle",{cx:x,cy:j,r:"10",fill:"transparent",onMouseEnter:()=>s(v),style:{cursor:"pointer"}}),l.jsx("circle",{cx:x,cy:j,r:S?5:3,className:S?"fill-emerald-400":"fill-emerald-500"})]},v)}),t!==null&&(()=>{const y=e[t],{x:v,y:x}=m[t],j=`${(y.citationRate*100).toFixed(1)}%`,S=y.startDate.slice(5,10),C=56,_=30,E=Math.max(c.left,Math.min(v-C/2,a-c.right-C)),R=x-_-8;return l.jsxs("g",{children:[l.jsx("rect",{x:E,y:R,width:C,height:_,rx:"4",className:"fill-zinc-800",stroke:"currentColor",strokeWidth:"0.5"}),l.jsx("text",{x:E+C/2,y:R+13,textAnchor:"middle",className:"fill-zinc-50",fontSize:"11",fontWeight:"600",children:j}),l.jsx("text",{x:E+C/2,y:R+24,textAnchor:"middle",className:"fill-zinc-400",fontSize:"8",children:S})]})})(),e.map((y,v)=>({b:y,i:v})).filter(({i:y})=>y===0||y===e.length-1||e.length<=7).map(({b:y,i:v})=>{const x=m[v].x;return l.jsx("text",{x,y:r-2,textAnchor:"middle",className:"fill-zinc-500",fontSize:"8",children:y.startDate.slice(5,10)},v)})]})})}function D4({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(lt,{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:`${X1[s.category]??"bg-zinc-600"} transition-all`,style:{width:`${a}%`},title:`${s.label}: ${(s.percentage*100).toFixed(1)}%`},s.category)})})}function M4({projectName:e}){const[t,s]=N.useState(!1),[a,r]=N.useState([]),[c,d]=N.useState([]),[f,p]=N.useState([]),[m,b]=N.useState([]),[y,v]=N.useState([]),[x,j]=N.useState(null),[S,C]=N.useState(""),[_,E]=N.useState(""),[R,z]=N.useState("30"),[U,O]=N.useState(!1),[M,A]=N.useState({startDate:"",endDate:"",query:"",page:"",limit:"20"}),[Z,W]=N.useState(""),[Q,se]=N.useState(!0),[me,ze]=N.useState(!1),[je,B]=N.useState(!1),[T,ae]=N.useState(!1),[pe,te]=N.useState(!1),[L,G]=N.useState(!1),[ie,re]=N.useState(!1),[ce,he]=N.useState(!1),[de,Ge]=N.useState(null),[ge,Xe]=N.useState(!1),[mt,fe]=N.useState(!1),[Je,dt]=N.useState(!1),[Wt,_t]=N.useState(!1),[nn,Kt]=N.useState(null),[kt,wt]=N.useState(""),[sn,oe]=N.useState(!1),[Ue,Pe]=N.useState(!1),[ke,Te]=N.useState("indexed"),[zt,Qn]=N.useState([]),[bs,Fs]=N.useState(null),[xs,Gs]=N.useState(!1),[os,Ce]=N.useState(null),[wn,ne]=N.useState(null),$e=a.find($=>$.connectionType==="gsc"),ld=f.length>0||m.length>0||y.length>0;async function pl($){if(!$){d([]),C("");return}ae(!0);try{const{sites:ue}=await Lj(e);d(ue),C($.propertyId??ue[0]?.siteUrl??"")}catch(ue){d([]),Ce(ue instanceof Error?ue.message:"Failed to load Search Console properties")}finally{ae(!1)}}async function Ks(){G(!0);try{const $=await $j(e,{startDate:M.startDate||void 0,endDate:M.endDate||void 0,query:M.query||void 0,page:M.page||void 0,limit:parseInt(M.limit,10)||20});p($)}catch($){p([]),Ce($ instanceof Error?$.message:"Failed to load GSC performance data")}finally{G(!1)}}async function Ss(){re(!0);try{const[$,ue]=await Promise.all([Bj(e,{url:Z.trim()||void 0,limit:20}),qj(e)]);b($),v(ue)}catch($){b([]),v([]),Ce($ instanceof Error?$.message:"Failed to load GSC inspection history")}finally{re(!1)}}async function qi(){Xe(!0);try{const[$,ue]=await Promise.all([Hj(e),Zj(e).catch(()=>[])]);Ge($),Qn(ue)}catch($){Ge(null),Qn([]),Ce($ instanceof Error?$.message:"Failed to load coverage data")}finally{Xe(!1)}}async function ls($){Gs(!0),Ce(null);try{const ue=await zm(e,{urls:$}),{succeeded:nt,failed:Vt,total:Lt}=ue.summary;ne(Vt===0?`Indexing requested for ${nt} URL${nt!==1?"s":""}.`:`Indexing requested: ${nt}/${Lt} succeeded, ${Vt} failed.`)}catch(ue){Ce(ue instanceof Error?ue.message:"Failed to request indexing")}finally{Gs(!1)}}async function Ea(){Gs(!0),Ce(null);try{const $=await zm(e,{urls:[],allUnindexed:!0}),{succeeded:ue,failed:nt,total:Vt}=$.summary;ne(nt===0?`Indexing requested for ${ue} unindexed URL${ue!==1?"s":""}.`:`Indexing requested: ${ue}/${Vt} succeeded, ${nt} failed.`)}catch($){Ce($ instanceof Error?$.message:"Failed to request indexing")}finally{Gs(!1)}}async function cs(){if(kt.trim()){oe(!0),Ce(null);try{await Uj(e,"gsc",kt.trim()),r($=>$.map(ue=>ue.connectionType==="gsc"?{...ue,sitemapUrl:kt.trim()}:ue)),ne("Sitemap URL saved."),wt("")}catch($){Ce($ instanceof Error?$.message:"Failed to save sitemap URL")}finally{oe(!1)}}}async function gl(){dt(!0),Ce(null);try{const $=await Kj(e);Kt($.sitemaps),r(ue=>ue.map(nt=>nt.connectionType==="gsc"?{...nt,sitemapUrl:$.primarySitemapUrl}:nt)),ne(`Discovered ${$.sitemaps.length} sitemap(s). Primary sitemap saved and inspection queued (run ${$.run.id}).`)}catch($){Ce($ instanceof Error?$.message:"Failed to discover sitemaps")}finally{dt(!1)}}async function yl(){_t(!0),Ce(null);try{const $=await Gj(e);Kt($.sitemaps),$.sitemaps.length===0&&ne("No sitemaps found in this GSC property. Submit a sitemap in Google Search Console first.")}catch($){Ce($ instanceof Error?$.message:"Failed to list sitemaps")}finally{_t(!1)}}async function Ra(){se(!0),Ce(null);try{const[$,ue]=await Promise.all([_p().catch(()=>null),Aj(e).catch(()=>[])]);s(!!$?.google?.configured),r(ue);const nt=ue.find(Vt=>Vt.connectionType==="gsc");await Promise.all([pl(nt),Ks(),Ss(),qi()])}finally{se(!1)}}N.useEffect(()=>{Ra()},[e]);async function Hi(){if(!t){Ce("Google OAuth app credentials are not configured yet. Set them on the Settings page first.");return}ze(!0),Ce(null),ne(null);try{const{authUrl:$}=await Tj(e,"gsc");if(!$.startsWith("https://accounts.google.com/")){Ce("Unexpected OAuth redirect URL. Please try again.");return}const ue=window.open($,"_blank","width=600,height=700");if(!ue){window.location.assign($);return}ne("Finish the Google consent flow in the popup, then close it to refresh this project.");const nt=window.setInterval(()=>{ue.closed&&(window.clearInterval(nt),ne(null),Ra())},1e3)}catch($){Ce($ instanceof Error?$.message:"Failed to start OAuth flow")}finally{ze(!1)}}async function cd(){Ce(null),ne(null);try{await Dj(e,"gsc"),r($=>$.filter(ue=>ue.connectionType!=="gsc")),d([]),C("")}catch($){Ce($ instanceof Error?$.message:"Failed to disconnect")}}async function vl(){if(S){te(!0),Ce(null);try{await Mj(e,"gsc",S),r($=>$.map(ue=>ue.connectionType==="gsc"?{...ue,propertyId:S}:ue)),ne("GSC property updated.")}catch($){Ce($ instanceof Error?$.message:"Failed to save GSC property")}finally{te(!1)}}}async function bl(){B(!0),Ce(null),ne(null);try{await Pj(e,{days:parseInt(R,10)||void 0,full:U||void 0}),ne("GSC sync queued. Refresh after the run completes to see imported data.")}catch($){Ce($ instanceof Error?$.message:"Failed to trigger sync")}finally{B(!1)}}async function qr(){if(_.trim()){he(!0),Ce(null),ne(null);try{const $=await Ij(e,_.trim());j($),E(""),await Ss()}catch($){Ce($ instanceof Error?$.message:"Failed to inspect URL")}finally{he(!1)}}}return l.jsxs("section",{className:"page-section-divider",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Search Console"}),l.jsx("h2",{children:"Google Search Console"})]}),l.jsx("div",{className:"flex items-center gap-2",children:$e&&l.jsx(le,{type:"button",variant:"outline",size:"sm",disabled:L,onClick:()=>{Ks()},children:L?"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:()=>Ce(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:()=>ne(null),children:"×"})]}),Q?l.jsx("p",{className:"text-sm text-zinc-500",children:"Loading…"}):l.jsxs("div",{className:"space-y-3",children:[l.jsxs(He,{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(lt,{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:cd,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:br($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(le,{type:"button",variant:"outline",size:"sm",disabled:me,onClick:Hi,children:me?"Opening…":"Connect Google Search Console"}):l.jsx(le,{type:"button",variant:"outline",size:"sm",asChild:!0,children:l.jsx(gt,{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(le,{type:"button",size:"sm",disabled:Je||!$e.propertyId,onClick:gl,children:Je?"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:kt,onChange:$=>wt($.target.value),onKeyDown:$=>$.key==="Enter"&&void cs()}),l.jsx(le,{type:"button",size:"sm",variant:"outline",disabled:sn||!kt.trim(),onClick:cs,children:sn?"Saving…":"Save sitemap URL"})]})]})]})]})}),($e||ld)&&l.jsxs(l.Fragment,{children:[l.jsxs(He,{className:"surface-card",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Coverage"}),l.jsx("h3",{children:"Index coverage"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[de&&de.notIndexed.length>0&&l.jsx(le,{type:"button",variant:"outline",size:"sm",disabled:xs,onClick:()=>{Ea()},children:xs?"Requesting…":`Request indexing (${de.notIndexed.length})`}),l.jsx(le,{type:"button",variant:"outline",size:"sm",disabled:ge,onClick:()=>{qi()},children:ge?"Loading…":"Refresh coverage"})]})]}),de&&de.summary.total>0?l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"mt-6 flex flex-col items-center",children:(()=>{const $=de.summary.indexed+de.summary.notIndexed,ue=$>0?de.summary.indexed/$:0,nt=$>0?de.summary.notIndexed/$:0,Vt=54,Lt=2*Math.PI*Vt,Et=Lt*(1-ue),jt=Lt*nt,jn=Lt*ue;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:Vt,fill:"none",stroke:"rgba(255,255,255,0.04)",strokeWidth:"14"}),l.jsx("circle",{cx:"64",cy:"64",r:Vt,fill:"none",stroke:"#10b981",strokeWidth:"14",strokeDasharray:Lt,strokeDashoffset:Et,strokeLinecap:"round",transform:"rotate(-90 64 64)",style:{transition:"stroke-dashoffset 0.6s ease"}}),de.summary.notIndexed>0&&l.jsx("circle",{cx:"64",cy:"64",r:Vt,fill:"none",stroke:"#52525b",strokeWidth:"14",strokeDasharray:`${jt} ${Lt-jt}`,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:[(ue*100).toFixed(0),"%"]}),l.jsx("span",{className:"text-xs uppercase tracking-widest text-zinc-500 mt-0.5",children:"Indexed"})]})]}),l.jsxs("div",{className:"mt-4 flex items-center justify-center gap-8",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full bg-emerald-500"}),l.jsxs("div",{children:[l.jsx("p",{className:"text-2xl font-semibold tabular-nums text-zinc-50",children:de.summary.indexed.toLocaleString()}),l.jsx("p",{className:"text-[11px] uppercase tracking-wide text-zinc-500",children:"Indexed"})]})]}),l.jsx("div",{className:"h-8 w-px bg-zinc-800"}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full bg-zinc-500"}),l.jsxs("div",{children:[l.jsx("p",{className:"text-2xl font-semibold tabular-nums text-zinc-50",children:de.summary.notIndexed.toLocaleString()}),l.jsxs("p",{className:"text-[11px] uppercase tracking-wide text-zinc-500",children:["Not indexed",(de.reasonGroups??[]).length>0&&l.jsxs("span",{className:"ml-1 text-zinc-600",children:["· ",(de.reasonGroups??[]).length," ",(de.reasonGroups??[]).length===1?"reason":"reasons"]})]})]})]}),de.summary.deindexed>0&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"h-8 w-px bg-zinc-800"}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full bg-rose-500"}),l.jsxs("div",{children:[l.jsx("p",{className:"text-2xl font-semibold tabular-nums text-zinc-50",children:de.summary.deindexed.toLocaleString()}),l.jsx("p",{className:"text-[11px] uppercase tracking-wide text-zinc-500",children:"Deindexed"})]})]})]})]})]})})()}),l.jsx("div",{className:"mt-3 flex gap-1",children:["indexed","notIndexed","deindexed"].map($=>{const ue=$==="indexed"?de.indexed.length:$==="notIndexed"?de.notIndexed.length:de.deindexed.length,nt=$==="indexed"?"Indexed":$==="notIndexed"?"Not Indexed":"Deindexed";return l.jsxs("button",{type:"button",className:`rounded-full px-3 py-1 text-xs font-medium transition-colors ${ke===$?"bg-zinc-700 text-zinc-100":"text-zinc-400 hover:bg-zinc-800 hover:text-zinc-200"}`,onClick:()=>{Te($),Fs(null)},children:[nt," (",ue,")"]},$)})}),l.jsxs("div",{className:"mt-3 overflow-x-auto",children:[ke==="indexed"&&de.indexed.length>0&&l.jsxs("table",{className:"data-table w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{className:"text-left",children:"URL"}),l.jsx("th",{className:"text-left",children:"Verdict"}),l.jsx("th",{className:"text-left",children:"Last Crawl"}),l.jsx("th",{className:"text-left",children:"Mobile"})]})}),l.jsx("tbody",{children:de.indexed.map($=>l.jsxs("tr",{children:[l.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:$.url}),l.jsx("td",{className:"text-zinc-400",children:$.verdict??"Unknown"}),l.jsx("td",{className:"text-zinc-400",children:$.crawlTime?$.crawlTime.split("T")[0]:"—"}),l.jsx("td",{className:"text-zinc-400",children:$.isMobileFriendly===!0?"Yes":$.isMobileFriendly===!1?"No":"—"})]},$.id))})]}),ke==="notIndexed"&&!bs&&(de.reasonGroups??[]).length>0&&l.jsxs("table",{className:"data-table w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{className:"text-left",children:"Reason"}),l.jsx("th",{className:"text-right",children:"Pages"})]})}),l.jsx("tbody",{children:(de.reasonGroups??[]).map($=>l.jsxs("tr",{className:"cursor-pointer hover:bg-zinc-800/40",onClick:()=>Fs($.reason),children:[l.jsx("td",{className:"text-zinc-200",children:$.reason}),l.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:$.count})]},$.reason))})]}),ke==="notIndexed"&&!bs&&(de.reasonGroups??[]).length===0&&de.notIndexed.length>0&&l.jsxs("table",{className:"data-table w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{className:"text-left",children:"URL"}),l.jsx("th",{className:"text-left",children:"Indexing State"}),l.jsx("th",{className:"text-left",children:"Coverage"})]})}),l.jsx("tbody",{children:de.notIndexed.map($=>l.jsxs("tr",{children:[l.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:$.url}),l.jsx("td",{className:"text-zinc-400",children:$.indexingState??"Unknown"}),l.jsx("td",{className:"text-zinc-400",children:$.coverageState??"Unknown"})]},$.id))})]}),ke==="notIndexed"&&bs&&(()=>{const $=(de.reasonGroups??[]).find(ue=>ue.reason===bs);return $?l.jsxs("div",{children:[l.jsx("div",{className:"flex items-center gap-2 mb-3",children:l.jsx("button",{type:"button",className:"text-xs text-zinc-400 hover:text-zinc-200 transition-colors",onClick:()=>Fs(null),children:"\\u2190 Back to reasons"})}),l.jsxs("div",{className:"mb-3 flex items-center justify-between rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium text-zinc-200",children:$.reason}),l.jsxs("p",{className:"mt-1 text-xs text-zinc-500",children:[$.count," affected page",$.count!==1?"s":""]})]}),l.jsx(le,{type:"button",variant:"outline",size:"sm",disabled:xs,onClick:()=>{ls($.urls.map(ue=>ue.url))},children:xs?"Requesting…":`Request indexing (${$.count})`})]}),l.jsxs("table",{className:"data-table w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{className:"text-left",children:"URL"}),l.jsx("th",{className:"text-left",children:"Last Crawl"}),l.jsx("th",{className:"w-8"})]})}),l.jsx("tbody",{children:$.urls.map(ue=>l.jsxs("tr",{children:[l.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:ue.url}),l.jsx("td",{className:"text-zinc-400",children:ue.crawlTime?ue.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([ue.url])},title:"Request indexing",children:"Index"})})]},ue.id))})]})]}):null})(),ke==="deindexed"&&de.deindexed.length>0&&l.jsxs("table",{className:"data-table w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{className:"text-left",children:"URL"}),l.jsx("th",{className:"text-left",children:"Previous"}),l.jsx("th",{className:"text-left",children:"Current"}),l.jsx("th",{className:"text-left",children:"Detected"})]})}),l.jsx("tbody",{children:de.deindexed.map(($,ue)=>l.jsxs("tr",{children:[l.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:$.url}),l.jsx("td",{className:"text-zinc-400",children:$.previousState}),l.jsx("td",{className:"text-zinc-400",children:$.currentState}),l.jsx("td",{className:"text-zinc-400",children:$.transitionDate.split("T")[0]})]},`${$.url}-${ue}`))})]}),(ke==="indexed"&&de.indexed.length===0||ke==="notIndexed"&&!bs&&de.notIndexed.length===0||ke==="deindexed"&&de.deindexed.length===0)&&l.jsx("p",{className:"text-sm text-zinc-500",children:"No URLs in this category."})]})]}):l.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:ge?"Loading coverage data…":"No coverage data yet. Inspect your sitemap to populate this view."})]}),l.jsxs(He,{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(le,{type:"button",variant:"outline",size:"sm",disabled:L,onClick:()=>{Ks()},children:L?"Loading…":"Apply filters"})]}),f.length>0&&(()=>{const $=new Map;for(const Ie of f){const st=$.get(Ie.date);st?(st.clicks+=Ie.clicks,st.impressions+=Ie.impressions):$.set(Ie.date,{clicks:Ie.clicks,impressions:Ie.impressions})}const ue=[...$.entries()].sort(([Ie],[st])=>Ie.localeCompare(st));if(ue.length===0)return null;const nt=Math.max(...ue.map(([,Ie])=>Ie.impressions),1),Vt=ue.reduce((Ie,[,st])=>Ie+st.clicks,0),Lt=ue.reduce((Ie,[,st])=>Ie+st.impressions,0),Et=Lt>0?(Vt/Lt*100).toFixed(1):"0.0",jt=700,jn=220,en={top:12,bottom:36,left:48,right:12},ud=jt-en.left-en.right,Vs=jn-en.top-en.bottom,Qs=ud/ue.length,us=Math.max(Math.min(Qs*.35,24),4),Oa=Math.max(us*.15,1),Ys=Ie=>{if(Ie<=0)return 1;const st=Math.pow(10,Math.floor(Math.log10(Ie))),Ht=Ie/st,an=Ht<=1.5?1.5:Ht<=3?3:Ht<=5?5:10;return Math.ceil(an*st)},Yn=4,ds=Math.ceil(Ys(nt)/Yn)*Yn,Js=Array.from({length:Yn+1},(Ie,st)=>ds/Yn*st),Mt=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:Vt.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:Lt.toLocaleString()})]})]}),l.jsxs("span",{className:"text-xs text-zinc-500",children:["CTR ",l.jsxs("span",{className:"text-amber-400 tabular-nums font-medium",children:[Et,"%"]})]})]}),l.jsx("div",{className:"relative w-full",style:{aspectRatio:`${jt} / ${jn}`},children:l.jsxs("svg",{viewBox:`0 0 ${jt} ${jn}`,className:"h-full w-full",children:[Js.map((Ie,st)=>{const Ht=en.top+Vs-Ie/ds*Vs;return l.jsxs("g",{children:[l.jsx("line",{x1:en.left,y1:Ht,x2:jt-en.right,y2:Ht,stroke:"rgba(255,255,255,0.06)",strokeWidth:"1"}),l.jsx("text",{x:en.left-6,y:Ht+3.5,textAnchor:"end",fill:"#a1a1aa",fontSize:"10",fontFamily:"inherit",children:Mt(Ie)})]},`t-${st}`)}),ue.map(([Ie,st],Ht)=>{const an=en.left+Qs*Ht+Qs/2,Aa=st.impressions/ds*Vs,Hr=st.clicks/ds*Vs;return l.jsxs("g",{children:[l.jsx("title",{children:`${Ie}
|
|
234
|
+
Clicks: ${st.clicks}
|
|
235
|
+
Impressions: ${st.impressions}
|
|
236
|
+
CTR: ${st.impressions>0?(st.clicks/st.impressions*100).toFixed(1):0}%`}),l.jsx("rect",{x:an-us-Oa/2,y:en.top+Vs-Aa,width:us,height:Math.max(Aa,1),rx:2,fill:"#3b82f6",opacity:.85}),l.jsx("rect",{x:an+Oa/2,y:en.top+Vs-Hr,width:us,height:Math.max(Hr,1),rx:2,fill:"#10b981",opacity:.85})]},Ie)}),(()=>{const Ie=Math.min(ue.length,7);return Array.from({length:Ie},(st,Ht)=>{const an=ue.length===1?0:Math.round(Ht/(Ie-1)*(ue.length-1)),Aa=en.left+Qs*an+Qs/2;return l.jsx("text",{x:Aa,y:jn-8,textAnchor:"middle",fill:"#71717a",fontSize:"10",fontFamily:"inherit",children:ue[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:M.startDate,onChange:$=>A(ue=>({...ue,startDate:$.target.value}))}),l.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"date",value:M.endDate,onChange:$=>A(ue=>({...ue,endDate:$.target.value}))}),l.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"Filter query",value:M.query,onChange:$=>A(ue=>({...ue,query:$.target.value}))}),l.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"Filter page",value:M.page,onChange:$=>A(ue=>({...ue,page:$.target.value}))}),l.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"number",min:"1",placeholder:"Limit",value:M.limit,onChange:$=>A(ue=>({...ue,limit:$.target.value}))})]}),f.length>0?l.jsx("div",{className:"mt-3 overflow-x-auto",children:l.jsxs("table",{className:"data-table w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{className:"text-left",children:"Date"}),l.jsx("th",{className:"text-left",children:"Query"}),l.jsx("th",{className:"text-left",children:"Page"}),l.jsx("th",{className:"text-right",children:"Clicks"}),l.jsx("th",{className:"text-right",children:"Impressions"}),l.jsx("th",{className:"text-right",children:"CTR"}),l.jsx("th",{className:"text-right",children:"Position"})]})}),l.jsx("tbody",{children:f.map(($,ue)=>l.jsxs("tr",{children:[l.jsx("td",{className:"text-zinc-400",children:$.date}),l.jsx("td",{className:"max-w-xs truncate text-zinc-200",children:$.query}),l.jsx("td",{className:"max-w-xs truncate text-zinc-400",children:$.page}),l.jsx("td",{className:"text-right tabular-nums text-zinc-300",children:$.clicks.toLocaleString()}),l.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:$.impressions.toLocaleString()}),l.jsxs("td",{className:"text-right tabular-nums text-zinc-400",children:[($.ctr*100).toFixed(1),"%"]}),l.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:$.position.toFixed(1)})]},`${$.date}:${$.query}:${$.page}:${ue}`))})]})}):l.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No performance rows match the current filters yet."})]}),l.jsxs(He,{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:_,onChange:$=>E($.target.value),onKeyDown:$=>$.key==="Enter"&&void qr()}),l.jsx(le,{type:"button",size:"sm",disabled:ce||!$e?.propertyId||!_.trim(),onClick:qr,children:ce?"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:Eb(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:br(x.crawlTime)})]})]})]}),l.jsxs(He,{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(le,{type:"button",variant:"outline",size:"sm",disabled:ie,onClick:()=>{Ss()},children:ie?"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:Z,onChange:$=>W($.target.value)}),l.jsx(le,{type:"button",size:"sm",variant:"outline",disabled:ie,onClick:()=>{Ss()},children:"Apply filter"})]}),m.length>0?l.jsx("div",{className:"mt-3 overflow-x-auto",children:l.jsxs("table",{className:"data-table w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{className:"text-left",children:"URL"}),l.jsx("th",{className:"text-left",children:"Indexing"}),l.jsx("th",{className:"text-left",children:"Verdict"}),l.jsx("th",{className:"text-left",children:"Coverage"}),l.jsx("th",{className:"text-left",children:"Mobile"}),l.jsx("th",{className:"text-left",children:"Inspected"})]})}),l.jsx("tbody",{children:m.map($=>l.jsxs("tr",{children:[l.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:$.url}),l.jsx("td",{className:"text-zinc-300",children:$.indexingState??"Unknown"}),l.jsx("td",{className:"text-zinc-400",children:$.verdict??"Unknown"}),l.jsx("td",{className:"text-zinc-400",children:$.coverageState??"Unknown"}),l.jsx("td",{className:"text-zinc-400",children:Eb($.isMobileFriendly)}),l.jsx("td",{className:"text-zinc-400",children:br($.inspectedAt)})]},$.id))})]})}):l.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No inspection history yet."})]}),l.jsxs(He,{className:"surface-card",children:[l.jsx("div",{className:"section-head",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Deindexed"}),l.jsx("h3",{children:"Recent indexing losses"})]})}),y.length>0?l.jsx("div",{className:"mt-3 overflow-x-auto",children:l.jsxs("table",{className:"data-table w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{className:"text-left",children:"URL"}),l.jsx("th",{className:"text-left",children:"Previous"}),l.jsx("th",{className:"text-left",children:"Current"}),l.jsx("th",{className:"text-left",children:"Changed at"})]})}),l.jsx("tbody",{children:y.map($=>l.jsxs("tr",{children:[l.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:$.url}),l.jsx("td",{className:"text-zinc-400",children:$.previousState??"Unknown"}),l.jsx("td",{className:"text-zinc-300",children:$.currentState??"Unknown"}),l.jsx("td",{className:"text-zinc-400",children:br($.transitionDate)})]},`${$.url}:${$.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($=>!$),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(He,{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:S,disabled:T||c.length===0,onChange:$=>C($.target.value),children:c.length===0?l.jsx("option",{value:"",children:T?"Loading properties…":"No properties available"}):c.map($=>l.jsxs("option",{value:$.siteUrl,children:[$.siteUrl," · ",$.permissionLevel]},$.siteUrl))}),l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsx(le,{type:"button",size:"sm",variant:"outline",disabled:T,onClick:()=>{pl($e)},children:T?"Refreshing…":"Refresh properties"}),l.jsx(le,{type:"button",size:"sm",disabled:!S||pe,onClick:vl,children:pe?"Saving…":"Save property"})]}),l.jsx("p",{className:"text-xs text-zinc-500",children:"The selected property is used for future syncs and URL inspections for this project."})]})]}),l.jsxs(He,{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:R,onChange:$=>z($.target.value)})]}),l.jsxs("label",{className:"flex items-center gap-2 rounded border border-zinc-800/60 bg-zinc-900/20 px-3 py-2 text-sm text-zinc-300",children:[l.jsx("input",{type:"checkbox",checked:U,onChange:$=>O($.target.checked)}),"Replace existing imported rows for the requested range"]})]}),l.jsx(le,{type:"button",size:"sm",disabled:je||!$e.propertyId,onClick:bl,children:je?"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(He,{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(le,{type:"button",size:"sm",variant:"outline",disabled:Wt||!$e.propertyId,onClick:()=>{yl()},children:Wt?"Loading…":"Browse sitemaps from GSC"}),l.jsx(le,{type:"button",size:"sm",variant:"outline",disabled:Je||!$e.propertyId,onClick:gl,children:Je?"Discovering…":"Auto-discover and queue inspection"})]}),l.jsx("p",{className:"text-xs text-zinc-500",children:"Browse lists available sitemaps without queueing a run. Auto-discover saves the primary sitemap and queues an inspection."}),nn&&nn.length>0&&l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3 space-y-2",children:[l.jsxs("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:["Sitemaps (",nn.length,")"]}),nn.map($=>{const ue=$.contents?.[0];return l.jsxs("div",{className:"flex items-start justify-between gap-2 text-xs",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-zinc-200 break-all",children:$.path}),$.lastSubmitted&&l.jsxs("p",{className:"text-zinc-500",children:["Submitted: ",$.lastSubmitted.split("T")[0]]})]}),l.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[ue&&l.jsxs("div",{className:"text-right",children:[l.jsxs("p",{className:"text-zinc-300",children:[ue.indexed," / ",ue.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:()=>wt($.path),children:"Use"})]})]},$.path)})]}),l.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[l.jsx("input",{className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"url",placeholder:$e.sitemapUrl?"Update sitemap URL…":"https://example.com/sitemap.xml",value:kt,onChange:$=>wt($.target.value),onKeyDown:$=>$.key==="Enter"&&kt.trim()&&void cs()}),l.jsx(le,{type:"button",size:"sm",disabled:sn||!kt.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(le,{type:"button",size:"sm",variant:"outline",disabled:mt||!$e.propertyId,onClick:()=>{const ue=document.getElementById(`gsc-sitemap-inspect-${e}`)?.value?.trim()||$e.sitemapUrl||void 0;fe(!0),Fj(e,{sitemapUrl:ue}).then(nt=>{ne(`Sitemap inspection queued (run ${nt.id}). Refresh coverage after the run completes.`)}).catch(nt=>{Ce(nt instanceof Error?nt.message:"Failed to queue sitemap inspection")}).finally(()=>fe(!1))},children:mt?"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,p]=N.useState(null),[m,b]=N.useState(e.displayName),[y,v]=N.useState(e.canonicalDomain),[x,j]=N.useState(e.country),[S,C]=N.useState(e.language),[_,E]=N.useState(e.ownedDomains??[]),[R,z]=N.useState(""),[U,O]=N.useState(null),[M,A]=N.useState(!1),[Z,W]=N.useState(!1),[Q,se]=N.useState(""),[me,ze]=N.useState(""),[je,B]=N.useState(""),[T,ae]=N.useState(""),[pe,te]=N.useState("");N.useEffect(()=>{a||(b(e.displayName),v(e.canonicalDomain),j(e.country),C(e.language),E(e.ownedDomains??[]))},[e,a]);function L(){r(!1),p(null),b(e.displayName),v(e.canonicalDomain),j(e.country),C(e.language),E(e.ownedDomains??[]),z("")}function G(){const fe=R.trim();fe&&(_.includes(fe)||E([..._,fe]),z(""))}function ie(fe){E(_.filter(Je=>Je!==fe))}async function re(){if(!(!m.trim()||!y.trim()||!x.trim()||!S.trim())){d(!0),p(null);try{await t(e.name,{displayName:m.trim(),canonicalDomain:y.trim(),ownedDomains:_,country:x.trim(),language:S.trim()}),r(!1)}catch(fe){p(fe instanceof Error?fe.message:"Failed to save")}finally{d(!1)}}}async function ce(){const fe=Q.trim(),Je=me.trim(),dt=je.trim(),Wt=T.trim();if(!(!fe||!Je||!dt||!Wt)){A(!0),O(null);try{const _t={label:fe,city:Je,region:dt,country:Wt};pe.trim()&&(_t.timezone=pe.trim()),await yj(e.name,_t),s(),se(""),ze(""),B(""),ae(""),te(""),W(!1)}catch(_t){O(_t instanceof Error?_t.message:"Failed to add location")}finally{A(!1)}}}async function he(fe){A(!0),O(null);try{await vj(e.name,fe),s()}catch(Je){O(Je instanceof Error?Je.message:"Failed to remove location")}finally{A(!1)}}async function de(fe){A(!0),O(null);try{await bj(e.name,fe),s()}catch(Je){O(Je instanceof Error?Je.message:"Failed to set default location")}finally{A(!1)}}const Ge=m!==e.displayName||y!==e.canonicalDomain||x!==e.country||S!==e.language||JSON.stringify(_)!==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",Xe="block text-xs font-medium text-zinc-400 mb-1",mt=Q.trim()&&me.trim()&&je.trim()&&T.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(le,{type:"button",variant:"outline",size:"sm",onClick:()=>r(!0),children:"Edit settings"})]}),f&&l.jsxs("div",{className:"mb-3 rounded-lg border border-rose-800/40 bg-rose-950/20 px-3 py-2 text-sm text-rose-300",children:[f,l.jsx("button",{type:"button",className:"ml-2 text-rose-400 hover:text-rose-200",onClick:()=>p(null),children:"×"})]}),a?l.jsxs("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900/40 p-4 space-y-4",children:[l.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[l.jsxs("div",{children:[l.jsx("label",{className:Xe,children:"Display name"}),l.jsx("input",{className:ge,type:"text",value:m,onChange:fe=>b(fe.target.value),placeholder:"My Project"})]}),l.jsxs("div",{children:[l.jsx("label",{className:Xe,children:"Canonical domain"}),l.jsx("input",{className:ge,type:"text",value:y,onChange:fe=>v(fe.target.value),placeholder:"example.com"})]}),l.jsxs("div",{children:[l.jsx("label",{className:Xe,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:Xe,children:"Language"}),l.jsx("input",{className:ge,type:"text",value:S,onChange:fe=>C(fe.target.value),placeholder:"en"})]})]}),l.jsxs("div",{children:[l.jsx("label",{className:Xe,children:"Owned domains"}),l.jsx("div",{className:"flex flex-wrap gap-1.5 mb-2",children:_.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:()=>ie(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:R,onChange:fe=>z(fe.target.value),onKeyDown:fe=>fe.key==="Enter"&&(fe.preventDefault(),G())}),l.jsx(le,{type:"button",variant:"outline",size:"sm",disabled:!R.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(le,{type:"button",disabled:c||!Ge||!m.trim()||!y.trim(),onClick:re,children:c?"Saving...":"Save changes"}),l.jsx(le,{type:"button",variant:"outline",disabled:c,onClick:L,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:[U&&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:[U,l.jsx("button",{type:"button",className:"ml-1 text-rose-400 hover:text-rose-200",onClick:()=>O(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:M,onClick:()=>de(fe.label),className:"text-[10px] text-zinc-500 hover:text-emerald-400 transition-colors disabled:opacity-40","aria-label":`Set ${fe.label} as default location`,children:"Set default"}),l.jsx("button",{type:"button",disabled:M,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"}),Z?l.jsxs("div",{className:"mt-2 rounded border border-zinc-800 bg-zinc-900/50 p-3 space-y-2",children:[l.jsx("p",{className:"text-[10px] font-medium uppercase tracking-wide text-zinc-500",children:"Add location"}),l.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[l.jsxs("div",{children:[l.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Label *"}),l.jsx("input",{className:ge,type:"text",value:Q,onChange:fe=>se(fe.target.value),placeholder:"nyc"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"City *"}),l.jsx("input",{className:ge,type:"text",value:me,onChange:fe=>ze(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:je,onChange:fe=>B(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:T,onChange:fe=>ae(fe.target.value),placeholder:"US",maxLength:2})]}),l.jsxs("div",{className:"col-span-2",children:[l.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Timezone (optional)"}),l.jsx("input",{className:ge,type:"text",value:pe,onChange:fe=>te(fe.target.value),placeholder:"America/New_York"})]})]}),l.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[l.jsx(le,{type:"button",size:"sm",disabled:M||!mt,onClick:ce,children:M?"Adding...":"Add location"}),l.jsx(le,{type:"button",size:"sm",variant:"outline",disabled:M,onClick:()=>{W(!1),O(null)},children:"Cancel"})]})]}):l.jsx(le,{type:"button",size:"sm",variant:"outline",onClick:()=>W(!0),children:"+ Add location"})]})]})]})})})]})}const P4=[{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"}],Ux=["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 $4({projectName:e}){const[t,s]=N.useState("loading"),[a,r]=N.useState(!1),[c,d]=N.useState("daily"),[f,p]=N.useState(6),[m,b]=N.useState(""),[y,v]=N.useState("UTC"),[x,j]=N.useState(!1),[S,C]=N.useState(""),[_,E]=N.useState(!1),[R,z]=N.useState(!1),[U,O]=N.useState(null);N.useEffect(()=>{Nj(e).then(s).catch(()=>s(null))},[e]);const M=()=>{if(t&&t!=="loading"){const Q=O2(t.preset??null,t.cronExpr);d(Q.freq),p(Q.hour),b(Q.customCron);const se=Ux.includes(t.timezone);v(se?t.timezone:"Other"),j(!se),C(se?"":t.timezone)}else d("daily"),p(6),b(""),v("UTC"),j(!1),C("");O(null),r(!0)},A=async()=>{E(!0),O(null);try{const se={timezone:x?S.trim()||"UTC":y};c==="custom"?se.cron=m.trim():se.preset=R2(c,f);const me=await _m(e,se);s(me),r(!1)}catch(Q){O(Q instanceof Error?Q.message:"Failed to save schedule")}finally{E(!1)}},Z=async()=>{if(!(!t||t==="loading")){E(!0),O(null);try{const Q={timezone:t.timezone,enabled:!t.enabled};t.preset?Q.preset=t.preset:Q.cron=t.cronExpr,s(await _m(e,Q))}catch(Q){O(Q instanceof Error?Q.message:"Failed to update schedule")}finally{E(!1)}}},W=async()=>{z(!0),O(null);try{await Cj(e),s(null),r(!1)}catch(Q){O(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(le,{type:"button",variant:"outline",size:"sm",onClick:M,children:t?"Edit schedule":"+ Set schedule"})]}),t==="loading"&&l.jsx("p",{className:"supporting-copy",children:"Loading..."}),t!=="loading"&&!a&&t===null&&l.jsx(He,{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(He,{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:A2(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(lt,{tone:t.enabled?"positive":"neutral",children:t.enabled?"Active":"Paused"}),l.jsx(le,{type:"button",variant:"outline",size:"sm",disabled:_,onClick:Z,children:t.enabled?"Pause":"Resume"}),l.jsx(le,{type:"button",variant:"ghost",size:"sm",disabled:R,onClick:W,children:R?"Removing...":"Remove"})]})]}),U&&l.jsx("p",{className:"text-rose-400 text-sm mt-2",children:U})]}),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:P4.map(Q=>l.jsx("option",{value:Q.value,children:Q.label},Q.value))})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Time"}),l.jsx("select",{className:"w-full rounded border border-zinc-700 bg-zinc-900 px-2 py-1.5 text-sm text-zinc-200 focus:border-zinc-500 focus:outline-none disabled:opacity-40",value:f,disabled:c==="twice-daily"||c==="custom",onChange:Q=>p(parseInt(Q.target.value)),children:Array.from({length:24},(Q,se)=>l.jsx("option",{value:se,children:mm(se)},se))})]})]}),c==="custom"&&l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Cron expression"}),l.jsx("input",{className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 font-mono focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"0 9 * * 1-5",value:m,onChange:Q=>b(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),v("Other")):(j(!1),v(Q.target.value))},children:[Ux.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:S,onChange:Q=>C(Q.target.value)})]}),U&&l.jsx("p",{className:"text-rose-400 text-sm",children:U}),l.jsxs("div",{className:"flex gap-2 justify-end",children:[l.jsx(le,{type:"button",variant:"outline",size:"sm",onClick:()=>{r(!1),O(null)},children:"Cancel"}),l.jsx(le,{type:"button",size:"sm",disabled:_||c==="custom"&&!m.trim(),onClick:A,children:_?"Saving...":"Save schedule"})]})]})]})}const I4=[{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 B4({projectName:e}){const[t,s]=N.useState("loading"),[a,r]=N.useState(!1),[c,d]=N.useState(""),[f,p]=N.useState(["citation.lost","citation.gained"]),[m,b]=N.useState(!1),[y,v]=N.useState(null),[x,j]=N.useState({});N.useEffect(()=>{_j(e).then(s).catch(()=>s([]))},[e]);const S=R=>{p(z=>z.includes(R)?z.filter(U=>U!==R):[...z,R])},C=async()=>{if(!(!c.trim()||f.length===0)){b(!0),v(null);try{const R=await kj(e,{channel:"webhook",url:c.trim(),events:f});s(z=>z==="loading"?[R]:[...z,R]),d(""),p(["citation.lost","citation.gained"]),r(!1)}catch(R){v(R instanceof Error?R.message:"Failed to add webhook")}finally{b(!1)}}},_=async R=>{try{await zj(e,R),s(z=>z==="loading"?z:z.filter(U=>U.id!==R))}catch(z){v(z instanceof Error?z.message:"Failed to remove webhook")}},E=async R=>{j(z=>({...z,[R]:{state:"testing"}}));try{const z=await Ej(e,R);j(U=>({...U,[R]:{state:z.ok?"ok":"fail",status:z.status}}))}catch{j(z=>({...z,[R]:{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(le,{type:"button",variant:"outline",size:"sm",onClick:()=>{r(!a),v(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:R=>d(R.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:I4.map(R=>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(R.value),onChange:()=>S(R.value)}),l.jsx("span",{className:"text-sm text-zinc-300",children:R.label})]},R.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(le,{type:"button",variant:"outline",size:"sm",onClick:()=>{r(!1),v(null)},children:"Cancel"}),l.jsx(le,{type:"button",size:"sm",disabled:m||!c.trim()||f.length===0,onClick:C,children:m?"Adding...":"Add webhook"})]})]}),t==="loading"&&l.jsx("p",{className:"supporting-copy",children:"Loading..."}),t!=="loading"&&t.length===0&&!a&&l.jsx(He,{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(R=>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:R.url})}),l.jsx("td",{children:l.jsx("div",{className:"flex flex-wrap gap-1",children:R.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(lt,{tone:R.enabled?"positive":"neutral",children:R.enabled?"Active":"Paused"})}),l.jsx("td",{children:l.jsxs("div",{className:"flex items-center gap-1 justify-end",children:[x[R.id]&&(()=>{const z=x[R.id],U=z.state==="testing"?"Sending…":z.state==="ok"?`Delivered${z.status?` (${z.status})`:""}`:`Failed${z.status?` (${z.status})`:""}`;return l.jsx(lt,{tone:z.state==="ok"?"positive":z.state==="fail"?"negative":"neutral",children:U})})(),l.jsx(le,{variant:"ghost",size:"sm",type:"button",disabled:x[R.id]?.state==="testing",onClick:()=>E(R.id),children:"Test"}),l.jsx(le,{variant:"ghost",size:"sm",type:"button",onClick:()=>_(R.id),children:"Remove"})]})})]},R.id))})]}),y&&l.jsx("p",{className:"text-rose-400 text-sm mt-2",children:y})]})]})}const q4=Qu();function H4({projectName:e}){const[t,s]=N.useState(null),[a,r]=N.useState([]),[c,d]=N.useState(null),[f,p]=N.useState([]),[m,b]=N.useState([]),[y,v]=N.useState(null),[x,j]=N.useState(""),[S,C]=N.useState(""),[_,E]=N.useState(""),[R,z]=N.useState(!0),[U,O]=N.useState(null),[M,A]=N.useState("coverage");N.useEffect(()=>{Z()},[e]);async function Z(){z(!0),O(null);try{const T=await Qj(e);if(s(T),T.connected){const[ae,pe,te]=await Promise.all([e1(e).catch(()=>null),t1(e).catch(()=>[]),s1(e).catch(()=>[])]);ae&&d(ae),p(pe),b(te)}}catch(T){O(T instanceof Error?T.message:"Failed to load Bing data")}finally{z(!1)}}async function W(){if(S.trim()){O(null);try{const T=await Yj(e,S.trim());C(""),T.availableSites.length>0&&r(T.availableSites),await Z()}catch(T){O(T instanceof Error?T.message:"Failed to connect")}}}async function Q(){try{await Jj(e),s(null),d(null),p([]),b([])}catch(T){O(T instanceof Error?T.message:"Failed to disconnect")}}async function se(){if(_)try{await Wj(e,_),await Z()}catch(T){O(T instanceof Error?T.message:"Failed to set site")}}async function me(){if(x.trim())try{const T=await n1(e,x.trim());v(T),p(ae=>[T,...ae])}catch(T){O(T instanceof Error?T.message:"Inspection failed")}}async function ze(T){try{await Em(e,{urls:[T]}),O(null)}catch(ae){O(ae instanceof Error?ae.message:"Submission failed")}}async function je(){try{await Em(e,{allUnindexed:!0}),O(null)}catch(T){O(T instanceof Error?T.message:"Batch submission failed")}}if(R)return l.jsx(He,{className:"p-4",children:l.jsx("div",{className:"text-sm text-zinc-400",children:"Loading Bing data..."})});if(!t?.connected)return l.jsxs(He,{className:"p-4 space-y-3",children:[l.jsx("h3",{className:"text-sm font-semibold text-zinc-200",children:"Bing Webmaster Tools"}),l.jsx("p",{className:"text-xs text-zinc-400",children:"Connect Bing Webmaster Tools to monitor index coverage and submit URLs for the Bing search engine (used by OpenAI)."}),l.jsxs("div",{children:[l.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"bing-api-key",children:"API Key"}),l.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[l.jsx("input",{id:"bing-api-key",type:"password",className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"Bing Webmaster Tools API key",value:S,onChange:T=>C(T.target.value),onKeyDown:T=>T.key==="Enter"&&W()}),l.jsx(le,{size:"sm",disabled:!S.trim(),onClick:W,children:"Connect"})]}),l.jsxs("p",{className:"mt-1 text-[11px] text-zinc-500",children:["Get your API key from"," ",l.jsx("a",{href:"https://www.bing.com/webmasters/",target:"_blank",rel:"noopener noreferrer",className:"text-zinc-400 hover:text-zinc-300 underline underline-offset-2",children:"Bing Webmaster Tools"})]})]}),U&&l.jsx("p",{className:"text-xs text-rose-400",children:U})]});if(!t.siteUrl)return l.jsxs(He,{className:"p-4 space-y-3",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("h3",{className:"text-sm font-semibold text-zinc-200",children:"Bing Webmaster Tools"}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(lt,{tone:"positive",children:"Connected"}),l.jsx(le,{size:"sm",variant:"ghost",onClick:Q,children:"Disconnect"})]})]}),l.jsx("p",{className:"text-xs text-zinc-400",children:"Select a site to monitor:"}),a.length>0?l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("select",{className:"flex-1 rounded border border-zinc-700 bg-zinc-900 px-2 py-1.5 text-sm text-zinc-200 focus:border-zinc-500 focus:outline-none",value:_,onChange:T=>E(T.target.value),children:[l.jsx("option",{value:"",children:"Select a site..."}),a.map(T=>l.jsxs("option",{value:T.url,children:[T.url,T.verified?" (verified)":""]},T.url))]}),l.jsx(le,{size:"sm",disabled:!_,onClick:se,children:"Set Site"})]}):l.jsx("div",{children:l.jsx(le,{size:"sm",onClick:async()=>{const T=await Xj(e);r(T.sites)},children:"Load Sites"})}),U&&l.jsx("p",{className:"text-xs text-rose-400",children:U})]});const B=[{key:"coverage",label:"Coverage"},{key:"inspections",label:"Inspections"},{key:"performance",label:"Performance"}];return l.jsxs(He,{className:"p-4 space-y-4",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx("h3",{className:"text-sm font-semibold text-zinc-200",children:"Bing Webmaster Tools"}),l.jsx("p",{className:"text-xs text-zinc-500",children:t.siteUrl})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(lt,{tone:"positive",children:"Connected"}),l.jsx(le,{size:"sm",variant:"ghost",onClick:Q,children:"Disconnect"})]})]}),U&&l.jsx("p",{className:"text-xs text-rose-400",children:U}),l.jsx("div",{className:"flex gap-1 border-b border-zinc-800",children:B.map(T=>l.jsx("button",{className:`px-3 py-1.5 text-xs font-medium border-b-2 transition-colors ${M===T.key?"border-zinc-200 text-zinc-200":"border-transparent text-zinc-500 hover:text-zinc-300"}`,onClick:()=>A(T.key),children:T.label},T.key))}),M==="coverage"&&c&&l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsxs("div",{className:"text-center",children:[l.jsx("div",{className:"text-2xl font-semibold text-emerald-400",children:c.summary.indexed}),l.jsx("div",{className:"text-[10px] uppercase tracking-wide text-zinc-500",children:"Indexed"})]}),l.jsxs("div",{className:"text-center",children:[l.jsx("div",{className:"text-2xl font-semibold text-rose-400",children:c.summary.notIndexed}),l.jsx("div",{className:"text-[10px] uppercase tracking-wide text-zinc-500",children:"Not Indexed"})]}),l.jsxs("div",{className:"text-center",children:[l.jsxs("div",{className:"text-2xl font-semibold text-zinc-300",children:[c.summary.percentage,"%"]}),l.jsx("div",{className:"text-[10px] uppercase tracking-wide text-zinc-500",children:"Coverage"})]})]}),c.notIndexed.length>0&&l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between mb-2",children:[l.jsxs("h4",{className:"text-xs font-medium text-zinc-400",children:["Not Indexed (",c.notIndexed.length,")"]}),l.jsx(le,{size:"sm",variant:"ghost",onClick:je,children:"Submit all to Bing"})]}),l.jsxs("table",{className:"w-full text-xs",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-zinc-800",children:[l.jsx("th",{className:"text-left py-1.5 text-zinc-500 font-medium",children:"URL"}),l.jsx("th",{className:"text-left py-1.5 text-zinc-500 font-medium w-16",children:"HTTP"}),l.jsx("th",{className:"text-right py-1.5 text-zinc-500 font-medium w-20",children:"Action"})]})}),l.jsx("tbody",{children:c.notIndexed.map(T=>l.jsxs("tr",{className:"border-b border-zinc-800/50",children:[l.jsx("td",{className:"py-1.5 text-zinc-300 truncate max-w-[300px]",children:T.url}),l.jsx("td",{className:"py-1.5 text-zinc-400",children:T.httpCode??"—"}),l.jsx("td",{className:"py-1.5 text-right",children:l.jsx("button",{className:"text-[10px] text-zinc-400 hover:text-zinc-200 underline underline-offset-2",onClick:()=>ze(T.url),children:"Submit"})})]},T.id))})]})]}),c.indexed.length>0&&l.jsxs("div",{children:[l.jsxs("h4",{className:"text-xs font-medium text-zinc-400 mb-2",children:["Indexed (",c.indexed.length,")"]}),l.jsxs("table",{className:"w-full text-xs",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-zinc-800",children:[l.jsx("th",{className:"text-left py-1.5 text-zinc-500 font-medium",children:"URL"}),l.jsx("th",{className:"text-left py-1.5 text-zinc-500 font-medium w-28",children:"Last Crawled"})]})}),l.jsx("tbody",{children:c.indexed.map(T=>l.jsxs("tr",{className:"border-b border-zinc-800/50",children:[l.jsx("td",{className:"py-1.5 text-zinc-300 truncate max-w-[300px]",children:T.url}),l.jsx("td",{className:"py-1.5 text-zinc-400",children:T.lastCrawledDate?br(T.lastCrawledDate):"—"})]},T.id))})]})]})]}),M==="coverage"&&!c&&l.jsx("p",{className:"text-xs text-zinc-500",children:"No coverage data. Inspect URLs to build coverage data."}),M==="inspections"&&l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("input",{type:"text",className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"URL to inspect",value:x,onChange:T=>j(T.target.value),onKeyDown:T=>T.key==="Enter"&&me()}),l.jsx(le,{size:"sm",disabled:!x.trim(),onClick:me,children:"Inspect"})]}),y&&l.jsxs("div",{className:"rounded border border-zinc-800 bg-zinc-900/40 p-3 text-xs space-y-1",children:[l.jsx("div",{className:"text-zinc-200 font-medium",children:y.url}),l.jsxs("div",{className:"text-zinc-400",children:["In Index: ",l.jsx("span",{className:y.inIndex?"text-emerald-400":"text-rose-400",children:y.inIndex?"Yes":"No"})," · ","HTTP: ",y.httpCode??"—"," · ","Crawled: ",y.lastCrawledDate??"—"]})]}),f.length>0&&l.jsxs("table",{className:"w-full text-xs",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-zinc-800",children:[l.jsx("th",{className:"text-left py-1.5 text-zinc-500 font-medium",children:"URL"}),l.jsx("th",{className:"text-left py-1.5 text-zinc-500 font-medium w-16",children:"Index"}),l.jsx("th",{className:"text-left py-1.5 text-zinc-500 font-medium w-14",children:"HTTP"}),l.jsx("th",{className:"text-left py-1.5 text-zinc-500 font-medium w-28",children:"Inspected"})]})}),l.jsx("tbody",{children:f.map(T=>l.jsxs("tr",{className:"border-b border-zinc-800/50",children:[l.jsx("td",{className:"py-1.5 text-zinc-300 truncate max-w-[250px]",children:T.url}),l.jsx("td",{className:"py-1.5",children:l.jsx(lt,{tone:T.inIndex?"positive":"negative",children:T.inIndex?"Yes":"No"})}),l.jsx("td",{className:"py-1.5 text-zinc-400",children:T.httpCode??"—"}),l.jsx("td",{className:"py-1.5 text-zinc-400",children:br(T.inspectedAt)})]},T.id))})]})]}),M==="performance"&&l.jsx("div",{children:m.length===0?l.jsx("p",{className:"text-xs text-zinc-500",children:"No Bing performance data available."}):l.jsxs("table",{className:"w-full text-xs",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-zinc-800",children:[l.jsx("th",{className:"text-left py-1.5 text-zinc-500 font-medium",children:"Query"}),l.jsx("th",{className:"text-right py-1.5 text-zinc-500 font-medium w-16",children:"Clicks"}),l.jsx("th",{className:"text-right py-1.5 text-zinc-500 font-medium w-16",children:"Impr"}),l.jsx("th",{className:"text-right py-1.5 text-zinc-500 font-medium w-14",children:"CTR"}),l.jsx("th",{className:"text-right py-1.5 text-zinc-500 font-medium w-14",children:"Pos"})]})}),l.jsx("tbody",{children:m.map((T,ae)=>l.jsxs("tr",{className:"border-b border-zinc-800/50",children:[l.jsx("td",{className:"py-1.5 text-zinc-300 truncate max-w-[250px]",children:T.query}),l.jsx("td",{className:"py-1.5 text-zinc-200 text-right",children:T.clicks}),l.jsx("td",{className:"py-1.5 text-zinc-400 text-right",children:T.impressions}),l.jsxs("td",{className:"py-1.5 text-zinc-400 text-right",children:[(T.ctr*100).toFixed(1),"%"]}),l.jsx("td",{className:"py-1.5 text-zinc-400 text-right",children:T.averagePosition.toFixed(1)})]},ae))})]})})]})}function Z4({insights:e}){const{openEvidence:t}=ul(),[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(Uu,{size:12,className:`shrink-0 text-zinc-500 transition-transform duration-150 ${c?"rotate-90":""}`}),l.jsx(lt,{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(Nm,{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(Wo,{provider:f.provider})})]}),l.jsx("button",{type:"button",className:"text-xs text-zinc-400 hover:text-zinc-200 whitespace-nowrap transition-colors",onClick:p=>{p.stopPropagation(),t(f.evidenceId)},children:"View →"})]},f.evidenceId))})]},r.id)})})}function Fp({tab:e}){const{projectId:t}=Lu({from:"/projects/$projectId"}),s=ja(),{dashboard:a,refetch:r}=ka(),c=a??q4.dashboard,d=RM(c,t),[f,p]=N.useState(!1),[m,b]=N.useState(!1),[y,v]=N.useState(!1),[x,j]=N.useState(null),[S,C]=N.useState(!1),[_,E]=N.useState(""),[R,z]=N.useState(!1),[U,O]=N.useState(!1),[M,A]=N.useState(""),[Z,W]=N.useState(!1),[Q,se]=N.useState(!1),[me,ze]=N.useState(""),[je,B]=N.useState(!1),[T,ae]=N.useState(void 0),[pe,te]=N.useState(!1),[L,G]=N.useState(null),[ie,re]=N.useState(!1),ce=d?.visibilityEvidence??[],he=d?.project.name??"",de=N.useMemo(()=>new Set(ce.map(oe=>oe.location??"")),[ce]),Ge=de.has(""),ge=N.useMemo(()=>[...de].filter(Boolean),[de]);N.useEffect(()=>{if(T===void 0||T===""||!he){G(null),re(!1);return}re(!0),jp(he,T).then(oe=>{G(oe),re(!1)}).catch(()=>{G(null),re(!1)})},[T,he]);const Xe=N.useMemo(()=>{if(!L)return null;const oe=new Map;for(const Ue of L){for(const[Pe,ke]of Object.entries(Ue.providerRuns??{}))oe.set(`${Ue.keyword}::${Pe}`,ke.map(Te=>({runId:Te.runId,citationState:Te.citationState,createdAt:Te.createdAt})));(!Ue.providerRuns||Object.keys(Ue.providerRuns).length===0)&&oe.set(`${Ue.keyword}::`,Ue.runs.map(Pe=>({runId:Pe.runId,citationState:Pe.citationState,createdAt:Pe.createdAt})))}return oe},[L]),mt=N.useMemo(()=>{const oe=T!==void 0?ce.filter(Ue=>T===""?!Ue.location:Ue.location===T):ce;return Xe?oe.map(Ue=>{const Pe=Xe.get(`${Ue.keyword}::${Ue.provider}`)??Xe.get(`${Ue.keyword}::`);return Pe?{...Ue,runHistory:Pe}:Ue}):oe},[ce,T,Xe]);if(!d)return l.jsx("div",{className:"page-container",children:l.jsxs(He,{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(le,{asChild:!0,children:l.jsx(gt,{to:"/",children:"Return to overview"})})]})});async function fe(){v(!0),j(null);try{await Cp(he),r()}catch(oe){j(oe instanceof Error?oe.message:"Failed to trigger run")}finally{v(!1)}}async function Je(){b(!0);try{await xj(he),s({to:"/"}),r()}catch(oe){console.error("Failed to delete project:",oe)}finally{b(!1)}}async function dt(){const oe=await Sj(he),Ue=typeof oe=="string"?oe:JSON.stringify(oe,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 oe=_.split(`
|
|
237
|
+
`).map(Ue=>Ue.trim()).filter(Boolean);if(oe.length!==0){z(!0);try{await pj(he,oe),r(),E(""),C(!1)}finally{z(!1)}}}async function _t(){const oe=M.trim();if(oe){W(!0);try{const Pe=(await wp(he)).map(Te=>Te.domain),ke=[...new Set([...Pe,oe])];await Np(he,ke),r(),A(""),O(!1)}finally{W(!1)}}}async function nn(){const oe=me.trim();if(oe){B(!0);try{const Ue=d?.project.ownedDomains??[];await Cm(he,[...Ue,oe]),r(),ze(""),se(!1)}finally{B(!1)}}}async function Kt(oe){B(!0);try{const Ue=d?.project.ownedDomains??[];await Cm(he,Ue.filter(Pe=>Pe!==oe)),r()}finally{B(!1)}}async function kt(oe,Ue){await gj(oe,Ue),r()}const wt=oe=>!Number.isNaN(Number.parseInt(oe,10)),sn=[{key:"overview",label:"Overview",href:`/projects/${d.project.id}`},{key:"search-console",label:"Search Engine Intelligence",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(He,{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(le,{type:"button",variant:"destructive",disabled:m,onClick:Je,children:m?"Deleting...":"Yes, delete project"}),l.jsx(le,{type:"button",variant:"outline",disabled:m,onClick:()=>p(!1),children:"Cancel"})]})]}):null,l.jsxs("div",{className:"page-header",children:[l.jsxs("div",{className:"page-header-left",children:[l.jsx("h1",{className:"page-title",children:d.project.displayName||d.project.name}),l.jsxs("p",{className:"page-subtitle",children:[d.project.canonicalDomain,(d.project.ownedDomains??[]).length===0&&!Q&&l.jsx("button",{type:"button",className:"ml-2 text-[10px] uppercase tracking-wide text-zinc-600 hover:text-zinc-400 transition-colors",onClick:()=>se(!0),children:"+ add domain"})," "," · ",d.contextLabel]}),l.jsxs("div",{className:"tag-row",children:[l.jsx("span",{className:"tag",children:d.project.country}),l.jsx("span",{className:"tag",children:d.project.language.toUpperCase()}),d.project.tags.map(oe=>l.jsx("span",{className:"tag",children:oe},oe))]}),((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(oe=>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:[oe,l.jsx("button",{type:"button",className:"ml-0.5 text-zinc-500 hover:text-zinc-200 transition-colors",disabled:je,onClick:()=>Kt(oe),"aria-label":`Remove ${oe}`,children:"×"})]},oe)),Q?l.jsxs("span",{className:"inline-flex items-center gap-1",children:[l.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-1.5 py-0.5 text-xs text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none w-40",type:"text",placeholder:"docs.example.com",value:me,onChange:oe=>ze(oe.target.value),onKeyDown:oe=>oe.key==="Enter"&&nn(),autoFocus:!0}),l.jsx(le,{type:"button",size:"sm",disabled:!me.trim()||je,onClick:nn,children:je?"...":"Add"}),l.jsx("button",{type:"button",className:"text-xs text-zinc-500 hover:text-zinc-300",onClick:()=>{se(!1),ze("")},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(le,{type:"button",variant:"outline",size:"icon",onClick:dt,"aria-label":"Export project as YAML",children:l.jsx(l2,{className:"h-4 w-4 text-zinc-400"})}),l.jsx(le,{type:"button",variant:"outline",size:"icon",onClick:()=>p(!0),"aria-label":"Delete project",children:l.jsx(C2,{className:"h-4 w-4 text-zinc-400"})}),l.jsx(le,{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(oe=>l.jsx(gt,{to:oe.href,className:`project-subnav-link ${oe.key===e?"project-subnav-link-active":""}`,"aria-current":oe.key===e?"page":void 0,children:oe.label},oe.key))}),e==="overview"?l.jsxs(l.Fragment,{children:[l.jsxs("section",{className:"gauge-row",children:[l.jsx(ou,{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:wt(d.visibilitySummary.value)}),l.jsx(ou,{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:wt(d.competitorPressure.value)}),l.jsx(ou,{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:wt(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(Ko,{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(oe=>l.jsxs("tr",{children:[l.jsx("td",{children:l.jsxs("div",{className:"flex flex-col items-start gap-0.5",children:[l.jsx(Wo,{provider:oe.provider}),oe.model&&l.jsx("span",{className:"text-[11px] font-mono text-zinc-500",children:oe.model})]})}),l.jsx("td",{children:l.jsxs("span",{className:`font-semibold ${oe.score>=70?"text-emerald-400":oe.score>=40?"text-amber-400":"text-rose-400"}`,children:[oe.score,"%"]})}),l.jsxs("td",{className:"text-zinc-500",children:[oe.cited," of ",oe.total]})]},`${oe.provider}::${oe.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(Z4,{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(oe=>oe.keyword)).size," key phrases tracked"]}),l.jsx(le,{type:"button",variant:"outline",size:"sm",onClick:()=>C(!S),children:S?"Cancel":"+ Add key phrases"})]})]}),S&&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:_,onChange:oe=>E(oe.target.value)}),l.jsxs("div",{className:"mt-2 flex items-center justify-between",children:[l.jsxs("p",{className:"text-xs text-zinc-500",children:[_.split(`
|
|
238
|
+
`).filter(oe=>oe.trim()).length," key phrases"]}),l.jsx(le,{type:"button",size:"sm",disabled:!_.trim()||R,onClick:Wt,children:R?"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 ${T===void 0?"filter-chip-active":""}`,type:"button","aria-pressed":T===void 0,onClick:()=>{ae(void 0)},children:"All locations"}),d.project.locations.map(oe=>de.has(oe.label)&&l.jsx("button",{className:`filter-chip ${T===oe.label?"filter-chip-active":""}`,type:"button","aria-pressed":T===oe.label,onClick:()=>{ae(oe.label),te(!1)},children:oe.label},oe.label)),Ge&&l.jsx("button",{className:`filter-chip ${T===""?"filter-chip-active":""}`,type:"button","aria-pressed":T==="",onClick:()=>{ae(""),te(!1)},children:"No location"}),ge.length>1&&T===void 0&&l.jsx("button",{className:`filter-chip filter-chip-compare ${pe?"filter-chip-active":""}`,type:"button","aria-pressed":pe,onClick:()=>te(oe=>!oe),title:"Side-by-side location comparison",children:"Compare"})]}),l.jsx(z4,{evidence:mt})]}),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(le,{type:"button",variant:"outline",size:"sm",onClick:()=>O(!U),children:U?"Cancel":"+ Add competitor"})]})]}),U&&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:M,onChange:oe=>A(oe.target.value),onKeyDown:oe=>oe.key==="Enter"&&_t()}),l.jsx(le,{type:"button",size:"sm",disabled:!M.trim()||Z,onClick:_t,children:Z?"Adding...":"Add"})]}),l.jsx(E4,{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(oe=>l.jsx(J1,{run:oe},oe.id))})]}),l.jsx(U4,{project:{...d.project,displayName:d.project.displayName??d.project.name,defaultLocation:d.project.defaultLocation??null},onUpdateProject:kt,onRefresh:()=>{r()}}),l.jsx($4,{projectName:d.project.name}),l.jsx(B4,{projectName:d.project.name})]}):e==="analytics"?l.jsx(A4,{projectName:d.project.name}):l.jsxs("div",{className:"space-y-6",children:[l.jsx("h2",{className:"text-lg font-semibold text-zinc-100",children:"Search Engine Intelligence"}),l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[l.jsxs("div",{children:[l.jsx("h3",{className:"text-xs uppercase tracking-wide text-zinc-500 mb-2",children:"Google (Gemini)"}),l.jsx(M4,{projectName:d.project.name})]}),l.jsxs("div",{children:[l.jsx("h3",{className:"text-xs uppercase tracking-wide text-zinc-500 mb-2",children:"Bing (OpenAI)"}),l.jsx(H4,{projectName:d.project.name})]})]})]})]})}const F4="modulepreload",G4=function(e,t){return new URL(e,t).href},Px={},K4=function(t,s,a){let r=Promise.resolve();if(s&&s.length>0){let m=function(b){return Promise.all(b.map(y=>Promise.resolve(y).then(v=>({status:"fulfilled",value:v}),v=>({status:"rejected",reason:v}))))};const d=document.getElementsByTagName("link"),f=document.querySelector("meta[property=csp-nonce]"),p=f?.nonce||f?.getAttribute("nonce");r=m(s.map(b=>{if(b=G4(b,a),b in Px)return;Px[b]=!0;const y=b.endsWith(".css"),v=y?'[rel="stylesheet"]':"";if(a)for(let j=d.length-1;j>=0;j--){const S=d[j];if(S.href===b&&(!y||S.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${b}"]${v}`))return;const x=document.createElement("link");if(x.rel=y?"stylesheet":F4,y||(x.as="script"),x.crossOrigin="",x.href=b,p&&x.setAttribute("nonce",p),document.head.appendChild(x),y)return new Promise((j,S)=>{x.addEventListener("load",j),x.addEventListener("error",()=>S(new Error(`Unable to preload CSS for ${b}`)))})}))}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 V4(){const{dashboard:e}=ka(),t=e?.runs??[],[s,a]=N.useState("all"),r=s==="all"?t:t.filter(d=>d.status===s),c=()=>{K4(async()=>{const{triggerAllRuns:d}=await Promise.resolve().then(()=>jM);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(le,{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","cancelled"].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":$u(d)},d))}),l.jsx("div",{className:"run-list",children:r.length>0?r.map(d=>l.jsx(J1,{run:d},d.id)):l.jsxs(He,{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."})]})})]})]})}function Q4({providerName:e,keyUrl:t,modelHint:s,onSaved:a}){const r=e.toLowerCase()==="local",[c,d]=N.useState(""),[f,p]=N.useState(""),[m,b]=N.useState(""),[y,v]=N.useState(""),[x,j]=N.useState(""),[S,C]=N.useState(""),[_,E]=N.useState(!1),[R,z]=N.useState(null),[U,O]=N.useState(!1),M=r?f.trim().length>0:c.trim().length>0;async function A(){if(M){E(!0),z(null),O(!1);try{const W=je=>{const B=parseInt(je.trim(),10);return Number.isFinite(B)&&B>0?B:void 0},Q={},se=W(y);se!==void 0&&(Q.maxConcurrency=se);const me=W(x);me!==void 0&&(Q.maxRequestsPerMinute=me);const ze=W(S);ze!==void 0&&(Q.maxRequestsPerDay=ze),await wj(e.toLowerCase(),{...c.trim()?{apiKey:c.trim()}:{},...f.trim()?{baseUrl:f.trim()}:{},...m.trim()?{model:m.trim()}:{},...Object.keys(Q).length>0?{quota:Q}:{}}),d(""),p(""),b(""),v(""),j(""),C(""),O(!0),a()}catch(W){z(W instanceof Error?W.message:"Failed to update provider")}finally{E(!1)}}}const Z=s??"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:[r&&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:f,onChange:W=>p(W.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",r?" (optional)":""]}),t&&l.jsxs("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"text-[10px] text-zinc-500 hover:text-zinc-300 underline underline-offset-2",children:["Get API key ","↗"]})]}),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:r?"Optional — most local servers don't need one":`Enter ${e} API key`,value:c,onChange:W=>d(W.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:Z,value:m,onChange:W=>b(W.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:y,onChange:W=>v(W.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:x,onChange:W=>j(W.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:S,onChange:W=>C(W.target.value)}),l.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Per day"})]})]})]}),R&&l.jsx("p",{className:"text-xs text-rose-400",children:R}),U&&l.jsx("p",{className:"text-xs text-emerald-400",children:"Provider updated."}),l.jsx(le,{type:"button",size:"sm",disabled:!M||_,onClick:A,children:_?"Saving...":"Save"})]})}function Y4({onSaved:e}){const[t,s]=N.useState(""),[a,r]=N.useState(""),[c,d]=N.useState(!1),[f,p]=N.useState(null),[m,b]=N.useState(!1),y=t.trim().length>0&&a.trim().length>0;async function v(){if(y){d(!0),p(null),b(!1);try{await jj({clientId:t.trim(),clientSecret:a.trim()}),s(""),r(""),b(!0),e()}catch(x){p(x instanceof Error?x.message:"Failed to update Google OAuth credentials")}finally{d(!1)}}}return l.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3 space-y-2",children:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"google-client-id",children:"Client ID"}),l.jsx("a",{href:"https://console.cloud.google.com/apis/credentials",target:"_blank",rel:"noopener noreferrer",className:"text-[10px] text-zinc-500 hover:text-zinc-300 underline underline-offset-2",children:"Google Cloud \\u2197"})]}),l.jsx("input",{id:"google-client-id",type:"text",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"Google OAuth client ID",value:t,onChange:x=>s(x.target.value)})]}),l.jsxs("div",{children:[l.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"google-client-secret",children:"Client secret"}),l.jsx("input",{id:"google-client-secret",type:"password",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"Google OAuth client secret",value:a,onChange:x=>r(x.target.value)})]}),l.jsxs("p",{className:"text-[11px] text-zinc-500",children:["These credentials are stored in ",l.jsx("code",{children:"~/.canonry/config.yaml"}),". Project-level Search Console connections are created separately per canonical domain."]}),f&&l.jsx("p",{className:"text-xs text-rose-400",children:f}),m&&l.jsx("p",{className:"text-xs text-emerald-400",children:"Google OAuth credentials updated."}),l.jsx(le,{type:"button",size:"sm",disabled:!y||c,onClick:v,children:c?"Saving...":"Save Google OAuth app"})]})}function J4(){const[e,t]=N.useState(null),[s,a]=N.useState(null),[r,c]=N.useState(!1),[d,f]=N.useState("localhost"),[p,m]=N.useState("9222"),[b,y]=N.useState(!1);return N.useEffect(()=>{km().then(t).catch(v=>{const x=v instanceof Error?v.message:String(v);x.includes("501")||a(x)})},[]),l.jsxs(He,{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(lt,{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(v=>l.jsxs("span",{className:"mr-2",children:[v.name,": ",v.alive?"● alive":"○ idle"]},v.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(le,{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 v=>{v.preventDefault(),y(!0);try{await Vj(d,parseInt(p,10)||9222);const x=await km().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:v=>f(v.target.value),"aria-label":"CDP host"}),l.jsx("input",{className:"w-24 rounded border border-zinc-700 bg-zinc-900 px-2 py-1 text-sm text-zinc-100 placeholder-zinc-500 focus:outline-none focus:ring-1 focus:ring-zinc-500",placeholder:"9222",value:p,onChange:v=>m(v.target.value),"aria-label":"CDP port"})]}),l.jsx("div",{children:l.jsx(le,{type:"submit",size:"sm",disabled:b,children:b?"Saving…":"Save endpoint"})})]})]})}const X4={apiStatus:{state:"checking",detail:"Checking service health"},workerStatus:{state:"checking",detail:"Checking service health"}};function W4(){const e=cl(),{dashboard:t}=ka(),s=t?.settings??e?.dashboard?.settings,c=Yu(!e,e?.health).data??e?.health??X4,[d,f]=N.useState(null),[p,m]=N.useState(!1),[b,y]=N.useState(!1),[v,x]=N.useState(""),[j,S]=N.useState(!1),[C,_]=N.useState(null),[E,R]=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, Bing WMT setup, and service health."})]})}),l.jsxs("section",{className:"settings-grid",children:[s.providerStatuses.map(z=>l.jsxs(He,{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:z.displayName??z.name})]}),l.jsx(lt,{tone:z.state==="ready"?"positive":"caution",children:z.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:z.model})]}),z.quota&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{children:[l.jsx("dt",{children:"Concurrency"}),l.jsx("dd",{children:z.quota.maxConcurrency})]}),l.jsxs("div",{children:[l.jsx("dt",{children:"Rate limit"}),l.jsxs("dd",{children:[z.quota.maxRequestsPerMinute,"/min · ",z.quota.maxRequestsPerDay,"/day"]})]})]})]}),l.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:z.detail}),l.jsx("div",{className:"mt-2",children:l.jsx(le,{type:"button",variant:"outline",size:"sm",onClick:()=>f(d===z.name?null:z.name),children:d===z.name?"Cancel":z.state==="ready"?z.name.toLowerCase()==="local"?"Update config":"Update key":"Configure"})}),d===z.name&&l.jsx(Q4,{providerName:z.name,keyUrl:z.keyUrl,modelHint:z.modelHint,onSaved:()=>{f(null)}})]},z.name)),l.jsxs(He,{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(lt,{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(le,{type:"button",variant:"outline",size:"sm",onClick:()=>m(!p),children:p?"Cancel":s.google.state==="ready"?"Update OAuth app":"Configure Google OAuth"})}),p&&l.jsx(Y4,{onSaved:()=>{m(!1)}})]}),l.jsxs(He,{className:"surface-card",children:[l.jsxs("div",{className:"section-head",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Bing"}),l.jsx("h2",{children:"Webmaster Tools"})]}),l.jsx(lt,{tone:s.bing.state==="ready"?"positive":"caution",children:s.bing.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:"API key authentication — no OAuth needed"})]}),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.bing.detail}),l.jsx("div",{className:"mt-2",children:l.jsx(le,{type:"button",variant:"outline",size:"sm",onClick:()=>y(!b),children:b?"Cancel":s.bing.state==="ready"?"Update API key":"Configure Bing"})}),b&&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:"bing-api-key",children:"API Key"}),l.jsx("a",{href:"https://www.bing.com/webmasters/",target:"_blank",rel:"noopener noreferrer",className:"text-[10px] text-zinc-500 hover:text-zinc-300 underline underline-offset-2",children:"Bing Webmaster Tools"})]}),l.jsx("input",{id:"bing-api-key",type:"password",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"Bing Webmaster Tools API key",value:v,onChange:z=>x(z.target.value)})]}),l.jsxs("p",{className:"text-[11px] text-zinc-500",children:["This key is stored in ",l.jsx("code",{children:"~/.canonry/config.yaml"}),". Project-level Bing connections are created separately per canonical domain."]}),C&&l.jsx("p",{className:"text-xs text-rose-400",children:C}),E&&l.jsx("p",{className:"text-xs text-emerald-400",children:"Bing API key updated."}),l.jsx(le,{type:"button",size:"sm",disabled:!v.trim()||j,onClick:async()=>{if(v.trim()){S(!0),_(null),R(!1);try{await i1(v.trim()),x(""),R(!0),y(!1)}catch(z){_(z instanceof Error?z.message:"Failed to update Bing API key")}finally{S(!1)}}},children:j?"Saving...":"Save Bing API key"})]})]}),l.jsx(J4,{}),l.jsxs(He,{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(lt,{tone:xu(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(lt,{tone:xu(c.workerStatus),children:c.workerStatus.state==="ok"?"Healthy":"Attention"})]})]})]})]}),l.jsx("section",{className:"page-section",children:l.jsxs(He,{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(z=>l.jsx("li",{children:z},z))}),l.jsx("p",{className:"supporting-copy",children:s.bootstrapNote})]})})]}):null}const e3=Qu(),t3=[{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 n3({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 s3(){const e=cl(),{dashboard:t,refetch:s}=ka(),a=t??e?.dashboard??e3.dashboard,r=a.settings,f=Yu(!e,e?.health).data??e?.health??{apiStatus:{label:"API",state:"checking",detail:"Checking service health"},workerStatus:{label:"Worker",state:"checking",detail:"Checking service health"}},p=d5(a.setup,f,r),m=ja(),[b,y]=N.useState(0),[v,x]=N.useState(""),[j,S]=N.useState(""),[C,_]=N.useState(""),[E,R]=N.useState("US"),[z,U]=N.useState("en"),[O,M]=N.useState(null),[A,Z]=N.useState(null),[W,Q]=N.useState(null),[se,me]=N.useState(!1),[ze,je]=N.useState(""),[B,T]=N.useState(!1),[ae,pe]=N.useState(null),[te,L]=N.useState(!1),G=r.providerStatuses.filter(ne=>ne.state==="ready"),[ie,re]=N.useState(G[0]?.name??""),[ce,he]=N.useState(5),[de,Ge]=N.useState(!1),[ge,Xe]=N.useState(null),[mt,fe]=N.useState(""),[Je,dt]=N.useState(!1),[Wt,_t]=N.useState(null),[nn,Kt]=N.useState(!1),[kt,wt]=N.useState(!1),[sn,oe]=N.useState(null),[Ue,Pe]=N.useState(!1),ke=v.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),Te=ze.split(`
|
|
239
|
+
`).map(ne=>ne.trim()).filter(Boolean),zt=mt.split(`
|
|
240
|
+
`).map(ne=>ne.trim()).filter(Boolean),Qn=p.healthChecks.some(ne=>ne.id==="api"&&ne.state==="ready"),bs=async()=>{if(!(!ke||!C)){me(!0),Q(null);try{const ne=await ll(ke,{displayName:j||v,canonicalDomain:C,country:E,language:z});M(ke),Z(ne.id),s(),y(2)}catch(ne){Q(ne instanceof Error?ne.message:"Failed to create project")}finally{me(!1)}}},Fs=async()=>{if(!O)return;const ne=Te;if(ne.length!==0){L(!0),pe(null);try{await mj(O,ne),T(!0),s(),y(3)}catch($e){pe($e instanceof Error?$e.message:"Failed to save key phrases")}finally{L(!1)}}},xs=async()=>{if(!(!O||!ie)){Ge(!0),Xe(null);try{const ne=await Rj(O,ie,ce);if(ne.keywords.length>0){const $e=ze?ze.trimEnd()+`
|
|
241
|
+
`+ne.keywords.join(`
|
|
242
|
+
`):ne.keywords.join(`
|
|
243
|
+
`);je($e)}}catch(ne){Xe(ne instanceof Error?ne.message:"Failed to generate key phrases")}finally{Ge(!1)}}},Gs=async()=>{if(!O)return;const ne=zt;if(ne.length!==0){Kt(!0),_t(null);try{await Np(O,ne),dt(!0),s(),y(4)}catch($e){_t($e instanceof Error?$e.message:"Failed to save competitors")}finally{Kt(!1)}}},os=async()=>{if(O){Pe(!0),oe(null);try{await Cp(O),wt(!0),s()}catch(ne){oe(ne instanceof Error?ne.message:"Failed to trigger run")}finally{Pe(!1)}}},Ce=()=>y(ne=>Math.max(0,ne-1)),wn=(()=>{switch(b){case 0:return l.jsxs(He,{className:"surface-card step-card",children:[l.jsx("div",{className:"section-head",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 1 of 5"}),l.jsx("h2",{children:"System ready"})]})}),l.jsx("p",{className:"supporting-copy",children:"Checking that your Canonry instance is configured and reachable."}),l.jsx("div",{className:"compact-stack",children:p.healthChecks.map(ne=>l.jsxs("div",{className:"health-check-row",children:[l.jsxs("div",{children:[l.jsx("p",{className:"run-row-title",children:ne.label}),l.jsx("p",{className:"supporting-copy",children:ne.detail}),ne.id==="provider"&&ne.state!=="ready"&&l.jsx(gt,{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(lt,{tone:ne.state==="ready"?"positive":"caution",children:ne.state==="ready"?"Ready":"Attention"})]},ne.id))}),l.jsxs("div",{className:"setup-nav",children:[l.jsx("span",{}),l.jsx(le,{type:"button",disabled:!Qn,onClick:()=>y(1),children:"Continue"})]})]});case 1:return l.jsxs(He,{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"})]}),O?l.jsx(lt,{tone:"positive",children:"Created"}):null]}),O?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:O})," created successfully."]}),l.jsxs("div",{className:"setup-nav",children:[l.jsx(le,{type:"button",variant:"outline",onClick:Ce,children:"Back"}),l.jsx(le,{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:v,onChange:ne=>x(ne.target.value)}),ke&&ke!==v?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:ne=>S(ne.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:C,onChange:ne=>_(ne.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:ne=>R(ne.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:ne=>U(ne.target.value.toLowerCase())})]})]}),W?l.jsx("p",{className:"text-rose-400 text-sm",children:W}):null,l.jsxs("div",{className:"setup-nav",children:[l.jsx(le,{type:"button",variant:"outline",onClick:Ce,children:"Back"}),l.jsx(le,{type:"button",disabled:!ke||!C||se,onClick:bs,children:se?"Creating...":"Create project"})]})]})]});case 2:return l.jsxs(He,{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"})]}),B?l.jsxs(lt,{tone:"positive",children:[Te.length," saved"]}):l.jsxs(lt,{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."}),B?l.jsxs("div",{className:"compact-stack",children:[l.jsx("ul",{className:"detail-list",children:Te.map(ne=>l.jsx("li",{children:ne},ne))}),l.jsxs("div",{className:"setup-nav",children:[l.jsx(le,{type:"button",variant:"outline",onClick:Ce,children:"Back"}),l.jsx(le,{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:ie,onChange:ne=>re(ne.target.value),children:G.map(ne=>l.jsxs("option",{value:ne.name,children:[ne.displayName??ne.name,ne.model?` (${ne.model})`:""]},ne.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:ce,onChange:ne=>he(Number(ne.target.value)),children:[3,5,10,15,20].map(ne=>l.jsx("option",{value:ne,children:ne},ne))})]}),l.jsx(le,{type:"button",variant:"outline",disabled:de||!ie,onClick:xs,children:de?"Analyzing site...":"Generate"})]}),ge?l.jsx("p",{className:"text-rose-400 text-sm",children:ge}):null]}):null,l.jsxs("div",{className:"flex items-center gap-2 text-zinc-500 text-xs uppercase tracking-wide",children:[l.jsx("span",{className:"flex-1 border-t border-zinc-800"}),"or type manually",l.jsx("span",{className:"flex-1 border-t border-zinc-800"})]}),l.jsxs("div",{className:"setup-field",children:[l.jsx("label",{className:"setup-label",htmlFor:"keywords",children:"Key phrases (one per line)"}),l.jsx("textarea",{id:"keywords",className:"setup-textarea",rows:6,placeholder:`emergency dentist brooklyn
|
|
244
|
+
best invisalign downtown brooklyn
|
|
245
|
+
pediatric dentist brooklyn heights`,value:ze,onChange:ne=>je(ne.target.value)})]}),ae?l.jsx("p",{className:"text-rose-400 text-sm",children:ae}):null,l.jsxs("div",{className:"setup-nav",children:[l.jsx(le,{type:"button",variant:"outline",onClick:Ce,children:"Back"}),l.jsx(le,{type:"button",disabled:Te.length===0||te,onClick:Fs,children:te?"Saving...":`Save ${Te.length} key phrase${Te.length!==1?"s":""}`})]})]})]});case 3:return l.jsxs(He,{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"})]}),Je?l.jsx(lt,{tone:"positive",children:"Saved"}):null]}),l.jsx("p",{className:"supporting-copy",children:"Domains that compete for the same key phrases. One per line."}),Je?l.jsxs("div",{className:"compact-stack",children:[l.jsx("ul",{className:"detail-list",children:zt.map(ne=>l.jsx("li",{children:ne},ne))}),l.jsxs("div",{className:"setup-nav",children:[l.jsx(le,{type:"button",variant:"outline",onClick:Ce,children:"Back"}),l.jsx(le,{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:mt,onChange:ne=>fe(ne.target.value)})]}),Wt?l.jsx("p",{className:"text-rose-400 text-sm",children:Wt}):null,l.jsxs("div",{className:"setup-nav",children:[l.jsx(le,{type:"button",variant:"outline",onClick:Ce,children:"Back"}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx(le,{type:"button",variant:"outline",onClick:()=>y(4),children:"Skip"}),l.jsx(le,{type:"button",disabled:zt.length===0||nn,onClick:Gs,children:nn?"Saving...":`Save ${zt.length} competitor${zt.length!==1?"s":""}`})]})]})]})]});case 4:return l.jsxs(He,{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"})]}),kt?l.jsx(lt,{tone:"positive",children:"Queued"}):null]}),kt?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(le,{type:"button",onClick:()=>m({to:A?`/projects/${A}`:"/"}),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:O}),"."]}),sn?l.jsx("p",{className:"text-rose-400 text-sm",children:sn}):null,l.jsxs("div",{className:"setup-nav",children:[l.jsx(le,{type:"button",variant:"outline",onClick:Ce,children:"Back"}),l.jsx(le,{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(n3,{current:b,labels:t3}),l.jsx("section",{className:"setup-wizard",children:wn})]})}function i3(){return l.jsx("div",{className:"page-container",children:l.jsx("section",{className:"page-section",children:l.jsxs(He,{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(le,{asChild:!0,children:l.jsx(gt,{to:"/",children:"Return to overview"})})]})})})}function a3(){return l.jsx(n5,{children:l.jsx(t5,{})})}const ss=Mz()({component:a3,validateSearch:e=>({runId:typeof e.runId=="string"?e.runId:void 0,evidenceId:typeof e.evidenceId=="string"?e.evidenceId:void 0})}),r3=is({getParentRoute:()=>ss,path:"/",component:m5,beforeLoad:({context:e})=>{const t=e.queryClient.getQueryData(Ei.projects.all);if(t&&t.length===0)throw Km({to:"/setup"})}}),o3=is({getParentRoute:()=>ss,path:"/projects",component:_4}),od=is({getParentRoute:()=>ss,path:"/projects/$projectId",component:()=>l.jsx(sp,{})}),l3=is({getParentRoute:()=>od,path:"/",component:()=>l.jsx(Fp,{tab:"overview"})}),c3=is({getParentRoute:()=>od,path:"/search-console",component:()=>l.jsx(Fp,{tab:"search-console"})}),u3=is({getParentRoute:()=>od,path:"/analytics",component:()=>l.jsx(Fp,{tab:"analytics"})}),d3=is({getParentRoute:()=>ss,path:"/runs",component:V4}),f3=is({getParentRoute:()=>ss,path:"/settings",component:W4,beforeLoad:({context:e})=>{}}),h3=is({getParentRoute:()=>ss,path:"/setup",component:s3,beforeLoad:({context:e})=>{const t=e.queryClient.getQueryData(Ei.projects.all);if(t&&t.length>0)throw Km({to:"/"})}}),m3=is({getParentRoute:()=>ss,path:"*",component:i3}),p3=ss.addChildren([r3,o3,od.addChildren([l3,c3,u3]),d3,f3,h3,m3]);function g3(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath:"/"}const $x=g3(),y3=$x==="/"?"":$x.replace(/\/$/,"");function v3(e,t){return Gz({routeTree:p3,basepath:y3||"/",context:{queryClient:e},...t?.initialEntries})}const b3={negative:"border-rose-700/60 bg-rose-950/80 text-rose-200",caution:"border-amber-700/60 bg-amber-950/80 text-amber-200",positive:"border-emerald-700/60 bg-emerald-950/80 text-emerald-200",neutral:"border-zinc-700/60 bg-zinc-900/80 text-zinc-200"};function x3(){const e=N.useSyncExternalStore(Wz,_b,_b),t=N.useCallback(s=>{CS(s)},[]);return e.length===0?null:l.jsx("div",{"aria-live":"polite","aria-label":"Notifications",className:"fixed bottom-4 right-4 z-50 flex flex-col gap-2 max-w-sm",children:e.map(s=>l.jsxs("div",{role:"alert",className:`flex items-start gap-2 rounded-lg border px-3 py-2.5 text-sm shadow-lg backdrop-blur-sm animate-in slide-in-from-bottom-2 ${b3[s.tone]}`,children:[l.jsx("p",{className:"flex-1 leading-snug",children:s.message}),l.jsx("button",{type:"button",onClick:()=>t(s.id),className:"shrink-0 rounded p-0.5 opacity-60 hover:opacity-100 transition-opacity","aria-label":"Dismiss",children:l.jsx(Pu,{className:"size-3.5"})})]},s.id))})}const W1=e2(),S3=v3(W1),eN=document.getElementById("root");if(!eN)throw new Error("Expected #root element for web app bootstrap.");v_.createRoot(eN).render(l.jsx(N.StrictMode,{children:l.jsxs(H_,{client:W1,children:[l.jsx(Qz,{router:S3}),l.jsx(x3,{})]})}));
|