@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.
- package/assets/assets/index-sl--69xx.js +246 -0
- package/assets/index.html +1 -1
- package/dist/{chunk-2JBQ7NMO.js → chunk-SN5AMQJE.js} +130 -43
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +6 -6
- package/assets/assets/index-BFA6dYNt.js +0 -246
|
@@ -0,0 +1,246 @@
|
|
|
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 Fx(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var gh={exports:{}},Oo={};var Mv;function lk(){if(Mv)return Oo;Mv=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function s(a,r,c){var d=null;if(c!==void 0&&(d=""+c),r.key!==void 0&&(d=""+r.key),"key"in r){c={};for(var f in r)f!=="key"&&(c[f]=r[f])}else c=r;return r=c.ref,{$$typeof:e,type:a,key:d,ref:r!==void 0?r:null,props:c}}return Oo.Fragment=t,Oo.jsx=s,Oo.jsxs=s,Oo}var Uv;function ck(){return Uv||(Uv=1,gh.exports=lk()),gh.exports}var l=ck(),yh={exports:{}},Ee={};var $v;function uk(){if($v)return Ee;$v=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(O){return O===null||typeof O!="object"?null:(O=b&&O[b]||O["@@iterator"],typeof O=="function"?O:null)}var j={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,C={};function k(O,G,ie){this.props=O,this.context=G,this.refs=C,this.updater=ie||j}k.prototype.isReactComponent={},k.prototype.setState=function(O,G){if(typeof O!="object"&&typeof O!="function"&&O!=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,O,G,"setState")},k.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function E(){}E.prototype=k.prototype;function R(O,G,ie){this.props=O,this.context=G,this.refs=C,this.updater=ie||j}var z=R.prototype=new E;z.constructor=R,S(z,k.prototype),z.isPureReactComponent=!0;var L=Array.isArray;function M(){}var A={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function B(O,G,ie){var re=ie.ref;return{$$typeof:e,type:O,key:G,ref:re!==void 0?re:null,props:ie}}function te(O,G){return B(O.type,G,O.props)}function Y(O){return typeof O=="object"&&O!==null&&O.$$typeof===e}function se(O){var G={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(ie){return G[ie]})}var pe=/\/+/g;function ke(O,G){return typeof O=="object"&&O!==null&&O.key!=null?se(""+O.key):G.toString(36)}function we(O){switch(O.status){case"fulfilled":return O.value;case"rejected":throw O.reason;default:switch(typeof O.status=="string"?O.then(M,M):(O.status="pending",O.then(function(G){O.status==="pending"&&(O.status="fulfilled",O.value=G)},function(G){O.status==="pending"&&(O.status="rejected",O.reason=G)})),O.status){case"fulfilled":return O.value;case"rejected":throw O.reason}}throw O}function I(O,G,ie,re,ce){var he=typeof O;(he==="undefined"||he==="boolean")&&(O=null);var de=!1;if(O===null)de=!0;else switch(he){case"bigint":case"string":case"number":de=!0;break;case"object":switch(O.$$typeof){case e:case t:de=!0;break;case v:return de=O._init,I(de(O._payload),G,ie,re,ce)}}if(de)return ce=ce(O),de=re===""?"."+ke(O,0):re,L(ce)?(ie="",de!=null&&(ie=de.replace(pe,"$&/")+"/"),I(ce,G,ie,"",function(Ge){return Ge})):ce!=null&&(Y(ce)&&(ce=te(ce,ie+(ce.key==null||O&&O.key===ce.key?"":(""+ce.key).replace(pe,"$&/")+"/")+de)),G.push(ce)),1;de=0;var De=re===""?".":re+":";if(L(O))for(var ge=0;ge<O.length;ge++)re=O[ge],he=De+ke(re,ge),de+=I(re,G,ie,he,ce);else if(ge=x(O),typeof ge=="function")for(O=ge.call(O),ge=0;!(re=O.next()).done;)re=re.value,he=De+ke(re,ge++),de+=I(re,G,ie,he,ce);else if(he==="object"){if(typeof O.then=="function")return I(we(O),G,ie,re,ce);throw G=String(O),Error("Objects are not valid as a React child (found: "+(G==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":G)+"). If you meant to render a collection of children, use an array instead.")}return de}function Z(O,G,ie){if(O==null)return O;var re=[],ce=0;return I(O,re,"","",function(he){return G.call(ie,he,ce++)}),re}function oe(O){if(O._status===-1){var G=O._result;G=G(),G.then(function(ie){(O._status===0||O._status===-1)&&(O._status=1,O._result=ie)},function(ie){(O._status===0||O._status===-1)&&(O._status=2,O._result=ie)}),O._status===-1&&(O._status=0,O._result=G)}if(O._status===1)return O._result.default;throw O._result}var q=typeof reportError=="function"?reportError:function(O){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var G=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof O=="object"&&O!==null&&typeof O.message=="string"?String(O.message):String(O),error:O});if(!window.dispatchEvent(G))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",O);return}console.error(O)},J={map:Z,forEach:function(O,G,ie){Z(O,function(){G.apply(this,arguments)},ie)},count:function(O){var G=0;return Z(O,function(){G++}),G},toArray:function(O){return Z(O,function(G){return G})||[]},only:function(O){if(!Y(O))throw Error("React.Children.only expected to receive a single React element child.");return O}};return Ee.Activity=y,Ee.Children=J,Ee.Component=k,Ee.Fragment=s,Ee.Profiler=r,Ee.PureComponent=R,Ee.StrictMode=a,Ee.Suspense=p,Ee.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=A,Ee.__COMPILER_RUNTIME={__proto__:null,c:function(O){return A.H.useMemoCache(O)}},Ee.cache=function(O){return function(){return O.apply(null,arguments)}},Ee.cacheSignal=function(){return null},Ee.cloneElement=function(O,G,ie){if(O==null)throw Error("The argument must be a React element, but you passed "+O+".");var re=S({},O.props),ce=O.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||(re[he]=G[he]);var he=arguments.length-2;if(he===1)re.children=ie;else if(1<he){for(var de=Array(he),De=0;De<he;De++)de[De]=arguments[De+2];re.children=de}return B(O.type,ce,re)},Ee.createContext=function(O){return O={$$typeof:d,_currentValue:O,_currentValue2:O,_threadCount:0,Provider:null,Consumer:null},O.Provider=O,O.Consumer={$$typeof:c,_context:O},O},Ee.createElement=function(O,G,ie){var re,ce={},he=null;if(G!=null)for(re in G.key!==void 0&&(he=""+G.key),G)T.call(G,re)&&re!=="key"&&re!=="__self"&&re!=="__source"&&(ce[re]=G[re]);var de=arguments.length-2;if(de===1)ce.children=ie;else if(1<de){for(var De=Array(de),ge=0;ge<de;ge++)De[ge]=arguments[ge+2];ce.children=De}if(O&&O.defaultProps)for(re in de=O.defaultProps,de)ce[re]===void 0&&(ce[re]=de[re]);return B(O,he,ce)},Ee.createRef=function(){return{current:null}},Ee.forwardRef=function(O){return{$$typeof:f,render:O}},Ee.isValidElement=Y,Ee.lazy=function(O){return{$$typeof:v,_payload:{_status:-1,_result:O},_init:oe}},Ee.memo=function(O,G){return{$$typeof:m,type:O,compare:G===void 0?null:G}},Ee.startTransition=function(O){var G=A.T,ie={};A.T=ie;try{var re=O(),ce=A.S;ce!==null&&ce(ie,re),typeof re=="object"&&re!==null&&typeof re.then=="function"&&re.then(M,q)}catch(he){q(he)}finally{G!==null&&ie.types!==null&&(G.types=ie.types),A.T=G}},Ee.unstable_useCacheRefresh=function(){return A.H.useCacheRefresh()},Ee.use=function(O){return A.H.use(O)},Ee.useActionState=function(O,G,ie){return A.H.useActionState(O,G,ie)},Ee.useCallback=function(O,G){return A.H.useCallback(O,G)},Ee.useContext=function(O){return A.H.useContext(O)},Ee.useDebugValue=function(){},Ee.useDeferredValue=function(O,G){return A.H.useDeferredValue(O,G)},Ee.useEffect=function(O,G){return A.H.useEffect(O,G)},Ee.useEffectEvent=function(O){return A.H.useEffectEvent(O)},Ee.useId=function(){return A.H.useId()},Ee.useImperativeHandle=function(O,G,ie){return A.H.useImperativeHandle(O,G,ie)},Ee.useInsertionEffect=function(O,G){return A.H.useInsertionEffect(O,G)},Ee.useLayoutEffect=function(O,G){return A.H.useLayoutEffect(O,G)},Ee.useMemo=function(O,G){return A.H.useMemo(O,G)},Ee.useOptimistic=function(O,G){return A.H.useOptimistic(O,G)},Ee.useReducer=function(O,G,ie){return A.H.useReducer(O,G,ie)},Ee.useRef=function(O){return A.H.useRef(O)},Ee.useState=function(O){return A.H.useState(O)},Ee.useSyncExternalStore=function(O,G,ie){return A.H.useSyncExternalStore(O,G,ie)},Ee.useTransition=function(){return A.H.useTransition()},Ee.version="19.2.4",Ee}var Pv;function rl(){return Pv||(Pv=1,yh.exports=uk()),yh.exports}var N=rl();const ss=Fx(N),Um=ok({__proto__:null,default:ss},[N]);var vh={exports:{}},Do={},bh={exports:{}},xh={};var Iv;function dk(){return Iv||(Iv=1,(function(e){function t(I,Z){var oe=I.length;I.push(Z);e:for(;0<oe;){var q=oe-1>>>1,J=I[q];if(0<r(J,Z))I[q]=Z,I[oe]=J,oe=q;else break e}}function s(I){return I.length===0?null:I[0]}function a(I){if(I.length===0)return null;var Z=I[0],oe=I.pop();if(oe!==Z){I[0]=oe;e:for(var q=0,J=I.length,O=J>>>1;q<O;){var G=2*(q+1)-1,ie=I[G],re=G+1,ce=I[re];if(0>r(ie,oe))re<J&&0>r(ce,ie)?(I[q]=ce,I[re]=oe,q=re):(I[q]=ie,I[G]=oe,q=G);else if(re<J&&0>r(ce,oe))I[q]=ce,I[re]=oe,q=re;else break e}}return Z}function r(I,Z){var oe=I.sortIndex-Z.sortIndex;return oe!==0?oe:I.id-Z.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var d=Date,f=d.now();e.unstable_now=function(){return d.now()-f}}var p=[],m=[],v=1,y=null,b=3,x=!1,j=!1,S=!1,C=!1,k=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;function z(I){for(var Z=s(m);Z!==null;){if(Z.callback===null)a(m);else if(Z.startTime<=I)a(m),Z.sortIndex=Z.expirationTime,t(p,Z);else break;Z=s(m)}}function L(I){if(S=!1,z(I),!j)if(s(p)!==null)j=!0,M||(M=!0,se());else{var Z=s(m);Z!==null&&we(L,Z.startTime-I)}}var M=!1,A=-1,T=5,B=-1;function te(){return C?!0:!(e.unstable_now()-B<T)}function Y(){if(C=!1,M){var I=e.unstable_now();B=I;var Z=!0;try{e:{j=!1,S&&(S=!1,E(A),A=-1),x=!0;var oe=b;try{t:{for(z(I),y=s(p);y!==null&&!(y.expirationTime>I&&te());){var q=y.callback;if(typeof q=="function"){y.callback=null,b=y.priorityLevel;var J=q(y.expirationTime<=I);if(I=e.unstable_now(),typeof J=="function"){y.callback=J,z(I),Z=!0;break t}y===s(p)&&a(p),z(I)}else a(p);y=s(p)}if(y!==null)Z=!0;else{var O=s(m);O!==null&&we(L,O.startTime-I),Z=!1}}break e}finally{y=null,b=oe,x=!1}Z=void 0}}finally{Z?se():M=!1}}}var se;if(typeof R=="function")se=function(){R(Y)};else if(typeof MessageChannel<"u"){var pe=new MessageChannel,ke=pe.port2;pe.port1.onmessage=Y,se=function(){ke.postMessage(null)}}else se=function(){k(Y,0)};function we(I,Z){A=k(function(){I(e.unstable_now())},Z)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(I){I.callback=null},e.unstable_forceFrameRate=function(I){0>I||125<I?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<I?Math.floor(1e3/I):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_next=function(I){switch(b){case 1:case 2:case 3:var Z=3;break;default:Z=b}var oe=b;b=Z;try{return I()}finally{b=oe}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(I,Z){switch(I){case 1:case 2:case 3:case 4:case 5:break;default:I=3}var oe=b;b=I;try{return Z()}finally{b=oe}},e.unstable_scheduleCallback=function(I,Z,oe){var q=e.unstable_now();switch(typeof oe=="object"&&oe!==null?(oe=oe.delay,oe=typeof oe=="number"&&0<oe?q+oe:q):oe=q,I){case 1:var J=-1;break;case 2:J=250;break;case 5:J=1073741823;break;case 4:J=1e4;break;default:J=5e3}return J=oe+J,I={id:v++,callback:Z,priorityLevel:I,startTime:oe,expirationTime:J,sortIndex:-1},oe>q?(I.sortIndex=oe,t(m,I),s(p)===null&&I===s(m)&&(S?(E(A),A=-1):S=!0,we(L,oe-q))):(I.sortIndex=J,t(p,I),j||x||(j=!0,M||(M=!0,se()))),I},e.unstable_shouldYield=te,e.unstable_wrapCallback=function(I){var Z=b;return function(){var oe=b;b=Z;try{return I.apply(this,arguments)}finally{b=oe}}}})(xh)),xh}var Bv;function fk(){return Bv||(Bv=1,bh.exports=dk()),bh.exports}var Sh={exports:{}},tn={};var qv;function hk(){if(qv)return tn;qv=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 Hv;function Gx(){if(Hv)return Sh.exports;Hv=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 Zv;function mk(){if(Zv)return Do;Zv=1;var e=fk(),t=rl(),s=Gx();function a(n){var i="https://react.dev/errors/"+n;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var o=2;o<arguments.length;o++)i+="&args[]="+encodeURIComponent(arguments[o])}return"Minified React error #"+n+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function c(n){var i=n,o=n;if(n.alternate)for(;i.return;)i=i.return;else{n=i;do i=n,(i.flags&4098)!==0&&(o=i.return),n=i.return;while(n)}return i.tag===3?o:null}function d(n){if(n.tag===13){var i=n.memoizedState;if(i===null&&(n=n.alternate,n!==null&&(i=n.memoizedState)),i!==null)return i.dehydrated}return null}function f(n){if(n.tag===31){var i=n.memoizedState;if(i===null&&(n=n.alternate,n!==null&&(i=n.memoizedState)),i!==null)return i.dehydrated}return null}function p(n){if(c(n)!==n)throw Error(a(188))}function m(n){var i=n.alternate;if(!i){if(i=c(n),i===null)throw Error(a(188));return i!==n?null:n}for(var o=n,u=i;;){var h=o.return;if(h===null)break;var g=h.alternate;if(g===null){if(u=h.return,u!==null){o=u;continue}break}if(h.child===g.child){for(g=h.child;g;){if(g===o)return p(h),n;if(g===u)return p(h),i;g=g.sibling}throw Error(a(188))}if(o.return!==u.return)o=h,u=g;else{for(var w=!1,_=h.child;_;){if(_===o){w=!0,o=h,u=g;break}if(_===u){w=!0,u=h,o=g;break}_=_.sibling}if(!w){for(_=g.child;_;){if(_===o){w=!0,o=g,u=h;break}if(_===u){w=!0,u=g,o=h;break}_=_.sibling}if(!w)throw Error(a(189))}}if(o.alternate!==u)throw Error(a(190))}if(o.tag!==3)throw Error(a(188));return o.stateNode.current===o?n:i}function v(n){var i=n.tag;if(i===5||i===26||i===27||i===6)return n;for(n=n.child;n!==null;){if(i=v(n),i!==null)return i;n=n.sibling}return null}var y=Object.assign,b=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),j=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),R=Symbol.for("react.context"),z=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),M=Symbol.for("react.suspense_list"),A=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),B=Symbol.for("react.activity"),te=Symbol.for("react.memo_cache_sentinel"),Y=Symbol.iterator;function se(n){return n===null||typeof n!="object"?null:(n=Y&&n[Y]||n["@@iterator"],typeof n=="function"?n:null)}var pe=Symbol.for("react.client.reference");function ke(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===pe?null:n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case S:return"Fragment";case k:return"Profiler";case C:return"StrictMode";case L:return"Suspense";case M:return"SuspenseList";case B:return"Activity"}if(typeof n=="object")switch(n.$$typeof){case j:return"Portal";case R:return n.displayName||"Context";case E:return(n._context.displayName||"Context")+".Consumer";case z:var i=n.render;return n=n.displayName,n||(n=i.displayName||i.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case A: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 we=Array.isArray,I=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Z=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,oe={pending:!1,data:null,method:null,action:null},q=[],J=-1;function O(n){return{current:n}}function G(n){0>J||(n.current=q[J],q[J]=null,J--)}function ie(n,i){J++,q[J]=n.current,n.current=i}var re=O(null),ce=O(null),he=O(null),de=O(null);function De(n,i){switch(ie(he,i),ie(ce,n),ie(re,null),i.nodeType){case 9:case 11:n=(n=i.documentElement)&&(n=n.namespaceURI)?av(n):0;break;default:if(n=i.tagName,i=i.namespaceURI)i=av(i),n=rv(i,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}G(re),ie(re,n)}function ge(){G(re),G(ce),G(he)}function Ge(n){n.memoizedState!==null&&ie(de,n);var i=re.current,o=rv(i,n.type);i!==o&&(ie(ce,n),ie(re,o))}function st(n){ce.current===n&&(G(re),G(ce)),de.current===n&&(G(de),Eo._currentValue=oe)}var me,Xe;function ut(n){if(me===void 0)try{throw Error()}catch(o){var i=o.stack.trim().match(/\n( *(at )?)/);me=i&&i[1]||"",Xe=-1<o.stack.indexOf(`
|
|
2
|
+
at`)?" (<anonymous>)":-1<o.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
+
`+me+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 ne=function(){throw Error()};if(Object.defineProperty(ne.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ne,[])}catch(Q){var K=Q}Reflect.construct(n,[],ne)}else{try{ne.call()}catch(Q){K=Q}n.call(ne.prototype)}}else{try{throw Error()}catch(Q){K=Q}(ne=n())&&typeof ne.catch=="function"&&ne.catch(function(){})}}catch(Q){if(Q&&K&&typeof Q.stack=="string")return[Q.stack,K.stack]}return[null,null]}};u.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var h=Object.getOwnPropertyDescriptor(u.DetermineComponentFrameRoot,"name");h&&h.configurable&&Object.defineProperty(u.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var g=u.DetermineComponentFrameRoot(),w=g[0],_=g[1];if(w&&_){var D=w.split(`
|
|
4
|
+
`),F=_.split(`
|
|
5
|
+
`);for(h=u=0;u<D.length&&!D[u].includes("DetermineComponentFrameRoot");)u++;for(;h<F.length&&!F[h].includes("DetermineComponentFrameRoot");)h++;if(u===D.length||h===F.length)for(u=D.length-1,h=F.length-1;1<=u&&0<=h&&D[u]!==F[h];)h--;for(;1<=u&&0<=h;u--,h--)if(D[u]!==F[h]){if(u!==1||h!==1)do if(u--,h--,0>h||D[u]!==F[h]){var X=`
|
|
6
|
+
`+D[u].replace(" at new "," at ");return n.displayName&&X.includes("<anonymous>")&&(X=X.replace("<anonymous>",n.displayName)),X}while(1<=u&&0<=h);break}}}finally{nn=!1,Error.prepareStackTrace=o}return(o=n?n.displayName||n.name:"")?ut(o):""}function sn(n,i){switch(n.tag){case 26:case 27:case 5:return ut(n.type);case 16:return ut("Lazy");case 13:return n.child!==i&&i!==null?ut("Suspense Fallback"):ut("Suspense");case 19:return ut("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 ut("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,le=e.unstable_shouldYield,Pe=e.unstable_requestPaint,Ie=e.unstable_now,ze=e.unstable_getCurrentPriorityLevel,Le=e.unstable_ImmediatePriority,pt=e.unstable_UserBlockingPriority,an=e.unstable_NormalPriority,Ss=e.unstable_LowPriority,Ks=e.unstable_IdlePriority,ws=e.log,Vs=e.unstable_setDisableYieldValue,ls=null,_e=null;function Ht(n){if(typeof ws=="function"&&Vs(n),_e&&typeof _e.setStrictMode=="function")try{_e.setStrictMode(ls,n)}catch{}}var Ke=Math.clz32?Math.clz32:pl,ae=Math.log,Yn=Math.LN2;function pl(n){return n>>>=0,n===0?32:31-(ae(n)/Yn|0)|0}var Qs=256,js=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 Aa(n,i,o){var u=n.pendingLanes;if(u===0)return 0;var h=0,g=n.suspendedLanes,w=n.pingedLanes;n=n.warmLanes;var _=u&134217727;return _!==0?(u=_&~g,u!==0?h=cs(u):(w&=_,w!==0?h=cs(w):o||(o=_&~n,o!==0&&(h=cs(o))))):(_=u&~g,_!==0?h=cs(_):w!==0?h=cs(w):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 w=n.pendingLanes;n.pendingLanes=o,n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0,n.expiredLanes&=o,n.entangledLanes&=o,n.errorRecoveryDisabledLanes&=o,n.shellSuspendCounter=0;var _=n.entanglements,D=n.expirationTimes,F=n.hiddenUpdates;for(o=w&~o;0<o;){var X=31-Ke(o),ne=1<<X;_[X]=0,D[X]=-1;var K=F[X];if(K!==null)for(F[X]=null,X=0;X<K.length;X++){var Q=K[X];Q!==null&&(Q.lane&=-536870913)}o&=~ne}u!==0&&vl(n,u,0),g!==0&&h===0&&n.tag!==0&&(n.suspendedLanes|=g&~(w&~i))}function vl(n,i,o){n.pendingLanes|=i,n.suspendedLanes&=~i;var u=31-Ke(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-Ke(o),h=1<<u;h&i|n[u]&i&&(n[u]|=i),o&=~h}}function Hr(n,i){var o=i&-i;return o=(o&42)!==0?1:$(o),(o&(n.suspendedLanes|i))!==0?0:o}function $(n){switch(n){case 2:n=1;break;case 8:n=4;break;case 32:n=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:n=128;break;case 268435456:n=134217728;break;default:n=0}return n}function fe(n){return n&=-n,2<n?8<n?(n&134217727)!==0?32:268435456:8:2}function it(){var n=Z.p;return n!==0?n:(n=window.event,n===void 0?32:Ev(n.type))}function Qt(n,i){var o=Z.p;try{return Z.p=n,i()}finally{Z.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=hv(n);n!==null;){if(o=n[Et])return o;n=hv(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 Be=new Set,at={};function Zt(n,i){rn(n,i),rn(n+"Capture",i)}function rn(n,i){for(at[n]=i,n=0;n<i.length;n++)Be.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]*$"),Zr={},Yp={};function WN(n){return zt.call(Yp,n)?!0:zt.call(Zr,n)?!1:Da.test(n)?Yp[n]=!0:(Zr[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 Jp(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(w){o=""+w,g.call(this,w)}}),Object.defineProperty(n,i,{enumerable:u.enumerable}),{getValue:function(){return o},setValue:function(w){o=""+w},stopTracking:function(){n._valueTracker=null,delete n[i]}}}}function ld(n){if(!n._valueTracker){var i=Jp(n)?"checked":"value";n._valueTracker=e1(n,i,""+n[i])}}function Xp(n){if(!n)return!1;var i=n._valueTracker;if(!i)return!0;var o=i.getValue(),u="";return n&&(u=Jp(n)?n.checked?"true":"false":n.value),n=u,n!==o?(i.setValue(n),!0):!1}function wl(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}var 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,w,_){n.name="",w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?n.type=w:n.removeAttribute("type"),i!=null?w==="number"?(i===0&&n.value===""||n.value!=i)&&(n.value=""+On(i)):n.value!==""+On(i)&&(n.value=""+On(i)):w!=="submit"&&w!=="reset"||n.removeAttribute("value"),i!=null?ud(n,w,On(i)):o!=null?ud(n,w,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 Wp(n,i,o,u,h,g,w,_){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,w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(n.name=w),ld(n)}function ud(n,i,o){i==="number"&&wl(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 eg(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 tg(n,i,o,u){if(i==null){if(u!=null){if(o!=null)throw Error(a(92));if(we(u)){if(1<u.length)throw Error(a(93));u=u[0]}o=u}o==null&&(o=""),i=o}o=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 ng(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 sg(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&&ng(n,h,u)}else for(var g in i)i.hasOwnProperty(g)&&ng(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 jl(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 ig(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&&Xp(u)}break e;case"textarea":eg(n,o.value,o.defaultValue);break e;case"select":i=o.value,i!=null&&La(n,!!o.multiple,i,!1)}}}var md=!1;function ag(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,ig(i),n)))for(i=0;i<n.length;i++)ig(n[i])}}function Fr(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 Gr={};Object.defineProperty(Gr,"passive",{get:function(){pd=!0}}),window.addEventListener("test",Gr,Gr),window.removeEventListener("test",Gr,Gr)}catch{pd=!1}var ei=null,gd=null,Nl=null;function rg(){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 w=o-n;for(u=1;u<=w&&i[o-u]===h[g-u];u++);return Nl=h.slice(n,1<u?1-u:void 0)}function Cl(n){var i=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&i===13&&(n=13)):n=i,n===10&&(n=13),32<=n||n===13?n:0}function kl(){return!0}function og(){return!1}function mn(n){function i(o,u,h,g,w){this._reactName=o,this._targetInst=h,this.type=u,this.nativeEvent=g,this.target=w,this.currentTarget=null;for(var _ in n)n.hasOwnProperty(_)&&(o=n[_],this[_]=o?o(g):g[_]);return this.isDefaultPrevented=(g.defaultPrevented!=null?g.defaultPrevented:g.returnValue===!1)?kl:og,this.isPropagationStopped=og,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),Kr=y({},Gi,{view:0,detail:0}),a1=mn(Kr),yd,vd,Vr,zl=y({},Kr,{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!==Vr&&(Vr&&n.type==="mousemove"?(yd=n.screenX-Vr.screenX,vd=n.screenY-Vr.screenY):vd=yd=0,Vr=n),yd)},movementY:function(n){return"movementY"in n?n.movementY:vd}}),lg=mn(zl),r1=y({},zl,{dataTransfer:0}),o1=mn(r1),l1=y({},Kr,{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}),cg=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({},Kr,{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}),ug=mn(x1),S1=y({},Kr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:xd}),w1=mn(S1),j1=y({},Gi,{propertyName:0,elapsedTime:0,pseudoElement:0}),N1=mn(j1),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,Qr=null;ks&&"documentMode"in document&&(Qr=document.documentMode);var R1=ks&&"TextEvent"in window&&!Qr,dg=ks&&(!Sd||Qr&&8<Qr&&11>=Qr),fg=" ",hg=!1;function mg(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 pg(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var Pa=!1;function A1(n,i){switch(n){case"compositionend":return pg(i);case"keypress":return i.which!==32?null:(hg=!0,fg);case"textInput":return n=i.data,n===fg&&hg?null:n;default:return null}}function T1(n,i){if(Pa)return n==="compositionend"||!Sd&&mg(n,i)?(n=rg(),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 dg&&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 gg(n){var i=n&&n.nodeName&&n.nodeName.toLowerCase();return i==="input"?!!O1[n.type]:i==="textarea"}function yg(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 Yr=null,Jr=null;function D1(n){W0(n,0)}function El(n){var i=fs(n);if(Xp(i))return n}function vg(n,i){if(n==="change")return i}var bg=!1;if(ks){var wd;if(ks){var jd="oninput"in document;if(!jd){var xg=document.createElement("div");xg.setAttribute("oninput","return;"),jd=typeof xg.oninput=="function"}wd=jd}else wd=!1;bg=wd&&(!document.documentMode||9<document.documentMode)}function Sg(){Yr&&(Yr.detachEvent("onpropertychange",wg),Jr=Yr=null)}function wg(n){if(n.propertyName==="value"&&El(Jr)){var i=[];yg(i,Jr,n,hd(n)),ag(D1,i)}}function L1(n,i,o){n==="focusin"?(Sg(),Yr=i,Jr=o,Yr.attachEvent("onpropertychange",wg)):n==="focusout"&&Sg()}function M1(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return El(Jr)}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 Xr(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 jg(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function Ng(n,i){var o=jg(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=jg(o)}}function Cg(n,i){return n&&i?n===i?!0:n&&n.nodeType===3?!1:i&&i.nodeType===3?Cg(n,i.parentNode):"contains"in n?n.contains(i):n.compareDocumentPosition?!!(n.compareDocumentPosition(i)&16):!1:!1}function kg(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var i=wl(n.document);i instanceof n.HTMLIFrameElement;){try{var o=typeof i.contentWindow.location.href=="string"}catch{o=!1}if(o)n=i.contentWindow;else break;i=wl(n.document)}return i}function 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,Wr=null,kd=!1;function _g(n,i,o){var u=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;kd||Ia==null||Ia!==wl(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}),Wr&&Xr(Wr,u)||(Wr=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={},zg={};ks&&(zg=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 zg)return _d[n]=i[o];return n}var Eg=Vi("animationend"),Rg=Vi("animationiteration"),Ag=Vi("animationstart"),B1=Vi("transitionrun"),q1=Vi("transitionstart"),H1=Vi("transitioncancel"),Tg=Vi("transitionend"),Og=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){Og.set(n,i),Zt(i,[n])}var Rl=typeof reportError=="function"?reportError:function(n){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof n=="object"&&n!==null&&typeof n.message=="string"?String(n.message):String(n),error:n});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",n);return}console.error(n)},Ln=[],qa=0,Ed=0;function Al(){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 w=u.pending;w===null?h.next=h:(h.next=w.next,w.next=h),u.pending=h}g!==0&&Dg(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 Rd(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 Dg(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-Ke(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<wo)throw wo=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 Ad(n){return n=n.prototype,!(!n||!n.isReactComponent)}function _s(n,i){var o=n.alternate;return o===null?(o=_n(n.tag,i,n.key,n.mode),o.elementType=n.elementType,o.type=n.type,o.stateNode=n.stateNode,o.alternate=n,n.alternate=o):(o.pendingProps=i,o.type=n.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=n.flags&65011712,o.childLanes=n.childLanes,o.lanes=n.lanes,o.child=n.child,o.memoizedProps=n.memoizedProps,o.memoizedState=n.memoizedState,o.updateQueue=n.updateQueue,i=n.dependencies,o.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},o.sibling=n.sibling,o.index=n.index,o.ref=n.ref,o.refCleanup=n.refCleanup,o}function Lg(n,i){n.flags&=65011714;var o=n.alternate;return o===null?(n.childLanes=0,n.lanes=i,n.child=null,n.subtreeFlags=0,n.memoizedProps=null,n.memoizedState=null,n.updateQueue=null,n.dependencies=null,n.stateNode=null):(n.childLanes=o.childLanes,n.lanes=o.lanes,n.child=o.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=o.memoizedProps,n.memoizedState=o.memoizedState,n.updateQueue=o.updateQueue,n.type=o.type,i=o.dependencies,n.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),n}function Dl(n,i,o,u,h,g){var w=0;if(u=n,typeof n=="function")Ad(n)&&(w=1);else if(typeof n=="string")w=QC(n,o,re.current)?26:n==="html"||n==="head"||n==="body"?27:5;else e:switch(n){case B:return n=_n(31,o,i,h),n.elementType=B,n.lanes=g,n;case S:return Yi(o.children,h,g,i);case C:w=8,h|=24;break;case k:return n=_n(12,o,i,h|2),n.elementType=k,n.lanes=g,n;case L:return n=_n(13,o,i,h),n.elementType=L,n.lanes=g,n;case M:return n=_n(19,o,i,h),n.elementType=M,n.lanes=g,n;default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case R:w=10;break e;case E:w=9;break e;case z:w=11;break e;case A:w=14;break e;case T:w=16,u=null;break e}w=29,o=Error(a(130,n===null?"null":typeof n,"")),u=null}return i=_n(w,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 Mg(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 Ug=new WeakMap;function Mn(n,i){if(typeof n=="object"&&n!==null){var o=Ug.get(n);return o!==void 0?o:(i={value:n,source:i,stack:Vt(i)},Ug.set(n,i),i)}return{value:n,source:i,stack:Vt(i)}}var Za=[],Fa=0,Ll=null,eo=0,Un=[],$n=0,ti=null,hs=1,ms="";function zs(n,i){Za[Fa++]=eo,Za[Fa++]=Ll,Ll=n,eo=i}function $g(n,i,o){Un[$n++]=hs,Un[$n++]=ms,Un[$n++]=ti,ti=n;var u=hs;n=ms;var h=32-Ke(u)-1;u&=~(1<<h),o+=1;var g=32-Ke(i)+h;if(30<g){var w=h-h%5;g=(u&(1<<w)-1).toString(32),u>>=w,h-=w,hs=1<<32-Ke(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),$g(n,1,0))}function Ld(n){for(;n===Ll;)Ll=Za[--Fa],Za[Fa]=null,eo=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 Pg(n,i){Un[$n++]=hs,Un[$n++]=ms,Un[$n++]=ti,hs=i.id,ms=i.overflow,ti=n}var Yt=null,ht=null,Ze=!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 to(Mn(i,n)),Md}function Ig(n){var i=n.stateNode,o=n.type,u=n.memoizedProps;switch(i[Et]=n,i[Nt]=u,o){case"dialog":$e("cancel",i),$e("close",i);break;case"iframe":case"object":case"embed":$e("load",i);break;case"video":case"audio":for(o=0;o<No.length;o++)$e(No[o],i);break;case"source":$e("error",i);break;case"img":case"image":case"link":$e("error",i),$e("load",i);break;case"details":$e("toggle",i);break;case"input":$e("invalid",i),Wp(i,u.value,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name,!0);break;case"select":$e("invalid",i);break;case"textarea":$e("invalid",i),tg(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||sv(i.textContent,o)?(u.popover!=null&&($e("beforetoggle",i),$e("toggle",i)),u.onScroll!=null&&$e("scroll",i),u.onScrollEnd!=null&&$e("scrollend",i),u.onClick!=null&&(i.onclick=Cs),i=!0):i=!1,i||si(n,!0)}function Bg(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(!Ze)return Bg(n),Ze=!0,!1;var i=n.tag,o;if((o=i!==3&&i!==27)&&((o=i===5)&&(o=n.type,o=!(o!=="form"&&o!=="button")||th(n.type,n.memoizedProps)),o=!o),o&&ht&&si(n),Bg(n),i===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(a(317));ht=fv(n)}else if(i===31){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(a(317));ht=fv(n)}else i===27?(i=ht,yi(n.type)?(n=rh,rh=null,ht=n):ht=i):ht=Yt?Bn(n.stateNode.nextSibling):null;return!0}function Ji(){ht=Yt=null,Ze=!1}function Ud(){var n=ni;return n!==null&&(vn===null?vn=n:vn.push.apply(vn,n),ni=null),n}function to(n){ni===null?ni=[n]:ni.push(n)}var $d=O(null),Xi=null,Es=null;function ii(n,i,o){ie($d,i._currentValue),i._currentValue=o}function Rs(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 w=h.child;g=g.firstContext;e:for(;g!==null;){var _=g;g=h;for(var D=0;D<i.length;D++)if(_.context===i[D]){g.lanes|=o,_=g.alternate,_!==null&&(_.lanes|=o),Pd(g.return,o,n),u||(w=null);break e}g=_.next}}else if(h.tag===18){if(w=h.return,w===null)throw Error(a(341));w.lanes|=o,g=w.alternate,g!==null&&(g.lanes|=o),Pd(w,o,n),w=null}else w=h.child;if(w!==null)w.return=h;else for(w=h;w!==null;){if(w===n){w=null;break}if(h=w.sibling,h!==null){h.return=w.return,w=h;break}w=w.return}h=w}}function 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 w=h.alternate;if(w===null)throw Error(a(387));if(w=w.memoizedProps,w!==null){var _=h.type;kn(h.pendingProps.value,w.value)||(n!==null?n.push(_):n=[_])}}else if(h===de.current){if(w=h.alternate,w===null)throw Error(a(387));w.memoizedState.memoizedState!==h.memoizedState.memoizedState&&(n!==null?n.push(Eo):n=[Eo])}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 qg(Xi,n)}function Ul(n,i){return Xi===null&&Wi(n),qg(n,i)}function qg(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:R,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Bd(){return{controller:new F1,data:new Map,refCount:0}}function no(n){n.refCount--,n.refCount===0&&G1(K1,function(){n.controller.abort()})}var so=null,qd=0,Va=0,Qa=null;function V1(n,i){if(so===null){var o=so=[];qd=0,Va=Gf(),Qa={status:"pending",value:void 0,then:function(u){o.push(u)}}}return qd++,i.then(Hg,Hg),i}function Hg(){if(--qd===0&&so!==null){Qa!==null&&(Qa.status="fulfilled");var n=so;so=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 Zg=I.S;I.S=function(n,i){_0=Ie(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&V1(n,i),Zg!==null&&Zg(n,i)};var ea=O(null);function Hd(){var n=ea.current;return n!==null?n:ct.pooledCache}function $l(n,i){i===null?ie(ea,ea.current):ie(ea,i.pool)}function Fg(){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 Gg(n){return n=n.status,n==="fulfilled"||n==="rejected"}function Kg(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,Qg(n),n;default:if(typeof i.status=="string")i.then(Cs,Cs);else{if(n=ct,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,Qg(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 Vg(){if(na===null)throw Error(a(459));var n=na;return na=null,n}function Qg(n){if(n===Ya||n===Pl)throw Error(a(483))}var Ja=null,io=0;function Bl(n){var i=io;return io+=1,Ja===null&&(Ja=[]),Kg(Ja,n,i)}function ao(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 Yg(n){function i(P,U){if(n){var H=P.deletions;H===null?(P.deletions=[U],P.flags|=16):H.push(U)}}function o(P,U){if(!n)return null;for(;U!==null;)i(P,U),U=U.sibling;return null}function u(P){for(var U=new Map;P!==null;)P.key!==null?U.set(P.key,P):U.set(P.index,P),P=P.sibling;return U}function h(P,U){return P=_s(P,U),P.index=0,P.sibling=null,P}function g(P,U,H){return P.index=H,n?(H=P.alternate,H!==null?(H=H.index,H<U?(P.flags|=67108866,U):H):(P.flags|=67108866,U)):(P.flags|=1048576,U)}function w(P){return n&&P.alternate===null&&(P.flags|=67108866),P}function _(P,U,H,W){return U===null||U.tag!==6?(U=Td(H,P.mode,W),U.return=P,U):(U=h(U,H),U.return=P,U)}function D(P,U,H,W){var Ne=H.type;return Ne===S?X(P,U,H.props.children,W,H.key):U!==null&&(U.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===T&&ta(Ne)===U.type)?(U=h(U,H.props),ao(U,H),U.return=P,U):(U=Dl(H.type,H.key,H.props,null,P.mode,W),ao(U,H),U.return=P,U)}function F(P,U,H,W){return U===null||U.tag!==4||U.stateNode.containerInfo!==H.containerInfo||U.stateNode.implementation!==H.implementation?(U=Od(H,P.mode,W),U.return=P,U):(U=h(U,H.children||[]),U.return=P,U)}function X(P,U,H,W,Ne){return U===null||U.tag!==7?(U=Yi(H,P.mode,W,Ne),U.return=P,U):(U=h(U,H),U.return=P,U)}function ne(P,U,H){if(typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint")return U=Td(""+U,P.mode,H),U.return=P,U;if(typeof U=="object"&&U!==null){switch(U.$$typeof){case x:return H=Dl(U.type,U.key,U.props,null,P.mode,H),ao(H,U),H.return=P,H;case j:return U=Od(U,P.mode,H),U.return=P,U;case T:return U=ta(U),ne(P,U,H)}if(we(U)||se(U))return U=Yi(U,P.mode,H,null),U.return=P,U;if(typeof U.then=="function")return ne(P,Bl(U),H);if(U.$$typeof===R)return ne(P,Ul(P,U),H);ql(P,U)}return null}function K(P,U,H,W){var Ne=U!==null?U.key:null;if(typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint")return Ne!==null?null:_(P,U,""+H,W);if(typeof H=="object"&&H!==null){switch(H.$$typeof){case x:return H.key===Ne?D(P,U,H,W):null;case j:return H.key===Ne?F(P,U,H,W):null;case T:return H=ta(H),K(P,U,H,W)}if(we(H)||se(H))return Ne!==null?null:X(P,U,H,W,null);if(typeof H.then=="function")return K(P,U,Bl(H),W);if(H.$$typeof===R)return K(P,U,Ul(P,H),W);ql(P,H)}return null}function Q(P,U,H,W,Ne){if(typeof W=="string"&&W!==""||typeof W=="number"||typeof W=="bigint")return P=P.get(H)||null,_(U,P,""+W,Ne);if(typeof W=="object"&&W!==null){switch(W.$$typeof){case x:return P=P.get(W.key===null?H:W.key)||null,D(U,P,W,Ne);case j:return P=P.get(W.key===null?H:W.key)||null,F(U,P,W,Ne);case T:return W=ta(W),Q(P,U,H,W,Ne)}if(we(W)||se(W))return P=P.get(H)||null,X(U,P,W,Ne,null);if(typeof W.then=="function")return Q(P,U,H,Bl(W),Ne);if(W.$$typeof===R)return Q(P,U,H,Ul(U,W),Ne);ql(U,W)}return null}function ye(P,U,H,W){for(var Ne=null,Ve=null,Se=U,Te=U=0,He=null;Se!==null&&Te<H.length;Te++){Se.index>Te?(He=Se,Se=null):He=Se.sibling;var Qe=K(P,Se,H[Te],W);if(Qe===null){Se===null&&(Se=He);break}n&&Se&&Qe.alternate===null&&i(P,Se),U=g(Qe,U,Te),Ve===null?Ne=Qe:Ve.sibling=Qe,Ve=Qe,Se=He}if(Te===H.length)return o(P,Se),Ze&&zs(P,Te),Ne;if(Se===null){for(;Te<H.length;Te++)Se=ne(P,H[Te],W),Se!==null&&(U=g(Se,U,Te),Ve===null?Ne=Se:Ve.sibling=Se,Ve=Se);return Ze&&zs(P,Te),Ne}for(Se=u(Se);Te<H.length;Te++)He=Q(Se,P,Te,H[Te],W),He!==null&&(n&&He.alternate!==null&&Se.delete(He.key===null?Te:He.key),U=g(He,U,Te),Ve===null?Ne=He:Ve.sibling=He,Ve=He);return n&&Se.forEach(function(wi){return i(P,wi)}),Ze&&zs(P,Te),Ne}function Ce(P,U,H,W){if(H==null)throw Error(a(151));for(var Ne=null,Ve=null,Se=U,Te=U=0,He=null,Qe=H.next();Se!==null&&!Qe.done;Te++,Qe=H.next()){Se.index>Te?(He=Se,Se=null):He=Se.sibling;var wi=K(P,Se,Qe.value,W);if(wi===null){Se===null&&(Se=He);break}n&&Se&&wi.alternate===null&&i(P,Se),U=g(wi,U,Te),Ve===null?Ne=wi:Ve.sibling=wi,Ve=wi,Se=He}if(Qe.done)return o(P,Se),Ze&&zs(P,Te),Ne;if(Se===null){for(;!Qe.done;Te++,Qe=H.next())Qe=ne(P,Qe.value,W),Qe!==null&&(U=g(Qe,U,Te),Ve===null?Ne=Qe:Ve.sibling=Qe,Ve=Qe);return Ze&&zs(P,Te),Ne}for(Se=u(Se);!Qe.done;Te++,Qe=H.next())Qe=Q(Se,P,Te,Qe.value,W),Qe!==null&&(n&&Qe.alternate!==null&&Se.delete(Qe.key===null?Te:Qe.key),U=g(Qe,U,Te),Ve===null?Ne=Qe:Ve.sibling=Qe,Ve=Qe);return n&&Se.forEach(function(rk){return i(P,rk)}),Ze&&zs(P,Te),Ne}function lt(P,U,H,W){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;U!==null;){if(U.key===Ne){if(Ne=H.type,Ne===S){if(U.tag===7){o(P,U.sibling),W=h(U,H.props.children),W.return=P,P=W;break e}}else if(U.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===T&&ta(Ne)===U.type){o(P,U.sibling),W=h(U,H.props),ao(W,H),W.return=P,P=W;break e}o(P,U);break}else i(P,U);U=U.sibling}H.type===S?(W=Yi(H.props.children,P.mode,W,H.key),W.return=P,P=W):(W=Dl(H.type,H.key,H.props,null,P.mode,W),ao(W,H),W.return=P,P=W)}return w(P);case j:e:{for(Ne=H.key;U!==null;){if(U.key===Ne)if(U.tag===4&&U.stateNode.containerInfo===H.containerInfo&&U.stateNode.implementation===H.implementation){o(P,U.sibling),W=h(U,H.children||[]),W.return=P,P=W;break e}else{o(P,U);break}else i(P,U);U=U.sibling}W=Od(H,P.mode,W),W.return=P,P=W}return w(P);case T:return H=ta(H),lt(P,U,H,W)}if(we(H))return ye(P,U,H,W);if(se(H)){if(Ne=se(H),typeof Ne!="function")throw Error(a(150));return H=Ne.call(H),Ce(P,U,H,W)}if(typeof H.then=="function")return lt(P,U,Bl(H),W);if(H.$$typeof===R)return lt(P,U,Ul(P,H),W);ql(P,H)}return typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint"?(H=""+H,U!==null&&U.tag===6?(o(P,U.sibling),W=h(U,H),W.return=P,P=W):(o(P,U),W=Td(H,P.mode,W),W.return=P,P=W),w(P)):o(P,U)}return function(P,U,H,W){try{io=0;var Ne=lt(P,U,H,W);return Ja=null,Ne}catch(Se){if(Se===Ya||Se===Pl)throw Se;var Ve=_n(29,Se,null,P.mode);return Ve.lanes=W,Ve.return=P,Ve}}}var sa=Yg(!0),Jg=Yg(!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,(Je&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),Dg(n,null,o),i}return Tl(n,u,i,o),Ol(n)}function ro(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 w={lane:o.lane,tag:o.tag,payload:o.payload,callback:null,next:null};g===null?h=g=w:g=g.next=w,o=o.next}while(o!==null);g===null?h=g=i:g=g.next=i}else h=g=i;o={baseState:u.baseState,firstBaseUpdate:h,lastBaseUpdate:g,shared:u.shared,callbacks:u.callbacks},n.updateQueue=o;return}n=o.lastBaseUpdate,n===null?o.firstBaseUpdate=i:n.next=i,o.lastBaseUpdate=i}var Vd=!1;function oo(){if(Vd){var n=Qa;if(n!==null)throw n}}function lo(n,i,o,u){Vd=!1;var h=n.updateQueue;ai=!1;var g=h.firstBaseUpdate,w=h.lastBaseUpdate,_=h.shared.pending;if(_!==null){h.shared.pending=null;var D=_,F=D.next;D.next=null,w===null?g=F:w.next=F,w=D;var X=n.alternate;X!==null&&(X=X.updateQueue,_=X.lastBaseUpdate,_!==w&&(_===null?X.firstBaseUpdate=F:_.next=F,X.lastBaseUpdate=D))}if(g!==null){var ne=h.baseState;w=0,X=F=D=null,_=g;do{var K=_.lane&-536870913,Q=K!==_.lane;if(Q?(qe&K)===K:(u&K)===K){K!==0&&K===Va&&(Vd=!0),X!==null&&(X=X.next={lane:0,tag:_.tag,payload:_.payload,callback:null,next:null});e:{var ye=n,Ce=_;K=i;var lt=o;switch(Ce.tag){case 1:if(ye=Ce.payload,typeof ye=="function"){ne=ye.call(lt,ne,K);break e}ne=ye;break e;case 3:ye.flags=ye.flags&-65537|128;case 0:if(ye=Ce.payload,K=typeof ye=="function"?ye.call(lt,ne,K):ye,K==null)break e;ne=y({},ne,K);break e;case 2:ai=!0}}K=_.callback,K!==null&&(n.flags|=64,Q&&(n.flags|=8192),Q=h.callbacks,Q===null?h.callbacks=[K]:Q.push(K))}else Q={lane:K,tag:_.tag,payload:_.payload,callback:_.callback,next:null},X===null?(F=X=Q,D=ne):X=X.next=Q,w|=K;if(_=_.next,_===null){if(_=h.shared.pending,_===null)break;Q=_,_=Q.next,Q.next=null,h.lastBaseUpdate=Q,h.shared.pending=null}}while(!0);X===null&&(D=ne),h.baseState=D,h.firstBaseUpdate=F,h.lastBaseUpdate=X,g===null&&(h.shared.lanes=0),fi|=w,n.lanes=w,n.memoizedState=ne}}function Xg(n,i){if(typeof n!="function")throw Error(a(191,n));n.call(i)}function Wg(n,i){var o=n.callbacks;if(o!==null)for(n.callbacks=null,n=0;n<o.length;n++)Xg(o[n],i)}var Xa=O(null),Hl=O(0);function ey(n,i){n=Ps,ie(Hl,n),ie(Xa,i),Ps=n|i.baseLanes}function Qd(){ie(Hl,Ps),ie(Xa,Xa.current)}function Yd(){Ps=Hl.current,G(Xa),G(Hl)}var zn=O(null),In=null;function li(n){var i=n.alternate;ie(Rt,Rt.current&1),ie(zn,n),In===null&&(i===null||Xa.current!==null||i.memoizedState!==null)&&(In=n)}function Jd(n){ie(Rt,Rt.current),ie(zn,n),In===null&&(In=n)}function ty(n){n.tag===22?(ie(Rt,Rt.current),ie(zn,n),In===null&&(In=n)):ci()}function ci(){ie(Rt,Rt.current),ie(zn,zn.current)}function En(n){G(zn),In===n&&(In=null),G(Rt)}var Rt=O(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 As=0,Ae=null,rt=null,$t=null,Fl=!1,Wa=!1,ia=!1,Gl=0,co=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 As=g,Ae=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,I.H=n===null||n.memoizedState===null?$y:pf,ia=!1,g=o(u,h),ia=!1,Wa&&(g=sy(i,o,u,h)),ny(n),g}function ny(n){I.H=ho;var i=rt!==null&&rt.next!==null;if(As=0,$t=rt=Ae=null,Fl=!1,co=0,er=null,i)throw Error(a(300));n===null||Pt||(n=n.dependencies,n!==null&&Ml(n)&&(Pt=!0))}function sy(n,i,o,u){Ae=n;var h=0;do{if(Wa&&(er=null),co=0,Wa=!1,25<=h)throw Error(a(301));if(h+=1,$t=rt=null,n.updateQueue!=null){var g=n.updateQueue;g.lastEffect=null,g.events=null,g.stores=null,g.memoCache!=null&&(g.memoCache.index=0)}I.H=Py,g=i(o,u)}while(Wa);return g}function J1(){var n=I.H,i=n.useState()[0];return i=typeof i.then=="function"?uo(i):i,n=n.useState()[0],(rt!==null?rt.memoizedState:null)!==n&&(Ae.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}As=0,$t=rt=Ae=null,Wa=!1,co=Gl=0,er=null}function on(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return $t===null?Ae.memoizedState=$t=n:$t=$t.next=n,$t}function At(){if(rt===null){var n=Ae.alternate;n=n!==null?n.memoizedState:null}else n=rt.next;var i=$t===null?Ae.memoizedState:$t.next;if(i!==null)$t=i,rt=n;else{if(n===null)throw Ae.alternate===null?Error(a(467)):Error(a(310));rt=n,n={memoizedState:rt.memoizedState,baseState:rt.baseState,baseQueue:rt.baseQueue,queue:rt.queue,next:null},$t===null?Ae.memoizedState=$t=n:$t=$t.next=n}return $t}function Kl(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function uo(n){var i=co;return co+=1,er===null&&(er=[]),n=Kg(er,n,i),i=Ae,($t===null?i.memoizedState:$t.next)===null&&(i=i.alternate,I.H=i===null||i.memoizedState===null?$y:pf),n}function Vl(n){if(n!==null&&typeof n=="object"){if(typeof n.then=="function")return uo(n);if(n.$$typeof===R)return Jt(n)}throw Error(a(438,String(n)))}function sf(n){var i=null,o=Ae.updateQueue;if(o!==null&&(i=o.memoCache),i==null){var u=Ae.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(),Ae.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]=te;return i.index++,o}function Ts(n,i){return typeof i=="function"?i(n):i}function Ql(n){var i=At();return af(i,rt,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 w=h.next;h.next=g.next,g.next=w}i.baseQueue=h=g,u.pending=null}if(g=n.baseState,h===null)n.memoizedState=g;else{i=h.next;var _=w=null,D=null,F=i,X=!1;do{var ne=F.lane&-536870913;if(ne!==F.lane?(qe&ne)===ne:(As&ne)===ne){var K=F.revertLane;if(K===0)D!==null&&(D=D.next={lane:0,revertLane:0,gesture:null,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null}),ne===Va&&(X=!0);else if((As&K)===K){F=F.next,K===Va&&(X=!0);continue}else ne={lane:0,revertLane:F.revertLane,gesture:null,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null},D===null?(_=D=ne,w=g):D=D.next=ne,Ae.lanes|=K,fi|=K;ne=F.action,ia&&o(g,ne),g=F.hasEagerState?F.eagerState:o(g,ne)}else K={lane:ne,revertLane:F.revertLane,gesture:F.gesture,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null},D===null?(_=D=K,w=g):D=D.next=K,Ae.lanes|=ne,fi|=ne;F=F.next}while(F!==null&&F!==i);if(D===null?w=g:D.next=_,!kn(g,n.memoizedState)&&(Pt=!0,X&&(o=Qa,o!==null)))throw o;n.memoizedState=g,n.baseState=w,n.baseQueue=D,u.lastRenderedState=g}return h===null&&(u.lanes=0),[n.memoizedState,u.dispatch]}function rf(n){var i=At(),o=i.queue;if(o===null)throw Error(a(311));o.lastRenderedReducer=n;var u=o.dispatch,h=o.pending,g=i.memoizedState;if(h!==null){o.pending=null;var w=h=h.next;do g=n(g,w.action),w=w.next;while(w!==h);kn(g,i.memoizedState)||(Pt=!0),i.memoizedState=g,i.baseQueue===null&&(i.baseState=g),o.lastRenderedState=g}return[g,u]}function iy(n,i,o){var u=Ae,h=At(),g=Ze;if(g){if(o===void 0)throw Error(a(407));o=o()}else o=i();var w=!kn((rt||h).memoizedState,o);if(w&&(h.memoizedState=o,Pt=!0),h=h.queue,cf(oy.bind(null,u,h,n),[n]),h.getSnapshot!==i||w||$t!==null&&$t.memoizedState.tag&1){if(u.flags|=2048,tr(9,{destroy:void 0},ry.bind(null,u,h,o,i),null),ct===null)throw Error(a(349));g||(As&127)!==0||ay(u,i,o)}return o}function ay(n,i,o){n.flags|=16384,n={getSnapshot:i,value:o},i=Ae.updateQueue,i===null?(i=Kl(),Ae.updateQueue=i,i.stores=[n]):(o=i.stores,o===null?i.stores=[n]:o.push(n))}function ry(n,i,o,u){i.value=o,i.getSnapshot=u,ly(i)&&cy(n)}function oy(n,i,o){return o(function(){ly(i)&&cy(n)})}function ly(n){var i=n.getSnapshot;n=n.value;try{var o=i();return!kn(n,o)}catch{return!0}}function cy(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 uy(n,i,o,u){return n.baseState=o,af(n,rt,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(w){g.listeners.push(w)}};I.T!==null?o(!0):g.isTransition=!1,u(g),o=i.pending,o===null?(g.next=i.pending=g,dy(i,g)):(g.next=o.next,i.pending=o.next=g)}}function dy(n,i){var o=i.action,u=i.payload,h=n.state;if(i.isTransition){var g=I.T,w={};I.T=w;try{var _=o(h,u),D=I.S;D!==null&&D(w,_),fy(n,i,_)}catch(F){lf(n,i,F)}finally{g!==null&&w.types!==null&&(g.types=w.types),I.T=g}}else try{g=o(h,u),fy(n,i,g)}catch(F){lf(n,i,F)}}function fy(n,i,o){o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(function(u){hy(n,i,u)},function(u){return lf(n,i,u)}):hy(n,i,o)}function hy(n,i,o){i.status="fulfilled",i.value=o,my(i),n.state=o,i=n.pending,i!==null&&(o=i.next,o===i?n.pending=null:(o=o.next,i.next=o,dy(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,my(i),i=i.next;while(i!==u)}n.action=null}function my(n){n=n.listeners;for(var i=0;i<n.length;i++)(0,n[i])()}function py(n,i){return i}function gy(n,i){if(Ze){var o=ct.formState;if(o!==null){e:{var u=Ae;if(Ze){if(ht){t:{for(var h=ht,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){ht=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:py,lastRenderedState:i},o.queue=u,o=Ly.bind(null,Ae,u),u.dispatch=o,u=of(!1),g=mf.bind(null,Ae,!1,u.queue),u=on(),h={state:i,dispatch:null,action:n,pending:null},u.queue=h,o=X1.bind(null,Ae,h,g,o),h.dispatch=o,u.memoizedState=n,[i,o,!1]}function yy(n){var i=At();return vy(i,rt,n)}function vy(n,i,o){if(i=af(n,i,py)[0],n=Ql(Ts)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var u=uo(i)}catch(w){throw w===Ya?Pl:w}else u=i;i=At();var h=i.queue,g=h.dispatch;return o!==i.memoizedState&&(Ae.flags|=2048,tr(9,{destroy:void 0},W1.bind(null,h,o),null)),[u,g,n]}function W1(n,i){n.action=i}function by(n){var i=At(),o=rt;if(o!==null)return vy(i,o,n);At(),i=i.memoizedState,o=At();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=Ae.updateQueue,i===null&&(i=Kl(),Ae.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 xy(){return At().memoizedState}function Yl(n,i,o,u){var h=on();Ae.flags|=n,h.memoizedState=tr(1|i,{destroy:void 0},o,u===void 0?null:u)}function Jl(n,i,o,u){var h=At();u=u===void 0?null:u;var g=h.memoizedState.inst;rt!==null&&u!==null&&Xd(u,rt.memoizedState.deps)?h.memoizedState=tr(i,g,o,u):(Ae.flags|=n,h.memoizedState=tr(1|i,g,o,u))}function Sy(n,i){Yl(8390656,8,n,i)}function cf(n,i){Jl(2048,8,n,i)}function eC(n){Ae.flags|=4;var i=Ae.updateQueue;if(i===null)i=Kl(),Ae.updateQueue=i,i.events=[n];else{var o=i.events;o===null?i.events=[n]:o.push(n)}}function wy(n){var i=At().memoizedState;return eC({ref:i,nextImpl:n}),function(){if((Je&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}function jy(n,i){return Jl(4,2,n,i)}function Ny(n,i){return Jl(4,4,n,i)}function Cy(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 ky(n,i,o){o=o!=null?o.concat([n]):null,Jl(4,4,Cy.bind(null,i,n),o)}function uf(){}function _y(n,i){var o=At();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 zy(n,i){var o=At();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||(As&1073741824)!==0&&(qe&261930)===0?n.memoizedState=i:(n.memoizedState=o,n=E0(),Ae.lanes|=n,fi|=n,o)}function Ey(n,i,o,u){return kn(o,i)?o:Xa.current!==null?(n=df(n,o,u),kn(n,i)||(Pt=!0),n):(As&42)===0||(As&1073741824)!==0&&(qe&261930)===0?(Pt=!0,n.memoizedState=o):(n=E0(),Ae.lanes|=n,fi|=n,i)}function Ry(n,i,o,u,h){var g=Z.p;Z.p=g!==0&&8>g?g:8;var w=I.T,_={};I.T=_,mf(n,!1,i,o);try{var D=h(),F=I.S;if(F!==null&&F(_,D),D!==null&&typeof D=="object"&&typeof D.then=="function"){var X=Q1(D,u);fo(n,i,X,Tn(n))}else fo(n,i,u,Tn(n))}catch(ne){fo(n,i,{then:function(){},status:"rejected",reason:ne},Tn())}finally{Z.p=g,w!==null&&_.types!==null&&(w.types=_.types),I.T=w}}function tC(){}function ff(n,i,o,u){if(n.tag!==5)throw Error(a(476));var h=Ay(n).queue;Ry(n,h,i,oe,o===null?tC:function(){return Ty(n),o(u)})}function Ay(n){var i=n.memoizedState;if(i!==null)return i;i={memoizedState:oe,baseState:oe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ts,lastRenderedState:oe},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 Ty(n){var i=Ay(n);i.next===null&&(i=n.alternate.memoizedState),fo(n,i.next.queue,{},Tn())}function hf(){return Jt(Eo)}function Oy(){return At().memoizedState}function Dy(){return At().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),ro(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)?My(i,o):(o=Rd(n,i,o,u),o!==null&&(bn(o,n,u),Uy(o,i,u)))}function Ly(n,i,o){var u=Tn();fo(n,i,o,u)}function fo(n,i,o,u){var h={lane:u,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null};if(Xl(n))My(i,h);else{var g=n.alternate;if(n.lanes===0&&(g===null||g.lanes===0)&&(g=i.lastRenderedReducer,g!==null))try{var w=i.lastRenderedState,_=g(w,o);if(h.hasEagerState=!0,h.eagerState=_,kn(_,w))return Tl(n,i,h,0),ct===null&&Al(),!1}catch{}if(o=Rd(n,i,h,u),o!==null)return bn(o,n,u),Uy(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=Rd(n,o,u,2),i!==null&&bn(i,n,2)}function Xl(n){var i=n.alternate;return n===Ae||i!==null&&i===Ae}function My(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 Uy(n,i,o){if((o&4194048)!==0){var u=i.lanes;u&=n.pendingLanes,o|=u,i.lanes=o,bl(n,o)}}var ho={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};ho.useEffectEvent=Ct;var $y={readContext:Jt,use:Vl,useCallback:function(n,i){return on().memoizedState=[n,i===void 0?null:i],n},useContext:Jt,useEffect:Sy,useImperativeHandle:function(n,i,o){o=o!=null?o.concat([n]):null,Yl(4194308,4,Cy.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,Ae,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=Ly.bind(null,Ae,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=Ry.bind(null,Ae,n.queue,!0,!1),on().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,i,o){var u=Ae,h=on();if(Ze){if(o===void 0)throw Error(a(407));o=o()}else{if(o=i(),ct===null)throw Error(a(349));(qe&127)!==0||ay(u,i,o)}h.memoizedState=o;var g={value:o,getSnapshot:i};return h.queue=g,Sy(oy.bind(null,u,g,n),[n]),u.flags|=2048,tr(9,{destroy:void 0},ry.bind(null,u,g,o,i),null),o},useId:function(){var n=on(),i=ct.identifierPrefix;if(Ze){var o=ms,u=hs;o=(u&~(1<<32-Ke(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:gy,useActionState:gy,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,Ae,!0,o),o.dispatch=i,[n,i]},useMemoCache:sf,useCacheRefresh:function(){return on().memoizedState=nC.bind(null,Ae)},useEffectEvent:function(n){var i=on(),o={impl:n};return i.memoizedState=o,function(){if((Je&2)!==0)throw Error(a(440));return o.impl.apply(void 0,arguments)}}},pf={readContext:Jt,use:Vl,useCallback:_y,useContext:Jt,useEffect:cf,useImperativeHandle:ky,useInsertionEffect:jy,useLayoutEffect:Ny,useMemo:zy,useReducer:Ql,useRef:xy,useState:function(){return Ql(Ts)},useDebugValue:uf,useDeferredValue:function(n,i){var o=At();return Ey(o,rt.memoizedState,n,i)},useTransition:function(){var n=Ql(Ts)[0],i=At().memoizedState;return[typeof n=="boolean"?n:uo(n),i]},useSyncExternalStore:iy,useId:Oy,useHostTransitionStatus:hf,useFormState:yy,useActionState:yy,useOptimistic:function(n,i){var o=At();return uy(o,rt,n,i)},useMemoCache:sf,useCacheRefresh:Dy};pf.useEffectEvent=wy;var Py={readContext:Jt,use:Vl,useCallback:_y,useContext:Jt,useEffect:cf,useImperativeHandle:ky,useInsertionEffect:jy,useLayoutEffect:Ny,useMemo:zy,useReducer:rf,useRef:xy,useState:function(){return rf(Ts)},useDebugValue:uf,useDeferredValue:function(n,i){var o=At();return rt===null?df(o,n,i):Ey(o,rt.memoizedState,n,i)},useTransition:function(){var n=rf(Ts)[0],i=At().memoizedState;return[typeof n=="boolean"?n:uo(n),i]},useSyncExternalStore:iy,useId:Oy,useHostTransitionStatus:hf,useFormState:by,useActionState:by,useOptimistic:function(n,i){var o=At();return rt!==null?uy(o,rt,n,i):(o.baseState=n,[n,o.queue.dispatch])},useMemoCache:sf,useCacheRefresh:Dy};Py.useEffectEvent=wy;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),ro(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),ro(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),ro(i,n,o))}};function Iy(n,i,o,u,h,g,w){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(u,g,w):i.prototype&&i.prototype.isPureReactComponent?!Xr(o,u)||!Xr(h,g):!0}function By(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 qy(n){Rl(n)}function Hy(n){console.error(n)}function Zy(n){Rl(n)}function Wl(n,i){try{var o=n.onUncaughtError;o(i.value,{componentStack:i.stack})}catch(u){setTimeout(function(){throw u})}}function Fy(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 Gy(n){return n=ri(n),n.tag=3,n}function Ky(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(){Fy(i,o,u)}}var w=o.stateNode;w!==null&&typeof w.componentDidCatch=="function"&&(n.callback=function(){Fy(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(Ze)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}),to(Mn(n,o)))):(u!==Md&&(i=Error(a(423),{cause:u}),to(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),So===null?So=[g]:So.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=Gy(h),Ky(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?Jg(i,null,o,u):sa(i,n.child,o,u)}function Vy(n,i,o,u,h){o=o.render;var g=i.ref;if("ref"in u){var w={};for(var _ in u)_!=="ref"&&(w[_]=u[_])}else w=u;return Wi(i),u=Wd(n,i,o,w,g,h),_=ef(),n!==null&&!Pt?(tf(n,i,h),Os(n,i,h)):(Ze&&_&&Dd(i),i.flags|=1,Xt(n,i,u,h),i.child)}function Qy(n,i,o,u,h){if(n===null){var g=o.type;return typeof g=="function"&&!Ad(g)&&g.defaultProps===void 0&&o.compare===null?(i.tag=15,i.type=g,Yy(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 w=g.memoizedProps;if(o=o.compare,o=o!==null?o:Xr,o(w,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 Yy(n,i,o,u,h){if(n!==null){var g=n.memoizedProps;if(Xr(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 Jy(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 Xy(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?ey(i,g):Qd(),ty(i);else return u=i.lanes=536870912,Xy(n,i,g!==null?g.baseLanes|o:o,o,u)}else g!==null?($l(i,g.cachePool),ey(i,g),ci(),i.memoizedState=null):(n!==null&&$l(i,null),Qd(),ci());return Xt(n,i,h,o),i.child}function mo(n,i){return n!==null&&n.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function Xy(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(),ty(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 Wy(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(Ze){if(u.mode==="hidden")return n=ec(i,u),i.lanes=536870912,mo(null,n);if(Jd(i),(n=ht)?(n=dv(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=Mg(n),o.return=i,i.child=o,Yt=i,ht=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 w=g.dehydrated;if(Jd(i),h)if(i.flags&256)i.flags&=-257,i=Wy(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=ct,u!==null&&(w=Hr(u,o),w!==0&&w!==g.retryLane))throw g.retryLane=w,Qi(n,w),bn(u,n,w),bf;dc(),i=Wy(n,i,o)}else n=g.treeContext,ht=Bn(w.nextSibling),Yt=i,Ze=!0,ni=null,Pn=!1,n!==null&&Pg(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)):(Ze&&u&&Dd(i),i.flags|=1,Xt(n,i,o,h),i.child)}function e0(n,i,o,u,h,g){return Wi(i),i.updateQueue=null,o=sy(i,u,o,h),ny(n),u=ef(),n!==null&&!Pt?(tf(n,i,g),Os(n,i,g)):(Ze&&u&&Dd(i),i.flags|=1,Xt(n,i,o,g),i.child)}function t0(n,i,o,u,h){if(Wi(i),i.stateNode===null){var g=Ha,w=o.contextType;typeof w=="object"&&w!==null&&(g=Jt(w)),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),w=o.contextType,g.context=typeof w=="object"&&w!==null?Jt(w):Ha,g.state=i.memoizedState,w=o.getDerivedStateFromProps,typeof w=="function"&&(gf(i,o,w,u),g.state=i.memoizedState),typeof o.getDerivedStateFromProps=="function"||typeof g.getSnapshotBeforeUpdate=="function"||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(w=g.state,typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount(),w!==g.state&&yf.enqueueReplaceState(g,g.state,null),lo(i,u,g,h),oo(),g.state=i.memoizedState),typeof g.componentDidMount=="function"&&(i.flags|=4194308),u=!0}else if(n===null){g=i.stateNode;var _=i.memoizedProps,D=aa(o,_);g.props=D;var F=g.context,X=o.contextType;w=Ha,typeof X=="object"&&X!==null&&(w=Jt(X));var ne=o.getDerivedStateFromProps;X=typeof ne=="function"||typeof g.getSnapshotBeforeUpdate=="function",_=i.pendingProps!==_,X||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(_||F!==w)&&By(i,g,u,w),ai=!1;var K=i.memoizedState;g.state=K,lo(i,u,g,h),oo(),F=i.memoizedState,_||K!==F||ai?(typeof ne=="function"&&(gf(i,o,ne,u),F=i.memoizedState),(D=ai||Iy(i,o,D,u,K,F,w))?(X||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=F),g.props=u,g.state=F,g.context=w,u=D):(typeof g.componentDidMount=="function"&&(i.flags|=4194308),u=!1)}else{g=i.stateNode,Gd(n,i),w=i.memoizedProps,X=aa(o,w),g.props=X,ne=i.pendingProps,K=g.context,F=o.contextType,D=Ha,typeof F=="object"&&F!==null&&(D=Jt(F)),_=o.getDerivedStateFromProps,(F=typeof _=="function"||typeof g.getSnapshotBeforeUpdate=="function")||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(w!==ne||K!==D)&&By(i,g,u,D),ai=!1,K=i.memoizedState,g.state=K,lo(i,u,g,h),oo();var Q=i.memoizedState;w!==ne||K!==Q||ai||n!==null&&n.dependencies!==null&&Ml(n.dependencies)?(typeof _=="function"&&(gf(i,o,_,u),Q=i.memoizedState),(X=ai||Iy(i,o,X,u,K,Q,D)||n!==null&&n.dependencies!==null&&Ml(n.dependencies))?(F||typeof g.UNSAFE_componentWillUpdate!="function"&&typeof g.componentWillUpdate!="function"||(typeof g.componentWillUpdate=="function"&&g.componentWillUpdate(u,Q,D),typeof g.UNSAFE_componentWillUpdate=="function"&&g.UNSAFE_componentWillUpdate(u,Q,D)),typeof g.componentDidUpdate=="function"&&(i.flags|=4),typeof g.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof g.componentDidUpdate!="function"||w===n.memoizedProps&&K===n.memoizedState||(i.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||w===n.memoizedProps&&K===n.memoizedState||(i.flags|=1024),i.memoizedProps=u,i.memoizedState=Q),g.props=u,g.state=Q,g.context=D,u=X):(typeof g.componentDidUpdate!="function"||w===n.memoizedProps&&K===n.memoizedState||(i.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||w===n.memoizedProps&&K===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 n0(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 wf(n){return{baseLanes:n,cachePool:Fg()}}function jf(n,i,o){return n=n!==null?n.childLanes&~o:0,i&&(n|=An),n}function s0(n,i,o){var u=i.pendingProps,h=!1,g=(i.flags&128)!==0,w;if((w=g)||(w=n!==null&&n.memoizedState===null?!1:(Rt.current&2)!==0),w&&(h=!0,i.flags&=-129),w=(i.flags&32)!==0,i.flags&=-33,n===null){if(Ze){if(h?li(i):ci(),(n=ht)?(n=dv(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=Mg(n),o.return=i,i.child=o,Yt=i,ht=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=wf(o),u.childLanes=jf(n,w,o),i.memoizedState=Sf,mo(null,u)):(li(i),Nf(i,_))}var D=n.memoizedState;if(D!==null&&(_=D.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=wf(o),u.childLanes=jf(n,w,o),i.memoizedState=Sf,i=mo(null,u));else if(li(i),ah(_)){if(w=_.nextSibling&&_.nextSibling.dataset,w)var F=w.dgst;w=F,u=Error(a(419)),u.stack="",u.digest=w,to({value:u,source:null,stack:null}),i=Cf(n,i,o)}else if(Pt||Ka(n,i,o,!1),w=(o&n.childLanes)!==0,Pt||w){if(w=ct,w!==null&&(u=Hr(w,o),u!==0&&u!==D.retryLane))throw D.retryLane=u,Qi(n,u),bn(w,n,u),bf;ih(_)||dc(),i=Cf(n,i,o)}else ih(_)?(i.flags|=192,i.child=n.child,i=null):(n=D.treeContext,ht=Bn(_.nextSibling),Yt=i,Ze=!0,ni=null,Pn=!1,n!==null&&Pg(i,n),i=Nf(i,u.children),i.flags|=4096);return i}return h?(ci(),_=u.fallback,h=i.mode,D=n.child,F=D.sibling,u=_s(D,{mode:"hidden",children:u.children}),u.subtreeFlags=D.subtreeFlags&65011712,F!==null?_=_s(F,_):(_=Yi(_,h,o,null),_.flags|=2),_.return=i,u.return=i,u.sibling=_,i.child=u,mo(null,u),u=i.child,_=n.child.memoizedState,_===null?_=wf(o):(h=_.cachePool,h!==null?(D=Ut._currentValue,h=h.parent!==D?{parent:D,pool:D}:h):h=Fg(),_={baseLanes:_.baseLanes|o,cachePool:h}),u.memoizedState=_,u.childLanes=jf(n,w,o),i.memoizedState=Sf,mo(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&&(w=i.deletions,w===null?(i.deletions=[n],i.flags|=16):w.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 i0(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 w=n.memoizedState;w===null?n.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:u,tail:o,tailMode:h,treeForkCount:g}:(w.isBackwards=i,w.rendering=null,w.renderingStartTime=0,w.last=u,w.tail=o,w.tailMode=h,w.treeForkCount=g)}function a0(n,i,o){var u=i.pendingProps,h=u.revealOrder,g=u.tail;u=u.children;var w=Rt.current,_=(w&2)!==0;if(_?(w=w&1|2,i.flags|=128):w&=1,ie(Rt,w),Xt(n,i,u,o),u=Ze?eo:0,!_&&n!==null&&(n.flags&128)!==0)e:for(n=i.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&i0(n,o,i);else if(n.tag===19)i0(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:De(i,i.stateNode.containerInfo),ii(i,Ut,n.memoizedState.cache),Ji();break;case 27:case 5:Ge(i);break;case 4:De(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?s0(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 a0(n,i,o);i.flags|=128}if(h=i.memoizedState,h!==null&&(h.rendering=null,h.tail=null,h.lastEffect=null),ie(Rt,Rt.current),u)break;return null;case 22:return i.lanes=0,Jy(n,i,o,i.pendingProps);case 24:ii(i,Ut,n.memoizedState.cache)}return Os(n,i,o)}function r0(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,Ze&&(i.flags&1048576)!==0&&$g(i,eo,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")Ad(n)?(u=aa(n,u),i.tag=1,i=t0(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=Vy(null,i,n,u,o);break e}else if(h===A){i.tag=14,i=Qy(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),t0(n,i,u,h,o);case 3:e:{if(De(i,i.stateNode.containerInfo),n===null)throw Error(a(387));u=i.pendingProps;var g=i.memoizedState;h=g.element,Gd(n,i),lo(i,u,null,o);var w=i.memoizedState;if(u=w.cache,ii(i,Ut,u),u!==g.cache&&Id(i,[Ut],o,!0),oo(),u=w.element,g.isDehydrated)if(g={element:u,isDehydrated:!1,cache:w.cache},i.updateQueue.baseState=g,i.memoizedState=g,i.flags&256){i=n0(n,i,u,o);break e}else if(u!==h){h=Mn(Error(a(424)),i),to(h),i=n0(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,ht=Bn(n.firstChild),Yt=i,Ze=!0,ni=null,Pn=!0,o=Jg(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=yv(i.type,null,i.pendingProps,null))?i.memoizedState=o:Ze||(o=i.type,n=i.pendingProps,u=vc(he.current).createElement(o),u[Et]=i,u[Nt]=n,Wt(u,o,n),Mt(u),i.stateNode=u):i.memoizedState=yv(i.type,n.memoizedProps,i.pendingProps,n.memoizedState),null;case 27:return Ge(i),n===null&&Ze&&(u=i.stateNode=mv(i.type,i.pendingProps,he.current),Yt=i,Pn=!0,h=ht,yi(i.type)?(rh=h,ht=Bn(u.firstChild)):ht=h),Xt(n,i,i.pendingProps.children,o),tc(n,i),n===null&&(i.flags|=4194304),i.child;case 5:return n===null&&Ze&&((h=u=ht)&&(u=MC(u,i.type,i.pendingProps,Pn),u!==null?(i.stateNode=u,Yt=i,ht=Bn(u.firstChild),Pn=!1,h=!0):h=!1),h||si(i)),Ge(i),h=i.type,g=i.pendingProps,w=n!==null?n.memoizedProps:null,u=g.children,th(h,g)?u=null:w!==null&&th(h,w)&&(i.flags|=32),i.memoizedState!==null&&(h=Wd(n,i,J1,null,null,o),Eo._currentValue=h),tc(n,i),Xt(n,i,u,o),i.child;case 6:return n===null&&Ze&&((n=o=ht)&&(o=UC(o,i.pendingProps,Pn),o!==null?(i.stateNode=o,Yt=i,ht=null,n=!0):n=!1),n||si(i)),null;case 13:return s0(n,i,o);case 4:return De(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 Vy(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 Qy(n,i,i.type,i.pendingProps,o);case 15:return Yy(n,i,i.type,i.pendingProps,o);case 19:return a0(n,i,o);case 31:return aC(n,i,o);case 22:return Jy(n,i,o,i.pendingProps);case 24:return Wi(i),u=Jt(Ut),n===null?(h=Hd(),h===null&&(h=ct,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),lo(i,null,null,o),oo()),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(O0())n.flags|=8192;else throw na=Il,Zd}else n.flags&=-16777217}function o0(n,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)n.flags&=-16777217;else if(n.flags|=16777216,!wv(i))if(O0())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 po(n,i){if(!Ze)switch(n.tailMode){case"hidden":i=n.tail;for(var o=null;i!==null;)i.alternate!==null&&(o=i),i=i.sibling;o===null?n.tail=null:o.sibling=null;break;case"collapsed":o=n.tail;for(var u=null;o!==null;)o.alternate!==null&&(u=o),o=o.sibling;u===null?i||n.tail===null?n.tail=null:n.tail.sibling=null:u.sibling=null}}function mt(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 mt(i),null;case 1:return mt(i),null;case 3:return o=i.stateNode,u=null,n!==null&&(u=n.memoizedState.cache),i.memoizedState.cache!==u&&(i.flags|=2048),Rs(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())),mt(i),null;case 26:var h=i.type,g=i.memoizedState;return n===null?(Ds(i),g!==null?(mt(i),o0(i,g)):(mt(i),zf(i,h,null,u,o))):g?g!==n.memoizedState?(Ds(i),mt(i),o0(i,g)):(mt(i),i.flags&=-16777217):(n=n.memoizedProps,n!==u&&Ds(i),mt(i),zf(i,h,n,u,o)),null;case 27:if(st(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 mt(i),null}n=re.current,Ga(i)?Ig(i):(n=mv(h,u,o),i.stateNode=n,Ds(i))}return mt(i),null;case 5:if(st(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 mt(i),null}if(g=re.current,Ga(i))Ig(i);else{var w=vc(he.current);switch(g){case 1:g=w.createElementNS("http://www.w3.org/2000/svg",h);break;case 2:g=w.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;default:switch(h){case"svg":g=w.createElementNS("http://www.w3.org/2000/svg",h);break;case"math":g=w.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;case"script":g=w.createElement("div"),g.innerHTML="<script><\/script>",g=g.removeChild(g.firstChild);break;case"select":g=typeof u.is=="string"?w.createElement("select",{is:u.is}):w.createElement("select"),u.multiple?g.multiple=!0:u.size&&(g.size=u.size);break;default:g=typeof u.is=="string"?w.createElement(h,{is:u.is}):w.createElement(h)}}g[Et]=i,g[Nt]=u;e:for(w=i.child;w!==null;){if(w.tag===5||w.tag===6)g.appendChild(w.stateNode);else if(w.tag!==4&&w.tag!==27&&w.child!==null){w.child.return=w,w=w.child;continue}if(w===i)break e;for(;w.sibling===null;){if(w.return===null||w.return===i)break e;w=w.return}w.sibling.return=w.return,w=w.sibling}i.stateNode=g;e:switch(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 mt(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||sv(n.nodeValue,o)),n||si(i,!0)}else n=vc(n).createTextNode(u),n[Et]=i,i.stateNode=n}return mt(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;mt(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 mt(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;mt(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),mt(i),null);case 4:return ge(),n===null&&Yf(i.stateNode.containerInfo),mt(i),null;case 10:return Rs(i.type),mt(i),null;case 19:if(G(Rt),u=i.memoizedState,u===null)return mt(i),null;if(h=(i.flags&128)!==0,g=u.rendering,g===null)if(h)po(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,po(u,!1),n=g.updateQueue,i.updateQueue=n,sc(i,n),i.subtreeFlags=0,n=o,o=i.child;o!==null;)Lg(o,n),o=o.sibling;return ie(Rt,Rt.current&1|2),Ze&&zs(i,u.treeForkCount),i.child}n=n.sibling}u.tail!==null&&Ie()>lc&&(i.flags|=128,h=!0,po(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),po(u,!0),u.tail===null&&u.tailMode==="hidden"&&!g.alternate&&!Ze)return mt(i),null}else 2*Ie()-u.renderingStartTime>lc&&o!==536870912&&(i.flags|=128,h=!0,po(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=Ie(),n.sibling=null,o=Rt.current,ie(Rt,h?o&1|2:o&1),Ze&&zs(i,u.treeForkCount),n):(mt(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&&(mt(i),i.subtreeFlags&6&&(i.flags|=8192)):mt(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),Rs(Ut),mt(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 Rs(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 st(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(Rt),null;case 4:return ge(),null;case 10:return Rs(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 Rs(Ut),null;case 25:return null;default:return null}}function l0(n,i){switch(Ld(i),i.tag){case 3:Rs(Ut),ge();break;case 26:case 27:case 5:st(i);break;case 4:ge();break;case 31:i.memoizedState!==null&&En(i);break;case 13:En(i);break;case 19:G(Rt);break;case 10:Rs(i.type);break;case 22:case 23:En(i),Yd(),n!==null&&G(ea);break;case 24:Rs(Ut)}}function go(n,i){try{var o=i.updateQueue,u=o!==null?o.lastEffect:null;if(u!==null){var h=u.next;o=h;do{if((o.tag&n)===n){u=void 0;var g=o.create,w=o.inst;u=g(),w.destroy=u}o=o.next}while(o!==h)}}catch(_){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 w=u.inst,_=w.destroy;if(_!==void 0){w.destroy=void 0,h=i;var D=o,F=_;try{F()}catch(X){et(h,D,X)}}}u=u.next}while(u!==g)}}catch(X){et(i,i.return,X)}}function c0(n){var i=n.updateQueue;if(i!==null){var o=n.stateNode;try{Wg(i,o)}catch(u){et(n,n.return,u)}}}function u0(n,i,o){o.props=aa(n.type,n.memoizedProps),o.state=n.memoizedState;try{o.componentWillUnmount()}catch(u){et(n,i,u)}}function yo(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 d0(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;RC(u,n.type,o,i),u[Nt]=i}catch(h){et(n,n.return,h)}}function f0(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&yi(n.type)||n.tag===4}function Rf(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||f0(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 Af(n,i,o){var u=n.tag;if(u===5||u===6)n=n.stateNode,i?(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o).insertBefore(n,i):(i=o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,i.appendChild(n),o=o._reactRootContainer,o!=null||i.onclick!==null||(i.onclick=Cs));else if(u!==4&&(u===27&&yi(n.type)&&(o=n.stateNode,i=null),n=n.child,n!==null))for(Af(n,i,o),n=n.sibling;n!==null;)Af(n,i,o),n=n.sibling}function 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 h0(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,m0=typeof WeakSet=="function"?WeakSet:Set,Kt=null;function cC(n,i){if(n=n.containerInfo,Wf=Cc,n=kg(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 w=0,_=-1,D=-1,F=0,X=0,ne=n,K=null;t:for(;;){for(var Q;ne!==o||h!==0&&ne.nodeType!==3||(_=w+h),ne!==g||u!==0&&ne.nodeType!==3||(D=w+u),ne.nodeType===3&&(w+=ne.nodeValue.length),(Q=ne.firstChild)!==null;)K=ne,ne=Q;for(;;){if(ne===n)break t;if(K===o&&++F===h&&(_=w),K===g&&++X===u&&(D=w),(Q=ne.nextSibling)!==null)break;ne=K,K=ne.parentNode}ne=Q}o=_===-1||D===-1?null:{start:_,end:D}}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 p0(n,i,o){var u=o.flags;switch(o.tag){case 0:case 11:case 15:Us(n,o),u&4&&go(5,o);break;case 1:if(Us(n,o),u&4)if(n=o.stateNode,i===null)try{n.componentDidMount()}catch(w){et(o,o.return,w)}else{var h=aa(o.type,i.memoizedProps);i=i.memoizedState;try{n.componentDidUpdate(h,i,n.__reactInternalSnapshotBeforeUpdate)}catch(w){et(o,o.return,w)}}u&64&&c0(o),u&512&&yo(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{Wg(n,i)}catch(w){et(o,o.return,w)}}break;case 27:i===null&&u&4&&h0(o);case 26:case 5:Us(n,o),i===null&&u&4&&d0(o),u&512&&yo(o,o.return);break;case 12:Us(n,o);break;case 31:Us(n,o),u&4&&v0(n,o);break;case 13:Us(n,o),u&4&&b0(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 g0(n){var i=n.alternate;i!==null&&(n.alternate=null,g0(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;)y0(n,i,o),o=o.sibling}function y0(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),ko(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,cv(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,o.stateNode),hr(n)):cv(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"&&u0(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 v0(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 b0(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 m0),i;case 22:return n=n.stateNode,i=n._retryCache,i===null&&(i=n._retryCache=new m0),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,w=i,_=w;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));y0(g,w,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;)x0(i,n),i=i.sibling}var Wn=null;function x0(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),go(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 w=xv("link","href",h).get(u+(o.href||""));if(w){for(var _=0;_<w.length;_++)if(g=w[_],g.getAttribute("href")===(o.href==null||o.href===""?null:o.href)&&g.getAttribute("rel")===(o.rel==null?null:o.rel)&&g.getAttribute("title")===(o.title==null?null:o.title)&&g.getAttribute("crossorigin")===(o.crossOrigin==null?null:o.crossOrigin)){w.splice(_,1);break t}}g=h.createElement(u),Wt(g,u,o),h.head.appendChild(g);break;case"meta":if(w=xv("meta","content",h).get(u+(o.content||""))){for(_=0;_<w.length;_++)if(g=w[_],g.getAttribute("content")===(o.content==null?null:""+o.content)&&g.getAttribute("name")===(o.name==null?null:o.name)&&g.getAttribute("property")===(o.property==null?null:o.property)&&g.getAttribute("http-equiv")===(o.httpEquiv==null?null:o.httpEquiv)&&g.getAttribute("charset")===(o.charSet==null?null:o.charSet)){w.splice(_,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 Sv(h,n.type,n.stateNode);else n.stateNode=bv(h,u,n.memoizedProps);else g!==u?(g===null?o.stateNode!==null&&(o=o.stateNode,o.parentNode.removeChild(o)):g.count--,u===null?Sv(h,n.type,n.stateNode):bv(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,S0(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=Ie()),u&4&&(u=n.updateQueue,u!==null&&(n.updateQueue=null,ac(n,u)));break;case 22:h=n.memoizedState!==null;var D=o!==null&&o.memoizedState!==null,F=Ls,X=It;if(Ls=F||h,It=X||D,gn(i,n),It=X,Ls=F,yn(n),u&8192)e:for(i=n.stateNode,i._visibility=h?i._visibility&-2:i._visibility|1,h&&(o===null||D||Ls||It||ra(n)),o=null,i=n;;){if(i.tag===5||i.tag===26){if(o===null){D=o=i;try{if(g=D.stateNode,h)w=g.style,typeof w.setProperty=="function"?w.setProperty("display","none","important"):w.display="none";else{_=D.stateNode;var ne=D.memoizedProps.style,K=ne!=null&&ne.hasOwnProperty("display")?ne.display:null;_.style.display=K==null||typeof K=="boolean"?"":(""+K).trim()}}catch(ye){et(D,D.return,ye)}}}else if(i.tag===6){if(o===null){D=i;try{D.stateNode.nodeValue=h?"":D.memoizedProps}catch(ye){et(D,D.return,ye)}}}else if(i.tag===18){if(o===null){D=i;try{var Q=D.stateNode;h?uv(Q,!0):uv(D.stateNode,!1)}catch(ye){et(D,D.return,ye)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===n)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===n)break e;for(;i.sibling===null;){if(i.return===null||i.return===n)break e;o===i&&(o=null),i=i.return}o===i&&(o=null),i.sibling.return=i.return,i=i.sibling}u&4&&(u=n.updateQueue,u!==null&&(o=u.retryQueue,o!==null&&(u.retryQueue=null,ac(n,o))));break;case 19: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(f0(u)){o=u;break}u=u.return}if(o==null)throw Error(a(160));switch(o.tag){case 27:var h=o.stateNode,g=Rf(n);ic(n,g,h);break;case 5:var w=o.stateNode;o.flags&32&&(Ma(w,""),o.flags&=-33);var _=Rf(n);ic(n,_,w);break;case 3:case 4:var D=o.stateNode.containerInfo,F=Rf(n);Af(n,F,D);break;default:throw Error(a(161))}}catch(X){et(n,n.return,X)}n.flags&=-3}i&4096&&(n.flags&=-4097)}function S0(n){if(n.subtreeFlags&1024)for(n=n.child;n!==null;){var i=n;S0(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;)p0(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"&&u0(i,i.return,o),ra(i);break;case 27:ko(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,w=g.flags;switch(g.tag){case 0:case 11:case 15:$s(h,g,o),go(4,g);break;case 1:if($s(h,g,o),u=g,h=u.stateNode,typeof h.componentDidMount=="function")try{h.componentDidMount()}catch(F){et(u,u.return,F)}if(u=g,h=u.updateQueue,h!==null){var _=u.stateNode;try{var D=h.shared.hiddenCallbacks;if(D!==null)for(h.shared.hiddenCallbacks=null,h=0;h<D.length;h++)Xg(D[h],_)}catch(F){et(u,u.return,F)}}o&&w&64&&c0(g),yo(g,g.return);break;case 27:h0(g);case 26:case 5:$s(h,g,o),o&&u===null&&w&4&&d0(g),yo(g,g.return);break;case 12:$s(h,g,o);break;case 31:$s(h,g,o),o&&w&4&&v0(h,g);break;case 13:$s(h,g,o),o&&w&4&&b0(h,g);break;case 22:g.memoizedState===null&&$s(h,g,o),yo(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&&no(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&&no(n))}function es(n,i,o,u){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)w0(n,i,o,u),i=i.sibling}function w0(n,i,o,u){var h=i.flags;switch(i.tag){case 0:case 11:case 15:es(n,i,o,u),h&2048&&go(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&&no(n)));break;case 12:if(h&2048){es(n,i,o,u),n=i.stateNode;try{var g=i.memoizedProps,w=g.id,_=g.onPostCommit;typeof _=="function"&&_(w,i.alternate===null?"mount":"update",n.passiveEffectDuration,-0)}catch(D){et(i,i.return,D)}}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,w=i.alternate,i.memoizedState!==null?g._visibility&2?es(n,i,o,u):vo(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(w,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,w=i,_=o,D=u,F=w.flags;switch(w.tag){case 0:case 11:case 15:nr(g,w,_,D,h),go(8,w);break;case 23:break;case 22:var X=w.stateNode;w.memoizedState!==null?X._visibility&2?nr(g,w,_,D,h):vo(g,w):(X._visibility|=2,nr(g,w,_,D,h)),h&&F&2048&&Of(w.alternate,w);break;case 24:nr(g,w,_,D,h),h&&F&2048&&Df(w.alternate,w);break;default:nr(g,w,_,D,h)}i=i.sibling}}function vo(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:vo(o,u),h&2048&&Of(u.alternate,u);break;case 24:vo(o,u),h&2048&&Df(u.alternate,u);break;default:vo(o,u)}i=i.sibling}}var bo=8192;function sr(n,i,o){if(n.subtreeFlags&bo)for(n=n.child;n!==null;)j0(n,i,o),n=n.sibling}function j0(n,i,o){switch(n.tag){case 26:sr(n,i,o),n.flags&bo&&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=bo,bo=16777216,sr(n,i,o),bo=u):sr(n,i,o));break;default:sr(n,i,o)}}function N0(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 xo(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,k0(u,n)}N0(n)}if(n.subtreeFlags&10256)for(n=n.child;n!==null;)C0(n),n=n.sibling}function C0(n){switch(n.tag){case 0:case 11:case 15:xo(n),n.flags&2048&&ui(9,n,n.return);break;case 3:xo(n);break;case 12:xo(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)):xo(n);break;default:xo(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,k0(u,n)}N0(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 k0(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:no(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(g0(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,Je=0,ct=null,Ue=null,qe=0,We=0,Rn=null,di=!1,ir=!1,Lf=!1,Ps=0,kt=0,fi=0,oa=0,Mf=0,An=0,ar=0,So=null,vn=null,Uf=!1,oc=0,_0=0,lc=1/0,cc=null,hi=null,Ft=0,mi=null,rr=null,Is=0,$f=0,Pf=null,z0=null,wo=0,If=null;function Tn(){return(Je&2)!==0&&qe!==0?qe&-qe:I.T!==null?Gf():it()}function E0(){if(An===0)if((qe&536870912)===0||Ze){var n=js;js<<=1,(js&3932160)===0&&(js=262144),An=n}else An=536870912;return n=zn.current,n!==null&&(n.flags|=32),An}function bn(n,i,o){(n===ct&&(We===2||We===9)||n.cancelPendingCommit!==null)&&(or(n,0),pi(n,qe,An,!1)),Fi(n,o),((Je&2)===0||n!==ct)&&(n===ct&&((Je&2)===0&&(oa|=o),kt===4&&pi(n,qe,An,!1)),gs(n))}function R0(n,i,o){if((Je&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 w=0;else w=n.pendingLanes&-536870913,w=w!==0?w:w&536870912?536870912:0;if(w!==0){i=w;e:{var _=n;h=So;var D=_.current.memoizedState.isDehydrated;if(D&&(or(_,w).flags|=256),w=qf(_,w,!1),w!==2){if(Lf&&!D){_.errorRecoveryDisabledLanes|=g,oa|=g,h=4;break e}g=vn,vn=h,g!==null&&(vn===null?vn=g:vn.push.apply(vn,g))}h=w}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,An,!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-Ie(),10<h)){if(pi(u,i,An,!di),Aa(u,0,!0)!==0)break e;Is=i,u.timeoutHandle=ov(A0.bind(null,u,o,vn,cc,Uf,i,An,oa,ar,di,g,"Throttled",-0,0),h);break e}A0(u,o,vn,cc,Uf,i,An,oa,ar,di,g,null,-0,0)}}break}while(!0);gs(n)}function A0(n,i,o,u,h,g,w,_,D,F,X,ne,K,Q){if(n.timeoutHandle=-1,ne=i.subtreeFlags,ne&8192||(ne&16785408)===16785408){ne={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Cs},j0(i,g,ne);var ye=(g&62914560)===g?oc-Ie():(g&4194048)===g?_0-Ie():0;if(ye=JC(ne,ye),ye!==null){Is=g,n.cancelPendingCommit=ye(P0.bind(null,n,i,g,o,u,h,w,_,D,X,ne,null,K,Q)),pi(n,g,w,!F);return}}P0(n,i,g,o,u,h,w,_,D)}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-Ke(h),w=1<<g;u[g]=-1,h&=~w}o!==0&&vl(n,o,i)}function uc(){return(Je&6)===0?(jo(0),!1):!0}function Bf(){if(Ue!==null){if(We===0)var n=Ue.return;else n=Ue,Es=Xi=null,nf(n),Ja=null,io=0,n=Ue;for(;n!==null;)l0(n.alternate,n),n=n.return;Ue=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(),ct=n,Ue=o=_s(n.current,null),qe=i,We=0,Rn=null,di=!1,ir=us(n,i),Lf=!1,ar=An=Mf=oa=fi=kt=0,vn=So=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-Ke(u),g=1<<h;i|=n[h],u&=~g}return Ps=i,Al(),o}function T0(n,i){Ae=null,I.H=ho,i===Ya||i===Pl?(i=Vg(),We=3):i===Zd?(i=Vg(),We=4):We=i===bf?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,Rn=i,Ue===null&&(kt=1,Wl(n,Mn(i,n.current)))}function O0(){var n=zn.current;return n===null?!0:(qe&4194048)===qe?In===null:(qe&62914560)===qe||(qe&536870912)!==0?n===In:!1}function D0(){var n=I.H;return I.H=ho,n===null?ho:n}function L0(){var n=I.A;return I.A=dC,n}function dc(){kt=4,di||(qe&4194048)!==qe&&zn.current!==null||(ir=!0),(fi&134217727)===0&&(oa&134217727)===0||ct===null||pi(ct,qe,An,!1)}function qf(n,i,o){var u=Je;Je|=2;var h=D0(),g=L0();(ct!==n||qe!==i)&&(cc=null,or(n,i)),i=!1;var w=kt;e:do try{if(We!==0&&Ue!==null){var _=Ue,D=Rn;switch(We){case 8:Bf(),w=6;break e;case 3:case 2:case 9:case 6:zn.current===null&&(i=!0);var F=We;if(We=0,Rn=null,lr(n,_,D,F),o&&ir){w=0;break e}break;default:F=We,We=0,Rn=null,lr(n,_,D,F)}}mC(),w=kt;break}catch(X){T0(n,X)}while(!0);return i&&n.shellSuspendCounter++,Es=Xi=null,Je=u,I.H=h,I.A=g,Ue===null&&(ct=null,qe=0,Al()),w}function mC(){for(;Ue!==null;)M0(Ue)}function pC(n,i){var o=Je;Je|=2;var u=D0(),h=L0();ct!==n||qe!==i?(cc=null,lc=Ie()+500,or(n,i)):ir=us(n,i);e:do try{if(We!==0&&Ue!==null){i=Ue;var g=Rn;t:switch(We){case 1:We=0,Rn=null,lr(n,i,g,1);break;case 2:case 9:if(Gg(g)){We=0,Rn=null,U0(i);break}i=function(){We!==2&&We!==9||ct!==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:Gg(g)?(We=0,Rn=null,U0(i)):(We=0,Rn=null,lr(n,i,g,7));break;case 5:var w=null;switch(Ue.tag){case 26:w=Ue.memoizedState;case 5:case 27:var _=Ue;if(w?wv(w):_.stateNode.complete){We=0,Rn=null;var D=_.sibling;if(D!==null)Ue=D;else{var F=_.return;F!==null?(Ue=F,fc(F)):Ue=null}break t}}We=0,Rn=null,lr(n,i,g,5);break;case 6:We=0,Rn=null,lr(n,i,g,6);break;case 8:Bf(),kt=6;break e;default:throw Error(a(462))}}gC();break}catch(X){T0(n,X)}while(!0);return Es=Xi=null,I.H=u,I.A=h,Je=o,Ue!==null?0:(ct=null,qe=0,Al(),kt)}function gC(){for(;Ue!==null&&!le();)M0(Ue)}function M0(n){var i=r0(n.alternate,n,Ps);n.memoizedProps=n.pendingProps,i===null?fc(n):Ue=i}function U0(n){var i=n,o=i.alternate;switch(i.tag){case 15:case 0:i=e0(o,i,i.pendingProps,i.type,void 0,qe);break;case 11:i=e0(o,i,i.pendingProps,i.type.render,i.ref,qe);break;case 5:nf(i);default:l0(o,i),i=Ue=Lg(i,Ps),i=r0(o,i,Ps)}n.memoizedProps=n.pendingProps,i===null?fc(n):Ue=i}function lr(n,i,o,u){Es=Xi=null,nf(i),Ja=null,io=0;var h=i.return;try{if(iC(n,h,i,o,qe)){kt=1,Wl(n,Mn(o,n.current)),Ue=null;return}}catch(g){if(h!==null)throw Ue=h,g;kt=1,Wl(n,Mn(o,n.current)),Ue=null;return}i.flags&32768?(Ze||u===1?n=!0:ir||(qe&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))),$0(i,n)):fc(i)}function fc(n){var i=n;do{if((i.flags&32768)!==0){$0(i,di);return}n=i.return;var o=oC(i.alternate,i,Ps);if(o!==null){Ue=o;return}if(i=i.sibling,i!==null){Ue=i;return}Ue=i=n}while(i!==null);kt===0&&(kt=5)}function $0(n,i){do{var o=lC(n.alternate,n);if(o!==null){o.flags&=32767,Ue=o;return}if(o=n.return,o!==null&&(o.flags|=32768,o.subtreeFlags=0,o.deletions=null),!i&&(n=n.sibling,n!==null)){Ue=n;return}Ue=n=o}while(n!==null);kt=6,Ue=null}function P0(n,i,o,u,h,g,w,_,D){n.cancelPendingCommit=null;do hc();while(Ft!==0);if((Je&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,w,_,D),n===ct&&(Ue=ct=null,qe=0),rr=i,mi=n,Is=o,$f=g,Pf=h,z0=u,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(n.callbackNode=null,n.callbackPriority=0,xC(an,function(){return Z0(),null})):(n.callbackNode=null,n.callbackPriority=0),u=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||u){u=I.T,I.T=null,h=Z.p,Z.p=2,w=Je,Je|=4;try{cC(n,i,o)}finally{Je=w,Z.p=h,I.T=u}}Ft=1,I0(),B0(),q0()}}function I0(){if(Ft===1){Ft=0;var n=mi,i=rr,o=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||o){o=I.T,I.T=null;var u=Z.p;Z.p=2;var h=Je;Je|=4;try{x0(i,n);var g=eh,w=kg(n.containerInfo),_=g.focusedElem,D=g.selectionRange;if(w!==_&&_&&_.ownerDocument&&Cg(_.ownerDocument.documentElement,_)){if(D!==null&&Nd(_)){var F=D.start,X=D.end;if(X===void 0&&(X=F),"selectionStart"in _)_.selectionStart=F,_.selectionEnd=Math.min(X,_.value.length);else{var ne=_.ownerDocument||document,K=ne&&ne.defaultView||window;if(K.getSelection){var Q=K.getSelection(),ye=_.textContent.length,Ce=Math.min(D.start,ye),lt=D.end===void 0?Ce:Math.min(D.end,ye);!Q.extend&&Ce>lt&&(w=lt,lt=Ce,Ce=w);var P=Ng(_,Ce),U=Ng(_,lt);if(P&&U&&(Q.rangeCount!==1||Q.anchorNode!==P.node||Q.anchorOffset!==P.offset||Q.focusNode!==U.node||Q.focusOffset!==U.offset)){var H=ne.createRange();H.setStart(P.node,P.offset),Q.removeAllRanges(),Ce>lt?(Q.addRange(H),Q.extend(U.node,U.offset)):(H.setEnd(U.node,U.offset),Q.addRange(H))}}}}for(ne=[],Q=_;Q=Q.parentNode;)Q.nodeType===1&&ne.push({element:Q,left:Q.scrollLeft,top:Q.scrollTop});for(typeof _.focus=="function"&&_.focus(),_=0;_<ne.length;_++){var W=ne[_];W.element.scrollLeft=W.left,W.element.scrollTop=W.top}}Cc=!!Wf,eh=Wf=null}finally{Je=h,Z.p=u,I.T=o}}n.current=i,Ft=2}}function B0(){if(Ft===2){Ft=0;var n=mi,i=rr,o=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||o){o=I.T,I.T=null;var u=Z.p;Z.p=2;var h=Je;Je|=4;try{p0(n,i.alternate,i)}finally{Je=h,Z.p=u,I.T=o}}Ft=3}}function q0(){if(Ft===4||Ft===3){Ft=0,Pe();var n=mi,i=rr,o=Is,u=z0;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?Ft=5:(Ft=0,rr=mi=null,H0(n,n.pendingLanes));var h=n.pendingLanes;if(h===0&&(hi=null),fe(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=I.T,h=Z.p,Z.p=2,I.T=null;try{for(var g=n.onRecoverableError,w=0;w<u.length;w++){var _=u[w];g(_.value,{componentStack:_.stack})}}finally{I.T=i,Z.p=h}}(Is&3)!==0&&hc(),gs(n),h=n.pendingLanes,(o&261930)!==0&&(h&42)!==0?n===If?wo++:(wo=0,If=n):wo=0,jo(0)}}function H0(n,i){(n.pooledCacheLanes&=i)===0&&(i=n.pooledCache,i!=null&&(n.pooledCache=null,no(i)))}function hc(){return I0(),B0(),q0(),Z0()}function Z0(){if(Ft!==5)return!1;var n=mi,i=$f;$f=0;var o=fe(Is),u=I.T,h=Z.p;try{Z.p=32>o?32:o,I.T=null,o=Pf,Pf=null;var g=mi,w=Is;if(Ft=0,rr=mi=null,Is=0,(Je&6)!==0)throw Error(a(331));var _=Je;if(Je|=4,C0(g.current),w0(g,g.current,w,o),Je=_,jo(0,!1),_e&&typeof _e.onPostCommitFiberRoot=="function")try{_e.onPostCommitFiberRoot(ls,g)}catch{}return!0}finally{Z.p=h,I.T=u,H0(n,i)}}function F0(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)F0(n,n,o);else for(;i!==null;){if(i.tag===3){F0(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=Gy(2),u=oi(i,o,2),u!==null&&(Ky(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,ct===n&&(qe&o)===o&&(kt===4||kt===3&&(qe&62914560)===qe&&300>Ie()-oc?(Je&2)===0&&or(n,0):Mf|=o,ar===qe&&(ar=0)),gs(n)}function G0(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),G0(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),G0(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,wC())}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 w=u.suspendedLanes,_=u.pingedLanes;g=(1<<31-Ke(42|n)+1)-1,g&=h&~(w&~_),g=g&201326741?g&201326741|1:g?g|2:0}g!==0&&(o=!0,Y0(u,g))}else g=qe,g=Aa(u,u===ct?g:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),(g&3)===0||us(u,g)||(o=!0,Y0(u,g));u=u.next}while(o);Ff=!1}}function SC(){K0()}function K0(){pc=Zf=!1;var n=0;gi!==0&&TC()&&(n=gi);for(var i=Ie(),o=null,u=mc;u!==null;){var h=u.next,g=V0(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 V0(n,i){for(var o=n.suspendedLanes,u=n.pingedLanes,h=n.expirationTimes,g=n.pendingLanes&-62914561;0<g;){var w=31-Ke(g),_=1<<w,D=h[w];D===-1?((_&o)===0||(_&u)!==0)&&(h[w]=gl(_,i)):D<=i&&(n.expiredLanes|=_),g&=~_}if(i=ct,o=qe,o=Aa(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),fe(o)){case 2:case 8:o=pt;break;case 32:o=an;break;case 268435456:o=Ks;break;default:o=an}return u=Q0.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 Q0(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=qe;return u=Aa(n,n===ct?u:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),u===0?null:(R0(n,u,i),V0(n,Ie()),n.callbackNode!=null&&n.callbackNode===o?Q0.bind(null,n):null)}function Y0(n,i){if(hc())return null;R0(n,i,!0)}function wC(){DC(function(){(Je&6)!==0?xt(Le,SC):K0()})}function Gf(){if(gi===0){var n=Va;n===0&&(n=Qs,Qs<<=1,(Qs&261888)===0&&(Qs=256)),gi=n}return gi}function J0(n){return n==null||typeof n=="symbol"||typeof n=="boolean"?null:typeof n=="function"?n:jl(""+n)}function X0(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 jC(n,i,o,u,h){if(i==="submit"&&o&&o.stateNode===h){var g=J0((h[Nt]||null).action),w=u.submitter;w&&(i=(i=w[Nt]||null)?J0(i.formAction):w.getAttribute("formAction"),i!==null&&(g=i,w=null));var _=new _l("action","action",null,u,h);n.push({event:_,listeners:[{instance:null,listener:function(){if(u.defaultPrevented){if(gi!==0){var D=w?X0(h,w):new FormData(h);ff(o,{pending:!0,data:D,method:h.method,action:g},null,D)}}else typeof g=="function"&&(_.preventDefault(),D=w?X0(h,w):new FormData(h),ff(o,{pending:!0,data:D,method:h.method,action:g},g,D))},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(Eg,"onAnimationEnd"),Xn(Rg,"onAnimationIteration"),Xn(Ag,"onAnimationStart"),Xn("dblclick","onDoubleClick"),Xn("focusin","onFocus"),Xn("focusout","onBlur"),Xn(B1,"onTransitionRun"),Xn(q1,"onTransitionStart"),Xn(H1,"onTransitionCancel"),Xn(Tg,"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 No="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(No));function W0(n,i){i=(i&4)!==0;for(var o=0;o<n.length;o++){var u=n[o],h=u.event;u=u.listeners;e:{var g=void 0;if(i)for(var w=u.length-1;0<=w;w--){var _=u[w],D=_.instance,F=_.currentTarget;if(_=_.listener,D!==g&&h.isPropagationStopped())break e;g=_,h.currentTarget=F;try{g(h)}catch(X){Rl(X)}h.currentTarget=null,g=D}else for(w=0;w<u.length;w++){if(_=u[w],D=_.instance,F=_.currentTarget,_=_.listener,D!==g&&h.isPropagationStopped())break e;g=_,h.currentTarget=F;try{g(h)}catch(X){Rl(X)}h.currentTarget=null,g=D}}}}function $e(n,i){var o=i[en];o===void 0&&(o=i[en]=new Set);var u=n+"__bubble";o.has(u)||(ev(i,n,2,!1),o.add(u))}function Qf(n,i,o){var u=0;i&&(u|=4),ev(o,n,u,i)}var gc="_reactListening"+Math.random().toString(36).slice(2);function Yf(n){if(!n[gc]){n[gc]=!0,Be.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 ev(n,i,o,u){switch(Ev(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 w=u.tag;if(w===3||w===4){var _=u.stateNode.containerInfo;if(_===h)break;if(w===4)for(w=u.return;w!==null;){var D=w.tag;if((D===3||D===4)&&w.stateNode.containerInfo===h)return;w=w.return}for(;_!==null;){if(w=Xs(_),w===null)return;if(D=w.tag,D===5||D===6||D===26||D===27){u=g=w;continue e}_=_.parentNode}}u=u.return}ag(function(){var F=g,X=hd(o),ne=[];e:{var K=Og.get(n);if(K!==void 0){var Q=_l,ye=n;switch(n){case"keypress":if(Cl(o)===0)break e;case"keydown":case"keyup":Q=b1;break;case"focusin":ye="focus",Q=bd;break;case"focusout":ye="blur",Q=bd;break;case"beforeblur":case"afterblur":Q=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":Q=lg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Q=o1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Q=w1;break;case Eg:case Rg:case Ag:Q=u1;break;case Tg:Q=N1;break;case"scroll":case"scrollend":Q=a1;break;case"wheel":Q=k1;break;case"copy":case"cut":case"paste":Q=f1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Q=ug;break;case"toggle":case"beforetoggle":Q=z1}var Ce=(i&4)!==0,lt=!Ce&&(n==="scroll"||n==="scrollend"),P=Ce?K!==null?K+"Capture":null:K;Ce=[];for(var U=F,H;U!==null;){var W=U;if(H=W.stateNode,W=W.tag,W!==5&&W!==26&&W!==27||H===null||P===null||(W=Fr(U,P),W!=null&&Ce.push(Co(U,W,H))),lt)break;U=U.return}0<Ce.length&&(K=new Q(K,ye,null,o,X),ne.push({event:K,listeners:Ce}))}}if((i&7)===0){e:{if(K=n==="mouseover"||n==="pointerover",Q=n==="mouseout"||n==="pointerout",K&&o!==fd&&(ye=o.relatedTarget||o.fromElement)&&(Xs(ye)||ye[Cn]))break e;if((Q||K)&&(K=X.window===X?X:(K=X.ownerDocument)?K.defaultView||K.parentWindow:window,Q?(ye=o.relatedTarget||o.toElement,Q=F,ye=ye?Xs(ye):null,ye!==null&&(lt=c(ye),Ce=ye.tag,ye!==lt||Ce!==5&&Ce!==27&&Ce!==6)&&(ye=null)):(Q=null,ye=F),Q!==ye)){if(Ce=lg,W="onMouseLeave",P="onMouseEnter",U="mouse",(n==="pointerout"||n==="pointerover")&&(Ce=ug,W="onPointerLeave",P="onPointerEnter",U="pointer"),lt=Q==null?K:fs(Q),H=ye==null?K:fs(ye),K=new Ce(W,U+"leave",Q,o,X),K.target=lt,K.relatedTarget=H,W=null,Xs(X)===F&&(Ce=new Ce(P,U+"enter",ye,o,X),Ce.target=H,Ce.relatedTarget=lt,W=Ce),lt=W,Q&&ye)t:{for(Ce=_C,P=Q,U=ye,H=0,W=P;W;W=Ce(W))H++;W=0;for(var Ne=U;Ne;Ne=Ce(Ne))W++;for(;0<H-W;)P=Ce(P),H--;for(;0<W-H;)U=Ce(U),W--;for(;H--;){if(P===U||U!==null&&P===U.alternate){Ce=P;break t}P=Ce(P),U=Ce(U)}Ce=null}else Ce=null;Q!==null&&tv(ne,K,Q,Ce,!1),ye!==null&<!==null&&tv(ne,lt,ye,Ce,!0)}}e:{if(K=F?fs(F):window,Q=K.nodeName&&K.nodeName.toLowerCase(),Q==="select"||Q==="input"&&K.type==="file")var Ve=vg;else if(gg(K))if(bg)Ve=$1;else{Ve=M1;var Se=L1}else Q=K.nodeName,!Q||Q.toLowerCase()!=="input"||K.type!=="checkbox"&&K.type!=="radio"?F&&dd(F.elementType)&&(Ve=vg):Ve=U1;if(Ve&&(Ve=Ve(n,F))){yg(ne,Ve,o,X);break e}Se&&Se(n,K,F),n==="focusout"&&F&&K.type==="number"&&F.memoizedProps.value!=null&&ud(K,"number",K.value)}switch(Se=F?fs(F):window,n){case"focusin":(gg(Se)||Se.contentEditable==="true")&&(Ia=Se,Cd=F,Wr=null);break;case"focusout":Wr=Cd=Ia=null;break;case"mousedown":kd=!0;break;case"contextmenu":case"mouseup":case"dragend":kd=!1,_g(ne,o,X);break;case"selectionchange":if(I1)break;case"keydown":case"keyup":_g(ne,o,X)}var Te;if(Sd)e:{switch(n){case"compositionstart":var He="onCompositionStart";break e;case"compositionend":He="onCompositionEnd";break e;case"compositionupdate":He="onCompositionUpdate";break e}He=void 0}else Pa?mg(n,o)&&(He="onCompositionEnd"):n==="keydown"&&o.keyCode===229&&(He="onCompositionStart");He&&(dg&&o.locale!=="ko"&&(Pa||He!=="onCompositionStart"?He==="onCompositionEnd"&&Pa&&(Te=rg()):(ei=X,gd="value"in ei?ei.value:ei.textContent,Pa=!0)),Se=yc(F,He),0<Se.length&&(He=new cg(He,n,null,o,X),ne.push({event:He,listeners:Se}),Te?He.data=Te:(Te=pg(o),Te!==null&&(He.data=Te)))),(Te=R1?A1(n,o):T1(n,o))&&(He=yc(F,"onBeforeInput"),0<He.length&&(Se=new cg("onBeforeInput","beforeinput",null,o,X),ne.push({event:Se,listeners:He}),Se.data=Te)),jC(ne,n,F,o,X)}W0(ne,i)})}function Co(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=Fr(n,o),h!=null&&u.unshift(Co(n,h,g)),h=Fr(n,i),h!=null&&u.push(Co(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 tv(n,i,o,u,h){for(var g=i._reactName,w=[];o!==null&&o!==u;){var _=o,D=_.alternate,F=_.stateNode;if(_=_.tag,D!==null&&D===u)break;_!==5&&_!==26&&_!==27||F===null||(D=F,h?(F=Fr(o,g),F!=null&&w.unshift(Co(o,F,D))):h||(F=Fr(o,g),F!=null&&w.push(Co(o,F,D)))),o=o.return}w.length!==0&&n.push({event:i,listeners:w})}var zC=/\r\n?/g,EC=/\u0000|\uFFFD/g;function nv(n){return(typeof n=="string"?n:""+n).replace(zC,`
|
|
9
|
+
`).replace(EC,"")}function sv(n,i){return i=nv(i),nv(n)===i}function ot(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":sg(n,u,g);break;case"data":if(i!=="object"){Sl(n,"data",u);break}case"src":case"href":if(u===""&&(i!=="a"||o!=="href")){n.removeAttribute(o);break}if(u==null||typeof u=="function"||typeof u=="symbol"||typeof u=="boolean"){n.removeAttribute(o);break}u=jl(""+u),n.setAttribute(o,u);break;case"action":case"formAction":if(typeof u=="function"){n.setAttribute(o,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof g=="function"&&(o==="formAction"?(i!=="input"&&ot(n,i,"name",h.name,h,null),ot(n,i,"formEncType",h.formEncType,h,null),ot(n,i,"formMethod",h.formMethod,h,null),ot(n,i,"formTarget",h.formTarget,h,null)):(ot(n,i,"encType",h.encType,h,null),ot(n,i,"method",h.method,h,null),ot(n,i,"target",h.target,h,null)));if(u==null||typeof u=="symbol"||typeof u=="boolean"){n.removeAttribute(o);break}u=jl(""+u),n.setAttribute(o,u);break;case"onClick":u!=null&&(n.onclick=Cs);break;case"onScroll":u!=null&&$e("scroll",n);break;case"onScrollEnd":u!=null&&$e("scrollend",n);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(a(61));if(o=u.__html,o!=null){if(h.children!=null)throw Error(a(60));n.innerHTML=o}}break;case"multiple":n.multiple=u&&typeof u!="function"&&typeof u!="symbol";break;case"muted":n.muted=u&&typeof u!="function"&&typeof u!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(u==null||typeof u=="function"||typeof u=="boolean"||typeof u=="symbol"){n.removeAttribute("xlink:href");break}o=jl(""+u),n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",o);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":u!=null&&typeof u!="function"&&typeof u!="symbol"?n.setAttribute(o,""+u):n.removeAttribute(o);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":u&&typeof u!="function"&&typeof u!="symbol"?n.setAttribute(o,""):n.removeAttribute(o);break;case"capture":case"download":u===!0?n.setAttribute(o,""):u!==!1&&u!=null&&typeof u!="function"&&typeof u!="symbol"?n.setAttribute(o,u):n.removeAttribute(o);break;case"cols":case"rows":case"size":case"span":u!=null&&typeof u!="function"&&typeof u!="symbol"&&!isNaN(u)&&1<=u?n.setAttribute(o,u):n.removeAttribute(o);break;case"rowSpan":case"start":u==null||typeof u=="function"||typeof u=="symbol"||isNaN(u)?n.removeAttribute(o):n.setAttribute(o,u);break;case"popover":$e("beforetoggle",n),$e("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":sg(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&&$e("scroll",n);break;case"onScrollEnd":u!=null&&$e("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(!at.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":$e("error",n),$e("load",n);var u=!1,h=!1,g;for(g in o)if(o.hasOwnProperty(g)){var w=o[g];if(w!=null)switch(g){case"src":u=!0;break;case"srcSet":h=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:ot(n,i,g,w,o,null)}}h&&ot(n,i,"srcSet",o.srcSet,o,null),u&&ot(n,i,"src",o.src,o,null);return;case"input":$e("invalid",n);var _=g=w=h=null,D=null,F=null;for(u in o)if(o.hasOwnProperty(u)){var X=o[u];if(X!=null)switch(u){case"name":h=X;break;case"type":w=X;break;case"checked":D=X;break;case"defaultChecked":F=X;break;case"value":g=X;break;case"defaultValue":_=X;break;case"children":case"dangerouslySetInnerHTML":if(X!=null)throw Error(a(137,i));break;default:ot(n,i,u,X,o,null)}}Wp(n,g,_,D,F,w,h,!1);return;case"select":$e("invalid",n),u=w=g=null;for(h in o)if(o.hasOwnProperty(h)&&(_=o[h],_!=null))switch(h){case"value":g=_;break;case"defaultValue":w=_;break;case"multiple":u=_;default:ot(n,i,h,_,o,null)}i=g,o=w,n.multiple=!!u,i!=null?La(n,!!u,i,!1):o!=null&&La(n,!!u,o,!0);return;case"textarea":$e("invalid",n),g=h=u=null;for(w in o)if(o.hasOwnProperty(w)&&(_=o[w],_!=null))switch(w){case"value":u=_;break;case"defaultValue":h=_;break;case"children":g=_;break;case"dangerouslySetInnerHTML":if(_!=null)throw Error(a(91));break;default:ot(n,i,w,_,o,null)}tg(n,u,h,g);return;case"option":for(D in o)o.hasOwnProperty(D)&&(u=o[D],u!=null)&&(D==="selected"?n.selected=u&&typeof u!="function"&&typeof u!="symbol":ot(n,i,D,u,o,null));return;case"dialog":$e("beforetoggle",n),$e("toggle",n),$e("cancel",n),$e("close",n);break;case"iframe":case"object":$e("load",n);break;case"video":case"audio":for(u=0;u<No.length;u++)$e(No[u],n);break;case"image":$e("error",n),$e("load",n);break;case"details":$e("toggle",n);break;case"embed":case"source":case"link":$e("error",n),$e("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(F in o)if(o.hasOwnProperty(F)&&(u=o[F],u!=null))switch(F){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:ot(n,i,F,u,o,null)}return;default:if(dd(i)){for(X in o)o.hasOwnProperty(X)&&(u=o[X],u!==void 0&&Xf(n,i,X,u,o,void 0));return}}for(_ in o)o.hasOwnProperty(_)&&(u=o[_],u!=null&&ot(n,i,_,u,o,null))}function RC(n,i,o,u){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var h=null,g=null,w=null,_=null,D=null,F=null,X=null;for(Q in o){var ne=o[Q];if(o.hasOwnProperty(Q)&&ne!=null)switch(Q){case"checked":break;case"value":break;case"defaultValue":D=ne;default:u.hasOwnProperty(Q)||ot(n,i,Q,null,u,ne)}}for(var K in u){var Q=u[K];if(ne=o[K],u.hasOwnProperty(K)&&(Q!=null||ne!=null))switch(K){case"type":g=Q;break;case"name":h=Q;break;case"checked":F=Q;break;case"defaultChecked":X=Q;break;case"value":w=Q;break;case"defaultValue":_=Q;break;case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(a(137,i));break;default:Q!==ne&&ot(n,i,K,Q,u,ne)}}cd(n,w,_,D,F,X,g,h);return;case"select":Q=w=_=K=null;for(g in o)if(D=o[g],o.hasOwnProperty(g)&&D!=null)switch(g){case"value":break;case"multiple":Q=D;default:u.hasOwnProperty(g)||ot(n,i,g,null,u,D)}for(h in u)if(g=u[h],D=o[h],u.hasOwnProperty(h)&&(g!=null||D!=null))switch(h){case"value":K=g;break;case"defaultValue":_=g;break;case"multiple":w=g;default:g!==D&&ot(n,i,h,g,u,D)}i=_,o=w,u=Q,K!=null?La(n,!!o,K,!1):!!u!=!!o&&(i!=null?La(n,!!o,i,!0):La(n,!!o,o?[]:"",!1));return;case"textarea":Q=K=null;for(_ in o)if(h=o[_],o.hasOwnProperty(_)&&h!=null&&!u.hasOwnProperty(_))switch(_){case"value":break;case"children":break;default:ot(n,i,_,null,u,h)}for(w in u)if(h=u[w],g=o[w],u.hasOwnProperty(w)&&(h!=null||g!=null))switch(w){case"value":K=h;break;case"defaultValue":Q=h;break;case"children":break;case"dangerouslySetInnerHTML":if(h!=null)throw Error(a(91));break;default:h!==g&&ot(n,i,w,h,u,g)}eg(n,K,Q);return;case"option":for(var ye in o)K=o[ye],o.hasOwnProperty(ye)&&K!=null&&!u.hasOwnProperty(ye)&&(ye==="selected"?n.selected=!1:ot(n,i,ye,null,u,K));for(D in u)K=u[D],Q=o[D],u.hasOwnProperty(D)&&K!==Q&&(K!=null||Q!=null)&&(D==="selected"?n.selected=K&&typeof K!="function"&&typeof K!="symbol":ot(n,i,D,K,u,Q));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)K=o[Ce],o.hasOwnProperty(Ce)&&K!=null&&!u.hasOwnProperty(Ce)&&ot(n,i,Ce,null,u,K);for(F in u)if(K=u[F],Q=o[F],u.hasOwnProperty(F)&&K!==Q&&(K!=null||Q!=null))switch(F){case"children":case"dangerouslySetInnerHTML":if(K!=null)throw Error(a(137,i));break;default:ot(n,i,F,K,u,Q)}return;default:if(dd(i)){for(var lt in o)K=o[lt],o.hasOwnProperty(lt)&&K!==void 0&&!u.hasOwnProperty(lt)&&Xf(n,i,lt,void 0,u,K);for(X in u)K=u[X],Q=o[X],!u.hasOwnProperty(X)||K===Q||K===void 0&&Q===void 0||Xf(n,i,X,K,u,Q);return}}for(var P in o)K=o[P],o.hasOwnProperty(P)&&K!=null&&!u.hasOwnProperty(P)&&ot(n,i,P,null,u,K);for(ne in u)K=u[ne],Q=o[ne],!u.hasOwnProperty(ne)||K===Q||K==null&&Q==null||ot(n,i,ne,K,u,Q)}function iv(n){switch(n){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function AC(){if(typeof performance.getEntriesByType=="function"){for(var n=0,i=0,o=performance.getEntriesByType("resource"),u=0;u<o.length;u++){var h=o[u],g=h.transferSize,w=h.initiatorType,_=h.duration;if(g&&_&&iv(w)){for(w=0,_=h.responseEnd,u+=1;u<o.length;u++){var D=o[u],F=D.startTime;if(F>_)break;var X=D.transferSize,ne=D.initiatorType;X&&iv(ne)&&(D=D.responseEnd,w+=X*(D<_?1:(_-F)/(D-F)))}if(--u,i+=8*(g+w)/(h.duration/1e3),n++,10<n)break}}if(0<n)return i/n/1e6}return navigator.connection&&(n=navigator.connection.downlink,typeof n=="number")?n:5}var Wf=null,eh=null;function vc(n){return n.nodeType===9?n:n.ownerDocument}function av(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 rv(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 ov=typeof setTimeout=="function"?setTimeout:void 0,OC=typeof clearTimeout=="function"?clearTimeout:void 0,lv=typeof Promise=="function"?Promise:void 0,DC=typeof queueMicrotask=="function"?queueMicrotask:typeof lv<"u"?function(n){return lv.resolve(null).then(n).catch(LC)}:ov;function LC(n){setTimeout(function(){throw n})}function yi(n){return n==="head"}function cv(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")ko(n.ownerDocument.documentElement);else if(o==="head"){o=n.ownerDocument.head,ko(o);for(var g=o.firstChild;g;){var w=g.nextSibling,_=g.nodeName;g[ds]||_==="SCRIPT"||_==="STYLE"||_==="LINK"&&g.rel.toLowerCase()==="stylesheet"||o.removeChild(g),g=w}}else o==="body"&&ko(n.ownerDocument.body);o=h}while(o);hr(i)}function uv(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 dv(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 fv(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 hv(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 mv(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 ko(n){for(var i=n.attributes;i.length;)n.removeAttributeNode(i[0]);Oa(n)}var qn=new Map,pv=new Set;function bc(n){return typeof n.getRootNode=="function"?n.getRootNode():n.nodeType===9?n:n.ownerDocument}var Bs=Z.d;Z.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"?Ty(i):Bs.r(n)}var ur=typeof document>"u"?null:document;function gv(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+'"]'),pv.has(h)||(pv.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),gv("dns-prefetch",n,null)}function qC(n,i){Bs.C(n,i),gv("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(_o(g))||i==="script"&&u.querySelector(zo(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(zo(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 w=h.get(g);if(!w){var _={loading:0,preload:null};if(w=u.querySelector(_o(g)))_.loading=5;else{n=y({rel:"stylesheet",href:n,"data-precedence":i},o),(o=qn.get(g))&&oh(n,o);var D=w=u.createElement("link");Mt(D),Wt(D,"link",n),D._p=new Promise(function(F,X){D.onload=F,D.onerror=X}),D.addEventListener("load",function(){_.loading|=1}),D.addEventListener("error",function(){_.loading|=2}),_.loading|=4,xc(w,i,u)}w={type:"stylesheet",instance:w,count:1,state:_},h.set(g,w)}}}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(zo(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(zo(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 yv(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,w=g.get(n);if(w||(h=h.ownerDocument||h,w={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},g.set(n,w),(g=h.querySelector(_o(n)))&&!g._p&&(w.instance=g,w.state.loading=5),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,w.state))),i&&u===null)throw Error(a(528,""));return w}if(i&&u!==null)throw Error(a(529,""));return null;case"script":return i=o.async,o=o.src,typeof o=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=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 _o(n){return'link[rel="stylesheet"]['+n+"]"}function vv(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 zo(n){return"script[async]"+n}function bv(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(_o(h));if(g)return i.state.loading|=4,i.instance=g,Mt(g),g;u=vv(o),(h=qn.get(h))&&oh(u,h),g=(n.ownerDocument||n).createElement("link"),Mt(g);var w=g;return w._p=new Promise(function(_,D){w.onload=_,w.onerror=D}),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(zo(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,w=0;w<u.length;w++){var _=u[w];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 xv(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 w=g.getAttribute(i)||"";w=n+w;var _=u.get(w);_?_.push(g):u.set(w,[g])}}return u}function Sv(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 wv(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(_o(h));if(g){i=g._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(n.count++,n=wc.bind(n),i.then(n,n)),o.state.loading|=4,o.instance=g,Mt(g);return}g=i.ownerDocument||i,u=vv(u),(h=qn.get(h))&&oh(u,h),g=g.createElement("link"),Mt(g);var w=g;w._p=new Promise(function(_,D){w.onload=_,w.onerror=D}),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=wc.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*AC());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 wc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Nc(this,this.stylesheets);else if(this.unsuspend){var n=this.unsuspend;this.unsuspend=null,n()}}}var jc=null;function Nc(n,i){n.stylesheets=null,n.unsuspend!==null&&(n.count++,jc=new Map,i.forEach(XC,n),jc=null,wc.call(n))}function XC(n,i){if(!(i.state.loading&4)){var o=jc.get(n);if(o)var u=o.get(null);else{o=new Map,jc.set(n,o);for(var h=n.querySelectorAll("link[data-precedence],style[data-precedence]"),g=0;g<h.length;g++){var w=h[g];(w.nodeName==="LINK"||w.getAttribute("media")!=="not all")&&(o.set(w.dataset.precedence,w),u=w)}u&&o.set(null,u)}h=i.instance,w=h.getAttribute("data-precedence"),g=o.get(w)||u,g===u&&o.set(null,h),o.set(w,h),this.count++,u=wc.bind(this),h.addEventListener("load",u),h.addEventListener("error",u),g?g.parentNode.insertBefore(h,g.nextSibling):(n=n.nodeType===9?n.head:n,n.insertBefore(h,n.firstChild)),i.state.loading|=4}}var Eo={$$typeof:R,Provider:null,Consumer:null,_currentValue:oe,_currentValue2:oe,_threadCount:0};function WC(n,i,o,u,h,g,w,_,D){this.tag=1,this.containerInfo=n,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=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=w,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=D,this.incompleteTransitions=new Map}function jv(n,i,o,u,h,g,w,_,D,F,X,ne){return n=new WC(n,i,o,w,D,F,X,ne,_),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 Nv(n){return n?(n=Ha,n):Ha}function Cv(n,i,o,u,h,g){h=Nv(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),ro(o,n,i))}function kv(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){kv(n,i),(n=n.alternate)&&kv(n,i)}function _v(n){if(n.tag===13||n.tag===31){var i=Qi(n,67108864);i!==null&&bn(i,n,67108864),uh(n,67108864)}}function zv(n){if(n.tag===13||n.tag===31){var i=Tn();i=$(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=I.T;I.T=null;var g=Z.p;try{Z.p=2,dh(n,i,o,u)}finally{Z.p=g,I.T=h}}function tk(n,i,o,u){var h=I.T;I.T=null;var g=Z.p;try{Z.p=8,dh(n,i,o,u)}finally{Z.p=g,I.T=h}}function dh(n,i,o,u){if(Cc){var h=fh(u);if(h===null)Jf(n,i,u,kc,o),Rv(n,u);else if(sk(h,n,i,o,u))u.stopPropagation();else if(Rv(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 w=cs(g.pendingLanes);if(w!==0){var _=g;for(_.pendingLanes|=2,_.entangledLanes|=2;w;){var D=1<<31-Ke(w);_.entanglements[1]|=D,w&=~D}gs(g),(Je&6)===0&&(lc=Ie()+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 Ev(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 Le: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,Ro=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 Rv(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":Ro.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ao.delete(i.pointerId)}}function To(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&&_v(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=To(vi,n,i,o,u,h),!0;case"dragenter":return bi=To(bi,n,i,o,u,h),!0;case"mouseover":return xi=To(xi,n,i,o,u,h),!0;case"pointerover":var g=h.pointerId;return Ro.set(g,To(Ro.get(g)||null,n,i,o,u,h)),!0;case"gotpointercapture":return g=h.pointerId,Ao.set(g,To(Ao.get(g)||null,n,i,o,u,h)),!0}return!1}function Av(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(){zv(o)});return}}else if(i===31){if(i=f(o),i!==null){n.blockedOn=i,Qt(n.priority,function(){zv(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&&_v(i),n.blockedOn=o,!1;i.shift()}return!0}function Tv(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),Ro.forEach(Tv),Ao.forEach(Tv)}function zc(n,i){n.blockedOn===i&&(n.blockedOn=null,mh||(mh=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,ik)))}var Ec=null;function Ov(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(D){return zc(D,n)}vi!==null&&zc(vi,n),bi!==null&&zc(bi,n),xi!==null&&zc(xi,n),Ro.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);)Av(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],w=h[Nt]||null;if(typeof g=="function")w||Ov(o);else if(w){var _=null;if(g&&g.hasAttribute("formAction")){if(h=g,w=g[Nt]||null)_=w.formAction;else if(hh(h)!==null)continue}else _=w.action;typeof _=="function"?o[u+1]=_:(o.splice(u,3),u-=3),Ov(o)}}}function Dv(){function n(g){g.canIntercept&&g.info==="react-transition"&&g.intercept({handler:function(){return new Promise(function(w){return h=w})},focusReset:"manual",scroll:"manual"})}function i(){h!==null&&(h(),h=null),u||setTimeout(o,20)}function o(){if(!u&&!navigation.transition){var g=navigation.currentEntry;g&&g.url!=null&&navigation.navigate(g.url,{state:g.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var u=!1,h=null;return navigation.addEventListener("navigate",n),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(o,100),function(){u=!0,navigation.removeEventListener("navigate",n),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),h!==null&&(h(),h=null)}}}function ph(n){this._internalRoot=n}Rc.prototype.render=ph.prototype.render=function(n){var i=this._internalRoot;if(i===null)throw Error(a(409));var o=i.current,u=Tn();Cv(o,u,n,i,null,null)},Rc.prototype.unmount=ph.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var i=n.containerInfo;Cv(n.current,2,null,n,null,null),uc(),i[Cn]=null}};function Rc(n){this._internalRoot=n}Rc.prototype.unstable_scheduleHydration=function(n){if(n){var i=it();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&&Av(n)}};var Lv=t.version;if(Lv!=="19.2.4")throw Error(a(527,Lv,"19.2.4"));Z.findDOMNode=function(n){var i=n._reactInternals;if(i===void 0)throw typeof n.render=="function"?Error(a(188)):(n=Object.keys(n).join(","),Error(a(268,n)));return n=m(i),n=n!==null?v(n):null,n=n===null?null:n.stateNode,n};var ak={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:I,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ac=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ac.isDisabled&&Ac.supportsFiber)try{ls=Ac.inject(ak),_e=Ac}catch{}}return Do.createRoot=function(n,i){if(!r(n))throw Error(a(299));var o=!1,u="",h=qy,g=Hy,w=Zy;return i!=null&&(i.unstable_strictMode===!0&&(o=!0),i.identifierPrefix!==void 0&&(u=i.identifierPrefix),i.onUncaughtError!==void 0&&(h=i.onUncaughtError),i.onCaughtError!==void 0&&(g=i.onCaughtError),i.onRecoverableError!==void 0&&(w=i.onRecoverableError)),i=jv(n,1,!1,null,null,o,u,null,h,g,w,Dv),n[Cn]=i.current,Yf(n),new ph(i)},Do.hydrateRoot=function(n,i,o){if(!r(n))throw Error(a(299));var u=!1,h="",g=qy,w=Hy,_=Zy,D=null;return o!=null&&(o.unstable_strictMode===!0&&(u=!0),o.identifierPrefix!==void 0&&(h=o.identifierPrefix),o.onUncaughtError!==void 0&&(g=o.onUncaughtError),o.onCaughtError!==void 0&&(w=o.onCaughtError),o.onRecoverableError!==void 0&&(_=o.onRecoverableError),o.formState!==void 0&&(D=o.formState)),i=jv(n,1,!0,i,o??null,u,h,D,g,w,_,Dv),i.context=Nv(null),o=i.current,u=Tn(),u=$(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 Rc(i)},Do.version="19.2.4",Do}var Fv;function pk(){if(Fv)return vh.exports;Fv=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(),Mr=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 wa=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 Kx(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 Gv(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(!Yo(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 Kv(e,t){const{exact:s,status:a,predicate:r,mutationKey:c}=e;if(c){if(!t.options.mutationKey)return!1;if(s){if(Qo(t.options.mutationKey)!==Qo(c))return!1}else if(!Yo(t.options.mutationKey,c))return!1}return!(a&&t.state.status!==a||r&&!r(t))}function $m(e,t){return(t?.queryKeyHashFn||Qo)(e)}function Qo(e){return JSON.stringify(e,(t,s)=>em(s)?Object.keys(s).sort().reduce((a,r)=>(a[r]=s[r],a),{}):s)}function Yo(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(s=>Yo(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=Vv(e)&&Vv(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 j=Pm(b,x,s+1);p[y]=j,j===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 Vv(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function em(e){if(!Qv(e))return!1;const t=e.constructor;if(t===void 0)return!0;const s=t.prototype;return!(!Qv(s)||!s.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Qv(e){return Object.prototype.toString.call(e)==="[object Object]"}function wk(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 jk(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 Vx(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 Qx(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 Mr{#t;#e;#n;constructor(){super(),this.#n=e=>{if(!wa&&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 Mr{#t=!0;#e;#n;constructor(){super(),this.#n=e=>{if(!wa&&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 Rk(e){return Math.min(1e3*2**e,3e4)}function Yx(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 Jx(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=()=>Yx(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?.()}),j=()=>{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??(wa?0:3),R=e.retryDelay??Rk,z=typeof R=="function"?R(s,k):R,L=E===!0||typeof E=="number"&&s<E||typeof E=="function"&&E(s,k);if(t||!L){b(k);return}s++,e.onFail?.(s,k),wk(z).then(()=>m()?void 0:x()).then(()=>{t?b(k):j()})})};return{promise:r,status:()=>r.status,cancel:d,continue:()=>(a?.(),r),cancelRetry:f,continueRetry:p,canStart:v,start:()=>(v()?j():x().then(j),r)}}var Xx=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??(wa?1/0:300*1e3))}clearGcTimeout(){this.#t&&(fa.clearTimeout(this.#t),this.#t=void 0)}},Ak=class extends Xx{#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=Jv(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=Jv(this.options);t.data!==void 0&&(this.setState(Yv(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:!Kx(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=Vx(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=Jx({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,...Wx(s.data,this.options),fetchMeta:e.meta??null};case"success":const a={...s,...Yv(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 Wx(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Yx(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Yv(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Jv(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 Mr{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),Xv(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.#w(),this.#e.setOptions(this.options),t._defaulted&&!lu(this.options,t)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const a=this.hasListeners();a&&Wv(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.#w();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(wa||this.#i.isStale||!Wh(e))return;const s=Kx(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,!(wa||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(),B=!T&&Xv(e,t),te=T&&Wv(e,s,t,a);(B||te)&&(v={...v,...Wx(m.data,e.options)}),t._optimisticResults==="isRestoring"&&(v.fetchStatus="idle")}let{error:x,errorUpdatedAt:j,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,j=Date.now(),S="error");const k=v.fetchStatus==="fetching",E=S==="pending",R=S==="error",z=E&&k,L=b!==void 0,A={status:S,fetchStatus:v.fetchStatus,isPending:E,isSuccess:S==="success",isError:R,isInitialLoading:z,isLoading:z,data:b,dataUpdatedAt:v.dataUpdatedAt,error:x,errorUpdatedAt:j,failureCount:v.fetchFailureCount,failureReason:v.fetchFailureReason,errorUpdateCount:v.errorUpdateCount,isFetched:v.dataUpdateCount>0||v.errorUpdateCount>0,isFetchedAfterMount:v.dataUpdateCount>p.dataUpdateCount||v.errorUpdateCount>p.errorUpdateCount,isFetching:k,isRefetching:k&&!E,isLoadingError:R&&!L,isPaused:v.fetchStatus==="paused",isPlaceholderData:y,isRefetchError:R&&L,isStale:Hm(e,t),refetch:this.refetch,promise:this.#o,isEnabled:Hn(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const T=A.data!==void 0,B=A.status==="error"&&!T,te=pe=>{B?pe.reject(A.error):T&&pe.resolve(A.data)},Y=()=>{const pe=this.#o=A.promise=nm();te(pe)},se=this.#o;switch(se.status){case"pending":e.queryHash===s.queryHash&&te(se);break;case"fulfilled":(B||A.data!==se.value)&&Y();break;case"rejected":(!B||A.error!==se.reason)&&Y();break}}return A}updateResult(){const e=this.#i,t=this.createResult(this.#e,this.options);if(this.#s=this.#e.state,this.#r=this.options,this.#s.data!==void 0&&(this.#f=this.#e),lu(t,e))return;this.#i=t;const s=()=>{if(!e)return!0;const{notifyOnChangeProps:a}=this.options,r=typeof a=="function"?a():a;if(r==="all"||!r&&!this.#h.size)return!0;const c=new Set(r??this.#h);return this.options.throwOnError&&c.add("error"),Object.keys(this.#i).some(d=>{const f=d;return this.#i[f]!==e[f]&&c.has(f)})};this.#j({listeners:s()})}#w(){const e=this.#t.getQueryCache().build(this.#t,this.options);if(e===this.#e)return;const t=this.#e;this.#e=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#j(e){Bt.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#i)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function Tk(e,t){return Hn(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Xv(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 Wv(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 eb(e){return{onFetch:(t,s)=>{const a=t.options,r=t.fetchOptions?.meta?.fetchMore?.direction,c=t.state.data?.pages||[],d=t.state.data?.pageParams||[];let f={pages:[],pageParams:[]},p=0;const m=async()=>{let v=!1;const y=j=>{Ck(j,()=>t.signal,()=>v=!0)},b=Vx(t.options,t.fetchOptions),x=async(j,S,C)=>{if(v)return Promise.reject();if(S==null&&j.pages.length)return Promise.resolve(j);const E=(()=>{const M={client:t.client,queryKey:t.queryKey,pageParam:S,direction:C?"backward":"forward",meta:t.options.meta};return y(M),M})(),R=await b(E),{maxPages:z}=t.options,L=C?Nk:jk;return{pages:L(j.pages,R,z),pageParams:L(j.pageParams,S,z)}};if(r&&c.length){const j=r==="backward",S=j?Dk:tb,C={pages:c,pageParams:d},k=S(a,C);f=await x(C,k,j)}else{const j=e??c.length;do{const S=p===0?d[0]??a.initialPageParam:tb(a,f);if(p>0&&S==null)break;f=await x(f,S),p++}while(p<j)}return f};t.options.persister?t.fetchFn=()=>t.options.persister?.(m,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},s):t.fetchFn=m}}}function tb(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 Xx{#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=Jx({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 eS=class extends Mr{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=>Kv(t,s))}findAll(e={}){return this.getAll().filter(t=>Kv(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 nb(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 Mr{#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&&(nb(s,r).forEach(v=>{v.destroy()}),nb(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 Mr{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 Ak({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=>Gv(t,s))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(s=>Gv(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 eS,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=eb(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(cn).catch(cn)}ensureInfiniteQueryData(e){return e.behavior=eb(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(Qo(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#i.values()],s={};return t.forEach(a=>{Yo(e,a.queryKey)&&Object.assign(s,a.defaultOptions)}),s}setMutationDefaults(e,t){this.#s.set(Qo(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#s.values()],s={};return t.forEach(a=>{Yo(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()}},tS=N.createContext(void 0),nS=e=>{const t=N.useContext(tS);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(tS.Provider,{value:e,children:t})),sS=N.createContext(!1),iS=()=>N.useContext(sS);sS.Provider;function qk(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Hk=N.createContext(qk()),aS=()=>N.useContext(Hk),rS=(e,t,s)=>{const a=s?.state.error&&typeof e.throwOnError=="function"?Qx(e.throwOnError,[s.state.error,s]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||a)&&(t.isReset()||(e.retryOnMount=!1))},oS=e=>{N.useEffect(()=>{e.clearReset()},[e])},lS=({result:e,errorResetBoundary:t,throwOnError:s,query:a,suspense:r})=>e.isError&&!t.isReset()&&!e.isFetching&&a&&(r&&e.data===void 0||Qx(s,[e.error,a])),cS=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=nS(),r=iS(),c=aS(),d=N.useMemo(()=>e.map(S=>{const C=a.defaultQueryOptions(S);return C._optimisticResults=r?"isRestoring":"optimistic",C}),[e,a,r]);d.forEach(S=>{cS(S);const C=a.getQueryCache().get(S.queryHash);rS(S,c,C)}),oS(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 j=p.find((S,C)=>{const k=d[C];return k&&lS({result:S,errorResetBoundary:c,throwOnError:k.throwOnError,query:a.getQueryCache().get(k.queryHash),suspense:k.suspense})});if(j?.error)throw j.error;return m(v())}function Gk(e,t,s){const a=iS(),r=aS(),c=nS(),d=c.defaultQueryOptions(e);c.getDefaultOptions().queries?._experimental_beforeQuery?.(d);const f=c.getQueryCache().get(d.queryHash);d._optimisticResults=a?"isRestoring":"optimistic",cS(d),rS(d,r,f),oS(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(lS({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&&!wa&&Zk(v,a)&&(p?rm(d,m,r):f?.promise)?.catch(cn).finally(()=>{m.updateResult()}),d.notifyOnChangeProps?v:m.trackResult(v)}function Ho(e,t){return Gk(e,qm)}var Oc=typeof window<"u"?N.useLayoutEffect:N.useEffect;function wh(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 Jo(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,sb=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=rb(e)&&rb(r);if(!c&&!(uu(e)&&uu(r)))return r;const d=c?e:ib(e);if(!d)return r;const f=c?r:ib(r);if(!f)return r;const p=d.length,m=f.length,v=c?new Array(m):s();let y=0;for(let b=0;b<m;b++){const x=c?b:f[b],j=e[x],S=r[x];if(j===S){v[x]=j,(c?b<p:Jk.call(e,x))&&y++;continue}if(j===null||S===null||typeof j!="object"||typeof S!="object"){v[x]=S;continue}const C=ha(j,S,s,a+1);v[x]=C,C===j&&y++}return p===m&&y===p?e:v}function ib(e){const t=Object.getOwnPropertyNames(e);for(const r of t)if(!sb.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(!sb.call(e,r))return!1;a.push(r)}return a}function uu(e){if(!ab(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const s=t.prototype;return!(!ab(s)||!s.hasOwnProperty("isPrototypeOf"))}function ab(e){return Object.prototype.toString.call(e)==="[object Object]"}function rb(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 Rr(e){let t,s;const a=new Promise((r,c)=>{t=r,s=c});return a.status="pending",a.resolve=r=>{a.status="resolved",a.value=r,t(r),e?.(r)},a.reject=r=>{a.status="rejected",s(r)},a}function Xo(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function Wk(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function ob(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 Lo(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+=ob(e.slice(s,r.index))+r[0],s=t.lastIndex;a=a+ob(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,uS=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 j;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)j=E;else{r.static??=new Map;const R=pa(s.fullPath??s.from);R.parent=r,R.depth=c,j=R,r.static.set(k,R)}}else{const E=k.toLowerCase(),R=r.staticInsensitive?.get(E);if(R)j=R;else{r.staticInsensitive??=new Map;const z=pa(s.fullPath??s.from);z.parent=r,z.depth=c,j=z,r.staticInsensitive.set(E,z)}}break}case 1:{const k=p.substring(S,x[1]),E=p.substring(x[4],C),R=v&&!!(k||E),z=k?R?k:k.toLowerCase():void 0,L=E?R?E:E.toLowerCase():void 0,M=!y&&r.dynamic?.find(A=>!A.skipOnParamError&&A.caseSensitive===R&&A.prefix===z&&A.suffix===L);if(M)j=M;else{const A=Nh(1,s.fullPath??s.from,R,z,L);j=A,A.depth=c,A.parent=r,r.dynamic??=[],r.dynamic.push(A)}break}case 3:{const k=p.substring(S,x[1]),E=p.substring(x[4],C),R=v&&!!(k||E),z=k?R?k:k.toLowerCase():void 0,L=E?R?E:E.toLowerCase():void 0,M=!y&&r.optional?.find(A=>!A.skipOnParamError&&A.caseSensitive===R&&A.prefix===z&&A.suffix===L);if(M)j=M;else{const A=Nh(3,s.fullPath??s.from,R,z,L);j=A,A.parent=r,A.depth=c,r.optional??=[],r.optional.push(A)}break}case 2:{const k=p.substring(S,x[1]),E=p.substring(x[4],C),R=v&&!!(k||E),z=k?R?k:k.toLowerCase():void 0,L=E?R?E:E.toLowerCase():void 0,M=Nh(2,s.fullPath??s.from,R,z,L);j=M,M.parent=r,M.depth=c,r.wildcard??=[],r.wildcard.push(M)}}r=j}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=uS,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 jh(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(jh);for(const t of e.dynamic)ki(t)}if(e.optional?.length){e.optional.sort(jh);for(const t of e.optional)ki(t)}if(e.wildcard?.length){e.wildcard.sort(jh);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]=dS(e,a,r);return{route:r.node.route,rawParams:c,parsedParams:r.parsedParams}}function dS(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===uS){m--,d--,p--;continue}const y=t[d],b=p;if(y&&(p+=y.length),v.kind===1){r??=s.node.fullPath.split("/");const x=r[m],j=v.prefix?.length??0;if(x.charCodeAt(j)===123){const S=v.suffix?.length??0,C=x.substring(j+2,x.length-S-1),k=y.substring(j,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],j=v.prefix?.length??0,S=v.suffix?.length??0,C=x.substring(j+3,x.length-S-1),k=v.suffix||v.prefix?y.substring(j,y.length-S):y;k&&(c[C]=decodeURIComponent(k))}else if(v.kind===2){const x=v,j=e.substring(b+(x.prefix?.length??0),e.length-(x.suffix?.length??0)),S=decodeURIComponent(j);c["*"]=S,c._splat=S;break}}return s.rawParams&&Object.assign(c,s.rawParams),[c,{part:d,node:f,path:p,segment:m}]}function 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=!Jo(t),c=r&&e!=="/",d=t.length-(r?1:0),f=[{node:s,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let p=null,m=null,v=null;for(;f.length;){const y=f.pop(),{node:b,index:x,skipped:j,depth:S,statics:C,dynamics:k,optionals:E}=y;let{extract:R,rawParams:z,parsedParams:L}=y;if(b.skipOnParamError){if(!Ch(e,t,y))continue;z=y.rawParams,R=y.extract,L=y.parsedParams}a&&b.route&&b.kind!==ma&&Mo(m,y)&&(m=y);const M=x===d;if(M&&(b.route&&!c&&Mo(v,y)&&(v=y),!b.optional&&!b.wildcard&&!b.index&&!b.pathless))continue;const A=M?void 0:t[x];let T;if(M&&b.index){const B={node:b.index,index:x,skipped:j,depth:S+1,statics:C,dynamics:k,optionals:E,extract:R,rawParams:z,parsedParams:L};let te=!0;if(b.index.skipOnParamError&&(Ch(e,t,B)||(te=!1)),te){if(C===d&&!k&&!E&&!j)return B;Mo(v,B)&&(v=B)}}if(b.wildcard&&Mo(p,y))for(const B of b.wildcard){const{prefix:te,suffix:Y}=B;if(te&&(M||!(B.caseSensitive?A:T??=A.toLowerCase()).startsWith(te)))continue;if(Y){if(M)continue;const pe=t.slice(x).join("/").slice(-Y.length);if((B.caseSensitive?pe:pe.toLowerCase())!==Y)continue}const se={node:B,index:d,skipped:j,depth:S,statics:C,dynamics:k,optionals:E,extract:R,rawParams:z,parsedParams:L};if(!(B.skipOnParamError&&!Ch(e,t,se))){p=se;break}}if(b.optional){const B=j|1<<S,te=S+1;for(let Y=b.optional.length-1;Y>=0;Y--){const se=b.optional[Y];f.push({node:se,index:x,skipped:B,depth:te,statics:C,dynamics:k,optionals:E,extract:R,rawParams:z,parsedParams:L})}if(!M)for(let Y=b.optional.length-1;Y>=0;Y--){const se=b.optional[Y],{prefix:pe,suffix:ke}=se;if(pe||ke){const we=se.caseSensitive?A:T??=A.toLowerCase();if(pe&&!we.startsWith(pe)||ke&&!we.endsWith(ke))continue}f.push({node:se,index:x+1,skipped:j,depth:te,statics:C,dynamics:k,optionals:E+1,extract:R,rawParams:z,parsedParams:L})}}if(!M&&b.dynamic&&A)for(let B=b.dynamic.length-1;B>=0;B--){const te=b.dynamic[B],{prefix:Y,suffix:se}=te;if(Y||se){const pe=te.caseSensitive?A:T??=A.toLowerCase();if(Y&&!pe.startsWith(Y)||se&&!pe.endsWith(se))continue}f.push({node:te,index:x+1,skipped:j,depth:S+1,statics:C,dynamics:k+1,optionals:E,extract:R,rawParams:z,parsedParams:L})}if(!M&&b.staticInsensitive){const B=b.staticInsensitive.get(T??=A.toLowerCase());B&&f.push({node:B,index:x+1,skipped:j,depth:S+1,statics:C+1,dynamics:k,optionals:E,extract:R,rawParams:z,parsedParams:L})}if(!M&&b.static){const B=b.static.get(A);B&&f.push({node:B,index:x+1,skipped:j,depth:S+1,statics:C+1,dynamics:k,optionals:E,extract:R,rawParams:z,parsedParams:L})}if(b.pathless){const B=S+1;for(let te=b.pathless.length-1;te>=0;te--){const Y=b.pathless[te];f.push({node:Y,index:x,skipped:j,depth:B,statics:C,dynamics:k,optionals:E,extract:R,rawParams:z,parsedParams:L})}}}if(v&&p)return Mo(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]=dS(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 Mo(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 fS(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 hS(e){return Oi(fS(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&&Jo(f)==="";)f.pop();const y=t.split("/");for(let b=0,x=y.length;b<x;b++){const j=y[b];j===""?b?b===x-1&&f.push(j):f=[j]:j===".."?f.pop():j==="."||f.push(j)}}f.length>1&&(Jo(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 j=p[5],S=b.substring(0,p[1]),C=b.substring(p[4],j),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=>cb(r,s)).join("/"):cb(a,s)}function lb({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 j=e.substring(v,p[1]),S=e.substring(p[4],y);if(!x){r=!0,(j||S)&&(m+="/"+j+S);continue}const C=kh("_splat",t,s);m+="/"+j+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 j=e.substring(v,p[1]),S=e.substring(p[4],y),C=kh(x,t,s)??"undefined";m+="/"+j+C+S;continue}if(b===3){const x=e.substring(p[2],p[3]),j=t[x];if(j==null)continue;c[x]=j;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 cb(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 w_(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 j_(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 R_(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=mS(e[s],t);return t}}}function A_(e){const t=hS(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 mS(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 pS({update:e,notify:t,unwatched:s}){return{link:a,unlink:r,propagate:c,checkDirty:d,shallowPropagate:f};function a(m,v,y){const b=v.depsTail;if(b!==void 0&&b.dep===m)return;const x=b!==void 0?b.nextDep:v.deps;if(x!==void 0&&x.dep===m){x.version=y,v.depsTail=x;return}const j=m.subsTail;if(j!==void 0&&j.version===y&&j.sub===v)return;const S=v.depsTail=m.subsTail={version:y,dep:m,sub:v,prevDep:b,nextDep:x,prevSub:j,nextSub:void 0};x!==void 0&&(x.prevDep=S),b!==void 0?b.nextDep=S:v.deps=S,j!==void 0?j.nextSub=S:m.subs=S}function r(m,v=m.sub){const y=m.dep,b=m.prevDep,x=m.nextDep,j=m.nextSub,S=m.prevSub;return x!==void 0?x.prevDep=b:v.depsTail=b,b!==void 0?b.nextDep=x:v.deps=x,j!==void 0?j.prevSub=S:y.subsTail=S,S!==void 0?S.nextSub=j:(y.subs=j)===void 0&&s(y),x}function c(m){let v=m.nextSub,y;e:do{const b=m.sub;let x=b.flags;if(x&60?x&12?x&4?!(x&48)&&p(m,b)?(b.flags=x|40,x&=1):x=0:b.flags=x&-9|32:x=0:b.flags=x|32,x&2&&t(b),x&1){const j=b.subs;if(j!==void 0){const S=(m=j).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 j=m.dep,S=j.flags;if(v.flags&16)x=!0;else if((S&17)===17){if(e(j)){const C=j.subs;C.nextSub!==void 0&&f(C),x=!0}}else if((S&33)===33){(m.nextSub!==void 0||m.prevSub!==void 0)&&(y={value:m,prev:y}),m=j.deps,v=j,++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,Zo=0;const Hs=[],{link:v4,unlink:gS,propagate:b4,checkDirty:T_,shallowPropagate:x4}=pS({update(e){return e.depsTail!==void 0?M_(e):U_(e)},notify(e){let t=Zo,s=t;do if(Hs[t++]=e,e.flags&=-3,e=e.subs?.sub,e===void 0||!(e.flags&2))break;while(!0);for(Zo=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,Ru(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,Ru(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,Ru(e)}}else e.flags=2}function P_(){try{for(;ca<Zo;){const e=Hs[ca];Hs[ca++]=void 0,$_(e)}}finally{for(;ca<Zo;){const e=Hs[ca];Hs[ca++]=void 0,e.flags|=10}ca=0,Zo=0}}function I_(){this.depsTail=void 0,this.flags=0,Ru(this);const e=this.subs;e!==void 0&&gS(e)}function Ru(e){const t=e.depsTail;let s=t!==void 0?t.nextDep:e.deps;for(;s!==void 0;)s=gS(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:ub,unlink:B_,propagate:q_,checkDirty:yS,shallowPropagate:db}=pS({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 vS(){if(!(O_()>0)){for(;Lc<um;){const e=cm[Lc];cm[Lc++]=void 0,e.notify()}Lc=0,um=0}}function bS(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&&ub(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&&yS(r.deps,r)){if(r._update()){const d=r.subs;d!==void 0&&db(d)}}else c&vt.Pending&&(r.flags=c&~vt.Pending);return ys!==void 0&&ub(r,ys,Wc),r._snapshot}):r.set=function(c){if(r._update(c)){const d=r.subs;d!==void 0&&(q_(d),db(d),vS())}},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&&yS(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=bS(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=bS(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_(),vS()}}function Fo(e){let t;return K_(()=>{t=e()}),t}var dm=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},Au=(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},fb=(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},xS=(e,t)=>{const s=e.router.getMatch(t);return!!(!s||s._nonReactive.dehydrated)},hb=(e,t,s)=>{const a=xa(e,s);e.updateMatch(t,r=>({...r,context:a}))},Uo=(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)},SS=(e,t,s,a)=>{if(a._nonReactive.pendingTimeout!==void 0)return;const r=s.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!Au(e,t)&&(s.options.loader||s.options.beforeLoad||jS(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;SS(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=Rr(()=>{c?.resolve(),c=void 0});const{paramsError:d,searchError:f}=r;d&&Uo(e,s,d,"PARSE_PARAMS"),f&&Uo(e,s,f,"VALIDATE_SEARCH"),SS(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){Fo(()=>{v(),y()});return}r._nonReactive.beforeLoadPromise=Rr();const b={...xa(e,s,!1),...r.__routeContext},{search:x,params:j,cause:S}=r,C=Au(e,t),k={search:x,abortController:p,params:j,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){Fo(()=>{v(),y()});return}(xn(z)||dn(z))&&(v(),Uo(e,s,z,"BEFORE_LOAD")),Fo(()=>{v(),e.updateMatch(t,L=>({...L,__beforeLoadContext:z})),y()})};let R;try{if(R=a.options.beforeLoad(k),Xo(R))return v(),R.catch(z=>{Uo(e,s,z,"BEFORE_LOAD")}).then(E)}catch(z){v(),Uo(e,s,z,"BEFORE_LOAD")}E(R)},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(xS(e,s))return;const p=V_(e,s,r);return Xo(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}))},wS=(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=Au(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}},mb=async(e,t,s,a,r)=>{try{const c=e.router.getMatch(s);try{(!(Qk??e.router.isServer)||c.ssr===!0)&&Wo(r);const d=r.options.loader,f=typeof d=="function"?d:d?.handler,p=f?.(wS(e,t,s,a,r)),m=!!f&&Xo(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 Wo(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,j,S,C,k){const E=Date.now()-j.updatedAt,R=x?k.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:k.options.staleTime??e.router.options.defaultStaleTime??0,z=k.options.shouldReload,L=typeof z=="function"?z(wS(e,t,r,s,k)):z,{status:M,invalid:A}=C,T=E>R&&(!!e.forceStaleReload||C.cause==="enter"||S!==void 0&&S!==C.id);d=M==="success"&&(A||(L??T)),x&&k.options.preload===!1||(d&&!e.sync&&v?(f=!0,(async()=>{try{await mb(e,t,r,s,k);const B=e.router.getMatch(r);B._nonReactive.loaderPromise?.resolve(),B._nonReactive.loadPromise?.resolve(),B._nonReactive.loaderPromise=void 0,B._nonReactive.loadPromise=void 0}catch(B){xn(B)&&await e.router.navigate(B.options)}})()):M!=="success"||d?await mb(e,t,r,s,k):hb(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(xS(e,r)){if(!e.router.getMatch(r))return e.matches[s];hb(e,r,s)}else{const x=e.router.getMatch(r),j=e.router.state.matches[s]?.routeId===c?e.router.state.matches[s].id:e.router.state.matches.find(C=>C.routeId===c)?.id,S=Au(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,j,C,p)}else{const C=S&&!e.router.state.matches.some(E=>E.id===r),k=e.router.getMatch(r);k._nonReactive.loaderPromise=Rr(),C!==k.preload&&e.updateMatch(r,E=>({...E,preload:C})),await a(S,x,j,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 pb(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);Xo(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?fb(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 j=x.reason;if(xn(j))throw j;dn(j)?f??=j:p??=j}if(p!==void 0)throw p}const m=f??(a&&!t.preload?a:void 0);let v=t.serialError?t.firstBadMatchIndex??0:t.matches.length-1;if(!m&&a&&t.preload)return t.matches;if(m){const b=fb(t,m);Ui(b!==void 0);const x=t.matches[b],j=t.router.looseRoutesById[x.routeId],S=t.router.options?.defaultNotFoundComponent;!j.options.notFoundComponent&&S&&(j.options.notFoundComponent=S),m.routeId=x.routeId;const C=x.routeId===t.router.routeTree.id;t.updateMatch(x.id,k=>({...k,...C?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:m},isFetching:!1})),v=b,await Wo(j,["notFoundComponent"])}else if(!t.preload){const b=t.matches[0];b.globalNotFound||t.router.getMatch(b.id)?.globalNotFound&&t.updateMatch(b.id,x=>({...x,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){const b=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await Wo(b,["errorComponent"])}for(let b=0;b<=v;b++){const{id:x,routeId:j}=t.matches[b],S=t.router.looseRoutesById[j];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 ${j}:`,C)}}const y=dm(t);if(Xo(y)&&await y,m)throw m;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function gb(e,t){const s=t.map(a=>e.options[a]?.preload?.()).filter(Boolean);if(s.length!==0)return Promise.all(s)}function Wo(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=gb(e,eu);a?e._componentsPromise=a.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():gb(e,t);return e._lazyPromise?e._lazyPromise.then(s):s()}function jS(e){for(const t of eu)if(e.options[t]?.preload)return!0;return!1}var eu=["component","errorComponent","pendingComponent","notFoundComponent"],Di="__TSR_index",yb="popstate",vb="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=bb(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=bb(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 bb(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,j=!1;const S=()=>m;let C,k;const E=()=>{C&&(A._ignoreSubscribers=!0,(C.isPush?t.history.pushState:t.history.replaceState)(C.state,"",C.href),A._ignoreSubscribers=!1,C=void 0,k=void 0,v=void 0)},R=(T,B,te)=>{const Y=f(B);k||(v=m),m=gu(B,te),C={href:Y,state:te,isPush:C?.isPush||T==="push"},k||(k=Promise.resolve().then(()=>E()))},z=T=>{m=p(),A.notify({type:T})},L=async()=>{if(b){b=!1;return}const T=p(),B=T.state[Di]-m.state[Di],te=B===1,Y=B===-1,se=!te&&!Y||y;y=!1;const pe=se?"GO":Y?"BACK":"FORWARD",ke=se?{type:"GO",index:B}:{type:Y?"BACK":"FORWARD"};if(x)x=!1;else{const we=c();if(typeof document<"u"&&we.length){for(const I of we)if(await I.blockerFn({currentLocation:m,nextLocation:T,action:pe})){b=!0,t.history.go(1),A.notify(ke);return}}}m=p(),A.notify(ke)},M=T=>{if(j){j=!1;return}let B=!1;const te=c();if(typeof document<"u"&&te.length)for(const Y of te){const se=Y.enableBeforeUnload??!0;if(se===!0){B=!0;break}if(typeof se=="function"&&se()===!0){B=!0;break}}if(B)return T.preventDefault(),T.returnValue=""},A=W_({getLocation:S,getLength:()=>t.history.length,pushState:(T,B)=>R("push",T,B),replaceState:(T,B)=>R("replace",T,B),back:T=>(T&&(x=!0),j=!0,t.history.back()),forward:T=>{T&&(x=!0),j=!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(vb,M,{capture:!0}),t.removeEventListener(yb,L)},onBlocked:()=>{v&&m!==v&&(m=v)},getBlockers:c,setBlockers:d,notifyOnIndexChange:!1});return t.addEventListener(vb,M,{capture:!0}),t.addEventListener(yb,L),t.history.pushState=function(...T){const B=s.apply(t.history,T);return A._ignoreSubscribers||z("PUSH"),B},t.history.replaceState=function(...T){const B=a.apply(t.history,T);return A._ignoreSubscribers||z("REPLACE"),B},A}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)),w_(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=hS(f);v&&v!=="/"&&m.push(A_({basepath:f})),p&&m.push(p),this.rewrite=m.length===0?void 0:m.length===1?m[0]:R_(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:Lo(f).path,external:!1,searchStr:k,search:la(s?.search,C),hash:Lo(m.slice(1)).path,state:ha(s?.state,y)}}const b=new URL(v,this.origin),x=lm(this.rewrite,b),j=this.options.parseSearch(x.search),S=this.options.stringifySearch(j);return x.search=S,{href:x.href.replace(x.origin,""),publicHref:v,pathname:Lo(x.pathname).path,external:!!this.rewrite&&x.origin!==this.origin,searchStr:S,search:la(s?.search,j),hash:Lo(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 j=x.matchedRoutes;if((!x.foundRoute||x.foundRoute.path!=="/"&&x.routeParams["**"])&&this.options.notFoundRoute&&(j=[...j,this.options.notFoundRoute]),Object.keys(b).length>0)for(const B of j){const te=B.options.params?.stringify??B.options.stringifyParams;if(te)try{Object.assign(b,te(b))}catch{}}const S=t.leaveParams?y:Lo(lb({path:y,params:b,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let C=m;if(t._includeValidateSearch&&this.options.search?.strict){const B={};j.forEach(te=>{if(te.options.validateSearch)try{Object.assign(B,tu(te.options.validateSearch,{...B,...C}))}catch{}}),C=B}C=oz({search:C,dest:r,destRoutes:j,_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,R=E?`#${E}`:"";let z=r.state===!0?c.state:r.state?zi(r.state,c.state):{};z=ha(c.state,z);const L=`${S}${k}${R}`;let M,A,T=!1;if(this.rewrite){const B=new URL(L,this.origin),te=mS(this.rewrite,B);M=B.href.replace(B.origin,""),te.origin!==this.origin?(A=te.href,T=!0):A=te.pathname+te.search+te.hash}else M=t_(L),A=M;return{publicHref:A,href:M,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=Rr(()=>{d?.resolve(),d=void 0}),c&&r())this.load();else{let{maskedLocation:f,hashScrollIntoView:p,...m}=a;f&&(m={...f,state:{...f.state,__tempKey:void 0,__tempLocation:{...m,search:m.searchStr,state:{...m.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(m.unmaskOnReload??this.options.unmaskOnReload??!1)&&(m.state.__tempKey=this.tempLocationKey)),m.state.__hashScrollIntoViewOptions=p??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=t,this.history[a.replace?"replace":"push"](m.publicHref,m.state,{ignoreBlocker:s})}return this.resetNextScroll=a.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:t,resetScroll:s,hashScrollIntoView:a,viewTransition:r,ignoreBlocker:c,href:d,...f}={})=>{if(d){const 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 pb({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=[];Fo(()=>{this.__store.setState(j=>{const S=j.matches,C=j.pendingMatches||j.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)),{...j,isLoading:!1,loadedAt:Date.now(),matches:C,pendingMatches:void 0,cachedMatches:[...j.cachedMatches,...v.filter(k=>k.status!=="error"&&k.status!=="notFound"&&k.status!=="redirected")]}}),this.clearExpiredCache()}),[[y,"onLeave"],[b,"onEnter"],[x,"onStay"]].forEach(([j,S])=>{j.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=Wo,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)]);Fo(()=>{a.forEach(d=>{c.has(d.id)||this.__store.setState(f=>({...f,cachedMatches:[...f.cachedMatches,d]}))})});try{return a=await pb({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 j,S,C;{const pe=x?.search??e.search,ke=x?._strictSearch??void 0;try{const we=tu(b.options.validateSearch,{...pe})??void 0;j={...pe,...we},S={...ke,...we},C=void 0}catch(we){let I=we;if(we instanceof yu||(I=new yu(we.message,{cause:we})),t?.throwOnError)throw I;j=pe,S={},C=I}}const k=b.options.loaderDeps?.({search:j})??"",E=k?JSON.stringify(k):"",{interpolatedPath:R,usedParams:z}=lb({path:b.fullPath,params:r,decoder:this.pathParamsDecoder,server:this.isServer}),L=b.id+R+E,M=this.getMatch(L),A=v.get(b.id),T=M?._strictParams??z;let B;if(!M)try{xb(b,z,c,T)}catch(pe){if(dn(pe)||xn(pe)?B=pe:B=new iz(pe.message,{cause:pe}),t?.throwOnError)throw B}Object.assign(r,T);const te=A?"stay":"enter";let Y;if(M)Y={...M,cause:te,params:A?.params??r,_strictParams:T,search:la(A?A.search:M.search,j),_strictSearch:S};else{const pe=b.options.loader||b.options.beforeLoad||b.lazyFn||jS(b)?"pending":"success";Y={id:L,ssr:b.options.ssr,index:y,routeId:b.id,params:A?.params??r,_strictParams:T,pathname:R,updatedAt:Date.now(),search:A?la(A.search,j):j,_strictSearch:S,searchError:void 0,status:pe,isFetching:!1,error:void 0,paramsError:B,__routeContext:void 0,_nonReactive:{loadPromise:Rr()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:te,loaderDeps:A?ha(A.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||(Y.globalNotFound=p===b.id),Y.searchError=C;const se=this.getParentContext(x);Y.context={...se,...Y.__routeContext,...Y.__beforeLoadContext},m[y]=Y}for(let y=0;y<m.length;y++){const b=m[y],x=this.looseRoutesById[b.routeId],j=this.getMatch(b.id),S=v.get(b.routeId);if(b.params=S?la(S.params,r):r,!j){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:R=>this.navigate({...R,_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=Jo(t),c={...e.search};for(const m of t)try{Object.assign(c,tu(m.options.validateSearch,c))}catch{}const d=Jo(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{xb(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 xb(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! ☝️",NS=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=fS(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 NS{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 CS()?l.jsx(ss.Fragment,{children:e}):l.jsx(ss.Fragment,{children:t})}function CS(){return ss.useSyncExternalStore(mz,()=>!0,()=>!1)}function mz(){return()=>{}}var kS=N.createContext(null);function Kn(e){const t=N.useContext(kS);return e?.warn,t}var zh={exports:{}},Eh={},Rh={exports:{}},Ah={};var Sb;function pz(){if(Sb)return Ah;Sb=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(),j=a({inst:{value:x,getSnapshot:b}}),S=j[0].inst,C=j[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 Ah.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:v,Ah}var wb;function gz(){return wb||(wb=1,Rh.exports=pz()),Rh.exports}var jb;function yz(){if(jb)return Eh;jb=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 j=c(null);if(j.current===null){var S={hasValue:!1,value:null};j.current=S}else S=j.current;j=f(function(){function k(M){if(!E){if(E=!0,R=M,M=b(M),x!==void 0&&S.hasValue){var A=S.value;if(x(A,M))return z=A}return z=M}if(A=z,a(R,M))return A;var T=b(M);return x!==void 0&&x(A,T)?(R=M,A):(R=M,z=T)}var E=!1,R,z,L=y===void 0?null:y;return[function(){return k(v())},L===null?void 0:function(){return k(L())}]},[v,y,b,x]);var C=r(m,j[0],j[1]);return d(function(){S.hasValue=!0,S.value=C},[C]),p(C),C},Eh}var Nb;function vz(){return Nb||(Nb=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),wz=N.createContext(void 0);function Ii(e){const t=N.useContext(e.from?wz: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=Gx();const jz=Fx(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:j,children:S,target:C,disabled:k,style:E,className:R,onClick:z,onBlur:L,onFocus:M,onMouseEnter:A,onMouseLeave:T,onTouchStart:B,ignoreBlocker:te,params:Y,search:se,hash:pe,state:ke,mask:we,reloadDocument:I,unsafeRelative:Z,from:oe,_fromLocation:q,...J}=e,O=CS(),G=Sn({select:ze=>{const Le=ze.matches[ze.matches.length-1];return{search:Le?.search,hash:ze.location.hash,path:Le?.pathname}},structuralSharing:!0}),ie=e.from,re=N.useMemo(()=>({...e,from:ie}),[s,G,ie,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),ce=N.useMemo(()=>s.buildLocation({...re}),[s,re]),he=ce.maskedLocation?ce.maskedLocation.publicHref:ce.publicHref,de=ce.maskedLocation?ce.maskedLocation.external:ce.external,De=N.useMemo(()=>Rz(he,de,s.history,k),[k,de,he,s.history]),ge=N.useMemo(()=>{if(De?.external)return du(De.href,s.protocolAllowlist)?void 0:De.href;if(!Az(f)&&!(typeof f!="string"||f.indexOf(":")===-1))try{return new URL(f),du(f,s.protocolAllowlist)?void 0:f}catch{}},[f,De,s.protocolAllowlist]),Ge=Sn({select:ze=>{if(ge)return!1;if(d?.exact){if(!h_(ze.location.pathname,ce.pathname,s.basepath))return!1}else{const Le=hu(ze.location.pathname,s.basepath),pt=hu(ce.pathname,s.basepath);if(!(Le.startsWith(pt)&&(Le.length===pt.length||Le[pt.length]==="/")))return!1}return(d?.includeSearch??!0)&&!va(ze.location.search,ce.search,{partial:!d?.exact,ignoreUndefined:!d?.explicitUndefined})?!1:d?.includeHash?O&&ze.location.hash===ce.hash:!0}}),st=Ge?zi(r,{})??Cz:Th,me=Ge?Th:zi(c,{})??Th,Xe=[R,st.className,me.className].filter(Boolean).join(" "),ut=(E||st.style||me.style)&&{...E,...st.style,...me.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({...re,_builtLocation:ce}).catch(ze=>{console.warn(ze),console.warn(uz)})},[s,re,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 Le=ze.currentTarget.getAttribute("target"),pt=C!==void 0?C:Le;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({...re,replace:y,resetScroll:x,hashScrollIntoView:v,startTransition:b,viewTransition:j,ignoreBlocker:te})}};if(ge)return{...J,ref:a,href:ge,...S&&{children:S},...C&&{target:C},...k&&{disabled:k},...E&&{style:E},...R&&{className:R},...z&&{onClick:z},...L&&{onBlur:L},...M&&{onFocus:M},...A&&{onMouseEnter:A},...T&&{onMouseLeave:T},...B&&{onTouchStart:B}};const le=ze=>{if(k||Vt!=="intent")return;if(!zt){xt();return}const Le=ze.currentTarget;if($o.has(Le))return;const pt=setTimeout(()=>{$o.delete(Le),xt()},zt);$o.set(Le,pt)},Pe=ze=>{k||Vt!=="intent"||xt()},Ie=ze=>{if(k||!Vt||!zt)return;const Le=ze.currentTarget,pt=$o.get(Le);pt&&(clearTimeout(pt),$o.delete(Le))};return{...J,...st,...me,href:De?.href,ref:a,onClick:mr([z,hn]),onBlur:mr([L,Ie]),onFocus:mr([M,le]),onMouseEnter:mr([A,le]),onMouseLeave:mr([T,Ie]),onTouchStart:mr([B,Pe]),disabled:!!k,target:C,...ut&&{style:ut},...Xe&&{className:Xe},...k&&kz,...Ge&&_z,...O&&nn&&zz}}var Th={},Cz={className:"active"},kz={role:"link","aria-disabled":!0},_z={"data-status":"active","aria-current":"page"},zz={"data-transitioning":"transitioning"},$o=new WeakMap,Ez={rootMargin:"100px"},mr=e=>t=>{for(const s of e)if(s){if(t.defaultPrevented)return;s(t)}};function Rz(e,t,s,a){if(!a)return t?{href:e,external:!0}:{href:s.createHref(e)||"/",external:!1}}function Az(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 NS{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 Cb(e){return typeof e=="object"?new kb(e,{silent:!0}).createRoute(e):new kb(e,{silent:!0}).createRoute}var kb=class{constructor(e,t){this.path=e,this.createRoute=s=>{const a=as(s);return a.isRoot=!1,a},this.silent=t?.silent}},_b=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 zb(e){return typeof e=="object"?new _b(e):t=>new _b({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 _S(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 zS=N.memo(function({matchId:t}){const s=Kn(),a=Sn({select:j=>{const S=j.matches.findIndex(k=>k.id===t),C=j.matches[S];return Ui(C),{routeId:C.routeId,ssr:C.ssr,_displayPending:C._displayPending,resetKey:j.loadedAt,parentRouteId:j.matches[S-1]?.routeId}},structuralSharing:!0}),r=s.routesById[a.routeId],c=r.options.pendingComponent??s.options.defaultPendingComponent,d=c?l.jsx(c,{}):null,f=r.options.errorComponent??s.options.defaultErrorComponent,p=r.options.onCatch??s.options.defaultOnCatch,m=r.isRoot?r.options.notFoundComponent??s.options.notFoundRoute?.options.component:r.options.notFoundComponent,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:(j,S)=>{if(dn(j))throw j;p?.(j,S)},children:l.jsx(x,{fallback:j=>{if(!m||j.routeId&&j.routeId!==a.routeId||!j.routeId&&!r.isRoot)throw j;return N.createElement(m,j)},children:v||a._displayPending?l.jsx(hz,{fallback:d,children:l.jsx(Eb,{matchId:t})}):l.jsx(Eb,{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 Eb=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=Rr();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)),_S(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 _S(t,r,void 0);if(!d)return null;const p=l.jsx(zS,{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=wh(c),f=c||s||r,p=wh(f),m=c||r,v=wh(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&&j_(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(zS,{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=Cb,globalThis.createLazyFileRoute=zb):typeof window<"u"&&(window.createFileRoute=Cb,window.createLazyFileRoute=zb);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(kS.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 Ri=[],Qz=0;const fm=new Set;function ES(){const e=[...Ri];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 Ri=[...Ri,r],ES(),setTimeout(()=>{RS(a)},s),a}function RS(e){const t=Ri.length;Ri=Ri.filter(s=>s.id!==e),Ri.length!==t&&ES()}function Jz(e){return fm.add(e),()=>{fm.delete(e)}}function Rb(){return Ri}function Xz(){return new Ik({defaultOptions:{queries:{staleTime:3e4,retry:1,refetchOnWindowFocus:!1}},mutationCache:new eS({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()),Ab=e=>{const t=e2(e);return t.charAt(0).toUpperCase()+t.slice(1)},AS=(...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:AS("lucide",r),...!c&&!t2(f)&&{"aria-hidden":"true"},...f},[...d.map(([m,v])=>N.createElement(m,v)),...Array.isArray(c)?c:[c]]));const jn=(e,t)=>{const s=N.forwardRef(({className:a,...r},c)=>N.createElement(s2,{ref:c,iconNode:t,className:AS(`lucide-${Wz(Ab(e))}`,`lucide-${e}`,a),...r}));return s.displayName=Ab(e),s};const i2=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Lu=jn("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=jn("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=jn("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=jn("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=jn("layout-dashboard",d2);const h2=[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]],m2=jn("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=jn("play",p2);const y2=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Tb=jn("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=jn("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=jn("rotate-ccw",x2);const w2=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],j2=jn("settings",w2);const N2=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],C2=jn("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=jn("triangle-alert",k2);const z2=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Mu=jn("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 Ob(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 R2(e,t){return e==="twice-daily"?"twice-daily":e.startsWith("weekly@")?`${e}@${t}`:`daily@${t}`}function A2(e,t){if(!e)return{freq:"custom",hour:6,customCron:t};if(e==="twice-daily")return{freq:"twice-daily",hour:6,customCron:""};const s=e.match(/^daily(?:@(\d+))?$/);if(s)return{freq:"daily",hour:s[1]?parseInt(s[1]):6,customCron:""};const a=e.match(/^(weekly@(?:mon|tue|wed|thu|fri|sat|sun))(?:@(\d+))?$/);return a?{freq:a[1],hour:a[2]?parseInt(a[2]):6,customCron:""}:{freq:"custom",hour:6,customCron:t}}function 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 Db(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=Db(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():Db(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 TS(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;TS(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(TS(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 OS(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=OS(e[t]))&&(a&&(a+=" "),a+=s)}else for(s in e)e[s]&&(a&&(a+=" "),a+=s);return a}function DS(){for(var e,t,s=0,a="",r=arguments.length;s<r;s++)(e=arguments[s])&&(t=OS(e))&&(a&&(a+=" "),a+=t);return a}const Lb=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Mb=DS,LS=(e,t)=>s=>{var a;if(t?.variants==null)return Mb(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=Lb(v)||Lb(y);return r[m][b]}),f=s&&Object.entries(s).reduce((m,v)=>{let[y,b]=v;return b===void 0||(m[y]=b),m},{}),p=t==null||(a=t.compoundVariants)===null||a===void 0?void 0:a.reduce((m,v)=>{let{class:y,className:b,...x}=v;return Object.entries(x).every(j=>{let[S,C]=j;return Array.isArray(C)?C.includes({...c,...f}[S]):{...c,...f}[S]===C})?[...m,y,b]:m},[]);return Mb(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}),MS=(e=new Map,t=null,s)=>({nextPart:e,validators:t,classGroupId:s}),bu="-",Ub=[],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 US(f,p,t)},getConflictingClassGroupIds:(d,f)=>{if(f){const p=a[d],m=s[d];return p?m?q2(m,p):p:m||Ub}return s[d]||Ub}}},US=(e,t,s)=>{if(e.length-t===0)return s.classGroupId;const r=e[t],c=s.nextPart.get(r);if(c){const m=US(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=MS();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:$S(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,$S(t,f),s,a)}},$S=(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=MS(),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="!",$b=":",tE=[],Pb=(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===$b){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 j=m&&m>p?m-p:void 0;return Pb(c,x,b,j)};if(t){const r=t+$b,c=a;a=d=>d.startsWith(r)?c(d.slice(r.length)):Pb(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:j,maybePostfixModifierPosition:S}=s(v);if(y){p=v+(p.length>0?" "+p:p);continue}let C=!!S,k=a(C?j.substring(0,S):j);if(!k){if(!C){p=v+(p.length>0?" "+p:p);continue}if(k=a(j),!k){p=v+(p.length>0?" "+p:p);continue}C=!1}const E=b.length===0?"":b.length===1?b[0]:c(b).join(":"),R=x?E+mm:E,z=R+k;if(d.indexOf(z)>-1)continue;d.push(z);const L=r(k,C);for(let M=0;M<L.length;++M){const A=L[M];d.push(R+A)}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=PS(s))&&(r&&(r+=" "),r+=a);return r},PS=e=>{if(typeof e=="string")return e;let t,s="";for(let a=0;a<e.length;a++)e[a]&&(t=PS(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},IS=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,BS=/^\((?:(\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)\(.+\)$/,ji=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),qS=()=>!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,FS,rp),ve=e=>IS.test(e),ua=e=>Bi(e,GS,gE),Ib=e=>Bi(e,zE,Oe),SE=e=>Bi(e,VS,qS),wE=e=>Bi(e,KS,rp),Bb=e=>Bi(e,HS,rp),jE=e=>Bi(e,ZS,vE),Mc=e=>Bi(e,QS,yE),be=e=>BS.test(e),Po=e=>_a(e,GS),NE=e=>_a(e,KS),qb=e=>_a(e,HS),CE=e=>_a(e,FS),kE=e=>_a(e,ZS),Uc=e=>_a(e,QS,!0),_E=e=>_a(e,VS,!0),Bi=(e,t,s)=>{const a=IS.exec(e);return a?a[1]?t(a[1]):s(a[2]):!1},_a=(e,t,s=!1)=>{const a=BS.exec(e);return a?a[1]?t(a[1]):s:!1},HS=e=>e==="position"||e==="percentage",ZS=e=>e==="image"||e==="url",FS=e=>e==="length"||e==="size"||e==="bg-size",GS=e=>e==="length",zE=e=>e==="number",KS=e=>e==="family-name",VS=e=>e==="number"||e==="weight",QS=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"),j=Gt("blur"),S=Gt("perspective"),C=Gt("aspect"),k=Gt("ease"),E=Gt("animate"),R=()=>["auto","avoid","all","avoid-page","page","left","right","column"],z=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],L=()=>[...z(),be,ve],M=()=>["auto","hidden","clip","visible","scroll"],A=()=>["auto","contain","none"],T=()=>[be,ve,p],B=()=>[ji,"full","auto",...T()],te=()=>[Ni,"none","subgrid",be,ve],Y=()=>["auto",{span:["full",Ni,be,ve]},Ni,be,ve],se=()=>[Ni,"auto",be,ve],pe=()=>["auto","min","max","fr",be,ve],ke=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],we=()=>["start","end","center","stretch","center-safe","end-safe"],I=()=>["auto",...T()],Z=()=>[ji,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...T()],oe=()=>[ji,"screen","full","dvw","lvw","svw","min","max","fit",...T()],q=()=>[ji,"screen","full","lh","dvh","lvh","svh","min","max","fit",...T()],J=()=>[e,be,ve],O=()=>[...z(),qb,Bb,{position:[be,ve]}],G=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ie=()=>["auto","cover","contain",CE,xE,{size:[be,ve]}],re=()=>[Oh,Po,ua],ce=()=>["","none","full",m,be,ve],he=()=>["",Oe,Po,ua],de=()=>["solid","dashed","dotted","double"],De=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ge=()=>[Oe,Oh,qb,Bb],Ge=()=>["","none",j,be,ve],st=()=>["none",Oe,be,ve],me=()=>["none",Oe,be,ve],Xe=()=>[Oe,be,ve],ut=()=>[ji,"full",...T()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[qs],breakpoint:[qs],color:[qS],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",ji,ve,be,C]}],container:["container"],columns:[{columns:[Oe,ve,be,f]}],"break-after":[{"break-after":R()}],"break-before":[{"break-before":R()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:L()}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:A()}],"overscroll-x":[{"overscroll-x":A()}],"overscroll-y":[{"overscroll-y":A()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:B()}],"inset-x":[{"inset-x":B()}],"inset-y":[{"inset-y":B()}],start:[{"inset-s":B(),start:B()}],end:[{"inset-e":B(),end:B()}],"inset-bs":[{"inset-bs":B()}],"inset-be":[{"inset-be":B()}],top:[{top:B()}],right:[{right:B()}],bottom:[{bottom:B()}],left:[{left:B()}],visibility:["visible","invisible","collapse"],z:[{z:[Ni,"auto",be,ve]}],basis:[{basis:[ji,"full","auto",f,...T()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Oe,ji,"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":te()}],"col-start-end":[{col:Y()}],"col-start":[{"col-start":se()}],"col-end":[{"col-end":se()}],"grid-rows":[{"grid-rows":te()}],"row-start-end":[{row:Y()}],"row-start":[{"row-start":se()}],"row-end":[{"row-end":se()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":pe()}],"auto-rows":[{"auto-rows":pe()}],gap:[{gap:T()}],"gap-x":[{"gap-x":T()}],"gap-y":[{"gap-y":T()}],"justify-content":[{justify:[...ke(),"normal"]}],"justify-items":[{"justify-items":[...we(),"normal"]}],"justify-self":[{"justify-self":["auto",...we()]}],"align-content":[{content:["normal",...ke()]}],"align-items":[{items:[...we(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...we(),{baseline:["","last"]}]}],"place-content":[{"place-content":ke()}],"place-items":[{"place-items":[...we(),"baseline"]}],"place-self":[{"place-self":["auto",...we()]}],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:I()}],mx:[{mx:I()}],my:[{my:I()}],ms:[{ms:I()}],me:[{me:I()}],mbs:[{mbs:I()}],mbe:[{mbe:I()}],mt:[{mt:I()}],mr:[{mr:I()}],mb:[{mb:I()}],ml:[{ml:I()}],"space-x":[{"space-x":T()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":T()}],"space-y-reverse":["space-y-reverse"],size:[{size:Z()}],"inline-size":[{inline:["auto",...oe()]}],"min-inline-size":[{"min-inline":["auto",...oe()]}],"max-inline-size":[{"max-inline":["none",...oe()]}],"block-size":[{block:["auto",...q()]}],"min-block-size":[{"min-block":["auto",...q()]}],"max-block-size":[{"max-block":["none",...q()]}],w:[{w:[f,"screen",...Z()]}],"min-w":[{"min-w":[f,"screen","none",...Z()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[d]},...Z()]}],h:[{h:["screen","lh",...Z()]}],"min-h":[{"min-h":["screen","lh","none",...Z()]}],"max-h":[{"max-h":["screen","lh",...Z()]}],"font-size":[{text:["base",s,Po,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,wE,t]}],"font-features":[{"font-features":[ve]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[r,be,ve]}],"line-clamp":[{"line-clamp":[Oe,"none",be,Ib]}],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:J()}],"text-color":[{text:J()}],"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:J()}],"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:O()}],"bg-repeat":[{bg:G()}],"bg-size":[{bg:ie()}],"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,jE]}],"bg-color":[{bg:J()}],"gradient-from-pos":[{from:re()}],"gradient-via-pos":[{via:re()}],"gradient-to-pos":[{to:re()}],"gradient-from":[{from:J()}],"gradient-via":[{via:J()}],"gradient-to":[{to:J()}],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:J()}],"border-color-x":[{"border-x":J()}],"border-color-y":[{"border-y":J()}],"border-color-s":[{"border-s":J()}],"border-color-e":[{"border-e":J()}],"border-color-bs":[{"border-bs":J()}],"border-color-be":[{"border-be":J()}],"border-color-t":[{"border-t":J()}],"border-color-r":[{"border-r":J()}],"border-color-b":[{"border-b":J()}],"border-color-l":[{"border-l":J()}],"divide-color":[{divide:J()}],"outline-style":[{outline:[...de(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Oe,be,ve]}],"outline-w":[{outline:["",Oe,Po,ua]}],"outline-color":[{outline:J()}],shadow:[{shadow:["","none",v,Uc,Mc]}],"shadow-color":[{shadow:J()}],"inset-shadow":[{"inset-shadow":["none",y,Uc,Mc]}],"inset-shadow-color":[{"inset-shadow":J()}],"ring-w":[{ring:he()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:J()}],"ring-offset-w":[{"ring-offset":[Oe,ua]}],"ring-offset-color":[{"ring-offset":J()}],"inset-ring-w":[{"inset-ring":he()}],"inset-ring-color":[{"inset-ring":J()}],"text-shadow":[{"text-shadow":["none",b,Uc,Mc]}],"text-shadow-color":[{"text-shadow":J()}],opacity:[{opacity:[Oe,be,ve]}],"mix-blend":[{"mix-blend":[...De(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":De()}],"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":J()}],"mask-image-linear-to-color":[{"mask-linear-to":J()}],"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":J()}],"mask-image-t-to-color":[{"mask-t-to":J()}],"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":J()}],"mask-image-r-to-color":[{"mask-r-to":J()}],"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":J()}],"mask-image-b-to-color":[{"mask-b-to":J()}],"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":J()}],"mask-image-l-to-color":[{"mask-l-to":J()}],"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":J()}],"mask-image-x-to-color":[{"mask-x-to":J()}],"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":J()}],"mask-image-y-to-color":[{"mask-y-to":J()}],"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":J()}],"mask-image-radial-to-color":[{"mask-radial-to":J()}],"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":J()}],"mask-image-conic-to-color":[{"mask-conic-to":J()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:O()}],"mask-repeat":[{mask:G()}],"mask-size":[{mask:ie()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",be,ve]}],filter:[{filter:["","none",be,ve]}],blur:[{blur:Ge()}],brightness:[{brightness:[Oe,be,ve]}],contrast:[{contrast:[Oe,be,ve]}],"drop-shadow":[{"drop-shadow":["","none",x,Uc,Mc]}],"drop-shadow-color":[{"drop-shadow":J()}],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":Ge()}],"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":L()}],rotate:[{rotate:st()}],"rotate-x":[{"rotate-x":st()}],"rotate-y":[{"rotate-y":st()}],"rotate-z":[{"rotate-z":st()}],scale:[{scale:me()}],"scale-x":[{"scale-x":me()}],"scale-y":[{"scale-y":me()}],"scale-z":[{"scale-z":me()}],"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:L()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ut()}],"translate-x":[{"translate-x":ut()}],"translate-y":[{"translate-y":ut()}],"translate-z":[{"translate-z":ut()}],"translate-none":["translate-none"],accent:[{accent:J()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:J()}],"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",...J()]}],"stroke-w":[{stroke:[Oe,Po,ua,Ib]}],stroke:[{stroke:["none",...J()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},RE=lE(EE);function Vn(...e){return RE(DS(e))}const AE=LS("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-zinc-400 focus-visible:ring-offset-2 focus-visible:ring-offset-black disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-zinc-50 text-black hover:bg-zinc-200",secondary:"border border-zinc-800 bg-zinc-950 text-zinc-100 hover:bg-zinc-900",ghost:"text-zinc-400 hover:bg-zinc-900 hover:text-zinc-50",outline:"border border-zinc-800 bg-transparent text-zinc-100 hover:bg-zinc-900",destructive:"bg-rose-600 text-white hover:bg-rose-700"},size:{default:"h-9 px-4",sm:"h-8 px-3 text-xs",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}}),ue=N.forwardRef(({className:e,variant:t,size:s,asChild:a=!1,...r},c)=>{const d=a?M2:"button";return l.jsx(d,{ref:c,className:Vn(AE({variant:t,size:s,className:e})),...r})});ue.displayName="Button";const TE=LS("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 YS({className:e,variant:t,...s}){return l.jsx("div",{className:Vn(TE({variant:t}),e),...s})}function Hb({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 el({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 JS(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(YS,{variant:s,children:t})}function $u({status:e}){return l.jsx(tt,{tone:JS(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,...j}=y,S=b?.[e]?.[p]||f,C=N.useMemo(()=>j,Object.values(j));return l.jsx(S.Provider,{value:C,children:x})};m.displayName=c+"Provider";function v(y,b){const x=b?.[e]?.[p]||f,j=N.useContext(x);if(j)return j;if(d!==void 0)return d;throw new Error(`\`${y}\` must be used within \`${c}\``)}return[m,v]}const r=()=>{const c=s.map(d=>N.createContext(d));return function(f){const p=f?.[e]||c;return N.useMemo(()=>({[`__scope${e}`]:{...f,[e]:p}}),[f,p])}};return r.scopeName=e,[a,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 tl=globalThis?.document?N.useLayoutEffect:()=>{},$E=Um[" useId ".trim().toString()]||(()=>{}),PE=0;function Dh(e){const[t,s]=N.useState($E());return tl(()=>{s(a=>a??String(PE++))},[e]),e||(t?`radix-${t}`:"")}var IE=Um[" useInsertionEffect ".trim().toString()]||tl;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 XS(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=XS(`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 nl(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=nl(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",eR="dismissableLayer.focusOutside",Zb,WS=N.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ew=N.forwardRef((e,t)=>{const{disableOutsidePointerEvents:s=!1,onEscapeKeyDown:a,onPointerDownOutside:r,onFocusOutside:c,onInteractOutside:d,onDismiss:f,...p}=e,m=N.useContext(WS),[v,y]=N.useState(null),b=v?.ownerDocument??globalThis?.document,[,x]=N.useState({}),j=ka(t,A=>y(A)),S=Array.from(m.layers),[C]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),k=S.indexOf(C),E=v?S.indexOf(v):-1,R=m.layersWithOutsidePointerEventsDisabled.size>0,z=E>=k,L=sR(A=>{const T=A.target,B=[...m.branches].some(te=>te.contains(T));!z||B||(r?.(A),d?.(A),A.defaultPrevented||f?.())},b),M=iR(A=>{const T=A.target;[...m.branches].some(te=>te.contains(T))||(c?.(A),d?.(A),A.defaultPrevented||f?.())},b);return JE(A=>{E===m.layers.size-1&&(a?.(A),!A.defaultPrevented&&f&&(A.preventDefault(),f()))},b),N.useEffect(()=>{if(v)return s&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(Zb=b.body.style.pointerEvents,b.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(v)),m.layers.add(v),Fb(),()=>{s&&m.layersWithOutsidePointerEventsDisabled.size===1&&(b.body.style.pointerEvents=Zb)}},[v,b,s,m]),N.useEffect(()=>()=>{v&&(m.layers.delete(v),m.layersWithOutsidePointerEventsDisabled.delete(v),Fb())},[v,m]),N.useEffect(()=>{const A=()=>x({});return document.addEventListener(pm,A),()=>document.removeEventListener(pm,A)},[]),l.jsx(Gs.div,{...p,ref:j,style:{pointerEvents:R?z?"auto":"none":void 0,...e.style},onFocusCapture:Li(e.onFocusCapture,M.onFocusCapture),onBlurCapture:Li(e.onBlurCapture,M.onBlurCapture),onPointerDownCapture:Li(e.onPointerDownCapture,L.onPointerDownCapture)})});ew.displayName=XE;var tR="DismissableLayerBranch",nR=N.forwardRef((e,t)=>{const s=N.useContext(WS),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})});nR.displayName=tR;function sR(e,t=globalThis?.document){const s=nl(e),a=N.useRef(!1),r=N.useRef(()=>{});return N.useEffect(()=>{const c=f=>{if(f.target&&!a.current){let p=function(){tw(WE,s,m,{discrete:!0})};const m={originalEvent:f};f.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=p,t.addEventListener("click",r.current,{once:!0})):p()}else t.removeEventListener("click",r.current);a.current=!1},d=window.setTimeout(()=>{t.addEventListener("pointerdown",c)},0);return()=>{window.clearTimeout(d),t.removeEventListener("pointerdown",c),t.removeEventListener("click",r.current)}},[t,s]),{onPointerDownCapture:()=>a.current=!0}}function iR(e,t=globalThis?.document){const s=nl(e),a=N.useRef(!1);return N.useEffect(()=>{const r=c=>{c.target&&!a.current&&tw(eR,s,{originalEvent:c},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,s]),{onFocusCapture:()=>a.current=!0,onBlurCapture:()=>a.current=!1}}function Fb(){const e=new CustomEvent(pm);document.dispatchEvent(e)}function tw(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",Gb={bubbles:!1,cancelable:!0},aR="FocusScope",nw=N.forwardRef((e,t)=>{const{loop:s=!1,trapped:a=!1,onMountAutoFocus:r,onUnmountAutoFocus:c,...d}=e,[f,p]=N.useState(null),m=nl(r),v=nl(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(R){if(x.paused||!f)return;const z=R.target;f.contains(z)?y.current=z:Ci(y.current,{select:!0})},C=function(R){if(x.paused||!f)return;const z=R.relatedTarget;z!==null&&(f.contains(z)||Ci(y.current,{select:!0}))},k=function(R){if(document.activeElement===document.body)for(const L of R)L.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){Vb.add(x);const S=document.activeElement;if(!f.contains(S)){const k=new CustomEvent(Lh,Gb);f.addEventListener(Lh,m),f.dispatchEvent(k),k.defaultPrevented||(rR(dR(sw(f)),{select:!0}),document.activeElement===S&&Ci(f))}return()=>{f.removeEventListener(Lh,m),setTimeout(()=>{const k=new CustomEvent(Mh,Gb);f.addEventListener(Mh,v),f.dispatchEvent(k),k.defaultPrevented||Ci(S??document.body,{select:!0}),f.removeEventListener(Mh,v),Vb.remove(x)},0)}}},[f,m,v,x]);const j=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,[R,z]=oR(E);R&&z?!S.shiftKey&&k===z?(S.preventDefault(),s&&Ci(R,{select:!0})):S.shiftKey&&k===R&&(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:j})});nw.displayName=aR;function rR(e,{select:t=!1}={}){const s=document.activeElement;for(const a of e)if(Ci(a,{select:t}),document.activeElement!==s)return}function oR(e){const t=sw(e),s=Kb(t,e),a=Kb(t.reverse(),e);return[s,a]}function sw(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 Kb(e,t){for(const s of e)if(!lR(s,{upTo:t}))return s}function lR(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function cR(e){return e instanceof HTMLInputElement&&"select"in e}function Ci(e,{select:t=!1}={}){if(e&&e.focus){const s=document.activeElement;e.focus({preventScroll:!0}),e!==s&&cR(e)&&t&&e.select()}}var Vb=uR();function uR(){let e=[];return{add(t){const s=e[0];t!==s&&s?.pause(),e=Qb(e,t),e.unshift(t)},remove(t){e=Qb(e,t),e[0]?.resume()}}}function Qb(e,t){const s=[...e],a=s.indexOf(t);return a!==-1&&s.splice(a,1),s}function dR(e){return e.filter(t=>t.tagName!=="A")}var fR="Portal",iw=N.forwardRef((e,t)=>{const{container:s,...a}=e,[r,c]=N.useState(!1);tl(()=>c(!0),[]);const d=s||r&&globalThis?.document?.body;return d?jz.createPortal(l.jsx(Gs.div,{...a,ref:t}),d):null});iw.displayName=fR;function hR(e,t){return N.useReducer((s,a)=>t[s][a]??s,e)}var Pu=e=>{const{present:t,children:s}=e,a=mR(t),r=typeof s=="function"?s({present:a.isPresent}):N.Children.only(s),c=ka(a.ref,pR(r));return typeof s=="function"||a.isPresent?N.cloneElement(r,{ref:c}):null};Pu.displayName="Presence";function mR(e){const[t,s]=N.useState(),a=N.useRef(null),r=N.useRef(e),c=N.useRef("none"),d=e?"mounted":"unmounted",[f,p]=hR(d,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return N.useEffect(()=>{const m=$c(a.current);c.current=f==="mounted"?m:"none"},[f]),tl(()=>{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]),tl(()=>{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 pR(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,s=t&&"isReactWarning"in t&&t.isReactWarning;return s?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,s=t&&"isReactWarning"in t&&t.isReactWarning,s?e.props.ref:e.props.ref||e.ref)}var Uh=0;function gR(){N.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Yb()),document.body.insertAdjacentElement("beforeend",e[1]??Yb()),Uh++,()=>{Uh===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Uh--}},[])}function Yb(){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 aw(e,t){var s={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(s[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,a=Object.getOwnPropertySymbols(e);r<a.length;r++)t.indexOf(a[r])<0&&Object.prototype.propertyIsEnumerable.call(e,a[r])&&(s[a[r]]=e[a[r]]);return s}function yR(e,t,s){if(s||arguments.length===2)for(var a=0,r=t.length,c;a<r;a++)(c||!(a in t))&&(c||(c=Array.prototype.slice.call(t,0,a)),c[a]=t[a]);return e.concat(c||Array.prototype.slice.call(t))}var nu="right-scroll-bar-position",su="width-before-scroll-bar",vR="with-scroll-bars-hidden",bR="--removed-body-scroll-bar-size";function $h(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function xR(e,t){var s=N.useState(function(){return{value:e,callback:t,facade:{get current(){return s.value},set current(a){var r=s.value;r!==a&&(s.value=a,s.callback(a,r))}}}})[0];return s.callback=t,s.facade}var SR=typeof window<"u"?N.useLayoutEffect:N.useEffect,Jb=new WeakMap;function wR(e,t){var s=xR(null,function(a){return e.forEach(function(r){return $h(r,a)})});return SR(function(){var a=Jb.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)})}Jb.set(s,e)},[e]),s}function jR(e){return e}function NR(e,t){t===void 0&&(t=jR);var s=[],a=!1,r={read:function(){if(a)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return s.length?s[s.length-1]:e},useMedium:function(c){var d=t(c,a);return s.push(d),function(){s=s.filter(function(f){return f!==d})}},assignSyncMedium:function(c){for(a=!0;s.length;){var d=s;s=[],d.forEach(c)}s={push:function(f){return c(f)},filter:function(){return s}}},assignMedium:function(c){a=!0;var d=[];if(s.length){var f=s;s=[],f.forEach(c),d=s}var p=function(){var 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 CR(e){e===void 0&&(e={});var t=NR(null);return t.options=bs({async:!0,ssr:!1},e),t}var rw=function(e){var t=e.sideCar,s=aw(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))};rw.isSideCarExport=!0;function kR(e,t){return e.useMedium(t),rw}var ow=CR(),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,j=e.noIsolation,S=e.inert,C=e.allowPinchZoom,k=e.as,E=k===void 0?"div":k,R=e.gapMode,z=aw(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),L=b,M=wR([s,t]),A=bs(bs({},z),r);return N.createElement(N.Fragment,null,v&&N.createElement(L,{sideCar:ow,removeScrollBar:m,shards:y,noRelative:x,noIsolation:j,inert:S,setCallbacks:c,allowPinchZoom:!!C,lockRef:s,gapMode:R}),d?N.cloneElement(N.Children.only(f),bs(bs({},A),{ref:M})):N.createElement(E,bs({},A,{className:p,ref:M}),f))});Iu.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Iu.classNames={fullWidth:su,zeroRight:nu};var _R=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function zR(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=_R();return t&&e.setAttribute("nonce",t),e}function ER(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function RR(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var AR=function(){var e=0,t=null;return{add:function(s){e==0&&(t=zR())&&(ER(t,s),RR(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},TR=function(){var e=AR();return function(t,s){N.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&s])}},lw=function(){var e=TR(),t=function(s){var a=s.styles,r=s.dynamic;return e(a,r),null};return t},OR={left:0,top:0,right:0,gap:0},Ih=function(e){return parseInt(e||"",10)||0},DR=function(e){var t=window.getComputedStyle(document.body),s=t[e==="padding"?"paddingLeft":"marginLeft"],a=t[e==="padding"?"paddingTop":"marginTop"],r=t[e==="padding"?"paddingRight":"marginRight"];return[Ih(s),Ih(a),Ih(r)]},LR=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return OR;var t=DR(e),s=document.documentElement.clientWidth,a=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,a-s+t[2]-t[0])}},MR=lw(),kr="data-scroll-locked",UR=function(e,t,s,a){var r=e.left,c=e.top,d=e.right,f=e.gap;return s===void 0&&(s="margin"),`
|
|
13
|
+
.`.concat(vR,` {
|
|
14
|
+
overflow: hidden `).concat(a,`;
|
|
15
|
+
padding-right: `).concat(f,"px ").concat(a,`;
|
|
16
|
+
}
|
|
17
|
+
body[`).concat(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(bR,": ").concat(f,`px;
|
|
48
|
+
}
|
|
49
|
+
`)},Xb=function(){var e=parseInt(document.body.getAttribute(kr)||"0",10);return isFinite(e)?e:0},$R=function(){N.useEffect(function(){return document.body.setAttribute(kr,(Xb()+1).toString()),function(){var e=Xb()-1;e<=0?document.body.removeAttribute(kr):document.body.setAttribute(kr,e.toString())}},[])},PR=function(e){var t=e.noRelative,s=e.noImportant,a=e.gapMode,r=a===void 0?"margin":a;$R();var c=N.useMemo(function(){return LR(r)},[r]);return N.createElement(MR,{styles:UR(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,IR=function(e){return e.tagName==="TEXTAREA"},cw=function(e,t){if(!(e instanceof Element))return!1;var s=window.getComputedStyle(e);return s[t]!=="hidden"&&!(s.overflowY===s.overflowX&&!IR(e)&&s[t]==="visible")},BR=function(e){return cw(e,"overflowY")},qR=function(e){return cw(e,"overflowX")},Wb=function(e,t){var s=t.ownerDocument,a=t;do{typeof ShadowRoot<"u"&&a instanceof ShadowRoot&&(a=a.host);var r=uw(e,a);if(r){var c=dw(e,a),d=c[1],f=c[2];if(d>f)return!0}a=a.parentNode}while(a&&a!==s.body);return!1},HR=function(e){var t=e.scrollTop,s=e.scrollHeight,a=e.clientHeight;return[t,s,a]},ZR=function(e){var t=e.scrollLeft,s=e.scrollWidth,a=e.clientWidth;return[t,s,a]},uw=function(e,t){return e==="v"?BR(t):qR(t)},dw=function(e,t){return e==="v"?HR(t):ZR(t)},FR=function(e,t){return e==="h"&&t==="rtl"?-1:1},GR=function(e,t,s,a,r){var c=FR(e,window.getComputedStyle(t).direction),d=c*a,f=s.target,p=t.contains(f),m=!1,v=d>0,y=0,b=0;do{if(!f)break;var x=dw(e,f),j=x[0],S=x[1],C=x[2],k=S-C-c*j;(j||k)&&uw(e,f)&&(y+=k,b+=j);var E=f.parentNode;f=E&&E.nodeType===Node.DOCUMENT_FRAGMENT_NODE?E.host:E}while(!p&&f!==document.body||p&&(t.contains(f)||t===f));return(v&&Math.abs(y)<1||!v&&Math.abs(b)<1)&&(m=!0),m},Ic=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},ex=function(e){return[e.deltaX,e.deltaY]},tx=function(e){return e&&"current"in e?e.current:e},KR=function(e,t){return e[0]===t[0]&&e[1]===t[1]},VR=function(e){return`
|
|
50
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
51
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
52
|
+
`)},QR=0,gr=[];function YR(e){var t=N.useRef([]),s=N.useRef([0,0]),a=N.useRef(),r=N.useState(QR++)[0],c=N.useState(lw)[0],d=N.useRef(e);N.useEffect(function(){d.current=e},[e]),N.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var S=yR([e.lockRef.current],(e.shards||[]).map(tx),!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,R="deltaX"in S?S.deltaX:E[0]-k[0],z="deltaY"in S?S.deltaY:E[1]-k[1],L,M=S.target,A=Math.abs(R)>Math.abs(z)?"h":"v";if("touches"in S&&A==="h"&&M.type==="range")return!1;var T=window.getSelection(),B=T&&T.anchorNode,te=B?B===M||B.contains(M):!1;if(te)return!1;var Y=Wb(A,M);if(!Y)return!0;if(Y?L=A:(L=A==="v"?"h":"v",Y=Wb(A,M)),!Y)return!1;if(!a.current&&"changedTouches"in S&&(R||z)&&(a.current=L),!L)return!0;var se=a.current||L;return GR(se,C,S,se==="h"?R:z)},[]),p=N.useCallback(function(S){var C=S;if(!(!gr.length||gr[gr.length-1]!==c)){var k="deltaY"in C?ex(C):Ic(C),E=t.current.filter(function(L){return L.name===C.type&&(L.target===C.target||C.target===L.shadowParent)&&KR(L.delta,k)})[0];if(E&&E.should){C.cancelable&&C.preventDefault();return}if(!E){var R=(d.current.shards||[]).map(tx).filter(Boolean).filter(function(L){return L.contains(C.target)}),z=R.length>0?f(C,R[0]):!d.current.noIsolation;z&&C.cancelable&&C.preventDefault()}}},[]),m=N.useCallback(function(S,C,k,E){var R={name:S,delta:C,target:k,should:E,shadowParent:JR(k)};t.current.push(R),setTimeout(function(){t.current=t.current.filter(function(z){return z!==R})},1)},[]),v=N.useCallback(function(S){s.current=Ic(S),a.current=void 0},[]),y=N.useCallback(function(S){m(S.type,ex(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,j=e.inert;return N.createElement(N.Fragment,null,j?N.createElement(c,{styles:VR(r)}):null,x?N.createElement(PR,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function JR(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const XR=kR(ow,YR);var fw=N.forwardRef(function(e,t){return N.createElement(Iu,bs({},e,{ref:t,sideCar:XR}))});fw.classNames=Iu.classNames;var WR=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,hw=function(e){return e&&(e.host||hw(e.parentNode))},eA=function(e,t){return t.map(function(s){if(e.contains(s))return s;var a=hw(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})},tA=function(e,t,s,a){var r=eA(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),j=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&&j&&Bc.set(b,!0),C===1&&b.setAttribute(s,"true"),j||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={})}},nA=function(e,t,s){s===void 0&&(s="data-aria-hidden");var a=Array.from(Array.isArray(e)?e:[e]),r=WR(e);return r?(a.push.apply(a,Array.from(r.querySelectorAll("[aria-live], script"))),tA(a,r,s,"aria-hidden")):function(){return null}},Bu="Dialog",[mw]=ME(Bu),[sA,rs]=mw(Bu),pw=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(sA,{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})};pw.displayName=Bu;var gw="DialogTrigger",iA=N.forwardRef((e,t)=>{const{__scopeDialog:s,...a}=e,r=rs(gw,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)})});iA.displayName=gw;var op="DialogPortal",[aA,yw]=mw(op,{forceMount:void 0}),vw=e=>{const{__scopeDialog:t,forceMount:s,children:a,container:r}=e,c=rs(op,t);return l.jsx(aA,{scope:t,forceMount:s,children:N.Children.map(a,d=>l.jsx(Pu,{present:s||c.open,children:l.jsx(iw,{asChild:!0,container:r,children:d})}))})};vw.displayName=op;var Su="DialogOverlay",bw=N.forwardRef((e,t)=>{const s=yw(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(oA,{...r,ref:t})}):null});bw.displayName=Su;var rA=XS("DialogOverlay.RemoveScroll"),oA=N.forwardRef((e,t)=>{const{__scopeDialog:s,...a}=e,r=rs(Su,s);return l.jsx(fw,{as:rA,allowPinchZoom:!0,shards:[r.contentRef],children:l.jsx(Gs.div,{"data-state":cp(r.open),...a,ref:t,style:{pointerEvents:"auto",...a.style}})})}),ja="DialogContent",xw=N.forwardRef((e,t)=>{const s=yw(ja,e.__scopeDialog),{forceMount:a=s.forceMount,...r}=e,c=rs(ja,e.__scopeDialog);return l.jsx(Pu,{present:a||c.open,children:c.modal?l.jsx(lA,{...r,ref:t}):l.jsx(cA,{...r,ref:t})})});xw.displayName=ja;var lA=N.forwardRef((e,t)=>{const s=rs(ja,e.__scopeDialog),a=N.useRef(null),r=ka(t,s.contentRef,a);return N.useEffect(()=>{const c=a.current;if(c)return nA(c)},[]),l.jsx(Sw,{...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())})}),cA=N.forwardRef((e,t)=>{const s=rs(ja,e.__scopeDialog),a=N.useRef(!1),r=N.useRef(!1);return l.jsx(Sw,{...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()}})}),Sw=N.forwardRef((e,t)=>{const{__scopeDialog:s,trapFocus:a,onOpenAutoFocus:r,onCloseAutoFocus:c,...d}=e,f=rs(ja,s),p=N.useRef(null),m=ka(t,p);return gR(),l.jsxs(l.Fragment,{children:[l.jsx(nw,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:r,onUnmountAutoFocus:c,children:l.jsx(ew,{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(uA,{titleId:f.titleId}),l.jsx(fA,{contentRef:p,descriptionId:f.descriptionId})]})]})}),lp="DialogTitle",ww=N.forwardRef((e,t)=>{const{__scopeDialog:s,...a}=e,r=rs(lp,s);return l.jsx(Gs.h2,{id:r.titleId,...a,ref:t})});ww.displayName=lp;var jw="DialogDescription",Nw=N.forwardRef((e,t)=>{const{__scopeDialog:s,...a}=e,r=rs(jw,s);return l.jsx(Gs.p,{id:r.descriptionId,...a,ref:t})});Nw.displayName=jw;var Cw="DialogClose",kw=N.forwardRef((e,t)=>{const{__scopeDialog:s,...a}=e,r=rs(Cw,s);return l.jsx(Gs.button,{type:"button",...a,ref:t,onClick:Li(e.onClick,()=>r.onOpenChange(!1))})});kw.displayName=Cw;function cp(e){return e?"open":"closed"}var _w="DialogTitleWarning",[S4,zw]=LE(_w,{contentName:ja,titleName:lp,docsSlug:"dialog"}),uA=({titleId:e})=>{const t=zw(_w),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},dA="DialogDescriptionWarning",fA=({contentRef:e,descriptionId:t})=>{const a=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${zw(dA).contentName}}.`;return N.useEffect(()=>{const r=e.current?.getAttribute("aria-describedby");t&&r&&(document.getElementById(t)||console.warn(a))},[a,e,t]),null},Ew=pw,Rw=vw,up=bw,dp=xw,fp=ww,Aw=Nw,Tw=kw;const hA=Ew,mA=Rw,Ow=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}));Ow.displayName=up.displayName;const pA=400,gA=1200,yA=720,Dw=N.forwardRef(({className:e,children:t,...s},a)=>{const[r,c]=N.useState(yA),d=N.useRef(!1),f=N.useRef(0),p=N.useRef(0),m=N.useCallback(b=>{d.current=!0,f.current=b.clientX,p.current=r,b.target.setPointerCapture(b.pointerId),b.preventDefault()},[r]),v=N.useCallback(b=>{if(!d.current)return;const x=f.current-b.clientX,j=Math.min(gA,Math.max(pA,p.current+x));c(j)},[]),y=N.useCallback(()=>{d.current=!1},[]);return l.jsxs(mA,{children:[l.jsx(Ow,{}),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(Tw,{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"})]})]})]})});Dw.displayName=dp.displayName;const vA=({className:e,...t})=>l.jsx("div",{className:Vn("flex flex-col gap-1.5 pr-10",e),...t}),Lw=N.forwardRef(({className:e,...t},s)=>l.jsx(fp,{ref:s,className:Vn("text-lg font-medium text-zinc-50",e),...t}));Lw.displayName=fp.displayName;const Mw=N.forwardRef(({className:e,...t},s)=>l.jsx(Aw,{ref:s,className:Vn("text-sm text-zinc-500",e),...t}));Mw.displayName=Aw.displayName;function bA({title:e,subtitle:t,children:s,open:a,onClose:r}){return l.jsx(hA,{open:a,onOpenChange:c=>c?void 0:r(),children:l.jsxs(Dw,{children:[l.jsxs(vA,{className:"drawer-head",children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:t}),l.jsx(Lw,{id:"drawer-title",children:e}),l.jsx(Mw,{className:"sr-only",children:t})]}),l.jsx("div",{className:"drawer-body",children:s})]})})}function ee(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 Uw extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const $w={};function $i(e){return $w}function Pw(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 xA(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 nx=Symbol("evaluating");function nt(e,t,s){let a;Object.defineProperty(e,t,{get(){if(a!==nx)return a===void 0&&(a=nx,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 sx(e){return JSON.stringify(e)}function SA(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Iw="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function wu(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const wA=hp(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Ar(e){if(wu(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const s=t.prototype;return!(wu(s)===!1||Object.prototype.hasOwnProperty.call(s,"isPrototypeOf")===!1)}function Bw(e){return Ar(e)?{...e}:Array.isArray(e)?[...e]:e}const jA=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 je(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 NA(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const CA={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 kA(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 _A(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 zA(e,t){if(!Ar(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 EA(e,t){if(!Ar(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 RA(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 AA(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 TA(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 wr(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 sl(...e){const[t,s,a]=e;return typeof t=="string"?{message:t,code:"custom",input:s,inst:a}:{...t}}const qw=(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})},Hw=ee("$ZodError",qw),Zw=ee("$ZodError",qw,{Parent:Error});function OA(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 DA(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 Iw(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 Iw(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??Hw)(c.issues.map(d=>Pi(d,r,$i())))}:{success:!0,data:c.value}},LA=qu(Zw),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}},MA=Hu(Zw),UA=e=>(t,s,a)=>{const r=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return yp(e)(t,s,r)},$A=e=>(t,s,a)=>yp(e)(t,s,a),PA=e=>async(t,s,a)=>{const r=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return vp(e)(t,s,r)},IA=e=>async(t,s,a)=>vp(e)(t,s,a),BA=e=>(t,s,a)=>{const r=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return qu(e)(t,s,r)},qA=e=>(t,s,a)=>qu(e)(t,s,a),HA=e=>async(t,s,a)=>{const r=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Hu(e)(t,s,r)},ZA=e=>async(t,s,a)=>Hu(e)(t,s,a),FA=/^[cC][^\s-]{8,}$/,GA=/^[0-9a-z]+$/,KA=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,VA=/^[0-9a-vA-V]{20}$/,QA=/^[A-Za-z0-9]{27}$/,YA=/^[a-zA-Z0-9_-]{21}$/,JA=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,XA=/^([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})$/,ix=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)$/,WA=/^(?!\.)(?!.*\.\.)([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}=))?$/,Fw=/^[A-Za-z0-9_-]*$/,oT=/^\+[1-9]\d{6,14}$/,Gw="(?:(?:\\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(`^${Gw}$`);function Kw(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(`^${Kw(e)}$`)}function uT(e){const t=Kw({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(`^${Gw}T(?:${a})$`)}const dT=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},fT=/^-?\d+$/,Vw=/^-?\d+(?:\.\d+)?$/,hT=/^(?:true|false)$/i,mT=/^[^A-Z]*$/,pT=/^[^a-z]*$/,Nn=ee("$ZodCheck",(e,t)=>{var s;e._zod??(e._zod={}),e._zod.def=t,(s=e._zod).onattach??(s.onattach=[])}),Qw={number:"number",bigint:"bigint",object:"date"},Yw=ee("$ZodCheckLessThan",(e,t)=>{Nn.init(e,t);const s=Qw[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})}}),Jw=ee("$ZodCheckGreaterThan",(e,t)=>{Nn.init(e,t);const s=Qw[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=ee("$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):xA(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=ee("$ZodCheckNumberFormat",(e,t)=>{Nn.init(e,t),t.format=t.format||"float64";const s=t.format?.includes("int"),a=s?"int":"number",[r,c]=CA[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=ee("$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=ee("$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=ee("$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=ee("$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=ee("$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})}}),wT=ee("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=mT),Zu.init(e,t)}),jT=ee("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=pT),Zu.init(e,t)}),NT=ee("$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=ee("$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=ee("$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=ee("$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=ee("$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=LA(e,r);return c.success?{value:c.data}:{issues:c.error?.issues}}catch{return MA(e,r).then(d=>d.success?{value:d.data}:{issues:d.error?.issues})}},vendor:"zod",version:1}))}),bp=ee("$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=ee("$ZodStringFormat",(e,t)=>{Zu.init(e,t),bp.init(e,t)}),RT=ee("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=XA),bt.init(e,t)}),AT=ee("$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=ix(a))}else t.pattern??(t.pattern=ix());bt.init(e,t)}),TT=ee("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=WA),bt.init(e,t)}),OT=ee("$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=ee("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=tT()),bt.init(e,t)}),LT=ee("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=YA),bt.init(e,t)}),MT=ee("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=FA),bt.init(e,t)}),UT=ee("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=GA),bt.init(e,t)}),$T=ee("$ZodULID",(e,t)=>{t.pattern??(t.pattern=KA),bt.init(e,t)}),PT=ee("$ZodXID",(e,t)=>{t.pattern??(t.pattern=VA),bt.init(e,t)}),IT=ee("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=QA),bt.init(e,t)}),BT=ee("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=uT(t)),bt.init(e,t)}),qT=ee("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=lT),bt.init(e,t)}),HT=ee("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=cT(t)),bt.init(e,t)}),ZT=ee("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=JA),bt.init(e,t)}),FT=ee("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=nT),bt.init(e,t),e._zod.bag.format="ipv4"}),GT=ee("$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=ee("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=iT),bt.init(e,t)}),VT=ee("$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 Xw(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const QT=ee("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=rT),bt.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=s=>{Xw(s.value)||s.issues.push({code:"invalid_format",format:"base64",input:s.value,inst:e,continue:!t.abort})}});function YT(e){if(!Fw.test(e))return!1;const t=e.replace(/[-_]/g,a=>a==="-"?"+":"/"),s=t.padEnd(Math.ceil(t.length/4)*4,"=");return Xw(s)}const JT=ee("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Fw),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=ee("$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=ee("$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})}}),Ww=ee("$ZodNumber",(e,t)=>{St.init(e,t),e._zod.pattern=e._zod.bag.pattern??Vw,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=ee("$ZodNumberFormat",(e,t)=>{yT.init(e,t),Ww.init(e,t)}),nO=ee("$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=ee("$ZodUnknown",(e,t)=>{St.init(e,t),e._zod.parse=s=>s}),iO=ee("$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 ax(e,t,s){e.issues.length&&t.issues.push(...wr(s,e.issues)),t.value[s]=e.value}const aO=ee("$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=>ax(m,s,d))):ax(p,s,d)}return c.length?Promise.all(c).then(()=>s):s}});function ju(e,t,s,a,r){if(e.issues.length){if(r&&!(s in a))return;t.issues.push(...wr(s,e.issues))}e.value===void 0?s in a&&(t.value[s]=void 0):t.value[s]=e.value}function ej(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=NA(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(s)}}function tj(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=>ju(x,s,y,t,v))):ju(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=ee("$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(()=>ej(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=wu,c=t.catchall;let d;e._zod.parse=(f,p)=>{d??(d=a.value);const m=f.value;if(!r(m))return f.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),f;f.value={};const v=[],y=d.shape;for(const b of d.keys){const x=y[b],j=x._zod.optout==="optional",S=x._zod.run({value:m[b],issues:[]},p);S instanceof Promise?v.push(S.then(C=>ju(C,f,b,m,j))):ju(S,f,b,m,j)}return c?tj(v,m,f,p,a.value,e):v.length?Promise.all(v).then(()=>f):f}}),oO=ee("$ZodObjectJIT",(e,t)=>{rO.init(e,t);const s=e._zod.parse,a=hp(()=>ej(t)),r=b=>{const x=new zT(["shape","payload","ctx"]),j=a.value,S=R=>{const z=sx(R);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 R of j.keys)C[R]=`key_${k++}`;x.write("const newResult = {};");for(const R of j.keys){const z=C[R],L=sx(R),A=b[R]?._zod?.optout==="optional";x.write(`const ${z} = ${S(R)};`),A?x.write(`
|
|
59
|
+
if (${z}.issues.length) {
|
|
60
|
+
if (${L} in input) {
|
|
61
|
+
payload.issues = payload.issues.concat(${z}.issues.map(iss => ({
|
|
62
|
+
...iss,
|
|
63
|
+
path: iss.path ? [${L}, ...iss.path] : [${L}]
|
|
64
|
+
})));
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if (${z}.value === undefined) {
|
|
69
|
+
if (${L} in input) {
|
|
70
|
+
newResult[${L}] = undefined;
|
|
71
|
+
}
|
|
72
|
+
} else {
|
|
73
|
+
newResult[${L}] = ${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 ? [${L}, ...iss.path] : [${L}]
|
|
81
|
+
})));
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
if (${z}.value === undefined) {
|
|
85
|
+
if (${L} in input) {
|
|
86
|
+
newResult[${L}] = undefined;
|
|
87
|
+
}
|
|
88
|
+
} else {
|
|
89
|
+
newResult[${L}] = ${z}.value;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
`)}x.write("payload.value = newResult;"),x.write("return payload;");const E=x.compile();return(R,z)=>E(b,R,z)};let c;const d=wu,f=!$w.jitless,m=f&&wA.value,v=t.catchall;let y;e._zod.parse=(b,x)=>{y??(y=a.value);const j=b.value;return d(j)?f&&m&&x?.async===!1&&x.jitless!==!0?(c||(c=r(t.shape)),b=c(b,x),v?tj([],j,b,x,y,e):b):s(b,x):(b.issues.push({expected:"object",code:"invalid_type",input:j,inst:e}),b)}});function rx(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=ee("$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=>rx(p,r,e,c)):rx(f,r,e,c)}}),cO=ee("$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])=>ox(s,p,m)):ox(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(Ar(e)&&Ar(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 ox(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=ee("$ZodRecord",(e,t)=>{St.init(e,t),e._zod.parse=(s,a)=>{const r=s.value;if(!Ar(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(...wr(m,y.issues)),s.value[m]=y.value})):(v.issues.length&&s.issues.push(...wr(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"&&Vw.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(...wr(f,y.issues)),s.value[p.value]=y.value})):(v.issues.length&&s.issues.push(...wr(f,v.issues)),s.value[p.value]=v.value)}}return c.length?Promise.all(c).then(()=>s):s}}),dO=ee("$ZodEnum",(e,t)=>{St.init(e,t);const s=Pw(t.entries),a=new Set(s);e._zod.values=a,e._zod.pattern=new RegExp(`^(${s.filter(r=>jA.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=ee("$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=ee("$ZodTransform",(e,t)=>{St.init(e,t),e._zod.parse=(s,a)=>{if(a.direction==="backward")throw new Uw(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 lx(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const nj=ee("$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=>lx(c,s.value)):lx(r,s.value)}return s.value===void 0?s:t.innerType._zod.run(s,a)}}),mO=ee("$ZodExactOptional",(e,t)=>{nj.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=ee("$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=ee("$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=>cx(c,t)):cx(r,t)}});function cx(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const yO=ee("$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=ee("$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=>ux(c,e)):ux(r,e)}});function ux(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=ee("$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=ee("$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=ee("$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(dx):dx(r)}});function dx(e){return e.value=Object.freeze(e.value),e}const wO=ee("$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=>fx(c,s,a,e));fx(r,s,a,e)}});function fx(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(sl(r))}}var hx;class jO{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 jO}(hx=globalThis).__zod_globalRegistry??(hx.__zod_globalRegistry=NO());const Bo=globalThis.__zod_globalRegistry;function CO(e,t){return new e({type:"string",...je(t)})}function kO(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...je(t)})}function mx(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...je(t)})}function _O(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...je(t)})}function zO(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...je(t)})}function EO(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...je(t)})}function RO(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...je(t)})}function AO(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...je(t)})}function TO(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...je(t)})}function OO(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...je(t)})}function DO(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...je(t)})}function LO(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...je(t)})}function MO(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...je(t)})}function UO(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...je(t)})}function $O(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...je(t)})}function PO(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...je(t)})}function IO(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...je(t)})}function BO(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...je(t)})}function qO(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...je(t)})}function HO(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...je(t)})}function ZO(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...je(t)})}function FO(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...je(t)})}function GO(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...je(t)})}function KO(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...je(t)})}function VO(e,t){return new e({type:"string",format:"date",check:"string_format",...je(t)})}function QO(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...je(t)})}function YO(e,t){return new e({type:"string",format:"duration",check:"string_format",...je(t)})}function JO(e,t){return new e({type:"number",checks:[],...je(t)})}function XO(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...je(t)})}function WO(e,t){return new e({type:"boolean",...je(t)})}function eD(e){return new e({type:"unknown"})}function tD(e,t){return new e({type:"never",...je(t)})}function px(e,t){return new Yw({check:"less_than",...je(t),value:e,inclusive:!1})}function qh(e,t){return new Yw({check:"less_than",...je(t),value:e,inclusive:!0})}function gx(e,t){return new Jw({check:"greater_than",...je(t),value:e,inclusive:!1})}function Hh(e,t){return new Jw({check:"greater_than",...je(t),value:e,inclusive:!0})}function yx(e,t){return new gT({check:"multiple_of",...je(t),value:e})}function sj(e,t){return new vT({check:"max_length",...je(t),maximum:e})}function Nu(e,t){return new bT({check:"min_length",...je(t),minimum:e})}function ij(e,t){return new xT({check:"length_equals",...je(t),length:e})}function nD(e,t){return new ST({check:"string_format",format:"regex",...je(t),pattern:e})}function sD(e){return new wT({check:"string_format",format:"lowercase",...je(e)})}function iD(e){return new jT({check:"string_format",format:"uppercase",...je(e)})}function aD(e,t){return new NT({check:"string_format",format:"includes",...je(t),includes:e})}function rD(e,t){return new CT({check:"string_format",format:"starts_with",...je(t),prefix:e})}function oD(e,t){return new kT({check:"string_format",format:"ends_with",...je(t),suffix:e})}function Ur(e){return new _T({check:"overwrite",tx:e})}function lD(e){return Ur(t=>t.normalize(e))}function cD(){return Ur(e=>e.trim())}function uD(){return Ur(e=>e.toLowerCase())}function dD(){return Ur(e=>e.toUpperCase())}function fD(){return Ur(e=>SA(e))}function hD(e,t,s){return new e({type:"array",element:t,...je(s)})}function mD(e,t,s){return new e({type:"custom",check:"custom",fn:t,...je(s)})}function pD(e){const t=gD(s=>(s.addIssue=a=>{if(typeof a=="string")s.issues.push(sl(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(sl(r))}},e(s.value,s)));return t}function gD(e,t){const s=new Nn({check:"custom",...je(t)});return s._zod.check=e,s}function aj(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??Bo,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 rj(e,t){const s=e.seen.get(t);if(!s)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=new Map;for(const d of e.seen.entries()){const f=e.metadataRegistry.get(d[0])?.id;if(f){const p=a.get(f);if(p&&p!==d[0])throw new Error(`Duplicate schema id "${f}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);a.set(f,d[0])}}const r=d=>{const f=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const y=e.external.registry.get(d[0])?.id,b=e.external.uri??(j=>j);if(y)return{ref:b(y)};const x=d[1].defId??d[1].schema.id??`schema${e.counter++}`;return d[1].defId=x,{defId:x,ref:`${b("__shared")}#/${f}/${x}`}}if(d[1]===s)return{ref:"#"};const m=`#/${f}/`,v=d[1].schema.id??`__schema${e.counter++}`;return{defId:v,ref:m+v}},c=d=>{if(d[1].schema.$ref)return;const f=d[1],{ref:p,defId:m}=r(d);f.def={...f.schema},m&&(f.defId=m);const v=f.schema;for(const y in v)delete v[y];v.$ref=p};if(e.cycles==="throw")for(const d of e.seen.entries()){const f=d[1];if(f.cycle)throw new Error(`Cycle detected: #/${f.cycle?.join("/")}/<root>
|
|
93
|
+
|
|
94
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const d of e.seen.entries()){const f=d[1];if(t===d[0]){c(d);continue}if(e.external){const m=e.external.registry.get(d[0])?.id;if(t!==d[0]&&m){c(d);continue}}if(e.metadataRegistry.get(d[0])?.id){c(d);continue}if(f.cycle){c(d);continue}if(f.count>1&&e.reused==="ref"){c(d);continue}}}function oj(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=aj({...s,processors:t});return qt(e,a),rj(a,e),oj(a,e)},Cu=(e,t,s={})=>a=>{const{libraryOptions:r,target:c}=a??{},d=aj({...r??{},target:c,io:t,processors:s});return qt(e,d),rj(d,e),oj(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"},wD=(e,t,s,a)=>{s.not={}},jD=(e,t,s,a)=>{},ND=(e,t,s,a)=>{const r=e._zod.def,c=Pw(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)},RD=(e,t,s,a)=>{const r=e._zod.def,c=r.inclusive===!1,d=r.options.map((f,p)=>qt(f,t,{...a,path:[...a.path,c?"oneOf":"anyOf",p]}));c?s.oneOf=d:s.anyOf=d},AD=(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},lj=(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=ee("ZodISODateTime",(e,t)=>{BT.init(e,t),jt.init(e,t)});function BD(e){return KO(ID,e)}const qD=ee("ZodISODate",(e,t)=>{qT.init(e,t),jt.init(e,t)});function HD(e){return VO(qD,e)}const ZD=ee("ZodISOTime",(e,t)=>{HT.init(e,t),jt.init(e,t)});function FD(e){return QO(ZD,e)}const GD=ee("ZodISODuration",(e,t)=>{ZT.init(e,t),jt.init(e,t)});function KD(e){return YO(GD,e)}const VD=(e,t)=>{Hw.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:s=>DA(e,s)},flatten:{value:s=>OA(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=ee("ZodError",VD,{Parent:Error}),QD=yp(Qn),YD=vp(Qn),JD=qu(Qn),XD=Hu(Qn),WD=UA(Qn),eL=$A(Qn),tL=PA(Qn),nL=IA(Qn),sL=BA(Qn),iL=qA(Qn),aL=HA(Qn),rL=ZA(Qn),wt=ee("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(Ur(s)),e.optional=()=>xx(e),e.exactOptional=()=>BL(e),e.nullable=()=>Sx(e),e.nullish=()=>xx(Sx(e)),e.nonoptional=s=>KL(e,s),e.array=()=>Ye(e),e.or=s=>OL([e,s]),e.and=s=>LL(e,s),e.transform=s=>wx(e,PL(s)),e.default=s=>ZL(e,s),e.prefault=s=>GL(e,s),e.catch=s=>QL(e,s),e.pipe=s=>wx(e,s),e.readonly=()=>XL(e),e.describe=s=>{const a=e.clone();return Bo.add(a,{description:s}),a},Object.defineProperty(e,"description",{get(){return Bo.get(e)?.description},configurable:!0}),e.meta=(...s)=>{if(s.length===0)return Bo.get(e);const a=e.clone();return Bo.add(a,s[0]),a},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=s=>s(e),e)),cj=ee("_ZodString",(e,t)=>{bp.init(e,t),wt.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(sj(...a)),e.length=(...a)=>e.check(ij(...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=ee("ZodString",(e,t)=>{bp.init(e,t),cj.init(e,t),e.email=s=>e.check(kO(lL,s)),e.url=s=>e.check(AO(cL,s)),e.jwt=s=>e.check(GO(NL,s)),e.emoji=s=>e.check(TO(uL,s)),e.guid=s=>e.check(mx(vx,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(RO(Fc,s)),e.nanoid=s=>e.check(OO(dL,s)),e.guid=s=>e.check(mx(vx,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(wL,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(jL,s)),e.datetime=s=>e.check(BD(s)),e.date=s=>e.check(HD(s)),e.time=s=>e.check(FD(s)),e.duration=s=>e.check(KD(s))});function V(e){return CO(oL,e)}const jt=ee("ZodStringFormat",(e,t)=>{bt.init(e,t),cj.init(e,t)}),lL=ee("ZodEmail",(e,t)=>{TT.init(e,t),jt.init(e,t)}),vx=ee("ZodGUID",(e,t)=>{RT.init(e,t),jt.init(e,t)}),Fc=ee("ZodUUID",(e,t)=>{AT.init(e,t),jt.init(e,t)}),cL=ee("ZodURL",(e,t)=>{OT.init(e,t),jt.init(e,t)}),uL=ee("ZodEmoji",(e,t)=>{DT.init(e,t),jt.init(e,t)}),dL=ee("ZodNanoID",(e,t)=>{LT.init(e,t),jt.init(e,t)}),fL=ee("ZodCUID",(e,t)=>{MT.init(e,t),jt.init(e,t)}),hL=ee("ZodCUID2",(e,t)=>{UT.init(e,t),jt.init(e,t)}),mL=ee("ZodULID",(e,t)=>{$T.init(e,t),jt.init(e,t)}),pL=ee("ZodXID",(e,t)=>{PT.init(e,t),jt.init(e,t)}),gL=ee("ZodKSUID",(e,t)=>{IT.init(e,t),jt.init(e,t)}),yL=ee("ZodIPv4",(e,t)=>{FT.init(e,t),jt.init(e,t)}),vL=ee("ZodIPv6",(e,t)=>{GT.init(e,t),jt.init(e,t)}),bL=ee("ZodCIDRv4",(e,t)=>{KT.init(e,t),jt.init(e,t)}),xL=ee("ZodCIDRv6",(e,t)=>{VT.init(e,t),jt.init(e,t)}),SL=ee("ZodBase64",(e,t)=>{QT.init(e,t),jt.init(e,t)}),wL=ee("ZodBase64URL",(e,t)=>{JT.init(e,t),jt.init(e,t)}),jL=ee("ZodE164",(e,t)=>{XT.init(e,t),jt.init(e,t)}),NL=ee("ZodJWT",(e,t)=>{eO.init(e,t),jt.init(e,t)}),uj=ee("ZodNumber",(e,t)=>{Ww.init(e,t),wt.init(e,t),e._zod.processJSONSchema=(a,r,c)=>xD(e,a,r),e.gt=(a,r)=>e.check(gx(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(px(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(bx(a)),e.safe=a=>e.check(bx(a)),e.positive=a=>e.check(gx(0,a)),e.nonnegative=a=>e.check(Hh(0,a)),e.negative=a=>e.check(px(0,a)),e.nonpositive=a=>e.check(qh(0,a)),e.multipleOf=(a,r)=>e.check(yx(a,r)),e.step=(a,r)=>e.check(yx(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 dt(e){return JO(uj,e)}const CL=ee("ZodNumberFormat",(e,t)=>{tO.init(e,t),uj.init(e,t)});function bx(e){return XO(CL,e)}const kL=ee("ZodBoolean",(e,t)=>{nO.init(e,t),wt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>SD(e,s,a)});function ol(e){return WO(kL,e)}const _L=ee("ZodUnknown",(e,t)=>{sO.init(e,t),wt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>jD()});function bm(){return eD(_L)}const zL=ee("ZodNever",(e,t)=>{iO.init(e,t),wt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>wD(e,s,a)});function EL(e){return tD(zL,e)}const RL=ee("ZodArray",(e,t)=>{aO.init(e,t),wt.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(sj(s,a)),e.length=(s,a)=>e.check(ij(s,a)),e.unwrap=()=>e.element});function Ye(e,t){return hD(RL,e,t)}const AL=ee("ZodObject",(e,t)=>{oO.init(e,t),wt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>ED(e,s,a,r),nt(e,"shape",()=>t.shape),e.keyof=()=>wn(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=>zA(e,s),e.safeExtend=s=>EA(e,s),e.merge=s=>RA(e,s),e.pick=s=>kA(e,s),e.omit=s=>_A(e,s),e.partial=(...s)=>AA(dj,e,s[0]),e.required=(...s)=>TA(fj,e,s[0])});function Fe(e,t){const s={type:"object",shape:e??{},...je(t)};return new AL(s)}const TL=ee("ZodUnion",(e,t)=>{lO.init(e,t),wt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>RD(e,s,a,r),e.options=t.options});function OL(e,t){return new TL({type:"union",options:e,...je(t)})}const DL=ee("ZodIntersection",(e,t)=>{cO.init(e,t),wt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>AD(e,s,a,r)});function LL(e,t){return new DL({type:"intersection",left:e,right:t})}const ML=ee("ZodRecord",(e,t)=>{uO.init(e,t),wt.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,...je(s)})}const xm=ee("ZodEnum",(e,t)=>{dO.init(e,t),wt.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:[],...je(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:[],...je(r),entries:c})}});function wn(e,t){const s=Array.isArray(e)?Object.fromEntries(e.map(a=>[a,a])):e;return new xm({type:"enum",entries:s,...je(t)})}const UL=ee("ZodLiteral",(e,t)=>{fO.init(e,t),wt.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],...je(t)})}const $L=ee("ZodTransform",(e,t)=>{hO.init(e,t),wt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>_D(e,s),e._zod.parse=(s,a)=>{if(a.direction==="backward")throw new Uw(e.constructor.name);s.addIssue=c=>{if(typeof c=="string")s.issues.push(sl(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(sl(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 dj=ee("ZodOptional",(e,t)=>{nj.init(e,t),wt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>lj(e,s,a,r),e.unwrap=()=>e._zod.def.innerType});function xx(e){return new dj({type:"optional",innerType:e})}const IL=ee("ZodExactOptional",(e,t)=>{mO.init(e,t),wt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>lj(e,s,a,r),e.unwrap=()=>e._zod.def.innerType});function BL(e){return new IL({type:"optional",innerType:e})}const qL=ee("ZodNullable",(e,t)=>{pO.init(e,t),wt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>OD(e,s,a,r),e.unwrap=()=>e._zod.def.innerType});function Sx(e){return new qL({type:"nullable",innerType:e})}const HL=ee("ZodDefault",(e,t)=>{gO.init(e,t),wt.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():Bw(t)}})}const FL=ee("ZodPrefault",(e,t)=>{yO.init(e,t),wt.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():Bw(t)}})}const fj=ee("ZodNonOptional",(e,t)=>{vO.init(e,t),wt.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 fj({type:"nonoptional",innerType:e,...je(t)})}const VL=ee("ZodCatch",(e,t)=>{bO.init(e,t),wt.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=ee("ZodPipe",(e,t)=>{xO.init(e,t),wt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>$D(e,s,a,r),e.in=t.in,e.out=t.out});function wx(e,t){return new YL({type:"pipe",in:e,out:t})}const JL=ee("ZodReadonly",(e,t)=>{SO.init(e,t),wt.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=ee("ZodCustom",(e,t)=>{wO.init(e,t),wt.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)}Fe({maxConcurrency:dt().int().positive(),maxRequestsPerMinute:dt().int().positive(),maxRequestsPerDay:dt().int().positive()});const $r=V().min(1);V().min(1);const xp=Fe({label:V().min(1),city:V().min(1),region:V().min(1),country:V().length(2),timezone:V().optional()}),hj=wn(["citation.lost","citation.gained","run.completed","run.failed"]);Fe({id:V(),projectId:V(),channel:ku("webhook"),url:V().url(),events:Ye(hj),enabled:ol().default(!0),webhookSecret:V().optional(),createdAt:V(),updatedAt:V()});const mj=wn(["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}Fe({displayName:V().min(1),canonicalDomain:V().min(1),ownedDomains:Ye(V().min(1)).optional(),country:V().length(2),language:V().min(2),tags:Ye(V()).optional(),labels:Fu(V(),V()).optional(),providers:Ye($r).optional(),locations:Ye(xp).optional(),defaultLocation:V().nullable().optional(),configSource:mj.optional()});Fe({id:V(),name:V(),displayName:V().optional(),canonicalDomain:V(),ownedDomains:Ye(V()).default([]),country:V().length(2),language:V().min(2),tags:Ye(V()).default([]),labels:Fu(V(),V()).default({}),locations:Ye(xp).default([]),defaultLocation:V().nullable().optional(),configSource:mj.default("cli"),configRevision:dt().int().positive().default(1),createdAt:V().optional(),updatedAt:V().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=Fe({name:V().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(V(),V()).optional().default({})}),r5=Fe({preset:V().optional(),cron:V().optional(),timezone:V().optional().default("UTC"),providers:Ye($r).optional().default([])}).refine(e=>e.preset&&!e.cron||!e.preset&&e.cron,{message:'Exactly one of "preset" or "cron" must be provided'}).optional(),o5=Fe({channel:ku("webhook"),url:V().url(),events:Ye(hj).min(1)}),l5=Fe({gsc:Fe({propertyUrl:V()}).optional(),syncSchedule:Fe({preset:V().optional(),cron:V().optional()}).optional()}).optional(),c5=Fe({displayName:V().min(1),canonicalDomain:V().min(1),ownedDomains:Ye(V().min(1)).optional().default([]),country:V().length(2),language:V().min(2),keywords:Ye(V().min(1)).optional().default([]),competitors:Ye(V().min(1)).optional().default([]),providers:Ye($r).optional().default([]),locations:Ye(xp).optional().default([]),defaultLocation:V().optional(),schedule:r5,notifications:Ye(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"]})});Fe({apiVersion:ku("canonry/v1"),kind:ku("Project"),metadata:a5,spec:c5});const u5=wn(["gsc","ga4"]);Fe({id:V(),domain:V(),connectionType:u5,propertyId:V().nullable().optional(),sitemapUrl:V().nullable().optional(),scopes:Ye(V()).default([]),createdAt:V(),updatedAt:V()});Fe({date:V(),query:V(),page:V(),country:V().nullable().optional(),device:V().nullable().optional(),clicks:dt(),impressions:dt(),ctr:dt(),position:dt()});const wm=Fe({id:V(),url:V(),indexingState:V().nullable().optional(),verdict:V().nullable().optional(),coverageState:V().nullable().optional(),pageFetchState:V().nullable().optional(),robotsTxtState:V().nullable().optional(),crawlTime:V().nullable().optional(),lastCrawlResult:V().nullable().optional(),isMobileFriendly:ol().nullable().optional(),richResults:Ye(V()).default([]),inspectedAt:V()});wn(["stable","reindexed","deindexed","still-missing","new"]);const d5=Fe({url:V(),previousState:V().nullable(),currentState:V().nullable(),transitionDate:V()}),f5=Fe({reason:V(),count:dt(),urls:Ye(wm).default([])});Fe({summary:Fe({total:dt(),indexed:dt(),notIndexed:dt(),deindexed:dt(),percentage:dt()}),lastInspectedAt:V().nullable(),indexed:Ye(wm).default([]),notIndexed:Ye(wm).default([]),deindexed:Ye(d5).default([]),reasonGroups:Ye(f5).default([])});Fe({url:V(),type:wn(["URL_UPDATED","URL_DELETED"]),notifiedAt:V()});Fe({url:V(),type:wn(["URL_UPDATED","URL_DELETED"]),notifiedAt:V(),status:wn(["success","error"]),error:V().optional()});Fe({date:V(),indexed:dt(),notIndexed:dt(),reasonBreakdown:Fu(V(),dt()).default({})});Fe({id:V(),domain:V(),siteUrl:V().nullable().optional(),createdAt:V(),updatedAt:V()});const jx=Fe({id:V(),url:V(),httpCode:dt().nullable().optional(),inIndex:ol().nullable().optional(),lastCrawledDate:V().nullable().optional(),inIndexDate:V().nullable().optional(),inspectedAt:V()});Fe({summary:Fe({total:dt(),indexed:dt(),notIndexed:dt(),percentage:dt()}),lastInspectedAt:V().nullable(),indexed:Ye(jx).default([]),notIndexed:Ye(jx).default([])});Fe({query:V(),impressions:dt(),clicks:dt(),ctr:dt(),averagePosition:dt()});Fe({url:V(),status:wn(["success","error"]),submittedAt:V(),error:V().optional()});const h5=wn(["queued","running","completed","partial","failed","cancelled"]),m5=wn(["answer-visibility","site-audit","gsc-sync","inspect-sitemap"]),p5=wn(["manual","scheduled","config-apply"]),g5=wn(["cited","not-cited"]),y5=wn(["new","cited","lost","emerging","not-cited"]);Fe({id:V(),projectId:V(),kind:m5,status:h5,trigger:p5.default("manual"),location:V().nullable().optional(),startedAt:V().nullable().optional(),finishedAt:V().nullable().optional(),error:V().nullable().optional(),createdAt:V()});const v5=Fe({uri:V(),title:V()});Fe({id:V(),runId:V(),keywordId:V(),keyword:V().optional(),provider:$r,citationState:g5,transition:y5.optional(),answerText:V().nullable().optional(),citedDomains:Ye(V()).default([]),competitorOverlap:Ye(V()).default([]),groundingSources:Ye(v5).default([]),searchQueries:Ye(V()).default([]),model:V().nullable().optional(),location:V().nullable().optional(),createdAt:V()});Fe({id:V(),projectId:V().nullable().optional(),actor:V(),action:V(),entityType:V(),entityId:V().nullable().optional(),diff:bm().optional(),createdAt:V()});Fe({id:V(),projectId:V(),cronExpr:V(),preset:V().nullable().optional(),timezone:V().default("UTC"),enabled:ol().default(!0),providers:Ye($r).default([]),lastRunAt:V().nullable().optional(),nextRunAt:V().nullable().optional(),createdAt:V(),updatedAt:V()});Fe({preset:V().optional(),cron:V().optional(),timezone:V().optional().default("UTC"),enabled:ol().optional().default(!0),providers:Ye($r).optional().default([])}).refine(e=>e.preset&&!e.cron||!e.preset&&e.cron,{message:'Exactly one of "preset" or "cron" must be provided'});function jm({state:e}){return l.jsx(tt,{tone:OE(e),children:Uu(e)})}function Nx(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 pj 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 pj(c,a.status,d)}if(a.status!==204)return a.json()}function gj(){return xe("/projects")}function Sp(e){return xe(`/projects/${encodeURIComponent(e)}`)}function yj(){return xe("/runs")}function Or(e){return xe(`/runs/${encodeURIComponent(e)}`)}function vj(e){return xe(`/projects/${encodeURIComponent(e)}/keywords`)}function wp(e){return xe(`/projects/${encodeURIComponent(e)}/competitors`)}function jp(e,t){const s=new URLSearchParams;t!==void 0&&s.set("location",t);const a=s.toString();return xe(`/projects/${encodeURIComponent(e)}/timeline${a?`?${a}`:""}`)}function ll(e,t){return xe(`/projects/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}function bj(e,t){return xe(`/projects/${encodeURIComponent(e)}/keywords`,{method:"PUT",body:JSON.stringify({keywords:t})})}function xj(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 Sj(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 wj(e,t){return xe(`/projects/${encodeURIComponent(e)}/locations`,{method:"POST",body:JSON.stringify(t)})}async function jj(e,t){await xe(`/projects/${encodeURIComponent(e)}/locations/${encodeURIComponent(t)}`,{method:"DELETE"})}function Nj(e,t){return xe(`/projects/${encodeURIComponent(e)}/locations/default`,{method:"PUT",body:JSON.stringify({label:t})})}async function Cj(e){await xe(`/projects/${encodeURIComponent(e)}`,{method:"DELETE",body:"{}"})}function kj(e){return xe(`/projects/${encodeURIComponent(e)}/export`)}function Gu(){return xe("/settings")}function _j(e,t){return xe(`/settings/providers/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}function zj(e){return xe("/settings/google",{method:"PUT",body:JSON.stringify(e)})}async function Ej(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 Rj(e){await xe(`/projects/${encodeURIComponent(e)}/schedule`,{method:"DELETE",body:"{}"})}function Aj(e){return xe(`/projects/${encodeURIComponent(e)}/notifications`)}function Tj(e,t){return xe(`/projects/${encodeURIComponent(e)}/notifications`,{method:"POST",body:JSON.stringify(t)})}async function Oj(e,t){await xe(`/projects/${encodeURIComponent(e)}/notifications/${encodeURIComponent(t)}`,{method:"DELETE",body:"{}"})}function Dj(e,t){return xe(`/projects/${encodeURIComponent(e)}/notifications/${encodeURIComponent(t)}/test`,{method:"POST",body:"{}"})}function Lj(e,t,s){return xe(`/projects/${encodeURIComponent(e)}/keywords/generate`,{method:"POST",body:JSON.stringify({provider:t,count:s})})}function Mj(e){return xe("/apply",{method:"POST",body:JSON.stringify(e)})}function w5(e){return xe("/runs",{method:"POST",body:JSON.stringify(e??{})})}function kp(e){return xe(`/projects/${encodeURIComponent(e)}/google/connections`)}function Uj(e,t){return xe(`/projects/${encodeURIComponent(e)}/google/connect`,{method:"POST",body:JSON.stringify({type:t})})}function $j(e,t){return xe(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}`,{method:"DELETE",body:"{}"})}function Pj(e){return xe(`/projects/${encodeURIComponent(e)}/google/properties`)}function Ij(e,t,s){return xe(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}/property`,{method:"PUT",body:JSON.stringify({propertyId:s})})}function Bj(e,t,s){return xe(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}/sitemap`,{method:"PUT",body:JSON.stringify({sitemapUrl:s})})}function _p(e,t){return xe(`/projects/${encodeURIComponent(e)}/google/gsc/sync`,{method:"POST",body:JSON.stringify(t??{})})}function qj(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 Hj(e,t){return xe(`/projects/${encodeURIComponent(e)}/google/gsc/inspect`,{method:"POST",body:JSON.stringify({url:t})})}function Zj(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 Fj(e){return xe(`/projects/${encodeURIComponent(e)}/google/gsc/deindexed`)}function zp(e){return xe(`/projects/${encodeURIComponent(e)}/google/gsc/coverage`)}function Gj(e,t){const s=new URLSearchParams,a=s.toString()?`?${s.toString()}`:"";return xe(`/projects/${encodeURIComponent(e)}/google/gsc/coverage/history${a}`)}function Kj(e,t){return xe(`/projects/${encodeURIComponent(e)}/google/gsc/inspect-sitemap`,{method:"POST",body:JSON.stringify(t??{})})}function Vj(e){return xe(`/projects/${encodeURIComponent(e)}/google/gsc/sitemaps`)}function Qj(e){return xe(`/projects/${encodeURIComponent(e)}/google/gsc/discover-sitemaps`,{method:"POST",body:"{}"})}function km(){return xe("/cdp/status")}function Yj(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 Ep(e){return xe(`/projects/${encodeURIComponent(e)}/bing/status`)}function Jj(e,t){return xe(`/projects/${encodeURIComponent(e)}/bing/connect`,{method:"POST",body:JSON.stringify({apiKey:t})})}function Xj(e){return xe(`/projects/${encodeURIComponent(e)}/bing/disconnect`,{method:"DELETE",body:"{}"})}function Wj(e){return xe(`/projects/${encodeURIComponent(e)}/bing/sites`)}function eN(e,t){return xe(`/projects/${encodeURIComponent(e)}/bing/set-site`,{method:"POST",body:JSON.stringify({siteUrl:t})})}function Rp(e){return xe(`/projects/${encodeURIComponent(e)}/bing/coverage`)}function Ap(e,t){const s=new URLSearchParams,a=s.toString()?`?${s.toString()}`:"";return xe(`/projects/${encodeURIComponent(e)}/bing/inspections${a}`)}function Tp(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 j5=Object.freeze(Object.defineProperty({__proto__:null,ApiError:pj,addLocation:wj,addNotification:Tj,appendKeywords:xj,applyProjectConfig:Mj,bingConnect:Jj,bingDisconnect:Xj,bingRequestIndexing:zm,bingSetSite:eN,configureCdp:Yj,createProject:ll,deleteProject:Cj,fetchAllRuns:yj,fetchAnalyticsGaps:iN,fetchAnalyticsMetrics:sN,fetchAnalyticsSources:aN,fetchBingCoverage:Rp,fetchBingInspections:Ap,fetchBingPerformance:tN,fetchBingSites:Wj,fetchBingStatus:Ep,fetchCdpStatus:km,fetchCompetitors:wp,fetchExport:kj,fetchGoogleConnections:kp,fetchGoogleProperties:Pj,fetchGscCoverage:zp,fetchGscCoverageHistory:Gj,fetchGscDeindexed:Fj,fetchGscInspections:Zj,fetchGscPerformance:qj,fetchGscSitemaps:Vj,fetchKeywords:vj,fetchProject:Sp,fetchProjects:gj,fetchRunDetail:Or,fetchSchedule:Ej,fetchServiceStatus:rN,fetchSettings:Gu,fetchTimeline:jp,generateKeywords:Lj,googleConnect:Uj,googleDisconnect:$j,inspectBingUrl:Tp,inspectGscUrl:Hj,listNotifications:Aj,removeLocation:jj,removeNotification:Oj,removeSchedule:Rj,requestIndexing:_m,saveGoogleProperty:Ij,saveSchedule:Cm,saveSitemapUrl:Bj,sendTestNotification:Dj,setCompetitors:Np,setDefaultLocation:Nj,setKeywords:bj,triggerAllRuns:w5,triggerDiscoverSitemaps:Qj,triggerGscSync:_p,triggerInspectSitemap:Kj,triggerRun:Cp,updateBingApiKey:nN,updateGoogleAuthConfig:zj,updateOwnedDomains:Nm,updateProject:Sj,updateProviderConfig:_j},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),j=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},R=E.citationState==="cited"||E.citationState==="emerging",L=E.citedDomains.findIndex(Z=>j.has(Z.toLowerCase().replace(/^www\./,"")))+1,M=E.citedDomains.length,A=t.project.displayName||t.project.name,T=[...x.map(Sm),A,A.split(" ").slice(0,2).join(" ")].filter(Z=>Z.trim().length>2),B=R?"cited":E.citationState==="lost"?"lost":E.citationState==="pending"?"pending":"not-cited",te=N.useRef(0),Y=N.useCallback(async Z=>{const oe=++te.current;if(Z===-1||Z===S.length-1){d(-1),p(null),r(!1);return}d(Z),r(!1);const q=S[Z],J=`${q.runId}::${e.keyword}::${e.provider}`;if(y[J]){p(y[J]);return}v(!0);try{const O=await Or(q.runId);if(oe!==te.current)return;const G=O.snapshots.find(re=>re.keyword===e.keyword&&re.provider===e.provider)??O.snapshots.find(re=>re.keyword===e.keyword),ie=G?{citationState:G.citationState,provider:G.provider,model:G.model??null,answerSnippet:G.answerText??"",citedDomains:G.citedDomains,competitorDomains:G.competitorOverlap,groundingSources:G.groundingSources,evidenceUrls:[],changeLabel:q.citationState,summary:""}:{citationState:q.citationState,provider:e.provider,model:q.model??null,answerSnippet:"",citedDomains:[],competitorDomains:[],groundingSources:[],evidenceUrls:[],changeLabel:q.citationState,summary:"Snapshot data not available for this run."};b(re=>({...re,[J]:ie})),p(ie)}catch{if(oe!==te.current)return;p({citationState:q.citationState,provider:e.provider,model:q.model??null,answerSnippet:"",citedDomains:[],competitorDomains:[],groundingSources:[],evidenceUrls:[],changeLabel:q.citationState,summary:"Failed to load historical run data."})}finally{oe===te.current&&v(!1)}},[S,e.keyword,e.provider,y]),pe=(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(" · "):"",we=R&&L>0?{label:"Citation confirmed",title:`Cited #${L} of ${M} domain${M!==1?"s":""}`,meta:pe}:R?{label:"Citation confirmed",title:"Cited in this answer",meta:pe}:E.citationState==="lost"?{label:"Citation lost",title:M>0?`${M} domain${M!==1?"s":""} cited instead`:"No longer appearing in this answer",meta:pe}:E.citationState==="pending"?{label:"Pending",title:"Awaiting first visibility run",meta:"No provider data yet"}:{label:"Not in this answer",title:M>0?`${M} domain${M!==1?"s":""} cited instead`:"No domains cited for this query",meta:pe},I=()=>{if(!E.answerSnippet)return null;const Z=E.answerSnippet.split(`
|
|
95
|
+
`),oe=[];let q=[],J=0;const O=()=>{if(q.length===0)return;const G=q.join(" ").trim();G&&oe.push(l.jsx("p",{className:oe.length>0?"mt-2.5":"",children:Nx(G,T)},J++)),q=[]};for(const G of Z){const ie=G.trim();if(/^[-\u2013\u2014]{3,}$/.test(ie)){O(),oe.push(l.jsx("hr",{className:"border-zinc-800/60 my-3"},J++));continue}const re=ie.match(/^(#{1,3})\s+(.+)$/);if(re){O();const ce=re[1].length,he=re[2].replace(/^[\p{Emoji}\p{Emoji_Component}\s#]+/u,"").trim()||re[2],de=ce===1?"text-[13px] font-semibold text-zinc-100 mt-4 mb-1":ce===2?"text-xs font-semibold text-zinc-200 mt-3 mb-0.5":"text-xs font-medium text-zinc-300 mt-2";oe.push(l.jsx("p",{className:de,children:Nx(he,T)},J++));continue}if(ie===""){O();continue}q.push(ie)}return O(),oe};return l.jsx(Ew,{open:!0,onOpenChange:Z=>{Z||s()},children:l.jsxs(Rw,{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(Tw,{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((Z,oe)=>{const q=c===-1&&oe===S.length-1||c===oe,J=Z.citationState==="cited"?"bg-emerald-400":Z.citationState==="emerging"?"bg-amber-400":Z.citationState==="lost"?"bg-rose-400":"bg-zinc-600",G=new Date(Z.createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"}),ie=!!(Z.model&&oe>0&&S[oe-1]?.model&&S[oe-1].model!==Z.model);return l.jsxs("button",{type:"button",className:`evidence-run-dot ${q?"evidence-run-dot--selected":""}`,onClick:()=>Y(oe===S.length-1?-1:oe),"aria-label":[`Run ${G}: ${Z.citationState}`,Z.model?`model ${Z.model}`:null,ie?"model changed":null].filter(Boolean).join(" — "),"aria-pressed":q,children:[l.jsx("span",{className:`size-2 rounded-full ${J} ${ie?"ring-1 ring-amber-300/80 ring-offset-2 ring-offset-zinc-950":""}`,"aria-hidden":"true"}),l.jsx("span",{className:"text-[10px] text-zinc-500",children:G})]},oe)})}),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:()=>Y(-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(Z=>l.jsx("span",{className:"inline-flex items-center rounded-full border border-amber-400/30 bg-amber-400/10 px-2 py-1 text-[10px] text-amber-100",children:`${Z.fromModel??"unknown"} -> ${Z.toModel??"unknown"} on ${new Date(Z.createdAt).toLocaleDateString()}`},`${Z.runId}:${Z.toModel??"unknown"}`))})]}),l.jsxs("div",{className:"evidence-modal-body",children:[m&&l.jsx("div",{className:"md:col-span-2 flex items-center justify-center py-12 text-zinc-500 text-sm",children:"Loading historical run data\\u2026"}),!m&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"evidence-modal-main",children:[l.jsxs("div",{className:`evidence-position-hero evidence-position-hero--${B}`,children:[l.jsx("p",{className:`evidence-position-label evidence-position-label--${B}`,children:we.label}),l.jsx("p",{className:`evidence-position-title evidence-position-title--${B}`,children:we.title}),l.jsx("p",{className:"evidence-position-meta",children:we.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:I()}),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:R?"Why you're cited":"What to fix"}),l.jsx("div",{className:"action-items-list",children:e.relatedTechnicalSignals.map((Z,oe)=>l.jsxs("div",{className:"action-item",children:[l.jsx("svg",{className:`action-item-icon ${R?"text-emerald-400":"text-amber-400"}`,viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:R?l.jsx("path",{d:"M3 8l3.5 3.5L13 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}):l.jsxs(l.Fragment,{children:[l.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.5"}),l.jsx("path",{d:"M8 5v3.5M8 10.5v0",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}),l.jsx("span",{className:"action-item-text",children:Z})]},oe))})]}),E.summary&&l.jsx("p",{className:"text-xs text-zinc-600 border-t border-zinc-800/40 pt-3 mt-1",children:E.summary})]}),l.jsxs("div",{className:"evidence-modal-sidebar",children:[E.citedDomains.length>0&&l.jsxs("div",{children:[l.jsx("p",{className:"drawer-section-label",children:"Who was cited \\u2014 in order"}),l.jsxs("div",{className:"citation-leaderboard",children:[E.citedDomains.map((Z,oe)=>{const q=Z.toLowerCase().replace(/^www\./,""),J=j.has(q),O=!J&&E.competitorDomains.some(ie=>ie.toLowerCase().replace(/^www\./,"")===q),G=J?"you":O?"competitor":"other";return l.jsxs("div",{className:`citation-leaderboard-item citation-leaderboard-item--${G}`,children:[l.jsxs("span",{className:"citation-leaderboard-rank",children:["#",oe+1]}),l.jsx("span",{className:"citation-leaderboard-domain",children:Z}),J&&l.jsx("span",{className:"citation-leaderboard-tag",children:"You"}),O&&l.jsx("span",{className:"citation-leaderboard-tag",children:"Competitor"})]},Z)}),!R&&l.jsxs("div",{className:"citation-leaderboard-item citation-leaderboard-item--not-cited border-dashed",children:[l.jsx("span",{className:"citation-leaderboard-rank text-zinc-600",children:"\\u2014"}),l.jsx("span",{className:"citation-leaderboard-domain text-zinc-600",children:t.project.canonicalDomain}),l.jsx("span",{className:"citation-leaderboard-tag text-zinc-600",children:"Not cited"})]})]})]}),E.groundingSources.length>0&&l.jsxs("div",{children:[l.jsxs("p",{className:"drawer-section-label",children:["Grounding sources (",E.groundingSources.length,")"]}),l.jsx("ul",{className:"grid gap-0.5",children:E.groundingSources.map((Z,oe)=>l.jsx("li",{className:"truncate text-sm",children:l.jsx("a",{href:Z.uri,target:"_blank",rel:"noreferrer",className:"text-zinc-400 hover:text-zinc-200 transition-colors",children:Z.title||Z.uri})},oe))})]}),E.evidenceUrls.length>0&&l.jsxs("div",{children:[l.jsx("p",{className:"drawer-section-label",children:"Evidence URLs"}),l.jsx("ul",{className:"grid gap-1",children:E.evidenceUrls.map(Z=>l.jsx("li",{className:"truncate text-sm",children:l.jsx("a",{href:Z,target:"_blank",rel:"noreferrer",className:"text-zinc-400 hover:text-zinc-200 transition-colors",children:Z})},Z))})]}),E.citedDomains.length===0&&E.groundingSources.length===0&&E.evidenceUrls.length===0&&l.jsxs("div",{className:"flex items-center justify-center h-24 text-zinc-600 text-sm",children:["No citation data ",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 R5(e,t){return e.projects.find(s=>s.project.id===t)}function A5(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 Cx(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 Op(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?Cx(e.startedAt):Cx(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 j=f.get(`${m.keyword}::${x}`);if(!j&&p.length>1)continue;const S=j?.model??null,C=S?`${x}:${S}`:null,k=C?m.modelRuns?.[C]:void 0,E=m.providerRuns?.[x],R=(E?.length?E:null)??(k?.length?k:null),z=E?.length?"provider":k?.length?"model":"keyword",L=R?R.at(-1).transition:y,M=L==="lost"?"lost":L==="emerging"?"emerging":j?j.citationState==="cited"?"cited":"not-cited":b,A=Em(R||m.runs),T=I5(m,x),B=(R??m.runs).map(pe=>({runId:pe.runId,citationState:pe.citationState,createdAt:pe.createdAt,model:T.get(pe.runId)??null})),te=B5(B),Y=z==="provider"&&te.length<=1?"model":z,se=q5(B);r.push({id:`evidence_${e}_${c++}`,keyword:m.keyword,provider:j?.provider??x,model:j?.model??null,location:j?.location??null,citationState:M,changeLabel:H5(L,A),answerSnippet:j?.answerText??"",citedDomains:j?.citedDomains??[],evidenceUrls:[],competitorDomains:j?.competitorOverlap??[],relatedTechnicalSignals:[],groundingSources:j?.groundingSources??[],summary:Z5(M,m.keyword),runHistory:B,historyScope:Y,modelsSeen:te,modelTransitions:se})}}}for(const f of a)d.has(f.keyword)||r.push({id:`evidence_${e}_${c++}`,keyword:f.keyword,provider:"",model:null,location:null,citationState:"pending",changeLabel:"Awaiting first run",answerSnippet:"",citedDomains:[],evidenceUrls:[],competitorDomains:[],relatedTechnicalSignals:[],groundingSources:[],summary:`"${f.keyword}" has been added but no visibility run has been triggered yet.`,runHistory:[],historyScope:"keyword",modelsSeen:[],modelTransitions:[]});return r}function 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 kx(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=kx(a,c),v=kx(r,c);for(const k of c){const E=m.get(k)??new Set,R=v.get(k)??new Set,z=[...E].filter(L=>!R.has(L));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(L=>{const M=t.find(A=>A.keyword===L);return{keyword:L,evidenceId:M?.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=[],j=new Set;for(const[k,{transition:E,citationState:R}]of y){if(!(E==="emerging"||E==="new"&&R==="cited"))continue;j.add(k);const L=t.find(M=>M.keyword===k&&(M.citationState==="emerging"||M.citationState==="cited"));b.push({keyword:k,evidenceId:L?.id??"",provider:L?.provider,citationState:"emerging"})}for(const k of t)k.citationState==="emerging"&&(j.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 ${j.size} keyword${j.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(L=>L.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(L=>!E.has(L));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(L=>{const M=t.find(A=>A.keyword===L);return{keyword:L,evidenceId:M?.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=>Op(y,e.project.displayName||e.project.name)),m=new Map;for(const y of a){const b=y.provider||"gemini",x=y.model??null,j=`${b}::${x??"unknown"}`,S=m.get(j)??{provider:b,model:x,cited:0,total:0};S.total++,y.citationState==="cited"&&S.cited++,m.set(j,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:j})=>({provider:y,model:b,score:j>0?Math.round(x/j*100):0,cited:x,total:j}));return{project:t,dateRangeLabel:"All time",contextLabel:`${t.country} / ${t.language.toUpperCase()}`,visibilitySummary:{label:"Answer Visibility",value:a.length>0?`${r.score}`:"No data",delta:a.length>0?`${r.citedCount} of ${r.totalCount} key phrases visible`:"Run a sweep first",tone:a.length>0?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 j=[...x],S=new Set(a.map(E=>E.keyword).filter(Boolean)),C=S.size>0?j.length/S.size:0,k=C>=.5?"High":C>=.2?"Moderate":j.length>0?"Low":"None";return{id:y.id||`comp_${b}`,domain:y.domain,citationCount:j.length,totalKeywords:S.size,pressureLabel:k,citedKeywords:j,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?Op(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(Op(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 Ai={projects:{all:["projects"],detail:(e,t)=>["projects",e,t],keywords:e=>["projects",e,"keywords"],competitors:e=>["projects",e,"competitors"],timeline:(e,t)=>["projects",e,"timeline",t]},runs:{all:["runs"],detail:e=>["runs",e]},settings:["settings"],health:["health"]},fN=N.createContext(null);fN.Provider;function cl(){return N.useContext(fN)}function Ea(e){const s=cl()?.dashboard??null,a=Ho({queryKey:Ai.projects.all,queryFn:gj,enabled:!s}),r=Ho({queryKey:Ai.runs.all,queryFn:yj,enabled:!s,refetchInterval:j=>j.state.data?.some(k=>k.status==="running"||k.status==="queued")?3e3:!1}),c=Ho({queryKey:Ai.settings,queryFn:()=>Gu().catch(()=>null),enabled:!s}),d=a.data??[],f=r.data??[],p=Fk({queries:d.map(j=>{const S=f.filter(k=>k.projectId===j.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:Ai.projects.detail(j.id,C[0]?.id),queryFn:async()=>{const[k,E,R,z,L]=await Promise.all([vj(j.name).catch(()=>[]),wp(j.name).catch(()=>[]),jp(j.name).catch(()=>[]),C[0]?Or(C[0].id).catch(()=>null):Promise.resolve(null),C[1]?Or(C[1].id).catch(()=>null):Promise.resolve(null)]);return{project:j,runs:S,keywords:k,competitors:E,timeline:R,latestRunDetail:z,previousRunDetail:L}},enabled:!s&&a.isSuccess&&r.isSuccess}})}),m=p.every(j=>j.isSuccess),v=N.useMemo(()=>{if(s)return s;if(!a.data||!r.data||d.length>0&&!m)return null;const j=p.map(S=>S.data).filter(S=>S!=null);return Q5(j,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 _x=J5(),Rm=_x==="/"?"":_x.replace(/\/$/,"");async function X5(){const e=Rm?`${Rm}/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 Ho({queryKey:Ai.health,queryFn:X5,enabled:e,refetchInterval:15e3,initialData:t})}function W5(e){return Ho({queryKey:Ai.runs.detail(e??""),queryFn:()=>Or(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 zx=[{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"}],Ex=e=>({label:e,state:"checking",detail:"Checking service health"}),eM={apiStatus:Ex("API"),workerStatus:Ex("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),j=x.data??null,S=x.isLoading;N.useEffect(()=>{j&&j.status!=="running"&&j.status!=="queued"&&a()},[j?.status,a]),N.useEffect(()=>{b(!1)},[f.pathname]),N.useEffect(()=>{if(typeof window>"u"||!p&&!m)return;const z=L=>{L.key==="Escape"&&v()};return window.addEventListener("keydown",z),()=>{window.removeEventListener("keydown",z)}},[p,m,v]);const C=t??e?.dashboard??null,k=p&&C?A5(C,p):void 0,E=m&&C?T5(C,m):void 0,R=(()=>{const z=f.pathname;if(z==="/")return"Portfolio";if(z==="/projects")return"Projects";if(z==="/runs")return"Runs";if(z==="/settings")return"Settings";if(z==="/setup")return"Setup";if(z.startsWith("/projects/")){const M=z.split("/").filter(Boolean)[1];if(M&&C){const A=C.projects.find(T=>T.project.id===M);if(A)return A.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(Hb,{})}),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(j2,{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 L=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-${L}`}),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:zx.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(Hb,{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:R})]})]}),l.jsxs("div",{className:"topbar-actions",children:[l.jsxs("div",{className:"health-pill-row",children:[l.jsxs("span",{className:`health-pill health-pill-${d.apiStatus.state}`,children:["API ",d.apiStatus.state==="ok"?"ok":d.apiStatus.state]}),l.jsxs("span",{className:`health-pill health-pill-${d.workerStatus.state}`,children:["Worker ",d.workerStatus.state==="ok"?"ok":d.workerStatus.state]})]}),l.jsxs(ue,{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(ue,{className:"mobile-nav-close",variant:"ghost",size:"icon",type:"button",onClick:()=>b(!1),children:[l.jsx(Mu,{className:"size-5"}),l.jsx("span",{className:"sr-only",children:"Close navigation"})]}),l.jsx(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(L=>l.jsx("div",{className:"skeleton-text-sm w-full"},L))})]},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:zx.map(z=>l.jsx("a",{href:z.href,target:"_blank",rel:"noreferrer",children:z.label},z.href))})]})]}),k?l.jsxs(bA,{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..."}):j&&j.snapshots.length>0?l.jsxs("div",{className:"space-y-2",children:[j.snapshots.map(z=>l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 p-3",children:[l.jsxs("div",{className:"flex items-center justify-between gap-2 mb-1",children:[l.jsx("p",{className:"text-sm font-medium text-zinc-200 truncate",children:z.keyword??"Unknown key phrase"}),l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx(el,{provider:z.provider}),l.jsx(YS,{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((L,M)=>l.jsx("li",{className:"text-xs text-zinc-500 truncate",children:l.jsx("a",{href:L.uri,target:"_blank",rel:"noreferrer",className:"hover:text-zinc-300",children:L.title||L.uri})},M))})]}),z.answerText&&l.jsxs("details",{className:"mt-1",children:[l.jsx("summary",{className:"text-xs text-zinc-500 cursor-pointer hover:text-zinc-400",children:"Answer preview"}),l.jsx("p",{className:"mt-1 text-xs text-zinc-400 leading-relaxed whitespace-pre-wrap",children:z.answerText})]})]},z.id)),j.status==="running"&&l.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[l.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-amber-500 animate-pulse"}),"Querying remaining key phrases..."]})]}):j&&j.status==="running"?l.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[l.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-amber-500 animate-pulse"}),"Waiting for first key phrase result..."]}):j&&j.status==="queued"?l.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[l.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-zinc-500 animate-pulse"}),"Run queued, waiting for execution slot..."]}):j&&j.error?l.jsxs("div",{className:"rounded-lg border border-rose-800/40 bg-rose-950/20 p-3",children:[l.jsx("p",{className:"text-sm font-medium text-rose-300 mb-2",children:"Run failed"}),l.jsx("pre",{className:"text-xs text-rose-300/80 whitespace-pre-wrap break-words max-h-48 overflow-y-auto font-mono leading-5",children:E2(j.error)})]}):l.jsx("p",{className:"text-sm text-zinc-500",children:"No snapshot data available."})]})]}):null,E?l.jsx(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(ue,{variant:"secondary",size:"sm",onClick:this.handleReset,children:[l.jsx(S2,{className:"size-3.5 mr-1.5"}),"Try again"]}),l.jsx(ue,{variant:"secondary",size:"sm",onClick:()=>{window.location.href="/"},children:"Go home"})]})]})}):this.props.children}}const Me=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}));Me.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 j=c+x/Math.max(e.length-1,1)*m,S=c+(1-(b-d)/p)*v;return`${j},${S}`}).join(" ");return l.jsxs("svg",{className:`sparkline sparkline-${t}`,viewBox:`0 0 ${r} ${a}`,"aria-hidden":"true",children:[l.jsx("defs",{children:l.jsx("clipPath",{id:s,children:l.jsx("rect",{x:c,y:c,width:m,height: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:JS(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(Me,{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(ue,{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(Me,{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 Dp=Symbol.for("yaml.alias"),Am=Symbol.for("yaml.document"),Mi=Symbol.for("yaml.map"),hN=Symbol.for("yaml.pair"),xs=Symbol.for("yaml.scalar"),Pr=Symbol.for("yaml.seq"),Gn=Symbol.for("yaml.node.type"),Ra=e=>!!e&&typeof e=="object"&&e[Gn]===Dp,Qu=e=>!!e&&typeof e=="object"&&e[Gn]===Am,dl=e=>!!e&&typeof e=="object"&&e[Gn]===Mi,Dt=e=>!!e&&typeof e=="object"&&e[Gn]===hN,ft=e=>!!e&&typeof e=="object"&&e[Gn]===xs,fl=e=>!!e&&typeof e=="object"&&e[Gn]===Pr;function Tt(e){if(e&&typeof e=="object")switch(e[Gn]){case Mi:case Pr:return!0}return!1}function Ot(e){if(e&&typeof e=="object")switch(e[Gn]){case Dp:case Mi:case xs:case Pr:return!0}return!1}const mN=e=>(ft(e)||Tt(e))&&!!e.anchor,da=Symbol("break visit"),mM=Symbol("skip children"),Go=Symbol("remove node");function Ir(e,t){const s=pM(t);Qu(e)?jr(null,e.contents,s,Object.freeze([e]))===Go&&(e.contents=null):jr(null,e,s,Object.freeze([]))}Ir.BREAK=da;Ir.SKIP=mM;Ir.REMOVE=Go;function jr(e,t,s,a){const r=gM(e,t,s,a);if(Ot(r)||Dt(r))return yM(e,a,r),jr(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=jr(c,t.items[c],s,a);if(typeof d=="number")c=d-1;else{if(d===da)return da;d===Go&&(t.items.splice(c,1),c-=1)}}}else if(Dt(t)){a=Object.freeze(a.concat(t));const c=jr("key",t.key,s,a);if(c===da)return da;c===Go&&(t.key=null);const d=jr("value",t.value,s,a);if(d===da)return da;d===Go&&(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(ft(t))return s.Scalar?.(e,t,a);if(Ra(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=Ra(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={};Ir(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 Ir(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&&(ft(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 Lp{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 Mp extends Lp{constructor(t){super(Dp),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=[],Ir(t,{Node:(c,d)=>{(Ra(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(Ra(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 Re extends Lp{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)}}Re.BLOCK_FOLDED="BLOCK_FOLDED";Re.BLOCK_LITERAL="BLOCK_LITERAL";Re.PLAIN="PLAIN";Re.QUOTE_DOUBLE="QUOTE_DOUBLE";Re.QUOTE_SINGLE="QUOTE_SINGLE";const SM="tag:yaml.org,2002:";function wM(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 Mp(p.anchor);p={anchor:null,node:null},f.set(e,p)}t?.startsWith("!!")&&(t=SM+t.slice(2));let m=wM(e,t,d.tags);if(!m){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const y=new Re(e);return p&&(p.node=y),y}m=e instanceof Map?d[Mi]:Symbol.iterator in Object(e)?d[Pr]: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 Re(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 qo=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class bN extends Lp{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(qo(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&&ft(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&&ft(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 jM=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,j=!1,S=-1,C=-1,k=-1;s===Tm&&(S=Rx(e,S,t.length),S!==-1&&(y=S+p));for(let R;R=e[S+=1];){if(s===au&&R==="\\"){switch(C=S,e[S+1]){case"x":S+=3;break;case"u":S+=5;break;case"U":S+=9;break;default:S+=1}k=S}if(R===`
|
|
100
|
+
`)s===Tm&&(S=Rx(e,S,t.length)),y=S+t.length+p,b=void 0;else{if(R===" "&&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=R,R=e[S+=1],j=!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 j=!0}x=R}if(j&&f&&f(),m.length===0)return e;d&&d();let E=e.slice(0,m[0]);for(let R=0;R<m.length;++R){const z=m[R],L=m[R+1]||e.length;z===0?E=`
|
|
103
|
+
${t}${e.slice(0,L)}`:(s===au&&v[z]&&(E+=`${e[z]}\\`),E+=`
|
|
104
|
+
${t}${e.slice(z+1,L)}`)}return E}function Rx(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 Ko(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 Ko(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=Ko;else{const r=e.includes('"'),c=e.includes("'");r&&!c?a=Om:c&&!r?a=Ko:a=s?Om:Ko}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===Re.BLOCK_FOLDED?!1:t===Re.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 L=s[b-1];if(L!==`
|
|
117
|
+
`&&L!==" "&&L!==" ")break}let x=s.substring(b);const j=x.indexOf(`
|
|
118
|
+
`);j===-1?y="-":s===x||j!==x.length-1?(y="+",c&&c()):y="",x&&(s=s.slice(0,-x.length),x[x.length-1]===`
|
|
119
|
+
`&&(x=x.slice(0,-1)),x=x.replace(Dm,`$&${m}`));let S=!1,C,k=-1;for(C=0;C<s.length;++C){const L=s[C];if(L===" ")S=!0;else if(L===`
|
|
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 L=s.replace(/\n+/g,`
|
|
121
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${m}`);let M=!1;const A=Ju(a,!0);d!=="folded"&&t!==Re.BLOCK_FOLDED&&(A.onOverflow=()=>{M=!0});const T=Yu(`${E}${L}${x}`,m,Tm,A);if(!M)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!==Re.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:j}=t.doc.schema;if(j.some(b)||x?.some(b))return Cr(c,t)}return f?y:Yu(y,p,xN,Ju(t,!1))}function Up(e,t,s,a){const{implicitKey:r,inFlow:c}=t,d=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:f}=e;f!==Re.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(d.value)&&(f=Re.QUOTE_DOUBLE);const p=v=>{switch(v){case Re.BLOCK_FOLDED:case Re.BLOCK_LITERAL:return r||c?Cr(d.value,t):ru(d,t,s,a);case Re.QUOTE_DOUBLE:return Ko(d.value,t);case Re.QUOTE_SINGLE:return Om(d.value,t);case Re.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:jM,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(ft(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=(ft(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 Dr(e,t,s,a){if(Dt(e))return e.toString(t,s,a);if(Ra(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):ft(c)?Up(c,t,s,a):c.toString(t,s,a);return d?ft(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 A="With simple keys, collection cannot be used as a key value";throw new Error(A)}}let x=!y&&(!e||b&&t==null&&!s.inFlow||Tt(e)||(ft(e)?e.type===Re.BLOCK_FOLDED||e.type===Re.BLOCK_LITERAL:typeof e=="object"));s=Object.assign({},s,{allNullValues:!1,implicitKey:!x&&(y||!c),indent:f+p});let j=!1,S=!1,C=Dr(e,s,()=>j=!0,()=>S=!0);if(!x&&!s.inFlow&&C.length>1024){if(y)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");x=!0}if(s.inFlow){if(c||t==null)return j&&a&&a(),C===""?"?":x?`? ${C}`:C}else if(c&&!y||t==null&&x)return C=`? ${C}`,b&&!j?C+=ga(C,s.indent,m(b)):S&&r&&r(),C;j&&(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,R;Ot(t)?(k=!!t.spaceBefore,E=t.commentBefore,R=t.comment):(k=!1,E=null,R=null,t&&typeof t=="object"&&(t=d.createNode(t))),s.implicitKey=!1,!x&&!b&&ft(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 L=Dr(t,s,()=>z=!0,()=>S=!0);let M=" ";if(b||k||E){if(M=k?`
|
|
130
|
+
`:"",E){const A=m(E);M+=`
|
|
131
|
+
${Zs(A,s.indent)}`}L===""&&!s.inFlow?M===`
|
|
132
|
+
`&&R&&(M=`
|
|
133
|
+
|
|
134
|
+
`):M+=`
|
|
135
|
+
${s.indent}`}else if(!x&&Tt(t)){const A=L[0],T=L.indexOf(`
|
|
136
|
+
`),B=T!==-1,te=s.inFlow??t.flow??t.items.length===0;if(B||!te){let Y=!1;if(B&&(A==="&"||A==="!")){let se=L.indexOf(" ");A==="&"&&se!==-1&&se<T&&L[se+1]==="!"&&(se=L.indexOf(" ",se+1)),(se===-1||T<se)&&(Y=!0)}Y||(M=`
|
|
137
|
+
${s.indent}`)}}else(L===""||L[0]===`
|
|
138
|
+
`)&&(M="");return C+=M+L,s.inFlow?z&&a&&a():R&&!z?C+=ga(C,s.indent,m(R)):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 Re(Symbol(Gc)),{addToJSMap:wN}),stringify:()=>Gc},RM=(e,t)=>(Fs.identify(t)||ft(t)&&(!t.type||t.type===Re.PLAIN)&&Fs.identify(t.value))&&e?.doc.schema.tags.some(s=>s.tag===Fs.tag&&s.default);function wN(e,t,s){if(s=e&&Ra(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&&Ra(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 jN(e,t,{key:s,value:a}){if(Ot(s)&&s.addToJSMap)s.addToJSMap(e,t,a);else if(RM(e,s))wN(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=AM(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 AM(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 $p(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 jN(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 j=0;j<t.length;++j){const S=t[j];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=Dr(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 j=1;j<b.length;++j){const S=b[j];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 j=0;j<e.length;++j){const S=e[j];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 R=Ot(S.value)?S.value:null;R?(R.comment&&(C=R.comment),R.commentBefore&&(m=!0)):S.value==null&&E?.comment&&(C=E.comment)}C&&(m=!0);let k=Dr(S,p,()=>C=null);j<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 j=y.reduce((S,C)=>S+C.length+2,2);m=t.options.lineWidth>0&&j>t.options.lineWidth}if(m){let j=b;for(const S of y)j+=S?`
|
|
143
|
+
${c}${r}${S}`:`
|
|
144
|
+
`;return`${j}
|
|
145
|
+
${r}${x}`}else return`${b}${d}${y.join(" ")}${d}${x}`}function zu({indent:e,options:{commentString:t}},s,a,r){if(a&&r&&(a=a.replace(/^\n+/,"")),a){const c=Zs(t(a),e);s.push(c.trimStart())}}function ya(e,t){const s=ft(t)?t.value:t;for(const a of e)if(Dt(a)&&(a.key===t||a.key===s||ft(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($p(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`);ft(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&&ft(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)jN(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 Br={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(Pr,t),this.items=[]}add(t){this.items.push(t)}delete(t){const s=Kc(t);return typeof s!="number"?!1:this.items.splice(s,1).length>0}get(t,s){const a=Kc(t);if(typeof a!="number")return;const r=this.items[a];return!s&&ft(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];ft(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=ft(e)?e.value:e;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}const qr={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),Up(e,t,s,a)}},ed={identify:e=>e==null,createNode:()=>new Re(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Re(null),stringify:({source:e},t)=>typeof e=="string"&&ed.test.test(e)?e:t.options.nullStr},Pp={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new Re(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},s){if(e&&Pp.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 Re(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),Ip=(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)=>Ip(e,2,8,s),stringify:e=>zN(e,8,"0o")},RN={identify:td,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,s)=>Ip(e,0,10,s),stringify:os},AN={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)=>Ip(e,2,16,s),stringify:e=>zN(e,16,"0x")},DM=[Br,qr,Wu,ed,Pp,EN,RN,AN,CN,kN,_N];function Ax(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 Re(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Vc},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:Vc},{identify:Ax,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})=>Ax(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=[Br,qr].concat(LM,MM),Bp={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof atob=="function"){const s=atob(e.replace(/[\n\r]/g,"")),a=new Uint8Array(s.length);for(let r=0;r<s.length;++r)a[r]=s.charCodeAt(r);return a}else return t("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:t,value:s},a,r,c){if(!s)return"";const d=s;let f;if(typeof btoa=="function"){let p="";for(let m=0;m<d.length;++m)p+=String.fromCharCode(d[m]);f=btoa(p)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=Re.BLOCK_LITERAL),t!==Re.QUOTE_DOUBLE){const p=Math.max(a.options.lineWidth-a.indent.length,a.options.minContentWidth),m=Math.ceil(f.length/p),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===Re.BLOCK_LITERAL?`
|
|
146
|
+
`:" ")}return Up({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 Re(null));if(a.commentBefore&&(r.key.commentBefore=r.key.commentBefore?`${a.commentBefore}
|
|
147
|
+
${r.key.commentBefore}`:a.commentBefore),a.comment){const c=r.value??r.key;c.comment=c.comment?`${a.comment}
|
|
148
|
+
${c.comment}`:a.comment}a=r}e.items[s]=Dt(a)?a:new 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($p(f,p,s))}return r}const qp={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 Hp={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)ft(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 Re(!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 Re(!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 Re(parseFloat(e.replace(/_/g,""))),s=e.indexOf(".");if(s!==-1){const a=e.substring(s+1).replace(/_/g,"");a[a.length-1]==="0"&&(t.minFractionDigits=a.length)}return t},stringify: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 Zp(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=>Zp(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=>Zp(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=>Zp(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)?ft(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($p(d,null,a));return c}}Er.tag="tag:yaml.org,2002:set";const Fp={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 Gp(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})=>Gp(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=>Gp(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=Gp(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$/,"")??""},Tx=[Br,qr,Wu,ed,LN,MN,BM,qM,HM,ZM,$M,PM,IM,Bp,Fs,Hp,qp,Fp,$N,PN,sd],Ox=new Map([["core",DM],["failsafe",[Br,qr,Wu]],["json",UM],["yaml11",Tx],["yaml-1.1",Tx]]),Dx={binary:Bp,bool:Pp,float:_N,floatExp:kN,floatNaN:CN,floatTime:PN,int:RN,intHex:AN,intOct:EN,intTime:$N,map:Br,merge:Fs,null:ed,omap:Hp,pairs:qp,seq:qr,set:Fp,timestamp:sd},FM={"tag:yaml.org,2002:binary":Bp,"tag:yaml.org,2002:merge":Fs,"tag:yaml.org,2002:omap":Hp,"tag:yaml.org,2002:pairs":qp,"tag:yaml.org,2002:set":Fp,"tag:yaml.org,2002:timestamp":sd};function Kh(e,t,s){const a=Ox.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(Ox.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"?Dx[d]:d;if(!f){const p=JSON.stringify(d),m=Object.keys(Dx).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 Kp{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:Br}),Object.defineProperty(this,xs,{value:Wu}),Object.defineProperty(this,Pr,{value:qr}),this.sortMapEntries=typeof d=="function"?d:d===!0?GM:null}clone(){const t=Object.create(Kp.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=Dr(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(Dr(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:Am});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:Am}});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 Mp(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"),j={aliasDuplicateObjects:c??!0,keepUndefined:p??!1,onAnchor:y,onTagObj:m,replacer:r,schema:this.schema,sourceObjects:x},S=il(t,v,j);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 qo(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 qo(t)?!s&&ft(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 qo(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){qo(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 Kp(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 Lx=(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 Lr(e,{flow:t,indicator:s,next:a,offset:r,onError:c,parentIndent:d,startOnNewline:f}){let p=!1,m=f,v=f,y="",b="",x=!1,j=!1,S=null,C=null,k=null,E=null,R=null,z=null,L=null;for(const T of e)switch(j&&(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"),j=!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 B=T.source.substring(1)||" ";y?y+=b+B:y=B,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,L??(L=T.offset),m=!1,v=!1,j=!0;break;case"tag":{k&&c(T,"MULTIPLE_TAGS","A node can have at most one tag"),k=T,L??(L=T.offset),m=!1,v=!1,j=!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){R&&c(T,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),R=T,m=!1,v=!1;break}default:c(T,"UNEXPECTED_TOKEN",`Unexpected ${T.type} token`),m=!1,v=!1}const M=e[e.length-1],A=M?M.offset+M.source.length:r;return j&&a&&a.type!=="space"&&a.type!=="newline"&&a.type!=="comma"&&(a.type!=="scalar"||a.source!=="")&&c(a.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),S&&(m&&S.indent<=d||a?.type==="block-map"||a?.type==="block-seq")&&c(S,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:R,found:z,spaceBefore:p,comment:y,hasNewline:x,anchor:C,tag:k,newlineAfterProp:E,end:A,start:L??A}}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||ft(c)&&ft(d)&&c.value===d.value;return t.some(c=>r(c.key,s))}const Mx="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:j}=v,S=Lr(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",Mx)),!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",Mx);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 R=Lr(x??[],{indicator:"map-value-ind",next:j,offset:E.range[2],onError:r,parentIndent:a.indent,startOnNewline:!b||b.type==="block-scalar"});if(p=R.end,R.found){C&&(j?.type==="block-map"&&!R.hasNewline&&r(p,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),s.options.strict&&S.start<R.found.offset-1024&&r(E.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const z=j?e(s,j,R,r):t(s,p,x,null,R,r);s.schema.compat&&Lm(a.indent,j,r),p=z.range[2];const L=new fn(E,z);s.options.keepSourceTokens&&(L.srcToken=v),f.items.push(L)}else{C&&r(E.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),R.comment&&(E.comment?E.comment+=`
|
|
159
|
+
`+R.comment:E.comment=R.comment);const z=new 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=Lr(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:R,sep:z,value:L}=k,M=Lr(E,{flow:f,indicator:"explicit-key-ind",next:R??z?.[0],offset:y,onError:r,parentIndent:a.indent,startOnNewline:!1});if(!M.found){if(!M.anchor&&!M.tag&&!z&&!L){C===0&&M.comma?r(M.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${f}`):C<a.items.length-1&&r(M.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${f}`),M.comment&&(m.comment?m.comment+=`
|
|
160
|
+
`+M.comment:m.comment=M.comment),y=M.end;continue}!d&&s.options.strict&&al(R)&&r(R,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(C===0)M.comma&&r(M.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${f}`);else if(M.comma||r(M.start,"MISSING_CHAR",`Missing , between ${f} items`),M.comment){let A="";e:for(const T of E)switch(T.type){case"comma":case"space":break;case"comment":A=T.source.substring(1);break e;default:break e}if(A){let T=m.items[m.items.length-1];Dt(T)&&(T=T.value??T.key),T.comment?T.comment+=`
|
|
161
|
+
`+A:T.comment=A,M.comment=M.comment.substring(A.length+1)}}if(!d&&!z&&!M.found){const A=L?e(s,L,M,r):t(s,M.end,z,null,M,r);m.items.push(A),y=A.range[2],Qh(L)&&r(A.range,"BLOCK_IN_FLOW",Vh)}else{s.atKey=!0;const A=M.end,T=R?e(s,R,M,r):t(s,A,E,null,M,r);Qh(R)&&r(T.range,"BLOCK_IN_FLOW",Vh),s.atKey=!1;const B=Lr(z??[],{flow:f,indicator:"map-value-ind",next:L,offset:T.range[2],onError:r,parentIndent:a.indent,startOnNewline:!1});if(B.found){if(!d&&!M.found&&s.options.strict){if(z)for(const se of z){if(se===B.found)break;if(se.type==="newline"){r(se,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}M.start<B.found.offset-1024&&r(B.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else L&&("source"in L&&L.source?.[0]===":"?r(L,"MISSING_CHAR",`Missing space after : in ${f}`):r(B.start,"MISSING_CHAR",`Missing , or : between ${f} items`));const te=L?e(s,L,B,r):B.found?t(s,B.end,z,null,B,r):null;te?Qh(L)&&r(te.range,"BLOCK_IN_FLOW",Vh):B.comment&&(T.comment?T.comment+=`
|
|
162
|
+
`+B.comment:T.comment=B.comment);const Y=new fn(T,te);if(s.options.keepSourceTokens&&(Y.srcToken=k),d){const se=m;BN(s,se.items,T)&&r(A,"DUPLICATE_KEY","Map keys must be unique"),se.items.push(Y)}else{const se=new Zn(s.schema);se.flow=!0,se.items.push(Y);const pe=(te??T).range;se.range=[T.range[0],pe[1],pe[2]],m.items.push(se)}y=te?te.range[2]:B.end}}const b=d?"}":"]",[x,...j]=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&&j.unshift(x)}if(j.length>0){const C=ml(j,S,s.options.strict,r);C.comment&&(m.comment?m.comment+=`
|
|
163
|
+
`+C.comment:m.comment=C.comment),m.range=[a.offset,S,C.offset]}else m.range=[a.offset,S,S];return m}function 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,j=b&&c?b.offset>c.offset?b:c:b??c;j&&(!x||x.offset<j.offset)&&r(j,"MISSING_CHAR","Missing newline after block sequence props")}const f=s.type==="block-map"?"map":s.type==="block-seq"?"seq":s.start.source==="{"?"map":"seq";if(!c||!d||d==="!"||d===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 Re(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===">"?Re.BLOCK_FOLDED:Re.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===Re.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 j=a+r.length+t.source.length;return{value:y,type:c,comment:r.comment,range:[a,j,j]}}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 j=Number(x);!d&&j?d=j:p===-1&&(p=e+b)}}p!==-1&&a(p,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${r}`);let m=!1,v="",y=r.length;for(let b=1;b<t.length;++b){const x=t[b];switch(x.type){case"space":m=!0;case"newline":y+=x.source.length;break;case"comment":s&&!m&&a(x,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),y+=x.source.length,v=x.source.substring(1);break;case"error":a(x,"UNEXPECTED_TOKEN",x.message),y+=x.source.length;break;default:{const j=`Unexpected token in block scalar header: ${x.type}`;a(x,"UNEXPECTED_TOKEN",j);const 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,j)=>s(a+b,x,j);switch(r){case"scalar":f=Re.PLAIN,p=s3(c,m);break;case"single-quoted-scalar":f=Re.QUOTE_SINGLE,p=i3(c,m);break;case"double-quoted-scalar":f=Re.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=ft(y)?y:new Re(y)}catch(y){const b=y instanceof Error?y.message:String(y);a(s??t,"TAG_RESOLVE_FAILED",b),v=new Re(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:Vp};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=Vp(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&&(!ft(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 Vp(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 Mp(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=Lr(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):Vp(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 Io(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 Ux(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=Io(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}=Ux(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:Ux(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=Io(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(Io(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(Io(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(Io(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 $x=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==="%"&&$x.has(this.buffer[t+1])&&$x.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 Px(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 Ix(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"&&Ix(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&&Px(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":{Px(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);Ix(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 w3(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new x3||null,prettyErrors:t}}function j3(e,t={}){const{lineCounter:s,prettyErrors:a}=w3(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(Lx(e,s)),f.warnings.forEach(Lx(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=j3(t),y=[],b=[];for(let x=0;x<v.length;x++){const j=v[x];if(j.errors.length>0){y.push(`Document ${x+1}: ${j.errors[0]?.message}`);continue}const S=j.toJSON();if(!(!S||typeof S!="object"))try{const C=await Mj(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(ue,{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(A=>l.jsx("div",{className:"skeleton-text-sm w-16"},A))}),[1,2,3].map(A=>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"})]},A))]})]});const a=e.projects,r=Ca(),[c,d]=N.useState(!1),[f,p]=N.useState(""),[m,v]=N.useState(""),[y,b]=N.useState(""),[x,j]=N.useState("US"),[S,C]=N.useState("en"),[k,E]=N.useState(!1),[R,z]=N.useState(null),L=f.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),M=async()=>{if(!(!L||!y)){E(!0),z(null);try{const A=await ll(L,{displayName:m||f,canonicalDomain:y,country:x,language:S});s(),p(""),v(""),b(""),j("US"),C("en"),d(!1),r({to:"/projects/$projectId",params:{projectId:A.id}})}catch(A){z(A instanceof Error?A.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(ue,{type:"button",onClick:()=>d(A=>!A),children:[l.jsx(Tb,{className:"size-4 mr-1.5"}),"Add project"]})})]}),c?l.jsxs(Me,{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:A=>p(A.target.value)}),L&&L!==f?l.jsxs("p",{className:"supporting-copy",children:["Slug: ",L]}):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:A=>v(A.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:A=>b(A.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:A=>j(A.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:A=>C(A.target.value.toLowerCase())})]})]})]}),R?l.jsx("p",{className:"text-rose-400 text-sm mt-3",children:R}):null,l.jsxs("div",{className:"flex items-center gap-3 mt-4",children:[l.jsx(ue,{type:"button",disabled:!L||!y||k,onClick:M,children:k?"Creating...":"Create project"}),l.jsx(ue,{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(A=>{const T=A.recentRuns[0];return l.jsxs("tr",{className:"cursor-pointer",onClick:()=>r({to:"/projects/$projectId",params:{projectId:A.project.id}}),children:[l.jsxs("td",{children:[l.jsx(yt,{to:"/projects/$projectId",params:{projectId:A.project.id},className:"text-zinc-100 font-medium hover:underline",onClick:B=>B.stopPropagation(),children:A.project.displayName||A.project.name}),l.jsx("p",{className:"text-[11px] text-zinc-500",children:A.project.name})]}),l.jsx("td",{className:"text-zinc-400",children:A.project.canonicalDomain}),l.jsx("td",{children:l.jsx(tt,{tone:A.visibilitySummary.tone,children:A.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:A.project.country})]},A.project.id)})})]})}):c?null:l.jsxs(Me,{className:"surface-card empty-card",children:[l.jsx("h3",{children:"No projects yet"}),l.jsx("p",{className:"supporting-copy",children:"Create your first monitoring project to start tracking AI visibility."}),l.jsxs(ue,{type:"button",onClick:()=>d(!0),children:[l.jsx(Tb,{className:"size-4 mr-1.5"}),"Add project"]})]}),l.jsx(N3,{onApplied:()=>{s()}})]})}function Vo({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(ue,{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(Vo,{text:c})]}),l.jsx("p",{className:"gauge-delta",children:s}),l.jsx("p",{className:"gauge-description",children:r})]})}function Bx({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(j=>j.citationState),v=m.includes("cited")?"cited":m.includes("emerging")?"emerging":m.includes("lost")?"lost":m.every(j=>j==="pending")?"pending":"not-cited",y=k3(f),b=f.filter(j=>j.citationState==="cited"||j.citationState==="emerging").length,x=(()=>{if(y.length===0)return"Awaiting first run";if(y.length===1)return"First observation";const j=y[y.length-1].citationState,S=y[y.length-2].citationState;if(S!=="cited"&&j==="cited")return"Newly cited";if(S==="cited"&&j!=="cited")return"Lost since last run";let C=0;for(let k=y.length-1;k>=0&&y[k].citationState===j;k--)C++;return j==="cited"?C<=1?"Cited in latest run":`Cited for ${C} runs`:C<=1?"Not cited in latest run":`Not cited across ${C} runs`})();return l.jsxs(N.Fragment,{children:[l.jsxs("tr",{className:"evidence-phrase-row cursor-pointer hover:bg-zinc-800/40",onClick:()=>c(d),"aria-expanded":p,children:[l.jsx("td",{children:l.jsx(Lu,{size:14,className:`transition-transform duration-150 text-zinc-500 ${p?"rotate-90":""}`})}),l.jsx("td",{className:"evidence-keyword-cell",children:l.jsxs("div",{children:[l.jsx("span",{className:"font-medium text-zinc-100",children:d}),l.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:f.map(j=>l.jsx(el,{provider:j.provider},j.id))})]})}),l.jsx("td",{children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(jm,{state:v}),l.jsxs("span",{className:"text-[11px] text-zinc-500",children:[b,"/",f.length]})]})}),l.jsx("td",{children:l.jsx(Bx,{history:y})}),l.jsx("td",{className:"evidence-change-cell",children:x}),l.jsx("td",{})]}),p&&f.map(j=>l.jsxs("tr",{className:"bg-zinc-900/30",children:[l.jsx("td",{}),l.jsx("td",{className:"evidence-keyword-cell pl-5",children:l.jsx(el,{provider:j.provider})}),l.jsx("td",{children:l.jsx(jm,{state:j.citationState})}),l.jsx("td",{children:l.jsx(Bx,{history:j.runHistory})}),l.jsx("td",{className:"evidence-change-cell",children:j.changeLabel}),l.jsx("td",{children:l.jsx(ue,{variant:"ghost",size:"sm",type:"button",onClick:S=>{S.stopPropagation(),t(j.id)},children:"View"})})]},j.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"],R3=["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 A3({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(([j,S,C])=>{x||(r(j),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(Vo,{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,j])=>l.jsxs("tr",{className:"border-t border-zinc-800/40",children:[l.jsx("td",{className:"py-1.5 text-zinc-300",children:x}),l.jsxs("td",{className:"py-1.5 text-right text-zinc-200",children:[(j.citationRate*100).toFixed(1),"%"]}),l.jsxs("td",{className:"py-1.5 text-right text-zinc-400",children:[j.cited," / ",j.total]})]},x))})]})]})]}),a.buckets.length>=1&&l.jsx(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(Vo,{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:R3.map(x=>{const j=x==="cited"?c.cited.length:x==="gap"?c.gap.length:c.uncited.length,S=m===x;return l.jsxs("button",{type:"button",className:`px-3 py-1 text-xs rounded-full border transition-colors ${S?x==="gap"?"bg-amber-900/40 border-amber-700/60 text-amber-300":x==="cited"?"bg-emerald-900/40 border-emerald-700/60 text-emerald-300":"bg-zinc-800/40 border-zinc-700 text-zinc-300":"border-zinc-800 text-zinc-400 hover:border-zinc-700"}`,onClick:()=>v(S?null:x),children:[x==="gap"?"Gap":x==="cited"?"Cited":"Not Cited"," (",j,")"]},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(Vo,{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(j=>j.domain).join(", ")})]},x.category))})]})]}),f&&f.overall.length===0&&l.jsx("p",{className:"text-sm text-zinc-500 py-4",children:"No source data available. Run a visibility sweep first."})]})]})}function 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),j=c.top+f-y.citationRate/p*f;return{x,y:j}}),v=m.map(y=>`${y.x},${y.y}`).join(" ");return l.jsx("div",{className:"surface-card rounded-lg p-3 border border-zinc-800/60",children:l.jsxs("svg",{viewBox:`0 0 ${a} ${r}`,className:"w-full h-auto","aria-label":"Citation rate trend chart",onMouseLeave:()=>s(null),children:[l.jsxs("text",{x:c.left-4,y:c.top+4,textAnchor:"end",className:"fill-zinc-500",fontSize:"9",children:[(p*100).toFixed(0),"%"]}),l.jsx("text",{x:c.left-4,y:c.top+f+4,textAnchor:"end",className:"fill-zinc-500",fontSize:"9",children:"0%"}),l.jsx("line",{x1:c.left,y1:c.top+f,x2:c.left+d,y2:c.top+f,stroke:"currentColor",className:"text-zinc-800",strokeWidth:"0.5"}),l.jsx("polyline",{fill:"none",stroke:"currentColor",className:"text-emerald-500",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",points:v}),t!==null&&l.jsx("line",{x1:m[t].x,y1:c.top,x2:m[t].x,y2:c.top+f,stroke:"currentColor",className:"text-zinc-600",strokeWidth:"0.5",strokeDasharray:"3 2"}),e.map((y,b)=>{const{x,y:j}=m[b],S=t===b;return l.jsxs("g",{children:[l.jsx("circle",{cx:x,cy:j,r:"10",fill:"transparent",onMouseEnter:()=>s(b),style:{cursor:"pointer"}}),l.jsx("circle",{cx:x,cy:j,r:S?5:3,className:S?"fill-emerald-400":"fill-emerald-500"})]},b)}),t!==null&&(()=>{const y=e[t],{x:b,y:x}=m[t],j=`${(y.citationRate*100).toFixed(1)}%`,S=y.startDate.slice(5,10),C=56,k=30,E=Math.max(c.left,Math.min(b-C/2,a-c.right-C)),R=x-k-8;return l.jsxs("g",{children:[l.jsx("rect",{x:E,y:R,width:C,height:k,rx:"4",className:"fill-zinc-800",stroke:"currentColor",strokeWidth:"0.5"}),l.jsx("text",{x:E+C/2,y:R+13,textAnchor:"middle",className:"fill-zinc-50",fontSize:"11",fontWeight:"600",children:j}),l.jsx("text",{x:E+C/2,y:R+24,textAnchor:"middle",className:"fill-zinc-400",fontSize:"8",children:S})]})})(),e.map((y,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,j]=N.useState(null),[S,C]=N.useState(""),[k,E]=N.useState(""),[R,z]=N.useState("30"),[L,M]=N.useState(!1),[A,T]=N.useState({startDate:"",endDate:"",query:"",page:"",limit:"20"}),[B,te]=N.useState(""),[Y,se]=N.useState(!0),[pe,ke]=N.useState(!1),[we,I]=N.useState(!1),[Z,oe]=N.useState(!1),[q,J]=N.useState(!1),[O,G]=N.useState(!1),[ie,re]=N.useState(!1),[ce,he]=N.useState(!1),[de,De]=N.useState(null),[ge,Ge]=N.useState(!1),[st,me]=N.useState(!1),[Xe,ut]=N.useState(!1),[nn,_t]=N.useState(!1),[sn,Vt]=N.useState(null),[zt,xt]=N.useState(""),[hn,le]=N.useState(!1),[Pe,Ie]=N.useState(!1),[ze,Le]=N.useState("indexed"),[pt,an]=N.useState([]),[Ss,Ks]=N.useState(null),[ws,Vs]=N.useState(!1),[ls,_e]=N.useState(null),[Ht,Ke]=N.useState(null),ae=a.find($=>$.connectionType==="gsc"),Yn=f.length>0||m.length>0||y.length>0;async function pl($){if(!$){d([]),C("");return}oe(!0);try{const{sites:fe}=await Pj(e);d(fe),C($.propertyId??fe[0]?.siteUrl??"")}catch(fe){d([]),_e(fe instanceof Error?fe.message:"Failed to load Search Console properties")}finally{oe(!1)}}async function Qs(){G(!0);try{const $=await qj(e,{startDate:A.startDate||void 0,endDate:A.endDate||void 0,query:A.query||void 0,page:A.page||void 0,limit:parseInt(A.limit,10)||20});p($)}catch($){p([]),_e($ instanceof Error?$.message:"Failed to load GSC performance data")}finally{G(!1)}}async function js(){re(!0);try{const[$,fe]=await Promise.all([Zj(e,{url:B.trim()||void 0,limit:20}),Fj(e)]);v($),b(fe)}catch($){v([]),b([]),_e($ instanceof Error?$.message:"Failed to load GSC inspection history")}finally{re(!1)}}async function Zi(){Ge(!0);try{const[$,fe]=await Promise.all([zp(e),Gj(e).catch(()=>[])]);De($),an(fe)}catch($){De(null),an([]),_e($ instanceof Error?$.message:"Failed to load coverage data")}finally{Ge(!1)}}async function cs($){Vs(!0),_e(null);try{const fe=await _m(e,{urls:$}),{succeeded:it,failed:Qt,total:Lt}=fe.summary;Ke(Qt===0?`Indexing requested for ${it} URL${it!==1?"s":""}.`:`Indexing requested: ${it}/${Lt} succeeded, ${Qt} failed.`)}catch(fe){_e(fe instanceof Error?fe.message:"Failed to request indexing")}finally{Vs(!1)}}async function Aa(){Vs(!0),_e(null);try{const $=await _m(e,{urls:[],allUnindexed:!0}),{succeeded:fe,failed:it,total:Qt}=$.summary;Ke(it===0?`Indexing requested for ${fe} unindexed URL${fe!==1?"s":""}.`:`Indexing requested: ${fe}/${Qt} succeeded, ${it} failed.`)}catch($){_e($ instanceof Error?$.message:"Failed to request indexing")}finally{Vs(!1)}}async function us(){if(zt.trim()){le(!0),_e(null);try{await Bj(e,"gsc",zt.trim()),r($=>$.map(fe=>fe.connectionType==="gsc"?{...fe,sitemapUrl:zt.trim()}:fe)),Ke("Sitemap URL saved."),xt("")}catch($){_e($ instanceof Error?$.message:"Failed to save sitemap URL")}finally{le(!1)}}}async function gl(){ut(!0),_e(null);try{const $=await Qj(e);Vt($.sitemaps),r(fe=>fe.map(it=>it.connectionType==="gsc"?{...it,sitemapUrl:$.primarySitemapUrl}:it)),Ke(`Discovered ${$.sitemaps.length} sitemap(s). Primary sitemap saved and inspection queued (run ${$.run.id}).`)}catch($){_e($ instanceof Error?$.message:"Failed to discover sitemaps")}finally{ut(!1)}}async function yl(){_t(!0),_e(null);try{const $=await Vj(e);Vt($.sitemaps),$.sitemaps.length===0&&Ke("No sitemaps found in this GSC property. Submit a sitemap in Google Search Console first.")}catch($){_e($ instanceof Error?$.message:"Failed to list sitemaps")}finally{_t(!1)}}async function Ta(){se(!0),_e(null);try{const[$,fe]=await Promise.all([Gu().catch(()=>null),kp(e).catch(()=>[])]);s(!!$?.google?.configured),r(fe);const it=fe.find(Qt=>Qt.connectionType==="gsc");await Promise.all([pl(it),Qs(),js(),Zi()])}finally{se(!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),Ke(null);try{const{authUrl:$}=await Uj(e,"gsc");if(!$.startsWith("https://accounts.google.com/")){_e("Unexpected OAuth redirect URL. Please try again.");return}const fe=window.open($,"_blank","width=600,height=700");if(!fe){window.location.assign($);return}Ke("Finish the Google consent flow in the popup, then close it to refresh this project.");const it=window.setInterval(()=>{fe.closed&&(window.clearInterval(it),Ke(null),Ta())},1e3)}catch($){_e($ instanceof Error?$.message:"Failed to start OAuth flow")}finally{ke(!1)}}async function rd(){_e(null),Ke(null);try{await $j(e,"gsc"),r($=>$.filter(fe=>fe.connectionType!=="gsc")),d([]),C("")}catch($){_e($ instanceof Error?$.message:"Failed to disconnect")}}async function vl(){if(S){J(!0),_e(null);try{await Ij(e,"gsc",S),r($=>$.map(fe=>fe.connectionType==="gsc"?{...fe,propertyId:S}:fe)),Ke("GSC property updated.")}catch($){_e($ instanceof Error?$.message:"Failed to save GSC property")}finally{J(!1)}}}async function bl(){I(!0),_e(null),Ke(null);try{await _p(e,{days:parseInt(R,10)||void 0,full:L||void 0}),Ke("GSC sync queued. Refresh after the run completes to see imported data.")}catch($){_e($ instanceof Error?$.message:"Failed to trigger sync")}finally{I(!1)}}async function Hr(){if(k.trim()){he(!0),_e(null),Ke(null);try{const $=await Hj(e,k.trim());j($),E(""),await js()}catch($){_e($ instanceof Error?$.message:"Failed to inspect URL")}finally{he(!1)}}}return l.jsxs("section",{className:"page-section-divider",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Search Console"}),l.jsx("h2",{children:"Google Search Console"})]}),l.jsx("div",{className:"flex items-center gap-2",children:ae&&l.jsx(ue,{type:"button",variant:"outline",size:"sm",disabled:O,onClick:()=>{Qs()},children:O?"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:()=>Ke(null),children:"×"})]}),Y?l.jsx("p",{className:"text-sm text-zinc-500",children:"Loading…"}):l.jsxs("div",{className:"space-y-3",children:[l.jsxs(Me,{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:ae?"positive":t?"caution":"negative",children:ae?"Connected":t?"Ready to connect":"App credentials missing"})]}),ae?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:ae.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:ae.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:ae.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(ae.updatedAt)})]})]})]}):l.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-5",children:[l.jsx("p",{className:"text-sm text-zinc-300",children:t?"Generate a Google OAuth link for this project and have the client sign in with a Google account that already has access to the correct Search Console property.":"Set Google OAuth client credentials first. Once configured, you can generate a consent link for this project domain."}),l.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[t?l.jsx(ue,{type:"button",variant:"outline",size:"sm",disabled:pe,onClick:Fi,children:pe?"Opening…":"Connect Google Search Console"}):l.jsx(ue,{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."})]})]})]}),ae&&!ae.sitemapUrl&&l.jsx("div",{className:"rounded-lg border border-amber-800/40 bg-amber-950/20 px-4 py-3",children:l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsx("span",{className:"mt-0.5 text-amber-400",children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"h-5 w-5","aria-hidden":"true",children:l.jsx("path",{fillRule:"evenodd",d:"M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495zM10 6a.75.75 0 01.75.75v3.5a.75.75 0 01-1.5 0v-3.5A.75.75 0 0110 6zm0 9a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})})}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("p",{className:"text-sm font-medium text-amber-300",children:"Set your sitemap URL"}),l.jsx("p",{className:"mt-1 text-xs text-amber-400/70",children:"Canonry uses your sitemap to discover URLs for index coverage inspection. Auto-discover from GSC or enter it manually."}),l.jsxs("div",{className:"mt-2 flex flex-col gap-2",children:[l.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[l.jsx(ue,{type:"button",size:"sm",disabled:Xe||!ae.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:$=>xt($.target.value),onKeyDown:$=>$.key==="Enter"&&void us()}),l.jsx(ue,{type:"button",size:"sm",variant:"outline",disabled:hn||!zt.trim(),onClick:us,children:hn?"Saving…":"Save sitemap URL"})]})]})]})]})}),(ae||Yn)&&l.jsxs(l.Fragment,{children:[l.jsxs(Me,{className:"surface-card",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Coverage"}),l.jsx("h3",{children:"Index coverage"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[de&&de.notIndexed.length>0&&l.jsx(ue,{type:"button",variant:"outline",size:"sm",disabled:ws,onClick:()=>{Aa()},children:ws?"Requesting…":`Request indexing (${de.notIndexed.length})`}),l.jsx(ue,{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 $=de.summary.indexed+de.summary.notIndexed,fe=$>0?de.summary.indexed/$:0,it=$>0?de.summary.notIndexed/$:0,Qt=54,Lt=2*Math.PI*Qt,Et=Lt*(1-fe),Nt=Lt*it,Cn=Lt*fe;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:[(fe*100).toFixed(0),"%"]}),l.jsx("span",{className:"text-xs uppercase tracking-widest text-zinc-500 mt-0.5",children:"Indexed"})]})]}),l.jsxs("div",{className:"mt-4 flex items-center justify-center gap-8",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full bg-emerald-500"}),l.jsxs("div",{children:[l.jsx("p",{className:"text-2xl font-semibold tabular-nums text-zinc-50",children:de.summary.indexed.toLocaleString()}),l.jsx("p",{className:"text-[11px] uppercase tracking-wide text-zinc-500",children:"Indexed"})]})]}),l.jsx("div",{className:"h-8 w-px bg-zinc-800"}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full bg-zinc-500"}),l.jsxs("div",{children:[l.jsx("p",{className:"text-2xl font-semibold tabular-nums text-zinc-50",children:de.summary.notIndexed.toLocaleString()}),l.jsxs("p",{className:"text-[11px] uppercase tracking-wide text-zinc-500",children:["Not indexed",(de.reasonGroups??[]).length>0&&l.jsxs("span",{className:"ml-1 text-zinc-600",children:["· ",(de.reasonGroups??[]).length," ",(de.reasonGroups??[]).length===1?"reason":"reasons"]})]})]})]}),de.summary.deindexed>0&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"h-8 w-px bg-zinc-800"}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full bg-rose-500"}),l.jsxs("div",{children:[l.jsx("p",{className:"text-2xl font-semibold tabular-nums text-zinc-50",children:de.summary.deindexed.toLocaleString()}),l.jsx("p",{className:"text-[11px] uppercase tracking-wide text-zinc-500",children:"Deindexed"})]})]})]})]})]})})()}),l.jsx("div",{className:"mt-3 flex gap-1",children:["indexed","notIndexed","deindexed"].map($=>{const fe=$==="indexed"?de.indexed.length:$==="notIndexed"?de.notIndexed.length:de.deindexed.length,it=$==="indexed"?"Indexed":$==="notIndexed"?"Not Indexed":"Deindexed";return l.jsxs("button",{type:"button",className:`rounded-full px-3 py-1 text-xs font-medium transition-colors ${ze===$?"bg-zinc-700 text-zinc-100":"text-zinc-400 hover:bg-zinc-800 hover:text-zinc-200"}`,onClick:()=>{Le($),Ks(null)},children:[it," (",fe,")"]},$)})}),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($=>l.jsxs("tr",{children:[l.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:$.url}),l.jsx("td",{className:"text-zinc-400",children:$.verdict??"Unknown"}),l.jsx("td",{className:"text-zinc-400",children:$.crawlTime?$.crawlTime.split("T")[0]:"—"}),l.jsx("td",{className:"text-zinc-400",children:$.isMobileFriendly===!0?"Yes":$.isMobileFriendly===!1?"No":"—"})]},$.id))})]}),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($=>l.jsxs("tr",{className:"cursor-pointer hover:bg-zinc-800/40",onClick:()=>Ks($.reason),children:[l.jsx("td",{className:"text-zinc-200",children:$.reason}),l.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:$.count})]},$.reason))})]}),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($=>l.jsxs("tr",{children:[l.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:$.url}),l.jsx("td",{className:"text-zinc-400",children:$.indexingState??"Unknown"}),l.jsx("td",{className:"text-zinc-400",children:$.coverageState??"Unknown"})]},$.id))})]}),ze==="notIndexed"&&Ss&&(()=>{const $=(de.reasonGroups??[]).find(fe=>fe.reason===Ss);return $?l.jsxs("div",{children:[l.jsx("div",{className:"flex items-center gap-2 mb-3",children:l.jsx("button",{type:"button",className:"text-xs text-zinc-400 hover:text-zinc-200 transition-colors",onClick:()=>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:$.reason}),l.jsxs("p",{className:"mt-1 text-xs text-zinc-500",children:[$.count," affected page",$.count!==1?"s":""]})]}),l.jsx(ue,{type:"button",variant:"outline",size:"sm",disabled:ws,onClick:()=>{cs($.urls.map(fe=>fe.url))},children:ws?"Requesting…":`Request indexing (${$.count})`})]}),l.jsxs("table",{className:"data-table w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{className:"text-left",children:"URL"}),l.jsx("th",{className:"text-left",children:"Last Crawl"}),l.jsx("th",{className:"w-8"})]})}),l.jsx("tbody",{children:$.urls.map(fe=>l.jsxs("tr",{children:[l.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:fe.url}),l.jsx("td",{className:"text-zinc-400",children:fe.crawlTime?fe.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:ws,onClick:()=>{cs([fe.url])},title:"Request indexing",children:"Index"})})]},fe.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(($,fe)=>l.jsxs("tr",{children:[l.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:$.url}),l.jsx("td",{className:"text-zinc-400",children:$.previousState}),l.jsx("td",{className:"text-zinc-400",children:$.currentState}),l.jsx("td",{className:"text-zinc-400",children:$.transitionDate.split("T")[0]})]},`${$.url}-${fe}`))})]}),(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(Me,{className:"surface-card",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Performance"}),l.jsx("h3",{children:"Search performance"})]}),l.jsx(ue,{type:"button",variant:"outline",size:"sm",disabled:O,onClick:()=>{Qs()},children:O?"Loading…":"Apply filters"})]}),f.length>0&&(()=>{const $=new Map;for(const Be of f){const at=$.get(Be.date);at?(at.clicks+=Be.clicks,at.impressions+=Be.impressions):$.set(Be.date,{clicks:Be.clicks,impressions:Be.impressions})}const fe=[...$.entries()].sort(([Be],[at])=>Be.localeCompare(at));if(fe.length===0)return null;const it=Math.max(...fe.map(([,Be])=>Be.impressions),1),Qt=fe.reduce((Be,[,at])=>Be+at.clicks,0),Lt=fe.reduce((Be,[,at])=>Be+at.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/fe.length,ds=Math.max(Math.min(Js*.35,24),4),Oa=Math.max(ds*.15,1),Xs=Be=>{if(Be<=0)return 1;const at=Math.pow(10,Math.floor(Math.log10(Be))),Zt=Be/at,rn=Zt<=1.5?1.5:Zt<=3?3:Zt<=5?5:10;return Math.ceil(rn*at)},Jn=4,fs=Math.ceil(Xs(it)/Jn)*Jn,Ws=Array.from({length:Jn+1},(Be,at)=>fs/Jn*at),Mt=Be=>Be>=1e3?`${(Be/1e3).toFixed(Be>=1e4?0:1)}k`:String(Be);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((Be,at)=>{const Zt=en.top+Ys-Be/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(Be)})]},`t-${at}`)}),fe.map(([Be,at],Zt)=>{const rn=en.left+Js*Zt+Js/2,Da=at.impressions/fs*Ys,Zr=at.clicks/fs*Ys;return l.jsxs("g",{children:[l.jsx("title",{children:`${Be}
|
|
234
|
+
Clicks: ${at.clicks}
|
|
235
|
+
Impressions: ${at.impressions}
|
|
236
|
+
CTR: ${at.impressions>0?(at.clicks/at.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-Zr,width:ds,height:Math.max(Zr,1),rx:2,fill:"#10b981",opacity:.85})]},Be)}),(()=>{const Be=Math.min(fe.length,7);return Array.from({length:Be},(at,Zt)=>{const rn=fe.length===1?0:Math.round(Zt/(Be-1)*(fe.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:fe[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:A.startDate,onChange:$=>T(fe=>({...fe,startDate:$.target.value}))}),l.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"date",value:A.endDate,onChange:$=>T(fe=>({...fe,endDate:$.target.value}))}),l.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"Filter query",value:A.query,onChange:$=>T(fe=>({...fe,query:$.target.value}))}),l.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"Filter page",value:A.page,onChange:$=>T(fe=>({...fe,page:$.target.value}))}),l.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"number",min:"1",placeholder:"Limit",value:A.limit,onChange:$=>T(fe=>({...fe,limit:$.target.value}))})]}),f.length>0?l.jsx("div",{className:"mt-3 overflow-x-auto",children:l.jsxs("table",{className:"data-table w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{className:"text-left",children:"Date"}),l.jsx("th",{className:"text-left",children:"Query"}),l.jsx("th",{className:"text-left",children:"Page"}),l.jsx("th",{className:"text-right",children:"Clicks"}),l.jsx("th",{className:"text-right",children:"Impressions"}),l.jsx("th",{className:"text-right",children:"CTR"}),l.jsx("th",{className:"text-right",children:"Position"})]})}),l.jsx("tbody",{children:f.map(($,fe)=>l.jsxs("tr",{children:[l.jsx("td",{className:"text-zinc-400",children:$.date}),l.jsx("td",{className:"max-w-xs truncate text-zinc-200",children:$.query}),l.jsx("td",{className:"max-w-xs truncate text-zinc-400",children:$.page}),l.jsx("td",{className:"text-right tabular-nums text-zinc-300",children:$.clicks.toLocaleString()}),l.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:$.impressions.toLocaleString()}),l.jsxs("td",{className:"text-right tabular-nums text-zinc-400",children:[($.ctr*100).toFixed(1),"%"]}),l.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:$.position.toFixed(1)})]},`${$.date}:${$.query}:${$.page}:${fe}`))})]})}):l.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No performance rows match the current filters yet."})]}),l.jsxs(Me,{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:$=>E($.target.value),onKeyDown:$=>$.key==="Enter"&&void Hr()}),l.jsx(ue,{type:"button",size:"sm",disabled:ce||!ae?.propertyId||!k.trim(),onClick:Hr,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:Ob(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(Me,{className:"surface-card",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"History"}),l.jsx("h3",{children:"Inspection log"})]}),l.jsx(ue,{type:"button",variant:"outline",size:"sm",disabled:ie,onClick:()=>{js()},children:ie?"Loading…":"Refresh history"})]}),l.jsxs("div",{className:"mt-3 flex flex-col gap-2 lg:flex-row",children:[l.jsx("input",{className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"Filter exact URL",value:B,onChange:$=>te($.target.value)}),l.jsx(ue,{type:"button",size:"sm",variant:"outline",disabled:ie,onClick:()=>{js()},children:"Apply filter"})]}),m.length>0?l.jsx("div",{className:"mt-3 overflow-x-auto",children:l.jsxs("table",{className:"data-table w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{className:"text-left",children:"URL"}),l.jsx("th",{className:"text-left",children:"Indexing"}),l.jsx("th",{className:"text-left",children:"Verdict"}),l.jsx("th",{className:"text-left",children:"Coverage"}),l.jsx("th",{className:"text-left",children:"Mobile"}),l.jsx("th",{className:"text-left",children:"Inspected"})]})}),l.jsx("tbody",{children:m.map($=>l.jsxs("tr",{children:[l.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:$.url}),l.jsx("td",{className:"text-zinc-300",children:$.indexingState??"Unknown"}),l.jsx("td",{className:"text-zinc-400",children:$.verdict??"Unknown"}),l.jsx("td",{className:"text-zinc-400",children:$.coverageState??"Unknown"}),l.jsx("td",{className:"text-zinc-400",children:Ob($.isMobileFriendly)}),l.jsx("td",{className:"text-zinc-400",children:vs($.inspectedAt)})]},$.id))})]})}):l.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No inspection history yet."})]}),l.jsxs(Me,{className:"surface-card",children:[l.jsx("div",{className:"section-head",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Deindexed"}),l.jsx("h3",{children:"Recent indexing losses"})]})}),y.length>0?l.jsx("div",{className:"mt-3 overflow-x-auto",children:l.jsxs("table",{className:"data-table w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{className:"text-left",children:"URL"}),l.jsx("th",{className:"text-left",children:"Previous"}),l.jsx("th",{className:"text-left",children:"Current"}),l.jsx("th",{className:"text-left",children:"Changed at"})]})}),l.jsx("tbody",{children:y.map($=>l.jsxs("tr",{children:[l.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:$.url}),l.jsx("td",{className:"text-zinc-400",children:$.previousState??"Unknown"}),l.jsx("td",{className:"text-zinc-300",children:$.currentState??"Unknown"}),l.jsx("td",{className:"text-zinc-400",children:vs($.transitionDate)})]},`${$.url}:${$.transitionDate}`))})]})}):l.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No deindexed transitions recorded."})]})]}),ae&&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:()=>Ie($=>!$),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 ${Pe?"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"})]})}),Pe&&l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"grid gap-3 xl:grid-cols-2",children:[l.jsxs(Me,{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:Z||c.length===0,onChange:$=>C($.target.value),children:c.length===0?l.jsx("option",{value:"",children:Z?"Loading properties…":"No properties available"}):c.map($=>l.jsxs("option",{value:$.siteUrl,children:[$.siteUrl," · ",$.permissionLevel]},$.siteUrl))}),l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsx(ue,{type:"button",size:"sm",variant:"outline",disabled:Z,onClick:()=>{pl(ae)},children:Z?"Refreshing…":"Refresh properties"}),l.jsx(ue,{type:"button",size:"sm",disabled:!S||q,onClick:vl,children:q?"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(Me,{className:"surface-card",children:[l.jsx("div",{className:"section-head",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Sync"}),l.jsx("h3",{children:"Import GSC performance data"})]})}),l.jsxs("div",{className:"mt-3 space-y-3",children:[l.jsxs("div",{className:"grid gap-3 sm:grid-cols-[160px_1fr]",children:[l.jsxs("div",{children:[l.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`gsc-sync-days-${e}`,children:"Days"}),l.jsx("input",{id:`gsc-sync-days-${e}`,type:"number",min:"1",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",value:R,onChange:$=>z($.target.value)})]}),l.jsxs("label",{className:"flex items-center gap-2 rounded border border-zinc-800/60 bg-zinc-900/20 px-3 py-2 text-sm text-zinc-300",children:[l.jsx("input",{type:"checkbox",checked:L,onChange:$=>M($.target.checked)}),"Replace existing imported rows for the requested range"]})]}),l.jsx(ue,{type:"button",size:"sm",disabled:we||!ae.propertyId,onClick:bl,children:we?"Queueing…":"Queue sync"}),!ae.propertyId&&l.jsx("p",{className:"text-xs text-amber-400",children:"Select a Search Console property before queueing a sync."})]})]})]}),l.jsxs(Me,{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:[ae.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:ae.sitemapUrl})]}),l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsx(ue,{type:"button",size:"sm",variant:"outline",disabled:nn||!ae.propertyId,onClick:()=>{yl()},children:nn?"Loading…":"Browse sitemaps from GSC"}),l.jsx(ue,{type:"button",size:"sm",variant:"outline",disabled:Xe||!ae.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($=>{const fe=$.contents?.[0];return l.jsxs("div",{className:"flex items-start justify-between gap-2 text-xs",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-zinc-200 break-all",children:$.path}),$.lastSubmitted&&l.jsxs("p",{className:"text-zinc-500",children:["Submitted: ",$.lastSubmitted.split("T")[0]]})]}),l.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[fe&&l.jsxs("div",{className:"text-right",children:[l.jsxs("p",{className:"text-zinc-300",children:[fe.indexed," / ",fe.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($.path),children:"Use"})]})]},$.path)})]}),l.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[l.jsx("input",{className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"url",placeholder:ae.sitemapUrl?"Update sitemap URL…":"https://example.com/sitemap.xml",value:zt,onChange:$=>xt($.target.value),onKeyDown:$=>$.key==="Enter"&&zt.trim()&&void us()}),l.jsx(ue,{type:"button",size:"sm",disabled:hn||!zt.trim(),onClick:us,children:hn?"Saving…":ae.sitemapUrl?"Update":"Save"})]}),l.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[l.jsx("input",{className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"url",placeholder:"Sitemap URL for inspection (leave empty for saved default)",id:`gsc-sitemap-inspect-${e}`}),l.jsx(ue,{type:"button",size:"sm",variant:"outline",disabled:st||!ae.propertyId,onClick:()=>{const fe=document.getElementById(`gsc-sitemap-inspect-${e}`)?.value?.trim()||ae.sitemapUrl||void 0;me(!0),Kj(e,{sitemapUrl:fe}).then(it=>{Ke(`Sitemap inspection queued (run ${it.id}). Refresh coverage after the run completes.`)}).catch(it=>{_e(it instanceof Error?it.message:"Failed to queue sitemap inspection")}).finally(()=>me(!1))},children:st?"Queueing…":"Inspect sitemap"})]}),!ae.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,j]=N.useState(e.country),[S,C]=N.useState(e.language),[k,E]=N.useState(e.ownedDomains??[]),[R,z]=N.useState(""),[L,M]=N.useState(null),[A,T]=N.useState(!1),[B,te]=N.useState(!1),[Y,se]=N.useState(""),[pe,ke]=N.useState(""),[we,I]=N.useState(""),[Z,oe]=N.useState(""),[q,J]=N.useState("");N.useEffect(()=>{a||(v(e.displayName),b(e.canonicalDomain),j(e.country),C(e.language),E(e.ownedDomains??[]))},[e,a]);function O(){r(!1),p(null),v(e.displayName),b(e.canonicalDomain),j(e.country),C(e.language),E(e.ownedDomains??[]),z("")}function G(){const me=R.trim();me&&(k.includes(me)||E([...k,me]),z(""))}function ie(me){E(k.filter(Xe=>Xe!==me))}async function re(){if(!(!m.trim()||!y.trim()||!x.trim()||!S.trim())){d(!0),p(null);try{await t(e.name,{displayName:m.trim(),canonicalDomain:y.trim(),ownedDomains:k,country:x.trim(),language:S.trim()}),r(!1)}catch(me){p(me instanceof Error?me.message:"Failed to save")}finally{d(!1)}}}async function ce(){const me=Y.trim(),Xe=pe.trim(),ut=we.trim(),nn=Z.trim();if(!(!me||!Xe||!ut||!nn)){T(!0),M(null);try{const _t={label:me,city:Xe,region:ut,country:nn};q.trim()&&(_t.timezone=q.trim()),await wj(e.name,_t),s(),se(""),ke(""),I(""),oe(""),J(""),te(!1)}catch(_t){M(_t instanceof Error?_t.message:"Failed to add location")}finally{T(!1)}}}async function he(me){T(!0),M(null);try{await jj(e.name,me),s()}catch(Xe){M(Xe instanceof Error?Xe.message:"Failed to remove location")}finally{T(!1)}}async function de(me){T(!0),M(null);try{await Nj(e.name,me),s()}catch(Xe){M(Xe instanceof Error?Xe.message:"Failed to set default location")}finally{T(!1)}}const De=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",Ge="block text-xs font-medium text-zinc-400 mb-1",st=Y.trim()&&pe.trim()&&we.trim()&&Z.trim();return l.jsxs("section",{className:"page-section-divider",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Configuration"}),l.jsx("h2",{children:"Project settings"})]}),!a&&l.jsx(ue,{type:"button",variant:"outline",size:"sm",onClick:()=>r(!0),children:"Edit settings"})]}),f&&l.jsxs("div",{className:"mb-3 rounded-lg border border-rose-800/40 bg-rose-950/20 px-3 py-2 text-sm text-rose-300",children:[f,l.jsx("button",{type:"button",className:"ml-2 text-rose-400 hover:text-rose-200",onClick:()=>p(null),children:"×"})]}),a?l.jsxs("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900/40 p-4 space-y-4",children:[l.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[l.jsxs("div",{children:[l.jsx("label",{className:Ge,children:"Display name"}),l.jsx("input",{className:ge,type:"text",value:m,onChange:me=>v(me.target.value),placeholder:"My Project"})]}),l.jsxs("div",{children:[l.jsx("label",{className:Ge,children:"Canonical domain"}),l.jsx("input",{className:ge,type:"text",value:y,onChange:me=>b(me.target.value),placeholder:"example.com"})]}),l.jsxs("div",{children:[l.jsx("label",{className:Ge,children:"Country"}),l.jsx("input",{className:ge,type:"text",value:x,onChange:me=>j(me.target.value),placeholder:"US",maxLength:2})]}),l.jsxs("div",{children:[l.jsx("label",{className:Ge,children:"Language"}),l.jsx("input",{className:ge,type:"text",value:S,onChange:me=>C(me.target.value),placeholder:"en"})]})]}),l.jsxs("div",{children:[l.jsx("label",{className:Ge,children:"Owned domains"}),l.jsx("div",{className:"flex flex-wrap gap-1.5 mb-2",children:k.map(me=>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:[me,l.jsx("button",{type:"button",className:"ml-0.5 text-zinc-500 hover:text-zinc-200 transition-colors",onClick:()=>ie(me),"aria-label":`Remove ${me}`,children:"×"})]},me))}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx("input",{className:`${ge} flex-1`,type:"text",placeholder:"docs.example.com",value:R,onChange:me=>z(me.target.value),onKeyDown:me=>me.key==="Enter"&&(me.preventDefault(),G())}),l.jsx(ue,{type:"button",variant:"outline",size:"sm",disabled:!R.trim(),onClick:G,children:"Add"})]})]}),l.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t border-zinc-800/60",children:[l.jsx(ue,{type:"button",disabled:c||!De||!m.trim()||!y.trim(),onClick:re,children:c?"Saving...":"Save changes"}),l.jsx(ue,{type:"button",variant:"outline",disabled:c,onClick:O,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(me=>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:me},me))}):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:[L&&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:[L,l.jsx("button",{type:"button",className:"ml-1 text-rose-400 hover:text-rose-200",onClick:()=>M(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(me=>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 ${me.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:[me.label,me.label===e.defaultLocation?" ★":""]})}),l.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:me.city}),l.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:me.region}),l.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:me.country}),l.jsx("td",{className:"py-1.5 pr-3 text-zinc-500",children:me.timezone??"—"}),l.jsx("td",{className:"py-1.5",children:l.jsxs("div",{className:"flex items-center gap-1.5",children:[me.label!==e.defaultLocation&&l.jsx("button",{type:"button",disabled:A,onClick:()=>de(me.label),className:"text-[10px] text-zinc-500 hover:text-emerald-400 transition-colors disabled:opacity-40","aria-label":`Set ${me.label} as default location`,children:"Set default"}),l.jsx("button",{type:"button",disabled:A,onClick:()=>he(me.label),className:"text-[10px] text-zinc-500 hover:text-rose-400 transition-colors disabled:opacity-40","aria-label":`Remove location ${me.label}`,children:"Remove"})]})})]},me.label))})]}):l.jsx("p",{className:"text-zinc-500 text-xs mb-2",children:"No locations configured"}),B?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:Y,onChange:me=>se(me.target.value),placeholder:"nyc"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"City *"}),l.jsx("input",{className:ge,type:"text",value:pe,onChange:me=>ke(me.target.value),placeholder:"New York"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Region *"}),l.jsx("input",{className:ge,type:"text",value:we,onChange:me=>I(me.target.value),placeholder:"NY"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Country *"}),l.jsx("input",{className:ge,type:"text",value:Z,onChange:me=>oe(me.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:q,onChange:me=>J(me.target.value),placeholder:"America/New_York"})]})]}),l.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[l.jsx(ue,{type:"button",size:"sm",disabled:A||!st,onClick:ce,children:A?"Adding...":"Add location"}),l.jsx(ue,{type:"button",size:"sm",variant:"outline",disabled:A,onClick:()=>{te(!1),M(null)},children:"Cancel"})]})]}):l.jsx(ue,{type:"button",size:"sm",variant:"outline",onClick:()=>te(!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"}],qx=["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,j]=N.useState(!1),[S,C]=N.useState(""),[k,E]=N.useState(!1),[R,z]=N.useState(!1),[L,M]=N.useState(null);N.useEffect(()=>{Ej(e).then(s).catch(()=>s(null))},[e]);const A=()=>{if(t&&t!=="loading"){const Y=A2(t.preset??null,t.cronExpr);d(Y.freq),p(Y.hour),v(Y.customCron);const se=qx.includes(t.timezone);b(se?t.timezone:"Other"),j(!se),C(se?"":t.timezone)}else d("daily"),p(6),v(""),b("UTC"),j(!1),C("");M(null),r(!0)},T=async()=>{E(!0),M(null);try{const se={timezone:x?S.trim()||"UTC":y};c==="custom"?se.cron=m.trim():se.preset=R2(c,f);const pe=await Cm(e,se);s(pe),r(!1)}catch(Y){M(Y instanceof Error?Y.message:"Failed to save schedule")}finally{E(!1)}},B=async()=>{if(!(!t||t==="loading")){E(!0),M(null);try{const Y={timezone:t.timezone,enabled:!t.enabled};t.preset?Y.preset=t.preset:Y.cron=t.cronExpr,s(await Cm(e,Y))}catch(Y){M(Y instanceof Error?Y.message:"Failed to update schedule")}finally{E(!1)}}},te=async()=>{z(!0),M(null);try{await Rj(e),s(null),r(!1)}catch(Y){M(Y instanceof Error?Y.message:"Failed to remove schedule")}finally{z(!1)}};return l.jsxs("section",{className:"page-section-divider",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Automation"}),l.jsx("h2",{children:"Scheduled runs"})]}),t!=="loading"&&!a&&l.jsx(ue,{type:"button",variant:"outline",size:"sm",onClick:A,children:t?"Edit schedule":"+ Set schedule"})]}),t==="loading"&&l.jsx("p",{className:"supporting-copy",children:"Loading..."}),t!=="loading"&&!a&&t===null&&l.jsx(Me,{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(Me,{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(ue,{type:"button",variant:"outline",size:"sm",disabled:k,onClick:B,children:t.enabled?"Pause":"Resume"}),l.jsx(ue,{type:"button",variant:"ghost",size:"sm",disabled:R,onClick:te,children:R?"Removing...":"Remove"})]})]}),L&&l.jsx("p",{className:"text-rose-400 text-sm mt-2",children:L})]}),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:Y=>d(Y.target.value),children:U3.map(Y=>l.jsx("option",{value:Y.value,children:Y.label},Y.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:Y=>p(parseInt(Y.target.value)),children:Array.from({length:24},(Y,se)=>l.jsx("option",{value:se,children:hm(se)},se))})]})]}),c==="custom"&&l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Cron expression"}),l.jsx("input",{className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 font-mono focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"0 9 * * 1-5",value:m,onChange:Y=>v(Y.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:Y=>{Y.target.value==="Other"?(j(!0),b("Other")):(j(!1),b(Y.target.value))},children:[qx.map(Y=>l.jsx("option",{value:Y,children:Y},Y)),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:Y=>C(Y.target.value)})]}),L&&l.jsx("p",{className:"text-rose-400 text-sm",children:L}),l.jsxs("div",{className:"flex gap-2 justify-end",children:[l.jsx(ue,{type:"button",variant:"outline",size:"sm",onClick:()=>{r(!1),M(null)},children:"Cancel"}),l.jsx(ue,{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,j]=N.useState({});N.useEffect(()=>{Aj(e).then(s).catch(()=>s([]))},[e]);const S=R=>{p(z=>z.includes(R)?z.filter(L=>L!==R):[...z,R])},C=async()=>{if(!(!c.trim()||f.length===0)){v(!0),b(null);try{const R=await Tj(e,{channel:"webhook",url:c.trim(),events:f});s(z=>z==="loading"?[R]:[...z,R]),d(""),p(["citation.lost","citation.gained"]),r(!1)}catch(R){b(R instanceof Error?R.message:"Failed to add webhook")}finally{v(!1)}}},k=async R=>{try{await Oj(e,R),s(z=>z==="loading"?z:z.filter(L=>L.id!==R))}catch(z){b(z instanceof Error?z.message:"Failed to remove webhook")}},E=async R=>{j(z=>({...z,[R]:{state:"testing"}}));try{const z=await Dj(e,R);j(L=>({...L,[R]:{state:z.ok?"ok":"fail",status:z.status}}))}catch{j(z=>({...z,[R]:{state:"fail"}}))}};return l.jsxs("section",{className:"page-section-divider",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Automation"}),l.jsx("h2",{children:"Notifications"})]}),t!=="loading"&&l.jsx(ue,{type:"button",variant:"outline",size:"sm",onClick:()=>{r(!a),b(null)},children:a?"Cancel":"+ Add webhook"})]}),a&&l.jsxs("div",{className:"mb-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-4 space-y-3",children:[l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Webhook URL"}),l.jsx("input",{className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"url",placeholder:"https://hooks.example.com/canonry",value:c,onChange:R=>d(R.target.value)})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Trigger on"}),l.jsx("div",{className:"flex flex-wrap gap-3",children:P3.map(R=>l.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer select-none",children:[l.jsx("input",{type:"checkbox",className:"rounded border-zinc-600 bg-zinc-800",checked:f.includes(R.value),onChange:()=>S(R.value)}),l.jsx("span",{className:"text-sm text-zinc-300",children:R.label})]},R.value))})]}),y&&l.jsx("p",{className:"text-rose-400 text-sm",children:y}),l.jsxs("div",{className:"flex gap-2 justify-end",children:[l.jsx(ue,{type:"button",variant:"outline",size:"sm",onClick:()=>{r(!1),b(null)},children:"Cancel"}),l.jsx(ue,{type:"button",size:"sm",disabled:m||!c.trim()||f.length===0,onClick:C,children:m?"Adding...":"Add webhook"})]})]}),t==="loading"&&l.jsx("p",{className:"supporting-copy",children:"Loading..."}),t!=="loading"&&t.length===0&&!a&&l.jsx(Me,{className:"surface-card compact-card",children:l.jsx("p",{className:"supporting-copy",children:"No webhooks configured. Add one to get alerted when citations change or runs complete."})}),t!=="loading"&&t.length>0&&l.jsxs("div",{className:"evidence-table-wrap",children:[l.jsxs("table",{className:"evidence-table",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:"URL"}),l.jsx("th",{children:"Events"}),l.jsx("th",{children:"Status"}),l.jsx("th",{})]})}),l.jsx("tbody",{children:t.map(R=>l.jsxs("tr",{children:[l.jsx("td",{className:"evidence-keyword-cell",children:l.jsx("span",{className:"font-mono text-xs text-zinc-300 break-all",children:R.url})}),l.jsx("td",{children:l.jsx("div",{className:"flex flex-wrap gap-1",children:R.events.map(z=>l.jsx("span",{className:"inline-flex items-center rounded-full border border-zinc-700 bg-zinc-800/60 px-2 py-0.5 text-[10px] font-medium text-zinc-400 uppercase tracking-wide",children:z.replace("."," ")},z))})}),l.jsx("td",{children:l.jsx(tt,{tone:R.enabled?"positive":"neutral",children:R.enabled?"Active":"Paused"})}),l.jsx("td",{children:l.jsxs("div",{className:"flex items-center gap-1 justify-end",children:[x[R.id]&&(()=>{const z=x[R.id],L=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:L})})(),l.jsx(ue,{variant:"ghost",size:"sm",type:"button",disabled:x[R.id]?.state==="testing",onClick:()=>E(R.id),children:"Test"}),l.jsx(ue,{variant:"ghost",size:"sm",type:"button",onClick:()=>k(R.id),children:"Remove"})]})})]},R.id))})]}),y&&l.jsx("p",{className:"text-rose-400 text-sm mt-2",children:y})]})]})}function Hx({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,j]=N.useState(""),[S,C]=N.useState(""),[k,E]=N.useState(""),[R,z]=N.useState(!0),[L,M]=N.useState(null),[A,T]=N.useState(null),[B,te]=N.useState("coverage");N.useEffect(()=>{Y()},[e]);async function Y(){z(!0),M(null);try{const q=await Ep(e);if(s(q),q.connected){const[J,O,G]=await Promise.all([Rp(e).catch(()=>null),Ap(e).catch(()=>[]),tN(e).catch(()=>[])]);J&&d(J),p(O),v(G)}}catch(q){M(q instanceof Error?q.message:"Failed to load Bing data")}finally{z(!1)}}async function se(){if(S.trim()){M(null);try{const q=await Jj(e,S.trim());C(""),q.availableSites.length>0&&r(q.availableSites),await Y()}catch(q){M(q instanceof Error?q.message:"Failed to connect")}}}async function pe(){try{await Xj(e),s(null),r([]),d(null),p([]),v([]),b(null),E(""),M(null)}catch(q){M(q instanceof Error?q.message:"Failed to disconnect")}}async function ke(){if(k)try{await eN(e,k),await Y()}catch(q){M(q instanceof Error?q.message:"Failed to set site")}}async function we(){if(x.trim())try{const q=await Tp(e,x.trim());b(q),p(J=>[q,...J])}catch(q){M(q instanceof Error?q.message:"Inspection failed")}}async function I(q){try{await zm(e,{urls:[q]}),M(null),T(`Submitted to Bing: ${q}`),setTimeout(()=>T(null),4e3)}catch(J){M(J instanceof Error?J.message:"Submission failed")}}async function Z(){try{const q=await zm(e,{allUnindexed:!0});M(null);const{succeeded:J,total:O}=q.summary;T(`Submitted ${J}/${O} URL${O!==1?"s":""} to Bing`),setTimeout(()=>T(null),4e3)}catch(q){M(q instanceof Error?q.message:"Batch submission failed")}}if(R)return l.jsx(Me,{className:"surface-card",children:l.jsx("div",{className:"text-sm text-zinc-400",children:"Loading Bing data..."})});if(!t?.connected)return l.jsxs(Me,{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:q=>C(q.target.value),onKeyDown:q=>q.key==="Enter"&&se()}),l.jsx(ue,{size:"sm",disabled:!S.trim(),onClick:se,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"})]})]}),L&&l.jsx("p",{className:"mt-3 text-xs text-rose-400",children:L})]});if(!t.siteUrl)return l.jsxs(Me,{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(ue,{size:"sm",variant:"ghost",onClick:pe,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:q=>E(q.target.value),children:[l.jsx("option",{value:"",children:"Select a site..."}),a.map(q=>l.jsxs("option",{value:q.url,children:[q.url,q.verified?" (verified)":""]},q.url))]}),l.jsx(ue,{size:"sm",disabled:!k,onClick:ke,children:"Set Site"})]}):l.jsx("div",{className:"mt-3",children:l.jsx(ue,{size:"sm",onClick:async()=>{const q=await Wj(e);r(q.sites)},children:"Load Sites"})})]})]}),L&&l.jsx("p",{className:"mt-3 text-xs text-rose-400",children:L})]});const oe=[{key:"coverage",label:"Coverage"},{key:"inspections",label:"Inspections"},{key:"performance",label:"Performance"}];return l.jsxs("div",{className:"space-y-3",children:[l.jsxs(Me,{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(ue,{size:"sm",variant:"ghost",onClick:pe,children:"Disconnect"})]})]}),L&&l.jsx("p",{className:"mb-3 text-xs text-rose-400",children:L}),A&&l.jsx("p",{className:"mb-3 text-xs text-emerald-400",children:A}),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(Me,{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:oe.map(q=>l.jsx("button",{className:`px-3 py-1.5 text-xs font-medium border-b-2 transition-colors ${B===q.key?"border-zinc-200 text-zinc-200":"border-transparent text-zinc-500 hover:text-zinc-300"}`,onClick:()=>te(q.key),children:q.label},q.key))}),B==="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(ue,{size:"sm",variant:"ghost",onClick:Z,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(q=>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:q.url}),l.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:q.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:()=>I(q.url),children:"Submit"})})]},q.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(q=>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:q.url}),l.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:q.lastCrawledDate?vs(q.lastCrawledDate):"—"})]},q.id))})]})})]})]}),B==="coverage"&&!c&&l.jsx("p",{className:"mt-4 text-xs text-zinc-500",children:"No coverage data yet. Inspect URLs to build coverage data."}),B==="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:q=>j(q.target.value),onKeyDown:q=>q.key==="Enter"&&we()}),l.jsx(ue,{size:"sm",disabled:!x.trim(),onClick:we,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(q=>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:q.url}),l.jsx("td",{className:"py-1.5 px-3",children:l.jsx(tt,{tone:q.inIndex?"positive":"negative",children:q.inIndex?"Yes":"No"})}),l.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:q.httpCode??"—"}),l.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:vs(q.inspectedAt)})]},q.id))})]})})]}),B==="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((q,J)=>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:q.query}),l.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-200",children:q.clicks}),l.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:q.impressions}),l.jsxs("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:[(q.ctr*100).toFixed(1),"%"]}),l.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:q.averagePosition.toFixed(1)})]},J))})]})})})]})]})}function q3({projectName:e}){const[t,s]=N.useState("google"),[a,r]=N.useState(!0),[c,d]=N.useState("idle"),[f,p]=N.useState(null),m=N.useRef(null),[v,y]=N.useState(!1),[b,x]=N.useState(null),[j,S]=N.useState(null),[C,k]=N.useState(!1),[E,R]=N.useState(null),[z,L]=N.useState(null);async function M(oe=!1){oe||r(!0),p(null);try{const[q,J,O]=await Promise.all([Gu().catch(()=>null),kp(e).catch(()=>[]),Ep(e).catch(()=>null)]),G=J.find(ce=>ce.connectionType==="gsc")??null;y(!!q?.google?.configured),k(!!q?.bing?.configured),x(G),R(O);const[ie,re]=await Promise.all([G?zp(e).catch(()=>null):Promise.resolve(null),O?.connected?Rp(e).catch(()=>null):Promise.resolve(null)]);S(ie),L(re)}catch(q){p(q instanceof Error?q.message:"Failed to load search console overview")}finally{r(!1)}}async function A(){if(c!=="idle")return;m.current?.abort();const oe=new AbortController;m.current=oe;const q=oe.signal;d("syncing"),p(null);const J=[];try{async function O(){if(!b)return;const ce=await _p(e);if(!ce?.id)return;const he=2e3,De=Date.now()+12e4;for(;Date.now()<De;){if(q.aborted||(await new Promise(Ge=>setTimeout(Ge,he)),q.aborted))return;const ge=await Or(ce.id).catch(()=>null);if(!ge)break;if(["completed","failed","cancelled"].includes(ge.status)){ge.status!=="completed"&&J.push(`Google sync ${ge.status}`);break}}}const G=10;async function ie(){if(!E?.connected)return;const ce=await Ap(e).catch(()=>[]),he=[...new Set(ce.map(de=>de.url))];if(he.length!==0)for(let de=0;de<he.length;de+=G){if(q.aborted)return;const De=he.slice(de,de+G),Ge=(await Promise.allSettled(De.map(st=>Tp(e,st)))).filter(st=>st.status==="rejected").length;Ge>0&&J.push(`${Ge} Bing inspection(s) failed`)}}const re=await Promise.allSettled([O(),ie()]);for(const ce of re)ce.status==="rejected"&&J.push(ce.reason instanceof Error?ce.reason.message:"Sync failed");if(q.aborted)return;d("reloading"),await M(!0),J.length>0&&p(`Partial refresh: ${J.join("; ")}`)}catch(O){q.aborted||p(O instanceof Error?O.message:"Refresh failed")}finally{q.aborted||d("idle")}}N.useEffect(()=>(M(),()=>{m.current?.abort()}),[e]);const T=b?"positive":v?"caution":"negative",B=b?"Connected":v?"Ready to connect":"Needs setup",te=j?`${j.summary.percentage}% indexed`:b?"Awaiting coverage":"No coverage data",Y=j?`${j.summary.notIndexed} not indexed${j.summary.deindexed>0?` · ${j.summary.deindexed} deindexed`:""}`:b?"Run sitemap inspection to populate coverage":v?"Connect Search Console for this domain":"Add Google OAuth credentials in Settings",se=j?.lastInspectedAt??b?.updatedAt??null,pe=E?.connected?"positive":C?"caution":"negative",ke=E?.connected?"Connected":C?"Ready to connect":"Needs setup",we=z?`${z.summary.percentage}% indexed`:E?.connected?"Awaiting coverage":"No coverage data",I=z?`${z.summary.notIndexed} not indexed`:E?.connected?"Inspect URLs to populate coverage":C?"Connect Bing Webmaster Tools for this domain":"Add a Bing API key in Settings",Z=z?.lastInspectedAt??E?.updatedAt??null;return l.jsxs("div",{className:"space-y-6",children:[l.jsxs(Me,{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(ue,{type:"button",variant:"outline",size:"sm",disabled:a||c!=="idle",onClick:()=>{A()},children:a?"Loading…":c==="syncing"?"Querying Google & Bing…":c==="reloading"?"Reloading…":"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(Hx,{eyebrow:"Google",title:"Google Search Console",status:a?"Loading…":B,tone:a?"neutral":T,targetLabel:"Selected property",targetValue:b?.propertyId??"No property selected",coverageValue:a?"Loading…":te,note:a?"Loading overview…":Y,updatedAt:se,active:t==="google",onClick:()=>s("google")}),l.jsx(Hx,{eyebrow:"Bing",title:"Bing Webmaster Tools",status:a?"Loading…":ke,tone:a?"neutral":pe,targetLabel:"Selected site",targetValue:E?.siteUrl??"No site selected",coverageValue:a?"Loading…":we,note:a?"Loading overview…":I,updatedAt:Z,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(([oe,q])=>l.jsx("button",{type:"button",role:"tab","aria-selected":t===oe,className:`project-subnav-link ${t===oe?"project-subnav-link-active":""}`,onClick:()=>s(oe),children:q},oe))}),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(jm,{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(el,{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 Qp({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(le=>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"})]},le))}),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(le=>l.jsx("div",{className:"skeleton-text-sm w-full"},le))})]})]});const d=R5(a,t),[f,p]=N.useState(!1),[m,v]=N.useState(!1),[y,b]=N.useState(!1),[x,j]=N.useState(null),[S,C]=N.useState(!1),[k,E]=N.useState(""),[R,z]=N.useState(!1),[L,M]=N.useState(!1),[A,T]=N.useState(""),[B,te]=N.useState(!1),[Y,se]=N.useState(!1),[pe,ke]=N.useState(""),[we,I]=N.useState(!1),[Z,oe]=N.useState(void 0),[q,J]=N.useState(!1),[O,G]=N.useState(null),[ie,re]=N.useState(!1),ce=d?.visibilityEvidence??[],he=d?.project.name??"",de=N.useMemo(()=>new Set(ce.map(le=>le.location??"")),[ce]),De=de.has(""),ge=N.useMemo(()=>[...de].filter(Boolean),[de]);N.useEffect(()=>{if(Z===void 0||Z===""||!he){G(null),re(!1);return}re(!0),jp(he,Z).then(le=>{G(le),re(!1)}).catch(()=>{G(null),re(!1)})},[Z,he]);const Ge=N.useMemo(()=>{if(!O)return null;const le=new Map;for(const Pe of O){for(const[Ie,ze]of Object.entries(Pe.providerRuns??{}))le.set(`${Pe.keyword}::${Ie}`,ze.map(Le=>({runId:Le.runId,citationState:Le.citationState,createdAt:Le.createdAt})));(!Pe.providerRuns||Object.keys(Pe.providerRuns).length===0)&&le.set(`${Pe.keyword}::`,Pe.runs.map(Ie=>({runId:Ie.runId,citationState:Ie.citationState,createdAt:Ie.createdAt})))}return le},[O]),st=N.useMemo(()=>{const le=Z!==void 0?ce.filter(Pe=>Z===""?!Pe.location:Pe.location===Z):ce;return Ge?le.map(Pe=>{const Ie=Ge.get(`${Pe.keyword}::${Pe.provider}`)??Ge.get(`${Pe.keyword}::`);return Ie?{...Pe,runHistory:Ie}:Pe}):le},[ce,Z,Ge]);if(!d)return l.jsx("div",{className:"page-container",children:l.jsxs(Me,{className:"surface-card empty-card",children:[l.jsx("h1",{children:"Project not found"}),l.jsxs("p",{children:['Could not find a project with ID "',t,'".']}),l.jsx(ue,{asChild:!0,children:l.jsx(yt,{to:"/",children:"Return to overview"})})]})});async function me(){b(!0),j(null);try{await Cp(he),c()}catch(le){j(le instanceof Error?le.message:"Failed to trigger run")}finally{b(!1)}}async function Xe(){v(!0);try{await Cj(he),s({to:"/"}),c()}catch(le){console.error("Failed to delete project:",le)}finally{v(!1)}}async function ut(){const le=await kj(he),Pe=typeof le=="string"?le:JSON.stringify(le,null,2),Ie=new Blob([Pe],{type:"text/yaml"}),ze=URL.createObjectURL(Ie),Le=document.createElement("a");Le.href=ze,Le.download=`${he}.yaml`,Le.click()}async function nn(){const le=k.split(`
|
|
237
|
+
`).map(Pe=>Pe.trim()).filter(Boolean);if(le.length!==0){z(!0);try{await xj(he,le),c(),E(""),C(!1)}finally{z(!1)}}}async function _t(){const le=A.trim();if(le){te(!0);try{const Ie=(await wp(he)).map(Le=>Le.domain),ze=[...new Set([...Ie,le])];await Np(he,ze),c(),T(""),M(!1)}finally{te(!1)}}}async function sn(){const le=pe.trim();if(le){I(!0);try{const Pe=d?.project.ownedDomains??[];await Nm(he,[...Pe,le]),c(),ke(""),se(!1)}finally{I(!1)}}}async function Vt(le){I(!0);try{const Pe=d?.project.ownedDomains??[];await Nm(he,Pe.filter(Ie=>Ie!==le)),c()}finally{I(!1)}}async function zt(le,Pe){await Sj(le,Pe),c()}const xt=le=>!Number.isNaN(Number.parseInt(le,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(Me,{className:"surface-card p-6 mb-6 border-rose-800/60",children:[l.jsx("h3",{className:"text-base font-semibold text-rose-400 mb-2",children:"Delete project?"}),l.jsxs("p",{className:"text-sm text-zinc-400 mb-4",children:["This will permanently delete ",l.jsx("strong",{className:"text-zinc-200",children:d.project.displayName||d.project.name})," and all its key phrases, competitors, runs, and snapshots. This cannot be undone."]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(ue,{type:"button",variant:"destructive",disabled:m,onClick:Xe,children:m?"Deleting...":"Yes, delete project"}),l.jsx(ue,{type:"button",variant:"outline",disabled:m,onClick:()=>p(!1),children:"Cancel"})]})]}):null,l.jsxs("div",{className:"page-header",children:[l.jsxs("div",{className:"page-header-left",children:[l.jsx("h1",{className:"page-title",children:d.project.displayName||d.project.name}),l.jsxs("p",{className:"page-subtitle",children:[d.project.canonicalDomain,(d.project.ownedDomains??[]).length===0&&!Y&&l.jsx("button",{type:"button",className:"ml-2 text-[10px] uppercase tracking-wide text-zinc-600 hover:text-zinc-400 transition-colors",onClick:()=>se(!0),children:"+ add domain"})," "," · ",d.contextLabel]}),l.jsxs("div",{className:"tag-row",children:[l.jsx("span",{className:"tag",children:d.project.country}),l.jsx("span",{className:"tag",children:d.project.language.toUpperCase()}),d.project.tags.map(le=>l.jsx("span",{className:"tag",children:le},le))]}),((d.project.ownedDomains??[]).length>0||Y)&&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(le=>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:[le,l.jsx("button",{type:"button",className:"ml-0.5 text-zinc-500 hover:text-zinc-200 transition-colors",disabled:we,onClick:()=>Vt(le),"aria-label":`Remove ${le}`,children:"×"})]},le)),Y?l.jsxs("span",{className:"inline-flex items-center gap-1",children:[l.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-1.5 py-0.5 text-xs text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none w-40",type:"text",placeholder:"docs.example.com",value:pe,onChange:le=>ke(le.target.value),onKeyDown:le=>le.key==="Enter"&&sn(),autoFocus:!0}),l.jsx(ue,{type:"button",size:"sm",disabled:!pe.trim()||we,onClick:sn,children:we?"...":"Add"}),l.jsx("button",{type:"button",className:"text-xs text-zinc-500 hover:text-zinc-300",onClick:()=>{se(!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:()=>se(!0),children:"+ domain"})]})]}),l.jsxs("div",{className:"page-header-right",children:[l.jsx("p",{className:"text-sm text-zinc-500",children:d.dateRangeLabel}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(ue,{type:"button",variant:"outline",size:"icon",onClick:ut,"aria-label":"Export project as YAML",children:l.jsx(r2,{className:"h-4 w-4 text-zinc-400"})}),l.jsx(ue,{type:"button",variant:"outline",size:"icon",onClick:()=>p(!0),"aria-label":"Delete project",children:l.jsx(C2,{className:"h-4 w-4 text-zinc-400"})}),l.jsx(ue,{type:"button",disabled:y,onClick:me,children:y?"Starting...":"Run now"})]})]})]}),x&&l.jsxs("div",{className:"mb-3 rounded-lg border border-rose-800/40 bg-rose-950/20 px-3 py-2 text-sm text-rose-300",children:[x,l.jsx("button",{type:"button",className:"ml-2 text-rose-400 hover:text-rose-200",onClick:()=>j(null),children:"×"})]}),l.jsx("nav",{className:"project-subnav","aria-label":"Project sections",children:hn.map(le=>l.jsx(yt,{to:le.href,className:`project-subnav-link ${le.key===e?"project-subnav-link-active":""}`,"aria-current":le.key===e?"page":void 0,children:le.label},le.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(Vo,{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(le=>l.jsxs("tr",{children:[l.jsx("td",{children:l.jsxs("div",{className:"flex flex-col items-start gap-0.5",children:[l.jsx(el,{provider:le.provider}),le.model&&l.jsx("span",{className:"text-[11px] font-mono text-zinc-500",children:le.model})]})}),l.jsx("td",{children:l.jsxs("span",{className:`font-semibold ${le.score>=70?"text-emerald-400":le.score>=40?"text-amber-400":"text-rose-400"}`,children:[le.score,"%"]})}),l.jsxs("td",{className:"text-zinc-500",children:[le.cited," of ",le.total]})]},`${le.provider}::${le.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(le=>le.keyword)).size," key phrases tracked"]}),l.jsx(ue,{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:le=>E(le.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(le=>le.trim()).length," key phrases"]}),l.jsx(ue,{type:"button",size:"sm",disabled:!k.trim()||R,onClick:nn,children:R?"Adding...":"Add key phrases"})]})]}),d.project.locations&&d.project.locations.length>0&&l.jsxs("div",{className:"filter-row mb-3",role:"toolbar","aria-label":"Location filters",children:[l.jsx("button",{className:`filter-chip ${Z===void 0?"filter-chip-active":""}`,type:"button","aria-pressed":Z===void 0,onClick:()=>{oe(void 0)},children:"All locations"}),d.project.locations.map(le=>de.has(le.label)&&l.jsx("button",{className:`filter-chip ${Z===le.label?"filter-chip-active":""}`,type:"button","aria-pressed":Z===le.label,onClick:()=>{oe(le.label),J(!1)},children:le.label},le.label)),De&&l.jsx("button",{className:`filter-chip ${Z===""?"filter-chip-active":""}`,type:"button","aria-pressed":Z==="",onClick:()=>{oe(""),J(!1)},children:"No location"}),ge.length>1&&Z===void 0&&l.jsx("button",{className:`filter-chip filter-chip-compare ${q?"filter-chip-active":""}`,type:"button","aria-pressed":q,onClick:()=>J(le=>!le),title:"Side-by-side location comparison",children:"Compare"})]}),l.jsx(_3,{evidence:st})]}),l.jsxs("section",{className:"page-section-divider",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Competitors"}),l.jsx("h2",{children:"Competitive landscape"})]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs("p",{className:"supporting-copy",children:[d.competitors.length," tracked"]}),l.jsx(ue,{type:"button",variant:"outline",size:"sm",onClick:()=>M(!L),children:L?"Cancel":"+ Add competitor"})]})]}),L&&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:A,onChange:le=>T(le.target.value),onKeyDown:le=>le.key==="Enter"&&_t()}),l.jsx(ue,{type:"button",size:"sm",disabled:!A.trim()||B,onClick:_t,children:B?"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(le=>l.jsx(QN,{run:le},le.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(A3,{projectName:d.project.name}):l.jsx(q3,{projectName:d.project.name})]})}const Z3="modulepreload",F3=function(e,t){return new URL(e,t).href},Zx={},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 Zx)return;Zx[v]=!0;const y=v.endsWith(".css"),b=y?'[rel="stylesheet"]':"";if(a)for(let j=d.length-1;j>=0;j--){const S=d[j];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((j,S)=>{x.addEventListener("load",j),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(()=>j5);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(ue,{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(Me,{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,j]=N.useState(""),[S,C]=N.useState(""),[k,E]=N.useState(!1),[R,z]=N.useState(null),[L,M]=N.useState(!1),A=r?f.trim().length>0:c.trim().length>0;async function T(){if(A){E(!0),z(null),M(!1);try{const te=we=>{const I=parseInt(we.trim(),10);return Number.isFinite(I)&&I>0?I:void 0},Y={},se=te(y);se!==void 0&&(Y.maxConcurrency=se);const pe=te(x);pe!==void 0&&(Y.maxRequestsPerMinute=pe);const ke=te(S);ke!==void 0&&(Y.maxRequestsPerDay=ke),await _j(e.toLowerCase(),{...c.trim()?{apiKey:c.trim()}:{},...f.trim()?{baseUrl:f.trim()}:{},...m.trim()?{model:m.trim()}:{},...Object.keys(Y).length>0?{quota:Y}:{}}),d(""),p(""),v(""),b(""),j(""),C(""),M(!0),a()}catch(te){z(te instanceof Error?te.message:"Failed to update provider")}finally{E(!1)}}}const B=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:te=>p(te.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:te=>d(te.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:B,value:m,onChange:te=>v(te.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:te=>b(te.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:te=>j(te.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:te=>C(te.target.value)}),l.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Per day"})]})]})]}),R&&l.jsx("p",{className:"text-xs text-rose-400",children:R}),L&&l.jsx("p",{className:"text-xs text-emerald-400",children:"Provider updated."}),l.jsx(ue,{type:"button",size:"sm",disabled:!A||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 zj({clientId:t.trim(),clientSecret:a.trim()}),s(""),r(""),v(!0),e()}catch(x){p(x instanceof Error?x.message:"Failed to update Google OAuth credentials")}finally{d(!1)}}}return l.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3 space-y-2",children:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"google-client-id",children:"Client ID"}),l.jsx("a",{href:"https://console.cloud.google.com/apis/credentials",target:"_blank",rel:"noopener noreferrer",className:"text-[10px] text-zinc-500 hover:text-zinc-300 underline underline-offset-2",children:"Google Cloud \\u2197"})]}),l.jsx("input",{id:"google-client-id",type:"text",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"Google OAuth client ID",value:t,onChange:x=>s(x.target.value)})]}),l.jsxs("div",{children:[l.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"google-client-secret",children:"Client secret"}),l.jsx("input",{id:"google-client-secret",type:"password",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"Google OAuth client secret",value:a,onChange:x=>r(x.target.value)})]}),l.jsxs("p",{className:"text-[11px] text-zinc-500",children:["These credentials are stored in ",l.jsx("code",{children:"~/.canonry/config.yaml"}),". Project-level Search Console connections are created separately per canonical domain."]}),f&&l.jsx("p",{className:"text-xs text-rose-400",children:f}),m&&l.jsx("p",{className:"text-xs text-emerald-400",children:"Google OAuth credentials updated."}),l.jsx(ue,{type:"button",size:"sm",disabled:!y||c,onClick:b,children:c?"Saving...":"Save Google OAuth app"})]})}function 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(Me,{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(ue,{type:"button",variant:"outline",size:"sm",onClick:()=>c(!r),children:r?"Cancel":e?.connected?"Update endpoint":"Configure"})}),r&&l.jsxs("form",{className:"mt-3 flex flex-col gap-2",onSubmit:async b=>{b.preventDefault(),y(!0);try{await Yj(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(ue,{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(""),[j,S]=N.useState(!1),[C,k]=N.useState(null),[E,R]=N.useState(!1);return s?l.jsxs("div",{className:"page-container",children:[l.jsx("div",{className:"page-header",children:l.jsxs("div",{className:"page-header-left",children:[l.jsx("h1",{className:"page-title",children:"Settings"}),l.jsx("p",{className:"page-subtitle",children:"Provider state, Google OAuth, Bing WMT setup, and service health."})]})}),l.jsxs("section",{className:"settings-grid",children:[s.providerStatuses.map(z=>l.jsxs(Me,{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(ue,{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(Me,{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(ue,{type:"button",variant:"outline",size:"sm",onClick:()=>m(!p),children:p?"Cancel":s.google.state==="ready"?"Update OAuth app":"Configure Google OAuth"})}),p&&l.jsx(Q3,{onSaved:()=>{m(!1)}})]}),l.jsxs(Me,{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(ue,{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(ue,{type:"button",size:"sm",disabled:!b.trim()||j,onClick:async()=>{if(b.trim()){S(!0),k(null),R(!1);try{await nN(b.trim()),x(""),R(!0),y(!1)}catch(z){k(z instanceof Error?z.message:"Failed to update Bing API key")}finally{S(!1)}}},children:j?"Saving...":"Save Bing API key"})]})]}),l.jsx(Y3,{}),l.jsxs(Me,{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(Me,{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(ae=>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"})]},ae))})]})]});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,j]=N.useState(""),[S,C]=N.useState(""),[k,E]=N.useState(""),[R,z]=N.useState("US"),[L,M]=N.useState("en"),[A,T]=N.useState(null),[B,te]=N.useState(null),[Y,se]=N.useState(null),[pe,ke]=N.useState(!1),[we,I]=N.useState(""),[Z,oe]=N.useState(!1),[q,J]=N.useState(null),[O,G]=N.useState(!1),ie=c.providerStatuses.filter(ae=>ae.state==="ready"),[re,ce]=N.useState(ie[0]?.name??""),[he,de]=N.useState(5),[De,ge]=N.useState(!1),[Ge,st]=N.useState(null),[me,Xe]=N.useState(""),[ut,nn]=N.useState(!1),[_t,sn]=N.useState(null),[Vt,zt]=N.useState(!1),[xt,hn]=N.useState(!1),[le,Pe]=N.useState(null),[Ie,ze]=N.useState(!1),Le=x.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),pt=we.split(`
|
|
239
|
+
`).map(ae=>ae.trim()).filter(Boolean),an=me.split(`
|
|
240
|
+
`).map(ae=>ae.trim()).filter(Boolean),Ss=m.healthChecks.some(ae=>ae.id==="api"&&ae.state==="ready"),Ks=async()=>{if(!(!Le||!k)){ke(!0),se(null);try{const ae=await ll(Le,{displayName:S||x,canonicalDomain:k,country:R,language:L});T(Le),te(ae.id),a(),b(2)}catch(ae){se(ae instanceof Error?ae.message:"Failed to create project")}finally{ke(!1)}}},ws=async()=>{if(!A)return;const ae=pt;if(ae.length!==0){G(!0),J(null);try{await bj(A,ae),oe(!0),a(),b(3)}catch(Yn){J(Yn instanceof Error?Yn.message:"Failed to save key phrases")}finally{G(!1)}}},Vs=async()=>{if(!(!A||!re)){ge(!0),st(null);try{const ae=await Lj(A,re,he);if(ae.keywords.length>0){const Yn=we?we.trimEnd()+`
|
|
241
|
+
`+ae.keywords.join(`
|
|
242
|
+
`):ae.keywords.join(`
|
|
243
|
+
`);I(Yn)}}catch(ae){st(ae instanceof Error?ae.message:"Failed to generate key phrases")}finally{ge(!1)}}},ls=async()=>{if(!A)return;const ae=an;if(ae.length!==0){zt(!0),sn(null);try{await Np(A,ae),nn(!0),a(),b(4)}catch(Yn){sn(Yn instanceof Error?Yn.message:"Failed to save competitors")}finally{zt(!1)}}},_e=async()=>{if(A){ze(!0),Pe(null);try{await Cp(A),hn(!0),a()}catch(ae){Pe(ae instanceof Error?ae.message:"Failed to trigger run")}finally{ze(!1)}}},Ht=()=>b(ae=>Math.max(0,ae-1)),Ke=(()=>{switch(y){case 0:return l.jsxs(Me,{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(ae=>l.jsxs("div",{className:"health-check-row",children:[l.jsxs("div",{children:[l.jsx("p",{className:"run-row-title",children:ae.label}),l.jsx("p",{className:"supporting-copy",children:ae.detail}),ae.id==="provider"&&ae.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:ae.state==="ready"?"positive":"caution",children:ae.state==="ready"?"Ready":"Attention"})]},ae.id))}),l.jsxs("div",{className:"setup-nav",children:[l.jsx("span",{}),l.jsx(ue,{type:"button",disabled:!Ss,onClick:()=>b(1),children:"Continue"})]})]});case 1:return l.jsxs(Me,{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"})]}),A?l.jsx(tt,{tone:"positive",children:"Created"}):null]}),A?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:A})," created successfully."]}),l.jsxs("div",{className:"setup-nav",children:[l.jsx(ue,{type:"button",variant:"outline",onClick:Ht,children:"Back"}),l.jsx(ue,{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:ae=>j(ae.target.value)}),Le&&Le!==x?l.jsxs("p",{className:"supporting-copy",children:["Slug: ",Le]}):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:ae=>C(ae.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:ae=>E(ae.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:R,onChange:ae=>z(ae.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:L,onChange:ae=>M(ae.target.value.toLowerCase())})]})]}),Y?l.jsx("p",{className:"text-rose-400 text-sm",children:Y}):null,l.jsxs("div",{className:"setup-nav",children:[l.jsx(ue,{type:"button",variant:"outline",onClick:Ht,children:"Back"}),l.jsx(ue,{type:"button",disabled:!Le||!k||pe,onClick:Ks,children:pe?"Creating...":"Create project"})]})]})]});case 2:return l.jsxs(Me,{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"})]}),Z?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."}),Z?l.jsxs("div",{className:"compact-stack",children:[l.jsx("ul",{className:"detail-list",children:pt.map(ae=>l.jsx("li",{children:ae},ae))}),l.jsxs("div",{className:"setup-nav",children:[l.jsx(ue,{type:"button",variant:"outline",onClick:Ht,children:"Back"}),l.jsx(ue,{type:"button",onClick:()=>b(3),children:"Continue"})]})]}):l.jsxs("div",{className:"compact-stack",children:[ie.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:re,onChange:ae=>ce(ae.target.value),children:ie.map(ae=>l.jsxs("option",{value:ae.name,children:[ae.displayName??ae.name,ae.model?` (${ae.model})`:""]},ae.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:ae=>de(Number(ae.target.value)),children:[3,5,10,15,20].map(ae=>l.jsx("option",{value:ae,children:ae},ae))})]}),l.jsx(ue,{type:"button",variant:"outline",disabled:De||!re,onClick:Vs,children:De?"Analyzing site...":"Generate"})]}),Ge?l.jsx("p",{className:"text-rose-400 text-sm",children:Ge}):null]}):null,l.jsxs("div",{className:"flex items-center gap-2 text-zinc-500 text-xs uppercase tracking-wide",children:[l.jsx("span",{className:"flex-1 border-t border-zinc-800"}),"or type manually",l.jsx("span",{className:"flex-1 border-t border-zinc-800"})]}),l.jsxs("div",{className:"setup-field",children:[l.jsx("label",{className:"setup-label",htmlFor:"keywords",children:"Key phrases (one per line)"}),l.jsx("textarea",{id:"keywords",className:"setup-textarea",rows:6,placeholder:`emergency dentist brooklyn
|
|
244
|
+
best invisalign downtown brooklyn
|
|
245
|
+
pediatric dentist brooklyn heights`,value:we,onChange:ae=>I(ae.target.value)})]}),q?l.jsx("p",{className:"text-rose-400 text-sm",children:q}):null,l.jsxs("div",{className:"setup-nav",children:[l.jsx(ue,{type:"button",variant:"outline",onClick:Ht,children:"Back"}),l.jsx(ue,{type:"button",disabled:pt.length===0||O,onClick:ws,children:O?"Saving...":`Save ${pt.length} key phrase${pt.length!==1?"s":""}`})]})]})]});case 3:return l.jsxs(Me,{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"})]}),ut?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."}),ut?l.jsxs("div",{className:"compact-stack",children:[l.jsx("ul",{className:"detail-list",children:an.map(ae=>l.jsx("li",{children:ae},ae))}),l.jsxs("div",{className:"setup-nav",children:[l.jsx(ue,{type:"button",variant:"outline",onClick:Ht,children:"Back"}),l.jsx(ue,{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:me,onChange:ae=>Xe(ae.target.value)})]}),_t?l.jsx("p",{className:"text-rose-400 text-sm",children:_t}):null,l.jsxs("div",{className:"setup-nav",children:[l.jsx(ue,{type:"button",variant:"outline",onClick:Ht,children:"Back"}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx(ue,{type:"button",variant:"outline",onClick:()=>b(4),children:"Skip"}),l.jsx(ue,{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(Me,{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(ue,{type:"button",onClick:()=>v({to:B?`/projects/${B}`:"/"}),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:A}),"."]}),le?l.jsx("p",{className:"text-rose-400 text-sm",children:le}):null,l.jsxs("div",{className:"setup-nav",children:[l.jsx(ue,{type:"button",variant:"outline",onClick:Ht,children:"Back"}),l.jsx(ue,{type:"button",disabled:Ie,onClick:_e,children:Ie?"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:Ke})]})}function n4(){return l.jsx("div",{className:"page-container",children:l.jsx("section",{className:"page-section",children:l.jsxs(Me,{className:"surface-card empty-card",children:[l.jsx("h1",{children:"Route not found"}),l.jsx("p",{children:"The current path does not map to a dashboard view."}),l.jsx(ue,{asChild:!0,children:l.jsx(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(Ai.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(Qp,{tab:"overview"})}),o4=as({getParentRoute:()=>ad,path:"/search-console",component:()=>l.jsx(Qp,{tab:"search-console"})}),l4=as({getParentRoute:()=>ad,path:"/analytics",component:()=>l.jsx(Qp,{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(Ai.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:Rm||"/",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,Rb,Rb),t=N.useCallback(s=>{RS(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,{})]})}));
|