@ainyc/canonry 1.21.1 → 1.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,246 +0,0 @@
1
- function ok(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 qx(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var gh={exports:{}},To={};var Ov;function lk(){if(Ov)return To;Ov=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 To.Fragment=t,To.jsx=s,To.jsxs=s,To}var Dv;function ck(){return Dv||(Dv=1,gh.exports=lk()),gh.exports}var l=ck(),yh={exports:{}},Ee={};var Lv;function uk(){if(Lv)return Ee;Lv=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),d=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),b=Symbol.iterator;function x(D){return D===null||typeof D!="object"?null:(D=b&&D[b]||D["@@iterator"],typeof D=="function"?D:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,C={};function k(D,G,se){this.props=D,this.context=G,this.refs=C,this.updater=se||w}k.prototype.isReactComponent={},k.prototype.setState=function(D,G){if(typeof D!="object"&&typeof D!="function"&&D!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,D,G,"setState")},k.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function E(){}E.prototype=k.prototype;function A(D,G,se){this.props=D,this.context=G,this.refs=C,this.updater=se||w}var z=A.prototype=new E;z.constructor=A,S(z,k.prototype),z.isPureReactComponent=!0;var M=Array.isArray;function U(){}var R={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function q(D,G,se){var oe=se.ref;return{$$typeof:e,type:D,key:G,ref:oe!==void 0?oe:null,props:se}}function W(D,G){return q(D.type,G,D.props)}function Q(D){return typeof D=="object"&&D!==null&&D.$$typeof===e}function ne(D){var G={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(se){return G[se]})}var me=/\/+/g;function ke(D,G){return typeof D=="object"&&D!==null&&D.key!=null?ne(""+D.key):G.toString(36)}function je(D){switch(D.status){case"fulfilled":return D.value;case"rejected":throw D.reason;default:switch(typeof D.status=="string"?D.then(U,U):(D.status="pending",D.then(function(G){D.status==="pending"&&(D.status="fulfilled",D.value=G)},function(G){D.status==="pending"&&(D.status="rejected",D.reason=G)})),D.status){case"fulfilled":return D.value;case"rejected":throw D.reason}}throw D}function B(D,G,se,oe,ce){var he=typeof D;(he==="undefined"||he==="boolean")&&(D=null);var de=!1;if(D===null)de=!0;else switch(he){case"bigint":case"string":case"number":de=!0;break;case"object":switch(D.$$typeof){case e:case t:de=!0;break;case v:return de=D._init,B(de(D._payload),G,se,oe,ce)}}if(de)return ce=ce(D),de=oe===""?"."+ke(D,0):oe,M(ce)?(se="",de!=null&&(se=de.replace(me,"$&/")+"/"),B(ce,G,se,"",function(Je){return Je})):ce!=null&&(Q(ce)&&(ce=W(ce,se+(ce.key==null||D&&D.key===ce.key?"":(""+ce.key).replace(me,"$&/")+"/")+de)),G.push(ce)),1;de=0;var Fe=oe===""?".":oe+":";if(M(D))for(var ge=0;ge<D.length;ge++)oe=D[ge],he=Fe+ke(oe,ge),de+=B(oe,G,se,he,ce);else if(ge=x(D),typeof ge=="function")for(D=ge.call(D),ge=0;!(oe=D.next()).done;)oe=oe.value,he=Fe+ke(oe,ge++),de+=B(oe,G,se,he,ce);else if(he==="object"){if(typeof D.then=="function")return B(je(D),G,se,oe,ce);throw G=String(D),Error("Objects are not valid as a React child (found: "+(G==="[object Object]"?"object with keys {"+Object.keys(D).join(", ")+"}":G)+"). If you meant to render a collection of children, use an array instead.")}return de}function O(D,G,se){if(D==null)return D;var oe=[],ce=0;return B(D,oe,"","",function(he){return G.call(se,he,ce++)}),oe}function ae(D){if(D._status===-1){var G=D._result;G=G(),G.then(function(se){(D._status===0||D._status===-1)&&(D._status=1,D._result=se)},function(se){(D._status===0||D._status===-1)&&(D._status=2,D._result=se)}),D._status===-1&&(D._status=0,D._result=G)}if(D._status===1)return D._result.default;throw D._result}var pe=typeof reportError=="function"?reportError:function(D){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var G=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof D=="object"&&D!==null&&typeof D.message=="string"?String(D.message):String(D),error:D});if(!window.dispatchEvent(G))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",D);return}console.error(D)},te={map:O,forEach:function(D,G,se){O(D,function(){G.apply(this,arguments)},se)},count:function(D){var G=0;return O(D,function(){G++}),G},toArray:function(D){return O(D,function(G){return G})||[]},only:function(D){if(!Q(D))throw Error("React.Children.only expected to receive a single React element child.");return D}};return Ee.Activity=y,Ee.Children=te,Ee.Component=k,Ee.Fragment=s,Ee.Profiler=r,Ee.PureComponent=A,Ee.StrictMode=a,Ee.Suspense=p,Ee.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=R,Ee.__COMPILER_RUNTIME={__proto__:null,c:function(D){return R.H.useMemoCache(D)}},Ee.cache=function(D){return function(){return D.apply(null,arguments)}},Ee.cacheSignal=function(){return null},Ee.cloneElement=function(D,G,se){if(D==null)throw Error("The argument must be a React element, but you passed "+D+".");var oe=S({},D.props),ce=D.key;if(G!=null)for(he in G.key!==void 0&&(ce=""+G.key),G)!T.call(G,he)||he==="key"||he==="__self"||he==="__source"||he==="ref"&&G.ref===void 0||(oe[he]=G[he]);var he=arguments.length-2;if(he===1)oe.children=se;else if(1<he){for(var de=Array(he),Fe=0;Fe<he;Fe++)de[Fe]=arguments[Fe+2];oe.children=de}return q(D.type,ce,oe)},Ee.createContext=function(D){return D={$$typeof:d,_currentValue:D,_currentValue2:D,_threadCount:0,Provider:null,Consumer:null},D.Provider=D,D.Consumer={$$typeof:c,_context:D},D},Ee.createElement=function(D,G,se){var oe,ce={},he=null;if(G!=null)for(oe in G.key!==void 0&&(he=""+G.key),G)T.call(G,oe)&&oe!=="key"&&oe!=="__self"&&oe!=="__source"&&(ce[oe]=G[oe]);var de=arguments.length-2;if(de===1)ce.children=se;else if(1<de){for(var Fe=Array(de),ge=0;ge<de;ge++)Fe[ge]=arguments[ge+2];ce.children=Fe}if(D&&D.defaultProps)for(oe in de=D.defaultProps,de)ce[oe]===void 0&&(ce[oe]=de[oe]);return q(D,he,ce)},Ee.createRef=function(){return{current:null}},Ee.forwardRef=function(D){return{$$typeof:f,render:D}},Ee.isValidElement=Q,Ee.lazy=function(D){return{$$typeof:v,_payload:{_status:-1,_result:D},_init:ae}},Ee.memo=function(D,G){return{$$typeof:m,type:D,compare:G===void 0?null:G}},Ee.startTransition=function(D){var G=R.T,se={};R.T=se;try{var oe=D(),ce=R.S;ce!==null&&ce(se,oe),typeof oe=="object"&&oe!==null&&typeof oe.then=="function"&&oe.then(U,pe)}catch(he){pe(he)}finally{G!==null&&se.types!==null&&(G.types=se.types),R.T=G}},Ee.unstable_useCacheRefresh=function(){return R.H.useCacheRefresh()},Ee.use=function(D){return R.H.use(D)},Ee.useActionState=function(D,G,se){return R.H.useActionState(D,G,se)},Ee.useCallback=function(D,G){return R.H.useCallback(D,G)},Ee.useContext=function(D){return R.H.useContext(D)},Ee.useDebugValue=function(){},Ee.useDeferredValue=function(D,G){return R.H.useDeferredValue(D,G)},Ee.useEffect=function(D,G){return R.H.useEffect(D,G)},Ee.useEffectEvent=function(D){return R.H.useEffectEvent(D)},Ee.useId=function(){return R.H.useId()},Ee.useImperativeHandle=function(D,G,se){return R.H.useImperativeHandle(D,G,se)},Ee.useInsertionEffect=function(D,G){return R.H.useInsertionEffect(D,G)},Ee.useLayoutEffect=function(D,G){return R.H.useLayoutEffect(D,G)},Ee.useMemo=function(D,G){return R.H.useMemo(D,G)},Ee.useOptimistic=function(D,G){return R.H.useOptimistic(D,G)},Ee.useReducer=function(D,G,se){return R.H.useReducer(D,G,se)},Ee.useRef=function(D){return R.H.useRef(D)},Ee.useState=function(D){return R.H.useState(D)},Ee.useSyncExternalStore=function(D,G,se){return R.H.useSyncExternalStore(D,G,se)},Ee.useTransition=function(){return R.H.useTransition()},Ee.version="19.2.4",Ee}var Mv;function rl(){return Mv||(Mv=1,yh.exports=uk()),yh.exports}var N=rl();const ss=qx(N),Um=ok({__proto__:null,default:ss},[N]);var vh={exports:{}},Oo={},bh={exports:{}},xh={};var Uv;function dk(){return Uv||(Uv=1,(function(e){function t(B,O){var ae=B.length;B.push(O);e:for(;0<ae;){var pe=ae-1>>>1,te=B[pe];if(0<r(te,O))B[pe]=O,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 O=B[0],ae=B.pop();if(ae!==O){B[0]=ae;e:for(var pe=0,te=B.length,D=te>>>1;pe<D;){var G=2*(pe+1)-1,se=B[G],oe=G+1,ce=B[oe];if(0>r(se,ae))oe<te&&0>r(ce,se)?(B[pe]=ce,B[oe]=ae,pe=oe):(B[pe]=se,B[G]=ae,pe=G);else if(oe<te&&0>r(ce,ae))B[pe]=ce,B[oe]=ae,pe=oe;else break e}}return O}function r(B,O){var ae=B.sortIndex-O.sortIndex;return ae!==0?ae:B.id-O.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var d=Date,f=d.now();e.unstable_now=function(){return d.now()-f}}var p=[],m=[],v=1,y=null,b=3,x=!1,w=!1,S=!1,C=!1,k=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,A=typeof setImmediate<"u"?setImmediate:null;function z(B){for(var O=s(m);O!==null;){if(O.callback===null)a(m);else if(O.startTime<=B)a(m),O.sortIndex=O.expirationTime,t(p,O);else break;O=s(m)}}function M(B){if(S=!1,z(B),!w)if(s(p)!==null)w=!0,U||(U=!0,ne());else{var O=s(m);O!==null&&je(M,O.startTime-B)}}var U=!1,R=-1,T=5,q=-1;function W(){return C?!0:!(e.unstable_now()-q<T)}function Q(){if(C=!1,U){var B=e.unstable_now();q=B;var O=!0;try{e:{w=!1,S&&(S=!1,E(R),R=-1),x=!0;var ae=b;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,b=y.priorityLevel;var te=pe(y.expirationTime<=B);if(B=e.unstable_now(),typeof te=="function"){y.callback=te,z(B),O=!0;break t}y===s(p)&&a(p),z(B)}else a(p);y=s(p)}if(y!==null)O=!0;else{var D=s(m);D!==null&&je(M,D.startTime-B),O=!1}}break e}finally{y=null,b=ae,x=!1}O=void 0}}finally{O?ne():U=!1}}}var ne;if(typeof A=="function")ne=function(){A(Q)};else if(typeof MessageChannel<"u"){var me=new MessageChannel,ke=me.port2;me.port1.onmessage=Q,ne=function(){ke.postMessage(null)}}else ne=function(){k(Q,0)};function je(B,O){R=k(function(){B(e.unstable_now())},O)}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"):T=0<B?Math.floor(1e3/B):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_next=function(B){switch(b){case 1:case 2:case 3:var O=3;break;default:O=b}var ae=b;b=O;try{return B()}finally{b=ae}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(B,O){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var ae=b;b=B;try{return O()}finally{b=ae}},e.unstable_scheduleCallback=function(B,O,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:v++,callback:O,priorityLevel:B,startTime:ae,expirationTime:te,sortIndex:-1},ae>pe?(B.sortIndex=ae,t(m,B),s(p)===null&&B===s(m)&&(S?(E(R),R=-1):S=!0,je(M,ae-pe))):(B.sortIndex=te,t(p,B),w||x||(w=!0,U||(U=!0,ne()))),B},e.unstable_shouldYield=W,e.unstable_wrapCallback=function(B){var O=b;return function(){var ae=b;b=O;try{return B.apply(this,arguments)}finally{b=ae}}}})(xh)),xh}var $v;function fk(){return $v||($v=1,bh.exports=dk()),bh.exports}var Sh={exports:{}},tn={};var Pv;function hk(){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 v=2;v<arguments.length;v++)m+="&args[]="+encodeURIComponent(arguments[v])}return"Minified React error #"+p+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(){}var a={d:{f:s,r:function(){throw Error(t(522))},D:s,C:s,L:s,m:s,X:s,S:s,M:s},p:0,findDOMNode:null},r=Symbol.for("react.portal");function c(p,m,v){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:r,key:y==null?null:""+y,children:p,containerInfo:m,implementation:v}}var d=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(p,m){if(p==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return tn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,tn.createPortal=function(p,m){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(t(299));return c(p,m,null,v)},tn.flushSync=function(p){var m=d.T,v=a.p;try{if(d.T=null,a.p=2,p)return p()}finally{d.T=m,a.p=v,a.d.f()}},tn.preconnect=function(p,m){typeof p=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,a.d.C(p,m))},tn.prefetchDNS=function(p){typeof p=="string"&&a.d.D(p)},tn.preinit=function(p,m){if(typeof p=="string"&&m&&typeof m.as=="string"){var v=m.as,y=f(v,m.crossOrigin),b=typeof m.integrity=="string"?m.integrity:void 0,x=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;v==="style"?a.d.S(p,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:y,integrity:b,fetchPriority:x}):v==="script"&&a.d.X(p,{crossOrigin:y,integrity:b,fetchPriority:x,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},tn.preinitModule=function(p,m){if(typeof p=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var v=f(m.as,m.crossOrigin);a.d.M(p,{crossOrigin:v,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&a.d.M(p)},tn.preload=function(p,m){if(typeof p=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var v=m.as,y=f(v,m.crossOrigin);a.d.L(p,v,{crossOrigin:y,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,type:typeof m.type=="string"?m.type:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0,referrerPolicy:typeof m.referrerPolicy=="string"?m.referrerPolicy:void 0,imageSrcSet:typeof m.imageSrcSet=="string"?m.imageSrcSet:void 0,imageSizes:typeof m.imageSizes=="string"?m.imageSizes:void 0,media:typeof m.media=="string"?m.media:void 0})}},tn.preloadModule=function(p,m){if(typeof p=="string")if(m){var v=f(m.as,m.crossOrigin);a.d.m(p,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:v,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else a.d.m(p)},tn.requestFormReset=function(p){a.d.r(p)},tn.unstable_batchedUpdates=function(p,m){return p(m)},tn.useFormState=function(p,m,v){return d.H.useFormState(p,m,v)},tn.useFormStatus=function(){return d.H.useHostTransitionStatus()},tn.version="19.2.4",tn}var Iv;function Hx(){if(Iv)return Sh.exports;Iv=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=hk(),Sh.exports}var Bv;function mk(){if(Bv)return Oo;Bv=1;var e=fk(),t=rl(),s=Hx();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 j=!1,_=h.child;_;){if(_===o){j=!0,o=h,u=g;break}if(_===u){j=!0,u=h,o=g;break}_=_.sibling}if(!j){for(_=g.child;_;){if(_===o){j=!0,o=g,u=h;break}if(_===u){j=!0,u=g,o=h;break}_=_.sibling}if(!j)throw Error(a(189))}}if(o.alternate!==u)throw Error(a(190))}if(o.tag!==3)throw Error(a(188));return o.stateNode.current===o?n:i}function v(n){var i=n.tag;if(i===5||i===26||i===27||i===6)return n;for(n=n.child;n!==null;){if(i=v(n),i!==null)return i;n=n.sibling}return null}var y=Object.assign,b=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),A=Symbol.for("react.context"),z=Symbol.for("react.forward_ref"),M=Symbol.for("react.suspense"),U=Symbol.for("react.suspense_list"),R=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),q=Symbol.for("react.activity"),W=Symbol.for("react.memo_cache_sentinel"),Q=Symbol.iterator;function ne(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 ke(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 k:return"Profiler";case C:return"StrictMode";case M:return"Suspense";case U:return"SuspenseList";case q:return"Activity"}if(typeof n=="object")switch(n.$$typeof){case w:return"Portal";case A: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 R:return i=n.displayName||null,i!==null?i:ke(n.type)||"Memo";case T:i=n._payload,n=n._init;try{return ke(n(i))}catch{}}return null}var je=Array.isArray,B=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,O=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 D(n){return{current:n}}function G(n){0>te||(n.current=pe[te],pe[te]=null,te--)}function se(n,i){te++,pe[te]=n.current,n.current=i}var oe=D(null),ce=D(null),he=D(null),de=D(null);function Fe(n,i){switch(se(he,i),se(ce,n),se(oe,null),i.nodeType){case 9:case 11:n=(n=i.documentElement)&&(n=n.namespaceURI)?nv(n):0;break;default:if(n=i.tagName,i=i.namespaceURI)i=nv(i),n=sv(i,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}G(oe),se(oe,n)}function ge(){G(oe),G(ce),G(he)}function Je(n){n.memoizedState!==null&&se(de,n);var i=oe.current,o=sv(i,n.type);i!==o&&(se(ce,n),se(oe,o))}function mt(n){ce.current===n&&(G(oe),G(ce)),de.current===n&&(G(de),zo._currentValue=ae)}var fe,Xe;function ct(n){if(fe===void 0)try{throw Error()}catch(o){var i=o.stack.trim().match(/\n( *(at )?)/);fe=i&&i[1]||"",Xe=-1<o.stack.indexOf(`
2
- at`)?" (<anonymous>)":-1<o.stack.indexOf("@")?"@unknown:0:0":""}return`
3
- `+fe+n+Xe}var nn=!1;function _t(n,i){if(!n||nn)return"";nn=!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(),j=g[0],_=g[1];if(j&&_){var L=j.split(`
4
- `),Z=_.split(`
5
- `);for(h=u=0;u<L.length&&!L[u].includes("DetermineComponentFrameRoot");)u++;for(;h<Z.length&&!Z[h].includes("DetermineComponentFrameRoot");)h++;if(u===L.length||h===Z.length)for(u=L.length-1,h=Z.length-1;1<=u&&0<=h&&L[u]!==Z[h];)h--;for(;1<=u&&0<=h;u--,h--)if(L[u]!==Z[h]){if(u!==1||h!==1)do if(u--,h--,0>h||L[u]!==Z[h]){var Y=`
6
- `+L[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{nn=!1,Error.prepareStackTrace=o}return(o=n?n.displayName||n.name:"")?ct(o):""}function sn(n,i){switch(n.tag){case 26:case 27:case 5:return ct(n.type);case 16:return ct("Lazy");case 13:return n.child!==i&&i!==null?ct("Suspense Fallback"):ct("Suspense");case 19:return ct("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 ct("Activity");default:return""}}function Vt(n){try{var i="",o=null;do i+=sn(n,o),o=n,n=n.return;while(n);return i}catch(u){return`
7
- Error generating stack: `+u.message+`
8
- `+u.stack}}var zt=Object.prototype.hasOwnProperty,xt=e.unstable_scheduleCallback,hn=e.unstable_cancelCallback,re=e.unstable_shouldYield,$e=e.unstable_requestPaint,Pe=e.unstable_now,ze=e.unstable_getCurrentPriorityLevel,De=e.unstable_ImmediatePriority,pt=e.unstable_UserBlockingPriority,an=e.unstable_NormalPriority,Ss=e.unstable_LowPriority,Ks=e.unstable_IdlePriority,js=e.log,Vs=e.unstable_setDisableYieldValue,ls=null,_e=null;function Ht(n){if(typeof js=="function"&&Vs(n),_e&&typeof _e.setStrictMode=="function")try{_e.setStrictMode(ls,n)}catch{}}var Ge=Math.clz32?Math.clz32:pl,ie=Math.log,Yn=Math.LN2;function pl(n){return n>>>=0,n===0?32:31-(ie(n)/Yn|0)|0}var Qs=256,ws=262144,Zi=4194304;function cs(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 Ra(n,i,o){var u=n.pendingLanes;if(u===0)return 0;var h=0,g=n.suspendedLanes,j=n.pingedLanes;n=n.warmLanes;var _=u&134217727;return _!==0?(u=_&~g,u!==0?h=cs(u):(j&=_,j!==0?h=cs(j):o||(o=_&~n,o!==0&&(h=cs(o))))):(_=u&~g,_!==0?h=cs(_):j!==0?h=cs(j):o||(o=u&~n,o!==0&&(h=cs(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 us(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=Zi;return Zi<<=1,(Zi&62914560)===0&&(Zi=4194304),n}function Ta(n){for(var i=[],o=0;31>o;o++)i.push(n);return i}function Fi(n,i){n.pendingLanes|=i,i!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function rd(n,i,o,u,h,g){var j=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 _=n.entanglements,L=n.expirationTimes,Z=n.hiddenUpdates;for(o=j&~o;0<o;){var Y=31-Ge(o),ee=1<<Y;_[Y]=0,L[Y]=-1;var F=Z[Y];if(F!==null)for(Z[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&~(j&~i))}function vl(n,i,o){n.pendingLanes|=i,n.suspendedLanes&=~i;var u=31-Ge(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-Ge(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:P(o),(o&(n.suspendedLanes|i))!==0?0:o}function P(n){switch(n){case 2:n=1;break;case 8:n=4;break;case 32:n=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:n=128;break;case 268435456:n=134217728;break;default:n=0}return n}function ue(n){return n&=-n,2<n?8<n?(n&134217727)!==0?32:268435456:8:2}function st(){var n=O.p;return n!==0?n:(n=window.event,n===void 0?32:kv(n.type))}function Qt(n,i){var o=O.p;try{return O.p=n,i()}finally{O.p=o}}var Lt=Math.random().toString(36).slice(2),Et="__reactFiber$"+Lt,Nt="__reactProps$"+Lt,Cn="__reactContainer$"+Lt,en="__reactEvents$"+Lt,od="__reactListeners$"+Lt,Ys="__reactHandles$"+Lt,Js="__reactResources$"+Lt,ds="__reactMarker$"+Lt;function Oa(n){delete n[Et],delete n[Nt],delete n[en],delete n[od],delete n[Ys]}function Xs(n){var i=n[Et];if(i)return i;for(var o=n.parentNode;o;){if(i=o[Cn]||o[Et]){if(o=i.alternate,i.child!==null||o!==null&&o.child!==null)for(n=uv(n);n!==null;){if(o=n[Et])return o;n=uv(n)}return i}n=o,o=n.parentNode}return null}function Jn(n){if(n=n[Et]||n[Cn]){var i=n.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return n}return null}function fs(n){var i=n.tag;if(i===5||i===26||i===27||i===6)return n.stateNode;throw Error(a(33))}function Ws(n){var i=n[Js];return i||(i=n[Js]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function Mt(n){n[ds]=!0}var Ie=new Set,it={};function Zt(n,i){rn(n,i),rn(n+"Capture",i)}function rn(n,i){for(it[n]=i,n=0;n<i.length;n++)Ie.add(i[n])}var Da=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={},Kp={};function WN(n){return zt.call(Kp,n)?!0:zt.call(Hr,n)?!1:Da.test(n)?Kp[n]=!0:(Hr[n]=!0,!1)}function xl(n,i,o){if(WN(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 Ns(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 On(n){switch(typeof n){case"bigint":case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function Vp(n){var i=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function e1(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(j){o=""+j,g.call(this,j)}}),Object.defineProperty(n,i,{enumerable:u.enumerable}),{getValue:function(){return o},setValue:function(j){o=""+j},stopTracking:function(){n._valueTracker=null,delete n[i]}}}}function ld(n){if(!n._valueTracker){var i=Vp(n)?"checked":"value";n._valueTracker=e1(n,i,""+n[i])}}function Qp(n){if(!n)return!1;var i=n._valueTracker;if(!i)return!0;var o=i.getValue(),u="";return n&&(u=Vp(n)?n.checked?"true":"false":n.value),n=u,n!==o?(i.setValue(n),!0):!1}function jl(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 t1=/[\n"\\]/g;function Dn(n){return n.replace(t1,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function cd(n,i,o,u,h,g,j,_){n.name="",j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?n.type=j:n.removeAttribute("type"),i!=null?j==="number"?(i===0&&n.value===""||n.value!=i)&&(n.value=""+On(i)):n.value!==""+On(i)&&(n.value=""+On(i)):j!=="submit"&&j!=="reset"||n.removeAttribute("value"),i!=null?ud(n,j,On(i)):o!=null?ud(n,j,On(o)):u!=null&&n.removeAttribute("value"),h==null&&g!=null&&(n.defaultChecked=!!g),h!=null&&(n.checked=h&&typeof h!="function"&&typeof h!="symbol"),_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?n.name=""+On(_):n.removeAttribute("name")}function Yp(n,i,o,u,h,g,j,_){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)){ld(n);return}o=o!=null?""+On(o):"",i=i!=null?""+On(i):o,_||i===n.value||(n.value=i),n.defaultValue=i}u=u??h,u=typeof u!="function"&&typeof u!="symbol"&&!!u,n.checked=_?n.checked:!!u,n.defaultChecked=!!u,j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"&&(n.name=j),ld(n)}function ud(n,i,o){i==="number"&&jl(n.ownerDocument)===n||n.defaultValue===""+o||(n.defaultValue=""+o)}function La(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=""+On(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 Jp(n,i,o){if(i!=null&&(i=""+On(i),i!==n.value&&(n.value=i),o==null)){n.defaultValue!==i&&(n.defaultValue=i);return}n.defaultValue=o!=null?""+On(o):""}function Xp(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=On(i),n.defaultValue=o,u=n.textContent,u===o&&u!==""&&u!==null&&(n.value=u),ld(n)}function Ma(n,i){if(i){var o=n.firstChild;if(o&&o===n.lastChild&&o.nodeType===3){o.nodeValue=i;return}}n.textContent=i}var n1=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 Wp(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||n1.has(i)?i==="float"?n.cssFloat=o:n[i]=(""+o).trim():n[i]=o+"px"}function eg(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&&Wp(n,h,u)}else for(var g in i)i.hasOwnProperty(g)&&Wp(n,g,i[g])}function dd(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 s1=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),i1=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function wl(n){return i1.test(""+n)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":n}function Cs(){}var fd=null;function hd(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var Ua=null,$a=null;function tg(n){var i=Jn(n);if(i&&(n=i.stateNode)){var o=n[Nt]||null;e:switch(n=i.stateNode,i.type){case"input":if(cd(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="'+Dn(""+i)+'"][type="radio"]'),i=0;i<o.length;i++){var u=o[i];if(u!==n&&u.form===n.form){var h=u[Nt]||null;if(!h)throw Error(a(90));cd(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&&Qp(u)}break e;case"textarea":Jp(n,o.value,o.defaultValue);break e;case"select":i=o.value,i!=null&&La(n,!!o.multiple,i,!1)}}}var md=!1;function ng(n,i,o){if(md)return n(i,o);md=!0;try{var u=n(i);return u}finally{if(md=!1,(Ua!==null||$a!==null)&&(uc(),Ua&&(i=Ua,n=$a,$a=Ua=null,tg(i),n)))for(i=0;i<n.length;i++)tg(n[i])}}function Zr(n,i){var o=n.stateNode;if(o===null)return null;var u=o[Nt]||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 ks=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),pd=!1;if(ks)try{var Fr={};Object.defineProperty(Fr,"passive",{get:function(){pd=!0}}),window.addEventListener("test",Fr,Fr),window.removeEventListener("test",Fr,Fr)}catch{pd=!1}var ei=null,gd=null,Nl=null;function sg(){if(Nl)return Nl;var n,i=gd,o=i.length,u,h="value"in ei?ei.value:ei.textContent,g=h.length;for(n=0;n<o&&i[n]===h[n];n++);var j=o-n;for(u=1;u<=j&&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 kl(){return!0}function ig(){return!1}function mn(n){function i(o,u,h,g,j){this._reactName=o,this._targetInst=h,this.type=u,this.nativeEvent=g,this.target=j,this.currentTarget=null;for(var _ in n)n.hasOwnProperty(_)&&(o=n[_],this[_]=o?o(g):g[_]);return this.isDefaultPrevented=(g.defaultPrevented!=null?g.defaultPrevented:g.returnValue===!1)?kl:ig,this.isPropagationStopped=ig,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=kl)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=kl)},persist:function(){},isPersistent:kl}),i}var Gi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},_l=mn(Gi),Gr=y({},Gi,{view:0,detail:0}),a1=mn(Gr),yd,vd,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:xd,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"?(yd=n.screenX-Kr.screenX,vd=n.screenY-Kr.screenY):vd=yd=0,Kr=n),yd)},movementY:function(n){return"movementY"in n?n.movementY:vd}}),ag=mn(zl),r1=y({},zl,{dataTransfer:0}),o1=mn(r1),l1=y({},Gr,{relatedTarget:0}),bd=mn(l1),c1=y({},Gi,{animationName:0,elapsedTime:0,pseudoElement:0}),u1=mn(c1),d1=y({},Gi,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),f1=mn(d1),h1=y({},Gi,{data:0}),rg=mn(h1),m1={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},p1={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"},g1={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function y1(n){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(n):(n=g1[n])?!!i[n]:!1}function xd(){return y1}var v1=y({},Gr,{key:function(n){if(n.key){var i=m1[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"?p1[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:xd,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}}),b1=mn(v1),x1=y({},zl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),og=mn(x1),S1=y({},Gr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:xd}),j1=mn(S1),w1=y({},Gi,{propertyName:0,elapsedTime:0,pseudoElement:0}),N1=mn(w1),C1=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}),k1=mn(C1),_1=y({},Gi,{newState:0,oldState:0}),z1=mn(_1),E1=[9,13,27,32],Sd=ks&&"CompositionEvent"in window,Vr=null;ks&&"documentMode"in document&&(Vr=document.documentMode);var A1=ks&&"TextEvent"in window&&!Vr,lg=ks&&(!Sd||Vr&&8<Vr&&11>=Vr),cg=" ",ug=!1;function dg(n,i){switch(n){case"keyup":return E1.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function fg(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var Pa=!1;function R1(n,i){switch(n){case"compositionend":return fg(i);case"keypress":return i.which!==32?null:(ug=!0,cg);case"textInput":return n=i.data,n===cg&&ug?null:n;default:return null}}function T1(n,i){if(Pa)return n==="compositionend"||!Sd&&dg(n,i)?(n=sg(),Nl=gd=ei=null,Pa=!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 lg&&i.locale!=="ko"?null:i.data;default:return null}}var O1={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 hg(n){var i=n&&n.nodeName&&n.nodeName.toLowerCase();return i==="input"?!!O1[n.type]:i==="textarea"}function mg(n,i,o,u){Ua?$a?$a.push(u):$a=[u]:Ua=u,i=yc(i,"onChange"),0<i.length&&(o=new _l("onChange","change",null,o,u),n.push({event:o,listeners:i}))}var Qr=null,Yr=null;function D1(n){Y0(n,0)}function El(n){var i=fs(n);if(Qp(i))return n}function pg(n,i){if(n==="change")return i}var gg=!1;if(ks){var jd;if(ks){var wd="oninput"in document;if(!wd){var yg=document.createElement("div");yg.setAttribute("oninput","return;"),wd=typeof yg.oninput=="function"}jd=wd}else jd=!1;gg=jd&&(!document.documentMode||9<document.documentMode)}function vg(){Qr&&(Qr.detachEvent("onpropertychange",bg),Yr=Qr=null)}function bg(n){if(n.propertyName==="value"&&El(Yr)){var i=[];mg(i,Yr,n,hd(n)),ng(D1,i)}}function L1(n,i,o){n==="focusin"?(vg(),Qr=i,Yr=o,Qr.attachEvent("onpropertychange",bg)):n==="focusout"&&vg()}function M1(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return El(Yr)}function U1(n,i){if(n==="click")return El(i)}function $1(n,i){if(n==="input"||n==="change")return El(i)}function P1(n,i){return n===i&&(n!==0||1/n===1/i)||n!==n&&i!==i}var kn=typeof Object.is=="function"?Object.is:P1;function Jr(n,i){if(kn(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(!zt.call(i,h)||!kn(n[h],i[h]))return!1}return!0}function xg(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function Sg(n,i){var o=xg(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=xg(o)}}function jg(n,i){return n&&i?n===i?!0:n&&n.nodeType===3?!1:i&&i.nodeType===3?jg(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=jl(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=jl(n.document)}return i}function Nd(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 I1=ks&&"documentMode"in document&&11>=document.documentMode,Ia=null,Cd=null,Xr=null,kd=!1;function Ng(n,i,o){var u=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;kd||Ia==null||Ia!==jl(u)||(u=Ia,"selectionStart"in u&&Nd(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(Cd,"onSelect"),0<u.length&&(i=new _l("onSelect","select",null,i,o),n.push({event:i,listeners:u}),i.target=Ia)))}function Ki(n,i){var o={};return o[n.toLowerCase()]=i.toLowerCase(),o["Webkit"+n]="webkit"+i,o["Moz"+n]="moz"+i,o}var Ba={animationend:Ki("Animation","AnimationEnd"),animationiteration:Ki("Animation","AnimationIteration"),animationstart:Ki("Animation","AnimationStart"),transitionrun:Ki("Transition","TransitionRun"),transitionstart:Ki("Transition","TransitionStart"),transitioncancel:Ki("Transition","TransitionCancel"),transitionend:Ki("Transition","TransitionEnd")},_d={},Cg={};ks&&(Cg=document.createElement("div").style,"AnimationEvent"in window||(delete Ba.animationend.animation,delete Ba.animationiteration.animation,delete Ba.animationstart.animation),"TransitionEvent"in window||delete Ba.transitionend.transition);function Vi(n){if(_d[n])return _d[n];if(!Ba[n])return n;var i=Ba[n],o;for(o in i)if(i.hasOwnProperty(o)&&o in Cg)return _d[n]=i[o];return n}var kg=Vi("animationend"),_g=Vi("animationiteration"),zg=Vi("animationstart"),B1=Vi("transitionrun"),q1=Vi("transitionstart"),H1=Vi("transitioncancel"),Eg=Vi("transitionend"),Ag=new Map,zd="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(" ");zd.push("scrollEnd");function Xn(n,i){Ag.set(n,i),Zt(i,[n])}var Al=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)},Ln=[],qa=0,Ed=0;function Rl(){for(var n=qa,i=Ed=qa=0;i<n;){var o=Ln[i];Ln[i++]=null;var u=Ln[i];Ln[i++]=null;var h=Ln[i];Ln[i++]=null;var g=Ln[i];if(Ln[i++]=null,u!==null&&h!==null){var j=u.pending;j===null?h.next=h:(h.next=j.next,j.next=h),u.pending=h}g!==0&&Rg(o,h,g)}}function Tl(n,i,o,u){Ln[qa++]=n,Ln[qa++]=i,Ln[qa++]=o,Ln[qa++]=u,Ed|=u,n.lanes|=u,n=n.alternate,n!==null&&(n.lanes|=u)}function Ad(n,i,o,u){return Tl(n,i,o,u),Ol(n)}function Qi(n,i){return Tl(n,null,null,i),Ol(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-Ge(o),n=g.hiddenUpdates,u=n[h],u===null?n[h]=[i]:u.push(i),i.lane=o|536870912),g):null}function Ol(n){if(50<So)throw So=0,If=null,Error(a(185));for(var i=n.return;i!==null;)n=i,i=n.return;return n.tag===3?n.stateNode:null}var Ha={};function Z1(n,i,o,u){this.tag=n,this.key=o,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=u,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function _n(n,i,o,u){return new Z1(n,i,o,u)}function Rd(n){return n=n.prototype,!(!n||!n.isReactComponent)}function _s(n,i){var o=n.alternate;return o===null?(o=_n(n.tag,i,n.key,n.mode),o.elementType=n.elementType,o.type=n.type,o.stateNode=n.stateNode,o.alternate=n,n.alternate=o):(o.pendingProps=i,o.type=n.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=n.flags&65011712,o.childLanes=n.childLanes,o.lanes=n.lanes,o.child=n.child,o.memoizedProps=n.memoizedProps,o.memoizedState=n.memoizedState,o.updateQueue=n.updateQueue,i=n.dependencies,o.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},o.sibling=n.sibling,o.index=n.index,o.ref=n.ref,o.refCleanup=n.refCleanup,o}function Tg(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 j=0;if(u=n,typeof n=="function")Rd(n)&&(j=1);else if(typeof n=="string")j=QC(n,o,oe.current)?26:n==="html"||n==="head"||n==="body"?27:5;else e:switch(n){case q:return n=_n(31,o,i,h),n.elementType=q,n.lanes=g,n;case S:return Yi(o.children,h,g,i);case C:j=8,h|=24;break;case k:return n=_n(12,o,i,h|2),n.elementType=k,n.lanes=g,n;case M:return n=_n(13,o,i,h),n.elementType=M,n.lanes=g,n;case U:return n=_n(19,o,i,h),n.elementType=U,n.lanes=g,n;default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case A:j=10;break e;case E:j=9;break e;case z:j=11;break e;case R:j=14;break e;case T:j=16,u=null;break e}j=29,o=Error(a(130,n===null?"null":typeof n,"")),u=null}return i=_n(j,o,i,h),i.elementType=n,i.type=u,i.lanes=g,i}function Yi(n,i,o,u){return n=_n(7,n,u,i),n.lanes=o,n}function Td(n,i,o){return n=_n(6,n,null,i),n.lanes=o,n}function Og(n){var i=_n(18,null,null,0);return i.stateNode=n,i}function Od(n,i,o){return i=_n(4,n.children!==null?n.children:[],n.key,i),i.lanes=o,i.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},i}var Dg=new WeakMap;function Mn(n,i){if(typeof n=="object"&&n!==null){var o=Dg.get(n);return o!==void 0?o:(i={value:n,source:i,stack:Vt(i)},Dg.set(n,i),i)}return{value:n,source:i,stack:Vt(i)}}var Za=[],Fa=0,Ll=null,Wr=0,Un=[],$n=0,ti=null,hs=1,ms="";function zs(n,i){Za[Fa++]=Wr,Za[Fa++]=Ll,Ll=n,Wr=i}function Lg(n,i,o){Un[$n++]=hs,Un[$n++]=ms,Un[$n++]=ti,ti=n;var u=hs;n=ms;var h=32-Ge(u)-1;u&=~(1<<h),o+=1;var g=32-Ge(i)+h;if(30<g){var j=h-h%5;g=(u&(1<<j)-1).toString(32),u>>=j,h-=j,hs=1<<32-Ge(i)+h|o<<h|u,ms=g+n}else hs=1<<g|o<<h|u,ms=n}function Dd(n){n.return!==null&&(zs(n,1),Lg(n,1,0))}function Ld(n){for(;n===Ll;)Ll=Za[--Fa],Za[Fa]=null,Wr=Za[--Fa],Za[Fa]=null;for(;n===ti;)ti=Un[--$n],Un[$n]=null,ms=Un[--$n],Un[$n]=null,hs=Un[--$n],Un[$n]=null}function Mg(n,i){Un[$n++]=hs,Un[$n++]=ms,Un[$n++]=ti,hs=i.id,ms=i.overflow,ti=n}var Yt=null,ft=null,He=!1,ni=null,Pn=!1,Md=Error(a(519));function si(n){var i=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw eo(Mn(i,n)),Md}function Ug(n){var i=n.stateNode,o=n.type,u=n.memoizedProps;switch(i[Et]=n,i[Nt]=u,o){case"dialog":Ue("cancel",i),Ue("close",i);break;case"iframe":case"object":case"embed":Ue("load",i);break;case"video":case"audio":for(o=0;o<wo.length;o++)Ue(wo[o],i);break;case"source":Ue("error",i);break;case"img":case"image":case"link":Ue("error",i),Ue("load",i);break;case"details":Ue("toggle",i);break;case"input":Ue("invalid",i),Yp(i,u.value,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name,!0);break;case"select":Ue("invalid",i);break;case"textarea":Ue("invalid",i),Xp(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||ev(i.textContent,o)?(u.popover!=null&&(Ue("beforetoggle",i),Ue("toggle",i)),u.onScroll!=null&&Ue("scroll",i),u.onScrollEnd!=null&&Ue("scrollend",i),u.onClick!=null&&(i.onclick=Cs),i=!0):i=!1,i||si(n,!0)}function $g(n){for(Yt=n.return;Yt;)switch(Yt.tag){case 5:case 31:case 13:Pn=!1;return;case 27:case 3:Pn=!0;return;default:Yt=Yt.return}}function Ga(n){if(n!==Yt)return!1;if(!He)return $g(n),He=!0,!1;var i=n.tag,o;if((o=i!==3&&i!==27)&&((o=i===5)&&(o=n.type,o=!(o!=="form"&&o!=="button")||th(n.type,n.memoizedProps)),o=!o),o&&ft&&si(n),$g(n),i===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(a(317));ft=cv(n)}else if(i===31){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(a(317));ft=cv(n)}else i===27?(i=ft,yi(n.type)?(n=rh,rh=null,ft=n):ft=i):ft=Yt?Bn(n.stateNode.nextSibling):null;return!0}function Ji(){ft=Yt=null,He=!1}function Ud(){var n=ni;return n!==null&&(vn===null?vn=n:vn.push.apply(vn,n),ni=null),n}function eo(n){ni===null?ni=[n]:ni.push(n)}var $d=D(null),Xi=null,Es=null;function ii(n,i,o){se($d,i._currentValue),i._currentValue=o}function As(n){n._currentValue=$d.current,G($d)}function Pd(n,i,o){for(;n!==null;){var u=n.alternate;if((n.childLanes&i)!==i?(n.childLanes|=i,u!==null&&(u.childLanes|=i)):u!==null&&(u.childLanes&i)!==i&&(u.childLanes|=i),n===o)break;n=n.return}}function Id(n,i,o,u){var h=n.child;for(h!==null&&(h.return=n);h!==null;){var g=h.dependencies;if(g!==null){var j=h.child;g=g.firstContext;e:for(;g!==null;){var _=g;g=h;for(var L=0;L<i.length;L++)if(_.context===i[L]){g.lanes|=o,_=g.alternate,_!==null&&(_.lanes|=o),Pd(g.return,o,n),u||(j=null);break e}g=_.next}}else if(h.tag===18){if(j=h.return,j===null)throw Error(a(341));j.lanes|=o,g=j.alternate,g!==null&&(g.lanes|=o),Pd(j,o,n),j=null}else j=h.child;if(j!==null)j.return=h;else for(j=h;j!==null;){if(j===n){j=null;break}if(h=j.sibling,h!==null){h.return=j.return,j=h;break}j=j.return}h=j}}function Ka(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 j=h.alternate;if(j===null)throw Error(a(387));if(j=j.memoizedProps,j!==null){var _=h.type;kn(h.pendingProps.value,j.value)||(n!==null?n.push(_):n=[_])}}else if(h===de.current){if(j=h.alternate,j===null)throw Error(a(387));j.memoizedState.memoizedState!==h.memoizedState.memoizedState&&(n!==null?n.push(zo):n=[zo])}h=h.return}n!==null&&Id(i,n,o,u),i.flags|=262144}function Ml(n){for(n=n.firstContext;n!==null;){if(!kn(n.context._currentValue,n.memoizedValue))return!0;n=n.next}return!1}function Wi(n){Xi=n,Es=null,n=n.dependencies,n!==null&&(n.firstContext=null)}function Jt(n){return Pg(Xi,n)}function Ul(n,i){return Xi===null&&Wi(n),Pg(n,i)}function Pg(n,i){var o=i._currentValue;if(i={context:i,memoizedValue:o,next:null},Es===null){if(n===null)throw Error(a(308));Es=i,n.dependencies={lanes:0,firstContext:i},n.flags|=524288}else Es=Es.next=i;return o}var F1=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()})}},G1=e.unstable_scheduleCallback,K1=e.unstable_NormalPriority,Ut={$$typeof:A,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Bd(){return{controller:new F1,data:new Map,refCount:0}}function to(n){n.refCount--,n.refCount===0&&G1(K1,function(){n.controller.abort()})}var no=null,qd=0,Va=0,Qa=null;function V1(n,i){if(no===null){var o=no=[];qd=0,Va=Gf(),Qa={status:"pending",value:void 0,then:function(u){o.push(u)}}}return qd++,i.then(Ig,Ig),i}function Ig(){if(--qd===0&&no!==null){Qa!==null&&(Qa.status="fulfilled");var n=no;no=null,Va=0,Qa=null;for(var i=0;i<n.length;i++)(0,n[i])()}}function Q1(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 Bg=B.S;B.S=function(n,i){N0=Pe(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&V1(n,i),Bg!==null&&Bg(n,i)};var ea=D(null);function Hd(){var n=ea.current;return n!==null?n:lt.pooledCache}function $l(n,i){i===null?se(ea,ea.current):se(ea,i.pool)}function qg(){var n=Hd();return n===null?null:{parent:Ut._currentValue,pool:n}}var Ya=Error(a(460)),Zd=Error(a(474)),Pl=Error(a(542)),Il={then:function(){}};function Hg(n){return n=n.status,n==="fulfilled"||n==="rejected"}function Zg(n,i,o){switch(o=n[o],o===void 0?n.push(i):o!==i&&(i.then(Cs,Cs),i=o),i.status){case"fulfilled":return i.value;case"rejected":throw n=i.reason,Gg(n),n;default:if(typeof i.status=="string")i.then(Cs,Cs);else{if(n=lt,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,Gg(n),n}throw na=i,Ya}}function ta(n){try{var i=n._init;return i(n._payload)}catch(o){throw o!==null&&typeof o=="object"&&typeof o.then=="function"?(na=o,Ya):o}}var na=null;function Fg(){if(na===null)throw Error(a(459));var n=na;return na=null,n}function Gg(n){if(n===Ya||n===Pl)throw Error(a(483))}var Ja=null,so=0;function Bl(n){var i=so;return so+=1,Ja===null&&(Ja=[]),Zg(Ja,n,i)}function io(n,i){i=i.props.ref,n.ref=i!==void 0?i:null}function ql(n,i){throw i.$$typeof===b?Error(a(525)):(n=Object.prototype.toString.call(i),Error(a(31,n==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":n)))}function Kg(n){function i(I,$){if(n){var H=I.deletions;H===null?(I.deletions=[$],I.flags|=16):H.push($)}}function o(I,$){if(!n)return null;for(;$!==null;)i(I,$),$=$.sibling;return null}function u(I){for(var $=new Map;I!==null;)I.key!==null?$.set(I.key,I):$.set(I.index,I),I=I.sibling;return $}function h(I,$){return I=_s(I,$),I.index=0,I.sibling=null,I}function g(I,$,H){return I.index=H,n?(H=I.alternate,H!==null?(H=H.index,H<$?(I.flags|=67108866,$):H):(I.flags|=67108866,$)):(I.flags|=1048576,$)}function j(I){return n&&I.alternate===null&&(I.flags|=67108866),I}function _(I,$,H,J){return $===null||$.tag!==6?($=Td(H,I.mode,J),$.return=I,$):($=h($,H),$.return=I,$)}function L(I,$,H,J){var Ne=H.type;return Ne===S?Y(I,$,H.props.children,J,H.key):$!==null&&($.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===T&&ta(Ne)===$.type)?($=h($,H.props),io($,H),$.return=I,$):($=Dl(H.type,H.key,H.props,null,I.mode,J),io($,H),$.return=I,$)}function Z(I,$,H,J){return $===null||$.tag!==4||$.stateNode.containerInfo!==H.containerInfo||$.stateNode.implementation!==H.implementation?($=Od(H,I.mode,J),$.return=I,$):($=h($,H.children||[]),$.return=I,$)}function Y(I,$,H,J,Ne){return $===null||$.tag!==7?($=Yi(H,I.mode,J,Ne),$.return=I,$):($=h($,H),$.return=I,$)}function ee(I,$,H){if(typeof $=="string"&&$!==""||typeof $=="number"||typeof $=="bigint")return $=Td(""+$,I.mode,H),$.return=I,$;if(typeof $=="object"&&$!==null){switch($.$$typeof){case x:return H=Dl($.type,$.key,$.props,null,I.mode,H),io(H,$),H.return=I,H;case w:return $=Od($,I.mode,H),$.return=I,$;case T:return $=ta($),ee(I,$,H)}if(je($)||ne($))return $=Yi($,I.mode,H,null),$.return=I,$;if(typeof $.then=="function")return ee(I,Bl($),H);if($.$$typeof===A)return ee(I,Ul(I,$),H);ql(I,$)}return null}function F(I,$,H,J){var Ne=$!==null?$.key:null;if(typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint")return Ne!==null?null:_(I,$,""+H,J);if(typeof H=="object"&&H!==null){switch(H.$$typeof){case x:return H.key===Ne?L(I,$,H,J):null;case w:return H.key===Ne?Z(I,$,H,J):null;case T:return H=ta(H),F(I,$,H,J)}if(je(H)||ne(H))return Ne!==null?null:Y(I,$,H,J,null);if(typeof H.then=="function")return F(I,$,Bl(H),J);if(H.$$typeof===A)return F(I,$,Ul(I,H),J);ql(I,H)}return null}function V(I,$,H,J,Ne){if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return I=I.get(H)||null,_($,I,""+J,Ne);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case x:return I=I.get(J.key===null?H:J.key)||null,L($,I,J,Ne);case w:return I=I.get(J.key===null?H:J.key)||null,Z($,I,J,Ne);case T:return J=ta(J),V(I,$,H,J,Ne)}if(je(J)||ne(J))return I=I.get(H)||null,Y($,I,J,Ne,null);if(typeof J.then=="function")return V(I,$,H,Bl(J),Ne);if(J.$$typeof===A)return V(I,$,H,Ul($,J),Ne);ql($,J)}return null}function ye(I,$,H,J){for(var Ne=null,Ke=null,Se=$,Te=$=0,qe=null;Se!==null&&Te<H.length;Te++){Se.index>Te?(qe=Se,Se=null):qe=Se.sibling;var Ve=F(I,Se,H[Te],J);if(Ve===null){Se===null&&(Se=qe);break}n&&Se&&Ve.alternate===null&&i(I,Se),$=g(Ve,$,Te),Ke===null?Ne=Ve:Ke.sibling=Ve,Ke=Ve,Se=qe}if(Te===H.length)return o(I,Se),He&&zs(I,Te),Ne;if(Se===null){for(;Te<H.length;Te++)Se=ee(I,H[Te],J),Se!==null&&($=g(Se,$,Te),Ke===null?Ne=Se:Ke.sibling=Se,Ke=Se);return He&&zs(I,Te),Ne}for(Se=u(Se);Te<H.length;Te++)qe=V(Se,I,Te,H[Te],J),qe!==null&&(n&&qe.alternate!==null&&Se.delete(qe.key===null?Te:qe.key),$=g(qe,$,Te),Ke===null?Ne=qe:Ke.sibling=qe,Ke=qe);return n&&Se.forEach(function(ji){return i(I,ji)}),He&&zs(I,Te),Ne}function Ce(I,$,H,J){if(H==null)throw Error(a(151));for(var Ne=null,Ke=null,Se=$,Te=$=0,qe=null,Ve=H.next();Se!==null&&!Ve.done;Te++,Ve=H.next()){Se.index>Te?(qe=Se,Se=null):qe=Se.sibling;var ji=F(I,Se,Ve.value,J);if(ji===null){Se===null&&(Se=qe);break}n&&Se&&ji.alternate===null&&i(I,Se),$=g(ji,$,Te),Ke===null?Ne=ji:Ke.sibling=ji,Ke=ji,Se=qe}if(Ve.done)return o(I,Se),He&&zs(I,Te),Ne;if(Se===null){for(;!Ve.done;Te++,Ve=H.next())Ve=ee(I,Ve.value,J),Ve!==null&&($=g(Ve,$,Te),Ke===null?Ne=Ve:Ke.sibling=Ve,Ke=Ve);return He&&zs(I,Te),Ne}for(Se=u(Se);!Ve.done;Te++,Ve=H.next())Ve=V(Se,I,Te,Ve.value,J),Ve!==null&&(n&&Ve.alternate!==null&&Se.delete(Ve.key===null?Te:Ve.key),$=g(Ve,$,Te),Ke===null?Ne=Ve:Ke.sibling=Ve,Ke=Ve);return n&&Se.forEach(function(rk){return i(I,rk)}),He&&zs(I,Te),Ne}function ot(I,$,H,J){if(typeof H=="object"&&H!==null&&H.type===S&&H.key===null&&(H=H.props.children),typeof H=="object"&&H!==null){switch(H.$$typeof){case x:e:{for(var Ne=H.key;$!==null;){if($.key===Ne){if(Ne=H.type,Ne===S){if($.tag===7){o(I,$.sibling),J=h($,H.props.children),J.return=I,I=J;break e}}else if($.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===T&&ta(Ne)===$.type){o(I,$.sibling),J=h($,H.props),io(J,H),J.return=I,I=J;break e}o(I,$);break}else i(I,$);$=$.sibling}H.type===S?(J=Yi(H.props.children,I.mode,J,H.key),J.return=I,I=J):(J=Dl(H.type,H.key,H.props,null,I.mode,J),io(J,H),J.return=I,I=J)}return j(I);case w:e:{for(Ne=H.key;$!==null;){if($.key===Ne)if($.tag===4&&$.stateNode.containerInfo===H.containerInfo&&$.stateNode.implementation===H.implementation){o(I,$.sibling),J=h($,H.children||[]),J.return=I,I=J;break e}else{o(I,$);break}else i(I,$);$=$.sibling}J=Od(H,I.mode,J),J.return=I,I=J}return j(I);case T:return H=ta(H),ot(I,$,H,J)}if(je(H))return ye(I,$,H,J);if(ne(H)){if(Ne=ne(H),typeof Ne!="function")throw Error(a(150));return H=Ne.call(H),Ce(I,$,H,J)}if(typeof H.then=="function")return ot(I,$,Bl(H),J);if(H.$$typeof===A)return ot(I,$,Ul(I,H),J);ql(I,H)}return typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint"?(H=""+H,$!==null&&$.tag===6?(o(I,$.sibling),J=h($,H),J.return=I,I=J):(o(I,$),J=Td(H,I.mode,J),J.return=I,I=J),j(I)):o(I,$)}return function(I,$,H,J){try{so=0;var Ne=ot(I,$,H,J);return Ja=null,Ne}catch(Se){if(Se===Ya||Se===Pl)throw Se;var Ke=_n(29,Se,null,I.mode);return Ke.lanes=J,Ke.return=I,Ke}}}var sa=Kg(!0),Vg=Kg(!1),ai=!1;function Fd(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Gd(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 ri(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function oi(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=Ol(n),Rg(n,null,o),i}return Tl(n,u,i,o),Ol(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 Kd(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 j={lane:o.lane,tag:o.tag,payload:o.payload,callback:null,next:null};g===null?h=g=j:g=g.next=j,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 Vd=!1;function ro(){if(Vd){var n=Qa;if(n!==null)throw n}}function oo(n,i,o,u){Vd=!1;var h=n.updateQueue;ai=!1;var g=h.firstBaseUpdate,j=h.lastBaseUpdate,_=h.shared.pending;if(_!==null){h.shared.pending=null;var L=_,Z=L.next;L.next=null,j===null?g=Z:j.next=Z,j=L;var Y=n.alternate;Y!==null&&(Y=Y.updateQueue,_=Y.lastBaseUpdate,_!==j&&(_===null?Y.firstBaseUpdate=Z:_.next=Z,Y.lastBaseUpdate=L))}if(g!==null){var ee=h.baseState;j=0,Y=Z=L=null,_=g;do{var F=_.lane&-536870913,V=F!==_.lane;if(V?(Be&F)===F:(u&F)===F){F!==0&&F===Va&&(Vd=!0),Y!==null&&(Y=Y.next={lane:0,tag:_.tag,payload:_.payload,callback:null,next:null});e:{var ye=n,Ce=_;F=i;var ot=o;switch(Ce.tag){case 1:if(ye=Ce.payload,typeof ye=="function"){ee=ye.call(ot,ee,F);break e}ee=ye;break e;case 3:ye.flags=ye.flags&-65537|128;case 0:if(ye=Ce.payload,F=typeof ye=="function"?ye.call(ot,ee,F):ye,F==null)break e;ee=y({},ee,F);break e;case 2:ai=!0}}F=_.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:_.tag,payload:_.payload,callback:_.callback,next:null},Y===null?(Z=Y=V,L=ee):Y=Y.next=V,j|=F;if(_=_.next,_===null){if(_=h.shared.pending,_===null)break;V=_,_=V.next,V.next=null,h.lastBaseUpdate=V,h.shared.pending=null}}while(!0);Y===null&&(L=ee),h.baseState=L,h.firstBaseUpdate=Z,h.lastBaseUpdate=Y,g===null&&(h.shared.lanes=0),fi|=j,n.lanes=j,n.memoizedState=ee}}function Qg(n,i){if(typeof n!="function")throw Error(a(191,n));n.call(i)}function Yg(n,i){var o=n.callbacks;if(o!==null)for(n.callbacks=null,n=0;n<o.length;n++)Qg(o[n],i)}var Xa=D(null),Hl=D(0);function Jg(n,i){n=Ps,se(Hl,n),se(Xa,i),Ps=n|i.baseLanes}function Qd(){se(Hl,Ps),se(Xa,Xa.current)}function Yd(){Ps=Hl.current,G(Xa),G(Hl)}var zn=D(null),In=null;function li(n){var i=n.alternate;se(At,At.current&1),se(zn,n),In===null&&(i===null||Xa.current!==null||i.memoizedState!==null)&&(In=n)}function Jd(n){se(At,At.current),se(zn,n),In===null&&(In=n)}function Xg(n){n.tag===22?(se(At,At.current),se(zn,n),In===null&&(In=n)):ci()}function ci(){se(At,At.current),se(zn,zn.current)}function En(n){G(zn),In===n&&(In=null),G(At)}var At=D(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||ih(o)||ah(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 Rs=0,Re=null,at=null,$t=null,Fl=!1,Wa=!1,ia=!1,Gl=0,lo=0,er=null,Y1=0;function Ct(){throw Error(a(321))}function Xd(n,i){if(i===null)return!1;for(var o=0;o<i.length&&o<n.length;o++)if(!kn(n[o],i[o]))return!1;return!0}function Wd(n,i,o,u,h,g){return Rs=g,Re=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,B.H=n===null||n.memoizedState===null?Ly:pf,ia=!1,g=o(u,h),ia=!1,Wa&&(g=ey(i,o,u,h)),Wg(n),g}function Wg(n){B.H=fo;var i=at!==null&&at.next!==null;if(Rs=0,$t=at=Re=null,Fl=!1,lo=0,er=null,i)throw Error(a(300));n===null||Pt||(n=n.dependencies,n!==null&&Ml(n)&&(Pt=!0))}function ey(n,i,o,u){Re=n;var h=0;do{if(Wa&&(er=null),lo=0,Wa=!1,25<=h)throw Error(a(301));if(h+=1,$t=at=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=My,g=i(o,u)}while(Wa);return g}function J1(){var n=B.H,i=n.useState()[0];return i=typeof i.then=="function"?co(i):i,n=n.useState()[0],(at!==null?at.memoizedState:null)!==n&&(Re.flags|=1024),i}function ef(){var n=Gl!==0;return Gl=0,n}function tf(n,i,o){i.updateQueue=n.updateQueue,i.flags&=-2053,n.lanes&=~o}function nf(n){if(Fl){for(n=n.memoizedState;n!==null;){var i=n.queue;i!==null&&(i.pending=null),n=n.next}Fl=!1}Rs=0,$t=at=Re=null,Wa=!1,lo=Gl=0,er=null}function on(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return $t===null?Re.memoizedState=$t=n:$t=$t.next=n,$t}function Rt(){if(at===null){var n=Re.alternate;n=n!==null?n.memoizedState:null}else n=at.next;var i=$t===null?Re.memoizedState:$t.next;if(i!==null)$t=i,at=n;else{if(n===null)throw Re.alternate===null?Error(a(467)):Error(a(310));at=n,n={memoizedState:at.memoizedState,baseState:at.baseState,baseQueue:at.baseQueue,queue:at.queue,next:null},$t===null?Re.memoizedState=$t=n:$t=$t.next=n}return $t}function Kl(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function co(n){var i=lo;return lo+=1,er===null&&(er=[]),n=Zg(er,n,i),i=Re,($t===null?i.memoizedState:$t.next)===null&&(i=i.alternate,B.H=i===null||i.memoizedState===null?Ly:pf),n}function Vl(n){if(n!==null&&typeof n=="object"){if(typeof n.then=="function")return co(n);if(n.$$typeof===A)return Jt(n)}throw Error(a(438,String(n)))}function sf(n){var i=null,o=Re.updateQueue;if(o!==null&&(i=o.memoCache),i==null){var u=Re.alternate;u!==null&&(u=u.updateQueue,u!==null&&(u=u.memoCache,u!=null&&(i={data:u.data.map(function(h){return h.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),o===null&&(o=Kl(),Re.updateQueue=o),o.memoCache=i,o=i.data[i.index],o===void 0)for(o=i.data[i.index]=Array(n),u=0;u<n;u++)o[u]=W;return i.index++,o}function Ts(n,i){return typeof i=="function"?i(n):i}function Ql(n){var i=Rt();return af(i,at,n)}function af(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 j=h.next;h.next=g.next,g.next=j}i.baseQueue=h=g,u.pending=null}if(g=n.baseState,h===null)n.memoizedState=g;else{i=h.next;var _=j=null,L=null,Z=i,Y=!1;do{var ee=Z.lane&-536870913;if(ee!==Z.lane?(Be&ee)===ee:(Rs&ee)===ee){var F=Z.revertLane;if(F===0)L!==null&&(L=L.next={lane:0,revertLane:0,gesture:null,action:Z.action,hasEagerState:Z.hasEagerState,eagerState:Z.eagerState,next:null}),ee===Va&&(Y=!0);else if((Rs&F)===F){Z=Z.next,F===Va&&(Y=!0);continue}else ee={lane:0,revertLane:Z.revertLane,gesture:null,action:Z.action,hasEagerState:Z.hasEagerState,eagerState:Z.eagerState,next:null},L===null?(_=L=ee,j=g):L=L.next=ee,Re.lanes|=F,fi|=F;ee=Z.action,ia&&o(g,ee),g=Z.hasEagerState?Z.eagerState:o(g,ee)}else F={lane:ee,revertLane:Z.revertLane,gesture:Z.gesture,action:Z.action,hasEagerState:Z.hasEagerState,eagerState:Z.eagerState,next:null},L===null?(_=L=F,j=g):L=L.next=F,Re.lanes|=ee,fi|=ee;Z=Z.next}while(Z!==null&&Z!==i);if(L===null?j=g:L.next=_,!kn(g,n.memoizedState)&&(Pt=!0,Y&&(o=Qa,o!==null)))throw o;n.memoizedState=g,n.baseState=j,n.baseQueue=L,u.lastRenderedState=g}return h===null&&(u.lanes=0),[n.memoizedState,u.dispatch]}function rf(n){var i=Rt(),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 j=h=h.next;do g=n(g,j.action),j=j.next;while(j!==h);kn(g,i.memoizedState)||(Pt=!0),i.memoizedState=g,i.baseQueue===null&&(i.baseState=g),o.lastRenderedState=g}return[g,u]}function ty(n,i,o){var u=Re,h=Rt(),g=He;if(g){if(o===void 0)throw Error(a(407));o=o()}else o=i();var j=!kn((at||h).memoizedState,o);if(j&&(h.memoizedState=o,Pt=!0),h=h.queue,cf(iy.bind(null,u,h,n),[n]),h.getSnapshot!==i||j||$t!==null&&$t.memoizedState.tag&1){if(u.flags|=2048,tr(9,{destroy:void 0},sy.bind(null,u,h,o,i),null),lt===null)throw Error(a(349));g||(Rs&127)!==0||ny(u,i,o)}return o}function ny(n,i,o){n.flags|=16384,n={getSnapshot:i,value:o},i=Re.updateQueue,i===null?(i=Kl(),Re.updateQueue=i,i.stores=[n]):(o=i.stores,o===null?i.stores=[n]:o.push(n))}function sy(n,i,o,u){i.value=o,i.getSnapshot=u,ay(i)&&ry(n)}function iy(n,i,o){return o(function(){ay(i)&&ry(n)})}function ay(n){var i=n.getSnapshot;n=n.value;try{var o=i();return!kn(n,o)}catch{return!0}}function ry(n){var i=Qi(n,2);i!==null&&bn(i,n,2)}function of(n){var i=on();if(typeof n=="function"){var o=n;if(n=o(),ia){Ht(!0);try{o()}finally{Ht(!1)}}}return i.memoizedState=i.baseState=n,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ts,lastRenderedState:n},i}function oy(n,i,o,u){return n.baseState=o,af(n,at,typeof u=="function"?u:Ts)}function X1(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(j){g.listeners.push(j)}};B.T!==null?o(!0):g.isTransition=!1,u(g),o=i.pending,o===null?(g.next=i.pending=g,ly(i,g)):(g.next=o.next,i.pending=o.next=g)}}function ly(n,i){var o=i.action,u=i.payload,h=n.state;if(i.isTransition){var g=B.T,j={};B.T=j;try{var _=o(h,u),L=B.S;L!==null&&L(j,_),cy(n,i,_)}catch(Z){lf(n,i,Z)}finally{g!==null&&j.types!==null&&(g.types=j.types),B.T=g}}else try{g=o(h,u),cy(n,i,g)}catch(Z){lf(n,i,Z)}}function cy(n,i,o){o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(function(u){uy(n,i,u)},function(u){return lf(n,i,u)}):uy(n,i,o)}function uy(n,i,o){i.status="fulfilled",i.value=o,dy(i),n.state=o,i=n.pending,i!==null&&(o=i.next,o===i?n.pending=null:(o=o.next,i.next=o,ly(n,o)))}function lf(n,i,o){var u=n.pending;if(n.pending=null,u!==null){u=u.next;do i.status="rejected",i.reason=o,dy(i),i=i.next;while(i!==u)}n.action=null}function dy(n){n=n.listeners;for(var i=0;i<n.length;i++)(0,n[i])()}function fy(n,i){return i}function hy(n,i){if(He){var o=lt.formState;if(o!==null){e:{var u=Re;if(He){if(ft){t:{for(var h=ft,g=Pn;h.nodeType!==8;){if(!g){h=null;break t}if(h=Bn(h.nextSibling),h===null){h=null;break t}}g=h.data,h=g==="F!"||g==="F"?h:null}if(h){ft=Bn(h.nextSibling),u=h.data==="F!";break e}}si(u)}u=!1}u&&(i=o[0])}}return o=on(),o.memoizedState=o.baseState=i,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:fy,lastRenderedState:i},o.queue=u,o=Ty.bind(null,Re,u),u.dispatch=o,u=of(!1),g=mf.bind(null,Re,!1,u.queue),u=on(),h={state:i,dispatch:null,action:n,pending:null},u.queue=h,o=X1.bind(null,Re,h,g,o),h.dispatch=o,u.memoizedState=n,[i,o,!1]}function my(n){var i=Rt();return py(i,at,n)}function py(n,i,o){if(i=af(n,i,fy)[0],n=Ql(Ts)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var u=co(i)}catch(j){throw j===Ya?Pl:j}else u=i;i=Rt();var h=i.queue,g=h.dispatch;return o!==i.memoizedState&&(Re.flags|=2048,tr(9,{destroy:void 0},W1.bind(null,h,o),null)),[u,g,n]}function W1(n,i){n.action=i}function gy(n){var i=Rt(),o=at;if(o!==null)return py(i,o,n);Rt(),i=i.memoizedState,o=Rt();var u=o.queue.dispatch;return o.memoizedState=n,[i,u,!1]}function tr(n,i,o,u){return n={tag:n,create:o,deps:u,inst:i,next:null},i=Re.updateQueue,i===null&&(i=Kl(),Re.updateQueue=i),o=i.lastEffect,o===null?i.lastEffect=n.next=n:(u=o.next,o.next=n,n.next=u,i.lastEffect=n),n}function yy(){return Rt().memoizedState}function Yl(n,i,o,u){var h=on();Re.flags|=n,h.memoizedState=tr(1|i,{destroy:void 0},o,u===void 0?null:u)}function Jl(n,i,o,u){var h=Rt();u=u===void 0?null:u;var g=h.memoizedState.inst;at!==null&&u!==null&&Xd(u,at.memoizedState.deps)?h.memoizedState=tr(i,g,o,u):(Re.flags|=n,h.memoizedState=tr(1|i,g,o,u))}function vy(n,i){Yl(8390656,8,n,i)}function cf(n,i){Jl(2048,8,n,i)}function eC(n){Re.flags|=4;var i=Re.updateQueue;if(i===null)i=Kl(),Re.updateQueue=i,i.events=[n];else{var o=i.events;o===null?i.events=[n]:o.push(n)}}function by(n){var i=Rt().memoizedState;return eC({ref:i,nextImpl:n}),function(){if((Ye&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}function xy(n,i){return Jl(4,2,n,i)}function Sy(n,i){return Jl(4,4,n,i)}function jy(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,jy.bind(null,i,n),o)}function uf(){}function Ny(n,i){var o=Rt();i=i===void 0?null:i;var u=o.memoizedState;return i!==null&&Xd(i,u[1])?u[0]:(o.memoizedState=[n,i],n)}function Cy(n,i){var o=Rt();i=i===void 0?null:i;var u=o.memoizedState;if(i!==null&&Xd(i,u[1]))return u[0];if(u=n(),ia){Ht(!0);try{n()}finally{Ht(!1)}}return o.memoizedState=[u,i],u}function df(n,i,o){return o===void 0||(Rs&1073741824)!==0&&(Be&261930)===0?n.memoizedState=i:(n.memoizedState=o,n=k0(),Re.lanes|=n,fi|=n,o)}function ky(n,i,o,u){return kn(o,i)?o:Xa.current!==null?(n=df(n,o,u),kn(n,i)||(Pt=!0),n):(Rs&42)===0||(Rs&1073741824)!==0&&(Be&261930)===0?(Pt=!0,n.memoizedState=o):(n=k0(),Re.lanes|=n,fi|=n,i)}function _y(n,i,o,u,h){var g=O.p;O.p=g!==0&&8>g?g:8;var j=B.T,_={};B.T=_,mf(n,!1,i,o);try{var L=h(),Z=B.S;if(Z!==null&&Z(_,L),L!==null&&typeof L=="object"&&typeof L.then=="function"){var Y=Q1(L,u);uo(n,i,Y,Tn(n))}else uo(n,i,u,Tn(n))}catch(ee){uo(n,i,{then:function(){},status:"rejected",reason:ee},Tn())}finally{O.p=g,j!==null&&_.types!==null&&(j.types=_.types),B.T=j}}function tC(){}function ff(n,i,o,u){if(n.tag!==5)throw Error(a(476));var h=zy(n).queue;_y(n,h,i,ae,o===null?tC:function(){return Ey(n),o(u)})}function zy(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:Ts,lastRenderedState:ae},next:null};var o={};return i.next={memoizedState:o,baseState:o,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ts,lastRenderedState:o},next:null},n.memoizedState=i,n=n.alternate,n!==null&&(n.memoizedState=i),i}function Ey(n){var i=zy(n);i.next===null&&(i=n.alternate.memoizedState),uo(n,i.next.queue,{},Tn())}function hf(){return Jt(zo)}function Ay(){return Rt().memoizedState}function Ry(){return Rt().memoizedState}function nC(n){for(var i=n.return;i!==null;){switch(i.tag){case 24:case 3:var o=Tn();n=ri(o);var u=oi(i,n,o);u!==null&&(bn(u,i,o),ao(u,i,o)),i={cache:Bd()},n.payload=i;return}i=i.return}}function sC(n,i,o){var u=Tn();o={lane:u,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},Xl(n)?Oy(i,o):(o=Ad(n,i,o,u),o!==null&&(bn(o,n,u),Dy(o,i,u)))}function Ty(n,i,o){var u=Tn();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))Oy(i,h);else{var g=n.alternate;if(n.lanes===0&&(g===null||g.lanes===0)&&(g=i.lastRenderedReducer,g!==null))try{var j=i.lastRenderedState,_=g(j,o);if(h.hasEagerState=!0,h.eagerState=_,kn(_,j))return Tl(n,i,h,0),lt===null&&Rl(),!1}catch{}if(o=Ad(n,i,h,u),o!==null)return bn(o,n,u),Dy(o,i,u),!0}return!1}function mf(n,i,o,u){if(u={lane:2,revertLane:Gf(),gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Xl(n)){if(i)throw Error(a(479))}else i=Ad(n,o,u,2),i!==null&&bn(i,n,2)}function Xl(n){var i=n.alternate;return n===Re||i!==null&&i===Re}function Oy(n,i){Wa=Fl=!0;var o=n.pending;o===null?i.next=i:(i.next=o.next,o.next=i),n.pending=i}function Dy(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:Jt,use:Vl,useCallback:Ct,useContext:Ct,useEffect:Ct,useImperativeHandle:Ct,useLayoutEffect:Ct,useInsertionEffect:Ct,useMemo:Ct,useReducer:Ct,useRef:Ct,useState:Ct,useDebugValue:Ct,useDeferredValue:Ct,useTransition:Ct,useSyncExternalStore:Ct,useId:Ct,useHostTransitionStatus:Ct,useFormState:Ct,useActionState:Ct,useOptimistic:Ct,useMemoCache:Ct,useCacheRefresh:Ct};fo.useEffectEvent=Ct;var Ly={readContext:Jt,use:Vl,useCallback:function(n,i){return on().memoizedState=[n,i===void 0?null:i],n},useContext:Jt,useEffect:vy,useImperativeHandle:function(n,i,o){o=o!=null?o.concat([n]):null,Yl(4194308,4,jy.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=on();i=i===void 0?null:i;var u=n();if(ia){Ht(!0);try{n()}finally{Ht(!1)}}return o.memoizedState=[u,i],u},useReducer:function(n,i,o){var u=on();if(o!==void 0){var h=o(i);if(ia){Ht(!0);try{o(i)}finally{Ht(!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=sC.bind(null,Re,n),[u.memoizedState,n]},useRef:function(n){var i=on();return n={current:n},i.memoizedState=n},useState:function(n){n=of(n);var i=n.queue,o=Ty.bind(null,Re,i);return i.dispatch=o,[n.memoizedState,o]},useDebugValue:uf,useDeferredValue:function(n,i){var o=on();return df(o,n,i)},useTransition:function(){var n=of(!1);return n=_y.bind(null,Re,n.queue,!0,!1),on().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,i,o){var u=Re,h=on();if(He){if(o===void 0)throw Error(a(407));o=o()}else{if(o=i(),lt===null)throw Error(a(349));(Be&127)!==0||ny(u,i,o)}h.memoizedState=o;var g={value:o,getSnapshot:i};return h.queue=g,vy(iy.bind(null,u,g,n),[n]),u.flags|=2048,tr(9,{destroy:void 0},sy.bind(null,u,g,o,i),null),o},useId:function(){var n=on(),i=lt.identifierPrefix;if(He){var o=ms,u=hs;o=(u&~(1<<32-Ge(u)-1)).toString(32)+o,i="_"+i+"R_"+o,o=Gl++,0<o&&(i+="H"+o.toString(32)),i+="_"}else o=Y1++,i="_"+i+"r_"+o.toString(32)+"_";return n.memoizedState=i},useHostTransitionStatus:hf,useFormState:hy,useActionState:hy,useOptimistic:function(n){var i=on();i.memoizedState=i.baseState=n;var o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=o,i=mf.bind(null,Re,!0,o),o.dispatch=i,[n,i]},useMemoCache:sf,useCacheRefresh:function(){return on().memoizedState=nC.bind(null,Re)},useEffectEvent:function(n){var i=on(),o={impl:n};return i.memoizedState=o,function(){if((Ye&2)!==0)throw Error(a(440));return o.impl.apply(void 0,arguments)}}},pf={readContext:Jt,use:Vl,useCallback:Ny,useContext:Jt,useEffect:cf,useImperativeHandle:wy,useInsertionEffect:xy,useLayoutEffect:Sy,useMemo:Cy,useReducer:Ql,useRef:yy,useState:function(){return Ql(Ts)},useDebugValue:uf,useDeferredValue:function(n,i){var o=Rt();return ky(o,at.memoizedState,n,i)},useTransition:function(){var n=Ql(Ts)[0],i=Rt().memoizedState;return[typeof n=="boolean"?n:co(n),i]},useSyncExternalStore:ty,useId:Ay,useHostTransitionStatus:hf,useFormState:my,useActionState:my,useOptimistic:function(n,i){var o=Rt();return oy(o,at,n,i)},useMemoCache:sf,useCacheRefresh:Ry};pf.useEffectEvent=by;var My={readContext:Jt,use:Vl,useCallback:Ny,useContext:Jt,useEffect:cf,useImperativeHandle:wy,useInsertionEffect:xy,useLayoutEffect:Sy,useMemo:Cy,useReducer:rf,useRef:yy,useState:function(){return rf(Ts)},useDebugValue:uf,useDeferredValue:function(n,i){var o=Rt();return at===null?df(o,n,i):ky(o,at.memoizedState,n,i)},useTransition:function(){var n=rf(Ts)[0],i=Rt().memoizedState;return[typeof n=="boolean"?n:co(n),i]},useSyncExternalStore:ty,useId:Ay,useHostTransitionStatus:hf,useFormState:gy,useActionState:gy,useOptimistic:function(n,i){var o=Rt();return at!==null?oy(o,at,n,i):(o.baseState=n,[n,o.queue.dispatch])},useMemoCache:sf,useCacheRefresh:Ry};My.useEffectEvent=by;function gf(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 yf={enqueueSetState:function(n,i,o){n=n._reactInternals;var u=Tn(),h=ri(u);h.payload=i,o!=null&&(h.callback=o),i=oi(n,h,u),i!==null&&(bn(i,n,u),ao(i,n,u))},enqueueReplaceState:function(n,i,o){n=n._reactInternals;var u=Tn(),h=ri(u);h.tag=1,h.payload=i,o!=null&&(h.callback=o),i=oi(n,h,u),i!==null&&(bn(i,n,u),ao(i,n,u))},enqueueForceUpdate:function(n,i){n=n._reactInternals;var o=Tn(),u=ri(o);u.tag=2,i!=null&&(u.callback=i),i=oi(n,u,o),i!==null&&(bn(i,n,o),ao(i,n,o))}};function Uy(n,i,o,u,h,g,j){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(u,g,j):i.prototype&&i.prototype.isPureReactComponent?!Jr(o,u)||!Jr(h,g):!0}function $y(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&&yf.enqueueReplaceState(i,i.state,null)}function aa(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){Al(n)}function Iy(n){console.error(n)}function By(n){Al(n)}function Wl(n,i){try{var o=n.onUncaughtError;o(i.value,{componentStack:i.stack})}catch(u){setTimeout(function(){throw u})}}function qy(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 vf(n,i,o){return o=ri(o),o.tag=3,o.payload={element:null},o.callback=function(){Wl(n,i)},o}function Hy(n){return n=ri(n),n.tag=3,n}function Zy(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(){qy(i,o,u)}}var j=o.stateNode;j!==null&&typeof j.componentDidCatch=="function"&&(n.callback=function(){qy(i,o,u),typeof h!="function"&&(hi===null?hi=new Set([this]):hi.add(this));var _=u.stack;this.componentDidCatch(u.value,{componentStack:_!==null?_:""})})}function iC(n,i,o,u,h){if(o.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){if(i=o.alternate,i!==null&&Ka(i,o,h,!0),o=zn.current,o!==null){switch(o.tag){case 31:case 13:return In===null?dc():o.alternate===null&&kt===0&&(kt=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),Hf(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)),Hf(n,u,h)),!1}throw Error(a(435,o.tag))}return Hf(n,u,h),dc(),!1}if(He)return i=zn.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=h,u!==Md&&(n=Error(a(422),{cause:u}),eo(Mn(n,o)))):(u!==Md&&(i=Error(a(423),{cause:u}),eo(Mn(i,o))),n=n.current.alternate,n.flags|=65536,h&=-h,n.lanes|=h,u=Mn(u,o),h=vf(n.stateNode,u,h),Kd(n,h),kt!==4&&(kt=2)),!1;var g=Error(a(520),{cause:u});if(g=Mn(g,o),xo===null?xo=[g]:xo.push(g),kt!==4&&(kt=2),i===null)return!0;u=Mn(u,o),o=i;do{switch(o.tag){case 3:return o.flags|=65536,n=h&-h,o.lanes|=n,n=vf(o.stateNode,u,n),Kd(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"&&(hi===null||!hi.has(g))))return o.flags|=65536,h&=-h,o.lanes|=h,h=Hy(h),Zy(h,n,o,u),Kd(o,h),!1}o=o.return}while(o!==null);return!1}var bf=Error(a(461)),Pt=!1;function Xt(n,i,o,u){i.child=n===null?Vg(i,null,o,u):sa(i,n.child,o,u)}function Fy(n,i,o,u,h){o=o.render;var g=i.ref;if("ref"in u){var j={};for(var _ in u)_!=="ref"&&(j[_]=u[_])}else j=u;return Wi(i),u=Wd(n,i,o,j,g,h),_=ef(),n!==null&&!Pt?(tf(n,i,h),Os(n,i,h)):(He&&_&&Dd(i),i.flags|=1,Xt(n,i,u,h),i.child)}function Gy(n,i,o,u,h){if(n===null){var g=o.type;return typeof g=="function"&&!Rd(g)&&g.defaultProps===void 0&&o.compare===null?(i.tag=15,i.type=g,Ky(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,!_f(n,h)){var j=g.memoizedProps;if(o=o.compare,o=o!==null?o:Jr,o(j,u)&&n.ref===i.ref)return Os(n,i,h)}return i.flags|=1,n=_s(g,u),n.ref=i.ref,n.return=i,i.child=n}function Ky(n,i,o,u,h){if(n!==null){var g=n.memoizedProps;if(Jr(g,u)&&n.ref===i.ref)if(Pt=!1,i.pendingProps=u=g,_f(n,h))(n.flags&131072)!==0&&(Pt=!0);else return i.lanes=n.lanes,Os(n,i,h)}return xf(n,i,o,u,h)}function Vy(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 Qy(n,i,g,o,u)}if((o&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},n!==null&&$l(i,g!==null?g.cachePool:null),g!==null?Jg(i,g):Qd(),Xg(i);else return u=i.lanes=536870912,Qy(n,i,g!==null?g.baseLanes|o:o,o,u)}else g!==null?($l(i,g.cachePool),Jg(i,g),ci(),i.memoizedState=null):(n!==null&&$l(i,null),Qd(),ci());return Xt(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 Qy(n,i,o,u,h){var g=Hd();return g=g===null?null:{parent:Ut._currentValue,pool:g},i.memoizedState={baseLanes:o,cachePool:g},n!==null&&$l(i,null),Qd(),Xg(i),n!==null&&Ka(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 Yy(n,i,o){return sa(i,n.child,null,o),n=ec(i,i.pendingProps),n.flags|=2,En(i),i.memoizedState=null,n}function aC(n,i,o){var u=i.pendingProps,h=(i.flags&128)!==0;if(i.flags&=-129,n===null){if(He){if(u.mode==="hidden")return n=ec(i,u),i.lanes=536870912,ho(null,n);if(Jd(i),(n=ft)?(n=lv(n,Pn),n=n!==null&&n.data==="&"?n:null,n!==null&&(i.memoizedState={dehydrated:n,treeContext:ti!==null?{id:hs,overflow:ms}:null,retryLane:536870912,hydrationErrors:null},o=Og(n),o.return=i,i.child=o,Yt=i,ft=null)):n=null,n===null)throw si(i);return i.lanes=536870912,null}return ec(i,u)}var g=n.memoizedState;if(g!==null){var j=g.dehydrated;if(Jd(i),h)if(i.flags&256)i.flags&=-257,i=Yy(n,i,o);else if(i.memoizedState!==null)i.child=n.child,i.flags|=128,i=null;else throw Error(a(558));else if(Pt||Ka(n,i,o,!1),h=(o&n.childLanes)!==0,Pt||h){if(u=lt,u!==null&&(j=qr(u,o),j!==0&&j!==g.retryLane))throw g.retryLane=j,Qi(n,j),bn(u,n,j),bf;dc(),i=Yy(n,i,o)}else n=g.treeContext,ft=Bn(j.nextSibling),Yt=i,He=!0,ni=null,Pn=!1,n!==null&&Mg(i,n),i=ec(i,u),i.flags|=4096;return i}return n=_s(n.child,{mode:u.mode,children:u.children}),n.ref=i.ref,i.child=n,n.return=i,n}function 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 xf(n,i,o,u,h){return Wi(i),o=Wd(n,i,o,u,void 0,h),u=ef(),n!==null&&!Pt?(tf(n,i,h),Os(n,i,h)):(He&&u&&Dd(i),i.flags|=1,Xt(n,i,o,h),i.child)}function Jy(n,i,o,u,h,g){return Wi(i),i.updateQueue=null,o=ey(i,u,o,h),Wg(n),u=ef(),n!==null&&!Pt?(tf(n,i,g),Os(n,i,g)):(He&&u&&Dd(i),i.flags|=1,Xt(n,i,o,g),i.child)}function Xy(n,i,o,u,h){if(Wi(i),i.stateNode===null){var g=Ha,j=o.contextType;typeof j=="object"&&j!==null&&(g=Jt(j)),g=new o(u,g),i.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,g.updater=yf,i.stateNode=g,g._reactInternals=i,g=i.stateNode,g.props=u,g.state=i.memoizedState,g.refs={},Fd(i),j=o.contextType,g.context=typeof j=="object"&&j!==null?Jt(j):Ha,g.state=i.memoizedState,j=o.getDerivedStateFromProps,typeof j=="function"&&(gf(i,o,j,u),g.state=i.memoizedState),typeof o.getDerivedStateFromProps=="function"||typeof g.getSnapshotBeforeUpdate=="function"||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(j=g.state,typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount(),j!==g.state&&yf.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 _=i.memoizedProps,L=aa(o,_);g.props=L;var Z=g.context,Y=o.contextType;j=Ha,typeof Y=="object"&&Y!==null&&(j=Jt(Y));var ee=o.getDerivedStateFromProps;Y=typeof ee=="function"||typeof g.getSnapshotBeforeUpdate=="function",_=i.pendingProps!==_,Y||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(_||Z!==j)&&$y(i,g,u,j),ai=!1;var F=i.memoizedState;g.state=F,oo(i,u,g,h),ro(),Z=i.memoizedState,_||F!==Z||ai?(typeof ee=="function"&&(gf(i,o,ee,u),Z=i.memoizedState),(L=ai||Uy(i,o,L,u,F,Z,j))?(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=Z),g.props=u,g.state=Z,g.context=j,u=L):(typeof g.componentDidMount=="function"&&(i.flags|=4194308),u=!1)}else{g=i.stateNode,Gd(n,i),j=i.memoizedProps,Y=aa(o,j),g.props=Y,ee=i.pendingProps,F=g.context,Z=o.contextType,L=Ha,typeof Z=="object"&&Z!==null&&(L=Jt(Z)),_=o.getDerivedStateFromProps,(Z=typeof _=="function"||typeof g.getSnapshotBeforeUpdate=="function")||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(j!==ee||F!==L)&&$y(i,g,u,L),ai=!1,F=i.memoizedState,g.state=F,oo(i,u,g,h),ro();var V=i.memoizedState;j!==ee||F!==V||ai||n!==null&&n.dependencies!==null&&Ml(n.dependencies)?(typeof _=="function"&&(gf(i,o,_,u),V=i.memoizedState),(Y=ai||Uy(i,o,Y,u,F,V,L)||n!==null&&n.dependencies!==null&&Ml(n.dependencies))?(Z||typeof g.UNSAFE_componentWillUpdate!="function"&&typeof g.componentWillUpdate!="function"||(typeof g.componentWillUpdate=="function"&&g.componentWillUpdate(u,V,L),typeof g.UNSAFE_componentWillUpdate=="function"&&g.UNSAFE_componentWillUpdate(u,V,L)),typeof g.componentDidUpdate=="function"&&(i.flags|=4),typeof g.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof g.componentDidUpdate!="function"||j===n.memoizedProps&&F===n.memoizedState||(i.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||j===n.memoizedProps&&F===n.memoizedState||(i.flags|=1024),i.memoizedProps=u,i.memoizedState=V),g.props=u,g.state=V,g.context=L,u=Y):(typeof g.componentDidUpdate!="function"||j===n.memoizedProps&&F===n.memoizedState||(i.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||j===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=sa(i,n.child,null,h),i.child=sa(i,null,o,h)):Xt(n,i,o,h),i.memoizedState=g.state,n=i.child):n=Os(n,i,h),n}function Wy(n,i,o,u){return Ji(),i.flags|=256,Xt(n,i,o,u),i.child}var Sf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function jf(n){return{baseLanes:n,cachePool:qg()}}function wf(n,i,o){return n=n!==null?n.childLanes&~o:0,i&&(n|=Rn),n}function e0(n,i,o){var u=i.pendingProps,h=!1,g=(i.flags&128)!==0,j;if((j=g)||(j=n!==null&&n.memoizedState===null?!1:(At.current&2)!==0),j&&(h=!0,i.flags&=-129),j=(i.flags&32)!==0,i.flags&=-33,n===null){if(He){if(h?li(i):ci(),(n=ft)?(n=lv(n,Pn),n=n!==null&&n.data!=="&"?n:null,n!==null&&(i.memoizedState={dehydrated:n,treeContext:ti!==null?{id:hs,overflow:ms}:null,retryLane:536870912,hydrationErrors:null},o=Og(n),o.return=i,i.child=o,Yt=i,ft=null)):n=null,n===null)throw si(i);return ah(n)?i.lanes=32:i.lanes=536870912,null}var _=u.children;return u=u.fallback,h?(ci(),h=i.mode,_=nc({mode:"hidden",children:_},h),u=Yi(u,h,o,null),_.return=i,u.return=i,_.sibling=u,i.child=_,u=i.child,u.memoizedState=jf(o),u.childLanes=wf(n,j,o),i.memoizedState=Sf,ho(null,u)):(li(i),Nf(i,_))}var L=n.memoizedState;if(L!==null&&(_=L.dehydrated,_!==null)){if(g)i.flags&256?(li(i),i.flags&=-257,i=Cf(n,i,o)):i.memoizedState!==null?(ci(),i.child=n.child,i.flags|=128,i=null):(ci(),_=u.fallback,h=i.mode,u=nc({mode:"visible",children:u.children},h),_=Yi(_,h,o,null),_.flags|=2,u.return=i,_.return=i,u.sibling=_,i.child=u,sa(i,n.child,null,o),u=i.child,u.memoizedState=jf(o),u.childLanes=wf(n,j,o),i.memoizedState=Sf,i=ho(null,u));else if(li(i),ah(_)){if(j=_.nextSibling&&_.nextSibling.dataset,j)var Z=j.dgst;j=Z,u=Error(a(419)),u.stack="",u.digest=j,eo({value:u,source:null,stack:null}),i=Cf(n,i,o)}else if(Pt||Ka(n,i,o,!1),j=(o&n.childLanes)!==0,Pt||j){if(j=lt,j!==null&&(u=qr(j,o),u!==0&&u!==L.retryLane))throw L.retryLane=u,Qi(n,u),bn(j,n,u),bf;ih(_)||dc(),i=Cf(n,i,o)}else ih(_)?(i.flags|=192,i.child=n.child,i=null):(n=L.treeContext,ft=Bn(_.nextSibling),Yt=i,He=!0,ni=null,Pn=!1,n!==null&&Mg(i,n),i=Nf(i,u.children),i.flags|=4096);return i}return h?(ci(),_=u.fallback,h=i.mode,L=n.child,Z=L.sibling,u=_s(L,{mode:"hidden",children:u.children}),u.subtreeFlags=L.subtreeFlags&65011712,Z!==null?_=_s(Z,_):(_=Yi(_,h,o,null),_.flags|=2),_.return=i,u.return=i,u.sibling=_,i.child=u,ho(null,u),u=i.child,_=n.child.memoizedState,_===null?_=jf(o):(h=_.cachePool,h!==null?(L=Ut._currentValue,h=h.parent!==L?{parent:L,pool:L}:h):h=qg(),_={baseLanes:_.baseLanes|o,cachePool:h}),u.memoizedState=_,u.childLanes=wf(n,j,o),i.memoizedState=Sf,ho(n.child,u)):(li(i),o=n.child,n=o.sibling,o=_s(o,{mode:"visible",children:u.children}),o.return=i,o.sibling=null,n!==null&&(j=i.deletions,j===null?(i.deletions=[n],i.flags|=16):j.push(n)),i.child=o,i.memoizedState=null,o)}function Nf(n,i){return i=nc({mode:"visible",children:i},n.mode),i.return=n,n.child=i}function nc(n,i){return n=_n(22,n,null,i),n.lanes=0,n}function Cf(n,i,o){return sa(i,n.child,null,o),n=Nf(i,i.pendingProps.children),n.flags|=2,i.memoizedState=null,n}function t0(n,i,o){n.lanes|=i;var u=n.alternate;u!==null&&(u.lanes|=i),Pd(n.return,i,o)}function kf(n,i,o,u,h,g){var j=n.memoizedState;j===null?n.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:u,tail:o,tailMode:h,treeForkCount:g}:(j.isBackwards=i,j.rendering=null,j.renderingStartTime=0,j.last=u,j.tail=o,j.tailMode=h,j.treeForkCount=g)}function n0(n,i,o){var u=i.pendingProps,h=u.revealOrder,g=u.tail;u=u.children;var j=At.current,_=(j&2)!==0;if(_?(j=j&1|2,i.flags|=128):j&=1,se(At,j),Xt(n,i,u,o),u=He?Wr:0,!_&&n!==null&&(n.flags&128)!==0)e:for(n=i.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&t0(n,o,i);else if(n.tag===19)t0(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),kf(i,!1,h,o,g,u);break;case"backwards":case"unstable_legacy-backwards":for(o=null,h=i.child,i.child=null;h!==null;){if(n=h.alternate,n!==null&&Zl(n)===null){i.child=h;break}n=h.sibling,h.sibling=o,o=h,h=n}kf(i,!0,o,null,g,u);break;case"together":kf(i,!1,null,null,void 0,u);break;default:i.memoizedState=null}return i.child}function Os(n,i,o){if(n!==null&&(i.dependencies=n.dependencies),fi|=i.lanes,(o&i.childLanes)===0)if(n!==null){if(Ka(n,i,o,!1),(o&i.childLanes)===0)return null}else return null;if(n!==null&&i.child!==n.child)throw Error(a(153));if(i.child!==null){for(n=i.child,o=_s(n,n.pendingProps),i.child=o,o.return=i;n.sibling!==null;)n=n.sibling,o=o.sibling=_s(n,n.pendingProps),o.return=i;o.sibling=null}return i.child}function _f(n,i){return(n.lanes&i)!==0?!0:(n=n.dependencies,!!(n!==null&&Ml(n)))}function rC(n,i,o){switch(i.tag){case 3:Fe(i,i.stateNode.containerInfo),ii(i,Ut,n.memoizedState.cache),Ji();break;case 27:case 5:Je(i);break;case 4:Fe(i,i.stateNode.containerInfo);break;case 10:ii(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,Jd(i),null;break;case 13:var u=i.memoizedState;if(u!==null)return u.dehydrated!==null?(li(i),i.flags|=128,null):(o&i.child.childLanes)!==0?e0(n,i,o):(li(i),n=Os(n,i,o),n!==null?n.sibling:null);li(i);break;case 19:var h=(n.flags&128)!==0;if(u=(o&i.childLanes)!==0,u||(Ka(n,i,o,!1),u=(o&i.childLanes)!==0),h){if(u)return n0(n,i,o);i.flags|=128}if(h=i.memoizedState,h!==null&&(h.rendering=null,h.tail=null,h.lastEffect=null),se(At,At.current),u)break;return null;case 22:return i.lanes=0,Vy(n,i,o,i.pendingProps);case 24:ii(i,Ut,n.memoizedState.cache)}return Os(n,i,o)}function s0(n,i,o){if(n!==null)if(n.memoizedProps!==i.pendingProps)Pt=!0;else{if(!_f(n,o)&&(i.flags&128)===0)return Pt=!1,rC(n,i,o);Pt=(n.flags&131072)!==0}else Pt=!1,He&&(i.flags&1048576)!==0&&Lg(i,Wr,i.index);switch(i.lanes=0,i.tag){case 16:e:{var u=i.pendingProps;if(n=ta(i.elementType),i.type=n,typeof n=="function")Rd(n)?(u=aa(n,u),i.tag=1,i=Xy(null,i,n,u,o)):(i.tag=0,i=xf(null,i,n,u,o));else{if(n!=null){var h=n.$$typeof;if(h===z){i.tag=11,i=Fy(null,i,n,u,o);break e}else if(h===R){i.tag=14,i=Gy(null,i,n,u,o);break e}}throw i=ke(n)||n,Error(a(306,i,""))}}return i;case 0:return xf(n,i,i.type,i.pendingProps,o);case 1:return u=i.type,h=aa(u,i.pendingProps),Xy(n,i,u,h,o);case 3:e:{if(Fe(i,i.stateNode.containerInfo),n===null)throw Error(a(387));u=i.pendingProps;var g=i.memoizedState;h=g.element,Gd(n,i),oo(i,u,null,o);var j=i.memoizedState;if(u=j.cache,ii(i,Ut,u),u!==g.cache&&Id(i,[Ut],o,!0),ro(),u=j.element,g.isDehydrated)if(g={element:u,isDehydrated:!1,cache:j.cache},i.updateQueue.baseState=g,i.memoizedState=g,i.flags&256){i=Wy(n,i,u,o);break e}else if(u!==h){h=Mn(Error(a(424)),i),eo(h),i=Wy(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=Bn(n.firstChild),Yt=i,He=!0,ni=null,Pn=!0,o=Vg(i,null,u,o),i.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling;else{if(Ji(),u===h){i=Os(n,i,o);break e}Xt(n,i,u,o)}i=i.child}return i;case 26:return tc(n,i),n===null?(o=mv(i.type,null,i.pendingProps,null))?i.memoizedState=o:He||(o=i.type,n=i.pendingProps,u=vc(he.current).createElement(o),u[Et]=i,u[Nt]=n,Wt(u,o,n),Mt(u),i.stateNode=u):i.memoizedState=mv(i.type,n.memoizedProps,i.pendingProps,n.memoizedState),null;case 27:return Je(i),n===null&&He&&(u=i.stateNode=dv(i.type,i.pendingProps,he.current),Yt=i,Pn=!0,h=ft,yi(i.type)?(rh=h,ft=Bn(u.firstChild)):ft=h),Xt(n,i,i.pendingProps.children,o),tc(n,i),n===null&&(i.flags|=4194304),i.child;case 5:return n===null&&He&&((h=u=ft)&&(u=MC(u,i.type,i.pendingProps,Pn),u!==null?(i.stateNode=u,Yt=i,ft=Bn(u.firstChild),Pn=!1,h=!0):h=!1),h||si(i)),Je(i),h=i.type,g=i.pendingProps,j=n!==null?n.memoizedProps:null,u=g.children,th(h,g)?u=null:j!==null&&th(h,j)&&(i.flags|=32),i.memoizedState!==null&&(h=Wd(n,i,J1,null,null,o),zo._currentValue=h),tc(n,i),Xt(n,i,u,o),i.child;case 6:return n===null&&He&&((n=o=ft)&&(o=UC(o,i.pendingProps,Pn),o!==null?(i.stateNode=o,Yt=i,ft=null,n=!0):n=!1),n||si(i)),null;case 13:return e0(n,i,o);case 4:return Fe(i,i.stateNode.containerInfo),u=i.pendingProps,n===null?i.child=sa(i,null,u,o):Xt(n,i,u,o),i.child;case 11:return Fy(n,i,i.type,i.pendingProps,o);case 7:return Xt(n,i,i.pendingProps,o),i.child;case 8:return Xt(n,i,i.pendingProps.children,o),i.child;case 12:return Xt(n,i,i.pendingProps.children,o),i.child;case 10:return u=i.pendingProps,ii(i,i.type,u.value),Xt(n,i,u.children,o),i.child;case 9:return h=i.type._context,u=i.pendingProps.children,Wi(i),h=Jt(h),u=u(h),i.flags|=1,Xt(n,i,u,o),i.child;case 14:return Gy(n,i,i.type,i.pendingProps,o);case 15:return Ky(n,i,i.type,i.pendingProps,o);case 19:return n0(n,i,o);case 31:return aC(n,i,o);case 22:return Vy(n,i,o,i.pendingProps);case 24:return Wi(i),u=Jt(Ut),n===null?(h=Hd(),h===null&&(h=lt,g=Bd(),h.pooledCache=g,g.refCount++,g!==null&&(h.pooledCacheLanes|=o),h=g),i.memoizedState={parent:u,cache:h},Fd(i),ii(i,Ut,h)):((n.lanes&o)!==0&&(Gd(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),ii(i,Ut,u)):(u=g.cache,ii(i,Ut,u),u!==h.cache&&Id(i,[Ut],o,!0))),Xt(n,i,i.pendingProps.children,o),i.child;case 29:throw i.pendingProps}throw Error(a(156,i.tag))}function Ds(n){n.flags|=4}function zf(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(A0())n.flags|=8192;else throw na=Il,Zd}else n.flags&=-16777217}function i0(n,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)n.flags&=-16777217;else if(n.flags|=16777216,!bv(i))if(A0())n.flags|=8192;else throw na=Il,Zd}function sc(n,i){i!==null&&(n.flags|=4),n.flags&16384&&(i=n.tag!==22?yl():536870912,n.lanes|=i,ar|=i)}function mo(n,i){if(!He)switch(n.tailMode){case"hidden":i=n.tail;for(var o=null;i!==null;)i.alternate!==null&&(o=i),i=i.sibling;o===null?n.tail=null:o.sibling=null;break;case"collapsed":o=n.tail;for(var u=null;o!==null;)o.alternate!==null&&(u=o),o=o.sibling;u===null?i||n.tail===null?n.tail=null:n.tail.sibling=null:u.sibling=null}}function 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 oC(n,i,o){var u=i.pendingProps;switch(Ld(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),As(Ut),ge(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),(n===null||n.child===null)&&(Ga(i)?Ds(i):n===null||n.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,Ud())),ht(i),null;case 26:var h=i.type,g=i.memoizedState;return n===null?(Ds(i),g!==null?(ht(i),i0(i,g)):(ht(i),zf(i,h,null,u,o))):g?g!==n.memoizedState?(Ds(i),ht(i),i0(i,g)):(ht(i),i.flags&=-16777217):(n=n.memoizedProps,n!==u&&Ds(i),ht(i),zf(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&&Ds(i);else{if(!u){if(i.stateNode===null)throw Error(a(166));return ht(i),null}n=oe.current,Ga(i)?Ug(i):(n=dv(h,u,o),i.stateNode=n,Ds(i))}return ht(i),null;case 5:if(mt(i),h=i.type,n!==null&&i.stateNode!=null)n.memoizedProps!==u&&Ds(i);else{if(!u){if(i.stateNode===null)throw Error(a(166));return ht(i),null}if(g=oe.current,Ga(i))Ug(i);else{var j=vc(he.current);switch(g){case 1:g=j.createElementNS("http://www.w3.org/2000/svg",h);break;case 2:g=j.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;default:switch(h){case"svg":g=j.createElementNS("http://www.w3.org/2000/svg",h);break;case"math":g=j.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;case"script":g=j.createElement("div"),g.innerHTML="<script><\/script>",g=g.removeChild(g.firstChild);break;case"select":g=typeof u.is=="string"?j.createElement("select",{is:u.is}):j.createElement("select"),u.multiple?g.multiple=!0:u.size&&(g.size=u.size);break;default:g=typeof u.is=="string"?j.createElement(h,{is:u.is}):j.createElement(h)}}g[Et]=i,g[Nt]=u;e:for(j=i.child;j!==null;){if(j.tag===5||j.tag===6)g.appendChild(j.stateNode);else if(j.tag!==4&&j.tag!==27&&j.child!==null){j.child.return=j,j=j.child;continue}if(j===i)break e;for(;j.sibling===null;){if(j.return===null||j.return===i)break e;j=j.return}j.sibling.return=j.return,j=j.sibling}i.stateNode=g;e:switch(Wt(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&&Ds(i)}}return ht(i),zf(i,i.type,n===null?null:n.memoizedProps,i.pendingProps,o),null;case 6:if(n&&i.stateNode!=null)n.memoizedProps!==u&&Ds(i);else{if(typeof u!="string"&&i.stateNode===null)throw Error(a(166));if(n=he.current,Ga(i)){if(n=i.stateNode,o=i.memoizedProps,u=null,h=Yt,h!==null)switch(h.tag){case 27:case 5:u=h.memoizedProps}n[Et]=i,n=!!(n.nodeValue===o||u!==null&&u.suppressHydrationWarning===!0||ev(n.nodeValue,o)),n||si(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=Ga(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 Ji(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;ht(i),n=!1}else o=Ud(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=o),n=!0;if(!n)return i.flags&256?(En(i),i):(En(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=Ga(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 Ji(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;ht(i),h=!1}else h=Ud(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=h),h=!0;if(!h)return i.flags&256?(En(i),i):(En(i),null)}return En(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&&Yf(i.stateNode.containerInfo),ht(i),null;case 10:return As(i.type),ht(i),null;case 19:if(G(At),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(kt!==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;)Tg(o,n),o=o.sibling;return se(At,At.current&1|2),He&&zs(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&&!He)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=At.current,se(At,h?o&1|2:o&1),He&&zs(i,u.treeForkCount),n):(ht(i),null);case 22:case 23:return En(i),Yd(),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(ea),null;case 24:return o=null,n!==null&&(o=n.memoizedState.cache),i.memoizedState.cache!==o&&(i.flags|=2048),As(Ut),ht(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function lC(n,i){switch(Ld(i),i.tag){case 1:return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 3:return As(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(En(i),i.alternate===null)throw Error(a(340));Ji()}return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 13:if(En(i),n=i.memoizedState,n!==null&&n.dehydrated!==null){if(i.alternate===null)throw Error(a(340));Ji()}return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 19:return G(At),null;case 4:return ge(),null;case 10:return As(i.type),null;case 22:case 23:return En(i),Yd(),n!==null&&G(ea),n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 24:return As(Ut),null;case 25:return null;default:return null}}function a0(n,i){switch(Ld(i),i.tag){case 3:As(Ut),ge();break;case 26:case 27:case 5:mt(i);break;case 4:ge();break;case 31:i.memoizedState!==null&&En(i);break;case 13:En(i);break;case 19:G(At);break;case 10:As(i.type);break;case 22:case 23:En(i),Yd(),n!==null&&G(ea);break;case 24:As(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,j=o.inst;u=g(),j.destroy=u}o=o.next}while(o!==h)}}catch(_){et(i,i.return,_)}}function ui(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 j=u.inst,_=j.destroy;if(_!==void 0){j.destroy=void 0,h=i;var L=o,Z=_;try{Z()}catch(Y){et(h,L,Y)}}}u=u.next}while(u!==g)}}catch(Y){et(i,i.return,Y)}}function r0(n){var i=n.updateQueue;if(i!==null){var o=n.stateNode;try{Yg(i,o)}catch(u){et(n,n.return,u)}}}function o0(n,i,o){o.props=aa(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 ps(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 l0(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 Ef(n,i,o){try{var u=n.stateNode;AC(u,n.type,o,i),u[Nt]=i}catch(h){et(n,n.return,h)}}function c0(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&yi(n.type)||n.tag===4}function Af(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||c0(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&&yi(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 Rf(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=Cs));else if(u!==4&&(u===27&&yi(n.type)&&(o=n.stateNode,i=null),n=n.child,n!==null))for(Rf(n,i,o),n=n.sibling;n!==null;)Rf(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&&yi(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 u0(n){var i=n.stateNode,o=n.memoizedProps;try{for(var u=n.type,h=i.attributes;h.length;)i.removeAttributeNode(h[0]);Wt(i,u,o),i[Et]=n,i[Nt]=o}catch(g){et(n,n.return,g)}}var Ls=!1,It=!1,Tf=!1,d0=typeof WeakSet=="function"?WeakSet:Set,Kt=null;function cC(n,i){if(n=n.containerInfo,Wf=Cc,n=wg(n),Nd(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 j=0,_=-1,L=-1,Z=0,Y=0,ee=n,F=null;t:for(;;){for(var V;ee!==o||h!==0&&ee.nodeType!==3||(_=j+h),ee!==g||u!==0&&ee.nodeType!==3||(L=j+u),ee.nodeType===3&&(j+=ee.nodeValue.length),(V=ee.firstChild)!==null;)F=ee,ee=V;for(;;){if(ee===n)break t;if(F===o&&++Z===h&&(_=j),F===g&&++Y===u&&(L=j),(V=ee.nextSibling)!==null)break;ee=F,F=ee.parentNode}ee=V}o=_===-1||L===-1?null:{start:_,end:L}}else o=null}o=o||{start:0,end:0}}else o=null;for(eh={focusedElem:n,selectionRange:o},Cc=!1,Kt=i;Kt!==null;)if(i=Kt,n=i.child,(i.subtreeFlags&1028)!==0&&n!==null)n.return=i,Kt=n;else for(;Kt!==null;){switch(i=Kt,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=aa(o.type,h);n=u.getSnapshotBeforeUpdate(ye,g),u.__reactInternalSnapshotBeforeUpdate=n}catch(Ce){et(o,o.return,Ce)}}break;case 3:if((n&1024)!==0){if(n=i.stateNode.containerInfo,o=n.nodeType,o===9)sh(n);else if(o===1)switch(n.nodeName){case"HEAD":case"HTML":case"BODY":sh(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,Kt=n;break}Kt=i.return}}function f0(n,i,o){var u=o.flags;switch(o.tag){case 0:case 11:case 15:Us(n,o),u&4&&po(5,o);break;case 1:if(Us(n,o),u&4)if(n=o.stateNode,i===null)try{n.componentDidMount()}catch(j){et(o,o.return,j)}else{var h=aa(o.type,i.memoizedProps);i=i.memoizedState;try{n.componentDidUpdate(h,i,n.__reactInternalSnapshotBeforeUpdate)}catch(j){et(o,o.return,j)}}u&64&&r0(o),u&512&&go(o,o.return);break;case 3:if(Us(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{Yg(n,i)}catch(j){et(o,o.return,j)}}break;case 27:i===null&&u&4&&u0(o);case 26:case 5:Us(n,o),i===null&&u&4&&l0(o),u&512&&go(o,o.return);break;case 12:Us(n,o);break;case 31:Us(n,o),u&4&&p0(n,o);break;case 13:Us(n,o),u&4&&g0(n,o),u&64&&(n=o.memoizedState,n!==null&&(n=n.dehydrated,n!==null&&(o=vC.bind(null,o),$C(n,o))));break;case 22:if(u=o.memoizedState!==null||Ls,!u){i=i!==null&&i.memoizedState!==null||It,h=Ls;var g=It;Ls=u,(It=i)&&!g?$s(n,o,(o.subtreeFlags&8772)!==0):Us(n,o),Ls=h,It=g}break;case 30:break;default:Us(n,o)}}function h0(n){var i=n.alternate;i!==null&&(n.alternate=null,h0(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 gt=null,pn=!1;function Ms(n,i,o){for(o=o.child;o!==null;)m0(n,i,o),o=o.sibling}function m0(n,i,o){if(_e&&typeof _e.onCommitFiberUnmount=="function")try{_e.onCommitFiberUnmount(ls,o)}catch{}switch(o.tag){case 26:It||ps(o,i),Ms(n,i,o),o.memoizedState?o.memoizedState.count--:o.stateNode&&(o=o.stateNode,o.parentNode.removeChild(o));break;case 27:It||ps(o,i);var u=gt,h=pn;yi(o.type)&&(gt=o.stateNode,pn=!1),Ms(n,i,o),Co(o.stateNode),gt=u,pn=h;break;case 5:It||ps(o,i);case 6:if(u=gt,h=pn,gt=null,Ms(n,i,o),gt=u,pn=h,gt!==null)if(pn)try{(gt.nodeType===9?gt.body:gt.nodeName==="HTML"?gt.ownerDocument.body:gt).removeChild(o.stateNode)}catch(g){et(o,i,g)}else try{gt.removeChild(o.stateNode)}catch(g){et(o,i,g)}break;case 18:gt!==null&&(pn?(n=gt,rv(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,o.stateNode),hr(n)):rv(gt,o.stateNode));break;case 4:u=gt,h=pn,gt=o.stateNode.containerInfo,pn=!0,Ms(n,i,o),gt=u,pn=h;break;case 0:case 11:case 14:case 15:ui(2,o,i),It||ui(4,o,i),Ms(n,i,o);break;case 1:It||(ps(o,i),u=o.stateNode,typeof u.componentWillUnmount=="function"&&o0(o,i,u)),Ms(n,i,o);break;case 21:Ms(n,i,o);break;case 22:It=(u=It)||o.memoizedState!==null,Ms(n,i,o),It=u;break;default:Ms(n,i,o)}}function p0(n,i){if(i.memoizedState===null&&(n=i.alternate,n!==null&&(n=n.memoizedState,n!==null))){n=n.dehydrated;try{hr(n)}catch(o){et(i,i.return,o)}}}function g0(n,i){if(i.memoizedState===null&&(n=i.alternate,n!==null&&(n=n.memoizedState,n!==null&&(n=n.dehydrated,n!==null))))try{hr(n)}catch(o){et(i,i.return,o)}}function uC(n){switch(n.tag){case 31:case 13:case 19:var i=n.stateNode;return i===null&&(i=n.stateNode=new d0),i;case 22:return n=n.stateNode,i=n._retryCache,i===null&&(i=n._retryCache=new d0),i;default:throw Error(a(435,n.tag))}}function ac(n,i){var o=uC(n);i.forEach(function(u){if(!o.has(u)){o.add(u);var h=bC.bind(null,n,u);u.then(h,h)}})}function gn(n,i){var o=i.deletions;if(o!==null)for(var u=0;u<o.length;u++){var h=o[u],g=n,j=i,_=j;e:for(;_!==null;){switch(_.tag){case 27:if(yi(_.type)){gt=_.stateNode,pn=!1;break e}break;case 5:gt=_.stateNode,pn=!1;break e;case 3:case 4:gt=_.stateNode.containerInfo,pn=!0;break e}_=_.return}if(gt===null)throw Error(a(160));m0(g,j,h),gt=null,pn=!1,g=h.alternate,g!==null&&(g.return=null),h.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)y0(i,n),i=i.sibling}var Wn=null;function y0(n,i){var o=n.alternate,u=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:gn(i,n),yn(n),u&4&&(ui(3,n,n.return),po(3,n),ui(5,n,n.return));break;case 1:gn(i,n),yn(n),u&512&&(It||o===null||ps(o,o.return)),u&64&&Ls&&(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=Wn;if(gn(i,n),yn(n),u&512&&(It||o===null||ps(o,o.return)),u&4){var g=o!==null?o.memoizedState:null;if(u=n.memoizedState,o===null)if(u===null)if(n.stateNode===null){e:{u=n.type,o=n.memoizedProps,h=h.ownerDocument||h;t:switch(u){case"title":g=h.getElementsByTagName("title")[0],(!g||g[ds]||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"))),Wt(g,u,o),g[Et]=n,Mt(g),u=g;break e;case"link":var j=yv("link","href",h).get(u+(o.href||""));if(j){for(var _=0;_<j.length;_++)if(g=j[_],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)){j.splice(_,1);break t}}g=h.createElement(u),Wt(g,u,o),h.head.appendChild(g);break;case"meta":if(j=yv("meta","content",h).get(u+(o.content||""))){for(_=0;_<j.length;_++)if(g=j[_],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)){j.splice(_,1);break t}}g=h.createElement(u),Wt(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 vv(h,n.type,n.stateNode);else n.stateNode=gv(h,u,n.memoizedProps);else g!==u?(g===null?o.stateNode!==null&&(o=o.stateNode,o.parentNode.removeChild(o)):g.count--,u===null?vv(h,n.type,n.stateNode):gv(h,u,n.memoizedProps)):u===null&&n.stateNode!==null&&Ef(n,n.memoizedProps,o.memoizedProps)}break;case 27:gn(i,n),yn(n),u&512&&(It||o===null||ps(o,o.return)),o!==null&&u&4&&Ef(n,n.memoizedProps,o.memoizedProps);break;case 5:if(gn(i,n),yn(n),u&512&&(It||o===null||ps(o,o.return)),n.flags&32){h=n.stateNode;try{Ma(h,"")}catch(ye){et(n,n.return,ye)}}u&4&&n.stateNode!=null&&(h=n.memoizedProps,Ef(n,h,o!==null?o.memoizedProps:h)),u&1024&&(Tf=!0);break;case 6:if(gn(i,n),yn(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=Wn,Wn=bc(i.containerInfo),gn(i,n),Wn=h,yn(n),u&4&&o!==null&&o.memoizedState.isDehydrated)try{hr(i.containerInfo)}catch(ye){et(n,n.return,ye)}Tf&&(Tf=!1,v0(n));break;case 4:u=Wn,Wn=bc(n.stateNode.containerInfo),gn(i,n),yn(n),Wn=u;break;case 12:gn(i,n),yn(n);break;case 31:gn(i,n),yn(n),u&4&&(u=n.updateQueue,u!==null&&(n.updateQueue=null,ac(n,u)));break;case 13:gn(i,n),yn(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 L=o!==null&&o.memoizedState!==null,Z=Ls,Y=It;if(Ls=Z||h,It=Y||L,gn(i,n),It=Y,Ls=Z,yn(n),u&8192)e:for(i=n.stateNode,i._visibility=h?i._visibility&-2:i._visibility|1,h&&(o===null||L||Ls||It||ra(n)),o=null,i=n;;){if(i.tag===5||i.tag===26){if(o===null){L=o=i;try{if(g=L.stateNode,h)j=g.style,typeof j.setProperty=="function"?j.setProperty("display","none","important"):j.display="none";else{_=L.stateNode;var ee=L.memoizedProps.style,F=ee!=null&&ee.hasOwnProperty("display")?ee.display:null;_.style.display=F==null||typeof F=="boolean"?"":(""+F).trim()}}catch(ye){et(L,L.return,ye)}}}else if(i.tag===6){if(o===null){L=i;try{L.stateNode.nodeValue=h?"":L.memoizedProps}catch(ye){et(L,L.return,ye)}}}else if(i.tag===18){if(o===null){L=i;try{var V=L.stateNode;h?ov(V,!0):ov(L.stateNode,!1)}catch(ye){et(L,L.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:gn(i,n),yn(n),u&4&&(u=n.updateQueue,u!==null&&(n.updateQueue=null,ac(n,u)));break;case 30:break;case 21:break;default:gn(i,n),yn(n)}}function yn(n){var i=n.flags;if(i&2){try{for(var o,u=n.return;u!==null;){if(c0(u)){o=u;break}u=u.return}if(o==null)throw Error(a(160));switch(o.tag){case 27:var h=o.stateNode,g=Af(n);ic(n,g,h);break;case 5:var j=o.stateNode;o.flags&32&&(Ma(j,""),o.flags&=-33);var _=Af(n);ic(n,_,j);break;case 3:case 4:var L=o.stateNode.containerInfo,Z=Af(n);Rf(n,Z,L);break;default:throw Error(a(161))}}catch(Y){et(n,n.return,Y)}n.flags&=-3}i&4096&&(n.flags&=-4097)}function v0(n){if(n.subtreeFlags&1024)for(n=n.child;n!==null;){var i=n;v0(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),n=n.sibling}}function Us(n,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)f0(n,i.alternate,i),i=i.sibling}function ra(n){for(n=n.child;n!==null;){var i=n;switch(i.tag){case 0:case 11:case 14:case 15:ui(4,i,i.return),ra(i);break;case 1:ps(i,i.return);var o=i.stateNode;typeof o.componentWillUnmount=="function"&&o0(i,i.return,o),ra(i);break;case 27:Co(i.stateNode);case 26:case 5:ps(i,i.return),ra(i);break;case 22:i.memoizedState===null&&ra(i);break;case 30:ra(i);break;default:ra(i)}n=n.sibling}}function $s(n,i,o){for(o=o&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var u=i.alternate,h=n,g=i,j=g.flags;switch(g.tag){case 0:case 11:case 15:$s(h,g,o),po(4,g);break;case 1:if($s(h,g,o),u=g,h=u.stateNode,typeof h.componentDidMount=="function")try{h.componentDidMount()}catch(Z){et(u,u.return,Z)}if(u=g,h=u.updateQueue,h!==null){var _=u.stateNode;try{var L=h.shared.hiddenCallbacks;if(L!==null)for(h.shared.hiddenCallbacks=null,h=0;h<L.length;h++)Qg(L[h],_)}catch(Z){et(u,u.return,Z)}}o&&j&64&&r0(g),go(g,g.return);break;case 27:u0(g);case 26:case 5:$s(h,g,o),o&&u===null&&j&4&&l0(g),go(g,g.return);break;case 12:$s(h,g,o);break;case 31:$s(h,g,o),o&&j&4&&p0(h,g);break;case 13:$s(h,g,o),o&&j&4&&g0(h,g);break;case 22:g.memoizedState===null&&$s(h,g,o),go(g,g.return);break;case 30:break;default:$s(h,g,o)}i=i.sibling}}function Of(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 Df(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 es(n,i,o,u){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)b0(n,i,o,u),i=i.sibling}function b0(n,i,o,u){var h=i.flags;switch(i.tag){case 0:case 11:case 15:es(n,i,o,u),h&2048&&po(9,i);break;case 1:es(n,i,o,u);break;case 3:es(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){es(n,i,o,u),n=i.stateNode;try{var g=i.memoizedProps,j=g.id,_=g.onPostCommit;typeof _=="function"&&_(j,i.alternate===null?"mount":"update",n.passiveEffectDuration,-0)}catch(L){et(i,i.return,L)}}else es(n,i,o,u);break;case 31:es(n,i,o,u);break;case 13:es(n,i,o,u);break;case 23:break;case 22:g=i.stateNode,j=i.alternate,i.memoizedState!==null?g._visibility&2?es(n,i,o,u):yo(n,i):g._visibility&2?es(n,i,o,u):(g._visibility|=2,nr(n,i,o,u,(i.subtreeFlags&10256)!==0||!1)),h&2048&&Of(j,i);break;case 24:es(n,i,o,u),h&2048&&Df(i.alternate,i);break;default:es(n,i,o,u)}}function nr(n,i,o,u,h){for(h=h&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var g=n,j=i,_=o,L=u,Z=j.flags;switch(j.tag){case 0:case 11:case 15:nr(g,j,_,L,h),po(8,j);break;case 23:break;case 22:var Y=j.stateNode;j.memoizedState!==null?Y._visibility&2?nr(g,j,_,L,h):yo(g,j):(Y._visibility|=2,nr(g,j,_,L,h)),h&&Z&2048&&Of(j.alternate,j);break;case 24:nr(g,j,_,L,h),h&&Z&2048&&Df(j.alternate,j);break;default:nr(g,j,_,L,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&&Of(u.alternate,u);break;case 24:yo(o,u),h&2048&&Df(u.alternate,u);break;default:yo(o,u)}i=i.sibling}}var vo=8192;function sr(n,i,o){if(n.subtreeFlags&vo)for(n=n.child;n!==null;)x0(n,i,o),n=n.sibling}function x0(n,i,o){switch(n.tag){case 26:sr(n,i,o),n.flags&vo&&n.memoizedState!==null&&YC(o,Wn,n.memoizedState,n.memoizedProps);break;case 5:sr(n,i,o);break;case 3:case 4:var u=Wn;Wn=bc(n.stateNode.containerInfo),sr(n,i,o),Wn=u;break;case 22:n.memoizedState===null&&(u=n.alternate,u!==null&&u.memoizedState!==null?(u=vo,vo=16777216,sr(n,i,o),vo=u):sr(n,i,o));break;default:sr(n,i,o)}}function S0(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];Kt=u,w0(u,n)}S0(n)}if(n.subtreeFlags&10256)for(n=n.child;n!==null;)j0(n),n=n.sibling}function j0(n){switch(n.tag){case 0:case 11:case 15:bo(n),n.flags&2048&&ui(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];Kt=u,w0(u,n)}S0(n)}for(n=n.child;n!==null;){switch(i=n,i.tag){case 0:case 11:case 15:ui(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(;Kt!==null;){var o=Kt;switch(o.tag){case 0:case 11:case 15:ui(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,Kt=u;else e:for(o=n;Kt!==null;){u=Kt;var h=u.sibling,g=u.return;if(h0(u),u===o){Kt=null;break e}if(h!==null){h.return=g,Kt=h;break e}Kt=g}}}var dC={getCacheForType:function(n){var i=Jt(Ut),o=i.data.get(n);return o===void 0&&(o=n(),i.data.set(n,o)),o},cacheSignal:function(){return Jt(Ut).controller.signal}},fC=typeof WeakMap=="function"?WeakMap:Map,Ye=0,lt=null,Me=null,Be=0,We=0,An=null,di=!1,ir=!1,Lf=!1,Ps=0,kt=0,fi=0,oa=0,Mf=0,Rn=0,ar=0,xo=null,vn=null,Uf=!1,oc=0,N0=0,lc=1/0,cc=null,hi=null,Ft=0,mi=null,rr=null,Is=0,$f=0,Pf=null,C0=null,So=0,If=null;function Tn(){return(Ye&2)!==0&&Be!==0?Be&-Be:B.T!==null?Gf():st()}function k0(){if(Rn===0)if((Be&536870912)===0||He){var n=ws;ws<<=1,(ws&3932160)===0&&(ws=262144),Rn=n}else Rn=536870912;return n=zn.current,n!==null&&(n.flags|=32),Rn}function bn(n,i,o){(n===lt&&(We===2||We===9)||n.cancelPendingCommit!==null)&&(or(n,0),pi(n,Be,Rn,!1)),Fi(n,o),((Ye&2)===0||n!==lt)&&(n===lt&&((Ye&2)===0&&(oa|=o),kt===4&&pi(n,Be,Rn,!1)),gs(n))}function _0(n,i,o){if((Ye&6)!==0)throw Error(a(327));var u=!o&&(i&127)===0&&(i&n.expiredLanes)===0||us(n,i),h=u?pC(n,i):qf(n,i,!0),g=u;do{if(h===0){ir&&!u&&pi(n,i,0,!1);break}else{if(o=n.current.alternate,g&&!hC(o)){h=qf(n,i,!1),g=!1;continue}if(h===2){if(g=i,n.errorRecoveryDisabledLanes&g)var j=0;else j=n.pendingLanes&-536870913,j=j!==0?j:j&536870912?536870912:0;if(j!==0){i=j;e:{var _=n;h=xo;var L=_.current.memoizedState.isDehydrated;if(L&&(or(_,j).flags|=256),j=qf(_,j,!1),j!==2){if(Lf&&!L){_.errorRecoveryDisabledLanes|=g,oa|=g,h=4;break e}g=vn,vn=h,g!==null&&(vn===null?vn=g:vn.push.apply(vn,g))}h=j}if(g=!1,h!==2)continue}}if(h===1){or(n,0),pi(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:pi(u,i,Rn,!di);break e;case 2:vn=null;break;case 3:case 5:break;default:throw Error(a(329))}if((i&62914560)===i&&(h=oc+300-Pe(),10<h)){if(pi(u,i,Rn,!di),Ra(u,0,!0)!==0)break e;Is=i,u.timeoutHandle=iv(z0.bind(null,u,o,vn,cc,Uf,i,Rn,oa,ar,di,g,"Throttled",-0,0),h);break e}z0(u,o,vn,cc,Uf,i,Rn,oa,ar,di,g,null,-0,0)}}break}while(!0);gs(n)}function z0(n,i,o,u,h,g,j,_,L,Z,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:Cs},x0(i,g,ee);var ye=(g&62914560)===g?oc-Pe():(g&4194048)===g?N0-Pe():0;if(ye=JC(ee,ye),ye!==null){Is=g,n.cancelPendingCommit=ye(M0.bind(null,n,i,g,o,u,h,j,_,L,Y,ee,null,F,V)),pi(n,g,j,!Z);return}}M0(n,i,g,o,u,h,j,_,L)}function hC(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(!kn(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 pi(n,i,o,u){i&=~Mf,i&=~oa,n.suspendedLanes|=i,n.pingedLanes&=~i,u&&(n.warmLanes|=i),u=n.expirationTimes;for(var h=i;0<h;){var g=31-Ge(h),j=1<<g;u[g]=-1,h&=~j}o!==0&&vl(n,o,i)}function uc(){return(Ye&6)===0?(jo(0),!1):!0}function Bf(){if(Me!==null){if(We===0)var n=Me.return;else n=Me,Es=Xi=null,nf(n),Ja=null,so=0,n=Me;for(;n!==null;)a0(n.alternate,n),n=n.return;Me=null}}function or(n,i){var o=n.timeoutHandle;o!==-1&&(n.timeoutHandle=-1,OC(o)),o=n.cancelPendingCommit,o!==null&&(n.cancelPendingCommit=null,o()),Is=0,Bf(),lt=n,Me=o=_s(n.current,null),Be=i,We=0,An=null,di=!1,ir=us(n,i),Lf=!1,ar=Rn=Mf=oa=fi=kt=0,vn=xo=null,Uf=!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-Ge(u),g=1<<h;i|=n[h],u&=~g}return Ps=i,Rl(),o}function E0(n,i){Re=null,B.H=fo,i===Ya||i===Pl?(i=Fg(),We=3):i===Zd?(i=Fg(),We=4):We=i===bf?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,An=i,Me===null&&(kt=1,Wl(n,Mn(i,n.current)))}function A0(){var n=zn.current;return n===null?!0:(Be&4194048)===Be?In===null:(Be&62914560)===Be||(Be&536870912)!==0?n===In:!1}function R0(){var n=B.H;return B.H=fo,n===null?fo:n}function T0(){var n=B.A;return B.A=dC,n}function dc(){kt=4,di||(Be&4194048)!==Be&&zn.current!==null||(ir=!0),(fi&134217727)===0&&(oa&134217727)===0||lt===null||pi(lt,Be,Rn,!1)}function qf(n,i,o){var u=Ye;Ye|=2;var h=R0(),g=T0();(lt!==n||Be!==i)&&(cc=null,or(n,i)),i=!1;var j=kt;e:do try{if(We!==0&&Me!==null){var _=Me,L=An;switch(We){case 8:Bf(),j=6;break e;case 3:case 2:case 9:case 6:zn.current===null&&(i=!0);var Z=We;if(We=0,An=null,lr(n,_,L,Z),o&&ir){j=0;break e}break;default:Z=We,We=0,An=null,lr(n,_,L,Z)}}mC(),j=kt;break}catch(Y){E0(n,Y)}while(!0);return i&&n.shellSuspendCounter++,Es=Xi=null,Ye=u,B.H=h,B.A=g,Me===null&&(lt=null,Be=0,Rl()),j}function mC(){for(;Me!==null;)O0(Me)}function pC(n,i){var o=Ye;Ye|=2;var u=R0(),h=T0();lt!==n||Be!==i?(cc=null,lc=Pe()+500,or(n,i)):ir=us(n,i);e:do try{if(We!==0&&Me!==null){i=Me;var g=An;t:switch(We){case 1:We=0,An=null,lr(n,i,g,1);break;case 2:case 9:if(Hg(g)){We=0,An=null,D0(i);break}i=function(){We!==2&&We!==9||lt!==n||(We=7),gs(n)},g.then(i,i);break e;case 3:We=7;break e;case 4:We=5;break e;case 7:Hg(g)?(We=0,An=null,D0(i)):(We=0,An=null,lr(n,i,g,7));break;case 5:var j=null;switch(Me.tag){case 26:j=Me.memoizedState;case 5:case 27:var _=Me;if(j?bv(j):_.stateNode.complete){We=0,An=null;var L=_.sibling;if(L!==null)Me=L;else{var Z=_.return;Z!==null?(Me=Z,fc(Z)):Me=null}break t}}We=0,An=null,lr(n,i,g,5);break;case 6:We=0,An=null,lr(n,i,g,6);break;case 8:Bf(),kt=6;break e;default:throw Error(a(462))}}gC();break}catch(Y){E0(n,Y)}while(!0);return Es=Xi=null,B.H=u,B.A=h,Ye=o,Me!==null?0:(lt=null,Be=0,Rl(),kt)}function gC(){for(;Me!==null&&!re();)O0(Me)}function O0(n){var i=s0(n.alternate,n,Ps);n.memoizedProps=n.pendingProps,i===null?fc(n):Me=i}function D0(n){var i=n,o=i.alternate;switch(i.tag){case 15:case 0:i=Jy(o,i,i.pendingProps,i.type,void 0,Be);break;case 11:i=Jy(o,i,i.pendingProps,i.type.render,i.ref,Be);break;case 5:nf(i);default:a0(o,i),i=Me=Tg(i,Ps),i=s0(o,i,Ps)}n.memoizedProps=n.pendingProps,i===null?fc(n):Me=i}function lr(n,i,o,u){Es=Xi=null,nf(i),Ja=null,so=0;var h=i.return;try{if(iC(n,h,i,o,Be)){kt=1,Wl(n,Mn(o,n.current)),Me=null;return}}catch(g){if(h!==null)throw Me=h,g;kt=1,Wl(n,Mn(o,n.current)),Me=null;return}i.flags&32768?(He||u===1?n=!0:ir||(Be&536870912)!==0?n=!1:(di=n=!0,(u===2||u===9||u===3||u===6)&&(u=zn.current,u!==null&&u.tag===13&&(u.flags|=16384))),L0(i,n)):fc(i)}function fc(n){var i=n;do{if((i.flags&32768)!==0){L0(i,di);return}n=i.return;var o=oC(i.alternate,i,Ps);if(o!==null){Me=o;return}if(i=i.sibling,i!==null){Me=i;return}Me=i=n}while(i!==null);kt===0&&(kt=5)}function L0(n,i){do{var o=lC(n.alternate,n);if(o!==null){o.flags&=32767,Me=o;return}if(o=n.return,o!==null&&(o.flags|=32768,o.subtreeFlags=0,o.deletions=null),!i&&(n=n.sibling,n!==null)){Me=n;return}Me=n=o}while(n!==null);kt=6,Me=null}function M0(n,i,o,u,h,g,j,_,L){n.cancelPendingCommit=null;do hc();while(Ft!==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|=Ed,rd(n,o,g,j,_,L),n===lt&&(Me=lt=null,Be=0),rr=i,mi=n,Is=o,$f=g,Pf=h,C0=u,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(n.callbackNode=null,n.callbackPriority=0,xC(an,function(){return B0(),null})):(n.callbackNode=null,n.callbackPriority=0),u=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||u){u=B.T,B.T=null,h=O.p,O.p=2,j=Ye,Ye|=4;try{cC(n,i,o)}finally{Ye=j,O.p=h,B.T=u}}Ft=1,U0(),$0(),P0()}}function U0(){if(Ft===1){Ft=0;var n=mi,i=rr,o=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||o){o=B.T,B.T=null;var u=O.p;O.p=2;var h=Ye;Ye|=4;try{y0(i,n);var g=eh,j=wg(n.containerInfo),_=g.focusedElem,L=g.selectionRange;if(j!==_&&_&&_.ownerDocument&&jg(_.ownerDocument.documentElement,_)){if(L!==null&&Nd(_)){var Z=L.start,Y=L.end;if(Y===void 0&&(Y=Z),"selectionStart"in _)_.selectionStart=Z,_.selectionEnd=Math.min(Y,_.value.length);else{var ee=_.ownerDocument||document,F=ee&&ee.defaultView||window;if(F.getSelection){var V=F.getSelection(),ye=_.textContent.length,Ce=Math.min(L.start,ye),ot=L.end===void 0?Ce:Math.min(L.end,ye);!V.extend&&Ce>ot&&(j=ot,ot=Ce,Ce=j);var I=Sg(_,Ce),$=Sg(_,ot);if(I&&$&&(V.rangeCount!==1||V.anchorNode!==I.node||V.anchorOffset!==I.offset||V.focusNode!==$.node||V.focusOffset!==$.offset)){var H=ee.createRange();H.setStart(I.node,I.offset),V.removeAllRanges(),Ce>ot?(V.addRange(H),V.extend($.node,$.offset)):(H.setEnd($.node,$.offset),V.addRange(H))}}}}for(ee=[],V=_;V=V.parentNode;)V.nodeType===1&&ee.push({element:V,left:V.scrollLeft,top:V.scrollTop});for(typeof _.focus=="function"&&_.focus(),_=0;_<ee.length;_++){var J=ee[_];J.element.scrollLeft=J.left,J.element.scrollTop=J.top}}Cc=!!Wf,eh=Wf=null}finally{Ye=h,O.p=u,B.T=o}}n.current=i,Ft=2}}function $0(){if(Ft===2){Ft=0;var n=mi,i=rr,o=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||o){o=B.T,B.T=null;var u=O.p;O.p=2;var h=Ye;Ye|=4;try{f0(n,i.alternate,i)}finally{Ye=h,O.p=u,B.T=o}}Ft=3}}function P0(){if(Ft===4||Ft===3){Ft=0,$e();var n=mi,i=rr,o=Is,u=C0;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?Ft=5:(Ft=0,rr=mi=null,I0(n,n.pendingLanes));var h=n.pendingLanes;if(h===0&&(hi=null),ue(o),i=i.stateNode,_e&&typeof _e.onCommitFiberRoot=="function")try{_e.onCommitFiberRoot(ls,i,void 0,(i.current.flags&128)===128)}catch{}if(u!==null){i=B.T,h=O.p,O.p=2,B.T=null;try{for(var g=n.onRecoverableError,j=0;j<u.length;j++){var _=u[j];g(_.value,{componentStack:_.stack})}}finally{B.T=i,O.p=h}}(Is&3)!==0&&hc(),gs(n),h=n.pendingLanes,(o&261930)!==0&&(h&42)!==0?n===If?So++:(So=0,If=n):So=0,jo(0)}}function I0(n,i){(n.pooledCacheLanes&=i)===0&&(i=n.pooledCache,i!=null&&(n.pooledCache=null,to(i)))}function hc(){return U0(),$0(),P0(),B0()}function B0(){if(Ft!==5)return!1;var n=mi,i=$f;$f=0;var o=ue(Is),u=B.T,h=O.p;try{O.p=32>o?32:o,B.T=null,o=Pf,Pf=null;var g=mi,j=Is;if(Ft=0,rr=mi=null,Is=0,(Ye&6)!==0)throw Error(a(331));var _=Ye;if(Ye|=4,j0(g.current),b0(g,g.current,j,o),Ye=_,jo(0,!1),_e&&typeof _e.onPostCommitFiberRoot=="function")try{_e.onPostCommitFiberRoot(ls,g)}catch{}return!0}finally{O.p=h,B.T=u,I0(n,i)}}function q0(n,i,o){i=Mn(o,i),i=vf(n.stateNode,i,2),n=oi(n,i,2),n!==null&&(Fi(n,2),gs(n))}function et(n,i,o){if(n.tag===3)q0(n,n,o);else for(;i!==null;){if(i.tag===3){q0(i,n,o);break}else if(i.tag===1){var u=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(hi===null||!hi.has(u))){n=Mn(o,n),o=Hy(2),u=oi(i,o,2),u!==null&&(Zy(o,u,i,n),Fi(u,2),gs(u));break}}i=i.return}}function Hf(n,i,o){var u=n.pingCache;if(u===null){u=n.pingCache=new fC;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)||(Lf=!0,h.add(o),n=yC.bind(null,n,i,o),i.then(n,n))}function yC(n,i,o){var u=n.pingCache;u!==null&&u.delete(i),n.pingedLanes|=n.suspendedLanes&o,n.warmLanes&=~o,lt===n&&(Be&o)===o&&(kt===4||kt===3&&(Be&62914560)===Be&&300>Pe()-oc?(Ye&2)===0&&or(n,0):Mf|=o,ar===Be&&(ar=0)),gs(n)}function H0(n,i){i===0&&(i=yl()),n=Qi(n,i),n!==null&&(Fi(n,i),gs(n))}function vC(n){var i=n.memoizedState,o=0;i!==null&&(o=i.retryLane),H0(n,o)}function bC(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),H0(n,o)}function xC(n,i){return xt(n,i)}var mc=null,cr=null,Zf=!1,pc=!1,Ff=!1,gi=0;function gs(n){n!==cr&&n.next===null&&(cr===null?mc=cr=n:cr=cr.next=n),pc=!0,Zf||(Zf=!0,jC())}function jo(n,i){if(!Ff&&pc){Ff=!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 j=u.suspendedLanes,_=u.pingedLanes;g=(1<<31-Ge(42|n)+1)-1,g&=h&~(j&~_),g=g&201326741?g&201326741|1:g?g|2:0}g!==0&&(o=!0,K0(u,g))}else g=Be,g=Ra(u,u===lt?g:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),(g&3)===0||us(u,g)||(o=!0,K0(u,g));u=u.next}while(o);Ff=!1}}function SC(){Z0()}function Z0(){pc=Zf=!1;var n=0;gi!==0&&TC()&&(n=gi);for(var i=Pe(),o=null,u=mc;u!==null;){var h=u.next,g=F0(u,i);g===0?(u.next=null,o===null?mc=h:o.next=h,h===null&&(cr=o)):(o=u,(n!==0||(g&3)!==0)&&(pc=!0)),u=h}Ft!==0&&Ft!==5||jo(n),gi!==0&&(gi=0)}function F0(n,i){for(var o=n.suspendedLanes,u=n.pingedLanes,h=n.expirationTimes,g=n.pendingLanes&-62914561;0<g;){var j=31-Ge(g),_=1<<j,L=h[j];L===-1?((_&o)===0||(_&u)!==0)&&(h[j]=gl(_,i)):L<=i&&(n.expiredLanes|=_),g&=~_}if(i=lt,o=Be,o=Ra(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&&hn(u),n.callbackNode=null,n.callbackPriority=0;if((o&3)===0||us(n,o)){if(i=o&-o,i===n.callbackPriority)return i;switch(u!==null&&hn(u),ue(o)){case 2:case 8:o=pt;break;case 32:o=an;break;case 268435456:o=Ks;break;default:o=an}return u=G0.bind(null,n),o=xt(o,u),n.callbackPriority=i,n.callbackNode=o,i}return u!==null&&u!==null&&hn(u),n.callbackPriority=2,n.callbackNode=null,2}function G0(n,i){if(Ft!==0&&Ft!==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=Ra(n,n===lt?u:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),u===0?null:(_0(n,u,i),F0(n,Pe()),n.callbackNode!=null&&n.callbackNode===o?G0.bind(null,n):null)}function K0(n,i){if(hc())return null;_0(n,i,!0)}function jC(){DC(function(){(Ye&6)!==0?xt(De,SC):Z0()})}function Gf(){if(gi===0){var n=Va;n===0&&(n=Qs,Qs<<=1,(Qs&261888)===0&&(Qs=256)),gi=n}return gi}function V0(n){return n==null||typeof n=="symbol"||typeof n=="boolean"?null:typeof n=="function"?n:wl(""+n)}function Q0(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 wC(n,i,o,u,h){if(i==="submit"&&o&&o.stateNode===h){var g=V0((h[Nt]||null).action),j=u.submitter;j&&(i=(i=j[Nt]||null)?V0(i.formAction):j.getAttribute("formAction"),i!==null&&(g=i,j=null));var _=new _l("action","action",null,u,h);n.push({event:_,listeners:[{instance:null,listener:function(){if(u.defaultPrevented){if(gi!==0){var L=j?Q0(h,j):new FormData(h);ff(o,{pending:!0,data:L,method:h.method,action:g},null,L)}}else typeof g=="function"&&(_.preventDefault(),L=j?Q0(h,j):new FormData(h),ff(o,{pending:!0,data:L,method:h.method,action:g},g,L))},currentTarget:h}]})}}for(var Kf=0;Kf<zd.length;Kf++){var Vf=zd[Kf],NC=Vf.toLowerCase(),CC=Vf[0].toUpperCase()+Vf.slice(1);Xn(NC,"on"+CC)}Xn(kg,"onAnimationEnd"),Xn(_g,"onAnimationIteration"),Xn(zg,"onAnimationStart"),Xn("dblclick","onDoubleClick"),Xn("focusin","onFocus"),Xn("focusout","onBlur"),Xn(B1,"onTransitionRun"),Xn(q1,"onTransitionStart"),Xn(H1,"onTransitionCancel"),Xn(Eg,"onTransitionEnd"),rn("onMouseEnter",["mouseout","mouseover"]),rn("onMouseLeave",["mouseout","mouseover"]),rn("onPointerEnter",["pointerout","pointerover"]),rn("onPointerLeave",["pointerout","pointerover"]),Zt("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Zt("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Zt("onBeforeInput",["compositionend","keypress","textInput","paste"]),Zt("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Zt("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Zt("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var wo="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(" "),kC=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(wo));function Y0(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 j=u.length-1;0<=j;j--){var _=u[j],L=_.instance,Z=_.currentTarget;if(_=_.listener,L!==g&&h.isPropagationStopped())break e;g=_,h.currentTarget=Z;try{g(h)}catch(Y){Al(Y)}h.currentTarget=null,g=L}else for(j=0;j<u.length;j++){if(_=u[j],L=_.instance,Z=_.currentTarget,_=_.listener,L!==g&&h.isPropagationStopped())break e;g=_,h.currentTarget=Z;try{g(h)}catch(Y){Al(Y)}h.currentTarget=null,g=L}}}}function Ue(n,i){var o=i[en];o===void 0&&(o=i[en]=new Set);var u=n+"__bubble";o.has(u)||(J0(i,n,2,!1),o.add(u))}function Qf(n,i,o){var u=0;i&&(u|=4),J0(o,n,u,i)}var gc="_reactListening"+Math.random().toString(36).slice(2);function Yf(n){if(!n[gc]){n[gc]=!0,Ie.forEach(function(o){o!=="selectionchange"&&(kC.has(o)||Qf(o,!1,n),Qf(o,!0,n))});var i=n.nodeType===9?n:n.ownerDocument;i===null||i[gc]||(i[gc]=!0,Qf("selectionchange",!1,i))}}function J0(n,i,o,u){switch(kv(i)){case 2:var h=ek;break;case 8:h=tk;break;default:h=dh}o=h.bind(null,i,o,n),h=void 0,!pd||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(h=!0),u?h!==void 0?n.addEventListener(i,o,{capture:!0,passive:h}):n.addEventListener(i,o,!0):h!==void 0?n.addEventListener(i,o,{passive:h}):n.addEventListener(i,o,!1)}function Jf(n,i,o,u,h){var g=u;if((i&1)===0&&(i&2)===0&&u!==null)e:for(;;){if(u===null)return;var j=u.tag;if(j===3||j===4){var _=u.stateNode.containerInfo;if(_===h)break;if(j===4)for(j=u.return;j!==null;){var L=j.tag;if((L===3||L===4)&&j.stateNode.containerInfo===h)return;j=j.return}for(;_!==null;){if(j=Xs(_),j===null)return;if(L=j.tag,L===5||L===6||L===26||L===27){u=g=j;continue e}_=_.parentNode}}u=u.return}ng(function(){var Z=g,Y=hd(o),ee=[];e:{var F=Ag.get(n);if(F!==void 0){var V=_l,ye=n;switch(n){case"keypress":if(Cl(o)===0)break e;case"keydown":case"keyup":V=b1;break;case"focusin":ye="focus",V=bd;break;case"focusout":ye="blur",V=bd;break;case"beforeblur":case"afterblur":V=bd;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=ag;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":V=o1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":V=j1;break;case kg:case _g:case zg:V=u1;break;case Eg:V=N1;break;case"scroll":case"scrollend":V=a1;break;case"wheel":V=k1;break;case"copy":case"cut":case"paste":V=f1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":V=og;break;case"toggle":case"beforetoggle":V=z1}var Ce=(i&4)!==0,ot=!Ce&&(n==="scroll"||n==="scrollend"),I=Ce?F!==null?F+"Capture":null:F;Ce=[];for(var $=Z,H;$!==null;){var J=$;if(H=J.stateNode,J=J.tag,J!==5&&J!==26&&J!==27||H===null||I===null||(J=Zr($,I),J!=null&&Ce.push(No($,J,H))),ot)break;$=$.return}0<Ce.length&&(F=new V(F,ye,null,o,Y),ee.push({event:F,listeners:Ce}))}}if((i&7)===0){e:{if(F=n==="mouseover"||n==="pointerover",V=n==="mouseout"||n==="pointerout",F&&o!==fd&&(ye=o.relatedTarget||o.fromElement)&&(Xs(ye)||ye[Cn]))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=Z,ye=ye?Xs(ye):null,ye!==null&&(ot=c(ye),Ce=ye.tag,ye!==ot||Ce!==5&&Ce!==27&&Ce!==6)&&(ye=null)):(V=null,ye=Z),V!==ye)){if(Ce=ag,J="onMouseLeave",I="onMouseEnter",$="mouse",(n==="pointerout"||n==="pointerover")&&(Ce=og,J="onPointerLeave",I="onPointerEnter",$="pointer"),ot=V==null?F:fs(V),H=ye==null?F:fs(ye),F=new Ce(J,$+"leave",V,o,Y),F.target=ot,F.relatedTarget=H,J=null,Xs(Y)===Z&&(Ce=new Ce(I,$+"enter",ye,o,Y),Ce.target=H,Ce.relatedTarget=ot,J=Ce),ot=J,V&&ye)t:{for(Ce=_C,I=V,$=ye,H=0,J=I;J;J=Ce(J))H++;J=0;for(var Ne=$;Ne;Ne=Ce(Ne))J++;for(;0<H-J;)I=Ce(I),H--;for(;0<J-H;)$=Ce($),J--;for(;H--;){if(I===$||$!==null&&I===$.alternate){Ce=I;break t}I=Ce(I),$=Ce($)}Ce=null}else Ce=null;V!==null&&X0(ee,F,V,Ce,!1),ye!==null&&ot!==null&&X0(ee,ot,ye,Ce,!0)}}e:{if(F=Z?fs(Z):window,V=F.nodeName&&F.nodeName.toLowerCase(),V==="select"||V==="input"&&F.type==="file")var Ke=pg;else if(hg(F))if(gg)Ke=$1;else{Ke=M1;var Se=L1}else V=F.nodeName,!V||V.toLowerCase()!=="input"||F.type!=="checkbox"&&F.type!=="radio"?Z&&dd(Z.elementType)&&(Ke=pg):Ke=U1;if(Ke&&(Ke=Ke(n,Z))){mg(ee,Ke,o,Y);break e}Se&&Se(n,F,Z),n==="focusout"&&Z&&F.type==="number"&&Z.memoizedProps.value!=null&&ud(F,"number",F.value)}switch(Se=Z?fs(Z):window,n){case"focusin":(hg(Se)||Se.contentEditable==="true")&&(Ia=Se,Cd=Z,Xr=null);break;case"focusout":Xr=Cd=Ia=null;break;case"mousedown":kd=!0;break;case"contextmenu":case"mouseup":case"dragend":kd=!1,Ng(ee,o,Y);break;case"selectionchange":if(I1)break;case"keydown":case"keyup":Ng(ee,o,Y)}var Te;if(Sd)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 Pa?dg(n,o)&&(qe="onCompositionEnd"):n==="keydown"&&o.keyCode===229&&(qe="onCompositionStart");qe&&(lg&&o.locale!=="ko"&&(Pa||qe!=="onCompositionStart"?qe==="onCompositionEnd"&&Pa&&(Te=sg()):(ei=Y,gd="value"in ei?ei.value:ei.textContent,Pa=!0)),Se=yc(Z,qe),0<Se.length&&(qe=new rg(qe,n,null,o,Y),ee.push({event:qe,listeners:Se}),Te?qe.data=Te:(Te=fg(o),Te!==null&&(qe.data=Te)))),(Te=A1?R1(n,o):T1(n,o))&&(qe=yc(Z,"onBeforeInput"),0<qe.length&&(Se=new rg("onBeforeInput","beforeinput",null,o,Y),ee.push({event:Se,listeners:qe}),Se.data=Te)),wC(ee,n,Z,o,Y)}Y0(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 _C(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5&&n.tag!==27);return n||null}function X0(n,i,o,u,h){for(var g=i._reactName,j=[];o!==null&&o!==u;){var _=o,L=_.alternate,Z=_.stateNode;if(_=_.tag,L!==null&&L===u)break;_!==5&&_!==26&&_!==27||Z===null||(L=Z,h?(Z=Zr(o,g),Z!=null&&j.unshift(No(o,Z,L))):h||(Z=Zr(o,g),Z!=null&&j.push(No(o,Z,L)))),o=o.return}j.length!==0&&n.push({event:i,listeners:j})}var zC=/\r\n?/g,EC=/\u0000|\uFFFD/g;function W0(n){return(typeof n=="string"?n:""+n).replace(zC,`
9
- `).replace(EC,"")}function ev(n,i){return i=W0(i),W0(n)===i}function rt(n,i,o,u,h,g){switch(o){case"children":typeof u=="string"?i==="body"||i==="textarea"&&u===""||Ma(n,u):(typeof u=="number"||typeof u=="bigint")&&i!=="body"&&Ma(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":eg(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=wl(""+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"&&rt(n,i,"name",h.name,h,null),rt(n,i,"formEncType",h.formEncType,h,null),rt(n,i,"formMethod",h.formMethod,h,null),rt(n,i,"formTarget",h.formTarget,h,null)):(rt(n,i,"encType",h.encType,h,null),rt(n,i,"method",h.method,h,null),rt(n,i,"target",h.target,h,null)));if(u==null||typeof u=="symbol"||typeof u=="boolean"){n.removeAttribute(o);break}u=wl(""+u),n.setAttribute(o,u);break;case"onClick":u!=null&&(n.onclick=Cs);break;case"onScroll":u!=null&&Ue("scroll",n);break;case"onScrollEnd":u!=null&&Ue("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=wl(""+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":Ue("beforetoggle",n),Ue("toggle",n),xl(n,"popover",u);break;case"xlinkActuate":Ns(n,"http://www.w3.org/1999/xlink","xlink:actuate",u);break;case"xlinkArcrole":Ns(n,"http://www.w3.org/1999/xlink","xlink:arcrole",u);break;case"xlinkRole":Ns(n,"http://www.w3.org/1999/xlink","xlink:role",u);break;case"xlinkShow":Ns(n,"http://www.w3.org/1999/xlink","xlink:show",u);break;case"xlinkTitle":Ns(n,"http://www.w3.org/1999/xlink","xlink:title",u);break;case"xlinkType":Ns(n,"http://www.w3.org/1999/xlink","xlink:type",u);break;case"xmlBase":Ns(n,"http://www.w3.org/XML/1998/namespace","xml:base",u);break;case"xmlLang":Ns(n,"http://www.w3.org/XML/1998/namespace","xml:lang",u);break;case"xmlSpace":Ns(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=s1.get(o)||o,xl(n,o,u))}}function Xf(n,i,o,u,h,g){switch(o){case"style":eg(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"?Ma(n,u):(typeof u=="number"||typeof u=="bigint")&&Ma(n,""+u);break;case"onScroll":u!=null&&Ue("scroll",n);break;case"onScrollEnd":u!=null&&Ue("scrollend",n);break;case"onClick":u!=null&&(n.onclick=Cs);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!it.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[Nt]||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 Wt(n,i,o){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ue("error",n),Ue("load",n);var u=!1,h=!1,g;for(g in o)if(o.hasOwnProperty(g)){var j=o[g];if(j!=null)switch(g){case"src":u=!0;break;case"srcSet":h=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:rt(n,i,g,j,o,null)}}h&&rt(n,i,"srcSet",o.srcSet,o,null),u&&rt(n,i,"src",o.src,o,null);return;case"input":Ue("invalid",n);var _=g=j=h=null,L=null,Z=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":j=Y;break;case"checked":L=Y;break;case"defaultChecked":Z=Y;break;case"value":g=Y;break;case"defaultValue":_=Y;break;case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(a(137,i));break;default:rt(n,i,u,Y,o,null)}}Yp(n,g,_,L,Z,j,h,!1);return;case"select":Ue("invalid",n),u=j=g=null;for(h in o)if(o.hasOwnProperty(h)&&(_=o[h],_!=null))switch(h){case"value":g=_;break;case"defaultValue":j=_;break;case"multiple":u=_;default:rt(n,i,h,_,o,null)}i=g,o=j,n.multiple=!!u,i!=null?La(n,!!u,i,!1):o!=null&&La(n,!!u,o,!0);return;case"textarea":Ue("invalid",n),g=h=u=null;for(j in o)if(o.hasOwnProperty(j)&&(_=o[j],_!=null))switch(j){case"value":u=_;break;case"defaultValue":h=_;break;case"children":g=_;break;case"dangerouslySetInnerHTML":if(_!=null)throw Error(a(91));break;default:rt(n,i,j,_,o,null)}Xp(n,u,h,g);return;case"option":for(L in o)o.hasOwnProperty(L)&&(u=o[L],u!=null)&&(L==="selected"?n.selected=u&&typeof u!="function"&&typeof u!="symbol":rt(n,i,L,u,o,null));return;case"dialog":Ue("beforetoggle",n),Ue("toggle",n),Ue("cancel",n),Ue("close",n);break;case"iframe":case"object":Ue("load",n);break;case"video":case"audio":for(u=0;u<wo.length;u++)Ue(wo[u],n);break;case"image":Ue("error",n),Ue("load",n);break;case"details":Ue("toggle",n);break;case"embed":case"source":case"link":Ue("error",n),Ue("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(Z in o)if(o.hasOwnProperty(Z)&&(u=o[Z],u!=null))switch(Z){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:rt(n,i,Z,u,o,null)}return;default:if(dd(i)){for(Y in o)o.hasOwnProperty(Y)&&(u=o[Y],u!==void 0&&Xf(n,i,Y,u,o,void 0));return}}for(_ in o)o.hasOwnProperty(_)&&(u=o[_],u!=null&&rt(n,i,_,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,j=null,_=null,L=null,Z=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":L=ee;default:u.hasOwnProperty(V)||rt(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":Z=V;break;case"defaultChecked":Y=V;break;case"value":j=V;break;case"defaultValue":_=V;break;case"children":case"dangerouslySetInnerHTML":if(V!=null)throw Error(a(137,i));break;default:V!==ee&&rt(n,i,F,V,u,ee)}}cd(n,j,_,L,Z,Y,g,h);return;case"select":V=j=_=F=null;for(g in o)if(L=o[g],o.hasOwnProperty(g)&&L!=null)switch(g){case"value":break;case"multiple":V=L;default:u.hasOwnProperty(g)||rt(n,i,g,null,u,L)}for(h in u)if(g=u[h],L=o[h],u.hasOwnProperty(h)&&(g!=null||L!=null))switch(h){case"value":F=g;break;case"defaultValue":_=g;break;case"multiple":j=g;default:g!==L&&rt(n,i,h,g,u,L)}i=_,o=j,u=V,F!=null?La(n,!!o,F,!1):!!u!=!!o&&(i!=null?La(n,!!o,i,!0):La(n,!!o,o?[]:"",!1));return;case"textarea":V=F=null;for(_ in o)if(h=o[_],o.hasOwnProperty(_)&&h!=null&&!u.hasOwnProperty(_))switch(_){case"value":break;case"children":break;default:rt(n,i,_,null,u,h)}for(j in u)if(h=u[j],g=o[j],u.hasOwnProperty(j)&&(h!=null||g!=null))switch(j){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&&rt(n,i,j,h,u,g)}Jp(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:rt(n,i,ye,null,u,F));for(L in u)F=u[L],V=o[L],u.hasOwnProperty(L)&&F!==V&&(F!=null||V!=null)&&(L==="selected"?n.selected=F&&typeof F!="function"&&typeof F!="symbol":rt(n,i,L,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 Ce in o)F=o[Ce],o.hasOwnProperty(Ce)&&F!=null&&!u.hasOwnProperty(Ce)&&rt(n,i,Ce,null,u,F);for(Z in u)if(F=u[Z],V=o[Z],u.hasOwnProperty(Z)&&F!==V&&(F!=null||V!=null))switch(Z){case"children":case"dangerouslySetInnerHTML":if(F!=null)throw Error(a(137,i));break;default:rt(n,i,Z,F,u,V)}return;default:if(dd(i)){for(var ot in o)F=o[ot],o.hasOwnProperty(ot)&&F!==void 0&&!u.hasOwnProperty(ot)&&Xf(n,i,ot,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||Xf(n,i,Y,F,u,V);return}}for(var I in o)F=o[I],o.hasOwnProperty(I)&&F!=null&&!u.hasOwnProperty(I)&&rt(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||rt(n,i,ee,F,u,V)}function tv(n){switch(n){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function RC(){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,j=h.initiatorType,_=h.duration;if(g&&_&&tv(j)){for(j=0,_=h.responseEnd,u+=1;u<o.length;u++){var L=o[u],Z=L.startTime;if(Z>_)break;var Y=L.transferSize,ee=L.initiatorType;Y&&tv(ee)&&(L=L.responseEnd,j+=Y*(L<_?1:(_-Z)/(L-Z)))}if(--u,i+=8*(g+j)/(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 Wf=null,eh=null;function vc(n){return n.nodeType===9?n:n.ownerDocument}function nv(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 sv(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 th(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 nh=null;function TC(){var n=window.event;return n&&n.type==="popstate"?n===nh?!1:(nh=n,!0):(nh=null,!1)}var iv=typeof setTimeout=="function"?setTimeout:void 0,OC=typeof clearTimeout=="function"?clearTimeout:void 0,av=typeof Promise=="function"?Promise:void 0,DC=typeof queueMicrotask=="function"?queueMicrotask:typeof av<"u"?function(n){return av.resolve(null).then(n).catch(LC)}:iv;function LC(n){setTimeout(function(){throw n})}function yi(n){return n==="head"}function rv(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),hr(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 j=g.nextSibling,_=g.nodeName;g[ds]||_==="SCRIPT"||_==="STYLE"||_==="LINK"&&g.rel.toLowerCase()==="stylesheet"||o.removeChild(g),g=j}}else o==="body"&&Co(n.ownerDocument.body);o=h}while(o);hr(i)}function ov(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 sh(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":sh(o),Oa(o);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(o.rel.toLowerCase()==="stylesheet")continue}n.removeChild(o)}}function MC(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[ds])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=Bn(n.nextSibling),n===null)break}return null}function UC(n,i,o){if(i==="")return null;for(;n.nodeType!==3;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!o||(n=Bn(n.nextSibling),n===null))return null;return n}function lv(n,i){for(;n.nodeType!==8;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!i||(n=Bn(n.nextSibling),n===null))return null;return n}function ih(n){return n.data==="$?"||n.data==="$~"}function ah(n){return n.data==="$!"||n.data==="$?"&&n.ownerDocument.readyState!=="loading"}function $C(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 Bn(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 rh=null;function cv(n){n=n.nextSibling;for(var i=0;n;){if(n.nodeType===8){var o=n.data;if(o==="/$"||o==="/&"){if(i===0)return Bn(n.nextSibling);i--}else o!=="$"&&o!=="$!"&&o!=="$?"&&o!=="$~"&&o!=="&"||i++}n=n.nextSibling}return null}function uv(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 dv(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 qn=new Map,fv=new Set;function bc(n){return typeof n.getRootNode=="function"?n.getRootNode():n.nodeType===9?n:n.ownerDocument}var Bs=O.d;O.d={f:PC,r:IC,D:BC,C:qC,L:HC,m:ZC,X:GC,S:FC,M:KC};function PC(){var n=Bs.f(),i=uc();return n||i}function IC(n){var i=Jn(n);i!==null&&i.tag===5&&i.type==="form"?Ey(i):Bs.r(n)}var ur=typeof document>"u"?null:document;function hv(n,i,o){var u=ur;if(u&&typeof i=="string"&&i){var h=Dn(i);h='link[rel="'+n+'"][href="'+h+'"]',typeof o=="string"&&(h+='[crossorigin="'+o+'"]'),fv.has(h)||(fv.add(h),n={rel:n,crossOrigin:o,href:i},u.querySelector(h)===null&&(i=u.createElement("link"),Wt(i,"link",n),Mt(i),u.head.appendChild(i)))}}function BC(n){Bs.D(n),hv("dns-prefetch",n,null)}function qC(n,i){Bs.C(n,i),hv("preconnect",n,i)}function HC(n,i,o){Bs.L(n,i,o);var u=ur;if(u&&n&&i){var h='link[rel="preload"][as="'+Dn(i)+'"]';i==="image"&&o&&o.imageSrcSet?(h+='[imagesrcset="'+Dn(o.imageSrcSet)+'"]',typeof o.imageSizes=="string"&&(h+='[imagesizes="'+Dn(o.imageSizes)+'"]')):h+='[href="'+Dn(n)+'"]';var g=h;switch(i){case"style":g=dr(n);break;case"script":g=fr(n)}qn.has(g)||(n=y({rel:"preload",href:i==="image"&&o&&o.imageSrcSet?void 0:n,as:i},o),qn.set(g,n),u.querySelector(h)!==null||i==="style"&&u.querySelector(ko(g))||i==="script"&&u.querySelector(_o(g))||(i=u.createElement("link"),Wt(i,"link",n),Mt(i),u.head.appendChild(i)))}}function ZC(n,i){Bs.m(n,i);var o=ur;if(o&&n){var u=i&&typeof i.as=="string"?i.as:"script",h='link[rel="modulepreload"][as="'+Dn(u)+'"][href="'+Dn(n)+'"]',g=h;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":g=fr(n)}if(!qn.has(g)&&(n=y({rel:"modulepreload",href:n},i),qn.set(g,n),o.querySelector(h)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(o.querySelector(_o(g)))return}u=o.createElement("link"),Wt(u,"link",n),Mt(u),o.head.appendChild(u)}}}function FC(n,i,o){Bs.S(n,i,o);var u=ur;if(u&&n){var h=Ws(u).hoistableStyles,g=dr(n);i=i||"default";var j=h.get(g);if(!j){var _={loading:0,preload:null};if(j=u.querySelector(ko(g)))_.loading=5;else{n=y({rel:"stylesheet",href:n,"data-precedence":i},o),(o=qn.get(g))&&oh(n,o);var L=j=u.createElement("link");Mt(L),Wt(L,"link",n),L._p=new Promise(function(Z,Y){L.onload=Z,L.onerror=Y}),L.addEventListener("load",function(){_.loading|=1}),L.addEventListener("error",function(){_.loading|=2}),_.loading|=4,xc(j,i,u)}j={type:"stylesheet",instance:j,count:1,state:_},h.set(g,j)}}}function GC(n,i){Bs.X(n,i);var o=ur;if(o&&n){var u=Ws(o).hoistableScripts,h=fr(n),g=u.get(h);g||(g=o.querySelector(_o(h)),g||(n=y({src:n,async:!0},i),(i=qn.get(h))&&lh(n,i),g=o.createElement("script"),Mt(g),Wt(g,"link",n),o.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},u.set(h,g))}}function KC(n,i){Bs.M(n,i);var o=ur;if(o&&n){var u=Ws(o).hoistableScripts,h=fr(n),g=u.get(h);g||(g=o.querySelector(_o(h)),g||(n=y({src:n,async:!0,type:"module"},i),(i=qn.get(h))&&lh(n,i),g=o.createElement("script"),Mt(g),Wt(g,"link",n),o.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},u.set(h,g))}}function mv(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=dr(o.href),o=Ws(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=dr(o.href);var g=Ws(h).hoistableStyles,j=g.get(n);if(j||(h=h.ownerDocument||h,j={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},g.set(n,j),(g=h.querySelector(ko(n)))&&!g._p&&(j.instance=g,j.state.loading=5),qn.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},qn.set(n,o),g||VC(h,n,o,j.state))),i&&u===null)throw Error(a(528,""));return j}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=fr(o),o=Ws(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 dr(n){return'href="'+Dn(n)+'"'}function ko(n){return'link[rel="stylesheet"]['+n+"]"}function pv(n){return y({},n,{"data-precedence":n.precedence,precedence:null})}function VC(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}),Wt(i,"link",o),Mt(i),n.head.appendChild(i))}function fr(n){return'[src="'+Dn(n)+'"]'}function _o(n){return"script[async]"+n}function gv(n,i,o){if(i.count++,i.instance===null)switch(i.type){case"style":var u=n.querySelector('style[data-href~="'+Dn(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),Wt(u,"style",h),xc(u,o.precedence,n),i.instance=u;case"stylesheet":h=dr(o.href);var g=n.querySelector(ko(h));if(g)return i.state.loading|=4,i.instance=g,Mt(g),g;u=pv(o),(h=qn.get(h))&&oh(u,h),g=(n.ownerDocument||n).createElement("link"),Mt(g);var j=g;return j._p=new Promise(function(_,L){j.onload=_,j.onerror=L}),Wt(g,"link",u),i.state.loading|=4,xc(g,o.precedence,n),i.instance=g;case"script":return g=fr(o.src),(h=n.querySelector(_o(g)))?(i.instance=h,Mt(h),h):(u=o,(h=qn.get(g))&&(u=y({},o),lh(u,h)),n=n.ownerDocument||n,h=n.createElement("script"),Mt(h),Wt(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,j=0;j<u.length;j++){var _=u[j];if(_.dataset.precedence===i)g=_;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 oh(n,i){n.crossOrigin==null&&(n.crossOrigin=i.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=i.referrerPolicy),n.title==null&&(n.title=i.title)}function lh(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 yv(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[ds]||g[Et]||n==="link"&&g.getAttribute("rel")==="stylesheet")&&g.namespaceURI!=="http://www.w3.org/2000/svg"){var j=g.getAttribute(i)||"";j=n+j;var _=u.get(j);_?_.push(g):u.set(j,[g])}}return u}function vv(n,i,o){n=n.ownerDocument||n,n.head.insertBefore(o,i==="title"?n.querySelector("head > title"):null)}function QC(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 bv(n){return!(n.type==="stylesheet"&&(n.state.loading&3)===0)}function YC(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=dr(u.href),g=i.querySelector(ko(h));if(g){i=g._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(n.count++,n=jc.bind(n),i.then(n,n)),o.state.loading|=4,o.instance=g,Mt(g);return}g=i.ownerDocument||i,u=pv(u),(h=qn.get(h))&&oh(u,h),g=g.createElement("link"),Mt(g);var j=g;j._p=new Promise(function(_,L){j.onload=_,j.onerror=L}),Wt(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=jc.bind(n),i.addEventListener("load",o),i.addEventListener("error",o))}}var ch=0;function JC(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&&ch===0&&(ch=62500*RC());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>ch?50:800)+i);return n.unsuspend=o,function(){n.unsuspend=null,clearTimeout(u),clearTimeout(h)}}:null}function jc(){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 wc=null;function Nc(n,i){n.stylesheets=null,n.unsuspend!==null&&(n.count++,wc=new Map,i.forEach(XC,n),wc=null,jc.call(n))}function XC(n,i){if(!(i.state.loading&4)){var o=wc.get(n);if(o)var u=o.get(null);else{o=new Map,wc.set(n,o);for(var h=n.querySelectorAll("link[data-precedence],style[data-precedence]"),g=0;g<h.length;g++){var j=h[g];(j.nodeName==="LINK"||j.getAttribute("media")!=="not all")&&(o.set(j.dataset.precedence,j),u=j)}u&&o.set(null,u)}h=i.instance,j=h.getAttribute("data-precedence"),g=o.get(j)||u,g===u&&o.set(null,h),o.set(j,h),this.count++,u=jc.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:A,Provider:null,Consumer:null,_currentValue:ae,_currentValue2:ae,_threadCount:0};function WC(n,i,o,u,h,g,j,_,L){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=Ta(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ta(0),this.hiddenUpdates=Ta(null),this.identifierPrefix=u,this.onUncaughtError=h,this.onCaughtError=g,this.onRecoverableError=j,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=L,this.incompleteTransitions=new Map}function xv(n,i,o,u,h,g,j,_,L,Z,Y,ee){return n=new WC(n,i,o,j,L,Z,Y,ee,_),i=1,g===!0&&(i|=24),g=_n(3,null,null,i),n.current=g,g.stateNode=n,i=Bd(),i.refCount++,n.pooledCache=i,i.refCount++,g.memoizedState={element:u,isDehydrated:o,cache:i},Fd(g),n}function Sv(n){return n?(n=Ha,n):Ha}function jv(n,i,o,u,h,g){h=Sv(h),u.context===null?u.context=h:u.pendingContext=h,u=ri(i),u.payload={element:o},g=g===void 0?null:g,g!==null&&(u.callback=g),o=oi(n,u,i),o!==null&&(bn(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 uh(n,i){wv(n,i),(n=n.alternate)&&wv(n,i)}function Nv(n){if(n.tag===13||n.tag===31){var i=Qi(n,67108864);i!==null&&bn(i,n,67108864),uh(n,67108864)}}function Cv(n){if(n.tag===13||n.tag===31){var i=Tn();i=P(i);var o=Qi(n,i);o!==null&&bn(o,n,i),uh(n,i)}}var Cc=!0;function ek(n,i,o,u){var h=B.T;B.T=null;var g=O.p;try{O.p=2,dh(n,i,o,u)}finally{O.p=g,B.T=h}}function tk(n,i,o,u){var h=B.T;B.T=null;var g=O.p;try{O.p=8,dh(n,i,o,u)}finally{O.p=g,B.T=h}}function dh(n,i,o,u){if(Cc){var h=fh(u);if(h===null)Jf(n,i,u,kc,o),_v(n,u);else if(sk(h,n,i,o,u))u.stopPropagation();else if(_v(n,u),i&4&&-1<nk.indexOf(n)){for(;h!==null;){var g=Jn(h);if(g!==null)switch(g.tag){case 3:if(g=g.stateNode,g.current.memoizedState.isDehydrated){var j=cs(g.pendingLanes);if(j!==0){var _=g;for(_.pendingLanes|=2,_.entangledLanes|=2;j;){var L=1<<31-Ge(j);_.entanglements[1]|=L,j&=~L}gs(g),(Ye&6)===0&&(lc=Pe()+500,jo(0))}}break;case 31:case 13:_=Qi(g,2),_!==null&&bn(_,g,2),uc(),uh(g,2)}if(g=fh(u),g===null&&Jf(n,i,u,kc,o),g===h)break;h=g}h!==null&&u.stopPropagation()}else Jf(n,i,u,null,o)}}function fh(n){return n=hd(n),hh(n)}var kc=null;function hh(n){if(kc=null,n=Xs(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 kc=n,null}function kv(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(ze()){case De:return 2;case pt:return 8;case an:case Ss:return 32;case Ks:return 268435456;default:return 32}default:return 32}}var mh=!1,vi=null,bi=null,xi=null,Eo=new Map,Ao=new Map,Si=[],nk="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":vi=null;break;case"dragenter":case"dragleave":bi=null;break;case"mouseover":case"mouseout":xi=null;break;case"pointerover":case"pointerout":Eo.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ao.delete(i.pointerId)}}function Ro(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=Jn(i),i!==null&&Nv(i)),n):(n.eventSystemFlags|=u,i=n.targetContainers,h!==null&&i.indexOf(h)===-1&&i.push(h),n)}function sk(n,i,o,u,h){switch(i){case"focusin":return vi=Ro(vi,n,i,o,u,h),!0;case"dragenter":return bi=Ro(bi,n,i,o,u,h),!0;case"mouseover":return xi=Ro(xi,n,i,o,u,h),!0;case"pointerover":var g=h.pointerId;return Eo.set(g,Ro(Eo.get(g)||null,n,i,o,u,h)),!0;case"gotpointercapture":return g=h.pointerId,Ao.set(g,Ro(Ao.get(g)||null,n,i,o,u,h)),!0}return!1}function zv(n){var i=Xs(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,Qt(n.priority,function(){Cv(o)});return}}else if(i===31){if(i=f(o),i!==null){n.blockedOn=i,Qt(n.priority,function(){Cv(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 _c(n){if(n.blockedOn!==null)return!1;for(var i=n.targetContainers;0<i.length;){var o=fh(n.nativeEvent);if(o===null){o=n.nativeEvent;var u=new o.constructor(o.type,o);fd=u,o.target.dispatchEvent(u),fd=null}else return i=Jn(o),i!==null&&Nv(i),n.blockedOn=o,!1;i.shift()}return!0}function Ev(n,i,o){_c(n)&&o.delete(i)}function ik(){mh=!1,vi!==null&&_c(vi)&&(vi=null),bi!==null&&_c(bi)&&(bi=null),xi!==null&&_c(xi)&&(xi=null),Eo.forEach(Ev),Ao.forEach(Ev)}function zc(n,i){n.blockedOn===i&&(n.blockedOn=null,mh||(mh=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,ik)))}var Ec=null;function Av(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(hh(u||o)===null)continue;break}var g=Jn(o);g!==null&&(n.splice(i,3),i-=3,ff(g,{pending:!0,data:h,method:o.method,action:u},u,h))}}))}function hr(n){function i(L){return zc(L,n)}vi!==null&&zc(vi,n),bi!==null&&zc(bi,n),xi!==null&&zc(xi,n),Eo.forEach(i),Ao.forEach(i);for(var o=0;o<Si.length;o++){var u=Si[o];u.blockedOn===n&&(u.blockedOn=null)}for(;0<Si.length&&(o=Si[0],o.blockedOn===null);)zv(o),o.blockedOn===null&&Si.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],j=h[Nt]||null;if(typeof g=="function")j||Av(o);else if(j){var _=null;if(g&&g.hasAttribute("formAction")){if(h=g,j=g[Nt]||null)_=j.formAction;else if(hh(h)!==null)continue}else _=j.action;typeof _=="function"?o[u+1]=_:(o.splice(u,3),u-=3),Av(o)}}}function Rv(){function n(g){g.canIntercept&&g.info==="react-transition"&&g.intercept({handler:function(){return new Promise(function(j){return h=j})},focusReset:"manual",scroll:"manual"})}function i(){h!==null&&(h(),h=null),u||setTimeout(o,20)}function o(){if(!u&&!navigation.transition){var g=navigation.currentEntry;g&&g.url!=null&&navigation.navigate(g.url,{state:g.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var u=!1,h=null;return navigation.addEventListener("navigate",n),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(o,100),function(){u=!0,navigation.removeEventListener("navigate",n),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),h!==null&&(h(),h=null)}}}function ph(n){this._internalRoot=n}Ac.prototype.render=ph.prototype.render=function(n){var i=this._internalRoot;if(i===null)throw Error(a(409));var o=i.current,u=Tn();jv(o,u,n,i,null,null)},Ac.prototype.unmount=ph.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var i=n.containerInfo;jv(n.current,2,null,n,null,null),uc(),i[Cn]=null}};function Ac(n){this._internalRoot=n}Ac.prototype.unstable_scheduleHydration=function(n){if(n){var i=st();n={blockedOn:null,target:n,priority:i};for(var o=0;o<Si.length&&i!==0&&i<Si[o].priority;o++);Si.splice(o,0,n),o===0&&zv(n)}};var Tv=t.version;if(Tv!=="19.2.4")throw Error(a(527,Tv,"19.2.4"));O.findDOMNode=function(n){var i=n._reactInternals;if(i===void 0)throw typeof n.render=="function"?Error(a(188)):(n=Object.keys(n).join(","),Error(a(268,n)));return n=m(i),n=n!==null?v(n):null,n=n===null?null:n.stateNode,n};var ak={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:B,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Rc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Rc.isDisabled&&Rc.supportsFiber)try{ls=Rc.inject(ak),_e=Rc}catch{}}return Oo.createRoot=function(n,i){if(!r(n))throw Error(a(299));var o=!1,u="",h=Py,g=Iy,j=By;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&&(j=i.onRecoverableError)),i=xv(n,1,!1,null,null,o,u,null,h,g,j,Rv),n[Cn]=i.current,Yf(n),new ph(i)},Oo.hydrateRoot=function(n,i,o){if(!r(n))throw Error(a(299));var u=!1,h="",g=Py,j=Iy,_=By,L=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&&(j=o.onCaughtError),o.onRecoverableError!==void 0&&(_=o.onRecoverableError),o.formState!==void 0&&(L=o.formState)),i=xv(n,1,!0,i,o??null,u,h,L,g,j,_,Rv),i.context=Sv(null),o=i.current,u=Tn(),u=P(u),h=ri(u),h.callback=null,oi(o,h,u),o=u,i.current.lanes=o,Fi(i,o),gs(i),n[Cn]=i.current,Yf(n),new Ac(i)},Oo.version="19.2.4",Oo}var qv;function pk(){if(qv)return vh.exports;qv=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(),vh.exports=mk(),vh.exports}var gk=pk(),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(){}},yk={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},vk=class{#t=yk;#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)}},fa=new vk;function bk(e){setTimeout(e,0)}var ja=typeof window>"u"||"Deno"in globalThis;function cn(){}function xk(e,t){return typeof e=="function"?e(t):e}function Wh(e){return typeof e=="number"&&e>=0&&e!==1/0}function Zx(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ti(e,t){return typeof e=="function"?e(t):e}function Hn(e,t){return typeof e=="function"?e(t):e}function Hv(e,t){const{type:s="all",exact:a,fetchStatus:r,predicate:c,queryKey:d,stale:f}=e;if(d){if(a){if(t.queryHash!==$m(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 Zv(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 $m(e,t){return(t?.queryKeyHashFn||Vo)(e)}function Vo(e){return JSON.stringify(e,(t,s)=>em(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 Sk=Object.prototype.hasOwnProperty;function Pm(e,t,s=0){if(e===t)return e;if(s>500)return t;const a=Fv(e)&&Fv(t);if(!a&&!(em(e)&&em(t)))return t;const c=(a?e:Object.keys(e)).length,d=a?t:Object.keys(t),f=d.length,p=a?new Array(f):{};let m=0;for(let v=0;v<f;v++){const y=a?v:d[v],b=e[y],x=t[y];if(b===x){p[y]=b,(a?v<c:Sk.call(e,y))&&m++;continue}if(b===null||x===null||typeof b!="object"||typeof x!="object"){p[y]=x;continue}const w=Pm(b,x,s+1);p[y]=w,w===b&&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 Fv(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function em(e){if(!Gv(e))return!1;const t=e.constructor;if(t===void 0)return!0;const s=t.prototype;return!(!Gv(s)||!s.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Gv(e){return Object.prototype.toString.call(e)==="[object Object]"}function jk(e){return new Promise(t=>{fa.setTimeout(t,e)})}function tm(e,t,s){return typeof s.structuralSharing=="function"?s.structuralSharing(e,t):s.structuralSharing!==!1?Pm(e,t):t}function wk(e,t,s=0){const a=[...e,t];return s&&a.length>s?a.slice(1):a}function Nk(e,t,s=0){const a=[t,...e];return s&&a.length>s?a.slice(0,-1):a}var Im=Symbol();function Fx(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 Gx(e,t){return typeof e=="function"?e(...t):!!e}function Ck(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 kk=class extends Lr{#t;#e;#n;constructor(){super(),this.#n=e=>{if(!ja&&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 kk;function nm(){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 _k=bk;function zk(){let e=[],t=0,s=f=>{f()},a=f=>{f()},r=_k;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=zk(),Ek=class extends Lr{#t=!0;#e;#n;constructor(){super(),this.#n=e=>{if(!ja&&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 Ek;function Ak(e){return Math.min(1e3*2**e,3e4)}function Kx(e){return(e??"online")==="online"?cu.isOnline():!0}var sm=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function Vx(e){let t=!1,s=0,a;const r=nm(),c=()=>r.status!=="pending",d=S=>{if(!c()){const C=new sm(S);b(C),e.onCancel?.(C)}},f=()=>{t=!0},p=()=>{t=!1},m=()=>Bm.isFocused()&&(e.networkMode==="always"||cu.isOnline())&&e.canRun(),v=()=>Kx(e.networkMode)&&e.canRun(),y=S=>{c()||(a?.(),r.resolve(S))},b=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?.()}),w=()=>{if(c())return;let S;const C=s===0?e.initialPromise:void 0;try{S=C??e.fn()}catch(k){S=Promise.reject(k)}Promise.resolve(S).then(y).catch(k=>{if(c())return;const E=e.retry??(ja?0:3),A=e.retryDelay??Ak,z=typeof A=="function"?A(s,k):A,M=E===!0||typeof E=="number"&&s<E||typeof E=="function"&&E(s,k);if(t||!M){b(k);return}s++,e.onFail?.(s,k),jk(z).then(()=>m()?void 0:x()).then(()=>{t?b(k):w()})})};return{promise:r,status:()=>r.status,cancel:d,continue:()=>(a?.(),r),cancelRetry:f,continueRetry:p,canStart:v,start:()=>(v()?w():x().then(w),r)}}var Qx=class{#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Wh(this.gcTime)&&(this.#t=fa.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ja?1/0:300*1e3))}clearGcTimeout(){this.#t&&(fa.clearTimeout(this.#t),this.#t=void 0)}},Rk=class extends Qx{#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=Vv(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=Vv(this.options);t.data!==void 0&&(this.setState(Kv(t.data,t.dataUpdatedAt)),this.#t=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const s=tm(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(cn).catch(cn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#t)}isActive(){return this.observers.some(e=>Hn(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=>Ti(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:!Zx(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=Fx(this.options,t),m=(()=>{const v={client:this.#i,queryKey:this.queryKey,meta:this.meta};return a(v),v})();return this.#o=!1,this.options.persister?this.options.persister(f,m,this):f(m)},d=(()=>{const f={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:r};return a(f),f})();this.options.behavior?.onFetch(d,this),this.#e=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==d.fetchOptions?.meta)&&this.#a({type:"fetch",meta:d.fetchOptions?.meta}),this.#s=Vx({initialPromise:t?.initialPromise,fn:d.fetchFn,onCancel:f=>{f instanceof sm&&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 sm){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,...Yx(s.data,this.options),fetchMeta:e.meta??null};case"success":const a={...s,...Kv(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 Yx(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Kx(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Kv(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Vv(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=nm(),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),Qv(this.#e,this.options)?this.#p():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return im(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return im(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 Hn(this.options.enabled,this.#e)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#j(),this.#e.setOptions(this.options),t._defaulted&&!lu(this.options,t)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const a=this.hasListeners();a&&Yv(this.#e,s,this.options,t)&&this.#p(),this.updateResult(),a&&(this.#e!==s||Hn(this.options.enabled,this.#e)!==Hn(t.enabled,this.#e)||Ti(this.options.staleTime,this.#e)!==Ti(t.staleTime,this.#e))&&this.#g();const r=this.#y();a&&(this.#e!==s||Hn(this.options.enabled,this.#e)!==Hn(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 Ok(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.#j();let t=this.#e.fetch(this.options,e);return e?.throwOnError||(t=t.catch(cn)),t}#g(){this.#x();const e=Ti(this.options.staleTime,this.#e);if(ja||this.#i.isStale||!Wh(e))return;const s=Zx(this.#i.dataUpdatedAt,e)+1;this.#c=fa.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,!(ja||Hn(this.options.enabled,this.#e)===!1||!Wh(this.#l)||this.#l===0)&&(this.#u=fa.setInterval(()=>{(this.options.refetchIntervalInBackground||Bm.isFocused())&&this.#p()},this.#l))}#b(){this.#g(),this.#v(this.#y())}#x(){this.#c&&(fa.clearTimeout(this.#c),this.#c=void 0)}#S(){this.#u&&(fa.clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const s=this.#e,a=this.options,r=this.#i,c=this.#s,d=this.#r,p=e!==s?e.state:this.#n,{state:m}=e;let v={...m},y=!1,b;if(t._optimisticResults){const T=this.hasListeners(),q=!T&&Qv(e,t),W=T&&Yv(e,s,t,a);(q||W)&&(v={...v,...Yx(m.data,e.options)}),t._optimisticResults==="isRestoring"&&(v.fetchStatus="idle")}let{error:x,errorUpdatedAt:w,status:S}=v;b=v.data;let C=!1;if(t.placeholderData!==void 0&&b===void 0&&S==="pending"){let T;r?.isPlaceholderData&&t.placeholderData===d?.placeholderData?(T=r.data,C=!0):T=typeof t.placeholderData=="function"?t.placeholderData(this.#f?.state.data,this.#f):t.placeholderData,T!==void 0&&(S="success",b=tm(r?.data,T,t),y=!0)}if(t.select&&b!==void 0&&!C)if(r&&b===c?.data&&t.select===this.#m)b=this.#d;else try{this.#m=t.select,b=t.select(b),b=tm(r?.data,b,t),this.#d=b,this.#a=null}catch(T){this.#a=T}this.#a&&(x=this.#a,b=this.#d,w=Date.now(),S="error");const k=v.fetchStatus==="fetching",E=S==="pending",A=S==="error",z=E&&k,M=b!==void 0,R={status:S,fetchStatus:v.fetchStatus,isPending:E,isSuccess:S==="success",isError:A,isInitialLoading:z,isLoading:z,data:b,dataUpdatedAt:v.dataUpdatedAt,error:x,errorUpdatedAt:w,failureCount:v.fetchFailureCount,failureReason:v.fetchFailureReason,errorUpdateCount:v.errorUpdateCount,isFetched:v.dataUpdateCount>0||v.errorUpdateCount>0,isFetchedAfterMount:v.dataUpdateCount>p.dataUpdateCount||v.errorUpdateCount>p.errorUpdateCount,isFetching:k,isRefetching:k&&!E,isLoadingError:A&&!M,isPaused:v.fetchStatus==="paused",isPlaceholderData:y,isRefetchError:A&&M,isStale:Hm(e,t),refetch:this.refetch,promise:this.#o,isEnabled:Hn(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const T=R.data!==void 0,q=R.status==="error"&&!T,W=me=>{q?me.reject(R.error):T&&me.resolve(R.data)},Q=()=>{const me=this.#o=R.promise=nm();W(me)},ne=this.#o;switch(ne.status){case"pending":e.queryHash===s.queryHash&&W(ne);break;case"fulfilled":(q||R.data!==ne.value)&&Q();break;case"rejected":(!q||R.error!==ne.reason)&&Q();break}}return R}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.#w({listeners:s()})}#j(){const e=this.#t.getQueryCache().build(this.#t,this.options);if(e===this.#e)return;const t=this.#e;this.#e=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#w(e){Bt.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#i)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function Tk(e,t){return Hn(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Qv(e,t){return Tk(e,t)||e.state.data!==void 0&&im(e,t,t.refetchOnMount)}function im(e,t,s){if(Hn(t.enabled,e)!==!1&&Ti(t.staleTime,e)!=="static"){const a=typeof s=="function"?s(e):s;return a==="always"||a!==!1&&Hm(e,t)}return!1}function Yv(e,t,s,a){return(e!==t||Hn(a.enabled,e)===!1)&&(!s.suspense||e.state.status!=="error")&&Hm(e,s)}function Hm(e,t){return Hn(t.enabled,e)!==!1&&e.isStaleByTime(Ti(t.staleTime,e))}function Ok(e,t){return!lu(e.getCurrentResult(),t)}function Jv(e){return{onFetch:(t,s)=>{const a=t.options,r=t.fetchOptions?.meta?.fetchMore?.direction,c=t.state.data?.pages||[],d=t.state.data?.pageParams||[];let f={pages:[],pageParams:[]},p=0;const m=async()=>{let v=!1;const y=w=>{Ck(w,()=>t.signal,()=>v=!0)},b=Fx(t.options,t.fetchOptions),x=async(w,S,C)=>{if(v)return Promise.reject();if(S==null&&w.pages.length)return Promise.resolve(w);const E=(()=>{const U={client:t.client,queryKey:t.queryKey,pageParam:S,direction:C?"backward":"forward",meta:t.options.meta};return y(U),U})(),A=await b(E),{maxPages:z}=t.options,M=C?Nk:wk;return{pages:M(w.pages,A,z),pageParams:M(w.pageParams,S,z)}};if(r&&c.length){const w=r==="backward",S=w?Dk:Xv,C={pages:c,pageParams:d},k=S(a,C);f=await x(C,k,w)}else{const w=e??c.length;do{const S=p===0?d[0]??a.initialPageParam:Xv(a,f);if(p>0&&S==null)break;f=await x(f,S),p++}while(p<w)}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 Xv(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 Dk(e,{pages:t,pageParams:s}){return t.length>0?e.getPreviousPageParam?.(t[0],t,s[0],s):void 0}var Lk=class extends Qx{#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||Mk(),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=Vx({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 Mk(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Jx=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 Lk({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=Tc(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=Tc(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=Tc(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=Tc(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=>Zv(t,s))}findAll(e={}){return this.getAll().filter(t=>Zv(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(cn))))}};function Tc(e){return e.options.scope?.id}function Wv(e,t){const s=new Set(t);return e.filter(a=>!s.has(a))}function Uk(e,t,s){const a=e.slice(0);return a[t]=s,a}var $k=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(v=>v.observer.setOptions(v.defaultedQueryOptions));const r=a.map(v=>v.observer),c=r.map(v=>v.getCurrentResult()),d=s.length!==r.length,f=r.some((v,y)=>v!==s[y]),p=d||f,m=p?!0:c.some((v,y)=>{const b=this.#e[y];return!b||!lu(v,b)});!p&&!m||(p&&(this.#d=a,this.#s=r),this.#e=c,this.hasListeners()&&(p&&(Wv(s,r).forEach(v=>{v.destroy()}),Wv(r,s).forEach(v=>{v.subscribe(y=>{this.#l(v,y)})})),this.#h()))})}getCurrentResult(){return this.#e}getQueries(){return this.#s.map(e=>e.getCurrentQuery())}getObservers(){return this.#s}getOptimisticResult(e,t){const s=this.#u(e),a=s.map(c=>c.observer.getOptimisticResult(c.defaultedQueryOptions)),r=s.map(c=>c.defaultedQueryOptions.queryHash);return[a,c=>this.#c(c??a,t,r),()=>this.#f(a,s)]}#f(e,t){return t.map((s,a)=>{const r=e[a];return s.defaultedQueryOptions.notifyOnChangeProps?r:s.observer.trackResult(r,c=>{t.forEach(d=>{d.observer.trackProp(c)})})})}#c(e,t,s){if(t){const a=this.#m,r=s!==void 0&&a!==void 0&&(a.length!==s.length||s.some((c,d)=>c!==a[d]));return(!this.#r||this.#e!==this.#a||r||t!==this.#o)&&(this.#o=t,this.#a=this.#e,s!==void 0&&(this.#m=s),this.#r=Pm(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=Uk(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)})})}}},Pk=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??$m(a,t);let c=this.get(r);return c||(c=new Rk({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=>Hv(t,s))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(s=>Hv(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()})})}},Ik=class{#t;#e;#n;#i;#s;#r;#o;#a;constructor(e={}){this.#t=e.queryCache||new Pk,this.#e=e.mutationCache||new Jx,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(Ti(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=xk(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(cn).catch(cn)}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(cn)),r.state.fetchStatus==="paused"?Promise.resolve():c}));return Promise.all(a).then(cn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const s=this.#t.build(this,t);return s.isStaleByTime(Ti(t.staleTime,s))?s.fetch(t):Promise.resolve(s.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(cn).catch(cn)}fetchInfiniteQuery(e){return e.behavior=Jv(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(cn).catch(cn)}ensureInfiniteQueryData(e){return e.behavior=Jv(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=$m(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()}},Xx=N.createContext(void 0),Wx=e=>{const t=N.useContext(Xx);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Bk=({client:e,children:t})=>(N.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),l.jsx(Xx.Provider,{value:e,children:t})),eS=N.createContext(!1),tS=()=>N.useContext(eS);eS.Provider;function qk(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Hk=N.createContext(qk()),nS=()=>N.useContext(Hk),sS=(e,t,s)=>{const a=s?.state.error&&typeof e.throwOnError=="function"?Gx(e.throwOnError,[s.state.error,s]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||a)&&(t.isReset()||(e.retryOnMount=!1))},iS=e=>{N.useEffect(()=>{e.clearReset()},[e])},aS=({result:e,errorResetBoundary:t,throwOnError:s,query:a,suspense:r})=>e.isError&&!t.isReset()&&!e.isFetching&&a&&(r&&e.data===void 0||Gx(s,[e.error,a])),rS=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))}},Zk=(e,t)=>e.isLoading&&e.isFetching&&!t,am=(e,t)=>e?.suspense&&t.isPending,rm=(e,t,s)=>t.fetchOptimistic(e).catch(()=>{s.clearReset()});function Fk({queries:e,...t},s){const a=Wx(),r=tS(),c=nS(),d=N.useMemo(()=>e.map(S=>{const C=a.defaultQueryOptions(S);return C._optimisticResults=r?"isRestoring":"optimistic",C}),[e,a,r]);d.forEach(S=>{rS(S);const C=a.getQueryCache().get(S.queryHash);sS(S,c,C)}),iS(c);const[f]=N.useState(()=>new $k(a,d,t)),[p,m,v]=f.getOptimisticResult(d,t.combine),y=!r&&t.subscribed!==!1;N.useSyncExternalStore(N.useCallback(S=>y?f.subscribe(Bt.batchCalls(S)):cn,[f,y]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),N.useEffect(()=>{f.setQueries(d,t)},[d,t,f]);const x=p.some((S,C)=>am(d[C],S))?p.flatMap((S,C)=>{const k=d[C];if(k&&am(k,S)){const E=new qm(a,k);return rm(k,E,c)}return[]}):[];if(x.length>0)throw Promise.all(x);const w=p.find((S,C)=>{const k=d[C];return k&&aS({result:S,errorResetBoundary:c,throwOnError:k.throwOnError,query:a.getQueryCache().get(k.queryHash),suspense:k.suspense})});if(w?.error)throw w.error;return m(v())}function Gk(e,t,s){const a=tS(),r=nS(),c=Wx(),d=c.defaultQueryOptions(e);c.getDefaultOptions().queries?._experimental_beforeQuery?.(d);const f=c.getQueryCache().get(d.queryHash);d._optimisticResults=a?"isRestoring":"optimistic",rS(d),sS(d,r,f),iS(r);const p=!c.getQueryCache().get(d.queryHash),[m]=N.useState(()=>new t(c,d)),v=m.getOptimisticResult(d),y=!a&&e.subscribed!==!1;if(N.useSyncExternalStore(N.useCallback(b=>{const x=y?m.subscribe(Bt.batchCalls(b)):cn;return m.updateResult(),x},[m,y]),()=>m.getCurrentResult(),()=>m.getCurrentResult()),N.useEffect(()=>{m.setOptions(d)},[d,m]),am(d,v))throw rm(d,m,r);if(aS({result:v,errorResetBoundary:r,throwOnError:d.throwOnError,query:f,suspense:d.suspense}))throw v.error;return c.getDefaultOptions().queries?._experimental_afterQuery?.(d,v),d.experimental_prefetchInRender&&!ja&&Zk(v,a)&&(p?rm(d,m,r):f?.promise)?.catch(cn).finally(()=>{m.updateResult()}),d.notifyOnChangeProps?v:m.trackResult(v)}function qo(e,t){return Gk(e,qm)}var Oc=typeof window<"u"?N.useLayoutEffect:N.useEffect;function jh(e){const t=N.useRef({value:e,prev:null}),s=t.current.value;return e!==s&&(t.current={value:e,prev:s}),t.current.prev}function Kk(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 Vk(e){const t=N.useRef(null);return N.useImperativeHandle(e,()=>t.current,[]),t}var Qk=!1;function Yo(e){return e[e.length-1]}function Yk(e){return typeof e=="function"}function zi(e,t){return Yk(e)?e(t):e}var Jk=Object.prototype.hasOwnProperty,eb=Object.prototype.propertyIsEnumerable,Xk=()=>Object.create(null),la=(e,t)=>ha(e,t,Xk);function ha(e,t,s=()=>({}),a=0){if(e===t)return e;if(a>500)return t;const r=t,c=sb(e)&&sb(r);if(!c&&!(uu(e)&&uu(r)))return r;const d=c?e:tb(e);if(!d)return r;const f=c?r:tb(r);if(!f)return r;const p=d.length,m=f.length,v=c?new Array(m):s();let y=0;for(let b=0;b<m;b++){const x=c?b:f[b],w=e[x],S=r[x];if(w===S){v[x]=w,(c?b<p:Jk.call(e,x))&&y++;continue}if(w===null||S===null||typeof w!="object"||typeof S!="object"){v[x]=S;continue}const C=ha(w,S,s,a+1);v[x]=C,C===w&&y++}return p===m&&y===p?e:v}function tb(e){const t=Object.getOwnPropertyNames(e);for(const r of t)if(!eb.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(!eb.call(e,r))return!1;a.push(r)}return a}function uu(e){if(!nb(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const s=t.prototype;return!(!nb(s)||!s.hasOwnProperty("isPrototypeOf"))}function nb(e){return Object.prototype.toString.call(e)==="[object Object]"}function sb(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function va(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(!va(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)&&!va(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||!va(e[d],t[d],s)))return!1;return r===c}return!1}function Ar(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 Wk(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function ib(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 Wk(t)}var e_=["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+=ib(e.slice(s,r.index))+r[0],s=t.lastIndex;a=a+ib(s?e.slice(s):e);let c=!1;return a.startsWith("//")&&(c=!0,a="/"+a.replace(/^\/+/,"")),{path:a,handledProtocolRelativeURL:c}}function t_(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 n_="Invariant failed";function Ui(e,t){if(!e)throw new Error(n_)}var ma=4,oS=5;function s_(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=s_(c);if(d){const[f,p]=d,m=c.charCodeAt(f+1);if(m===45){if(f+2<c.length&&c.charCodeAt(f+2)===36){const v=f+3,y=p;if(v<y)return s[0]=3,s[1]=t+f,s[2]=t+v,s[3]=t+y,s[4]=t+p+1,s[5]=r,s}}else if(m===36){const v=f+1,y=f+2;return y===p?(s[0]=2,s[1]=t+f,s[2]=t+v,s[3]=t+y,s[4]=t+p+1,s[5]=e.length,s):(s[0]=1,s[1]=t+f,s[2]=t+y,s[3]=t+p,s[4]=t+p+1,s[5]=r,s)}}return s[0]=0,s[1]=t,s[2]=t,s[3]=r,s[4]=r,s[5]=r,s}function Eu(e,t,s,a,r,c,d){d?.(s);let f=a;{const p=s.fullPath??s.from,m=p.length,v=s.options?.caseSensitive??e,y=!!(s.options?.params?.parse&&s.options?.skipRouteOnParseError?.params);for(;f<m;){const x=Zm(p,f,t);let w;const S=f,C=x[5];switch(f=C+1,c++,x[0]){case 0:{const k=p.substring(x[2],x[3]);if(v){const E=r.static?.get(k);if(E)w=E;else{r.static??=new Map;const A=pa(s.fullPath??s.from);A.parent=r,A.depth=c,w=A,r.static.set(k,A)}}else{const E=k.toLowerCase(),A=r.staticInsensitive?.get(E);if(A)w=A;else{r.staticInsensitive??=new Map;const z=pa(s.fullPath??s.from);z.parent=r,z.depth=c,w=z,r.staticInsensitive.set(E,z)}}break}case 1:{const k=p.substring(S,x[1]),E=p.substring(x[4],C),A=v&&!!(k||E),z=k?A?k:k.toLowerCase():void 0,M=E?A?E:E.toLowerCase():void 0,U=!y&&r.dynamic?.find(R=>!R.skipOnParamError&&R.caseSensitive===A&&R.prefix===z&&R.suffix===M);if(U)w=U;else{const R=Nh(1,s.fullPath??s.from,A,z,M);w=R,R.depth=c,R.parent=r,r.dynamic??=[],r.dynamic.push(R)}break}case 3:{const k=p.substring(S,x[1]),E=p.substring(x[4],C),A=v&&!!(k||E),z=k?A?k:k.toLowerCase():void 0,M=E?A?E:E.toLowerCase():void 0,U=!y&&r.optional?.find(R=>!R.skipOnParamError&&R.caseSensitive===A&&R.prefix===z&&R.suffix===M);if(U)w=U;else{const R=Nh(3,s.fullPath??s.from,A,z,M);w=R,R.parent=r,R.depth=c,r.optional??=[],r.optional.push(R)}break}case 2:{const k=p.substring(S,x[1]),E=p.substring(x[4],C),A=v&&!!(k||E),z=k?A?k:k.toLowerCase():void 0,M=E?A?E:E.toLowerCase():void 0,U=Nh(2,s.fullPath??s.from,A,z,M);w=U,U.parent=r,U.depth=c,r.wildcard??=[],r.wildcard.push(U)}}r=w}if(y&&s.children&&!s.isRoot&&s.id&&s.id.charCodeAt(s.id.lastIndexOf("/")+1)===95){const x=pa(s.fullPath??s.from);x.kind=oS,x.parent=r,c++,x.depth=c,r.pathless??=[],r.pathless.push(x),r=x}const b=(s.path||!s.children)&&!s.isRoot;if(b&&p.endsWith("/")){const x=pa(s.fullPath??s.from);x.kind=ma,x.parent=r,c++,x.depth=c,r.index=x,r=x}r.parse=s.options?.params?.parse??null,r.skipOnParamError=y,r.parsingPriority=s.options?.skipRouteOnParseError?.priority??0,b&&!r.route&&(r.route=s,r.fullPath=s.fullPath??s.from)}if(s.children)for(const p of s.children)Eu(e,t,p,f,r,c,d)}function wh(e,t){if(e.skipOnParamError&&!t.skipOnParamError)return-1;if(!e.skipOnParamError&&t.skipOnParamError)return 1;if(e.skipOnParamError&&t.skipOnParamError&&(e.parsingPriority||t.parsingPriority))return t.parsingPriority-e.parsingPriority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function ki(e){if(e.pathless)for(const t of e.pathless)ki(t);if(e.static)for(const t of e.static.values())ki(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())ki(t);if(e.dynamic?.length){e.dynamic.sort(wh);for(const t of e.dynamic)ki(t)}if(e.optional?.length){e.optional.sort(wh);for(const t of e.optional)ki(t)}if(e.wildcard?.length){e.wildcard.sort(wh);for(const t of e.wildcard)ki(t)}}function pa(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 Nh(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 i_(e,t){const s=pa("/"),a=new Uint16Array(6);for(const r of e)Eu(!1,a,r,1,s,0);ki(s),t.masksTree=s,t.flatCache=fu(1e3)}function a_(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 r_(e,t,s,a,r){e||="/",a||="/";const c=t?`case\0${e}`:e;let d=r.singleCache.get(c);return d||(d=pa("/"),Eu(t,new Uint16Array(6),{from:e},1,d,0),r.singleCache.set(c,d)),Fm(a,d,s)}function o_(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=u_(c.route)),t.matchCache.set(a,c),c}function l_(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function c_(e,t=!1,s){const a=pa(e.fullPath),r=new Uint16Array(6),c={},d={};let f=0;return Eu(t,r,e,1,a,0,p=>{if(s?.(p,f),Ui(!(p.id in c),`Duplicate routes found with id: ${String(p.id)}`),c[p.id]=p,f!==0&&p.path){const m=l_(p.fullPath);(!d[m]||p.fullPath.endsWith("/"))&&(d[m]=p)}f++}),ki(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=f_(e,a,t,s);if(!r)return null;const[c]=lS(e,a,r);return{route:r.node.route,rawParams:c,parsedParams:r.parsedParams}}function lS(e,t,s){const a=d_(s.node);let r=null;const c=Object.create(null);let d=s.extract?.part??0,f=s.extract?.node??0,p=s.extract?.path??0,m=s.extract?.segment??0;for(;f<a.length;d++,f++,p++,m++){const v=a[f];if(v.kind===ma)break;if(v.kind===oS){m--,d--,p--;continue}const y=t[d],b=p;if(y&&(p+=y.length),v.kind===1){r??=s.node.fullPath.split("/");const x=r[m],w=v.prefix?.length??0;if(x.charCodeAt(w)===123){const S=v.suffix?.length??0,C=x.substring(w+2,x.length-S-1),k=y.substring(w,y.length-S);c[C]=decodeURIComponent(k)}else{const S=x.substring(1);c[S]=decodeURIComponent(y)}}else if(v.kind===3){if(s.skipped&1<<f){d--,p=b-1;continue}r??=s.node.fullPath.split("/");const x=r[m],w=v.prefix?.length??0,S=v.suffix?.length??0,C=x.substring(w+3,x.length-S-1),k=v.suffix||v.prefix?y.substring(w,y.length-S):y;k&&(c[C]=decodeURIComponent(k))}else if(v.kind===2){const x=v,w=e.substring(b+(x.prefix?.length??0),e.length-(x.suffix?.length??0)),S=decodeURIComponent(w);c["*"]=S,c._splat=S;break}}return s.rawParams&&Object.assign(c,s.rawParams),[c,{part:d,node:f,path:p,segment:m}]}function u_(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function d_(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function f_(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,v=null;for(;f.length;){const y=f.pop(),{node:b,index:x,skipped:w,depth:S,statics:C,dynamics:k,optionals:E}=y;let{extract:A,rawParams:z,parsedParams:M}=y;if(b.skipOnParamError){if(!Ch(e,t,y))continue;z=y.rawParams,A=y.extract,M=y.parsedParams}a&&b.route&&b.kind!==ma&&Lo(m,y)&&(m=y);const U=x===d;if(U&&(b.route&&!c&&Lo(v,y)&&(v=y),!b.optional&&!b.wildcard&&!b.index&&!b.pathless))continue;const R=U?void 0:t[x];let T;if(U&&b.index){const q={node:b.index,index:x,skipped:w,depth:S+1,statics:C,dynamics:k,optionals:E,extract:A,rawParams:z,parsedParams:M};let W=!0;if(b.index.skipOnParamError&&(Ch(e,t,q)||(W=!1)),W){if(C===d&&!k&&!E&&!w)return q;Lo(v,q)&&(v=q)}}if(b.wildcard&&Lo(p,y))for(const q of b.wildcard){const{prefix:W,suffix:Q}=q;if(W&&(U||!(q.caseSensitive?R:T??=R.toLowerCase()).startsWith(W)))continue;if(Q){if(U)continue;const me=t.slice(x).join("/").slice(-Q.length);if((q.caseSensitive?me:me.toLowerCase())!==Q)continue}const ne={node:q,index:d,skipped:w,depth:S,statics:C,dynamics:k,optionals:E,extract:A,rawParams:z,parsedParams:M};if(!(q.skipOnParamError&&!Ch(e,t,ne))){p=ne;break}}if(b.optional){const q=w|1<<S,W=S+1;for(let Q=b.optional.length-1;Q>=0;Q--){const ne=b.optional[Q];f.push({node:ne,index:x,skipped:q,depth:W,statics:C,dynamics:k,optionals:E,extract:A,rawParams:z,parsedParams:M})}if(!U)for(let Q=b.optional.length-1;Q>=0;Q--){const ne=b.optional[Q],{prefix:me,suffix:ke}=ne;if(me||ke){const je=ne.caseSensitive?R:T??=R.toLowerCase();if(me&&!je.startsWith(me)||ke&&!je.endsWith(ke))continue}f.push({node:ne,index:x+1,skipped:w,depth:W,statics:C,dynamics:k,optionals:E+1,extract:A,rawParams:z,parsedParams:M})}}if(!U&&b.dynamic&&R)for(let q=b.dynamic.length-1;q>=0;q--){const W=b.dynamic[q],{prefix:Q,suffix:ne}=W;if(Q||ne){const me=W.caseSensitive?R:T??=R.toLowerCase();if(Q&&!me.startsWith(Q)||ne&&!me.endsWith(ne))continue}f.push({node:W,index:x+1,skipped:w,depth:S+1,statics:C,dynamics:k+1,optionals:E,extract:A,rawParams:z,parsedParams:M})}if(!U&&b.staticInsensitive){const q=b.staticInsensitive.get(T??=R.toLowerCase());q&&f.push({node:q,index:x+1,skipped:w,depth:S+1,statics:C+1,dynamics:k,optionals:E,extract:A,rawParams:z,parsedParams:M})}if(!U&&b.static){const q=b.static.get(R);q&&f.push({node:q,index:x+1,skipped:w,depth:S+1,statics:C+1,dynamics:k,optionals:E,extract:A,rawParams:z,parsedParams:M})}if(b.pathless){const q=S+1;for(let W=b.pathless.length-1;W>=0;W--){const Q=b.pathless[W];f.push({node:Q,index:x,skipped:w,depth:q,statics:C,dynamics:k,optionals:E,extract:A,rawParams:z,parsedParams:M})}}}if(v&&p)return Lo(p,v)?v:p;if(v)return v;if(p)return p;if(a&&m){let y=m.index;for(let x=0;x<m.index;x++)y+=t[x].length;const b=y===e.length?"/":e.slice(y);return m.rawParams??=Object.create(null),m.rawParams["**"]=decodeURIComponent(b),m}return null}function Ch(e,t,s){try{const[a,r]=lS(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===ma)>(e.node.kind===ma)||t.node.kind===ma==(e.node.kind===ma)&&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 cS(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 uS(e){return Oi(cS(e))}function hu(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function h_(e,t,s){return hu(e,s)===hu(t,s)}function m_({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 b=0,x=y.length;b<x;b++){const w=y[b];w===""?b?b===x-1&&f.push(w):f=[w]:w===".."?f.pop():w==="."||f.push(w)}}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 b=f[y];if(!b)continue;p=Zm(b,0,p);const x=p[0];if(x===0){m+=b;continue}const w=p[5],S=b.substring(0,p[1]),C=b.substring(p[4],w),k=b.substring(p[2],p[3]);x===1?m+=S||C?`${S}{$${k}}${C}`:`$${k}`:x===2?m+=S||C?`${S}{$}${C}`:"$":m+=`${S}{-$${k}}${C}`}m=Gm(m);const v=m||"/";return d&&a&&a.set(d,v),v}function p_(e){const t=new Map(e.map(r=>[encodeURIComponent(r),r])),s=Array.from(t.keys()).map(r=>r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),a=new RegExp(s,"g");return r=>r.replace(a,c=>t.get(c)??c)}function kh(e,t,s){const a=t[e];return typeof a!="string"?a:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(a)?a:a.split("/").map(r=>rb(r,s)).join("/"):rb(a,s)}function ab({path:e,params:t,decoder:s,...a}){let r=!1;const c=Object.create(null);if(!e||e==="/")return{interpolatedPath:"/",usedParams:c,isMissingParams:r};if(!e.includes("$"))return{interpolatedPath:e,usedParams:c,isMissingParams:r};const d=e.length;let f=0,p,m="";for(;f<d;){const v=f;p=Zm(e,v,p);const y=p[5];if(f=y+1,v===y)continue;const b=p[0];if(b===0){m+="/"+e.substring(v,y);continue}if(b===2){const x=t._splat;c._splat=x,c["*"]=x;const w=e.substring(v,p[1]),S=e.substring(p[4],y);if(!x){r=!0,(w||S)&&(m+="/"+w+S);continue}const C=kh("_splat",t,s);m+="/"+w+C+S;continue}if(b===1){const x=e.substring(p[2],p[3]);!r&&!(x in t)&&(r=!0),c[x]=t[x];const w=e.substring(v,p[1]),S=e.substring(p[4],y),C=kh(x,t,s)??"undefined";m+="/"+w+C+S;continue}if(b===3){const x=e.substring(p[2],p[3]),w=t[x];if(w==null)continue;c[x]=w;const S=e.substring(v,p[1]),C=e.substring(p[4],y),k=kh(x,t,s)??"";m+="/"+S+k+C;continue}}return e.endsWith("/")&&(m+="/"),{usedParams:c,interpolatedPath:m||"/",isMissingParams:r}}function rb(e,t){const s=encodeURIComponent(e);return t?.(s)??s}function dn(e){return!!e?.isNotFound}function g_(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}var om="tsr-scroll-restoration-v1_3",y_=(e,t)=>{let s;return(...a)=>{s||(s=setTimeout(()=>{e(...a),s=null},t))}};function v_(){const e=g_();if(!e)return null;const t=e.getItem(om);let s=t?JSON.parse(t):{};return{state:s,set:a=>{s=zi(a,s)||s;try{e.setItem(om,JSON.stringify(s))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}var Dc=v_(),b_=e=>e.state.__TSR_key||e.href;function x_(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 S_({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 b=p[y];if(y==="window")window.scrollTo({top:b.scrollY,left:b.scrollX,behavior:s});else if(y){const x=document.querySelector(y);x&&(x.scrollLeft=b.scrollX,x.scrollTop=b.scrollY)}}break e}const m=(c??window.location).hash.split("#",2)[1];if(m){const y=window.history.state?.__hashScrollIntoViewOptions??!0;if(y){const b=document.getElementById(m);b&&b.scrollIntoView(y)}break e}const v={top:0,left:0,behavior:s};if(window.scrollTo(v),r)for(const y of r){if(y==="window")continue;const b=typeof y=="function"?y():document.querySelector(y);b&&b.scrollTo(v)}}mu=!1}function j_(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||b_;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=x_(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 v=document.querySelector(c);v&&(m.scrollX=v.scrollLeft||0,m.scrollY=v.scrollTop||0)}return f})};typeof document<"u"&&document.addEventListener("scroll",y_(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})||(S_({storageKey:om,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 w_(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 N_(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 _h(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function C_(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]=_h(r):Array.isArray(c)?c.push(_h(r)):s[a]=[c,_h(r)]}return s}var k_=z_(JSON.parse),__=E_(JSON.stringify,JSON.parse);function z_(e){return t=>{t[0]==="?"&&(t=t.substring(1));const s=C_(t);for(const a in s){const r=s[a];if(typeof r=="string")try{s[a]=e(r)}catch{}}return s}}function E_(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=N_(r,a);return c?`?${c}`:""}}var ba="__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 xn(e){return e instanceof Response&&!!e.options}function A_(e){return{input:({url:t})=>{for(const s of e)t=lm(s,t);return t},output:({url:t})=>{for(let s=e.length-1;s>=0;s--)t=dS(e[s],t);return t}}}function R_(e){const t=uS(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 lm(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 dS(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 vt=(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))(vt||{});function fS({update:e,notify:t,unwatched:s}){return{link:a,unlink:r,propagate:c,checkDirty:d,shallowPropagate:f};function a(m,v,y){const b=v.depsTail;if(b!==void 0&&b.dep===m)return;const x=b!==void 0?b.nextDep:v.deps;if(x!==void 0&&x.dep===m){x.version=y,v.depsTail=x;return}const w=m.subsTail;if(w!==void 0&&w.version===y&&w.sub===v)return;const S=v.depsTail=m.subsTail={version:y,dep:m,sub:v,prevDep:b,nextDep:x,prevSub:w,nextSub:void 0};x!==void 0&&(x.prevDep=S),b!==void 0?b.nextDep=S:v.deps=S,w!==void 0?w.nextSub=S:m.subs=S}function r(m,v=m.sub){const y=m.dep,b=m.prevDep,x=m.nextDep,w=m.nextSub,S=m.prevSub;return x!==void 0?x.prevDep=b:v.depsTail=b,b!==void 0?b.nextDep=x:v.deps=x,w!==void 0?w.prevSub=S:y.subsTail=S,S!==void 0?S.nextSub=w:(y.subs=w)===void 0&&s(y),x}function c(m){let v=m.nextSub,y;e:do{const b=m.sub;let x=b.flags;if(x&60?x&12?x&4?!(x&48)&&p(m,b)?(b.flags=x|40,x&=1):x=0:b.flags=x&-9|32:x=0:b.flags=x|32,x&2&&t(b),x&1){const w=b.subs;if(w!==void 0){const S=(m=w).nextSub;S!==void 0&&(y={value:v,prev:y},v=S);continue}}if((m=v)!==void 0){v=m.nextSub;continue}for(;y!==void 0;)if(m=y.value,y=y.prev,m!==void 0){v=m.nextSub;continue e}break}while(!0)}function d(m,v){let y,b=0,x=!1;e:do{const w=m.dep,S=w.flags;if(v.flags&16)x=!0;else if((S&17)===17){if(e(w)){const C=w.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=w.deps,v=w,++b;continue}if(!x){const C=m.nextDep;if(C!==void 0){m=C;continue}}for(;b--;){const C=v.subs,k=C.nextSub!==void 0;if(k?(m=y.value,y=y.prev):m=C,x){if(e(v)){k&&f(C),v=m.sub;continue}x=!1}else v.flags&=-33;v=m.sub;const E=m.nextDep;if(E!==void 0){m=E;continue e}}return x}while(!0)}function f(m){do{const v=m.sub,y=v.flags;(y&48)===32&&(v.flags=y|16,(y&6)===2&&t(v))}while((m=m.nextSub)!==void 0)}function p(m,v){let y=v.depsTail;for(;y!==void 0;){if(y===m)return!0;y=y.prevDep}return!1}}let Vm=0,ca=0,Ho=0;const Hs=[],{link:v4,unlink:hS,propagate:b4,checkDirty:T_,shallowPropagate:x4}=fS({update(e){return e.depsTail!==void 0?M_(e):U_(e)},notify(e){let t=Ho,s=t;do if(Hs[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=Hs[s];Hs[s++]=Hs[t],Hs[t]=a}},unwatched(e){e.flags&1?e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,Au(e)):I_.call(e)}});function O_(){return Vm}function D_(){++Vm}function L_(){--Vm||P_()}function M_(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 U_(e){return e.flags=1,e.currentValue!==(e.currentValue=e.pendingValue)}function $_(e){const t=e.flags;if(t&16||t&32&&T_(e.deps,e)){e.depsTail=void 0,e.flags=6;try{e.fn()}finally{e.flags&=-5,Au(e)}}else e.flags=2}function P_(){try{for(;ca<Ho;){const e=Hs[ca];Hs[ca++]=void 0,$_(e)}}finally{for(;ca<Ho;){const e=Hs[ca];Hs[ca++]=void 0,e.flags|=10}ca=0,Ho=0}}function I_(){this.depsTail=void 0,this.flags=0,Au(this);const e=this.subs;e!==void 0&&hS(e)}function Au(e){const t=e.depsTail;let s=t!==void 0?t.nextDep:e.deps;for(;s!==void 0;)s=hS(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 cm=[];let Wc=0;const{link:ob,unlink:B_,propagate:q_,checkDirty:mS,shallowPropagate:lb}=fS({update(e){return e._update()},notify(e){cm[um++]=e,e.flags&=~vt.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=vt.Mutable|vt.Dirty,pu(e))}});let Lc=0,um=0,ys;function pu(e){const t=e.depsTail;let s=t!==void 0?t.nextDep:e.deps;for(;s!==void 0;)s=B_(s,e)}function pS(){if(!(O_()>0)){for(;Lc<um;){const e=cm[Lc];cm[Lc++]=void 0,e.notify()}Lc=0,um=0}}function gS(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?vt.None:vt.Mutable,get(){return ys!==void 0&&ob(r,ys,Wc),r._snapshot},subscribe(c){const d=Qm(c),f={current:!1},p=H_(()=>{r.get(),f.current?d.next?.(r._snapshot):f.current=!0});return{unsubscribe:()=>{p.stop()}}},_update(c){const d=ys,f=Object.is;if(s)ys=r,++Wc,r.depsTail=void 0;else if(c===void 0)return!1;s&&(r.flags=vt.Mutable|vt.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{ys=d,s&&(r.flags&=~vt.RecursedCheck),pu(r)}}};return s?(r.flags=vt.Mutable|vt.Dirty,r.get=function(){const c=r.flags;if(c&vt.Dirty||c&vt.Pending&&mS(r.deps,r)){if(r._update()){const d=r.subs;d!==void 0&&lb(d)}}else c&vt.Pending&&(r.flags=c&~vt.Pending);return ys!==void 0&&ob(r,ys,Wc),r._snapshot}):r.set=function(c){if(r._update(c)){const d=r.subs;d!==void 0&&(q_(d),lb(d),pS())}},r}function H_(e){const t=()=>{const a=ys;ys=s,++Wc,s.depsTail=void 0,s.flags=vt.Watching|vt.RecursedCheck;try{return e()}finally{ys=a,s.flags&=~vt.RecursedCheck,pu(s)}},s={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:vt.Watching|vt.RecursedCheck,notify(){const a=this.flags;a&vt.Dirty||a&vt.Pending&&mS(this.deps,this)?t():this.flags=vt.Watching},stop(){this.flags=vt.None,this.depsTail=void 0,pu(this)}};return t(),s}class Z_{constructor(t){this.atom=gS(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 F_{constructor(t){this.atom=gS(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(Qm(t))}}function G_(e){return typeof e=="function"?new F_(e):new Z_(e)}function K_(e){try{D_(),e()}finally{L_(),pS()}}function Zo(e){let t;return K_(()=>{t=e()}),t}var dm=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},Ru=(e,t)=>!!(e.preload&&!e.router.state.matches.some(s=>s.id===t)),xa=(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},cb=(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},Ei=(e,t,s)=>{if(!(!xn(s)&&!dn(s)))throw xn(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:xn(s)?"redirected":a.status==="pending"?"success":a.status,context:xa(e,t.index),isFetching:!1,error:s})),dn(s)&&!s.routeId&&(s.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),xn(s)&&(e.rendered=!0,s.options._fromLocation=e.location,s.redirectHandled=!0,s=e.router.resolveRedirect(s))),s},yS=(e,t)=>{const s=e.router.getMatch(t);return!!(!s||s._nonReactive.dehydrated)},ub=(e,t,s)=>{const a=xa(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,Ei(e,e.router.getMatch(r),s);try{d.options.onError?.(s)}catch(f){s=f,Ei(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&&!xn(s)&&!dn(s)&&(e.serialError??=s)},vS=(e,t,s,a)=>{if(a._nonReactive.pendingTimeout!==void 0)return;const r=s.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!Ru(e,t)&&(s.options.loader||s.options.beforeLoad||xS(s))&&typeof r=="number"&&r!==1/0&&(s.options.pendingComponent??e.router.options?.defaultPendingComponent)){const c=setTimeout(()=>{dm(e)},r);a._nonReactive.pendingTimeout=c}},V_=(e,t,s)=>{const a=e.router.getMatch(t);if(!a._nonReactive.beforeLoadPromise&&!a._nonReactive.loaderPromise)return;vS(e,t,s,a);const r=()=>{const c=e.router.getMatch(t);c.preload&&(c.status==="redirected"||c.status==="notFound")&&Ei(e,c,c.error)};return a._nonReactive.beforeLoadPromise?a._nonReactive.beforeLoadPromise.then(r):r()},Q_=(e,t,s,a)=>{const r=e.router.getMatch(t);let c=r._nonReactive.loadPromise;r._nonReactive.loadPromise=Ar(()=>{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"),vS(e,t,a,r);const p=new AbortController;let m=!1;const v=()=>{m||(m=!0,e.updateMatch(t,z=>({...z,isFetching:"beforeLoad",fetchCount:z.fetchCount+1,abortController:p})))},y=()=>{r._nonReactive.beforeLoadPromise?.resolve(),r._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,z=>({...z,isFetching:!1}))};if(!a.options.beforeLoad){Zo(()=>{v(),y()});return}r._nonReactive.beforeLoadPromise=Ar();const b={...xa(e,s,!1),...r.__routeContext},{search:x,params:w,cause:S}=r,C=Ru(e,t),k={search:x,abortController:p,params:w,preload:C,context:b,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(()=>{v(),y()});return}(xn(z)||dn(z))&&(v(),Mo(e,s,z,"BEFORE_LOAD")),Zo(()=>{v(),e.updateMatch(t,M=>({...M,__beforeLoadContext:z})),y()})};let A;try{if(A=a.options.beforeLoad(k),Jo(A))return v(),A.catch(z=>{Mo(e,s,z,"BEFORE_LOAD")}).then(E)}catch(z){v(),Mo(e,s,z,"BEFORE_LOAD")}E(A)},Y_=(e,t)=>{const{id:s,routeId:a}=e.matches[t],r=e.router.looseRoutesById[a],c=()=>f(),d=()=>Q_(e,s,t,r),f=()=>{if(yS(e,s))return;const p=V_(e,s,r);return Jo(p)?p.then(d):d()};return c()},J_=(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}))},bS=(e,t,s,a,r)=>{const c=t[a-1],{params:d,loaderDeps:f,abortController:p,cause:m}=e.router.getMatch(s),v=xa(e,a),y=Ru(e,s);return{params:d,deps:f,preload:!!y,parentMatchPromise:c,abortController:p,context:v,location:e.location,navigate:b=>e.router.navigate({...b,_fromLocation:e.location}),cause:y?"preload":m,route:r,...e.router.options.additionalContext}},db=async(e,t,s,a,r)=>{try{const c=e.router.getMatch(s);try{(!(Qk??e.router.isServer)||c.ssr===!0)&&Xo(r);const d=r.options.loader,f=typeof d=="function"?d:d?.handler,p=f?.(bS(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;Ei(e,e.router.getMatch(s),y),y!==void 0&&e.updateMatch(s,b=>({...b,loaderData:y}))}r._lazyPromise&&await r._lazyPromise;const v=c._nonReactive.minPendingPromise;v&&await v,r._componentsPromise&&await r._componentsPromise,e.updateMatch(s,y=>({...y,error:void 0,context:xa(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:xa(e,a)}));return}const p=c._nonReactive.minPendingPromise;p&&await p,dn(d)&&await r.options.notFoundComponent?.preload?.(),Ei(e,e.router.getMatch(s),d);try{r.options.onError?.(d)}catch(m){f=m,Ei(e,e.router.getMatch(s),m)}!xn(f)&&!dn(f)&&await Xo(r,["errorComponent"]),e.updateMatch(s,m=>({...m,error:f,context:xa(e,a),status:"error",isFetching:!1}))}}catch(c){const d=e.router.getMatch(s);d&&(d._nonReactive.loaderPromise=void 0),Ei(e,d,c)}},X_=async(e,t,s)=>{async function a(x,w,S,C,k){const E=Date.now()-w.updatedAt,A=x?k.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:k.options.staleTime??e.router.options.defaultStaleTime??0,z=k.options.shouldReload,M=typeof z=="function"?z(bS(e,t,r,s,k)):z,{status:U,invalid:R}=C,T=E>A&&(!!e.forceStaleReload||C.cause==="enter"||S!==void 0&&S!==C.id);d=U==="success"&&(R||(M??T)),x&&k.options.preload===!1||(d&&!e.sync&&v?(f=!0,(async()=>{try{await db(e,t,r,s,k);const q=e.router.getMatch(r);q._nonReactive.loaderPromise?.resolve(),q._nonReactive.loadPromise?.resolve(),q._nonReactive.loaderPromise=void 0,q._nonReactive.loadPromise=void 0}catch(q){xn(q)&&await e.router.navigate(q.options)}})()):U!=="success"||d?await db(e,t,r,s,k):ub(e,r,s))}const{id:r,routeId:c}=e.matches[s];let d=!1,f=!1;const p=e.router.looseRoutesById[c],m=p.options.loader,v=((typeof m=="function"?void 0:m?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!=="blocking";if(yS(e,r)){if(!e.router.getMatch(r))return e.matches[s];ub(e,r,s)}else{const x=e.router.getMatch(r),w=e.router.state.matches[s]?.routeId===c?e.router.state.matches[s].id:e.router.state.matches.find(C=>C.routeId===c)?.id,S=Ru(e,r);if(x._nonReactive.loaderPromise){if(x.status==="success"&&!e.sync&&!x.preload&&v)return x;await x._nonReactive.loaderPromise;const C=e.router.getMatch(r),k=C._nonReactive.error||C.error;k&&Ei(e,C,k),C.status==="pending"&&await a(S,x,w,C,p)}else{const C=S&&!e.router.state.matches.some(E=>E.id===r),k=e.router.getMatch(r);k._nonReactive.loaderPromise=Ar(),C!==k.preload&&e.updateMatch(r,E=>({...E,preload:C})),await a(S,x,w,k,p)}}const y=e.router.getMatch(r);f||(y._nonReactive.loaderPromise?.resolve(),y._nonReactive.loadPromise?.resolve(),y._nonReactive.loadPromise=void 0),clearTimeout(y._nonReactive.pendingTimeout),y._nonReactive.pendingTimeout=void 0,f||(y._nonReactive.loaderPromise=void 0),y._nonReactive.dehydrated=void 0;const b=f?y.isFetching:!1;return b!==y.isFetching||y.invalid!==!1?(e.updateMatch(r,x=>({...x,isFetching:b,invalid:!1})),e.router.getMatch(r)):y};async function fb(e){const t=e,s=[];t.router.state.matches.some(b=>b._forcePending)&&dm(t);let a;for(let b=0;b<t.matches.length;b++){try{const x=Y_(t,b);Jo(x)&&await x}catch(x){if(xn(x))throw x;if(dn(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?cb(t,a):void 0,d=a&&t.preload?0:c!==void 0?Math.min(c+1,r):r;let f,p;for(let b=0;b<d;b++)s.push(X_(t,s,b));try{await Promise.all(s)}catch{const b=await Promise.allSettled(s);for(const x of b){if(x.status!=="rejected")continue;const w=x.reason;if(xn(w))throw w;dn(w)?f??=w:p??=w}if(p!==void 0)throw p}const m=f??(a&&!t.preload?a:void 0);let v=t.serialError?t.firstBadMatchIndex??0:t.matches.length-1;if(!m&&a&&t.preload)return t.matches;if(m){const b=cb(t,m);Ui(b!==void 0);const x=t.matches[b],w=t.router.looseRoutesById[x.routeId],S=t.router.options?.defaultNotFoundComponent;!w.options.notFoundComponent&&S&&(w.options.notFoundComponent=S),m.routeId=x.routeId;const C=x.routeId===t.router.routeTree.id;t.updateMatch(x.id,k=>({...k,...C?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:m},isFetching:!1})),v=b,await Xo(w,["notFoundComponent"])}else if(!t.preload){const b=t.matches[0];b.globalNotFound||t.router.getMatch(b.id)?.globalNotFound&&t.updateMatch(b.id,x=>({...x,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){const b=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await Xo(b,["errorComponent"])}for(let b=0;b<=v;b++){const{id:x,routeId:w}=t.matches[b],S=t.router.looseRoutesById[w];try{const C=J_(t,x,S);if(C){const k=await C;t.updateMatch(x,E=>({...E,...k}))}}catch(C){console.error(`Error executing head for route ${w}:`,C)}}const y=dm(t);if(Jo(y)&&await y,m)throw m;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function hb(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=hb(e,eu);a?e._componentsPromise=a.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():hb(e,t);return e._lazyPromise?e._lazyPromise.then(s):s()}function xS(e){for(const t of eu)if(e.options[t]?.preload)return!0;return!1}var eu=["component","errorComponent","pendingComponent","notFoundComponent"],Di="__TSR_index",mb="popstate",pb="beforeunload";function W_(e){let t=e.getLocation();const s=new Set,a=d=>{t=e.getLocation(),s.forEach(f=>f({location:t,action:d}))},r=d=>{e.notifyOnIndexChange??!0?a(d):t=e.getLocation()},c=async({task:d,navigateOpts:f,...p})=>{if(f?.ignoreBlocker??!1){d();return}const m=e.getBlockers?.()??[],v=p.type==="PUSH"||p.type==="REPLACE";if(typeof document<"u"&&m.length&&v)for(const y of m){const b=gu(p.path,p.state);if(await y.blockerFn({currentLocation:t,nextLocation:b,action:p.type})){e.onBlocked?.();return}}d()};return{get location(){return t},get length(){return e.getLength()},subscribers:s,subscribe:d=>(s.add(d),()=>{s.delete(d)}),push:(d,f,p)=>{const m=t.state[Di];f=gb(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[Di];f=gb(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[Di]!==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 gb(e,t){t||(t={});const s=Ym();return{...t,key:s,__TSR_key:s,[Di]:e}}function ez(e){const t=typeof document<"u"?window:void 0,s=t.history.pushState,a=t.history.replaceState;let r=[];const c=()=>r,d=T=>r=T,f=(T=>T),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 T=Ym();t.history.replaceState({[Di]:0,key:T,__TSR_key:T},"")}let m=p(),v,y=!1,b=!1,x=!1,w=!1;const S=()=>m;let C,k;const E=()=>{C&&(R._ignoreSubscribers=!0,(C.isPush?t.history.pushState:t.history.replaceState)(C.state,"",C.href),R._ignoreSubscribers=!1,C=void 0,k=void 0,v=void 0)},A=(T,q,W)=>{const Q=f(q);k||(v=m),m=gu(q,W),C={href:Q,state:W,isPush:C?.isPush||T==="push"},k||(k=Promise.resolve().then(()=>E()))},z=T=>{m=p(),R.notify({type:T})},M=async()=>{if(b){b=!1;return}const T=p(),q=T.state[Di]-m.state[Di],W=q===1,Q=q===-1,ne=!W&&!Q||y;y=!1;const me=ne?"GO":Q?"BACK":"FORWARD",ke=ne?{type:"GO",index:q}:{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:T,action:me})){b=!0,t.history.go(1),R.notify(ke);return}}}m=p(),R.notify(ke)},U=T=>{if(w){w=!1;return}let q=!1;const W=c();if(typeof document<"u"&&W.length)for(const Q of W){const ne=Q.enableBeforeUnload??!0;if(ne===!0){q=!0;break}if(typeof ne=="function"&&ne()===!0){q=!0;break}}if(q)return T.preventDefault(),T.returnValue=""},R=W_({getLocation:S,getLength:()=>t.history.length,pushState:(T,q)=>A("push",T,q),replaceState:(T,q)=>A("replace",T,q),back:T=>(T&&(x=!0),w=!0,t.history.back()),forward:T=>{T&&(x=!0),w=!0,t.history.forward()},go:T=>{y=!0,t.history.go(T)},createHref:T=>f(T),flush:E,destroy:()=>{t.history.pushState=s,t.history.replaceState=a,t.removeEventListener(pb,U,{capture:!0}),t.removeEventListener(mb,M)},onBlocked:()=>{v&&m!==v&&(m=v)},getBlockers:c,setBlockers:d,notifyOnIndexChange:!1});return t.addEventListener(pb,U,{capture:!0}),t.addEventListener(mb,M),t.history.pushState=function(...T){const q=s.apply(t.history,T);return R._ignoreSubscribers||z("PUSH"),q},t.history.replaceState=function(...T){const q=a.apply(t.history,T);return R._ignoreSubscribers||z("REPLACE"),q},R}function tz(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function gu(e,t){const s=tz(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||{[Di]:0,key:c,__TSR_key:c}}}function Ym(){return(Math.random()+1).toString(36).substring(7)}function Sa(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 nz(e){const t=e.filter(s=>s.status!=="redirected");return t.length===e.length?e:t}var sz=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=p_(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=ez()),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=G_(az(this.latestLocation)),j_(this));let d=!1;const f=this.options.basepath??"/",p=this.options.rewrite;if(r||a!==f||c!==p){this.basepath=f;const m=[],v=uS(f);v&&v!=="/"&&m.push(R_({basepath:f})),p&&m.push(p),this.rewrite=m.length===0?void 0:m.length===1?m[0]:A_(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=c_(this.routeTree,this.options.caseSensitive,(s,a)=>{s.init({originalIndex:a})});return this.options.routeMasks&&i_(this.options.routeMasks,t.processedTree),t},this.subscribe=(t,s)=>{const a={eventType:t,fn:s};return this.subscribers.add(a),()=>{this.subscribers.delete(a)}},this.emit=t=>{this.subscribers.forEach(s=>{s.eventType===t.type&&s.fn(t)})},this.parseLocation=(t,s)=>{const a=({pathname:f,search:p,hash:m,href:v,state:y})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(f)){const C=this.options.parseSearch(p),k=this.options.stringifySearch(C);return{href:f+k+m,publicHref:v,pathname:Do(f).path,external:!1,searchStr:k,search:la(s?.search,C),hash:Do(m.slice(1)).path,state:ha(s?.state,y)}}const b=new URL(v,this.origin),x=lm(this.rewrite,b),w=this.options.parseSearch(x.search),S=this.options.stringifySearch(w);return x.search=S,{href:x.href.replace(x.origin,""),publicHref:v,pathname:Do(x.pathname).path,external:!!this.rewrite&&x.origin!==this.origin,searchStr:S,search:la(s?.search,w),hash:Do(x.hash.slice(1)).path,state:ha(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)=>m_({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=>rz({pathname:t,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=t=>{const s=this.getMatch(t);s&&(s.abortController.abort(),clearTimeout(s._nonReactive.pendingTimeout),s._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const t=this.state.matches.filter(a=>a.status==="pending"),s=this.state.matches.filter(a=>a.isFetching==="loader");new Set([...this.state.pendingMatches??[],...t,...s]).forEach(a=>{this.cancelMatch(a.id)})},this.buildLocation=t=>{const s=(r={})=>{const c=r._fromLocation||this.pendingBuiltLocation||this.latestLocation,d=this.matchRoutesLightweight(c);r.from;const f=r.unsafeRelative==="path"?c.pathname:r.from??d.fullPath,p=this.resolvePathWithBase(f,"."),m=d.search,v=Object.assign(Object.create(null),d.params),y=r.to?this.resolvePathWithBase(p,`${r.to}`):this.resolvePathWithBase(p,"."),b=r.params===!1||r.params===null?Object.create(null):(r.params??!0)===!0?v:Object.assign(v,zi(r.params,v)),x=this.getMatchedRoutes(y);let w=x.matchedRoutes;if((!x.foundRoute||x.foundRoute.path!=="/"&&x.routeParams["**"])&&this.options.notFoundRoute&&(w=[...w,this.options.notFoundRoute]),Object.keys(b).length>0)for(const q of w){const W=q.options.params?.stringify??q.options.stringifyParams;if(W)try{Object.assign(b,W(b))}catch{}}const S=t.leaveParams?y:Do(ab({path:y,params:b,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let C=m;if(t._includeValidateSearch&&this.options.search?.strict){const q={};w.forEach(W=>{if(W.options.validateSearch)try{Object.assign(q,tu(W.options.validateSearch,{...q,...C}))}catch{}}),C=q}C=oz({search:C,dest:r,destRoutes:w,_includeValidateSearch:t._includeValidateSearch}),C=la(m,C);const k=this.options.stringifySearch(C),E=r.hash===!0?c.hash:r.hash?zi(r.hash,c.hash):void 0,A=E?`#${E}`:"";let z=r.state===!0?c.state:r.state?zi(r.state,c.state):{};z=ha(c.state,z);const M=`${S}${k}${A}`;let U,R,T=!1;if(this.rewrite){const q=new URL(M,this.origin),W=dS(this.rewrite,q);U=q.href.replace(q.origin,""),W.origin!==this.origin?(R=W.href,T=!0):R=W.pathname+W.search+W.hash}else U=t_(M),R=U;return{publicHref:R,href:U,pathname:S,search:C,searchStr:k,state:z,hash:E??"",external:T,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=a_(d.pathname,this.processedTree);if(m){Object.assign(p,m.rawParams);const{from:v,params:y,...b}=m.route,x=y===!1||y===null?Object.create(null):(y??!0)===!0?p:Object.assign(p,zi(y,p));c={from:t.from,...b,params:x},f=s(c)}}}return f&&(d.maskedLocation=f),d};return t.mask?a(t,{from:t.from,...t.mask}):a(t)},this.commitLocation=async({viewTransition:t,ignoreBlocker:s,...a})=>{const r=()=>{const f=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];f.forEach(m=>{a.state[m]=this.latestLocation.state[m]});const p=va(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=Ar(()=>{d?.resolve(),d=void 0}),c&&r())this.load();else{let{maskedLocation:f,hashScrollIntoView:p,...m}=a;f&&(m={...f,state:{...f.state,__tempKey:void 0,__tempLocation:{...m,search:m.searchStr,state:{...m.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(m.unmaskOnReload??this.options.unmaskOnReload??!1)&&(m.state.__tempKey=this.tempLocationKey)),m.state.__hashScrollIntoViewOptions=p??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=t,this.history[a.replace?"replace":"push"](m.publicHref,m.state,{ignoreBlocker:s})}return this.resetNextScroll=a.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:t,resetScroll:s,hashScrollIntoView:a,viewTransition:r,ignoreBlocker:c,href:d,...f}={})=>{if(d){const v=this.history.location.state.__TSR_index,y=gu(d,{__TSR_index:t?v:v+1}),b=new URL(y.pathname,this.origin);f.to=lm(this.rewrite,b).pathname,f.search=this.options.parseSearch(y.search),f.hash=y.hash.slice(1)}const p=this.buildLocation({...f,_includeValidateSearch:!0});this.pendingBuiltLocation=p;const m=this.commitLocation({...p,viewTransition:r,replace:t,resetScroll:s,hashScrollIntoView:a,ignoreBlocker:c});return Promise.resolve().then(()=>{this.pendingBuiltLocation===p&&(this.pendingBuiltLocation=void 0)}),m},this.navigate=async({to:t,reloadDocument:s,href:a,publicHref:r,...c})=>{let d=!1;if(a)try{new URL(`${a}`),d=!0}catch{}if(d&&!s&&(s=!0),s){if(t!==void 0||!a){const p=this.buildLocation({to:t,...c});a=a??p.publicHref,r=r??p.publicHref}const f=!d&&r?r:a;if(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",...Sa({resolvedLocation:m,location:p})}),this.emit({type:"onBeforeLoad",...Sa({resolvedLocation:m,location:p})}),await fb({router:this,sync:t?.sync,forceStaleReload:c.href===p.href,matches:this.state.pendingMatches,location:p,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let v=[],y=[],b=[],x=[];Zo(()=>{this.__store.setState(w=>{const S=w.matches,C=w.pendingMatches||w.matches;return v=S.filter(k=>!C.some(E=>E.id===k.id)),y=S.filter(k=>!C.some(E=>E.routeId===k.routeId)),b=C.filter(k=>!S.some(E=>E.routeId===k.routeId)),x=C.filter(k=>S.some(E=>E.routeId===k.routeId)),{...w,isLoading:!1,loadedAt:Date.now(),matches:C,pendingMatches:void 0,cachedMatches:[...w.cachedMatches,...v.filter(k=>k.status!=="error"&&k.status!=="notFound"&&k.status!=="redirected")]}}),this.clearExpiredCache()}),[[y,"onLeave"],[b,"onEnter"],[x,"onStay"]].forEach(([w,S])=>{w.forEach(C=>{this.looseRoutesById[C.routeId].options[S]?.(C)})})})})}})}catch(p){xn(p)?(s=p,this.navigate({...s.options,replace:!0,ignoreBlocker:!0})):dn(p)&&(a=p),this.__store.setState(m=>({...m,statusCode:s?s.status:a?404:m.matches.some(v=>v.status==="error")?500:200,redirect:s}))}this.latestLoadPromise===r&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),f()})}),this.latestLoadPromise=r,await r;this.latestLoadPromise&&r!==this.latestLoadPromise;)await this.latestLoadPromise;let d;this.hasNotFoundMatch()?d=404:this.__store.state.matches.some(f=>f.status==="error")&&(d=500),d!==void 0&&this.__store.setState(f=>({...f,statusCode:d}))},this.startViewTransition=t=>{const s=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,s&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let a;if(typeof s=="object"&&this.isViewTransitionTypesSupported){const r=this.latestLocation,c=this.state.resolvedLocation,d=typeof s.types=="function"?s.types(Sa({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:nz(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 fb({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(xn(d))return d.options.reloadDocument?void 0:await this.preloadRoute({...d.options,_fromLocation:s});dn(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=r_(r.pathname,s?.caseSensitive??!1,s?.fuzzy??!1,c.pathname,this.processedTree);return!d||t.params&&!va(d.rawParams,t.params,{partial:!0})?!1:s?.includeSearch??!0?va(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??__,parseSearch:e.parseSearch??k_,protocolAllowlist:e.protocolAllowlist??e_}),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?cz(this.options.notFoundMode,d):void 0,m=new Array(d.length),v=new Map(this.state.matches.map(y=>[y.routeId,y]));for(let y=0;y<d.length;y++){const b=d[y],x=m[y-1];let w,S,C;{const me=x?.search??e.search,ke=x?._strictSearch??void 0;try{const je=tu(b.options.validateSearch,{...me})??void 0;w={...me,...je},S={...ke,...je},C=void 0}catch(je){let B=je;if(je instanceof yu||(B=new yu(je.message,{cause:je})),t?.throwOnError)throw B;w=me,S={},C=B}}const k=b.options.loaderDeps?.({search:w})??"",E=k?JSON.stringify(k):"",{interpolatedPath:A,usedParams:z}=ab({path:b.fullPath,params:r,decoder:this.pathParamsDecoder,server:this.isServer}),M=b.id+A+E,U=this.getMatch(M),R=v.get(b.id),T=U?._strictParams??z;let q;if(!U)try{yb(b,z,c,T)}catch(me){if(dn(me)||xn(me)?q=me:q=new iz(me.message,{cause:me}),t?.throwOnError)throw q}Object.assign(r,T);const W=R?"stay":"enter";let Q;if(U)Q={...U,cause:W,params:R?.params??r,_strictParams:T,search:la(R?R.search:U.search,w),_strictSearch:S};else{const me=b.options.loader||b.options.beforeLoad||b.lazyFn||xS(b)?"pending":"success";Q={id:M,ssr:b.options.ssr,index:y,routeId:b.id,params:R?.params??r,_strictParams:T,pathname:A,updatedAt:Date.now(),search:R?la(R.search,w):w,_strictSearch:S,searchError:void 0,status:me,isFetching:!1,error:void 0,paramsError:q,__routeContext:void 0,_nonReactive:{loadPromise:Ar()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:W,loaderDeps:R?ha(R.loaderDeps,k):k,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:b.options.staticData||{},fullPath:b.fullPath}}t?.preload||(Q.globalNotFound=p===b.id),Q.searchError=C;const ne=this.getParentContext(x);Q.context={...ne,...Q.__routeContext,...Q.__beforeLoadContext},m[y]=Q}for(let y=0;y<m.length;y++){const b=m[y],x=this.looseRoutesById[b.routeId],w=this.getMatch(b.id),S=v.get(b.routeId);if(b.params=S?la(S.params,r):r,!w){const C=m[y-1],k=this.getParentContext(C);if(x.options.context){const E={deps:b.loaderDeps,params:b.params,context:k??{},location:e,navigate:A=>this.navigate({...A,_fromLocation:e}),buildLocation:this.buildLocation,cause:b.cause,abortController:b.abortController,preload:!!b.preload,matches:m,routeId:x.id};b.__routeContext=x.options.context(E)??void 0}b.context={...k,...b.__routeContext,...b.__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 v of t)try{yb(v,s,a??{},m)}catch{}p=m}return{matchedRoutes:t,fullPath:r.fullPath,search:c,params:p}}},yu=class extends Error{},iz=class extends Error{};function az(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 rz({pathname:e,routesById:t,processedTree:s}){const a=Object.create(null),r=Oi(e);let c,d;const f=o_(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 oz({search:e,dest:t,destRoutes:s,_includeValidateSearch:a}){return lz(s)(e,t,a??!1)}function lz(e){const t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const r of e){if("search"in r.options)r.options.search?.middlewares&&t.middlewares.push(...r.options.search.middlewares);else if(r.options.preSearchFilters||r.options.postSearchFilters){const c=({search:d,next:f})=>{let p=d;"preSearchFilters"in r.options&&r.options.preSearchFilters&&(p=r.options.preSearchFilters.reduce((v,y)=>y(v),d));const m=f(p);return"postSearchFilters"in r.options&&r.options.postSearchFilters?r.options.postSearchFilters.reduce((v,y)=>y(v),m):m};t.middlewares.push(c)}if(r.options.validateSearch){const c=({search:d,next:f})=>{const p=f(d);if(!t._includeValidateSearch)return p;try{return{...p,...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:zi(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 cz(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 ba}function yb(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 uz="Error preloading route! ☝️",SS=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=ba:this.parentRoute||Ui(!1);let r=a?ba:s?.path;r&&r!=="/"&&(r=cS(r));const c=s?.id||r;let d=a?ba: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.")}},dz=class extends SS{constructor(e){super(e)}};function Jm(e){const t=e.errorComponent??Xm;return l.jsx(fz,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:s,reset:a})=>s?N.createElement(t,{error:s,reset:a}):e.children})}var fz=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 hz({children:e,fallback:t=null}){return jS()?l.jsx(ss.Fragment,{children:e}):l.jsx(ss.Fragment,{children:t})}function jS(){return ss.useSyncExternalStore(mz,()=>!0,()=>!1)}function mz(){return()=>{}}var wS=N.createContext(null);function Kn(e){const t=N.useContext(wS);return e?.warn,t}var zh={exports:{}},Eh={},Ah={exports:{}},Rh={};var vb;function pz(){if(vb)return Rh;vb=1;var e=rl();function t(y,b){return y===b&&(y!==0||1/y===1/b)||y!==y&&b!==b}var s=typeof Object.is=="function"?Object.is:t,a=e.useState,r=e.useEffect,c=e.useLayoutEffect,d=e.useDebugValue;function f(y,b){var x=b(),w=a({inst:{value:x,getSnapshot:b}}),S=w[0].inst,C=w[1];return c(function(){S.value=x,S.getSnapshot=b,p(S)&&C({inst:S})},[y,x,b]),r(function(){return p(S)&&C({inst:S}),y(function(){p(S)&&C({inst:S})})},[y]),d(x),x}function p(y){var b=y.getSnapshot;y=y.value;try{var x=b();return!s(y,x)}catch{return!0}}function m(y,b){return b()}var v=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?m:f;return Rh.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:v,Rh}var bb;function gz(){return bb||(bb=1,Ah.exports=pz()),Ah.exports}var xb;function yz(){if(xb)return Eh;xb=1;var e=rl(),t=gz();function s(m,v){return m===v&&(m!==0||1/m===1/v)||m!==m&&v!==v}var a=typeof Object.is=="function"?Object.is:s,r=t.useSyncExternalStore,c=e.useRef,d=e.useEffect,f=e.useMemo,p=e.useDebugValue;return Eh.useSyncExternalStoreWithSelector=function(m,v,y,b,x){var w=c(null);if(w.current===null){var S={hasValue:!1,value:null};w.current=S}else S=w.current;w=f(function(){function k(U){if(!E){if(E=!0,A=U,U=b(U),x!==void 0&&S.hasValue){var R=S.value;if(x(R,U))return z=R}return z=U}if(R=z,a(A,U))return R;var T=b(U);return x!==void 0&&x(R,T)?(A=U,R):(A=U,z=T)}var E=!1,A,z,M=y===void 0?null:y;return[function(){return k(v())},M===null?void 0:function(){return k(M())}]},[v,y,b,x]);var C=r(m,w[0],w[1]);return d(function(){S.hasValue=!0,S.value=C},[C]),p(C),C},Eh}var Sb;function vz(){return Sb||(Sb=1,zh.exports=yz()),zh.exports}var bz=vz();function xz(e,t){return e===t}function Sz(e,t,s=xz){const a=N.useCallback(d=>{if(!e)return()=>{};const{unsubscribe:f}=e.subscribe(d);return f},[e]),r=N.useCallback(()=>e?.get(),[e]);return bz.useSyncExternalStoreWithSelector(a,r,r,t,s)}function Sn(e){const t=Kn({warn:e?.router===void 0}),s=e?.router||t,a=N.useRef(void 0);return Sz(s.__store,r=>{if(e?.select){if(e.structuralSharing??s.options.defaultStructuralSharing){const c=ha(a.current,e.select(r));return a.current=c,c}return e.select(r)}return r})}var Tu=N.createContext(void 0),jz=N.createContext(void 0);function Ii(e){const t=N.useContext(e.from?jz:Tu);return Sn({select:s=>{const a=s.matches.find(r=>e.from?e.from===r.routeId:r.id===t);if(Ui(!((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 Ii({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 Ii({...s,select:a=>t?t(a.loaderDeps):a.loaderDeps})}function Ou(e){return Ii({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const s=e.strict===!1?t.params:t._strictParams;return e.select?e.select(s):s}})}function Du(e){return Ii({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function Ca(e){const t=Kn();return N.useCallback(s=>t.navigate({...s,from:s.from??e?.from}),[e?.from,t])}function tp(e){return Ii({...e,select:t=>e.select?e.select(t.context):t.context})}var np=Hx();const wz=qx(np);function Nz(e,t){const s=Kn(),a=Vk(t),{activeProps:r,inactiveProps:c,activeOptions:d,to:f,preload:p,preloadDelay:m,hashScrollIntoView:v,replace:y,startTransition:b,resetScroll:x,viewTransition:w,children:S,target:C,disabled:k,style:E,className:A,onClick:z,onBlur:M,onFocus:U,onMouseEnter:R,onMouseLeave:T,onTouchStart:q,ignoreBlocker:W,params:Q,search:ne,hash:me,state:ke,mask:je,reloadDocument:B,unsafeRelative:O,from:ae,_fromLocation:pe,...te}=e,D=jS(),G=Sn({select:ze=>{const De=ze.matches[ze.matches.length-1];return{search:De?.search,hash:ze.location.hash,path:De?.pathname}},structuralSharing:!0}),se=e.from,oe=N.useMemo(()=>({...e,from:se}),[s,G,se,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),ce=N.useMemo(()=>s.buildLocation({...oe}),[s,oe]),he=ce.maskedLocation?ce.maskedLocation.publicHref:ce.publicHref,de=ce.maskedLocation?ce.maskedLocation.external:ce.external,Fe=N.useMemo(()=>Az(he,de,s.history,k),[k,de,he,s.history]),ge=N.useMemo(()=>{if(Fe?.external)return du(Fe.href,s.protocolAllowlist)?void 0:Fe.href;if(!Rz(f)&&!(typeof f!="string"||f.indexOf(":")===-1))try{return new URL(f),du(f,s.protocolAllowlist)?void 0:f}catch{}},[f,Fe,s.protocolAllowlist]),Je=Sn({select:ze=>{if(ge)return!1;if(d?.exact){if(!h_(ze.location.pathname,ce.pathname,s.basepath))return!1}else{const De=hu(ze.location.pathname,s.basepath),pt=hu(ce.pathname,s.basepath);if(!(De.startsWith(pt)&&(De.length===pt.length||De[pt.length]==="/")))return!1}return(d?.includeSearch??!0)&&!va(ze.location.search,ce.search,{partial:!d?.exact,ignoreUndefined:!d?.explicitUndefined})?!1:d?.includeHash?D&&ze.location.hash===ce.hash:!0}}),mt=Je?zi(r,{})??Cz:Th,fe=Je?Th:zi(c,{})??Th,Xe=[A,mt.className,fe.className].filter(Boolean).join(" "),ct=(E||mt.style||fe.style)&&{...E,...mt.style,...fe.style},[nn,_t]=N.useState(!1),sn=N.useRef(!1),Vt=e.reloadDocument||ge?!1:p??s.options.defaultPreload,zt=m??s.options.defaultPreloadDelay??0,xt=N.useCallback(()=>{s.preloadRoute({...oe,_builtLocation:ce}).catch(ze=>{console.warn(ze),console.warn(uz)})},[s,oe,ce]);Kk(a,N.useCallback(ze=>{ze?.isIntersecting&&xt()},[xt]),Ez,{disabled:!!k||Vt!=="viewport"}),N.useEffect(()=>{sn.current||!k&&Vt==="render"&&(xt(),sn.current=!0)},[k,xt,Vt]);const hn=ze=>{const De=ze.currentTarget.getAttribute("target"),pt=C!==void 0?C:De;if(!k&&!Tz(ze)&&!ze.defaultPrevented&&(!pt||pt==="_self")&&ze.button===0){ze.preventDefault(),np.flushSync(()=>{_t(!0)});const an=s.subscribe("onResolved",()=>{an(),_t(!1)});s.navigate({...oe,replace:y,resetScroll:x,hashScrollIntoView:v,startTransition:b,viewTransition:w,ignoreBlocker:W})}};if(ge)return{...te,ref:a,href:ge,...S&&{children:S},...C&&{target:C},...k&&{disabled:k},...E&&{style:E},...A&&{className:A},...z&&{onClick:z},...M&&{onBlur:M},...U&&{onFocus:U},...R&&{onMouseEnter:R},...T&&{onMouseLeave:T},...q&&{onTouchStart:q}};const re=ze=>{if(k||Vt!=="intent")return;if(!zt){xt();return}const De=ze.currentTarget;if(Uo.has(De))return;const pt=setTimeout(()=>{Uo.delete(De),xt()},zt);Uo.set(De,pt)},$e=ze=>{k||Vt!=="intent"||xt()},Pe=ze=>{if(k||!Vt||!zt)return;const De=ze.currentTarget,pt=Uo.get(De);pt&&(clearTimeout(pt),Uo.delete(De))};return{...te,...mt,...fe,href:Fe?.href,ref:a,onClick:mr([z,hn]),onBlur:mr([M,Pe]),onFocus:mr([U,re]),onMouseEnter:mr([R,re]),onMouseLeave:mr([T,Pe]),onTouchStart:mr([q,$e]),disabled:!!k,target:C,...ct&&{style:ct},...Xe&&{className:Xe},...k&&kz,...Je&&_z,...D&&nn&&zz}}var Th={},Cz={className:"active"},kz={role:"link","aria-disabled":!0},_z={"data-status":"active","aria-current":"page"},zz={"data-transitioning":"transitioning"},Uo=new WeakMap,Ez={rootMargin:"100px"},mr=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 Rz(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var yt=N.forwardRef((e,t)=>{const{_asChild:s,...a}=e,{type:r,...c}=Nz(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 Tz(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var Oz=class extends SS{constructor(e){super(e),this.useMatch=t=>Ii({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>tp({...t,from:this.id}),this.useSearch=t=>Du({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>Ou({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=()=>Ca({from:this.fullPath}),this.Link=ss.forwardRef((t,s)=>l.jsx(yt,{ref:s,from:this.fullPath,...t})),this.$$typeof=Symbol.for("react.memo")}};function as(e){return new Oz(e)}function Dz(){return e=>Mz(e)}var Lz=class extends dz{constructor(e){super(e),this.useMatch=t=>Ii({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>tp({...t,from:this.id}),this.useSearch=t=>Du({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>Ou({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=()=>Ca({from:this.fullPath}),this.Link=ss.forwardRef((t,s)=>l.jsx(yt,{ref:s,from:this.fullPath,...t})),this.$$typeof=Symbol.for("react.memo")}};function Mz(e){return new Lz(e)}function jb(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=as(s);return a.isRoot=!1,a},this.silent=t?.silent}},Nb=class{constructor(e){this.useMatch=t=>Ii({select:t?.select,from:this.options.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>tp({...t,from:this.options.id}),this.useSearch=t=>Du({select:t?.select,structuralSharing:t?.structuralSharing,from:this.options.id}),this.useParams=t=>Ou({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=()=>Ca({from:Kn().routesById[this.options.id].fullPath}),this.options=e,this.$$typeof=Symbol.for("react.memo")}};function Cb(e){return typeof e=="object"?new Nb(e):t=>new Nb({id:e,...t})}function Uz(e){const t=Sn({select:s=>`not-found-${s.location.pathname}-${s.status}`});return l.jsx(Jm,{getResetKey:()=>t,onCatch:(s,a)=>{if(dn(s))e.onCatch?.(s,a);else throw s},errorComponent:({error:s})=>{if(dn(s))return e.fallback?.(s);throw s},children:e.children})}function $z(){return l.jsx("p",{children:"Not Found"})}function xr(e){return l.jsx(l.Fragment,{children:e.children})}function NS(e,t,s){return t.options.notFoundComponent?l.jsx(t.options.notFoundComponent,{...s}):e.options.defaultNotFoundComponent?l.jsx(e.options.defaultNotFoundComponent,{...s}):l.jsx($z,{})}function Pz(){return Kn().isScrollRestoring,null}var CS=N.memo(function({matchId:t}){const s=Kn(),a=Sn({select:w=>{const S=w.matches.findIndex(k=>k.id===t),C=w.matches[S];return Ui(C),{routeId:C.routeId,ssr:C.ssr,_displayPending:C._displayPending,resetKey:w.loadedAt,parentRouteId:w.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,v=a.ssr===!1||a.ssr==="data-only",y=(!r.isRoot||r.options.wrapInSuspense||v)&&(r.options.wrapInSuspense??c??(r.options.errorComponent?.preload||v))?N.Suspense:xr,b=f?Jm:xr,x=m?Uz:xr;return l.jsxs(r.isRoot?r.options.shellComponent??xr:xr,{children:[l.jsx(Tu.Provider,{value:t,children:l.jsx(y,{fallback:d,children:l.jsx(b,{getResetKey:()=>a.resetKey,errorComponent:f||Xm,onCatch:(w,S)=>{if(dn(w))throw w;p?.(w,S)},children:l.jsx(x,{fallback:w=>{if(!m||w.routeId&&w.routeId!==a.routeId||!w.routeId&&!r.isRoot)throw w;return N.createElement(m,w)},children:v||a._displayPending?l.jsx(hz,{fallback:d,children:l.jsx(kb,{matchId:t})}):l.jsx(kb,{matchId:t})})})})}),a.parentRouteId===ba&&s.options.scrollRestoration?l.jsxs(l.Fragment,{children:[l.jsx(Iz,{}),l.jsx(Pz,{})]}):null]})});function Iz(){const e=Kn(),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",...Sa(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}var kb=N.memo(function({matchId:t}){const s=Kn(),{match:a,key:r,routeId:c}=Sn({select:p=>{const m=p.matches.find(b=>b.id===t),v=m.routeId,y=(s.routesById[v].options.remountDeps??s.options.defaultRemountDeps)?.({routeId:v,loaderDeps:m.loaderDeps,params:m._strictParams,search:m._strictSearch});return{key:y?JSON.stringify(y):void 0,routeId:v,match:{id:m.id,status:m.status,error:m.error,_forcePending:m._forcePending,_displayPending:m._displayPending}}},structuralSharing:!0}),d=s.routesById[c],f=N.useMemo(()=>{const p=d.options.component??s.options.defaultComponent;return p?l.jsx(p,{},r):l.jsx(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 v=Ar();m._nonReactive.minPendingPromise=v,setTimeout(()=>{v.resolve(),m._nonReactive.minPendingPromise=void 0},p)}}throw s.getMatch(a.id)?._nonReactive.loadPromise}if(a.status==="notFound")return Ui(dn(a.error)),NS(s,d,a.error);if(a.status==="redirected")throw Ui(xn(a.error)),s.getMatch(a.id)?._nonReactive.loadPromise;if(a.status==="error")throw a.error;return f}),sp=N.memo(function(){const t=Kn(),s=N.useContext(Tu),a=Sn({select:m=>m.matches.find(v=>v.id===s)?.routeId}),r=t.routesById[a],c=Sn({select:m=>{const v=m.matches.find(y=>y.id===s);return Ui(v),v.globalNotFound}}),d=Sn({select:m=>{const v=m.matches;return v[v.findIndex(y=>y.id===s)+1]?.id}}),f=t.options.defaultPendingComponent?l.jsx(t.options.defaultPendingComponent,{}):null;if(c)return NS(t,r,void 0);if(!d)return null;const p=l.jsx(CS,{matchId:d});return a===ba?l.jsx(N.Suspense,{fallback:f,children:p}):p});function Bz(){const e=Kn(),t=N.useRef({router:e,mounted:!1}),[s,a]=N.useState(!1),{hasPendingMatches:r,isLoading:c}=Sn({select:y=>({isLoading:y.isLoading,hasPendingMatches:y.matches.some(b=>b.status==="pending")}),structuralSharing:!0}),d=jh(c),f=c||s||r,p=jh(f),m=c||r,v=jh(m);return e.startTransition=y=>{a(!0),N.startTransition(()=>{y(),a(!1)})},N.useEffect(()=>{const y=e.history.subscribe(e.load),b=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Oi(e.latestLocation.publicHref)!==Oi(b.publicHref)&&e.commitLocation({...b,replace:!0}),()=>{y()}},[e,e.history]),Oc(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(b){console.error(b)}})()},[e]),Oc(()=>{d&&!c&&e.emit({type:"onLoad",...Sa(e.state)})},[d,e,c]),Oc(()=>{v&&!m&&e.emit({type:"onBeforeRouteMount",...Sa(e.state)})},[m,v,e]),Oc(()=>{if(p&&!f){const y=Sa(e.state);e.emit({type:"onResolved",...y}),e.__store.setState(b=>({...b,status:"idle",resolvedLocation:b.location})),y.hrefChanged&&w_(e)}},[f,p,e]),null}function qz(){const e=Kn(),t=e.routesById[ba].options.pendingComponent??e.options.defaultPendingComponent,s=t?l.jsx(t,{}):null,a=l.jsxs(typeof document<"u"&&e.ssr?xr:N.Suspense,{fallback:s,children:[l.jsx(Bz,{}),l.jsx(Hz,{})]});return e.options.InnerWrap?l.jsx(e.options.InnerWrap,{children:a}):a}function Hz(){const e=Kn(),t=Sn({select:r=>r.matches[0]?.id}),s=Sn({select:r=>r.loadedAt}),a=t?l.jsx(CS,{matchId:t}):null;return l.jsx(Tu.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?a:l.jsx(Jm,{getResetKey:()=>s,errorComponent:Xm,onCatch:void 0,children:a})})}var Zz=e=>new Fz(e),Fz=class extends sz{constructor(e){super(e)}};typeof globalThis<"u"?(globalThis.createFileRoute=jb,globalThis.createLazyFileRoute=Cb):typeof window<"u"&&(window.createFileRoute=jb,window.createLazyFileRoute=Cb);function Gz({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(wS.Provider,{value:e,children:t});return e.options.Wrap?l.jsx(e.options.Wrap,{children:a}):a}function Kz({router:e,...t}){return l.jsx(Gz,{router:e,...t,children:l.jsx(qz,{})})}function Vz(e){return Sn({select:t=>t.location})}let Ai=[],Qz=0;const fm=new Set;function kS(){const e=[...Ai];for(const t of fm)t(e)}function Yz(e,t="negative",s=6e3){const a=String(++Qz),r={id:a,message:e,tone:t,expiresAt:Date.now()+s};return Ai=[...Ai,r],kS(),setTimeout(()=>{_S(a)},s),a}function _S(e){const t=Ai.length;Ai=Ai.filter(s=>s.id!==e),Ai.length!==t&&kS()}function Jz(e){return fm.add(e),()=>{fm.delete(e)}}function _b(){return Ai}function Xz(){return new Ik({defaultOptions:{queries:{staleTime:3e4,retry:1,refetchOnWindowFocus:!1}},mutationCache:new Jx({onError:e=>{Yz(e instanceof Error?e.message:"An unexpected error occurred","negative")}})})}const Wz=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),e2=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,s,a)=>a?a.toUpperCase():s.toLowerCase()),zb=e=>{const t=e2(e);return t.charAt(0).toUpperCase()+t.slice(1)},zS=(...e)=>e.filter((t,s,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===s).join(" ").trim(),t2=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var n2={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 s2=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,...n2,width:t,height:t,stroke:e,strokeWidth:a?Number(s)*24/Number(t):s,className:zS("lucide",r),...!c&&!t2(f)&&{"aria-hidden":"true"},...f},[...d.map(([m,v])=>N.createElement(m,v)),...Array.isArray(c)?c:[c]]));const wn=(e,t)=>{const s=N.forwardRef(({className:a,...r},c)=>N.createElement(s2,{ref:c,iconNode:t,className:zS(`lucide-${Wz(zb(e))}`,`lucide-${e}`,a),...r}));return s.displayName=zb(e),s};const i2=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Lu=wn("chevron-right",i2);const a2=[["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"}]],r2=wn("download",a2);const o2=[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]],l2=wn("github",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=wn("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=wn("layout-dashboard",d2);const h2=[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]],m2=wn("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=wn("play",p2);const y2=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Eb=wn("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=wn("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=wn("rotate-ccw",x2);const j2=[["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"}]],w2=wn("settings",j2);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=wn("trash-2",N2);const k2=[["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"}]],_2=wn("triangle-alert",k2);const z2=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Mu=wn("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 Uu(e){return e.split("-").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function vs(e){if(!e)return"—";try{return new Date(e).toLocaleString()}catch{return e}}function Ab(e){return e===null?"Unknown":e?"Pass":"Fail"}function hm(e){return e===0?"12:00 AM":e<12?`${e}:00 AM`:e===12?"12:00 PM":`${e-12}:00 PM`}function A2(e,t){return e==="twice-daily"?"twice-daily":e.startsWith("weekly@")?`${e}@${t}`:`daily@${t}`}function R2(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 T2(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 ${hm(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 ${hm(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 ka(...e){return N.useCallback(ip(...e),e)}var O2=Symbol.for("react.lazy"),vu=Um[" use ".trim().toString()];function D2(e){return typeof e=="object"&&e!==null&&"then"in e}function ES(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===O2&&"_payload"in e&&D2(e._payload)}function L2(e){const t=U2(e),s=N.forwardRef((a,r)=>{let{children:c,...d}=a;ES(c)&&typeof vu=="function"&&(c=vu(c._payload));const f=N.Children.toArray(c),p=f.find(P2);if(p){const m=p.props.children,v=f.map(y=>y===p?N.Children.count(m)>1?N.Children.only(null):N.isValidElement(m)?m.props.children:null:y);return l.jsx(t,{...d,ref:r,children:N.isValidElement(m)?N.cloneElement(m,void 0,v):null})}return l.jsx(t,{...d,ref:r,children:c})});return s.displayName=`${e}.Slot`,s}var M2=L2("Slot");function U2(e){const t=N.forwardRef((s,a)=>{let{children:r,...c}=s;if(ES(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 $2=Symbol("radix.slottable");function P2(e){return N.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===$2}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 AS(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=AS(e[t]))&&(a&&(a+=" "),a+=s)}else for(s in e)e[s]&&(a&&(a+=" "),a+=s);return a}function RS(){for(var e,t,s=0,a="",r=arguments.length;s<r;s++)(e=arguments[s])&&(t=AS(e))&&(a&&(a+=" "),a+=t);return a}const Tb=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Ob=RS,TS=(e,t)=>s=>{var a;if(t?.variants==null)return Ob(e,s?.class,s?.className);const{variants:r,defaultVariants:c}=t,d=Object.keys(r).map(m=>{const v=s?.[m],y=c?.[m];if(v===null)return null;const b=Tb(v)||Tb(y);return r[m][b]}),f=s&&Object.entries(s).reduce((m,v)=>{let[y,b]=v;return b===void 0||(m[y]=b),m},{}),p=t==null||(a=t.compoundVariants)===null||a===void 0?void 0:a.reduce((m,v)=>{let{class:y,className:b,...x}=v;return Object.entries(x).every(w=>{let[S,C]=w;return Array.isArray(C)?C.includes({...c,...f}[S]):{...c,...f}[S]===C})?[...m,y,b]:m},[]);return Ob(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="-",Db=[],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 DS(f,p,t)},getConflictingClassGroupIds:(d,f)=>{if(f){const p=a[d],m=s[d];return p?m?q2(m,p):p:m||Db}return s[d]||Db}}},DS=(e,t,s)=>{if(e.length-t===0)return s.classGroupId;const r=e[t],c=s.nextPart.get(r);if(c){const m=DS(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 v=d[m];if(v.validator(f))return v.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:LS(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,LS(t,f),s,a)}},LS=(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)}}},mm="!",Lb=":",tE=[],Mb=(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 v=r.length;for(let S=0;S<v;S++){const C=r[S];if(d===0&&f===0){if(C===Lb){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 b=y,x=!1;y.endsWith(mm)?(b=y.slice(0,-1),x=!0):y.startsWith(mm)&&(b=y.slice(1),x=!0);const w=m&&m>p?m-p:void 0;return Mb(c,x,b,w)};if(t){const r=t+Lb,c=a;a=d=>d.startsWith(r)?c(d.slice(r.length)):Mb(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 v=f[m],{isExternal:y,modifiers:b,hasImportantModifier:x,baseClassName:w,maybePostfixModifierPosition:S}=s(v);if(y){p=v+(p.length>0?" "+p:p);continue}let C=!!S,k=a(C?w.substring(0,S):w);if(!k){if(!C){p=v+(p.length>0?" "+p:p);continue}if(k=a(w),!k){p=v+(p.length>0?" "+p:p);continue}C=!1}const E=b.length===0?"":b.length===1?b[0]:c(b).join(":"),A=x?E+mm:E,z=A+k;if(d.indexOf(z)>-1)continue;d.push(z);const M=r(k,C);for(let U=0;U<M.length;++U){const R=M[U];d.push(A+R)}p=v+(p.length>0?" "+p:p)}return p},oE=(...e)=>{let t=0,s,a,r="";for(;t<e.length;)(s=e[t++])&&(a=MS(s))&&(r&&(r+=" "),r+=a);return r},MS=e=>{if(typeof e=="string")return e;let t,s="";for(let a=0;a<e.length;a++)e[a]&&(t=MS(e[a]))&&(s&&(s+=" "),s+=t);return s},lE=(e,...t)=>{let s,a,r,c;const d=p=>{const m=t.reduce((v,y)=>y(v),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 v=rE(p,s);return r(p,v),v};return c=d,(...p)=>c(oE(...p))},cE=[],Gt=e=>{const t=s=>s[e]||cE;return t.isThemeGetter=!0,t},US=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,$S=/^\((?:(\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)\(.+\)$/,wi=e=>uE.test(e),Oe=e=>!!e&&!Number.isNaN(Number(e)),Ni=e=>!!e&&Number.isInteger(Number(e)),Oh=e=>e.endsWith("%")&&Oe(e.slice(0,-1)),qs=e=>dE.test(e),PS=()=>!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=>Bi(e,qS,rp),ve=e=>US.test(e),ua=e=>Bi(e,HS,gE),Ub=e=>Bi(e,zE,Oe),SE=e=>Bi(e,FS,PS),jE=e=>Bi(e,ZS,rp),$b=e=>Bi(e,IS,rp),wE=e=>Bi(e,BS,vE),Mc=e=>Bi(e,GS,yE),be=e=>$S.test(e),$o=e=>_a(e,HS),NE=e=>_a(e,ZS),Pb=e=>_a(e,IS),CE=e=>_a(e,qS),kE=e=>_a(e,BS),Uc=e=>_a(e,GS,!0),_E=e=>_a(e,FS,!0),Bi=(e,t,s)=>{const a=US.exec(e);return a?a[1]?t(a[1]):s(a[2]):!1},_a=(e,t,s=!1)=>{const a=$S.exec(e);return a?a[1]?t(a[1]):s:!1},IS=e=>e==="position"||e==="percentage",BS=e=>e==="image"||e==="url",qS=e=>e==="length"||e==="size"||e==="bg-size",HS=e=>e==="length",zE=e=>e==="number",ZS=e=>e==="family-name",FS=e=>e==="number"||e==="weight",GS=e=>e==="shadow",EE=()=>{const e=Gt("color"),t=Gt("font"),s=Gt("text"),a=Gt("font-weight"),r=Gt("tracking"),c=Gt("leading"),d=Gt("breakpoint"),f=Gt("container"),p=Gt("spacing"),m=Gt("radius"),v=Gt("shadow"),y=Gt("inset-shadow"),b=Gt("text-shadow"),x=Gt("drop-shadow"),w=Gt("blur"),S=Gt("perspective"),C=Gt("aspect"),k=Gt("ease"),E=Gt("animate"),A=()=>["auto","avoid","all","avoid-page","page","left","right","column"],z=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],M=()=>[...z(),be,ve],U=()=>["auto","hidden","clip","visible","scroll"],R=()=>["auto","contain","none"],T=()=>[be,ve,p],q=()=>[wi,"full","auto",...T()],W=()=>[Ni,"none","subgrid",be,ve],Q=()=>["auto",{span:["full",Ni,be,ve]},Ni,be,ve],ne=()=>[Ni,"auto",be,ve],me=()=>["auto","min","max","fr",be,ve],ke=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],je=()=>["start","end","center","stretch","center-safe","end-safe"],B=()=>["auto",...T()],O=()=>[wi,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...T()],ae=()=>[wi,"screen","full","dvw","lvw","svw","min","max","fit",...T()],pe=()=>[wi,"screen","full","lh","dvh","lvh","svh","min","max","fit",...T()],te=()=>[e,be,ve],D=()=>[...z(),Pb,$b,{position:[be,ve]}],G=()=>["no-repeat",{repeat:["","x","y","space","round"]}],se=()=>["auto","cover","contain",CE,xE,{size:[be,ve]}],oe=()=>[Oh,$o,ua],ce=()=>["","none","full",m,be,ve],he=()=>["",Oe,$o,ua],de=()=>["solid","dashed","dotted","double"],Fe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ge=()=>[Oe,Oh,Pb,$b],Je=()=>["","none",w,be,ve],mt=()=>["none",Oe,be,ve],fe=()=>["none",Oe,be,ve],Xe=()=>[Oe,be,ve],ct=()=>[wi,"full",...T()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[qs],breakpoint:[qs],color:[PS],container:[qs],"drop-shadow":[qs],ease:["in","out","in-out"],font:[bE],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[qs],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[qs],shadow:[qs],spacing:["px",Oe],text:[qs],"text-shadow":[qs],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",wi,ve,be,C]}],container:["container"],columns:[{columns:[Oe,ve,be,f]}],"break-after":[{"break-after":A()}],"break-before":[{"break-before":A()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:M()}],overflow:[{overflow:U()}],"overflow-x":[{"overflow-x":U()}],"overflow-y":[{"overflow-y":U()}],overscroll:[{overscroll:R()}],"overscroll-x":[{"overscroll-x":R()}],"overscroll-y":[{"overscroll-y":R()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:q()}],"inset-x":[{"inset-x":q()}],"inset-y":[{"inset-y":q()}],start:[{"inset-s":q(),start:q()}],end:[{"inset-e":q(),end:q()}],"inset-bs":[{"inset-bs":q()}],"inset-be":[{"inset-be":q()}],top:[{top:q()}],right:[{right:q()}],bottom:[{bottom:q()}],left:[{left:q()}],visibility:["visible","invisible","collapse"],z:[{z:[Ni,"auto",be,ve]}],basis:[{basis:[wi,"full","auto",f,...T()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Oe,wi,"auto","initial","none",ve]}],grow:[{grow:["",Oe,be,ve]}],shrink:[{shrink:["",Oe,be,ve]}],order:[{order:[Ni,"first","last","none",be,ve]}],"grid-cols":[{"grid-cols":W()}],"col-start-end":[{col:Q()}],"col-start":[{"col-start":ne()}],"col-end":[{"col-end":ne()}],"grid-rows":[{"grid-rows":W()}],"row-start-end":[{row:Q()}],"row-start":[{"row-start":ne()}],"row-end":[{"row-end":ne()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":me()}],"auto-rows":[{"auto-rows":me()}],gap:[{gap:T()}],"gap-x":[{"gap-x":T()}],"gap-y":[{"gap-y":T()}],"justify-content":[{justify:[...ke(),"normal"]}],"justify-items":[{"justify-items":[...je(),"normal"]}],"justify-self":[{"justify-self":["auto",...je()]}],"align-content":[{content:["normal",...ke()]}],"align-items":[{items:[...je(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...je(),{baseline:["","last"]}]}],"place-content":[{"place-content":ke()}],"place-items":[{"place-items":[...je(),"baseline"]}],"place-self":[{"place-self":["auto",...je()]}],p:[{p:T()}],px:[{px:T()}],py:[{py:T()}],ps:[{ps:T()}],pe:[{pe:T()}],pbs:[{pbs:T()}],pbe:[{pbe:T()}],pt:[{pt:T()}],pr:[{pr:T()}],pb:[{pb:T()}],pl:[{pl:T()}],m:[{m: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":T()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":T()}],"space-y-reverse":["space-y-reverse"],size:[{size:O()}],"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",...O()]}],"min-w":[{"min-w":[f,"screen","none",...O()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[d]},...O()]}],h:[{h:["screen","lh",...O()]}],"min-h":[{"min-h":["screen","lh","none",...O()]}],"max-h":[{"max-h":["screen","lh",...O()]}],"font-size":[{text:["base",s,$o,ua]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,_E,SE]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Oh,ve]}],"font-family":[{font:[NE,jE,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":[Oe,"none",be,Ub]}],leading:[{leading:[c,...T()]}],"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:[Oe,"from-font","auto",be,ua]}],"text-decoration-color":[{decoration:te()}],"underline-offset":[{"underline-offset":[Oe,"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:T()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",be,ve]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",be,ve]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:D()}],"bg-repeat":[{bg:G()}],"bg-size":[{bg:se()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ni,be,ve],radial:["",be,ve],conic:[Ni,be,ve]},kE,wE]}],"bg-color":[{bg:te()}],"gradient-from-pos":[{from:oe()}],"gradient-via-pos":[{via:oe()}],"gradient-to-pos":[{to:oe()}],"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":[Oe,be,ve]}],"outline-w":[{outline:["",Oe,$o,ua]}],"outline-color":[{outline:te()}],shadow:[{shadow:["","none",v,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":[Oe,ua]}],"ring-offset-color":[{"ring-offset":te()}],"inset-ring-w":[{"inset-ring":he()}],"inset-ring-color":[{"inset-ring":te()}],"text-shadow":[{"text-shadow":["none",b,Uc,Mc]}],"text-shadow-color":[{"text-shadow":te()}],opacity:[{opacity:[Oe,be,ve]}],"mix-blend":[{"mix-blend":[...Fe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Fe()}],"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":[Oe]}],"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":[Oe]}],"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:D()}],"mask-repeat":[{mask:G()}],"mask-size":[{mask:se()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",be,ve]}],filter:[{filter:["","none",be,ve]}],blur:[{blur:Je()}],brightness:[{brightness:[Oe,be,ve]}],contrast:[{contrast:[Oe,be,ve]}],"drop-shadow":[{"drop-shadow":["","none",x,Uc,Mc]}],"drop-shadow-color":[{"drop-shadow":te()}],grayscale:[{grayscale:["",Oe,be,ve]}],"hue-rotate":[{"hue-rotate":[Oe,be,ve]}],invert:[{invert:["",Oe,be,ve]}],saturate:[{saturate:[Oe,be,ve]}],sepia:[{sepia:["",Oe,be,ve]}],"backdrop-filter":[{"backdrop-filter":["","none",be,ve]}],"backdrop-blur":[{"backdrop-blur":Je()}],"backdrop-brightness":[{"backdrop-brightness":[Oe,be,ve]}],"backdrop-contrast":[{"backdrop-contrast":[Oe,be,ve]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Oe,be,ve]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Oe,be,ve]}],"backdrop-invert":[{"backdrop-invert":["",Oe,be,ve]}],"backdrop-opacity":[{"backdrop-opacity":[Oe,be,ve]}],"backdrop-saturate":[{"backdrop-saturate":[Oe,be,ve]}],"backdrop-sepia":[{"backdrop-sepia":["",Oe,be,ve]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":T()}],"border-spacing-x":[{"border-spacing-x":T()}],"border-spacing-y":[{"border-spacing-y":T()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",be,ve]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Oe,"initial",be,ve]}],ease:[{ease:["linear","initial",k,be,ve]}],delay:[{delay:[Oe,be,ve]}],animate:[{animate:["none",E,be,ve]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,be,ve]}],"perspective-origin":[{"perspective-origin":M()}],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:Xe()}],"skew-x":[{"skew-x":Xe()}],"skew-y":[{"skew-y":Xe()}],transform:[{transform:[be,ve,"","none","gpu","cpu"]}],"transform-origin":[{origin:M()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ct()}],"translate-x":[{"translate-x":ct()}],"translate-y":[{"translate-y":ct()}],"translate-z":[{"translate-z":ct()}],"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":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mbs":[{"scroll-mbs":T()}],"scroll-mbe":[{"scroll-mbe":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pbs":[{"scroll-pbs":T()}],"scroll-pbe":[{"scroll-pbe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",be,ve]}],fill:[{fill:["none",...te()]}],"stroke-w":[{stroke:[Oe,$o,ua,Ub]}],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"]}},AE=lE(EE);function Vn(...e){return AE(RS(e))}const RE=TS("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:Vn(RE({variant:t,size:s,className:e})),...r})});le.displayName="Button";const TE=TS("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 KS({className:e,variant:t,...s}){return l.jsx("div",{className:Vn(TE({variant:t}),e),...s})}function Ib({compact:e=!1}){return l.jsxs(yt,{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 VS(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 OE(e){switch(e){case"cited":return"positive";case"emerging":return"caution";case"not-cited":return"caution";case"lost":return"negative";case"pending":return"neutral";default:return"neutral"}}function DE(e){return e==="High"?"negative":e==="Moderate"?"caution":"neutral"}function tt({tone:e,children:t}){const s=e==="positive"?"success":e==="caution"?"warning":e==="negative"?"destructive":"neutral";return l.jsx(KS,{variant:s,children:t})}function $u({status:e}){return l.jsx(tt,{tone:VS(e),children:Uu(e)})}function Li(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:b,children:x,...w}=y,S=b?.[e]?.[p]||f,C=N.useMemo(()=>w,Object.values(w));return l.jsx(S.Provider,{value:C,children:x})};m.displayName=c+"Provider";function v(y,b){const x=b?.[e]?.[p]||f,w=N.useContext(x);if(w)return w;if(d!==void 0)return d;throw new Error(`\`${y}\` must be used within \`${c}\``)}return[m,v]}const r=()=>{const c=s.map(d=>N.createContext(d));return function(f){const p=f?.[e]||c;return N.useMemo(()=>({[`__scope${e}`]:{...f,[e]:p}}),[f,p])}};return r.scopeName=e,[a,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:()=>{},$E=Um[" useId ".trim().toString()]||(()=>{}),PE=0;function Dh(e){const[t,s]=N.useState($E());return el(()=>{s(a=>a??String(PE++))},[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 v=N.useRef(e!==void 0);N.useEffect(()=>{const y=v.current;y!==f&&console.warn(`${a} is changing from ${y?"controlled":"uncontrolled"} to ${f?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),v.current=f},[f,a])}const m=N.useCallback(v=>{if(f){const y=HE(v)?v(e):v;y!==e&&d.current?.(y)}else c(v)},[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 QS(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,v=f.map(y=>y===p?N.Children.count(m)>1?N.Children.only(null):N.isValidElement(m)?m.props.children:null:y);return l.jsx(t,{...d,ref:r,children:N.isValidElement(m)?N.cloneElement(m,void 0,v):null})}return l.jsx(t,{...d,ref:r,children:c})});return s.displayName=`${e}.Slot`,s}function 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"],Gs=QE.reduce((e,t)=>{const s=QS(`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",pm="dismissableLayer.update",WE="dismissableLayer.pointerDownOutside",eA="dismissableLayer.focusOutside",Bb,YS=N.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),JS=N.forwardRef((e,t)=>{const{disableOutsidePointerEvents:s=!1,onEscapeKeyDown:a,onPointerDownOutside:r,onFocusOutside:c,onInteractOutside:d,onDismiss:f,...p}=e,m=N.useContext(YS),[v,y]=N.useState(null),b=v?.ownerDocument??globalThis?.document,[,x]=N.useState({}),w=ka(t,R=>y(R)),S=Array.from(m.layers),[C]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),k=S.indexOf(C),E=v?S.indexOf(v):-1,A=m.layersWithOutsidePointerEventsDisabled.size>0,z=E>=k,M=sA(R=>{const T=R.target,q=[...m.branches].some(W=>W.contains(T));!z||q||(r?.(R),d?.(R),R.defaultPrevented||f?.())},b),U=iA(R=>{const T=R.target;[...m.branches].some(W=>W.contains(T))||(c?.(R),d?.(R),R.defaultPrevented||f?.())},b);return JE(R=>{E===m.layers.size-1&&(a?.(R),!R.defaultPrevented&&f&&(R.preventDefault(),f()))},b),N.useEffect(()=>{if(v)return s&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(Bb=b.body.style.pointerEvents,b.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(v)),m.layers.add(v),qb(),()=>{s&&m.layersWithOutsidePointerEventsDisabled.size===1&&(b.body.style.pointerEvents=Bb)}},[v,b,s,m]),N.useEffect(()=>()=>{v&&(m.layers.delete(v),m.layersWithOutsidePointerEventsDisabled.delete(v),qb())},[v,m]),N.useEffect(()=>{const R=()=>x({});return document.addEventListener(pm,R),()=>document.removeEventListener(pm,R)},[]),l.jsx(Gs.div,{...p,ref:w,style:{pointerEvents:A?z?"auto":"none":void 0,...e.style},onFocusCapture:Li(e.onFocusCapture,U.onFocusCapture),onBlurCapture:Li(e.onBlurCapture,U.onBlurCapture),onPointerDownCapture:Li(e.onPointerDownCapture,M.onPointerDownCapture)})});JS.displayName=XE;var tA="DismissableLayerBranch",nA=N.forwardRef((e,t)=>{const s=N.useContext(YS),a=N.useRef(null),r=ka(t,a);return N.useEffect(()=>{const c=a.current;if(c)return s.branches.add(c),()=>{s.branches.delete(c)}},[s.branches]),l.jsx(Gs.div,{...e,ref:r})});nA.displayName=tA;function sA(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(){XS(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 iA(e,t=globalThis?.document){const s=tl(e),a=N.useRef(!1);return N.useEffect(()=>{const r=c=>{c.target&&!a.current&&XS(eA,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 qb(){const e=new CustomEvent(pm);document.dispatchEvent(e)}function XS(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 Lh="focusScope.autoFocusOnMount",Mh="focusScope.autoFocusOnUnmount",Hb={bubbles:!1,cancelable:!0},aA="FocusScope",WS=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),v=tl(c),y=N.useRef(null),b=ka(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(A){if(x.paused||!f)return;const z=A.target;f.contains(z)?y.current=z:Ci(y.current,{select:!0})},C=function(A){if(x.paused||!f)return;const z=A.relatedTarget;z!==null&&(f.contains(z)||Ci(y.current,{select:!0}))},k=function(A){if(document.activeElement===document.body)for(const M of A)M.removedNodes.length>0&&Ci(f)};document.addEventListener("focusin",S),document.addEventListener("focusout",C);const E=new MutationObserver(k);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){Fb.add(x);const S=document.activeElement;if(!f.contains(S)){const k=new CustomEvent(Lh,Hb);f.addEventListener(Lh,m),f.dispatchEvent(k),k.defaultPrevented||(rA(dA(ej(f)),{select:!0}),document.activeElement===S&&Ci(f))}return()=>{f.removeEventListener(Lh,m),setTimeout(()=>{const k=new CustomEvent(Mh,Hb);f.addEventListener(Mh,v),f.dispatchEvent(k),k.defaultPrevented||Ci(S??document.body,{select:!0}),f.removeEventListener(Mh,v),Fb.remove(x)},0)}}},[f,m,v,x]);const w=N.useCallback(S=>{if(!s&&!a||x.paused)return;const C=S.key==="Tab"&&!S.altKey&&!S.ctrlKey&&!S.metaKey,k=document.activeElement;if(C&&k){const E=S.currentTarget,[A,z]=oA(E);A&&z?!S.shiftKey&&k===z?(S.preventDefault(),s&&Ci(A,{select:!0})):S.shiftKey&&k===A&&(S.preventDefault(),s&&Ci(z,{select:!0})):k===E&&S.preventDefault()}},[s,a,x.paused]);return l.jsx(Gs.div,{tabIndex:-1,...d,ref:b,onKeyDown:w})});WS.displayName=aA;function rA(e,{select:t=!1}={}){const s=document.activeElement;for(const a of e)if(Ci(a,{select:t}),document.activeElement!==s)return}function oA(e){const t=ej(e),s=Zb(t,e),a=Zb(t.reverse(),e);return[s,a]}function ej(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 Zb(e,t){for(const s of e)if(!lA(s,{upTo:t}))return s}function lA(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 cA(e){return e instanceof HTMLInputElement&&"select"in e}function Ci(e,{select:t=!1}={}){if(e&&e.focus){const s=document.activeElement;e.focus({preventScroll:!0}),e!==s&&cA(e)&&t&&e.select()}}var Fb=uA();function uA(){let e=[];return{add(t){const s=e[0];t!==s&&s?.pause(),e=Gb(e,t),e.unshift(t)},remove(t){e=Gb(e,t),e[0]?.resume()}}}function Gb(e,t){const s=[...e],a=s.indexOf(t);return a!==-1&&s.splice(a,1),s}function dA(e){return e.filter(t=>t.tagName!=="A")}var fA="Portal",tj=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?wz.createPortal(l.jsx(Gs.div,{...a,ref:t}),d):null});tj.displayName=fA;function hA(e,t){return N.useReducer((s,a)=>t[s][a]??s,e)}var Pu=e=>{const{present:t,children:s}=e,a=mA(t),r=typeof s=="function"?s({present:a.isPresent}):N.Children.only(s),c=ka(a.ref,pA(r));return typeof s=="function"||a.isPresent?N.cloneElement(r,{ref:c}):null};Pu.displayName="Presence";function mA(e){const[t,s]=N.useState(),a=N.useRef(null),r=N.useRef(e),c=N.useRef("none"),d=e?"mounted":"unmounted",[f,p]=hA(d,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return N.useEffect(()=>{const m=$c(a.current);c.current=f==="mounted"?m:"none"},[f]),el(()=>{const m=a.current,v=r.current;if(v!==e){const b=c.current,x=$c(m);e?p("MOUNT"):x==="none"||m?.display==="none"?p("UNMOUNT"):p(v&&b!==x?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,p]),el(()=>{if(t){let m;const v=t.ownerDocument.defaultView??window,y=x=>{const S=$c(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=v.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=C)})}},b=x=>{x.target===t&&(c.current=$c(a.current))};return t.addEventListener("animationstart",b),t.addEventListener("animationcancel",y),t.addEventListener("animationend",y),()=>{v.clearTimeout(m),t.removeEventListener("animationstart",b),t.removeEventListener("animationcancel",y),t.removeEventListener("animationend",y)}}else p("ANIMATION_END")},[t,p]),{isPresent:["mounted","unmountSuspended"].includes(f),ref:N.useCallback(m=>{a.current=m?getComputedStyle(m):null,s(m)},[])}}function $c(e){return e?.animationName||"none"}function pA(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 Uh=0;function gA(){N.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Kb()),document.body.insertAdjacentElement("beforeend",e[1]??Kb()),Uh++,()=>{Uh===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Uh--}},[])}function Kb(){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 bs=function(){return bs=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},bs.apply(this,arguments)};function nj(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 yA(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",vA="with-scroll-bars-hidden",bA="--removed-body-scroll-bar-size";function $h(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function xA(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 SA=typeof window<"u"?N.useLayoutEffect:N.useEffect,Vb=new WeakMap;function jA(e,t){var s=xA(null,function(a){return e.forEach(function(r){return $h(r,a)})});return SA(function(){var a=Vb.get(s);if(a){var r=new Set(a),c=new Set(e),d=s.current;r.forEach(function(f){c.has(f)||$h(f,null)}),c.forEach(function(f){r.has(f)||$h(f,d)})}Vb.set(s,e)},[e]),s}function wA(e){return e}function NA(e,t){t===void 0&&(t=wA);var s=[],a=!1,r={read:function(){if(a)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return s.length?s[s.length-1]:e},useMedium:function(c){var d=t(c,a);return s.push(d),function(){s=s.filter(function(f){return f!==d})}},assignSyncMedium:function(c){for(a=!0;s.length;){var d=s;s=[],d.forEach(c)}s={push:function(f){return c(f)},filter:function(){return s}}},assignMedium:function(c){a=!0;var d=[];if(s.length){var f=s;s=[],f.forEach(c),d=s}var p=function(){var v=d;d=[],v.forEach(c)},m=function(){return Promise.resolve().then(p)};m(),s={push:function(v){d.push(v),m()},filter:function(v){return d=d.filter(v),s}}}};return r}function CA(e){e===void 0&&(e={});var t=NA(null);return t.options=bs({async:!0,ssr:!1},e),t}var sj=function(e){var t=e.sideCar,s=nj(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,bs({},s))};sj.isSideCarExport=!0;function kA(e,t){return e.useMedium(t),sj}var ij=CA(),Ph=function(){},Iu=N.forwardRef(function(e,t){var s=N.useRef(null),a=N.useState({onScrollCapture:Ph,onWheelCapture:Ph,onTouchMoveCapture:Ph}),r=a[0],c=a[1],d=e.forwardProps,f=e.children,p=e.className,m=e.removeScrollBar,v=e.enabled,y=e.shards,b=e.sideCar,x=e.noRelative,w=e.noIsolation,S=e.inert,C=e.allowPinchZoom,k=e.as,E=k===void 0?"div":k,A=e.gapMode,z=nj(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),M=b,U=jA([s,t]),R=bs(bs({},z),r);return N.createElement(N.Fragment,null,v&&N.createElement(M,{sideCar:ij,removeScrollBar:m,shards:y,noRelative:x,noIsolation:w,inert:S,setCallbacks:c,allowPinchZoom:!!C,lockRef:s,gapMode:A}),d?N.cloneElement(N.Children.only(f),bs(bs({},R),{ref:U})):N.createElement(E,bs({},R,{className:p,ref:U}),f))});Iu.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Iu.classNames={fullWidth:su,zeroRight:nu};var _A=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function zA(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=_A();return t&&e.setAttribute("nonce",t),e}function EA(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function AA(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var RA=function(){var e=0,t=null;return{add:function(s){e==0&&(t=zA())&&(EA(t,s),AA(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},TA=function(){var e=RA();return function(t,s){N.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&s])}},aj=function(){var e=TA(),t=function(s){var a=s.styles,r=s.dynamic;return e(a,r),null};return t},OA={left:0,top:0,right:0,gap:0},Ih=function(e){return parseInt(e||"",10)||0},DA=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[Ih(s),Ih(a),Ih(r)]},LA=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return OA;var t=DA(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])}},MA=aj(),kr="data-scroll-locked",UA=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(vA,` {
14
- overflow: hidden `).concat(a,`;
15
- padding-right: `).concat(f,"px ").concat(a,`;
16
- }
17
- body[`).concat(kr,`] {
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(kr,`] {
47
- `).concat(bA,": ").concat(f,`px;
48
- }
49
- `)},Qb=function(){var e=parseInt(document.body.getAttribute(kr)||"0",10);return isFinite(e)?e:0},$A=function(){N.useEffect(function(){return document.body.setAttribute(kr,(Qb()+1).toString()),function(){var e=Qb()-1;e<=0?document.body.removeAttribute(kr):document.body.setAttribute(kr,e.toString())}},[])},PA=function(e){var t=e.noRelative,s=e.noImportant,a=e.gapMode,r=a===void 0?"margin":a;$A();var c=N.useMemo(function(){return LA(r)},[r]);return N.createElement(MA,{styles:UA(c,!t,r,s?"":"!important")})},gm=!1;if(typeof window<"u")try{var Pc=Object.defineProperty({},"passive",{get:function(){return gm=!0,!0}});window.addEventListener("test",Pc,Pc),window.removeEventListener("test",Pc,Pc)}catch{gm=!1}var pr=gm?{passive:!1}:!1,IA=function(e){return e.tagName==="TEXTAREA"},rj=function(e,t){if(!(e instanceof Element))return!1;var s=window.getComputedStyle(e);return s[t]!=="hidden"&&!(s.overflowY===s.overflowX&&!IA(e)&&s[t]==="visible")},BA=function(e){return rj(e,"overflowY")},qA=function(e){return rj(e,"overflowX")},Yb=function(e,t){var s=t.ownerDocument,a=t;do{typeof ShadowRoot<"u"&&a instanceof ShadowRoot&&(a=a.host);var r=oj(e,a);if(r){var c=lj(e,a),d=c[1],f=c[2];if(d>f)return!0}a=a.parentNode}while(a&&a!==s.body);return!1},HA=function(e){var t=e.scrollTop,s=e.scrollHeight,a=e.clientHeight;return[t,s,a]},ZA=function(e){var t=e.scrollLeft,s=e.scrollWidth,a=e.clientWidth;return[t,s,a]},oj=function(e,t){return e==="v"?BA(t):qA(t)},lj=function(e,t){return e==="v"?HA(t):ZA(t)},FA=function(e,t){return e==="h"&&t==="rtl"?-1:1},GA=function(e,t,s,a,r){var c=FA(e,window.getComputedStyle(t).direction),d=c*a,f=s.target,p=t.contains(f),m=!1,v=d>0,y=0,b=0;do{if(!f)break;var x=lj(e,f),w=x[0],S=x[1],C=x[2],k=S-C-c*w;(w||k)&&oj(e,f)&&(y+=k,b+=w);var E=f.parentNode;f=E&&E.nodeType===Node.DOCUMENT_FRAGMENT_NODE?E.host:E}while(!p&&f!==document.body||p&&(t.contains(f)||t===f));return(v&&Math.abs(y)<1||!v&&Math.abs(b)<1)&&(m=!0),m},Ic=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Jb=function(e){return[e.deltaX,e.deltaY]},Xb=function(e){return e&&"current"in e?e.current:e},KA=function(e,t){return e[0]===t[0]&&e[1]===t[1]},VA=function(e){return`
50
- .block-interactivity-`.concat(e,` {pointer-events: none;}
51
- .allow-interactivity-`).concat(e,` {pointer-events: all;}
52
- `)},QA=0,gr=[];function YA(e){var t=N.useRef([]),s=N.useRef([0,0]),a=N.useRef(),r=N.useState(QA++)[0],c=N.useState(aj)[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=yA([e.lockRef.current],(e.shards||[]).map(Xb),!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 k=Ic(S),E=s.current,A="deltaX"in S?S.deltaX:E[0]-k[0],z="deltaY"in S?S.deltaY:E[1]-k[1],M,U=S.target,R=Math.abs(A)>Math.abs(z)?"h":"v";if("touches"in S&&R==="h"&&U.type==="range")return!1;var T=window.getSelection(),q=T&&T.anchorNode,W=q?q===U||q.contains(U):!1;if(W)return!1;var Q=Yb(R,U);if(!Q)return!0;if(Q?M=R:(M=R==="v"?"h":"v",Q=Yb(R,U)),!Q)return!1;if(!a.current&&"changedTouches"in S&&(A||z)&&(a.current=M),!M)return!0;var ne=a.current||M;return GA(ne,C,S,ne==="h"?A:z)},[]),p=N.useCallback(function(S){var C=S;if(!(!gr.length||gr[gr.length-1]!==c)){var k="deltaY"in C?Jb(C):Ic(C),E=t.current.filter(function(M){return M.name===C.type&&(M.target===C.target||C.target===M.shadowParent)&&KA(M.delta,k)})[0];if(E&&E.should){C.cancelable&&C.preventDefault();return}if(!E){var A=(d.current.shards||[]).map(Xb).filter(Boolean).filter(function(M){return M.contains(C.target)}),z=A.length>0?f(C,A[0]):!d.current.noIsolation;z&&C.cancelable&&C.preventDefault()}}},[]),m=N.useCallback(function(S,C,k,E){var A={name:S,delta:C,target:k,should:E,shadowParent:JA(k)};t.current.push(A),setTimeout(function(){t.current=t.current.filter(function(z){return z!==A})},1)},[]),v=N.useCallback(function(S){s.current=Ic(S),a.current=void 0},[]),y=N.useCallback(function(S){m(S.type,Jb(S),S.target,f(S,e.lockRef.current))},[]),b=N.useCallback(function(S){m(S.type,Ic(S),S.target,f(S,e.lockRef.current))},[]);N.useEffect(function(){return gr.push(c),e.setCallbacks({onScrollCapture:y,onWheelCapture:y,onTouchMoveCapture:b}),document.addEventListener("wheel",p,pr),document.addEventListener("touchmove",p,pr),document.addEventListener("touchstart",v,pr),function(){gr=gr.filter(function(S){return S!==c}),document.removeEventListener("wheel",p,pr),document.removeEventListener("touchmove",p,pr),document.removeEventListener("touchstart",v,pr)}},[]);var x=e.removeScrollBar,w=e.inert;return N.createElement(N.Fragment,null,w?N.createElement(c,{styles:VA(r)}):null,x?N.createElement(PA,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function JA(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const XA=kA(ij,YA);var cj=N.forwardRef(function(e,t){return N.createElement(Iu,bs({},e,{ref:t,sideCar:XA}))});cj.classNames=Iu.classNames;var WA=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},yr=new WeakMap,Bc=new WeakMap,qc={},Bh=0,uj=function(e){return e&&(e.host||uj(e.parentNode))},eR=function(e,t){return t.map(function(s){if(e.contains(s))return s;var a=uj(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})},tR=function(e,t,s,a){var r=eR(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 v=function(y){!y||p.has(y)||Array.prototype.forEach.call(y.children,function(b){if(f.has(b))v(b);else try{var x=b.getAttribute(a),w=x!==null&&x!=="false",S=(yr.get(b)||0)+1,C=(c.get(b)||0)+1;yr.set(b,S),c.set(b,C),d.push(b),S===1&&w&&Bc.set(b,!0),C===1&&b.setAttribute(s,"true"),w||b.setAttribute(a,"true")}catch(k){console.error("aria-hidden: cannot operate on ",b,k)}})};return v(t),f.clear(),Bh++,function(){d.forEach(function(y){var b=yr.get(y)-1,x=c.get(y)-1;yr.set(y,b),c.set(y,x),b||(Bc.has(y)||y.removeAttribute(a),Bc.delete(y)),x||y.removeAttribute(s)}),Bh--,Bh||(yr=new WeakMap,yr=new WeakMap,Bc=new WeakMap,qc={})}},nR=function(e,t,s){s===void 0&&(s="data-aria-hidden");var a=Array.from(Array.isArray(e)?e:[e]),r=WA(e);return r?(a.push.apply(a,Array.from(r.querySelectorAll("[aria-live], script"))),tR(a,r,s,"aria-hidden")):function(){return null}},Bu="Dialog",[dj]=ME(Bu),[sR,rs]=dj(Bu),fj=e=>{const{__scopeDialog:t,children:s,open:a,defaultOpen:r,onOpenChange:c,modal:d=!0}=e,f=N.useRef(null),p=N.useRef(null),[m,v]=BE({prop:a,defaultProp:r??!1,onChange:c,caller:Bu});return l.jsx(sR,{scope:t,triggerRef:f,contentRef:p,contentId:Dh(),titleId:Dh(),descriptionId:Dh(),open:m,onOpenChange:v,onOpenToggle:N.useCallback(()=>v(y=>!y),[v]),modal:d,children:s})};fj.displayName=Bu;var hj="DialogTrigger",iR=N.forwardRef((e,t)=>{const{__scopeDialog:s,...a}=e,r=rs(hj,s),c=ka(t,r.triggerRef);return l.jsx(Gs.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":cp(r.open),...a,ref:c,onClick:Li(e.onClick,r.onOpenToggle)})});iR.displayName=hj;var op="DialogPortal",[aR,mj]=dj(op,{forceMount:void 0}),pj=e=>{const{__scopeDialog:t,forceMount:s,children:a,container:r}=e,c=rs(op,t);return l.jsx(aR,{scope:t,forceMount:s,children:N.Children.map(a,d=>l.jsx(Pu,{present:s||c.open,children:l.jsx(tj,{asChild:!0,container:r,children:d})}))})};pj.displayName=op;var Su="DialogOverlay",gj=N.forwardRef((e,t)=>{const s=mj(Su,e.__scopeDialog),{forceMount:a=s.forceMount,...r}=e,c=rs(Su,e.__scopeDialog);return c.modal?l.jsx(Pu,{present:a||c.open,children:l.jsx(oR,{...r,ref:t})}):null});gj.displayName=Su;var rR=QS("DialogOverlay.RemoveScroll"),oR=N.forwardRef((e,t)=>{const{__scopeDialog:s,...a}=e,r=rs(Su,s);return l.jsx(cj,{as:rR,allowPinchZoom:!0,shards:[r.contentRef],children:l.jsx(Gs.div,{"data-state":cp(r.open),...a,ref:t,style:{pointerEvents:"auto",...a.style}})})}),wa="DialogContent",yj=N.forwardRef((e,t)=>{const s=mj(wa,e.__scopeDialog),{forceMount:a=s.forceMount,...r}=e,c=rs(wa,e.__scopeDialog);return l.jsx(Pu,{present:a||c.open,children:c.modal?l.jsx(lR,{...r,ref:t}):l.jsx(cR,{...r,ref:t})})});yj.displayName=wa;var lR=N.forwardRef((e,t)=>{const s=rs(wa,e.__scopeDialog),a=N.useRef(null),r=ka(t,s.contentRef,a);return N.useEffect(()=>{const c=a.current;if(c)return nR(c)},[]),l.jsx(vj,{...e,ref:r,trapFocus:s.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Li(e.onCloseAutoFocus,c=>{c.preventDefault(),s.triggerRef.current?.focus()}),onPointerDownOutside:Li(e.onPointerDownOutside,c=>{const d=c.detail.originalEvent,f=d.button===0&&d.ctrlKey===!0;(d.button===2||f)&&c.preventDefault()}),onFocusOutside:Li(e.onFocusOutside,c=>c.preventDefault())})}),cR=N.forwardRef((e,t)=>{const s=rs(wa,e.__scopeDialog),a=N.useRef(!1),r=N.useRef(!1);return l.jsx(vj,{...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()}})}),vj=N.forwardRef((e,t)=>{const{__scopeDialog:s,trapFocus:a,onOpenAutoFocus:r,onCloseAutoFocus:c,...d}=e,f=rs(wa,s),p=N.useRef(null),m=ka(t,p);return gA(),l.jsxs(l.Fragment,{children:[l.jsx(WS,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:r,onUnmountAutoFocus:c,children:l.jsx(JS,{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(uR,{titleId:f.titleId}),l.jsx(fR,{contentRef:p,descriptionId:f.descriptionId})]})]})}),lp="DialogTitle",bj=N.forwardRef((e,t)=>{const{__scopeDialog:s,...a}=e,r=rs(lp,s);return l.jsx(Gs.h2,{id:r.titleId,...a,ref:t})});bj.displayName=lp;var xj="DialogDescription",Sj=N.forwardRef((e,t)=>{const{__scopeDialog:s,...a}=e,r=rs(xj,s);return l.jsx(Gs.p,{id:r.descriptionId,...a,ref:t})});Sj.displayName=xj;var jj="DialogClose",wj=N.forwardRef((e,t)=>{const{__scopeDialog:s,...a}=e,r=rs(jj,s);return l.jsx(Gs.button,{type:"button",...a,ref:t,onClick:Li(e.onClick,()=>r.onOpenChange(!1))})});wj.displayName=jj;function cp(e){return e?"open":"closed"}var Nj="DialogTitleWarning",[S4,Cj]=LE(Nj,{contentName:wa,titleName:lp,docsSlug:"dialog"}),uR=({titleId:e})=>{const t=Cj(Nj),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},dR="DialogDescriptionWarning",fR=({contentRef:e,descriptionId:t})=>{const a=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Cj(dR).contentName}}.`;return N.useEffect(()=>{const r=e.current?.getAttribute("aria-describedby");t&&r&&(document.getElementById(t)||console.warn(a))},[a,e,t]),null},kj=fj,_j=pj,up=gj,dp=yj,fp=bj,zj=Sj,Ej=wj;const hR=kj,mR=_j,Aj=N.forwardRef(({className:e,...t},s)=>l.jsx(up,{ref:s,className:Vn("fixed inset-0 z-50 bg-black/70 backdrop-blur-sm",e),...t}));Aj.displayName=up.displayName;const pR=400,gR=1200,yR=720,Rj=N.forwardRef(({className:e,children:t,...s},a)=>{const[r,c]=N.useState(yR),d=N.useRef(!1),f=N.useRef(0),p=N.useRef(0),m=N.useCallback(b=>{d.current=!0,f.current=b.clientX,p.current=r,b.target.setPointerCapture(b.pointerId),b.preventDefault()},[r]),v=N.useCallback(b=>{if(!d.current)return;const x=f.current-b.clientX,w=Math.min(gR,Math.max(pR,p.current+x));c(w)},[]),y=N.useCallback(()=>{d.current=!1},[]);return l.jsxs(mR,{children:[l.jsx(Aj,{}),l.jsxs(dp,{ref:a,className:Vn("fixed z-50 flex flex-col bg-zinc-950 px-5 py-4 shadow-2xl overflow-hidden","max-md:inset-x-0 max-md:bottom-0 max-md:top-auto max-md:max-h-[88vh] max-md:rounded-t-2xl max-md:border-t","md:inset-y-0 md:right-0 md:h-full md:border-l","border-zinc-800",e),style:{width:`min(${r}px, 100vw)`},...s,children:[l.jsx("div",{className:"absolute inset-y-0 left-0 w-1.5 cursor-col-resize hover:bg-zinc-700/50 active:bg-zinc-600/50 transition-colors max-md:hidden",onPointerDown:m,onPointerMove:v,onPointerUp:y}),t,l.jsxs(Ej,{className:"absolute right-4 top-4 inline-flex size-8 items-center justify-center rounded-md text-zinc-500 transition hover:bg-zinc-900 hover:text-zinc-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-zinc-400",children:[l.jsx(Mu,{className:"size-4"}),l.jsx("span",{className:"sr-only",children:"Close"})]})]})]})});Rj.displayName=dp.displayName;const vR=({className:e,...t})=>l.jsx("div",{className:Vn("flex flex-col gap-1.5 pr-10",e),...t}),Tj=N.forwardRef(({className:e,...t},s)=>l.jsx(fp,{ref:s,className:Vn("text-lg font-medium text-zinc-50",e),...t}));Tj.displayName=fp.displayName;const Oj=N.forwardRef(({className:e,...t},s)=>l.jsx(zj,{ref:s,className:Vn("text-sm text-zinc-500",e),...t}));Oj.displayName=zj.displayName;function bR({title:e,subtitle:t,children:s,open:a,onClose:r}){return l.jsx(hR,{open:a,onOpenChange:c=>c?void 0:r(),children:l.jsxs(Rj,{children:[l.jsxs(vR,{className:"drawer-head",children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:t}),l.jsx(Tj,{id:"drawer-title",children:e}),l.jsx(Oj,{className:"sr-only",children:t})]}),l.jsx("div",{className:"drawer-body",children:s})]})})}function X(e,t,s){function a(f,p){if(f._zod||Object.defineProperty(f,"_zod",{value:{def:p,constr:d,traits:new Set},enumerable:!1}),f._zod.traits.has(e))return;f._zod.traits.add(e),t(f,p);const m=d.prototype,v=Object.keys(m);for(let y=0;y<v.length;y++){const b=v[y];b in f||(f[b]=m[b].bind(f))}}const r=s?.Parent??Object;class c extends r{}Object.defineProperty(c,"name",{value:e});function d(f){var p;const m=s?.Parent?new c:this;a(m,f),(p=m._zod).deferred??(p.deferred=[]);for(const v of m._zod.deferred)v();return m}return Object.defineProperty(d,"init",{value:a}),Object.defineProperty(d,Symbol.hasInstance,{value:f=>s?.Parent&&f instanceof s.Parent?!0:f?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}class _r extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Dj extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const Lj={};function $i(e){return Lj}function Mj(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 ym(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 xR(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 Wb=Symbol("evaluating");function nt(e,t,s){let a;Object.defineProperty(e,t,{get(){if(a!==Wb)return a===void 0&&(a=Wb,a=s()),a},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function za(e,t,s){Object.defineProperty(e,t,{value:s,writable:!0,enumerable:!0,configurable:!0})}function qi(...e){const t={};for(const s of e){const a=Object.getOwnPropertyDescriptors(s);Object.assign(t,a)}return Object.defineProperties({},t)}function ex(e){return JSON.stringify(e)}function SR(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Uj="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ju(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const jR=hp(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Rr(e){if(ju(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const s=t.prototype;return!(ju(s)===!1||Object.prototype.hasOwnProperty.call(s,"isPrototypeOf")===!1)}function $j(e){return Rr(e)?{...e}:Array.isArray(e)?[...e]:e}const wR=new Set(["string","number","symbol"]);function Tr(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Hi(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 NR(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const CR={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 kR(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=qi(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 za(this,"shape",d),d},checks:[]});return Hi(e,c)}function _R(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=qi(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 za(this,"shape",d),d},checks:[]});return Hi(e,c)}function zR(e,t){if(!Rr(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=qi(e._zod.def,{get shape(){const c={...e._zod.def.shape,...t};return za(this,"shape",c),c}});return Hi(e,r)}function ER(e,t){if(!Rr(t))throw new Error("Invalid input to safeExtend: expected a plain object");const s=qi(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return za(this,"shape",a),a}});return Hi(e,s)}function AR(e,t){const s=qi(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t._zod.def.shape};return za(this,"shape",a),a},get catchall(){return t._zod.def.catchall},checks:[]});return Hi(e,s)}function RR(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=qi(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 za(this,"shape",p),p},checks:[]});return Hi(t,d)}function TR(e,t,s){const a=qi(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 za(this,"shape",c),c}});return Hi(t,a)}function Sr(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 jr(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 Pi(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 Pj=(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,ym,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Ij=X("$ZodError",Pj),Bj=X("$ZodError",Pj,{Parent:Error});function OR(e,t=s=>s.message){const s={},a=[];for(const r of e.issues)r.path.length>0?(s[r.path[0]]=s[r.path[0]]||[],s[r.path[0]].push(t(r))):a.push(t(r));return{formErrors:a,fieldErrors:s}}function DR(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=>Pi(p,c,$i())));throw Uj(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=>Pi(p,c,$i())));throw Uj(f,r?.callee),f}return d.value},qu=e=>(t,s,a)=>{const r=a?{...a,async:!1}:{async:!1},c=t._zod.run({value:s,issues:[]},r);if(c instanceof Promise)throw new _r;return c.issues.length?{success:!1,error:new(e??Ij)(c.issues.map(d=>Pi(d,r,$i())))}:{success:!0,data:c.value}},LR=qu(Bj),Hu=e=>async(t,s,a)=>{const r=a?Object.assign(a,{async:!0}):{async:!0};let c=t._zod.run({value:s,issues:[]},r);return c instanceof Promise&&(c=await c),c.issues.length?{success:!1,error:new e(c.issues.map(d=>Pi(d,r,$i())))}:{success:!0,data:c.value}},MR=Hu(Bj),UR=e=>(t,s,a)=>{const r=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return yp(e)(t,s,r)},$R=e=>(t,s,a)=>yp(e)(t,s,a),PR=e=>async(t,s,a)=>{const r=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return vp(e)(t,s,r)},IR=e=>async(t,s,a)=>vp(e)(t,s,a),BR=e=>(t,s,a)=>{const r=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return qu(e)(t,s,r)},qR=e=>(t,s,a)=>qu(e)(t,s,a),HR=e=>async(t,s,a)=>{const r=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Hu(e)(t,s,r)},ZR=e=>async(t,s,a)=>Hu(e)(t,s,a),FR=/^[cC][^\s-]{8,}$/,GR=/^[0-9a-z]+$/,KR=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,VR=/^[0-9a-vA-V]{20}$/,QR=/^[A-Za-z0-9]{27}$/,YR=/^[a-zA-Z0-9_-]{21}$/,JR=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,XR=/^([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})$/,tx=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)$/,WR=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,eT="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function tT(){return new RegExp(eT,"u")}const nT=/^(?:(?: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])$/,sT=/^(([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}|:))$/,iT=/^((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])$/,aT=/^(([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])$/,rT=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,qj=/^[A-Za-z0-9_-]*$/,oT=/^\+[1-9]\d{6,14}$/,Hj="(?:(?:\\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])))",lT=new RegExp(`^${Hj}$`);function Zj(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 cT(e){return new RegExp(`^${Zj(e)}$`)}function uT(e){const t=Zj({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(`^${Hj}T(?:${a})$`)}const dT=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},fT=/^-?\d+$/,Fj=/^-?\d+(?:\.\d+)?$/,hT=/^(?:true|false)$/i,mT=/^[^A-Z]*$/,pT=/^[^a-z]*$/,Nn=X("$ZodCheck",(e,t)=>{var s;e._zod??(e._zod={}),e._zod.def=t,(s=e._zod).onattach??(s.onattach=[])}),Gj={number:"number",bigint:"bigint",object:"date"},Kj=X("$ZodCheckLessThan",(e,t)=>{Nn.init(e,t);const s=Gj[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})}}),Vj=X("$ZodCheckGreaterThan",(e,t)=>{Nn.init(e,t);const s=Gj[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})}}),gT=X("$ZodCheckMultipleOf",(e,t)=>{Nn.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):xR(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})}}),yT=X("$ZodCheckNumberFormat",(e,t)=>{Nn.init(e,t),t.format=t.format||"float64";const s=t.format?.includes("int"),a=s?"int":"number",[r,c]=CR[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=fT)}),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})}}),vT=X("$ZodCheckMaxLength",(e,t)=>{var s;Nn.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})}}),bT=X("$ZodCheckMinLength",(e,t)=>{var s;Nn.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})}}),xT=X("$ZodCheckLengthEquals",(e,t)=>{var s;Nn.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})}}),Zu=X("$ZodCheckStringFormat",(e,t)=>{var s,a;Nn.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=()=>{})}),ST=X("$ZodCheckRegex",(e,t)=>{Zu.init(e,t),e._zod.check=s=>{t.pattern.lastIndex=0,!t.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:"regex",input:s.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),jT=X("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=mT),Zu.init(e,t)}),wT=X("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=pT),Zu.init(e,t)}),NT=X("$ZodCheckIncludes",(e,t)=>{Nn.init(e,t);const s=Tr(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})}}),CT=X("$ZodCheckStartsWith",(e,t)=>{Nn.init(e,t);const s=new RegExp(`^${Tr(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})}}),kT=X("$ZodCheckEndsWith",(e,t)=>{Nn.init(e,t);const s=new RegExp(`.*${Tr(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})}}),_T=X("$ZodCheckOverwrite",(e,t)=>{Nn.init(e,t),e._zod.check=s=>{s.value=t.tx(s.value)}});class zT{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 ET={major:4,minor:3,patch:6},St=X("$ZodType",(e,t)=>{var s;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=ET;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=Sr(d),v;for(const y of f){if(y._zod.def.when){if(!y._zod.def.when(d))continue}else if(m)continue;const b=d.issues.length,x=y._zod.check(d);if(x instanceof Promise&&p?.async===!1)throw new _r;if(v||x instanceof Promise)v=(v??Promise.resolve()).then(async()=>{await x,d.issues.length!==b&&(m||(m=Sr(d,b)))});else{if(d.issues.length===b)continue;m||(m=Sr(d,b))}}return v?v.then(()=>d):d},c=(d,f,p)=>{if(Sr(d))return d.aborted=!0,d;const m=r(f,a,p);if(m instanceof Promise){if(p.async===!1)throw new _r;return m.then(v=>e._zod.parse(v,p))}return e._zod.parse(m,p)};e._zod.run=(d,f)=>{if(f.skipChecks)return e._zod.parse(d,f);if(f.direction==="backward"){const m=e._zod.parse({value:d.value,issues:[]},{...f,skipChecks:!0});return m instanceof Promise?m.then(v=>c(v,d,f)):c(m,d,f)}const p=e._zod.parse(d,f);if(p instanceof Promise){if(f.async===!1)throw new _r;return p.then(m=>r(m,a,f))}return r(p,a,f)}}nt(e,"~standard",()=>({validate:r=>{try{const c=LR(e,r);return c.success?{value:c.data}:{issues:c.error?.issues}}catch{return MR(e,r).then(d=>d.success?{value:d.data}:{issues:d.error?.issues})}},vendor:"zod",version:1}))}),bp=X("$ZodString",(e,t)=>{St.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??dT(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}}),bt=X("$ZodStringFormat",(e,t)=>{Zu.init(e,t),bp.init(e,t)}),AT=X("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=XR),bt.init(e,t)}),RT=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=tx(a))}else t.pattern??(t.pattern=tx());bt.init(e,t)}),TT=X("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=WR),bt.init(e,t)}),OT=X("$ZodURL",(e,t)=>{bt.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})}}}),DT=X("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=tT()),bt.init(e,t)}),LT=X("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=YR),bt.init(e,t)}),MT=X("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=FR),bt.init(e,t)}),UT=X("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=GR),bt.init(e,t)}),$T=X("$ZodULID",(e,t)=>{t.pattern??(t.pattern=KR),bt.init(e,t)}),PT=X("$ZodXID",(e,t)=>{t.pattern??(t.pattern=VR),bt.init(e,t)}),IT=X("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=QR),bt.init(e,t)}),BT=X("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=uT(t)),bt.init(e,t)}),qT=X("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=lT),bt.init(e,t)}),HT=X("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=cT(t)),bt.init(e,t)}),ZT=X("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=JR),bt.init(e,t)}),FT=X("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=nT),bt.init(e,t),e._zod.bag.format="ipv4"}),GT=X("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=sT),bt.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})}}}),KT=X("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=iT),bt.init(e,t)}),VT=X("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=aT),bt.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 Qj(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const QT=X("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=rT),bt.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=s=>{Qj(s.value)||s.issues.push({code:"invalid_format",format:"base64",input:s.value,inst:e,continue:!t.abort})}});function YT(e){if(!qj.test(e))return!1;const t=e.replace(/[-_]/g,a=>a==="-"?"+":"/"),s=t.padEnd(Math.ceil(t.length/4)*4,"=");return Qj(s)}const JT=X("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=qj),bt.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=s=>{YT(s.value)||s.issues.push({code:"invalid_format",format:"base64url",input:s.value,inst:e,continue:!t.abort})}}),XT=X("$ZodE164",(e,t)=>{t.pattern??(t.pattern=oT),bt.init(e,t)});function WT(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 eO=X("$ZodJWT",(e,t)=>{bt.init(e,t),e._zod.check=s=>{WT(s.value,t.alg)||s.issues.push({code:"invalid_format",format:"jwt",input:s.value,inst:e,continue:!t.abort})}}),Yj=X("$ZodNumber",(e,t)=>{St.init(e,t),e._zod.pattern=e._zod.bag.pattern??Fj,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}}),tO=X("$ZodNumberFormat",(e,t)=>{yT.init(e,t),Yj.init(e,t)}),nO=X("$ZodBoolean",(e,t)=>{St.init(e,t),e._zod.pattern=hT,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}}),sO=X("$ZodUnknown",(e,t)=>{St.init(e,t),e._zod.parse=s=>s}),iO=X("$ZodNever",(e,t)=>{St.init(e,t),e._zod.parse=(s,a)=>(s.issues.push({expected:"never",code:"invalid_type",input:s.value,inst:e}),s)});function nx(e,t,s){e.issues.length&&t.issues.push(...jr(s,e.issues)),t.value[s]=e.value}const aO=X("$ZodArray",(e,t)=>{St.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=>nx(m,s,d))):nx(p,s,d)}return c.length?Promise.all(c).then(()=>s):s}});function wu(e,t,s,a,r){if(e.issues.length){if(r&&!(s in a))return;t.issues.push(...jr(s,e.issues))}e.value===void 0?s in a&&(t.value[s]=void 0):t.value[s]=e.value}function Jj(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=NR(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(s)}}function Xj(e,t,s,a,r,c){const d=[],f=r.keySet,p=r.catchall._zod,m=p.def.type,v=p.optout==="optional";for(const y in t){if(f.has(y))continue;if(m==="never"){d.push(y);continue}const b=p.run({value:t[y],issues:[]},a);b instanceof Promise?e.push(b.then(x=>wu(x,s,y,t,v))):wu(b,s,y,t,v)}return d.length&&s.issues.push({code:"unrecognized_keys",keys:d,input:t,inst:c}),e.length?Promise.all(e).then(()=>s):s}const rO=X("$ZodObject",(e,t)=>{if(St.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(()=>Jj(t));nt(e._zod,"propValues",()=>{const f=t.shape,p={};for(const m in f){const v=f[m]._zod;if(v.values){p[m]??(p[m]=new Set);for(const y of v.values)p[m].add(y)}}return p});const r=ju,c=t.catchall;let d;e._zod.parse=(f,p)=>{d??(d=a.value);const m=f.value;if(!r(m))return f.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),f;f.value={};const v=[],y=d.shape;for(const b of d.keys){const x=y[b],w=x._zod.optout==="optional",S=x._zod.run({value:m[b],issues:[]},p);S instanceof Promise?v.push(S.then(C=>wu(C,f,b,m,w))):wu(S,f,b,m,w)}return c?Xj(v,m,f,p,a.value,e):v.length?Promise.all(v).then(()=>f):f}}),oO=X("$ZodObjectJIT",(e,t)=>{rO.init(e,t);const s=e._zod.parse,a=hp(()=>Jj(t)),r=b=>{const x=new zT(["shape","payload","ctx"]),w=a.value,S=A=>{const z=ex(A);return`shape[${z}]._zod.run({ value: input[${z}], issues: [] }, ctx)`};x.write("const input = payload.value;");const C=Object.create(null);let k=0;for(const A of w.keys)C[A]=`key_${k++}`;x.write("const newResult = {};");for(const A of w.keys){const z=C[A],M=ex(A),R=b[A]?._zod?.optout==="optional";x.write(`const ${z} = ${S(A)};`),R?x.write(`
59
- if (${z}.issues.length) {
60
- if (${M} in input) {
61
- payload.issues = payload.issues.concat(${z}.issues.map(iss => ({
62
- ...iss,
63
- path: iss.path ? [${M}, ...iss.path] : [${M}]
64
- })));
65
- }
66
- }
67
-
68
- if (${z}.value === undefined) {
69
- if (${M} in input) {
70
- newResult[${M}] = undefined;
71
- }
72
- } else {
73
- newResult[${M}] = ${z}.value;
74
- }
75
-
76
- `):x.write(`
77
- if (${z}.issues.length) {
78
- payload.issues = payload.issues.concat(${z}.issues.map(iss => ({
79
- ...iss,
80
- path: iss.path ? [${M}, ...iss.path] : [${M}]
81
- })));
82
- }
83
-
84
- if (${z}.value === undefined) {
85
- if (${M} in input) {
86
- newResult[${M}] = undefined;
87
- }
88
- } else {
89
- newResult[${M}] = ${z}.value;
90
- }
91
-
92
- `)}x.write("payload.value = newResult;"),x.write("return payload;");const E=x.compile();return(A,z)=>E(b,A,z)};let c;const d=ju,f=!Lj.jitless,m=f&&jR.value,v=t.catchall;let y;e._zod.parse=(b,x)=>{y??(y=a.value);const w=b.value;return d(w)?f&&m&&x?.async===!1&&x.jitless!==!0?(c||(c=r(t.shape)),b=c(b,x),v?Xj([],w,b,x,y,e):b):s(b,x):(b.issues.push({expected:"object",code:"invalid_type",input:w,inst:e}),b)}});function sx(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=>!Sr(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=>Pi(d,a,$i())))}),t)}const lO=X("$ZodUnion",(e,t)=>{St.init(e,t),nt(e._zod,"optin",()=>t.options.some(r=>r._zod.optin==="optional")?"optional":void 0),nt(e._zod,"optout",()=>t.options.some(r=>r._zod.optout==="optional")?"optional":void 0),nt(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),nt(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=>sx(p,r,e,c)):sx(f,r,e,c)}}),cO=X("$ZodIntersection",(e,t)=>{St.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])=>ix(s,p,m)):ix(s,c,d)}});function vm(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(Rr(e)&&Rr(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=vm(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=vm(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 ix(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}),Sr(e))return e;const d=vm(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 uO=X("$ZodRecord",(e,t)=>{St.init(e,t),e._zod.parse=(s,a)=>{const r=s.value;if(!Rr(r))return s.issues.push({expected:"record",code:"invalid_type",input:r,inst:e}),s;const c=[],d=t.keyType._zod.values;if(d){s.value={};const f=new Set;for(const m of d)if(typeof m=="string"||typeof m=="number"||typeof m=="symbol"){f.add(typeof m=="number"?m.toString():m);const v=t.valueType._zod.run({value:r[m],issues:[]},a);v instanceof Promise?c.push(v.then(y=>{y.issues.length&&s.issues.push(...jr(m,y.issues)),s.value[m]=y.value})):(v.issues.length&&s.issues.push(...jr(m,v.issues)),s.value[m]=v.value)}let p;for(const m in r)f.has(m)||(p=p??[],p.push(m));p&&p.length>0&&s.issues.push({code:"unrecognized_keys",input:r,inst:e,keys:p})}else{s.value={};for(const f of Reflect.ownKeys(r)){if(f==="__proto__")continue;let p=t.keyType._zod.run({value:f,issues:[]},a);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof f=="string"&&Fj.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=>Pi(y,a,$i())),input:f,path:[f],inst:e});continue}const v=t.valueType._zod.run({value:r[f],issues:[]},a);v instanceof Promise?c.push(v.then(y=>{y.issues.length&&s.issues.push(...jr(f,y.issues)),s.value[p.value]=y.value})):(v.issues.length&&s.issues.push(...jr(f,v.issues)),s.value[p.value]=v.value)}}return c.length?Promise.all(c).then(()=>s):s}}),dO=X("$ZodEnum",(e,t)=>{St.init(e,t);const s=Mj(t.entries),a=new Set(s);e._zod.values=a,e._zod.pattern=new RegExp(`^(${s.filter(r=>wR.has(typeof r)).map(r=>typeof r=="string"?Tr(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}}),fO=X("$ZodLiteral",(e,t)=>{if(St.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"?Tr(a):a?Tr(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}}),hO=X("$ZodTransform",(e,t)=>{St.init(e,t),e._zod.parse=(s,a)=>{if(a.direction==="backward")throw new Dj(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 ax(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const Wj=X("$ZodOptional",(e,t)=>{St.init(e,t),e._zod.optin="optional",e._zod.optout="optional",nt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),nt(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=>ax(c,s.value)):ax(r,s.value)}return s.value===void 0?s:t.innerType._zod.run(s,a)}}),mO=X("$ZodExactOptional",(e,t)=>{Wj.init(e,t),nt(e._zod,"values",()=>t.innerType._zod.values),nt(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(s,a)=>t.innerType._zod.run(s,a)}),pO=X("$ZodNullable",(e,t)=>{St.init(e,t),nt(e._zod,"optin",()=>t.innerType._zod.optin),nt(e._zod,"optout",()=>t.innerType._zod.optout),nt(e._zod,"pattern",()=>{const s=t.innerType._zod.pattern;return s?new RegExp(`^(${pp(s.source)}|null)$`):void 0}),nt(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)}),gO=X("$ZodDefault",(e,t)=>{St.init(e,t),e._zod.optin="optional",nt(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=>rx(c,t)):rx(r,t)}});function rx(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const yO=X("$ZodPrefault",(e,t)=>{St.init(e,t),e._zod.optin="optional",nt(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))}),vO=X("$ZodNonOptional",(e,t)=>{St.init(e,t),nt(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=>ox(c,e)):ox(r,e)}});function ox(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 bO=X("$ZodCatch",(e,t)=>{St.init(e,t),nt(e._zod,"optin",()=>t.innerType._zod.optin),nt(e._zod,"optout",()=>t.innerType._zod.optout),nt(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=>Pi(d,a,$i()))},input:s.value}),s.issues=[]),s)):(s.value=r.value,r.issues.length&&(s.value=t.catchValue({...s,error:{issues:r.issues.map(c=>Pi(c,a,$i()))},input:s.value}),s.issues=[]),s)}}),xO=X("$ZodPipe",(e,t)=>{St.init(e,t),nt(e._zod,"values",()=>t.in._zod.values),nt(e._zod,"optin",()=>t.in._zod.optin),nt(e._zod,"optout",()=>t.out._zod.optout),nt(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 SO=X("$ZodReadonly",(e,t)=>{St.init(e,t),nt(e._zod,"propValues",()=>t.innerType._zod.propValues),nt(e._zod,"values",()=>t.innerType._zod.values),nt(e._zod,"optin",()=>t.innerType?._zod?.optin),nt(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(lx):lx(r)}});function lx(e){return e.value=Object.freeze(e.value),e}const jO=X("$ZodCustom",(e,t)=>{Nn.init(e,t),St.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=>cx(c,s,a,e));cx(r,s,a,e)}});function cx(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 ux;class wO{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 NO(){return new wO}(ux=globalThis).__zod_globalRegistry??(ux.__zod_globalRegistry=NO());const Io=globalThis.__zod_globalRegistry;function CO(e,t){return new e({type:"string",...we(t)})}function kO(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...we(t)})}function dx(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...we(t)})}function _O(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...we(t)})}function zO(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...we(t)})}function EO(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...we(t)})}function AO(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...we(t)})}function RO(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...we(t)})}function TO(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...we(t)})}function OO(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...we(t)})}function DO(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...we(t)})}function LO(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...we(t)})}function MO(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...we(t)})}function UO(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...we(t)})}function $O(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...we(t)})}function PO(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...we(t)})}function IO(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...we(t)})}function BO(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...we(t)})}function qO(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...we(t)})}function HO(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...we(t)})}function ZO(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...we(t)})}function FO(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...we(t)})}function GO(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...we(t)})}function KO(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...we(t)})}function VO(e,t){return new e({type:"string",format:"date",check:"string_format",...we(t)})}function QO(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...we(t)})}function YO(e,t){return new e({type:"string",format:"duration",check:"string_format",...we(t)})}function JO(e,t){return new e({type:"number",checks:[],...we(t)})}function XO(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...we(t)})}function WO(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 fx(e,t){return new Kj({check:"less_than",...we(t),value:e,inclusive:!1})}function qh(e,t){return new Kj({check:"less_than",...we(t),value:e,inclusive:!0})}function hx(e,t){return new Vj({check:"greater_than",...we(t),value:e,inclusive:!1})}function Hh(e,t){return new Vj({check:"greater_than",...we(t),value:e,inclusive:!0})}function mx(e,t){return new gT({check:"multiple_of",...we(t),value:e})}function ew(e,t){return new vT({check:"max_length",...we(t),maximum:e})}function Nu(e,t){return new bT({check:"min_length",...we(t),minimum:e})}function tw(e,t){return new xT({check:"length_equals",...we(t),length:e})}function nD(e,t){return new ST({check:"string_format",format:"regex",...we(t),pattern:e})}function sD(e){return new jT({check:"string_format",format:"lowercase",...we(e)})}function iD(e){return new wT({check:"string_format",format:"uppercase",...we(e)})}function aD(e,t){return new NT({check:"string_format",format:"includes",...we(t),includes:e})}function rD(e,t){return new CT({check:"string_format",format:"starts_with",...we(t),prefix:e})}function oD(e,t){return new kT({check:"string_format",format:"ends_with",...we(t),suffix:e})}function Mr(e){return new _T({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=>SR(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 Nn({check:"custom",...we(t)});return s._zod.check=e,s}function nw(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 v={...s,schemaPath:[...s.schemaPath,e],path:s.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,d.schema,v);else{const b=d.schema,x=t.processors[r.type];if(!x)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${r.type}`);x(e,t,b,v)}const y=e._zod.parent;y&&(d.ref||(d.ref=y),qt(y,t,v),t.seen.get(y).isParent=!0)}const p=t.metadataRegistry.get(e);return p&&Object.assign(d.schema,p),t.io==="input"&&ln(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 sw(e,t){const s=e.seen.get(t);if(!s)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=new Map;for(const d of e.seen.entries()){const f=e.metadataRegistry.get(d[0])?.id;if(f){const p=a.get(f);if(p&&p!==d[0])throw new Error(`Duplicate schema id "${f}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);a.set(f,d[0])}}const r=d=>{const f=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const y=e.external.registry.get(d[0])?.id,b=e.external.uri??(w=>w);if(y)return{ref:b(y)};const x=d[1].defId??d[1].schema.id??`schema${e.counter++}`;return d[1].defId=x,{defId:x,ref:`${b("__shared")}#/${f}/${x}`}}if(d[1]===s)return{ref:"#"};const m=`#/${f}/`,v=d[1].schema.id??`__schema${e.counter++}`;return{defId:v,ref:m+v}},c=d=>{if(d[1].schema.$ref)return;const f=d[1],{ref:p,defId:m}=r(d);f.def={...f.schema},m&&(f.defId=m);const v=f.schema;for(const y in v)delete v[y];v.$ref=p};if(e.cycles==="throw")for(const d of e.seen.entries()){const f=d[1];if(f.cycle)throw new Error(`Cycle detected: #/${f.cycle?.join("/")}/<root>
93
-
94
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const d of e.seen.entries()){const f=d[1];if(t===d[0]){c(d);continue}if(e.external){const m=e.external.registry.get(d[0])?.id;if(t!==d[0]&&m){c(d);continue}}if(e.metadataRegistry.get(d[0])?.id){c(d);continue}if(f.cycle){c(d);continue}if(f.count>1&&e.reused==="ref"){c(d);continue}}}function iw(e,t){const s=e.seen.get(t);if(!s)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=d=>{const f=e.seen.get(d);if(f.ref===null)return;const p=f.def??f.schema,m={...p},v=f.ref;if(f.ref=null,v){a(v);const b=e.seen.get(v),x=b.schema;if(x.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(p.allOf=p.allOf??[],p.allOf.push(x)):Object.assign(p,x),Object.assign(p,m),d._zod.parent===v)for(const S in p)S==="$ref"||S==="allOf"||S in m||delete p[S];if(x.$ref&&b.def)for(const S in p)S==="$ref"||S==="allOf"||S in b.def&&JSON.stringify(p[S])===JSON.stringify(b.def[S])&&delete p[S]}const y=d._zod.parent;if(y&&y!==v){a(y);const b=e.seen.get(y);if(b?.schema.$ref&&(p.$ref=b.schema.$ref,b.def))for(const x in p)x==="$ref"||x==="allOf"||x in b.def&&JSON.stringify(p[x])===JSON.stringify(b.def[x])&&delete p[x]}e.override({zodSchema:d,jsonSchema:p,path:f.path??[]})};for(const d of[...e.seen.entries()].reverse())a(d[0]);const r={};if(e.target==="draft-2020-12"?r.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?r.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?r.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const d=e.external.registry.get(t)?.id;if(!d)throw new Error("Schema is missing an `id` property");r.$id=e.external.uri(d)}Object.assign(r,s.def??s.schema);const c=e.external?.defs??{};for(const d of e.seen.entries()){const f=d[1];f.def&&f.defId&&(c[f.defId]=f.def)}e.external||Object.keys(c).length>0&&(e.target==="draft-2020-12"?r.$defs=c:r.definitions=c);try{const d=JSON.parse(JSON.stringify(r));return Object.defineProperty(d,"~standard",{value:{...t["~standard"],jsonSchema:{input: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 ln(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 ln(a.element,s);if(a.type==="set")return ln(a.valueType,s);if(a.type==="lazy")return ln(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 ln(a.innerType,s);if(a.type==="intersection")return ln(a.left,s)||ln(a.right,s);if(a.type==="record"||a.type==="map")return ln(a.keyType,s)||ln(a.valueType,s);if(a.type==="pipe")return ln(a.in,s)||ln(a.out,s);if(a.type==="object"){for(const r in a.shape)if(ln(a.shape[r],s))return!0;return!1}if(a.type==="union"){for(const r of a.options)if(ln(r,s))return!0;return!1}if(a.type==="tuple"){for(const r of a.items)if(ln(r,s))return!0;return!!(a.rest&&ln(a.rest,s))}return!1}const yD=(e,t={})=>s=>{const a=nw({...s,processors:t});return qt(e,a),sw(a,e),iw(a,e)},Cu=(e,t,s={})=>a=>{const{libraryOptions:r,target:c}=a??{},d=nw({...r??{},target:c,io:t,processors:s});return qt(e,d),sw(d,e),iw(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 v=[...p];v.length===1?r.pattern=v[0].source:v.length>1&&(r.allOf=[...v.map(y=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:y.source}))])}},xD=(e,t,s,a)=>{const r=s,{minimum:c,maximum:d,format:f,multipleOf:p,exclusiveMaximum:m,exclusiveMinimum:v}=e._zod.bag;typeof f=="string"&&f.includes("int")?r.type="integer":r.type="number",typeof v=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(r.minimum=v,r.exclusiveMinimum=!0):r.exclusiveMinimum=v),typeof c=="number"&&(r.minimum=c,typeof v=="number"&&t.target!=="draft-04"&&(v>=c?delete r.minimum:delete r.exclusiveMinimum)),typeof m=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(r.maximum=m,r.exclusiveMaximum=!0):r.exclusiveMaximum=m),typeof d=="number"&&(r.maximum=d,typeof m=="number"&&t.target!=="draft-04"&&(m<=d?delete r.maximum:delete r.exclusiveMaximum)),typeof p=="number"&&(r.multipleOf=p)},SD=(e,t,s,a)=>{s.type="boolean"},jD=(e,t,s,a)=>{s.not={}},wD=(e,t,s,a)=>{},ND=(e,t,s,a)=>{const r=e._zod.def,c=Mj(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},kD=(e,t,s,a)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},_D=(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 v=c.shape[m]._zod;return t.io==="input"?v.optin===void 0:v.optout===void 0}));p.size>0&&(r.required=Array.from(p)),c.catchall?._zod.def.type==="never"?r.additionalProperties=!1:c.catchall?c.catchall&&(r.additionalProperties=qt(c.catchall,t,{...a,path:[...a.path,"additionalProperties"]})):t.io==="output"&&(r.additionalProperties=!1)},AD=(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},RD=(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},TD=(e,t,s,a)=>{const r=s,c=e._zod.def;r.type="object";const d=c.keyType,p=d._zod.bag?.patterns;if(c.mode==="loose"&&p&&p.size>0){const v=qt(c.valueType,t,{...a,path:[...a.path,"patternProperties","*"]});r.patternProperties={};for(const y of p)r.patternProperties[y.source]=v}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(r.propertyNames=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 v=[...m].filter(y=>typeof y=="string"||typeof y=="number");v.length>0&&(r.required=v)}},OD=(e,t,s,a)=>{const r=e._zod.def,c=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},$D=(e,t,s,a)=>{const r=e._zod.def,c=t.io==="input"?r.in._zod.def.type==="transform"?r.out:r.in:r.out;qt(c,t,a);const d=t.seen.get(e);d.ref=c},PD=(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},aw=(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)=>{BT.init(e,t),wt.init(e,t)});function BD(e){return KO(ID,e)}const qD=X("ZodISODate",(e,t)=>{qT.init(e,t),wt.init(e,t)});function HD(e){return VO(qD,e)}const ZD=X("ZodISOTime",(e,t)=>{HT.init(e,t),wt.init(e,t)});function FD(e){return QO(ZD,e)}const GD=X("ZodISODuration",(e,t)=>{ZT.init(e,t),wt.init(e,t)});function KD(e){return YO(GD,e)}const VD=(e,t)=>{Ij.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:s=>DR(e,s)},flatten:{value:s=>OR(e,s)},addIssue:{value:s=>{e.issues.push(s),e.message=JSON.stringify(e.issues,ym,2)}},addIssues:{value:s=>{e.issues.push(...s),e.message=JSON.stringify(e.issues,ym,2)}},isEmpty:{get(){return e.issues.length===0}}})},Qn=X("ZodError",VD,{Parent:Error}),QD=yp(Qn),YD=vp(Qn),JD=qu(Qn),XD=Hu(Qn),WD=UR(Qn),eL=$R(Qn),tL=PR(Qn),nL=IR(Qn),sL=BR(Qn),iL=qR(Qn),aL=HR(Qn),rL=ZR(Qn),jt=X("ZodType",(e,t)=>(St.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(qi(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)=>Hi(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(e5(s,a)),e.superRefine=s=>e.check(t5(s)),e.overwrite=s=>e.check(Mr(s)),e.optional=()=>yx(e),e.exactOptional=()=>BL(e),e.nullable=()=>vx(e),e.nullish=()=>yx(vx(e)),e.nonoptional=s=>KL(e,s),e.array=()=>Qe(e),e.or=s=>OL([e,s]),e.and=s=>LL(e,s),e.transform=s=>bx(e,PL(s)),e.default=s=>ZL(e,s),e.prefault=s=>GL(e,s),e.catch=s=>QL(e,s),e.pipe=s=>bx(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)),rw=X("_ZodString",(e,t)=>{bp.init(e,t),jt.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(ew(...a)),e.length=(...a)=>e.check(tw(...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),rw.init(e,t),e.email=s=>e.check(kO(lL,s)),e.url=s=>e.check(RO(cL,s)),e.jwt=s=>e.check(GO(NL,s)),e.emoji=s=>e.check(TO(uL,s)),e.guid=s=>e.check(dx(px,s)),e.uuid=s=>e.check(_O(Fc,s)),e.uuidv4=s=>e.check(zO(Fc,s)),e.uuidv6=s=>e.check(EO(Fc,s)),e.uuidv7=s=>e.check(AO(Fc,s)),e.nanoid=s=>e.check(OO(dL,s)),e.guid=s=>e.check(dx(px,s)),e.cuid=s=>e.check(DO(fL,s)),e.cuid2=s=>e.check(LO(hL,s)),e.ulid=s=>e.check(MO(mL,s)),e.base64=s=>e.check(HO(SL,s)),e.base64url=s=>e.check(ZO(jL,s)),e.xid=s=>e.check(UO(pL,s)),e.ksuid=s=>e.check($O(gL,s)),e.ipv4=s=>e.check(PO(yL,s)),e.ipv6=s=>e.check(IO(vL,s)),e.cidrv4=s=>e.check(BO(bL,s)),e.cidrv6=s=>e.check(qO(xL,s)),e.e164=s=>e.check(FO(wL,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 CO(oL,e)}const wt=X("ZodStringFormat",(e,t)=>{bt.init(e,t),rw.init(e,t)}),lL=X("ZodEmail",(e,t)=>{TT.init(e,t),wt.init(e,t)}),px=X("ZodGUID",(e,t)=>{AT.init(e,t),wt.init(e,t)}),Fc=X("ZodUUID",(e,t)=>{RT.init(e,t),wt.init(e,t)}),cL=X("ZodURL",(e,t)=>{OT.init(e,t),wt.init(e,t)}),uL=X("ZodEmoji",(e,t)=>{DT.init(e,t),wt.init(e,t)}),dL=X("ZodNanoID",(e,t)=>{LT.init(e,t),wt.init(e,t)}),fL=X("ZodCUID",(e,t)=>{MT.init(e,t),wt.init(e,t)}),hL=X("ZodCUID2",(e,t)=>{UT.init(e,t),wt.init(e,t)}),mL=X("ZodULID",(e,t)=>{$T.init(e,t),wt.init(e,t)}),pL=X("ZodXID",(e,t)=>{PT.init(e,t),wt.init(e,t)}),gL=X("ZodKSUID",(e,t)=>{IT.init(e,t),wt.init(e,t)}),yL=X("ZodIPv4",(e,t)=>{FT.init(e,t),wt.init(e,t)}),vL=X("ZodIPv6",(e,t)=>{GT.init(e,t),wt.init(e,t)}),bL=X("ZodCIDRv4",(e,t)=>{KT.init(e,t),wt.init(e,t)}),xL=X("ZodCIDRv6",(e,t)=>{VT.init(e,t),wt.init(e,t)}),SL=X("ZodBase64",(e,t)=>{QT.init(e,t),wt.init(e,t)}),jL=X("ZodBase64URL",(e,t)=>{JT.init(e,t),wt.init(e,t)}),wL=X("ZodE164",(e,t)=>{XT.init(e,t),wt.init(e,t)}),NL=X("ZodJWT",(e,t)=>{eO.init(e,t),wt.init(e,t)}),ow=X("ZodNumber",(e,t)=>{Yj.init(e,t),jt.init(e,t),e._zod.processJSONSchema=(a,r,c)=>xD(e,a,r),e.gt=(a,r)=>e.check(hx(a,r)),e.gte=(a,r)=>e.check(Hh(a,r)),e.min=(a,r)=>e.check(Hh(a,r)),e.lt=(a,r)=>e.check(fx(a,r)),e.lte=(a,r)=>e.check(qh(a,r)),e.max=(a,r)=>e.check(qh(a,r)),e.int=a=>e.check(gx(a)),e.safe=a=>e.check(gx(a)),e.positive=a=>e.check(hx(0,a)),e.nonnegative=a=>e.check(Hh(0,a)),e.negative=a=>e.check(fx(0,a)),e.nonpositive=a=>e.check(qh(0,a)),e.multipleOf=(a,r)=>e.check(mx(a,r)),e.step=(a,r)=>e.check(mx(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 ut(e){return JO(ow,e)}const CL=X("ZodNumberFormat",(e,t)=>{tO.init(e,t),ow.init(e,t)});function gx(e){return XO(CL,e)}const kL=X("ZodBoolean",(e,t)=>{nO.init(e,t),jt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>SD(e,s,a)});function ol(e){return WO(kL,e)}const _L=X("ZodUnknown",(e,t)=>{sO.init(e,t),jt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>wD()});function bm(){return eD(_L)}const zL=X("ZodNever",(e,t)=>{iO.init(e,t),jt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>jD(e,s,a)});function EL(e){return tD(zL,e)}const AL=X("ZodArray",(e,t)=>{aO.init(e,t),jt.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(ew(s,a)),e.length=(s,a)=>e.check(tw(s,a)),e.unwrap=()=>e.element});function Qe(e,t){return hD(AL,e,t)}const RL=X("ZodObject",(e,t)=>{oO.init(e,t),jt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>ED(e,s,a,r),nt(e,"shape",()=>t.shape),e.keyof=()=>jn(Object.keys(e._zod.def.shape)),e.catchall=s=>e.clone({...e._zod.def,catchall:s}),e.passthrough=()=>e.clone({...e._zod.def,catchall:bm()}),e.loose=()=>e.clone({...e._zod.def,catchall:bm()}),e.strict=()=>e.clone({...e._zod.def,catchall:EL()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=s=>zR(e,s),e.safeExtend=s=>ER(e,s),e.merge=s=>AR(e,s),e.pick=s=>kR(e,s),e.omit=s=>_R(e,s),e.partial=(...s)=>RR(lw,e,s[0]),e.required=(...s)=>TR(cw,e,s[0])});function Ze(e,t){const s={type:"object",shape:e??{},...we(t)};return new RL(s)}const TL=X("ZodUnion",(e,t)=>{lO.init(e,t),jt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>AD(e,s,a,r),e.options=t.options});function OL(e,t){return new TL({type:"union",options:e,...we(t)})}const DL=X("ZodIntersection",(e,t)=>{cO.init(e,t),jt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>RD(e,s,a,r)});function LL(e,t){return new DL({type:"intersection",left:e,right:t})}const ML=X("ZodRecord",(e,t)=>{uO.init(e,t),jt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>TD(e,s,a,r),e.keyType=t.keyType,e.valueType=t.valueType});function Fu(e,t,s){return new ML({type:"record",keyType:e,valueType:t,...we(s)})}const xm=X("ZodEnum",(e,t)=>{dO.init(e,t),jt.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 xm({...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 xm({...t,checks:[],...we(r),entries:c})}});function jn(e,t){const s=Array.isArray(e)?Object.fromEntries(e.map(a=>[a,a])):e;return new xm({type:"enum",entries:s,...we(t)})}const UL=X("ZodLiteral",(e,t)=>{fO.init(e,t),jt.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 ku(e,t){return new UL({type:"literal",values:Array.isArray(e)?e:[e],...we(t)})}const $L=X("ZodTransform",(e,t)=>{hO.init(e,t),jt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>_D(e,s),e._zod.parse=(s,a)=>{if(a.direction==="backward")throw new Dj(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 PL(e){return new $L({type:"transform",transform:e})}const lw=X("ZodOptional",(e,t)=>{Wj.init(e,t),jt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>aw(e,s,a,r),e.unwrap=()=>e._zod.def.innerType});function yx(e){return new lw({type:"optional",innerType:e})}const IL=X("ZodExactOptional",(e,t)=>{mO.init(e,t),jt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>aw(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)=>{pO.init(e,t),jt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>OD(e,s,a,r),e.unwrap=()=>e._zod.def.innerType});function vx(e){return new qL({type:"nullable",innerType:e})}const HL=X("ZodDefault",(e,t)=>{gO.init(e,t),jt.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():$j(t)}})}const FL=X("ZodPrefault",(e,t)=>{yO.init(e,t),jt.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():$j(t)}})}const cw=X("ZodNonOptional",(e,t)=>{vO.init(e,t),jt.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 cw({type:"nonoptional",innerType:e,...we(t)})}const VL=X("ZodCatch",(e,t)=>{bO.init(e,t),jt.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)=>{xO.init(e,t),jt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>$D(e,s,a,r),e.in=t.in,e.out=t.out});function bx(e,t){return new YL({type:"pipe",in:e,out:t})}const JL=X("ZodReadonly",(e,t)=>{SO.init(e,t),jt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>PD(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)=>{jO.init(e,t),jt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>kD(e,s)});function e5(e,t={}){return mD(WL,e,t)}function t5(e){return pD(e)}Ze({maxConcurrency:ut().int().positive(),maxRequestsPerMinute:ut().int().positive(),maxRequestsPerDay:ut().int().positive()});const Ur=K().min(1);K().min(1);const xp=Ze({label:K().min(1),city:K().min(1),region:K().min(1),country:K().length(2),timezone:K().optional()}),uw=jn(["citation.lost","citation.gained","run.completed","run.failed"]);Ze({id:K(),projectId:K(),channel:ku("webhook"),url:K().url(),events:Qe(uw),enabled:ol().default(!0),webhookSecret:K().optional(),createdAt:K(),updatedAt:K()});const dw=jn(["cli","api","config-file"]);function n5(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 s5(e,t){return t?e.some(s=>s.label===t):!0}Ze({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:Fu(K(),K()).optional(),providers:Qe(Ur).optional(),locations:Qe(xp).optional(),defaultLocation:K().nullable().optional(),configSource:dw.optional()});Ze({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:Fu(K(),K()).default({}),locations:Qe(xp).default([]),defaultLocation:K().nullable().optional(),configSource:dw.default("cli"),configRevision:ut().int().positive().default(1),createdAt:K().optional(),updatedAt:K().optional()});function Sm(e){let t=e.trim().toLowerCase();try{t.includes("://")&&(t=new URL(t).hostname.toLowerCase())}catch{}return t.replace(/^www\./,"")}function i5(e){const t=[e.canonicalDomain,...e.ownedDomains??[]],s=new Set,a=[];for(const r of t){const c=r.trim();if(!c)continue;const d=Sm(c);s.has(d)||(s.add(d),a.push(c))}return a}const a5=Ze({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:Fu(K(),K()).optional().default({})}),r5=Ze({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(),o5=Ze({channel:ku("webhook"),url:K().url(),events:Qe(uw).min(1)}),l5=Ze({gsc:Ze({propertyUrl:K()}).optional(),syncSchedule:Ze({preset:K().optional(),cron:K().optional()}).optional()}).optional(),c5=Ze({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:r5,notifications:Qe(o5).optional().default([]),google:l5}).superRefine((e,t)=>{const s=n5(e.locations);s.length>0&&t.addIssue({code:"custom",message:`Duplicate location labels are not allowed: ${s.join(", ")}`,path:["locations"]}),s5(e.locations,e.defaultLocation)||t.addIssue({code:"custom",message:`defaultLocation "${e.defaultLocation}" must match a configured location label`,path:["defaultLocation"]})});Ze({apiVersion:ku("canonry/v1"),kind:ku("Project"),metadata:a5,spec:c5});const u5=jn(["gsc","ga4"]);Ze({id:K(),domain:K(),connectionType:u5,propertyId:K().nullable().optional(),sitemapUrl:K().nullable().optional(),scopes:Qe(K()).default([]),createdAt:K(),updatedAt:K()});Ze({date:K(),query:K(),page:K(),country:K().nullable().optional(),device:K().nullable().optional(),clicks:ut(),impressions:ut(),ctr:ut(),position:ut()});const jm=Ze({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()});jn(["stable","reindexed","deindexed","still-missing","new"]);const d5=Ze({url:K(),previousState:K().nullable(),currentState:K().nullable(),transitionDate:K()}),f5=Ze({reason:K(),count:ut(),urls:Qe(jm).default([])});Ze({summary:Ze({total:ut(),indexed:ut(),notIndexed:ut(),deindexed:ut(),percentage:ut()}),lastInspectedAt:K().nullable(),indexed:Qe(jm).default([]),notIndexed:Qe(jm).default([]),deindexed:Qe(d5).default([]),reasonGroups:Qe(f5).default([])});Ze({url:K(),type:jn(["URL_UPDATED","URL_DELETED"]),notifiedAt:K()});Ze({url:K(),type:jn(["URL_UPDATED","URL_DELETED"]),notifiedAt:K(),status:jn(["success","error"]),error:K().optional()});Ze({date:K(),indexed:ut(),notIndexed:ut(),reasonBreakdown:Fu(K(),ut()).default({})});Ze({id:K(),domain:K(),siteUrl:K().nullable().optional(),createdAt:K(),updatedAt:K()});const xx=Ze({id:K(),url:K(),httpCode:ut().nullable().optional(),inIndex:ol().nullable().optional(),lastCrawledDate:K().nullable().optional(),inIndexDate:K().nullable().optional(),inspectedAt:K()});Ze({summary:Ze({total:ut(),indexed:ut(),notIndexed:ut(),percentage:ut()}),lastInspectedAt:K().nullable(),indexed:Qe(xx).default([]),notIndexed:Qe(xx).default([])});Ze({query:K(),impressions:ut(),clicks:ut(),ctr:ut(),averagePosition:ut()});Ze({url:K(),status:jn(["success","error"]),submittedAt:K(),error:K().optional()});const h5=jn(["queued","running","completed","partial","failed","cancelled"]),m5=jn(["answer-visibility","site-audit","gsc-sync","inspect-sitemap"]),p5=jn(["manual","scheduled","config-apply"]),g5=jn(["cited","not-cited"]),y5=jn(["new","cited","lost","emerging","not-cited"]);Ze({id:K(),projectId:K(),kind:m5,status:h5,trigger:p5.default("manual"),location:K().nullable().optional(),startedAt:K().nullable().optional(),finishedAt:K().nullable().optional(),error:K().nullable().optional(),createdAt:K()});const v5=Ze({uri:K(),title:K()});Ze({id:K(),runId:K(),keywordId:K(),keyword:K().optional(),provider:Ur,citationState:g5,transition:y5.optional(),answerText:K().nullable().optional(),citedDomains:Qe(K()).default([]),competitorOverlap:Qe(K()).default([]),groundingSources:Qe(v5).default([]),searchQueries:Qe(K()).default([]),model:K().nullable().optional(),location:K().nullable().optional(),createdAt:K()});Ze({id:K(),projectId:K().nullable().optional(),actor:K(),action:K(),entityType:K(),entityId:K().nullable().optional(),diff:bm().optional(),createdAt:K()});Ze({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()});Ze({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 wm({state:e}){return l.jsx(tt,{tone:OE(e),children:Uu(e)})}function Sx(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"?ss.createElement("strong",{key:`b-${f}`,className:"text-zinc-200 font-semibold"},d.value):d.value).filter(Boolean);const r=s.map(d=>d.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),c=new RegExp(`(${r.join("|")})`,"gi");return a.flatMap((d,f)=>d.value.split(c).map((m,v)=>m?v%2===1?d.type==="bold"?ss.createElement("mark",{key:`hl-${f}-${v}`,className:"answer-highlight"},ss.createElement("strong",{className:"text-zinc-200 font-semibold"},m)):ss.createElement("mark",{key:`hl-${f}-${v}`,className:"answer-highlight"},m):d.type==="bold"?ss.createElement("strong",{key:`b-${f}-${v}`,className:"text-zinc-200 font-semibold"},m):m:null)).filter(Boolean)}class fw extends Error{code;statusCode;constructor(t,s,a){super(t),this.name="ApiError",this.code=a??"UNKNOWN",this.statusCode=s}}function b5(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,"")+"/api/v1":"/api/v1"}const x5=b5();function S5(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.apiKey?window.__CANONRY_CONFIG__.apiKey:""}async function xe(e,t){const s=S5(),a=await fetch(`${x5}${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 fw(c,a.status,d)}if(a.status!==204)return a.json()}function hw(){return xe("/projects")}function Sp(e){return xe(`/projects/${encodeURIComponent(e)}`)}function mw(){return xe("/runs")}function sl(e){return xe(`/runs/${encodeURIComponent(e)}`)}function pw(e){return xe(`/projects/${encodeURIComponent(e)}/keywords`)}function jp(e){return xe(`/projects/${encodeURIComponent(e)}/competitors`)}function wp(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 gw(e,t){return xe(`/projects/${encodeURIComponent(e)}/keywords`,{method:"PUT",body:JSON.stringify({keywords:t})})}function yw(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 Nm(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 vw(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 bw(e,t){return xe(`/projects/${encodeURIComponent(e)}/locations`,{method:"POST",body:JSON.stringify(t)})}async function xw(e,t){await xe(`/projects/${encodeURIComponent(e)}/locations/${encodeURIComponent(t)}`,{method:"DELETE"})}function Sw(e,t){return xe(`/projects/${encodeURIComponent(e)}/locations/default`,{method:"PUT",body:JSON.stringify({label:t})})}async function jw(e){await xe(`/projects/${encodeURIComponent(e)}`,{method:"DELETE",body:"{}"})}function ww(e){return xe(`/projects/${encodeURIComponent(e)}/export`)}function Gu(){return xe("/settings")}function Nw(e,t){return xe(`/settings/providers/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}function Cw(e){return xe("/settings/google",{method:"PUT",body:JSON.stringify(e)})}async function kw(e){try{return await xe(`/projects/${encodeURIComponent(e)}/schedule`)}catch(t){if(t instanceof Error&&t.message.includes("404"))return null;throw t}}function Cm(e,t){return xe(`/projects/${encodeURIComponent(e)}/schedule`,{method:"PUT",body:JSON.stringify(t)})}async function _w(e){await xe(`/projects/${encodeURIComponent(e)}/schedule`,{method:"DELETE",body:"{}"})}function zw(e){return xe(`/projects/${encodeURIComponent(e)}/notifications`)}function Ew(e,t){return xe(`/projects/${encodeURIComponent(e)}/notifications`,{method:"POST",body:JSON.stringify(t)})}async function Aw(e,t){await xe(`/projects/${encodeURIComponent(e)}/notifications/${encodeURIComponent(t)}`,{method:"DELETE",body:"{}"})}function Rw(e,t){return xe(`/projects/${encodeURIComponent(e)}/notifications/${encodeURIComponent(t)}/test`,{method:"POST",body:"{}"})}function Tw(e,t,s){return xe(`/projects/${encodeURIComponent(e)}/keywords/generate`,{method:"POST",body:JSON.stringify({provider:t,count:s})})}function Ow(e){return xe("/apply",{method:"POST",body:JSON.stringify(e)})}function j5(e){return xe("/runs",{method:"POST",body:JSON.stringify(e??{})})}function kp(e){return xe(`/projects/${encodeURIComponent(e)}/google/connections`)}function Dw(e,t){return xe(`/projects/${encodeURIComponent(e)}/google/connect`,{method:"POST",body:JSON.stringify({type:t})})}function Lw(e,t){return xe(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}`,{method:"DELETE",body:"{}"})}function Mw(e){return xe(`/projects/${encodeURIComponent(e)}/google/properties`)}function Uw(e,t,s){return xe(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}/property`,{method:"PUT",body:JSON.stringify({propertyId:s})})}function $w(e,t,s){return xe(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}/sitemap`,{method:"PUT",body:JSON.stringify({sitemapUrl:s})})}function Pw(e,t){return xe(`/projects/${encodeURIComponent(e)}/google/gsc/sync`,{method:"POST",body:JSON.stringify(t??{})})}function Iw(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 Bw(e,t){return xe(`/projects/${encodeURIComponent(e)}/google/gsc/inspect`,{method:"POST",body:JSON.stringify({url:t})})}function qw(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 Hw(e){return xe(`/projects/${encodeURIComponent(e)}/google/gsc/deindexed`)}function _p(e){return xe(`/projects/${encodeURIComponent(e)}/google/gsc/coverage`)}function Zw(e,t){const s=new URLSearchParams,a=s.toString()?`?${s.toString()}`:"";return xe(`/projects/${encodeURIComponent(e)}/google/gsc/coverage/history${a}`)}function Fw(e,t){return xe(`/projects/${encodeURIComponent(e)}/google/gsc/inspect-sitemap`,{method:"POST",body:JSON.stringify(t??{})})}function Gw(e){return xe(`/projects/${encodeURIComponent(e)}/google/gsc/sitemaps`)}function Kw(e){return xe(`/projects/${encodeURIComponent(e)}/google/gsc/discover-sitemaps`,{method:"POST",body:"{}"})}function km(){return xe("/cdp/status")}function Vw(e,t){return xe("/settings/cdp",{method:"PUT",body:JSON.stringify({host:e,port:t})})}function _m(e,t){return xe(`/projects/${encodeURIComponent(e)}/google/indexing/request`,{method:"POST",body:JSON.stringify(t)})}function zp(e){return xe(`/projects/${encodeURIComponent(e)}/bing/status`)}function Qw(e,t){return xe(`/projects/${encodeURIComponent(e)}/bing/connect`,{method:"POST",body:JSON.stringify({apiKey:t})})}function Yw(e){return xe(`/projects/${encodeURIComponent(e)}/bing/disconnect`,{method:"DELETE",body:"{}"})}function Jw(e){return xe(`/projects/${encodeURIComponent(e)}/bing/sites`)}function Xw(e,t){return xe(`/projects/${encodeURIComponent(e)}/bing/set-site`,{method:"POST",body:JSON.stringify({siteUrl:t})})}function Ep(e){return xe(`/projects/${encodeURIComponent(e)}/bing/coverage`)}function Ww(e,t){const s=new URLSearchParams,a=s.toString()?`?${s.toString()}`:"";return xe(`/projects/${encodeURIComponent(e)}/bing/inspections${a}`)}function eN(e,t){return xe(`/projects/${encodeURIComponent(e)}/bing/inspect-url`,{method:"POST",body:JSON.stringify({url:t})})}function zm(e,t){return xe(`/projects/${encodeURIComponent(e)}/bing/request-indexing`,{method:"POST",body:JSON.stringify(t)})}function tN(e){return xe(`/projects/${encodeURIComponent(e)}/bing/performance`)}function nN(e){return xe("/settings/bing",{method:"PUT",body:JSON.stringify({apiKey:e})})}function sN(e,t){const s=t?`?window=${t}`:"";return xe(`/projects/${encodeURIComponent(e)}/analytics/metrics${s}`)}function iN(e,t){const s=t?`?window=${t}`:"";return xe(`/projects/${encodeURIComponent(e)}/analytics/gaps${s}`)}function aN(e,t){const s=t?`?window=${t}`:"";return xe(`/projects/${encodeURIComponent(e)}/analytics/sources${s}`)}async function rN(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 w5=Object.freeze(Object.defineProperty({__proto__:null,ApiError:fw,addLocation:bw,addNotification:Ew,appendKeywords:yw,applyProjectConfig:Ow,bingConnect:Qw,bingDisconnect:Yw,bingRequestIndexing:zm,bingSetSite:Xw,configureCdp:Vw,createProject:ll,deleteProject:jw,fetchAllRuns:mw,fetchAnalyticsGaps:iN,fetchAnalyticsMetrics:sN,fetchAnalyticsSources:aN,fetchBingCoverage:Ep,fetchBingInspections:Ww,fetchBingPerformance:tN,fetchBingSites:Jw,fetchBingStatus:zp,fetchCdpStatus:km,fetchCompetitors:jp,fetchExport:ww,fetchGoogleConnections:kp,fetchGoogleProperties:Mw,fetchGscCoverage:_p,fetchGscCoverageHistory:Zw,fetchGscDeindexed:Hw,fetchGscInspections:qw,fetchGscPerformance:Iw,fetchGscSitemaps:Gw,fetchKeywords:pw,fetchProject:Sp,fetchProjects:hw,fetchRunDetail:sl,fetchSchedule:kw,fetchServiceStatus:rN,fetchSettings:Gu,fetchTimeline:wp,generateKeywords:Tw,googleConnect:Dw,googleDisconnect:Lw,inspectBingUrl:eN,inspectGscUrl:Bw,listNotifications:zw,removeLocation:xw,removeNotification:Aw,removeSchedule:_w,requestIndexing:_m,saveGoogleProperty:Uw,saveSchedule:Cm,saveSitemapUrl:$w,sendTestNotification:Rw,setCompetitors:Np,setDefaultLocation:Sw,setKeywords:gw,triggerAllRuns:j5,triggerDiscoverSitemaps:Kw,triggerGscSync:Pw,triggerInspectSitemap:Fw,triggerRun:Cp,updateBingApiKey:nN,updateGoogleAuthConfig:Cw,updateOwnedDomains:Nm,updateProject:vw,updateProviderConfig:Nw},Symbol.toStringTag,{value:"Module"}));function N5({evidence:e,project:t,onClose:s}){const[a,r]=N.useState(!1),[c,d]=N.useState(-1),[f,p]=N.useState(null),[m,v]=N.useState(!1),[y,b]=N.useState({}),x=i5(t.project),w=new Set(x.map(Sm)),S=e.runHistory,C=S.length>1,k=c>=0&&f!==null,E=k?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},A=E.citationState==="cited"||E.citationState==="emerging",M=E.citedDomains.findIndex(O=>w.has(O.toLowerCase().replace(/^www\./,"")))+1,U=E.citedDomains.length,R=t.project.displayName||t.project.name,T=[...x.map(Sm),R,R.split(" ").slice(0,2).join(" ")].filter(O=>O.trim().length>2),q=A?"cited":E.citationState==="lost"?"lost":E.citationState==="pending"?"pending":"not-cited",W=N.useRef(0),Q=N.useCallback(async O=>{const ae=++W.current;if(O===-1||O===S.length-1){d(-1),p(null),r(!1);return}d(O),r(!1);const pe=S[O],te=`${pe.runId}::${e.keyword}::${e.provider}`;if(y[te]){p(y[te]);return}v(!0);try{const D=await sl(pe.runId);if(ae!==W.current)return;const G=D.snapshots.find(oe=>oe.keyword===e.keyword&&oe.provider===e.provider)??D.snapshots.find(oe=>oe.keyword===e.keyword),se=G?{citationState:G.citationState,provider:G.provider,model:G.model??null,answerSnippet:G.answerText??"",citedDomains:G.citedDomains,competitorDomains:G.competitorOverlap,groundingSources:G.groundingSources,evidenceUrls:[],changeLabel:pe.citationState,summary:""}:{citationState:pe.citationState,provider:e.provider,model:pe.model??null,answerSnippet:"",citedDomains:[],competitorDomains:[],groundingSources:[],evidenceUrls:[],changeLabel:pe.citationState,summary:"Snapshot data not available for this run."};b(oe=>({...oe,[te]:se})),p(se)}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&&v(!1)}},[S,e.keyword,e.provider,y]),me=(k||e.historyScope!=="provider")&&E.model?`${E.provider} (${E.model}) · ${E.changeLabel.toLowerCase()}`:`${E.provider} · ${E.changeLabel.toLowerCase()}`,ke=!k&&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=A&&M>0?{label:"Citation confirmed",title:`Cited #${M} of ${U} domain${U!==1?"s":""}`,meta:me}:A?{label:"Citation confirmed",title:"Cited in this answer",meta:me}:E.citationState==="lost"?{label:"Citation lost",title:U>0?`${U} domain${U!==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:U>0?`${U} domain${U!==1?"s":""} cited instead`:"No domains cited for this query",meta:me},B=()=>{if(!E.answerSnippet)return null;const O=E.answerSnippet.split(`
95
- `),ae=[];let pe=[],te=0;const D=()=>{if(pe.length===0)return;const G=pe.join(" ").trim();G&&ae.push(l.jsx("p",{className:ae.length>0?"mt-2.5":"",children:Sx(G,T)},te++)),pe=[]};for(const G of O){const se=G.trim();if(/^[-\u2013\u2014]{3,}$/.test(se)){D(),ae.push(l.jsx("hr",{className:"border-zinc-800/60 my-3"},te++));continue}const oe=se.match(/^(#{1,3})\s+(.+)$/);if(oe){D();const ce=oe[1].length,he=oe[2].replace(/^[\p{Emoji}\p{Emoji_Component}\s#]+/u,"").trim()||oe[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:Sx(he,T)},te++));continue}if(se===""){D();continue}pe.push(se)}return D(),ae};return l.jsx(kj,{open:!0,onOpenChange:O=>{O||s()},children:l.jsxs(_j,{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(Ej,{className:"inline-flex size-8 items-center justify-center rounded-md text-zinc-500 transition hover:bg-zinc-800 hover:text-zinc-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-zinc-400 shrink-0",children:[l.jsx(Mu,{className:"size-4"}),l.jsx("span",{className:"sr-only",children:"Close"})]})]}),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((O,ae)=>{const pe=c===-1&&ae===S.length-1||c===ae,te=O.citationState==="cited"?"bg-emerald-400":O.citationState==="emerging"?"bg-amber-400":O.citationState==="lost"?"bg-rose-400":"bg-zinc-600",G=new Date(O.createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"}),se=!!(O.model&&ae>0&&S[ae-1]?.model&&S[ae-1].model!==O.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}: ${O.citationState}`,O.model?`model ${O.model}`:null,se?"model changed":null].filter(Boolean).join(" — "),"aria-pressed":pe,children:[l.jsx("span",{className:`size-2 rounded-full ${te} ${se?"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"})]}),!k&&(e.modelTransitions?.length??0)>0&&l.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:e.modelTransitions.map(O=>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:`${O.fromModel??"unknown"} -> ${O.toModel??"unknown"} on ${new Date(O.createdAt).toLocaleDateString()}`},`${O.runId}:${O.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--${q}`,children:[l.jsx("p",{className:`evidence-position-label evidence-position-label--${q}`,children:je.label}),l.jsx("p",{className:`evidence-position-title evidence-position-title--${q}`,children:je.title}),l.jsx("p",{className:"evidence-position-meta",children:je.meta}),ke&&l.jsx("p",{className:"mt-1 text-[11px] text-zinc-500",children:ke})]}),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"}),!k&&e.relatedTechnicalSignals.length>0&&l.jsxs("div",{children:[l.jsx("p",{className:"drawer-section-label",children:A?"Why you're cited":"What to fix"}),l.jsx("div",{className:"action-items-list",children:e.relatedTechnicalSignals.map((O,ae)=>l.jsxs("div",{className:"action-item",children:[l.jsx("svg",{className:`action-item-icon ${A?"text-emerald-400":"text-amber-400"}`,viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:A?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:O})]},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((O,ae)=>{const pe=O.toLowerCase().replace(/^www\./,""),te=w.has(pe),D=!te&&E.competitorDomains.some(se=>se.toLowerCase().replace(/^www\./,"")===pe),G=te?"you":D?"competitor":"other";return l.jsxs("div",{className:`citation-leaderboard-item citation-leaderboard-item--${G}`,children:[l.jsxs("span",{className:"citation-leaderboard-rank",children:["#",ae+1]}),l.jsx("span",{className:"citation-leaderboard-domain",children:O}),te&&l.jsx("span",{className:"citation-leaderboard-tag",children:"You"}),D&&l.jsx("span",{className:"citation-leaderboard-tag",children:"Competitor"})]},O)}),!A&&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((O,ae)=>l.jsx("li",{className:"truncate text-sm",children:l.jsx("a",{href:O.uri,target:"_blank",rel:"noreferrer",className:"text-zinc-400 hover:text-zinc-200 transition-colors",children:O.title||O.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(O=>l.jsx("li",{className:"truncate text-sm",children:l.jsx("a",{href:O,target:"_blank",rel:"noreferrer",className:"text-zinc-400 hover:text-zinc-200 transition-colors",children:O})},O))})]}),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 ",k?"for this run":"yet"]})]})]})]})]})]})})}function ns(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 Zh=[{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 Ku(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 C5=Ku({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"}),k5=Ku({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"}),_5=Ku({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"}),z5=Ku({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"}),E5=[{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:ns(["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:ns(["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:ns(["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:ns(["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:ns(["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:ns(["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:ns(["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:ns(["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:ns(["not-cited","not-cited","not-cited","not-cited","not-cited","cited"])}];Zh[0],Zh[1],ns(["cited","cited","cited","cited","cited"]),Zh[2],ns(["not-cited","not-cited","not-cited","cited"]);function A5(e,t){return e.projects.find(s=>s.project.id===t)}function R5(e,t){return e.runs.find(s=>s.id===t)}function T5(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 oN(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 jx(e){try{return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}catch{return e}}function O5(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 lN(e){return e==="answer-visibility"?"Answer visibility sweep":e}function D5(e){return e==="manual"?"Manual":e==="scheduled"?"Scheduled":e==="config-apply"?"Config apply":e}function Ap(e,t){return{id:e.id,projectId:e.projectId,projectName:t,kind:e.kind,kindLabel:lN(e.kind),status:e.status,trigger:e.trigger??"manual",location:e.location??null,createdAt:e.createdAt,startedAt:e.startedAt?jx(e.startedAt):jx(e.createdAt),duration:O5(e.startedAt,e.finishedAt),statusDetail:e.error?cN(e.error):L5(e),summary:M5(e),triggerLabel:D5(e.trigger)}}function cN(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 L5(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?cN(e.error):"Run failed.";default:return""}}function M5(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 uN(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 U5(e){return e>=70?"positive":e>=40?"caution":"negative"}function $5(e){return e==="High"?"negative":e==="Moderate"?"caution":"neutral"}function dN(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 P5(e,t,s,a){const r=[];let c=0;const d=new Set;if(s){const f=new Map;for(const m of s.snapshots)if(m.keyword){const v=`${m.keyword}::${m.provider}`;f.set(v,m)}const p=[...new Set(s.snapshots.map(m=>m.provider))].sort();p.length===0&&p.push("gemini");for(const m of t){if(m.runs.length===0)continue;d.add(m.keyword);const y=m.runs.at(-1)?.transition??"not-cited",b=y==="lost"?"lost":y==="emerging"?"emerging":y==="cited"?"cited":"not-cited";for(const x of p){const w=f.get(`${m.keyword}::${x}`);if(!w&&p.length>1)continue;const S=w?.model??null,C=S?`${x}:${S}`:null,k=C?m.modelRuns?.[C]:void 0,E=m.providerRuns?.[x],A=(E?.length?E:null)??(k?.length?k:null),z=E?.length?"provider":k?.length?"model":"keyword",M=A?A.at(-1).transition:y,U=M==="lost"?"lost":M==="emerging"?"emerging":w?w.citationState==="cited"?"cited":"not-cited":b,R=Em(A||m.runs),T=I5(m,x),q=(A??m.runs).map(me=>({runId:me.runId,citationState:me.citationState,createdAt:me.createdAt,model:T.get(me.runId)??null})),W=B5(q),Q=z==="provider"&&W.length<=1?"model":z,ne=q5(q);r.push({id:`evidence_${e}_${c++}`,keyword:m.keyword,provider:w?.provider??x,model:w?.model??null,location:w?.location??null,citationState:U,changeLabel:H5(M,R),answerSnippet:w?.answerText??"",citedDomains:w?.citedDomains??[],evidenceUrls:[],competitorDomains:w?.competitorOverlap??[],relatedTechnicalSignals:[],groundingSources:w?.groundingSources??[],summary:Z5(U,m.keyword),runHistory:q,historyScope:Q,modelsSeen:W,modelTransitions:ne})}}}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 I5(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 B5(e){const t=new Set;for(const s of e)s.model&&t.add(s.model);return[...t]}function q5(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 Em(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 H5(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 Z5(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 Fh=3;function F5(e){const{evidence:t,timeline:s,latestSnapshots:a,previousSnapshots:r,trackedCompetitors:c}=e,d=[],f=[],p=new Set;for(const k of t)k.citationState==="lost"&&(p.has(k.keyword)||(p.add(k.keyword),f.push({keyword:k.keyword,evidenceId:k.id,provider:k.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),v=wx(r,c);for(const k of c){const E=m.get(k)??new Set,A=v.get(k)??new Set,z=[...E].filter(M=>!A.has(M));z.length>0&&d.push({id:`insight_comp_gained_${k}`,tone:"negative",title:`${k} appeared on ${z.length} keyword${z.length>1?"s":""}`,detail:"A tracked competitor gained new citations.",actionLabel:"Competitor",affectedPhrases:z.map(M=>{const U=t.find(R=>R.keyword===M);return{keyword:M,evidenceId:U?.id??"",citationState:"cited"}})})}const y=new Map;for(const k of s){const E=k.runs.at(-1);E&&y.set(k.keyword,{transition:E.transition,citationState:E.citationState})}const b=[],x=[],w=new Set;for(const[k,{transition:E,citationState:A}]of y){if(!(E==="emerging"||E==="new"&&A==="cited"))continue;w.add(k);const M=t.find(U=>U.keyword===k&&(U.citationState==="emerging"||U.citationState==="cited"));b.push({keyword:k,evidenceId:M?.id??"",provider:M?.provider,citationState:"emerging"})}for(const k of t)k.citationState==="emerging"&&(w.has(k.keyword)||x.push({keyword:k.keyword,evidenceId:k.id,provider:k.provider,citationState:"emerging"}));if(x.length>0){const k=new Set(x.map(E=>E.keyword)).size;d.push({id:"insight_provider_pickup",tone:"positive",title:`Picked up by new provider on ${k} keyword${k>1?"s":""}`,detail:"Your domain started appearing on additional providers.",actionLabel:"Pickup",affectedPhrases:x})}b.length>0&&d.push({id:"insight_first_citation",tone:"positive",title:`First citation on ${w.size} keyword${w.size>1?"s":""}`,detail:"Your domain appeared in AI answers for the first time.",actionLabel:"New",affectedPhrases:b});const S=new Set(t.map(k=>k.keyword)),C=[];for(const k of s){if(!S.has(k.keyword)||k.runs.length<Fh||k.runs.at(-1)?.citationState!=="not-cited")continue;if(Em(k.runs)>=Fh){const z=t.find(M=>M.keyword===k.keyword);C.push({keyword:k.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 ${Fh}+ runs`,detail:"These keywords have not been cited by any provider across multiple consecutive runs.",actionLabel:"Gap",affectedPhrases:C});for(const k of c){const E=m.get(k)??new Set,z=[...v.get(k)??new Set].filter(M=>!E.has(M));z.length>0&&d.push({id:`insight_comp_lost_${k}`,tone:"neutral",title:`${k} dropped from ${z.length} keyword${z.length>1?"s":""}`,detail:"A tracked competitor lost citations.",actionLabel:"Competitor",affectedPhrases:z.map(M=>{const U=t.find(R=>R.keyword===M);return{keyword:M,evidenceId:U?.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 G5(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: ${lN(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 K5(e){const t=oN(e.project),s=P5(t.name,e.timeline,e.latestRunDetail,e.keywords),a=e.latestRunDetail?.snapshots??[],r=uN(a),c=dN(a,e.competitors.map(y=>y.domain)),d=F5({evidence:s,timeline:e.timeline,latestSnapshots:e.latestRunDetail?.snapshots??[],previousSnapshots:e.previousRunDetail?.snapshots??[],trackedCompetitors:e.competitors.map(y=>y.domain)}),f=[...e.runs].sort((y,b)=>b.createdAt.localeCompare(y.createdAt)),p=f.map(y=>Ap(y,e.project.displayName||e.project.name)),m=new Map;for(const y of a){const b=y.provider||"gemini",x=y.model??null,w=`${b}::${x??"unknown"}`,S=m.get(w)??{provider:b,model:x,cited:0,total:0};S.total++,y.citationState==="cited"&&S.cited++,m.set(w,S)}const v=[...m.values()].sort((y,b)=>y.provider.localeCompare(b.provider)||(y.model??"").localeCompare(b.model??"")).map(({provider:y,model:b,cited:x,total:w})=>({provider:y,model:b,score:w>0?Math.round(x/w*100):0,cited:x,total:w}));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?U5(r.score):"neutral",description:a.length>0?`${r.citedCount} of ${r.totalCount} tracked key phrases found your domain in at least one AI answer engine.`:"No visibility data yet. Trigger a run to start tracking.",tooltip:'Percentage of tracked key phrases where your domain is cited by at least one AI answer engine. A key phrase is "visible" if any configured provider includes your site in its response.',trend:[]},providerScores:v,competitorPressure:{label:"Competitor Pressure",value:c.label,delta:c.count>0?`${c.count} overlapping citations`:"No overlap detected",tone:$5(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:G5(f),insights:d,visibilityEvidence:s,competitors:e.competitors.map((y,b)=>{const x=new Set;for(const E of a)(E.competitorOverlap.includes(y.domain)||E.citedDomains.includes(y.domain))&&E.keyword&&x.add(E.keyword);const w=[...x],S=new Set(a.map(E=>E.keyword).filter(Boolean)),C=S.size>0?w.length/S.size:0,k=C>=.5?"High":C>=.2?"Moderate":w.length>0?"Low":"None";return{id:y.id||`comp_${b}`,domain:y.domain,citationCount:w.length,totalKeywords:S.size,pressureLabel:k,citedKeywords:w,movement:"",notes:""}}),recentRuns:p.slice(0,5)}}function V5(e){const t=oN(e.project),s=e.latestRunDetail?.snapshots??[],a=uN(s),r=dN(s,e.competitors.map(p=>p.domain)),d=[...e.runs].sort((p,m)=>m.createdAt.localeCompare(p.createdAt))[0],f=d?Ap(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 Q5(e,t){const s=[],a=[],r=[];for(const d of e){a.push(K5(d)),r.push(V5(d));const f=[...d.runs].sort((p,m)=>m.createdAt.localeCompare(p.createdAt));for(const p of f)s.push(Ap(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?Y5(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 Y5(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 Ri={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"]},fN=N.createContext(null);fN.Provider;function cl(){return N.useContext(fN)}function Ea(e){const s=cl()?.dashboard??null,a=qo({queryKey:Ri.projects.all,queryFn:hw,enabled:!s}),r=qo({queryKey:Ri.runs.all,queryFn:mw,enabled:!s,refetchInterval:w=>w.state.data?.some(k=>k.status==="running"||k.status==="queued")?3e3:!1}),c=qo({queryKey:Ri.settings,queryFn:()=>Gu().catch(()=>null),enabled:!s}),d=a.data??[],f=r.data??[],p=Fk({queries:d.map(w=>{const S=f.filter(k=>k.projectId===w.id),C=S.filter(k=>(k.status==="completed"||k.status==="partial")&&k.kind==="answer-visibility").sort((k,E)=>E.createdAt.localeCompare(k.createdAt));return{queryKey:Ri.projects.detail(w.id),queryFn:async()=>{const[k,E,A,z,M]=await Promise.all([pw(w.name).catch(()=>[]),jp(w.name).catch(()=>[]),wp(w.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:w,runs:S,keywords:k,competitors:E,timeline:A,latestRunDetail:z,previousRunDetail:M}},enabled:!s&&a.isSuccess&&r.isSuccess}})}),m=p.every(w=>w.isSuccess),v=N.useMemo(()=>{if(s)return s;if(!a.data||!r.data||d.length>0&&!m)return null;const w=p.map(S=>S.data).filter(S=>S!=null);return Q5(w,c.data??null)},[s,a.data,r.data,c.data,m,p,d.length]),y=!s&&(a.isError||r.isError),b=!s&&!v&&!y,x=N.useCallback(async()=>{await Promise.all([a.refetch(),r.refetch(),c.refetch()])},[a.refetch,r.refetch,c.refetch]);return{dashboard:v,isLoading:b,isError:y,refetch:x}}function J5(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath:"/"}const Nx=J5(),Am=Nx==="/"?"":Nx.replace(/\/$/,"");async function X5(){const e=Am?`${Am}/health`:"/health",t=await rN(e,"API"),s=t.state==="ok"?{label:"Runner",state:"ok",detail:"In-process job runner"}:{label:"Runner",state:t.state,detail:"Depends on API"};return{apiStatus:t,workerStatus:s}}function Vu(e,t){return qo({queryKey:Ri.health,queryFn:X5,enabled:e,refetchInterval:15e3,initialData:t})}function W5(e){return qo({queryKey:Ri.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=Ca(),t=Du({strict:!1}),s=Sn({select:p=>p.location.pathname}),a=t.runId??null,r=t.evidenceId??null;return{runId:a,evidenceId:r,openRun:p=>e({to:s,from:is.to,search:m=>({...m,runId:p,evidenceId:void 0})}),openEvidence:p=>e({to:s,from:is.to,search:m=>({...m,evidenceId:p,runId:void 0})}),closeDrawer:()=>e({to:s,from:is.to,search:p=>({...p,runId:void 0,evidenceId:void 0})})}}const Cx=[{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"}],kx=e=>({label:e,state:"checking",detail:"Checking service health"}),eM={apiStatus:kx("API"),workerStatus:kx("Worker")};function tM(){const e=cl(),{dashboard:t,isLoading:s,refetch:a}=Ea(),d=Vu(!e,e?.health).data??e?.health??eM,f=Vz(),{runId:p,evidenceId:m,closeDrawer:v}=ul(),[y,b]=N.useState(!1),x=W5(p),w=x.data??null,S=x.isLoading;N.useEffect(()=>{w&&w.status!=="running"&&w.status!=="queued"&&a()},[w?.status,a]),N.useEffect(()=>{b(!1)},[f.pathname]),N.useEffect(()=>{if(typeof window>"u"||!p&&!m)return;const z=M=>{M.key==="Escape"&&v()};return window.addEventListener("keydown",z),()=>{window.removeEventListener("keydown",z)}},[p,m,v]);const C=t??e?.dashboard??null,k=p&&C?R5(C,p):void 0,E=m&&C?T5(C,m):void 0,A=(()=>{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 U=z.split("/").filter(Boolean)[1];if(U&&C){const R=C.projects.find(T=>T.project.id===U);if(R)return R.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(Ib,{})}),l.jsxs("nav",{className:"sidebar-nav",children:[l.jsxs(yt,{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(yt,{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(yt,{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(yt,{to:"/settings",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[l.jsx(w2,{className:"sidebar-icon"}),l.jsx("span",{children:"Settings"})]}),s?l.jsxs(l.Fragment,{children:[l.jsx("p",{className:"sidebar-section-title",children:"Projects"}),[1,2,3].map(z=>l.jsxs("div",{className:"sidebar-skeleton-item",children:[l.jsx("span",{className:"skeleton-circle size-2"}),l.jsx("span",{className:"skeleton-text flex-1",style:{width:`${50+z*15}%`}})]},z))]}):C&&C.projects.length>0?l.jsxs(l.Fragment,{children:[l.jsx("p",{className:"sidebar-section-title",children:"Projects"}),C.projects.map(z=>{const M=z.visibilitySummary.tone;return l.jsxs(yt,{to:"/projects/$projectId",params:{projectId:z.project.id},className:"sidebar-project",activeProps:{className:"sidebar-project sidebar-project-active"},children:[l.jsx("span",{className:`sidebar-dot sidebar-dot-${M}`}),l.jsx("span",{children:z.project.name})]},z.project.id)})]}):s?null:l.jsxs(l.Fragment,{children:[l.jsx("p",{className:"sidebar-section-title",children:"Resources"}),l.jsxs(yt,{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"})]})]})]}),l.jsx("div",{className:"sidebar-footer",children:Cx.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(Ib,{compact:!0})}),l.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[l.jsx(yt,{to:"/",children:"Home"}),l.jsx(Lu,{className:"breadcrumb-sep size-3"}),l.jsx("span",{className:"breadcrumb-current",children:A})]})]}),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:()=>b(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:()=>b(!1),children:[l.jsx(Mu,{className:"size-5"}),l.jsx("span",{className:"sr-only",children:"Close navigation"})]}),l.jsx(yt,{to:"/",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Overview"}),l.jsx(yt,{to:"/projects",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!1},children:"Projects"}),l.jsx(yt,{to:"/runs",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Runs"}),l.jsx(yt,{to:"/settings",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Settings"}),C&&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(yt,{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.jsxs("div",{className:"page-skeleton",children:[l.jsxs("div",{className:"page-skeleton-header",children:[l.jsx("div",{className:"skeleton-text h-6 w-40"}),l.jsx("div",{className:"skeleton-text-sm w-72"})]}),l.jsx("div",{className:"page-skeleton-grid",children:[1,2,3].map(z=>l.jsxs("div",{className:"page-skeleton-card",children:[l.jsx("div",{className:"skeleton-text w-24"}),l.jsx("div",{className:"skeleton-text w-full"}),l.jsx("div",{className:"skeleton-text-sm w-3/4"})]},z))}),l.jsx("div",{className:"page-skeleton-grid",style:{gridTemplateColumns:"1fr 1fr"},children:[1,2].map(z=>l.jsxs("div",{className:"page-skeleton-card",children:[l.jsx("div",{className:"skeleton-text w-20"}),l.jsx("div",{className:"space-y-2",children:[1,2,3].map(M=>l.jsx("div",{className:"skeleton-text-sm w-full"},M))})]},z))})]}):l.jsx(sp,{})}),l.jsxs("footer",{className:"footer",children:[l.jsxs("a",{href:"https://github.com/AINYC/canonry",target:"_blank",rel:"noreferrer",className:"footer-brand",children:[l.jsx(l2,{className:"size-3.5"}),l.jsx("span",{children:"Canonry"})]}),l.jsx("div",{className:"footer-links",children:Cx.map(z=>l.jsx("a",{href:z.href,target:"_blank",rel:"noreferrer",children:z.label},z.href))})]})]}),k?l.jsxs(bR,{open:k!==void 0,title:k.summary,subtitle:`${k.projectName} · ${k.kindLabel}`,onClose:v,children:[l.jsxs("div",{className:"flex flex-wrap items-center gap-x-5 gap-y-1 text-sm",children:[l.jsx($u,{status:k.status}),l.jsx("span",{className:"text-zinc-400",children:k.startedAt}),l.jsx("span",{className:"text-zinc-500",children:k.duration}),l.jsx("span",{className:"text-zinc-600",children:k.triggerLabel})]}),k.status==="failed"&&k.statusDetail&&l.jsx("p",{className:"text-sm text-rose-300/80 mt-2",children:k.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..."}):w&&w.snapshots.length>0?l.jsxs("div",{className:"space-y-2",children:[w.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(KS,{variant:z.citationState==="cited"?"success":"neutral",children:z.citationState})]})]}),z.model&&l.jsx("p",{className:"text-[11px] text-zinc-500 font-mono",children:z.model}),z.citedDomains.length>0&&l.jsxs("p",{className:"text-xs text-zinc-500 mt-1",children:[l.jsx("span",{className:"text-zinc-400",children:"Sources:"})," ",z.citedDomains.join(", ")]}),z.competitorOverlap.length>0&&l.jsxs("p",{className:"text-xs text-rose-400/80 mt-0.5",children:["Competitor cited: ",z.competitorOverlap.join(", ")]}),z.groundingSources&&z.groundingSources.length>0&&l.jsxs("details",{className:"mt-2",children:[l.jsxs("summary",{className:"text-xs text-zinc-500 cursor-pointer hover:text-zinc-400",children:[z.groundingSources.length," grounding source",z.groundingSources.length!==1?"s":""]}),l.jsx("ul",{className:"mt-1 space-y-0.5",children:z.groundingSources.map((M,U)=>l.jsx("li",{className:"text-xs text-zinc-500 truncate",children:l.jsx("a",{href:M.uri,target:"_blank",rel:"noreferrer",className:"hover:text-zinc-300",children:M.title||M.uri})},U))})]}),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)),w.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..."]})]}):w&&w.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..."]}):w&&w.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..."]}):w&&w.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(w.error)})]}):l.jsx("p",{className:"text-sm text-zinc-500",children:"No snapshot data available."})]})]}):null,E?l.jsx(N5,{evidence:E.evidence,project:E.project,onClose:v}):null]})}class nM 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(_2,{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 Le=N.forwardRef(({className:e,...t},s)=>l.jsx("div",{ref:s,className:Vn("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}));Le.displayName="Card";const sM=N.forwardRef(({className:e,...t},s)=>l.jsx("div",{ref:s,className:Vn("flex flex-col gap-1.5 p-5",e),...t}));sM.displayName="CardHeader";const iM=N.forwardRef(({className:e,...t},s)=>l.jsx("h3",{ref:s,className:Vn("font-medium tracking-tight text-zinc-50",e),...t}));iM.displayName="CardTitle";const aM=N.forwardRef(({className:e,...t},s)=>l.jsx("p",{ref:s,className:Vn("text-sm text-zinc-500",e),...t}));aM.displayName="CardDescription";const rM=N.forwardRef(({className:e,...t},s)=>l.jsx("div",{ref:s,className:Vn("p-5 pt-0",e),...t}));rM.displayName="CardContent";function oM({points:e,tone:t}){const s=N.useId();if(e.length===0)return null;const a=42,r=132,c=5,d=Math.min(...e),p=Math.max(...e)-d||1,m=r-c*2,v=a-c*2,y=e.map((b,x)=>{const w=c+x/Math.max(e.length-1,1)*m,S=c+(1-(b-d)/p)*v;return`${w},${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:v,rx:"8"})})}),l.jsx("line",{className:"sparkline-guide",x1:c,x2:r-c,y1:a-c,y2:a-c}),l.jsx("polyline",{clipPath:`url(#${s})`,points:y,vectorEffect:"non-scaling-stroke"})]})}function lM(e){return e.displayName??e.name.charAt(0).toUpperCase()+e.name.slice(1)}function cM(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=>lM(p)).join(" · ");return{...a,label:"Providers",tone:d?"positive":"caution",detail:`${r} of ${c} configured`,meta:f||"None configured"}})}function uM(e,t){if(e.apiStatus.state!=="ok")return"Launch is blocked until the API responds cleanly.";if(e.apiStatus.databaseConfigured===!1)return"Launch is blocked until the API has a database connection configured.";if(e.workerStatus.state!=="ok")return"Launch is blocked until the worker is healthy and heartbeats are current.";if(!t.providerStatuses.some(s=>s.state==="ready"))return"Launch is blocked until at least one provider is configured."}function dM(e,t,s){const a=uM(t,s),r=structuredClone(e);return r.healthChecks=r.healthChecks.map(c=>{if(c.id==="api")return{...c,detail:t.apiStatus.detail,state:t.apiStatus.state==="ok"?"ready":"attention"};if(c.id==="worker")return{...c,detail:t.workerStatus.detail,state:t.workerStatus.state==="ok"?"ready":"attention"};const d=s.providerStatuses.some(f=>f.state==="ready");return{...c,detail:d?"At least one provider configured.":"No providers configured.",state:d?"ready":"attention"}}),r.launchState.enabled=a===void 0,r.launchState.blockedReason=a,r.launchState.summary=a??"Queue a visibility sweep first, then follow with a site audit to explain movement.",r}function fM({project:e}){return l.jsxs(yt,{to:"/projects/$projectId",params:{projectId:e.project.id},className:"project-row cursor-pointer",children:[l.jsxs("div",{className:"project-row-primary",children:[l.jsxs("div",{children:[l.jsx("p",{className:"project-name",children:e.project.name}),l.jsx("p",{className:"project-domain",children:e.project.canonicalDomain})]}),l.jsx("p",{className:"project-insight",children:e.insight})]}),l.jsx("div",{className:"project-row-stat",children:l.jsxs("div",{className:"metric-inline-block",children:[l.jsx("p",{className:"metric-inline-label",children:"Answer Visibility"}),l.jsx("p",{className:"metric-inline-value",children:e.visibilityScore}),l.jsx("p",{className:"metric-inline-delta",children:e.visibilityDelta})]})}),l.jsx("div",{className:"project-row-stat",children:l.jsxs("div",{className:"metric-inline-block",children:[l.jsx("p",{className:"metric-inline-label",children:"Competitor Pressure"}),l.jsx("p",{className:"metric-inline-value",children:e.competitorPressureLabel}),l.jsxs("p",{className:"metric-inline-delta",children:[e.lastRun.kindLabel," · ",Uu(e.lastRun.status)]})]})}),l.jsx("div",{className:"project-row-chart",children:l.jsx(oM,{points:e.trend,tone:VS(e.lastRun.status)})}),l.jsx("span",{className:"project-row-link",children:l.jsx(Lu,{className:"h-4 w-4 text-zinc-500"})})]})}function hM(){const e=cl(),{dashboard:t,isLoading:s}=Ea(),a=t??e?.dashboard;if(!a||s)return l.jsxs("div",{className:"page-skeleton",children:[l.jsxs("div",{className:"page-skeleton-header",children:[l.jsx("div",{className:"skeleton-text h-6 w-32"}),l.jsx("div",{className:"skeleton-text-sm w-64"})]}),l.jsx("div",{className:"space-y-3",children:[1,2,3].map(v=>l.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-4 flex items-center gap-4",children:[l.jsxs("div",{className:"flex-1 space-y-2",children:[l.jsx("div",{className:"skeleton-text w-36"}),l.jsx("div",{className:"skeleton-text-sm w-48"})]}),l.jsx("div",{className:"skeleton-text w-16"}),l.jsx("div",{className:"skeleton-text w-16"}),l.jsx("div",{className:"skeleton h-8 w-20 rounded"})]},v))})]});const r=a.portfolioOverview,f=Vu(!e,e?.health).data??e?.health??{apiStatus:{label:"API",state:"checking",detail:"Checking service health"},workerStatus:{label:"Worker",state:"checking",detail:"Checking service health"}},p=cM(r.systemHealth,f,a.settings),{openRun:m}=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:r.lastUpdatedAt})})]}),r.projects.length>0?l.jsx("div",{className:"project-list project-list-scrollable",children:r.projects.map(v=>l.jsx(fM,{project:v},v.project.id))}):l.jsxs(Le,{className:"surface-card empty-card",children:[l.jsx("h3",{children:r.emptyState?.title??"No projects yet"}),l.jsx("p",{className:"supporting-copy",children:r.emptyState?.detail}),l.jsx(le,{size:"sm",asChild:!0,children:l.jsx(yt,{to:r.emptyState?.ctaHref==="/setup"||!r.emptyState?.ctaHref?"/setup":"/",children:r.emptyState?.ctaLabel??"Launch setup"})})]}),l.jsxs("div",{className:"overview-secondary-grid",children:[r.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:r.attentionItems.map(v=>l.jsxs(yt,{to:v.href,className:`attention-item attention-item-${v.tone}`,children:[l.jsxs("div",{children:[l.jsx("p",{className:"attention-title",children:v.title}),l.jsx("p",{className:"attention-detail",children:v.detail})]}),l.jsx("span",{className:"attention-action",children:v.actionLabel})]},v.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:r.recentRuns.length>0?r.recentRuns.map(v=>l.jsxs("button",{className:"compact-run",type:"button",onClick:()=>m(v.id),children:[l.jsxs("div",{children:[l.jsx("p",{className:"compact-run-title",children:v.projectName}),l.jsx("p",{className:"compact-run-detail",children:v.summary})]}),l.jsx($u,{status:v.status})]},v.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:p.map(v=>l.jsxs(Le,{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:v.label}),l.jsx("h3",{children:v.detail})]}),l.jsx(tt,{tone:v.tone,children:v.label})]}),l.jsx("p",{className:"supporting-copy",children:v.meta})]},v.id))})]})]})}const Rp=Symbol.for("yaml.alias"),Rm=Symbol.for("yaml.document"),Mi=Symbol.for("yaml.map"),hN=Symbol.for("yaml.pair"),xs=Symbol.for("yaml.scalar"),$r=Symbol.for("yaml.seq"),Gn=Symbol.for("yaml.node.type"),Aa=e=>!!e&&typeof e=="object"&&e[Gn]===Rp,Qu=e=>!!e&&typeof e=="object"&&e[Gn]===Rm,dl=e=>!!e&&typeof e=="object"&&e[Gn]===Mi,Dt=e=>!!e&&typeof e=="object"&&e[Gn]===hN,dt=e=>!!e&&typeof e=="object"&&e[Gn]===xs,fl=e=>!!e&&typeof e=="object"&&e[Gn]===$r;function Tt(e){if(e&&typeof e=="object")switch(e[Gn]){case Mi:case $r:return!0}return!1}function Ot(e){if(e&&typeof e=="object")switch(e[Gn]){case Rp:case Mi:case xs:case $r:return!0}return!1}const mN=e=>(dt(e)||Tt(e))&&!!e.anchor,da=Symbol("break visit"),mM=Symbol("skip children"),Fo=Symbol("remove node");function Pr(e,t){const s=pM(t);Qu(e)?wr(null,e.contents,s,Object.freeze([e]))===Fo&&(e.contents=null):wr(null,e,s,Object.freeze([]))}Pr.BREAK=da;Pr.SKIP=mM;Pr.REMOVE=Fo;function wr(e,t,s,a){const r=gM(e,t,s,a);if(Ot(r)||Dt(r))return yM(e,a,r),wr(e,r,s,a);if(typeof r!="symbol"){if(Tt(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===da)return da;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===da)return da;c===Fo&&(t.key=null);const d=wr("value",t.value,s,a);if(d===da)return da;d===Fo&&(t.value=null)}}return r}function pM(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 gM(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(dt(t))return s.Scalar?.(e,t,a);if(Aa(t))return s.Alias?.(e,t,a)}function yM(e,t,s){const a=t[t.length-1];if(Tt(a))a.items[e]=s;else if(Dt(a))e==="key"?a.key=s:a.value=s;else if(Qu(a))a.contents=s;else{const r=Aa(a)?"alias":"scalar";throw new Error(`Cannot replace node with ${r} parent`)}}const vM={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},bM=e=>e.replace(/[!,[\]{}]/g,t=>vM[t]);class un{constructor(t,s){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},un.defaultYaml,t),this.tags=Object.assign({},un.defaultTags,s)}clone(){const t=new un(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new un(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:un.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},un.defaultTags);break}return t}add(t,s){this.atNextDocument&&(this.yaml={explicit:un.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},un.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+bM(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&&Ot(t.contents)){const c={};Pr(t.contents,(d,f)=>{Ot(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
- `)}}un.defaultYaml={explicit:!1,version:"1.2"};un.defaultTags={"!!":"tag:yaml.org,2002:"};function pN(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 gN(e){const t=new Set;return Pr(e,{Value(s,a){a.anchor&&t.add(a.anchor)}}),t}function yN(e,t){for(let s=1;;++s){const a=`${e}${s}`;if(!t.has(a))return a}}function xM(e,t){const s=[],a=new Map;let r=null;return{onAnchor:c=>{s.push(c),r??(r=gN(e));const d=yN(t,r);return r.add(d),d},setAnchors:()=>{for(const c of s){const d=a.get(c);if(typeof d=="object"&&d.anchor&&(dt(d.node)||Tt(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 Nr(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=Nr(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=Nr(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=Nr(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=Nr(e,a,r,c);d===void 0?delete a[r]:d!==c&&(a[r]=d)}return e.call(t,s,a)}function Fn(e,t,s){if(Array.isArray(e))return e.map((a,r)=>Fn(a,String(r),s));if(e&&typeof e.toJSON=="function"){if(!s||!mN(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 Tp{constructor(t){Object.defineProperty(this,Gn,{value:t})}clone(){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:s,maxAliasCount:a,onAnchor:r,reviver:c}={}){if(!Qu(t))throw new TypeError("A document argument is required");const d={anchors:new Map,doc:t,keep:!0,mapAsMap:s===!0,mapKeyWarned:!1,maxAliasCount:typeof a=="number"?a:100},f=Fn(this,"",d);if(typeof r=="function")for(const{count:p,res:m}of d.anchors.values())r(m,p);return typeof c=="function"?Nr(c,{"":f},"",f):f}}class Op extends Tp{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=[],Pr(t,{Node:(c,d)=>{(Aa(d)||mN(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||(Fn(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(pN(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(Aa(t)){const a=t.resolve(e),r=s&&a&&s.get(a);return r?r.count*r.aliasCount:0}else if(Tt(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 vN=e=>!e||typeof e!="function"&&typeof e!="object";class Ae extends Tp{constructor(t){super(xs),this.value=t}toJSON(t,s){return s?.keep?this.value:Fn(this.value,t,s)}toString(){return String(this.value)}}Ae.BLOCK_FOLDED="BLOCK_FOLDED";Ae.BLOCK_LITERAL="BLOCK_LITERAL";Ae.PLAIN="PLAIN";Ae.QUOTE_DOUBLE="QUOTE_DOUBLE";Ae.QUOTE_SINGLE="QUOTE_SINGLE";const SM="tag:yaml.org,2002:";function jM(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(Qu(e)&&(e=e.contents),Ot(e))return e;if(Dt(e)){const y=s.schema[Mi].createNode?.(s.schema,null,s);return y.items.push(e),y}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:a,onAnchor:r,onTagObj:c,schema:d,sourceObjects:f}=s;let p;if(a&&e&&typeof e=="object"){if(p=f.get(e),p)return p.anchor??(p.anchor=r(e)),new Op(p.anchor);p={anchor:null,node:null},f.set(e,p)}t?.startsWith("!!")&&(t=SM+t.slice(2));let m=jM(e,t,d.tags);if(!m){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const y=new Ae(e);return p&&(p.node=y),y}m=e instanceof Map?d[Mi]:Symbol.iterator in Object(e)?d[$r]:d[Mi]}c&&(c(m),delete s.onTagObj);const v=m?.createNode?m.createNode(s.schema,e,s):typeof m?.nodeClass?.from=="function"?m.nodeClass.from(s.schema,e,s):new Ae(e);return t?v.tag=t:m.default||(v.tag=m.tag),p&&(p.node=v),v}function _u(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 bN extends Tp{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=>Ot(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(Tt(c))c.addIn(r,s);else if(c===void 0&&this.schema)this.set(a,_u(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(Tt(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&&dt(c)?c.value:c:Tt(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&&dt(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 Tt(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(Tt(c))c.setIn(r,s);else if(c===void 0&&this.schema)this.set(a,_u(this.schema,r,s));else throw new Error(`Expected YAML collection at ${a}. Remaining path: ${r}`)}}}const wM=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function Zs(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const ga=(e,t,s)=>e.endsWith(`
97
- `)?Zs(s,t):s.includes(`
98
- `)?`
99
- `+Zs(s,t):(e.endsWith(" ")?"":" ")+s,xN="flow",Tm="block",au="quoted";function Yu(e,t,s="flow",{indentAtStart:a,lineWidth:r=80,minContentWidth:c=20,onFold:d,onOverflow:f}={}){if(!r||r<0)return e;r<c&&(c=0);const p=Math.max(1+c,1+r-t.length);if(e.length<=p)return e;const m=[],v={};let y=r-t.length;typeof a=="number"&&(a>r-Math.max(2,c)?m.push(0):y=r-a);let b,x,w=!1,S=-1,C=-1,k=-1;s===Tm&&(S=_x(e,S,t.length),S!==-1&&(y=S+p));for(let A;A=e[S+=1];){if(s===au&&A==="\\"){switch(C=S,e[S+1]){case"x":S+=3;break;case"u":S+=5;break;case"U":S+=9;break;default:S+=1}k=S}if(A===`
100
- `)s===Tm&&(S=_x(e,S,t.length)),y=S+t.length+p,b=void 0;else{if(A===" "&&x&&x!==" "&&x!==`
101
- `&&x!==" "){const z=e[S+1];z&&z!==" "&&z!==`
102
- `&&z!==" "&&(b=S)}if(S>=y)if(b)m.push(b),y=b+p,b=void 0;else if(s===au){for(;x===" "||x===" ";)x=A,A=e[S+=1],w=!0;const z=S>k+1?S-2:C-1;if(v[z])return e;m.push(z),v[z]=!0,y=z+p,b=void 0}else w=!0}x=A}if(w&&f&&f(),m.length===0)return e;d&&d();let E=e.slice(0,m[0]);for(let A=0;A<m.length;++A){const z=m[A],M=m[A+1]||e.length;z===0?E=`
103
- ${t}${e.slice(0,M)}`:(s===au&&v[z]&&(E+=`${e[z]}\\`),E+=`
104
- ${t}${e.slice(z+1,M)}`)}return E}function _x(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 Ju=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),Xu=e=>/^(%|---|\.\.\.)/m.test(e);function NM(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||(Xu(e)?" ":"");let d="",f=0;for(let p=0,m=s[p];m;m=s[++p])if(m===" "&&s[p+1]==="\\"&&s[p+2]==="n"&&(d+=s.slice(f,p)+"\\ ",p+=1,f=p,m="\\"),m==="\\")switch(s[p+1]){case"u":{d+=s.slice(f,p);const v=s.substr(p+2,4);switch(v){case"0000":d+="\\0";break;case"0007":d+="\\a";break;case"000b":d+="\\v";break;case"001b":d+="\\e";break;case"0085":d+="\\N";break;case"00a0":d+="\\_";break;case"2028":d+="\\L";break;case"2029":d+="\\P";break;default:v.substr(0,2)==="00"?d+="\\x"+v.substr(2):d+=s.substr(p,6)}p+=5,f=p+1}break;case"n":if(a||s[p+2]==='"'||s.length<r)p+=1;else{for(d+=s.slice(f,p)+`
107
-
108
- `;s[p+2]==="\\"&&s[p+3]==="n"&&s[p+4]!=='"';)d+=`
109
- `,p+=2;d+=c,s[p+2]===" "&&(d+="\\"),p+=1,f=p+1}break;default:p+=1}return d=f?d+s.slice(f):s,a?d:Yu(d,c,au,Ju(t,!1))}function Om(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||(Xu(e)?" ":""),a="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
111
- ${s}`)+"'";return t.implicitKey?a:Yu(a,s,xN,Ju(t,!1))}function Cr(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=Om:c&&!r?a=Go:a=s?Om: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 Cr(s,a);const m=a.indent||(a.forceBlockIndent||Xu(s)?" ":""),v=d==="literal"?!0:d==="folded"||t===Ae.BLOCK_FOLDED?!1:t===Ae.BLOCK_LITERAL?!0:!NM(s,p,m.length);if(!s)return v?`|
115
- `:`>
116
- `;let y,b;for(b=s.length;b>0;--b){const M=s[b-1];if(M!==`
117
- `&&M!==" "&&M!==" ")break}let x=s.substring(b);const w=x.indexOf(`
118
- `);w===-1?y="-":s===x||w!==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,k=-1;for(C=0;C<s.length;++C){const M=s[C];if(M===" ")S=!0;else if(M===`
120
- `)k=C;else break}let E=s.substring(0,k<C?k+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()),!v){const M=s.replace(/\n+/g,`
121
- $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${m}`);let U=!1;const R=Ju(a,!0);d!=="folded"&&t!==Ae.BLOCK_FOLDED&&(R.onOverflow=()=>{U=!0});const T=Yu(`${E}${M}${x}`,m,Tm,R);if(!U)return`>${z}
122
- ${m}${T}`}return s=s.replace(/\n+/g,`$&${m}`),`|${z}
123
- ${m}${E}${s}${x}`}function CM(e,t,s,a){const{type:r,value:c}=e,{actualString:d,implicitKey:f,indent:p,indentStep:m,inFlow:v}=t;if(f&&c.includes(`
124
- `)||v&&/[[\]{},]/.test(c))return Cr(c,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(c))return f||v||!c.includes(`
125
- `)?Cr(c,t):ru(e,t,s,a);if(!f&&!v&&r!==Ae.PLAIN&&c.includes(`
126
- `))return ru(e,t,s,a);if(Xu(c)){if(p==="")return t.forceBlockIndent=!0,ru(e,t,s,a);if(f&&p===m)return Cr(c,t)}const y=c.replace(/\n+/g,`$&
127
- ${p}`);if(d){const b=S=>S.default&&S.tag!=="tag:yaml.org,2002:str"&&S.test?.test(y),{compat:x,tags:w}=t.doc.schema;if(w.some(b)||x?.some(b))return Cr(c,t)}return f?y:Yu(y,p,xN,Ju(t,!1))}function Dp(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!==Ae.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(d.value)&&(f=Ae.QUOTE_DOUBLE);const p=v=>{switch(v){case Ae.BLOCK_FOLDED:case Ae.BLOCK_LITERAL:return r||c?Cr(d.value,t):ru(d,t,s,a);case Ae.QUOTE_DOUBLE:return Go(d.value,t);case Ae.QUOTE_SINGLE:return Om(d.value,t);case Ae.PLAIN:return CM(d,t,s,a);default:return null}};let m=p(f);if(m===null){const{defaultKeyType:v,defaultStringType:y}=t.options,b=r&&v||y;if(m=p(b),m===null)throw new Error(`Unsupported default string type ${b}`)}return m}function SN(e,t){const s=Object.assign({blockQuote:!0,commentString:wM,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 kM(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(dt(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 _M(e,t,{anchors:s,doc:a}){if(!a.directives)return"";const r=[],c=(dt(e)||Tt(e))&&e.anchor;c&&pN(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 Or(e,t,s,a){if(Dt(e))return e.toString(t,s,a);if(Aa(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=Ot(e)?e:t.doc.createNode(e,{onTagObj:p=>r=p});r??(r=kM(t.doc.schema.tags,c));const d=_M(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):dt(c)?Dp(c,t,s,a):c.toString(t,s,a);return d?dt(c)||f[0]==="{"||f[0]==="["?`${d} ${f}`:`${d}
128
- ${t.indent}${f}`:f}function zM({key:e,value:t},s,a,r){const{allNullValues:c,doc:d,indent:f,indentStep:p,options:{commentString:m,indentSeq:v,simpleKeys:y}}=s;let b=Ot(e)&&e.comment||null;if(y){if(b)throw new Error("With simple keys, key nodes cannot have comments");if(Tt(e)||!Ot(e)&&typeof e=="object"){const R="With simple keys, collection cannot be used as a key value";throw new Error(R)}}let x=!y&&(!e||b&&t==null&&!s.inFlow||Tt(e)||(dt(e)?e.type===Ae.BLOCK_FOLDED||e.type===Ae.BLOCK_LITERAL:typeof e=="object"));s=Object.assign({},s,{allNullValues:!1,implicitKey:!x&&(y||!c),indent:f+p});let w=!1,S=!1,C=Or(e,s,()=>w=!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 w&&a&&a(),C===""?"?":x?`? ${C}`:C}else if(c&&!y||t==null&&x)return C=`? ${C}`,b&&!w?C+=ga(C,s.indent,m(b)):S&&r&&r(),C;w&&(b=null),x?(b&&(C+=ga(C,s.indent,m(b))),C=`? ${C}
129
- ${f}:`):(C=`${C}:`,b&&(C+=ga(C,s.indent,m(b))));let k,E,A;Ot(t)?(k=!!t.spaceBefore,E=t.commentBefore,A=t.comment):(k=!1,E=null,A=null,t&&typeof t=="object"&&(t=d.createNode(t))),s.implicitKey=!1,!x&&!b&&dt(t)&&(s.indentAtStart=C.length+1),S=!1,!v&&p.length>=2&&!s.inFlow&&!x&&fl(t)&&!t.flow&&!t.tag&&!t.anchor&&(s.indent=s.indent.substring(2));let z=!1;const M=Or(t,s,()=>z=!0,()=>S=!0);let U=" ";if(b||k||E){if(U=k?`
130
- `:"",E){const R=m(E);U+=`
131
- ${Zs(R,s.indent)}`}M===""&&!s.inFlow?U===`
132
- `&&A&&(U=`
133
-
134
- `):U+=`
135
- ${s.indent}`}else if(!x&&Tt(t)){const R=M[0],T=M.indexOf(`
136
- `),q=T!==-1,W=s.inFlow??t.flow??t.items.length===0;if(q||!W){let Q=!1;if(q&&(R==="&"||R==="!")){let ne=M.indexOf(" ");R==="&"&&ne!==-1&&ne<T&&M[ne+1]==="!"&&(ne=M.indexOf(" ",ne+1)),(ne===-1||T<ne)&&(Q=!0)}Q||(U=`
137
- ${s.indent}`)}}else(M===""||M[0]===`
138
- `)&&(U="");return C+=U+M,s.inFlow?z&&a&&a():A&&!z?C+=ga(C,s.indent,m(A)):S&&r&&r(),C}function EM(e,t){(e==="debug"||e==="warn")&&console.warn(t)}const Gc="<<",Fs={identify:e=>e===Gc||typeof e=="symbol"&&e.description===Gc,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Ae(Symbol(Gc)),{addToJSMap:jN}),stringify:()=>Gc},AM=(e,t)=>(Fs.identify(t)||dt(t)&&(!t.type||t.type===Ae.PLAIN)&&Fs.identify(t.value))&&e?.doc.schema.tags.some(s=>s.tag===Fs.tag&&s.default);function jN(e,t,s){if(s=e&&Aa(s)?s.resolve(e.doc):s,fl(s))for(const a of s.items)Gh(e,t,a);else if(Array.isArray(s))for(const a of s)Gh(e,t,a);else Gh(e,t,s)}function Gh(e,t,s){const a=e&&Aa(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 wN(e,t,{key:s,value:a}){if(Ot(s)&&s.addToJSMap)s.addToJSMap(e,t,a);else if(AM(e,s))jN(e,t,a);else{const r=Fn(s,"",e);if(t instanceof Map)t.set(r,Fn(a,r,e));else if(t instanceof Set)t.add(r);else{const c=RM(s,r,e),d=Fn(a,c,e);c in t?Object.defineProperty(t,c,{value:d,writable:!0,enumerable:!0,configurable:!0}):t[c]=d}}return t}function RM(e,t,s){if(t===null)return"";if(typeof t!="object")return String(t);if(Ot(e)&&s?.doc){const a=SN(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)+'..."'),EM(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 Lp(e,t,s){const a=il(e,void 0,s),r=il(t,void 0,s);return new fn(a,r)}class fn{constructor(t,s=null){Object.defineProperty(this,Gn,{value:hN}),this.key=t,this.value=s}clone(t){let{key:s,value:a}=this;return Ot(s)&&(s=s.clone(t)),Ot(a)&&(a=a.clone(t)),new fn(s,a)}toJSON(t,s){const a=s?.mapAsMap?new Map:{};return wN(s,a,this)}toString(t,s,a){return t?.doc?zM(this,t,s,a):JSON.stringify(this)}}function NN(e,t,s){return(t.inFlow??e.flow?OM:TM)(e,t,s)}function TM({comment:e,items:t},s,{blockItemPrefix:a,flowChars:r,itemIndent:c,onChompKeep:d,onComment:f}){const{indent:p,options:{commentString:m}}=s,v=Object.assign({},s,{indent:c,type:null});let y=!1;const b=[];for(let w=0;w<t.length;++w){const S=t[w];let C=null;if(Ot(S))!y&&S.spaceBefore&&b.push(""),zu(s,b,S.commentBefore,y),S.comment&&(C=S.comment);else if(Dt(S)){const E=Ot(S.key)?S.key:null;E&&(!y&&E.spaceBefore&&b.push(""),zu(s,b,E.commentBefore,y))}y=!1;let k=Or(S,v,()=>C=null,()=>y=!0);C&&(k+=ga(k,c,m(C))),y&&C&&(y=!1),b.push(a+k)}let x;if(b.length===0)x=r.start+r.end;else{x=b[0];for(let w=1;w<b.length;++w){const S=b[w];x+=S?`
139
- ${p}${S}`:`
140
- `}}return e?(x+=`
141
- `+Zs(m(e),p),f&&f()):y&&d&&d(),x}function OM({items:e},t,{flowChars:s,itemIndent:a}){const{indent:r,indentStep:c,flowCollectionPadding:d,options:{commentString:f}}=t;a+=c;const p=Object.assign({},t,{indent:a,inFlow:!0,type:null});let m=!1,v=0;const y=[];for(let w=0;w<e.length;++w){const S=e[w];let C=null;if(Ot(S))S.spaceBefore&&y.push(""),zu(t,y,S.commentBefore,!1),S.comment&&(C=S.comment);else if(Dt(S)){const E=Ot(S.key)?S.key:null;E&&(E.spaceBefore&&y.push(""),zu(t,y,E.commentBefore,!1),E.comment&&(m=!0));const A=Ot(S.value)?S.value:null;A?(A.comment&&(C=A.comment),A.commentBefore&&(m=!0)):S.value==null&&E?.comment&&(C=E.comment)}C&&(m=!0);let k=Or(S,p,()=>C=null);w<e.length-1&&(k+=","),C&&(k+=ga(k,a,f(C))),!m&&(y.length>v||k.includes(`
142
- `))&&(m=!0),y.push(k),v=y.length}const{start:b,end:x}=s;if(y.length===0)return b+x;if(!m){const w=y.reduce((S,C)=>S+C.length+2,2);m=t.options.lineWidth>0&&w>t.options.lineWidth}if(m){let w=b;for(const S of y)w+=S?`
143
- ${c}${r}${S}`:`
144
- `;return`${w}
145
- ${r}${x}`}else return`${b}${d}${y.join(" ")}${d}${x}`}function zu({indent:e,options:{commentString:t}},s,a,r){if(a&&r&&(a=a.replace(/^\n+/,"")),a){const c=Zs(t(a),e);s.push(c.trimStart())}}function ya(e,t){const s=dt(t)?t.value:t;for(const a of e)if(Dt(a)&&(a.key===t||a.key===s||dt(a.key)&&a.key.value===s))return a}class Zn extends bN{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(Mi,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(Lp(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 fn(t,t?.value):a=new fn(t.key,t.value);const r=ya(this.items,a.key),c=this.schema?.sortMapEntries;if(r){if(!s)throw new Error(`Key ${a.key} already set`);dt(r.value)&&vN(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=ya(this.items,t);return s?this.items.splice(this.items.indexOf(s),1).length>0:!1}get(t,s){const r=ya(this.items,t)?.value;return(!s&&dt(r)?r.value:r)??void 0}has(t){return!!ya(this.items,t)}set(t,s){this.add(new fn(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)wN(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})),NN(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:a,onComment:s})}}const Ir={collection:"map",default:!0,nodeClass:Zn,tag:"tag:yaml.org,2002:map",resolve(e,t){return dl(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,s)=>Zn.from(e,t,s)};class Na extends bN{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super($r,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&&dt(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];dt(r)&&vN(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(Fn(c,String(r++),s));return a}toString(t,s,a){return t?NN(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=dt(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:Na,tag:"tag:yaml.org,2002:seq",resolve(e,t){return fl(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,s)=>Na.from(e,t,s)},Wu={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,s,a){return t=Object.assign({actualString:!0},t),Dp(e,t,s,a)}},ed={identify:e=>e==null,createNode:()=>new Ae(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Ae(null),stringify:({source:e},t)=>typeof e=="string"&&ed.test.test(e)?e:t.options.nullStr},Mp={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new Ae(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},s){if(e&&Mp.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 os({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 CN={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:os},kN={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():os(e)}},_N={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 Ae(parseFloat(e)),s=e.indexOf(".");return s!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-s-1),t},stringify:os},td=e=>typeof e=="bigint"||Number.isInteger(e),Up=(e,t,s,{intAsBigInt:a})=>a?BigInt(e):parseInt(e.substring(t),s);function zN(e,t,s){const{value:a}=e;return td(a)&&a>=0?s+a.toString(t):os(e)}const EN={identify:e=>td(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,s)=>Up(e,2,8,s),stringify:e=>zN(e,8,"0o")},AN={identify:td,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,s)=>Up(e,0,10,s),stringify:os},RN={identify:e=>td(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,s)=>Up(e,2,16,s),stringify:e=>zN(e,16,"0x")},DM=[Ir,Br,Wu,ed,Mp,EN,AN,RN,CN,kN,_N];function zx(e){return typeof e=="bigint"||Number.isInteger(e)}const Vc=({value:e})=>JSON.stringify(e),LM=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:Vc},{identify:e=>e==null,createNode:()=>new Ae(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:zx,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})=>zx(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}],MM={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},UM=[Ir,Br].concat(LM,MM),$p={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=Ae.BLOCK_LITERAL),t!==Ae.QUOTE_DOUBLE){const p=Math.max(a.options.lineWidth-a.indent.length,a.options.minContentWidth),m=Math.ceil(f.length/p),v=new Array(m);for(let y=0,b=0;y<m;++y,b+=p)v[y]=f.substr(b,p);f=v.join(t===Ae.BLOCK_LITERAL?`
146
- `:" ")}return Dp({comment:e,type:t,value:f},a,r,c)}};function TN(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 fn(new Ae(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 fn(a)}}else t("Expected a sequence for this tag");return e}function ON(e,t,s){const{replacer:a}=s,r=new Na(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(Lp(f,p,s))}return r}const Pp={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:TN,createNode:ON};class zr extends Na{constructor(){super(),this.add=Zn.prototype.add.bind(this),this.delete=Zn.prototype.delete.bind(this),this.get=Zn.prototype.get.bind(this),this.has=Zn.prototype.has.bind(this),this.set=Zn.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=Fn(r.key,"",s),d=Fn(r.value,c,s)):c=Fn(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=ON(t,s,a),c=new this;return c.items=r.items,c}}zr.tag="tag:yaml.org,2002:omap";const Ip={collection:"seq",identify:e=>e instanceof Map,nodeClass:zr,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const s=TN(e,t),a=[];for(const{key:r}of s.items)dt(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 DN({value:e,source:t},s){return t&&(e?LN:MN).test.test(t)?t:e?s.options.trueStr:s.options.falseStr}const LN={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 Ae(!0),stringify:DN},MN={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 Ae(!1),stringify:DN},$M={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:os},PM={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():os(e)}},IM={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 Ae(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:os},hl=e=>typeof e=="bigint"||Number.isInteger(e);function nd(e,t,s,{intAsBigInt:a}){const r=e[0];if((r==="-"||r==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),a){switch(s){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}const d=BigInt(e);return r==="-"?BigInt(-1)*d:d}const c=parseInt(e,s);return r==="-"?-1*c:c}function Bp(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 os(e)}const BM={identify:hl,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,s)=>nd(e,2,2,s),stringify:e=>Bp(e,2,"0b")},qM={identify:hl,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,s)=>nd(e,1,8,s),stringify:e=>Bp(e,8,"0")},HM={identify:hl,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,s)=>nd(e,0,10,s),stringify:os},ZM={identify:hl,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,s)=>nd(e,2,16,s),stringify:e=>Bp(e,16,"0x")};class Er extends Zn{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 fn(t.key,null):s=new fn(t,null),ya(this.items,s.key)||this.items.push(s)}get(t,s){const a=ya(this.items,t);return!s&&Dt(a)?dt(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=ya(this.items,t);a&&!s?this.items.splice(this.items.indexOf(a),1):!a&&s&&this.items.push(new fn(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(Lp(d,null,a));return c}}Er.tag="tag:yaml.org,2002:set";const qp={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 Hp(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 UN(e){let{value:t}=e,s=d=>d;if(typeof t=="bigint")s=d=>BigInt(d);else if(isNaN(t)||!isFinite(t))return os(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 $N={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})=>Hp(e,s),stringify:UN},PN={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=>Hp(e,!1),stringify:UN},sd={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){const t=e.match(sd.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,s,a,r,c,d,f]=t.map(Number),p=t[7]?Number((t[7]+"00").substr(1,3)):0;let m=Date.UTC(s,a-1,r,c||0,d||0,f||0,p);const v=t[8];if(v&&v!=="Z"){let y=Hp(v,!1);Math.abs(y)<30&&(y*=60),m-=6e4*y}return new Date(m)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""},Ex=[Ir,Br,Wu,ed,LN,MN,BM,qM,HM,ZM,$M,PM,IM,$p,Fs,Ip,Pp,qp,$N,PN,sd],Ax=new Map([["core",DM],["failsafe",[Ir,Br,Wu]],["json",UM],["yaml11",Ex],["yaml-1.1",Ex]]),Rx={binary:$p,bool:Mp,float:_N,floatExp:kN,floatNaN:CN,floatTime:PN,int:AN,intHex:RN,intOct:EN,intTime:$N,map:Ir,merge:Fs,null:ed,omap:Ip,pairs:Pp,seq:Br,set:qp,timestamp:sd},FM={"tag:yaml.org,2002:binary":$p,"tag:yaml.org,2002:merge":Fs,"tag:yaml.org,2002:omap":Ip,"tag:yaml.org,2002:pairs":Pp,"tag:yaml.org,2002:set":qp,"tag:yaml.org,2002:timestamp":sd};function Kh(e,t,s){const a=Ax.get(t);if(a&&!e)return s&&!a.includes(Fs)?a.concat(Fs):a.slice();let r=a;if(!r)if(Array.isArray(e))r=[];else{const c=Array.from(Ax.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(Fs)),r.reduce((c,d)=>{const f=typeof d=="string"?Rx[d]:d;if(!f){const p=JSON.stringify(d),m=Object.keys(Rx).map(v=>JSON.stringify(v)).join(", ");throw new Error(`Unknown custom tag ${p}; use one of ${m}`)}return c.includes(f)||c.push(f),c},[])}const GM=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class Zp{constructor({compat:t,customTags:s,merge:a,resolveKnownTags:r,schema:c,sortMapEntries:d,toStringDefaults:f}){this.compat=Array.isArray(t)?Kh(t,"compat"):t?Kh(null,t):null,this.name=typeof c=="string"&&c||"core",this.knownTags=r?FM:{},this.tags=Kh(s,this.name,a),this.toStringOptions=f??null,Object.defineProperty(this,Mi,{value:Ir}),Object.defineProperty(this,xs,{value:Wu}),Object.defineProperty(this,$r,{value:Br}),this.sortMapEntries=typeof d=="function"?d:d===!0?GM:null}clone(){const t=Object.create(Zp.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function KM(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=SN(e,t),{commentString:c}=r.options;if(e.commentBefore){s.length!==1&&s.unshift("");const p=c(e.commentBefore);s.unshift(Zs(p,""))}let d=!1,f=null;if(e.contents){if(Ot(e.contents)){if(e.contents.spaceBefore&&a&&s.push(""),e.contents.commentBefore){const v=c(e.contents.commentBefore);s.push(Zs(v,""))}r.forceBlockIndent=!!e.comment,f=e.contents.comment}const p=f?void 0:()=>d=!0;let m=Or(e.contents,r,()=>f=null,p);f&&(m+=ga(m,"",c(f))),(m[0]==="|"||m[0]===">")&&s[s.length-1]==="---"?s[s.length-1]=`--- ${m}`:s.push(m)}else s.push(Or(e.contents,r));if(e.directives?.docEnd)if(e.comment){const p=c(e.comment);p.includes(`
149
- `)?(s.push("..."),s.push(Zs(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(Zs(c(p),"")))}return s.join(`
150
- `)+`
151
- `}class id{constructor(t,s,a){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Gn,{value:Rm});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 un({version:d}),this.setSchema(d,a),this.contents=t===void 0?null:this.createNode(t,r,a)}clone(){const t=Object.create(id.prototype,{[Gn]:{value:Rm}});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=Ot(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){vr(this.contents)&&this.contents.add(t)}addIn(t,s){vr(this.contents)&&this.contents.addIn(t,s)}createAlias(t,s){if(!t.anchor){const a=gN(this);t.anchor=!s||a.has(s)?yN(s||"a",a):s}return new Op(t.anchor)}createNode(t,s,a){let r;if(typeof s=="function")t=s.call({"":t},"",t),r=s;else if(Array.isArray(s)){const C=E=>typeof E=="number"||E instanceof String||E instanceof Number,k=s.filter(C).map(String);k.length>0&&(s=s.concat(k)),r=s}else a===void 0&&s&&(a=s,s=void 0);const{aliasDuplicateObjects:c,anchorPrefix:d,flow:f,keepUndefined:p,onTagObj:m,tag:v}=a??{},{onAnchor:y,setAnchors:b,sourceObjects:x}=xM(this,d||"a"),w={aliasDuplicateObjects:c??!0,keepUndefined:p??!1,onAnchor:y,onTagObj:m,replacer:r,schema:this.schema,sourceObjects:x},S=il(t,v,w);return f&&Tt(S)&&(S.flow=!0),b(),S}createPair(t,s,a={}){const r=this.createNode(t,null,a),c=this.createNode(s,null,a);return new fn(r,c)}delete(t){return vr(this.contents)?this.contents.delete(t):!1}deleteIn(t){return Bo(t)?this.contents==null?!1:(this.contents=null,!0):vr(this.contents)?this.contents.deleteIn(t):!1}get(t,s){return Tt(this.contents)?this.contents.get(t,s):void 0}getIn(t,s){return Bo(t)?!s&&dt(this.contents)?this.contents.value:this.contents:Tt(this.contents)?this.contents.getIn(t,s):void 0}has(t){return Tt(this.contents)?this.contents.has(t):!1}hasIn(t){return Bo(t)?this.contents!==void 0:Tt(this.contents)?this.contents.hasIn(t):!1}set(t,s){this.contents==null?this.contents=_u(this.schema,[t],s):vr(this.contents)&&this.contents.set(t,s)}setIn(t,s){Bo(t)?this.contents=s:this.contents==null?this.contents=_u(this.schema,Array.from(t),s):vr(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 un({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 un({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 Zp(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=Fn(this.contents,s??"",f);if(typeof c=="function")for(const{count:m,res:v}of f.anchors.values())c(v,m);return typeof d=="function"?Nr(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 KM(this,t)}}function vr(e){if(Tt(e))return!0;throw new Error("Expected a YAML collection as document contents")}class IN extends Error{constructor(t,s,a,r){super(),this.name=t,this.code=a,this.message=r,this.pos=s}}class Qc extends IN{constructor(t,s,a){super("YAMLParseError",t,s,a)}}class VM extends IN{constructor(t,s,a){super("YAMLWarning",t,s,a)}}const Tx=(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,v=f,y="",b="",x=!1,w=!1,S=null,C=null,k=null,E=null,A=null,z=null,M=null;for(const T of e)switch(w&&(T.type!=="space"&&T.type!=="newline"&&T.type!=="comma"&&c(T.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),w=!1),S&&(m&&T.type!=="comment"&&T.type!=="newline"&&c(S,"TAB_AS_INDENT","Tabs are not allowed as indentation"),S=null),T.type){case"space":!t&&(s!=="doc-start"||a?.type!=="flow-collection")&&T.source.includes(" ")&&(S=T),v=!0;break;case"comment":{v||c(T,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const q=T.source.substring(1)||" ";y?y+=b+q:y=q,b="",m=!1;break}case"newline":m?y?y+=T.source:(!z||s!=="seq-item-ind")&&(p=!0):b+=T.source,m=!0,x=!0,(C||k)&&(E=T),v=!0;break;case"anchor":C&&c(T,"MULTIPLE_ANCHORS","A node can have at most one anchor"),T.source.endsWith(":")&&c(T.offset+T.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),C=T,M??(M=T.offset),m=!1,v=!1,w=!0;break;case"tag":{k&&c(T,"MULTIPLE_TAGS","A node can have at most one tag"),k=T,M??(M=T.offset),m=!1,v=!1,w=!0;break}case s:(C||k)&&c(T,"BAD_PROP_ORDER",`Anchors and tags must be after the ${T.source} indicator`),z&&c(T,"UNEXPECTED_TOKEN",`Unexpected ${T.source} in ${t??"collection"}`),z=T,m=s==="seq-item-ind"||s==="explicit-key-ind",v=!1;break;case"comma":if(t){A&&c(T,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),A=T,m=!1,v=!1;break}default:c(T,"UNEXPECTED_TOKEN",`Unexpected ${T.type} token`),m=!1,v=!1}const U=e[e.length-1],R=U?U.offset+U.source.length:r;return w&&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:A,found:z,spaceBefore:p,comment:y,hasNewline:x,anchor:C,tag:k,newlineAfterProp:E,end:R,start:M??R}}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 BN(e,t,s){const{uniqueKeys:a}=e.options;if(a===!1)return!1;const r=typeof a=="function"?a:(c,d)=>c===d||dt(c)&&dt(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 QM({composeNode:e,composeEmptyNode:t},s,a,r,c){const d=c?.nodeClass??Zn,f=new d(s.schema);s.atRoot&&(s.atRoot=!1);let p=a.offset,m=null;for(const v of a.items){const{start:y,key:b,sep:x,value:w}=v,S=Dr(y,{indicator:"explicit-key-ind",next:b??x?.[0],offset:p,onError:r,parentIndent:a.indent,startOnNewline:!0}),C=!S.found;if(C){if(b&&(b.type==="block-seq"?r(p,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in b&&b.indent!==a.indent&&r(p,"BAD_INDENT",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(b))&&r(b??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 k=S.end,E=b?e(s,b,S,r):t(s,k,y,null,S,r);s.schema.compat&&Lm(a.indent,b,r),s.atKey=!1,BN(s,f.items,E)&&r(k,"DUPLICATE_KEY","Map keys must be unique");const A=Dr(x??[],{indicator:"map-value-ind",next:w,offset:E.range[2],onError:r,parentIndent:a.indent,startOnNewline:!b||b.type==="block-scalar"});if(p=A.end,A.found){C&&(w?.type==="block-map"&&!A.hasNewline&&r(p,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),s.options.strict&&S.start<A.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=w?e(s,w,A,r):t(s,p,x,null,A,r);s.schema.compat&&Lm(a.indent,w,r),p=z.range[2];const M=new fn(E,z);s.options.keepSourceTokens&&(M.srcToken=v),f.items.push(M)}else{C&&r(E.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),A.comment&&(E.comment?E.comment+=`
159
- `+A.comment:E.comment=A.comment);const z=new fn(E);s.options.keepSourceTokens&&(z.srcToken=v),f.items.push(z)}}return m&&m<p&&r(m,"IMPOSSIBLE","Map comment with trailing content"),f.range=[a.offset,p,m??p],f}function YM({composeNode:e,composeEmptyNode:t},s,a,r,c){const d=c?.nodeClass??Na,f=new d(s.schema);s.atRoot&&(s.atRoot=!1),s.atKey&&(s.atKey=!1);let p=a.offset,m=null;for(const{start:v,value:y}of a.items){const b=Dr(v,{indicator:"seq-item-ind",next:y,offset:p,onError:r,parentIndent:a.indent,startOnNewline:!0});if(!b.found)if(b.anchor||b.tag||y)y?.type==="block-seq"?r(b.end,"BAD_INDENT","All sequence items must start at the same column"):r(p,"MISSING_CHAR","Sequence item without - indicator");else{m=b.end,b.comment&&(f.comment=b.comment);continue}const x=y?e(s,y,b,r):t(s,b.end,v,null,b,r);s.schema.compat&&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 v=p.substring(1)||" ";r?r+=d+v:r=v,d="";break}case"newline":r&&(d+=p),c=!0;break;default:a(f,"UNEXPECTED_TOKEN",`Unexpected ${m} at node end`)}t+=p.length}}return{comment:r,offset:t}}const Vh="Block collections are not allowed within flow collections",Qh=e=>e&&(e.type==="block-map"||e.type==="block-seq");function JM({composeNode:e,composeEmptyNode:t},s,a,r,c){const d=a.start.source==="{",f=d?"flow map":"flow sequence",p=c?.nodeClass??(d?Zn:Na),m=new p(s.schema);m.flow=!0;const v=s.atRoot;v&&(s.atRoot=!1),s.atKey&&(s.atKey=!1);let y=a.offset+a.start.source.length;for(let C=0;C<a.items.length;++C){const k=a.items[C],{start:E,key:A,sep:z,value:M}=k,U=Dr(E,{flow:f,indicator:"explicit-key-ind",next:A??z?.[0],offset:y,onError:r,parentIndent:a.indent,startOnNewline:!1});if(!U.found){if(!U.anchor&&!U.tag&&!z&&!M){C===0&&U.comma?r(U.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${f}`):C<a.items.length-1&&r(U.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${f}`),U.comment&&(m.comment?m.comment+=`
160
- `+U.comment:m.comment=U.comment),y=U.end;continue}!d&&s.options.strict&&al(A)&&r(A,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(C===0)U.comma&&r(U.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${f}`);else if(U.comma||r(U.start,"MISSING_CHAR",`Missing , between ${f} items`),U.comment){let R="";e:for(const T of E)switch(T.type){case"comma":case"space":break;case"comment":R=T.source.substring(1);break e;default:break e}if(R){let T=m.items[m.items.length-1];Dt(T)&&(T=T.value??T.key),T.comment?T.comment+=`
161
- `+R:T.comment=R,U.comment=U.comment.substring(R.length+1)}}if(!d&&!z&&!U.found){const R=M?e(s,M,U,r):t(s,U.end,z,null,U,r);m.items.push(R),y=R.range[2],Qh(M)&&r(R.range,"BLOCK_IN_FLOW",Vh)}else{s.atKey=!0;const R=U.end,T=A?e(s,A,U,r):t(s,R,E,null,U,r);Qh(A)&&r(T.range,"BLOCK_IN_FLOW",Vh),s.atKey=!1;const q=Dr(z??[],{flow:f,indicator:"map-value-ind",next:M,offset:T.range[2],onError:r,parentIndent:a.indent,startOnNewline:!1});if(q.found){if(!d&&!U.found&&s.options.strict){if(z)for(const ne of z){if(ne===q.found)break;if(ne.type==="newline"){r(ne,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}U.start<q.found.offset-1024&&r(q.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else M&&("source"in M&&M.source?.[0]===":"?r(M,"MISSING_CHAR",`Missing space after : in ${f}`):r(q.start,"MISSING_CHAR",`Missing , or : between ${f} items`));const W=M?e(s,M,q,r):q.found?t(s,q.end,z,null,q,r):null;W?Qh(M)&&r(W.range,"BLOCK_IN_FLOW",Vh):q.comment&&(T.comment?T.comment+=`
162
- `+q.comment:T.comment=q.comment);const Q=new fn(T,W);if(s.options.keepSourceTokens&&(Q.srcToken=k),d){const ne=m;BN(s,ne.items,T)&&r(R,"DUPLICATE_KEY","Map keys must be unique"),ne.items.push(Q)}else{const ne=new Zn(s.schema);ne.flow=!0,ne.items.push(Q);const me=(W??T).range;ne.range=[T.range[0],me[1],me[2]],m.items.push(ne)}y=W?W.range[2]:q.end}}const b=d?"}":"]",[x,...w]=a.end;let S=y;if(x?.source===b)S=x.offset+x.source.length;else{const C=f[0].toUpperCase()+f.substring(1),k=v?`${C} must end with a ${b}`:`${C} in block collection must be sufficiently indented and end with a ${b}`;r(y,v?"MISSING_CHAR":"BAD_INDENT",k),x&&x.source.length!==1&&w.unshift(x)}if(w.length>0){const C=ml(w,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 Yh(e,t,s,a,r,c){const d=s.type==="block-map"?QM(e,t,s,a,c):s.type==="block-seq"?YM(e,t,s,a,c):JM(e,t,s,a,c),f=d.constructor;return r==="!"||r===f.tagName?(d.tag=f.tagName,d):(r&&(d.tag=r),d)}function XM(e,t,s,a,r){const c=a.tag,d=c?t.directives.tagName(c.source,b=>r(c,"TAG_RESOLVE_FAILED",b)):null;if(s.type==="block-seq"){const{anchor:b,newlineAfterProp:x}=a,w=b&&c?b.offset>c.offset?b:c:b??c;w&&(!x||x.offset<w.offset)&&r(w,"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===Zn.tagName&&f==="map"||d===Na.tagName&&f==="seq")return Yh(e,t,s,r,d);let p=t.schema.tags.find(b=>b.tag===d&&b.collection===f);if(!p){const b=t.schema.knownTags[d];if(b?.collection===f)t.schema.tags.push(Object.assign({},b,{default:!1})),p=b;else return b?r(c,"BAD_COLLECTION_TYPE",`${b.tag} used for ${f} collection, but expects ${b.collection??"scalar"}`,!0):r(c,"TAG_RESOLVE_FAILED",`Unresolved tag: ${d}`,!0),Yh(e,t,s,r,d)}const m=Yh(e,t,s,r,d,p),v=p.resolve?.(m,b=>r(c,"TAG_RESOLVE_FAILED",b),t.options)??m,y=Ot(v)?v:new Ae(v);return y.range=m.range,y.tag=d,p?.format&&(y.format=p.format),y}function WM(e,t,s){const a=t.offset,r=e3(t,e.options.strict,s);if(!r)return{value:"",type:null,comment:"",range:[a,a,a]};const c=r.mode===">"?Ae.BLOCK_FOLDED:Ae.BLOCK_LITERAL,d=t.source?t3(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,v=0;for(let S=0;S<f;++S){const[C,k]=d[S];if(k===""||k==="\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),v=S,p===0&&!e.atRoot&&s(m,"BAD_INDENT","Block scalar values in collections must be indented");break}m+=C.length+k.length+1}for(let S=d.length-1;S>=f;--S)d[S][0].length>p&&(f=S+1);let y="",b="",x=!1;for(let S=0;S<v;++S)y+=d[S][0].slice(p)+`
165
- `;for(let S=v;S<f;++S){let[C,k]=d[S];m+=C.length+k.length+1;const E=k[k.length-1]==="\r";if(E&&(k=k.slice(0,-1)),k&&C.length<p){const z=`Block scalar lines must not be less indented than their ${r.indent?"explicit indentation indicator":"first line"}`;s(m-k.length-(E?2:1),"BAD_INDENT",z),C=""}c===Ae.BLOCK_LITERAL?(y+=b+C.slice(p)+k,b=`
166
- `):C.length>p||k[0]===" "?(b===" "?b=`
167
- `:!x&&b===`
168
- `&&(b=`
169
-
170
- `),y+=b+C.slice(p)+k,b=`
171
- `,x=!0):k===""?b===`
172
- `?y+=`
173
- `:b=`
174
- `:(y+=b+k,b=" ",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 w=a+r.length+t.source.length;return{value:y,type:c,comment:r.comment,range:[a,w,w]}}function e3({offset:e,props:t},s,a){if(t[0].type!=="block-scalar-header")return a(t[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:r}=t[0],c=r[0];let d=0,f="",p=-1;for(let b=1;b<r.length;++b){const x=r[b];if(!f&&(x==="-"||x==="+"))f=x;else{const w=Number(x);!d&&w?d=w:p===-1&&(p=e+b)}}p!==-1&&a(p,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${r}`);let m=!1,v="",y=r.length;for(let b=1;b<t.length;++b){const x=t[b];switch(x.type){case"space":m=!0;case"newline":y+=x.source.length;break;case"comment":s&&!m&&a(x,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),y+=x.source.length,v=x.source.substring(1);break;case"error":a(x,"UNEXPECTED_TOKEN",x.message),y+=x.source.length;break;default:{const w=`Unexpected token in block scalar header: ${x.type}`;a(x,"UNEXPECTED_TOKEN",w);const S=x.source;S&&typeof S=="string"&&(y+=S.length)}}}return{mode:c,indent:d,chomp:f,comment:v,length:y}}function t3(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 n3(e,t,s){const{offset:a,type:r,source:c,end:d}=e;let f,p;const m=(b,x,w)=>s(a+b,x,w);switch(r){case"scalar":f=Ae.PLAIN,p=s3(c,m);break;case"single-quoted-scalar":f=Ae.QUOTE_SINGLE,p=i3(c,m);break;case"double-quoted-scalar":f=Ae.QUOTE_DOUBLE,p=a3(c,m);break;default:return s(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${r}`),{value:"",type:null,comment:"",range:[a,a+c.length,a+c.length]}}const v=a+c.length,y=ml(d,v,t,s);return{value:p,type:f,comment:y.comment,range:[a,v,y.offset]}}function s3(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}`),qN(e)}function i3(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),qN(e.slice(1,-1)).replace(/''/g,"'")}function qN(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 a3(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}=r3(e,a);s+=c,a=d}else if(r==="\\"){let c=e[++a];const d=o3[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+=l3(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 r3(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 o3={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
193
- `,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function l3(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 HN(e,t,s,a){const{value:r,type:c,comment:d,range:f}=t.type==="block-scalar"?WM(e,t,a):n3(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[xs]:p?m=c3(e.schema,r,p,s,a):t.type==="scalar"?m=u3(e,r,t,a):m=e.schema[xs];let v;try{const y=m.resolve(r,b=>a(s??t,"TAG_RESOLVE_FAILED",b),e.options);v=dt(y)?y:new Ae(y)}catch(y){const b=y instanceof Error?y.message:String(y);a(s??t,"TAG_RESOLVE_FAILED",b),v=new Ae(r)}return v.range=f,v.source=r,c&&(v.type=c),p&&(v.tag=p),m.format&&(v.format=m.format),d&&(v.comment=d),v}function c3(e,t,s,a,r){if(s==="!")return e[xs];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[xs])}function u3({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[xs];if(s.compat){const f=s.compat.find(p=>p.default&&p.test?.test(a))??s[xs];if(d.tag!==f.tag){const p=t.tagString(d.tag),m=t.tagString(f.tag),v=`Value may be parsed as either ${p} or ${m}`;c(r,"TAG_RESOLVE_FAILED",v,!0)}}return d}function d3(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 f3={composeNode:ZN,composeEmptyNode:Fp};function ZN(e,t,s,a){const r=e.atKey,{spaceBefore:c,comment:d,anchor:f,tag:p}=s;let m,v=!0;switch(t.type){case"alias":m=h3(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=HN(e,t,p,a),f&&(m.anchor=f.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":m=XM(f3,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=Fp(e,t.offset,void 0,null,s,a),v=!1}}return f&&m.anchor===""&&a(f,"BAD_ALIAS","Anchor cannot be an empty string"),r&&e.options.stringKeys&&(!dt(m)||typeof m.value!="string"||m.tag&&m.tag!=="tag:yaml.org,2002:str")&&a(p??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),c&&(m.spaceBefore=!0),d&&(t.type==="scalar"&&t.source===""?m.comment=d:m.commentBefore=d),e.options.keepSourceTokens&&v&&(m.srcToken=t),m}function Fp(e,t,s,a,{spaceBefore:r,comment:c,anchor:d,tag:f,end:p},m){const v={type:"scalar",offset:d3(t,s,a),indent:-1,source:""},y=HN(e,v,f,m);return d&&(y.anchor=d.source.substring(1),y.anchor===""&&m(d,"BAD_ALIAS","Anchor cannot be an empty string")),r&&(y.spaceBefore=!0),c&&(y.comment=c,y.range[2]=p),y}function h3({options:e},{offset:t,source:s,end:a},r){const c=new Op(s.substring(1));c.source===""&&r(t,"BAD_ALIAS","Alias cannot be an empty string"),c.source.endsWith(":")&&r(t+s.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const d=t+s.length,f=ml(a,d,e.strict,r);return c.range=[t,d,f.offset],f.comment&&(c.comment=f.comment),c}function m3(e,t,{offset:s,start:a,value:r,end:c},d){const f=Object.assign({_directives:t},e),p=new id(void 0,f),m={atKey:!1,atRoot:!0,directives:p.directives,options:p.options,schema:p.schema},v=Dr(a,{indicator:"doc-start",next:r??c?.[0],offset:s,onError:d,parentIndent:0,startOnNewline:!0});v.found&&(p.directives.docStart=!0,r&&(r.type==="block-map"||r.type==="block-seq")&&!v.hasNewline&&d(v.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),p.contents=r?ZN(m,r,v,d):Fp(m,v.end,a,null,v,d);const y=p.contents.range[2],b=ml(c,y,!1,d);return b.comment&&(p.comment=b.comment),p.range=[s,y,b.offset],p}function Po(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 Dx(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 p3{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(s,a,r,c)=>{const d=Po(s);c?this.warnings.push(new VM(d,a,r)):this.errors.push(new Qc(d,a,r))},this.directives=new un({version:t.version||"1.2"}),this.options=t}decorate(t,s){const{comment:a,afterEmptyLine:r}=Dx(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(Tt(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:Dx(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=Po(t);c[0]+=s,this.onError(c,"BAD_DIRECTIVE",a,r)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const s=m3(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(Po(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(Po(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(Po(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(t=!1,s=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(t){const a=Object.assign({_directives:this.directives},this.options),r=new id(void 0,a);this.atDirectives&&this.onError(s,"MISSING_CHAR","Missing directives-end indicator line"),r.range=[0,s,s],this.decorate(r,!1),yield r}}}const FN="\uFEFF",GN="",KN="",Mm="";function g3(e){switch(e){case FN:return"byte-order-mark";case GN:return"doc-mode";case KN: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 ts(e){switch(e){case void 0:case" ":case`
203
- `:case"\r":case" ":return!0;default:return!1}}const Lx=new Set("0123456789ABCDEFabcdef"),y3=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Yc=new Set(",[]{}"),v3=new Set(` ,[]{}
204
- \r `),Jh=e=>!e||v3.has(e);class b3{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==="...")&&ts(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]===FN&&(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 GN,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==="...")&&ts(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&&!ts(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===":")&&ts(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(Jh),"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("..."))&&ts(r[3]))&&!(a===this.indentNext-1&&this.flowLevel===1&&(r[0]==="]"||r[0]==="}")))return this.flowLevel=0,yield KN,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(Jh),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const d=this.charAt(1);if(this.flowKey||ts(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=>ts(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(ts(c)||t&&Yc.has(c))break;s=a}else if(ts(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(Jh))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const t=this.flowLevel>0,s=this.charAt(1);if(ts(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(;!ts(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(y3.has(s))s=this.buffer[++t];else if(s==="%"&&Lx.has(this.buffer[t+1])&&Lx.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 x3{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let s=0,a=this.lineStarts.length;for(;s<a;){const c=s+a>>1;this.lineStarts[c]<t?s=c+1:a=c}if(this.lineStarts[s]===t)return{line:s+1,col:1};if(s===0)return{line:0,col:t};const r=this.lineStarts[s-1];return{line:s,col:t-r+1}}}}function _i(e,t){for(let s=0;s<e.length;++s)if(e[s].type===t)return!0;return!1}function Mx(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 VN(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 br(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 Ux(e){if(e.start.type==="flow-seq-start")for(const t of e.items)t.sep&&!t.value&&!_i(t.start,"explicit-key-ind")&&!_i(t.sep,"map-value-ind")&&(t.key&&(t.value=t.key),delete t.key,VN(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 S3{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 b3,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=g3(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"&&Ux(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&&Mx(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":{Mx(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=br(s);let r;t.end?(r=t.end,r.push(this.sourceToken),delete t.end):r=[this.sourceToken];const c={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:a,key:t,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=c}else yield*this.lineEnd(t)}*blockScalar(t){switch(this.type){case"space":case"comment":case"newline":t.props.push(this.sourceToken);return;case"scalar":if(t.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let s=this.source.indexOf(`
222
- `)+1;for(;s!==0;)this.onNewLine(this.offset+s),s=this.source.indexOf(`
223
- `,s)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(t){const s=t.items[t.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,s.value){const a="end"in s.value?s.value.end:void 0;(Array.isArray(a)?a[a.length-1]:void 0)?.type==="comment"?a?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else s.sep?s.sep.push(this.sourceToken):s.start.push(this.sourceToken);return;case"space":case"comment":if(s.value)t.items.push({start:[this.sourceToken]});else if(s.sep)s.sep.push(this.sourceToken);else{if(this.atIndentedComment(s.start,t.indent)){const r=t.items[t.items.length-2]?.value?.end;if(Array.isArray(r)){Array.prototype.push.apply(r,s.start),r.push(this.sourceToken),t.items.pop();return}}s.start.push(this.sourceToken)}return}if(this.indent>=t.indent){const a=!this.onKeyLine&&this.indent===t.indent,r=a&&(s.sep||s.explicitKey)&&this.type!=="seq-item-ind";let c=[];if(r&&s.sep&&!s.value){const d=[];for(let f=0;f<s.sep.length;++f){const p=s.sep[f];switch(p.type){case"newline":d.push(f);break;case"space":break;case"comment":p.indent>t.indent&&(d.length=0);break;default:d.length=0}}d.length>=2&&(c=s.sep.splice(d[1]))}switch(this.type){case"anchor":case"tag":r||s.value?(c.push(this.sourceToken),t.items.push({start:c}),this.onKeyLine=!0):s.sep?s.sep.push(this.sourceToken):s.start.push(this.sourceToken);return;case"explicit-key-ind":!s.sep&&!s.explicitKey?(s.start.push(this.sourceToken),s.explicitKey=!0):r||s.value?(c.push(this.sourceToken),t.items.push({start:c,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(s.explicitKey)if(s.sep)if(s.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(_i(s.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:c,key:null,sep:[this.sourceToken]}]});else if(VN(s.key)&&!_i(s.sep,"newline")){const d=br(s.start),f=s.key,p=s.sep;p.push(this.sourceToken),delete s.key,delete s.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:d,key:f,sep:p}]})}else c.length>0?s.sep=s.sep.concat(c,this.sourceToken):s.sep.push(this.sourceToken);else if(_i(s.start,"newline"))Object.assign(s,{key:null,sep:[this.sourceToken]});else{const d=br(s.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:d,key:null,sep:[this.sourceToken]}]})}else s.sep?s.value||r?t.items.push({start:c,key:null,sep:[this.sourceToken]}):_i(s.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):s.sep.push(this.sourceToken):Object.assign(s,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const d=this.flowScalar(this.type);r||s.value?(t.items.push({start:c,key:d,sep:[]}),this.onKeyLine=!0):s.sep?this.stack.push(d):(Object.assign(s,{key:d,sep:[]}),this.onKeyLine=!0);return}default:{const d=this.startBlockValue(t);if(d){if(d.type==="block-seq"){if(!s.explicitKey&&s.sep&&!_i(s.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else a&&t.items.push({start:c});this.stack.push(d);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){const s=t.items[t.items.length-1];switch(this.type){case"newline":if(s.value){const a="end"in s.value?s.value.end:void 0;(Array.isArray(a)?a[a.length-1]:void 0)?.type==="comment"?a?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else s.start.push(this.sourceToken);return;case"space":case"comment":if(s.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(s.start,t.indent)){const r=t.items[t.items.length-2]?.value?.end;if(Array.isArray(r)){Array.prototype.push.apply(r,s.start),r.push(this.sourceToken),t.items.pop();return}}s.start.push(this.sourceToken)}return;case"anchor":case"tag":if(s.value||this.indent<=t.indent)break;s.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;s.value||_i(s.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):s.start.push(this.sourceToken);return}if(this.indent>t.indent){const a=this.startBlockValue(t);if(a){this.stack.push(a);return}}yield*this.pop(),yield*this.step()}*flowCollection(t){const s=t.items[t.items.length-1];if(this.type==="flow-error-end"){let a;do yield*this.pop(),a=this.peek(1);while(a?.type==="flow-collection")}else if(t.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!s||s.sep?t.items.push({start:[this.sourceToken]}):s.start.push(this.sourceToken);return;case"map-value-ind":!s||s.value?t.items.push({start:[],key:null,sep:[this.sourceToken]}):s.sep?s.sep.push(this.sourceToken):Object.assign(s,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!s||s.value?t.items.push({start:[this.sourceToken]}):s.sep?s.sep.push(this.sourceToken):s.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const r=this.flowScalar(this.type);!s||s.value?t.items.push({start:[],key:r,sep:[]}):s.sep?this.stack.push(r):Object.assign(s,{key:r,sep:[]});return}case"flow-map-end":case"flow-seq-end":t.end.push(this.sourceToken);return}const a=this.startBlockValue(t);a?this.stack.push(a):(yield*this.pop(),yield*this.step())}else{const a=this.peek(2);if(a.type==="block-map"&&(this.type==="map-value-ind"&&a.indent===t.indent||this.type==="newline"&&!a.items[a.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&a.type!=="flow-collection"){const r=Jc(a),c=br(r);Ux(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=br(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=br(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 j3(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new x3||null,prettyErrors:t}}function w3(e,t={}){const{lineCounter:s,prettyErrors:a}=j3(t),r=new S3(s?.addNewLine),c=new p3(t),d=Array.from(c.compose(r.parse(e)));if(a&&s)for(const f of d)f.errors.forEach(Tx(e,s)),f.warnings.forEach(Tx(e,s));return d.length>0?d:Object.assign([],{empty:!0},c.streamInfo())}function N3({onApplied:e}){const[t,s]=N.useState(""),[a,r]=N.useState(!1),[c,d]=N.useState([]),[f,p]=N.useState([]),m=async()=>{if(!t.trim())return;r(!0),d([]),p([]);const v=w3(t),y=[],b=[];for(let x=0;x<v.length;x++){const w=v[x];if(w.errors.length>0){y.push(`Document ${x+1}: ${w.errors[0]?.message}`);continue}const S=w.toJSON();if(!(!S||typeof S!="object"))try{const C=await Ow(S);b.push(`Applied "${C.displayName||C.name}" (revision ${C.configRevision})`)}catch(C){y.push(`Document ${x+1}: ${C instanceof Error?C.message:String(C)}`)}}d(b),p(y),r(!1),b.length>0&&e()};return l.jsxs("section",{className:"mt-8",children:[l.jsx("div",{className:"page-section-divider"}),l.jsx("div",{className:"section-head mt-6",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Config as code"}),l.jsx("h2",{className:"text-sm font-medium text-zinc-200",children:"Apply YAML"})]})}),l.jsxs("p",{className:"text-zinc-500 text-sm mb-3",children:["Paste a ",l.jsx("code",{className:"text-zinc-400",children:"canonry.yaml"})," config (multi-document YAML with ",l.jsx("code",{className:"text-zinc-400",children:"---"})," separators supported)."]}),l.jsx("textarea",{className:"setup-input w-full font-mono text-xs",rows:10,placeholder:`apiVersion: canonry/v1
226
- kind: Project
227
- metadata:
228
- name: my-project
229
- spec:
230
- canonicalDomain: example.com
231
- country: US
232
- language: en
233
- keywords: []`,value:t,onChange:v=>s(v.target.value)}),c.length>0&&l.jsx("ul",{className:"mt-2 space-y-1",children:c.map((v,y)=>l.jsx("li",{className:"text-emerald-400 text-sm",children:v},y))}),f.length>0&&l.jsx("ul",{className:"mt-2 space-y-1",children:f.map((v,y)=>l.jsx("li",{className:"text-rose-400 text-sm",children:v},y))}),l.jsx("div",{className:"mt-3",children:l.jsx(le,{type:"button",disabled:!t.trim()||a,onClick:m,children:a?"Applying...":"Apply"})})]})}function C3(){const{dashboard:e,isLoading:t,refetch:s}=Ea();if(!e||t)return l.jsxs("div",{className:"page-skeleton",children:[l.jsxs("div",{className:"page-skeleton-header",children:[l.jsx("div",{className:"skeleton-text h-6 w-28"}),l.jsx("div",{className:"skeleton-text-sm w-40"})]}),l.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 overflow-hidden",children:[l.jsx("div",{className:"p-3 border-b border-zinc-800/60 flex gap-8",children:["Name","Domain","Visibility","Last run","Country"].map(R=>l.jsx("div",{className:"skeleton-text-sm w-16"},R))}),[1,2,3].map(R=>l.jsxs("div",{className:"p-3 border-b border-zinc-800/40 flex gap-8 items-center",children:[l.jsxs("div",{className:"flex-1 space-y-1",children:[l.jsx("div",{className:"skeleton-text w-28"}),l.jsx("div",{className:"skeleton-text-sm w-16"})]}),l.jsx("div",{className:"skeleton-text w-24"}),l.jsx("div",{className:"skeleton h-5 w-14 rounded-full"}),l.jsx("div",{className:"skeleton h-5 w-16 rounded-full"}),l.jsx("div",{className:"skeleton-text-sm w-8"})]},R))]})]});const a=e.projects,r=Ca(),[c,d]=N.useState(!1),[f,p]=N.useState(""),[m,v]=N.useState(""),[y,b]=N.useState(""),[x,w]=N.useState("US"),[S,C]=N.useState("en"),[k,E]=N.useState(!1),[A,z]=N.useState(null),M=f.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),U=async()=>{if(!(!M||!y)){E(!0),z(null);try{const R=await ll(M,{displayName:m||f,canonicalDomain:y,country:x,language:S});s(),p(""),v(""),b(""),w("US"),C("en"),d(!1),r({to:"/projects/$projectId",params:{projectId:R.id}})}catch(R){z(R instanceof Error?R.message:"Failed to create project")}finally{E(!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:[a.length," project",a.length!==1?"s":""," tracked"]})]}),l.jsx("div",{className:"page-header-right",children:l.jsxs(le,{type:"button",onClick:()=>d(R=>!R),children:[l.jsx(Eb,{className:"size-4 mr-1.5"}),"Add project"]})})]}),c?l.jsxs(Le,{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:f,onChange:R=>p(R.target.value)}),M&&M!==f?l.jsxs("p",{className:"supporting-copy",children:["Slug: ",M]}):null]}),l.jsxs("div",{className:"setup-field",children:[l.jsx("label",{className:"setup-label",htmlFor:"new-display-name",children:"Display name"}),l.jsx("input",{id:"new-display-name",className:"setup-input",type:"text",placeholder:"My Project",value:m,onChange:R=>v(R.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:y,onChange:R=>b(R.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:x,onChange:R=>w(R.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:S,onChange:R=>C(R.target.value.toLowerCase())})]})]})]}),A?l.jsx("p",{className:"text-rose-400 text-sm mt-3",children:A}):null,l.jsxs("div",{className:"flex items-center gap-3 mt-4",children:[l.jsx(le,{type:"button",disabled:!M||!y||k,onClick:U,children:k?"Creating...":"Create project"}),l.jsx(le,{type:"button",variant:"ghost",onClick:()=>d(!1),children:"Cancel"})]})]}):null,a.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:a.map(R=>{const T=R.recentRuns[0];return l.jsxs("tr",{className:"cursor-pointer",onClick:()=>r({to:"/projects/$projectId",params:{projectId:R.project.id}}),children:[l.jsxs("td",{children:[l.jsx(yt,{to:"/projects/$projectId",params:{projectId:R.project.id},className:"text-zinc-100 font-medium hover:underline",onClick:q=>q.stopPropagation(),children:R.project.displayName||R.project.name}),l.jsx("p",{className:"text-[11px] text-zinc-500",children:R.project.name})]}),l.jsx("td",{className:"text-zinc-400",children:R.project.canonicalDomain}),l.jsx("td",{children:l.jsx(tt,{tone:R.visibilitySummary.tone,children:R.visibilitySummary.value})}),l.jsx("td",{className:"text-zinc-500 text-sm",children:T?l.jsx($u,{status:T.status}):l.jsx("span",{className:"text-zinc-600",children:"No runs"})}),l.jsx("td",{className:"text-right text-zinc-500",children:R.project.country})]},R.project.id)})})]})}):c?null:l.jsxs(Le,{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:()=>d(!0),children:[l.jsx(Eb,{className:"size-4 mr-1.5"}),"Add project"]})]}),l.jsx(N3,{onApplied:()=>{s()}})]})}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 QN({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($u,{status:e.status})]}),l.jsx("p",{className:"run-row-detail",children:e.statusDetail})]}),l.jsxs("dl",{className:"run-row-meta",children:[l.jsxs("div",{children:[l.jsx("dt",{children:"Started"}),l.jsx("dd",{children:e.startedAt})]}),l.jsxs("div",{children:[l.jsx("dt",{children:"Duration"}),l.jsx("dd",{children:e.duration})]}),l.jsxs("div",{children:[l.jsx("dt",{children:"Trigger"}),l.jsx("dd",{children:e.triggerLabel})]})]}),l.jsx(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,v=Number.parseInt(e,10),y=d&&!Number.isNaN(v)?Math.min(v/100,1):.5,b=m*(1-y);return l.jsxs("div",{className:"score-gauge",children:[l.jsxs("div",{className:"gauge-ring-wrapper",children:[l.jsxs("svg",{className:"gauge-ring",viewBox:"0 0 120 120","aria-hidden":"true",children:[l.jsx("circle",{className:"gauge-bg",cx:"60",cy:"60",r:48,strokeWidth:6}),l.jsx("circle",{className:`gauge-fill gauge-fill-${a}`,cx:"60",cy:"60",r:48,strokeWidth:6,strokeDasharray:m,strokeDashoffset:b,transform:"rotate(-90 60 60)"})]}),l.jsx("div",{className:"gauge-center",children:l.jsx("span",{className:d?"gauge-value":"gauge-value-text",children:e.split(" / ")[0]})})]}),l.jsxs("p",{className:"gauge-label",children:[t,c&&l.jsx(Ko,{text:c})]}),l.jsx("p",{className:"gauge-delta",children:s}),l.jsx("p",{className:"gauge-description",children:r})]})}function $x({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 k3(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 _3({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(w=>w.citationState),v=m.includes("cited")?"cited":m.includes("emerging")?"emerging":m.includes("lost")?"lost":m.every(w=>w==="pending")?"pending":"not-cited",y=k3(f),b=f.filter(w=>w.citationState==="cited"||w.citationState==="emerging").length,x=(()=>{if(y.length===0)return"Awaiting first run";if(y.length===1)return"First observation";const w=y[y.length-1].citationState,S=y[y.length-2].citationState;if(S!=="cited"&&w==="cited")return"Newly cited";if(S==="cited"&&w!=="cited")return"Lost since last run";let C=0;for(let k=y.length-1;k>=0&&y[k].citationState===w;k--)C++;return w==="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(Lu,{size:14,className:`transition-transform duration-150 text-zinc-500 ${p?"rotate-90":""}`})}),l.jsx("td",{className:"evidence-keyword-cell",children:l.jsxs("div",{children:[l.jsx("span",{className:"font-medium text-zinc-100",children:d}),l.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:f.map(w=>l.jsx(Wo,{provider:w.provider},w.id))})]})}),l.jsx("td",{children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(wm,{state:v}),l.jsxs("span",{className:"text-[11px] text-zinc-500",children:[b,"/",f.length]})]})}),l.jsx("td",{children:l.jsx($x,{history:y})}),l.jsx("td",{className:"evidence-change-cell",children:x}),l.jsx("td",{})]}),p&&f.map(w=>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:w.provider})}),l.jsx("td",{children:l.jsx(wm,{state:w.citationState})}),l.jsx("td",{children:l.jsx($x,{history:w.runHistory})}),l.jsx("td",{className:"evidence-change-cell",children:w.changeLabel}),l.jsx("td",{children:l.jsx(le,{variant:"ghost",size:"sm",type:"button",onClick:S=>{S.stopPropagation(),t(w.id)},children:"View"})})]},w.id))]},d)})})]})})}function z3({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(tt,{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 E3=["7d","30d","90d","all"],A3=["gap","cited","uncited"],YN={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 R3({projectName:e}){const[t,s]=N.useState("30d"),[a,r]=N.useState(null),[c,d]=N.useState(null),[f,p]=N.useState(null),[m,v]=N.useState(null),[y,b]=N.useState(!0);return N.useEffect(()=>{let x=!1;return b(!0),Promise.all([sN(e,t),iN(e,t),aN(e,t)]).then(([w,S,C])=>{x||(r(w),d(S),p(C),b(!1))}).catch(()=>{x||b(!1)}),()=>{x=!0}},[e,t]),y&&!a?l.jsx("p",{className:"text-sm text-zinc-500 py-8 text-center",children:"Loading analytics…"}):l.jsxs(l.Fragment,{children:[l.jsxs("section",{children:[l.jsxs("div",{className:"flex items-center justify-between mb-4",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Citation Metrics"}),l.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Citation Rate Trends ",l.jsx(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:E3.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(tt,{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,w])=>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:[(w.citationRate*100).toFixed(1),"%"]}),l.jsxs("td",{className:"py-1.5 text-right text-zinc-400",children:[w.cited," / ",w.total]})]},x))})]})]})]}),a.buckets.length>=1&&l.jsx(T3,{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:A3.map(x=>{const w=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:()=>v(S?null:x),children:[x==="gap"?"Gap":x==="cited"?"Cited":"Not Cited"," (",w,")"]},x)})}),l.jsx(O3,{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(D3,{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 ${YN[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(w=>w.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 T3({buckets:e}){const[t,s]=N.useState(null),a=600,r=140,c={top:24,right:10,bottom:20,left:40},d=a-c.left-c.right,f=r-c.top-c.bottom,p=1,m=e.map((y,b)=>{const x=c.left+(e.length>1?b/(e.length-1)*d:d/2),w=c.top+f-y.citationRate/p*f;return{x,y:w}}),v=m.map(y=>`${y.x},${y.y}`).join(" ");return l.jsx("div",{className:"surface-card rounded-lg p-3 border border-zinc-800/60",children:l.jsxs("svg",{viewBox:`0 0 ${a} ${r}`,className:"w-full h-auto","aria-label":"Citation rate trend chart",onMouseLeave:()=>s(null),children:[l.jsxs("text",{x:c.left-4,y:c.top+4,textAnchor:"end",className:"fill-zinc-500",fontSize:"9",children:[(p*100).toFixed(0),"%"]}),l.jsx("text",{x:c.left-4,y:c.top+f+4,textAnchor:"end",className:"fill-zinc-500",fontSize:"9",children:"0%"}),l.jsx("line",{x1:c.left,y1:c.top+f,x2:c.left+d,y2:c.top+f,stroke:"currentColor",className:"text-zinc-800",strokeWidth:"0.5"}),l.jsx("polyline",{fill:"none",stroke:"currentColor",className:"text-emerald-500",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",points:v}),t!==null&&l.jsx("line",{x1:m[t].x,y1:c.top,x2:m[t].x,y2:c.top+f,stroke:"currentColor",className:"text-zinc-600",strokeWidth:"0.5",strokeDasharray:"3 2"}),e.map((y,b)=>{const{x,y:w}=m[b],S=t===b;return l.jsxs("g",{children:[l.jsx("circle",{cx:x,cy:w,r:"10",fill:"transparent",onMouseEnter:()=>s(b),style:{cursor:"pointer"}}),l.jsx("circle",{cx:x,cy:w,r:S?5:3,className:S?"fill-emerald-400":"fill-emerald-500"})]},b)}),t!==null&&(()=>{const y=e[t],{x:b,y:x}=m[t],w=`${(y.citationRate*100).toFixed(1)}%`,S=y.startDate.slice(5,10),C=56,k=30,E=Math.max(c.left,Math.min(b-C/2,a-c.right-C)),A=x-k-8;return l.jsxs("g",{children:[l.jsx("rect",{x:E,y:A,width:C,height:k,rx:"4",className:"fill-zinc-800",stroke:"currentColor",strokeWidth:"0.5"}),l.jsx("text",{x:E+C/2,y:A+13,textAnchor:"middle",className:"fill-zinc-50",fontSize:"11",fontWeight:"600",children:w}),l.jsx("text",{x:E+C/2,y:A+24,textAnchor:"middle",className:"fill-zinc-400",fontSize:"8",children:S})]})})(),e.map((y,b)=>({b:y,i:b})).filter(({i:y})=>y===0||y===e.length-1||e.length<=7).map(({b:y,i:b})=>{const x=m[b].x;return l.jsx("text",{x,y:r-2,textAnchor:"middle",className:"fill-zinc-500",fontSize:"8",children:y.startDate.slice(5,10)},b)})]})})}function O3({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(tt,{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 D3({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:`${YN[s.category]??"bg-zinc-600"} transition-all`,style:{width:`${a}%`},title:`${s.label}: ${(s.percentage*100).toFixed(1)}%`},s.category)})})}function L3({projectName:e}){const[t,s]=N.useState(!1),[a,r]=N.useState([]),[c,d]=N.useState([]),[f,p]=N.useState([]),[m,v]=N.useState([]),[y,b]=N.useState([]),[x,w]=N.useState(null),[S,C]=N.useState(""),[k,E]=N.useState(""),[A,z]=N.useState("30"),[M,U]=N.useState(!1),[R,T]=N.useState({startDate:"",endDate:"",query:"",page:"",limit:"20"}),[q,W]=N.useState(""),[Q,ne]=N.useState(!0),[me,ke]=N.useState(!1),[je,B]=N.useState(!1),[O,ae]=N.useState(!1),[pe,te]=N.useState(!1),[D,G]=N.useState(!1),[se,oe]=N.useState(!1),[ce,he]=N.useState(!1),[de,Fe]=N.useState(null),[ge,Je]=N.useState(!1),[mt,fe]=N.useState(!1),[Xe,ct]=N.useState(!1),[nn,_t]=N.useState(!1),[sn,Vt]=N.useState(null),[zt,xt]=N.useState(""),[hn,re]=N.useState(!1),[$e,Pe]=N.useState(!1),[ze,De]=N.useState("indexed"),[pt,an]=N.useState([]),[Ss,Ks]=N.useState(null),[js,Vs]=N.useState(!1),[ls,_e]=N.useState(null),[Ht,Ge]=N.useState(null),ie=a.find(P=>P.connectionType==="gsc"),Yn=f.length>0||m.length>0||y.length>0;async function pl(P){if(!P){d([]),C("");return}ae(!0);try{const{sites:ue}=await Mw(e);d(ue),C(P.propertyId??ue[0]?.siteUrl??"")}catch(ue){d([]),_e(ue instanceof Error?ue.message:"Failed to load Search Console properties")}finally{ae(!1)}}async function Qs(){G(!0);try{const P=await Iw(e,{startDate:R.startDate||void 0,endDate:R.endDate||void 0,query:R.query||void 0,page:R.page||void 0,limit:parseInt(R.limit,10)||20});p(P)}catch(P){p([]),_e(P instanceof Error?P.message:"Failed to load GSC performance data")}finally{G(!1)}}async function ws(){oe(!0);try{const[P,ue]=await Promise.all([qw(e,{url:q.trim()||void 0,limit:20}),Hw(e)]);v(P),b(ue)}catch(P){v([]),b([]),_e(P instanceof Error?P.message:"Failed to load GSC inspection history")}finally{oe(!1)}}async function Zi(){Je(!0);try{const[P,ue]=await Promise.all([_p(e),Zw(e).catch(()=>[])]);Fe(P),an(ue)}catch(P){Fe(null),an([]),_e(P instanceof Error?P.message:"Failed to load coverage data")}finally{Je(!1)}}async function cs(P){Vs(!0),_e(null);try{const ue=await _m(e,{urls:P}),{succeeded:st,failed:Qt,total:Lt}=ue.summary;Ge(Qt===0?`Indexing requested for ${st} URL${st!==1?"s":""}.`:`Indexing requested: ${st}/${Lt} succeeded, ${Qt} failed.`)}catch(ue){_e(ue instanceof Error?ue.message:"Failed to request indexing")}finally{Vs(!1)}}async function Ra(){Vs(!0),_e(null);try{const P=await _m(e,{urls:[],allUnindexed:!0}),{succeeded:ue,failed:st,total:Qt}=P.summary;Ge(st===0?`Indexing requested for ${ue} unindexed URL${ue!==1?"s":""}.`:`Indexing requested: ${ue}/${Qt} succeeded, ${st} failed.`)}catch(P){_e(P instanceof Error?P.message:"Failed to request indexing")}finally{Vs(!1)}}async function us(){if(zt.trim()){re(!0),_e(null);try{await $w(e,"gsc",zt.trim()),r(P=>P.map(ue=>ue.connectionType==="gsc"?{...ue,sitemapUrl:zt.trim()}:ue)),Ge("Sitemap URL saved."),xt("")}catch(P){_e(P instanceof Error?P.message:"Failed to save sitemap URL")}finally{re(!1)}}}async function gl(){ct(!0),_e(null);try{const P=await Kw(e);Vt(P.sitemaps),r(ue=>ue.map(st=>st.connectionType==="gsc"?{...st,sitemapUrl:P.primarySitemapUrl}:st)),Ge(`Discovered ${P.sitemaps.length} sitemap(s). Primary sitemap saved and inspection queued (run ${P.run.id}).`)}catch(P){_e(P instanceof Error?P.message:"Failed to discover sitemaps")}finally{ct(!1)}}async function yl(){_t(!0),_e(null);try{const P=await Gw(e);Vt(P.sitemaps),P.sitemaps.length===0&&Ge("No sitemaps found in this GSC property. Submit a sitemap in Google Search Console first.")}catch(P){_e(P instanceof Error?P.message:"Failed to list sitemaps")}finally{_t(!1)}}async function Ta(){ne(!0),_e(null);try{const[P,ue]=await Promise.all([Gu().catch(()=>null),kp(e).catch(()=>[])]);s(!!P?.google?.configured),r(ue);const st=ue.find(Qt=>Qt.connectionType==="gsc");await Promise.all([pl(st),Qs(),ws(),Zi()])}finally{ne(!1)}}N.useEffect(()=>{Ta()},[e]);async function Fi(){if(!t){_e("Google OAuth app credentials are not configured yet. Set them on the Settings page first.");return}ke(!0),_e(null),Ge(null);try{const{authUrl:P}=await Dw(e,"gsc");if(!P.startsWith("https://accounts.google.com/")){_e("Unexpected OAuth redirect URL. Please try again.");return}const ue=window.open(P,"_blank","width=600,height=700");if(!ue){window.location.assign(P);return}Ge("Finish the Google consent flow in the popup, then close it to refresh this project.");const st=window.setInterval(()=>{ue.closed&&(window.clearInterval(st),Ge(null),Ta())},1e3)}catch(P){_e(P instanceof Error?P.message:"Failed to start OAuth flow")}finally{ke(!1)}}async function rd(){_e(null),Ge(null);try{await Lw(e,"gsc"),r(P=>P.filter(ue=>ue.connectionType!=="gsc")),d([]),C("")}catch(P){_e(P instanceof Error?P.message:"Failed to disconnect")}}async function vl(){if(S){te(!0),_e(null);try{await Uw(e,"gsc",S),r(P=>P.map(ue=>ue.connectionType==="gsc"?{...ue,propertyId:S}:ue)),Ge("GSC property updated.")}catch(P){_e(P instanceof Error?P.message:"Failed to save GSC property")}finally{te(!1)}}}async function bl(){B(!0),_e(null),Ge(null);try{await Pw(e,{days:parseInt(A,10)||void 0,full:M||void 0}),Ge("GSC sync queued. Refresh after the run completes to see imported data.")}catch(P){_e(P instanceof Error?P.message:"Failed to trigger sync")}finally{B(!1)}}async function qr(){if(k.trim()){he(!0),_e(null),Ge(null);try{const P=await Bw(e,k.trim());w(P),E(""),await ws()}catch(P){_e(P instanceof Error?P.message:"Failed to inspect URL")}finally{he(!1)}}}return l.jsxs("section",{className:"page-section-divider",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Search Console"}),l.jsx("h2",{children:"Google Search Console"})]}),l.jsx("div",{className:"flex items-center gap-2",children:ie&&l.jsx(le,{type:"button",variant:"outline",size:"sm",disabled:D,onClick:()=>{Qs()},children:D?"Refreshing…":"Refresh data"})})]}),ls&&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:[ls,l.jsx("button",{type:"button",className:"ml-2 text-rose-400 hover:text-rose-200",onClick:()=>_e(null),children:"×"})]}),Ht&&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:[Ht,l.jsx("button",{type:"button",className:"ml-2 text-emerald-400 hover:text-emerald-200",onClick:()=>Ge(null),children:"×"})]}),Q?l.jsx("p",{className:"text-sm text-zinc-500",children:"Loading…"}):l.jsxs("div",{className:"space-y-3",children:[l.jsxs(Le,{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(tt,{tone:ie?"positive":t?"caution":"negative",children:ie?"Connected":t?"Ready to connect":"App credentials missing"})]}),ie?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:ie.domain}),l.jsx("button",{type:"button",className:"ml-auto text-xs text-zinc-500 hover:text-rose-400 transition-colors",onClick:rd,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:ie.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:ie.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:vs(ie.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:Fi,children:me?"Opening…":"Connect Google Search Console"}):l.jsx(le,{type:"button",variant:"outline",size:"sm",asChild:!0,children:l.jsx(yt,{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."})]})]})]}),ie&&!ie.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:Xe||!ie.propertyId,onClick:gl,children:Xe?"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:zt,onChange:P=>xt(P.target.value),onKeyDown:P=>P.key==="Enter"&&void us()}),l.jsx(le,{type:"button",size:"sm",variant:"outline",disabled:hn||!zt.trim(),onClick:us,children:hn?"Saving…":"Save sitemap URL"})]})]})]})]})}),(ie||Yn)&&l.jsxs(l.Fragment,{children:[l.jsxs(Le,{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:js,onClick:()=>{Ra()},children:js?"Requesting…":`Request indexing (${de.notIndexed.length})`}),l.jsx(le,{type:"button",variant:"outline",size:"sm",disabled:ge,onClick:()=>{Zi()},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 P=de.summary.indexed+de.summary.notIndexed,ue=P>0?de.summary.indexed/P:0,st=P>0?de.summary.notIndexed/P:0,Qt=54,Lt=2*Math.PI*Qt,Et=Lt*(1-ue),Nt=Lt*st,Cn=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:Qt,fill:"none",stroke:"rgba(255,255,255,0.04)",strokeWidth:"14"}),l.jsx("circle",{cx:"64",cy:"64",r:Qt,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:Qt,fill:"none",stroke:"#52525b",strokeWidth:"14",strokeDasharray:`${Nt} ${Lt-Nt}`,strokeDashoffset:-Cn,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(P=>{const ue=P==="indexed"?de.indexed.length:P==="notIndexed"?de.notIndexed.length:de.deindexed.length,st=P==="indexed"?"Indexed":P==="notIndexed"?"Not Indexed":"Deindexed";return l.jsxs("button",{type:"button",className:`rounded-full px-3 py-1 text-xs font-medium transition-colors ${ze===P?"bg-zinc-700 text-zinc-100":"text-zinc-400 hover:bg-zinc-800 hover:text-zinc-200"}`,onClick:()=>{De(P),Ks(null)},children:[st," (",ue,")"]},P)})}),l.jsxs("div",{className:"mt-3 overflow-x-auto",children:[ze==="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(P=>l.jsxs("tr",{children:[l.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:P.url}),l.jsx("td",{className:"text-zinc-400",children:P.verdict??"Unknown"}),l.jsx("td",{className:"text-zinc-400",children:P.crawlTime?P.crawlTime.split("T")[0]:"—"}),l.jsx("td",{className:"text-zinc-400",children:P.isMobileFriendly===!0?"Yes":P.isMobileFriendly===!1?"No":"—"})]},P.id))})]}),ze==="notIndexed"&&!Ss&&(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(P=>l.jsxs("tr",{className:"cursor-pointer hover:bg-zinc-800/40",onClick:()=>Ks(P.reason),children:[l.jsx("td",{className:"text-zinc-200",children:P.reason}),l.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:P.count})]},P.reason))})]}),ze==="notIndexed"&&!Ss&&(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(P=>l.jsxs("tr",{children:[l.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:P.url}),l.jsx("td",{className:"text-zinc-400",children:P.indexingState??"Unknown"}),l.jsx("td",{className:"text-zinc-400",children:P.coverageState??"Unknown"})]},P.id))})]}),ze==="notIndexed"&&Ss&&(()=>{const P=(de.reasonGroups??[]).find(ue=>ue.reason===Ss);return P?l.jsxs("div",{children:[l.jsx("div",{className:"flex items-center gap-2 mb-3",children:l.jsx("button",{type:"button",className:"text-xs text-zinc-400 hover:text-zinc-200 transition-colors",onClick:()=>Ks(null),children:"\\u2190 Back to reasons"})}),l.jsxs("div",{className:"mb-3 flex items-center justify-between rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium text-zinc-200",children:P.reason}),l.jsxs("p",{className:"mt-1 text-xs text-zinc-500",children:[P.count," affected page",P.count!==1?"s":""]})]}),l.jsx(le,{type:"button",variant:"outline",size:"sm",disabled:js,onClick:()=>{cs(P.urls.map(ue=>ue.url))},children:js?"Requesting…":`Request indexing (${P.count})`})]}),l.jsxs("table",{className:"data-table w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{className:"text-left",children:"URL"}),l.jsx("th",{className:"text-left",children:"Last Crawl"}),l.jsx("th",{className:"w-8"})]})}),l.jsx("tbody",{children:P.urls.map(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:js,onClick:()=>{cs([ue.url])},title:"Request indexing",children:"Index"})})]},ue.id))})]})]}):null})(),ze==="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((P,ue)=>l.jsxs("tr",{children:[l.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:P.url}),l.jsx("td",{className:"text-zinc-400",children:P.previousState}),l.jsx("td",{className:"text-zinc-400",children:P.currentState}),l.jsx("td",{className:"text-zinc-400",children:P.transitionDate.split("T")[0]})]},`${P.url}-${ue}`))})]}),(ze==="indexed"&&de.indexed.length===0||ze==="notIndexed"&&!Ss&&de.notIndexed.length===0||ze==="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(Le,{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:D,onClick:()=>{Qs()},children:D?"Loading…":"Apply filters"})]}),f.length>0&&(()=>{const P=new Map;for(const Ie of f){const it=P.get(Ie.date);it?(it.clicks+=Ie.clicks,it.impressions+=Ie.impressions):P.set(Ie.date,{clicks:Ie.clicks,impressions:Ie.impressions})}const ue=[...P.entries()].sort(([Ie],[it])=>Ie.localeCompare(it));if(ue.length===0)return null;const st=Math.max(...ue.map(([,Ie])=>Ie.impressions),1),Qt=ue.reduce((Ie,[,it])=>Ie+it.clicks,0),Lt=ue.reduce((Ie,[,it])=>Ie+it.impressions,0),Et=Lt>0?(Qt/Lt*100).toFixed(1):"0.0",Nt=700,Cn=220,en={top:12,bottom:36,left:48,right:12},od=Nt-en.left-en.right,Ys=Cn-en.top-en.bottom,Js=od/ue.length,ds=Math.max(Math.min(Js*.35,24),4),Oa=Math.max(ds*.15,1),Xs=Ie=>{if(Ie<=0)return 1;const it=Math.pow(10,Math.floor(Math.log10(Ie))),Zt=Ie/it,rn=Zt<=1.5?1.5:Zt<=3?3:Zt<=5?5:10;return Math.ceil(rn*it)},Jn=4,fs=Math.ceil(Xs(st)/Jn)*Jn,Ws=Array.from({length:Jn+1},(Ie,it)=>fs/Jn*it),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:Qt.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:`${Nt} / ${Cn}`},children:l.jsxs("svg",{viewBox:`0 0 ${Nt} ${Cn}`,className:"h-full w-full",children:[Ws.map((Ie,it)=>{const Zt=en.top+Ys-Ie/fs*Ys;return l.jsxs("g",{children:[l.jsx("line",{x1:en.left,y1:Zt,x2:Nt-en.right,y2:Zt,stroke:"rgba(255,255,255,0.06)",strokeWidth:"1"}),l.jsx("text",{x:en.left-6,y:Zt+3.5,textAnchor:"end",fill:"#a1a1aa",fontSize:"10",fontFamily:"inherit",children:Mt(Ie)})]},`t-${it}`)}),ue.map(([Ie,it],Zt)=>{const rn=en.left+Js*Zt+Js/2,Da=it.impressions/fs*Ys,Hr=it.clicks/fs*Ys;return l.jsxs("g",{children:[l.jsx("title",{children:`${Ie}
234
- Clicks: ${it.clicks}
235
- Impressions: ${it.impressions}
236
- CTR: ${it.impressions>0?(it.clicks/it.impressions*100).toFixed(1):0}%`}),l.jsx("rect",{x:rn-ds-Oa/2,y:en.top+Ys-Da,width:ds,height:Math.max(Da,1),rx:2,fill:"#3b82f6",opacity:.85}),l.jsx("rect",{x:rn+Oa/2,y:en.top+Ys-Hr,width:ds,height:Math.max(Hr,1),rx:2,fill:"#10b981",opacity:.85})]},Ie)}),(()=>{const Ie=Math.min(ue.length,7);return Array.from({length:Ie},(it,Zt)=>{const rn=ue.length===1?0:Math.round(Zt/(Ie-1)*(ue.length-1)),Da=en.left+Js*rn+Js/2;return l.jsx("text",{x:Da,y:Cn-8,textAnchor:"middle",fill:"#71717a",fontSize:"10",fontFamily:"inherit",children:ue[rn][0].slice(5)},`xl-${rn}`)})})()]})})]})})(),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:R.startDate,onChange:P=>T(ue=>({...ue,startDate:P.target.value}))}),l.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"date",value:R.endDate,onChange:P=>T(ue=>({...ue,endDate:P.target.value}))}),l.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"Filter query",value:R.query,onChange:P=>T(ue=>({...ue,query:P.target.value}))}),l.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"Filter page",value:R.page,onChange:P=>T(ue=>({...ue,page:P.target.value}))}),l.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"number",min:"1",placeholder:"Limit",value:R.limit,onChange:P=>T(ue=>({...ue,limit:P.target.value}))})]}),f.length>0?l.jsx("div",{className:"mt-3 overflow-x-auto",children:l.jsxs("table",{className:"data-table w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{className:"text-left",children:"Date"}),l.jsx("th",{className:"text-left",children:"Query"}),l.jsx("th",{className:"text-left",children:"Page"}),l.jsx("th",{className:"text-right",children:"Clicks"}),l.jsx("th",{className:"text-right",children:"Impressions"}),l.jsx("th",{className:"text-right",children:"CTR"}),l.jsx("th",{className:"text-right",children:"Position"})]})}),l.jsx("tbody",{children:f.map((P,ue)=>l.jsxs("tr",{children:[l.jsx("td",{className:"text-zinc-400",children:P.date}),l.jsx("td",{className:"max-w-xs truncate text-zinc-200",children:P.query}),l.jsx("td",{className:"max-w-xs truncate text-zinc-400",children:P.page}),l.jsx("td",{className:"text-right tabular-nums text-zinc-300",children:P.clicks.toLocaleString()}),l.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:P.impressions.toLocaleString()}),l.jsxs("td",{className:"text-right tabular-nums text-zinc-400",children:[(P.ctr*100).toFixed(1),"%"]}),l.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:P.position.toFixed(1)})]},`${P.date}:${P.query}:${P.page}:${ue}`))})]})}):l.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No performance rows match the current filters yet."})]}),l.jsxs(Le,{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:k,onChange:P=>E(P.target.value),onKeyDown:P=>P.key==="Enter"&&void qr()}),l.jsx(le,{type:"button",size:"sm",disabled:ce||!ie?.propertyId||!k.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:Ab(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:vs(x.crawlTime)})]})]})]}),l.jsxs(Le,{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:se,onClick:()=>{ws()},children:se?"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:q,onChange:P=>W(P.target.value)}),l.jsx(le,{type:"button",size:"sm",variant:"outline",disabled:se,onClick:()=>{ws()},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(P=>l.jsxs("tr",{children:[l.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:P.url}),l.jsx("td",{className:"text-zinc-300",children:P.indexingState??"Unknown"}),l.jsx("td",{className:"text-zinc-400",children:P.verdict??"Unknown"}),l.jsx("td",{className:"text-zinc-400",children:P.coverageState??"Unknown"}),l.jsx("td",{className:"text-zinc-400",children:Ab(P.isMobileFriendly)}),l.jsx("td",{className:"text-zinc-400",children:vs(P.inspectedAt)})]},P.id))})]})}):l.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No inspection history yet."})]}),l.jsxs(Le,{className:"surface-card",children:[l.jsx("div",{className:"section-head",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Deindexed"}),l.jsx("h3",{children:"Recent indexing losses"})]})}),y.length>0?l.jsx("div",{className:"mt-3 overflow-x-auto",children:l.jsxs("table",{className:"data-table w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{className:"text-left",children:"URL"}),l.jsx("th",{className:"text-left",children:"Previous"}),l.jsx("th",{className:"text-left",children:"Current"}),l.jsx("th",{className:"text-left",children:"Changed at"})]})}),l.jsx("tbody",{children:y.map(P=>l.jsxs("tr",{children:[l.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:P.url}),l.jsx("td",{className:"text-zinc-400",children:P.previousState??"Unknown"}),l.jsx("td",{className:"text-zinc-300",children:P.currentState??"Unknown"}),l.jsx("td",{className:"text-zinc-400",children:vs(P.transitionDate)})]},`${P.url}:${P.transitionDate}`))})]})}):l.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No deindexed transitions recorded."})]})]}),ie&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"border-t border-zinc-800/60 pt-3",children:l.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 text-left",onClick:()=>Pe(P=>!P),children:[l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:`h-4 w-4 text-zinc-500 transition-transform ${$e?"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"})]})}),$e&&l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"grid gap-3 xl:grid-cols-2",children:[l.jsxs(Le,{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:O||c.length===0,onChange:P=>C(P.target.value),children:c.length===0?l.jsx("option",{value:"",children:O?"Loading properties…":"No properties available"}):c.map(P=>l.jsxs("option",{value:P.siteUrl,children:[P.siteUrl," · ",P.permissionLevel]},P.siteUrl))}),l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsx(le,{type:"button",size:"sm",variant:"outline",disabled:O,onClick:()=>{pl(ie)},children:O?"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(Le,{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:A,onChange:P=>z(P.target.value)})]}),l.jsxs("label",{className:"flex items-center gap-2 rounded border border-zinc-800/60 bg-zinc-900/20 px-3 py-2 text-sm text-zinc-300",children:[l.jsx("input",{type:"checkbox",checked:M,onChange:P=>U(P.target.checked)}),"Replace existing imported rows for the requested range"]})]}),l.jsx(le,{type:"button",size:"sm",disabled:je||!ie.propertyId,onClick:bl,children:je?"Queueing…":"Queue sync"}),!ie.propertyId&&l.jsx("p",{className:"text-xs text-amber-400",children:"Select a Search Console property before queueing a sync."})]})]})]}),l.jsxs(Le,{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:[ie.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:ie.sitemapUrl})]}),l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsx(le,{type:"button",size:"sm",variant:"outline",disabled:nn||!ie.propertyId,onClick:()=>{yl()},children:nn?"Loading…":"Browse sitemaps from GSC"}),l.jsx(le,{type:"button",size:"sm",variant:"outline",disabled:Xe||!ie.propertyId,onClick:gl,children:Xe?"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."}),sn&&sn.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 (",sn.length,")"]}),sn.map(P=>{const ue=P.contents?.[0];return l.jsxs("div",{className:"flex items-start justify-between gap-2 text-xs",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-zinc-200 break-all",children:P.path}),P.lastSubmitted&&l.jsxs("p",{className:"text-zinc-500",children:["Submitted: ",P.lastSubmitted.split("T")[0]]})]}),l.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[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:()=>xt(P.path),children:"Use"})]})]},P.path)})]}),l.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[l.jsx("input",{className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"url",placeholder:ie.sitemapUrl?"Update sitemap URL…":"https://example.com/sitemap.xml",value:zt,onChange:P=>xt(P.target.value),onKeyDown:P=>P.key==="Enter"&&zt.trim()&&void us()}),l.jsx(le,{type:"button",size:"sm",disabled:hn||!zt.trim(),onClick:us,children:hn?"Saving…":ie.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||!ie.propertyId,onClick:()=>{const ue=document.getElementById(`gsc-sitemap-inspect-${e}`)?.value?.trim()||ie.sitemapUrl||void 0;fe(!0),Fw(e,{sitemapUrl:ue}).then(st=>{Ge(`Sitemap inspection queued (run ${st.id}). Refresh coverage after the run completes.`)}).catch(st=>{_e(st instanceof Error?st.message:"Failed to queue sitemap inspection")}).finally(()=>fe(!1))},children:mt?"Queueing…":"Inspect sitemap"})]}),!ie.propertyId&&l.jsx("p",{className:"text-xs text-amber-400",children:"Select a Search Console property first."})]})]})]})]})]})]})}function M3({project:e,onUpdateProject:t,onRefresh:s}){const[a,r]=N.useState(!1),[c,d]=N.useState(!1),[f,p]=N.useState(null),[m,v]=N.useState(e.displayName),[y,b]=N.useState(e.canonicalDomain),[x,w]=N.useState(e.country),[S,C]=N.useState(e.language),[k,E]=N.useState(e.ownedDomains??[]),[A,z]=N.useState(""),[M,U]=N.useState(null),[R,T]=N.useState(!1),[q,W]=N.useState(!1),[Q,ne]=N.useState(""),[me,ke]=N.useState(""),[je,B]=N.useState(""),[O,ae]=N.useState(""),[pe,te]=N.useState("");N.useEffect(()=>{a||(v(e.displayName),b(e.canonicalDomain),w(e.country),C(e.language),E(e.ownedDomains??[]))},[e,a]);function D(){r(!1),p(null),v(e.displayName),b(e.canonicalDomain),w(e.country),C(e.language),E(e.ownedDomains??[]),z("")}function G(){const fe=A.trim();fe&&(k.includes(fe)||E([...k,fe]),z(""))}function se(fe){E(k.filter(Xe=>Xe!==fe))}async function oe(){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:k,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(),Xe=me.trim(),ct=je.trim(),nn=O.trim();if(!(!fe||!Xe||!ct||!nn)){T(!0),U(null);try{const _t={label:fe,city:Xe,region:ct,country:nn};pe.trim()&&(_t.timezone=pe.trim()),await bw(e.name,_t),s(),ne(""),ke(""),B(""),ae(""),te(""),W(!1)}catch(_t){U(_t instanceof Error?_t.message:"Failed to add location")}finally{T(!1)}}}async function he(fe){T(!0),U(null);try{await xw(e.name,fe),s()}catch(Xe){U(Xe instanceof Error?Xe.message:"Failed to remove location")}finally{T(!1)}}async function de(fe){T(!0),U(null);try{await Sw(e.name,fe),s()}catch(Xe){U(Xe instanceof Error?Xe.message:"Failed to set default location")}finally{T(!1)}}const Fe=m!==e.displayName||y!==e.canonicalDomain||x!==e.country||S!==e.language||JSON.stringify(k)!==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",Je="block text-xs font-medium text-zinc-400 mb-1",mt=Q.trim()&&me.trim()&&je.trim()&&O.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:Je,children:"Display name"}),l.jsx("input",{className:ge,type:"text",value:m,onChange:fe=>v(fe.target.value),placeholder:"My Project"})]}),l.jsxs("div",{children:[l.jsx("label",{className:Je,children:"Canonical domain"}),l.jsx("input",{className:ge,type:"text",value:y,onChange:fe=>b(fe.target.value),placeholder:"example.com"})]}),l.jsxs("div",{children:[l.jsx("label",{className:Je,children:"Country"}),l.jsx("input",{className:ge,type:"text",value:x,onChange:fe=>w(fe.target.value),placeholder:"US",maxLength:2})]}),l.jsxs("div",{children:[l.jsx("label",{className:Je,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:Je,children:"Owned domains"}),l.jsx("div",{className:"flex flex-wrap gap-1.5 mb-2",children:k.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:()=>se(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:A,onChange:fe=>z(fe.target.value),onKeyDown:fe=>fe.key==="Enter"&&(fe.preventDefault(),G())}),l.jsx(le,{type:"button",variant:"outline",size:"sm",disabled:!A.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||!Fe||!m.trim()||!y.trim(),onClick:oe,children:c?"Saving...":"Save changes"}),l.jsx(le,{type:"button",variant:"outline",disabled:c,onClick:D,children:"Cancel"})]})]}):l.jsx("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 overflow-hidden",children:l.jsx("table",{className:"w-full text-sm",children:l.jsxs("tbody",{children:[l.jsxs("tr",{className:"border-b border-zinc-800/40",children:[l.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium w-40",children:"Display name"}),l.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.displayName||"—"})]}),l.jsxs("tr",{className:"border-b border-zinc-800/40",children:[l.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Canonical domain"}),l.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.canonicalDomain})]}),l.jsxs("tr",{className:"border-b border-zinc-800/40",children:[l.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Owned domains"}),l.jsx("td",{className:"px-4 py-2.5",children:(e.ownedDomains??[]).length>0?l.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.ownedDomains.map(fe=>l.jsx("span",{className:"rounded-full border border-zinc-700/60 bg-zinc-800/40 px-2 py-0.5 text-xs text-zinc-300",children:fe},fe))}):l.jsx("span",{className:"text-zinc-500",children:"\\u2014"})})]}),l.jsxs("tr",{className:"border-b border-zinc-800/40",children:[l.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Country"}),l.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.country})]}),l.jsxs("tr",{className:"border-b border-zinc-800/40",children:[l.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Language"}),l.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.language})]}),l.jsxs("tr",{children:[l.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium align-top pt-3",children:"Locations"}),l.jsxs("td",{className:"px-4 py-2.5",children:[M&&l.jsxs("div",{className:"mb-2 rounded border border-rose-800/40 bg-rose-950/20 px-2 py-1 text-xs text-rose-300",children:[M,l.jsx("button",{type:"button",className:"ml-1 text-rose-400 hover:text-rose-200",onClick:()=>U(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:R,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:R,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"}),q?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=>ne(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=>ke(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:O,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:R||!mt,onClick:ce,children:R?"Adding...":"Add location"}),l.jsx(le,{type:"button",size:"sm",variant:"outline",disabled:R,onClick:()=>{W(!1),U(null)},children:"Cancel"})]})]}):l.jsx(le,{type:"button",size:"sm",variant:"outline",onClick:()=>W(!0),children:"+ Add location"})]})]})]})})})]})}const U3=[{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"}],Px=["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 $3({projectName:e}){const[t,s]=N.useState("loading"),[a,r]=N.useState(!1),[c,d]=N.useState("daily"),[f,p]=N.useState(6),[m,v]=N.useState(""),[y,b]=N.useState("UTC"),[x,w]=N.useState(!1),[S,C]=N.useState(""),[k,E]=N.useState(!1),[A,z]=N.useState(!1),[M,U]=N.useState(null);N.useEffect(()=>{kw(e).then(s).catch(()=>s(null))},[e]);const R=()=>{if(t&&t!=="loading"){const Q=R2(t.preset??null,t.cronExpr);d(Q.freq),p(Q.hour),v(Q.customCron);const ne=Px.includes(t.timezone);b(ne?t.timezone:"Other"),w(!ne),C(ne?"":t.timezone)}else d("daily"),p(6),v(""),b("UTC"),w(!1),C("");U(null),r(!0)},T=async()=>{E(!0),U(null);try{const ne={timezone:x?S.trim()||"UTC":y};c==="custom"?ne.cron=m.trim():ne.preset=A2(c,f);const me=await Cm(e,ne);s(me),r(!1)}catch(Q){U(Q instanceof Error?Q.message:"Failed to save schedule")}finally{E(!1)}},q=async()=>{if(!(!t||t==="loading")){E(!0),U(null);try{const Q={timezone:t.timezone,enabled:!t.enabled};t.preset?Q.preset=t.preset:Q.cron=t.cronExpr,s(await Cm(e,Q))}catch(Q){U(Q instanceof Error?Q.message:"Failed to update schedule")}finally{E(!1)}}},W=async()=>{z(!0),U(null);try{await _w(e),s(null),r(!1)}catch(Q){U(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:R,children:t?"Edit schedule":"+ Set schedule"})]}),t==="loading"&&l.jsx("p",{className:"supporting-copy",children:"Loading..."}),t!=="loading"&&!a&&t===null&&l.jsx(Le,{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(Le,{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:T2(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(tt,{tone:t.enabled?"positive":"neutral",children:t.enabled?"Active":"Paused"}),l.jsx(le,{type:"button",variant:"outline",size:"sm",disabled:k,onClick:q,children:t.enabled?"Pause":"Resume"}),l.jsx(le,{type:"button",variant:"ghost",size:"sm",disabled:A,onClick:W,children:A?"Removing...":"Remove"})]})]}),M&&l.jsx("p",{className:"text-rose-400 text-sm mt-2",children:M})]}),a&&l.jsxs("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900/40 p-4 space-y-3",children:[l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Frequency"}),l.jsx("select",{className:"w-full rounded border border-zinc-700 bg-zinc-900 px-2 py-1.5 text-sm text-zinc-200 focus:border-zinc-500 focus:outline-none",value:c,onChange:Q=>d(Q.target.value),children:U3.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,ne)=>l.jsx("option",{value:ne,children:hm(ne)},ne))})]})]}),c==="custom"&&l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Cron expression"}),l.jsx("input",{className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 font-mono focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"0 9 * * 1-5",value:m,onChange:Q=>v(Q.target.value)})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Timezone"}),l.jsxs("select",{className:"w-full rounded border border-zinc-700 bg-zinc-900 px-2 py-1.5 text-sm text-zinc-200 focus:border-zinc-500 focus:outline-none",value:x?"Other":y,onChange:Q=>{Q.target.value==="Other"?(w(!0),b("Other")):(w(!1),b(Q.target.value))},children:[Px.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)})]}),M&&l.jsx("p",{className:"text-rose-400 text-sm",children:M}),l.jsxs("div",{className:"flex gap-2 justify-end",children:[l.jsx(le,{type:"button",variant:"outline",size:"sm",onClick:()=>{r(!1),U(null)},children:"Cancel"}),l.jsx(le,{type:"button",size:"sm",disabled:k||c==="custom"&&!m.trim(),onClick:T,children:k?"Saving...":"Save schedule"})]})]})]})}const P3=[{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 I3({projectName:e}){const[t,s]=N.useState("loading"),[a,r]=N.useState(!1),[c,d]=N.useState(""),[f,p]=N.useState(["citation.lost","citation.gained"]),[m,v]=N.useState(!1),[y,b]=N.useState(null),[x,w]=N.useState({});N.useEffect(()=>{zw(e).then(s).catch(()=>s([]))},[e]);const S=A=>{p(z=>z.includes(A)?z.filter(M=>M!==A):[...z,A])},C=async()=>{if(!(!c.trim()||f.length===0)){v(!0),b(null);try{const A=await Ew(e,{channel:"webhook",url:c.trim(),events:f});s(z=>z==="loading"?[A]:[...z,A]),d(""),p(["citation.lost","citation.gained"]),r(!1)}catch(A){b(A instanceof Error?A.message:"Failed to add webhook")}finally{v(!1)}}},k=async A=>{try{await Aw(e,A),s(z=>z==="loading"?z:z.filter(M=>M.id!==A))}catch(z){b(z instanceof Error?z.message:"Failed to remove webhook")}},E=async A=>{w(z=>({...z,[A]:{state:"testing"}}));try{const z=await Rw(e,A);w(M=>({...M,[A]:{state:z.ok?"ok":"fail",status:z.status}}))}catch{w(z=>({...z,[A]:{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),b(null)},children:a?"Cancel":"+ Add webhook"})]}),a&&l.jsxs("div",{className:"mb-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-4 space-y-3",children:[l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Webhook URL"}),l.jsx("input",{className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"url",placeholder:"https://hooks.example.com/canonry",value:c,onChange:A=>d(A.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:P3.map(A=>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(A.value),onChange:()=>S(A.value)}),l.jsx("span",{className:"text-sm text-zinc-300",children:A.label})]},A.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),b(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(Le,{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(A=>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:A.url})}),l.jsx("td",{children:l.jsx("div",{className:"flex flex-wrap gap-1",children:A.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(tt,{tone:A.enabled?"positive":"neutral",children:A.enabled?"Active":"Paused"})}),l.jsx("td",{children:l.jsxs("div",{className:"flex items-center gap-1 justify-end",children:[x[A.id]&&(()=>{const z=x[A.id],M=z.state==="testing"?"Sending…":z.state==="ok"?`Delivered${z.status?` (${z.status})`:""}`:`Failed${z.status?` (${z.status})`:""}`;return l.jsx(tt,{tone:z.state==="ok"?"positive":z.state==="fail"?"negative":"neutral",children:M})})(),l.jsx(le,{variant:"ghost",size:"sm",type:"button",disabled:x[A.id]?.state==="testing",onClick:()=>E(A.id),children:"Test"}),l.jsx(le,{variant:"ghost",size:"sm",type:"button",onClick:()=>k(A.id),children:"Remove"})]})})]},A.id))})]}),y&&l.jsx("p",{className:"text-rose-400 text-sm mt-2",children:y})]})]})}function Ix({eyebrow:e,title:t,status:s,tone:a,targetLabel:r,targetValue:c,coverageValue:d,note:f,updatedAt:p,active:m,onClick:v}){return l.jsxs("button",{type:"button",onClick:v,className:`surface-card w-full text-left transition-colors ${m?"border-zinc-200 bg-zinc-900/50":"hover:border-zinc-700 hover:bg-zinc-900/40"}`,children:[l.jsxs("div",{className:"section-head",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:e}),l.jsx("h3",{children:t})]}),l.jsx(tt,{tone:a,children:s})]}),l.jsxs("div",{className:"mt-4 grid gap-3 sm: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:r}),l.jsx("p",{className:"mt-1 truncate text-sm text-zinc-200",children:c})]}),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:"Coverage"}),l.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:d})]})]}),l.jsxs("div",{className:"mt-3 flex flex-col gap-1 text-xs text-zinc-500 sm:flex-row sm:items-center sm:justify-between",children:[l.jsx("span",{children:f}),l.jsx("span",{children:p?`Updated ${vs(p)}`:"No recent sync yet"})]})]})}function Xh({label:e,value:t,tone:s}){const a=s==="positive"?"text-emerald-400":s==="negative"?"text-rose-400":"text-zinc-200";return 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:e}),l.jsx("p",{className:`mt-2 text-2xl font-semibold ${a}`,children:t})]})}function B3({projectName:e}){const[t,s]=N.useState(null),[a,r]=N.useState([]),[c,d]=N.useState(null),[f,p]=N.useState([]),[m,v]=N.useState([]),[y,b]=N.useState(null),[x,w]=N.useState(""),[S,C]=N.useState(""),[k,E]=N.useState(""),[A,z]=N.useState(!0),[M,U]=N.useState(null),[R,T]=N.useState("coverage");N.useEffect(()=>{q()},[e]);async function q(){z(!0),U(null);try{const O=await zp(e);if(s(O),O.connected){const[ae,pe,te]=await Promise.all([Ep(e).catch(()=>null),Ww(e).catch(()=>[]),tN(e).catch(()=>[])]);ae&&d(ae),p(pe),v(te)}}catch(O){U(O instanceof Error?O.message:"Failed to load Bing data")}finally{z(!1)}}async function W(){if(S.trim()){U(null);try{const O=await Qw(e,S.trim());C(""),O.availableSites.length>0&&r(O.availableSites),await q()}catch(O){U(O instanceof Error?O.message:"Failed to connect")}}}async function Q(){try{await Yw(e),s(null),r([]),d(null),p([]),v([]),b(null),E(""),U(null)}catch(O){U(O instanceof Error?O.message:"Failed to disconnect")}}async function ne(){if(k)try{await Xw(e,k),await q()}catch(O){U(O instanceof Error?O.message:"Failed to set site")}}async function me(){if(x.trim())try{const O=await eN(e,x.trim());b(O),p(ae=>[O,...ae])}catch(O){U(O instanceof Error?O.message:"Inspection failed")}}async function ke(O){try{await zm(e,{urls:[O]}),U(null)}catch(ae){U(ae instanceof Error?ae.message:"Submission failed")}}async function je(){try{await zm(e,{allUnindexed:!0}),U(null)}catch(O){U(O instanceof Error?O.message:"Batch submission failed")}}if(A)return l.jsx(Le,{className:"surface-card",children:l.jsx("div",{className:"text-sm text-zinc-400",children:"Loading Bing data..."})});if(!t?.connected)return l.jsxs(Le,{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(tt,{tone:"caution",children:"Not connected"})]}),l.jsx("p",{className:"text-sm text-zinc-300",children:"Connect Bing Webmaster Tools to inspect URLs, monitor index coverage, and submit pages for indexing."}),l.jsxs("div",{className:"mt-3",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:O=>C(O.target.value),onKeyDown:O=>O.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"})]})]}),M&&l.jsx("p",{className:"mt-3 text-xs text-rose-400",children:M})]});if(!t.siteUrl)return l.jsxs(Le,{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.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(tt,{tone:"positive",children:"Connected"}),l.jsx(le,{size:"sm",variant:"ghost",onClick:Q,children:"Disconnect"})]})]}),l.jsxs("div",{className:"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:t.domain})]}),l.jsx("p",{className:"mt-2 text-xs text-zinc-500",children:"The API key is connected, but no Bing site is selected yet. Pick the verified site that should receive inspections and indexing requests."})]}),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:"Registered domain"}),l.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:t.domain})]}),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:t.updatedAt?vs(t.updatedAt):"—"})]})]}),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:"Select site"}),a.length>0?l.jsxs("div",{className:"mt-3 flex flex-col gap-2 lg:flex-row",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:k,onChange:O=>E(O.target.value),children:[l.jsx("option",{value:"",children:"Select a site..."}),a.map(O=>l.jsxs("option",{value:O.url,children:[O.url,O.verified?" (verified)":""]},O.url))]}),l.jsx(le,{size:"sm",disabled:!k,onClick:ne,children:"Set Site"})]}):l.jsx("div",{className:"mt-3",children:l.jsx(le,{size:"sm",onClick:async()=>{const O=await Jw(e);r(O.sites)},children:"Load Sites"})})]})]}),M&&l.jsx("p",{className:"mt-3 text-xs text-rose-400",children:M})]});const B=[{key:"coverage",label:"Coverage"},{key:"inspections",label:"Inspections"},{key:"performance",label:"Performance"}];return l.jsxs("div",{className:"space-y-3",children:[l.jsxs(Le,{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.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(tt,{tone:"positive",children:"Connected"}),l.jsx(le,{size:"sm",variant:"ghost",onClick:Q,children:"Disconnect"})]})]}),M&&l.jsx("p",{className:"mb-3 text-xs text-rose-400",children:M}),l.jsxs("div",{className:"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:t.domain})]}),l.jsxs("p",{className:"mt-2 text-xs text-zinc-500",children:["Canonry stores Bing connections per canonical domain. This project is currently mapped to ",l.jsx("code",{children:t.siteUrl}),"."]})]}),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 site"}),l.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:t.siteUrl})]}),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:t.updatedAt?vs(t.updatedAt):"—"})]})]})]})]}),l.jsxs(Le,{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 monitoring"})]}),l.jsx("p",{className:"text-xs text-zinc-500",children:c?.lastInspectedAt?`Last inspected ${vs(c.lastInspectedAt)}`:"No inspection history yet"})]}),l.jsx("div",{className:"flex gap-1 border-b border-zinc-800",children:B.map(O=>l.jsx("button",{className:`px-3 py-1.5 text-xs font-medium border-b-2 transition-colors ${R===O.key?"border-zinc-200 text-zinc-200":"border-transparent text-zinc-500 hover:text-zinc-300"}`,onClick:()=>T(O.key),children:O.label},O.key))}),R==="coverage"&&c&&l.jsxs("div",{className:"mt-4 space-y-4",children:[l.jsxs("div",{className:"grid gap-3 sm:grid-cols-3",children:[l.jsx(Xh,{label:"Indexed",value:c.summary.indexed,tone:"positive"}),l.jsx(Xh,{label:"Not indexed",value:c.summary.notIndexed,tone:"negative"}),l.jsx(Xh,{label:"Coverage",value:`${c.summary.percentage}%`,tone:"neutral"})]}),c.notIndexed.length>0&&l.jsxs("div",{children:[l.jsxs("div",{className:"mb-2 flex items-center justify-between gap-3",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.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children: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 px-3 text-zinc-500 font-medium",children:"URL"}),l.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-16",children:"HTTP"}),l.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-20",children:"Action"})]})}),l.jsx("tbody",{children:c.notIndexed.map(O=>l.jsxs("tr",{className:"border-b border-zinc-800/50",children:[l.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:O.url}),l.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:O.httpCode??"—"}),l.jsx("td",{className:"py-1.5 px-3 text-right",children:l.jsx("button",{className:"text-[10px] text-zinc-400 hover:text-zinc-200 underline underline-offset-2",onClick:()=>ke(O.url),children:"Submit"})})]},O.id))})]})})]}),c.indexed.length>0&&l.jsxs("div",{children:[l.jsxs("h4",{className:"mb-2 text-xs font-medium text-zinc-400",children:["Indexed (",c.indexed.length,")"]}),l.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children: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 px-3 text-zinc-500 font-medium",children:"URL"}),l.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-32",children:"Last Crawled"})]})}),l.jsx("tbody",{children:c.indexed.map(O=>l.jsxs("tr",{className:"border-b border-zinc-800/50",children:[l.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:O.url}),l.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:O.lastCrawledDate?vs(O.lastCrawledDate):"—"})]},O.id))})]})})]})]}),R==="coverage"&&!c&&l.jsx("p",{className:"mt-4 text-xs text-zinc-500",children:"No coverage data yet. Inspect URLs to build coverage data."}),R==="inspections"&&l.jsxs("div",{className:"mt-4 space-y-3",children:[l.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",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:O=>w(O.target.value),onKeyDown:O=>O.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:"font-medium text-zinc-200",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.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children: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 px-3 text-zinc-500 font-medium",children:"URL"}),l.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-16",children:"Index"}),l.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-14",children:"HTTP"}),l.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-32",children:"Inspected"})]})}),l.jsx("tbody",{children:f.map(O=>l.jsxs("tr",{className:"border-b border-zinc-800/50",children:[l.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:O.url}),l.jsx("td",{className:"py-1.5 px-3",children:l.jsx(tt,{tone:O.inIndex?"positive":"negative",children:O.inIndex?"Yes":"No"})}),l.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:O.httpCode??"—"}),l.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:vs(O.inspectedAt)})]},O.id))})]})})]}),R==="performance"&&l.jsx("div",{className:"mt-4",children:m.length===0?l.jsx("p",{className:"text-xs text-zinc-500",children:"No Bing performance data available."}):l.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children: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 px-3 text-zinc-500 font-medium",children:"Query"}),l.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-16",children:"Clicks"}),l.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-16",children:"Impr"}),l.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-14",children:"CTR"}),l.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-14",children:"Pos"})]})}),l.jsx("tbody",{children:m.map((O,ae)=>l.jsxs("tr",{className:"border-b border-zinc-800/50",children:[l.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:O.query}),l.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-200",children:O.clicks}),l.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:O.impressions}),l.jsxs("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:[(O.ctr*100).toFixed(1),"%"]}),l.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:O.averagePosition.toFixed(1)})]},ae))})]})})})]})]})}function q3({projectName:e}){const[t,s]=N.useState("google"),[a,r]=N.useState(!0),[c,d]=N.useState(!1),[f,p]=N.useState(null),[m,v]=N.useState(!1),[y,b]=N.useState(null),[x,w]=N.useState(null),[S,C]=N.useState(!1),[k,E]=N.useState(null),[A,z]=N.useState(null);async function M(B=!1){B?d(!0):r(!0),p(null);try{const[O,ae,pe]=await Promise.all([Gu().catch(()=>null),kp(e).catch(()=>[]),zp(e).catch(()=>null)]),te=ae.find(se=>se.connectionType==="gsc")??null;v(!!O?.google?.configured),C(!!O?.bing?.configured),b(te),E(pe);const[D,G]=await Promise.all([te?_p(e).catch(()=>null):Promise.resolve(null),pe?.connected?Ep(e).catch(()=>null):Promise.resolve(null)]);w(D),z(G)}catch(O){p(O instanceof Error?O.message:"Failed to load search console overview")}finally{r(!1),d(!1)}}N.useEffect(()=>{M()},[e]);const U=y?"positive":m?"caution":"negative",R=y?"Connected":m?"Ready to connect":"Needs setup",T=x?`${x.summary.percentage}% indexed`:y?"Awaiting coverage":"No coverage data",q=x?`${x.summary.notIndexed} not indexed${x.summary.deindexed>0?` · ${x.summary.deindexed} deindexed`:""}`:y?"Run sitemap inspection to populate coverage":m?"Connect Search Console for this domain":"Add Google OAuth credentials in Settings",W=x?.lastInspectedAt??y?.updatedAt??null,Q=k?.connected?"positive":S?"caution":"negative",ne=k?.connected?"Connected":S?"Ready to connect":"Needs setup",me=A?`${A.summary.percentage}% indexed`:k?.connected?"Awaiting coverage":"No coverage data",ke=A?`${A.summary.notIndexed} not indexed`:k?.connected?"Inspect URLs to populate coverage":S?"Connect Bing Webmaster Tools for this domain":"Add a Bing API key in Settings",je=A?.lastInspectedAt??k?.updatedAt??null;return l.jsxs("div",{className:"space-y-6",children:[l.jsxs(Le,{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:"Search console"}),l.jsx("h2",{children:"Search Engine Intelligence"}),l.jsx("p",{className:"mt-1 max-w-3xl text-sm leading-6 text-zinc-500",children:"Scan both engines at a glance, then open the Google or Bing workspace when you need to inspect coverage or take action."})]}),l.jsx(le,{type:"button",variant:"outline",size:"sm",disabled:a||c,onClick:()=>{M(!0)},children:a||c?"Refreshing…":"Refresh overview"})]}),f&&l.jsx("div",{className:"mb-3 rounded-lg border border-rose-800/40 bg-rose-950/20 px-3 py-2 text-sm text-rose-300",children:f}),l.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[l.jsx(Ix,{eyebrow:"Google",title:"Google Search Console",status:a?"Loading…":R,tone:a?"neutral":U,targetLabel:"Selected property",targetValue:y?.propertyId??"No property selected",coverageValue:a?"Loading…":T,note:a?"Loading overview…":q,updatedAt:W,active:t==="google",onClick:()=>s("google")}),l.jsx(Ix,{eyebrow:"Bing",title:"Bing Webmaster Tools",status:a?"Loading…":ne,tone:a?"neutral":Q,targetLabel:"Selected site",targetValue:k?.siteUrl??"No site selected",coverageValue:a?"Loading…":me,note:a?"Loading overview…":ke,updatedAt:je,active:t==="bing",onClick:()=>s("bing")})]})]}),l.jsx("div",{className:"flex flex-wrap gap-2",role:"tablist","aria-label":"Search engine workspaces",children:[["google","Google"],["bing","Bing"]].map(([B,O])=>l.jsx("button",{type:"button",role:"tab","aria-selected":t===B,className:`project-subnav-link ${t===B?"project-subnav-link-active":""}`,onClick:()=>s(B),children:O},B))}),t==="google"&&l.jsx(L3,{projectName:e}),t==="bing"&&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:"Search engine"}),l.jsx("h2",{children:"Bing Webmaster Tools"})]})}),l.jsx(B3,{projectName:e})]})]})}function H3({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(Lu,{size:12,className:`shrink-0 text-zinc-500 transition-transform duration-150 ${c?"rotate-90":""}`}),l.jsx(tt,{tone:r.tone,children:r.actionLabel}),l.jsx("span",{className:"text-sm font-medium text-zinc-100 truncate",children:r.title}),l.jsx("span",{className:"hidden sm:inline text-xs text-zinc-500 truncate",children:r.detail})]}),d&&l.jsxs("span",{className:"text-[11px] text-zinc-600 whitespace-nowrap",children:[r.affectedPhrases.length," phrase",r.affectedPhrases.length>1?"s":""]})]}),c&&l.jsx("div",{className:"divide-y divide-zinc-800/20",children:r.affectedPhrases.map(f=>l.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-2 pl-9 bg-zinc-900/40",children:[l.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[l.jsx(wm,{state:f.citationState}),l.jsx("span",{className:"text-sm text-zinc-200 truncate",children:f.keyword}),l.jsx("div",{className:"hidden sm:flex gap-1",children:f.provider&&l.jsx(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 Gp({tab:e}){const{projectId:t}=Ou({from:"/projects/$projectId"}),s=Ca(),{dashboard:a,isLoading:r,refetch:c}=Ea();if(!a||r)return l.jsxs("div",{className:"page-skeleton",children:[l.jsxs("div",{className:"page-skeleton-header",children:[l.jsx("div",{className:"skeleton-text h-6 w-48"}),l.jsx("div",{className:"skeleton-text-sm w-32"})]}),l.jsx("div",{className:"grid grid-cols-3 gap-4",children:[1,2,3].map(re=>l.jsxs("div",{className:"page-skeleton-card flex flex-col items-center",children:[l.jsx("div",{className:"skeleton-circle size-20"}),l.jsx("div",{className:"skeleton-text w-16 mt-3"})]},re))}),l.jsxs("div",{className:"page-skeleton-card",children:[l.jsx("div",{className:"skeleton-text w-28"}),l.jsx("div",{className:"space-y-2 mt-2",children:[1,2,3,4].map(re=>l.jsx("div",{className:"skeleton-text-sm w-full"},re))})]})]});const d=A5(a,t),[f,p]=N.useState(!1),[m,v]=N.useState(!1),[y,b]=N.useState(!1),[x,w]=N.useState(null),[S,C]=N.useState(!1),[k,E]=N.useState(""),[A,z]=N.useState(!1),[M,U]=N.useState(!1),[R,T]=N.useState(""),[q,W]=N.useState(!1),[Q,ne]=N.useState(!1),[me,ke]=N.useState(""),[je,B]=N.useState(!1),[O,ae]=N.useState(void 0),[pe,te]=N.useState(!1),[D,G]=N.useState(null),[se,oe]=N.useState(!1),ce=d?.visibilityEvidence??[],he=d?.project.name??"",de=N.useMemo(()=>new Set(ce.map(re=>re.location??"")),[ce]),Fe=de.has(""),ge=N.useMemo(()=>[...de].filter(Boolean),[de]);N.useEffect(()=>{if(O===void 0||O===""||!he){G(null),oe(!1);return}oe(!0),wp(he,O).then(re=>{G(re),oe(!1)}).catch(()=>{G(null),oe(!1)})},[O,he]);const Je=N.useMemo(()=>{if(!D)return null;const re=new Map;for(const $e of D){for(const[Pe,ze]of Object.entries($e.providerRuns??{}))re.set(`${$e.keyword}::${Pe}`,ze.map(De=>({runId:De.runId,citationState:De.citationState,createdAt:De.createdAt})));(!$e.providerRuns||Object.keys($e.providerRuns).length===0)&&re.set(`${$e.keyword}::`,$e.runs.map(Pe=>({runId:Pe.runId,citationState:Pe.citationState,createdAt:Pe.createdAt})))}return re},[D]),mt=N.useMemo(()=>{const re=O!==void 0?ce.filter($e=>O===""?!$e.location:$e.location===O):ce;return Je?re.map($e=>{const Pe=Je.get(`${$e.keyword}::${$e.provider}`)??Je.get(`${$e.keyword}::`);return Pe?{...$e,runHistory:Pe}:$e}):re},[ce,O,Je]);if(!d)return l.jsx("div",{className:"page-container",children:l.jsxs(Le,{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(yt,{to:"/",children:"Return to overview"})})]})});async function fe(){b(!0),w(null);try{await Cp(he),c()}catch(re){w(re instanceof Error?re.message:"Failed to trigger run")}finally{b(!1)}}async function Xe(){v(!0);try{await jw(he),s({to:"/"}),c()}catch(re){console.error("Failed to delete project:",re)}finally{v(!1)}}async function ct(){const re=await ww(he),$e=typeof re=="string"?re:JSON.stringify(re,null,2),Pe=new Blob([$e],{type:"text/yaml"}),ze=URL.createObjectURL(Pe),De=document.createElement("a");De.href=ze,De.download=`${he}.yaml`,De.click()}async function nn(){const re=k.split(`
237
- `).map($e=>$e.trim()).filter(Boolean);if(re.length!==0){z(!0);try{await yw(he,re),c(),E(""),C(!1)}finally{z(!1)}}}async function _t(){const re=R.trim();if(re){W(!0);try{const Pe=(await jp(he)).map(De=>De.domain),ze=[...new Set([...Pe,re])];await Np(he,ze),c(),T(""),U(!1)}finally{W(!1)}}}async function sn(){const re=me.trim();if(re){B(!0);try{const $e=d?.project.ownedDomains??[];await Nm(he,[...$e,re]),c(),ke(""),ne(!1)}finally{B(!1)}}}async function Vt(re){B(!0);try{const $e=d?.project.ownedDomains??[];await Nm(he,$e.filter(Pe=>Pe!==re)),c()}finally{B(!1)}}async function zt(re,$e){await vw(re,$e),c()}const xt=re=>!Number.isNaN(Number.parseInt(re,10)),hn=[{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(Le,{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:Xe,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:()=>ne(!0),children:"+ add domain"})," "," · ",d.contextLabel]}),l.jsxs("div",{className:"tag-row",children:[l.jsx("span",{className:"tag",children:d.project.country}),l.jsx("span",{className:"tag",children:d.project.language.toUpperCase()}),d.project.tags.map(re=>l.jsx("span",{className:"tag",children:re},re))]}),((d.project.ownedDomains??[]).length>0||Q)&&l.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-1.5",children:[l.jsx("span",{className:"text-[10px] uppercase tracking-wide text-zinc-500 mr-1",children:"Also tracking"}),(d.project.ownedDomains??[]).map(re=>l.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-zinc-700/60 bg-zinc-800/40 px-2 py-0.5 text-xs text-zinc-300",children:[re,l.jsx("button",{type:"button",className:"ml-0.5 text-zinc-500 hover:text-zinc-200 transition-colors",disabled:je,onClick:()=>Vt(re),"aria-label":`Remove ${re}`,children:"×"})]},re)),Q?l.jsxs("span",{className:"inline-flex items-center gap-1",children:[l.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-1.5 py-0.5 text-xs text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none w-40",type:"text",placeholder:"docs.example.com",value:me,onChange:re=>ke(re.target.value),onKeyDown:re=>re.key==="Enter"&&sn(),autoFocus:!0}),l.jsx(le,{type:"button",size:"sm",disabled:!me.trim()||je,onClick:sn,children:je?"...":"Add"}),l.jsx("button",{type:"button",className:"text-xs text-zinc-500 hover:text-zinc-300",onClick:()=>{ne(!1),ke("")},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:()=>ne(!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:ct,"aria-label":"Export project as YAML",children:l.jsx(r2,{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:()=>w(null),children:"×"})]}),l.jsx("nav",{className:"project-subnav","aria-label":"Project sections",children:hn.map(re=>l.jsx(yt,{to:re.href,className:`project-subnav-link ${re.key===e?"project-subnav-link-active":""}`,"aria-current":re.key===e?"page":void 0,children:re.label},re.key))}),e==="overview"?l.jsxs(l.Fragment,{children:[l.jsxs("section",{className:"gauge-row",children:[l.jsx(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:xt(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:xt(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:xt(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(re=>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:re.provider}),re.model&&l.jsx("span",{className:"text-[11px] font-mono text-zinc-500",children:re.model})]})}),l.jsx("td",{children:l.jsxs("span",{className:`font-semibold ${re.score>=70?"text-emerald-400":re.score>=40?"text-amber-400":"text-rose-400"}`,children:[re.score,"%"]})}),l.jsxs("td",{className:"text-zinc-500",children:[re.cited," of ",re.total]})]},`${re.provider}::${re.model??"unknown"}`))})]})})]}),l.jsxs("section",{className:"page-section-divider",children:[l.jsx("div",{className:"section-head section-head-inline",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"What changed"}),l.jsx("h2",{children:"Citation signals"})]})}),l.jsx(H3,{insights:d.insights})]}),l.jsxs("section",{className:"page-section-divider",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Visibility evidence"}),l.jsx("h2",{children:"Key phrase citation tracking"})]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs("p",{className:"supporting-copy",children:[new Set(d.visibilityEvidence.map(re=>re.keyword)).size," key phrases tracked"]}),l.jsx(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:k,onChange:re=>E(re.target.value)}),l.jsxs("div",{className:"mt-2 flex items-center justify-between",children:[l.jsxs("p",{className:"text-xs text-zinc-500",children:[k.split(`
238
- `).filter(re=>re.trim()).length," key phrases"]}),l.jsx(le,{type:"button",size:"sm",disabled:!k.trim()||A,onClick:nn,children:A?"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 ${O===void 0?"filter-chip-active":""}`,type:"button","aria-pressed":O===void 0,onClick:()=>{ae(void 0)},children:"All locations"}),d.project.locations.map(re=>de.has(re.label)&&l.jsx("button",{className:`filter-chip ${O===re.label?"filter-chip-active":""}`,type:"button","aria-pressed":O===re.label,onClick:()=>{ae(re.label),te(!1)},children:re.label},re.label)),Fe&&l.jsx("button",{className:`filter-chip ${O===""?"filter-chip-active":""}`,type:"button","aria-pressed":O==="",onClick:()=>{ae(""),te(!1)},children:"No location"}),ge.length>1&&O===void 0&&l.jsx("button",{className:`filter-chip filter-chip-compare ${pe?"filter-chip-active":""}`,type:"button","aria-pressed":pe,onClick:()=>te(re=>!re),title:"Side-by-side location comparison",children:"Compare"})]}),l.jsx(_3,{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:()=>U(!M),children:M?"Cancel":"+ Add competitor"})]})]}),M&&l.jsxs("div",{className:"mb-3 flex gap-2 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3",children:[l.jsx("input",{className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"competitor.com",value:R,onChange:re=>T(re.target.value),onKeyDown:re=>re.key==="Enter"&&_t()}),l.jsx(le,{type:"button",size:"sm",disabled:!R.trim()||q,onClick:_t,children:q?"Adding...":"Add"})]}),l.jsx(z3,{competitors:d.competitors})]}),l.jsxs("section",{className:"page-section-divider",children:[l.jsx("div",{className:"section-head section-head-inline",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Run timeline"}),l.jsx("h2",{children:"Recent execution history"})]})}),l.jsx("div",{className:"run-list",children:d.recentRuns.map(re=>l.jsx(QN,{run:re},re.id))})]}),l.jsx(M3,{project:{...d.project,displayName:d.project.displayName??d.project.name,defaultLocation:d.project.defaultLocation??null},onUpdateProject:zt,onRefresh:()=>{c()}}),l.jsx($3,{projectName:d.project.name}),l.jsx(I3,{projectName:d.project.name})]}):e==="analytics"?l.jsx(R3,{projectName:d.project.name}):l.jsx(q3,{projectName:d.project.name})]})}const Z3="modulepreload",F3=function(e,t){return new URL(e,t).href},Bx={},G3=function(t,s,a){let r=Promise.resolve();if(s&&s.length>0){let m=function(v){return Promise.all(v.map(y=>Promise.resolve(y).then(b=>({status:"fulfilled",value:b}),b=>({status:"rejected",reason:b}))))};const d=document.getElementsByTagName("link"),f=document.querySelector("meta[property=csp-nonce]"),p=f?.nonce||f?.getAttribute("nonce");r=m(s.map(v=>{if(v=F3(v,a),v in Bx)return;Bx[v]=!0;const y=v.endsWith(".css"),b=y?'[rel="stylesheet"]':"";if(a)for(let w=d.length-1;w>=0;w--){const S=d[w];if(S.href===v&&(!y||S.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${v}"]${b}`))return;const x=document.createElement("link");if(x.rel=y?"stylesheet":Z3,y||(x.as="script"),x.crossOrigin="",x.href=v,p&&x.setAttribute("nonce",p),document.head.appendChild(x),y)return new Promise((w,S)=>{x.addEventListener("load",w),x.addEventListener("error",()=>S(new Error(`Unable to preload CSS for ${v}`)))})}))}function c(d){const f=new Event("vite:preloadError",{cancelable:!0});if(f.payload=d,window.dispatchEvent(f),!f.defaultPrevented)throw d}return r.then(d=>{for(const f of d||[])f.status==="rejected"&&c(f.reason);return t().catch(c)})};function K3(){const{dashboard:e,isLoading:t}=Ea();if(!e||t)return l.jsxs("div",{className:"page-skeleton",children:[l.jsxs("div",{className:"page-skeleton-header",children:[l.jsx("div",{className:"skeleton-text h-6 w-20"}),l.jsx("div",{className:"skeleton-text-sm w-72"})]}),l.jsx("div",{className:"space-y-2",children:[1,2,3,4].map(f=>l.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-3 flex items-center gap-3",children:[l.jsxs("div",{className:"flex-1 space-y-1.5",children:[l.jsx("div",{className:"skeleton-text w-40"}),l.jsx("div",{className:"skeleton-text-sm w-56"})]}),l.jsx("div",{className:"skeleton h-5 w-16 rounded-full"})]},f))})]});const s=e.runs,[a,r]=N.useState("all"),c=a==="all"?s:s.filter(f=>f.status===a),d=()=>{G3(async()=>{const{triggerAllRuns:f}=await Promise.resolve().then(()=>w5);return{triggerAllRuns:f}},void 0,import.meta.url).then(({triggerAllRuns:f})=>f().catch(p=>{console.error("Failed to trigger all runs",p)}))};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:d,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(f=>l.jsx("button",{className:`filter-chip ${a===f?"filter-chip-active":""}`,type:"button","aria-pressed":a===f,onClick:()=>r(f),children:f==="all"?"All runs":Uu(f)},f))}),l.jsx("div",{className:"run-list",children:c.length>0?c.map(f=>l.jsx(QN,{run:f},f.id)):l.jsxs(Le,{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 V3({providerName:e,keyUrl:t,modelHint:s,onSaved:a}){const r=e.toLowerCase()==="local",[c,d]=N.useState(""),[f,p]=N.useState(""),[m,v]=N.useState(""),[y,b]=N.useState(""),[x,w]=N.useState(""),[S,C]=N.useState(""),[k,E]=N.useState(!1),[A,z]=N.useState(null),[M,U]=N.useState(!1),R=r?f.trim().length>0:c.trim().length>0;async function T(){if(R){E(!0),z(null),U(!1);try{const W=je=>{const B=parseInt(je.trim(),10);return Number.isFinite(B)&&B>0?B:void 0},Q={},ne=W(y);ne!==void 0&&(Q.maxConcurrency=ne);const me=W(x);me!==void 0&&(Q.maxRequestsPerMinute=me);const ke=W(S);ke!==void 0&&(Q.maxRequestsPerDay=ke),await Nw(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(""),v(""),b(""),w(""),C(""),U(!0),a()}catch(W){z(W instanceof Error?W.message:"Failed to update provider")}finally{E(!1)}}}const q=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:q,value:m,onChange:W=>v(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=>b(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=>w(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"})]})]})]}),A&&l.jsx("p",{className:"text-xs text-rose-400",children:A}),M&&l.jsx("p",{className:"text-xs text-emerald-400",children:"Provider updated."}),l.jsx(le,{type:"button",size:"sm",disabled:!R||k,onClick:T,children:k?"Saving...":"Save"})]})}function Q3({onSaved:e}){const[t,s]=N.useState(""),[a,r]=N.useState(""),[c,d]=N.useState(!1),[f,p]=N.useState(null),[m,v]=N.useState(!1),y=t.trim().length>0&&a.trim().length>0;async function b(){if(y){d(!0),p(null),v(!1);try{await Cw({clientId:t.trim(),clientSecret:a.trim()}),s(""),r(""),v(!0),e()}catch(x){p(x instanceof Error?x.message:"Failed to update Google OAuth credentials")}finally{d(!1)}}}return l.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3 space-y-2",children:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"google-client-id",children:"Client ID"}),l.jsx("a",{href:"https://console.cloud.google.com/apis/credentials",target:"_blank",rel:"noopener noreferrer",className:"text-[10px] text-zinc-500 hover:text-zinc-300 underline underline-offset-2",children:"Google Cloud \\u2197"})]}),l.jsx("input",{id:"google-client-id",type:"text",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"Google OAuth client ID",value:t,onChange:x=>s(x.target.value)})]}),l.jsxs("div",{children:[l.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"google-client-secret",children:"Client secret"}),l.jsx("input",{id:"google-client-secret",type:"password",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"Google OAuth client secret",value:a,onChange:x=>r(x.target.value)})]}),l.jsxs("p",{className:"text-[11px] text-zinc-500",children:["These credentials are stored in ",l.jsx("code",{children:"~/.canonry/config.yaml"}),". Project-level Search Console connections are created separately per canonical domain."]}),f&&l.jsx("p",{className:"text-xs text-rose-400",children:f}),m&&l.jsx("p",{className:"text-xs text-emerald-400",children:"Google OAuth credentials updated."}),l.jsx(le,{type:"button",size:"sm",disabled:!y||c,onClick:b,children:c?"Saving...":"Save Google OAuth app"})]})}function Y3(){const[e,t]=N.useState(null),[s,a]=N.useState(null),[r,c]=N.useState(!1),[d,f]=N.useState("localhost"),[p,m]=N.useState("9222"),[v,y]=N.useState(!1);return N.useEffect(()=>{km().then(t).catch(b=>{const x=b instanceof Error?b.message:String(b);x.includes("501")||a(x)})},[]),l.jsxs(Le,{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(tt,{tone:e?.connected?"positive":"caution",children:e?.connected?"Connected":"Not connected"})]}),l.jsxs("dl",{className:"definition-list mt-3",children:[e?.endpoint&&l.jsxs("div",{children:[l.jsx("dt",{children:"Endpoint"}),l.jsx("dd",{className:"font-mono text-xs",children:e.endpoint})]}),e?.browserVersion&&l.jsxs("div",{children:[l.jsx("dt",{children:"Browser"}),l.jsx("dd",{className:"text-xs",children:e.browserVersion})]}),e?.targets&&e.targets.length>0&&l.jsxs("div",{children:[l.jsx("dt",{children:"Tabs"}),l.jsx("dd",{children:e.targets.map(b=>l.jsxs("span",{className:"mr-2",children:[b.name,": ",b.alive?"● alive":"○ idle"]},b.name))})]})]}),l.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:e?.connected?"Connected to Chrome via CDP. Launch Chrome with --remote-debugging-port to use this provider.":s||"Not configured. Set an endpoint below or run: canonry cdp connect --host localhost --port 9222"}),l.jsx("div",{className:"mt-2",children:l.jsx(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 b=>{b.preventDefault(),y(!0);try{await Vw(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:b=>f(b.target.value),"aria-label":"CDP host"}),l.jsx("input",{className:"w-24 rounded border border-zinc-700 bg-zinc-900 px-2 py-1 text-sm text-zinc-100 placeholder-zinc-500 focus:outline-none focus:ring-1 focus:ring-zinc-500",placeholder:"9222",value:p,onChange:b=>m(b.target.value),"aria-label":"CDP port"})]}),l.jsx("div",{children:l.jsx(le,{type:"submit",size:"sm",disabled:v,children:v?"Saving…":"Save endpoint"})})]})]})}const J3={apiStatus:{state:"checking",detail:"Checking service health"},workerStatus:{state:"checking",detail:"Checking service health"}};function X3(){const e=cl(),{dashboard:t}=Ea(),s=t?.settings??e?.dashboard?.settings,c=Vu(!e,e?.health).data??e?.health??J3,[d,f]=N.useState(null),[p,m]=N.useState(!1),[v,y]=N.useState(!1),[b,x]=N.useState(""),[w,S]=N.useState(!1),[C,k]=N.useState(null),[E,A]=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(Le,{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(tt,{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(V3,{providerName:z.name,keyUrl:z.keyUrl,modelHint:z.modelHint,onSaved:()=>{f(null)}})]},z.name)),l.jsxs(Le,{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(tt,{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(Q3,{onSaved:()=>{m(!1)}})]}),l.jsxs(Le,{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(tt,{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(!v),children:v?"Cancel":s.bing.state==="ready"?"Update API key":"Configure Bing"})}),v&&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:b,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:!b.trim()||w,onClick:async()=>{if(b.trim()){S(!0),k(null),A(!1);try{await nN(b.trim()),x(""),A(!0),y(!1)}catch(z){k(z instanceof Error?z.message:"Failed to update Bing API key")}finally{S(!1)}}},children:w?"Saving...":"Save Bing API key"})]})]}),l.jsx(Y3,{}),l.jsxs(Le,{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(tt,{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(tt,{tone:xu(c.workerStatus),children:c.workerStatus.state==="ok"?"Healthy":"Attention"})]})]})]})]}),l.jsx("section",{className:"page-section",children:l.jsxs(Le,{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 W3=[{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 e4({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 t4(){const e=cl(),{dashboard:t,isLoading:s,refetch:a}=Ea(),r=t??e?.dashboard;if(!r||s)return l.jsxs("div",{className:"page-skeleton",children:[l.jsxs("div",{className:"page-skeleton-header",children:[l.jsx("div",{className:"skeleton-text h-6 w-24"}),l.jsx("div",{className:"skeleton-text-sm w-80"})]}),l.jsxs("div",{className:"page-skeleton-card",children:[l.jsx("div",{className:"skeleton-text w-32"}),l.jsx("div",{className:"space-y-3 mt-3",children:[1,2,3].map(ie=>l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"space-y-1 flex-1",children:[l.jsx("div",{className:"skeleton-text w-24"}),l.jsx("div",{className:"skeleton-text-sm w-48"})]}),l.jsx("div",{className:"skeleton h-6 w-16 rounded-full"})]},ie))})]})]});const c=r.settings,p=Vu(!e,e?.health).data??e?.health??{apiStatus:{label:"API",state:"checking",detail:"Checking service health"},workerStatus:{label:"Worker",state:"checking",detail:"Checking service health"}},m=dM(r.setup,p,c),v=Ca(),[y,b]=N.useState(0),[x,w]=N.useState(""),[S,C]=N.useState(""),[k,E]=N.useState(""),[A,z]=N.useState("US"),[M,U]=N.useState("en"),[R,T]=N.useState(null),[q,W]=N.useState(null),[Q,ne]=N.useState(null),[me,ke]=N.useState(!1),[je,B]=N.useState(""),[O,ae]=N.useState(!1),[pe,te]=N.useState(null),[D,G]=N.useState(!1),se=c.providerStatuses.filter(ie=>ie.state==="ready"),[oe,ce]=N.useState(se[0]?.name??""),[he,de]=N.useState(5),[Fe,ge]=N.useState(!1),[Je,mt]=N.useState(null),[fe,Xe]=N.useState(""),[ct,nn]=N.useState(!1),[_t,sn]=N.useState(null),[Vt,zt]=N.useState(!1),[xt,hn]=N.useState(!1),[re,$e]=N.useState(null),[Pe,ze]=N.useState(!1),De=x.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),pt=je.split(`
239
- `).map(ie=>ie.trim()).filter(Boolean),an=fe.split(`
240
- `).map(ie=>ie.trim()).filter(Boolean),Ss=m.healthChecks.some(ie=>ie.id==="api"&&ie.state==="ready"),Ks=async()=>{if(!(!De||!k)){ke(!0),ne(null);try{const ie=await ll(De,{displayName:S||x,canonicalDomain:k,country:A,language:M});T(De),W(ie.id),a(),b(2)}catch(ie){ne(ie instanceof Error?ie.message:"Failed to create project")}finally{ke(!1)}}},js=async()=>{if(!R)return;const ie=pt;if(ie.length!==0){G(!0),te(null);try{await gw(R,ie),ae(!0),a(),b(3)}catch(Yn){te(Yn instanceof Error?Yn.message:"Failed to save key phrases")}finally{G(!1)}}},Vs=async()=>{if(!(!R||!oe)){ge(!0),mt(null);try{const ie=await Tw(R,oe,he);if(ie.keywords.length>0){const Yn=je?je.trimEnd()+`
241
- `+ie.keywords.join(`
242
- `):ie.keywords.join(`
243
- `);B(Yn)}}catch(ie){mt(ie instanceof Error?ie.message:"Failed to generate key phrases")}finally{ge(!1)}}},ls=async()=>{if(!R)return;const ie=an;if(ie.length!==0){zt(!0),sn(null);try{await Np(R,ie),nn(!0),a(),b(4)}catch(Yn){sn(Yn instanceof Error?Yn.message:"Failed to save competitors")}finally{zt(!1)}}},_e=async()=>{if(R){ze(!0),$e(null);try{await Cp(R),hn(!0),a()}catch(ie){$e(ie instanceof Error?ie.message:"Failed to trigger run")}finally{ze(!1)}}},Ht=()=>b(ie=>Math.max(0,ie-1)),Ge=(()=>{switch(y){case 0:return l.jsxs(Le,{className:"surface-card step-card",children:[l.jsx("div",{className:"section-head",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 1 of 5"}),l.jsx("h2",{children:"System ready"})]})}),l.jsx("p",{className:"supporting-copy",children:"Checking that your Canonry instance is configured and reachable."}),l.jsx("div",{className:"compact-stack",children:m.healthChecks.map(ie=>l.jsxs("div",{className:"health-check-row",children:[l.jsxs("div",{children:[l.jsx("p",{className:"run-row-title",children:ie.label}),l.jsx("p",{className:"supporting-copy",children:ie.detail}),ie.id==="provider"&&ie.state!=="ready"&&l.jsx(yt,{to:"/settings",className:"text-emerald-400 hover:text-emerald-300 text-sm mt-1 underline underline-offset-2 cursor-pointer",children:"Configure providers"})]}),l.jsx(tt,{tone:ie.state==="ready"?"positive":"caution",children:ie.state==="ready"?"Ready":"Attention"})]},ie.id))}),l.jsxs("div",{className:"setup-nav",children:[l.jsx("span",{}),l.jsx(le,{type:"button",disabled:!Ss,onClick:()=>b(1),children:"Continue"})]})]});case 1:return l.jsxs(Le,{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"})]}),R?l.jsx(tt,{tone:"positive",children:"Created"}):null]}),R?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:R})," created successfully."]}),l.jsxs("div",{className:"setup-nav",children:[l.jsx(le,{type:"button",variant:"outline",onClick:Ht,children:"Back"}),l.jsx(le,{type:"button",onClick:()=>b(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:x,onChange:ie=>w(ie.target.value)}),De&&De!==x?l.jsxs("p",{className:"supporting-copy",children:["Slug: ",De]}):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:S,onChange:ie=>C(ie.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:k,onChange:ie=>E(ie.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:A,onChange:ie=>z(ie.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:M,onChange:ie=>U(ie.target.value.toLowerCase())})]})]}),Q?l.jsx("p",{className:"text-rose-400 text-sm",children:Q}):null,l.jsxs("div",{className:"setup-nav",children:[l.jsx(le,{type:"button",variant:"outline",onClick:Ht,children:"Back"}),l.jsx(le,{type:"button",disabled:!De||!k||me,onClick:Ks,children:me?"Creating...":"Create project"})]})]})]});case 2:return l.jsxs(Le,{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"})]}),O?l.jsxs(tt,{tone:"positive",children:[pt.length," saved"]}):l.jsxs(tt,{tone:"neutral",children:[pt.length," key phrase",pt.length!==1?"s":""]})]}),l.jsx("p",{className:"supporting-copy",children:"Enter the search queries you want to track. One per line."}),O?l.jsxs("div",{className:"compact-stack",children:[l.jsx("ul",{className:"detail-list",children:pt.map(ie=>l.jsx("li",{children:ie},ie))}),l.jsxs("div",{className:"setup-nav",children:[l.jsx(le,{type:"button",variant:"outline",onClick:Ht,children:"Back"}),l.jsx(le,{type:"button",onClick:()=>b(3),children:"Continue"})]})]}):l.jsxs("div",{className:"compact-stack",children:[se.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:oe,onChange:ie=>ce(ie.target.value),children:se.map(ie=>l.jsxs("option",{value:ie.name,children:[ie.displayName??ie.name,ie.model?` (${ie.model})`:""]},ie.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:he,onChange:ie=>de(Number(ie.target.value)),children:[3,5,10,15,20].map(ie=>l.jsx("option",{value:ie,children:ie},ie))})]}),l.jsx(le,{type:"button",variant:"outline",disabled:Fe||!oe,onClick:Vs,children:Fe?"Analyzing site...":"Generate"})]}),Je?l.jsx("p",{className:"text-rose-400 text-sm",children:Je}):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:je,onChange:ie=>B(ie.target.value)})]}),pe?l.jsx("p",{className:"text-rose-400 text-sm",children:pe}):null,l.jsxs("div",{className:"setup-nav",children:[l.jsx(le,{type:"button",variant:"outline",onClick:Ht,children:"Back"}),l.jsx(le,{type:"button",disabled:pt.length===0||D,onClick:js,children:D?"Saving...":`Save ${pt.length} key phrase${pt.length!==1?"s":""}`})]})]})]});case 3:return l.jsxs(Le,{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"})]}),ct?l.jsx(tt,{tone:"positive",children:"Saved"}):null]}),l.jsx("p",{className:"supporting-copy",children:"Domains that compete for the same key phrases. One per line."}),ct?l.jsxs("div",{className:"compact-stack",children:[l.jsx("ul",{className:"detail-list",children:an.map(ie=>l.jsx("li",{children:ie},ie))}),l.jsxs("div",{className:"setup-nav",children:[l.jsx(le,{type:"button",variant:"outline",onClick:Ht,children:"Back"}),l.jsx(le,{type:"button",onClick:()=>b(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:fe,onChange:ie=>Xe(ie.target.value)})]}),_t?l.jsx("p",{className:"text-rose-400 text-sm",children:_t}):null,l.jsxs("div",{className:"setup-nav",children:[l.jsx(le,{type:"button",variant:"outline",onClick:Ht,children:"Back"}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx(le,{type:"button",variant:"outline",onClick:()=>b(4),children:"Skip"}),l.jsx(le,{type:"button",disabled:an.length===0||Vt,onClick:ls,children:Vt?"Saving...":`Save ${an.length} competitor${an.length!==1?"s":""}`})]})]})]})]});case 4:return l.jsxs(Le,{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"})]}),xt?l.jsx(tt,{tone:"positive",children:"Queued"}):null]}),xt?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:()=>v({to:q?`/projects/${q}`:"/"}),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:R}),"."]}),re?l.jsx("p",{className:"text-rose-400 text-sm",children:re}):null,l.jsxs("div",{className:"setup-nav",children:[l.jsx(le,{type:"button",variant:"outline",onClick:Ht,children:"Back"}),l.jsx(le,{type:"button",disabled:Pe,onClick:_e,children:Pe?"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(e4,{current:y,labels:W3}),l.jsx("section",{className:"setup-wizard",children:Ge})]})}function n4(){return l.jsx("div",{className:"page-container",children:l.jsx("section",{className:"page-section",children:l.jsxs(Le,{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(yt,{to:"/",children:"Return to overview"})})]})})})}function s4(){return l.jsx(nM,{children:l.jsx(tM,{})})}const is=Dz()({component:s4,validateSearch:e=>({runId:typeof e.runId=="string"?e.runId:void 0,evidenceId:typeof e.evidenceId=="string"?e.evidenceId:void 0})}),i4=as({getParentRoute:()=>is,path:"/",component:hM,beforeLoad:({context:e})=>{const t=e.queryClient.getQueryData(Ri.projects.all);if(t&&t.length===0)throw Km({to:"/setup"})}}),a4=as({getParentRoute:()=>is,path:"/projects",component:C3}),ad=as({getParentRoute:()=>is,path:"/projects/$projectId",component:()=>l.jsx(sp,{})}),r4=as({getParentRoute:()=>ad,path:"/",component:()=>l.jsx(Gp,{tab:"overview"})}),o4=as({getParentRoute:()=>ad,path:"/search-console",component:()=>l.jsx(Gp,{tab:"search-console"})}),l4=as({getParentRoute:()=>ad,path:"/analytics",component:()=>l.jsx(Gp,{tab:"analytics"})}),c4=as({getParentRoute:()=>is,path:"/runs",component:K3}),u4=as({getParentRoute:()=>is,path:"/settings",component:X3,beforeLoad:({context:e})=>{}}),d4=as({getParentRoute:()=>is,path:"/setup",component:t4,beforeLoad:({context:e})=>{const t=e.queryClient.getQueryData(Ri.projects.all);if(t&&t.length>0)throw Km({to:"/"})}}),f4=as({getParentRoute:()=>is,path:"*",component:n4}),h4=is.addChildren([i4,a4,ad.addChildren([r4,o4,l4]),c4,u4,d4,f4]);function m4(e,t){return Zz({routeTree:h4,basepath:Am||"/",context:{queryClient:e},...t?.initialEntries})}const p4={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 g4(){const e=N.useSyncExternalStore(Jz,_b,_b),t=N.useCallback(s=>{_S(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 ${p4[s.tone]}`,children:[l.jsx("p",{className:"flex-1 leading-snug",children:s.message}),l.jsx("button",{type:"button",onClick:()=>t(s.id),className:"shrink-0 rounded p-0.5 opacity-60 hover:opacity-100 transition-opacity","aria-label":"Dismiss",children:l.jsx(Mu,{className:"size-3.5"})})]},s.id))})}const JN=Xz(),y4=m4(JN),XN=document.getElementById("root");if(!XN)throw new Error("Expected #root element for web app bootstrap.");gk.createRoot(XN).render(l.jsx(N.StrictMode,{children:l.jsxs(Bk,{client:JN,children:[l.jsx(Kz,{router:y4}),l.jsx(g4,{})]})}));