@ainyc/canonry 4.50.0 → 4.51.1

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.
Files changed (29) hide show
  1. package/assets/assets/BacklinksPage-DIZCcqsP.js +1 -0
  2. package/assets/assets/ChartPrimitives-9Kx3gzQL.js +1 -0
  3. package/assets/assets/ProjectPage-R2cxJb5Y.js +6 -0
  4. package/assets/assets/RunRow-DqezNIUy.js +1 -0
  5. package/assets/assets/RunsPage-CfvTJ9Ny.js +1 -0
  6. package/assets/assets/SettingsPage-HfMGIa5v.js +1 -0
  7. package/assets/assets/TrafficPage-DV_Dvpl3.js +1 -0
  8. package/assets/assets/TrafficSourceDetailPage-lefreKBO.js +1 -0
  9. package/assets/assets/arrow-left-DpxpMUNt.js +1 -0
  10. package/assets/assets/index-DKBPD33e.js +210 -0
  11. package/assets/assets/{index-DOP3oQmw.css → index-DeGyEwik.css} +1 -1
  12. package/assets/assets/server-traffic-Bm8iKtXK.js +1 -0
  13. package/assets/assets/trash-2-CnBiLbiZ.js +1 -0
  14. package/assets/assets/{vendor-markdown-DN2199pt.js → vendor-markdown-DK7fbRNb.js} +1 -1
  15. package/assets/assets/{vendor-radix-Bvy4KXTI.js → vendor-radix-B57xfQbP.js} +1 -1
  16. package/assets/assets/{vendor-recharts-DPeiXMwW.js → vendor-recharts-DWvKDyBF.js} +1 -1
  17. package/assets/assets/vendor-tanstack-Dq7p98wZ.js +1 -0
  18. package/assets/index.html +6 -6
  19. package/dist/{chunk-QIG3TKL4.js → chunk-2ARCCG5E.js} +72 -1
  20. package/dist/{chunk-M4USKXJ4.js → chunk-DLDLDWH4.js} +128 -40
  21. package/dist/{chunk-MYDJ25GO.js → chunk-GGXU5VKI.js} +111 -77
  22. package/dist/{chunk-YVP5CTSV.js → chunk-JOKPYAEL.js} +2178 -1624
  23. package/dist/cli.js +6 -6
  24. package/dist/index.js +4 -4
  25. package/dist/{intelligence-service-TY7IPRST.js → intelligence-service-XMZEWLCW.js} +2 -2
  26. package/dist/mcp.js +2 -2
  27. package/package.json +9 -9
  28. package/assets/assets/index-DVK0M62U.js +0 -214
  29. package/assets/assets/vendor-tanstack-DPXTJtWt.js +0 -1
@@ -0,0 +1,210 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ProjectPage-R2cxJb5Y.js","./vendor-tanstack-Dq7p98wZ.js","./RunRow-DqezNIUy.js","./ChartPrimitives-9Kx3gzQL.js","./server-traffic-Bm8iKtXK.js","./vendor-recharts-DWvKDyBF.js","./trash-2-CnBiLbiZ.js","./vendor-radix-B57xfQbP.js","./vendor-markdown-DK7fbRNb.js","./RunsPage-CfvTJ9Ny.js","./SettingsPage-HfMGIa5v.js","./BacklinksPage-DIZCcqsP.js","./TrafficPage-DV_Dvpl3.js","./arrow-left-DpxpMUNt.js","./TrafficSourceDetailPage-lefreKBO.js"])))=>i.map(i=>d[i]);
2
+ import{c as Fx,d as Wx,Q as ew,M as tw,r as U,q as Ge,j as f,L as rt,a as nw,e as ks,u as Gn,f as aw,h as cc,k as iw,l as sw,m as Pb,O as Kb,n as Ka,o as Ai,p as rw,s as Bt,t as Qb,v as Gs,x as ow,y as lw,z as cw}from"./vendor-tanstack-Dq7p98wZ.js";import{S as uw,O as Of,P as Yb,C as Df,a as Xb,T as Rf,D as Jb,R as Fb}from"./vendor-radix-B57xfQbP.js";import{c as Wb}from"./vendor-recharts-DWvKDyBF.js";import{M as dw}from"./vendor-markdown-DK7fbRNb.js";(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))r(l);new MutationObserver(l=>{for(const c of l)if(c.type==="childList")for(const d of c.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&r(d)}).observe(document,{childList:!0,subtree:!0});function i(l){const c={};return l.integrity&&(c.integrity=l.integrity),l.referrerPolicy&&(c.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?c.credentials="include":l.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function r(l){if(l.ep)return;l.ep=!0;const c=i(l);fetch(l.href,c)}})();var Kd={exports:{}},Kr={},Qd={exports:{}},Yd={};var jy;function fw(){return jy||(jy=1,(function(e){function n($,F){var pe=$.length;$.push(F);e:for(;0<pe;){var je=pe-1>>>1,se=$[je];if(0<l(se,F))$[je]=F,$[pe]=se,pe=je;else break e}}function i($){return $.length===0?null:$[0]}function r($){if($.length===0)return null;var F=$[0],pe=$.pop();if(pe!==F){$[0]=pe;e:for(var je=0,se=$.length,Ye=se>>>1;je<Ye;){var Q=2*(je+1)-1,le=$[Q],ne=Q+1,ue=$[ne];if(0>l(le,pe))ne<se&&0>l(ue,le)?($[je]=ue,$[ne]=pe,je=ne):($[je]=le,$[Q]=pe,je=Q);else if(ne<se&&0>l(ue,pe))$[je]=ue,$[ne]=pe,je=ne;else break e}}return F}function l($,F){var pe=$.sortIndex-F.sortIndex;return pe!==0?pe:$.id-F.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,m=d.now();e.unstable_now=function(){return d.now()-m}}var g=[],b=[],v=1,S=null,w=3,_=!1,C=!1,N=!1,T=!1,L=typeof setTimeout=="function"?setTimeout:null,Z=typeof clearTimeout=="function"?clearTimeout:null,J=typeof setImmediate<"u"?setImmediate:null;function K($){for(var F=i(b);F!==null;){if(F.callback===null)r(b);else if(F.startTime<=$)r(b),F.sortIndex=F.expirationTime,n(g,F);else break;F=i(b)}}function X($){if(N=!1,K($),!C)if(i(g)!==null)C=!0,G||(G=!0,de());else{var F=i(b);F!==null&&be(X,F.startTime-$)}}var G=!1,D=-1,R=5,oe=-1;function Ne(){return T?!0:!(e.unstable_now()-oe<R)}function te(){if(T=!1,G){var $=e.unstable_now();oe=$;var F=!0;try{e:{C=!1,N&&(N=!1,Z(D),D=-1),_=!0;var pe=w;try{t:{for(K($),S=i(g);S!==null&&!(S.expirationTime>$&&Ne());){var je=S.callback;if(typeof je=="function"){S.callback=null,w=S.priorityLevel;var se=je(S.expirationTime<=$);if($=e.unstable_now(),typeof se=="function"){S.callback=se,K($),F=!0;break t}S===i(g)&&r(g),K($)}else r(g);S=i(g)}if(S!==null)F=!0;else{var Ye=i(b);Ye!==null&&be(X,Ye.startTime-$),F=!1}}break e}finally{S=null,w=pe,_=!1}F=void 0}}finally{F?de():G=!1}}}var de;if(typeof J=="function")de=function(){J(te)};else if(typeof MessageChannel<"u"){var Me=new MessageChannel,Qe=Me.port2;Me.port1.onmessage=te,de=function(){Qe.postMessage(null)}}else de=function(){L(te,0)};function be($,F){D=L(function(){$(e.unstable_now())},F)}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($){$.callback=null},e.unstable_forceFrameRate=function($){0>$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<$?Math.floor(1e3/$):5},e.unstable_getCurrentPriorityLevel=function(){return w},e.unstable_next=function($){switch(w){case 1:case 2:case 3:var F=3;break;default:F=w}var pe=w;w=F;try{return $()}finally{w=pe}},e.unstable_requestPaint=function(){T=!0},e.unstable_runWithPriority=function($,F){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var pe=w;w=$;try{return F()}finally{w=pe}},e.unstable_scheduleCallback=function($,F,pe){var je=e.unstable_now();switch(typeof pe=="object"&&pe!==null?(pe=pe.delay,pe=typeof pe=="number"&&0<pe?je+pe:je):pe=je,$){case 1:var se=-1;break;case 2:se=250;break;case 5:se=1073741823;break;case 4:se=1e4;break;default:se=5e3}return se=pe+se,$={id:v++,callback:F,priorityLevel:$,startTime:pe,expirationTime:se,sortIndex:-1},pe>je?($.sortIndex=pe,n(b,$),i(g)===null&&$===i(b)&&(N?(Z(D),D=-1):N=!0,be(X,pe-je))):($.sortIndex=se,n(g,$),C||_||(C=!0,G||(G=!0,de()))),$},e.unstable_shouldYield=Ne,e.unstable_wrapCallback=function($){var F=w;return function(){var pe=w;w=F;try{return $.apply(this,arguments)}finally{w=pe}}}})(Yd)),Yd}var Ny;function pw(){return Ny||(Ny=1,Qd.exports=fw()),Qd.exports}var ky;function mw(){if(ky)return Kr;ky=1;var e=pw(),n=Fx(),i=Wx();function r(t){var a="https://react.dev/errors/"+t;if(1<arguments.length){a+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)a+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+t+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function c(t){var a=t,s=t;if(t.alternate)for(;a.return;)a=a.return;else{t=a;do a=t,(a.flags&4098)!==0&&(s=a.return),t=a.return;while(t)}return a.tag===3?s:null}function d(t){if(t.tag===13){var a=t.memoizedState;if(a===null&&(t=t.alternate,t!==null&&(a=t.memoizedState)),a!==null)return a.dehydrated}return null}function m(t){if(t.tag===31){var a=t.memoizedState;if(a===null&&(t=t.alternate,t!==null&&(a=t.memoizedState)),a!==null)return a.dehydrated}return null}function g(t){if(c(t)!==t)throw Error(r(188))}function b(t){var a=t.alternate;if(!a){if(a=c(t),a===null)throw Error(r(188));return a!==t?null:t}for(var s=t,o=a;;){var u=s.return;if(u===null)break;var p=u.alternate;if(p===null){if(o=u.return,o!==null){s=o;continue}break}if(u.child===p.child){for(p=u.child;p;){if(p===s)return g(u),t;if(p===o)return g(u),a;p=p.sibling}throw Error(r(188))}if(s.return!==o.return)s=u,o=p;else{for(var y=!1,x=u.child;x;){if(x===s){y=!0,s=u,o=p;break}if(x===o){y=!0,o=u,s=p;break}x=x.sibling}if(!y){for(x=p.child;x;){if(x===s){y=!0,s=p,o=u;break}if(x===o){y=!0,o=p,s=u;break}x=x.sibling}if(!y)throw Error(r(189))}}if(s.alternate!==o)throw Error(r(190))}if(s.tag!==3)throw Error(r(188));return s.stateNode.current===s?t:a}function v(t){var a=t.tag;if(a===5||a===26||a===27||a===6)return t;for(t=t.child;t!==null;){if(a=v(t),a!==null)return a;t=t.sibling}return null}var S=Object.assign,w=Symbol.for("react.element"),_=Symbol.for("react.transitional.element"),C=Symbol.for("react.portal"),N=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),L=Symbol.for("react.profiler"),Z=Symbol.for("react.consumer"),J=Symbol.for("react.context"),K=Symbol.for("react.forward_ref"),X=Symbol.for("react.suspense"),G=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),oe=Symbol.for("react.activity"),Ne=Symbol.for("react.memo_cache_sentinel"),te=Symbol.iterator;function de(t){return t===null||typeof t!="object"?null:(t=te&&t[te]||t["@@iterator"],typeof t=="function"?t:null)}var Me=Symbol.for("react.client.reference");function Qe(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===Me?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case N:return"Fragment";case L:return"Profiler";case T:return"StrictMode";case X:return"Suspense";case G:return"SuspenseList";case oe:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case C:return"Portal";case J:return t.displayName||"Context";case Z:return(t._context.displayName||"Context")+".Consumer";case K:var a=t.render;return t=t.displayName,t||(t=a.displayName||a.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case D:return a=t.displayName||null,a!==null?a:Qe(t.type)||"Memo";case R:a=t._payload,t=t._init;try{return Qe(t(a))}catch{}}return null}var be=Array.isArray,$=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,pe={pending:!1,data:null,method:null,action:null},je=[],se=-1;function Ye(t){return{current:t}}function Q(t){0>se||(t.current=je[se],je[se]=null,se--)}function le(t,a){se++,je[se]=t.current,t.current=a}var ne=Ye(null),ue=Ye(null),ae=Ye(null),Ae=Ye(null);function tt(t,a){switch(le(ae,a),le(ue,t),le(ne,null),a.nodeType){case 9:case 11:t=(t=a.documentElement)&&(t=t.namespaceURI)?Pg(t):0;break;default:if(t=a.tagName,a=a.namespaceURI)a=Pg(a),t=Kg(a,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}Q(ne),le(ne,t)}function xe(){Q(ne),Q(ue),Q(ae)}function $e(t){t.memoizedState!==null&&le(Ae,t);var a=ne.current,s=Kg(a,t.type);a!==s&&(le(ue,t),le(ne,s))}function Ze(t){ue.current===t&&(Q(ne),Q(ue)),Ae.current===t&&(Q(Ae),Ir._currentValue=pe)}var Ct,_n;function Tt(t){if(Ct===void 0)try{throw Error()}catch(s){var a=s.stack.trim().match(/\n( *(at )?)/);Ct=a&&a[1]||"",_n=-1<s.stack.indexOf(`
3
+ at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
4
+ `+Ct+t+_n}var Fs=!1;function Ei(t,a){if(!t||Fs)return"";Fs=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var o={DetermineComponentFrameRoot:function(){try{if(a){var Y=function(){throw Error()};if(Object.defineProperty(Y.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Y,[])}catch(V){var q=V}Reflect.construct(t,[],Y)}else{try{Y.call()}catch(V){q=V}t.call(Y.prototype)}}else{try{throw Error()}catch(V){q=V}(Y=t())&&typeof Y.catch=="function"&&Y.catch(function(){})}}catch(V){if(V&&q&&typeof V.stack=="string")return[V.stack,q.stack]}return[null,null]}};o.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var u=Object.getOwnPropertyDescriptor(o.DetermineComponentFrameRoot,"name");u&&u.configurable&&Object.defineProperty(o.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var p=o.DetermineComponentFrameRoot(),y=p[0],x=p[1];if(y&&x){var A=y.split(`
5
+ `),B=x.split(`
6
+ `);for(u=o=0;o<A.length&&!A[o].includes("DetermineComponentFrameRoot");)o++;for(;u<B.length&&!B[u].includes("DetermineComponentFrameRoot");)u++;if(o===A.length||u===B.length)for(o=A.length-1,u=B.length-1;1<=o&&0<=u&&A[o]!==B[u];)u--;for(;1<=o&&0<=u;o--,u--)if(A[o]!==B[u]){if(o!==1||u!==1)do if(o--,u--,0>u||A[o]!==B[u]){var I=`
7
+ `+A[o].replace(" at new "," at ");return t.displayName&&I.includes("<anonymous>")&&(I=I.replace("<anonymous>",t.displayName)),I}while(1<=o&&0<=u);break}}}finally{Fs=!1,Error.prepareStackTrace=s}return(s=t?t.displayName||t.name:"")?Tt(s):""}function Rc(t,a){switch(t.tag){case 26:case 27:case 5:return Tt(t.type);case 16:return Tt("Lazy");case 13:return t.child!==a&&a!==null?Tt("Suspense Fallback"):Tt("Suspense");case 19:return Tt("SuspenseList");case 0:case 15:return Ei(t.type,!1);case 11:return Ei(t.type.render,!1);case 1:return Ei(t.type,!0);case 31:return Tt("Activity");default:return""}}function Ws(t){try{var a="",s=null;do a+=Rc(t,s),s=t,t=t.return;while(t);return a}catch(o){return`
8
+ Error generating stack: `+o.message+`
9
+ `+o.stack}}var Oi=Object.prototype.hasOwnProperty,Di=e.unstable_scheduleCallback,Ri=e.unstable_cancelCallback,mo=e.unstable_shouldYield,Mc=e.unstable_requestPaint,Lt=e.unstable_now,ho=e.unstable_getCurrentPriorityLevel,er=e.unstable_ImmediatePriority,go=e.unstable_UserBlockingPriority,Mi=e.unstable_NormalPriority,Bc=e.unstable_LowPriority,Bi=e.unstable_IdlePriority,yo=e.log,tr=e.unstable_setDisableYieldValue,ga=null,qt=null;function zn(t){if(typeof yo=="function"&&tr(t),qt&&typeof qt.setStrictMode=="function")try{qt.setStrictMode(ga,t)}catch{}}var mt=Math.clz32?Math.clz32:Lc,Ln=Math.log,Fa=Math.LN2;function Lc(t){return t>>>=0,t===0?32:31-(Ln(t)/Fa|0)|0}var Li=256,qi=262144,$i=4194304;function Pn(t){var a=t&42;if(a!==0)return a;switch(t&-t){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 t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Ui(t,a,s){var o=t.pendingLanes;if(o===0)return 0;var u=0,p=t.suspendedLanes,y=t.pingedLanes;t=t.warmLanes;var x=o&134217727;return x!==0?(o=x&~p,o!==0?u=Pn(o):(y&=x,y!==0?u=Pn(y):s||(s=x&~t,s!==0&&(u=Pn(s))))):(x=o&~p,x!==0?u=Pn(x):y!==0?u=Pn(y):s||(s=o&~t,s!==0&&(u=Pn(s)))),u===0?0:a!==0&&a!==u&&(a&p)===0&&(p=u&-u,s=a&-a,p>=s||p===32&&(s&4194048)!==0)?a:u}function Wa(t,a){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&a)===0}function Kn(t,a){switch(t){case 1:case 2:case 4:case 8:case 64:return a+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 a+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 bo(){var t=$i;return $i<<=1,($i&62914560)===0&&($i=4194304),t}function ee(t){for(var a=[],s=0;31>s;s++)a.push(t);return a}function We(t,a){t.pendingLanes|=a,a!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function ei(t,a,s,o,u,p){var y=t.pendingLanes;t.pendingLanes=s,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=s,t.entangledLanes&=s,t.errorRecoveryDisabledLanes&=s,t.shellSuspendCounter=0;var x=t.entanglements,A=t.expirationTimes,B=t.hiddenUpdates;for(s=y&~s;0<s;){var I=31-mt(s),Y=1<<I;x[I]=0,A[I]=-1;var q=B[I];if(q!==null)for(B[I]=null,I=0;I<q.length;I++){var V=q[I];V!==null&&(V.lane&=-536870913)}s&=~Y}o!==0&&vo(t,o,0),p!==0&&u===0&&t.tag!==0&&(t.suspendedLanes|=p&~(y&~a))}function vo(t,a,s){t.pendingLanes|=a,t.suspendedLanes&=~a;var o=31-mt(a);t.entangledLanes|=a,t.entanglements[o]=t.entanglements[o]|1073741824|s&261930}function So(t,a){var s=t.entangledLanes|=a;for(t=t.entanglements;s;){var o=31-mt(s),u=1<<o;u&a|t[o]&a&&(t[o]|=a),s&=~u}}function nr(t,a){var s=a&-a;return s=(s&42)!==0?1:ar(s),(s&(t.suspendedLanes|a))!==0?0:s}function ar(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=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:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function Cn(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function Ep(){var t=F.p;return t!==0?t:(t=window.event,t===void 0?32:gy(t.type))}function Op(t,a){var s=F.p;try{return F.p=t,a()}finally{F.p=s}}var ya=Math.random().toString(36).slice(2),Et="__reactFiber$"+ya,Zt="__reactProps$"+ya,Vi="__reactContainer$"+ya,qc="__reactEvents$"+ya,V1="__reactListeners$"+ya,G1="__reactHandles$"+ya,Dp="__reactResources$"+ya,ir="__reactMarker$"+ya;function $c(t){delete t[Et],delete t[Zt],delete t[qc],delete t[V1],delete t[G1]}function Gi(t){var a=t[Et];if(a)return a;for(var s=t.parentNode;s;){if(a=s[Vi]||s[Et]){if(s=a.alternate,a.child!==null||s!==null&&s.child!==null)for(t=ey(t);t!==null;){if(s=t[Et])return s;t=ey(t)}return a}t=s,s=t.parentNode}return null}function Ii(t){if(t=t[Et]||t[Vi]){var a=t.tag;if(a===5||a===6||a===13||a===31||a===26||a===27||a===3)return t}return null}function sr(t){var a=t.tag;if(a===5||a===26||a===27||a===6)return t.stateNode;throw Error(r(33))}function Hi(t){var a=t[Dp];return a||(a=t[Dp]={hoistableStyles:new Map,hoistableScripts:new Map}),a}function _t(t){t[ir]=!0}var Rp=new Set,Mp={};function ti(t,a){Zi(t,a),Zi(t+"Capture",a)}function Zi(t,a){for(Mp[t]=a,t=0;t<a.length;t++)Rp.add(a[t])}var I1=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]*$"),Bp={},Lp={};function H1(t){return Oi.call(Lp,t)?!0:Oi.call(Bp,t)?!1:I1.test(t)?Lp[t]=!0:(Bp[t]=!0,!1)}function xo(t,a,s){if(H1(a))if(s===null)t.removeAttribute(a);else{switch(typeof s){case"undefined":case"function":case"symbol":t.removeAttribute(a);return;case"boolean":var o=a.toLowerCase().slice(0,5);if(o!=="data-"&&o!=="aria-"){t.removeAttribute(a);return}}t.setAttribute(a,""+s)}}function wo(t,a,s){if(s===null)t.removeAttribute(a);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(a);return}t.setAttribute(a,""+s)}}function Qn(t,a,s,o){if(o===null)t.removeAttribute(s);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(s);return}t.setAttributeNS(a,s,""+o)}}function un(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function qp(t){var a=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function Z1(t,a,s){var o=Object.getOwnPropertyDescriptor(t.constructor.prototype,a);if(!t.hasOwnProperty(a)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var u=o.get,p=o.set;return Object.defineProperty(t,a,{configurable:!0,get:function(){return u.call(this)},set:function(y){s=""+y,p.call(this,y)}}),Object.defineProperty(t,a,{enumerable:o.enumerable}),{getValue:function(){return s},setValue:function(y){s=""+y},stopTracking:function(){t._valueTracker=null,delete t[a]}}}}function Uc(t){if(!t._valueTracker){var a=qp(t)?"checked":"value";t._valueTracker=Z1(t,a,""+t[a])}}function $p(t){if(!t)return!1;var a=t._valueTracker;if(!a)return!0;var s=a.getValue(),o="";return t&&(o=qp(t)?t.checked?"true":"false":t.value),t=o,t!==s?(a.setValue(t),!0):!1}function jo(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var P1=/[\n"\\]/g;function dn(t){return t.replace(P1,function(a){return"\\"+a.charCodeAt(0).toString(16)+" "})}function Vc(t,a,s,o,u,p,y,x){t.name="",y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"?t.type=y:t.removeAttribute("type"),a!=null?y==="number"?(a===0&&t.value===""||t.value!=a)&&(t.value=""+un(a)):t.value!==""+un(a)&&(t.value=""+un(a)):y!=="submit"&&y!=="reset"||t.removeAttribute("value"),a!=null?Gc(t,y,un(a)):s!=null?Gc(t,y,un(s)):o!=null&&t.removeAttribute("value"),u==null&&p!=null&&(t.defaultChecked=!!p),u!=null&&(t.checked=u&&typeof u!="function"&&typeof u!="symbol"),x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"?t.name=""+un(x):t.removeAttribute("name")}function Up(t,a,s,o,u,p,y,x){if(p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"&&(t.type=p),a!=null||s!=null){if(!(p!=="submit"&&p!=="reset"||a!=null)){Uc(t);return}s=s!=null?""+un(s):"",a=a!=null?""+un(a):s,x||a===t.value||(t.value=a),t.defaultValue=a}o=o??u,o=typeof o!="function"&&typeof o!="symbol"&&!!o,t.checked=x?t.checked:!!o,t.defaultChecked=!!o,y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(t.name=y),Uc(t)}function Gc(t,a,s){a==="number"&&jo(t.ownerDocument)===t||t.defaultValue===""+s||(t.defaultValue=""+s)}function Pi(t,a,s,o){if(t=t.options,a){a={};for(var u=0;u<s.length;u++)a["$"+s[u]]=!0;for(s=0;s<t.length;s++)u=a.hasOwnProperty("$"+t[s].value),t[s].selected!==u&&(t[s].selected=u),u&&o&&(t[s].defaultSelected=!0)}else{for(s=""+un(s),a=null,u=0;u<t.length;u++){if(t[u].value===s){t[u].selected=!0,o&&(t[u].defaultSelected=!0);return}a!==null||t[u].disabled||(a=t[u])}a!==null&&(a.selected=!0)}}function Vp(t,a,s){if(a!=null&&(a=""+un(a),a!==t.value&&(t.value=a),s==null)){t.defaultValue!==a&&(t.defaultValue=a);return}t.defaultValue=s!=null?""+un(s):""}function Gp(t,a,s,o){if(a==null){if(o!=null){if(s!=null)throw Error(r(92));if(be(o)){if(1<o.length)throw Error(r(93));o=o[0]}s=o}s==null&&(s=""),a=s}s=un(a),t.defaultValue=s,o=t.textContent,o===s&&o!==""&&o!==null&&(t.value=o),Uc(t)}function Ki(t,a){if(a){var s=t.firstChild;if(s&&s===t.lastChild&&s.nodeType===3){s.nodeValue=a;return}}t.textContent=a}var K1=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 Ip(t,a,s){var o=a.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?o?t.setProperty(a,""):a==="float"?t.cssFloat="":t[a]="":o?t.setProperty(a,s):typeof s!="number"||s===0||K1.has(a)?a==="float"?t.cssFloat=s:t[a]=(""+s).trim():t[a]=s+"px"}function Hp(t,a,s){if(a!=null&&typeof a!="object")throw Error(r(62));if(t=t.style,s!=null){for(var o in s)!s.hasOwnProperty(o)||a!=null&&a.hasOwnProperty(o)||(o.indexOf("--")===0?t.setProperty(o,""):o==="float"?t.cssFloat="":t[o]="");for(var u in a)o=a[u],a.hasOwnProperty(u)&&s[u]!==o&&Ip(t,u,o)}else for(var p in a)a.hasOwnProperty(p)&&Ip(t,p,a[p])}function Ic(t){if(t.indexOf("-")===-1)return!1;switch(t){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 Q1=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"]]),Y1=/^[\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 No(t){return Y1.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function Yn(){}var Hc=null;function Zc(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Qi=null,Yi=null;function Zp(t){var a=Ii(t);if(a&&(t=a.stateNode)){var s=t[Zt]||null;e:switch(t=a.stateNode,a.type){case"input":if(Vc(t,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),a=s.name,s.type==="radio"&&a!=null){for(s=t;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+dn(""+a)+'"][type="radio"]'),a=0;a<s.length;a++){var o=s[a];if(o!==t&&o.form===t.form){var u=o[Zt]||null;if(!u)throw Error(r(90));Vc(o,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name)}}for(a=0;a<s.length;a++)o=s[a],o.form===t.form&&$p(o)}break e;case"textarea":Vp(t,s.value,s.defaultValue);break e;case"select":a=s.value,a!=null&&Pi(t,!!s.multiple,a,!1)}}}var Pc=!1;function Pp(t,a,s){if(Pc)return t(a,s);Pc=!0;try{var o=t(a);return o}finally{if(Pc=!1,(Qi!==null||Yi!==null)&&(dl(),Qi&&(a=Qi,t=Yi,Yi=Qi=null,Zp(a),t)))for(a=0;a<t.length;a++)Zp(t[a])}}function rr(t,a){var s=t.stateNode;if(s===null)return null;var o=s[Zt]||null;if(o===null)return null;s=o[a];e:switch(a){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(o=!o.disabled)||(t=t.type,o=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!o;break e;default:t=!1}if(t)return null;if(s&&typeof s!="function")throw Error(r(231,a,typeof s));return s}var Xn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Kc=!1;if(Xn)try{var or={};Object.defineProperty(or,"passive",{get:function(){Kc=!0}}),window.addEventListener("test",or,or),window.removeEventListener("test",or,or)}catch{Kc=!1}var ba=null,Qc=null,ko=null;function Kp(){if(ko)return ko;var t,a=Qc,s=a.length,o,u="value"in ba?ba.value:ba.textContent,p=u.length;for(t=0;t<s&&a[t]===u[t];t++);var y=s-t;for(o=1;o<=y&&a[s-o]===u[p-o];o++);return ko=u.slice(t,1<o?1-o:void 0)}function Ao(t){var a=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&a===13&&(t=13)):t=a,t===10&&(t=13),32<=t||t===13?t:0}function _o(){return!0}function Qp(){return!1}function Pt(t){function a(s,o,u,p,y){this._reactName=s,this._targetInst=u,this.type=o,this.nativeEvent=p,this.target=y,this.currentTarget=null;for(var x in t)t.hasOwnProperty(x)&&(s=t[x],this[x]=s?s(p):p[x]);return this.isDefaultPrevented=(p.defaultPrevented!=null?p.defaultPrevented:p.returnValue===!1)?_o:Qp,this.isPropagationStopped=Qp,this}return S(a.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=_o)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=_o)},persist:function(){},isPersistent:_o}),a}var ni={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},zo=Pt(ni),lr=S({},ni,{view:0,detail:0}),X1=Pt(lr),Yc,Xc,cr,Co=S({},lr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Fc,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==cr&&(cr&&t.type==="mousemove"?(Yc=t.screenX-cr.screenX,Xc=t.screenY-cr.screenY):Xc=Yc=0,cr=t),Yc)},movementY:function(t){return"movementY"in t?t.movementY:Xc}}),Yp=Pt(Co),J1=S({},Co,{dataTransfer:0}),F1=Pt(J1),W1=S({},lr,{relatedTarget:0}),Jc=Pt(W1),eS=S({},ni,{animationName:0,elapsedTime:0,pseudoElement:0}),tS=Pt(eS),nS=S({},ni,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),aS=Pt(nS),iS=S({},ni,{data:0}),Xp=Pt(iS),sS={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},rS={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"},oS={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function lS(t){var a=this.nativeEvent;return a.getModifierState?a.getModifierState(t):(t=oS[t])?!!a[t]:!1}function Fc(){return lS}var cS=S({},lr,{key:function(t){if(t.key){var a=sS[t.key]||t.key;if(a!=="Unidentified")return a}return t.type==="keypress"?(t=Ao(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?rS[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Fc,charCode:function(t){return t.type==="keypress"?Ao(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Ao(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),uS=Pt(cS),dS=S({},Co,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Jp=Pt(dS),fS=S({},lr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Fc}),pS=Pt(fS),mS=S({},ni,{propertyName:0,elapsedTime:0,pseudoElement:0}),hS=Pt(mS),gS=S({},Co,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),yS=Pt(gS),bS=S({},ni,{newState:0,oldState:0}),vS=Pt(bS),SS=[9,13,27,32],Wc=Xn&&"CompositionEvent"in window,ur=null;Xn&&"documentMode"in document&&(ur=document.documentMode);var xS=Xn&&"TextEvent"in window&&!ur,Fp=Xn&&(!Wc||ur&&8<ur&&11>=ur),Wp=" ",em=!1;function tm(t,a){switch(t){case"keyup":return SS.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function nm(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Xi=!1;function wS(t,a){switch(t){case"compositionend":return nm(a);case"keypress":return a.which!==32?null:(em=!0,Wp);case"textInput":return t=a.data,t===Wp&&em?null:t;default:return null}}function jS(t,a){if(Xi)return t==="compositionend"||!Wc&&tm(t,a)?(t=Kp(),ko=Qc=ba=null,Xi=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1<a.char.length)return a.char;if(a.which)return String.fromCharCode(a.which)}return null;case"compositionend":return Fp&&a.locale!=="ko"?null:a.data;default:return null}}var NS={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 am(t){var a=t&&t.nodeName&&t.nodeName.toLowerCase();return a==="input"?!!NS[t.type]:a==="textarea"}function im(t,a,s,o){Qi?Yi?Yi.push(o):Yi=[o]:Qi=o,a=bl(a,"onChange"),0<a.length&&(s=new zo("onChange","change",null,s,o),t.push({event:s,listeners:a}))}var dr=null,fr=null;function kS(t){Ug(t,0)}function To(t){var a=sr(t);if($p(a))return t}function sm(t,a){if(t==="change")return a}var rm=!1;if(Xn){var eu;if(Xn){var tu="oninput"in document;if(!tu){var om=document.createElement("div");om.setAttribute("oninput","return;"),tu=typeof om.oninput=="function"}eu=tu}else eu=!1;rm=eu&&(!document.documentMode||9<document.documentMode)}function lm(){dr&&(dr.detachEvent("onpropertychange",cm),fr=dr=null)}function cm(t){if(t.propertyName==="value"&&To(fr)){var a=[];im(a,fr,t,Zc(t)),Pp(kS,a)}}function AS(t,a,s){t==="focusin"?(lm(),dr=a,fr=s,dr.attachEvent("onpropertychange",cm)):t==="focusout"&&lm()}function _S(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return To(fr)}function zS(t,a){if(t==="click")return To(a)}function CS(t,a){if(t==="input"||t==="change")return To(a)}function TS(t,a){return t===a&&(t!==0||1/t===1/a)||t!==t&&a!==a}var tn=typeof Object.is=="function"?Object.is:TS;function pr(t,a){if(tn(t,a))return!0;if(typeof t!="object"||t===null||typeof a!="object"||a===null)return!1;var s=Object.keys(t),o=Object.keys(a);if(s.length!==o.length)return!1;for(o=0;o<s.length;o++){var u=s[o];if(!Oi.call(a,u)||!tn(t[u],a[u]))return!1}return!0}function um(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function dm(t,a){var s=um(t);t=0;for(var o;s;){if(s.nodeType===3){if(o=t+s.textContent.length,t<=a&&o>=a)return{node:s,offset:a-t};t=o}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=um(s)}}function fm(t,a){return t&&a?t===a?!0:t&&t.nodeType===3?!1:a&&a.nodeType===3?fm(t,a.parentNode):"contains"in t?t.contains(a):t.compareDocumentPosition?!!(t.compareDocumentPosition(a)&16):!1:!1}function pm(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var a=jo(t.document);a instanceof t.HTMLIFrameElement;){try{var s=typeof a.contentWindow.location.href=="string"}catch{s=!1}if(s)t=a.contentWindow;else break;a=jo(t.document)}return a}function nu(t){var a=t&&t.nodeName&&t.nodeName.toLowerCase();return a&&(a==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||a==="textarea"||t.contentEditable==="true")}var ES=Xn&&"documentMode"in document&&11>=document.documentMode,Ji=null,au=null,mr=null,iu=!1;function mm(t,a,s){var o=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;iu||Ji==null||Ji!==jo(o)||(o=Ji,"selectionStart"in o&&nu(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),mr&&pr(mr,o)||(mr=o,o=bl(au,"onSelect"),0<o.length&&(a=new zo("onSelect","select",null,a,s),t.push({event:a,listeners:o}),a.target=Ji)))}function ai(t,a){var s={};return s[t.toLowerCase()]=a.toLowerCase(),s["Webkit"+t]="webkit"+a,s["Moz"+t]="moz"+a,s}var Fi={animationend:ai("Animation","AnimationEnd"),animationiteration:ai("Animation","AnimationIteration"),animationstart:ai("Animation","AnimationStart"),transitionrun:ai("Transition","TransitionRun"),transitionstart:ai("Transition","TransitionStart"),transitioncancel:ai("Transition","TransitionCancel"),transitionend:ai("Transition","TransitionEnd")},su={},hm={};Xn&&(hm=document.createElement("div").style,"AnimationEvent"in window||(delete Fi.animationend.animation,delete Fi.animationiteration.animation,delete Fi.animationstart.animation),"TransitionEvent"in window||delete Fi.transitionend.transition);function ii(t){if(su[t])return su[t];if(!Fi[t])return t;var a=Fi[t],s;for(s in a)if(a.hasOwnProperty(s)&&s in hm)return su[t]=a[s];return t}var gm=ii("animationend"),ym=ii("animationiteration"),bm=ii("animationstart"),OS=ii("transitionrun"),DS=ii("transitionstart"),RS=ii("transitioncancel"),vm=ii("transitionend"),Sm=new Map,ru="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(" ");ru.push("scrollEnd");function Tn(t,a){Sm.set(t,a),ti(a,[t])}var Eo=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var a=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(a))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},fn=[],Wi=0,ou=0;function Oo(){for(var t=Wi,a=ou=Wi=0;a<t;){var s=fn[a];fn[a++]=null;var o=fn[a];fn[a++]=null;var u=fn[a];fn[a++]=null;var p=fn[a];if(fn[a++]=null,o!==null&&u!==null){var y=o.pending;y===null?u.next=u:(u.next=y.next,y.next=u),o.pending=u}p!==0&&xm(s,u,p)}}function Do(t,a,s,o){fn[Wi++]=t,fn[Wi++]=a,fn[Wi++]=s,fn[Wi++]=o,ou|=o,t.lanes|=o,t=t.alternate,t!==null&&(t.lanes|=o)}function lu(t,a,s,o){return Do(t,a,s,o),Ro(t)}function si(t,a){return Do(t,null,null,a),Ro(t)}function xm(t,a,s){t.lanes|=s;var o=t.alternate;o!==null&&(o.lanes|=s);for(var u=!1,p=t.return;p!==null;)p.childLanes|=s,o=p.alternate,o!==null&&(o.childLanes|=s),p.tag===22&&(t=p.stateNode,t===null||t._visibility&1||(u=!0)),t=p,p=p.return;return t.tag===3?(p=t.stateNode,u&&a!==null&&(u=31-mt(s),t=p.hiddenUpdates,o=t[u],o===null?t[u]=[a]:o.push(a),a.lane=s|536870912),p):null}function Ro(t){if(50<Br)throw Br=0,yd=null,Error(r(185));for(var a=t.return;a!==null;)t=a,a=t.return;return t.tag===3?t.stateNode:null}var es={};function MS(t,a,s,o){this.tag=t,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=a,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function nn(t,a,s,o){return new MS(t,a,s,o)}function cu(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Jn(t,a){var s=t.alternate;return s===null?(s=nn(t.tag,a,t.key,t.mode),s.elementType=t.elementType,s.type=t.type,s.stateNode=t.stateNode,s.alternate=t,t.alternate=s):(s.pendingProps=a,s.type=t.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=t.flags&65011712,s.childLanes=t.childLanes,s.lanes=t.lanes,s.child=t.child,s.memoizedProps=t.memoizedProps,s.memoizedState=t.memoizedState,s.updateQueue=t.updateQueue,a=t.dependencies,s.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},s.sibling=t.sibling,s.index=t.index,s.ref=t.ref,s.refCleanup=t.refCleanup,s}function wm(t,a){t.flags&=65011714;var s=t.alternate;return s===null?(t.childLanes=0,t.lanes=a,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=s.childLanes,t.lanes=s.lanes,t.child=s.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=s.memoizedProps,t.memoizedState=s.memoizedState,t.updateQueue=s.updateQueue,t.type=s.type,a=s.dependencies,t.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),t}function Mo(t,a,s,o,u,p){var y=0;if(o=t,typeof t=="function")cu(t)&&(y=1);else if(typeof t=="string")y=Ux(t,s,ne.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case oe:return t=nn(31,s,a,u),t.elementType=oe,t.lanes=p,t;case N:return ri(s.children,u,p,a);case T:y=8,u|=24;break;case L:return t=nn(12,s,a,u|2),t.elementType=L,t.lanes=p,t;case X:return t=nn(13,s,a,u),t.elementType=X,t.lanes=p,t;case G:return t=nn(19,s,a,u),t.elementType=G,t.lanes=p,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case J:y=10;break e;case Z:y=9;break e;case K:y=11;break e;case D:y=14;break e;case R:y=16,o=null;break e}y=29,s=Error(r(130,t===null?"null":typeof t,"")),o=null}return a=nn(y,s,a,u),a.elementType=t,a.type=o,a.lanes=p,a}function ri(t,a,s,o){return t=nn(7,t,o,a),t.lanes=s,t}function uu(t,a,s){return t=nn(6,t,null,a),t.lanes=s,t}function jm(t){var a=nn(18,null,null,0);return a.stateNode=t,a}function du(t,a,s){return a=nn(4,t.children!==null?t.children:[],t.key,a),a.lanes=s,a.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},a}var Nm=new WeakMap;function pn(t,a){if(typeof t=="object"&&t!==null){var s=Nm.get(t);return s!==void 0?s:(a={value:t,source:a,stack:Ws(a)},Nm.set(t,a),a)}return{value:t,source:a,stack:Ws(a)}}var ts=[],ns=0,Bo=null,hr=0,mn=[],hn=0,va=null,qn=1,$n="";function Fn(t,a){ts[ns++]=hr,ts[ns++]=Bo,Bo=t,hr=a}function km(t,a,s){mn[hn++]=qn,mn[hn++]=$n,mn[hn++]=va,va=t;var o=qn;t=$n;var u=32-mt(o)-1;o&=~(1<<u),s+=1;var p=32-mt(a)+u;if(30<p){var y=u-u%5;p=(o&(1<<y)-1).toString(32),o>>=y,u-=y,qn=1<<32-mt(a)+u|s<<u|o,$n=p+t}else qn=1<<p|s<<u|o,$n=t}function fu(t){t.return!==null&&(Fn(t,1),km(t,1,0))}function pu(t){for(;t===Bo;)Bo=ts[--ns],ts[ns]=null,hr=ts[--ns],ts[ns]=null;for(;t===va;)va=mn[--hn],mn[hn]=null,$n=mn[--hn],mn[hn]=null,qn=mn[--hn],mn[hn]=null}function Am(t,a){mn[hn++]=qn,mn[hn++]=$n,mn[hn++]=va,qn=a.id,$n=a.overflow,va=t}var Ot=null,it=null,Be=!1,Sa=null,gn=!1,mu=Error(r(519));function xa(t){var a=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw gr(pn(a,t)),mu}function _m(t){var a=t.stateNode,s=t.type,o=t.memoizedProps;switch(a[Et]=t,a[Zt]=o,s){case"dialog":Oe("cancel",a),Oe("close",a);break;case"iframe":case"object":case"embed":Oe("load",a);break;case"video":case"audio":for(s=0;s<qr.length;s++)Oe(qr[s],a);break;case"source":Oe("error",a);break;case"img":case"image":case"link":Oe("error",a),Oe("load",a);break;case"details":Oe("toggle",a);break;case"input":Oe("invalid",a),Up(a,o.value,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name,!0);break;case"select":Oe("invalid",a);break;case"textarea":Oe("invalid",a),Gp(a,o.value,o.defaultValue,o.children)}s=o.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||a.textContent===""+s||o.suppressHydrationWarning===!0||Hg(a.textContent,s)?(o.popover!=null&&(Oe("beforetoggle",a),Oe("toggle",a)),o.onScroll!=null&&Oe("scroll",a),o.onScrollEnd!=null&&Oe("scrollend",a),o.onClick!=null&&(a.onclick=Yn),a=!0):a=!1,a||xa(t,!0)}function zm(t){for(Ot=t.return;Ot;)switch(Ot.tag){case 5:case 31:case 13:gn=!1;return;case 27:case 3:gn=!0;return;default:Ot=Ot.return}}function as(t){if(t!==Ot)return!1;if(!Be)return zm(t),Be=!0,!1;var a=t.tag,s;if((s=a!==3&&a!==27)&&((s=a===5)&&(s=t.type,s=!(s!=="form"&&s!=="button")||Od(t.type,t.memoizedProps)),s=!s),s&&it&&xa(t),zm(t),a===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(317));it=Wg(t)}else if(a===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(317));it=Wg(t)}else a===27?(a=it,Ma(t.type)?(t=Ld,Ld=null,it=t):it=a):it=Ot?bn(t.stateNode.nextSibling):null;return!0}function oi(){it=Ot=null,Be=!1}function hu(){var t=Sa;return t!==null&&(Xt===null?Xt=t:Xt.push.apply(Xt,t),Sa=null),t}function gr(t){Sa===null?Sa=[t]:Sa.push(t)}var gu=Ye(null),li=null,Wn=null;function wa(t,a,s){le(gu,a._currentValue),a._currentValue=s}function ea(t){t._currentValue=gu.current,Q(gu)}function yu(t,a,s){for(;t!==null;){var o=t.alternate;if((t.childLanes&a)!==a?(t.childLanes|=a,o!==null&&(o.childLanes|=a)):o!==null&&(o.childLanes&a)!==a&&(o.childLanes|=a),t===s)break;t=t.return}}function bu(t,a,s,o){var u=t.child;for(u!==null&&(u.return=t);u!==null;){var p=u.dependencies;if(p!==null){var y=u.child;p=p.firstContext;e:for(;p!==null;){var x=p;p=u;for(var A=0;A<a.length;A++)if(x.context===a[A]){p.lanes|=s,x=p.alternate,x!==null&&(x.lanes|=s),yu(p.return,s,t),o||(y=null);break e}p=x.next}}else if(u.tag===18){if(y=u.return,y===null)throw Error(r(341));y.lanes|=s,p=y.alternate,p!==null&&(p.lanes|=s),yu(y,s,t),y=null}else y=u.child;if(y!==null)y.return=u;else for(y=u;y!==null;){if(y===t){y=null;break}if(u=y.sibling,u!==null){u.return=y.return,y=u;break}y=y.return}u=y}}function is(t,a,s,o){t=null;for(var u=a,p=!1;u!==null;){if(!p){if((u.flags&524288)!==0)p=!0;else if((u.flags&262144)!==0)break}if(u.tag===10){var y=u.alternate;if(y===null)throw Error(r(387));if(y=y.memoizedProps,y!==null){var x=u.type;tn(u.pendingProps.value,y.value)||(t!==null?t.push(x):t=[x])}}else if(u===Ae.current){if(y=u.alternate,y===null)throw Error(r(387));y.memoizedState.memoizedState!==u.memoizedState.memoizedState&&(t!==null?t.push(Ir):t=[Ir])}u=u.return}t!==null&&bu(a,t,s,o),a.flags|=262144}function Lo(t){for(t=t.firstContext;t!==null;){if(!tn(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function ci(t){li=t,Wn=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function Dt(t){return Cm(li,t)}function qo(t,a){return li===null&&ci(t),Cm(t,a)}function Cm(t,a){var s=a._currentValue;if(a={context:a,memoizedValue:s,next:null},Wn===null){if(t===null)throw Error(r(308));Wn=a,t.dependencies={lanes:0,firstContext:a},t.flags|=524288}else Wn=Wn.next=a;return s}var BS=typeof AbortController<"u"?AbortController:function(){var t=[],a=this.signal={aborted:!1,addEventListener:function(s,o){t.push(o)}};this.abort=function(){a.aborted=!0,t.forEach(function(s){return s()})}},LS=e.unstable_scheduleCallback,qS=e.unstable_NormalPriority,St={$$typeof:J,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function vu(){return{controller:new BS,data:new Map,refCount:0}}function yr(t){t.refCount--,t.refCount===0&&LS(qS,function(){t.controller.abort()})}var br=null,Su=0,ss=0,rs=null;function $S(t,a){if(br===null){var s=br=[];Su=0,ss=jd(),rs={status:"pending",value:void 0,then:function(o){s.push(o)}}}return Su++,a.then(Tm,Tm),a}function Tm(){if(--Su===0&&br!==null){rs!==null&&(rs.status="fulfilled");var t=br;br=null,ss=0,rs=null;for(var a=0;a<t.length;a++)(0,t[a])()}}function US(t,a){var s=[],o={status:"pending",value:null,reason:null,then:function(u){s.push(u)}};return t.then(function(){o.status="fulfilled",o.value=a;for(var u=0;u<s.length;u++)(0,s[u])(a)},function(u){for(o.status="rejected",o.reason=u,u=0;u<s.length;u++)(0,s[u])(void 0)}),o}var Em=$.S;$.S=function(t,a){mg=Lt(),typeof a=="object"&&a!==null&&typeof a.then=="function"&&$S(t,a),Em!==null&&Em(t,a)};var ui=Ye(null);function xu(){var t=ui.current;return t!==null?t:et.pooledCache}function $o(t,a){a===null?le(ui,ui.current):le(ui,a.pool)}function Om(){var t=xu();return t===null?null:{parent:St._currentValue,pool:t}}var os=Error(r(460)),wu=Error(r(474)),Uo=Error(r(542)),Vo={then:function(){}};function Dm(t){return t=t.status,t==="fulfilled"||t==="rejected"}function Rm(t,a,s){switch(s=t[s],s===void 0?t.push(a):s!==a&&(a.then(Yn,Yn),a=s),a.status){case"fulfilled":return a.value;case"rejected":throw t=a.reason,Bm(t),t;default:if(typeof a.status=="string")a.then(Yn,Yn);else{if(t=et,t!==null&&100<t.shellSuspendCounter)throw Error(r(482));t=a,t.status="pending",t.then(function(o){if(a.status==="pending"){var u=a;u.status="fulfilled",u.value=o}},function(o){if(a.status==="pending"){var u=a;u.status="rejected",u.reason=o}})}switch(a.status){case"fulfilled":return a.value;case"rejected":throw t=a.reason,Bm(t),t}throw fi=a,os}}function di(t){try{var a=t._init;return a(t._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(fi=s,os):s}}var fi=null;function Mm(){if(fi===null)throw Error(r(459));var t=fi;return fi=null,t}function Bm(t){if(t===os||t===Uo)throw Error(r(483))}var ls=null,vr=0;function Go(t){var a=vr;return vr+=1,ls===null&&(ls=[]),Rm(ls,t,a)}function Sr(t,a){a=a.props.ref,t.ref=a!==void 0?a:null}function Io(t,a){throw a.$$typeof===w?Error(r(525)):(t=Object.prototype.toString.call(a),Error(r(31,t==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":t)))}function Lm(t){function a(O,z){if(t){var M=O.deletions;M===null?(O.deletions=[z],O.flags|=16):M.push(z)}}function s(O,z){if(!t)return null;for(;z!==null;)a(O,z),z=z.sibling;return null}function o(O){for(var z=new Map;O!==null;)O.key!==null?z.set(O.key,O):z.set(O.index,O),O=O.sibling;return z}function u(O,z){return O=Jn(O,z),O.index=0,O.sibling=null,O}function p(O,z,M){return O.index=M,t?(M=O.alternate,M!==null?(M=M.index,M<z?(O.flags|=67108866,z):M):(O.flags|=67108866,z)):(O.flags|=1048576,z)}function y(O){return t&&O.alternate===null&&(O.flags|=67108866),O}function x(O,z,M,P){return z===null||z.tag!==6?(z=uu(M,O.mode,P),z.return=O,z):(z=u(z,M),z.return=O,z)}function A(O,z,M,P){var Se=M.type;return Se===N?I(O,z,M.props.children,P,M.key):z!==null&&(z.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===R&&di(Se)===z.type)?(z=u(z,M.props),Sr(z,M),z.return=O,z):(z=Mo(M.type,M.key,M.props,null,O.mode,P),Sr(z,M),z.return=O,z)}function B(O,z,M,P){return z===null||z.tag!==4||z.stateNode.containerInfo!==M.containerInfo||z.stateNode.implementation!==M.implementation?(z=du(M,O.mode,P),z.return=O,z):(z=u(z,M.children||[]),z.return=O,z)}function I(O,z,M,P,Se){return z===null||z.tag!==7?(z=ri(M,O.mode,P,Se),z.return=O,z):(z=u(z,M),z.return=O,z)}function Y(O,z,M){if(typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint")return z=uu(""+z,O.mode,M),z.return=O,z;if(typeof z=="object"&&z!==null){switch(z.$$typeof){case _:return M=Mo(z.type,z.key,z.props,null,O.mode,M),Sr(M,z),M.return=O,M;case C:return z=du(z,O.mode,M),z.return=O,z;case R:return z=di(z),Y(O,z,M)}if(be(z)||de(z))return z=ri(z,O.mode,M,null),z.return=O,z;if(typeof z.then=="function")return Y(O,Go(z),M);if(z.$$typeof===J)return Y(O,qo(O,z),M);Io(O,z)}return null}function q(O,z,M,P){var Se=z!==null?z.key:null;if(typeof M=="string"&&M!==""||typeof M=="number"||typeof M=="bigint")return Se!==null?null:x(O,z,""+M,P);if(typeof M=="object"&&M!==null){switch(M.$$typeof){case _:return M.key===Se?A(O,z,M,P):null;case C:return M.key===Se?B(O,z,M,P):null;case R:return M=di(M),q(O,z,M,P)}if(be(M)||de(M))return Se!==null?null:I(O,z,M,P,null);if(typeof M.then=="function")return q(O,z,Go(M),P);if(M.$$typeof===J)return q(O,z,qo(O,M),P);Io(O,M)}return null}function V(O,z,M,P,Se){if(typeof P=="string"&&P!==""||typeof P=="number"||typeof P=="bigint")return O=O.get(M)||null,x(z,O,""+P,Se);if(typeof P=="object"&&P!==null){switch(P.$$typeof){case _:return O=O.get(P.key===null?M:P.key)||null,A(z,O,P,Se);case C:return O=O.get(P.key===null?M:P.key)||null,B(z,O,P,Se);case R:return P=di(P),V(O,z,M,P,Se)}if(be(P)||de(P))return O=O.get(M)||null,I(z,O,P,Se,null);if(typeof P.then=="function")return V(O,z,M,Go(P),Se);if(P.$$typeof===J)return V(O,z,M,qo(z,P),Se);Io(z,P)}return null}function fe(O,z,M,P){for(var Se=null,Ue=null,ge=z,ze=z=0,Re=null;ge!==null&&ze<M.length;ze++){ge.index>ze?(Re=ge,ge=null):Re=ge.sibling;var Ve=q(O,ge,M[ze],P);if(Ve===null){ge===null&&(ge=Re);break}t&&ge&&Ve.alternate===null&&a(O,ge),z=p(Ve,z,ze),Ue===null?Se=Ve:Ue.sibling=Ve,Ue=Ve,ge=Re}if(ze===M.length)return s(O,ge),Be&&Fn(O,ze),Se;if(ge===null){for(;ze<M.length;ze++)ge=Y(O,M[ze],P),ge!==null&&(z=p(ge,z,ze),Ue===null?Se=ge:Ue.sibling=ge,Ue=ge);return Be&&Fn(O,ze),Se}for(ge=o(ge);ze<M.length;ze++)Re=V(ge,O,ze,M[ze],P),Re!==null&&(t&&Re.alternate!==null&&ge.delete(Re.key===null?ze:Re.key),z=p(Re,z,ze),Ue===null?Se=Re:Ue.sibling=Re,Ue=Re);return t&&ge.forEach(function(Ua){return a(O,Ua)}),Be&&Fn(O,ze),Se}function we(O,z,M,P){if(M==null)throw Error(r(151));for(var Se=null,Ue=null,ge=z,ze=z=0,Re=null,Ve=M.next();ge!==null&&!Ve.done;ze++,Ve=M.next()){ge.index>ze?(Re=ge,ge=null):Re=ge.sibling;var Ua=q(O,ge,Ve.value,P);if(Ua===null){ge===null&&(ge=Re);break}t&&ge&&Ua.alternate===null&&a(O,ge),z=p(Ua,z,ze),Ue===null?Se=Ua:Ue.sibling=Ua,Ue=Ua,ge=Re}if(Ve.done)return s(O,ge),Be&&Fn(O,ze),Se;if(ge===null){for(;!Ve.done;ze++,Ve=M.next())Ve=Y(O,Ve.value,P),Ve!==null&&(z=p(Ve,z,ze),Ue===null?Se=Ve:Ue.sibling=Ve,Ue=Ve);return Be&&Fn(O,ze),Se}for(ge=o(ge);!Ve.done;ze++,Ve=M.next())Ve=V(ge,O,ze,Ve.value,P),Ve!==null&&(t&&Ve.alternate!==null&&ge.delete(Ve.key===null?ze:Ve.key),z=p(Ve,z,ze),Ue===null?Se=Ve:Ue.sibling=Ve,Ue=Ve);return t&&ge.forEach(function(Jx){return a(O,Jx)}),Be&&Fn(O,ze),Se}function Fe(O,z,M,P){if(typeof M=="object"&&M!==null&&M.type===N&&M.key===null&&(M=M.props.children),typeof M=="object"&&M!==null){switch(M.$$typeof){case _:e:{for(var Se=M.key;z!==null;){if(z.key===Se){if(Se=M.type,Se===N){if(z.tag===7){s(O,z.sibling),P=u(z,M.props.children),P.return=O,O=P;break e}}else if(z.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===R&&di(Se)===z.type){s(O,z.sibling),P=u(z,M.props),Sr(P,M),P.return=O,O=P;break e}s(O,z);break}else a(O,z);z=z.sibling}M.type===N?(P=ri(M.props.children,O.mode,P,M.key),P.return=O,O=P):(P=Mo(M.type,M.key,M.props,null,O.mode,P),Sr(P,M),P.return=O,O=P)}return y(O);case C:e:{for(Se=M.key;z!==null;){if(z.key===Se)if(z.tag===4&&z.stateNode.containerInfo===M.containerInfo&&z.stateNode.implementation===M.implementation){s(O,z.sibling),P=u(z,M.children||[]),P.return=O,O=P;break e}else{s(O,z);break}else a(O,z);z=z.sibling}P=du(M,O.mode,P),P.return=O,O=P}return y(O);case R:return M=di(M),Fe(O,z,M,P)}if(be(M))return fe(O,z,M,P);if(de(M)){if(Se=de(M),typeof Se!="function")throw Error(r(150));return M=Se.call(M),we(O,z,M,P)}if(typeof M.then=="function")return Fe(O,z,Go(M),P);if(M.$$typeof===J)return Fe(O,z,qo(O,M),P);Io(O,M)}return typeof M=="string"&&M!==""||typeof M=="number"||typeof M=="bigint"?(M=""+M,z!==null&&z.tag===6?(s(O,z.sibling),P=u(z,M),P.return=O,O=P):(s(O,z),P=uu(M,O.mode,P),P.return=O,O=P),y(O)):s(O,z)}return function(O,z,M,P){try{vr=0;var Se=Fe(O,z,M,P);return ls=null,Se}catch(ge){if(ge===os||ge===Uo)throw ge;var Ue=nn(29,ge,null,O.mode);return Ue.lanes=P,Ue.return=O,Ue}}}var pi=Lm(!0),qm=Lm(!1),ja=!1;function ju(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Nu(t,a){t=t.updateQueue,a.updateQueue===t&&(a.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Na(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function ka(t,a,s){var o=t.updateQueue;if(o===null)return null;if(o=o.shared,(Ie&2)!==0){var u=o.pending;return u===null?a.next=a:(a.next=u.next,u.next=a),o.pending=a,a=Ro(t),xm(t,null,s),a}return Do(t,o,a,s),Ro(t)}function xr(t,a,s){if(a=a.updateQueue,a!==null&&(a=a.shared,(s&4194048)!==0)){var o=a.lanes;o&=t.pendingLanes,s|=o,a.lanes=s,So(t,s)}}function ku(t,a){var s=t.updateQueue,o=t.alternate;if(o!==null&&(o=o.updateQueue,s===o)){var u=null,p=null;if(s=s.firstBaseUpdate,s!==null){do{var y={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};p===null?u=p=y:p=p.next=y,s=s.next}while(s!==null);p===null?u=p=a:p=p.next=a}else u=p=a;s={baseState:o.baseState,firstBaseUpdate:u,lastBaseUpdate:p,shared:o.shared,callbacks:o.callbacks},t.updateQueue=s;return}t=s.lastBaseUpdate,t===null?s.firstBaseUpdate=a:t.next=a,s.lastBaseUpdate=a}var Au=!1;function wr(){if(Au){var t=rs;if(t!==null)throw t}}function jr(t,a,s,o){Au=!1;var u=t.updateQueue;ja=!1;var p=u.firstBaseUpdate,y=u.lastBaseUpdate,x=u.shared.pending;if(x!==null){u.shared.pending=null;var A=x,B=A.next;A.next=null,y===null?p=B:y.next=B,y=A;var I=t.alternate;I!==null&&(I=I.updateQueue,x=I.lastBaseUpdate,x!==y&&(x===null?I.firstBaseUpdate=B:x.next=B,I.lastBaseUpdate=A))}if(p!==null){var Y=u.baseState;y=0,I=B=A=null,x=p;do{var q=x.lane&-536870913,V=q!==x.lane;if(V?(De&q)===q:(o&q)===q){q!==0&&q===ss&&(Au=!0),I!==null&&(I=I.next={lane:0,tag:x.tag,payload:x.payload,callback:null,next:null});e:{var fe=t,we=x;q=a;var Fe=s;switch(we.tag){case 1:if(fe=we.payload,typeof fe=="function"){Y=fe.call(Fe,Y,q);break e}Y=fe;break e;case 3:fe.flags=fe.flags&-65537|128;case 0:if(fe=we.payload,q=typeof fe=="function"?fe.call(Fe,Y,q):fe,q==null)break e;Y=S({},Y,q);break e;case 2:ja=!0}}q=x.callback,q!==null&&(t.flags|=64,V&&(t.flags|=8192),V=u.callbacks,V===null?u.callbacks=[q]:V.push(q))}else V={lane:q,tag:x.tag,payload:x.payload,callback:x.callback,next:null},I===null?(B=I=V,A=Y):I=I.next=V,y|=q;if(x=x.next,x===null){if(x=u.shared.pending,x===null)break;V=x,x=V.next,V.next=null,u.lastBaseUpdate=V,u.shared.pending=null}}while(!0);I===null&&(A=Y),u.baseState=A,u.firstBaseUpdate=B,u.lastBaseUpdate=I,p===null&&(u.shared.lanes=0),Ta|=y,t.lanes=y,t.memoizedState=Y}}function $m(t,a){if(typeof t!="function")throw Error(r(191,t));t.call(a)}function Um(t,a){var s=t.callbacks;if(s!==null)for(t.callbacks=null,t=0;t<s.length;t++)$m(s[t],a)}var cs=Ye(null),Ho=Ye(0);function Vm(t,a){t=ca,le(Ho,t),le(cs,a),ca=t|a.baseLanes}function _u(){le(Ho,ca),le(cs,cs.current)}function zu(){ca=Ho.current,Q(cs),Q(Ho)}var an=Ye(null),yn=null;function Aa(t){var a=t.alternate;le(ht,ht.current&1),le(an,t),yn===null&&(a===null||cs.current!==null||a.memoizedState!==null)&&(yn=t)}function Cu(t){le(ht,ht.current),le(an,t),yn===null&&(yn=t)}function Gm(t){t.tag===22?(le(ht,ht.current),le(an,t),yn===null&&(yn=t)):_a()}function _a(){le(ht,ht.current),le(an,an.current)}function sn(t){Q(an),yn===t&&(yn=null),Q(ht)}var ht=Ye(0);function Zo(t){for(var a=t;a!==null;){if(a.tag===13){var s=a.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||Md(s)||Bd(s)))return a}else if(a.tag===19&&(a.memoizedProps.revealOrder==="forwards"||a.memoizedProps.revealOrder==="backwards"||a.memoizedProps.revealOrder==="unstable_legacy-backwards"||a.memoizedProps.revealOrder==="together")){if((a.flags&128)!==0)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===t)break;for(;a.sibling===null;){if(a.return===null||a.return===t)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}var ta=0,_e=null,Xe=null,xt=null,Po=!1,us=!1,mi=!1,Ko=0,Nr=0,ds=null,VS=0;function ft(){throw Error(r(321))}function Tu(t,a){if(a===null)return!1;for(var s=0;s<a.length&&s<t.length;s++)if(!tn(t[s],a[s]))return!1;return!0}function Eu(t,a,s,o,u,p){return ta=p,_e=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,$.H=t===null||t.memoizedState===null?kh:Pu,mi=!1,p=s(o,u),mi=!1,us&&(p=Hm(a,s,o,u)),Im(t),p}function Im(t){$.H=_r;var a=Xe!==null&&Xe.next!==null;if(ta=0,xt=Xe=_e=null,Po=!1,Nr=0,ds=null,a)throw Error(r(300));t===null||wt||(t=t.dependencies,t!==null&&Lo(t)&&(wt=!0))}function Hm(t,a,s,o){_e=t;var u=0;do{if(us&&(ds=null),Nr=0,us=!1,25<=u)throw Error(r(301));if(u+=1,xt=Xe=null,t.updateQueue!=null){var p=t.updateQueue;p.lastEffect=null,p.events=null,p.stores=null,p.memoCache!=null&&(p.memoCache.index=0)}$.H=Ah,p=a(s,o)}while(us);return p}function GS(){var t=$.H,a=t.useState()[0];return a=typeof a.then=="function"?kr(a):a,t=t.useState()[0],(Xe!==null?Xe.memoizedState:null)!==t&&(_e.flags|=1024),a}function Ou(){var t=Ko!==0;return Ko=0,t}function Du(t,a,s){a.updateQueue=t.updateQueue,a.flags&=-2053,t.lanes&=~s}function Ru(t){if(Po){for(t=t.memoizedState;t!==null;){var a=t.queue;a!==null&&(a.pending=null),t=t.next}Po=!1}ta=0,xt=Xe=_e=null,us=!1,Nr=Ko=0,ds=null}function Ut(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return xt===null?_e.memoizedState=xt=t:xt=xt.next=t,xt}function gt(){if(Xe===null){var t=_e.alternate;t=t!==null?t.memoizedState:null}else t=Xe.next;var a=xt===null?_e.memoizedState:xt.next;if(a!==null)xt=a,Xe=t;else{if(t===null)throw _e.alternate===null?Error(r(467)):Error(r(310));Xe=t,t={memoizedState:Xe.memoizedState,baseState:Xe.baseState,baseQueue:Xe.baseQueue,queue:Xe.queue,next:null},xt===null?_e.memoizedState=xt=t:xt=xt.next=t}return xt}function Qo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function kr(t){var a=Nr;return Nr+=1,ds===null&&(ds=[]),t=Rm(ds,t,a),a=_e,(xt===null?a.memoizedState:xt.next)===null&&(a=a.alternate,$.H=a===null||a.memoizedState===null?kh:Pu),t}function Yo(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return kr(t);if(t.$$typeof===J)return Dt(t)}throw Error(r(438,String(t)))}function Mu(t){var a=null,s=_e.updateQueue;if(s!==null&&(a=s.memoCache),a==null){var o=_e.alternate;o!==null&&(o=o.updateQueue,o!==null&&(o=o.memoCache,o!=null&&(a={data:o.data.map(function(u){return u.slice()}),index:0})))}if(a==null&&(a={data:[],index:0}),s===null&&(s=Qo(),_e.updateQueue=s),s.memoCache=a,s=a.data[a.index],s===void 0)for(s=a.data[a.index]=Array(t),o=0;o<t;o++)s[o]=Ne;return a.index++,s}function na(t,a){return typeof a=="function"?a(t):a}function Xo(t){var a=gt();return Bu(a,Xe,t)}function Bu(t,a,s){var o=t.queue;if(o===null)throw Error(r(311));o.lastRenderedReducer=s;var u=t.baseQueue,p=o.pending;if(p!==null){if(u!==null){var y=u.next;u.next=p.next,p.next=y}a.baseQueue=u=p,o.pending=null}if(p=t.baseState,u===null)t.memoizedState=p;else{a=u.next;var x=y=null,A=null,B=a,I=!1;do{var Y=B.lane&-536870913;if(Y!==B.lane?(De&Y)===Y:(ta&Y)===Y){var q=B.revertLane;if(q===0)A!==null&&(A=A.next={lane:0,revertLane:0,gesture:null,action:B.action,hasEagerState:B.hasEagerState,eagerState:B.eagerState,next:null}),Y===ss&&(I=!0);else if((ta&q)===q){B=B.next,q===ss&&(I=!0);continue}else Y={lane:0,revertLane:B.revertLane,gesture:null,action:B.action,hasEagerState:B.hasEagerState,eagerState:B.eagerState,next:null},A===null?(x=A=Y,y=p):A=A.next=Y,_e.lanes|=q,Ta|=q;Y=B.action,mi&&s(p,Y),p=B.hasEagerState?B.eagerState:s(p,Y)}else q={lane:Y,revertLane:B.revertLane,gesture:B.gesture,action:B.action,hasEagerState:B.hasEagerState,eagerState:B.eagerState,next:null},A===null?(x=A=q,y=p):A=A.next=q,_e.lanes|=Y,Ta|=Y;B=B.next}while(B!==null&&B!==a);if(A===null?y=p:A.next=x,!tn(p,t.memoizedState)&&(wt=!0,I&&(s=rs,s!==null)))throw s;t.memoizedState=p,t.baseState=y,t.baseQueue=A,o.lastRenderedState=p}return u===null&&(o.lanes=0),[t.memoizedState,o.dispatch]}function Lu(t){var a=gt(),s=a.queue;if(s===null)throw Error(r(311));s.lastRenderedReducer=t;var o=s.dispatch,u=s.pending,p=a.memoizedState;if(u!==null){s.pending=null;var y=u=u.next;do p=t(p,y.action),y=y.next;while(y!==u);tn(p,a.memoizedState)||(wt=!0),a.memoizedState=p,a.baseQueue===null&&(a.baseState=p),s.lastRenderedState=p}return[p,o]}function Zm(t,a,s){var o=_e,u=gt(),p=Be;if(p){if(s===void 0)throw Error(r(407));s=s()}else s=a();var y=!tn((Xe||u).memoizedState,s);if(y&&(u.memoizedState=s,wt=!0),u=u.queue,Uu(Qm.bind(null,o,u,t),[t]),u.getSnapshot!==a||y||xt!==null&&xt.memoizedState.tag&1){if(o.flags|=2048,fs(9,{destroy:void 0},Km.bind(null,o,u,s,a),null),et===null)throw Error(r(349));p||(ta&127)!==0||Pm(o,a,s)}return s}function Pm(t,a,s){t.flags|=16384,t={getSnapshot:a,value:s},a=_e.updateQueue,a===null?(a=Qo(),_e.updateQueue=a,a.stores=[t]):(s=a.stores,s===null?a.stores=[t]:s.push(t))}function Km(t,a,s,o){a.value=s,a.getSnapshot=o,Ym(a)&&Xm(t)}function Qm(t,a,s){return s(function(){Ym(a)&&Xm(t)})}function Ym(t){var a=t.getSnapshot;t=t.value;try{var s=a();return!tn(t,s)}catch{return!0}}function Xm(t){var a=si(t,2);a!==null&&Jt(a,t,2)}function qu(t){var a=Ut();if(typeof t=="function"){var s=t;if(t=s(),mi){zn(!0);try{s()}finally{zn(!1)}}}return a.memoizedState=a.baseState=t,a.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:na,lastRenderedState:t},a}function Jm(t,a,s,o){return t.baseState=s,Bu(t,Xe,typeof o=="function"?o:na)}function IS(t,a,s,o,u){if(Wo(t))throw Error(r(485));if(t=a.action,t!==null){var p={payload:u,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(y){p.listeners.push(y)}};$.T!==null?s(!0):p.isTransition=!1,o(p),s=a.pending,s===null?(p.next=a.pending=p,Fm(a,p)):(p.next=s.next,a.pending=s.next=p)}}function Fm(t,a){var s=a.action,o=a.payload,u=t.state;if(a.isTransition){var p=$.T,y={};$.T=y;try{var x=s(u,o),A=$.S;A!==null&&A(y,x),Wm(t,a,x)}catch(B){$u(t,a,B)}finally{p!==null&&y.types!==null&&(p.types=y.types),$.T=p}}else try{p=s(u,o),Wm(t,a,p)}catch(B){$u(t,a,B)}}function Wm(t,a,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(o){eh(t,a,o)},function(o){return $u(t,a,o)}):eh(t,a,s)}function eh(t,a,s){a.status="fulfilled",a.value=s,th(a),t.state=s,a=t.pending,a!==null&&(s=a.next,s===a?t.pending=null:(s=s.next,a.next=s,Fm(t,s)))}function $u(t,a,s){var o=t.pending;if(t.pending=null,o!==null){o=o.next;do a.status="rejected",a.reason=s,th(a),a=a.next;while(a!==o)}t.action=null}function th(t){t=t.listeners;for(var a=0;a<t.length;a++)(0,t[a])()}function nh(t,a){return a}function ah(t,a){if(Be){var s=et.formState;if(s!==null){e:{var o=_e;if(Be){if(it){t:{for(var u=it,p=gn;u.nodeType!==8;){if(!p){u=null;break t}if(u=bn(u.nextSibling),u===null){u=null;break t}}p=u.data,u=p==="F!"||p==="F"?u:null}if(u){it=bn(u.nextSibling),o=u.data==="F!";break e}}xa(o)}o=!1}o&&(a=s[0])}}return s=Ut(),s.memoizedState=s.baseState=a,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:nh,lastRenderedState:a},s.queue=o,s=wh.bind(null,_e,o),o.dispatch=s,o=qu(!1),p=Zu.bind(null,_e,!1,o.queue),o=Ut(),u={state:a,dispatch:null,action:t,pending:null},o.queue=u,s=IS.bind(null,_e,u,p,s),u.dispatch=s,o.memoizedState=t,[a,s,!1]}function ih(t){var a=gt();return sh(a,Xe,t)}function sh(t,a,s){if(a=Bu(t,a,nh)[0],t=Xo(na)[0],typeof a=="object"&&a!==null&&typeof a.then=="function")try{var o=kr(a)}catch(y){throw y===os?Uo:y}else o=a;a=gt();var u=a.queue,p=u.dispatch;return s!==a.memoizedState&&(_e.flags|=2048,fs(9,{destroy:void 0},HS.bind(null,u,s),null)),[o,p,t]}function HS(t,a){t.action=a}function rh(t){var a=gt(),s=Xe;if(s!==null)return sh(a,s,t);gt(),a=a.memoizedState,s=gt();var o=s.queue.dispatch;return s.memoizedState=t,[a,o,!1]}function fs(t,a,s,o){return t={tag:t,create:s,deps:o,inst:a,next:null},a=_e.updateQueue,a===null&&(a=Qo(),_e.updateQueue=a),s=a.lastEffect,s===null?a.lastEffect=t.next=t:(o=s.next,s.next=t,t.next=o,a.lastEffect=t),t}function oh(){return gt().memoizedState}function Jo(t,a,s,o){var u=Ut();_e.flags|=t,u.memoizedState=fs(1|a,{destroy:void 0},s,o===void 0?null:o)}function Fo(t,a,s,o){var u=gt();o=o===void 0?null:o;var p=u.memoizedState.inst;Xe!==null&&o!==null&&Tu(o,Xe.memoizedState.deps)?u.memoizedState=fs(a,p,s,o):(_e.flags|=t,u.memoizedState=fs(1|a,p,s,o))}function lh(t,a){Jo(8390656,8,t,a)}function Uu(t,a){Fo(2048,8,t,a)}function ZS(t){_e.flags|=4;var a=_e.updateQueue;if(a===null)a=Qo(),_e.updateQueue=a,a.events=[t];else{var s=a.events;s===null?a.events=[t]:s.push(t)}}function ch(t){var a=gt().memoizedState;return ZS({ref:a,nextImpl:t}),function(){if((Ie&2)!==0)throw Error(r(440));return a.impl.apply(void 0,arguments)}}function uh(t,a){return Fo(4,2,t,a)}function dh(t,a){return Fo(4,4,t,a)}function fh(t,a){if(typeof a=="function"){t=t();var s=a(t);return function(){typeof s=="function"?s():a(null)}}if(a!=null)return t=t(),a.current=t,function(){a.current=null}}function ph(t,a,s){s=s!=null?s.concat([t]):null,Fo(4,4,fh.bind(null,a,t),s)}function Vu(){}function mh(t,a){var s=gt();a=a===void 0?null:a;var o=s.memoizedState;return a!==null&&Tu(a,o[1])?o[0]:(s.memoizedState=[t,a],t)}function hh(t,a){var s=gt();a=a===void 0?null:a;var o=s.memoizedState;if(a!==null&&Tu(a,o[1]))return o[0];if(o=t(),mi){zn(!0);try{t()}finally{zn(!1)}}return s.memoizedState=[o,a],o}function Gu(t,a,s){return s===void 0||(ta&1073741824)!==0&&(De&261930)===0?t.memoizedState=a:(t.memoizedState=s,t=gg(),_e.lanes|=t,Ta|=t,s)}function gh(t,a,s,o){return tn(s,a)?s:cs.current!==null?(t=Gu(t,s,o),tn(t,a)||(wt=!0),t):(ta&42)===0||(ta&1073741824)!==0&&(De&261930)===0?(wt=!0,t.memoizedState=s):(t=gg(),_e.lanes|=t,Ta|=t,a)}function yh(t,a,s,o,u){var p=F.p;F.p=p!==0&&8>p?p:8;var y=$.T,x={};$.T=x,Zu(t,!1,a,s);try{var A=u(),B=$.S;if(B!==null&&B(x,A),A!==null&&typeof A=="object"&&typeof A.then=="function"){var I=US(A,o);Ar(t,a,I,ln(t))}else Ar(t,a,o,ln(t))}catch(Y){Ar(t,a,{then:function(){},status:"rejected",reason:Y},ln())}finally{F.p=p,y!==null&&x.types!==null&&(y.types=x.types),$.T=y}}function PS(){}function Iu(t,a,s,o){if(t.tag!==5)throw Error(r(476));var u=bh(t).queue;yh(t,u,a,pe,s===null?PS:function(){return vh(t),s(o)})}function bh(t){var a=t.memoizedState;if(a!==null)return a;a={memoizedState:pe,baseState:pe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:na,lastRenderedState:pe},next:null};var s={};return a.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:na,lastRenderedState:s},next:null},t.memoizedState=a,t=t.alternate,t!==null&&(t.memoizedState=a),a}function vh(t){var a=bh(t);a.next===null&&(a=t.alternate.memoizedState),Ar(t,a.next.queue,{},ln())}function Hu(){return Dt(Ir)}function Sh(){return gt().memoizedState}function xh(){return gt().memoizedState}function KS(t){for(var a=t.return;a!==null;){switch(a.tag){case 24:case 3:var s=ln();t=Na(s);var o=ka(a,t,s);o!==null&&(Jt(o,a,s),xr(o,a,s)),a={cache:vu()},t.payload=a;return}a=a.return}}function QS(t,a,s){var o=ln();s={lane:o,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Wo(t)?jh(a,s):(s=lu(t,a,s,o),s!==null&&(Jt(s,t,o),Nh(s,a,o)))}function wh(t,a,s){var o=ln();Ar(t,a,s,o)}function Ar(t,a,s,o){var u={lane:o,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(Wo(t))jh(a,u);else{var p=t.alternate;if(t.lanes===0&&(p===null||p.lanes===0)&&(p=a.lastRenderedReducer,p!==null))try{var y=a.lastRenderedState,x=p(y,s);if(u.hasEagerState=!0,u.eagerState=x,tn(x,y))return Do(t,a,u,0),et===null&&Oo(),!1}catch{}if(s=lu(t,a,u,o),s!==null)return Jt(s,t,o),Nh(s,a,o),!0}return!1}function Zu(t,a,s,o){if(o={lane:2,revertLane:jd(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},Wo(t)){if(a)throw Error(r(479))}else a=lu(t,s,o,2),a!==null&&Jt(a,t,2)}function Wo(t){var a=t.alternate;return t===_e||a!==null&&a===_e}function jh(t,a){us=Po=!0;var s=t.pending;s===null?a.next=a:(a.next=s.next,s.next=a),t.pending=a}function Nh(t,a,s){if((s&4194048)!==0){var o=a.lanes;o&=t.pendingLanes,s|=o,a.lanes=s,So(t,s)}}var _r={readContext:Dt,use:Yo,useCallback:ft,useContext:ft,useEffect:ft,useImperativeHandle:ft,useLayoutEffect:ft,useInsertionEffect:ft,useMemo:ft,useReducer:ft,useRef:ft,useState:ft,useDebugValue:ft,useDeferredValue:ft,useTransition:ft,useSyncExternalStore:ft,useId:ft,useHostTransitionStatus:ft,useFormState:ft,useActionState:ft,useOptimistic:ft,useMemoCache:ft,useCacheRefresh:ft};_r.useEffectEvent=ft;var kh={readContext:Dt,use:Yo,useCallback:function(t,a){return Ut().memoizedState=[t,a===void 0?null:a],t},useContext:Dt,useEffect:lh,useImperativeHandle:function(t,a,s){s=s!=null?s.concat([t]):null,Jo(4194308,4,fh.bind(null,a,t),s)},useLayoutEffect:function(t,a){return Jo(4194308,4,t,a)},useInsertionEffect:function(t,a){Jo(4,2,t,a)},useMemo:function(t,a){var s=Ut();a=a===void 0?null:a;var o=t();if(mi){zn(!0);try{t()}finally{zn(!1)}}return s.memoizedState=[o,a],o},useReducer:function(t,a,s){var o=Ut();if(s!==void 0){var u=s(a);if(mi){zn(!0);try{s(a)}finally{zn(!1)}}}else u=a;return o.memoizedState=o.baseState=u,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:u},o.queue=t,t=t.dispatch=QS.bind(null,_e,t),[o.memoizedState,t]},useRef:function(t){var a=Ut();return t={current:t},a.memoizedState=t},useState:function(t){t=qu(t);var a=t.queue,s=wh.bind(null,_e,a);return a.dispatch=s,[t.memoizedState,s]},useDebugValue:Vu,useDeferredValue:function(t,a){var s=Ut();return Gu(s,t,a)},useTransition:function(){var t=qu(!1);return t=yh.bind(null,_e,t.queue,!0,!1),Ut().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,a,s){var o=_e,u=Ut();if(Be){if(s===void 0)throw Error(r(407));s=s()}else{if(s=a(),et===null)throw Error(r(349));(De&127)!==0||Pm(o,a,s)}u.memoizedState=s;var p={value:s,getSnapshot:a};return u.queue=p,lh(Qm.bind(null,o,p,t),[t]),o.flags|=2048,fs(9,{destroy:void 0},Km.bind(null,o,p,s,a),null),s},useId:function(){var t=Ut(),a=et.identifierPrefix;if(Be){var s=$n,o=qn;s=(o&~(1<<32-mt(o)-1)).toString(32)+s,a="_"+a+"R_"+s,s=Ko++,0<s&&(a+="H"+s.toString(32)),a+="_"}else s=VS++,a="_"+a+"r_"+s.toString(32)+"_";return t.memoizedState=a},useHostTransitionStatus:Hu,useFormState:ah,useActionState:ah,useOptimistic:function(t){var a=Ut();a.memoizedState=a.baseState=t;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return a.queue=s,a=Zu.bind(null,_e,!0,s),s.dispatch=a,[t,a]},useMemoCache:Mu,useCacheRefresh:function(){return Ut().memoizedState=KS.bind(null,_e)},useEffectEvent:function(t){var a=Ut(),s={impl:t};return a.memoizedState=s,function(){if((Ie&2)!==0)throw Error(r(440));return s.impl.apply(void 0,arguments)}}},Pu={readContext:Dt,use:Yo,useCallback:mh,useContext:Dt,useEffect:Uu,useImperativeHandle:ph,useInsertionEffect:uh,useLayoutEffect:dh,useMemo:hh,useReducer:Xo,useRef:oh,useState:function(){return Xo(na)},useDebugValue:Vu,useDeferredValue:function(t,a){var s=gt();return gh(s,Xe.memoizedState,t,a)},useTransition:function(){var t=Xo(na)[0],a=gt().memoizedState;return[typeof t=="boolean"?t:kr(t),a]},useSyncExternalStore:Zm,useId:Sh,useHostTransitionStatus:Hu,useFormState:ih,useActionState:ih,useOptimistic:function(t,a){var s=gt();return Jm(s,Xe,t,a)},useMemoCache:Mu,useCacheRefresh:xh};Pu.useEffectEvent=ch;var Ah={readContext:Dt,use:Yo,useCallback:mh,useContext:Dt,useEffect:Uu,useImperativeHandle:ph,useInsertionEffect:uh,useLayoutEffect:dh,useMemo:hh,useReducer:Lu,useRef:oh,useState:function(){return Lu(na)},useDebugValue:Vu,useDeferredValue:function(t,a){var s=gt();return Xe===null?Gu(s,t,a):gh(s,Xe.memoizedState,t,a)},useTransition:function(){var t=Lu(na)[0],a=gt().memoizedState;return[typeof t=="boolean"?t:kr(t),a]},useSyncExternalStore:Zm,useId:Sh,useHostTransitionStatus:Hu,useFormState:rh,useActionState:rh,useOptimistic:function(t,a){var s=gt();return Xe!==null?Jm(s,Xe,t,a):(s.baseState=t,[t,s.queue.dispatch])},useMemoCache:Mu,useCacheRefresh:xh};Ah.useEffectEvent=ch;function Ku(t,a,s,o){a=t.memoizedState,s=s(o,a),s=s==null?a:S({},a,s),t.memoizedState=s,t.lanes===0&&(t.updateQueue.baseState=s)}var Qu={enqueueSetState:function(t,a,s){t=t._reactInternals;var o=ln(),u=Na(o);u.payload=a,s!=null&&(u.callback=s),a=ka(t,u,o),a!==null&&(Jt(a,t,o),xr(a,t,o))},enqueueReplaceState:function(t,a,s){t=t._reactInternals;var o=ln(),u=Na(o);u.tag=1,u.payload=a,s!=null&&(u.callback=s),a=ka(t,u,o),a!==null&&(Jt(a,t,o),xr(a,t,o))},enqueueForceUpdate:function(t,a){t=t._reactInternals;var s=ln(),o=Na(s);o.tag=2,a!=null&&(o.callback=a),a=ka(t,o,s),a!==null&&(Jt(a,t,s),xr(a,t,s))}};function _h(t,a,s,o,u,p,y){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(o,p,y):a.prototype&&a.prototype.isPureReactComponent?!pr(s,o)||!pr(u,p):!0}function zh(t,a,s,o){t=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(s,o),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(s,o),a.state!==t&&Qu.enqueueReplaceState(a,a.state,null)}function hi(t,a){var s=a;if("ref"in a){s={};for(var o in a)o!=="ref"&&(s[o]=a[o])}if(t=t.defaultProps){s===a&&(s=S({},s));for(var u in t)s[u]===void 0&&(s[u]=t[u])}return s}function Ch(t){Eo(t)}function Th(t){console.error(t)}function Eh(t){Eo(t)}function el(t,a){try{var s=t.onUncaughtError;s(a.value,{componentStack:a.stack})}catch(o){setTimeout(function(){throw o})}}function Oh(t,a,s){try{var o=t.onCaughtError;o(s.value,{componentStack:s.stack,errorBoundary:a.tag===1?a.stateNode:null})}catch(u){setTimeout(function(){throw u})}}function Yu(t,a,s){return s=Na(s),s.tag=3,s.payload={element:null},s.callback=function(){el(t,a)},s}function Dh(t){return t=Na(t),t.tag=3,t}function Rh(t,a,s,o){var u=s.type.getDerivedStateFromError;if(typeof u=="function"){var p=o.value;t.payload=function(){return u(p)},t.callback=function(){Oh(a,s,o)}}var y=s.stateNode;y!==null&&typeof y.componentDidCatch=="function"&&(t.callback=function(){Oh(a,s,o),typeof u!="function"&&(Ea===null?Ea=new Set([this]):Ea.add(this));var x=o.stack;this.componentDidCatch(o.value,{componentStack:x!==null?x:""})})}function YS(t,a,s,o,u){if(s.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){if(a=s.alternate,a!==null&&is(a,s,u,!0),s=an.current,s!==null){switch(s.tag){case 31:case 13:return yn===null?fl():s.alternate===null&&pt===0&&(pt=3),s.flags&=-257,s.flags|=65536,s.lanes=u,o===Vo?s.flags|=16384:(a=s.updateQueue,a===null?s.updateQueue=new Set([o]):a.add(o),Sd(t,o,u)),!1;case 22:return s.flags|=65536,o===Vo?s.flags|=16384:(a=s.updateQueue,a===null?(a={transitions:null,markerInstances:null,retryQueue:new Set([o])},s.updateQueue=a):(s=a.retryQueue,s===null?a.retryQueue=new Set([o]):s.add(o)),Sd(t,o,u)),!1}throw Error(r(435,s.tag))}return Sd(t,o,u),fl(),!1}if(Be)return a=an.current,a!==null?((a.flags&65536)===0&&(a.flags|=256),a.flags|=65536,a.lanes=u,o!==mu&&(t=Error(r(422),{cause:o}),gr(pn(t,s)))):(o!==mu&&(a=Error(r(423),{cause:o}),gr(pn(a,s))),t=t.current.alternate,t.flags|=65536,u&=-u,t.lanes|=u,o=pn(o,s),u=Yu(t.stateNode,o,u),ku(t,u),pt!==4&&(pt=2)),!1;var p=Error(r(520),{cause:o});if(p=pn(p,s),Mr===null?Mr=[p]:Mr.push(p),pt!==4&&(pt=2),a===null)return!0;o=pn(o,s),s=a;do{switch(s.tag){case 3:return s.flags|=65536,t=u&-u,s.lanes|=t,t=Yu(s.stateNode,o,t),ku(s,t),!1;case 1:if(a=s.type,p=s.stateNode,(s.flags&128)===0&&(typeof a.getDerivedStateFromError=="function"||p!==null&&typeof p.componentDidCatch=="function"&&(Ea===null||!Ea.has(p))))return s.flags|=65536,u&=-u,s.lanes|=u,u=Dh(u),Rh(u,t,s,o),ku(s,u),!1}s=s.return}while(s!==null);return!1}var Xu=Error(r(461)),wt=!1;function Rt(t,a,s,o){a.child=t===null?qm(a,null,s,o):pi(a,t.child,s,o)}function Mh(t,a,s,o,u){s=s.render;var p=a.ref;if("ref"in o){var y={};for(var x in o)x!=="ref"&&(y[x]=o[x])}else y=o;return ci(a),o=Eu(t,a,s,y,p,u),x=Ou(),t!==null&&!wt?(Du(t,a,u),aa(t,a,u)):(Be&&x&&fu(a),a.flags|=1,Rt(t,a,o,u),a.child)}function Bh(t,a,s,o,u){if(t===null){var p=s.type;return typeof p=="function"&&!cu(p)&&p.defaultProps===void 0&&s.compare===null?(a.tag=15,a.type=p,Lh(t,a,p,o,u)):(t=Mo(s.type,null,o,a,a.mode,u),t.ref=a.ref,t.return=a,a.child=t)}if(p=t.child,!id(t,u)){var y=p.memoizedProps;if(s=s.compare,s=s!==null?s:pr,s(y,o)&&t.ref===a.ref)return aa(t,a,u)}return a.flags|=1,t=Jn(p,o),t.ref=a.ref,t.return=a,a.child=t}function Lh(t,a,s,o,u){if(t!==null){var p=t.memoizedProps;if(pr(p,o)&&t.ref===a.ref)if(wt=!1,a.pendingProps=o=p,id(t,u))(t.flags&131072)!==0&&(wt=!0);else return a.lanes=t.lanes,aa(t,a,u)}return Ju(t,a,s,o,u)}function qh(t,a,s,o){var u=o.children,p=t!==null?t.memoizedState:null;if(t===null&&a.stateNode===null&&(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.mode==="hidden"){if((a.flags&128)!==0){if(p=p!==null?p.baseLanes|s:s,t!==null){for(o=a.child=t.child,u=0;o!==null;)u=u|o.lanes|o.childLanes,o=o.sibling;o=u&~p}else o=0,a.child=null;return $h(t,a,p,s,o)}if((s&536870912)!==0)a.memoizedState={baseLanes:0,cachePool:null},t!==null&&$o(a,p!==null?p.cachePool:null),p!==null?Vm(a,p):_u(),Gm(a);else return o=a.lanes=536870912,$h(t,a,p!==null?p.baseLanes|s:s,s,o)}else p!==null?($o(a,p.cachePool),Vm(a,p),_a(),a.memoizedState=null):(t!==null&&$o(a,null),_u(),_a());return Rt(t,a,u,s),a.child}function zr(t,a){return t!==null&&t.tag===22||a.stateNode!==null||(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.sibling}function $h(t,a,s,o,u){var p=xu();return p=p===null?null:{parent:St._currentValue,pool:p},a.memoizedState={baseLanes:s,cachePool:p},t!==null&&$o(a,null),_u(),Gm(a),t!==null&&is(t,a,o,!0),a.childLanes=u,null}function tl(t,a){return a=al({mode:a.mode,children:a.children},t.mode),a.ref=t.ref,t.child=a,a.return=t,a}function Uh(t,a,s){return pi(a,t.child,null,s),t=tl(a,a.pendingProps),t.flags|=2,sn(a),a.memoizedState=null,t}function XS(t,a,s){var o=a.pendingProps,u=(a.flags&128)!==0;if(a.flags&=-129,t===null){if(Be){if(o.mode==="hidden")return t=tl(a,o),a.lanes=536870912,zr(null,t);if(Cu(a),(t=it)?(t=Fg(t,gn),t=t!==null&&t.data==="&"?t:null,t!==null&&(a.memoizedState={dehydrated:t,treeContext:va!==null?{id:qn,overflow:$n}:null,retryLane:536870912,hydrationErrors:null},s=jm(t),s.return=a,a.child=s,Ot=a,it=null)):t=null,t===null)throw xa(a);return a.lanes=536870912,null}return tl(a,o)}var p=t.memoizedState;if(p!==null){var y=p.dehydrated;if(Cu(a),u)if(a.flags&256)a.flags&=-257,a=Uh(t,a,s);else if(a.memoizedState!==null)a.child=t.child,a.flags|=128,a=null;else throw Error(r(558));else if(wt||is(t,a,s,!1),u=(s&t.childLanes)!==0,wt||u){if(o=et,o!==null&&(y=nr(o,s),y!==0&&y!==p.retryLane))throw p.retryLane=y,si(t,y),Jt(o,t,y),Xu;fl(),a=Uh(t,a,s)}else t=p.treeContext,it=bn(y.nextSibling),Ot=a,Be=!0,Sa=null,gn=!1,t!==null&&Am(a,t),a=tl(a,o),a.flags|=4096;return a}return t=Jn(t.child,{mode:o.mode,children:o.children}),t.ref=a.ref,a.child=t,t.return=a,t}function nl(t,a){var s=a.ref;if(s===null)t!==null&&t.ref!==null&&(a.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(r(284));(t===null||t.ref!==s)&&(a.flags|=4194816)}}function Ju(t,a,s,o,u){return ci(a),s=Eu(t,a,s,o,void 0,u),o=Ou(),t!==null&&!wt?(Du(t,a,u),aa(t,a,u)):(Be&&o&&fu(a),a.flags|=1,Rt(t,a,s,u),a.child)}function Vh(t,a,s,o,u,p){return ci(a),a.updateQueue=null,s=Hm(a,o,s,u),Im(t),o=Ou(),t!==null&&!wt?(Du(t,a,p),aa(t,a,p)):(Be&&o&&fu(a),a.flags|=1,Rt(t,a,s,p),a.child)}function Gh(t,a,s,o,u){if(ci(a),a.stateNode===null){var p=es,y=s.contextType;typeof y=="object"&&y!==null&&(p=Dt(y)),p=new s(o,p),a.memoizedState=p.state!==null&&p.state!==void 0?p.state:null,p.updater=Qu,a.stateNode=p,p._reactInternals=a,p=a.stateNode,p.props=o,p.state=a.memoizedState,p.refs={},ju(a),y=s.contextType,p.context=typeof y=="object"&&y!==null?Dt(y):es,p.state=a.memoizedState,y=s.getDerivedStateFromProps,typeof y=="function"&&(Ku(a,s,y,o),p.state=a.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof p.getSnapshotBeforeUpdate=="function"||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(y=p.state,typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount(),y!==p.state&&Qu.enqueueReplaceState(p,p.state,null),jr(a,o,p,u),wr(),p.state=a.memoizedState),typeof p.componentDidMount=="function"&&(a.flags|=4194308),o=!0}else if(t===null){p=a.stateNode;var x=a.memoizedProps,A=hi(s,x);p.props=A;var B=p.context,I=s.contextType;y=es,typeof I=="object"&&I!==null&&(y=Dt(I));var Y=s.getDerivedStateFromProps;I=typeof Y=="function"||typeof p.getSnapshotBeforeUpdate=="function",x=a.pendingProps!==x,I||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(x||B!==y)&&zh(a,p,o,y),ja=!1;var q=a.memoizedState;p.state=q,jr(a,o,p,u),wr(),B=a.memoizedState,x||q!==B||ja?(typeof Y=="function"&&(Ku(a,s,Y,o),B=a.memoizedState),(A=ja||_h(a,s,A,o,q,B,y))?(I||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount()),typeof p.componentDidMount=="function"&&(a.flags|=4194308)):(typeof p.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=o,a.memoizedState=B),p.props=o,p.state=B,p.context=y,o=A):(typeof p.componentDidMount=="function"&&(a.flags|=4194308),o=!1)}else{p=a.stateNode,Nu(t,a),y=a.memoizedProps,I=hi(s,y),p.props=I,Y=a.pendingProps,q=p.context,B=s.contextType,A=es,typeof B=="object"&&B!==null&&(A=Dt(B)),x=s.getDerivedStateFromProps,(B=typeof x=="function"||typeof p.getSnapshotBeforeUpdate=="function")||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(y!==Y||q!==A)&&zh(a,p,o,A),ja=!1,q=a.memoizedState,p.state=q,jr(a,o,p,u),wr();var V=a.memoizedState;y!==Y||q!==V||ja||t!==null&&t.dependencies!==null&&Lo(t.dependencies)?(typeof x=="function"&&(Ku(a,s,x,o),V=a.memoizedState),(I=ja||_h(a,s,I,o,q,V,A)||t!==null&&t.dependencies!==null&&Lo(t.dependencies))?(B||typeof p.UNSAFE_componentWillUpdate!="function"&&typeof p.componentWillUpdate!="function"||(typeof p.componentWillUpdate=="function"&&p.componentWillUpdate(o,V,A),typeof p.UNSAFE_componentWillUpdate=="function"&&p.UNSAFE_componentWillUpdate(o,V,A)),typeof p.componentDidUpdate=="function"&&(a.flags|=4),typeof p.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof p.componentDidUpdate!="function"||y===t.memoizedProps&&q===t.memoizedState||(a.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||y===t.memoizedProps&&q===t.memoizedState||(a.flags|=1024),a.memoizedProps=o,a.memoizedState=V),p.props=o,p.state=V,p.context=A,o=I):(typeof p.componentDidUpdate!="function"||y===t.memoizedProps&&q===t.memoizedState||(a.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||y===t.memoizedProps&&q===t.memoizedState||(a.flags|=1024),o=!1)}return p=o,nl(t,a),o=(a.flags&128)!==0,p||o?(p=a.stateNode,s=o&&typeof s.getDerivedStateFromError!="function"?null:p.render(),a.flags|=1,t!==null&&o?(a.child=pi(a,t.child,null,u),a.child=pi(a,null,s,u)):Rt(t,a,s,u),a.memoizedState=p.state,t=a.child):t=aa(t,a,u),t}function Ih(t,a,s,o){return oi(),a.flags|=256,Rt(t,a,s,o),a.child}var Fu={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Wu(t){return{baseLanes:t,cachePool:Om()}}function ed(t,a,s){return t=t!==null?t.childLanes&~s:0,a&&(t|=on),t}function Hh(t,a,s){var o=a.pendingProps,u=!1,p=(a.flags&128)!==0,y;if((y=p)||(y=t!==null&&t.memoizedState===null?!1:(ht.current&2)!==0),y&&(u=!0,a.flags&=-129),y=(a.flags&32)!==0,a.flags&=-33,t===null){if(Be){if(u?Aa(a):_a(),(t=it)?(t=Fg(t,gn),t=t!==null&&t.data!=="&"?t:null,t!==null&&(a.memoizedState={dehydrated:t,treeContext:va!==null?{id:qn,overflow:$n}:null,retryLane:536870912,hydrationErrors:null},s=jm(t),s.return=a,a.child=s,Ot=a,it=null)):t=null,t===null)throw xa(a);return Bd(t)?a.lanes=32:a.lanes=536870912,null}var x=o.children;return o=o.fallback,u?(_a(),u=a.mode,x=al({mode:"hidden",children:x},u),o=ri(o,u,s,null),x.return=a,o.return=a,x.sibling=o,a.child=x,o=a.child,o.memoizedState=Wu(s),o.childLanes=ed(t,y,s),a.memoizedState=Fu,zr(null,o)):(Aa(a),td(a,x))}var A=t.memoizedState;if(A!==null&&(x=A.dehydrated,x!==null)){if(p)a.flags&256?(Aa(a),a.flags&=-257,a=nd(t,a,s)):a.memoizedState!==null?(_a(),a.child=t.child,a.flags|=128,a=null):(_a(),x=o.fallback,u=a.mode,o=al({mode:"visible",children:o.children},u),x=ri(x,u,s,null),x.flags|=2,o.return=a,x.return=a,o.sibling=x,a.child=o,pi(a,t.child,null,s),o=a.child,o.memoizedState=Wu(s),o.childLanes=ed(t,y,s),a.memoizedState=Fu,a=zr(null,o));else if(Aa(a),Bd(x)){if(y=x.nextSibling&&x.nextSibling.dataset,y)var B=y.dgst;y=B,o=Error(r(419)),o.stack="",o.digest=y,gr({value:o,source:null,stack:null}),a=nd(t,a,s)}else if(wt||is(t,a,s,!1),y=(s&t.childLanes)!==0,wt||y){if(y=et,y!==null&&(o=nr(y,s),o!==0&&o!==A.retryLane))throw A.retryLane=o,si(t,o),Jt(y,t,o),Xu;Md(x)||fl(),a=nd(t,a,s)}else Md(x)?(a.flags|=192,a.child=t.child,a=null):(t=A.treeContext,it=bn(x.nextSibling),Ot=a,Be=!0,Sa=null,gn=!1,t!==null&&Am(a,t),a=td(a,o.children),a.flags|=4096);return a}return u?(_a(),x=o.fallback,u=a.mode,A=t.child,B=A.sibling,o=Jn(A,{mode:"hidden",children:o.children}),o.subtreeFlags=A.subtreeFlags&65011712,B!==null?x=Jn(B,x):(x=ri(x,u,s,null),x.flags|=2),x.return=a,o.return=a,o.sibling=x,a.child=o,zr(null,o),o=a.child,x=t.child.memoizedState,x===null?x=Wu(s):(u=x.cachePool,u!==null?(A=St._currentValue,u=u.parent!==A?{parent:A,pool:A}:u):u=Om(),x={baseLanes:x.baseLanes|s,cachePool:u}),o.memoizedState=x,o.childLanes=ed(t,y,s),a.memoizedState=Fu,zr(t.child,o)):(Aa(a),s=t.child,t=s.sibling,s=Jn(s,{mode:"visible",children:o.children}),s.return=a,s.sibling=null,t!==null&&(y=a.deletions,y===null?(a.deletions=[t],a.flags|=16):y.push(t)),a.child=s,a.memoizedState=null,s)}function td(t,a){return a=al({mode:"visible",children:a},t.mode),a.return=t,t.child=a}function al(t,a){return t=nn(22,t,null,a),t.lanes=0,t}function nd(t,a,s){return pi(a,t.child,null,s),t=td(a,a.pendingProps.children),t.flags|=2,a.memoizedState=null,t}function Zh(t,a,s){t.lanes|=a;var o=t.alternate;o!==null&&(o.lanes|=a),yu(t.return,a,s)}function ad(t,a,s,o,u,p){var y=t.memoizedState;y===null?t.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:o,tail:s,tailMode:u,treeForkCount:p}:(y.isBackwards=a,y.rendering=null,y.renderingStartTime=0,y.last=o,y.tail=s,y.tailMode=u,y.treeForkCount=p)}function Ph(t,a,s){var o=a.pendingProps,u=o.revealOrder,p=o.tail;o=o.children;var y=ht.current,x=(y&2)!==0;if(x?(y=y&1|2,a.flags|=128):y&=1,le(ht,y),Rt(t,a,o,s),o=Be?hr:0,!x&&t!==null&&(t.flags&128)!==0)e:for(t=a.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Zh(t,s,a);else if(t.tag===19)Zh(t,s,a);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===a)break e;for(;t.sibling===null;){if(t.return===null||t.return===a)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(u){case"forwards":for(s=a.child,u=null;s!==null;)t=s.alternate,t!==null&&Zo(t)===null&&(u=s),s=s.sibling;s=u,s===null?(u=a.child,a.child=null):(u=s.sibling,s.sibling=null),ad(a,!1,u,s,p,o);break;case"backwards":case"unstable_legacy-backwards":for(s=null,u=a.child,a.child=null;u!==null;){if(t=u.alternate,t!==null&&Zo(t)===null){a.child=u;break}t=u.sibling,u.sibling=s,s=u,u=t}ad(a,!0,s,null,p,o);break;case"together":ad(a,!1,null,null,void 0,o);break;default:a.memoizedState=null}return a.child}function aa(t,a,s){if(t!==null&&(a.dependencies=t.dependencies),Ta|=a.lanes,(s&a.childLanes)===0)if(t!==null){if(is(t,a,s,!1),(s&a.childLanes)===0)return null}else return null;if(t!==null&&a.child!==t.child)throw Error(r(153));if(a.child!==null){for(t=a.child,s=Jn(t,t.pendingProps),a.child=s,s.return=a;t.sibling!==null;)t=t.sibling,s=s.sibling=Jn(t,t.pendingProps),s.return=a;s.sibling=null}return a.child}function id(t,a){return(t.lanes&a)!==0?!0:(t=t.dependencies,!!(t!==null&&Lo(t)))}function JS(t,a,s){switch(a.tag){case 3:tt(a,a.stateNode.containerInfo),wa(a,St,t.memoizedState.cache),oi();break;case 27:case 5:$e(a);break;case 4:tt(a,a.stateNode.containerInfo);break;case 10:wa(a,a.type,a.memoizedProps.value);break;case 31:if(a.memoizedState!==null)return a.flags|=128,Cu(a),null;break;case 13:var o=a.memoizedState;if(o!==null)return o.dehydrated!==null?(Aa(a),a.flags|=128,null):(s&a.child.childLanes)!==0?Hh(t,a,s):(Aa(a),t=aa(t,a,s),t!==null?t.sibling:null);Aa(a);break;case 19:var u=(t.flags&128)!==0;if(o=(s&a.childLanes)!==0,o||(is(t,a,s,!1),o=(s&a.childLanes)!==0),u){if(o)return Ph(t,a,s);a.flags|=128}if(u=a.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),le(ht,ht.current),o)break;return null;case 22:return a.lanes=0,qh(t,a,s,a.pendingProps);case 24:wa(a,St,t.memoizedState.cache)}return aa(t,a,s)}function Kh(t,a,s){if(t!==null)if(t.memoizedProps!==a.pendingProps)wt=!0;else{if(!id(t,s)&&(a.flags&128)===0)return wt=!1,JS(t,a,s);wt=(t.flags&131072)!==0}else wt=!1,Be&&(a.flags&1048576)!==0&&km(a,hr,a.index);switch(a.lanes=0,a.tag){case 16:e:{var o=a.pendingProps;if(t=di(a.elementType),a.type=t,typeof t=="function")cu(t)?(o=hi(t,o),a.tag=1,a=Gh(null,a,t,o,s)):(a.tag=0,a=Ju(null,a,t,o,s));else{if(t!=null){var u=t.$$typeof;if(u===K){a.tag=11,a=Mh(null,a,t,o,s);break e}else if(u===D){a.tag=14,a=Bh(null,a,t,o,s);break e}}throw a=Qe(t)||t,Error(r(306,a,""))}}return a;case 0:return Ju(t,a,a.type,a.pendingProps,s);case 1:return o=a.type,u=hi(o,a.pendingProps),Gh(t,a,o,u,s);case 3:e:{if(tt(a,a.stateNode.containerInfo),t===null)throw Error(r(387));o=a.pendingProps;var p=a.memoizedState;u=p.element,Nu(t,a),jr(a,o,null,s);var y=a.memoizedState;if(o=y.cache,wa(a,St,o),o!==p.cache&&bu(a,[St],s,!0),wr(),o=y.element,p.isDehydrated)if(p={element:o,isDehydrated:!1,cache:y.cache},a.updateQueue.baseState=p,a.memoizedState=p,a.flags&256){a=Ih(t,a,o,s);break e}else if(o!==u){u=pn(Error(r(424)),a),gr(u),a=Ih(t,a,o,s);break e}else for(t=a.stateNode.containerInfo,t.nodeType===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,it=bn(t.firstChild),Ot=a,Be=!0,Sa=null,gn=!0,s=qm(a,null,o,s),a.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling;else{if(oi(),o===u){a=aa(t,a,s);break e}Rt(t,a,o,s)}a=a.child}return a;case 26:return nl(t,a),t===null?(s=iy(a.type,null,a.pendingProps,null))?a.memoizedState=s:Be||(s=a.type,t=a.pendingProps,o=vl(ae.current).createElement(s),o[Et]=a,o[Zt]=t,Mt(o,s,t),_t(o),a.stateNode=o):a.memoizedState=iy(a.type,t.memoizedProps,a.pendingProps,t.memoizedState),null;case 27:return $e(a),t===null&&Be&&(o=a.stateNode=ty(a.type,a.pendingProps,ae.current),Ot=a,gn=!0,u=it,Ma(a.type)?(Ld=u,it=bn(o.firstChild)):it=u),Rt(t,a,a.pendingProps.children,s),nl(t,a),t===null&&(a.flags|=4194304),a.child;case 5:return t===null&&Be&&((u=o=it)&&(o=_x(o,a.type,a.pendingProps,gn),o!==null?(a.stateNode=o,Ot=a,it=bn(o.firstChild),gn=!1,u=!0):u=!1),u||xa(a)),$e(a),u=a.type,p=a.pendingProps,y=t!==null?t.memoizedProps:null,o=p.children,Od(u,p)?o=null:y!==null&&Od(u,y)&&(a.flags|=32),a.memoizedState!==null&&(u=Eu(t,a,GS,null,null,s),Ir._currentValue=u),nl(t,a),Rt(t,a,o,s),a.child;case 6:return t===null&&Be&&((t=s=it)&&(s=zx(s,a.pendingProps,gn),s!==null?(a.stateNode=s,Ot=a,it=null,t=!0):t=!1),t||xa(a)),null;case 13:return Hh(t,a,s);case 4:return tt(a,a.stateNode.containerInfo),o=a.pendingProps,t===null?a.child=pi(a,null,o,s):Rt(t,a,o,s),a.child;case 11:return Mh(t,a,a.type,a.pendingProps,s);case 7:return Rt(t,a,a.pendingProps,s),a.child;case 8:return Rt(t,a,a.pendingProps.children,s),a.child;case 12:return Rt(t,a,a.pendingProps.children,s),a.child;case 10:return o=a.pendingProps,wa(a,a.type,o.value),Rt(t,a,o.children,s),a.child;case 9:return u=a.type._context,o=a.pendingProps.children,ci(a),u=Dt(u),o=o(u),a.flags|=1,Rt(t,a,o,s),a.child;case 14:return Bh(t,a,a.type,a.pendingProps,s);case 15:return Lh(t,a,a.type,a.pendingProps,s);case 19:return Ph(t,a,s);case 31:return XS(t,a,s);case 22:return qh(t,a,s,a.pendingProps);case 24:return ci(a),o=Dt(St),t===null?(u=xu(),u===null&&(u=et,p=vu(),u.pooledCache=p,p.refCount++,p!==null&&(u.pooledCacheLanes|=s),u=p),a.memoizedState={parent:o,cache:u},ju(a),wa(a,St,u)):((t.lanes&s)!==0&&(Nu(t,a),jr(a,null,null,s),wr()),u=t.memoizedState,p=a.memoizedState,u.parent!==o?(u={parent:o,cache:o},a.memoizedState=u,a.lanes===0&&(a.memoizedState=a.updateQueue.baseState=u),wa(a,St,o)):(o=p.cache,wa(a,St,o),o!==u.cache&&bu(a,[St],s,!0))),Rt(t,a,a.pendingProps.children,s),a.child;case 29:throw a.pendingProps}throw Error(r(156,a.tag))}function ia(t){t.flags|=4}function sd(t,a,s,o,u){if((a=(t.mode&32)!==0)&&(a=!1),a){if(t.flags|=16777216,(u&335544128)===u)if(t.stateNode.complete)t.flags|=8192;else if(Sg())t.flags|=8192;else throw fi=Vo,wu}else t.flags&=-16777217}function Qh(t,a){if(a.type!=="stylesheet"||(a.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!cy(a))if(Sg())t.flags|=8192;else throw fi=Vo,wu}function il(t,a){a!==null&&(t.flags|=4),t.flags&16384&&(a=t.tag!==22?bo():536870912,t.lanes|=a,gs|=a)}function Cr(t,a){if(!Be)switch(t.tailMode){case"hidden":a=t.tail;for(var s=null;a!==null;)a.alternate!==null&&(s=a),a=a.sibling;s===null?t.tail=null:s.sibling=null;break;case"collapsed":s=t.tail;for(var o=null;s!==null;)s.alternate!==null&&(o=s),s=s.sibling;o===null?a||t.tail===null?t.tail=null:t.tail.sibling=null:o.sibling=null}}function st(t){var a=t.alternate!==null&&t.alternate.child===t.child,s=0,o=0;if(a)for(var u=t.child;u!==null;)s|=u.lanes|u.childLanes,o|=u.subtreeFlags&65011712,o|=u.flags&65011712,u.return=t,u=u.sibling;else for(u=t.child;u!==null;)s|=u.lanes|u.childLanes,o|=u.subtreeFlags,o|=u.flags,u.return=t,u=u.sibling;return t.subtreeFlags|=o,t.childLanes=s,a}function FS(t,a,s){var o=a.pendingProps;switch(pu(a),a.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return st(a),null;case 1:return st(a),null;case 3:return s=a.stateNode,o=null,t!==null&&(o=t.memoizedState.cache),a.memoizedState.cache!==o&&(a.flags|=2048),ea(St),xe(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(t===null||t.child===null)&&(as(a)?ia(a):t===null||t.memoizedState.isDehydrated&&(a.flags&256)===0||(a.flags|=1024,hu())),st(a),null;case 26:var u=a.type,p=a.memoizedState;return t===null?(ia(a),p!==null?(st(a),Qh(a,p)):(st(a),sd(a,u,null,o,s))):p?p!==t.memoizedState?(ia(a),st(a),Qh(a,p)):(st(a),a.flags&=-16777217):(t=t.memoizedProps,t!==o&&ia(a),st(a),sd(a,u,t,o,s)),null;case 27:if(Ze(a),s=ae.current,u=a.type,t!==null&&a.stateNode!=null)t.memoizedProps!==o&&ia(a);else{if(!o){if(a.stateNode===null)throw Error(r(166));return st(a),null}t=ne.current,as(a)?_m(a):(t=ty(u,o,s),a.stateNode=t,ia(a))}return st(a),null;case 5:if(Ze(a),u=a.type,t!==null&&a.stateNode!=null)t.memoizedProps!==o&&ia(a);else{if(!o){if(a.stateNode===null)throw Error(r(166));return st(a),null}if(p=ne.current,as(a))_m(a);else{var y=vl(ae.current);switch(p){case 1:p=y.createElementNS("http://www.w3.org/2000/svg",u);break;case 2:p=y.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;default:switch(u){case"svg":p=y.createElementNS("http://www.w3.org/2000/svg",u);break;case"math":p=y.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;case"script":p=y.createElement("div"),p.innerHTML="<script><\/script>",p=p.removeChild(p.firstChild);break;case"select":p=typeof o.is=="string"?y.createElement("select",{is:o.is}):y.createElement("select"),o.multiple?p.multiple=!0:o.size&&(p.size=o.size);break;default:p=typeof o.is=="string"?y.createElement(u,{is:o.is}):y.createElement(u)}}p[Et]=a,p[Zt]=o;e:for(y=a.child;y!==null;){if(y.tag===5||y.tag===6)p.appendChild(y.stateNode);else if(y.tag!==4&&y.tag!==27&&y.child!==null){y.child.return=y,y=y.child;continue}if(y===a)break e;for(;y.sibling===null;){if(y.return===null||y.return===a)break e;y=y.return}y.sibling.return=y.return,y=y.sibling}a.stateNode=p;e:switch(Mt(p,u,o),u){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}o&&ia(a)}}return st(a),sd(a,a.type,t===null?null:t.memoizedProps,a.pendingProps,s),null;case 6:if(t&&a.stateNode!=null)t.memoizedProps!==o&&ia(a);else{if(typeof o!="string"&&a.stateNode===null)throw Error(r(166));if(t=ae.current,as(a)){if(t=a.stateNode,s=a.memoizedProps,o=null,u=Ot,u!==null)switch(u.tag){case 27:case 5:o=u.memoizedProps}t[Et]=a,t=!!(t.nodeValue===s||o!==null&&o.suppressHydrationWarning===!0||Hg(t.nodeValue,s)),t||xa(a,!0)}else t=vl(t).createTextNode(o),t[Et]=a,a.stateNode=t}return st(a),null;case 31:if(s=a.memoizedState,t===null||t.memoizedState!==null){if(o=as(a),s!==null){if(t===null){if(!o)throw Error(r(318));if(t=a.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(557));t[Et]=a}else oi(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;st(a),t=!1}else s=hu(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=s),t=!0;if(!t)return a.flags&256?(sn(a),a):(sn(a),null);if((a.flags&128)!==0)throw Error(r(558))}return st(a),null;case 13:if(o=a.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(u=as(a),o!==null&&o.dehydrated!==null){if(t===null){if(!u)throw Error(r(318));if(u=a.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(r(317));u[Et]=a}else oi(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;st(a),u=!1}else u=hu(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=u),u=!0;if(!u)return a.flags&256?(sn(a),a):(sn(a),null)}return sn(a),(a.flags&128)!==0?(a.lanes=s,a):(s=o!==null,t=t!==null&&t.memoizedState!==null,s&&(o=a.child,u=null,o.alternate!==null&&o.alternate.memoizedState!==null&&o.alternate.memoizedState.cachePool!==null&&(u=o.alternate.memoizedState.cachePool.pool),p=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(p=o.memoizedState.cachePool.pool),p!==u&&(o.flags|=2048)),s!==t&&s&&(a.child.flags|=8192),il(a,a.updateQueue),st(a),null);case 4:return xe(),t===null&&_d(a.stateNode.containerInfo),st(a),null;case 10:return ea(a.type),st(a),null;case 19:if(Q(ht),o=a.memoizedState,o===null)return st(a),null;if(u=(a.flags&128)!==0,p=o.rendering,p===null)if(u)Cr(o,!1);else{if(pt!==0||t!==null&&(t.flags&128)!==0)for(t=a.child;t!==null;){if(p=Zo(t),p!==null){for(a.flags|=128,Cr(o,!1),t=p.updateQueue,a.updateQueue=t,il(a,t),a.subtreeFlags=0,t=s,s=a.child;s!==null;)wm(s,t),s=s.sibling;return le(ht,ht.current&1|2),Be&&Fn(a,o.treeForkCount),a.child}t=t.sibling}o.tail!==null&&Lt()>cl&&(a.flags|=128,u=!0,Cr(o,!1),a.lanes=4194304)}else{if(!u)if(t=Zo(p),t!==null){if(a.flags|=128,u=!0,t=t.updateQueue,a.updateQueue=t,il(a,t),Cr(o,!0),o.tail===null&&o.tailMode==="hidden"&&!p.alternate&&!Be)return st(a),null}else 2*Lt()-o.renderingStartTime>cl&&s!==536870912&&(a.flags|=128,u=!0,Cr(o,!1),a.lanes=4194304);o.isBackwards?(p.sibling=a.child,a.child=p):(t=o.last,t!==null?t.sibling=p:a.child=p,o.last=p)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Lt(),t.sibling=null,s=ht.current,le(ht,u?s&1|2:s&1),Be&&Fn(a,o.treeForkCount),t):(st(a),null);case 22:case 23:return sn(a),zu(),o=a.memoizedState!==null,t!==null?t.memoizedState!==null!==o&&(a.flags|=8192):o&&(a.flags|=8192),o?(s&536870912)!==0&&(a.flags&128)===0&&(st(a),a.subtreeFlags&6&&(a.flags|=8192)):st(a),s=a.updateQueue,s!==null&&il(a,s.retryQueue),s=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),o=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(o=a.memoizedState.cachePool.pool),o!==s&&(a.flags|=2048),t!==null&&Q(ui),null;case 24:return s=null,t!==null&&(s=t.memoizedState.cache),a.memoizedState.cache!==s&&(a.flags|=2048),ea(St),st(a),null;case 25:return null;case 30:return null}throw Error(r(156,a.tag))}function WS(t,a){switch(pu(a),a.tag){case 1:return t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 3:return ea(St),xe(),t=a.flags,(t&65536)!==0&&(t&128)===0?(a.flags=t&-65537|128,a):null;case 26:case 27:case 5:return Ze(a),null;case 31:if(a.memoizedState!==null){if(sn(a),a.alternate===null)throw Error(r(340));oi()}return t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 13:if(sn(a),t=a.memoizedState,t!==null&&t.dehydrated!==null){if(a.alternate===null)throw Error(r(340));oi()}return t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 19:return Q(ht),null;case 4:return xe(),null;case 10:return ea(a.type),null;case 22:case 23:return sn(a),zu(),t!==null&&Q(ui),t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 24:return ea(St),null;case 25:return null;default:return null}}function Yh(t,a){switch(pu(a),a.tag){case 3:ea(St),xe();break;case 26:case 27:case 5:Ze(a);break;case 4:xe();break;case 31:a.memoizedState!==null&&sn(a);break;case 13:sn(a);break;case 19:Q(ht);break;case 10:ea(a.type);break;case 22:case 23:sn(a),zu(),t!==null&&Q(ui);break;case 24:ea(St)}}function Tr(t,a){try{var s=a.updateQueue,o=s!==null?s.lastEffect:null;if(o!==null){var u=o.next;s=u;do{if((s.tag&t)===t){o=void 0;var p=s.create,y=s.inst;o=p(),y.destroy=o}s=s.next}while(s!==u)}}catch(x){Ke(a,a.return,x)}}function za(t,a,s){try{var o=a.updateQueue,u=o!==null?o.lastEffect:null;if(u!==null){var p=u.next;o=p;do{if((o.tag&t)===t){var y=o.inst,x=y.destroy;if(x!==void 0){y.destroy=void 0,u=a;var A=s,B=x;try{B()}catch(I){Ke(u,A,I)}}}o=o.next}while(o!==p)}}catch(I){Ke(a,a.return,I)}}function Xh(t){var a=t.updateQueue;if(a!==null){var s=t.stateNode;try{Um(a,s)}catch(o){Ke(t,t.return,o)}}}function Jh(t,a,s){s.props=hi(t.type,t.memoizedProps),s.state=t.memoizedState;try{s.componentWillUnmount()}catch(o){Ke(t,a,o)}}function Er(t,a){try{var s=t.ref;if(s!==null){switch(t.tag){case 26:case 27:case 5:var o=t.stateNode;break;case 30:o=t.stateNode;break;default:o=t.stateNode}typeof s=="function"?t.refCleanup=s(o):s.current=o}}catch(u){Ke(t,a,u)}}function Un(t,a){var s=t.ref,o=t.refCleanup;if(s!==null)if(typeof o=="function")try{o()}catch(u){Ke(t,a,u)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(u){Ke(t,a,u)}else s.current=null}function Fh(t){var a=t.type,s=t.memoizedProps,o=t.stateNode;try{e:switch(a){case"button":case"input":case"select":case"textarea":s.autoFocus&&o.focus();break e;case"img":s.src?o.src=s.src:s.srcSet&&(o.srcset=s.srcSet)}}catch(u){Ke(t,t.return,u)}}function rd(t,a,s){try{var o=t.stateNode;xx(o,t.type,s,a),o[Zt]=a}catch(u){Ke(t,t.return,u)}}function Wh(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Ma(t.type)||t.tag===4}function od(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Wh(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&Ma(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function ld(t,a,s){var o=t.tag;if(o===5||o===6)t=t.stateNode,a?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(t,a):(a=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,a.appendChild(t),s=s._reactRootContainer,s!=null||a.onclick!==null||(a.onclick=Yn));else if(o!==4&&(o===27&&Ma(t.type)&&(s=t.stateNode,a=null),t=t.child,t!==null))for(ld(t,a,s),t=t.sibling;t!==null;)ld(t,a,s),t=t.sibling}function sl(t,a,s){var o=t.tag;if(o===5||o===6)t=t.stateNode,a?s.insertBefore(t,a):s.appendChild(t);else if(o!==4&&(o===27&&Ma(t.type)&&(s=t.stateNode),t=t.child,t!==null))for(sl(t,a,s),t=t.sibling;t!==null;)sl(t,a,s),t=t.sibling}function eg(t){var a=t.stateNode,s=t.memoizedProps;try{for(var o=t.type,u=a.attributes;u.length;)a.removeAttributeNode(u[0]);Mt(a,o,s),a[Et]=t,a[Zt]=s}catch(p){Ke(t,t.return,p)}}var sa=!1,jt=!1,cd=!1,tg=typeof WeakSet=="function"?WeakSet:Set,zt=null;function ex(t,a){if(t=t.containerInfo,Td=Al,t=pm(t),nu(t)){if("selectionStart"in t)var s={start:t.selectionStart,end:t.selectionEnd};else e:{s=(s=t.ownerDocument)&&s.defaultView||window;var o=s.getSelection&&s.getSelection();if(o&&o.rangeCount!==0){s=o.anchorNode;var u=o.anchorOffset,p=o.focusNode;o=o.focusOffset;try{s.nodeType,p.nodeType}catch{s=null;break e}var y=0,x=-1,A=-1,B=0,I=0,Y=t,q=null;t:for(;;){for(var V;Y!==s||u!==0&&Y.nodeType!==3||(x=y+u),Y!==p||o!==0&&Y.nodeType!==3||(A=y+o),Y.nodeType===3&&(y+=Y.nodeValue.length),(V=Y.firstChild)!==null;)q=Y,Y=V;for(;;){if(Y===t)break t;if(q===s&&++B===u&&(x=y),q===p&&++I===o&&(A=y),(V=Y.nextSibling)!==null)break;Y=q,q=Y.parentNode}Y=V}s=x===-1||A===-1?null:{start:x,end:A}}else s=null}s=s||{start:0,end:0}}else s=null;for(Ed={focusedElem:t,selectionRange:s},Al=!1,zt=a;zt!==null;)if(a=zt,t=a.child,(a.subtreeFlags&1028)!==0&&t!==null)t.return=a,zt=t;else for(;zt!==null;){switch(a=zt,p=a.alternate,t=a.flags,a.tag){case 0:if((t&4)!==0&&(t=a.updateQueue,t=t!==null?t.events:null,t!==null))for(s=0;s<t.length;s++)u=t[s],u.ref.impl=u.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&p!==null){t=void 0,s=a,u=p.memoizedProps,p=p.memoizedState,o=s.stateNode;try{var fe=hi(s.type,u);t=o.getSnapshotBeforeUpdate(fe,p),o.__reactInternalSnapshotBeforeUpdate=t}catch(we){Ke(s,s.return,we)}}break;case 3:if((t&1024)!==0){if(t=a.stateNode.containerInfo,s=t.nodeType,s===9)Rd(t);else if(s===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":Rd(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(r(163))}if(t=a.sibling,t!==null){t.return=a.return,zt=t;break}zt=a.return}}function ng(t,a,s){var o=s.flags;switch(s.tag){case 0:case 11:case 15:oa(t,s),o&4&&Tr(5,s);break;case 1:if(oa(t,s),o&4)if(t=s.stateNode,a===null)try{t.componentDidMount()}catch(y){Ke(s,s.return,y)}else{var u=hi(s.type,a.memoizedProps);a=a.memoizedState;try{t.componentDidUpdate(u,a,t.__reactInternalSnapshotBeforeUpdate)}catch(y){Ke(s,s.return,y)}}o&64&&Xh(s),o&512&&Er(s,s.return);break;case 3:if(oa(t,s),o&64&&(t=s.updateQueue,t!==null)){if(a=null,s.child!==null)switch(s.child.tag){case 27:case 5:a=s.child.stateNode;break;case 1:a=s.child.stateNode}try{Um(t,a)}catch(y){Ke(s,s.return,y)}}break;case 27:a===null&&o&4&&eg(s);case 26:case 5:oa(t,s),a===null&&o&4&&Fh(s),o&512&&Er(s,s.return);break;case 12:oa(t,s);break;case 31:oa(t,s),o&4&&sg(t,s);break;case 13:oa(t,s),o&4&&rg(t,s),o&64&&(t=s.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(s=cx.bind(null,s),Cx(t,s))));break;case 22:if(o=s.memoizedState!==null||sa,!o){a=a!==null&&a.memoizedState!==null||jt,u=sa;var p=jt;sa=o,(jt=a)&&!p?la(t,s,(s.subtreeFlags&8772)!==0):oa(t,s),sa=u,jt=p}break;case 30:break;default:oa(t,s)}}function ag(t){var a=t.alternate;a!==null&&(t.alternate=null,ag(a)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(a=t.stateNode,a!==null&&$c(a)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var ot=null,Kt=!1;function ra(t,a,s){for(s=s.child;s!==null;)ig(t,a,s),s=s.sibling}function ig(t,a,s){if(qt&&typeof qt.onCommitFiberUnmount=="function")try{qt.onCommitFiberUnmount(ga,s)}catch{}switch(s.tag){case 26:jt||Un(s,a),ra(t,a,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:jt||Un(s,a);var o=ot,u=Kt;Ma(s.type)&&(ot=s.stateNode,Kt=!1),ra(t,a,s),Ur(s.stateNode),ot=o,Kt=u;break;case 5:jt||Un(s,a);case 6:if(o=ot,u=Kt,ot=null,ra(t,a,s),ot=o,Kt=u,ot!==null)if(Kt)try{(ot.nodeType===9?ot.body:ot.nodeName==="HTML"?ot.ownerDocument.body:ot).removeChild(s.stateNode)}catch(p){Ke(s,a,p)}else try{ot.removeChild(s.stateNode)}catch(p){Ke(s,a,p)}break;case 18:ot!==null&&(Kt?(t=ot,Xg(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,s.stateNode),Ns(t)):Xg(ot,s.stateNode));break;case 4:o=ot,u=Kt,ot=s.stateNode.containerInfo,Kt=!0,ra(t,a,s),ot=o,Kt=u;break;case 0:case 11:case 14:case 15:za(2,s,a),jt||za(4,s,a),ra(t,a,s);break;case 1:jt||(Un(s,a),o=s.stateNode,typeof o.componentWillUnmount=="function"&&Jh(s,a,o)),ra(t,a,s);break;case 21:ra(t,a,s);break;case 22:jt=(o=jt)||s.memoizedState!==null,ra(t,a,s),jt=o;break;default:ra(t,a,s)}}function sg(t,a){if(a.memoizedState===null&&(t=a.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Ns(t)}catch(s){Ke(a,a.return,s)}}}function rg(t,a){if(a.memoizedState===null&&(t=a.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Ns(t)}catch(s){Ke(a,a.return,s)}}function tx(t){switch(t.tag){case 31:case 13:case 19:var a=t.stateNode;return a===null&&(a=t.stateNode=new tg),a;case 22:return t=t.stateNode,a=t._retryCache,a===null&&(a=t._retryCache=new tg),a;default:throw Error(r(435,t.tag))}}function rl(t,a){var s=tx(t);a.forEach(function(o){if(!s.has(o)){s.add(o);var u=ux.bind(null,t,o);o.then(u,u)}})}function Qt(t,a){var s=a.deletions;if(s!==null)for(var o=0;o<s.length;o++){var u=s[o],p=t,y=a,x=y;e:for(;x!==null;){switch(x.tag){case 27:if(Ma(x.type)){ot=x.stateNode,Kt=!1;break e}break;case 5:ot=x.stateNode,Kt=!1;break e;case 3:case 4:ot=x.stateNode.containerInfo,Kt=!0;break e}x=x.return}if(ot===null)throw Error(r(160));ig(p,y,u),ot=null,Kt=!1,p=u.alternate,p!==null&&(p.return=null),u.return=null}if(a.subtreeFlags&13886)for(a=a.child;a!==null;)og(a,t),a=a.sibling}var En=null;function og(t,a){var s=t.alternate,o=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Qt(a,t),Yt(t),o&4&&(za(3,t,t.return),Tr(3,t),za(5,t,t.return));break;case 1:Qt(a,t),Yt(t),o&512&&(jt||s===null||Un(s,s.return)),o&64&&sa&&(t=t.updateQueue,t!==null&&(o=t.callbacks,o!==null&&(s=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=s===null?o:s.concat(o))));break;case 26:var u=En;if(Qt(a,t),Yt(t),o&512&&(jt||s===null||Un(s,s.return)),o&4){var p=s!==null?s.memoizedState:null;if(o=t.memoizedState,s===null)if(o===null)if(t.stateNode===null){e:{o=t.type,s=t.memoizedProps,u=u.ownerDocument||u;t:switch(o){case"title":p=u.getElementsByTagName("title")[0],(!p||p[ir]||p[Et]||p.namespaceURI==="http://www.w3.org/2000/svg"||p.hasAttribute("itemprop"))&&(p=u.createElement(o),u.head.insertBefore(p,u.querySelector("head > title"))),Mt(p,o,s),p[Et]=t,_t(p),o=p;break e;case"link":var y=oy("link","href",u).get(o+(s.href||""));if(y){for(var x=0;x<y.length;x++)if(p=y[x],p.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&p.getAttribute("rel")===(s.rel==null?null:s.rel)&&p.getAttribute("title")===(s.title==null?null:s.title)&&p.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){y.splice(x,1);break t}}p=u.createElement(o),Mt(p,o,s),u.head.appendChild(p);break;case"meta":if(y=oy("meta","content",u).get(o+(s.content||""))){for(x=0;x<y.length;x++)if(p=y[x],p.getAttribute("content")===(s.content==null?null:""+s.content)&&p.getAttribute("name")===(s.name==null?null:s.name)&&p.getAttribute("property")===(s.property==null?null:s.property)&&p.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&p.getAttribute("charset")===(s.charSet==null?null:s.charSet)){y.splice(x,1);break t}}p=u.createElement(o),Mt(p,o,s),u.head.appendChild(p);break;default:throw Error(r(468,o))}p[Et]=t,_t(p),o=p}t.stateNode=o}else ly(u,t.type,t.stateNode);else t.stateNode=ry(u,o,t.memoizedProps);else p!==o?(p===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):p.count--,o===null?ly(u,t.type,t.stateNode):ry(u,o,t.memoizedProps)):o===null&&t.stateNode!==null&&rd(t,t.memoizedProps,s.memoizedProps)}break;case 27:Qt(a,t),Yt(t),o&512&&(jt||s===null||Un(s,s.return)),s!==null&&o&4&&rd(t,t.memoizedProps,s.memoizedProps);break;case 5:if(Qt(a,t),Yt(t),o&512&&(jt||s===null||Un(s,s.return)),t.flags&32){u=t.stateNode;try{Ki(u,"")}catch(fe){Ke(t,t.return,fe)}}o&4&&t.stateNode!=null&&(u=t.memoizedProps,rd(t,u,s!==null?s.memoizedProps:u)),o&1024&&(cd=!0);break;case 6:if(Qt(a,t),Yt(t),o&4){if(t.stateNode===null)throw Error(r(162));o=t.memoizedProps,s=t.stateNode;try{s.nodeValue=o}catch(fe){Ke(t,t.return,fe)}}break;case 3:if(wl=null,u=En,En=Sl(a.containerInfo),Qt(a,t),En=u,Yt(t),o&4&&s!==null&&s.memoizedState.isDehydrated)try{Ns(a.containerInfo)}catch(fe){Ke(t,t.return,fe)}cd&&(cd=!1,lg(t));break;case 4:o=En,En=Sl(t.stateNode.containerInfo),Qt(a,t),Yt(t),En=o;break;case 12:Qt(a,t),Yt(t);break;case 31:Qt(a,t),Yt(t),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,rl(t,o)));break;case 13:Qt(a,t),Yt(t),t.child.flags&8192&&t.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(ll=Lt()),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,rl(t,o)));break;case 22:u=t.memoizedState!==null;var A=s!==null&&s.memoizedState!==null,B=sa,I=jt;if(sa=B||u,jt=I||A,Qt(a,t),jt=I,sa=B,Yt(t),o&8192)e:for(a=t.stateNode,a._visibility=u?a._visibility&-2:a._visibility|1,u&&(s===null||A||sa||jt||gi(t)),s=null,a=t;;){if(a.tag===5||a.tag===26){if(s===null){A=s=a;try{if(p=A.stateNode,u)y=p.style,typeof y.setProperty=="function"?y.setProperty("display","none","important"):y.display="none";else{x=A.stateNode;var Y=A.memoizedProps.style,q=Y!=null&&Y.hasOwnProperty("display")?Y.display:null;x.style.display=q==null||typeof q=="boolean"?"":(""+q).trim()}}catch(fe){Ke(A,A.return,fe)}}}else if(a.tag===6){if(s===null){A=a;try{A.stateNode.nodeValue=u?"":A.memoizedProps}catch(fe){Ke(A,A.return,fe)}}}else if(a.tag===18){if(s===null){A=a;try{var V=A.stateNode;u?Jg(V,!0):Jg(A.stateNode,!1)}catch(fe){Ke(A,A.return,fe)}}}else if((a.tag!==22&&a.tag!==23||a.memoizedState===null||a===t)&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===t)break e;for(;a.sibling===null;){if(a.return===null||a.return===t)break e;s===a&&(s=null),a=a.return}s===a&&(s=null),a.sibling.return=a.return,a=a.sibling}o&4&&(o=t.updateQueue,o!==null&&(s=o.retryQueue,s!==null&&(o.retryQueue=null,rl(t,s))));break;case 19:Qt(a,t),Yt(t),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,rl(t,o)));break;case 30:break;case 21:break;default:Qt(a,t),Yt(t)}}function Yt(t){var a=t.flags;if(a&2){try{for(var s,o=t.return;o!==null;){if(Wh(o)){s=o;break}o=o.return}if(s==null)throw Error(r(160));switch(s.tag){case 27:var u=s.stateNode,p=od(t);sl(t,p,u);break;case 5:var y=s.stateNode;s.flags&32&&(Ki(y,""),s.flags&=-33);var x=od(t);sl(t,x,y);break;case 3:case 4:var A=s.stateNode.containerInfo,B=od(t);ld(t,B,A);break;default:throw Error(r(161))}}catch(I){Ke(t,t.return,I)}t.flags&=-3}a&4096&&(t.flags&=-4097)}function lg(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var a=t;lg(a),a.tag===5&&a.flags&1024&&a.stateNode.reset(),t=t.sibling}}function oa(t,a){if(a.subtreeFlags&8772)for(a=a.child;a!==null;)ng(t,a.alternate,a),a=a.sibling}function gi(t){for(t=t.child;t!==null;){var a=t;switch(a.tag){case 0:case 11:case 14:case 15:za(4,a,a.return),gi(a);break;case 1:Un(a,a.return);var s=a.stateNode;typeof s.componentWillUnmount=="function"&&Jh(a,a.return,s),gi(a);break;case 27:Ur(a.stateNode);case 26:case 5:Un(a,a.return),gi(a);break;case 22:a.memoizedState===null&&gi(a);break;case 30:gi(a);break;default:gi(a)}t=t.sibling}}function la(t,a,s){for(s=s&&(a.subtreeFlags&8772)!==0,a=a.child;a!==null;){var o=a.alternate,u=t,p=a,y=p.flags;switch(p.tag){case 0:case 11:case 15:la(u,p,s),Tr(4,p);break;case 1:if(la(u,p,s),o=p,u=o.stateNode,typeof u.componentDidMount=="function")try{u.componentDidMount()}catch(B){Ke(o,o.return,B)}if(o=p,u=o.updateQueue,u!==null){var x=o.stateNode;try{var A=u.shared.hiddenCallbacks;if(A!==null)for(u.shared.hiddenCallbacks=null,u=0;u<A.length;u++)$m(A[u],x)}catch(B){Ke(o,o.return,B)}}s&&y&64&&Xh(p),Er(p,p.return);break;case 27:eg(p);case 26:case 5:la(u,p,s),s&&o===null&&y&4&&Fh(p),Er(p,p.return);break;case 12:la(u,p,s);break;case 31:la(u,p,s),s&&y&4&&sg(u,p);break;case 13:la(u,p,s),s&&y&4&&rg(u,p);break;case 22:p.memoizedState===null&&la(u,p,s),Er(p,p.return);break;case 30:break;default:la(u,p,s)}a=a.sibling}}function ud(t,a){var s=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),t=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(t=a.memoizedState.cachePool.pool),t!==s&&(t!=null&&t.refCount++,s!=null&&yr(s))}function dd(t,a){t=null,a.alternate!==null&&(t=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==t&&(a.refCount++,t!=null&&yr(t))}function On(t,a,s,o){if(a.subtreeFlags&10256)for(a=a.child;a!==null;)cg(t,a,s,o),a=a.sibling}function cg(t,a,s,o){var u=a.flags;switch(a.tag){case 0:case 11:case 15:On(t,a,s,o),u&2048&&Tr(9,a);break;case 1:On(t,a,s,o);break;case 3:On(t,a,s,o),u&2048&&(t=null,a.alternate!==null&&(t=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==t&&(a.refCount++,t!=null&&yr(t)));break;case 12:if(u&2048){On(t,a,s,o),t=a.stateNode;try{var p=a.memoizedProps,y=p.id,x=p.onPostCommit;typeof x=="function"&&x(y,a.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(A){Ke(a,a.return,A)}}else On(t,a,s,o);break;case 31:On(t,a,s,o);break;case 13:On(t,a,s,o);break;case 23:break;case 22:p=a.stateNode,y=a.alternate,a.memoizedState!==null?p._visibility&2?On(t,a,s,o):Or(t,a):p._visibility&2?On(t,a,s,o):(p._visibility|=2,ps(t,a,s,o,(a.subtreeFlags&10256)!==0||!1)),u&2048&&ud(y,a);break;case 24:On(t,a,s,o),u&2048&&dd(a.alternate,a);break;default:On(t,a,s,o)}}function ps(t,a,s,o,u){for(u=u&&((a.subtreeFlags&10256)!==0||!1),a=a.child;a!==null;){var p=t,y=a,x=s,A=o,B=y.flags;switch(y.tag){case 0:case 11:case 15:ps(p,y,x,A,u),Tr(8,y);break;case 23:break;case 22:var I=y.stateNode;y.memoizedState!==null?I._visibility&2?ps(p,y,x,A,u):Or(p,y):(I._visibility|=2,ps(p,y,x,A,u)),u&&B&2048&&ud(y.alternate,y);break;case 24:ps(p,y,x,A,u),u&&B&2048&&dd(y.alternate,y);break;default:ps(p,y,x,A,u)}a=a.sibling}}function Or(t,a){if(a.subtreeFlags&10256)for(a=a.child;a!==null;){var s=t,o=a,u=o.flags;switch(o.tag){case 22:Or(s,o),u&2048&&ud(o.alternate,o);break;case 24:Or(s,o),u&2048&&dd(o.alternate,o);break;default:Or(s,o)}a=a.sibling}}var Dr=8192;function ms(t,a,s){if(t.subtreeFlags&Dr)for(t=t.child;t!==null;)ug(t,a,s),t=t.sibling}function ug(t,a,s){switch(t.tag){case 26:ms(t,a,s),t.flags&Dr&&t.memoizedState!==null&&Vx(s,En,t.memoizedState,t.memoizedProps);break;case 5:ms(t,a,s);break;case 3:case 4:var o=En;En=Sl(t.stateNode.containerInfo),ms(t,a,s),En=o;break;case 22:t.memoizedState===null&&(o=t.alternate,o!==null&&o.memoizedState!==null?(o=Dr,Dr=16777216,ms(t,a,s),Dr=o):ms(t,a,s));break;default:ms(t,a,s)}}function dg(t){var a=t.alternate;if(a!==null&&(t=a.child,t!==null)){a.child=null;do a=t.sibling,t.sibling=null,t=a;while(t!==null)}}function Rr(t){var a=t.deletions;if((t.flags&16)!==0){if(a!==null)for(var s=0;s<a.length;s++){var o=a[s];zt=o,pg(o,t)}dg(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)fg(t),t=t.sibling}function fg(t){switch(t.tag){case 0:case 11:case 15:Rr(t),t.flags&2048&&za(9,t,t.return);break;case 3:Rr(t);break;case 12:Rr(t);break;case 22:var a=t.stateNode;t.memoizedState!==null&&a._visibility&2&&(t.return===null||t.return.tag!==13)?(a._visibility&=-3,ol(t)):Rr(t);break;default:Rr(t)}}function ol(t){var a=t.deletions;if((t.flags&16)!==0){if(a!==null)for(var s=0;s<a.length;s++){var o=a[s];zt=o,pg(o,t)}dg(t)}for(t=t.child;t!==null;){switch(a=t,a.tag){case 0:case 11:case 15:za(8,a,a.return),ol(a);break;case 22:s=a.stateNode,s._visibility&2&&(s._visibility&=-3,ol(a));break;default:ol(a)}t=t.sibling}}function pg(t,a){for(;zt!==null;){var s=zt;switch(s.tag){case 0:case 11:case 15:za(8,s,a);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var o=s.memoizedState.cachePool.pool;o!=null&&o.refCount++}break;case 24:yr(s.memoizedState.cache)}if(o=s.child,o!==null)o.return=s,zt=o;else e:for(s=t;zt!==null;){o=zt;var u=o.sibling,p=o.return;if(ag(o),o===s){zt=null;break e}if(u!==null){u.return=p,zt=u;break e}zt=p}}}var nx={getCacheForType:function(t){var a=Dt(St),s=a.data.get(t);return s===void 0&&(s=t(),a.data.set(t,s)),s},cacheSignal:function(){return Dt(St).controller.signal}},ax=typeof WeakMap=="function"?WeakMap:Map,Ie=0,et=null,Ee=null,De=0,Pe=0,rn=null,Ca=!1,hs=!1,fd=!1,ca=0,pt=0,Ta=0,yi=0,pd=0,on=0,gs=0,Mr=null,Xt=null,md=!1,ll=0,mg=0,cl=1/0,ul=null,Ea=null,kt=0,Oa=null,ys=null,ua=0,hd=0,gd=null,hg=null,Br=0,yd=null;function ln(){return(Ie&2)!==0&&De!==0?De&-De:$.T!==null?jd():Ep()}function gg(){if(on===0)if((De&536870912)===0||Be){var t=qi;qi<<=1,(qi&3932160)===0&&(qi=262144),on=t}else on=536870912;return t=an.current,t!==null&&(t.flags|=32),on}function Jt(t,a,s){(t===et&&(Pe===2||Pe===9)||t.cancelPendingCommit!==null)&&(bs(t,0),Da(t,De,on,!1)),We(t,s),((Ie&2)===0||t!==et)&&(t===et&&((Ie&2)===0&&(yi|=s),pt===4&&Da(t,De,on,!1)),Vn(t))}function yg(t,a,s){if((Ie&6)!==0)throw Error(r(327));var o=!s&&(a&127)===0&&(a&t.expiredLanes)===0||Wa(t,a),u=o?rx(t,a):vd(t,a,!0),p=o;do{if(u===0){hs&&!o&&Da(t,a,0,!1);break}else{if(s=t.current.alternate,p&&!ix(s)){u=vd(t,a,!1),p=!1;continue}if(u===2){if(p=a,t.errorRecoveryDisabledLanes&p)var y=0;else y=t.pendingLanes&-536870913,y=y!==0?y:y&536870912?536870912:0;if(y!==0){a=y;e:{var x=t;u=Mr;var A=x.current.memoizedState.isDehydrated;if(A&&(bs(x,y).flags|=256),y=vd(x,y,!1),y!==2){if(fd&&!A){x.errorRecoveryDisabledLanes|=p,yi|=p,u=4;break e}p=Xt,Xt=u,p!==null&&(Xt===null?Xt=p:Xt.push.apply(Xt,p))}u=y}if(p=!1,u!==2)continue}}if(u===1){bs(t,0),Da(t,a,0,!0);break}e:{switch(o=t,p=u,p){case 0:case 1:throw Error(r(345));case 4:if((a&4194048)!==a)break;case 6:Da(o,a,on,!Ca);break e;case 2:Xt=null;break;case 3:case 5:break;default:throw Error(r(329))}if((a&62914560)===a&&(u=ll+300-Lt(),10<u)){if(Da(o,a,on,!Ca),Ui(o,0,!0)!==0)break e;ua=a,o.timeoutHandle=Qg(bg.bind(null,o,s,Xt,ul,md,a,on,yi,gs,Ca,p,"Throttled",-0,0),u);break e}bg(o,s,Xt,ul,md,a,on,yi,gs,Ca,p,null,-0,0)}}break}while(!0);Vn(t)}function bg(t,a,s,o,u,p,y,x,A,B,I,Y,q,V){if(t.timeoutHandle=-1,Y=a.subtreeFlags,Y&8192||(Y&16785408)===16785408){Y={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Yn},ug(a,p,Y);var fe=(p&62914560)===p?ll-Lt():(p&4194048)===p?mg-Lt():0;if(fe=Gx(Y,fe),fe!==null){ua=p,t.cancelPendingCommit=fe(Ag.bind(null,t,a,p,s,o,u,y,x,A,I,Y,null,q,V)),Da(t,p,y,!B);return}}Ag(t,a,p,s,o,u,y,x,A)}function ix(t){for(var a=t;;){var s=a.tag;if((s===0||s===11||s===15)&&a.flags&16384&&(s=a.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var o=0;o<s.length;o++){var u=s[o],p=u.getSnapshot;u=u.value;try{if(!tn(p(),u))return!1}catch{return!1}}if(s=a.child,a.subtreeFlags&16384&&s!==null)s.return=a,a=s;else{if(a===t)break;for(;a.sibling===null;){if(a.return===null||a.return===t)return!0;a=a.return}a.sibling.return=a.return,a=a.sibling}}return!0}function Da(t,a,s,o){a&=~pd,a&=~yi,t.suspendedLanes|=a,t.pingedLanes&=~a,o&&(t.warmLanes|=a),o=t.expirationTimes;for(var u=a;0<u;){var p=31-mt(u),y=1<<p;o[p]=-1,u&=~y}s!==0&&vo(t,s,a)}function dl(){return(Ie&6)===0?(Lr(0),!1):!0}function bd(){if(Ee!==null){if(Pe===0)var t=Ee.return;else t=Ee,Wn=li=null,Ru(t),ls=null,vr=0,t=Ee;for(;t!==null;)Yh(t.alternate,t),t=t.return;Ee=null}}function bs(t,a){var s=t.timeoutHandle;s!==-1&&(t.timeoutHandle=-1,Nx(s)),s=t.cancelPendingCommit,s!==null&&(t.cancelPendingCommit=null,s()),ua=0,bd(),et=t,Ee=s=Jn(t.current,null),De=a,Pe=0,rn=null,Ca=!1,hs=Wa(t,a),fd=!1,gs=on=pd=yi=Ta=pt=0,Xt=Mr=null,md=!1,(a&8)!==0&&(a|=a&32);var o=t.entangledLanes;if(o!==0)for(t=t.entanglements,o&=a;0<o;){var u=31-mt(o),p=1<<u;a|=t[u],o&=~p}return ca=a,Oo(),s}function vg(t,a){_e=null,$.H=_r,a===os||a===Uo?(a=Mm(),Pe=3):a===wu?(a=Mm(),Pe=4):Pe=a===Xu?8:a!==null&&typeof a=="object"&&typeof a.then=="function"?6:1,rn=a,Ee===null&&(pt=1,el(t,pn(a,t.current)))}function Sg(){var t=an.current;return t===null?!0:(De&4194048)===De?yn===null:(De&62914560)===De||(De&536870912)!==0?t===yn:!1}function xg(){var t=$.H;return $.H=_r,t===null?_r:t}function wg(){var t=$.A;return $.A=nx,t}function fl(){pt=4,Ca||(De&4194048)!==De&&an.current!==null||(hs=!0),(Ta&134217727)===0&&(yi&134217727)===0||et===null||Da(et,De,on,!1)}function vd(t,a,s){var o=Ie;Ie|=2;var u=xg(),p=wg();(et!==t||De!==a)&&(ul=null,bs(t,a)),a=!1;var y=pt;e:do try{if(Pe!==0&&Ee!==null){var x=Ee,A=rn;switch(Pe){case 8:bd(),y=6;break e;case 3:case 2:case 9:case 6:an.current===null&&(a=!0);var B=Pe;if(Pe=0,rn=null,vs(t,x,A,B),s&&hs){y=0;break e}break;default:B=Pe,Pe=0,rn=null,vs(t,x,A,B)}}sx(),y=pt;break}catch(I){vg(t,I)}while(!0);return a&&t.shellSuspendCounter++,Wn=li=null,Ie=o,$.H=u,$.A=p,Ee===null&&(et=null,De=0,Oo()),y}function sx(){for(;Ee!==null;)jg(Ee)}function rx(t,a){var s=Ie;Ie|=2;var o=xg(),u=wg();et!==t||De!==a?(ul=null,cl=Lt()+500,bs(t,a)):hs=Wa(t,a);e:do try{if(Pe!==0&&Ee!==null){a=Ee;var p=rn;t:switch(Pe){case 1:Pe=0,rn=null,vs(t,a,p,1);break;case 2:case 9:if(Dm(p)){Pe=0,rn=null,Ng(a);break}a=function(){Pe!==2&&Pe!==9||et!==t||(Pe=7),Vn(t)},p.then(a,a);break e;case 3:Pe=7;break e;case 4:Pe=5;break e;case 7:Dm(p)?(Pe=0,rn=null,Ng(a)):(Pe=0,rn=null,vs(t,a,p,7));break;case 5:var y=null;switch(Ee.tag){case 26:y=Ee.memoizedState;case 5:case 27:var x=Ee;if(y?cy(y):x.stateNode.complete){Pe=0,rn=null;var A=x.sibling;if(A!==null)Ee=A;else{var B=x.return;B!==null?(Ee=B,pl(B)):Ee=null}break t}}Pe=0,rn=null,vs(t,a,p,5);break;case 6:Pe=0,rn=null,vs(t,a,p,6);break;case 8:bd(),pt=6;break e;default:throw Error(r(462))}}ox();break}catch(I){vg(t,I)}while(!0);return Wn=li=null,$.H=o,$.A=u,Ie=s,Ee!==null?0:(et=null,De=0,Oo(),pt)}function ox(){for(;Ee!==null&&!mo();)jg(Ee)}function jg(t){var a=Kh(t.alternate,t,ca);t.memoizedProps=t.pendingProps,a===null?pl(t):Ee=a}function Ng(t){var a=t,s=a.alternate;switch(a.tag){case 15:case 0:a=Vh(s,a,a.pendingProps,a.type,void 0,De);break;case 11:a=Vh(s,a,a.pendingProps,a.type.render,a.ref,De);break;case 5:Ru(a);default:Yh(s,a),a=Ee=wm(a,ca),a=Kh(s,a,ca)}t.memoizedProps=t.pendingProps,a===null?pl(t):Ee=a}function vs(t,a,s,o){Wn=li=null,Ru(a),ls=null,vr=0;var u=a.return;try{if(YS(t,u,a,s,De)){pt=1,el(t,pn(s,t.current)),Ee=null;return}}catch(p){if(u!==null)throw Ee=u,p;pt=1,el(t,pn(s,t.current)),Ee=null;return}a.flags&32768?(Be||o===1?t=!0:hs||(De&536870912)!==0?t=!1:(Ca=t=!0,(o===2||o===9||o===3||o===6)&&(o=an.current,o!==null&&o.tag===13&&(o.flags|=16384))),kg(a,t)):pl(a)}function pl(t){var a=t;do{if((a.flags&32768)!==0){kg(a,Ca);return}t=a.return;var s=FS(a.alternate,a,ca);if(s!==null){Ee=s;return}if(a=a.sibling,a!==null){Ee=a;return}Ee=a=t}while(a!==null);pt===0&&(pt=5)}function kg(t,a){do{var s=WS(t.alternate,t);if(s!==null){s.flags&=32767,Ee=s;return}if(s=t.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!a&&(t=t.sibling,t!==null)){Ee=t;return}Ee=t=s}while(t!==null);pt=6,Ee=null}function Ag(t,a,s,o,u,p,y,x,A){t.cancelPendingCommit=null;do ml();while(kt!==0);if((Ie&6)!==0)throw Error(r(327));if(a!==null){if(a===t.current)throw Error(r(177));if(p=a.lanes|a.childLanes,p|=ou,ei(t,s,p,y,x,A),t===et&&(Ee=et=null,De=0),ys=a,Oa=t,ua=s,hd=p,gd=u,hg=o,(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,dx(Mi,function(){return Eg(),null})):(t.callbackNode=null,t.callbackPriority=0),o=(a.flags&13878)!==0,(a.subtreeFlags&13878)!==0||o){o=$.T,$.T=null,u=F.p,F.p=2,y=Ie,Ie|=4;try{ex(t,a,s)}finally{Ie=y,F.p=u,$.T=o}}kt=1,_g(),zg(),Cg()}}function _g(){if(kt===1){kt=0;var t=Oa,a=ys,s=(a.flags&13878)!==0;if((a.subtreeFlags&13878)!==0||s){s=$.T,$.T=null;var o=F.p;F.p=2;var u=Ie;Ie|=4;try{og(a,t);var p=Ed,y=pm(t.containerInfo),x=p.focusedElem,A=p.selectionRange;if(y!==x&&x&&x.ownerDocument&&fm(x.ownerDocument.documentElement,x)){if(A!==null&&nu(x)){var B=A.start,I=A.end;if(I===void 0&&(I=B),"selectionStart"in x)x.selectionStart=B,x.selectionEnd=Math.min(I,x.value.length);else{var Y=x.ownerDocument||document,q=Y&&Y.defaultView||window;if(q.getSelection){var V=q.getSelection(),fe=x.textContent.length,we=Math.min(A.start,fe),Fe=A.end===void 0?we:Math.min(A.end,fe);!V.extend&&we>Fe&&(y=Fe,Fe=we,we=y);var O=dm(x,we),z=dm(x,Fe);if(O&&z&&(V.rangeCount!==1||V.anchorNode!==O.node||V.anchorOffset!==O.offset||V.focusNode!==z.node||V.focusOffset!==z.offset)){var M=Y.createRange();M.setStart(O.node,O.offset),V.removeAllRanges(),we>Fe?(V.addRange(M),V.extend(z.node,z.offset)):(M.setEnd(z.node,z.offset),V.addRange(M))}}}}for(Y=[],V=x;V=V.parentNode;)V.nodeType===1&&Y.push({element:V,left:V.scrollLeft,top:V.scrollTop});for(typeof x.focus=="function"&&x.focus(),x=0;x<Y.length;x++){var P=Y[x];P.element.scrollLeft=P.left,P.element.scrollTop=P.top}}Al=!!Td,Ed=Td=null}finally{Ie=u,F.p=o,$.T=s}}t.current=a,kt=2}}function zg(){if(kt===2){kt=0;var t=Oa,a=ys,s=(a.flags&8772)!==0;if((a.subtreeFlags&8772)!==0||s){s=$.T,$.T=null;var o=F.p;F.p=2;var u=Ie;Ie|=4;try{ng(t,a.alternate,a)}finally{Ie=u,F.p=o,$.T=s}}kt=3}}function Cg(){if(kt===4||kt===3){kt=0,Mc();var t=Oa,a=ys,s=ua,o=hg;(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?kt=5:(kt=0,ys=Oa=null,Tg(t,t.pendingLanes));var u=t.pendingLanes;if(u===0&&(Ea=null),Cn(s),a=a.stateNode,qt&&typeof qt.onCommitFiberRoot=="function")try{qt.onCommitFiberRoot(ga,a,void 0,(a.current.flags&128)===128)}catch{}if(o!==null){a=$.T,u=F.p,F.p=2,$.T=null;try{for(var p=t.onRecoverableError,y=0;y<o.length;y++){var x=o[y];p(x.value,{componentStack:x.stack})}}finally{$.T=a,F.p=u}}(ua&3)!==0&&ml(),Vn(t),u=t.pendingLanes,(s&261930)!==0&&(u&42)!==0?t===yd?Br++:(Br=0,yd=t):Br=0,Lr(0)}}function Tg(t,a){(t.pooledCacheLanes&=a)===0&&(a=t.pooledCache,a!=null&&(t.pooledCache=null,yr(a)))}function ml(){return _g(),zg(),Cg(),Eg()}function Eg(){if(kt!==5)return!1;var t=Oa,a=hd;hd=0;var s=Cn(ua),o=$.T,u=F.p;try{F.p=32>s?32:s,$.T=null,s=gd,gd=null;var p=Oa,y=ua;if(kt=0,ys=Oa=null,ua=0,(Ie&6)!==0)throw Error(r(331));var x=Ie;if(Ie|=4,fg(p.current),cg(p,p.current,y,s),Ie=x,Lr(0,!1),qt&&typeof qt.onPostCommitFiberRoot=="function")try{qt.onPostCommitFiberRoot(ga,p)}catch{}return!0}finally{F.p=u,$.T=o,Tg(t,a)}}function Og(t,a,s){a=pn(s,a),a=Yu(t.stateNode,a,2),t=ka(t,a,2),t!==null&&(We(t,2),Vn(t))}function Ke(t,a,s){if(t.tag===3)Og(t,t,s);else for(;a!==null;){if(a.tag===3){Og(a,t,s);break}else if(a.tag===1){var o=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(Ea===null||!Ea.has(o))){t=pn(s,t),s=Dh(2),o=ka(a,s,2),o!==null&&(Rh(s,o,a,t),We(o,2),Vn(o));break}}a=a.return}}function Sd(t,a,s){var o=t.pingCache;if(o===null){o=t.pingCache=new ax;var u=new Set;o.set(a,u)}else u=o.get(a),u===void 0&&(u=new Set,o.set(a,u));u.has(s)||(fd=!0,u.add(s),t=lx.bind(null,t,a,s),a.then(t,t))}function lx(t,a,s){var o=t.pingCache;o!==null&&o.delete(a),t.pingedLanes|=t.suspendedLanes&s,t.warmLanes&=~s,et===t&&(De&s)===s&&(pt===4||pt===3&&(De&62914560)===De&&300>Lt()-ll?(Ie&2)===0&&bs(t,0):pd|=s,gs===De&&(gs=0)),Vn(t)}function Dg(t,a){a===0&&(a=bo()),t=si(t,a),t!==null&&(We(t,a),Vn(t))}function cx(t){var a=t.memoizedState,s=0;a!==null&&(s=a.retryLane),Dg(t,s)}function ux(t,a){var s=0;switch(t.tag){case 31:case 13:var o=t.stateNode,u=t.memoizedState;u!==null&&(s=u.retryLane);break;case 19:o=t.stateNode;break;case 22:o=t.stateNode._retryCache;break;default:throw Error(r(314))}o!==null&&o.delete(a),Dg(t,s)}function dx(t,a){return Di(t,a)}var hl=null,Ss=null,xd=!1,gl=!1,wd=!1,Ra=0;function Vn(t){t!==Ss&&t.next===null&&(Ss===null?hl=Ss=t:Ss=Ss.next=t),gl=!0,xd||(xd=!0,px())}function Lr(t,a){if(!wd&&gl){wd=!0;do for(var s=!1,o=hl;o!==null;){if(t!==0){var u=o.pendingLanes;if(u===0)var p=0;else{var y=o.suspendedLanes,x=o.pingedLanes;p=(1<<31-mt(42|t)+1)-1,p&=u&~(y&~x),p=p&201326741?p&201326741|1:p?p|2:0}p!==0&&(s=!0,Lg(o,p))}else p=De,p=Ui(o,o===et?p:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(p&3)===0||Wa(o,p)||(s=!0,Lg(o,p));o=o.next}while(s);wd=!1}}function fx(){Rg()}function Rg(){gl=xd=!1;var t=0;Ra!==0&&jx()&&(t=Ra);for(var a=Lt(),s=null,o=hl;o!==null;){var u=o.next,p=Mg(o,a);p===0?(o.next=null,s===null?hl=u:s.next=u,u===null&&(Ss=s)):(s=o,(t!==0||(p&3)!==0)&&(gl=!0)),o=u}kt!==0&&kt!==5||Lr(t),Ra!==0&&(Ra=0)}function Mg(t,a){for(var s=t.suspendedLanes,o=t.pingedLanes,u=t.expirationTimes,p=t.pendingLanes&-62914561;0<p;){var y=31-mt(p),x=1<<y,A=u[y];A===-1?((x&s)===0||(x&o)!==0)&&(u[y]=Kn(x,a)):A<=a&&(t.expiredLanes|=x),p&=~x}if(a=et,s=De,s=Ui(t,t===a?s:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),o=t.callbackNode,s===0||t===a&&(Pe===2||Pe===9)||t.cancelPendingCommit!==null)return o!==null&&o!==null&&Ri(o),t.callbackNode=null,t.callbackPriority=0;if((s&3)===0||Wa(t,s)){if(a=s&-s,a===t.callbackPriority)return a;switch(o!==null&&Ri(o),Cn(s)){case 2:case 8:s=go;break;case 32:s=Mi;break;case 268435456:s=Bi;break;default:s=Mi}return o=Bg.bind(null,t),s=Di(s,o),t.callbackPriority=a,t.callbackNode=s,a}return o!==null&&o!==null&&Ri(o),t.callbackPriority=2,t.callbackNode=null,2}function Bg(t,a){if(kt!==0&&kt!==5)return t.callbackNode=null,t.callbackPriority=0,null;var s=t.callbackNode;if(ml()&&t.callbackNode!==s)return null;var o=De;return o=Ui(t,t===et?o:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),o===0?null:(yg(t,o,a),Mg(t,Lt()),t.callbackNode!=null&&t.callbackNode===s?Bg.bind(null,t):null)}function Lg(t,a){if(ml())return null;yg(t,a,!0)}function px(){kx(function(){(Ie&6)!==0?Di(er,fx):Rg()})}function jd(){if(Ra===0){var t=ss;t===0&&(t=Li,Li<<=1,(Li&261888)===0&&(Li=256)),Ra=t}return Ra}function qg(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:No(""+t)}function $g(t,a){var s=a.ownerDocument.createElement("input");return s.name=a.name,s.value=a.value,t.id&&s.setAttribute("form",t.id),a.parentNode.insertBefore(s,a),t=new FormData(t),s.parentNode.removeChild(s),t}function mx(t,a,s,o,u){if(a==="submit"&&s&&s.stateNode===u){var p=qg((u[Zt]||null).action),y=o.submitter;y&&(a=(a=y[Zt]||null)?qg(a.formAction):y.getAttribute("formAction"),a!==null&&(p=a,y=null));var x=new zo("action","action",null,o,u);t.push({event:x,listeners:[{instance:null,listener:function(){if(o.defaultPrevented){if(Ra!==0){var A=y?$g(u,y):new FormData(u);Iu(s,{pending:!0,data:A,method:u.method,action:p},null,A)}}else typeof p=="function"&&(x.preventDefault(),A=y?$g(u,y):new FormData(u),Iu(s,{pending:!0,data:A,method:u.method,action:p},p,A))},currentTarget:u}]})}}for(var Nd=0;Nd<ru.length;Nd++){var kd=ru[Nd],hx=kd.toLowerCase(),gx=kd[0].toUpperCase()+kd.slice(1);Tn(hx,"on"+gx)}Tn(gm,"onAnimationEnd"),Tn(ym,"onAnimationIteration"),Tn(bm,"onAnimationStart"),Tn("dblclick","onDoubleClick"),Tn("focusin","onFocus"),Tn("focusout","onBlur"),Tn(OS,"onTransitionRun"),Tn(DS,"onTransitionStart"),Tn(RS,"onTransitionCancel"),Tn(vm,"onTransitionEnd"),Zi("onMouseEnter",["mouseout","mouseover"]),Zi("onMouseLeave",["mouseout","mouseover"]),Zi("onPointerEnter",["pointerout","pointerover"]),Zi("onPointerLeave",["pointerout","pointerover"]),ti("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ti("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ti("onBeforeInput",["compositionend","keypress","textInput","paste"]),ti("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ti("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ti("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var qr="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(" "),yx=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(qr));function Ug(t,a){a=(a&4)!==0;for(var s=0;s<t.length;s++){var o=t[s],u=o.event;o=o.listeners;e:{var p=void 0;if(a)for(var y=o.length-1;0<=y;y--){var x=o[y],A=x.instance,B=x.currentTarget;if(x=x.listener,A!==p&&u.isPropagationStopped())break e;p=x,u.currentTarget=B;try{p(u)}catch(I){Eo(I)}u.currentTarget=null,p=A}else for(y=0;y<o.length;y++){if(x=o[y],A=x.instance,B=x.currentTarget,x=x.listener,A!==p&&u.isPropagationStopped())break e;p=x,u.currentTarget=B;try{p(u)}catch(I){Eo(I)}u.currentTarget=null,p=A}}}}function Oe(t,a){var s=a[qc];s===void 0&&(s=a[qc]=new Set);var o=t+"__bubble";s.has(o)||(Vg(a,t,2,!1),s.add(o))}function Ad(t,a,s){var o=0;a&&(o|=4),Vg(s,t,o,a)}var yl="_reactListening"+Math.random().toString(36).slice(2);function _d(t){if(!t[yl]){t[yl]=!0,Rp.forEach(function(s){s!=="selectionchange"&&(yx.has(s)||Ad(s,!1,t),Ad(s,!0,t))});var a=t.nodeType===9?t:t.ownerDocument;a===null||a[yl]||(a[yl]=!0,Ad("selectionchange",!1,a))}}function Vg(t,a,s,o){switch(gy(a)){case 2:var u=Zx;break;case 8:u=Px;break;default:u=Gd}s=u.bind(null,a,s,t),u=void 0,!Kc||a!=="touchstart"&&a!=="touchmove"&&a!=="wheel"||(u=!0),o?u!==void 0?t.addEventListener(a,s,{capture:!0,passive:u}):t.addEventListener(a,s,!0):u!==void 0?t.addEventListener(a,s,{passive:u}):t.addEventListener(a,s,!1)}function zd(t,a,s,o,u){var p=o;if((a&1)===0&&(a&2)===0&&o!==null)e:for(;;){if(o===null)return;var y=o.tag;if(y===3||y===4){var x=o.stateNode.containerInfo;if(x===u)break;if(y===4)for(y=o.return;y!==null;){var A=y.tag;if((A===3||A===4)&&y.stateNode.containerInfo===u)return;y=y.return}for(;x!==null;){if(y=Gi(x),y===null)return;if(A=y.tag,A===5||A===6||A===26||A===27){o=p=y;continue e}x=x.parentNode}}o=o.return}Pp(function(){var B=p,I=Zc(s),Y=[];e:{var q=Sm.get(t);if(q!==void 0){var V=zo,fe=t;switch(t){case"keypress":if(Ao(s)===0)break e;case"keydown":case"keyup":V=uS;break;case"focusin":fe="focus",V=Jc;break;case"focusout":fe="blur",V=Jc;break;case"beforeblur":case"afterblur":V=Jc;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":V=Yp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":V=F1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":V=pS;break;case gm:case ym:case bm:V=tS;break;case vm:V=hS;break;case"scroll":case"scrollend":V=X1;break;case"wheel":V=yS;break;case"copy":case"cut":case"paste":V=aS;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":V=Jp;break;case"toggle":case"beforetoggle":V=vS}var we=(a&4)!==0,Fe=!we&&(t==="scroll"||t==="scrollend"),O=we?q!==null?q+"Capture":null:q;we=[];for(var z=B,M;z!==null;){var P=z;if(M=P.stateNode,P=P.tag,P!==5&&P!==26&&P!==27||M===null||O===null||(P=rr(z,O),P!=null&&we.push($r(z,P,M))),Fe)break;z=z.return}0<we.length&&(q=new V(q,fe,null,s,I),Y.push({event:q,listeners:we}))}}if((a&7)===0){e:{if(q=t==="mouseover"||t==="pointerover",V=t==="mouseout"||t==="pointerout",q&&s!==Hc&&(fe=s.relatedTarget||s.fromElement)&&(Gi(fe)||fe[Vi]))break e;if((V||q)&&(q=I.window===I?I:(q=I.ownerDocument)?q.defaultView||q.parentWindow:window,V?(fe=s.relatedTarget||s.toElement,V=B,fe=fe?Gi(fe):null,fe!==null&&(Fe=c(fe),we=fe.tag,fe!==Fe||we!==5&&we!==27&&we!==6)&&(fe=null)):(V=null,fe=B),V!==fe)){if(we=Yp,P="onMouseLeave",O="onMouseEnter",z="mouse",(t==="pointerout"||t==="pointerover")&&(we=Jp,P="onPointerLeave",O="onPointerEnter",z="pointer"),Fe=V==null?q:sr(V),M=fe==null?q:sr(fe),q=new we(P,z+"leave",V,s,I),q.target=Fe,q.relatedTarget=M,P=null,Gi(I)===B&&(we=new we(O,z+"enter",fe,s,I),we.target=M,we.relatedTarget=Fe,P=we),Fe=P,V&&fe)t:{for(we=bx,O=V,z=fe,M=0,P=O;P;P=we(P))M++;P=0;for(var Se=z;Se;Se=we(Se))P++;for(;0<M-P;)O=we(O),M--;for(;0<P-M;)z=we(z),P--;for(;M--;){if(O===z||z!==null&&O===z.alternate){we=O;break t}O=we(O),z=we(z)}we=null}else we=null;V!==null&&Gg(Y,q,V,we,!1),fe!==null&&Fe!==null&&Gg(Y,Fe,fe,we,!0)}}e:{if(q=B?sr(B):window,V=q.nodeName&&q.nodeName.toLowerCase(),V==="select"||V==="input"&&q.type==="file")var Ue=sm;else if(am(q))if(rm)Ue=CS;else{Ue=_S;var ge=AS}else V=q.nodeName,!V||V.toLowerCase()!=="input"||q.type!=="checkbox"&&q.type!=="radio"?B&&Ic(B.elementType)&&(Ue=sm):Ue=zS;if(Ue&&(Ue=Ue(t,B))){im(Y,Ue,s,I);break e}ge&&ge(t,q,B),t==="focusout"&&B&&q.type==="number"&&B.memoizedProps.value!=null&&Gc(q,"number",q.value)}switch(ge=B?sr(B):window,t){case"focusin":(am(ge)||ge.contentEditable==="true")&&(Ji=ge,au=B,mr=null);break;case"focusout":mr=au=Ji=null;break;case"mousedown":iu=!0;break;case"contextmenu":case"mouseup":case"dragend":iu=!1,mm(Y,s,I);break;case"selectionchange":if(ES)break;case"keydown":case"keyup":mm(Y,s,I)}var ze;if(Wc)e:{switch(t){case"compositionstart":var Re="onCompositionStart";break e;case"compositionend":Re="onCompositionEnd";break e;case"compositionupdate":Re="onCompositionUpdate";break e}Re=void 0}else Xi?tm(t,s)&&(Re="onCompositionEnd"):t==="keydown"&&s.keyCode===229&&(Re="onCompositionStart");Re&&(Fp&&s.locale!=="ko"&&(Xi||Re!=="onCompositionStart"?Re==="onCompositionEnd"&&Xi&&(ze=Kp()):(ba=I,Qc="value"in ba?ba.value:ba.textContent,Xi=!0)),ge=bl(B,Re),0<ge.length&&(Re=new Xp(Re,t,null,s,I),Y.push({event:Re,listeners:ge}),ze?Re.data=ze:(ze=nm(s),ze!==null&&(Re.data=ze)))),(ze=xS?wS(t,s):jS(t,s))&&(Re=bl(B,"onBeforeInput"),0<Re.length&&(ge=new Xp("onBeforeInput","beforeinput",null,s,I),Y.push({event:ge,listeners:Re}),ge.data=ze)),mx(Y,t,B,s,I)}Ug(Y,a)})}function $r(t,a,s){return{instance:t,listener:a,currentTarget:s}}function bl(t,a){for(var s=a+"Capture",o=[];t!==null;){var u=t,p=u.stateNode;if(u=u.tag,u!==5&&u!==26&&u!==27||p===null||(u=rr(t,s),u!=null&&o.unshift($r(t,u,p)),u=rr(t,a),u!=null&&o.push($r(t,u,p))),t.tag===3)return o;t=t.return}return[]}function bx(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function Gg(t,a,s,o,u){for(var p=a._reactName,y=[];s!==null&&s!==o;){var x=s,A=x.alternate,B=x.stateNode;if(x=x.tag,A!==null&&A===o)break;x!==5&&x!==26&&x!==27||B===null||(A=B,u?(B=rr(s,p),B!=null&&y.unshift($r(s,B,A))):u||(B=rr(s,p),B!=null&&y.push($r(s,B,A)))),s=s.return}y.length!==0&&t.push({event:a,listeners:y})}var vx=/\r\n?/g,Sx=/\u0000|\uFFFD/g;function Ig(t){return(typeof t=="string"?t:""+t).replace(vx,`
10
+ `).replace(Sx,"")}function Hg(t,a){return a=Ig(a),Ig(t)===a}function Je(t,a,s,o,u,p){switch(s){case"children":typeof o=="string"?a==="body"||a==="textarea"&&o===""||Ki(t,o):(typeof o=="number"||typeof o=="bigint")&&a!=="body"&&Ki(t,""+o);break;case"className":wo(t,"class",o);break;case"tabIndex":wo(t,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":wo(t,s,o);break;case"style":Hp(t,o,p);break;case"data":if(a!=="object"){wo(t,"data",o);break}case"src":case"href":if(o===""&&(a!=="a"||s!=="href")){t.removeAttribute(s);break}if(o==null||typeof o=="function"||typeof o=="symbol"||typeof o=="boolean"){t.removeAttribute(s);break}o=No(""+o),t.setAttribute(s,o);break;case"action":case"formAction":if(typeof o=="function"){t.setAttribute(s,"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 p=="function"&&(s==="formAction"?(a!=="input"&&Je(t,a,"name",u.name,u,null),Je(t,a,"formEncType",u.formEncType,u,null),Je(t,a,"formMethod",u.formMethod,u,null),Je(t,a,"formTarget",u.formTarget,u,null)):(Je(t,a,"encType",u.encType,u,null),Je(t,a,"method",u.method,u,null),Je(t,a,"target",u.target,u,null)));if(o==null||typeof o=="symbol"||typeof o=="boolean"){t.removeAttribute(s);break}o=No(""+o),t.setAttribute(s,o);break;case"onClick":o!=null&&(t.onclick=Yn);break;case"onScroll":o!=null&&Oe("scroll",t);break;case"onScrollEnd":o!=null&&Oe("scrollend",t);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(r(61));if(s=o.__html,s!=null){if(u.children!=null)throw Error(r(60));t.innerHTML=s}}break;case"multiple":t.multiple=o&&typeof o!="function"&&typeof o!="symbol";break;case"muted":t.muted=o&&typeof o!="function"&&typeof o!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(o==null||typeof o=="function"||typeof o=="boolean"||typeof o=="symbol"){t.removeAttribute("xlink:href");break}s=No(""+o),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":o!=null&&typeof o!="function"&&typeof o!="symbol"?t.setAttribute(s,""+o):t.removeAttribute(s);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":o&&typeof o!="function"&&typeof o!="symbol"?t.setAttribute(s,""):t.removeAttribute(s);break;case"capture":case"download":o===!0?t.setAttribute(s,""):o!==!1&&o!=null&&typeof o!="function"&&typeof o!="symbol"?t.setAttribute(s,o):t.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":o!=null&&typeof o!="function"&&typeof o!="symbol"&&!isNaN(o)&&1<=o?t.setAttribute(s,o):t.removeAttribute(s);break;case"rowSpan":case"start":o==null||typeof o=="function"||typeof o=="symbol"||isNaN(o)?t.removeAttribute(s):t.setAttribute(s,o);break;case"popover":Oe("beforetoggle",t),Oe("toggle",t),xo(t,"popover",o);break;case"xlinkActuate":Qn(t,"http://www.w3.org/1999/xlink","xlink:actuate",o);break;case"xlinkArcrole":Qn(t,"http://www.w3.org/1999/xlink","xlink:arcrole",o);break;case"xlinkRole":Qn(t,"http://www.w3.org/1999/xlink","xlink:role",o);break;case"xlinkShow":Qn(t,"http://www.w3.org/1999/xlink","xlink:show",o);break;case"xlinkTitle":Qn(t,"http://www.w3.org/1999/xlink","xlink:title",o);break;case"xlinkType":Qn(t,"http://www.w3.org/1999/xlink","xlink:type",o);break;case"xmlBase":Qn(t,"http://www.w3.org/XML/1998/namespace","xml:base",o);break;case"xmlLang":Qn(t,"http://www.w3.org/XML/1998/namespace","xml:lang",o);break;case"xmlSpace":Qn(t,"http://www.w3.org/XML/1998/namespace","xml:space",o);break;case"is":xo(t,"is",o);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=Q1.get(s)||s,xo(t,s,o))}}function Cd(t,a,s,o,u,p){switch(s){case"style":Hp(t,o,p);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(r(61));if(s=o.__html,s!=null){if(u.children!=null)throw Error(r(60));t.innerHTML=s}}break;case"children":typeof o=="string"?Ki(t,o):(typeof o=="number"||typeof o=="bigint")&&Ki(t,""+o);break;case"onScroll":o!=null&&Oe("scroll",t);break;case"onScrollEnd":o!=null&&Oe("scrollend",t);break;case"onClick":o!=null&&(t.onclick=Yn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Mp.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(u=s.endsWith("Capture"),a=s.slice(2,u?s.length-7:void 0),p=t[Zt]||null,p=p!=null?p[s]:null,typeof p=="function"&&t.removeEventListener(a,p,u),typeof o=="function")){typeof p!="function"&&p!==null&&(s in t?t[s]=null:t.hasAttribute(s)&&t.removeAttribute(s)),t.addEventListener(a,o,u);break e}s in t?t[s]=o:o===!0?t.setAttribute(s,""):xo(t,s,o)}}}function Mt(t,a,s){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Oe("error",t),Oe("load",t);var o=!1,u=!1,p;for(p in s)if(s.hasOwnProperty(p)){var y=s[p];if(y!=null)switch(p){case"src":o=!0;break;case"srcSet":u=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,a));default:Je(t,a,p,y,s,null)}}u&&Je(t,a,"srcSet",s.srcSet,s,null),o&&Je(t,a,"src",s.src,s,null);return;case"input":Oe("invalid",t);var x=p=y=u=null,A=null,B=null;for(o in s)if(s.hasOwnProperty(o)){var I=s[o];if(I!=null)switch(o){case"name":u=I;break;case"type":y=I;break;case"checked":A=I;break;case"defaultChecked":B=I;break;case"value":p=I;break;case"defaultValue":x=I;break;case"children":case"dangerouslySetInnerHTML":if(I!=null)throw Error(r(137,a));break;default:Je(t,a,o,I,s,null)}}Up(t,p,x,A,B,y,u,!1);return;case"select":Oe("invalid",t),o=y=p=null;for(u in s)if(s.hasOwnProperty(u)&&(x=s[u],x!=null))switch(u){case"value":p=x;break;case"defaultValue":y=x;break;case"multiple":o=x;default:Je(t,a,u,x,s,null)}a=p,s=y,t.multiple=!!o,a!=null?Pi(t,!!o,a,!1):s!=null&&Pi(t,!!o,s,!0);return;case"textarea":Oe("invalid",t),p=u=o=null;for(y in s)if(s.hasOwnProperty(y)&&(x=s[y],x!=null))switch(y){case"value":o=x;break;case"defaultValue":u=x;break;case"children":p=x;break;case"dangerouslySetInnerHTML":if(x!=null)throw Error(r(91));break;default:Je(t,a,y,x,s,null)}Gp(t,o,u,p);return;case"option":for(A in s)s.hasOwnProperty(A)&&(o=s[A],o!=null)&&(A==="selected"?t.selected=o&&typeof o!="function"&&typeof o!="symbol":Je(t,a,A,o,s,null));return;case"dialog":Oe("beforetoggle",t),Oe("toggle",t),Oe("cancel",t),Oe("close",t);break;case"iframe":case"object":Oe("load",t);break;case"video":case"audio":for(o=0;o<qr.length;o++)Oe(qr[o],t);break;case"image":Oe("error",t),Oe("load",t);break;case"details":Oe("toggle",t);break;case"embed":case"source":case"link":Oe("error",t),Oe("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(B in s)if(s.hasOwnProperty(B)&&(o=s[B],o!=null))switch(B){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,a));default:Je(t,a,B,o,s,null)}return;default:if(Ic(a)){for(I in s)s.hasOwnProperty(I)&&(o=s[I],o!==void 0&&Cd(t,a,I,o,s,void 0));return}}for(x in s)s.hasOwnProperty(x)&&(o=s[x],o!=null&&Je(t,a,x,o,s,null))}function xx(t,a,s,o){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var u=null,p=null,y=null,x=null,A=null,B=null,I=null;for(V in s){var Y=s[V];if(s.hasOwnProperty(V)&&Y!=null)switch(V){case"checked":break;case"value":break;case"defaultValue":A=Y;default:o.hasOwnProperty(V)||Je(t,a,V,null,o,Y)}}for(var q in o){var V=o[q];if(Y=s[q],o.hasOwnProperty(q)&&(V!=null||Y!=null))switch(q){case"type":p=V;break;case"name":u=V;break;case"checked":B=V;break;case"defaultChecked":I=V;break;case"value":y=V;break;case"defaultValue":x=V;break;case"children":case"dangerouslySetInnerHTML":if(V!=null)throw Error(r(137,a));break;default:V!==Y&&Je(t,a,q,V,o,Y)}}Vc(t,y,x,A,B,I,p,u);return;case"select":V=y=x=q=null;for(p in s)if(A=s[p],s.hasOwnProperty(p)&&A!=null)switch(p){case"value":break;case"multiple":V=A;default:o.hasOwnProperty(p)||Je(t,a,p,null,o,A)}for(u in o)if(p=o[u],A=s[u],o.hasOwnProperty(u)&&(p!=null||A!=null))switch(u){case"value":q=p;break;case"defaultValue":x=p;break;case"multiple":y=p;default:p!==A&&Je(t,a,u,p,o,A)}a=x,s=y,o=V,q!=null?Pi(t,!!s,q,!1):!!o!=!!s&&(a!=null?Pi(t,!!s,a,!0):Pi(t,!!s,s?[]:"",!1));return;case"textarea":V=q=null;for(x in s)if(u=s[x],s.hasOwnProperty(x)&&u!=null&&!o.hasOwnProperty(x))switch(x){case"value":break;case"children":break;default:Je(t,a,x,null,o,u)}for(y in o)if(u=o[y],p=s[y],o.hasOwnProperty(y)&&(u!=null||p!=null))switch(y){case"value":q=u;break;case"defaultValue":V=u;break;case"children":break;case"dangerouslySetInnerHTML":if(u!=null)throw Error(r(91));break;default:u!==p&&Je(t,a,y,u,o,p)}Vp(t,q,V);return;case"option":for(var fe in s)q=s[fe],s.hasOwnProperty(fe)&&q!=null&&!o.hasOwnProperty(fe)&&(fe==="selected"?t.selected=!1:Je(t,a,fe,null,o,q));for(A in o)q=o[A],V=s[A],o.hasOwnProperty(A)&&q!==V&&(q!=null||V!=null)&&(A==="selected"?t.selected=q&&typeof q!="function"&&typeof q!="symbol":Je(t,a,A,q,o,V));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var we in s)q=s[we],s.hasOwnProperty(we)&&q!=null&&!o.hasOwnProperty(we)&&Je(t,a,we,null,o,q);for(B in o)if(q=o[B],V=s[B],o.hasOwnProperty(B)&&q!==V&&(q!=null||V!=null))switch(B){case"children":case"dangerouslySetInnerHTML":if(q!=null)throw Error(r(137,a));break;default:Je(t,a,B,q,o,V)}return;default:if(Ic(a)){for(var Fe in s)q=s[Fe],s.hasOwnProperty(Fe)&&q!==void 0&&!o.hasOwnProperty(Fe)&&Cd(t,a,Fe,void 0,o,q);for(I in o)q=o[I],V=s[I],!o.hasOwnProperty(I)||q===V||q===void 0&&V===void 0||Cd(t,a,I,q,o,V);return}}for(var O in s)q=s[O],s.hasOwnProperty(O)&&q!=null&&!o.hasOwnProperty(O)&&Je(t,a,O,null,o,q);for(Y in o)q=o[Y],V=s[Y],!o.hasOwnProperty(Y)||q===V||q==null&&V==null||Je(t,a,Y,q,o,V)}function Zg(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function wx(){if(typeof performance.getEntriesByType=="function"){for(var t=0,a=0,s=performance.getEntriesByType("resource"),o=0;o<s.length;o++){var u=s[o],p=u.transferSize,y=u.initiatorType,x=u.duration;if(p&&x&&Zg(y)){for(y=0,x=u.responseEnd,o+=1;o<s.length;o++){var A=s[o],B=A.startTime;if(B>x)break;var I=A.transferSize,Y=A.initiatorType;I&&Zg(Y)&&(A=A.responseEnd,y+=I*(A<x?1:(x-B)/(A-B)))}if(--o,a+=8*(p+y)/(u.duration/1e3),t++,10<t)break}}if(0<t)return a/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var Td=null,Ed=null;function vl(t){return t.nodeType===9?t:t.ownerDocument}function Pg(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Kg(t,a){if(t===0)switch(a){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&a==="foreignObject"?0:t}function Od(t,a){return t==="textarea"||t==="noscript"||typeof a.children=="string"||typeof a.children=="number"||typeof a.children=="bigint"||typeof a.dangerouslySetInnerHTML=="object"&&a.dangerouslySetInnerHTML!==null&&a.dangerouslySetInnerHTML.__html!=null}var Dd=null;function jx(){var t=window.event;return t&&t.type==="popstate"?t===Dd?!1:(Dd=t,!0):(Dd=null,!1)}var Qg=typeof setTimeout=="function"?setTimeout:void 0,Nx=typeof clearTimeout=="function"?clearTimeout:void 0,Yg=typeof Promise=="function"?Promise:void 0,kx=typeof queueMicrotask=="function"?queueMicrotask:typeof Yg<"u"?function(t){return Yg.resolve(null).then(t).catch(Ax)}:Qg;function Ax(t){setTimeout(function(){throw t})}function Ma(t){return t==="head"}function Xg(t,a){var s=a,o=0;do{var u=s.nextSibling;if(t.removeChild(s),u&&u.nodeType===8)if(s=u.data,s==="/$"||s==="/&"){if(o===0){t.removeChild(u),Ns(a);return}o--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")o++;else if(s==="html")Ur(t.ownerDocument.documentElement);else if(s==="head"){s=t.ownerDocument.head,Ur(s);for(var p=s.firstChild;p;){var y=p.nextSibling,x=p.nodeName;p[ir]||x==="SCRIPT"||x==="STYLE"||x==="LINK"&&p.rel.toLowerCase()==="stylesheet"||s.removeChild(p),p=y}}else s==="body"&&Ur(t.ownerDocument.body);s=u}while(s);Ns(a)}function Jg(t,a){var s=t;t=0;do{var o=s.nextSibling;if(s.nodeType===1?a?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(a?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),o&&o.nodeType===8)if(s=o.data,s==="/$"){if(t===0)break;t--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||t++;s=o}while(s)}function Rd(t){var a=t.firstChild;for(a&&a.nodeType===10&&(a=a.nextSibling);a;){var s=a;switch(a=a.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":Rd(s),$c(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}t.removeChild(s)}}function _x(t,a,s,o){for(;t.nodeType===1;){var u=s;if(t.nodeName.toLowerCase()!==a.toLowerCase()){if(!o&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(o){if(!t[ir])switch(a){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(p=t.getAttribute("rel"),p==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(p!==u.rel||t.getAttribute("href")!==(u.href==null||u.href===""?null:u.href)||t.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin)||t.getAttribute("title")!==(u.title==null?null:u.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(p=t.getAttribute("src"),(p!==(u.src==null?null:u.src)||t.getAttribute("type")!==(u.type==null?null:u.type)||t.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin))&&p&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(a==="input"&&t.type==="hidden"){var p=u.name==null?null:""+u.name;if(u.type==="hidden"&&t.getAttribute("name")===p)return t}else return t;if(t=bn(t.nextSibling),t===null)break}return null}function zx(t,a,s){if(a==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!s||(t=bn(t.nextSibling),t===null))return null;return t}function Fg(t,a){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!a||(t=bn(t.nextSibling),t===null))return null;return t}function Md(t){return t.data==="$?"||t.data==="$~"}function Bd(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function Cx(t,a){var s=t.ownerDocument;if(t.data==="$~")t._reactRetry=a;else if(t.data!=="$?"||s.readyState!=="loading")a();else{var o=function(){a(),s.removeEventListener("DOMContentLoaded",o)};s.addEventListener("DOMContentLoaded",o),t._reactRetry=o}}function bn(t){for(;t!=null;t=t.nextSibling){var a=t.nodeType;if(a===1||a===3)break;if(a===8){if(a=t.data,a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"||a==="F!"||a==="F")break;if(a==="/$"||a==="/&")return null}}return t}var Ld=null;function Wg(t){t=t.nextSibling;for(var a=0;t;){if(t.nodeType===8){var s=t.data;if(s==="/$"||s==="/&"){if(a===0)return bn(t.nextSibling);a--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||a++}t=t.nextSibling}return null}function ey(t){t=t.previousSibling;for(var a=0;t;){if(t.nodeType===8){var s=t.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(a===0)return t;a--}else s!=="/$"&&s!=="/&"||a++}t=t.previousSibling}return null}function ty(t,a,s){switch(a=vl(s),t){case"html":if(t=a.documentElement,!t)throw Error(r(452));return t;case"head":if(t=a.head,!t)throw Error(r(453));return t;case"body":if(t=a.body,!t)throw Error(r(454));return t;default:throw Error(r(451))}}function Ur(t){for(var a=t.attributes;a.length;)t.removeAttributeNode(a[0]);$c(t)}var vn=new Map,ny=new Set;function Sl(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var da=F.d;F.d={f:Tx,r:Ex,D:Ox,C:Dx,L:Rx,m:Mx,X:Lx,S:Bx,M:qx};function Tx(){var t=da.f(),a=dl();return t||a}function Ex(t){var a=Ii(t);a!==null&&a.tag===5&&a.type==="form"?vh(a):da.r(t)}var xs=typeof document>"u"?null:document;function ay(t,a,s){var o=xs;if(o&&typeof a=="string"&&a){var u=dn(a);u='link[rel="'+t+'"][href="'+u+'"]',typeof s=="string"&&(u+='[crossorigin="'+s+'"]'),ny.has(u)||(ny.add(u),t={rel:t,crossOrigin:s,href:a},o.querySelector(u)===null&&(a=o.createElement("link"),Mt(a,"link",t),_t(a),o.head.appendChild(a)))}}function Ox(t){da.D(t),ay("dns-prefetch",t,null)}function Dx(t,a){da.C(t,a),ay("preconnect",t,a)}function Rx(t,a,s){da.L(t,a,s);var o=xs;if(o&&t&&a){var u='link[rel="preload"][as="'+dn(a)+'"]';a==="image"&&s&&s.imageSrcSet?(u+='[imagesrcset="'+dn(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(u+='[imagesizes="'+dn(s.imageSizes)+'"]')):u+='[href="'+dn(t)+'"]';var p=u;switch(a){case"style":p=ws(t);break;case"script":p=js(t)}vn.has(p)||(t=S({rel:"preload",href:a==="image"&&s&&s.imageSrcSet?void 0:t,as:a},s),vn.set(p,t),o.querySelector(u)!==null||a==="style"&&o.querySelector(Vr(p))||a==="script"&&o.querySelector(Gr(p))||(a=o.createElement("link"),Mt(a,"link",t),_t(a),o.head.appendChild(a)))}}function Mx(t,a){da.m(t,a);var s=xs;if(s&&t){var o=a&&typeof a.as=="string"?a.as:"script",u='link[rel="modulepreload"][as="'+dn(o)+'"][href="'+dn(t)+'"]',p=u;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":p=js(t)}if(!vn.has(p)&&(t=S({rel:"modulepreload",href:t},a),vn.set(p,t),s.querySelector(u)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(Gr(p)))return}o=s.createElement("link"),Mt(o,"link",t),_t(o),s.head.appendChild(o)}}}function Bx(t,a,s){da.S(t,a,s);var o=xs;if(o&&t){var u=Hi(o).hoistableStyles,p=ws(t);a=a||"default";var y=u.get(p);if(!y){var x={loading:0,preload:null};if(y=o.querySelector(Vr(p)))x.loading=5;else{t=S({rel:"stylesheet",href:t,"data-precedence":a},s),(s=vn.get(p))&&qd(t,s);var A=y=o.createElement("link");_t(A),Mt(A,"link",t),A._p=new Promise(function(B,I){A.onload=B,A.onerror=I}),A.addEventListener("load",function(){x.loading|=1}),A.addEventListener("error",function(){x.loading|=2}),x.loading|=4,xl(y,a,o)}y={type:"stylesheet",instance:y,count:1,state:x},u.set(p,y)}}}function Lx(t,a){da.X(t,a);var s=xs;if(s&&t){var o=Hi(s).hoistableScripts,u=js(t),p=o.get(u);p||(p=s.querySelector(Gr(u)),p||(t=S({src:t,async:!0},a),(a=vn.get(u))&&$d(t,a),p=s.createElement("script"),_t(p),Mt(p,"link",t),s.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},o.set(u,p))}}function qx(t,a){da.M(t,a);var s=xs;if(s&&t){var o=Hi(s).hoistableScripts,u=js(t),p=o.get(u);p||(p=s.querySelector(Gr(u)),p||(t=S({src:t,async:!0,type:"module"},a),(a=vn.get(u))&&$d(t,a),p=s.createElement("script"),_t(p),Mt(p,"link",t),s.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},o.set(u,p))}}function iy(t,a,s,o){var u=(u=ae.current)?Sl(u):null;if(!u)throw Error(r(446));switch(t){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(a=ws(s.href),s=Hi(u).hoistableStyles,o=s.get(a),o||(o={type:"style",instance:null,count:0,state:null},s.set(a,o)),o):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){t=ws(s.href);var p=Hi(u).hoistableStyles,y=p.get(t);if(y||(u=u.ownerDocument||u,y={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},p.set(t,y),(p=u.querySelector(Vr(t)))&&!p._p&&(y.instance=p,y.state.loading=5),vn.has(t)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},vn.set(t,s),p||$x(u,t,s,y.state))),a&&o===null)throw Error(r(528,""));return y}if(a&&o!==null)throw Error(r(529,""));return null;case"script":return a=s.async,s=s.src,typeof s=="string"&&a&&typeof a!="function"&&typeof a!="symbol"?(a=js(s),s=Hi(u).hoistableScripts,o=s.get(a),o||(o={type:"script",instance:null,count:0,state:null},s.set(a,o)),o):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,t))}}function ws(t){return'href="'+dn(t)+'"'}function Vr(t){return'link[rel="stylesheet"]['+t+"]"}function sy(t){return S({},t,{"data-precedence":t.precedence,precedence:null})}function $x(t,a,s,o){t.querySelector('link[rel="preload"][as="style"]['+a+"]")?o.loading=1:(a=t.createElement("link"),o.preload=a,a.addEventListener("load",function(){return o.loading|=1}),a.addEventListener("error",function(){return o.loading|=2}),Mt(a,"link",s),_t(a),t.head.appendChild(a))}function js(t){return'[src="'+dn(t)+'"]'}function Gr(t){return"script[async]"+t}function ry(t,a,s){if(a.count++,a.instance===null)switch(a.type){case"style":var o=t.querySelector('style[data-href~="'+dn(s.href)+'"]');if(o)return a.instance=o,_t(o),o;var u=S({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return o=(t.ownerDocument||t).createElement("style"),_t(o),Mt(o,"style",u),xl(o,s.precedence,t),a.instance=o;case"stylesheet":u=ws(s.href);var p=t.querySelector(Vr(u));if(p)return a.state.loading|=4,a.instance=p,_t(p),p;o=sy(s),(u=vn.get(u))&&qd(o,u),p=(t.ownerDocument||t).createElement("link"),_t(p);var y=p;return y._p=new Promise(function(x,A){y.onload=x,y.onerror=A}),Mt(p,"link",o),a.state.loading|=4,xl(p,s.precedence,t),a.instance=p;case"script":return p=js(s.src),(u=t.querySelector(Gr(p)))?(a.instance=u,_t(u),u):(o=s,(u=vn.get(p))&&(o=S({},s),$d(o,u)),t=t.ownerDocument||t,u=t.createElement("script"),_t(u),Mt(u,"link",o),t.head.appendChild(u),a.instance=u);case"void":return null;default:throw Error(r(443,a.type))}else a.type==="stylesheet"&&(a.state.loading&4)===0&&(o=a.instance,a.state.loading|=4,xl(o,s.precedence,t));return a.instance}function xl(t,a,s){for(var o=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=o.length?o[o.length-1]:null,p=u,y=0;y<o.length;y++){var x=o[y];if(x.dataset.precedence===a)p=x;else if(p!==u)break}p?p.parentNode.insertBefore(t,p.nextSibling):(a=s.nodeType===9?s.head:s,a.insertBefore(t,a.firstChild))}function qd(t,a){t.crossOrigin==null&&(t.crossOrigin=a.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=a.referrerPolicy),t.title==null&&(t.title=a.title)}function $d(t,a){t.crossOrigin==null&&(t.crossOrigin=a.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=a.referrerPolicy),t.integrity==null&&(t.integrity=a.integrity)}var wl=null;function oy(t,a,s){if(wl===null){var o=new Map,u=wl=new Map;u.set(s,o)}else u=wl,o=u.get(s),o||(o=new Map,u.set(s,o));if(o.has(t))return o;for(o.set(t,null),s=s.getElementsByTagName(t),u=0;u<s.length;u++){var p=s[u];if(!(p[ir]||p[Et]||t==="link"&&p.getAttribute("rel")==="stylesheet")&&p.namespaceURI!=="http://www.w3.org/2000/svg"){var y=p.getAttribute(a)||"";y=t+y;var x=o.get(y);x?x.push(p):o.set(y,[p])}}return o}function ly(t,a,s){t=t.ownerDocument||t,t.head.insertBefore(s,a==="title"?t.querySelector("head > title"):null)}function Ux(t,a,s){if(s===1||a.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof a.precedence!="string"||typeof a.href!="string"||a.href==="")break;return!0;case"link":if(typeof a.rel!="string"||typeof a.href!="string"||a.href===""||a.onLoad||a.onError)break;return a.rel==="stylesheet"?(t=a.disabled,typeof a.precedence=="string"&&t==null):!0;case"script":if(a.async&&typeof a.async!="function"&&typeof a.async!="symbol"&&!a.onLoad&&!a.onError&&a.src&&typeof a.src=="string")return!0}return!1}function cy(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function Vx(t,a,s,o){if(s.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var u=ws(o.href),p=a.querySelector(Vr(u));if(p){a=p._p,a!==null&&typeof a=="object"&&typeof a.then=="function"&&(t.count++,t=jl.bind(t),a.then(t,t)),s.state.loading|=4,s.instance=p,_t(p);return}p=a.ownerDocument||a,o=sy(o),(u=vn.get(u))&&qd(o,u),p=p.createElement("link"),_t(p);var y=p;y._p=new Promise(function(x,A){y.onload=x,y.onerror=A}),Mt(p,"link",o),s.instance=p}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(s,a),(a=s.state.preload)&&(s.state.loading&3)===0&&(t.count++,s=jl.bind(t),a.addEventListener("load",s),a.addEventListener("error",s))}}var Ud=0;function Gx(t,a){return t.stylesheets&&t.count===0&&kl(t,t.stylesheets),0<t.count||0<t.imgCount?function(s){var o=setTimeout(function(){if(t.stylesheets&&kl(t,t.stylesheets),t.unsuspend){var p=t.unsuspend;t.unsuspend=null,p()}},6e4+a);0<t.imgBytes&&Ud===0&&(Ud=62500*wx());var u=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&kl(t,t.stylesheets),t.unsuspend)){var p=t.unsuspend;t.unsuspend=null,p()}},(t.imgBytes>Ud?50:800)+a);return t.unsuspend=s,function(){t.unsuspend=null,clearTimeout(o),clearTimeout(u)}}:null}function jl(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)kl(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Nl=null;function kl(t,a){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Nl=new Map,a.forEach(Ix,t),Nl=null,jl.call(t))}function Ix(t,a){if(!(a.state.loading&4)){var s=Nl.get(t);if(s)var o=s.get(null);else{s=new Map,Nl.set(t,s);for(var u=t.querySelectorAll("link[data-precedence],style[data-precedence]"),p=0;p<u.length;p++){var y=u[p];(y.nodeName==="LINK"||y.getAttribute("media")!=="not all")&&(s.set(y.dataset.precedence,y),o=y)}o&&s.set(null,o)}u=a.instance,y=u.getAttribute("data-precedence"),p=s.get(y)||o,p===o&&s.set(null,u),s.set(y,u),this.count++,o=jl.bind(this),u.addEventListener("load",o),u.addEventListener("error",o),p?p.parentNode.insertBefore(u,p.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(u,t.firstChild)),a.state.loading|=4}}var Ir={$$typeof:J,Provider:null,Consumer:null,_currentValue:pe,_currentValue2:pe,_threadCount:0};function Hx(t,a,s,o,u,p,y,x,A){this.tag=1,this.containerInfo=t,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=ee(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ee(0),this.hiddenUpdates=ee(null),this.identifierPrefix=o,this.onUncaughtError=u,this.onCaughtError=p,this.onRecoverableError=y,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=A,this.incompleteTransitions=new Map}function uy(t,a,s,o,u,p,y,x,A,B,I,Y){return t=new Hx(t,a,s,y,A,B,I,Y,x),a=1,p===!0&&(a|=24),p=nn(3,null,null,a),t.current=p,p.stateNode=t,a=vu(),a.refCount++,t.pooledCache=a,a.refCount++,p.memoizedState={element:o,isDehydrated:s,cache:a},ju(p),t}function dy(t){return t?(t=es,t):es}function fy(t,a,s,o,u,p){u=dy(u),o.context===null?o.context=u:o.pendingContext=u,o=Na(a),o.payload={element:s},p=p===void 0?null:p,p!==null&&(o.callback=p),s=ka(t,o,a),s!==null&&(Jt(s,t,a),xr(s,t,a))}function py(t,a){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var s=t.retryLane;t.retryLane=s!==0&&s<a?s:a}}function Vd(t,a){py(t,a),(t=t.alternate)&&py(t,a)}function my(t){if(t.tag===13||t.tag===31){var a=si(t,67108864);a!==null&&Jt(a,t,67108864),Vd(t,67108864)}}function hy(t){if(t.tag===13||t.tag===31){var a=ln();a=ar(a);var s=si(t,a);s!==null&&Jt(s,t,a),Vd(t,a)}}var Al=!0;function Zx(t,a,s,o){var u=$.T;$.T=null;var p=F.p;try{F.p=2,Gd(t,a,s,o)}finally{F.p=p,$.T=u}}function Px(t,a,s,o){var u=$.T;$.T=null;var p=F.p;try{F.p=8,Gd(t,a,s,o)}finally{F.p=p,$.T=u}}function Gd(t,a,s,o){if(Al){var u=Id(o);if(u===null)zd(t,a,o,_l,s),yy(t,o);else if(Qx(u,t,a,s,o))o.stopPropagation();else if(yy(t,o),a&4&&-1<Kx.indexOf(t)){for(;u!==null;){var p=Ii(u);if(p!==null)switch(p.tag){case 3:if(p=p.stateNode,p.current.memoizedState.isDehydrated){var y=Pn(p.pendingLanes);if(y!==0){var x=p;for(x.pendingLanes|=2,x.entangledLanes|=2;y;){var A=1<<31-mt(y);x.entanglements[1]|=A,y&=~A}Vn(p),(Ie&6)===0&&(cl=Lt()+500,Lr(0))}}break;case 31:case 13:x=si(p,2),x!==null&&Jt(x,p,2),dl(),Vd(p,2)}if(p=Id(o),p===null&&zd(t,a,o,_l,s),p===u)break;u=p}u!==null&&o.stopPropagation()}else zd(t,a,o,null,s)}}function Id(t){return t=Zc(t),Hd(t)}var _l=null;function Hd(t){if(_l=null,t=Gi(t),t!==null){var a=c(t);if(a===null)t=null;else{var s=a.tag;if(s===13){if(t=d(a),t!==null)return t;t=null}else if(s===31){if(t=m(a),t!==null)return t;t=null}else if(s===3){if(a.stateNode.current.memoizedState.isDehydrated)return a.tag===3?a.stateNode.containerInfo:null;t=null}else a!==t&&(t=null)}}return _l=t,null}function gy(t){switch(t){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(ho()){case er:return 2;case go:return 8;case Mi:case Bc:return 32;case Bi:return 268435456;default:return 32}default:return 32}}var Zd=!1,Ba=null,La=null,qa=null,Hr=new Map,Zr=new Map,$a=[],Kx="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 yy(t,a){switch(t){case"focusin":case"focusout":Ba=null;break;case"dragenter":case"dragleave":La=null;break;case"mouseover":case"mouseout":qa=null;break;case"pointerover":case"pointerout":Hr.delete(a.pointerId);break;case"gotpointercapture":case"lostpointercapture":Zr.delete(a.pointerId)}}function Pr(t,a,s,o,u,p){return t===null||t.nativeEvent!==p?(t={blockedOn:a,domEventName:s,eventSystemFlags:o,nativeEvent:p,targetContainers:[u]},a!==null&&(a=Ii(a),a!==null&&my(a)),t):(t.eventSystemFlags|=o,a=t.targetContainers,u!==null&&a.indexOf(u)===-1&&a.push(u),t)}function Qx(t,a,s,o,u){switch(a){case"focusin":return Ba=Pr(Ba,t,a,s,o,u),!0;case"dragenter":return La=Pr(La,t,a,s,o,u),!0;case"mouseover":return qa=Pr(qa,t,a,s,o,u),!0;case"pointerover":var p=u.pointerId;return Hr.set(p,Pr(Hr.get(p)||null,t,a,s,o,u)),!0;case"gotpointercapture":return p=u.pointerId,Zr.set(p,Pr(Zr.get(p)||null,t,a,s,o,u)),!0}return!1}function by(t){var a=Gi(t.target);if(a!==null){var s=c(a);if(s!==null){if(a=s.tag,a===13){if(a=d(s),a!==null){t.blockedOn=a,Op(t.priority,function(){hy(s)});return}}else if(a===31){if(a=m(s),a!==null){t.blockedOn=a,Op(t.priority,function(){hy(s)});return}}else if(a===3&&s.stateNode.current.memoizedState.isDehydrated){t.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}t.blockedOn=null}function zl(t){if(t.blockedOn!==null)return!1;for(var a=t.targetContainers;0<a.length;){var s=Id(t.nativeEvent);if(s===null){s=t.nativeEvent;var o=new s.constructor(s.type,s);Hc=o,s.target.dispatchEvent(o),Hc=null}else return a=Ii(s),a!==null&&my(a),t.blockedOn=s,!1;a.shift()}return!0}function vy(t,a,s){zl(t)&&s.delete(a)}function Yx(){Zd=!1,Ba!==null&&zl(Ba)&&(Ba=null),La!==null&&zl(La)&&(La=null),qa!==null&&zl(qa)&&(qa=null),Hr.forEach(vy),Zr.forEach(vy)}function Cl(t,a){t.blockedOn===a&&(t.blockedOn=null,Zd||(Zd=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,Yx)))}var Tl=null;function Sy(t){Tl!==t&&(Tl=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Tl===t&&(Tl=null);for(var a=0;a<t.length;a+=3){var s=t[a],o=t[a+1],u=t[a+2];if(typeof o!="function"){if(Hd(o||s)===null)continue;break}var p=Ii(s);p!==null&&(t.splice(a,3),a-=3,Iu(p,{pending:!0,data:u,method:s.method,action:o},o,u))}}))}function Ns(t){function a(A){return Cl(A,t)}Ba!==null&&Cl(Ba,t),La!==null&&Cl(La,t),qa!==null&&Cl(qa,t),Hr.forEach(a),Zr.forEach(a);for(var s=0;s<$a.length;s++){var o=$a[s];o.blockedOn===t&&(o.blockedOn=null)}for(;0<$a.length&&(s=$a[0],s.blockedOn===null);)by(s),s.blockedOn===null&&$a.shift();if(s=(t.ownerDocument||t).$$reactFormReplay,s!=null)for(o=0;o<s.length;o+=3){var u=s[o],p=s[o+1],y=u[Zt]||null;if(typeof p=="function")y||Sy(s);else if(y){var x=null;if(p&&p.hasAttribute("formAction")){if(u=p,y=p[Zt]||null)x=y.formAction;else if(Hd(u)!==null)continue}else x=y.action;typeof x=="function"?s[o+1]=x:(s.splice(o,3),o-=3),Sy(s)}}}function xy(){function t(p){p.canIntercept&&p.info==="react-transition"&&p.intercept({handler:function(){return new Promise(function(y){return u=y})},focusReset:"manual",scroll:"manual"})}function a(){u!==null&&(u(),u=null),o||setTimeout(s,20)}function s(){if(!o&&!navigation.transition){var p=navigation.currentEntry;p&&p.url!=null&&navigation.navigate(p.url,{state:p.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var o=!1,u=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",a),navigation.addEventListener("navigateerror",a),setTimeout(s,100),function(){o=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",a),navigation.removeEventListener("navigateerror",a),u!==null&&(u(),u=null)}}}function Pd(t){this._internalRoot=t}El.prototype.render=Pd.prototype.render=function(t){var a=this._internalRoot;if(a===null)throw Error(r(409));var s=a.current,o=ln();fy(s,o,t,a,null,null)},El.prototype.unmount=Pd.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var a=t.containerInfo;fy(t.current,2,null,t,null,null),dl(),a[Vi]=null}};function El(t){this._internalRoot=t}El.prototype.unstable_scheduleHydration=function(t){if(t){var a=Ep();t={blockedOn:null,target:t,priority:a};for(var s=0;s<$a.length&&a!==0&&a<$a[s].priority;s++);$a.splice(s,0,t),s===0&&by(t)}};var wy=n.version;if(wy!=="19.2.4")throw Error(r(527,wy,"19.2.4"));F.findDOMNode=function(t){var a=t._reactInternals;if(a===void 0)throw typeof t.render=="function"?Error(r(188)):(t=Object.keys(t).join(","),Error(r(268,t)));return t=b(a),t=t!==null?v(t):null,t=t===null?null:t.stateNode,t};var Xx={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:$,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ol=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ol.isDisabled&&Ol.supportsFiber)try{ga=Ol.inject(Xx),qt=Ol}catch{}}return Kr.createRoot=function(t,a){if(!l(t))throw Error(r(299));var s=!1,o="",u=Ch,p=Th,y=Eh;return a!=null&&(a.unstable_strictMode===!0&&(s=!0),a.identifierPrefix!==void 0&&(o=a.identifierPrefix),a.onUncaughtError!==void 0&&(u=a.onUncaughtError),a.onCaughtError!==void 0&&(p=a.onCaughtError),a.onRecoverableError!==void 0&&(y=a.onRecoverableError)),a=uy(t,1,!1,null,null,s,o,null,u,p,y,xy),t[Vi]=a.current,_d(t),new Pd(a)},Kr.hydrateRoot=function(t,a,s){if(!l(t))throw Error(r(299));var o=!1,u="",p=Ch,y=Th,x=Eh,A=null;return s!=null&&(s.unstable_strictMode===!0&&(o=!0),s.identifierPrefix!==void 0&&(u=s.identifierPrefix),s.onUncaughtError!==void 0&&(p=s.onUncaughtError),s.onCaughtError!==void 0&&(y=s.onCaughtError),s.onRecoverableError!==void 0&&(x=s.onRecoverableError),s.formState!==void 0&&(A=s.formState)),a=uy(t,1,!0,a,s??null,o,u,A,p,y,x,xy),a.context=dy(null),s=a.current,o=ln(),o=ar(o),u=Na(o),u.callback=null,ka(s,u,o),s=o,a.current.lanes=s,We(a,s),Vn(a),t[Vi]=a.current,_d(t),new El(a)},Kr.version="19.2.4",Kr}var Ay;function hw(){if(Ay)return Kd.exports;Ay=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(n){console.error(n)}}return e(),Kd.exports=mw(),Kd.exports}var gw=hw();const yw={bodySerializer:e=>JSON.stringify(e,(n,i)=>typeof i=="bigint"?i.toString():i)},bw=({onRequest:e,onSseError:n,onSseEvent:i,responseTransformer:r,responseValidator:l,sseDefaultRetryDelay:c,sseMaxRetryAttempts:d,sseMaxRetryDelay:m,sseSleepFn:g,url:b,...v})=>{let S;const w=g??(N=>new Promise(T=>setTimeout(T,N)));return{stream:async function*(){let N=c??3e3,T=0;const L=v.signal??new AbortController().signal;for(;!L.aborted;){T++;const Z=v.headers instanceof Headers?v.headers:new Headers(v.headers);S!==void 0&&Z.set("Last-Event-ID",S);try{const J={redirect:"follow",...v,body:v.serializedBody,headers:Z,signal:L};let K=new Request(b,J);e&&(K=await e(b,J));const G=await(v.fetch??globalThis.fetch)(K);if(!G.ok)throw new Error(`SSE failed: ${G.status} ${G.statusText}`);if(!G.body)throw new Error("No body in SSE response");const D=G.body.pipeThrough(new TextDecoderStream).getReader();let R="";const oe=()=>{try{D.cancel()}catch{}};L.addEventListener("abort",oe);try{for(;;){const{done:Ne,value:te}=await D.read();if(Ne)break;R+=te;const de=R.split(`
11
+
12
+ `);R=de.pop()??"";for(const Me of de){const Qe=Me.split(`
13
+ `),be=[];let $;for(const je of Qe)if(je.startsWith("data:"))be.push(je.replace(/^data:\s*/,""));else if(je.startsWith("event:"))$=je.replace(/^event:\s*/,"");else if(je.startsWith("id:"))S=je.replace(/^id:\s*/,"");else if(je.startsWith("retry:")){const se=Number.parseInt(je.replace(/^retry:\s*/,""),10);Number.isNaN(se)||(N=se)}let F,pe=!1;if(be.length){const je=be.join(`
14
+ `);try{F=JSON.parse(je),pe=!0}catch{F=je}}pe&&(l&&await l(F),r&&(F=await r(F))),i?.({data:F,event:$,id:S,retry:N}),be.length&&(yield F)}}}finally{L.removeEventListener("abort",oe),D.releaseLock()}break}catch(J){if(n?.(J),d!==void 0&&T>=d)break;const K=Math.min(N*2**(T-1),m??3e4);await w(K)}}}()}},vw=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},Sw=e=>{switch(e){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},xw=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},ev=({allowReserved:e,explode:n,name:i,style:r,value:l})=>{if(!n){const m=(e?l:l.map(g=>encodeURIComponent(g))).join(Sw(r));switch(r){case"label":return`.${m}`;case"matrix":return`;${i}=${m}`;case"simple":return m;default:return`${i}=${m}`}}const c=vw(r),d=l.map(m=>r==="label"||r==="simple"?e?m:encodeURIComponent(m):uc({allowReserved:e,name:i,value:m})).join(c);return r==="label"||r==="matrix"?c+d:d},uc=({allowReserved:e,name:n,value:i})=>{if(i==null)return"";if(typeof i=="object")throw new Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${n}=${e?i:encodeURIComponent(i)}`},tv=({allowReserved:e,explode:n,name:i,style:r,value:l,valueOnly:c})=>{if(l instanceof Date)return c?l.toISOString():`${i}=${l.toISOString()}`;if(r!=="deepObject"&&!n){let g=[];Object.entries(l).forEach(([v,S])=>{g=[...g,v,e?S:encodeURIComponent(S)]});const b=g.join(",");switch(r){case"form":return`${i}=${b}`;case"label":return`.${b}`;case"matrix":return`;${i}=${b}`;default:return b}}const d=xw(r),m=Object.entries(l).map(([g,b])=>uc({allowReserved:e,name:r==="deepObject"?`${i}[${g}]`:g,value:b})).join(d);return r==="label"||r==="matrix"?d+m:m},ww=/\{[^{}]+\}/g,jw=({path:e,url:n})=>{let i=n;const r=n.match(ww);if(r)for(const l of r){let c=!1,d=l.substring(1,l.length-1),m="simple";d.endsWith("*")&&(c=!0,d=d.substring(0,d.length-1)),d.startsWith(".")?(d=d.substring(1),m="label"):d.startsWith(";")&&(d=d.substring(1),m="matrix");const g=e[d];if(g==null)continue;if(Array.isArray(g)){i=i.replace(l,ev({explode:c,name:d,style:m,value:g}));continue}if(typeof g=="object"){i=i.replace(l,tv({explode:c,name:d,style:m,value:g,valueOnly:!0}));continue}if(m==="matrix"){i=i.replace(l,`;${uc({name:d,value:g})}`);continue}const b=encodeURIComponent(m==="label"?`.${g}`:g);i=i.replace(l,b)}return i},Nw=({baseUrl:e,path:n,query:i,querySerializer:r,url:l})=>{const c=l.startsWith("/")?l:`/${l}`;let d=(e??"")+c;n&&(d=jw({path:n,url:d}));let m=i?r(i):"";return m.startsWith("?")&&(m=m.substring(1)),m&&(d+=`?${m}`),d};function kw(e){const n=e.body!==void 0;if(n&&e.bodySerializer)return"serializedBody"in e?e.serializedBody!==void 0&&e.serializedBody!==""?e.serializedBody:null:e.body!==""?e.body:null;if(n)return e.body}const Aw=async(e,n)=>{const i=typeof n=="function"?await n(e):n;if(i)return e.scheme==="bearer"?`Bearer ${i}`:e.scheme==="basic"?`Basic ${btoa(i)}`:i},nv=({allowReserved:e,array:n,object:i}={})=>l=>{const c=[];if(l&&typeof l=="object")for(const d in l){const m=l[d];if(m!=null)if(Array.isArray(m)){const g=ev({allowReserved:e,explode:!0,name:d,style:"form",value:m,...n});g&&c.push(g)}else if(typeof m=="object"){const g=tv({allowReserved:e,explode:!0,name:d,style:"deepObject",value:m,...i});g&&c.push(g)}else{const g=uc({allowReserved:e,name:d,value:m});g&&c.push(g)}}return c.join("&")},_w=e=>{if(!e)return"stream";const n=e.split(";")[0]?.trim();if(n){if(n.startsWith("application/json")||n.endsWith("+json"))return"json";if(n==="multipart/form-data")return"formData";if(["application/","audio/","image/","video/"].some(i=>n.startsWith(i)))return"blob";if(n.startsWith("text/"))return"text"}},zw=(e,n)=>n?!!(e.headers.has(n)||e.query?.[n]||e.headers.get("Cookie")?.includes(`${n}=`)):!1,Cw=async({security:e,...n})=>{for(const i of e){if(zw(n,i.name))continue;const r=await Aw(i,n.auth);if(!r)continue;const l=i.name??"Authorization";switch(i.in){case"query":n.query||(n.query={}),n.query[l]=r;break;case"cookie":n.headers.append("Cookie",`${l}=${r}`);break;default:n.headers.set(l,r);break}}},_y=e=>Nw({baseUrl:e.baseUrl,path:e.path,query:e.query,querySerializer:typeof e.querySerializer=="function"?e.querySerializer:nv(e.querySerializer),url:e.url}),zy=(e,n)=>{const i={...e,...n};return i.baseUrl?.endsWith("/")&&(i.baseUrl=i.baseUrl.substring(0,i.baseUrl.length-1)),i.headers=av(e.headers,n.headers),i},Tw=e=>{const n=[];return e.forEach((i,r)=>{n.push([r,i])}),n},av=(...e)=>{const n=new Headers;for(const i of e){if(!i)continue;const r=i instanceof Headers?Tw(i):Object.entries(i);for(const[l,c]of r)if(c===null)n.delete(l);else if(Array.isArray(c))for(const d of c)n.append(l,d);else c!==void 0&&n.set(l,typeof c=="object"?JSON.stringify(c):c)}return n};class Xd{fns=[];clear(){this.fns=[]}eject(n){const i=this.getInterceptorIndex(n);this.fns[i]&&(this.fns[i]=null)}exists(n){const i=this.getInterceptorIndex(n);return!!this.fns[i]}getInterceptorIndex(n){return typeof n=="number"?this.fns[n]?n:-1:this.fns.indexOf(n)}update(n,i){const r=this.getInterceptorIndex(n);return this.fns[r]?(this.fns[r]=i,n):!1}use(n){return this.fns.push(n),this.fns.length-1}}const Ew=()=>({error:new Xd,request:new Xd,response:new Xd}),Ow=nv({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),Dw={"Content-Type":"application/json"},iv=(e={})=>({...yw,headers:Dw,parseAs:"auto",querySerializer:Ow,...e}),sv=(e={})=>{let n=zy(iv(),e);const i=()=>({...n}),r=b=>(n=zy(n,b),i()),l=Ew(),c=async b=>{const v={...n,...b,fetch:b.fetch??n.fetch??globalThis.fetch,headers:av(n.headers,b.headers),serializedBody:void 0};v.security&&await Cw({...v,security:v.security}),v.requestValidator&&await v.requestValidator(v),v.body!==void 0&&v.bodySerializer&&(v.serializedBody=v.bodySerializer(v.body)),(v.body===void 0||v.serializedBody==="")&&v.headers.delete("Content-Type");const S=_y(v);return{opts:v,url:S}},d=async b=>{const{opts:v,url:S}=await c(b),w={redirect:"follow",...v,body:kw(v)};let _=new Request(S,w);for(const X of l.request.fns)X&&(_=await X(_,v));const C=v.fetch;let N=await C(_);for(const X of l.response.fns)X&&(N=await X(N,_,v));const T={request:_,response:N};if(N.ok){const X=(v.parseAs==="auto"?_w(N.headers.get("Content-Type")):v.parseAs)??"json";if(N.status===204||N.headers.get("Content-Length")==="0"){let D;switch(X){case"arrayBuffer":case"blob":case"text":D=await N[X]();break;case"formData":D=new FormData;break;case"stream":D=N.body;break;default:D={};break}return v.responseStyle==="data"?D:{data:D,...T}}let G;switch(X){case"arrayBuffer":case"blob":case"formData":case"json":case"text":G=await N[X]();break;case"stream":return v.responseStyle==="data"?N.body:{data:N.body,...T}}return X==="json"&&(v.responseValidator&&await v.responseValidator(G),v.responseTransformer&&(G=await v.responseTransformer(G))),v.responseStyle==="data"?G:{data:G,...T}}const L=await N.text();let Z;try{Z=JSON.parse(L)}catch{}const J=Z??L;let K=J;for(const X of l.error.fns)X&&(K=await X(J,N,_,v));if(K=K||{},v.throwOnError)throw K;return v.responseStyle==="data"?void 0:{error:K,...T}},m=b=>v=>d({...v,method:b}),g=b=>async v=>{const{opts:S,url:w}=await c(v);return bw({...S,body:S.body,headers:S.headers,method:b,onRequest:async(_,C)=>{let N=new Request(_,C);for(const T of l.request.fns)T&&(N=await T(N,S));return N},url:w})};return{buildUrl:_y,connect:m("CONNECT"),delete:m("DELETE"),get:m("GET"),getConfig:i,head:m("HEAD"),interceptors:l,options:m("OPTIONS"),patch:m("PATCH"),post:m("POST"),put:m("PUT"),request:d,setConfig:r,sse:{connect:g("CONNECT"),delete:g("DELETE"),get:g("GET"),head:g("HEAD"),options:g("OPTIONS"),patch:g("PATCH"),post:g("POST"),put:g("PUT"),trace:g("TRACE")},trace:m("TRACE")}},W=sv(iv()),Rw=e=>(e.client??W).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}",...e}),Mw=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}",...e}),Bw=e=>(e.client??W).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}",...e,headers:{"Content-Type":"application/json",...e.headers}}),Lw=e=>(e?.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects",...e}),qw=e=>(e.client??W).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/locations",...e,headers:{"Content-Type":"application/json",...e.headers}}),$w=e=>(e.client??W).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/locations/{label}",...e}),Uw=e=>(e.client??W).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/locations/default",...e,headers:{"Content-Type":"application/json",...e.headers}}),Vw=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/export",...e}),Gw=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/queries",...e}),Iw=e=>(e.client??W).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/queries",...e,headers:{"Content-Type":"application/json",...e.headers}}),Hw=e=>(e.client??W).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/queries",...e,headers:{"Content-Type":"application/json",...e.headers}}),Zw=e=>(e.client??W).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/queries/generate",...e,headers:{"Content-Type":"application/json",...e.headers}}),Pw=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/competitors",...e}),Kw=e=>(e.client??W).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/competitors",...e,headers:{"Content-Type":"application/json",...e.headers}}),Qw=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/runs",...e}),Yw=e=>(e.client??W).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/runs",...e,headers:{"Content-Type":"application/json",...e.headers}}),Xw=e=>(e?.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/runs",...e}),Jw=e=>(e?.client??W).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/runs",...e,headers:{"Content-Type":"application/json",...e?.headers}}),rv=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/runs/{id}",...e}),Fw=e=>(e.client??W).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/apply",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ww=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/timeline",...e}),ov=e=>(e?.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/settings",...e}),ej=e=>(e.client??W).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/settings/providers/{name}",...e,headers:{"Content-Type":"application/json",...e.headers}}),tj=e=>(e.client??W).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/settings/google",...e,headers:{"Content-Type":"application/json",...e.headers}}),nj=e=>(e.client??W).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/settings/bing",...e,headers:{"Content-Type":"application/json",...e.headers}}),aj=e=>(e.client??W).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/settings/cdp",...e,headers:{"Content-Type":"application/json",...e.headers}}),ij=e=>(e.client??W).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/schedule",...e}),sj=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/schedule",...e}),rj=e=>(e.client??W).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/schedule",...e,headers:{"Content-Type":"application/json",...e.headers}}),oj=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/notifications",...e}),lj=e=>(e.client??W).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/notifications",...e,headers:{"Content-Type":"application/json",...e.headers}}),cj=e=>(e.client??W).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/notifications/{id}",...e}),uj=e=>(e.client??W).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/notifications/{id}/test",...e}),dj=e=>(e?.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/cdp/status",...e}),fj=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/connections",...e}),pj=e=>(e.client??W).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/connect",...e,headers:{"Content-Type":"application/json",...e.headers}}),mj=e=>(e.client??W).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/connections/{type}",...e}),hj=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/properties",...e}),gj=e=>(e.client??W).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/connections/{type}/property",...e,headers:{"Content-Type":"application/json",...e.headers}}),yj=e=>(e.client??W).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/connections/{type}/sitemap",...e,headers:{"Content-Type":"application/json",...e.headers}}),bj=e=>(e.client??W).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/sync",...e,headers:{"Content-Type":"application/json",...e.headers}}),vj=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/performance",...e}),Sj=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/performance/daily",...e}),xj=e=>(e.client??W).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/inspect",...e,headers:{"Content-Type":"application/json",...e.headers}}),wj=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/inspections",...e}),jj=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/deindexed",...e}),lv=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/coverage",...e}),Nj=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/coverage/history",...e}),kj=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/sitemaps",...e}),Aj=e=>(e.client??W).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/discover-sitemaps",...e}),_j=e=>(e.client??W).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/inspect-sitemap",...e,headers:{"Content-Type":"application/json",...e.headers}}),zj=e=>(e.client??W).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/indexing/request",...e,headers:{"Content-Type":"application/json",...e.headers}}),Cj=e=>(e.client??W).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/connect",...e,headers:{"Content-Type":"application/json",...e.headers}}),Tj=e=>(e.client??W).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/disconnect",...e}),Ej=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/status",...e}),Oj=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/sites",...e}),Dj=e=>(e.client??W).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/set-site",...e,headers:{"Content-Type":"application/json",...e.headers}}),cv=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/coverage",...e}),Rj=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/inspections",...e}),Mj=e=>(e.client??W).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/inspect-url",...e,headers:{"Content-Type":"application/json",...e.headers}}),Bj=e=>(e.client??W).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/inspect-sitemap",...e,headers:{"Content-Type":"application/json",...e.headers}}),Lj=e=>(e.client??W).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/request-indexing",...e,headers:{"Content-Type":"application/json",...e.headers}}),qj=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/performance",...e}),$j=e=>(e.client??W).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/ga/connect",...e,headers:{"Content-Type":"application/json",...e.headers}}),Uj=e=>(e.client??W).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/ga/disconnect",...e}),Vj=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/ga/status",...e}),Gj=e=>(e.client??W).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/ga/sync",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ij=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/ga/traffic",...e}),Hj=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/ga/ai-referral-history",...e}),Zj=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/ga/social-referral-history",...e}),Pj=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/ga/session-history",...e}),Kj=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/insights",...e}),Qj=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/report",...e}),Yj=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/citations/visibility",...e}),Xj=e=>(e.client??W).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/content/dismissals",...e,headers:{"Content-Type":"application/json",...e.headers}}),Jj=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/overview",...e}),Fj=e=>(e?.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/backlinks/status",...e}),Wj=e=>(e?.client??W).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/backlinks/install",...e}),eN=e=>(e?.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/backlinks/syncs",...e}),tN=e=>(e?.client??W).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/backlinks/syncs",...e,headers:{"Content-Type":"application/json",...e?.headers}}),nN=e=>(e?.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/backlinks/syncs/latest",...e}),aN=e=>(e?.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/backlinks/releases",...e}),iN=e=>(e?.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/backlinks/latest-release",...e}),sN=e=>(e.client??W).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/backlinks/cache/{release}",...e}),rN=e=>(e.client??W).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/backlinks/extract",...e,headers:{"Content-Type":"application/json",...e.headers}}),oN=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/backlinks/summary",...e}),lN=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/backlinks/domains",...e}),cN=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/backlinks/history",...e}),uN=e=>(e.client??W).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/traffic/connect/cloud-run",...e,headers:{"Content-Type":"application/json",...e.headers}}),dN=e=>(e.client??W).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/traffic/connect/wordpress",...e,headers:{"Content-Type":"application/json",...e.headers}}),fN=e=>(e.client??W).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/traffic/connect/vercel",...e,headers:{"Content-Type":"application/json",...e.headers}}),pN=e=>(e.client??W).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/traffic/sources/{id}/sync",...e,headers:{"Content-Type":"application/json",...e.headers}}),mN=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/traffic/sources",...e}),hN=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/traffic/status",...e}),gN=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/traffic/sources/{id}",...e}),yN=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/traffic/events",...e}),bN=e=>(e.client??W).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/discover/run",...e,headers:{"Content-Type":"application/json",...e.headers}}),vN=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/discover/sessions",...e}),SN=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/discover/sessions/{id}",...e}),xN=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/discover/sessions/{id}/promote",...e}),wN=e=>(e.client??W).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/discover/sessions/{id}/promote",...e,headers:{"Content-Type":"application/json",...e.headers}}),jN=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/agent/providers",...e});function NN(e){const n={baseUrl:e.baseUrl,fetch:e.fetch,headers:{...e.headers??{}}};return sv(n)}class In extends Error{code;statusCode;constructor(n,i,r){super(n),this.name="ApiError",this.code=r??"UNKNOWN",this.statusCode=i}}function kN(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,"")+"/api/v1":"/api/v1"}const uv=kN();function AN(){const e=typeof window<"u"&&window.location?window.location.origin:"";return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?e+window.__CANONRY_CONFIG__.basePath.replace(/\/$/,""):e}function _N(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,""):""}function zN(e){return`${_N()}${e}`}function CN(e,n){if(n===404)return"Health endpoint returned 404. Check basePath or reverse-proxy configuration and make sure the dashboard reaches /health instead of an API-prefixed route."}function TN(){return""}function Jd(){return!!TN()}let dv=null;function Cy(e){dv=e}function Mf(){dv?.()}const ie=NN({baseUrl:AN()});ie.interceptors.response.use((e,n)=>((e.status===401||e.status===403)&&!n.url.includes("/api/v1/session")&&Mf(),e));async function ce(e){const n=await e();if(n.error!==void 0&&n.error!==null){const i=n.response.status;let r=`API ${i}: ${n.response.statusText}`,l;if(typeof n.error=="object"&&n.error!==null){const c=n.error.error;if(typeof c=="string")r=c;else if(c&&typeof c=="object"){const d=c;d.message&&(r=d.message),d.code&&(l=d.code)}else{const d=n.error;d.message&&(r=d.message),d.code&&(l=d.code)}}else typeof n.error=="string"&&(r=n.error);throw new In(r,i,l)}if(n.response.status!==204)return n.data}async function Bf(e,n){const i=n?.body!=null,r=await fetch(`${uv}${e}`,{...n,credentials:n?.credentials??"same-origin",headers:{...i?{"Content-Type":"application/json"}:{},...n?.headers}});if(!r.ok){const l=await r.text();let c=`API ${r.status}: ${r.statusText}`,d;if(l)try{const m=JSON.parse(l);typeof m.error=="string"?c=m.error:m.error?.message?(c=m.error.message,d=m.error.code):m.message&&(c=m.message)}catch{c=l}throw(r.status===401||r.status===403)&&!e.startsWith("/session")&&Mf(),new In(c,r.status,d)}if(r.status!==204)return r.json()}function Lf(e){return ce(()=>Mw({client:ie,path:{name:e}}))}function uR(e){return ce(()=>Qw({client:ie,path:{name:e}}))}function Xl(e){return ce(()=>rv({client:ie,path:{id:e}}))}function EN(e){return ce(()=>Gw({client:ie,path:{name:e}}))}function ON(e){return ce(()=>Pw({client:ie,path:{name:e}}))}function DN(e,n){return ce(()=>Ww({client:ie,path:{name:e},query:{location:n}}))}function RN(e,n){return ce(()=>Jj({client:ie,path:{name:e},query:{location:n?.location,since:n?.since}}))}function lo(e,n){return ce(()=>Bw({client:ie,path:{name:e},body:n}))}function MN(e,n){return ce(()=>Hw({client:ie,path:{name:e},body:{queries:n}}))}function BN(e,n){return ce(()=>Iw({client:ie,path:{name:e},body:{queries:n}}))}function LN(e,n){return ce(()=>Xj({client:ie,path:{name:e},body:n}))}function qN(e,n){return ce(()=>Kw({client:ie,path:{name:e},body:{competitors:n}}))}async function dR(e,n){const i=await Lf(e);return lo(e,{displayName:i.displayName??i.name,canonicalDomain:i.canonicalDomain,ownedDomains:n,aliases:i.aliases,country:i.country,language:i.language,tags:i.tags,labels:i.labels,providers:i.providers,locations:i.locations,defaultLocation:i.defaultLocation})}async function fR(e,n){const i=await Lf(e);return lo(e,{displayName:i.displayName??i.name,canonicalDomain:i.canonicalDomain,ownedDomains:i.ownedDomains,aliases:n,country:i.country,language:i.language,tags:i.tags,labels:i.labels,providers:i.providers,locations:i.locations,defaultLocation:i.defaultLocation})}async function pR(e,n){const i=await Lf(e);return lo(e,{displayName:n.displayName??i.displayName??i.name,canonicalDomain:n.canonicalDomain??i.canonicalDomain,ownedDomains:n.ownedDomains??i.ownedDomains,aliases:n.aliases??i.aliases,country:n.country??i.country,language:n.language??i.language,tags:i.tags,labels:i.labels,providers:i.providers,locations:n.locations??i.locations,defaultLocation:n.defaultLocation!==void 0?n.defaultLocation:i.defaultLocation})}function $N(e,n){const i={};return n?.location&&(i.location=n.location),n?.allLocations&&(i.allLocations=!0),n?.noLocation&&(i.noLocation=!0),ce(()=>Yw({client:ie,path:{name:e},body:i}))}function mR(e,n){return ce(()=>qw({client:ie,path:{name:e},body:n}))}async function hR(e,n){await ce(()=>$w({client:ie,path:{name:e,label:n}}))}function gR(e,n){return ce(()=>Uw({client:ie,path:{name:e},body:{label:n}}))}async function yR(e){await ce(()=>Rw({client:ie,path:{name:e}}))}function bR(e){return ce(()=>Vw({client:ie,path:{name:e}}))}function vR(){return ce(()=>ov({client:ie}))}function Ty(){return Bf("/session")}function UN(e){return Bf("/session/setup",{method:"POST",body:JSON.stringify({password:e})})}function VN(e){return Bf("/session",{method:"POST",body:JSON.stringify({password:e})})}function GN(e,n){return ce(()=>ej({client:ie,path:{name:e},body:n}))}function SR(e){return ce(()=>tj({client:ie,body:e}))}async function xR(e){try{return await ce(()=>sj({client:ie,path:{name:e}}))}catch(n){if(n instanceof In&&n.statusCode===404)return null;throw n}}function wR(e,n){return ce(()=>rj({client:ie,path:{name:e},body:n}))}async function jR(e){await ce(()=>ij({client:ie,path:{name:e}}))}function NR(e){return ce(()=>oj({client:ie,path:{name:e}}))}function kR(e,n){return ce(()=>lj({client:ie,path:{name:e},body:n}))}async function AR(e,n){await ce(()=>cj({client:ie,path:{name:e,id:n}}))}function _R(e,n){return ce(()=>uj({client:ie,path:{name:e,id:n}}))}function IN(e,n,i){return ce(()=>Zw({client:ie,path:{name:e},body:{provider:n,count:i}}))}function HN(e){return ce(()=>Fw({client:ie,body:e}))}function ZN(e){return ce(()=>Jw({client:ie,body:e??{}}))}function zR(e,n){return ce(()=>pj({client:ie,path:{name:e},body:{type:n}}))}function CR(e,n){return ce(()=>mj({client:ie,path:{name:e,type:n}}))}function TR(e,n,i){return ce(()=>gj({client:ie,path:{name:e,type:n},body:{propertyId:i}}))}function ER(e,n,i){return ce(()=>yj({client:ie,path:{name:e,type:n},body:{sitemapUrl:i}}))}function PN(e,n){return ce(()=>bj({client:ie,path:{name:e},body:n??{}}))}function OR(e,n){return ce(()=>xj({client:ie,path:{name:e},body:{url:n}}))}function KN(e){return ce(()=>lv({client:ie,path:{name:e}}))}function QN(e,n){return ce(()=>_j({client:ie,path:{name:e},body:n??{}}))}function DR(e){return ce(()=>kj({client:ie,path:{name:e}}))}function YN(e){return ce(()=>Aj({client:ie,path:{name:e}}))}function RR(e,n){return ce(()=>bN({client:ie,path:{name:e},body:n??{}}))}function MR(e,n,i){return ce(()=>wN({client:ie,path:{name:e,id:n},body:i??{}}))}function BR(){return ce(()=>dj({client:ie}))}function LR(e,n){return ce(()=>aj({client:ie,body:{host:e,port:n}}))}function qR(e,n){return ce(()=>zj({client:ie,path:{name:e},body:n}))}function $R(e,n){return ce(()=>Cj({client:ie,path:{name:e},body:{apiKey:n}}))}function UR(e){return ce(()=>Tj({client:ie,path:{name:e}}))}function VR(e,n){return ce(()=>Dj({client:ie,path:{name:e},body:{siteUrl:n}}))}function XN(e){return ce(()=>cv({client:ie,path:{name:e}}))}function GR(e,n){return ce(()=>Mj({client:ie,path:{name:e},body:{url:n}}))}function IR(e,n){return ce(()=>Bj({client:ie,path:{name:e},body:{}}))}function HR(e,n){return ce(()=>Lj({client:ie,path:{name:e},body:n}))}function ZR(e){return ce(()=>nj({client:ie,body:{apiKey:e}}))}function JN(e){return e?/filename\s*=\s*"?([^";]+)"?/i.exec(e)?.[1]??null:null}async function PR(e,n="agency"){const i=new URLSearchParams({audience:n}),r=await fetch(`${uv}/projects/${encodeURIComponent(e)}/report.html?${i.toString()}`,{credentials:"same-origin",headers:{}});if(!r.ok)throw new In(`Failed to download report: ${r.status}`,r.status);const l=await r.blob(),c=URL.createObjectURL(l),d=JN(r.headers.get("Content-Disposition"))??`canonry-report-${e}.html`,m=document.createElement("a");m.href=c,m.download=d,document.body.appendChild(m),m.click(),document.body.removeChild(m),URL.revokeObjectURL(c)}function KR(e,n){return ce(()=>Gj({client:ie,path:{name:e},body:{}}))}function QR(e,n){return ce(()=>$j({client:ie,path:{name:e},body:n}))}function YR(e){return ce(()=>Uj({client:ie,path:{name:e}}))}function XR(e,n){return ce(()=>uN({client:ie,path:{name:e},body:n}))}function JR(e,n){return ce(()=>dN({client:ie,path:{name:e},body:n}))}function FR(e,n){return ce(()=>fN({client:ie,path:{name:e},body:n}))}function WR(e,n,i){return ce(()=>pN({client:ie,path:{name:e,id:n},body:i??{}}))}function FN(e,n){return ce(()=>Kj({client:ie,path:{name:e},query:{runId:n}}))}function WN(e){if(!e||typeof e!="object")return;const n=e;if(!(typeof n.current!="string"||typeof n.latest!="string"||typeof n.url!="string"||typeof n.upgradeCommand!="string"))return{current:n.current,latest:n.latest,url:n.url,upgradeCommand:n.upgradeCommand}}async function ek(e,n){const i=zN(e);try{const r=await fetch(i,{credentials:"same-origin"});if(!r.ok)return{label:n,state:"error",detail:`${n} ${r.status}: ${r.statusText}`,statusCode:r.status,hint:CN(e,r.status)};const l=await r.json(),c=typeof l.version=="string"?l.version:"unknown",d=typeof l.databaseUrlConfigured=="boolean"?l.databaseUrlConfigured:void 0,m=typeof l.lastHeartbeatAt=="string"?l.lastHeartbeatAt:void 0,g=WN(l.updateAvailable),b=[c,d===!1?"database not configured":"database configured",m?`heartbeat ${m}`:void 0].filter(Boolean).join(" · ");return{label:n,state:"ok",detail:b,version:c,databaseConfigured:d,lastHeartbeatAt:m,...g?{updateAvailable:g}:{}}}catch(r){return{label:n,state:"error",detail:r instanceof Error?r.message:"unreachable",hint:e==="/health"?`Request failed while checking ${i}. If this instance is served behind a sub-path, verify the dashboard basePath and reverse-proxy rewrites.`:void 0}}}function eM(){return ce(()=>Fj({client:ie}))}function tM(){return ce(()=>Wj({client:ie}))}function nM(){return ce(()=>nN({client:ie}))}function aM(){return ce(()=>eN({client:ie}))}function iM(e){return ce(()=>tN({client:ie,body:e?{release:e}:{}}))}function sM(){return ce(()=>aN({client:ie}))}function rM(){return ce(()=>iN({client:ie}))}function oM(e){return ce(()=>sN({client:ie,path:{release:e}}))}function lM(e,n={}){return ce(()=>oN({client:ie,path:{name:e},query:{release:n.release,excludeCrawlers:n.excludeCrawlers?"1":void 0}}))}function cM(e,n={}){return ce(()=>lN({client:ie,path:{name:e},query:{limit:n.limit!==void 0?String(n.limit):void 0,offset:n.offset!==void 0?String(n.offset):void 0,release:n.release,excludeCrawlers:n.excludeCrawlers?"1":void 0}}))}function uM(e){return ce(()=>cN({client:ie,path:{name:e}}))}function dM(e,n){return ce(()=>rN({client:ie,path:{name:e},body:{release:void 0}}))}function Sn(e){return(...n)=>{e(...n)}}const tk=6e3,nk=5,ak=180;let $t=[],ik=0;const df=new Set,ff=new Map,pf=new Map;function Jl(){const e=[...$t];for(const n of df)n(e)}function qf(e){const n=ff.get(e);n&&(clearTimeout(n),ff.delete(e));const i=pf.get(e);i&&(clearTimeout(i),pf.delete(e))}function fv(e){qf(e);const n=$t.length;$t=$t.filter(i=>i.id!==e),$t.length!==n&&Jl()}function Ey(e){qf(e.id),ff.set(e.id,setTimeout(()=>{mf(e.id)},e.durationMs))}function sk(e,n,i){return typeof e=="string"?{title:e,tone:n,durationMs:i}:e}function cn(e,n="negative",i=tk){const r=sk(e,n,i),l={id:String(++ik),title:r.title,detail:r.detail,tone:r.tone??n,durationMs:r.durationMs??i,dedupeKey:r.dedupeKey,cta:r.cta,state:"open"};if(r.dedupeKey){const c=$t.find(d=>d.dedupeKey===r.dedupeKey);if(c){if((r.dedupeMode??"drop")==="drop")return c.id;const d={...c,title:l.title,detail:l.detail,tone:l.tone,durationMs:l.durationMs,cta:l.cta,state:"open"};return $t=$t.map(m=>m.id===c.id?d:m),Jl(),Ey(d),c.id}}return $t.length>=nk&&fv($t[0].id),$t=[...$t,l],Jl(),Ey(l),l.id}function mf(e){const n=$t.find(i=>i.id===e);!n||n.state==="closing"||(qf(e),$t=$t.map(i=>i.id===e?{...i,state:"closing"}:i),Jl(),pf.set(e,setTimeout(()=>{fv(e)},ak)))}function rk(e){return df.add(e),()=>{df.delete(e)}}function Oy(){return $t}const ok=5*6e4,lk=30*6e4,fM=3e4,pM=6e4,hf=3e4;function ck(){return new ew({defaultOptions:{queries:{staleTime:ok,retry:1,refetchOnWindowFocus:!1}},mutationCache:new tw({onError:(e,n,i,r)=>{r.meta?.skipGlobalErrorToast||cn({title:e instanceof Error?e.message:"An unexpected error occurred",tone:"negative"})}})})}const uk="modulepreload",dk=function(e,n){return new URL(e,n).href},Dy={},Is=function(n,i,r){let l=Promise.resolve();if(i&&i.length>0){let b=function(v){return Promise.all(v.map(S=>Promise.resolve(S).then(w=>({status:"fulfilled",value:w}),w=>({status:"rejected",reason:w}))))};const d=document.getElementsByTagName("link"),m=document.querySelector("meta[property=csp-nonce]"),g=m?.nonce||m?.getAttribute("nonce");l=b(i.map(v=>{if(v=dk(v,r),v in Dy)return;Dy[v]=!0;const S=v.endsWith(".css"),w=S?'[rel="stylesheet"]':"";if(r)for(let C=d.length-1;C>=0;C--){const N=d[C];if(N.href===v&&(!S||N.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${v}"]${w}`))return;const _=document.createElement("link");if(_.rel=S?"stylesheet":uk,S||(_.as="script"),_.crossOrigin="",_.href=v,g&&_.setAttribute("nonce",g),document.head.appendChild(_),S)return new Promise((C,N)=>{_.addEventListener("load",C),_.addEventListener("error",()=>N(new Error(`Unable to preload CSS for ${v}`)))})}))}function c(d){const m=new Event("vite:preloadError",{cancelable:!0});if(m.payload=d,window.dispatchEvent(m),!m.defaultPrevented)throw d}return l.then(d=>{for(const m of d||[])m.status==="rejected"&&c(m.reason);return n().catch(c)})};const fk=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),pk=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,i,r)=>r?r.toUpperCase():i.toLowerCase()),Ry=e=>{const n=pk(e);return n.charAt(0).toUpperCase()+n.slice(1)},pv=(...e)=>e.filter((n,i,r)=>!!n&&n.trim()!==""&&r.indexOf(n)===i).join(" ").trim(),mk=e=>{for(const n in e)if(n.startsWith("aria-")||n==="role"||n==="title")return!0};var hk={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 gk=U.forwardRef(({color:e="currentColor",size:n=24,strokeWidth:i=2,absoluteStrokeWidth:r,className:l="",children:c,iconNode:d,...m},g)=>U.createElement("svg",{ref:g,...hk,width:n,height:n,stroke:e,strokeWidth:r?Number(i)*24/Number(n):i,className:pv("lucide",l),...!c&&!mk(m)&&{"aria-hidden":"true"},...m},[...d.map(([b,v])=>U.createElement(b,v)),...Array.isArray(c)?c:[c]]));const at=(e,n)=>{const i=U.forwardRef(({className:r,...l},c)=>U.createElement(gk,{ref:c,iconNode:n,className:pv(`lucide-${fk(Ry(e))}`,`lucide-${e}`,r),...l}));return i.displayName=Ry(e),i};const yk=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],bk=at("arrow-right",yk);const vk=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],Sk=at("arrow-up",vk);const xk=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],wk=at("book-open",xk);const jk=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],mv=at("check",jk);const Nk=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],kk=at("chevron-down",Nk);const Ak=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],$f=at("chevron-right",Ak);const _k=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],zk=at("copy",_k);const Ck=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Tk=at("file-text",Ck);const Ek=[["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"}]],Ok=at("github",Ek);const Dk=[["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"}]],Rk=at("globe",Dk);const Mk=[["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"}]],Bk=at("layout-dashboard",Mk);const Lk=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],qk=at("link-2",Lk);const $k=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Uk=at("loader-circle",$k);const Vk=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],Gk=at("maximize-2",Vk);const Ik=[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]],Hk=at("menu",Ik);const Zk=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],Pk=at("minimize-2",Zk);const Kk=[["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"}]],Qk=at("play",Kk);const Yk=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],My=at("plus",Yk);const Xk=[["path",{d:"M19.07 4.93A10 10 0 0 0 6.99 3.34",key:"z3du51"}],["path",{d:"M4 6h.01",key:"oypzma"}],["path",{d:"M2.29 9.62A10 10 0 1 0 21.31 8.35",key:"qzzz0"}],["path",{d:"M16.24 7.76A6 6 0 1 0 8.23 16.67",key:"1yjesh"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M17.99 11.66A6 6 0 0 1 15.77 16.67",key:"1u2y91"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"m13.41 10.59 5.66-5.66",key:"mhq4k0"}]],Jk=at("radar",Xk);const Fk=[["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"}]],Wk=at("rocket",Fk);const e2=[["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"}]],hv=at("rotate-ccw",e2);const t2=[["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"}]],n2=at("settings",t2);const a2=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],By=at("sparkles",a2);const i2=[["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"}]],gv=at("triangle-alert",i2);const s2=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],r2=at("wrench",s2);const o2=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Hs=at("x",o2);function H(e,n,i){function r(m,g){if(m._zod||Object.defineProperty(m,"_zod",{value:{def:g,constr:d,traits:new Set},enumerable:!1}),m._zod.traits.has(e))return;m._zod.traits.add(e),n(m,g);const b=d.prototype,v=Object.keys(b);for(let S=0;S<v.length;S++){const w=v[S];w in m||(m[w]=b[w].bind(m))}}const l=i?.Parent??Object;class c extends l{}Object.defineProperty(c,"name",{value:e});function d(m){var g;const b=i?.Parent?new c:this;r(b,m),(g=b._zod).deferred??(g.deferred=[]);for(const v of b._zod.deferred)v();return b}return Object.defineProperty(d,"init",{value:r}),Object.defineProperty(d,Symbol.hasInstance,{value:m=>i?.Parent&&m instanceof i.Parent?!0:m?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}class Ds extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class yv extends Error{constructor(n){super(`Encountered unidirectional transform during encode: ${n}`),this.name="ZodEncodeError"}}const bv={};function Za(e){return bv}function vv(e){const n=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,l])=>n.indexOf(+r)===-1).map(([r,l])=>l)}function gf(e,n){return typeof n=="bigint"?n.toString():n}function dc(e){return{get value(){{const n=e();return Object.defineProperty(this,"value",{value:n}),n}}}}function Uf(e){return e==null}function Vf(e){const n=e.startsWith("^")?1:0,i=e.endsWith("$")?e.length-1:e.length;return e.slice(n,i)}function l2(e,n){const i=(e.toString().split(".")[1]||"").length,r=n.toString();let l=(r.split(".")[1]||"").length;if(l===0&&/\d?e-\d?/.test(r)){const g=r.match(/\d?e-(\d?)/);g?.[1]&&(l=Number.parseInt(g[1]))}const c=i>l?i:l,d=Number.parseInt(e.toFixed(c).replace(".","")),m=Number.parseInt(n.toFixed(c).replace(".",""));return d%m/10**c}const Ly=Symbol("evaluating");function He(e,n,i){let r;Object.defineProperty(e,n,{get(){if(r!==Ly)return r===void 0&&(r=Ly,r=i()),r},set(l){Object.defineProperty(e,n,{value:l})},configurable:!0})}function _i(e,n,i){Object.defineProperty(e,n,{value:i,writable:!0,enumerable:!0,configurable:!0})}function Qa(...e){const n={};for(const i of e){const r=Object.getOwnPropertyDescriptors(i);Object.assign(n,r)}return Object.defineProperties({},n)}function qy(e){return JSON.stringify(e)}function c2(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Sv="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function io(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const u2=dc(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Ls(e){if(io(e)===!1)return!1;const n=e.constructor;if(n===void 0||typeof n!="function")return!0;const i=n.prototype;return!(io(i)===!1||Object.prototype.hasOwnProperty.call(i,"isPrototypeOf")===!1)}function xv(e){return Ls(e)?{...e}:Array.isArray(e)?[...e]:e}const d2=new Set(["string","number","symbol"]);function qs(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ya(e,n,i){const r=new e._zod.constr(n??e._zod.def);return(!n||i?.parent)&&(r._zod.parent=e),r}function ve(e){const n=e;if(!n)return{};if(typeof n=="string")return{error:()=>n};if(n?.message!==void 0){if(n?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");n.error=n.message}return delete n.message,typeof n.error=="string"?{...n,error:()=>n.error}:n}function f2(e){return Object.keys(e).filter(n=>e[n]._zod.optin==="optional"&&e[n]._zod.optout==="optional")}const p2={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 m2(e,n){const i=e._zod.def,r=i.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const c=Qa(e._zod.def,{get shape(){const d={};for(const m in n){if(!(m in i.shape))throw new Error(`Unrecognized key: "${m}"`);n[m]&&(d[m]=i.shape[m])}return _i(this,"shape",d),d},checks:[]});return Ya(e,c)}function h2(e,n){const i=e._zod.def,r=i.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const c=Qa(e._zod.def,{get shape(){const d={...e._zod.def.shape};for(const m in n){if(!(m in i.shape))throw new Error(`Unrecognized key: "${m}"`);n[m]&&delete d[m]}return _i(this,"shape",d),d},checks:[]});return Ya(e,c)}function g2(e,n){if(!Ls(n))throw new Error("Invalid input to extend: expected a plain object");const i=e._zod.def.checks;if(i&&i.length>0){const c=e._zod.def.shape;for(const d in n)if(Object.getOwnPropertyDescriptor(c,d)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const l=Qa(e._zod.def,{get shape(){const c={...e._zod.def.shape,...n};return _i(this,"shape",c),c}});return Ya(e,l)}function y2(e,n){if(!Ls(n))throw new Error("Invalid input to safeExtend: expected a plain object");const i=Qa(e._zod.def,{get shape(){const r={...e._zod.def.shape,...n};return _i(this,"shape",r),r}});return Ya(e,i)}function b2(e,n){const i=Qa(e._zod.def,{get shape(){const r={...e._zod.def.shape,...n._zod.def.shape};return _i(this,"shape",r),r},get catchall(){return n._zod.def.catchall},checks:[]});return Ya(e,i)}function v2(e,n,i){const l=n._zod.def.checks;if(l&&l.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const d=Qa(n._zod.def,{get shape(){const m=n._zod.def.shape,g={...m};if(i)for(const b in i){if(!(b in m))throw new Error(`Unrecognized key: "${b}"`);i[b]&&(g[b]=e?new e({type:"optional",innerType:m[b]}):m[b])}else for(const b in m)g[b]=e?new e({type:"optional",innerType:m[b]}):m[b];return _i(this,"shape",g),g},checks:[]});return Ya(n,d)}function S2(e,n,i){const r=Qa(n._zod.def,{get shape(){const l=n._zod.def.shape,c={...l};if(i)for(const d in i){if(!(d in c))throw new Error(`Unrecognized key: "${d}"`);i[d]&&(c[d]=new e({type:"nonoptional",innerType:l[d]}))}else for(const d in l)c[d]=new e({type:"nonoptional",innerType:l[d]});return _i(this,"shape",c),c}});return Ya(n,r)}function zs(e,n=0){if(e.aborted===!0)return!0;for(let i=n;i<e.issues.length;i++)if(e.issues[i]?.continue!==!0)return!0;return!1}function Cs(e,n){return n.map(i=>{var r;return(r=i).path??(r.path=[]),i.path.unshift(e),i})}function Dl(e){return typeof e=="string"?e:e?.message}function Pa(e,n,i){const r={...e,path:e.path??[]};if(!e.message){const l=Dl(e.inst?._zod.def?.error?.(e))??Dl(n?.error?.(e))??Dl(i.customError?.(e))??Dl(i.localeError?.(e))??"Invalid input";r.message=l}return delete r.inst,delete r.continue,n?.reportInput||delete r.input,r}function Gf(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function so(...e){const[n,i,r]=e;return typeof n=="string"?{message:n,code:"custom",input:i,inst:r}:{...n}}const wv=(e,n)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:n,enumerable:!1}),e.message=JSON.stringify(n,gf,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},jv=H("$ZodError",wv),Nv=H("$ZodError",wv,{Parent:Error});function x2(e,n=i=>i.message){const i={},r=[];for(const l of e.issues)l.path.length>0?(i[l.path[0]]=i[l.path[0]]||[],i[l.path[0]].push(n(l))):r.push(n(l));return{formErrors:r,fieldErrors:i}}function w2(e,n=i=>i.message){const i={_errors:[]},r=l=>{for(const c of l.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(d=>r({issues:d}));else if(c.code==="invalid_key")r({issues:c.issues});else if(c.code==="invalid_element")r({issues:c.issues});else if(c.path.length===0)i._errors.push(n(c));else{let d=i,m=0;for(;m<c.path.length;){const g=c.path[m];m===c.path.length-1?(d[g]=d[g]||{_errors:[]},d[g]._errors.push(n(c))):d[g]=d[g]||{_errors:[]},d=d[g],m++}}};return r(e),i}const If=e=>(n,i,r,l)=>{const c=r?Object.assign(r,{async:!1}):{async:!1},d=n._zod.run({value:i,issues:[]},c);if(d instanceof Promise)throw new Ds;if(d.issues.length){const m=new(l?.Err??e)(d.issues.map(g=>Pa(g,c,Za())));throw Sv(m,l?.callee),m}return d.value},Hf=e=>async(n,i,r,l)=>{const c=r?Object.assign(r,{async:!0}):{async:!0};let d=n._zod.run({value:i,issues:[]},c);if(d instanceof Promise&&(d=await d),d.issues.length){const m=new(l?.Err??e)(d.issues.map(g=>Pa(g,c,Za())));throw Sv(m,l?.callee),m}return d.value},fc=e=>(n,i,r)=>{const l=r?{...r,async:!1}:{async:!1},c=n._zod.run({value:i,issues:[]},l);if(c instanceof Promise)throw new Ds;return c.issues.length?{success:!1,error:new(e??jv)(c.issues.map(d=>Pa(d,l,Za())))}:{success:!0,data:c.value}},j2=fc(Nv),pc=e=>async(n,i,r)=>{const l=r?Object.assign(r,{async:!0}):{async:!0};let c=n._zod.run({value:i,issues:[]},l);return c instanceof Promise&&(c=await c),c.issues.length?{success:!1,error:new e(c.issues.map(d=>Pa(d,l,Za())))}:{success:!0,data:c.value}},N2=pc(Nv),k2=e=>(n,i,r)=>{const l=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return If(e)(n,i,l)},A2=e=>(n,i,r)=>If(e)(n,i,r),_2=e=>async(n,i,r)=>{const l=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Hf(e)(n,i,l)},z2=e=>async(n,i,r)=>Hf(e)(n,i,r),C2=e=>(n,i,r)=>{const l=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return fc(e)(n,i,l)},T2=e=>(n,i,r)=>fc(e)(n,i,r),E2=e=>async(n,i,r)=>{const l=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return pc(e)(n,i,l)},O2=e=>async(n,i,r)=>pc(e)(n,i,r),D2=/^[cC][^\s-]{8,}$/,R2=/^[0-9a-z]+$/,M2=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,B2=/^[0-9a-vA-V]{20}$/,L2=/^[A-Za-z0-9]{27}$/,q2=/^[a-zA-Z0-9_-]{21}$/,$2=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,U2=/^([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})$/,$y=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)$/,V2=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,G2="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function I2(){return new RegExp(G2,"u")}const H2=/^(?:(?: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])$/,Z2=/^(([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}|:))$/,P2=/^((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])$/,K2=/^(([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])$/,Q2=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,kv=/^[A-Za-z0-9_-]*$/,Y2=/^\+[1-9]\d{6,14}$/,Av="(?:(?:\\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])))",X2=new RegExp(`^${Av}$`);function _v(e){const n="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${n}`:e.precision===0?`${n}:[0-5]\\d`:`${n}:[0-5]\\d\\.\\d{${e.precision}}`:`${n}(?::[0-5]\\d(?:\\.\\d+)?)?`}function J2(e){return new RegExp(`^${_v(e)}$`)}function F2(e){const n=_v({precision:e.precision}),i=["Z"];e.local&&i.push(""),e.offset&&i.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${n}(?:${i.join("|")})`;return new RegExp(`^${Av}T(?:${r})$`)}const W2=e=>{const n=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${n}$`)},eA=/^-?\d+$/,zv=/^-?\d+(?:\.\d+)?$/,tA=/^(?:true|false)$/i,nA=/^[^A-Z]*$/,aA=/^[^a-z]*$/,en=H("$ZodCheck",(e,n)=>{var i;e._zod??(e._zod={}),e._zod.def=n,(i=e._zod).onattach??(i.onattach=[])}),Cv={number:"number",bigint:"bigint",object:"date"},Tv=H("$ZodCheckLessThan",(e,n)=>{en.init(e,n);const i=Cv[typeof n.value];e._zod.onattach.push(r=>{const l=r._zod.bag,c=(n.inclusive?l.maximum:l.exclusiveMaximum)??Number.POSITIVE_INFINITY;n.value<c&&(n.inclusive?l.maximum=n.value:l.exclusiveMaximum=n.value)}),e._zod.check=r=>{(n.inclusive?r.value<=n.value:r.value<n.value)||r.issues.push({origin:i,code:"too_big",maximum:typeof n.value=="object"?n.value.getTime():n.value,input:r.value,inclusive:n.inclusive,inst:e,continue:!n.abort})}}),Ev=H("$ZodCheckGreaterThan",(e,n)=>{en.init(e,n);const i=Cv[typeof n.value];e._zod.onattach.push(r=>{const l=r._zod.bag,c=(n.inclusive?l.minimum:l.exclusiveMinimum)??Number.NEGATIVE_INFINITY;n.value>c&&(n.inclusive?l.minimum=n.value:l.exclusiveMinimum=n.value)}),e._zod.check=r=>{(n.inclusive?r.value>=n.value:r.value>n.value)||r.issues.push({origin:i,code:"too_small",minimum:typeof n.value=="object"?n.value.getTime():n.value,input:r.value,inclusive:n.inclusive,inst:e,continue:!n.abort})}}),iA=H("$ZodCheckMultipleOf",(e,n)=>{en.init(e,n),e._zod.onattach.push(i=>{var r;(r=i._zod.bag).multipleOf??(r.multipleOf=n.value)}),e._zod.check=i=>{if(typeof i.value!=typeof n.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof i.value=="bigint"?i.value%n.value===BigInt(0):l2(i.value,n.value)===0)||i.issues.push({origin:typeof i.value,code:"not_multiple_of",divisor:n.value,input:i.value,inst:e,continue:!n.abort})}}),sA=H("$ZodCheckNumberFormat",(e,n)=>{en.init(e,n),n.format=n.format||"float64";const i=n.format?.includes("int"),r=i?"int":"number",[l,c]=p2[n.format];e._zod.onattach.push(d=>{const m=d._zod.bag;m.format=n.format,m.minimum=l,m.maximum=c,i&&(m.pattern=eA)}),e._zod.check=d=>{const m=d.value;if(i){if(!Number.isInteger(m)){d.issues.push({expected:r,format:n.format,code:"invalid_type",continue:!1,input:m,inst:e});return}if(!Number.isSafeInteger(m)){m>0?d.issues.push({input:m,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!n.abort}):d.issues.push({input:m,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!n.abort});return}}m<l&&d.issues.push({origin:"number",input:m,code:"too_small",minimum:l,inclusive:!0,inst:e,continue:!n.abort}),m>c&&d.issues.push({origin:"number",input:m,code:"too_big",maximum:c,inclusive:!0,inst:e,continue:!n.abort})}}),rA=H("$ZodCheckMaxLength",(e,n)=>{var i;en.init(e,n),(i=e._zod.def).when??(i.when=r=>{const l=r.value;return!Uf(l)&&l.length!==void 0}),e._zod.onattach.push(r=>{const l=r._zod.bag.maximum??Number.POSITIVE_INFINITY;n.maximum<l&&(r._zod.bag.maximum=n.maximum)}),e._zod.check=r=>{const l=r.value;if(l.length<=n.maximum)return;const d=Gf(l);r.issues.push({origin:d,code:"too_big",maximum:n.maximum,inclusive:!0,input:l,inst:e,continue:!n.abort})}}),oA=H("$ZodCheckMinLength",(e,n)=>{var i;en.init(e,n),(i=e._zod.def).when??(i.when=r=>{const l=r.value;return!Uf(l)&&l.length!==void 0}),e._zod.onattach.push(r=>{const l=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;n.minimum>l&&(r._zod.bag.minimum=n.minimum)}),e._zod.check=r=>{const l=r.value;if(l.length>=n.minimum)return;const d=Gf(l);r.issues.push({origin:d,code:"too_small",minimum:n.minimum,inclusive:!0,input:l,inst:e,continue:!n.abort})}}),lA=H("$ZodCheckLengthEquals",(e,n)=>{var i;en.init(e,n),(i=e._zod.def).when??(i.when=r=>{const l=r.value;return!Uf(l)&&l.length!==void 0}),e._zod.onattach.push(r=>{const l=r._zod.bag;l.minimum=n.length,l.maximum=n.length,l.length=n.length}),e._zod.check=r=>{const l=r.value,c=l.length;if(c===n.length)return;const d=Gf(l),m=c>n.length;r.issues.push({origin:d,...m?{code:"too_big",maximum:n.length}:{code:"too_small",minimum:n.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!n.abort})}}),mc=H("$ZodCheckStringFormat",(e,n)=>{var i,r;en.init(e,n),e._zod.onattach.push(l=>{const c=l._zod.bag;c.format=n.format,n.pattern&&(c.patterns??(c.patterns=new Set),c.patterns.add(n.pattern))}),n.pattern?(i=e._zod).check??(i.check=l=>{n.pattern.lastIndex=0,!n.pattern.test(l.value)&&l.issues.push({origin:"string",code:"invalid_format",format:n.format,input:l.value,...n.pattern?{pattern:n.pattern.toString()}:{},inst:e,continue:!n.abort})}):(r=e._zod).check??(r.check=()=>{})}),cA=H("$ZodCheckRegex",(e,n)=>{mc.init(e,n),e._zod.check=i=>{n.pattern.lastIndex=0,!n.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:"regex",input:i.value,pattern:n.pattern.toString(),inst:e,continue:!n.abort})}}),uA=H("$ZodCheckLowerCase",(e,n)=>{n.pattern??(n.pattern=nA),mc.init(e,n)}),dA=H("$ZodCheckUpperCase",(e,n)=>{n.pattern??(n.pattern=aA),mc.init(e,n)}),fA=H("$ZodCheckIncludes",(e,n)=>{en.init(e,n);const i=qs(n.includes),r=new RegExp(typeof n.position=="number"?`^.{${n.position}}${i}`:i);n.pattern=r,e._zod.onattach.push(l=>{const c=l._zod.bag;c.patterns??(c.patterns=new Set),c.patterns.add(r)}),e._zod.check=l=>{l.value.includes(n.includes,n.position)||l.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:n.includes,input:l.value,inst:e,continue:!n.abort})}}),pA=H("$ZodCheckStartsWith",(e,n)=>{en.init(e,n);const i=new RegExp(`^${qs(n.prefix)}.*`);n.pattern??(n.pattern=i),e._zod.onattach.push(r=>{const l=r._zod.bag;l.patterns??(l.patterns=new Set),l.patterns.add(i)}),e._zod.check=r=>{r.value.startsWith(n.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:n.prefix,input:r.value,inst:e,continue:!n.abort})}}),mA=H("$ZodCheckEndsWith",(e,n)=>{en.init(e,n);const i=new RegExp(`.*${qs(n.suffix)}$`);n.pattern??(n.pattern=i),e._zod.onattach.push(r=>{const l=r._zod.bag;l.patterns??(l.patterns=new Set),l.patterns.add(i)}),e._zod.check=r=>{r.value.endsWith(n.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:n.suffix,input:r.value,inst:e,continue:!n.abort})}}),hA=H("$ZodCheckOverwrite",(e,n)=>{en.init(e,n),e._zod.check=i=>{i.value=n.tx(i.value)}});class gA{constructor(n=[]){this.content=[],this.indent=0,this&&(this.args=n)}indented(n){this.indent+=1,n(this),this.indent-=1}write(n){if(typeof n=="function"){n(this,{execution:"sync"}),n(this,{execution:"async"});return}const r=n.split(`
15
+ `).filter(d=>d),l=Math.min(...r.map(d=>d.length-d.trimStart().length)),c=r.map(d=>d.slice(l)).map(d=>" ".repeat(this.indent*2)+d);for(const d of c)this.content.push(d)}compile(){const n=Function,i=this?.args,l=[...(this?.content??[""]).map(c=>` ${c}`)];return new n(...i,l.join(`
16
+ `))}}const yA={major:4,minor:3,patch:6},ct=H("$ZodType",(e,n)=>{var i;e??(e={}),e._zod.def=n,e._zod.bag=e._zod.bag||{},e._zod.version=yA;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const l of r)for(const c of l._zod.onattach)c(e);if(r.length===0)(i=e._zod).deferred??(i.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const l=(d,m,g)=>{let b=zs(d),v;for(const S of m){if(S._zod.def.when){if(!S._zod.def.when(d))continue}else if(b)continue;const w=d.issues.length,_=S._zod.check(d);if(_ instanceof Promise&&g?.async===!1)throw new Ds;if(v||_ instanceof Promise)v=(v??Promise.resolve()).then(async()=>{await _,d.issues.length!==w&&(b||(b=zs(d,w)))});else{if(d.issues.length===w)continue;b||(b=zs(d,w))}}return v?v.then(()=>d):d},c=(d,m,g)=>{if(zs(d))return d.aborted=!0,d;const b=l(m,r,g);if(b instanceof Promise){if(g.async===!1)throw new Ds;return b.then(v=>e._zod.parse(v,g))}return e._zod.parse(b,g)};e._zod.run=(d,m)=>{if(m.skipChecks)return e._zod.parse(d,m);if(m.direction==="backward"){const b=e._zod.parse({value:d.value,issues:[]},{...m,skipChecks:!0});return b instanceof Promise?b.then(v=>c(v,d,m)):c(b,d,m)}const g=e._zod.parse(d,m);if(g instanceof Promise){if(m.async===!1)throw new Ds;return g.then(b=>l(b,r,m))}return l(g,r,m)}}He(e,"~standard",()=>({validate:l=>{try{const c=j2(e,l);return c.success?{value:c.data}:{issues:c.error?.issues}}catch{return N2(e,l).then(d=>d.success?{value:d.data}:{issues:d.error?.issues})}},vendor:"zod",version:1}))}),Zf=H("$ZodString",(e,n)=>{ct.init(e,n),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??W2(e._zod.bag),e._zod.parse=(i,r)=>{if(n.coerce)try{i.value=String(i.value)}catch{}return typeof i.value=="string"||i.issues.push({expected:"string",code:"invalid_type",input:i.value,inst:e}),i}}),lt=H("$ZodStringFormat",(e,n)=>{mc.init(e,n),Zf.init(e,n)}),bA=H("$ZodGUID",(e,n)=>{n.pattern??(n.pattern=U2),lt.init(e,n)}),vA=H("$ZodUUID",(e,n)=>{if(n.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[n.version];if(r===void 0)throw new Error(`Invalid UUID version: "${n.version}"`);n.pattern??(n.pattern=$y(r))}else n.pattern??(n.pattern=$y());lt.init(e,n)}),SA=H("$ZodEmail",(e,n)=>{n.pattern??(n.pattern=V2),lt.init(e,n)}),xA=H("$ZodURL",(e,n)=>{lt.init(e,n),e._zod.check=i=>{try{const r=i.value.trim(),l=new URL(r);n.hostname&&(n.hostname.lastIndex=0,n.hostname.test(l.hostname)||i.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:n.hostname.source,input:i.value,inst:e,continue:!n.abort})),n.protocol&&(n.protocol.lastIndex=0,n.protocol.test(l.protocol.endsWith(":")?l.protocol.slice(0,-1):l.protocol)||i.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:n.protocol.source,input:i.value,inst:e,continue:!n.abort})),n.normalize?i.value=l.href:i.value=r;return}catch{i.issues.push({code:"invalid_format",format:"url",input:i.value,inst:e,continue:!n.abort})}}}),wA=H("$ZodEmoji",(e,n)=>{n.pattern??(n.pattern=I2()),lt.init(e,n)}),jA=H("$ZodNanoID",(e,n)=>{n.pattern??(n.pattern=q2),lt.init(e,n)}),NA=H("$ZodCUID",(e,n)=>{n.pattern??(n.pattern=D2),lt.init(e,n)}),kA=H("$ZodCUID2",(e,n)=>{n.pattern??(n.pattern=R2),lt.init(e,n)}),AA=H("$ZodULID",(e,n)=>{n.pattern??(n.pattern=M2),lt.init(e,n)}),_A=H("$ZodXID",(e,n)=>{n.pattern??(n.pattern=B2),lt.init(e,n)}),zA=H("$ZodKSUID",(e,n)=>{n.pattern??(n.pattern=L2),lt.init(e,n)}),CA=H("$ZodISODateTime",(e,n)=>{n.pattern??(n.pattern=F2(n)),lt.init(e,n)}),TA=H("$ZodISODate",(e,n)=>{n.pattern??(n.pattern=X2),lt.init(e,n)}),EA=H("$ZodISOTime",(e,n)=>{n.pattern??(n.pattern=J2(n)),lt.init(e,n)}),OA=H("$ZodISODuration",(e,n)=>{n.pattern??(n.pattern=$2),lt.init(e,n)}),DA=H("$ZodIPv4",(e,n)=>{n.pattern??(n.pattern=H2),lt.init(e,n),e._zod.bag.format="ipv4"}),RA=H("$ZodIPv6",(e,n)=>{n.pattern??(n.pattern=Z2),lt.init(e,n),e._zod.bag.format="ipv6",e._zod.check=i=>{try{new URL(`http://[${i.value}]`)}catch{i.issues.push({code:"invalid_format",format:"ipv6",input:i.value,inst:e,continue:!n.abort})}}}),MA=H("$ZodCIDRv4",(e,n)=>{n.pattern??(n.pattern=P2),lt.init(e,n)}),BA=H("$ZodCIDRv6",(e,n)=>{n.pattern??(n.pattern=K2),lt.init(e,n),e._zod.check=i=>{const r=i.value.split("/");try{if(r.length!==2)throw new Error;const[l,c]=r;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://[${l}]`)}catch{i.issues.push({code:"invalid_format",format:"cidrv6",input:i.value,inst:e,continue:!n.abort})}}});function Ov(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const LA=H("$ZodBase64",(e,n)=>{n.pattern??(n.pattern=Q2),lt.init(e,n),e._zod.bag.contentEncoding="base64",e._zod.check=i=>{Ov(i.value)||i.issues.push({code:"invalid_format",format:"base64",input:i.value,inst:e,continue:!n.abort})}});function qA(e){if(!kv.test(e))return!1;const n=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),i=n.padEnd(Math.ceil(n.length/4)*4,"=");return Ov(i)}const $A=H("$ZodBase64URL",(e,n)=>{n.pattern??(n.pattern=kv),lt.init(e,n),e._zod.bag.contentEncoding="base64url",e._zod.check=i=>{qA(i.value)||i.issues.push({code:"invalid_format",format:"base64url",input:i.value,inst:e,continue:!n.abort})}}),UA=H("$ZodE164",(e,n)=>{n.pattern??(n.pattern=Y2),lt.init(e,n)});function VA(e,n=null){try{const i=e.split(".");if(i.length!==3)return!1;const[r]=i;if(!r)return!1;const l=JSON.parse(atob(r));return!("typ"in l&&l?.typ!=="JWT"||!l.alg||n&&(!("alg"in l)||l.alg!==n))}catch{return!1}}const GA=H("$ZodJWT",(e,n)=>{lt.init(e,n),e._zod.check=i=>{VA(i.value,n.alg)||i.issues.push({code:"invalid_format",format:"jwt",input:i.value,inst:e,continue:!n.abort})}}),Dv=H("$ZodNumber",(e,n)=>{ct.init(e,n),e._zod.pattern=e._zod.bag.pattern??zv,e._zod.parse=(i,r)=>{if(n.coerce)try{i.value=Number(i.value)}catch{}const l=i.value;if(typeof l=="number"&&!Number.isNaN(l)&&Number.isFinite(l))return i;const c=typeof l=="number"?Number.isNaN(l)?"NaN":Number.isFinite(l)?void 0:"Infinity":void 0;return i.issues.push({expected:"number",code:"invalid_type",input:l,inst:e,...c?{received:c}:{}}),i}}),IA=H("$ZodNumberFormat",(e,n)=>{sA.init(e,n),Dv.init(e,n)}),HA=H("$ZodBoolean",(e,n)=>{ct.init(e,n),e._zod.pattern=tA,e._zod.parse=(i,r)=>{if(n.coerce)try{i.value=!!i.value}catch{}const l=i.value;return typeof l=="boolean"||i.issues.push({expected:"boolean",code:"invalid_type",input:l,inst:e}),i}}),ZA=H("$ZodUnknown",(e,n)=>{ct.init(e,n),e._zod.parse=i=>i}),PA=H("$ZodNever",(e,n)=>{ct.init(e,n),e._zod.parse=(i,r)=>(i.issues.push({expected:"never",code:"invalid_type",input:i.value,inst:e}),i)});function Uy(e,n,i){e.issues.length&&n.issues.push(...Cs(i,e.issues)),n.value[i]=e.value}const KA=H("$ZodArray",(e,n)=>{ct.init(e,n),e._zod.parse=(i,r)=>{const l=i.value;if(!Array.isArray(l))return i.issues.push({expected:"array",code:"invalid_type",input:l,inst:e}),i;i.value=Array(l.length);const c=[];for(let d=0;d<l.length;d++){const m=l[d],g=n.element._zod.run({value:m,issues:[]},r);g instanceof Promise?c.push(g.then(b=>Uy(b,i,d))):Uy(g,i,d)}return c.length?Promise.all(c).then(()=>i):i}});function Fl(e,n,i,r,l){if(e.issues.length){if(l&&!(i in r))return;n.issues.push(...Cs(i,e.issues))}e.value===void 0?i in r&&(n.value[i]=void 0):n.value[i]=e.value}function Rv(e){const n=Object.keys(e.shape);for(const r of n)if(!e.shape?.[r]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${r}": expected a Zod schema`);const i=f2(e.shape);return{...e,keys:n,keySet:new Set(n),numKeys:n.length,optionalKeys:new Set(i)}}function Mv(e,n,i,r,l,c){const d=[],m=l.keySet,g=l.catchall._zod,b=g.def.type,v=g.optout==="optional";for(const S in n){if(m.has(S))continue;if(b==="never"){d.push(S);continue}const w=g.run({value:n[S],issues:[]},r);w instanceof Promise?e.push(w.then(_=>Fl(_,i,S,n,v))):Fl(w,i,S,n,v)}return d.length&&i.issues.push({code:"unrecognized_keys",keys:d,input:n,inst:c}),e.length?Promise.all(e).then(()=>i):i}const QA=H("$ZodObject",(e,n)=>{if(ct.init(e,n),!Object.getOwnPropertyDescriptor(n,"shape")?.get){const m=n.shape;Object.defineProperty(n,"shape",{get:()=>{const g={...m};return Object.defineProperty(n,"shape",{value:g}),g}})}const r=dc(()=>Rv(n));He(e._zod,"propValues",()=>{const m=n.shape,g={};for(const b in m){const v=m[b]._zod;if(v.values){g[b]??(g[b]=new Set);for(const S of v.values)g[b].add(S)}}return g});const l=io,c=n.catchall;let d;e._zod.parse=(m,g)=>{d??(d=r.value);const b=m.value;if(!l(b))return m.issues.push({expected:"object",code:"invalid_type",input:b,inst:e}),m;m.value={};const v=[],S=d.shape;for(const w of d.keys){const _=S[w],C=_._zod.optout==="optional",N=_._zod.run({value:b[w],issues:[]},g);N instanceof Promise?v.push(N.then(T=>Fl(T,m,w,b,C))):Fl(N,m,w,b,C)}return c?Mv(v,b,m,g,r.value,e):v.length?Promise.all(v).then(()=>m):m}}),YA=H("$ZodObjectJIT",(e,n)=>{QA.init(e,n);const i=e._zod.parse,r=dc(()=>Rv(n)),l=w=>{const _=new gA(["shape","payload","ctx"]),C=r.value,N=J=>{const K=qy(J);return`shape[${K}]._zod.run({ value: input[${K}], issues: [] }, ctx)`};_.write("const input = payload.value;");const T=Object.create(null);let L=0;for(const J of C.keys)T[J]=`key_${L++}`;_.write("const newResult = {};");for(const J of C.keys){const K=T[J],X=qy(J),D=w[J]?._zod?.optout==="optional";_.write(`const ${K} = ${N(J)};`),D?_.write(`
17
+ if (${K}.issues.length) {
18
+ if (${X} in input) {
19
+ payload.issues = payload.issues.concat(${K}.issues.map(iss => ({
20
+ ...iss,
21
+ path: iss.path ? [${X}, ...iss.path] : [${X}]
22
+ })));
23
+ }
24
+ }
25
+
26
+ if (${K}.value === undefined) {
27
+ if (${X} in input) {
28
+ newResult[${X}] = undefined;
29
+ }
30
+ } else {
31
+ newResult[${X}] = ${K}.value;
32
+ }
33
+
34
+ `):_.write(`
35
+ if (${K}.issues.length) {
36
+ payload.issues = payload.issues.concat(${K}.issues.map(iss => ({
37
+ ...iss,
38
+ path: iss.path ? [${X}, ...iss.path] : [${X}]
39
+ })));
40
+ }
41
+
42
+ if (${K}.value === undefined) {
43
+ if (${X} in input) {
44
+ newResult[${X}] = undefined;
45
+ }
46
+ } else {
47
+ newResult[${X}] = ${K}.value;
48
+ }
49
+
50
+ `)}_.write("payload.value = newResult;"),_.write("return payload;");const Z=_.compile();return(J,K)=>Z(w,J,K)};let c;const d=io,m=!bv.jitless,b=m&&u2.value,v=n.catchall;let S;e._zod.parse=(w,_)=>{S??(S=r.value);const C=w.value;return d(C)?m&&b&&_?.async===!1&&_.jitless!==!0?(c||(c=l(n.shape)),w=c(w,_),v?Mv([],C,w,_,S,e):w):i(w,_):(w.issues.push({expected:"object",code:"invalid_type",input:C,inst:e}),w)}});function Vy(e,n,i,r){for(const c of e)if(c.issues.length===0)return n.value=c.value,n;const l=e.filter(c=>!zs(c));return l.length===1?(n.value=l[0].value,l[0]):(n.issues.push({code:"invalid_union",input:n.value,inst:i,errors:e.map(c=>c.issues.map(d=>Pa(d,r,Za())))}),n)}const Bv=H("$ZodUnion",(e,n)=>{ct.init(e,n),He(e._zod,"optin",()=>n.options.some(l=>l._zod.optin==="optional")?"optional":void 0),He(e._zod,"optout",()=>n.options.some(l=>l._zod.optout==="optional")?"optional":void 0),He(e._zod,"values",()=>{if(n.options.every(l=>l._zod.values))return new Set(n.options.flatMap(l=>Array.from(l._zod.values)))}),He(e._zod,"pattern",()=>{if(n.options.every(l=>l._zod.pattern)){const l=n.options.map(c=>c._zod.pattern);return new RegExp(`^(${l.map(c=>Vf(c.source)).join("|")})$`)}});const i=n.options.length===1,r=n.options[0]._zod.run;e._zod.parse=(l,c)=>{if(i)return r(l,c);let d=!1;const m=[];for(const g of n.options){const b=g._zod.run({value:l.value,issues:[]},c);if(b instanceof Promise)m.push(b),d=!0;else{if(b.issues.length===0)return b;m.push(b)}}return d?Promise.all(m).then(g=>Vy(g,l,e,c)):Vy(m,l,e,c)}}),XA=H("$ZodDiscriminatedUnion",(e,n)=>{n.inclusive=!1,Bv.init(e,n);const i=e._zod.parse;He(e._zod,"propValues",()=>{const l={};for(const c of n.options){const d=c._zod.propValues;if(!d||Object.keys(d).length===0)throw new Error(`Invalid discriminated union option at index "${n.options.indexOf(c)}"`);for(const[m,g]of Object.entries(d)){l[m]||(l[m]=new Set);for(const b of g)l[m].add(b)}}return l});const r=dc(()=>{const l=n.options,c=new Map;for(const d of l){const m=d._zod.propValues?.[n.discriminator];if(!m||m.size===0)throw new Error(`Invalid discriminated union option at index "${n.options.indexOf(d)}"`);for(const g of m){if(c.has(g))throw new Error(`Duplicate discriminator value "${String(g)}"`);c.set(g,d)}}return c});e._zod.parse=(l,c)=>{const d=l.value;if(!io(d))return l.issues.push({code:"invalid_type",expected:"object",input:d,inst:e}),l;const m=r.value.get(d?.[n.discriminator]);return m?m._zod.run(l,c):n.unionFallback?i(l,c):(l.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:n.discriminator,input:d,path:[n.discriminator],inst:e}),l)}}),JA=H("$ZodIntersection",(e,n)=>{ct.init(e,n),e._zod.parse=(i,r)=>{const l=i.value,c=n.left._zod.run({value:l,issues:[]},r),d=n.right._zod.run({value:l,issues:[]},r);return c instanceof Promise||d instanceof Promise?Promise.all([c,d]).then(([g,b])=>Gy(i,g,b)):Gy(i,c,d)}});function yf(e,n){if(e===n)return{valid:!0,data:e};if(e instanceof Date&&n instanceof Date&&+e==+n)return{valid:!0,data:e};if(Ls(e)&&Ls(n)){const i=Object.keys(n),r=Object.keys(e).filter(c=>i.indexOf(c)!==-1),l={...e,...n};for(const c of r){const d=yf(e[c],n[c]);if(!d.valid)return{valid:!1,mergeErrorPath:[c,...d.mergeErrorPath]};l[c]=d.data}return{valid:!0,data:l}}if(Array.isArray(e)&&Array.isArray(n)){if(e.length!==n.length)return{valid:!1,mergeErrorPath:[]};const i=[];for(let r=0;r<e.length;r++){const l=e[r],c=n[r],d=yf(l,c);if(!d.valid)return{valid:!1,mergeErrorPath:[r,...d.mergeErrorPath]};i.push(d.data)}return{valid:!0,data:i}}return{valid:!1,mergeErrorPath:[]}}function Gy(e,n,i){const r=new Map;let l;for(const m of n.issues)if(m.code==="unrecognized_keys"){l??(l=m);for(const g of m.keys)r.has(g)||r.set(g,{}),r.get(g).l=!0}else e.issues.push(m);for(const m of i.issues)if(m.code==="unrecognized_keys")for(const g of m.keys)r.has(g)||r.set(g,{}),r.get(g).r=!0;else e.issues.push(m);const c=[...r].filter(([,m])=>m.l&&m.r).map(([m])=>m);if(c.length&&l&&e.issues.push({...l,keys:c}),zs(e))return e;const d=yf(n.value,i.value);if(!d.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(d.mergeErrorPath)}`);return e.value=d.data,e}const FA=H("$ZodRecord",(e,n)=>{ct.init(e,n),e._zod.parse=(i,r)=>{const l=i.value;if(!Ls(l))return i.issues.push({expected:"record",code:"invalid_type",input:l,inst:e}),i;const c=[],d=n.keyType._zod.values;if(d){i.value={};const m=new Set;for(const b of d)if(typeof b=="string"||typeof b=="number"||typeof b=="symbol"){m.add(typeof b=="number"?b.toString():b);const v=n.valueType._zod.run({value:l[b],issues:[]},r);v instanceof Promise?c.push(v.then(S=>{S.issues.length&&i.issues.push(...Cs(b,S.issues)),i.value[b]=S.value})):(v.issues.length&&i.issues.push(...Cs(b,v.issues)),i.value[b]=v.value)}let g;for(const b in l)m.has(b)||(g=g??[],g.push(b));g&&g.length>0&&i.issues.push({code:"unrecognized_keys",input:l,inst:e,keys:g})}else{i.value={};for(const m of Reflect.ownKeys(l)){if(m==="__proto__")continue;let g=n.keyType._zod.run({value:m,issues:[]},r);if(g instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof m=="string"&&zv.test(m)&&g.issues.length){const S=n.keyType._zod.run({value:Number(m),issues:[]},r);if(S instanceof Promise)throw new Error("Async schemas not supported in object keys currently");S.issues.length===0&&(g=S)}if(g.issues.length){n.mode==="loose"?i.value[m]=l[m]:i.issues.push({code:"invalid_key",origin:"record",issues:g.issues.map(S=>Pa(S,r,Za())),input:m,path:[m],inst:e});continue}const v=n.valueType._zod.run({value:l[m],issues:[]},r);v instanceof Promise?c.push(v.then(S=>{S.issues.length&&i.issues.push(...Cs(m,S.issues)),i.value[g.value]=S.value})):(v.issues.length&&i.issues.push(...Cs(m,v.issues)),i.value[g.value]=v.value)}}return c.length?Promise.all(c).then(()=>i):i}}),WA=H("$ZodEnum",(e,n)=>{ct.init(e,n);const i=vv(n.entries),r=new Set(i);e._zod.values=r,e._zod.pattern=new RegExp(`^(${i.filter(l=>d2.has(typeof l)).map(l=>typeof l=="string"?qs(l):l.toString()).join("|")})$`),e._zod.parse=(l,c)=>{const d=l.value;return r.has(d)||l.issues.push({code:"invalid_value",values:i,input:d,inst:e}),l}}),e_=H("$ZodLiteral",(e,n)=>{if(ct.init(e,n),n.values.length===0)throw new Error("Cannot create literal schema with no valid values");const i=new Set(n.values);e._zod.values=i,e._zod.pattern=new RegExp(`^(${n.values.map(r=>typeof r=="string"?qs(r):r?qs(r.toString()):String(r)).join("|")})$`),e._zod.parse=(r,l)=>{const c=r.value;return i.has(c)||r.issues.push({code:"invalid_value",values:n.values,input:c,inst:e}),r}}),t_=H("$ZodTransform",(e,n)=>{ct.init(e,n),e._zod.parse=(i,r)=>{if(r.direction==="backward")throw new yv(e.constructor.name);const l=n.transform(i.value,i);if(r.async)return(l instanceof Promise?l:Promise.resolve(l)).then(d=>(i.value=d,i));if(l instanceof Promise)throw new Ds;return i.value=l,i}});function Iy(e,n){return e.issues.length&&n===void 0?{issues:[],value:void 0}:e}const Lv=H("$ZodOptional",(e,n)=>{ct.init(e,n),e._zod.optin="optional",e._zod.optout="optional",He(e._zod,"values",()=>n.innerType._zod.values?new Set([...n.innerType._zod.values,void 0]):void 0),He(e._zod,"pattern",()=>{const i=n.innerType._zod.pattern;return i?new RegExp(`^(${Vf(i.source)})?$`):void 0}),e._zod.parse=(i,r)=>{if(n.innerType._zod.optin==="optional"){const l=n.innerType._zod.run(i,r);return l instanceof Promise?l.then(c=>Iy(c,i.value)):Iy(l,i.value)}return i.value===void 0?i:n.innerType._zod.run(i,r)}}),n_=H("$ZodExactOptional",(e,n)=>{Lv.init(e,n),He(e._zod,"values",()=>n.innerType._zod.values),He(e._zod,"pattern",()=>n.innerType._zod.pattern),e._zod.parse=(i,r)=>n.innerType._zod.run(i,r)}),a_=H("$ZodNullable",(e,n)=>{ct.init(e,n),He(e._zod,"optin",()=>n.innerType._zod.optin),He(e._zod,"optout",()=>n.innerType._zod.optout),He(e._zod,"pattern",()=>{const i=n.innerType._zod.pattern;return i?new RegExp(`^(${Vf(i.source)}|null)$`):void 0}),He(e._zod,"values",()=>n.innerType._zod.values?new Set([...n.innerType._zod.values,null]):void 0),e._zod.parse=(i,r)=>i.value===null?i:n.innerType._zod.run(i,r)}),i_=H("$ZodDefault",(e,n)=>{ct.init(e,n),e._zod.optin="optional",He(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(i,r)=>{if(r.direction==="backward")return n.innerType._zod.run(i,r);if(i.value===void 0)return i.value=n.defaultValue,i;const l=n.innerType._zod.run(i,r);return l instanceof Promise?l.then(c=>Hy(c,n)):Hy(l,n)}});function Hy(e,n){return e.value===void 0&&(e.value=n.defaultValue),e}const s_=H("$ZodPrefault",(e,n)=>{ct.init(e,n),e._zod.optin="optional",He(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(i,r)=>(r.direction==="backward"||i.value===void 0&&(i.value=n.defaultValue),n.innerType._zod.run(i,r))}),r_=H("$ZodNonOptional",(e,n)=>{ct.init(e,n),He(e._zod,"values",()=>{const i=n.innerType._zod.values;return i?new Set([...i].filter(r=>r!==void 0)):void 0}),e._zod.parse=(i,r)=>{const l=n.innerType._zod.run(i,r);return l instanceof Promise?l.then(c=>Zy(c,e)):Zy(l,e)}});function Zy(e,n){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:n}),e}const o_=H("$ZodCatch",(e,n)=>{ct.init(e,n),He(e._zod,"optin",()=>n.innerType._zod.optin),He(e._zod,"optout",()=>n.innerType._zod.optout),He(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(i,r)=>{if(r.direction==="backward")return n.innerType._zod.run(i,r);const l=n.innerType._zod.run(i,r);return l instanceof Promise?l.then(c=>(i.value=c.value,c.issues.length&&(i.value=n.catchValue({...i,error:{issues:c.issues.map(d=>Pa(d,r,Za()))},input:i.value}),i.issues=[]),i)):(i.value=l.value,l.issues.length&&(i.value=n.catchValue({...i,error:{issues:l.issues.map(c=>Pa(c,r,Za()))},input:i.value}),i.issues=[]),i)}}),l_=H("$ZodPipe",(e,n)=>{ct.init(e,n),He(e._zod,"values",()=>n.in._zod.values),He(e._zod,"optin",()=>n.in._zod.optin),He(e._zod,"optout",()=>n.out._zod.optout),He(e._zod,"propValues",()=>n.in._zod.propValues),e._zod.parse=(i,r)=>{if(r.direction==="backward"){const c=n.out._zod.run(i,r);return c instanceof Promise?c.then(d=>Rl(d,n.in,r)):Rl(c,n.in,r)}const l=n.in._zod.run(i,r);return l instanceof Promise?l.then(c=>Rl(c,n.out,r)):Rl(l,n.out,r)}});function Rl(e,n,i){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:e.value,issues:e.issues},i)}const c_=H("$ZodReadonly",(e,n)=>{ct.init(e,n),He(e._zod,"propValues",()=>n.innerType._zod.propValues),He(e._zod,"values",()=>n.innerType._zod.values),He(e._zod,"optin",()=>n.innerType?._zod?.optin),He(e._zod,"optout",()=>n.innerType?._zod?.optout),e._zod.parse=(i,r)=>{if(r.direction==="backward")return n.innerType._zod.run(i,r);const l=n.innerType._zod.run(i,r);return l instanceof Promise?l.then(Py):Py(l)}});function Py(e){return e.value=Object.freeze(e.value),e}const u_=H("$ZodCustom",(e,n)=>{en.init(e,n),ct.init(e,n),e._zod.parse=(i,r)=>i,e._zod.check=i=>{const r=i.value,l=n.fn(r);if(l instanceof Promise)return l.then(c=>Ky(c,i,r,e));Ky(l,i,r,e)}});function Ky(e,n,i,r){if(!e){const l={code:"custom",input:i,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(l.params=r._zod.def.params),n.issues.push(so(l))}}var Qy;class d_{constructor(){this._map=new WeakMap,this._idmap=new Map}add(n,...i){const r=i[0];return this._map.set(n,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,n),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(n){const i=this._map.get(n);return i&&typeof i=="object"&&"id"in i&&this._idmap.delete(i.id),this._map.delete(n),this}get(n){const i=n._zod.parent;if(i){const r={...this.get(i)??{}};delete r.id;const l={...r,...this._map.get(n)};return Object.keys(l).length?l:void 0}return this._map.get(n)}has(n){return this._map.has(n)}}function f_(){return new d_}(Qy=globalThis).__zod_globalRegistry??(Qy.__zod_globalRegistry=f_());const eo=globalThis.__zod_globalRegistry;function p_(e,n){return new e({type:"string",...ve(n)})}function m_(e,n){return new e({type:"string",format:"email",check:"string_format",abort:!1,...ve(n)})}function Yy(e,n){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...ve(n)})}function h_(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...ve(n)})}function g_(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ve(n)})}function y_(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ve(n)})}function b_(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ve(n)})}function v_(e,n){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ve(n)})}function S_(e,n){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...ve(n)})}function x_(e,n){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...ve(n)})}function w_(e,n){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...ve(n)})}function j_(e,n){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...ve(n)})}function N_(e,n){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...ve(n)})}function k_(e,n){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...ve(n)})}function A_(e,n){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...ve(n)})}function __(e,n){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...ve(n)})}function z_(e,n){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...ve(n)})}function C_(e,n){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ve(n)})}function T_(e,n){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ve(n)})}function E_(e,n){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...ve(n)})}function O_(e,n){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...ve(n)})}function D_(e,n){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...ve(n)})}function R_(e,n){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...ve(n)})}function M_(e,n){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ve(n)})}function B_(e,n){return new e({type:"string",format:"date",check:"string_format",...ve(n)})}function L_(e,n){return new e({type:"string",format:"time",check:"string_format",precision:null,...ve(n)})}function q_(e,n){return new e({type:"string",format:"duration",check:"string_format",...ve(n)})}function $_(e,n){return new e({type:"number",checks:[],...ve(n)})}function U_(e,n){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...ve(n)})}function V_(e,n){return new e({type:"boolean",...ve(n)})}function G_(e){return new e({type:"unknown"})}function I_(e,n){return new e({type:"never",...ve(n)})}function Xy(e,n){return new Tv({check:"less_than",...ve(n),value:e,inclusive:!1})}function Fd(e,n){return new Tv({check:"less_than",...ve(n),value:e,inclusive:!0})}function Jy(e,n){return new Ev({check:"greater_than",...ve(n),value:e,inclusive:!1})}function Wd(e,n){return new Ev({check:"greater_than",...ve(n),value:e,inclusive:!0})}function Fy(e,n){return new iA({check:"multiple_of",...ve(n),value:e})}function qv(e,n){return new rA({check:"max_length",...ve(n),maximum:e})}function Wl(e,n){return new oA({check:"min_length",...ve(n),minimum:e})}function $v(e,n){return new lA({check:"length_equals",...ve(n),length:e})}function H_(e,n){return new cA({check:"string_format",format:"regex",...ve(n),pattern:e})}function Z_(e){return new uA({check:"string_format",format:"lowercase",...ve(e)})}function P_(e){return new dA({check:"string_format",format:"uppercase",...ve(e)})}function K_(e,n){return new fA({check:"string_format",format:"includes",...ve(n),includes:e})}function Q_(e,n){return new pA({check:"string_format",format:"starts_with",...ve(n),prefix:e})}function Y_(e,n){return new mA({check:"string_format",format:"ends_with",...ve(n),suffix:e})}function Zs(e){return new hA({check:"overwrite",tx:e})}function X_(e){return Zs(n=>n.normalize(e))}function J_(){return Zs(e=>e.trim())}function F_(){return Zs(e=>e.toLowerCase())}function W_(){return Zs(e=>e.toUpperCase())}function ez(){return Zs(e=>c2(e))}function tz(e,n,i){return new e({type:"array",element:n,...ve(i)})}function nz(e,n,i){return new e({type:"custom",check:"custom",fn:n,...ve(i)})}function az(e){const n=iz(i=>(i.addIssue=r=>{if(typeof r=="string")i.issues.push(so(r,i.value,n._zod.def));else{const l=r;l.fatal&&(l.continue=!1),l.code??(l.code="custom"),l.input??(l.input=i.value),l.inst??(l.inst=n),l.continue??(l.continue=!n._zod.def.abort),i.issues.push(so(l))}},e(i.value,i)));return n}function iz(e,n){const i=new en({check:"custom",...ve(n)});return i._zod.check=e,i}function Uv(e){let n=e?.target??"draft-2020-12";return n==="draft-4"&&(n="draft-04"),n==="draft-7"&&(n="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??eo,target:n,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 Nt(e,n,i={path:[],schemaPath:[]}){var r;const l=e._zod.def,c=n.seen.get(e);if(c)return c.count++,i.schemaPath.includes(e)&&(c.cycle=i.path),c.schema;const d={schema:{},count:1,cycle:void 0,path:i.path};n.seen.set(e,d);const m=e._zod.toJSONSchema?.();if(m)d.schema=m;else{const v={...i,schemaPath:[...i.schemaPath,e],path:i.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(n,d.schema,v);else{const w=d.schema,_=n.processors[l.type];if(!_)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${l.type}`);_(e,n,w,v)}const S=e._zod.parent;S&&(d.ref||(d.ref=S),Nt(S,n,v),n.seen.get(S).isParent=!0)}const g=n.metadataRegistry.get(e);return g&&Object.assign(d.schema,g),n.io==="input"&&Vt(e)&&(delete d.schema.examples,delete d.schema.default),n.io==="input"&&d.schema._prefault&&((r=d.schema).default??(r.default=d.schema._prefault)),delete d.schema._prefault,n.seen.get(e).schema}function Vv(e,n){const i=e.seen.get(n);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const d of e.seen.entries()){const m=e.metadataRegistry.get(d[0])?.id;if(m){const g=r.get(m);if(g&&g!==d[0])throw new Error(`Duplicate schema id "${m}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(m,d[0])}}const l=d=>{const m=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const S=e.external.registry.get(d[0])?.id,w=e.external.uri??(C=>C);if(S)return{ref:w(S)};const _=d[1].defId??d[1].schema.id??`schema${e.counter++}`;return d[1].defId=_,{defId:_,ref:`${w("__shared")}#/${m}/${_}`}}if(d[1]===i)return{ref:"#"};const b=`#/${m}/`,v=d[1].schema.id??`__schema${e.counter++}`;return{defId:v,ref:b+v}},c=d=>{if(d[1].schema.$ref)return;const m=d[1],{ref:g,defId:b}=l(d);m.def={...m.schema},b&&(m.defId=b);const v=m.schema;for(const S in v)delete v[S];v.$ref=g};if(e.cycles==="throw")for(const d of e.seen.entries()){const m=d[1];if(m.cycle)throw new Error(`Cycle detected: #/${m.cycle?.join("/")}/<root>
51
+
52
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const d of e.seen.entries()){const m=d[1];if(n===d[0]){c(d);continue}if(e.external){const b=e.external.registry.get(d[0])?.id;if(n!==d[0]&&b){c(d);continue}}if(e.metadataRegistry.get(d[0])?.id){c(d);continue}if(m.cycle){c(d);continue}if(m.count>1&&e.reused==="ref"){c(d);continue}}}function Gv(e,n){const i=e.seen.get(n);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=d=>{const m=e.seen.get(d);if(m.ref===null)return;const g=m.def??m.schema,b={...g},v=m.ref;if(m.ref=null,v){r(v);const w=e.seen.get(v),_=w.schema;if(_.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(g.allOf=g.allOf??[],g.allOf.push(_)):Object.assign(g,_),Object.assign(g,b),d._zod.parent===v)for(const N in g)N==="$ref"||N==="allOf"||N in b||delete g[N];if(_.$ref&&w.def)for(const N in g)N==="$ref"||N==="allOf"||N in w.def&&JSON.stringify(g[N])===JSON.stringify(w.def[N])&&delete g[N]}const S=d._zod.parent;if(S&&S!==v){r(S);const w=e.seen.get(S);if(w?.schema.$ref&&(g.$ref=w.schema.$ref,w.def))for(const _ in g)_==="$ref"||_==="allOf"||_ in w.def&&JSON.stringify(g[_])===JSON.stringify(w.def[_])&&delete g[_]}e.override({zodSchema:d,jsonSchema:g,path:m.path??[]})};for(const d of[...e.seen.entries()].reverse())r(d[0]);const l={};if(e.target==="draft-2020-12"?l.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?l.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?l.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const d=e.external.registry.get(n)?.id;if(!d)throw new Error("Schema is missing an `id` property");l.$id=e.external.uri(d)}Object.assign(l,i.def??i.schema);const c=e.external?.defs??{};for(const d of e.seen.entries()){const m=d[1];m.def&&m.defId&&(c[m.defId]=m.def)}e.external||Object.keys(c).length>0&&(e.target==="draft-2020-12"?l.$defs=c:l.definitions=c);try{const d=JSON.parse(JSON.stringify(l));return Object.defineProperty(d,"~standard",{value:{...n["~standard"],jsonSchema:{input:ec(n,"input",e.processors),output:ec(n,"output",e.processors)}},enumerable:!1,writable:!1}),d}catch{throw new Error("Error converting schema to JSON.")}}function Vt(e,n){const i=n??{seen:new Set};if(i.seen.has(e))return!1;i.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return Vt(r.element,i);if(r.type==="set")return Vt(r.valueType,i);if(r.type==="lazy")return Vt(r.getter(),i);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return Vt(r.innerType,i);if(r.type==="intersection")return Vt(r.left,i)||Vt(r.right,i);if(r.type==="record"||r.type==="map")return Vt(r.keyType,i)||Vt(r.valueType,i);if(r.type==="pipe")return Vt(r.in,i)||Vt(r.out,i);if(r.type==="object"){for(const l in r.shape)if(Vt(r.shape[l],i))return!0;return!1}if(r.type==="union"){for(const l of r.options)if(Vt(l,i))return!0;return!1}if(r.type==="tuple"){for(const l of r.items)if(Vt(l,i))return!0;return!!(r.rest&&Vt(r.rest,i))}return!1}const sz=(e,n={})=>i=>{const r=Uv({...i,processors:n});return Nt(e,r),Vv(r,e),Gv(r,e)},ec=(e,n,i={})=>r=>{const{libraryOptions:l,target:c}=r??{},d=Uv({...l??{},target:c,io:n,processors:i});return Nt(e,d),Vv(d,e),Gv(d,e)},rz={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},oz=(e,n,i,r)=>{const l=i;l.type="string";const{minimum:c,maximum:d,format:m,patterns:g,contentEncoding:b}=e._zod.bag;if(typeof c=="number"&&(l.minLength=c),typeof d=="number"&&(l.maxLength=d),m&&(l.format=rz[m]??m,l.format===""&&delete l.format,m==="time"&&delete l.format),b&&(l.contentEncoding=b),g&&g.size>0){const v=[...g];v.length===1?l.pattern=v[0].source:v.length>1&&(l.allOf=[...v.map(S=>({...n.target==="draft-07"||n.target==="draft-04"||n.target==="openapi-3.0"?{type:"string"}:{},pattern:S.source}))])}},lz=(e,n,i,r)=>{const l=i,{minimum:c,maximum:d,format:m,multipleOf:g,exclusiveMaximum:b,exclusiveMinimum:v}=e._zod.bag;typeof m=="string"&&m.includes("int")?l.type="integer":l.type="number",typeof v=="number"&&(n.target==="draft-04"||n.target==="openapi-3.0"?(l.minimum=v,l.exclusiveMinimum=!0):l.exclusiveMinimum=v),typeof c=="number"&&(l.minimum=c,typeof v=="number"&&n.target!=="draft-04"&&(v>=c?delete l.minimum:delete l.exclusiveMinimum)),typeof b=="number"&&(n.target==="draft-04"||n.target==="openapi-3.0"?(l.maximum=b,l.exclusiveMaximum=!0):l.exclusiveMaximum=b),typeof d=="number"&&(l.maximum=d,typeof b=="number"&&n.target!=="draft-04"&&(b<=d?delete l.maximum:delete l.exclusiveMaximum)),typeof g=="number"&&(l.multipleOf=g)},cz=(e,n,i,r)=>{i.type="boolean"},uz=(e,n,i,r)=>{i.not={}},dz=(e,n,i,r)=>{},fz=(e,n,i,r)=>{const l=e._zod.def,c=vv(l.entries);c.every(d=>typeof d=="number")&&(i.type="number"),c.every(d=>typeof d=="string")&&(i.type="string"),i.enum=c},pz=(e,n,i,r)=>{const l=e._zod.def,c=[];for(const d of l.values)if(d===void 0){if(n.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof d=="bigint"){if(n.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];i.type=d===null?"null":typeof d,n.target==="draft-04"||n.target==="openapi-3.0"?i.enum=[d]:i.const=d}else c.every(d=>typeof d=="number")&&(i.type="number"),c.every(d=>typeof d=="string")&&(i.type="string"),c.every(d=>typeof d=="boolean")&&(i.type="boolean"),c.every(d=>d===null)&&(i.type="null"),i.enum=c},mz=(e,n,i,r)=>{if(n.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},hz=(e,n,i,r)=>{if(n.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},gz=(e,n,i,r)=>{const l=i,c=e._zod.def,{minimum:d,maximum:m}=e._zod.bag;typeof d=="number"&&(l.minItems=d),typeof m=="number"&&(l.maxItems=m),l.type="array",l.items=Nt(c.element,n,{...r,path:[...r.path,"items"]})},yz=(e,n,i,r)=>{const l=i,c=e._zod.def;l.type="object",l.properties={};const d=c.shape;for(const b in d)l.properties[b]=Nt(d[b],n,{...r,path:[...r.path,"properties",b]});const m=new Set(Object.keys(d)),g=new Set([...m].filter(b=>{const v=c.shape[b]._zod;return n.io==="input"?v.optin===void 0:v.optout===void 0}));g.size>0&&(l.required=Array.from(g)),c.catchall?._zod.def.type==="never"?l.additionalProperties=!1:c.catchall?c.catchall&&(l.additionalProperties=Nt(c.catchall,n,{...r,path:[...r.path,"additionalProperties"]})):n.io==="output"&&(l.additionalProperties=!1)},bz=(e,n,i,r)=>{const l=e._zod.def,c=l.inclusive===!1,d=l.options.map((m,g)=>Nt(m,n,{...r,path:[...r.path,c?"oneOf":"anyOf",g]}));c?i.oneOf=d:i.anyOf=d},vz=(e,n,i,r)=>{const l=e._zod.def,c=Nt(l.left,n,{...r,path:[...r.path,"allOf",0]}),d=Nt(l.right,n,{...r,path:[...r.path,"allOf",1]}),m=b=>"allOf"in b&&Object.keys(b).length===1,g=[...m(c)?c.allOf:[c],...m(d)?d.allOf:[d]];i.allOf=g},Sz=(e,n,i,r)=>{const l=i,c=e._zod.def;l.type="object";const d=c.keyType,g=d._zod.bag?.patterns;if(c.mode==="loose"&&g&&g.size>0){const v=Nt(c.valueType,n,{...r,path:[...r.path,"patternProperties","*"]});l.patternProperties={};for(const S of g)l.patternProperties[S.source]=v}else(n.target==="draft-07"||n.target==="draft-2020-12")&&(l.propertyNames=Nt(c.keyType,n,{...r,path:[...r.path,"propertyNames"]})),l.additionalProperties=Nt(c.valueType,n,{...r,path:[...r.path,"additionalProperties"]});const b=d._zod.values;if(b){const v=[...b].filter(S=>typeof S=="string"||typeof S=="number");v.length>0&&(l.required=v)}},xz=(e,n,i,r)=>{const l=e._zod.def,c=Nt(l.innerType,n,r),d=n.seen.get(e);n.target==="openapi-3.0"?(d.ref=l.innerType,i.nullable=!0):i.anyOf=[c,{type:"null"}]},wz=(e,n,i,r)=>{const l=e._zod.def;Nt(l.innerType,n,r);const c=n.seen.get(e);c.ref=l.innerType},jz=(e,n,i,r)=>{const l=e._zod.def;Nt(l.innerType,n,r);const c=n.seen.get(e);c.ref=l.innerType,i.default=JSON.parse(JSON.stringify(l.defaultValue))},Nz=(e,n,i,r)=>{const l=e._zod.def;Nt(l.innerType,n,r);const c=n.seen.get(e);c.ref=l.innerType,n.io==="input"&&(i._prefault=JSON.parse(JSON.stringify(l.defaultValue)))},kz=(e,n,i,r)=>{const l=e._zod.def;Nt(l.innerType,n,r);const c=n.seen.get(e);c.ref=l.innerType;let d;try{d=l.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}i.default=d},Az=(e,n,i,r)=>{const l=e._zod.def,c=n.io==="input"?l.in._zod.def.type==="transform"?l.out:l.in:l.out;Nt(c,n,r);const d=n.seen.get(e);d.ref=c},_z=(e,n,i,r)=>{const l=e._zod.def;Nt(l.innerType,n,r);const c=n.seen.get(e);c.ref=l.innerType,i.readOnly=!0},Iv=(e,n,i,r)=>{const l=e._zod.def;Nt(l.innerType,n,r);const c=n.seen.get(e);c.ref=l.innerType},zz=H("ZodISODateTime",(e,n)=>{CA.init(e,n),dt.init(e,n)});function Cz(e){return M_(zz,e)}const Tz=H("ZodISODate",(e,n)=>{TA.init(e,n),dt.init(e,n)});function Ez(e){return B_(Tz,e)}const Oz=H("ZodISOTime",(e,n)=>{EA.init(e,n),dt.init(e,n)});function Dz(e){return L_(Oz,e)}const Rz=H("ZodISODuration",(e,n)=>{OA.init(e,n),dt.init(e,n)});function Mz(e){return q_(Rz,e)}const Bz=(e,n)=>{jv.init(e,n),e.name="ZodError",Object.defineProperties(e,{format:{value:i=>w2(e,i)},flatten:{value:i=>x2(e,i)},addIssue:{value:i=>{e.issues.push(i),e.message=JSON.stringify(e.issues,gf,2)}},addIssues:{value:i=>{e.issues.push(...i),e.message=JSON.stringify(e.issues,gf,2)}},isEmpty:{get(){return e.issues.length===0}}})},kn=H("ZodError",Bz,{Parent:Error}),Lz=If(kn),qz=Hf(kn),$z=fc(kn),Uz=pc(kn),Vz=k2(kn),Gz=A2(kn),Iz=_2(kn),Hz=z2(kn),Zz=C2(kn),Pz=T2(kn),Kz=E2(kn),Qz=O2(kn),ut=H("ZodType",(e,n)=>(ct.init(e,n),Object.assign(e["~standard"],{jsonSchema:{input:ec(e,"input"),output:ec(e,"output")}}),e.toJSONSchema=sz(e,{}),e.def=n,e.type=n.type,Object.defineProperty(e,"_def",{value:n}),e.check=(...i)=>e.clone(Qa(n,{checks:[...n.checks??[],...i.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0}),e.with=e.check,e.clone=(i,r)=>Ya(e,i,r),e.brand=()=>e,e.register=((i,r)=>(i.add(e,r),e)),e.parse=(i,r)=>Lz(e,i,r,{callee:e.parse}),e.safeParse=(i,r)=>$z(e,i,r),e.parseAsync=async(i,r)=>qz(e,i,r,{callee:e.parseAsync}),e.safeParseAsync=async(i,r)=>Uz(e,i,r),e.spa=e.safeParseAsync,e.encode=(i,r)=>Vz(e,i,r),e.decode=(i,r)=>Gz(e,i,r),e.encodeAsync=async(i,r)=>Iz(e,i,r),e.decodeAsync=async(i,r)=>Hz(e,i,r),e.safeEncode=(i,r)=>Zz(e,i,r),e.safeDecode=(i,r)=>Pz(e,i,r),e.safeEncodeAsync=async(i,r)=>Kz(e,i,r),e.safeDecodeAsync=async(i,r)=>Qz(e,i,r),e.refine=(i,r)=>e.check(VC(i,r)),e.superRefine=i=>e.check(GC(i)),e.overwrite=i=>e.check(Zs(i)),e.optional=()=>tb(e),e.exactOptional=()=>zC(e),e.nullable=()=>nb(e),e.nullish=()=>tb(nb(e)),e.nonoptional=i=>RC(e,i),e.array=()=>E(e),e.or=i=>Kv([e,i]),e.and=i=>wC(e,i),e.transform=i=>ab(e,AC(i)),e.default=i=>EC(e,i),e.prefault=i=>DC(e,i),e.catch=i=>BC(e,i),e.pipe=i=>ab(e,i),e.readonly=()=>$C(e),e.describe=i=>{const r=e.clone();return eo.add(r,{description:i}),r},Object.defineProperty(e,"description",{get(){return eo.get(e)?.description},configurable:!0}),e.meta=(...i)=>{if(i.length===0)return eo.get(e);const r=e.clone();return eo.add(r,i[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=i=>i(e),e)),Hv=H("_ZodString",(e,n)=>{Zf.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(r,l,c)=>oz(e,r,l);const i=e._zod.bag;e.format=i.format??null,e.minLength=i.minimum??null,e.maxLength=i.maximum??null,e.regex=(...r)=>e.check(H_(...r)),e.includes=(...r)=>e.check(K_(...r)),e.startsWith=(...r)=>e.check(Q_(...r)),e.endsWith=(...r)=>e.check(Y_(...r)),e.min=(...r)=>e.check(Wl(...r)),e.max=(...r)=>e.check(qv(...r)),e.length=(...r)=>e.check($v(...r)),e.nonempty=(...r)=>e.check(Wl(1,...r)),e.lowercase=r=>e.check(Z_(r)),e.uppercase=r=>e.check(P_(r)),e.trim=()=>e.check(J_()),e.normalize=(...r)=>e.check(X_(...r)),e.toLowerCase=()=>e.check(F_()),e.toUpperCase=()=>e.check(W_()),e.slugify=()=>e.check(ez())}),Yz=H("ZodString",(e,n)=>{Zf.init(e,n),Hv.init(e,n),e.email=i=>e.check(m_(Xz,i)),e.url=i=>e.check(v_(Jz,i)),e.jwt=i=>e.check(R_(fC,i)),e.emoji=i=>e.check(S_(Fz,i)),e.guid=i=>e.check(Yy(Wy,i)),e.uuid=i=>e.check(h_(Ml,i)),e.uuidv4=i=>e.check(g_(Ml,i)),e.uuidv6=i=>e.check(y_(Ml,i)),e.uuidv7=i=>e.check(b_(Ml,i)),e.nanoid=i=>e.check(x_(Wz,i)),e.guid=i=>e.check(Yy(Wy,i)),e.cuid=i=>e.check(w_(eC,i)),e.cuid2=i=>e.check(j_(tC,i)),e.ulid=i=>e.check(N_(nC,i)),e.base64=i=>e.check(E_(cC,i)),e.base64url=i=>e.check(O_(uC,i)),e.xid=i=>e.check(k_(aC,i)),e.ksuid=i=>e.check(A_(iC,i)),e.ipv4=i=>e.check(__(sC,i)),e.ipv6=i=>e.check(z_(rC,i)),e.cidrv4=i=>e.check(C_(oC,i)),e.cidrv6=i=>e.check(T_(lC,i)),e.e164=i=>e.check(D_(dC,i)),e.datetime=i=>e.check(Cz(i)),e.date=i=>e.check(Ez(i)),e.time=i=>e.check(Dz(i)),e.duration=i=>e.check(Mz(i))});function h(e){return p_(Yz,e)}const dt=H("ZodStringFormat",(e,n)=>{lt.init(e,n),Hv.init(e,n)}),Xz=H("ZodEmail",(e,n)=>{SA.init(e,n),dt.init(e,n)}),Wy=H("ZodGUID",(e,n)=>{bA.init(e,n),dt.init(e,n)}),Ml=H("ZodUUID",(e,n)=>{vA.init(e,n),dt.init(e,n)}),Jz=H("ZodURL",(e,n)=>{xA.init(e,n),dt.init(e,n)}),Fz=H("ZodEmoji",(e,n)=>{wA.init(e,n),dt.init(e,n)}),Wz=H("ZodNanoID",(e,n)=>{jA.init(e,n),dt.init(e,n)}),eC=H("ZodCUID",(e,n)=>{NA.init(e,n),dt.init(e,n)}),tC=H("ZodCUID2",(e,n)=>{kA.init(e,n),dt.init(e,n)}),nC=H("ZodULID",(e,n)=>{AA.init(e,n),dt.init(e,n)}),aC=H("ZodXID",(e,n)=>{_A.init(e,n),dt.init(e,n)}),iC=H("ZodKSUID",(e,n)=>{zA.init(e,n),dt.init(e,n)}),sC=H("ZodIPv4",(e,n)=>{DA.init(e,n),dt.init(e,n)}),rC=H("ZodIPv6",(e,n)=>{RA.init(e,n),dt.init(e,n)}),oC=H("ZodCIDRv4",(e,n)=>{MA.init(e,n),dt.init(e,n)}),lC=H("ZodCIDRv6",(e,n)=>{BA.init(e,n),dt.init(e,n)}),cC=H("ZodBase64",(e,n)=>{LA.init(e,n),dt.init(e,n)}),uC=H("ZodBase64URL",(e,n)=>{$A.init(e,n),dt.init(e,n)}),dC=H("ZodE164",(e,n)=>{UA.init(e,n),dt.init(e,n)}),fC=H("ZodJWT",(e,n)=>{GA.init(e,n),dt.init(e,n)}),Zv=H("ZodNumber",(e,n)=>{Dv.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(r,l,c)=>lz(e,r,l),e.gt=(r,l)=>e.check(Jy(r,l)),e.gte=(r,l)=>e.check(Wd(r,l)),e.min=(r,l)=>e.check(Wd(r,l)),e.lt=(r,l)=>e.check(Xy(r,l)),e.lte=(r,l)=>e.check(Fd(r,l)),e.max=(r,l)=>e.check(Fd(r,l)),e.int=r=>e.check(eb(r)),e.safe=r=>e.check(eb(r)),e.positive=r=>e.check(Jy(0,r)),e.nonnegative=r=>e.check(Wd(0,r)),e.negative=r=>e.check(Xy(0,r)),e.nonpositive=r=>e.check(Fd(0,r)),e.multipleOf=(r,l)=>e.check(Fy(r,l)),e.step=(r,l)=>e.check(Fy(r,l)),e.finite=()=>e;const i=e._zod.bag;e.minValue=Math.max(i.minimum??Number.NEGATIVE_INFINITY,i.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(i.maximum??Number.POSITIVE_INFINITY,i.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(i.format??"").includes("int")||Number.isSafeInteger(i.multipleOf??.5),e.isFinite=!0,e.format=i.format??null});function j(e){return $_(Zv,e)}const pC=H("ZodNumberFormat",(e,n)=>{IA.init(e,n),Zv.init(e,n)});function eb(e){return U_(pC,e)}const mC=H("ZodBoolean",(e,n)=>{HA.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(i,r,l)=>cz(e,i,r)});function ye(e){return V_(mC,e)}const hC=H("ZodUnknown",(e,n)=>{ZA.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(i,r,l)=>dz()});function wi(){return G_(hC)}const gC=H("ZodNever",(e,n)=>{PA.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(i,r,l)=>uz(e,i,r)});function yC(e){return I_(gC,e)}const bC=H("ZodArray",(e,n)=>{KA.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(i,r,l)=>gz(e,i,r,l),e.element=n.element,e.min=(i,r)=>e.check(Wl(i,r)),e.nonempty=i=>e.check(Wl(1,i)),e.max=(i,r)=>e.check(qv(i,r)),e.length=(i,r)=>e.check($v(i,r)),e.unwrap=()=>e.element});function E(e,n){return tz(bC,e,n)}const vC=H("ZodObject",(e,n)=>{YA.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(i,r,l)=>yz(e,i,r,l),He(e,"shape",()=>n.shape),e.keyof=()=>re(Object.keys(e._zod.def.shape)),e.catchall=i=>e.clone({...e._zod.def,catchall:i}),e.passthrough=()=>e.clone({...e._zod.def,catchall:wi()}),e.loose=()=>e.clone({...e._zod.def,catchall:wi()}),e.strict=()=>e.clone({...e._zod.def,catchall:yC()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=i=>g2(e,i),e.safeExtend=i=>y2(e,i),e.merge=i=>b2(e,i),e.pick=i=>m2(e,i),e.omit=i=>h2(e,i),e.partial=(...i)=>v2(Yv,e,i[0]),e.required=(...i)=>S2(Xv,e,i[0])});function k(e,n){const i={type:"object",shape:e??{},...ve(n)};return new vC(i)}const Pv=H("ZodUnion",(e,n)=>{Bv.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(i,r,l)=>bz(e,i,r,l),e.options=n.options});function Kv(e,n){return new Pv({type:"union",options:e,...ve(n)})}const SC=H("ZodDiscriminatedUnion",(e,n)=>{Pv.init(e,n),XA.init(e,n)});function Qv(e,n,i){return new SC({type:"union",options:n,discriminator:e,...ve(i)})}const xC=H("ZodIntersection",(e,n)=>{JA.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(i,r,l)=>vz(e,i,r,l)});function wC(e,n){return new xC({type:"intersection",left:e,right:n})}const jC=H("ZodRecord",(e,n)=>{FA.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(i,r,l)=>Sz(e,i,r,l),e.keyType=n.keyType,e.valueType=n.valueType});function Zn(e,n,i){return new jC({type:"record",keyType:e,valueType:n,...ve(i)})}const bf=H("ZodEnum",(e,n)=>{WA.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(r,l,c)=>fz(e,r,l),e.enum=n.entries,e.options=Object.values(n.entries);const i=new Set(Object.keys(n.entries));e.extract=(r,l)=>{const c={};for(const d of r)if(i.has(d))c[d]=n.entries[d];else throw new Error(`Key ${d} not found in enum`);return new bf({...n,checks:[],...ve(l),entries:c})},e.exclude=(r,l)=>{const c={...n.entries};for(const d of r)if(i.has(d))delete c[d];else throw new Error(`Key ${d} not found in enum`);return new bf({...n,checks:[],...ve(l),entries:c})}});function re(e,n){const i=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new bf({type:"enum",entries:i,...ve(n)})}const NC=H("ZodLiteral",(e,n)=>{e_.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(i,r,l)=>pz(e,i,r),e.values=new Set(n.values),Object.defineProperty(e,"value",{get(){if(n.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return n.values[0]}})});function Wt(e,n){return new NC({type:"literal",values:Array.isArray(e)?e:[e],...ve(n)})}const kC=H("ZodTransform",(e,n)=>{t_.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(i,r,l)=>hz(e,i),e._zod.parse=(i,r)=>{if(r.direction==="backward")throw new yv(e.constructor.name);i.addIssue=c=>{if(typeof c=="string")i.issues.push(so(c,i.value,n));else{const d=c;d.fatal&&(d.continue=!1),d.code??(d.code="custom"),d.input??(d.input=i.value),d.inst??(d.inst=e),i.issues.push(so(d))}};const l=n.transform(i.value,i);return l instanceof Promise?l.then(c=>(i.value=c,i)):(i.value=l,i)}});function AC(e){return new kC({type:"transform",transform:e})}const Yv=H("ZodOptional",(e,n)=>{Lv.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(i,r,l)=>Iv(e,i,r,l),e.unwrap=()=>e._zod.def.innerType});function tb(e){return new Yv({type:"optional",innerType:e})}const _C=H("ZodExactOptional",(e,n)=>{n_.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(i,r,l)=>Iv(e,i,r,l),e.unwrap=()=>e._zod.def.innerType});function zC(e){return new _C({type:"optional",innerType:e})}const CC=H("ZodNullable",(e,n)=>{a_.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(i,r,l)=>xz(e,i,r,l),e.unwrap=()=>e._zod.def.innerType});function nb(e){return new CC({type:"nullable",innerType:e})}const TC=H("ZodDefault",(e,n)=>{i_.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(i,r,l)=>jz(e,i,r,l),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function EC(e,n){return new TC({type:"default",innerType:e,get defaultValue(){return typeof n=="function"?n():xv(n)}})}const OC=H("ZodPrefault",(e,n)=>{s_.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(i,r,l)=>Nz(e,i,r,l),e.unwrap=()=>e._zod.def.innerType});function DC(e,n){return new OC({type:"prefault",innerType:e,get defaultValue(){return typeof n=="function"?n():xv(n)}})}const Xv=H("ZodNonOptional",(e,n)=>{r_.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(i,r,l)=>wz(e,i,r,l),e.unwrap=()=>e._zod.def.innerType});function RC(e,n){return new Xv({type:"nonoptional",innerType:e,...ve(n)})}const MC=H("ZodCatch",(e,n)=>{o_.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(i,r,l)=>kz(e,i,r,l),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function BC(e,n){return new MC({type:"catch",innerType:e,catchValue:typeof n=="function"?n:()=>n})}const LC=H("ZodPipe",(e,n)=>{l_.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(i,r,l)=>Az(e,i,r,l),e.in=n.in,e.out=n.out});function ab(e,n){return new LC({type:"pipe",in:e,out:n})}const qC=H("ZodReadonly",(e,n)=>{c_.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(i,r,l)=>_z(e,i,r,l),e.unwrap=()=>e._zod.def.innerType});function $C(e){return new qC({type:"readonly",innerType:e})}const UC=H("ZodCustom",(e,n)=>{u_.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(i,r,l)=>mz(e,i)});function VC(e,n={}){return nz(UC,e,n)}function GC(e){return az(e)}const IC=k({maxConcurrency:j().int().positive(),maxRequestsPerMinute:j().int().positive(),maxRequestsPerDay:j().int().positive()}),ha=h().min(1);h().min(1);const Pf=k({label:h().min(1),city:h().min(1),region:h().min(1),country:h().length(2),timezone:h().optional()}),Kf=re(["citation.lost","citation.gained","run.completed","run.failed","insight.critical","insight.high"]);k({id:h(),projectId:h(),channel:Wt("webhook"),url:h().url(),urlDisplay:h(),urlHost:h(),events:E(Kf),enabled:ye().default(!0),source:h().optional(),webhookSecret:h().optional(),createdAt:h(),updatedAt:h()});k({channel:Wt("webhook"),url:h().url(),events:E(Kf).min(1),source:h().optional()});const Jv=re(["cli","api","config-file"]);function HC(e){const n=new Set,i=new Set;for(const r of e){if(n.has(r.label)){i.add(r.label);continue}n.add(r.label)}return[...i]}function ZC(e,n){return n?e.some(i=>i.label===n):!0}k({displayName:h().min(1),canonicalDomain:h().min(1),ownedDomains:E(h().min(1)).optional(),aliases:E(h()).optional(),country:h().length(2),language:h().min(2),tags:E(h()).optional(),labels:Zn(h(),h()).optional(),providers:E(ha).optional(),locations:E(Pf).optional(),defaultLocation:h().nullable().optional(),autoExtractBacklinks:ye().optional(),configSource:Jv.optional()});k({id:h(),name:h(),displayName:h().optional(),canonicalDomain:h(),ownedDomains:E(h()).default([]),aliases:E(h()).default([]),country:h().length(2),language:h().min(2),tags:E(h()).default([]),labels:Zn(h(),h()).default({}),providers:E(h()).default([]),locations:E(Pf).default([]),defaultLocation:h().nullable().optional(),autoExtractBacklinks:ye().default(!1),configSource:Jv.default("cli"),configRevision:j().int().positive().default(1),createdAt:h().optional(),updatedAt:h().optional()});k({id:h(),query:h(),createdAt:h()});k({id:h(),keyword:h(),createdAt:h()});k({queries:E(h().trim().min(1)).min(1)});k({keywords:E(h().trim().min(1)).min(1)});k({provider:ha,count:j().int().min(1).max(20).optional()});k({id:h(),domain:h(),createdAt:h()});k({competitors:E(h().trim().min(1)).min(1)});function tc(e){let n=e.trim().toLowerCase();try{n.includes("://")&&(n=new URL(n).hostname.toLowerCase())}catch{}return n.replace(/^www\./,"")}const PC=new Set(["ac.uk","co.id","co.il","co.in","co.jp","co.kr","co.nz","co.th","co.uk","co.za","com.au","com.br","com.cn","com.mx","com.ph","com.sg","com.tr","edu.au","edu.sg","gov.au","gov.uk","me.uk","ne.jp","net.au","net.br","net.cn","net.in","net.tr","or.jp","or.kr","org.au","org.br","org.in","org.nz","org.tr","org.uk","org.za"]);function KC(e){const n=tc(e);if(!n)return"";const i=n.split("/")[0]?.split(":")[0]??"";if(!i)return"";const r=i.split(".").filter(Boolean);if(r.length<2)return"";if(r.length===2)return r.join(".");const l=r.slice(-2).join(".");return PC.has(l)?r.length>=3?r.slice(-3).join("."):"":r.slice(-2).join(".")}function QC(e){const n=KC(e);return n?n.split(".")[0]??"":""}function YC(e){const n=[e.canonicalDomain,...e.ownedDomains??[]],i=new Set,r=[];for(const l of n){const c=l.trim();if(!c)continue;const d=tc(c);i.has(d)||(i.add(d),r.push(c))}return r}const XC=k({name:h().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:Zn(h(),h()).optional().default({})}),JC=k({preset:h().optional(),cron:h().optional(),timezone:h().optional().default("UTC"),providers:E(ha).optional().default([])}).refine(e=>e.preset&&!e.cron||!e.preset&&e.cron,{message:'Exactly one of "preset" or "cron" must be provided'}).optional(),FC=k({channel:Wt("webhook"),url:h().url(),events:E(Kf).min(1)}),WC=k({gsc:k({propertyUrl:h()}).optional(),syncSchedule:k({preset:h().optional(),cron:h().optional()}).optional()}).optional(),ib=E(h().min(1)),eT=k({displayName:h().min(1),canonicalDomain:h().min(1),ownedDomains:E(h().min(1)).optional().default([]),aliases:E(h().min(1)).optional().default([]),country:h().length(2),language:h().min(2),queries:ib.optional(),keywords:ib.optional(),competitors:E(h().min(1)).optional().default([]),providers:E(ha).optional().default([]),locations:E(Pf).optional().default([]),defaultLocation:h().optional(),schedule:JC,notifications:E(FC).optional().default([]),google:WC,autoExtractBacklinks:ye().optional().default(!1)}).superRefine((e,n)=>{e.queries!==void 0&&e.keywords!==void 0&&n.addIssue({code:"custom",message:"Use spec.queries; spec.keywords is accepted only as a legacy alias when spec.queries is omitted",path:["keywords"]});const i=HC(e.locations);i.length>0&&n.addIssue({code:"custom",message:`Duplicate location labels are not allowed: ${i.join(", ")}`,path:["locations"]}),ZC(e.locations,e.defaultLocation)||n.addIssue({code:"custom",message:`defaultLocation "${e.defaultLocation}" must match a configured location label`,path:["defaultLocation"]})});k({apiVersion:Wt("canonry/v1"),kind:Wt("Project"),metadata:XC,spec:eT});const tT=re(["gsc","ga4"]);k({id:h(),domain:h(),connectionType:tT,propertyId:h().nullable().optional(),sitemapUrl:h().nullable().optional(),scopes:E(h()).default([]),createdAt:h(),updatedAt:h()});k({date:h(),query:h(),page:h(),country:h().nullable().optional(),device:h().nullable().optional(),clicks:j(),impressions:j(),ctr:j(),position:j()});const nT=k({date:h(),clicks:j(),impressions:j(),ctr:j()});k({totals:k({clicks:j(),impressions:j(),ctr:j(),days:j()}),daily:E(nT)});const vf=k({id:h(),url:h(),indexingState:h().nullable().optional(),verdict:h().nullable().optional(),coverageState:h().nullable().optional(),pageFetchState:h().nullable().optional(),robotsTxtState:h().nullable().optional(),crawlTime:h().nullable().optional(),lastCrawlResult:h().nullable().optional(),isMobileFriendly:ye().nullable().optional(),richResults:E(h()).default([]),referringUrls:E(h()).default([]),inspectedAt:h()});re(["stable","reindexed","deindexed","still-missing","new"]);const aT=k({url:h(),previousState:h().nullable(),currentState:h().nullable(),transitionDate:h()}),iT=k({reason:h(),count:j(),urls:E(vf).default([])});k({summary:k({total:j(),indexed:j(),notIndexed:j(),deindexed:j(),percentage:j()}),lastInspectedAt:h().nullable(),lastSyncedAt:h().nullable(),indexed:E(vf).default([]),notIndexed:E(vf).default([]),deindexed:E(aT).default([]),reasonGroups:E(iT).default([])});k({url:h(),type:re(["URL_UPDATED","URL_DELETED"]),notifiedAt:h()});const sT=k({url:h(),type:re(["URL_UPDATED","URL_DELETED"]),notifiedAt:h(),status:re(["success","error"]),error:h().optional()});k({summary:k({total:j().int().nonnegative(),succeeded:j().int().nonnegative(),failed:j().int().nonnegative()}),results:E(sT).default([])});k({date:h(),indexed:j(),notIndexed:j(),reasonBreakdown:Zn(h(),j()).default({})});const rT=k({siteUrl:h(),permissionLevel:h()});k({sites:E(rT).default([])});const oT=k({type:h(),submitted:h(),indexed:h()}),lT=k({path:h(),lastSubmitted:h().optional(),isPending:ye().optional(),isSitemapsIndex:ye().optional(),type:h().optional(),lastDownloaded:h().optional(),warnings:h().optional(),errors:h().optional(),contents:E(oT).optional()});k({sitemaps:E(lT).default([])});k({id:h(),domain:h(),siteUrl:h().nullable().optional(),createdAt:h(),updatedAt:h()});const ef=k({id:h(),url:h(),httpCode:j().nullable().optional(),inIndex:ye().nullable().optional(),lastCrawledDate:h().nullable().optional(),inIndexDate:h().nullable().optional(),inspectedAt:h(),documentSize:j().nullable().optional(),anchorCount:j().nullable().optional(),discoveryDate:h().nullable().optional()});k({summary:k({total:j(),indexed:j(),notIndexed:j(),unknown:j().optional(),percentage:j()}),lastInspectedAt:h().nullable(),indexed:E(ef).default([]),notIndexed:E(ef).default([]),unknown:E(ef).default([]).optional()});k({query:h(),impressions:j(),clicks:j(),ctr:j(),averagePosition:j()});k({date:h(),indexed:j(),notIndexed:j(),unknown:j()});const cT=k({url:h(),status:re(["success","error"]),submittedAt:h(),error:h().optional()});k({summary:k({total:j().int().nonnegative(),succeeded:j().int().nonnegative(),failed:j().int().nonnegative()}),results:E(cT).default([])});const Fv=k({url:h(),verified:ye()});k({sites:E(Fv).default([])});k({connected:ye(),domain:h(),siteUrl:h().nullable(),createdAt:h().nullable(),updatedAt:h().nullable()});k({connected:ye(),domain:h(),siteUrl:h().nullable(),availableSites:E(Fv).default([])});k({siteUrl:h()});const uT=k({name:h(),alive:ye(),lastUsed:h().nullable()});k({connected:ye(),endpoint:h(),version:h().optional(),browserVersion:h().optional(),targets:E(uT).default([])});const Ps=re(["live","staging"]);k({projectName:h(),url:h(),stagingUrl:h().optional(),username:h(),defaultEnv:Ps,createdAt:h(),updatedAt:h()});const sb=k({url:h(),reachable:ye(),pageCount:j().nullable().optional(),version:h().nullable().optional(),error:h().nullable().optional(),plugins:E(h()).optional(),authenticatedUser:k({id:j(),slug:h()}).nullable().optional()});k({connected:ye(),projectName:h(),defaultEnv:Ps,live:sb.nullable(),staging:sb.nullable(),adminUrl:h().nullable().optional()});const dT=k({id:j(),slug:h(),title:h(),status:h(),modifiedAt:h().nullable().optional(),link:h().nullable().optional()}),Wv=k({title:h().nullable(),description:h().nullable(),noindex:ye().nullable(),writable:ye().default(!1),writeTargets:E(h()).default([])}),fT=k({type:h(),json:Zn(h(),wi())}),pT=dT.extend({env:Ps,content:h(),seo:Wv,schemaBlocks:E(fT).default([])}),rb=pT.extend({contentHash:h(),contentSnippet:h()}),e0=k({manualRequired:Wt(!0),targetUrl:h(),adminUrl:h().nullable().optional(),content:h(),nextSteps:E(h()).default([])}),mT=k({slug:h(),severity:re(["high","medium","low"]),code:re(["noindex","missing-seo-title","missing-meta-description","missing-schema","thin-content"]),message:h()});k({slug:h(),title:h(),status:h(),wordCount:j(),seo:Wv,schemaPresent:ye(),issues:E(mT).default([])});const hT=k({slug:h(),status:re(["applied","skipped","manual"]),error:h().optional(),manualAssist:e0.optional()});k({env:Ps,strategy:re(["plugin","manual"]),results:E(hT)});const gT=k({slug:h(),status:re(["deployed","stripped","skipped","failed"]),schemasInjected:E(h()).optional(),manualAssist:e0.optional(),error:h().optional()});k({env:Ps,results:E(gT)});const yT=k({slug:h(),title:h(),canonrySchemas:E(h()),thirdPartySchemas:E(h()),hasCanonrySchema:ye()});k({env:Ps,pages:E(yT)});const bT=k({name:h(),status:re(["completed","skipped","failed"]),summary:h().optional(),error:h().optional()});k({projectName:h(),steps:E(bT)});k({slug:h(),live:rb,staging:rb,hasDifferences:ye(),differences:k({title:ye(),slug:ye(),content:ye(),seoTitle:ye(),seoDescription:ye(),noindex:ye(),schema:ye()})});const vT=k({name:h(),displayName:h().optional(),keyUrl:h().optional(),modelHint:h().optional(),model:h().optional(),configured:ye(),quota:IC.optional(),vertexConfigured:ye().optional()}),ob=k({configured:ye()});k({providers:E(vT).default([]),google:ob,bing:ob});const hc=re(["queued","running","completed","partial","failed","cancelled"]),It=hc.enum,t0=re(["answer-visibility","site-audit","gsc-sync","inspect-sitemap","ga-sync","bing-inspect","bing-inspect-sitemap","backlink-extract","traffic-sync","aeo-discover-seed","aeo-discover-probe"]),Te=t0.enum,n0=re(["manual","scheduled","config-apply","backfill","probe"]),Rs=n0.enum,ji=re(["cited","not-cited"]),nc=ji.enum,ac=re(["visible","not-visible"]);ac.enum;const ic=re(["mentioned","not-mentioned"]);ic.enum;const a0=re(["new","cited","lost","emerging","not-cited"]);a0.enum;const ST=re(["new","mentioned","lost","emerging","not-mentioned"]);ST.enum;const xT=re([Rs.manual,Rs.probe]);k({kind:Wt(Te["answer-visibility"]).optional(),trigger:xT.optional(),providers:E(ha).optional(),queries:E(h().min(1)).min(1).optional(),location:h().min(1).optional(),allLocations:ye().optional(),noLocation:ye().optional()}).refine(e=>+!!e.location+ +!!e.allLocations+ +!!e.noLocation<=1,{message:'Only one of "location", "allLocations", or "noLocation" may be provided'});const wT=k({message:h(),raw:wi().optional()}),jT=k({message:h().optional(),providers:Zn(h(),wT).optional()}),NT=k({id:h(),projectId:h(),kind:t0,status:hc,trigger:n0.default("manual"),location:h().nullable().optional(),queries:E(h()).nullable().optional(),startedAt:h().nullable().optional(),finishedAt:h().nullable().optional(),error:jT.nullable().optional(),createdAt:h()});function Qf(e){if(e.providers){const n=Object.entries(e.providers);if(n.length===1){const[i,r]=n[0];return`${i}: ${r.message}`}if(n.length>1)return n.map(([i,r])=>`${i}: ${r.message}`).join(" • ")}return e.message??"Run failed."}const i0=k({uri:h(),title:h()}),s0=k({id:h(),runId:h(),queryId:h(),query:h().optional(),provider:ha,citationState:ji,answerMentioned:ye().optional(),visibilityState:ac.optional(),mentionState:ic.optional(),transition:a0.optional(),answerText:h().nullable().optional(),citedDomains:E(h()).default([]),competitorOverlap:E(h()).default([]),recommendedCompetitors:E(h()).default([]),matchedTerms:E(h()).default([]),groundingSources:E(i0).default([]),searchQueries:E(h()).default([]),model:h().nullable().optional(),location:h().nullable().optional(),createdAt:h()});k({snapshots:E(s0),total:j().int().nonnegative()});const kT=k({queryId:h().nullable(),query:h().nullable(),run1State:ji.nullable(),run2State:ji.nullable(),run1AnswerMentioned:ye().nullable(),run2AnswerMentioned:ye().nullable(),run1VisibilityState:ac.nullable(),run2VisibilityState:ac.nullable(),run1MentionState:ic.nullable().optional(),run2MentionState:ic.nullable().optional(),changed:ye(),visibilityChanged:ye()});k({run1:h(),run2:h(),diff:E(kT)});const AT=NT.extend({snapshots:E(s0).optional()});k({totalRuns:j().int().nonnegative(),run:AT.nullable()});k({id:h(),projectId:h().nullable().optional(),actor:h(),action:h(),entityType:h(),entityId:h().nullable().optional(),diff:wi().optional(),createdAt:h()});const _T=re(["yes","no","unknown","not-mentioned"]),lb=E(h().min(1));k({companyName:h().min(1),domain:h().min(1),queries:lb.optional(),phrases:lb.optional(),competitors:E(h().min(1)).optional().default([])}).superRefine((e,n)=>{e.queries!==void 0&&e.phrases!==void 0&&n.addIssue({code:"custom",message:"Use queries; phrases is accepted only as a legacy alias when queries is omitted",path:["phrases"]})});const zT=k({name:h(),count:j().int().nonnegative()}),CT=k({id:h(),name:h(),weight:j(),score:j(),grade:h(),status:re(["pass","partial","fail"]),findings:E(k({type:h(),message:h()})).default([]),recommendations:E(h()).default([])}),TT=k({url:h(),finalUrl:h(),auditedAt:h(),overallScore:j(),overallGrade:h(),summary:h(),factors:E(CT).default([])}),ET=k({industry:h(),summary:h(),services:E(h()).default([]),categoryTerms:E(h()).default([])}),OT=k({provider:h(),displayName:h(),model:h().nullable().optional(),mentioned:ye(),cited:ye(),describedAccurately:_T,accuracyNotes:h().nullable().optional(),incorrectClaims:E(h()).default([]),recommendedCompetitors:E(h()).default([]),citedDomains:E(h()).default([]),groundingSources:E(i0).default([]),searchQueries:E(h()).default([]),answerText:h(),error:h().nullable().optional()}),DT=k({query:h(),providerResults:E(OT).default([])}),RT=k({totalQueries:j().int().nonnegative(),totalProviders:j().int().nonnegative(),totalComparisons:j().int().nonnegative(),mentionCount:j().int().nonnegative(),citationCount:j().int().nonnegative(),topCompetitors:E(zT).default([]),visibilityGap:h(),whatThisMeans:E(h()).default([]),recommendedActions:E(h()).default([])});k({companyName:h(),domain:h(),homepageUrl:h(),generatedAt:h(),queries:E(h()).default([]),competitors:E(h()).default([]),profile:ET,audit:TT,queryResults:E(DT).default([]),summary:RT});const Yf=re(["answer-visibility","traffic-sync"]);Yf.enum;k({id:h(),projectId:h(),kind:Yf,cronExpr:h(),preset:h().nullable().optional(),timezone:h().default("UTC"),enabled:ye().default(!0),providers:E(ha).default([]),sourceId:h().nullable().optional(),lastRunAt:h().nullable().optional(),nextRunAt:h().nullable().optional(),createdAt:h(),updatedAt:h()});k({kind:Yf.optional(),preset:h().optional(),cron:h().optional(),timezone:h().optional().default("UTC"),enabled:ye().optional().default(!0),providers:E(ha).optional().default([]),sourceId:h().optional()}).refine(e=>e.preset&&!e.cron||!e.preset&&e.cron,{message:'Exactly one of "preset" or "cron" must be provided'});const MT=re(["mentioned","cited"]);MT.enum;k({id:h(),projectId:h(),propertyId:h(),clientEmail:h(),connected:ye(),createdAt:h(),updatedAt:h()});k({date:h(),landingPage:h(),sessions:j(),organicSessions:j(),users:j()});const Xf=re(["session","first_user","manual_utm"]),BT=k({source:h(),medium:h(),sessions:j(),users:j(),sourceDimension:Xf}),LT=k({source:h(),medium:h(),sourceDimension:Xf,landingPage:h(),sessions:j(),users:j()}),qT=k({source:h(),medium:h(),sessions:j(),users:j(),channelGroup:h()}),Qr=k({sessions:j(),sharePct:j(),sharePctDisplay:h()}),$T=k({organic:Qr,social:Qr,direct:Qr,ai:Qr,other:Qr});k({totalSessions:j(),totalOrganicSessions:j(),totalDirectSessions:j(),totalUsers:j(),topPages:E(k({landingPage:h(),sessions:j(),organicSessions:j(),directSessions:j(),users:j()})),aiReferrals:E(BT),aiReferralLandingPages:E(LT),aiSessionsDeduped:j(),aiUsersDeduped:j(),aiSessionsBySession:j(),aiUsersBySession:j(),socialReferrals:E(qT),socialSessions:j(),socialUsers:j(),channelBreakdown:$T,organicSharePct:j(),aiSharePct:j(),aiSharePctBySession:j(),directSharePct:j(),socialSharePct:j(),organicSharePctDisplay:h(),aiSharePctDisplay:h(),aiSharePctBySessionDisplay:h(),directSharePctDisplay:h(),socialSharePctDisplay:h(),otherSessions:j(),otherSharePct:j(),otherSharePctDisplay:h(),lastSyncedAt:h().nullable()});k({connected:ye(),propertyId:h().nullable(),clientEmail:h().nullable(),authMethod:re(["service-account","oauth"]).nullable(),lastSyncedAt:h().nullable(),createdAt:h().nullable().optional(),updatedAt:h().nullable().optional()});k({synced:ye(),rowCount:j().int().nonnegative(),aiReferralCount:j().int().nonnegative(),socialReferralCount:j().int().nonnegative(),days:j().int().nonnegative(),syncedAt:h(),syncedComponents:E(h()).optional()});k({date:h(),source:h(),medium:h(),landingPage:h(),sessions:j(),users:j(),sourceDimension:Xf});k({date:h(),source:h(),medium:h(),sessions:j(),users:j(),channelGroup:h()});k({date:h(),sessions:j(),organicSessions:j(),users:j()});function sc(e){return e.toLowerCase().replace(/[^a-z0-9]/g,"")}const r0=re(["claude","openai","gemini","zai"]),UT=k({id:r0,label:h(),defaultModel:h(),configured:ye(),keySource:re(["config","env"]).nullable()});k({providers:E(UT).default([]),defaultProvider:r0.nullable()});const VT=re(["aero","user","compaction"]);VT.enum;const o0=128;k({key:h().min(1).max(o0),value:h().min(1)});k({key:h().min(1).max(o0)});const Jf=re(["queued","downloading","querying","ready","failed"]);Jf.enum;k({id:h(),release:h(),status:Jf,phaseDetail:h().nullable().optional(),vertexPath:h().nullable().optional(),edgesPath:h().nullable().optional(),vertexSha256:h().nullable().optional(),edgesSha256:h().nullable().optional(),vertexBytes:j().int().nullable().optional(),edgesBytes:j().int().nullable().optional(),projectsProcessed:j().int().nullable().optional(),domainsDiscovered:j().int().nullable().optional(),downloadStartedAt:h().nullable().optional(),downloadFinishedAt:h().nullable().optional(),queryStartedAt:h().nullable().optional(),queryFinishedAt:h().nullable().optional(),error:h().nullable().optional(),createdAt:h(),updatedAt:h()});const GT=k({linkingDomain:h(),numHosts:j().int()}),IT=k({projectId:h(),release:h(),targetDomain:h(),totalLinkingDomains:j().int(),totalHosts:j().int(),top10HostsShare:h(),queriedAt:h(),excludedLinkingDomains:j().int().optional(),excludedHosts:j().int().optional()});k({summary:IT.nullable(),total:j().int(),rows:E(GT)});k({release:h(),totalLinkingDomains:j().int(),totalHosts:j().int(),top10HostsShare:h(),queriedAt:h()});k({duckdbInstalled:ye(),duckdbVersion:h().nullable().optional(),duckdbSpec:h(),pluginDir:h()});k({installed:ye(),version:h(),path:h(),alreadyPresent:ye()});k({release:h(),vertexUrl:h(),edgesUrl:h(),vertexBytes:j().int().nullable(),edgesBytes:j().int().nullable(),lastModified:h().nullable()});k({release:h(),syncStatus:Jf.nullable(),bytes:j().int(),lastUsedAt:h().nullable()});re(["snapshot","insight"]);const HT=k({kind:Wt("snapshot"),id:h(),runId:h(),query:h(),provider:h(),model:h().nullable(),citationState:ji,matchedField:re(["answerText","citedDomains","searchQueries","query"]),snippet:h(),createdAt:h()}),ZT=k({kind:Wt("insight"),id:h(),runId:h().nullable(),type:re(["regression","gain","opportunity","first-citation","provider-pickup","persistent-gap","competitor-gained","competitor-lost"]),severity:re(["critical","high","medium","low"]),title:h(),query:h(),provider:h(),matchedField:re(["title","query","recommendation","cause"]),snippet:h(),dismissed:ye(),createdAt:h()}),PT=Qv("kind",[HT,ZT]);k({query:h(),totalHits:j().int().nonnegative(),truncated:ye(),hits:E(PT)});const l0=re(["create","expand","refresh","add-schema"]);l0.enum;function mM(e){switch(e){case"create":return"Create";case"expand":return"Expand";case"refresh":return"Refresh";case"add-schema":return"Add schema"}}const c0=re(["gsc","competitor-evidence","both"]);c0.enum;const u0=re(["high","medium","low"]);u0.enum;const KT=re(["blog-post","comparison","listicle","how-to","guide","glossary"]);KT.enum;const d0=re(["proposed","briefed","payload-generated","draft-created","published","validated","dismissed"]);d0.enum;const QT=k({url:h(),gscImpressions:j().nonnegative(),gscClicks:j().nonnegative(),gscAvgPosition:j().nonnegative().nullable(),organicSessions:j().nonnegative()}),YT=k({domain:h(),url:h(),title:h(),citationCount:j().int().nonnegative()}),XT=k({demand:j(),competitor:j(),absence:j(),gapSeverity:j()}),JT=k({actionId:h(),state:d0,lastUpdated:h()}),f0=k({targetRef:h(),query:h(),action:l0,ourBestPage:QT.nullable(),winningCompetitor:YT.nullable(),score:j(),scoreBreakdown:XT,drivers:E(h()),demandSource:c0,actionConfidence:u0,existingAction:JT.nullable()});k({targets:E(f0),contextMetrics:k({totalAiReferralSessions:j().int().nonnegative(),latestRunId:h(),runTimestamp:h()})});const FT=k({targetRef:h(),addressedUrl:h().nullable(),note:h().nullable(),dismissedAt:h()});k({dismissals:E(FT)});k({targetRef:h().min(1),addressedUrl:h().url().optional(),note:h().max(500).optional()});k({targetRef:h(),promptVersion:h(),provider:h(),model:h(),responseText:h(),costMillicents:j().int().nonnegative(),generatedAt:h()});k({provider:h().optional(),model:h().optional(),forceRefresh:ye().optional()});const WT=k({uri:h(),title:h(),domain:h(),isOurDomain:ye(),isCompetitor:ye(),citationCount:j().int().nonnegative(),providers:E(ha)}),p0=k({query:h(),groundingSources:E(WT)});k({sources:E(p0),latestRunId:h()});const m0=k({query:h(),competitorDomains:E(h()),competitorCount:j().int().nonnegative(),missRate:j().min(0).max(1),lastSeenInRunId:h()});k({gaps:E(m0),latestRunId:h()});const h0=re(["ok","warn","fail","skipped"]);h0.enum;const Ff=re(["global","project"]);Ff.enum;const g0=re(["auth","config","providers","integrations","database","schedules","agent"]);g0.enum;const eE=k({id:h(),category:g0,scope:Ff,title:h(),status:h0,code:h().describe('Stable machine-readable code (e.g. "google.token.refresh-failed"). Use this for filtering and remediation logic.'),summary:h(),remediation:h().nullable().optional().describe('Operator-facing next step. Null when status is "ok" or no specific remediation applies.'),details:Zn(h(),wi()).optional().describe("Structured context — principal email, redirect URI, missing scopes, etc. Stable per check id."),durationMs:j().int().nonnegative().describe("How long the check took to execute.")});k({scope:Ff,project:h().nullable().describe('Project name when scope is "project", null otherwise.'),generatedAt:h().describe("ISO-8601 timestamp when this doctor run started."),durationMs:j().int().nonnegative(),summary:k({total:j().int().nonnegative(),ok:j().int().nonnegative(),warn:j().int().nonnegative(),fail:j().int().nonnegative(),skipped:j().int().nonnegative()}),checks:E(eE)});const tE=k({provider:h(),citationState:ji,cited:ye(),mentioned:ye(),runId:h(),runCreatedAt:h()}),nE=k({queryId:h(),query:h(),providers:E(tE),citedCount:j().int().nonnegative(),mentionedCount:j().int().nonnegative(),totalProviders:j().int().nonnegative()}),aE=k({queryId:h(),query:h(),provider:h(),citingCompetitors:E(h()),runId:h(),runCreatedAt:h()}),iE=k({providersConfigured:j().int().nonnegative(),providersCiting:j().int().nonnegative(),providersMentioning:j().int().nonnegative(),totalQueries:j().int().nonnegative(),queriesCitedAndMentioned:j().int().nonnegative(),queriesCitedOnly:j().int().nonnegative(),queriesMentionedOnly:j().int().nonnegative(),queriesInvisible:j().int().nonnegative(),latestRunId:h().nullable(),latestRunAt:h().nullable()});k({summary:iE,byQuery:E(nE),competitorGaps:E(aE),status:re(["ready","no-data"]),reason:re(["no-runs-yet","no-queries"]).optional()});const sE=re(["prompt","request-param","browser-geo","ignored"]),rE=k({label:h(),city:h(),region:h(),country:h(),otherConfiguredLabels:E(h())}),oE=k({provider:h(),treatment:sE,description:h()}),lE=k({generatedAt:h(),project:k({id:h(),name:h(),displayName:h(),canonicalDomain:h(),country:h(),language:h()}),location:rE.nullable(),providerLocationHandling:E(oE),periodStart:h().nullable(),periodEnd:h().nullable()}),cE=k({citationRate:j(),citedQueryCount:j(),totalQueryCount:j(),mentionRate:j(),mentionedQueryCount:j(),trend:re(["up","down","flat","unknown"]),queryCount:j(),competitorCount:j(),providerCount:j(),gsc:k({clicks:j(),impressions:j(),ctr:j(),avgPosition:j(),periodStart:h(),periodEnd:h()}).nullable(),ga:k({sessions:j(),users:j(),periodStart:h(),periodEnd:h()}).nullable(),findings:E(k({title:h(),detail:h(),tone:re(["positive","caution","negative","neutral"])}))}),uE=k({citationState:re(["cited","not-cited","pending"]),answerMentioned:ye().nullable(),model:h().nullable()}),dE=k({queries:E(h()),providers:E(h()),matrix:E(E(uE.nullable())),providerRates:E(k({provider:h(),citedCount:j(),totalCount:j(),citationRate:j()}))}),fE=k({domain:h(),citationCount:j(),totalCount:j(),pressureLabel:re(["High","Moderate","Low","None"]),citedQueries:E(h()),sharePct:j(),theirCitedPages:E(k({url:h(),citedFor:E(h())}))}),pE=k({projectCitationCount:j(),competitors:E(fE)}),mE=k({domain:h(),mentionCount:j(),totalCount:j(),pressureLabel:re(["High","Moderate","Low","None"]),mentionedQueries:E(h()),sharePct:j()}),hE=k({projectMentionCount:j(),totalAnswerSnapshots:j(),competitors:E(mE)}),gE=k({category:h(),label:h(),count:j(),sharePct:j()}),yE=k({categories:E(gE),topDomains:E(k({domain:h(),count:j(),isCompetitor:ye()}))}),bE=k({query:h(),clicks:j(),impressions:j(),ctr:j(),avgPosition:j(),category:re(["brand","lead-gen","industry","other"])}),vE=k({periodStart:h(),periodEnd:h(),totalClicks:j(),totalImpressions:j(),ctr:j(),avgPosition:j(),topQueries:E(bE),categoryBreakdown:E(k({category:re(["brand","lead-gen","industry","other"]),clicks:j(),impressions:j(),sharePct:j()})),trend:E(k({date:h(),clicks:j(),impressions:j()})),trackedButNoGsc:E(h()),gscButNotTracked:E(h())}),SE=k({totalSessions:j(),totalUsers:j(),totalOrganicSessions:j(),periodStart:h(),periodEnd:h(),topLandingPages:E(k({page:h(),sessions:j(),users:j(),organicSessions:j()})),channelBreakdown:E(k({channel:h(),sessions:j(),sharePct:j()}))}),xE=k({totalSessions:j(),organicSessions:j(),paidSessions:j(),channels:E(k({channelGroup:h(),sessions:j(),sharePct:j()})),topCampaigns:E(k({source:h(),medium:h(),sessions:j()}))}),wE=k({totalSessions:j(),totalUsers:j(),bySource:E(k({source:h(),sessions:j(),users:j(),sharePct:j()})),trend:E(k({date:h(),sessions:j()})),topLandingPages:E(k({page:h(),sessions:j(),users:j()}))}),jE=k({windowStart:h(),windowEnd:h(),hasData:ye(),verifiedCrawlerHits:k({current:j(),prior:j(),deltaPct:j().nullable()}),unverifiedCrawlerHits:k({current:j(),prior:j(),deltaPct:j().nullable()}),referralArrivals:k({current:j(),prior:j(),deltaPct:j().nullable()}),byOperator:E(k({operator:h(),verifiedHits:j(),unverifiedHits:j(),referralArrivals:j(),deltaPct:j().nullable()})),topCrawledPaths:E(k({path:h(),verifiedHits:j(),distinctOperators:j()})),referralProducts:E(k({product:h(),arrivals:j(),distinctLandingPaths:j()})),dailyTrend:E(k({date:h(),verifiedCrawlerHits:j(),referralArrivals:j()})),topReferralLandingPaths:E(k({path:h(),arrivals:j(),distinctProducts:j()}))}),NE=k({provider:re(["google","bing"]).nullable(),total:j(),indexed:j(),notIndexed:j(),deindexed:j(),unknown:j(),indexedPct:j()}),kE=k({runId:h(),date:h(),citationRate:j(),citedQueryCount:j(),totalQueryCount:j(),mentionRate:j(),mentionedQueryCount:j(),providerRates:E(k({provider:h(),citationRate:j()}))}),Sf=k({id:h(),type:re(["regression","gain","opportunity"]),severity:re(["critical","high","medium","low"]),title:h(),query:h(),provider:h(),recommendation:h().nullable(),createdAt:h(),instanceCount:j()}),AE=k({horizon:re(["immediate","short-term","medium-term"]),title:h(),rationale:h()}),Yr=k({current:j(),prior:j(),deltaAbs:j(),direction:re(["up","down","flat"]),window:j().optional()}),_E=k({provider:h(),current:j(),prior:j(),deltaAbs:j(),direction:re(["up","down","flat"])}),zE=k({enoughHistory:ye(),headline:h(),citationRate:Yr.nullable(),mentionRate:Yr.nullable(),citedQueryCount:Yr.nullable(),gscClicksDelta:Yr.nullable(),aiReferralsDelta:Yr.nullable(),providerMovements:E(_E),wins:E(Sf),regressions:E(Sf)});re(["agency","client"]);const CE=re(["agency","client","both"]),TE=re(["immediate","short-term","medium-term"]),EE=re(["high","medium","low"]);re(["positive","caution","negative","neutral"]);const OE=re(["content","competitors","provider","search-demand","indexing","location","monitoring"]),Wf=k({audience:CE,priority:j(),horizon:TE,category:OE,title:h(),action:h(),why:E(h()),evidence:E(h()),successMetric:h(),confidence:EE,targetRef:h().optional()}),DE=k({headline:h(),overview:h(),actionItems:E(Wf),confidenceNotes:E(h())}),RE=k({title:h(),detail:h(),severity:re(["positive","caution","negative","neutral"]),evidence:E(h())}),ME=k({priorities:E(Wf),diagnostics:E(RE)});function hM(e){return e.horizon==="immediate"?"negative":e.confidence==="high"?"caution":e.confidence==="low"?"neutral":"caution"}function gM(e){switch(e){case"critical":return"Critical";case"high":return"High";case"medium":return"Medium";case"low":return"Low"}}function yM(e){switch(e){case"immediate":return"Immediate";case"short-term":return"Short term";case"medium-term":return"Medium term"}}function bM(e){switch(e){case"content":return"Content";case"competitors":return"Competitors";case"provider":return"Provider";case"search-demand":return"Search demand";case"indexing":return"Indexing";case"location":return"Location";case"monitoring":return"Monitoring"}}function vM(e){switch(e){case"high":return"High";case"medium":return"Medium";case"low":return"Low"}}k({meta:lE,executiveSummary:cE,citationScorecard:dE,competitorLandscape:pE,mentionLandscape:hE,aiSourceOrigin:yE,gsc:vE.nullable(),ga:SE.nullable(),socialReferrals:xE.nullable(),aiReferrals:wE.nullable(),serverActivity:jE.nullable(),indexingHealth:NE.nullable(),citationsTrend:E(kE),whatsChanged:zE,insights:E(Sf),recommendedNextSteps:E(AE),actionPlan:E(Wf),clientSummary:DE,agencyDiagnostics:ME,contentOpportunities:E(f0),contentGaps:E(m0),groundingSources:E(p0)});const BE=re(["claude","codex"]);BE.enum;const LE=re(["claude","codex","all"]);LE.enum;const ep=re(["cloud-run","wordpress","cloudflare","vercel","generic-log"]);ep.enum;const qE=re(["raw-request-events","aggregate-request-metrics","request-url","status-code","user-agent","remote-ip","referer","cursor-pull"]);qE.enum;const $E=re(["raw-request","aggregate-bucket"]),UE=$E.enum,VE=re(["observed","provider-aggregated","inferred"]),GE=VE.enum,IE=k({type:h().nullable(),labels:Zn(h(),h())}),HE=k({sourceType:ep,evidenceKind:Wt(UE["raw-request"]),confidence:Wt(GE.observed),eventId:h().min(1),observedAt:h().min(1),method:h().nullable(),requestUrl:h().nullable(),host:h().nullable(),path:h().min(1),queryString:h().nullable(),status:j().int().nullable(),userAgent:h().nullable(),remoteIp:h().nullable(),referer:h().nullable(),latencyMs:j().nullable(),requestSizeBytes:j().int().nullable(),responseSizeBytes:j().int().nullable(),providerResource:IE,providerLabels:Zn(h(),h())});k({events:E(HE),rawEntryCount:j().int().nonnegative(),skippedEntryCount:j().int().nonnegative(),nextPageToken:h().optional(),filter:h()});const y0=re(["connected","paused","error","archived"]),SM=y0.enum,b0=re(["oauth","service-account"]);b0.enum;const ZE=re(["verified","claimed_unverified","unknown_ai_like"]);ZE.enum;k({gcpProjectId:h().min(1),serviceName:h().nullable().optional(),location:h().nullable().optional(),authMode:b0});k({baseUrl:h().url(),username:h().min(1)});const tp=re(["production","preview"]);tp.enum;k({projectId:h().min(1),teamId:h().min(1),environment:tp});const v0=k({id:h(),projectId:h(),sourceType:ep,displayName:h(),status:y0,lastSyncedAt:h().nullable(),lastCursor:h().nullable(),lastError:h().nullable(),archivedAt:h().nullable(),config:Zn(h(),wi()),createdAt:h(),updatedAt:h()});k({gcpProjectId:h().min(1),serviceName:h().min(1).optional(),location:h().min(1).optional(),displayName:h().min(1).optional(),keyJson:h().optional()});k({baseUrl:h().url(),username:h().min(1),applicationPassword:h().min(1),displayName:h().min(1).optional()});k({projectId:h().min(1),teamId:h().min(1),token:h().min(1),environment:tp.optional(),displayName:h().min(1).optional()});k({sourceId:h(),runId:h(),syncedAt:h(),pulledEvents:j().int().nonnegative(),crawlerHits:j().int().nonnegative(),aiReferralHits:j().int().nonnegative(),unknownHits:j().int().nonnegative(),crawlerBucketRows:j().int().nonnegative(),aiReferralBucketRows:j().int().nonnegative(),sampleRows:j().int().nonnegative(),windowStart:h(),windowEnd:h()});k({days:j().int().positive().optional()});k({sourceId:h(),runId:h(),status:hc,windowStart:h(),windowEnd:h(),daysRequested:j().int().positive(),daysApplied:j().int().positive()});const PE=k({crawlerHits:j().int().nonnegative(),aiReferralHits:j().int().nonnegative(),sampleCount:j().int().nonnegative()});k({sources:E(v0)});const KE=v0.extend({totals24h:PE,latestRun:k({runId:h(),status:hc,startedAt:h().nullable(),finishedAt:h().nullable(),error:h().nullable()}).nullable()});k({sources:E(KE)});const QE=re(["crawler","ai-referral"]),S0=QE.enum,YE=k({kind:Wt(S0.crawler),sourceId:h(),tsHour:h(),botId:h(),operator:h(),verificationStatus:h(),pathNormalized:h(),status:j().int(),hits:j().int().nonnegative()}),XE=k({kind:Wt(S0["ai-referral"]),sourceId:h(),tsHour:h(),product:h(),operator:h(),sourceDomain:h(),evidenceType:h(),landingPathNormalized:h(),status:j().int(),hits:j().int().nonnegative()}),JE=Qv("kind",[YE,XE]);k({windowStart:h(),windowEnd:h(),totals:k({crawlerHits:j().int().nonnegative(),aiReferralHits:j().int().nonnegative()}),events:E(JE)});const np=re(["cited","aspirational","wasted-surface"]),cb=np.enum;cb.cited,cb.aspirational;const ap=re(["direct-competitor","ota-aggregator","editorial-media","other","unknown"]),FE=ap.enum;FE["direct-competitor"];const ip=re(["queued","seeding","probing","completed","failed"]);ip.enum;const x0=k({domain:h().min(1),hits:j().int().positive(),competitorType:ap.default("unknown")}),WE=k({id:h(),sessionId:h(),projectId:h(),query:h(),bucket:np.nullable().default(null),citationState:ji,citedDomains:E(h()).default([]),createdAt:h()}),eO=k({id:h(),projectId:h(),status:ip,icpDescription:h().nullable().optional(),seedProvider:h().nullable().optional(),seedCountRaw:j().int().nullable().optional(),seedCount:j().int().nullable().optional(),dedupThreshold:j().nullable().optional(),probeCount:j().int().nullable().optional(),citedCount:j().int().nullable().default(null),aspirationalCount:j().int().nullable().default(null),wastedCount:j().int().nullable().default(null),competitorMap:E(x0).default([]),error:h().nullable().optional(),startedAt:h().nullable().optional(),finishedAt:h().nullable().optional(),createdAt:h()});eO.extend({probes:E(WE).default([])});const tO=500;k({icpDescription:h().min(1).optional(),dedupThreshold:j().min(0).max(1).optional(),maxProbes:j().int().positive().max(tO).optional(),locations:E(h().min(1)).optional()});k({buckets:E(np).min(1).optional(),includeCompetitors:ye().optional(),competitorTypes:E(ap).min(1).optional()});k({sessionId:h(),projectId:h(),status:ip,queriesByBucket:k({cited:E(h()),aspirational:E(h()),"wasted-surface":E(h())}),suggestedCompetitors:E(x0)});k({sessionId:h(),projectId:h(),promoted:k({queries:E(h()),competitors:E(h())}),skipped:k({queries:E(h()),competitors:E(h())})});Kv([Wt("cli"),h().regex(/^discovery:.+$/)]);var nO=(e=>(e.Clicks="clicks",e.Impressions="impressions",e.CTR="ctr",e.Position="position",e))(nO||{});const xM={clicks:"Clicks",impressions:"Impressions",ctr:"CTR",position:"Position"},wM={clicks:"Clicks",impressions:"Impr",ctr:"CTR",position:"Pos"},jM=Qf;function aO(e){const n=[];if(e.message&&n.push(e.message),e.providers)for(const[i,r]of Object.entries(e.providers)){const l=`[${i}] ${r.message}`;r.raw!==void 0?n.push(`${l}
53
+
54
+ ${JSON.stringify(r.raw,null,2)}`):n.push(l)}return n.length>0?n.join(`
55
+
56
+ `):"Run failed."}function w0(e){return e.split("-").map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(" ")}function NM(e){if(!e)return"—";try{return new Date(e).toLocaleString()}catch{return e}}function kM(e){return e===null?"Unknown":e?"Pass":"Fail"}function ub(e){return e===0?"12:00 AM":e<12?`${e}:00 AM`:e===12?"12:00 PM":`${e-12}:00 PM`}function AM(e,n){return e==="twice-daily"?"twice-daily":e.startsWith("weekly@")?`${e}@${n}`:`daily@${n}`}function _M(e,n){if(!e)return{freq:"custom",hour:6,customCron:n};if(e==="twice-daily")return{freq:"twice-daily",hour:6,customCron:""};const i=e.match(/^daily(?:@(\d+))?$/);if(i)return{freq:"daily",hour:i[1]?parseInt(i[1]):6,customCron:""};const r=e.match(/^(weekly@(?:mon|tue|wed|thu|fri|sat|sun))(?:@(\d+))?$/);return r?{freq:r[1],hour:r[2]?parseInt(r[2]):6,customCron:""}:{freq:"custom",hour:6,customCron:n}}function zM(e,n,i){const r=i==="UTC"?"UTC":i.split("/").pop()?.replace(/_/g," ")??i;if(!e)return`Custom: ${n} · ${r}`;if(e==="twice-daily")return`Twice a day (6am & 6pm) · ${r}`;const l=e.match(/^daily(?:@(\d+))?$/);if(l){const d=l[1]?parseInt(l[1]):6;return`Every day at ${ub(d)} · ${r}`}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"},m=c[2]?parseInt(c[2]):6;return`Every ${d[c[1]]} at ${ub(m)} · ${r}`}return`${e} · ${r}`}const qe=(e,n,i,r)=>{const l={_id:e,baseUrl:n?.baseUrl||(n?.client??W).getConfig().baseUrl};return n?.body&&(l.body=n.body),n?.headers&&(l.headers=n.headers),n?.path&&(l.path=n.path),n?.query&&(l.query=n.query),[l]},Ks=e=>qe("getApiV1Projects",e),sp=e=>Ge({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Lw({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:Ks(e)}),rp=e=>qe("getApiV1Runs",e),j0=e=>Ge({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Xw({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:rp(e)}),iO=e=>qe("getApiV1RunsById",e),N0=e=>Ge({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await rv({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:iO(e)}),sO=e=>qe("getApiV1Settings",e),rO=e=>Ge({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await ov({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:sO(e)}),oO=e=>qe("getApiV1ProjectsByNameGoogleConnections",e),CM=e=>Ge({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await fj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:oO(e)}),lO=e=>qe("getApiV1ProjectsByNameGoogleProperties",e),TM=e=>Ge({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await hj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:lO(e)}),cO=e=>qe("getApiV1ProjectsByNameGoogleGscPerformance",e),EM=e=>Ge({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await vj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:cO(e)}),uO=e=>qe("getApiV1ProjectsByNameGoogleGscPerformanceDaily",e),OM=e=>Ge({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Sj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:uO(e)}),dO=e=>qe("getApiV1ProjectsByNameGoogleGscInspections",e),DM=e=>Ge({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await wj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:dO(e)}),fO=e=>qe("getApiV1ProjectsByNameGoogleGscDeindexed",e),RM=e=>Ge({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await jj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:fO(e)}),pO=e=>qe("getApiV1ProjectsByNameGoogleGscCoverage",e),MM=e=>Ge({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await lv({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:pO(e)}),mO=e=>qe("getApiV1ProjectsByNameGoogleGscCoverageHistory",e),BM=e=>Ge({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Nj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:mO(e)}),LM=e=>qe("getApiV1ProjectsByNameGoogleGscSitemaps",e),hO=e=>qe("getApiV1ProjectsByNameBingStatus",e),qM=e=>Ge({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Ej({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:hO(e)}),gO=e=>qe("getApiV1ProjectsByNameBingSites",e),$M=e=>Ge({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Oj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:gO(e)}),yO=e=>qe("getApiV1ProjectsByNameBingCoverage",e),UM=e=>Ge({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await cv({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:yO(e)}),bO=e=>qe("getApiV1ProjectsByNameBingInspections",e),VM=e=>Ge({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Rj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:bO(e)}),vO=e=>qe("getApiV1ProjectsByNameBingPerformance",e),GM=e=>Ge({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await qj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:vO(e)}),SO=e=>qe("getApiV1ProjectsByNameGaStatus",e),IM=e=>Ge({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Vj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:SO(e)}),xO=e=>qe("getApiV1ProjectsByNameGaTraffic",e),HM=e=>Ge({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Ij({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:xO(e)}),wO=e=>qe("getApiV1ProjectsByNameGaAiReferralHistory",e),ZM=e=>Ge({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Hj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:wO(e)}),jO=e=>qe("getApiV1ProjectsByNameGaSocialReferralHistory",e),PM=e=>Ge({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Zj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:jO(e)}),NO=e=>qe("getApiV1ProjectsByNameGaSessionHistory",e),KM=e=>Ge({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Pj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:NO(e)}),kO=e=>qe("getApiV1ProjectsByNameReport",e),QM=e=>Ge({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Qj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:kO(e)}),AO=e=>qe("getApiV1ProjectsByNameCitationsVisibility",e),YM=e=>Ge({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Yj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:AO(e)}),_O=e=>qe("getApiV1ProjectsByNameTrafficSources",e),XM=e=>Ge({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await mN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:_O(e)}),zO=e=>qe("getApiV1ProjectsByNameTrafficStatus",e),JM=e=>Ge({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await hN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:zO(e)}),CO=e=>qe("getApiV1ProjectsByNameTrafficSourcesById",e),FM=e=>Ge({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await gN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:CO(e)}),TO=e=>qe("getApiV1ProjectsByNameTrafficEvents",e),WM=e=>Ge({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await yN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:TO(e)}),EO=e=>qe("getApiV1ProjectsByNameDiscoverSessions",e),e6=e=>Ge({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await vN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:EO(e)}),OO=e=>qe("getApiV1ProjectsByNameDiscoverSessionsById",e),t6=e=>Ge({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await SN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:OO(e)}),DO=e=>qe("getApiV1ProjectsByNameDiscoverSessionsByIdPromote",e),n6=e=>Ge({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await xN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:DO(e)}),RO=e=>qe("getApiV1ProjectsByNameAgentProviders",e),MO=e=>Ge({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await jN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:RO(e)});function db(e){return e.state==="ok"?"positive":e.state==="checking"?"neutral":"negative"}function k0(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 a6(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 i6(e){return e==="High"?"negative":e==="Moderate"?"caution":"neutral"}function BO(e){return e.displayName??e.name.charAt(0).toUpperCase()+e.name.slice(1)}function $s(e){const n=[e.detail,e.hint].filter(Boolean);return n.length>0?n.join(`
57
+ `):void 0}function LO(e,n,i){return e.map(r=>{if(r.id==="api")return{...r,tone:db(n.apiStatus),detail:n.apiStatus.state==="ok"?"Healthy":"Needs attention",meta:n.apiStatus.detail};if(r.id==="worker")return{...r,tone:db(n.workerStatus),detail:n.workerStatus.state==="ok"?"Healthy":"Needs attention",meta:n.workerStatus.detail};const l=i.providerStatuses.filter(g=>g.state==="ready").length,c=i.providerStatuses.length,d=l>0,m=i.providerStatuses.filter(g=>g.state==="ready").map(g=>BO(g)).join(" · ");return{...r,label:"Providers",tone:d?"positive":"caution",detail:`${l} of ${c} configured`,meta:m||"None configured"}})}function qO(e,n){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(!n.providerStatuses.some(i=>i.state==="ready"))return"Launch is blocked until at least one provider is configured."}function $O(e,n,i){const r=qO(n,i),l=structuredClone(e);return l.healthChecks=l.healthChecks.map(c=>{if(c.id==="api")return{...c,detail:n.apiStatus.detail,state:n.apiStatus.state==="ok"?"ready":"attention"};if(c.id==="worker")return{...c,detail:n.workerStatus.detail,state:n.workerStatus.state==="ok"?"ready":"attention"};const d=i.providerStatuses.some(m=>m.state==="ready");return{...c,detail:d?"At least one provider configured.":"No providers configured.",state:d?"ready":"attention"}}),l.launchState.enabled=r===void 0,l.launchState.blockedReason=r,l.launchState.summary=r??"Queue a visibility sweep first, then follow with a site audit to explain movement.",l}const A0="canonry.run-tracker",xf=new Set;let fb=!1,UO=0,gc={runs:{},batches:{}};function VO(){const e=Ni();for(const n of xf)n(e)}function GO(e){if(!e)return{runs:{},batches:{}};try{const n=JSON.parse(e);return{runs:n.runs??{},batches:n.batches??{}}}catch{return{runs:{},batches:{}}}}function IO(){typeof window>"u"||window.sessionStorage.setItem(A0,JSON.stringify(gc))}function _0(){fb||(fb=!0,!(typeof window>"u")&&(gc=GO(window.sessionStorage.getItem(A0))))}function yc(e){gc=e,IO(),VO()}function Ni(){return _0(),gc}function HO(e){return _0(),xf.add(e),()=>{xf.delete(e)}}function z0(e){const n=Ni();yc({...n,runs:{...n.runs,[e.id]:{runId:e.id,projectId:e.projectId,projectLabel:e.projectLabel,kind:e.kind,sourceAction:e.sourceAction,lastAnnouncedStatus:e.lastAnnouncedStatus??"queued"}}})}function pb(e){const n=Ni();if(!n.runs[e])return;const{[e]:i,...r}=n.runs;yc({...n,runs:r})}function ZO(e){const n=Ni(),i=`batch_${Date.now()}_${++UO}`;return yc({...n,batches:{...n.batches,[i]:{batchId:i,runIds:e.runIds,queuedCount:e.queuedCount,skippedCount:e.skippedCount}}}),i}function PO(e){const n=Ni();if(!n.batches[e])return;const{[e]:i,...r}=n.batches;yc({...n,batches:r})}function KO(e){return e==="completed"||e==="partial"||e==="failed"||e==="cancelled"}function QO(e,n){let i=0,r=0,l=0,c=0,d=0;for(const m of e){const g=n[m]?.status;g==="completed"?i+=1:g==="partial"?r+=1:g==="failed"?l+=1:g==="cancelled"?c+=1:d+=1}return{completed:i,partial:r,failed:l,cancelled:c,pending:d,finished:d===0}}const mb=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,hb=Wb,C0=(e,n)=>i=>{var r;if(n?.variants==null)return hb(e,i?.class,i?.className);const{variants:l,defaultVariants:c}=n,d=Object.keys(l).map(b=>{const v=i?.[b],S=c?.[b];if(v===null)return null;const w=mb(v)||mb(S);return l[b][w]}),m=i&&Object.entries(i).reduce((b,v)=>{let[S,w]=v;return w===void 0||(b[S]=w),b},{}),g=n==null||(r=n.compoundVariants)===null||r===void 0?void 0:r.reduce((b,v)=>{let{class:S,className:w,..._}=v;return Object.entries(_).every(C=>{let[N,T]=C;return Array.isArray(T)?T.includes({...c,...m}[N]):{...c,...m}[N]===T})?[...b,S,w]:b},[]);return hb(e,d,g,i?.class,i?.className)},YO=(e,n)=>{const i=new Array(e.length+n.length);for(let r=0;r<e.length;r++)i[r]=e[r];for(let r=0;r<n.length;r++)i[e.length+r]=n[r];return i},XO=(e,n)=>({classGroupId:e,validator:n}),T0=(e=new Map,n=null,i)=>({nextPart:e,validators:n,classGroupId:i}),rc="-",gb=[],JO="arbitrary..",FO=e=>{const n=e4(e),{conflictingClassGroups:i,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:d=>{if(d.startsWith("[")&&d.endsWith("]"))return WO(d);const m=d.split(rc),g=m[0]===""&&m.length>1?1:0;return E0(m,g,n)},getConflictingClassGroupIds:(d,m)=>{if(m){const g=r[d],b=i[d];return g?b?YO(b,g):g:b||gb}return i[d]||gb}}},E0=(e,n,i)=>{if(e.length-n===0)return i.classGroupId;const l=e[n],c=i.nextPart.get(l);if(c){const b=E0(e,n+1,c);if(b)return b}const d=i.validators;if(d===null)return;const m=n===0?e.join(rc):e.slice(n).join(rc),g=d.length;for(let b=0;b<g;b++){const v=d[b];if(v.validator(m))return v.classGroupId}},WO=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const n=e.slice(1,-1),i=n.indexOf(":"),r=n.slice(0,i);return r?JO+r:void 0})(),e4=e=>{const{theme:n,classGroups:i}=e;return t4(i,n)},t4=(e,n)=>{const i=T0();for(const r in e){const l=e[r];op(l,i,r,n)}return i},op=(e,n,i,r)=>{const l=e.length;for(let c=0;c<l;c++){const d=e[c];n4(d,n,i,r)}},n4=(e,n,i,r)=>{if(typeof e=="string"){a4(e,n,i);return}if(typeof e=="function"){i4(e,n,i,r);return}s4(e,n,i,r)},a4=(e,n,i)=>{const r=e===""?n:O0(n,e);r.classGroupId=i},i4=(e,n,i,r)=>{if(r4(e)){op(e(r),n,i,r);return}n.validators===null&&(n.validators=[]),n.validators.push(XO(i,e))},s4=(e,n,i,r)=>{const l=Object.entries(e),c=l.length;for(let d=0;d<c;d++){const[m,g]=l[d];op(g,O0(n,m),i,r)}},O0=(e,n)=>{let i=e;const r=n.split(rc),l=r.length;for(let c=0;c<l;c++){const d=r[c];let m=i.nextPart.get(d);m||(m=T0(),i.nextPart.set(d,m)),i=m}return i},r4=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,o4=e=>{if(e<1)return{get:()=>{},set:()=>{}};let n=0,i=Object.create(null),r=Object.create(null);const l=(c,d)=>{i[c]=d,n++,n>e&&(n=0,r=i,i=Object.create(null))};return{get(c){let d=i[c];if(d!==void 0)return d;if((d=r[c])!==void 0)return l(c,d),d},set(c,d){c in i?i[c]=d:l(c,d)}}},wf="!",yb=":",l4=[],bb=(e,n,i,r,l)=>({modifiers:e,hasImportantModifier:n,baseClassName:i,maybePostfixModifierPosition:r,isExternal:l}),c4=e=>{const{prefix:n,experimentalParseClassName:i}=e;let r=l=>{const c=[];let d=0,m=0,g=0,b;const v=l.length;for(let N=0;N<v;N++){const T=l[N];if(d===0&&m===0){if(T===yb){c.push(l.slice(g,N)),g=N+1;continue}if(T==="/"){b=N;continue}}T==="["?d++:T==="]"?d--:T==="("?m++:T===")"&&m--}const S=c.length===0?l:l.slice(g);let w=S,_=!1;S.endsWith(wf)?(w=S.slice(0,-1),_=!0):S.startsWith(wf)&&(w=S.slice(1),_=!0);const C=b&&b>g?b-g:void 0;return bb(c,_,w,C)};if(n){const l=n+yb,c=r;r=d=>d.startsWith(l)?c(d.slice(l.length)):bb(l4,!1,d,void 0,!0)}if(i){const l=r;r=c=>i({className:c,parseClassName:l})}return r},u4=e=>{const n=new Map;return e.orderSensitiveModifiers.forEach((i,r)=>{n.set(i,1e6+r)}),i=>{const r=[];let l=[];for(let c=0;c<i.length;c++){const d=i[c],m=d[0]==="[",g=n.has(d);m||g?(l.length>0&&(l.sort(),r.push(...l),l=[]),r.push(d)):l.push(d)}return l.length>0&&(l.sort(),r.push(...l)),r}},d4=e=>({cache:o4(e.cacheSize),parseClassName:c4(e),sortModifiers:u4(e),...FO(e)}),f4=/\s+/,p4=(e,n)=>{const{parseClassName:i,getClassGroupId:r,getConflictingClassGroupIds:l,sortModifiers:c}=n,d=[],m=e.trim().split(f4);let g="";for(let b=m.length-1;b>=0;b-=1){const v=m[b],{isExternal:S,modifiers:w,hasImportantModifier:_,baseClassName:C,maybePostfixModifierPosition:N}=i(v);if(S){g=v+(g.length>0?" "+g:g);continue}let T=!!N,L=r(T?C.substring(0,N):C);if(!L){if(!T){g=v+(g.length>0?" "+g:g);continue}if(L=r(C),!L){g=v+(g.length>0?" "+g:g);continue}T=!1}const Z=w.length===0?"":w.length===1?w[0]:c(w).join(":"),J=_?Z+wf:Z,K=J+L;if(d.indexOf(K)>-1)continue;d.push(K);const X=l(L,T);for(let G=0;G<X.length;++G){const D=X[G];d.push(J+D)}g=v+(g.length>0?" "+g:g)}return g},m4=(...e)=>{let n=0,i,r,l="";for(;n<e.length;)(i=e[n++])&&(r=D0(i))&&(l&&(l+=" "),l+=r);return l},D0=e=>{if(typeof e=="string")return e;let n,i="";for(let r=0;r<e.length;r++)e[r]&&(n=D0(e[r]))&&(i&&(i+=" "),i+=n);return i},h4=(e,...n)=>{let i,r,l,c;const d=g=>{const b=n.reduce((v,S)=>S(v),e());return i=d4(b),r=i.cache.get,l=i.cache.set,c=m,m(g)},m=g=>{const b=r(g);if(b)return b;const v=p4(g,i);return l(g,v),v};return c=d,(...g)=>c(m4(...g))},g4=[],At=e=>{const n=i=>i[e]||g4;return n.isThemeGetter=!0,n},R0=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,M0=/^\((?:(\w[\w-]*):)?(.+)\)$/i,y4=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,b4=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,v4=/\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$/,S4=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,x4=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,w4=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Va=e=>y4.test(e),Ce=e=>!!e&&!Number.isNaN(Number(e)),Ga=e=>!!e&&Number.isInteger(Number(e)),tf=e=>e.endsWith("%")&&Ce(e.slice(0,-1)),fa=e=>b4.test(e),B0=()=>!0,j4=e=>v4.test(e)&&!S4.test(e),lp=()=>!1,N4=e=>x4.test(e),k4=e=>w4.test(e),A4=e=>!me(e)&&!he(e),_4=e=>Xa(e,$0,lp),me=e=>R0.test(e),bi=e=>Xa(e,U0,j4),vb=e=>Xa(e,M4,Ce),z4=e=>Xa(e,G0,B0),C4=e=>Xa(e,V0,lp),Sb=e=>Xa(e,L0,lp),T4=e=>Xa(e,q0,k4),Bl=e=>Xa(e,I0,N4),he=e=>M0.test(e),Xr=e=>zi(e,U0),E4=e=>zi(e,V0),xb=e=>zi(e,L0),O4=e=>zi(e,$0),D4=e=>zi(e,q0),Ll=e=>zi(e,I0,!0),R4=e=>zi(e,G0,!0),Xa=(e,n,i)=>{const r=R0.exec(e);return r?r[1]?n(r[1]):i(r[2]):!1},zi=(e,n,i=!1)=>{const r=M0.exec(e);return r?r[1]?n(r[1]):i:!1},L0=e=>e==="position"||e==="percentage",q0=e=>e==="image"||e==="url",$0=e=>e==="length"||e==="size"||e==="bg-size",U0=e=>e==="length",M4=e=>e==="number",V0=e=>e==="family-name",G0=e=>e==="number"||e==="weight",I0=e=>e==="shadow",B4=()=>{const e=At("color"),n=At("font"),i=At("text"),r=At("font-weight"),l=At("tracking"),c=At("leading"),d=At("breakpoint"),m=At("container"),g=At("spacing"),b=At("radius"),v=At("shadow"),S=At("inset-shadow"),w=At("text-shadow"),_=At("drop-shadow"),C=At("blur"),N=At("perspective"),T=At("aspect"),L=At("ease"),Z=At("animate"),J=()=>["auto","avoid","all","avoid-page","page","left","right","column"],K=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],X=()=>[...K(),he,me],G=()=>["auto","hidden","clip","visible","scroll"],D=()=>["auto","contain","none"],R=()=>[he,me,g],oe=()=>[Va,"full","auto",...R()],Ne=()=>[Ga,"none","subgrid",he,me],te=()=>["auto",{span:["full",Ga,he,me]},Ga,he,me],de=()=>[Ga,"auto",he,me],Me=()=>["auto","min","max","fr",he,me],Qe=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],be=()=>["start","end","center","stretch","center-safe","end-safe"],$=()=>["auto",...R()],F=()=>[Va,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...R()],pe=()=>[Va,"screen","full","dvw","lvw","svw","min","max","fit",...R()],je=()=>[Va,"screen","full","lh","dvh","lvh","svh","min","max","fit",...R()],se=()=>[e,he,me],Ye=()=>[...K(),xb,Sb,{position:[he,me]}],Q=()=>["no-repeat",{repeat:["","x","y","space","round"]}],le=()=>["auto","cover","contain",O4,_4,{size:[he,me]}],ne=()=>[tf,Xr,bi],ue=()=>["","none","full",b,he,me],ae=()=>["",Ce,Xr,bi],Ae=()=>["solid","dashed","dotted","double"],tt=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],xe=()=>[Ce,tf,xb,Sb],$e=()=>["","none",C,he,me],Ze=()=>["none",Ce,he,me],Ct=()=>["none",Ce,he,me],_n=()=>[Ce,he,me],Tt=()=>[Va,"full",...R()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[fa],breakpoint:[fa],color:[B0],container:[fa],"drop-shadow":[fa],ease:["in","out","in-out"],font:[A4],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[fa],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[fa],shadow:[fa],spacing:["px",Ce],text:[fa],"text-shadow":[fa],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Va,me,he,T]}],container:["container"],columns:[{columns:[Ce,me,he,m]}],"break-after":[{"break-after":J()}],"break-before":[{"break-before":J()}],"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:X()}],overflow:[{overflow:G()}],"overflow-x":[{"overflow-x":G()}],"overflow-y":[{"overflow-y":G()}],overscroll:[{overscroll:D()}],"overscroll-x":[{"overscroll-x":D()}],"overscroll-y":[{"overscroll-y":D()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:oe()}],"inset-x":[{"inset-x":oe()}],"inset-y":[{"inset-y":oe()}],start:[{"inset-s":oe(),start:oe()}],end:[{"inset-e":oe(),end:oe()}],"inset-bs":[{"inset-bs":oe()}],"inset-be":[{"inset-be":oe()}],top:[{top:oe()}],right:[{right:oe()}],bottom:[{bottom:oe()}],left:[{left:oe()}],visibility:["visible","invisible","collapse"],z:[{z:[Ga,"auto",he,me]}],basis:[{basis:[Va,"full","auto",m,...R()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ce,Va,"auto","initial","none",me]}],grow:[{grow:["",Ce,he,me]}],shrink:[{shrink:["",Ce,he,me]}],order:[{order:[Ga,"first","last","none",he,me]}],"grid-cols":[{"grid-cols":Ne()}],"col-start-end":[{col:te()}],"col-start":[{"col-start":de()}],"col-end":[{"col-end":de()}],"grid-rows":[{"grid-rows":Ne()}],"row-start-end":[{row:te()}],"row-start":[{"row-start":de()}],"row-end":[{"row-end":de()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Me()}],"auto-rows":[{"auto-rows":Me()}],gap:[{gap:R()}],"gap-x":[{"gap-x":R()}],"gap-y":[{"gap-y":R()}],"justify-content":[{justify:[...Qe(),"normal"]}],"justify-items":[{"justify-items":[...be(),"normal"]}],"justify-self":[{"justify-self":["auto",...be()]}],"align-content":[{content:["normal",...Qe()]}],"align-items":[{items:[...be(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...be(),{baseline:["","last"]}]}],"place-content":[{"place-content":Qe()}],"place-items":[{"place-items":[...be(),"baseline"]}],"place-self":[{"place-self":["auto",...be()]}],p:[{p:R()}],px:[{px:R()}],py:[{py:R()}],ps:[{ps:R()}],pe:[{pe:R()}],pbs:[{pbs:R()}],pbe:[{pbe:R()}],pt:[{pt:R()}],pr:[{pr:R()}],pb:[{pb:R()}],pl:[{pl:R()}],m:[{m:$()}],mx:[{mx:$()}],my:[{my:$()}],ms:[{ms:$()}],me:[{me:$()}],mbs:[{mbs:$()}],mbe:[{mbe:$()}],mt:[{mt:$()}],mr:[{mr:$()}],mb:[{mb:$()}],ml:[{ml:$()}],"space-x":[{"space-x":R()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":R()}],"space-y-reverse":["space-y-reverse"],size:[{size:F()}],"inline-size":[{inline:["auto",...pe()]}],"min-inline-size":[{"min-inline":["auto",...pe()]}],"max-inline-size":[{"max-inline":["none",...pe()]}],"block-size":[{block:["auto",...je()]}],"min-block-size":[{"min-block":["auto",...je()]}],"max-block-size":[{"max-block":["none",...je()]}],w:[{w:[m,"screen",...F()]}],"min-w":[{"min-w":[m,"screen","none",...F()]}],"max-w":[{"max-w":[m,"screen","none","prose",{screen:[d]},...F()]}],h:[{h:["screen","lh",...F()]}],"min-h":[{"min-h":["screen","lh","none",...F()]}],"max-h":[{"max-h":["screen","lh",...F()]}],"font-size":[{text:["base",i,Xr,bi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,R4,z4]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",tf,me]}],"font-family":[{font:[E4,C4,n]}],"font-features":[{"font-features":[me]}],"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:[l,he,me]}],"line-clamp":[{"line-clamp":[Ce,"none",he,vb]}],leading:[{leading:[c,...R()]}],"list-image":[{"list-image":["none",he,me]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",he,me]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:se()}],"text-color":[{text:se()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ae(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ce,"from-font","auto",he,bi]}],"text-decoration-color":[{decoration:se()}],"underline-offset":[{"underline-offset":[Ce,"auto",he,me]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:R()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",he,me]}],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",he,me]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Ye()}],"bg-repeat":[{bg:Q()}],"bg-size":[{bg:le()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ga,he,me],radial:["",he,me],conic:[Ga,he,me]},D4,T4]}],"bg-color":[{bg:se()}],"gradient-from-pos":[{from:ne()}],"gradient-via-pos":[{via:ne()}],"gradient-to-pos":[{to:ne()}],"gradient-from":[{from:se()}],"gradient-via":[{via:se()}],"gradient-to":[{to:se()}],rounded:[{rounded:ue()}],"rounded-s":[{"rounded-s":ue()}],"rounded-e":[{"rounded-e":ue()}],"rounded-t":[{"rounded-t":ue()}],"rounded-r":[{"rounded-r":ue()}],"rounded-b":[{"rounded-b":ue()}],"rounded-l":[{"rounded-l":ue()}],"rounded-ss":[{"rounded-ss":ue()}],"rounded-se":[{"rounded-se":ue()}],"rounded-ee":[{"rounded-ee":ue()}],"rounded-es":[{"rounded-es":ue()}],"rounded-tl":[{"rounded-tl":ue()}],"rounded-tr":[{"rounded-tr":ue()}],"rounded-br":[{"rounded-br":ue()}],"rounded-bl":[{"rounded-bl":ue()}],"border-w":[{border:ae()}],"border-w-x":[{"border-x":ae()}],"border-w-y":[{"border-y":ae()}],"border-w-s":[{"border-s":ae()}],"border-w-e":[{"border-e":ae()}],"border-w-bs":[{"border-bs":ae()}],"border-w-be":[{"border-be":ae()}],"border-w-t":[{"border-t":ae()}],"border-w-r":[{"border-r":ae()}],"border-w-b":[{"border-b":ae()}],"border-w-l":[{"border-l":ae()}],"divide-x":[{"divide-x":ae()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ae()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Ae(),"hidden","none"]}],"divide-style":[{divide:[...Ae(),"hidden","none"]}],"border-color":[{border:se()}],"border-color-x":[{"border-x":se()}],"border-color-y":[{"border-y":se()}],"border-color-s":[{"border-s":se()}],"border-color-e":[{"border-e":se()}],"border-color-bs":[{"border-bs":se()}],"border-color-be":[{"border-be":se()}],"border-color-t":[{"border-t":se()}],"border-color-r":[{"border-r":se()}],"border-color-b":[{"border-b":se()}],"border-color-l":[{"border-l":se()}],"divide-color":[{divide:se()}],"outline-style":[{outline:[...Ae(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ce,he,me]}],"outline-w":[{outline:["",Ce,Xr,bi]}],"outline-color":[{outline:se()}],shadow:[{shadow:["","none",v,Ll,Bl]}],"shadow-color":[{shadow:se()}],"inset-shadow":[{"inset-shadow":["none",S,Ll,Bl]}],"inset-shadow-color":[{"inset-shadow":se()}],"ring-w":[{ring:ae()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:se()}],"ring-offset-w":[{"ring-offset":[Ce,bi]}],"ring-offset-color":[{"ring-offset":se()}],"inset-ring-w":[{"inset-ring":ae()}],"inset-ring-color":[{"inset-ring":se()}],"text-shadow":[{"text-shadow":["none",w,Ll,Bl]}],"text-shadow-color":[{"text-shadow":se()}],opacity:[{opacity:[Ce,he,me]}],"mix-blend":[{"mix-blend":[...tt(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":tt()}],"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":[Ce]}],"mask-image-linear-from-pos":[{"mask-linear-from":xe()}],"mask-image-linear-to-pos":[{"mask-linear-to":xe()}],"mask-image-linear-from-color":[{"mask-linear-from":se()}],"mask-image-linear-to-color":[{"mask-linear-to":se()}],"mask-image-t-from-pos":[{"mask-t-from":xe()}],"mask-image-t-to-pos":[{"mask-t-to":xe()}],"mask-image-t-from-color":[{"mask-t-from":se()}],"mask-image-t-to-color":[{"mask-t-to":se()}],"mask-image-r-from-pos":[{"mask-r-from":xe()}],"mask-image-r-to-pos":[{"mask-r-to":xe()}],"mask-image-r-from-color":[{"mask-r-from":se()}],"mask-image-r-to-color":[{"mask-r-to":se()}],"mask-image-b-from-pos":[{"mask-b-from":xe()}],"mask-image-b-to-pos":[{"mask-b-to":xe()}],"mask-image-b-from-color":[{"mask-b-from":se()}],"mask-image-b-to-color":[{"mask-b-to":se()}],"mask-image-l-from-pos":[{"mask-l-from":xe()}],"mask-image-l-to-pos":[{"mask-l-to":xe()}],"mask-image-l-from-color":[{"mask-l-from":se()}],"mask-image-l-to-color":[{"mask-l-to":se()}],"mask-image-x-from-pos":[{"mask-x-from":xe()}],"mask-image-x-to-pos":[{"mask-x-to":xe()}],"mask-image-x-from-color":[{"mask-x-from":se()}],"mask-image-x-to-color":[{"mask-x-to":se()}],"mask-image-y-from-pos":[{"mask-y-from":xe()}],"mask-image-y-to-pos":[{"mask-y-to":xe()}],"mask-image-y-from-color":[{"mask-y-from":se()}],"mask-image-y-to-color":[{"mask-y-to":se()}],"mask-image-radial":[{"mask-radial":[he,me]}],"mask-image-radial-from-pos":[{"mask-radial-from":xe()}],"mask-image-radial-to-pos":[{"mask-radial-to":xe()}],"mask-image-radial-from-color":[{"mask-radial-from":se()}],"mask-image-radial-to-color":[{"mask-radial-to":se()}],"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":K()}],"mask-image-conic-pos":[{"mask-conic":[Ce]}],"mask-image-conic-from-pos":[{"mask-conic-from":xe()}],"mask-image-conic-to-pos":[{"mask-conic-to":xe()}],"mask-image-conic-from-color":[{"mask-conic-from":se()}],"mask-image-conic-to-color":[{"mask-conic-to":se()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Ye()}],"mask-repeat":[{mask:Q()}],"mask-size":[{mask:le()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",he,me]}],filter:[{filter:["","none",he,me]}],blur:[{blur:$e()}],brightness:[{brightness:[Ce,he,me]}],contrast:[{contrast:[Ce,he,me]}],"drop-shadow":[{"drop-shadow":["","none",_,Ll,Bl]}],"drop-shadow-color":[{"drop-shadow":se()}],grayscale:[{grayscale:["",Ce,he,me]}],"hue-rotate":[{"hue-rotate":[Ce,he,me]}],invert:[{invert:["",Ce,he,me]}],saturate:[{saturate:[Ce,he,me]}],sepia:[{sepia:["",Ce,he,me]}],"backdrop-filter":[{"backdrop-filter":["","none",he,me]}],"backdrop-blur":[{"backdrop-blur":$e()}],"backdrop-brightness":[{"backdrop-brightness":[Ce,he,me]}],"backdrop-contrast":[{"backdrop-contrast":[Ce,he,me]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ce,he,me]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ce,he,me]}],"backdrop-invert":[{"backdrop-invert":["",Ce,he,me]}],"backdrop-opacity":[{"backdrop-opacity":[Ce,he,me]}],"backdrop-saturate":[{"backdrop-saturate":[Ce,he,me]}],"backdrop-sepia":[{"backdrop-sepia":["",Ce,he,me]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":R()}],"border-spacing-x":[{"border-spacing-x":R()}],"border-spacing-y":[{"border-spacing-y":R()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",he,me]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ce,"initial",he,me]}],ease:[{ease:["linear","initial",L,he,me]}],delay:[{delay:[Ce,he,me]}],animate:[{animate:["none",Z,he,me]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[N,he,me]}],"perspective-origin":[{"perspective-origin":X()}],rotate:[{rotate:Ze()}],"rotate-x":[{"rotate-x":Ze()}],"rotate-y":[{"rotate-y":Ze()}],"rotate-z":[{"rotate-z":Ze()}],scale:[{scale:Ct()}],"scale-x":[{"scale-x":Ct()}],"scale-y":[{"scale-y":Ct()}],"scale-z":[{"scale-z":Ct()}],"scale-3d":["scale-3d"],skew:[{skew:_n()}],"skew-x":[{"skew-x":_n()}],"skew-y":[{"skew-y":_n()}],transform:[{transform:[he,me,"","none","gpu","cpu"]}],"transform-origin":[{origin:X()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Tt()}],"translate-x":[{"translate-x":Tt()}],"translate-y":[{"translate-y":Tt()}],"translate-z":[{"translate-z":Tt()}],"translate-none":["translate-none"],accent:[{accent:se()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:se()}],"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",he,me]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mbs":[{"scroll-mbs":R()}],"scroll-mbe":[{"scroll-mbe":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pbs":[{"scroll-pbs":R()}],"scroll-pbe":[{"scroll-pbe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",he,me]}],fill:[{fill:["none",...se()]}],"stroke-w":[{stroke:[Ce,Xr,bi,vb]}],stroke:[{stroke:["none",...se()]}],"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"]}},L4=h4(B4);function An(...e){return L4(Wb(e))}const q4=C0("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-zinc-400 focus-visible:ring-offset-2 focus-visible:ring-offset-black disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-zinc-50 text-black hover:bg-zinc-200",secondary:"border border-zinc-800 bg-zinc-950 text-zinc-100 hover:bg-zinc-900",ghost:"text-zinc-400 hover:bg-zinc-900 hover:text-zinc-50",outline:"border border-zinc-800 bg-transparent text-zinc-100 hover:bg-zinc-900",destructive:"bg-rose-600 text-white hover:bg-rose-700"},size:{default:"h-9 px-4",sm:"h-8 px-3 text-xs",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}}),Le=U.forwardRef(({className:e,variant:n,size:i,asChild:r=!1,...l},c)=>{const d=r?uw:"button";return f.jsx(d,{ref:c,className:An(q4({variant:n,size:i,className:e})),...l})});Le.displayName="Button";const $4=C0("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 H0({className:e,variant:n,...i}){return f.jsx("div",{className:An($4({variant:n}),e),...i})}const U4=220;function wb({compact:e=!1,version:n,updateAvailable:i,onDismissUpdate:r}){const l=!e&&n&&n!=="unknown",[c,d]=U.useState(!1),m=!e&&i&&r,g=()=>{d(!0),window.setTimeout(()=>{r?.(),d(!1)},U4)};return e?f.jsxs(rt,{to:"/",className:"brand-lockup brand-lockup-compact","aria-label":"Canonry home",children:[f.jsx("img",{className:"brand-icon",src:"./favicon.svg",alt:"","aria-hidden":"true"}),f.jsx("span",{className:"brand-copy",children:f.jsx("span",{className:"brand-mark",children:"Canonry"})})]}):f.jsxs("div",{className:"brand-lockup brand-lockup-wrapper",children:[f.jsx(rt,{to:"/",className:"brand-icon-link","aria-label":"Canonry home",tabIndex:-1,children:f.jsx("img",{className:"brand-icon",src:"./favicon.svg",alt:"","aria-hidden":"true"})}),f.jsxs("div",{className:"brand-copy",children:[f.jsx(rt,{to:"/",className:"brand-mark",children:"Canonry"}),m?f.jsxs("span",{className:`brand-update-bubble ${c?"brand-update-bubble-closing":""}`,role:"status","aria-live":"polite",children:[f.jsxs("a",{className:"brand-update-bubble-link",href:i.url,target:"_blank",rel:"noopener noreferrer",title:`Open release: ${i.upgradeCommand}`,"aria-label":`New version v${i.latest} available — open release page`,children:[f.jsxs("span",{className:"brand-update-bubble-from",children:["v",i.current]}),f.jsx(bk,{className:"brand-update-bubble-arrow size-3","aria-hidden":"true"}),f.jsxs("span",{className:"brand-update-bubble-to",children:["v",i.latest]})]}),f.jsx("button",{type:"button",className:"brand-update-bubble-dismiss",onClick:g,"aria-label":`Dismiss update notification for v${i.latest}`,children:f.jsx(Hs,{className:"size-3","aria-hidden":"true"})})]}):l?f.jsxs("span",{className:"brand-version",children:["v",n]}):null]})]})}function V4({provider:e}){const n={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 f.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-[10px] font-medium uppercase tracking-wide ${n[e]??"border-zinc-700 bg-zinc-800 text-zinc-300"}`,children:e})}function Mn({tone:e,children:n,...i}){const r=e==="positive"?"success":e==="caution"?"warning":e==="negative"?"destructive":"neutral";return f.jsx(H0,{variant:r,...i,children:n})}function cp({status:e}){return f.jsx(Mn,{tone:k0(e),children:w0(e)})}const G4=Fb,I4=Yb,Z0=U.forwardRef(({className:e,...n},i)=>f.jsx(Of,{ref:i,className:An("fixed inset-0 z-50 bg-black/70 backdrop-blur-sm",e),...n}));Z0.displayName=Of.displayName;const H4=400,Z4=1200,P4=720,P0=U.forwardRef(({className:e,children:n,...i},r)=>{const[l,c]=U.useState(P4),d=U.useRef(!1),m=U.useRef(0),g=U.useRef(0),b=U.useCallback(w=>{d.current=!0,m.current=w.clientX,g.current=l,w.target.setPointerCapture(w.pointerId),w.preventDefault()},[l]),v=U.useCallback(w=>{if(!d.current)return;const _=m.current-w.clientX,C=Math.min(Z4,Math.max(H4,g.current+_));c(C)},[]),S=U.useCallback(()=>{d.current=!1},[]);return f.jsxs(I4,{children:[f.jsx(Z0,{}),f.jsxs(Df,{ref:r,className:An("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(${l}px, 100vw)`},...i,children:[f.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:b,onPointerMove:v,onPointerUp:S}),n,f.jsxs(Xb,{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:[f.jsx(Hs,{className:"size-4"}),f.jsx("span",{className:"sr-only",children:"Close"})]})]})]})});P0.displayName=Df.displayName;const K4=({className:e,...n})=>f.jsx("div",{className:An("flex flex-col gap-1.5 pr-10",e),...n}),K0=U.forwardRef(({className:e,...n},i)=>f.jsx(Rf,{ref:i,className:An("text-lg font-medium text-zinc-50",e),...n}));K0.displayName=Rf.displayName;const Q0=U.forwardRef(({className:e,...n},i)=>f.jsx(Jb,{ref:i,className:An("text-sm text-zinc-500",e),...n}));Q0.displayName=Jb.displayName;function Q4({title:e,subtitle:n,children:i,open:r,onClose:l}){return f.jsx(G4,{open:r,onOpenChange:c=>c?void 0:l(),children:f.jsxs(P0,{children:[f.jsxs(K4,{className:"drawer-head",children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:n}),f.jsx(K0,{id:"drawer-title",children:e}),f.jsx(Q0,{className:"sr-only",children:n})]}),f.jsx("div",{className:"drawer-body",children:i})]})})}function ql({text:e}){const[n,i]=U.useState(null),r=U.useRef(null),l=U.useCallback(()=>{if(!r.current)return;const d=r.current.getBoundingClientRect();i({top:d.top,left:d.left+d.width/2})},[]),c=U.useCallback(()=>i(null),[]);return f.jsxs("span",{className:"info-tooltip-wrapper",onMouseEnter:l,onMouseLeave:c,onFocus:l,onBlur:c,children:[f.jsxs("svg",{ref:r,className:"info-tooltip-icon",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[f.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M8 7v4M8 5.5v0",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),n!==null&&nw.createPortal(f.jsx("span",{role:"tooltip",style:{position:"fixed",top:n.top,left:n.left,transform:"translateX(-50%) translateY(calc(-100% - 8px))",zIndex:9999,pointerEvents:"none",width:"14rem",padding:"0.5rem 0.75rem",fontSize:"11px",fontWeight:400,textTransform:"none",letterSpacing:"normal",lineHeight:"1rem",color:"#d4d4d8",backgroundColor:"#18181b",border:"1px solid rgba(63, 63, 70, 0.6)",borderRadius:"0.5rem",boxShadow:"0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1)"},children:e}),document.body)]})}const Y4=/[\s\-_]+/;function X4(e){const n=e.split(Y4).filter(Boolean);return n.length===0?null:n.map(i=>i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("[\\s\\-_]*")}function jb(e,n){const i=J4(n),r=e.split(/(\*\*[^*]+\*\*)/).filter(Boolean).map(b=>b.startsWith("**")&&b.endsWith("**")?{type:"bold",value:b.slice(2,-2)}:{type:"text",value:b}),l=i.flatMap(b=>b.terms).filter(b=>b.trim().length>1);if(l.length===0)return r.map((b,v)=>b.type==="bold"?ks.createElement("strong",{key:`b-${v}`,className:"text-zinc-200 font-semibold"},b.value):b.value).filter(Boolean);const d=[...l].sort((b,v)=>v.length-b.length).map(X4).filter(b=>!!b);if(d.length===0)return r.map((b,v)=>b.type==="bold"?ks.createElement("strong",{key:`b-${v}`,className:"text-zinc-200 font-semibold"},b.value):b.value).filter(Boolean);const m=new RegExp(`(${d.join("|")})`,"gi"),g=new Map;for(const b of i)for(const v of b.terms){const S=sc(v);S&&!g.has(S)&&g.set(S,b.className)}return r.flatMap((b,v)=>b.value.split(m).map((w,_)=>{if(!w)return null;if(_%2===1){const N=g.get(sc(w))??"answer-highlight";return b.type==="bold"?ks.createElement("mark",{key:`hl-${v}-${_}`,className:N},ks.createElement("strong",{className:"text-zinc-200 font-semibold"},w)):ks.createElement("mark",{key:`hl-${v}-${_}`,className:N},w)}return b.type==="bold"?ks.createElement("strong",{key:`b-${v}-${_}`,className:"text-zinc-200 font-semibold"},w):w})).filter(Boolean)}function J4(e){return e.length===0?[]:typeof e[0]=="string"?[{terms:e,className:"answer-highlight"}]:e}function nf(e,n){switch(e){case"new":return"First observation";case"emerging":return"First mention";case"lost":return"Lost since last run";default:return n==="mentioned"||n==="visible"?"Mentioned in latest run":n==="pending"?"Awaiting first run":"Not mentioned in latest run"}}function F4({evidence:e,project:n,onClose:i}){const[r,l]=U.useState(!1),[c,d]=U.useState("mentions"),[m,g]=U.useState(-1),[b,v]=U.useState(null),[S,w]=U.useState(!1),[_,C]=U.useState({}),N=YC(n.project),T=new Set(N.map(tc)),L=e.runHistory,Z=L.length>1,[J,K]=U.useState(null),X=U.useRef(!1);U.useEffect(()=>{if(X.current||e.answerSnippet&&(e.visibilityState!=null||e.answerMentioned!=null))return;const ne=L.at(-1);ne&&(X.current=!0,Xl(ne.runId).then(ue=>{const ae=ue.snapshots?.find(Ae=>Ae.query===e.query&&Ae.provider===e.provider);ae&&K({citationState:ae.citationState,answerMentioned:ae.answerMentioned,visibilityState:ae.visibilityState,visibilityTransition:ne.visibilityTransition,provider:ae.provider,model:ae.model??e.model,answerSnippet:ae.answerText??e.answerSnippet,citedDomains:ae.citedDomains??e.citedDomains,competitorDomains:ae.competitorOverlap??e.competitorDomains,recommendedCompetitors:ae.recommendedCompetitors??e.recommendedCompetitors??[],matchedTerms:ae.matchedTerms??e.matchedTerms??[],groundingSources:ae.groundingSources??e.groundingSources,evidenceUrls:[],changeLabel:e.visibilityChangeLabel??e.changeLabel,summary:e.summary})}).catch(()=>{}))},[e,L]);const G=m>=0&&b!==null,D=G?b:J||{citationState:e.citationState,answerMentioned:e.answerMentioned,visibilityState:e.visibilityState,visibilityTransition:L.at(-1)?.visibilityTransition,provider:e.provider,model:e.model,answerSnippet:e.answerSnippet,citedDomains:e.citedDomains,competitorDomains:e.competitorDomains,recommendedCompetitors:e.recommendedCompetitors??[],matchedTerms:e.matchedTerms??[],groundingSources:e.groundingSources,evidenceUrls:e.evidenceUrls,changeLabel:e.visibilityChangeLabel??e.changeLabel,summary:e.summary},R=D.visibilityState==="pending"||D.citationState==="pending",oe=R?!1:D.visibilityState!=null?D.visibilityState==="visible":D.answerMentioned!=null?D.answerMentioned:D.citationState===nc.cited||D.citationState==="emerging",Ne=D.answerMentioned!=null||D.visibilityState!=null||D.recommendedCompetitors.length>0,te=D.citedDomains.length>0||D.groundingSources.length>0||D.evidenceUrls.length>0,de=n.project.displayName||n.project.name,Me=[...N.map(tc),de,de.split(" ").slice(0,2).join(" "),...D.matchedTerms].filter(ne=>ne.trim().length>2),Qe=[...D.competitorDomains.flatMap(ne=>{const ue=QC(ne);return ue.length>=4?[ue]:[]}),...D.recommendedCompetitors].filter(ne=>ne.trim().length>2),be=[{terms:Me,className:"answer-highlight-brand"},...Qe.length>0?[{terms:Qe,className:"answer-highlight-competitor"}]:[]],$=R?"pending":D.visibilityTransition==="lost"?"lost":oe?"mentioned":"not-mentioned",F=U.useRef(0),pe=U.useCallback(async ne=>{const ue=++F.current;if(ne===-1||ne===L.length-1){g(-1),v(null),l(!1);return}g(ne),l(!1);const ae=L[ne],Ae=`${ae.runId}::${e.query}::${e.provider}`;if(_[Ae]){v(_[Ae]);return}w(!0);try{const tt=await Xl(ae.runId);if(ue!==F.current)return;const xe=tt.snapshots?.find(Ze=>Ze.query===e.query&&Ze.provider===e.provider)??tt.snapshots?.find(Ze=>Ze.query===e.query),$e=xe?{citationState:xe.citationState,answerMentioned:xe.answerMentioned,visibilityState:xe.visibilityState,visibilityTransition:ae.visibilityTransition,provider:xe.provider,model:xe.model??null,answerSnippet:xe.answerText??"",citedDomains:xe.citedDomains,competitorDomains:xe.competitorOverlap,recommendedCompetitors:xe.recommendedCompetitors??[],matchedTerms:xe.matchedTerms??[],groundingSources:xe.groundingSources,evidenceUrls:[],changeLabel:nf(ae.mentionTransition??ae.visibilityTransition,ae.mentionState??ae.visibilityState),summary:""}:{citationState:ae.citationState,answerMentioned:ae.answerMentioned,visibilityState:ae.visibilityState,visibilityTransition:ae.visibilityTransition,provider:e.provider,model:ae.model??null,answerSnippet:"",citedDomains:[],competitorDomains:[],recommendedCompetitors:[],matchedTerms:[],groundingSources:[],evidenceUrls:[],changeLabel:nf(ae.mentionTransition??ae.visibilityTransition,ae.mentionState??ae.visibilityState),summary:"Snapshot data not available for this run."};C(Ze=>({...Ze,[Ae]:$e})),v($e)}catch{if(ue!==F.current)return;v({citationState:ae.citationState,answerMentioned:ae.answerMentioned,visibilityState:ae.visibilityState,visibilityTransition:ae.visibilityTransition,provider:e.provider,model:ae.model??null,answerSnippet:"",citedDomains:[],competitorDomains:[],recommendedCompetitors:[],matchedTerms:[],groundingSources:[],evidenceUrls:[],changeLabel:nf(ae.mentionTransition??ae.visibilityTransition,ae.mentionState??ae.visibilityState),summary:"Failed to load historical run data."})}finally{ue===F.current&&w(!1)}},[L,e.query,e.provider,_]),se=(G||e.historyScope!=="provider")&&D.model?`${D.provider} (${D.model}) · ${D.changeLabel.toLowerCase()}`:`${D.provider} · ${D.changeLabel.toLowerCase()}`,Ye=!G&&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(" · "):"",Q=oe?{label:"Mentioned in answer",title:"Your brand or domain is mentioned in this answer",meta:se}:D.visibilityTransition==="lost"?{label:"Mention lost",title:"Your brand no longer appears in this answer",meta:se}:R?{label:"Pending",title:"Awaiting first run",meta:"No provider data yet"}:{label:"Not mentioned in answer",title:"Your brand or domain was not mentioned in this answer",meta:se},le=()=>{if(!D.answerSnippet)return null;const ne=D.answerSnippet.split(`
58
+ `),ue=[];let ae=[],Ae=0;const tt=()=>{if(ae.length===0)return;const xe=ae.join(" ").trim();xe&&ue.push(f.jsx("p",{className:ue.length>0?"mt-2.5":"",children:jb(xe,be)},Ae++)),ae=[]};for(const xe of ne){const $e=xe.trim();if(/^[-\u2013\u2014]{3,}$/.test($e)){tt(),ue.push(f.jsx("hr",{className:"border-zinc-800/60 my-3"},Ae++));continue}const Ze=$e.match(/^(#{1,3})\s+(\S.*)$/);if(Ze){tt();const Ct=Ze[1].length,_n=Ze[2].replace(/^[\p{Emoji}\p{Emoji_Component}\s]+/u,"").trim()||Ze[2],Tt=Ct===1?"text-[13px] font-semibold text-zinc-100 mt-4 mb-1":Ct===2?"text-xs font-semibold text-zinc-200 mt-3 mb-0.5":"text-xs font-medium text-zinc-300 mt-2";ue.push(f.jsx("p",{className:Tt,children:jb(_n,be)},Ae++));continue}if($e===""){tt();continue}ae.push($e)}return tt(),ue};return f.jsx(Fb,{open:!0,onOpenChange:ne=>{ne||i()},children:f.jsxs(Yb,{children:[f.jsx(Of,{className:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm"}),f.jsxs(Df,{className:"evidence-modal","aria-describedby":void 0,children:[f.jsxs("div",{className:"evidence-modal-header",children:[f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsxs("p",{className:"eyebrow eyebrow-soft",children:[n.project.name," ","·"," ",D.provider||"All providers"]}),f.jsx(Rf,{className:"text-lg font-semibold text-zinc-50 truncate",children:e.query})]}),f.jsxs(Xb,{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:[f.jsx(Hs,{className:"size-4"}),f.jsx("span",{className:"sr-only",children:"Close"})]})]}),Z&&f.jsxs("div",{className:"evidence-modal-timeline",children:[f.jsx("p",{className:"drawer-section-label mb-1.5",children:"Run history"}),f.jsx("div",{className:"flex items-center gap-1 overflow-x-auto pb-1",children:L.map((ne,ue)=>{const ae=m===-1&&ue===L.length-1||m===ue,Ae=ne.visibilityState??(ne.answerMentioned?"visible":"not-visible"),tt=ne.visibilityTransition??Ae,xe=Ae==="visible"?"bg-emerald-400":tt==="emerging"?"bg-amber-400":tt==="lost"?"bg-rose-400":"bg-zinc-600",Ze=new Date(ne.createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"}),Ct=!!(ne.model&&ue>0&&L[ue-1]?.model&&L[ue-1].model!==ne.model);return f.jsxs("button",{type:"button",className:`evidence-run-dot ${ae?"evidence-run-dot--selected":""}`,onClick:()=>{pe(ue===L.length-1?-1:ue)},"aria-label":[`Run ${Ze}: ${Ae}`,ne.model?`model ${ne.model}`:null,Ct?"model changed":null].filter(Boolean).join(" — "),"aria-pressed":ae,children:[f.jsx("span",{className:`size-2 rounded-full ${xe} ${Ct?"ring-1 ring-amber-300/80 ring-offset-2 ring-offset-zinc-950":""}`,"aria-hidden":"true"}),f.jsx("span",{className:"text-[10px] text-zinc-500",children:Ze})]},ue)})}),m>=0&&m<L.length&&f.jsxs("p",{className:"text-[11px] text-zinc-500 mt-1",children:["Viewing run from ",new Date(L[m].createdAt).toLocaleString()," ","—"," ",f.jsx("span",{className:"capitalize",children:L[m].visibilityState??(L[m].answerMentioned?"visible":"not-visible")}),f.jsxs("button",{type:"button",className:"text-zinc-400 hover:text-zinc-200 ml-2",onClick:()=>{pe(-1)},children:["←"," Back to latest"]})]}),!G&&(e.modelTransitions?.length??0)>0&&f.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:e.modelTransitions.map(ne=>f.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:`${ne.fromModel??"unknown"} -> ${ne.toModel??"unknown"} on ${new Date(ne.createdAt).toLocaleDateString()}`},`${ne.runId}:${ne.toModel??"unknown"}`))})]}),f.jsxs("div",{className:"evidence-modal-body",children:[S&&f.jsxs("div",{className:"md:col-span-2 flex items-center justify-center py-12 text-zinc-500 text-sm",children:["Loading historical run data","…"]}),!S&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"evidence-modal-main",children:[f.jsxs("div",{className:`evidence-position-hero evidence-position-hero--${$}`,children:[f.jsx("p",{className:`evidence-position-label evidence-position-label--${$}`,children:Q.label}),f.jsx("p",{className:`evidence-position-title evidence-position-title--${$}`,children:Q.title}),f.jsx("p",{className:"evidence-position-meta",children:Q.meta}),Ye&&f.jsx("p",{className:"mt-1 text-[11px] text-zinc-500",children:Ye})]}),D.answerSnippet&&f.jsxs("div",{children:[f.jsx("p",{className:"drawer-section-label",children:"What the AI said"}),f.jsx("div",{className:`answer-snippet-block ${r?"evidence-answer-expanded":"evidence-answer-collapsed"}`,children:le()}),D.answerSnippet.length>280&&f.jsx("button",{type:"button",className:"mt-1.5 text-xs text-zinc-500 hover:text-zinc-300 transition-colors",onClick:()=>l(!r),children:r?"↑ Collapse":"↓ Show full answer"})]}),!D.answerSnippet&&!S&&f.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"}),!G&&e.relatedTechnicalSignals.length>0&&f.jsxs("div",{children:[f.jsx("p",{className:"drawer-section-label",children:oe?"Why you're visible":"What to fix"}),f.jsx("div",{className:"action-items-list",children:e.relatedTechnicalSignals.map((ne,ue)=>f.jsxs("div",{className:"action-item",children:[f.jsx("svg",{className:`action-item-icon ${oe?"text-emerald-400":"text-amber-400"}`,viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:oe?f.jsx("path",{d:"M3 8l3.5 3.5L13 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}):f.jsxs(f.Fragment,{children:[f.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M8 5v3.5M8 10.5v0",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}),f.jsx("span",{className:"action-item-text",children:ne})]},ue))})]}),D.summary&&f.jsx("p",{className:"text-xs text-zinc-600 border-t border-zinc-800/40 pt-3 mt-1",children:D.summary})]}),f.jsxs("div",{className:"evidence-modal-sidebar",children:[(Ne||te)&&f.jsxs("div",{className:"sidebar-tabs",children:[f.jsx("button",{className:`sidebar-tab ${c==="mentions"?"sidebar-tab--active":""}`,onClick:()=>d("mentions"),type:"button",title:"Canonry's answer-level visibility assessment and any company names extracted from the answer text.",children:"Mentions"}),f.jsx("button",{className:`sidebar-tab ${c==="sources"?"sidebar-tab--active":""}`,onClick:()=>d("sources"),type:"button",title:"Grounding links the model used to build the answer. These are supporting sources, not the primary visibility signal.",children:"Sources"})]}),c==="mentions"&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{children:[f.jsxs("div",{className:"drawer-section-label flex items-center",children:[f.jsx("span",{children:"Mention in answer"}),f.jsx(ql,{text:"Canonry scans the AI answer for your owned domains and project name. This is independent from grounding or citation sources."})]}),f.jsxs("div",{className:`mention-status mention-status--${oe?"mentioned":"not-mentioned"}`,children:[f.jsx("span",{className:"mention-status-icon",children:R?"…":oe?"✓":"—"}),f.jsx("span",{className:"mention-status-label",children:R?"Pending":oe?"Mentioned":"Not mentioned"})]}),D.matchedTerms.length>0&&f.jsxs("div",{className:"mt-2",children:[f.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500 mb-1.5",children:"Matched in answer"}),f.jsx("div",{className:"flex flex-wrap gap-1.5",children:D.matchedTerms.map(ne=>f.jsx("span",{className:"mention-chip mention-chip--brand",children:ne},ne))})]}),!R&&!oe&&D.matchedTerms.length===0&&f.jsxs("div",{className:"mt-2",children:[f.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500 mb-1.5",children:"Searched for"}),f.jsx("div",{className:"flex flex-wrap gap-1.5",children:Me.map(ne=>f.jsx("span",{className:"mention-chip mention-chip--muted",children:ne},ne))}),f.jsx("p",{className:"text-[11px] text-zinc-600 mt-1.5",children:"None of these appear in the answer text."})]})]}),(D.recommendedCompetitors.length>0||D.competitorDomains.length>0)&&f.jsxs("div",{children:[f.jsxs("div",{className:"drawer-section-label flex items-center",children:[f.jsx("span",{children:"Competitors in answer"}),f.jsx(ql,{text:"Competitors detected in the answer text or cited source links. Includes both tracked competitors and names extracted by Canonry."})]}),f.jsx("div",{className:"flex flex-wrap gap-1.5",children:(()=>{const ne=D.competitorDomains.map(Ae=>Ae.replace(/^www\./,"")),ue=new Set(ne.map(Ae=>sc(Ae.replace(/\.[^.]+$/,""))));return[...D.recommendedCompetitors.filter(Ae=>!ue.has(sc(Ae))),...ne].map(Ae=>f.jsx("span",{className:"mention-chip mention-chip--competitor",children:Ae},Ae))})()})]})]}),c==="sources"&&f.jsxs(f.Fragment,{children:[D.citedDomains.length>0&&f.jsxs("div",{children:[f.jsxs("div",{className:"drawer-section-label flex items-center",children:[f.jsx("span",{children:"Domains from source links"}),f.jsx(ql,{text:"These domains were extracted from grounding or citation URLs. They are supporting-source metadata, not proof that the answer text mentioned them."})]}),f.jsx("div",{className:"citation-leaderboard",children:D.citedDomains.map((ne,ue)=>{const ae=ne.toLowerCase().replace(/^www\./,""),Ae=T.has(ae),tt=!Ae&&D.competitorDomains.some($e=>$e.toLowerCase().replace(/^www\./,"")===ae),xe=Ae?"you":tt?"competitor":"other";return f.jsxs("div",{className:`citation-leaderboard-item citation-leaderboard-item--${xe}`,children:[f.jsxs("span",{className:"citation-leaderboard-rank",children:["#",ue+1]}),f.jsx("span",{className:"citation-leaderboard-domain",children:ne}),Ae&&f.jsx("span",{className:"citation-leaderboard-tag",children:"You"}),tt&&f.jsx("span",{className:"citation-leaderboard-tag",children:"Competitor"})]},ne)})})]}),D.groundingSources.length>0&&f.jsxs("div",{children:[f.jsxs("div",{className:"drawer-section-label flex items-center",children:[f.jsxs("span",{children:["Grounding source links (",D.groundingSources.length,")"]}),f.jsx(ql,{text:"Links the model used as grounding or supporting context while producing the answer. These are not the same thing as answer visibility."})]}),f.jsx("ul",{className:"grid gap-0.5",children:D.groundingSources.map((ne,ue)=>f.jsx("li",{className:"truncate text-sm",children:f.jsx("a",{href:ne.uri,target:"_blank",rel:"noopener noreferrer",className:"text-zinc-400 hover:text-zinc-200 transition-colors",children:ne.title||ne.uri})},ue))})]}),D.evidenceUrls.length>0&&f.jsxs("div",{children:[f.jsx("p",{className:"drawer-section-label",children:"Evidence URLs"}),f.jsx("ul",{className:"grid gap-1",children:D.evidenceUrls.map(ne=>f.jsx("li",{className:"truncate text-sm",children:f.jsx("a",{href:ne,target:"_blank",rel:"noopener noreferrer",className:"text-zinc-400 hover:text-zinc-200 transition-colors",children:ne})},ne))})]}),D.citedDomains.length===0&&D.groundingSources.length===0&&D.evidenceUrls.length===0&&f.jsxs("div",{className:"flex items-center justify-center h-24 text-zinc-600 text-sm",children:["No source data ",G?"for this run":"yet"]})]}),!Ne&&!te&&f.jsxs("div",{className:"flex items-center justify-center h-24 text-zinc-600 text-sm",children:["No answer visibility data ",G?"for this run":"yet"]})]})]})]})]})]})})}function Rn(e){const n=new Date("2026-02-20");return e.map((i,r)=>({runId:`run_mock_${r+1}`,citationState:i,createdAt:new Date(n.getTime()+r*2*24*60*60*1e3).toISOString()}))}const af=[{id:"project_citypoint",name:"Citypoint Dental NYC",canonicalDomain:"citypointdental.com",ownedDomains:[],aliases:[],country:"US",language:"en",tags:["local intent","priority"],labels:{},providers:[],locations:[],defaultLocation:null,autoExtractBacklinks:!1,configSource:"cli",configRevision:1},{id:"project_harbor",name:"Harbor Legal Group",canonicalDomain:"harborlegal.com",ownedDomains:[],aliases:[],country:"US",language:"en",tags:["lead gen"],labels:{},providers:[],locations:[],defaultLocation:null,autoExtractBacklinks:!1,configSource:"cli",configRevision:1},{id:"project_northstar",name:"Northstar Orthopedics",canonicalDomain:"northstarortho.com",ownedDomains:[],aliases:[],country:"US",language:"en",tags:["multi-location"],labels:{},providers:[],locations:[],defaultLocation:null,autoExtractBacklinks:!1,configSource:"cli",configRevision:1}];function bc(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 W4=bc({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"}),e3=bc({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"}),t3=bc({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"}),n3=bc({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"}),a3=[{id:"evidence_citypoint_emergency_gemini",query:"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:Rn(["cited","cited","cited","cited","cited","cited","cited","not-cited","not-cited"])},{id:"evidence_citypoint_emergency_openai",query:"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:Rn(["not-cited","cited","cited","cited","cited","cited","cited"])},{id:"evidence_citypoint_emergency_claude",query:"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:Rn(["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",query:"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:Rn(["not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","cited"])},{id:"evidence_citypoint_invisalign_gemini",query:"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:Rn(["cited","cited","cited","cited","cited","cited","cited","cited"])},{id:"evidence_citypoint_invisalign_claude",query:"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:Rn(["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",query:"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:Rn(["not-cited","not-cited","not-cited","not-cited"])},{id:"evidence_citypoint_children_gemini",query:"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:Rn(["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",query:"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:Rn(["not-cited","not-cited","not-cited","not-cited","not-cited","cited"])}];af[0],af[1],Rn(["cited","cited","cited","cited","cited"]),af[2],2/7,3/7,Rn(["not-cited","not-cited","not-cited","cited"]);function s6(e,n){return e.projects.find(i=>i.project.id===n)}function i3(e,n){return e.runs.find(i=>i.id===n)}function s3(e,n){for(const i of e.projects){const r=i.visibilityEvidence.find(l=>l.id===n);if(r)return{project:i,evidence:r}}}const r3={regression:"negative",gain:"positive",opportunity:"caution","first-citation":"positive","provider-pickup":"positive","persistent-gap":"caution","competitor-gained":"negative","competitor-lost":"neutral"},o3={opportunity:"write","persistent-gap":"write","competitor-gained":"write","competitor-lost":"write",regression:"investigate",gain:"monitor","first-citation":"monitor","provider-pickup":"monitor"},l3={regression:"lost",gain:"emerging",opportunity:"not-cited","first-citation":"emerging","provider-pickup":"emerging","persistent-gap":"not-cited","competitor-gained":"cited","competitor-lost":"not-cited"},c3={regression:"Regression",gain:"Gain",opportunity:"Opportunity","first-citation":"First citation","provider-pickup":"Pickup","persistent-gap":"Gap","competitor-gained":"Competitor","competitor-lost":"Competitor"};function u3(e){return{id:e.id,tone:r3[e.type],title:e.title,detail:e.cause?.details??e.cause?.cause??"",actionLabel:e.recommendation?.action??c3[e.type],actionGroup:o3[e.type],affectedPhrases:[{query:e.query,evidenceId:"",provider:e.provider,citationState:l3[e.type]}]}}function d3(e){return e.filter(n=>!n.dismissed).map(u3)}function Y0(e){return{id:e.id,name:e.name,displayName:e.displayName,canonicalDomain:e.canonicalDomain,ownedDomains:e.ownedDomains??[],aliases:e.aliases??[],country:e.country,language:e.language,tags:e.tags,labels:e.labels,providers:e.providers??[],locations:e.locations??[],defaultLocation:e.defaultLocation??null,autoExtractBacklinks:e.autoExtractBacklinks??!1,configSource:e.configSource,configRevision:e.configRevision,createdAt:e.createdAt,updatedAt:e.updatedAt}}function Nb(e){try{return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}catch{return e}}function f3(e,n){if(!e)return"Waiting";if(!n)return"Running";const i=new Date(n).getTime()-new Date(e).getTime();if(i<1e3)return"<1s";const r=Math.floor(i/1e3);if(r<60)return`${r}s`;const l=Math.floor(r/60),c=r%60;return`${l}m ${c}s`}function X0(e){switch(e){case Te["answer-visibility"]:return"Answer visibility sweep";case Te["gsc-sync"]:return"GSC sync";case Te["inspect-sitemap"]:return"Sitemap inspection";case Te["ga-sync"]:return"GA sync";case Te["traffic-sync"]:return"Traffic sync";case Te["bing-inspect"]:return"Bing URL inspection";case Te["bing-inspect-sitemap"]:return"Bing sitemap inspection";case Te["site-audit"]:return"Site audit";case Te["backlink-extract"]:return"Backlink extract";case Te["aeo-discover-seed"]:return"Discovery (seed phase)";case Te["aeo-discover-probe"]:return"Discovery (probe phase)"}}function p3(e){return e===Rs.manual?"Manual":e===Rs.scheduled?"Scheduled":e===Rs["config-apply"]?"Config apply":e}function up(e,n){return{id:e.id,projectId:e.projectId,projectName:n,kind:e.kind,kindLabel:X0(e.kind),status:e.status,trigger:e.trigger??"manual",location:e.location??null,createdAt:e.createdAt,startedAt:e.startedAt?Nb(e.startedAt):Nb(e.createdAt),duration:f3(e.startedAt??null,e.finishedAt??null),statusDetail:e.error?J0(e.error):m3(e),summary:h3(e),triggerLabel:p3(e.trigger)}}function J0(e){const n=Qf(e);return n.length>200?n.slice(0,200)+"…":n}function m3(e){switch(e.status){case It.queued:return"Waiting for execution slot.";case It.running:return"Provider queries in progress.";case It.completed:return"All queries checked.";case It.partial:return"Run completed with some queries skipped.";case It.failed:return e.error?J0(e.error):"Run failed.";case It.cancelled:return"Run was cancelled.";default:return""}}function h3(e){const n=X0(e.kind);switch(e.status){case It.queued:return`${n} queued`;case It.running:return`${n} in progress`;case It.completed:return`${n} completed`;case It.partial:return`${n} partially completed`;case It.failed:return`${n} failed`;case It.cancelled:return`${n} cancelled`;default:return e.status}}function g3(e,n,i,r){const l=[];let c=0;const d=new Set;if(i.length>0){const m=i.flatMap(C=>C.snapshots??[]),g=new Map;for(const C of m)if(C.query){const N=`${C.query}::${C.provider}::${C.location??""}`;g.set(N,C)}const b=new Set(m.map(C=>C.location??null));b.size===0&&b.add(null);const v=new Set(m.map(C=>C.provider)),S=new Set(n.flatMap(C=>Object.keys(C.providerRuns??{}))),w=[...new Set([...v,...S])].sort(),_=w.length>0?w:["gemini"];for(const C of n){if(C.runs.length===0)continue;d.add(C.query);const N=C.runs.at(-1),T=N?.transition??"not-cited";for(const L of _){const Z=[...b].filter(X=>g.has(`${C.query}::${L}::${X??""}`)),J=(C.providerRuns?.[L]?.length??0)>0,K=Z.length>0?Z:J?[null]:[];for(const X of K){const G=X??"",D=g.get(`${C.query}::${L}::${G}`),R=D?.model??null,oe=R?`${L}:${R}`:null,Ne=C.providerRuns?.[L],te=oe?C.modelRuns?.[oe]:void 0,de=$e=>$e?.filter(Ze=>(Ze.location??null)===X),Me=Z.length>0?de(Ne):Ne,Qe=Z.length>0?de(te):te,be=(Me?.length?Me:null)??(Qe?.length?Qe:null),$=Me?.length?"provider":Qe?.length?"model":"query",F=be?be.at(-1).transition:T,pe=be?be.at(-1).visibilityTransition??(be.at(-1).visibilityState==="visible"?"visible":"not-visible"):N?.visibilityTransition??(N?.visibilityState==="visible"?"visible":"not-visible"),je=be?.at(-1)?.citationState,se=be?.at(-1)?.visibilityState,Ye=D?F==="lost"?"lost":F==="emerging"?"emerging":D.citationState===nc.cited?"cited":"not-cited":je===nc.cited?"cited":"not-cited",Q=D?.visibilityState??(se==="visible"?"visible":se==="pending"?"pending":"not-visible"),le=kb(be||C.runs),ne=Ab(be||C.runs),ue=y3(C,L),ae=(be??C.runs).map($e=>({runId:$e.runId,citationState:$e.citationState,createdAt:$e.createdAt,model:ue.get($e.runId)??null,answerMentioned:$e.answerMentioned,visibilityState:$e.visibilityState,visibilityTransition:$e.visibilityTransition,mentionState:$e.mentionState,mentionTransition:$e.mentionTransition})),Ae=b3(ae),tt=$==="provider"&&Ae.length<=1?"model":$,xe=v3(ae);l.push({id:`evidence_${e}_${c++}`,query:C.query,provider:D?.provider??L,model:D?.model??null,location:D?.location??X,citationState:Ye,answerMentioned:D?.answerMentioned,visibilityState:Q,visibilityChangeLabel:_b(pe,ne,{positive:"visible",negative:"not visible",first:"first visibility"}),changeLabel:_b(F,le),answerSnippet:D?.answerText??"",citedDomains:D?.citedDomains??[],evidenceUrls:[],competitorDomains:D?.competitorOverlap??[],recommendedCompetitors:D?.recommendedCompetitors??[],matchedTerms:D?.matchedTerms??[],relatedTechnicalSignals:[],groundingSources:D?.groundingSources??[],summary:S3(Q,pe,C.query),runHistory:ae,historyScope:tt,modelsSeen:Ae,modelTransitions:xe})}}}}for(const m of r)d.has(m.query)||l.push({id:`evidence_${e}_${c++}`,query:m.query,provider:"",model:null,location:null,citationState:"pending",visibilityState:"pending",visibilityChangeLabel:"Awaiting first run",changeLabel:"Awaiting first run",answerSnippet:"",citedDomains:[],evidenceUrls:[],competitorDomains:[],recommendedCompetitors:[],matchedTerms:[],relatedTechnicalSignals:[],groundingSources:[],summary:`"${m.query}" has been added but no visibility run has been triggered yet.`,runHistory:[],historyScope:"query",modelsSeen:[],modelTransitions:[]});return l}function y3(e,n){const i=new Map,r=`${n}:`;for(const[l,c]of Object.entries(e.modelRuns??{})){if(!l.startsWith(r))continue;const d=l.slice(r.length),m=d==="unknown"?null:d;for(const g of c)i.set(g.runId,m)}return i}function b3(e){const n=new Set;for(const i of e)i.model&&n.add(i.model);return[...n]}function v3(e){const n=[];let i=null;for(const r of e){const l=r.model??null;l!==i&&i!==null&&n.push({runId:r.runId,createdAt:r.createdAt,fromModel:i,toModel:l}),i=l}return n}function kb(e){if(e.length===0)return 0;const n=e[e.length-1].citationState;let i=0;for(let r=e.length-1;r>=0&&e[r].citationState===n;r--)i++;return i}function Ab(e){if(e.length===0)return 0;const n=e[e.length-1].visibilityState??"not-visible";let i=0;for(let r=e.length-1;r>=0&&(e[r].visibilityState??"not-visible")===n;r--)i++;return i}function _b(e,n,i){const r={positive:i?.positive??"cited",negative:i?.negative??"not cited",first:i?.first??"first citation"};switch(e){case"new":return"First observation";case"cited":case"visible":return n<=1?`${Jr(r.positive)} in latest run`:`${Jr(r.positive)} for ${n} runs`;case"lost":return"Lost since last run";case"emerging":return Jr(r.first);case"not-cited":case"not-visible":return n<=1?`${Jr(r.negative)} in latest run`:`${Jr(r.negative)} across ${n} runs`;default:return e}}function Jr(e){return e.charAt(0).toUpperCase()+e.slice(1)}function S3(e,n,i){switch(n){case"lost":return`Mention was lost for "${i}". Your brand no longer appeared in the latest answer.`;case"emerging":return`Your brand started appearing in AI answers for "${i}".`}switch(e){case"visible":return`Your brand or domain is mentioned in AI answers for "${i}".`;case"pending":return`"${i}" has been added but no run has been triggered yet.`;default:return`Your brand or domain was not mentioned in AI answers for "${i}".`}}function x3(e){const n=Y0(e.project),i=g3(n.name,e.timeline,e.latestRunDetails,e.queries),l=[...e.runs].sort((c,d)=>d.createdAt.localeCompare(c.createdAt)).map(c=>up(c,e.project.displayName||e.project.name));return e.overview?w3(n,e.overview,i,l):j3(n,i,l)}function w3(e,n,i,r){const l=d3(n.topInsights);for(const c of n.attentionItems)c.id.startsWith("insight_")||l.push({id:c.id,tone:c.tone,title:c.title,detail:c.detail,actionLabel:c.actionLabel,actionGroup:"investigate",affectedPhrases:[]});return{project:e,dateRangeLabel:n.dateRangeLabel,contextLabel:n.contextLabel,mentionSummary:n.scores.mention,visibilitySummary:n.scores.visibility,mentionShareSummary:n.scores.mentionShare,queryCounts:{cited:n.queryCounts.citedQueries,total:n.queryCounts.totalQueries},gapQueries:n.scores.gapQueries,mentionGaps:n.scores.mentionGaps,indexCoverage:n.scores.indexCoverage,providerScores:n.providerScores,competitorPressure:n.scores.competitorPressure,runStatus:n.scores.runStatus,movementSummary:n.movementSummary,insights:l,visibilityEvidence:i,competitors:n.competitors.map(c=>({id:c.id,domain:c.domain,citationCount:c.citationCount,totalQueries:c.totalQueries,pressureLabel:c.pressureLabel,citedQueries:c.citedQueries,movement:"",notes:""})),recentRuns:r.slice(0,5),suggestedQueries:n.suggestedQueries}}function j3(e,n,i){const r={label:"",value:"No data",delta:"Loading…",tone:"neutral",description:"",tooltip:"",trend:[]};return{project:e,dateRangeLabel:"All time",contextLabel:`${e.country} / ${e.language.toUpperCase()}`,mentionSummary:{...r,label:"Mention Coverage"},visibilitySummary:{...r,label:"Citation Coverage"},mentionShareSummary:{...r,label:"Mention Share",breakdown:{projectMentionSnapshots:0,competitorMentionSnapshots:0,perCompetitor:[],snapshotsWithAnswerText:0,snapshotsTotal:0}},queryCounts:{cited:0,total:0},gapQueries:{...r,label:"Citation Gaps"},mentionGaps:{...r,label:"Mention Gaps"},indexCoverage:{...r,label:"Index Coverage"},providerScores:[],competitorPressure:{...r,label:"Competitor Pressure"},runStatus:{...r,label:"Run Status"},movementSummary:{gained:0,lost:0,tone:"neutral",hasPreviousRun:!1},insights:[],visibilityEvidence:n,competitors:[],recentRuns:i.slice(0,5),suggestedQueries:{rows:[],totalCandidates:0,skippedAlreadyTracked:0}}}function N3(e){const n=Y0(e.project),i=[...e.runs].sort((w,_)=>_.createdAt.localeCompare(w.createdAt)),r=i.find(w=>w.kind===Te["answer-visibility"])??i[0],l=e.project.displayName||e.project.name,c=r?up(r,l):k3(e.project.id,l),d=e.overview;if(!d)return{project:n,visibilityScore:0,visibilityDelta:"No data",visibilityTone:"neutral",lastRun:c,insight:"No runs completed yet.",trend:[],competitorPressureLabel:"None"};const m=d.scores.visibility,g=m.progress??0,b=d.queryCounts.citedQueries,v=d.queryCounts.totalQueries,S=d.providers.length;return{project:n,visibilityScore:g,visibilityDelta:v>0?`${b} of ${v} queries`:"No data",visibilityTone:m.tone,providerCoverage:m.providerCoverage,lastRun:c,insight:v>0?`${b} of ${v} queries mentioned across ${S} provider${S===1?"":"s"}.`:"No runs completed yet.",trend:[],competitorPressureLabel:d.scores.competitorPressure.value}}function k3(e,n){return{id:"none",projectId:e,projectName:n,kind:Te["answer-visibility"],kindLabel:"No runs yet",status:It.queued,trigger:Rs.manual,createdAt:"",startedAt:"",duration:"",statusDetail:"",summary:"No runs yet",triggerLabel:""}}function A3(e,n){const i=[],r=[],l=[];for(const d of e){r.push(x3(d)),l.push(N3(d));const m=[...d.runs].sort((g,b)=>b.createdAt.localeCompare(g.createdAt));for(const g of m)i.push(up(g,d.project.displayName||d.project.name))}i.sort((d,m)=>m.createdAt.localeCompare(d.createdAt));const c=e.length>0;return{portfolioOverview:{projects:l,attentionItems:c?_3(r):[{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:i.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 query set, and one competitor list are in place.",ctaLabel:"Launch setup",ctaHref:"/setup"}}},projects:r,runs:i,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"},queryImportState:{mode:"paste",queryCount: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:(n?.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:n?.google?.configured?"ready":"needs-config",detail:n?.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:n?.bing?.configured?"ready":"needs-config",detail:n?.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 _3(e){const n=[];for(const i of e){const r=i.visibilityEvidence.filter(c=>c.citationState==="lost");r.length>0&&n.push({id:`attention_${i.project.id}_lost`,tone:"negative",title:`${i.project.displayName||i.project.name} lost citations`,detail:`${r.length} quer${r.length>1?"ies":"y"} lost citation.`,actionLabel:"Open project",href:`/projects/${i.project.id}`});const l=i.recentRuns.filter(c=>c.status===It.running||c.status===It.queued);l.length>0&&n.push({id:`attention_${i.project.id}_active`,tone:"neutral",title:`${i.project.displayName||i.project.name} has active runs`,detail:`${l.length} run${l.length>1?"s":""} in progress.`,actionLabel:"View runs",href:"/runs"})}return n.length===0&&n.push({id:"attention_stable",tone:"positive",title:"All projects stable",detail:"No citation losses or active runs to flag.",actionLabel:"View portfolio",href:"/"}),n}const F0=U.createContext(null);F0.Provider;function vc(){return U.useContext(F0)}function z3(e,n){return["projects",e,n]}function Sc(e){const i=vc()?.dashboard??null,r=Gn({...sp({client:ie}),enabled:!i}),l=Gn({...j0({client:ie}),enabled:!i,staleTime:hf,refetchInterval:C=>C.state.data?.some(L=>L.status==="running"||L.status==="queued")?3e3:hf}),c=Gn({...rO({client:ie}),enabled:!i}),d=r.data??[],m=l.data??[],g=aw({queries:d.map(C=>{const N=m.filter(G=>G.projectId===C.id),T=N.filter(G=>(G.status==="completed"||G.status==="partial")&&G.kind==="answer-visibility"&&G.trigger!=="probe").sort((G,D)=>D.createdAt.localeCompare(G.createdAt)),L=T[0]?.createdAt??null,Z=L?T.filter(G=>G.createdAt===L).map(G=>G.id):[],J=T.find(G=>G.createdAt!==L)?.createdAt??null,K=J?T.filter(G=>G.createdAt===J).map(G=>G.id):[],X=[...Z].sort().join(",");return{queryKey:z3(C.id,X||void 0),queryFn:async()=>{const[G,D,R,oe,Ne,te,de,Me,Qe]=await Promise.all([EN(C.name).catch(()=>[]),ON(C.name).catch(()=>[]),DN(C.name).catch(()=>[]),Z.length?Promise.all(Z.map(be=>Xl(be).catch(()=>null))).then(be=>be.filter($=>$!=null)):Promise.resolve([]),K.length?Promise.all(K.map(be=>Xl(be).catch(()=>null))).then(be=>be.filter($=>$!=null)):Promise.resolve([]),KN(C.name).catch(()=>null),XN(C.name).catch(()=>null),FN(C.name).catch(()=>null),RN(C.name).catch(()=>null)]);return{project:C,runs:N,queries:G,competitors:D,timeline:R,latestRunDetails:oe,previousRunDetails:Ne,gscCoverage:te,bingCoverage:de,dbInsights:Me,overview:Qe}},enabled:!i&&r.isSuccess&&l.isSuccess,staleTime:lk}})}),b=g.every(C=>C.isSuccess),v=U.useMemo(()=>{if(i)return i;if(!r.data||!l.data||d.length>0&&!b)return null;const C=g.map(N=>N.data?{...N.data,runs:m.filter(T=>T.projectId===N.data.project.id)}:null).filter(N=>N!=null);return A3(C,c.data??null)},[i,r.data,l.data,c.data,b,g,d.length,m]),S=!i&&(r.isError||l.isError),w=!i&&!v&&!S,_=U.useCallback(async()=>{await Promise.all([r.refetch(),l.refetch(),c.refetch()])},[r.refetch,l.refetch,c.refetch]);return{dashboard:v,isLoading:w,isError:S,refetch:_}}const C3=["health"];async function T3(){const e=await ek("/health","API"),n=e.state==="ok"?{label:"Worker",state:"ok",detail:"In-process job runner"}:{label:"Worker",state:e.state,detail:`Depends on API health check · ${e.detail}`,statusCode:e.statusCode,hint:e.hint?`Worker status is inferred from API health in this deployment mode. ${e.hint}`:"Worker status is inferred from API health in this deployment mode."};return{apiStatus:e,workerStatus:n}}function dp(e,n){return Gn({queryKey:C3,queryFn:T3,enabled:e,refetchInterval:15e3,initialData:n})}function E3(e){return Gn({...N0({client:ie,path:{id:e??""}}),enabled:!!e,refetchInterval:n=>{const i=n.state.data?.status;return i==="running"||i==="queued"?3e3:!1}})}function fp(){const e=cc(),n=iw({strict:!1}),i=sw({select:g=>g.location.pathname}),r=n.runId??null,l=n.evidenceId??null;return{runId:r,evidenceId:l,openRun:g=>{e({to:i,from:Ft.to,search:b=>({...b,runId:g,evidenceId:void 0})})},openEvidence:g=>{e({to:i,from:Ft.to,search:b=>({...b,evidenceId:g,runId:void 0})})},closeDrawer:()=>{e({to:i,from:Ft.to,search:g=>({...g,runId:void 0,evidenceId:void 0})})}}}const O3={negative:"toast-card-negative",caution:"toast-card-caution",positive:"toast-card-positive",neutral:"toast-card-neutral"};function D3(e){if(e.cta)return`${e.cta.label}: ${e.title}`}function R3(){const e=U.useSyncExternalStore(rk,Oy,Oy),n=cc(),{openRun:i}=fp(),r=U.useCallback(c=>{mf(c)},[]),l=U.useCallback(c=>{c.cta&&(c.cta.intent==="open-run-drawer"?i(c.cta.runId):n({to:"/runs"}),mf(c.id))},[n,i]);return e.length===0?null:f.jsx("div",{className:"toast-viewport","aria-label":"Notifications",children:e.map(c=>f.jsxs("section",{role:c.tone==="negative"?"alert":"status","aria-live":c.tone==="negative"?"assertive":"polite","data-state":c.state,className:`toast-card ${O3[c.tone]}`,children:[f.jsxs("div",{className:"toast-copy",children:[f.jsx("p",{className:"toast-title",children:c.title}),c.detail?f.jsx("p",{className:"toast-detail",children:c.detail}):null,c.cta?f.jsx("button",{type:"button",className:"toast-action",onClick:()=>l(c),"aria-label":D3(c),children:c.cta.label}):null]}),f.jsx("button",{type:"button",onClick:()=>r(c.id),className:"toast-dismiss","aria-label":"Dismiss",children:f.jsx(Hs,{className:"size-3.5"})})]},c.id))})}async function pp(e){try{return await e.json()}catch{return{}}}function M3(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,"")+"/api/v1":"/api/v1"}const mp=M3();function hp(e){(e===401||e===403)&&Mf()}async function zb(e){const n=await fetch(`${mp}/projects/${encodeURIComponent(e)}/agent/transcript`,{credentials:"include"});if(!n.ok){hp(n.status);const i=await pp(n);throw new In(i.error?.message??`transcript fetch failed: ${n.status}`,n.status,i.error?.code)}return await n.json()}async function B3(e){const n=await fetch(`${mp}/projects/${encodeURIComponent(e)}/agent/transcript`,{method:"DELETE",credentials:"include"});if(!n.ok){hp(n.status);const i=await pp(n);throw new In(i.error?.message??`reset failed: ${n.status}`,n.status,i.error?.code)}}async function L3({project:e,prompt:n,provider:i,modelId:r,scope:l,signal:c,onEvent:d}){const m={prompt:n};i&&(m.provider=i),r&&(m.modelId=r),l&&(m.scope=l);const g=await fetch(`${mp}/projects/${encodeURIComponent(e)}/agent/prompt`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(m),signal:c});if(!g.ok||!g.body){hp(g.status);const _=await pp(g);throw new In(_.error?.message??`prompt failed: ${g.status}`,g.status,_.error?.code)}const b=g.body.getReader(),v=new TextDecoder;let S="";const w=()=>{b.cancel().catch(()=>{})};c?.addEventListener("abort",w,{once:!0});try{for(;;){const{value:_,done:C}=await b.read();if(C)break;S+=v.decode(_,{stream:!0});let N=S.indexOf(`
59
+
60
+ `);for(;N!==-1;){const T=S.slice(0,N);S=S.slice(N+2);for(const L of T.split(`
61
+ `)){if(!L.startsWith("data:"))continue;const Z=L.slice(5).trim();if(Z)try{d(JSON.parse(Z))}catch{}}N=S.indexOf(`
62
+
63
+ `)}}}finally{c?.removeEventListener("abort",w);try{b.releaseLock()}catch{}}}function W0(e){return!e||e.role!=="assistant"?"":e.content.filter(n=>n.type==="text").map(n=>n.text).join("")}const q3=[{label:"Status",prompt:"Quick status overview for this project — latest runs, current health, anything unusual."},{label:"Top insights",prompt:"Walk me through the 3 most severe active insights and what to do about each."},{label:"Last failed run",prompt:"If the latest run failed, dig into it and tell me what went wrong plus how to fix it."},{label:"Schedule",prompt:"What is the current sweep schedule, and is it appropriate given recent volatility?"}],$3=[{command:"/status",label:"Status",hint:"Latest runs, health, anything unusual",prompt:"Quick status overview for this project — latest runs, current health, anything unusual."},{command:"/insights",label:"Top insights",hint:"Walk through the most severe active insights",prompt:"Walk me through the 3 most severe active insights and what to do about each."},{command:"/last-run",label:"Last run",hint:"Summarize the latest sweep",prompt:"Summarize the latest run for this project — provider mix, visibility changes, and anything that moved."},{command:"/last-failed",label:"Last failed run",hint:"Diagnose the most recent failure",prompt:"If the latest run failed, dig into it and tell me what went wrong plus how to fix it."},{command:"/run-sweep",label:"Run sweep now",hint:"Trigger a new visibility sweep",prompt:"Run a new answer-visibility sweep for this project now and tell me when it lands."},{command:"/schedule",label:"Schedule",hint:"Review the sweep schedule",prompt:"What is the current sweep schedule, and is it appropriate given recent volatility?"},{command:"/queries",label:"Queries",hint:"List tracked queries",prompt:"List the tracked queries for this project and flag any that are obvious duplicates or underperformers."},{command:"/competitors",label:"Competitors",hint:"List tracked competitors",prompt:"List this project's tracked competitors and call out which ones are showing up in answer citations."},{command:"/clear",label:"Clear conversation",hint:"Wipe transcript and start fresh",action:"clear"}],$l=e=>`canonry:aero:provider:${e}`,Cb=e=>`canonry:aero:scope:${e}`;function U3({projectName:e}){const[n,i]=U.useState(!1),[r,l]=U.useState(!1),[c,d]=U.useState([]),[m,g]=U.useState(""),[b,v]=U.useState(!1),[S,w]=U.useState([]),[_,C]=U.useState(""),[N,T]=U.useState(null),[L,Z]=U.useState(()=>typeof window>"u"?null:window.localStorage.getItem($l(e))??null),[J,K]=U.useState(()=>typeof window>"u"?"read-only":window.localStorage.getItem(Cb(e))==="all"?"all":"read-only"),X=U.useRef(null),G=U.useRef(null),D=U.useRef(null),[R,oe]=U.useState(0),Ne=U.useMemo(()=>{const Q=m.trimStart();if(!Q.startsWith("/"))return[];if(/\s/.test(Q))return[];const le=Q.toLowerCase();return $3.filter(ne=>ne.command.startsWith(le)||ne.label.toLowerCase().includes(le.slice(1)))},[m]);U.useEffect(()=>{oe(Q=>Ne.length===0?0:Math.min(Q,Ne.length-1))},[Ne.length]);const te=Gn({...MO({client:ie,path:{name:e}}),enabled:n,staleTime:6e4}),de=U.useMemo(()=>{const Q=te.data?.providers??[];if(L){const ne=Q.find(ue=>ue.id===L&&ue.configured);if(ne)return ne}const le=te.data?.defaultProvider;return le?Q.find(ne=>ne.id===le)??null:null},[L,te.data]);U.useEffect(()=>{if(!te.data||!L)return;te.data.providers.find(le=>le.id===L&&le.configured)||(Z(null),window.localStorage.removeItem($l(e)))},[te.data,L,e]);const Me=U.useCallback(Q=>{Z(Q),!(typeof window>"u")&&(Q?window.localStorage.setItem($l(e),Q):window.localStorage.removeItem($l(e)))},[e]),Qe=U.useCallback(()=>{K(Q=>{const le=Q==="all"?"read-only":"all";return typeof window<"u"&&window.localStorage.setItem(Cb(e),le),le})},[e]);U.useEffect(()=>{if(!n)return;const Q=le=>{le.key==="Escape"&&(r?l(!1):i(!1))};return window.addEventListener("keydown",Q),()=>window.removeEventListener("keydown",Q)},[n,r]),U.useEffect(()=>{if(!n)return;let Q=!1;T(null);const le=()=>{Q||b||zb(e).then(ae=>{Q||d(ae.messages)}).catch(ae=>{Q||T(ae instanceof Error?ae.message:"Failed to load transcript")})};le();const ue=window.setInterval(le,15e3);return()=>{Q=!0,window.clearInterval(ue)}},[n,e,b]),U.useEffect(()=>()=>{X.current?.abort()},[e]),U.useEffect(()=>{const Q=G.current;Q&&(Q.scrollTop=Q.scrollHeight)},[c,_,S]);async function be(Q){const le=Q.trim();if(!le||b)return;T(null),g(""),v(!0),C(""),w([]);const ne={role:"user",content:le,timestamp:Date.now()};d(ae=>[...ae,ne]);const ue=new AbortController;X.current=ue;try{await L3({project:e,prompt:le,provider:L??void 0,scope:J,signal:ue.signal,onEvent:$});const ae=await zb(e);d(ae.messages)}catch(ae){ae.name!=="AbortError"&&T(ae instanceof Error?ae.message:"Prompt failed")}finally{v(!1),C(""),X.current=null}}function $(Q){switch(Q.type){case"message_update":C(W0(Q.message));break;case"message_end":Q.message.role==="assistant"&&C("");break;case"tool_execution_start":w(le=>[...le,{id:Q.toolCallId,name:Q.toolName,args:Q.args,startedAt:Date.now()}]);break;case"tool_execution_end":w(le=>le.map(ne=>ne.id===Q.toolCallId?{...ne,endedAt:Date.now(),isError:Q.isError,result:Q.result}:ne));break;case"error":T(Q.message);break}}async function F(){X.current?.abort();try{await B3(e),d([]),T(null)}catch(Q){T(Q instanceof Error?Q.message:"Reset failed")}}const pe=c.length===0,je=n&&r?"pointer-events-auto fixed inset-0 z-40 flex items-stretch justify-center bg-zinc-950/70 p-4 sm:p-8 backdrop-blur-sm":"pointer-events-none fixed inset-x-0 bottom-0 z-40 flex justify-center p-3",se=r?"pointer-events-auto flex h-full w-full max-w-5xl flex-col overflow-hidden rounded-2xl border border-zinc-800/80 bg-zinc-950/95 shadow-2xl":"pointer-events-auto w-full max-w-3xl",Ye=r?"flex-1 overflow-y-auto px-6 py-5 text-sm text-zinc-200":"max-h-[40vh] min-h-[120px] overflow-y-auto px-4 py-3 text-sm text-zinc-200";return f.jsx("div",{className:je,onClick:Q=>{r&&Q.target===Q.currentTarget&&l(!1)},children:f.jsx("div",{className:se,children:n?f.jsxs("div",{className:r?"flex h-full flex-col":"flex flex-col overflow-hidden rounded-2xl border border-zinc-800/80 bg-zinc-950/95 shadow-xl backdrop-blur",children:[f.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-zinc-800/70 px-4 py-2.5",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(By,{className:"h-4 w-4 text-emerald-400","aria-hidden":"true"}),f.jsx("span",{className:"text-sm font-medium text-zinc-100",children:"Aero"}),f.jsx("span",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:b?"working…":e})]}),f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx(V3,{providers:te.data?.providers??[],active:de,override:L,onPick:Me,disabled:b}),f.jsx("button",{type:"button",onClick:Sn(F),className:"rounded-md p-1.5 text-zinc-500 transition hover:bg-zinc-800/60 hover:text-zinc-200","aria-label":"Reset conversation",title:"Reset conversation",children:f.jsx(hv,{className:"h-3.5 w-3.5","aria-hidden":"true"})}),f.jsx("button",{type:"button",onClick:()=>l(Q=>!Q),className:"rounded-md p-1.5 text-zinc-500 transition hover:bg-zinc-800/60 hover:text-zinc-200","aria-label":r?"Collapse":"Expand",title:r?"Collapse":"Expand",children:r?f.jsx(Pk,{className:"h-3.5 w-3.5","aria-hidden":"true"}):f.jsx(Gk,{className:"h-3.5 w-3.5","aria-hidden":"true"})}),f.jsx("button",{type:"button",onClick:()=>{l(!1),i(!1)},className:"rounded-md p-1.5 text-zinc-500 transition hover:bg-zinc-800/60 hover:text-zinc-200","aria-label":"Close Aero",children:f.jsx(Hs,{className:"h-4 w-4","aria-hidden":"true"})})]})]}),f.jsxs("div",{ref:G,className:Ye,children:[N&&f.jsx("div",{className:"mb-2 rounded-md border border-rose-700/40 bg-rose-950/40 px-3 py-2 text-xs text-rose-200",children:N}),pe&&!b&&f.jsxs("div",{className:"flex flex-col gap-3 py-2",children:[f.jsxs("p",{className:"text-xs text-zinc-500",children:["Ask anything about ",f.jsx("span",{className:"text-zinc-300",children:e}),", or start with:"]}),f.jsx("div",{className:"flex flex-wrap gap-1.5",children:q3.map(Q=>f.jsx("button",{type:"button",onClick:()=>{be(Q.prompt)},className:"rounded-full border border-zinc-800 bg-zinc-900/70 px-3 py-1 text-xs text-zinc-300 transition hover:border-zinc-700 hover:bg-zinc-800/70 hover:text-zinc-100",children:Q.label},Q.label))})]}),P3(c,e,L,J),S.length>0&&f.jsx("div",{className:"mt-3 space-y-1.5",children:S.map(Q=>f.jsx(e1,{trail:Q},Q.id))}),b&&_&&f.jsxs("div",{className:"mt-3",children:[f.jsx("div",{className:"mb-0.5 text-[10px] uppercase tracking-wider text-emerald-400",children:"Aero"}),f.jsx(t1,{content:_})]}),b&&!_&&S.every(Q=>Q.endedAt!==void 0)&&f.jsx(X3,{})]}),f.jsx(G3,{projectName:e,activeProvider:de,scope:J,onToggleScope:Qe,disabled:b}),f.jsxs("div",{className:"relative",children:[Ne.length>0&&f.jsx(I3,{matches:Ne,selectedIndex:R,onHover:oe,onPick:Q=>{g(""),D.current?.focus(),Q.action==="clear"?F():be(Q.prompt)}}),f.jsxs("form",{className:"flex items-end gap-2 border-t border-zinc-800/70 bg-zinc-950/80 px-3 py-2.5",onSubmit:Q=>{if(Q.preventDefault(),Ne.length>0){const le=Ne[R];g(""),le.action==="clear"?F():be(le.prompt);return}be(m)},children:[f.jsx("textarea",{ref:D,value:m,onChange:Q=>g(Q.target.value),onKeyDown:Q=>{if(Ne.length>0){if(Q.key==="ArrowDown"){Q.preventDefault(),oe(le=>(le+1)%Ne.length);return}if(Q.key==="ArrowUp"){Q.preventDefault(),oe(le=>(le-1+Ne.length)%Ne.length);return}if(Q.key==="Tab"){Q.preventDefault();const le=Ne[R];g(`${le.command} `);return}if(Q.key==="Escape"){Q.preventDefault(),g("");return}}if(Q.key==="Enter"&&!Q.shiftKey)if(Q.preventDefault(),Ne.length>0){const le=Ne[R];g(""),le.action==="clear"?F():be(le.prompt)}else be(m)},placeholder:"Ask Aero, or / for commands…",disabled:b,rows:r?3:1,className:"flex-1 resize-none bg-transparent text-sm text-zinc-100 placeholder:text-zinc-600 focus:outline-none disabled:opacity-60"}),f.jsx("button",{type:"submit",disabled:b||!m.trim(),className:"inline-flex h-7 w-7 items-center justify-center rounded-md bg-emerald-500 text-zinc-950 transition hover:bg-emerald-400 disabled:opacity-40","aria-label":"Send",children:f.jsx(Sk,{className:"h-3.5 w-3.5","aria-hidden":"true"})})]})]})]}):f.jsxs("button",{type:"button",onClick:()=>i(!0),className:"flex w-full items-center justify-between rounded-full border border-zinc-800/80 bg-zinc-950/95 px-4 py-2 text-left text-sm text-zinc-400 shadow-lg backdrop-blur transition hover:border-zinc-700 hover:bg-zinc-900/90 hover:text-zinc-200",children:[f.jsxs("span",{className:"flex items-center gap-2",children:[f.jsx(By,{className:"h-4 w-4 text-emerald-400","aria-hidden":"true"}),"Ask Aero about ",e,"…"]}),f.jsx("span",{className:"text-[10px] uppercase tracking-wider text-zinc-600",children:"Enter"})]})})})}function V3({providers:e,active:n,override:i,onPick:r,disabled:l}){const[c,d]=U.useState(!1),m=U.useRef(null);if(U.useEffect(()=>{if(!c)return;const v=w=>{m.current?.contains(w.target)||d(!1)},S=w=>{w.key==="Escape"&&d(!1)};return window.addEventListener("mousedown",v),window.addEventListener("keydown",S),()=>{window.removeEventListener("mousedown",v),window.removeEventListener("keydown",S)}},[c]),e.length===0)return null;const g=n?.label.replace(/\s+\(.+\)$/,"")??"No provider",b=n?.defaultModel;return f.jsxs("div",{ref:m,className:"relative",children:[f.jsxs("button",{type:"button",onClick:()=>d(v=>!v),disabled:l,className:"flex items-center gap-1 rounded-md px-1.5 py-1 text-[11px] text-zinc-400 transition hover:bg-zinc-800/60 hover:text-zinc-200 disabled:opacity-50","aria-label":"Switch agent model","aria-haspopup":"listbox","aria-expanded":c,title:n?`${n.label} · ${n.defaultModel}`:"Pick a provider",children:[f.jsx("span",{className:"font-medium text-zinc-200",children:g}),b&&f.jsx("span",{className:"hidden font-mono text-[10px] text-zinc-500 sm:inline",children:b}),f.jsx(kk,{className:"h-3 w-3","aria-hidden":"true"})]}),c&&f.jsxs("div",{role:"listbox",className:"absolute right-0 top-full z-50 mt-1 w-64 overflow-hidden rounded-lg border border-zinc-800 bg-zinc-950 shadow-xl",children:[f.jsx("div",{className:"border-b border-zinc-800/60 px-3 py-2 text-[10px] uppercase tracking-wider text-zinc-500",children:"Aero provider"}),f.jsx("ul",{className:"max-h-72 overflow-y-auto py-1",children:e.map(v=>{const S=n?.id===v.id,w=i===v.id;return f.jsx("li",{children:f.jsxs("button",{type:"button",role:"option","aria-selected":S,disabled:!v.configured,onClick:()=>{v.configured&&(r(w?null:v.id),d(!1))},className:"flex w-full items-start gap-2 px-3 py-2 text-left text-xs transition enabled:hover:bg-zinc-900 disabled:cursor-not-allowed disabled:opacity-50",children:[f.jsx("span",{className:"mt-0.5 flex h-3.5 w-3.5 shrink-0 items-center justify-center",children:S?f.jsx(mv,{className:"h-3 w-3 text-emerald-400","aria-hidden":"true"}):null}),f.jsxs("span",{className:"flex-1",children:[f.jsxs("span",{className:"flex items-center gap-1.5",children:[f.jsx("span",{className:"font-medium text-zinc-100",children:v.label}),w&&f.jsx("span",{className:"rounded-full border border-emerald-800/60 bg-emerald-950/60 px-1.5 text-[9px] uppercase tracking-wider text-emerald-300",children:"Pinned"}),!v.configured&&f.jsx("span",{className:"rounded-full border border-zinc-800 px-1.5 text-[9px] uppercase tracking-wider text-zinc-500",children:"Key missing"})]}),f.jsx("span",{className:"mt-0.5 block font-mono text-[10px] text-zinc-500",children:v.defaultModel}),v.keySource==="env"&&f.jsx("span",{className:"mt-0.5 block text-[10px] text-zinc-600",children:"via env var"}),!v.configured&&f.jsxs("span",{className:"mt-0.5 block text-[10px] text-zinc-600",children:["Add key in config.yaml or export"," ",f.jsx("code",{className:"font-mono text-zinc-400",children:H3(v.id)})]})]})]})},v.id)})}),i&&f.jsx("button",{type:"button",onClick:()=>{r(null),d(!1)},className:"w-full border-t border-zinc-800/60 px-3 py-2 text-left text-[11px] text-zinc-400 transition hover:bg-zinc-900 hover:text-zinc-100",children:"Reset to auto-detected default"})]})]})}function G3({projectName:e,activeProvider:n,scope:i,onToggleScope:r,disabled:l}){const c=n?.label.replace(/\s+\(.+\)$/,"")??null,d=i==="all";return f.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 border-t border-zinc-800/70 bg-zinc-950/80 px-3 pt-2",children:[f.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-zinc-800 bg-zinc-900/70 px-2 py-0.5 text-[10px] text-zinc-400",children:[f.jsx("span",{className:"text-zinc-600",children:"project"}),f.jsx("span",{className:"font-medium text-zinc-200",children:e})]}),c&&f.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-zinc-800 bg-zinc-900/70 px-2 py-0.5 text-[10px] text-zinc-400",children:[f.jsx("span",{className:"text-zinc-600",children:"model"}),f.jsx("span",{className:"font-medium text-zinc-200",children:c})]}),f.jsxs("button",{type:"button",onClick:r,disabled:l,className:`inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-[10px] transition disabled:opacity-50 ${d?"border-amber-800/60 bg-amber-950/40 text-amber-300 hover:border-amber-700 hover:text-amber-200":"border-zinc-800 bg-zinc-900/70 text-zinc-400 hover:border-zinc-700 hover:text-zinc-200"}`,title:d?"Aero can invoke write tools (run sweep, dismiss insight, etc). Click to restrict.":"Aero is restricted to read-only tools. Click to allow writes.",children:[f.jsx("span",{className:d?"text-amber-500":"text-zinc-600",children:"scope"}),f.jsx("span",{className:"font-medium",children:d?"all tools":"read-only"})]})]})}function I3({matches:e,selectedIndex:n,onHover:i,onPick:r}){return f.jsxs("div",{className:"absolute inset-x-3 bottom-full mb-2 overflow-hidden rounded-lg border border-zinc-800 bg-zinc-950/98 shadow-2xl",children:[f.jsx("div",{className:"border-b border-zinc-800/60 px-3 py-1.5 text-[10px] uppercase tracking-wider text-zinc-500",children:"Commands"}),f.jsx("ul",{role:"listbox",className:"max-h-72 overflow-y-auto py-1",children:e.map((l,c)=>{const d=c===n;return f.jsx("li",{children:f.jsxs("button",{type:"button",role:"option","aria-selected":d,onMouseEnter:()=>i(c),onClick:()=>r(l),className:`flex w-full items-center gap-3 px-3 py-1.5 text-left text-xs transition ${d?"bg-zinc-900 text-zinc-100":"text-zinc-300 hover:bg-zinc-900/60"}`,children:[f.jsx("span",{className:"font-mono text-[11px] text-emerald-400",children:l.command}),f.jsx("span",{className:"font-medium",children:l.label}),f.jsx("span",{className:"ml-auto text-[10px] text-zinc-500",children:l.hint})]})},l.command)})}),f.jsxs("div",{className:"border-t border-zinc-800/60 px-3 py-1.5 text-[10px] text-zinc-600",children:[f.jsx("span",{className:"mr-3",children:"↑↓ to select"}),f.jsx("span",{className:"mr-3",children:"Enter to run"}),f.jsx("span",{children:"Tab to autocomplete"})]})]})}function H3(e){switch(e){case"claude":return"ANTHROPIC_API_KEY";case"openai":return"OPENAI_API_KEY";case"gemini":return"GOOGLE_API_KEY";case"zai":return"ZAI_API_KEY"}}function Z3(e,n){const i=e.timestamp??0;return`${e.role}:${i}:${n}`}function P3(e,n,i,r){const l=[];for(let c=0;c<e.length;c++){const d=e[c],m=Z3(d,c);if(d.role==="user"){const g=typeof d.content=="string"?d.content:JSON.stringify(d.content);if(g.startsWith("[system]"))continue;l.push(f.jsx(K3,{text:g,projectName:n,providerOverride:i,scope:r},m));continue}if(d.role==="assistant"){const g=new Map;let b=c+1;for(;b<e.length&&e[b].role==="toolResult";){const w=e[b];g.set(w.toolCallId,w),b++}const v=Y3(d,g,d.timestamp??0),S=W0(d);l.push(f.jsxs(U.Fragment,{children:[v.length>0&&f.jsx("div",{className:"mt-3 space-y-1.5",children:v.map(w=>f.jsx(e1,{trail:w},w.id))}),S.trim()&&f.jsxs("div",{className:"mt-3",children:[f.jsx("div",{className:"mb-0.5 text-[10px] uppercase tracking-wider text-emerald-400",children:"Aero"}),f.jsx(t1,{content:S})]})]},m)),c=b-1;continue}}return l}function K3({text:e,projectName:n,providerOverride:i,scope:r}){const[l,c]=U.useState(!1),d=U.useMemo(()=>Q3(n,e,i,r),[n,e,i,r]);async function m(){try{await navigator.clipboard.writeText(d),c(!0),window.setTimeout(()=>c(!1),1500)}catch{}}return f.jsxs("div",{className:"group relative mt-3 rounded-md bg-zinc-900/60 px-3 py-2 text-zinc-200",children:[f.jsxs("div",{className:"flex items-center justify-between gap-2",children:[f.jsx("div",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:"You"}),f.jsx("button",{type:"button",onClick:Sn(m),className:"inline-flex items-center gap-1 rounded border border-zinc-800/70 bg-zinc-950/60 px-1.5 py-0.5 text-[10px] text-zinc-400 opacity-0 transition hover:border-zinc-700 hover:text-zinc-100 group-hover:opacity-100 focus:opacity-100","aria-label":"Copy as CLI command",title:d,children:l?f.jsxs(f.Fragment,{children:[f.jsx(mv,{className:"h-2.5 w-2.5 text-emerald-400","aria-hidden":"true"}),"Copied"]}):f.jsxs(f.Fragment,{children:[f.jsx(zk,{className:"h-2.5 w-2.5","aria-hidden":"true"}),"Copy as CLI"]})})]}),f.jsx("div",{className:"whitespace-pre-wrap",children:e})]})}function Q3(e,n,i,r){const l=["canonry","agent","ask",Tb(e),Tb(n)];return i&&l.push("--provider",i),r==="read-only"&&l.push("--scope","read-only"),l.join(" ")}function Tb(e){return`'${e.replace(/'/g,"'\\''")}'`}function Y3(e,n,i){const r=[];for(const l of e.content){if(l.type!=="toolCall")continue;const c=l,d=n.get(c.id);r.push({id:c.id,name:c.name,args:c.arguments,startedAt:i,endedAt:d?.timestamp,isError:d?.isError,result:d?.content})}return r}function e1({trail:e}){const[n,i]=U.useState(!1),r=e.endedAt===void 0,l=!r&&e.isError===!0,c=e.endedAt!=null?e.endedAt-e.startedAt:null,d=c==null||c<0?null:c<1e3?`${c}ms`:`${(c/1e3).toFixed(1)}s`,m=l?"border-rose-800/50":r?"border-emerald-800/50":"border-zinc-800/70",g=l?"bg-rose-950/20":r?"bg-emerald-950/20":"bg-zinc-900/40";return f.jsxs("div",{className:`rounded-md border ${m} ${g} font-mono`,children:[f.jsxs("button",{type:"button",onClick:()=>i(b=>!b),className:"flex w-full items-center gap-2 px-2.5 py-1.5 text-left","aria-expanded":n,children:[f.jsx("span",{className:"flex h-3.5 w-3.5 shrink-0 items-center justify-center",children:r?f.jsx(Uk,{className:"h-3 w-3 animate-spin text-emerald-400","aria-hidden":"true"}):l?f.jsx(gv,{className:"h-3 w-3 text-rose-400","aria-hidden":"true"}):f.jsx(r2,{className:"h-3 w-3 text-zinc-500","aria-hidden":"true"})}),f.jsx("span",{className:"text-[11px] font-semibold text-zinc-100",children:e.name}),f.jsxs("span",{className:"ml-auto flex items-center gap-2 text-[10px] text-zinc-500",children:[r?f.jsx("span",{className:"text-emerald-400",children:"running…"}):f.jsxs(f.Fragment,{children:[f.jsx("span",{children:l?"failed":"ok"}),d&&f.jsx("span",{children:d})]}),f.jsx($f,{className:`h-3 w-3 transition-transform ${n?"rotate-90":""}`,"aria-hidden":"true"})]})]}),n&&f.jsxs("div",{className:"border-t border-zinc-800/60 px-2.5 py-2 text-[11px] text-zinc-400",children:[f.jsx("div",{className:"mb-1 text-[9px] uppercase tracking-wider text-zinc-600",children:"Args"}),f.jsx("pre",{className:"mb-2 overflow-x-auto whitespace-pre-wrap break-all text-[10px] text-zinc-300",children:Eb(e.args)}),!r&&e.result!==void 0&&f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"mb-1 text-[9px] uppercase tracking-wider text-zinc-600",children:l?"Error":"Result"}),f.jsx("pre",{className:"overflow-x-auto whitespace-pre-wrap break-all text-[10px] text-zinc-300",children:Eb(e.result)})]})]})]})}function Eb(e){try{const n=typeof e=="string"?e:JSON.stringify(e,null,2);return n.length>2e3?`${n.slice(0,2e3)}
64
+ … (${n.length-2e3} more chars)`:n}catch{return String(e)}}function t1({content:e}){return f.jsx("div",{className:"aero-markdown text-zinc-100",children:f.jsx(dw,{components:{h1:n=>f.jsx("h1",{...n,className:"mt-3 mb-2 text-base font-semibold text-zinc-50"}),h2:n=>f.jsx("h2",{...n,className:"mt-3 mb-2 text-sm font-semibold text-zinc-50"}),h3:n=>f.jsx("h3",{...n,className:"mt-3 mb-1.5 text-sm font-semibold text-zinc-100"}),h4:n=>f.jsx("h4",{...n,className:"mt-2 mb-1 text-xs font-semibold uppercase tracking-wide text-zinc-300"}),p:n=>f.jsx("p",{...n,className:"mb-2 leading-relaxed"}),ul:n=>f.jsx("ul",{...n,className:"mb-2 ml-4 list-disc space-y-1"}),ol:n=>f.jsx("ol",{...n,className:"mb-2 ml-4 list-decimal space-y-1"}),li:n=>f.jsx("li",{...n,className:"marker:text-zinc-600"}),strong:n=>f.jsx("strong",{...n,className:"font-semibold text-zinc-50"}),em:n=>f.jsx("em",{...n,className:"text-zinc-200"}),code:({children:n,...i})=>f.jsx("code",{...i,className:"rounded bg-zinc-800/70 px-1 py-0.5 font-mono text-[12px] text-emerald-200",children:n}),pre:n=>f.jsx("pre",{...n,className:"mb-2 overflow-x-auto rounded-md border border-zinc-800 bg-zinc-900/70 p-3 font-mono text-xs text-zinc-200"}),a:n=>f.jsx("a",{...n,className:"text-emerald-400 underline decoration-emerald-700 hover:decoration-emerald-400",target:"_blank",rel:"noopener noreferrer"}),table:n=>f.jsx("div",{className:"mb-2 overflow-x-auto",children:f.jsx("table",{...n,className:"w-full border-collapse text-xs"})}),thead:n=>f.jsx("thead",{...n,className:"border-b border-zinc-800"}),th:n=>f.jsx("th",{...n,className:"px-2 py-1 text-left font-semibold text-zinc-300"}),tr:n=>f.jsx("tr",{...n,className:"border-b border-zinc-900"}),td:n=>f.jsx("td",{...n,className:"px-2 py-1 text-zinc-200"}),blockquote:n=>f.jsx("blockquote",{...n,className:"mb-2 border-l-2 border-zinc-700 pl-3 italic text-zinc-400"}),hr:()=>f.jsx("hr",{className:"my-3 border-zinc-800"})},children:e})})}function X3(){return f.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[f.jsx("div",{className:"text-[10px] uppercase tracking-wider text-emerald-400",children:"Aero"}),f.jsxs("div",{className:"flex items-center gap-1","aria-label":"Aero is thinking",children:[f.jsx("span",{className:"aero-dot h-1.5 w-1.5 rounded-full bg-emerald-400/80"}),f.jsx("span",{className:"aero-dot aero-dot-2 h-1.5 w-1.5 rounded-full bg-emerald-400/60"}),f.jsx("span",{className:"aero-dot aero-dot-3 h-1.5 w-1.5 rounded-full bg-emerald-400/40"})]})]})}function J3(){const e=Pb(),n=/^\/projects\/([^/]+)/.exec(e.pathname),i=n?decodeURIComponent(n[1]):null,r=Gn({...sp({client:ie}),enabled:i!==null,staleTime:6e4});if(!i)return null;const l=r.data??[],c=l.find(d=>d.id===i)??l.find(d=>d.name===i);return c?f.jsx(U3,{projectName:c.name},c.name):null}function Fr(e,n){e.invalidateQueries({predicate:i=>{const r=i.queryKey[0];return typeof r?._id=="string"&&r._id.startsWith(n)}})}function xc(e,n,i){switch(e.invalidateQueries({queryKey:rp({client:ie})}),e.invalidateQueries({queryKey:Ks({client:ie})}),n){case Te["answer-visibility"]:case Te["site-audit"]:case Te["backlink-extract"]:return;case Te["gsc-sync"]:case Te["inspect-sitemap"]:Fr(e,"getApiV1ProjectsByNameGoogleGsc");return;case Te["ga-sync"]:Fr(e,"getApiV1ProjectsByNameGa");return;case Te["traffic-sync"]:Fr(e,"getApiV1ProjectsByNameGa"),Fr(e,"getApiV1ProjectsByNameTraffic");return;case Te["bing-inspect"]:case Te["bing-inspect-sitemap"]:Fr(e,"getApiV1ProjectsByNameBing");return;case Te["aeo-discover-seed"]:case Te["aeo-discover-probe"]:return;default:return n}}const Ob=[{label:"GitHub",href:"https://github.com/AINYC/canonry",Icon:Ok},{label:"Docs",href:"https://github.com/AINYC/canonry/tree/main/docs",Icon:wk},{label:"Changelog",href:"https://github.com/AINYC/canonry/releases",Icon:Tk}],Db=e=>({label:e,state:"checking",detail:"Checking service health"}),F3={apiStatus:Db("API"),workerStatus:Db("Worker")};function W3(e){switch(e){case Te["answer-visibility"]:return"Visibility sweep";case Te["gsc-sync"]:return"GSC sync";case Te["inspect-sitemap"]:return"Sitemap inspection";case Te["ga-sync"]:return"GA sync";case Te["traffic-sync"]:return"Traffic sync";case Te["bing-inspect"]:return"Bing URL inspection";case Te["bing-inspect-sitemap"]:return"Bing sitemap inspection";case Te["site-audit"]:return"Site audit";case Te["backlink-extract"]:return"Backlink extract";case Te["aeo-discover-seed"]:return"Discovery (seed phase)";case Te["aeo-discover-probe"]:return"Discovery (probe phase)"}}function eD(e){return e==="completed"?"positive":e==="partial"?"caution":"negative"}function tD(e){const n=W3(e.kind);return e.status==="completed"?`${n} completed`:e.status==="partial"?`${n} completed with partial results`:e.status==="cancelled"?`${n} cancelled`:`${n} failed`}function nD(e,n){return e.error?`${n}: ${Qf(e.error)}`:e.location?`${n} · ${e.location}`:n}function aD(e,n,i){if(n)return n;const r=i.find(l=>l.id===e);return r?.displayName||r?.name||e}function iD(e,n){return[e.completed>0?`${e.completed} completed`:null,e.partial>0?`${e.partial} partial`:null,e.failed>0?`${e.failed} failed`:null,e.cancelled>0?`${e.cancelled} cancelled`:null,n>0?`${n} skipped at queue time`:null].filter(Boolean).join(", ")}function sD(e){return e.failed>0||e.cancelled>0?"negative":e.partial>0?"caution":"positive"}function rD(){const e=Ka(),n=U.useSyncExternalStore(HO,Ni,Ni),i=Object.keys(n.runs).length>0||Object.keys(n.batches).length>0,r=Gn({...j0({client:ie}),enabled:i,staleTime:hf,refetchInterval:3e3}),l=Gn({...sp({client:ie}),enabled:i}),c=U.useRef({}),d=U.useCallback(()=>{r.refetch()},[r.refetch]);return U.useEffect(()=>{i&&d()},[i,d]),U.useEffect(()=>{if(!i||typeof window>"u")return;const m=()=>{document.visibilityState==="visible"&&d()};return window.addEventListener("focus",d),document.addEventListener("visibilitychange",m),()=>{window.removeEventListener("focus",d),document.removeEventListener("visibilitychange",m)}},[i,d]),U.useEffect(()=>{const m=r.data??[],g=l.data??[],b=Object.fromEntries(m.map(S=>[S.id,S])),v=Object.fromEntries(m.map(S=>[S.id,S.status]));for(const S of Object.values(n.runs)){const w=b[S.runId];if(!w||!KO(w.status)||(c.current[w.id]??S.lastAnnouncedStatus)===w.status)continue;const C=g.find(T=>T.id===w.projectId);if(C&&xc(e,w.kind,C.name),S.sourceAction==="run-all"){pb(w.id);continue}const N=aD(w.projectId,S.projectLabel,g);cn({title:tD(w),detail:nD(w,N),tone:eD(w.status),dedupeKey:`run:${w.id}`,dedupeMode:"replace",cta:{label:"View run",intent:"open-run-drawer",runId:w.id}}),pb(w.id)}for(const S of Object.values(n.batches)){const w=QO(S.runIds,b);w.finished&&(cn({title:"Run-all batch finished",detail:iD(w,S.skippedCount),tone:sD(w),dedupeKey:`batch:${S.batchId}`,dedupeMode:"replace",cta:{label:"View runs",intent:"go-to-runs"}}),PO(S.batchId))}c.current=v},[l.data,r.data,n,e]),null}function oD(){const e=vc(),{dashboard:n,isLoading:i,refetch:r}=Sc(),d=dp(!e,e?.health).data??e?.health??F3,m=Pb(),{runId:g,evidenceId:b,closeDrawer:v}=fp(),[S,w]=U.useState(!1),[_,C]=U.useState(()=>{if(typeof window>"u")return null;try{return window.localStorage.getItem("canonry:dismissedUpdateVersion")}catch{return null}}),[N]=U.useState(()=>typeof window>"u"?null:new URLSearchParams(window.location.search).get("force-update")),T=N?{current:d.apiStatus.version??"0.0.0",latest:N,url:"https://www.npmjs.com/package/@ainyc/canonry",upgradeCommand:"npm install -g @ainyc/canonry"}:d.apiStatus.updateAvailable,L=T&&T.latest!==_,Z=()=>{if(T){try{window.localStorage.setItem("canonry:dismissedUpdateVersion",T.latest)}catch{}C(T.latest)}},J=E3(g),K=J.data??null,X=J.isLoading;U.useEffect(()=>{K&&K.status!=="running"&&K.status!=="queued"&&r()},[K?.status,r]),U.useEffect(()=>{w(!1)},[m.pathname]),U.useEffect(()=>{if(typeof window>"u"||!g&&!b)return;const te=de=>{de.key==="Escape"&&v()};return window.addEventListener("keydown",te),()=>{window.removeEventListener("keydown",te)}},[g,b,v]);const G=n??e?.dashboard??null,D=m.pathname==="/setup"&&G!==null&&G.portfolioOverview.projects.length===0,R=g&&G?i3(G,g):void 0,oe=b&&G?s3(G,b):void 0,Ne=(()=>{const te=m.pathname;if(te==="/")return"Portfolio";if(te==="/projects")return"Projects";if(te==="/runs")return"Runs";if(te==="/settings")return"Settings";if(te==="/setup")return"Setup";if(te==="/backlinks")return"Backlinks";if(te==="/traffic"||te.startsWith("/traffic/"))return"Server traffic";if(te.startsWith("/projects/")){const Me=te.split("/").filter(Boolean)[1];if(Me&&G){const Qe=G.projects.find(be=>be.project.id===Me);if(Qe)return Qe.project.name}return"Project"}return"Not found"})();return f.jsxs("div",{className:`app-shell ${D?"app-shell-focus":""}`,children:[f.jsx("a",{className:"skip-link",href:"#content",children:"Skip to content"}),!D&&f.jsxs("aside",{className:"sidebar","aria-label":"Primary navigation",children:[f.jsx("div",{className:"sidebar-brand",children:f.jsx(wb,{version:d.apiStatus.version,updateAvailable:L?T:null,onDismissUpdate:Z})}),f.jsxs("nav",{className:"sidebar-nav",children:[f.jsxs(rt,{to:"/",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[f.jsx(Bk,{className:"sidebar-icon"}),f.jsx("span",{children:"Overview"})]}),f.jsxs(rt,{to:"/projects",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!1},children:[f.jsx(Rk,{className:"sidebar-icon"}),f.jsx("span",{children:"Projects"})]}),f.jsxs(rt,{to:"/runs",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[f.jsx(Qk,{className:"sidebar-icon"}),f.jsx("span",{children:"Runs"})]}),f.jsxs(rt,{to:"/traffic",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!1},children:[f.jsx(Jk,{className:"sidebar-icon"}),f.jsx("span",{children:"Server traffic"})]}),f.jsxs(rt,{to:"/backlinks",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[f.jsx(qk,{className:"sidebar-icon"}),f.jsx("span",{children:"Backlinks"})]}),f.jsxs(rt,{to:"/settings",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[f.jsx(n2,{className:"sidebar-icon"}),f.jsx("span",{children:"Settings"})]}),i?f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"sidebar-section-title",children:"Projects"}),[1,2,3].map(te=>f.jsxs("div",{className:"sidebar-skeleton-item",children:[f.jsx("span",{className:"skeleton-circle size-2"}),f.jsx("span",{className:"skeleton-text flex-1",style:{width:`${50+te*15}%`}})]},te))]}):G&&G.projects.length>0?f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"sidebar-section-title",children:"Projects"}),G.projects.map(te=>{const de=te.visibilitySummary.tone;return f.jsxs(rt,{to:"/projects/$projectId",params:{projectId:te.project.id},className:"sidebar-project",activeProps:{className:"sidebar-project sidebar-project-active"},children:[f.jsx("span",{className:`sidebar-dot sidebar-dot-${de}`}),f.jsx("span",{children:te.project.displayName||te.project.name})]},te.project.id)})]}):i?null:f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"sidebar-section-title",children:"Resources"}),f.jsxs(rt,{to:"/setup",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[f.jsx(Wk,{className:"sidebar-icon"}),f.jsx("span",{children:"Setup"})]})]})]}),f.jsx("div",{className:"sidebar-footer",children:Ob.map(({label:te,href:de,Icon:Me})=>f.jsx("a",{className:"sidebar-footer-icon",href:de,target:"_blank",rel:"noopener noreferrer",title:te,"aria-label":te,children:f.jsx(Me,{className:"size-4"})},de))})]}),f.jsxs("div",{className:"main-area",children:[f.jsxs("header",{className:"topbar",children:[f.jsxs("div",{className:"topbar-left",children:[f.jsx("div",{className:"topbar-brand-mobile",children:f.jsx(wb,{compact:!0})}),f.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[f.jsx(rt,{to:"/",children:"Home"}),f.jsx($f,{className:"breadcrumb-sep size-3"}),f.jsx("span",{className:"breadcrumb-current",children:Ne})]})]}),f.jsxs("div",{className:"topbar-actions",children:[f.jsxs("div",{className:"health-pill-row",children:[f.jsxs("span",{className:`health-pill health-pill-${d.apiStatus.state}`,title:$s(d.apiStatus),children:["API ",d.apiStatus.state==="ok"?"ok":d.apiStatus.state]}),f.jsxs("span",{className:`health-pill health-pill-${d.workerStatus.state}`,title:$s(d.workerStatus),children:["Worker ",d.workerStatus.state==="ok"?"ok":d.workerStatus.state]})]}),f.jsxs(Le,{className:"nav-toggle",variant:"secondary",size:"icon",type:"button","aria-expanded":S,"aria-controls":"mobile-nav",onClick:()=>w(te=>!te),children:[f.jsx(Hk,{className:"size-4"}),f.jsx("span",{className:"sr-only",children:"Open navigation"})]})]})]}),f.jsxs("div",{id:"mobile-nav",className:`mobile-nav ${S?"mobile-nav-open":""}`,children:[f.jsxs(Le,{className:"mobile-nav-close",variant:"ghost",size:"icon",type:"button",onClick:()=>w(!1),children:[f.jsx(Hs,{className:"size-5"}),f.jsx("span",{className:"sr-only",children:"Close navigation"})]}),f.jsx(rt,{to:"/",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Overview"}),f.jsx(rt,{to:"/projects",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!1},children:"Projects"}),f.jsx(rt,{to:"/runs",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Runs"}),f.jsx(rt,{to:"/traffic",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!1},children:"Server traffic"}),f.jsx(rt,{to:"/settings",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Settings"}),G&&G.projects.length>0?f.jsxs("div",{className:"mobile-nav-section",children:[f.jsx("p",{className:"mobile-nav-section-title",children:"Projects"}),G.projects.map(te=>f.jsx(rt,{to:"/projects/$projectId",params:{projectId:te.project.id},className:"mobile-nav-link",children:te.project.name},te.project.id))]}):null]}),f.jsx("main",{id:"content",className:"page-shell",children:i&&!e?f.jsxs("div",{className:"page-skeleton",children:[f.jsxs("div",{className:"page-skeleton-header",children:[f.jsx("div",{className:"skeleton-text h-6 w-40"}),f.jsx("div",{className:"skeleton-text-sm w-72"})]}),f.jsx("div",{className:"page-skeleton-grid",children:[1,2,3].map(te=>f.jsxs("div",{className:"page-skeleton-card",children:[f.jsx("div",{className:"skeleton-text w-24"}),f.jsx("div",{className:"skeleton-text w-full"}),f.jsx("div",{className:"skeleton-text-sm w-3/4"})]},te))}),f.jsx("div",{className:"page-skeleton-grid",style:{gridTemplateColumns:"1fr 1fr"},children:[1,2].map(te=>f.jsxs("div",{className:"page-skeleton-card",children:[f.jsx("div",{className:"skeleton-text w-20"}),f.jsx("div",{className:"space-y-2",children:[1,2,3].map(de=>f.jsx("div",{className:"skeleton-text-sm w-full"},de))})]},te))})]}):f.jsx(Kb,{})}),f.jsxs("footer",{className:"footer",children:[f.jsxs("span",{className:"footer-brand",children:[f.jsx("span",{children:f.jsx("a",{href:"https://canonry.ai",children:"Canonry"})}),d.apiStatus.version&&d.apiStatus.version!=="unknown"?f.jsxs("span",{className:"footer-version",children:["v",d.apiStatus.version]}):null]}),f.jsx("div",{className:"footer-links",children:Ob.map(({label:te,href:de,Icon:Me})=>f.jsx("a",{href:de,target:"_blank",rel:"noopener noreferrer",title:te,"aria-label":te,className:"footer-icon",children:f.jsx(Me,{className:"size-3.5"})},de))})]})]}),R?f.jsxs(Q4,{open:!0,title:R.summary,subtitle:`${R.projectName} · ${R.kindLabel}`,onClose:v,children:[f.jsxs("div",{className:"flex flex-wrap items-center gap-x-5 gap-y-1 text-sm",children:[f.jsx(cp,{status:R.status}),f.jsx("span",{className:"text-zinc-400",children:R.startedAt}),f.jsx("span",{className:"text-zinc-500",children:R.duration}),f.jsx("span",{className:"text-zinc-600",children:R.triggerLabel})]}),R.status==="failed"&&R.statusDetail&&f.jsx("p",{className:"text-sm text-rose-300/80 mt-2",children:R.statusDetail}),f.jsxs("div",{className:"mt-4",children:[f.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-2",children:"Activity Log"}),X?f.jsx("p",{className:"text-sm text-zinc-500",children:"Loading run details..."}):K?.snapshots&&K.snapshots.length>0?f.jsxs("div",{className:"space-y-2",children:[K.snapshots.map(te=>f.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 p-3",children:[f.jsxs("div",{className:"flex items-center justify-between gap-2 mb-1",children:[f.jsx("p",{className:"text-sm font-medium text-zinc-200 truncate",children:te.query??"Unknown query"}),f.jsxs("div",{className:"flex items-center gap-1.5",children:[f.jsx(V4,{provider:te.provider}),f.jsx(H0,{variant:te.citationState===nc.cited?"success":"neutral",children:te.citationState})]})]}),te.model&&f.jsx("p",{className:"text-[11px] text-zinc-500 font-mono",children:te.model}),te.citedDomains.length>0&&f.jsxs("p",{className:"text-xs text-zinc-500 mt-1",children:[f.jsx("span",{className:"text-zinc-400",children:"Sources:"})," ",te.citedDomains.join(", ")]}),te.competitorOverlap.length>0&&f.jsxs("p",{className:"text-xs text-rose-400/80 mt-0.5",children:["Competitor cited: ",te.competitorOverlap.join(", ")]}),te.groundingSources&&te.groundingSources.length>0&&f.jsxs("details",{className:"mt-2",children:[f.jsxs("summary",{className:"text-xs text-zinc-500 cursor-pointer hover:text-zinc-400",children:[te.groundingSources.length," grounding source",te.groundingSources.length!==1?"s":""]}),f.jsx("ul",{className:"mt-1 space-y-0.5",children:te.groundingSources.map((de,Me)=>f.jsx("li",{className:"text-xs text-zinc-500 truncate",children:f.jsx("a",{href:de.uri,target:"_blank",rel:"noopener noreferrer",className:"hover:text-zinc-300",children:de.title||de.uri})},Me))})]}),te.answerText&&f.jsxs("details",{className:"mt-1",children:[f.jsx("summary",{className:"text-xs text-zinc-500 cursor-pointer hover:text-zinc-400",children:"Answer preview"}),f.jsx("p",{className:"mt-1 text-xs text-zinc-400 leading-relaxed whitespace-pre-wrap",children:te.answerText})]})]},te.id)),K.status==="running"&&f.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[f.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-amber-500 animate-pulse"}),"Running remaining queries..."]})]}):K&&K.status==="running"?f.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[f.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-amber-500 animate-pulse"}),"Waiting for first query result..."]}):K&&K.status==="queued"?f.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[f.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-zinc-500 animate-pulse"}),"Run queued, waiting for execution slot..."]}):K&&K.error?f.jsxs("div",{className:"rounded-lg border border-rose-800/40 bg-rose-950/20 p-3",children:[f.jsx("p",{className:"text-sm font-medium text-rose-300 mb-2",children:"Run failed"}),f.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:aO(K.error)})]}):f.jsx("p",{className:"text-sm text-zinc-500",children:"No snapshot data available."})]})]}):null,oe?f.jsx(F4,{evidence:oe.evidence,project:oe.project,onClose:v}):null,f.jsx(rD,{}),f.jsx(R3,{}),f.jsx(J3,{})]})}class lD extends U.Component{state={error:null};static getDerivedStateFromError(n){return{error:n}}componentDidCatch(n,i){console.error("[ErrorBoundary]",n,i.componentStack)}handleReset=()=>{this.setState({error:null})};render(){return this.state.error?f.jsx("div",{className:"page-container",children:f.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 py-20 text-center",children:[f.jsx("div",{className:"rounded-full bg-rose-950/40 p-3",children:f.jsx(gv,{className:"size-6 text-rose-400"})}),f.jsx("h2",{className:"text-lg font-semibold text-zinc-100",children:"Something went wrong"}),f.jsx("p",{className:"text-sm text-zinc-400 max-w-md",children:this.state.error.message||"An unexpected error occurred while rendering this page."}),f.jsxs("div",{className:"flex gap-3 mt-2",children:[f.jsxs(Le,{variant:"secondary",size:"sm",onClick:this.handleReset,children:[f.jsx(hv,{className:"size-3.5 mr-1.5"}),"Try again"]}),f.jsx(Le,{variant:"secondary",size:"sm",onClick:()=>{const n=window.__CANONRY_CONFIG__?.basePath?.replace(/\/$/,"")??"";window.location.href=n||"/"},children:"Go home"})]})]})}):this.props.children}}const xn=U.forwardRef(({className:e,...n},i)=>f.jsx("div",{ref:i,className:An("rounded-xl border border-zinc-800 bg-zinc-950/75 shadow-[0_0_0_1px_rgba(255,255,255,0.01)] backdrop-blur",e),...n}));xn.displayName="Card";const jf=U.forwardRef(({className:e,...n},i)=>f.jsx("div",{ref:i,className:An("flex flex-col gap-1.5 p-5",e),...n}));jf.displayName="CardHeader";const Nf=U.forwardRef(({className:e,...n},i)=>f.jsx("h3",{ref:i,className:An("font-medium tracking-tight text-zinc-50",e),...n}));Nf.displayName="CardTitle";const kf=U.forwardRef(({className:e,...n},i)=>f.jsx("p",{ref:i,className:An("text-sm text-zinc-500",e),...n}));kf.displayName="CardDescription";const Pl=U.forwardRef(({className:e,...n},i)=>f.jsx("div",{ref:i,className:An("p-5 pt-0",e),...n}));Pl.displayName="CardContent";function cD({points:e,tone:n}){const i=U.useId();if(e.length===0)return null;const r=42,l=132,c=5,d=Math.min(...e),g=Math.max(...e)-d||1,b=l-c*2,v=r-c*2,S=e.map((w,_)=>{const C=c+_/Math.max(e.length-1,1)*b,N=c+(1-(w-d)/g)*v;return`${C},${N}`}).join(" ");return f.jsxs("svg",{className:`sparkline sparkline-${n}`,viewBox:`0 0 ${l} ${r}`,"aria-hidden":"true",children:[f.jsx("defs",{children:f.jsx("clipPath",{id:i,children:f.jsx("rect",{x:c,y:c,width:b,height:v,rx:"8"})})}),f.jsx("line",{className:"sparkline-guide",x1:c,x2:l-c,y1:r-c,y2:r-c}),f.jsx("polyline",{clipPath:`url(#${i})`,points:S,vectorEffect:"non-scaling-stroke"})]})}function uD({project:e}){return f.jsxs(rt,{to:"/projects/$projectId",params:{projectId:e.project.id},className:"project-row cursor-pointer",children:[f.jsxs("div",{className:"project-row-primary",children:[f.jsxs("div",{children:[f.jsx("p",{className:"project-name",children:e.project.name}),f.jsx("p",{className:"project-domain",children:e.project.canonicalDomain})]}),f.jsx("p",{className:"project-insight",children:e.insight})]}),f.jsx("div",{className:"project-row-stat",children:f.jsxs("div",{className:"metric-inline-block",children:[f.jsx("p",{className:"metric-inline-label",children:"Answer Visibility"}),f.jsx("p",{className:`metric-inline-value ${e.visibilityTone==="caution"?"text-amber-400":""}`,children:e.visibilityScore}),f.jsx("p",{className:"metric-inline-delta",children:e.visibilityDelta}),e.providerCoverage&&f.jsx("p",{className:"text-[10px] font-medium text-amber-400/80",children:e.providerCoverage})]})}),f.jsx("div",{className:"project-row-stat",children:f.jsxs("div",{className:"metric-inline-block",children:[f.jsx("p",{className:"metric-inline-label",children:"Competitor Pressure"}),f.jsx("p",{className:"metric-inline-value",children:e.competitorPressureLabel}),f.jsxs("p",{className:"metric-inline-delta",children:[e.lastRun.kindLabel," · ",w0(e.lastRun.status)]})]})}),f.jsx("div",{className:"project-row-chart",children:f.jsx(cD,{points:e.trend,tone:k0(e.lastRun.status)})}),f.jsx("span",{className:"project-row-link",children:f.jsx($f,{className:"h-4 w-4 text-zinc-500"})})]})}function dD(){const e=vc(),{dashboard:n,isLoading:i}=Sc(),r=n??e?.dashboard;if(!r||i)return f.jsxs("div",{className:"page-skeleton",children:[f.jsxs("div",{className:"page-skeleton-header",children:[f.jsx("div",{className:"skeleton-text h-6 w-32"}),f.jsx("div",{className:"skeleton-text-sm w-64"})]}),f.jsx("div",{className:"space-y-3",children:[1,2,3].map(v=>f.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-4 flex items-center gap-4",children:[f.jsxs("div",{className:"flex-1 space-y-2",children:[f.jsx("div",{className:"skeleton-text w-36"}),f.jsx("div",{className:"skeleton-text-sm w-48"})]}),f.jsx("div",{className:"skeleton-text w-16"}),f.jsx("div",{className:"skeleton-text w-16"}),f.jsx("div",{className:"skeleton h-8 w-20 rounded"})]},v))})]});const l=r.portfolioOverview,m=dp(!e,e?.health).data??e?.health??{apiStatus:{label:"API",state:"checking",detail:"Checking service health"},workerStatus:{label:"Worker",state:"checking",detail:"Checking service health"}},g=LO(l.systemHealth,m,r.settings),{openRun:b}=fp();return f.jsxs("div",{className:"page-container",children:[f.jsxs("div",{className:"page-header",children:[f.jsxs("div",{className:"page-header-left",children:[f.jsx("h1",{className:"page-title",children:"Portfolio"}),f.jsx("p",{className:"page-subtitle",children:"Visibility and execution state across all projects"})]}),f.jsx("div",{className:"page-header-right",children:f.jsx("p",{className:"text-[11px] text-zinc-600",children:l.lastUpdatedAt})})]}),l.projects.length>0?f.jsx("div",{className:"project-list project-list-scrollable",children:l.projects.map(v=>f.jsx(uD,{project:v},v.project.id))}):f.jsxs(xn,{className:"surface-card empty-card",children:[f.jsx("h3",{children:l.emptyState?.title??"No projects yet"}),f.jsx("p",{className:"supporting-copy",children:l.emptyState?.detail}),f.jsx(Le,{size:"sm",asChild:!0,children:f.jsx(rt,{to:l.emptyState?.ctaHref==="/setup"||!l.emptyState?.ctaHref?"/setup":"/",children:l.emptyState?.ctaLabel??"Launch setup"})})]}),f.jsxs("div",{className:"overview-secondary-grid",children:[l.attentionItems.length>0&&f.jsxs("section",{className:"overview-secondary-section",children:[f.jsx("div",{className:"section-head section-head-inline",children:f.jsxs("div",{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"Needs attention"}),f.jsx("h2",{className:"section-title-sm",children:"What changed"})]})}),f.jsx("div",{className:"attention-list attention-list-scrollable",children:l.attentionItems.map(v=>f.jsxs(rt,{to:v.href,className:`attention-item attention-item-${v.tone}`,children:[f.jsxs("div",{children:[f.jsx("p",{className:"attention-title",children:v.title}),f.jsx("p",{className:"attention-detail",children:v.detail})]}),f.jsx("span",{className:"attention-action",children:v.actionLabel})]},v.id))})]}),f.jsxs("section",{className:"overview-secondary-section",children:[f.jsx("div",{className:"section-head section-head-inline",children:f.jsxs("div",{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"Recent runs"}),f.jsx("h2",{className:"section-title-sm",children:"Activity"})]})}),f.jsx("div",{className:"compact-stack compact-stack-scrollable",children:l.recentRuns.length>0?l.recentRuns.map(v=>f.jsxs("button",{className:"compact-run",type:"button",onClick:()=>b(v.id),children:[f.jsxs("div",{children:[f.jsx("p",{className:"compact-run-title",children:v.projectName}),f.jsx("p",{className:"compact-run-detail",children:v.summary})]}),f.jsx(cp,{status:v.status})]},v.id)):f.jsx("p",{className:"supporting-copy",children:"Run history appears here after the first launch."})})]})]}),f.jsxs("section",{className:"page-section",children:[f.jsx("div",{className:"section-head section-head-inline",children:f.jsxs("div",{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"System health"}),f.jsx("h2",{className:"section-title-sm",children:"Infrastructure"})]})}),f.jsx("div",{className:"health-grid",children:g.map(v=>f.jsxs(xn,{className:"surface-card compact-card",children:[f.jsxs("div",{className:"section-head",children:[f.jsxs("div",{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:v.label}),f.jsx("h3",{children:v.detail})]}),f.jsx(Mn,{tone:v.tone,title:v.id==="api"?$s(m.apiStatus):v.id==="worker"?$s(m.workerStatus):void 0,children:v.label})]}),f.jsx("p",{className:"supporting-copy",children:v.meta})]},v.id))})]})]})}const gp=Symbol.for("yaml.alias"),Af=Symbol.for("yaml.document"),Ha=Symbol.for("yaml.map"),n1=Symbol.for("yaml.pair"),Hn=Symbol.for("yaml.scalar"),Qs=Symbol.for("yaml.seq"),Nn=Symbol.for("yaml.node.type"),Ci=e=>!!e&&typeof e=="object"&&e[Nn]===gp,wc=e=>!!e&&typeof e=="object"&&e[Nn]===Af,co=e=>!!e&&typeof e=="object"&&e[Nn]===Ha,vt=e=>!!e&&typeof e=="object"&&e[Nn]===n1,nt=e=>!!e&&typeof e=="object"&&e[Nn]===Hn,uo=e=>!!e&&typeof e=="object"&&e[Nn]===Qs;function yt(e){if(e&&typeof e=="object")switch(e[Nn]){case Ha:case Qs:return!0}return!1}function bt(e){if(e&&typeof e=="object")switch(e[Nn]){case gp:case Ha:case Hn:case Qs:return!0}return!1}const a1=e=>(nt(e)||yt(e))&&!!e.anchor,vi=Symbol("break visit"),fD=Symbol("skip children"),no=Symbol("remove node");function Ys(e,n){const i=pD(n);wc(e)?Ts(null,e.contents,i,Object.freeze([e]))===no&&(e.contents=null):Ts(null,e,i,Object.freeze([]))}Ys.BREAK=vi;Ys.SKIP=fD;Ys.REMOVE=no;function Ts(e,n,i,r){const l=mD(e,n,i,r);if(bt(l)||vt(l))return hD(e,r,l),Ts(e,l,i,r);if(typeof l!="symbol"){if(yt(n)){r=Object.freeze(r.concat(n));for(let c=0;c<n.items.length;++c){const d=Ts(c,n.items[c],i,r);if(typeof d=="number")c=d-1;else{if(d===vi)return vi;d===no&&(n.items.splice(c,1),c-=1)}}}else if(vt(n)){r=Object.freeze(r.concat(n));const c=Ts("key",n.key,i,r);if(c===vi)return vi;c===no&&(n.key=null);const d=Ts("value",n.value,i,r);if(d===vi)return vi;d===no&&(n.value=null)}}return l}function pD(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 mD(e,n,i,r){if(typeof i=="function")return i(e,n,r);if(co(n))return i.Map?.(e,n,r);if(uo(n))return i.Seq?.(e,n,r);if(vt(n))return i.Pair?.(e,n,r);if(nt(n))return i.Scalar?.(e,n,r);if(Ci(n))return i.Alias?.(e,n,r)}function hD(e,n,i){const r=n[n.length-1];if(yt(r))r.items[e]=i;else if(vt(r))e==="key"?r.key=i:r.value=i;else if(wc(r))r.contents=i;else{const l=Ci(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${l} parent`)}}const gD={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},yD=e=>e.replace(/[!,[\]{}]/g,n=>gD[n]);class Gt{constructor(n,i){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},Gt.defaultYaml,n),this.tags=Object.assign({},Gt.defaultTags,i)}clone(){const n=new Gt(this.yaml,this.tags);return n.docStart=this.docStart,n}atDocument(){const n=new Gt(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:Gt.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},Gt.defaultTags);break}return n}add(n,i){this.atNextDocument&&(this.yaml={explicit:Gt.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},Gt.defaultTags),this.atNextDocument=!1);const r=n.trim().split(/[ \t]+/),l=r.shift();switch(l){case"%TAG":{if(r.length!==2&&(i(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;const[c,d]=r;return this.tags[c]=d,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return i(0,"%YAML directive should contain exactly one part"),!1;const[c]=r;if(c==="1.1"||c==="1.2")return this.yaml.version=c,!0;{const d=/^\d+\.\d+$/.test(c);return i(6,`Unsupported YAML version ${c}`,d),!1}}default:return i(0,`Unknown directive ${l}`,!0),!1}}tagName(n,i){if(n==="!")return"!";if(n[0]!=="!")return i(`Not a valid tag: ${n}`),null;if(n[1]==="<"){const d=n.slice(2,-1);return d==="!"||d==="!!"?(i(`Verbatim tags aren't resolved, so ${n} is invalid.`),null):(n[n.length-1]!==">"&&i("Verbatim tags must end with a >"),d)}const[,r,l]=n.match(/^(.*!)([^!]*)$/s);l||i(`The ${n} tag has no suffix`);const c=this.tags[r];if(c)try{return c+decodeURIComponent(l)}catch(d){return i(String(d)),null}return r==="!"?n:(i(`Could not resolve tag: ${n}`),null)}tagString(n){for(const[i,r]of Object.entries(this.tags))if(n.startsWith(r))return i+yD(n.substring(r.length));return n[0]==="!"?n:`!<${n}>`}toString(n){const i=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags);let l;if(n&&r.length>0&&bt(n.contents)){const c={};Ys(n.contents,(d,m)=>{bt(m)&&m.tag&&(c[m.tag]=!0)}),l=Object.keys(c)}else l=[];for(const[c,d]of r)c==="!!"&&d==="tag:yaml.org,2002:"||(!n||l.some(m=>m.startsWith(d)))&&i.push(`%TAG ${c} ${d}`);return i.join(`
65
+ `)}}Gt.defaultYaml={explicit:!1,version:"1.2"};Gt.defaultTags={"!!":"tag:yaml.org,2002:"};function i1(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const i=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(i)}return!0}function s1(e){const n=new Set;return Ys(e,{Value(i,r){r.anchor&&n.add(r.anchor)}}),n}function r1(e,n){for(let i=1;;++i){const r=`${e}${i}`;if(!n.has(r))return r}}function bD(e,n){const i=[],r=new Map;let l=null;return{onAnchor:c=>{i.push(c),l??(l=s1(e));const d=r1(n,l);return l.add(d),d},setAnchors:()=>{for(const c of i){const d=r.get(c);if(typeof d=="object"&&d.anchor&&(nt(d.node)||yt(d.node)))d.node.anchor=d.anchor;else{const m=new Error("Failed to resolve repeated object (this should not happen)");throw m.source=c,m}}},sourceObjects:r}}function Es(e,n,i,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let l=0,c=r.length;l<c;++l){const d=r[l],m=Es(e,r,String(l),d);m===void 0?delete r[l]:m!==d&&(r[l]=m)}else if(r instanceof Map)for(const l of Array.from(r.keys())){const c=r.get(l),d=Es(e,r,l,c);d===void 0?r.delete(l):d!==c&&r.set(l,d)}else if(r instanceof Set)for(const l of Array.from(r)){const c=Es(e,r,l,l);c===void 0?r.delete(l):c!==l&&(r.delete(l),r.add(c))}else for(const[l,c]of Object.entries(r)){const d=Es(e,r,l,c);d===void 0?delete r[l]:d!==c&&(r[l]=d)}return e.call(n,i,r)}function jn(e,n,i){if(Array.isArray(e))return e.map((r,l)=>jn(r,String(l),i));if(e&&typeof e.toJSON=="function"){if(!i||!a1(e))return e.toJSON(n,i);const r={aliasCount:0,count:1,res:void 0};i.anchors.set(e,r),i.onCreate=c=>{r.res=c,delete i.onCreate};const l=e.toJSON(n,i);return i.onCreate&&i.onCreate(l),l}return typeof e=="bigint"&&!i?.keep?Number(e):e}class yp{constructor(n){Object.defineProperty(this,Nn,{value:n})}clone(){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(n.range=this.range.slice()),n}toJS(n,{mapAsMap:i,maxAliasCount:r,onAnchor:l,reviver:c}={}){if(!wc(n))throw new TypeError("A document argument is required");const d={anchors:new Map,doc:n,keep:!0,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},m=jn(this,"",d);if(typeof l=="function")for(const{count:g,res:b}of d.anchors.values())l(b,g);return typeof c=="function"?Es(c,{"":m},"",m):m}}class bp extends yp{constructor(n){super(gp),this.source=n,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(n,i){let r;i?.aliasResolveCache?r=i.aliasResolveCache:(r=[],Ys(n,{Node:(c,d)=>{(Ci(d)||a1(d))&&r.push(d)}}),i&&(i.aliasResolveCache=r));let l;for(const c of r){if(c===this)break;c.anchor===this.source&&(l=c)}return l}toJSON(n,i){if(!i)return{source:this.source};const{anchors:r,doc:l,maxAliasCount:c}=i,d=this.resolve(l,i);if(!d){const g=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(g)}let m=r.get(d);if(m||(jn(d,null,i),m=r.get(d)),m?.res===void 0){const g="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(g)}if(c>=0&&(m.count+=1,m.aliasCount===0&&(m.aliasCount=Kl(l,d,r)),m.count*m.aliasCount>c)){const g="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(g)}return m.res}toString(n,i,r){const l=`*${this.source}`;if(n){if(i1(this.source),n.options.verifyAliasOrder&&!n.anchors.has(this.source)){const c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(c)}if(n.implicitKey)return`${l} `}return l}}function Kl(e,n,i){if(Ci(n)){const r=n.resolve(e),l=i&&r&&i.get(r);return l?l.count*l.aliasCount:0}else if(yt(n)){let r=0;for(const l of n.items){const c=Kl(e,l,i);c>r&&(r=c)}return r}else if(vt(n)){const r=Kl(e,n.key,i),l=Kl(e,n.value,i);return Math.max(r,l)}return 1}const o1=e=>!e||typeof e!="function"&&typeof e!="object";class ke extends yp{constructor(n){super(Hn),this.value=n}toJSON(n,i){return i?.keep?this.value:jn(this.value,n,i)}toString(){return String(this.value)}}ke.BLOCK_FOLDED="BLOCK_FOLDED";ke.BLOCK_LITERAL="BLOCK_LITERAL";ke.PLAIN="PLAIN";ke.QUOTE_DOUBLE="QUOTE_DOUBLE";ke.QUOTE_SINGLE="QUOTE_SINGLE";const vD="tag:yaml.org,2002:";function SD(e,n,i){if(n){const r=i.filter(c=>c.tag===n),l=r.find(c=>!c.format)??r[0];if(!l)throw new Error(`Tag ${n} not found`);return l}return i.find(r=>r.identify?.(e)&&!r.format)}function ro(e,n,i){if(wc(e)&&(e=e.contents),bt(e))return e;if(vt(e)){const S=i.schema[Ha].createNode?.(i.schema,null,i);return S.items.push(e),S}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:r,onAnchor:l,onTagObj:c,schema:d,sourceObjects:m}=i;let g;if(r&&e&&typeof e=="object"){if(g=m.get(e),g)return g.anchor??(g.anchor=l(e)),new bp(g.anchor);g={anchor:null,node:null},m.set(e,g)}n?.startsWith("!!")&&(n=vD+n.slice(2));let b=SD(e,n,d.tags);if(!b){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const S=new ke(e);return g&&(g.node=S),S}b=e instanceof Map?d[Ha]:Symbol.iterator in Object(e)?d[Qs]:d[Ha]}c&&(c(b),delete i.onTagObj);const v=b?.createNode?b.createNode(i.schema,e,i):typeof b?.nodeClass?.from=="function"?b.nodeClass.from(i.schema,e,i):new ke(e);return n?v.tag=n:b.default||(v.tag=b.tag),g&&(g.node=v),v}function oc(e,n,i){let r=i;for(let l=n.length-1;l>=0;--l){const c=n[l];if(typeof c=="number"&&Number.isInteger(c)&&c>=0){const d=[];d[c]=r,r=d}else r=new Map([[c,r]])}return ro(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const to=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class l1 extends yp{constructor(n,i){super(n),Object.defineProperty(this,"schema",{value:i,configurable:!0,enumerable:!1,writable:!0})}clone(n){const i=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return n&&(i.schema=n),i.items=i.items.map(r=>bt(r)||vt(r)?r.clone(n):r),this.range&&(i.range=this.range.slice()),i}addIn(n,i){if(to(n))this.add(i);else{const[r,...l]=n,c=this.get(r,!0);if(yt(c))c.addIn(l,i);else if(c===void 0&&this.schema)this.set(r,oc(this.schema,l,i));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${l}`)}}deleteIn(n){const[i,...r]=n;if(r.length===0)return this.delete(i);const l=this.get(i,!0);if(yt(l))return l.deleteIn(r);throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}getIn(n,i){const[r,...l]=n,c=this.get(r,!0);return l.length===0?!i&&nt(c)?c.value:c:yt(c)?c.getIn(l,i):void 0}hasAllNullValues(n){return this.items.every(i=>{if(!vt(i))return!1;const r=i.value;return r==null||n&&nt(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(n){const[i,...r]=n;if(r.length===0)return this.has(i);const l=this.get(i,!0);return yt(l)?l.hasIn(r):!1}setIn(n,i){const[r,...l]=n;if(l.length===0)this.set(r,i);else{const c=this.get(r,!0);if(yt(c))c.setIn(l,i);else if(c===void 0&&this.schema)this.set(r,oc(this.schema,l,i));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${l}`)}}}const xD=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function pa(e,n){return/^\n+$/.test(e)?e.substring(1):n?e.replace(/^(?! *$)/gm,n):e}const Si=(e,n,i)=>e.endsWith(`
66
+ `)?pa(i,n):i.includes(`
67
+ `)?`
68
+ `+pa(i,n):(e.endsWith(" ")?"":" ")+i,c1="flow",_f="block",Ql="quoted";function jc(e,n,i="flow",{indentAtStart:r,lineWidth:l=80,minContentWidth:c=20,onFold:d,onOverflow:m}={}){if(!l||l<0)return e;l<c&&(c=0);const g=Math.max(1+c,1+l-n.length);if(e.length<=g)return e;const b=[],v={};let S=l-n.length;typeof r=="number"&&(r>l-Math.max(2,c)?b.push(0):S=l-r);let w,_,C=!1,N=-1,T=-1,L=-1;i===_f&&(N=Rb(e,N,n.length),N!==-1&&(S=N+g));for(let J;J=e[N+=1];){if(i===Ql&&J==="\\"){switch(T=N,e[N+1]){case"x":N+=3;break;case"u":N+=5;break;case"U":N+=9;break;default:N+=1}L=N}if(J===`
69
+ `)i===_f&&(N=Rb(e,N,n.length)),S=N+n.length+g,w=void 0;else{if(J===" "&&_&&_!==" "&&_!==`
70
+ `&&_!==" "){const K=e[N+1];K&&K!==" "&&K!==`
71
+ `&&K!==" "&&(w=N)}if(N>=S)if(w)b.push(w),S=w+g,w=void 0;else if(i===Ql){for(;_===" "||_===" ";)_=J,J=e[N+=1],C=!0;const K=N>L+1?N-2:T-1;if(v[K])return e;b.push(K),v[K]=!0,S=K+g,w=void 0}else C=!0}_=J}if(C&&m&&m(),b.length===0)return e;d&&d();let Z=e.slice(0,b[0]);for(let J=0;J<b.length;++J){const K=b[J],X=b[J+1]||e.length;K===0?Z=`
72
+ ${n}${e.slice(0,X)}`:(i===Ql&&v[K]&&(Z+=`${e[K]}\\`),Z+=`
73
+ ${n}${e.slice(K+1,X)}`)}return Z}function Rb(e,n,i){let r=n,l=n+1,c=e[l];for(;c===" "||c===" ";)if(n<l+i)c=e[++n];else{do c=e[++n];while(c&&c!==`
74
+ `);r=n,l=n+1,c=e[l]}return r}const Nc=(e,n)=>({indentAtStart:n?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),kc=e=>/^(%|---|\.\.\.)/m.test(e);function wD(e,n,i){if(!n||n<0)return!1;const r=n-i,l=e.length;if(l<=r)return!1;for(let c=0,d=0;c<l;++c)if(e[c]===`
75
+ `){if(c-d>r)return!0;if(d=c+1,l-d<=r)return!1}return!0}function ao(e,n){const i=JSON.stringify(e);if(n.options.doubleQuotedAsJSON)return i;const{implicitKey:r}=n,l=n.options.doubleQuotedMinMultiLineLength,c=n.indent||(kc(e)?" ":"");let d="",m=0;for(let g=0,b=i[g];b;b=i[++g])if(b===" "&&i[g+1]==="\\"&&i[g+2]==="n"&&(d+=i.slice(m,g)+"\\ ",g+=1,m=g,b="\\"),b==="\\")switch(i[g+1]){case"u":{d+=i.slice(m,g);const v=i.substr(g+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+=i.substr(g,6)}g+=5,m=g+1}break;case"n":if(r||i[g+2]==='"'||i.length<l)g+=1;else{for(d+=i.slice(m,g)+`
76
+
77
+ `;i[g+2]==="\\"&&i[g+3]==="n"&&i[g+4]!=='"';)d+=`
78
+ `,g+=2;d+=c,i[g+2]===" "&&(d+="\\"),g+=1,m=g+1}break;default:g+=1}return d=m?d+i.slice(m):i,r?d:jc(d,c,Ql,Nc(n,!1))}function zf(e,n){if(n.options.singleQuote===!1||n.implicitKey&&e.includes(`
79
+ `)||/[ \t]\n|\n[ \t]/.test(e))return ao(e,n);const i=n.indent||(kc(e)?" ":""),r="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
80
+ ${i}`)+"'";return n.implicitKey?r:jc(r,i,c1,Nc(n,!1))}function Os(e,n){const{singleQuote:i}=n.options;let r;if(i===!1)r=ao;else{const l=e.includes('"'),c=e.includes("'");l&&!c?r=zf:c&&!l?r=ao:r=i?zf:ao}return r(e,n)}let Cf;try{Cf=new RegExp(`(^|(?<!
81
+ ))
82
+ +(?!
83
+ |$)`,"g")}catch{Cf=/\n+(?!\n|$)/g}function Yl({comment:e,type:n,value:i},r,l,c){const{blockQuote:d,commentString:m,lineWidth:g}=r.options;if(!d||/\n[\t ]+$/.test(i))return Os(i,r);const b=r.indent||(r.forceBlockIndent||kc(i)?" ":""),v=d==="literal"?!0:d==="folded"||n===ke.BLOCK_FOLDED?!1:n===ke.BLOCK_LITERAL?!0:!wD(i,g,b.length);if(!i)return v?`|
84
+ `:`>
85
+ `;let S,w;for(w=i.length;w>0;--w){const X=i[w-1];if(X!==`
86
+ `&&X!==" "&&X!==" ")break}let _=i.substring(w);const C=_.indexOf(`
87
+ `);C===-1?S="-":i===_||C!==_.length-1?(S="+",c&&c()):S="",_&&(i=i.slice(0,-_.length),_[_.length-1]===`
88
+ `&&(_=_.slice(0,-1)),_=_.replace(Cf,`$&${b}`));let N=!1,T,L=-1;for(T=0;T<i.length;++T){const X=i[T];if(X===" ")N=!0;else if(X===`
89
+ `)L=T;else break}let Z=i.substring(0,L<T?L+1:T);Z&&(i=i.substring(Z.length),Z=Z.replace(/\n+/g,`$&${b}`));let K=(N?b?"2":"1":"")+S;if(e&&(K+=" "+m(e.replace(/ ?[\r\n]+/g," ")),l&&l()),!v){const X=i.replace(/\n+/g,`
90
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${b}`);let G=!1;const D=Nc(r,!0);d!=="folded"&&n!==ke.BLOCK_FOLDED&&(D.onOverflow=()=>{G=!0});const R=jc(`${Z}${X}${_}`,b,_f,D);if(!G)return`>${K}
91
+ ${b}${R}`}return i=i.replace(/\n+/g,`$&${b}`),`|${K}
92
+ ${b}${Z}${i}${_}`}function jD(e,n,i,r){const{type:l,value:c}=e,{actualString:d,implicitKey:m,indent:g,indentStep:b,inFlow:v}=n;if(m&&c.includes(`
93
+ `)||v&&/[[\]{},]/.test(c))return Os(c,n);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(c))return m||v||!c.includes(`
94
+ `)?Os(c,n):Yl(e,n,i,r);if(!m&&!v&&l!==ke.PLAIN&&c.includes(`
95
+ `))return Yl(e,n,i,r);if(kc(c)){if(g==="")return n.forceBlockIndent=!0,Yl(e,n,i,r);if(m&&g===b)return Os(c,n)}const S=c.replace(/\n+/g,`$&
96
+ ${g}`);if(d){const w=N=>N.default&&N.tag!=="tag:yaml.org,2002:str"&&N.test?.test(S),{compat:_,tags:C}=n.doc.schema;if(C.some(w)||_?.some(w))return Os(c,n)}return m?S:jc(S,g,c1,Nc(n,!1))}function vp(e,n,i,r){const{implicitKey:l,inFlow:c}=n,d=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:m}=e;m!==ke.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(d.value)&&(m=ke.QUOTE_DOUBLE);const g=v=>{switch(v){case ke.BLOCK_FOLDED:case ke.BLOCK_LITERAL:return l||c?Os(d.value,n):Yl(d,n,i,r);case ke.QUOTE_DOUBLE:return ao(d.value,n);case ke.QUOTE_SINGLE:return zf(d.value,n);case ke.PLAIN:return jD(d,n,i,r);default:return null}};let b=g(m);if(b===null){const{defaultKeyType:v,defaultStringType:S}=n.options,w=l&&v||S;if(b=g(w),b===null)throw new Error(`Unsupported default string type ${w}`)}return b}function u1(e,n){const i=Object.assign({blockQuote:!0,commentString:xD,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,n);let r;switch(i.collectionStyle){case"block":r=!1;break;case"flow":r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:i.flowCollectionPadding?" ":"",indent:"",indentStep:typeof i.indent=="number"?" ".repeat(i.indent):" ",inFlow:r,options:i}}function ND(e,n){if(n.tag){const l=e.filter(c=>c.tag===n.tag);if(l.length>0)return l.find(c=>c.format===n.format)??l[0]}let i,r;if(nt(n)){r=n.value;let l=e.filter(c=>c.identify?.(r));if(l.length>1){const c=l.filter(d=>d.test);c.length>0&&(l=c)}i=l.find(c=>c.format===n.format)??l.find(c=>!c.format)}else r=n,i=e.find(l=>l.nodeClass&&r instanceof l.nodeClass);if(!i){const l=r?.constructor?.name??(r===null?"null":typeof r);throw new Error(`Tag not resolved for ${l} value`)}return i}function kD(e,n,{anchors:i,doc:r}){if(!r.directives)return"";const l=[],c=(nt(e)||yt(e))&&e.anchor;c&&i1(c)&&(i.add(c),l.push(`&${c}`));const d=e.tag??(n.default?null:n.tag);return d&&l.push(r.directives.tagString(d)),l.join(" ")}function Us(e,n,i,r){if(vt(e))return e.toString(n,i,r);if(Ci(e)){if(n.doc.directives)return e.toString(n);if(n.resolvedAliases?.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");n.resolvedAliases?n.resolvedAliases.add(e):n.resolvedAliases=new Set([e]),e=e.resolve(n.doc)}let l;const c=bt(e)?e:n.doc.createNode(e,{onTagObj:g=>l=g});l??(l=ND(n.doc.schema.tags,c));const d=kD(c,l,n);d.length>0&&(n.indentAtStart=(n.indentAtStart??0)+d.length+1);const m=typeof l.stringify=="function"?l.stringify(c,n,i,r):nt(c)?vp(c,n,i,r):c.toString(n,i,r);return d?nt(c)||m[0]==="{"||m[0]==="["?`${d} ${m}`:`${d}
97
+ ${n.indent}${m}`:m}function AD({key:e,value:n},i,r,l){const{allNullValues:c,doc:d,indent:m,indentStep:g,options:{commentString:b,indentSeq:v,simpleKeys:S}}=i;let w=bt(e)&&e.comment||null;if(S){if(w)throw new Error("With simple keys, key nodes cannot have comments");if(yt(e)||!bt(e)&&typeof e=="object"){const D="With simple keys, collection cannot be used as a key value";throw new Error(D)}}let _=!S&&(!e||w&&n==null&&!i.inFlow||yt(e)||(nt(e)?e.type===ke.BLOCK_FOLDED||e.type===ke.BLOCK_LITERAL:typeof e=="object"));i=Object.assign({},i,{allNullValues:!1,implicitKey:!_&&(S||!c),indent:m+g});let C=!1,N=!1,T=Us(e,i,()=>C=!0,()=>N=!0);if(!_&&!i.inFlow&&T.length>1024){if(S)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");_=!0}if(i.inFlow){if(c||n==null)return C&&r&&r(),T===""?"?":_?`? ${T}`:T}else if(c&&!S||n==null&&_)return T=`? ${T}`,w&&!C?T+=Si(T,i.indent,b(w)):N&&l&&l(),T;C&&(w=null),_?(w&&(T+=Si(T,i.indent,b(w))),T=`? ${T}
98
+ ${m}:`):(T=`${T}:`,w&&(T+=Si(T,i.indent,b(w))));let L,Z,J;bt(n)?(L=!!n.spaceBefore,Z=n.commentBefore,J=n.comment):(L=!1,Z=null,J=null,n&&typeof n=="object"&&(n=d.createNode(n))),i.implicitKey=!1,!_&&!w&&nt(n)&&(i.indentAtStart=T.length+1),N=!1,!v&&g.length>=2&&!i.inFlow&&!_&&uo(n)&&!n.flow&&!n.tag&&!n.anchor&&(i.indent=i.indent.substring(2));let K=!1;const X=Us(n,i,()=>K=!0,()=>N=!0);let G=" ";if(w||L||Z){if(G=L?`
99
+ `:"",Z){const D=b(Z);G+=`
100
+ ${pa(D,i.indent)}`}X===""&&!i.inFlow?G===`
101
+ `&&J&&(G=`
102
+
103
+ `):G+=`
104
+ ${i.indent}`}else if(!_&&yt(n)){const D=X[0],R=X.indexOf(`
105
+ `),oe=R!==-1,Ne=i.inFlow??n.flow??n.items.length===0;if(oe||!Ne){let te=!1;if(oe&&(D==="&"||D==="!")){let de=X.indexOf(" ");D==="&"&&de!==-1&&de<R&&X[de+1]==="!"&&(de=X.indexOf(" ",de+1)),(de===-1||R<de)&&(te=!0)}te||(G=`
106
+ ${i.indent}`)}}else(X===""||X[0]===`
107
+ `)&&(G="");return T+=G+X,i.inFlow?K&&r&&r():J&&!K?T+=Si(T,i.indent,b(J)):N&&l&&l(),T}function _D(e,n){(e==="debug"||e==="warn")&&console.warn(n)}const Ul="<<",ma={identify:e=>e===Ul||typeof e=="symbol"&&e.description===Ul,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new ke(Symbol(Ul)),{addToJSMap:d1}),stringify:()=>Ul},zD=(e,n)=>(ma.identify(n)||nt(n)&&(!n.type||n.type===ke.PLAIN)&&ma.identify(n.value))&&e?.doc.schema.tags.some(i=>i.tag===ma.tag&&i.default);function d1(e,n,i){if(i=e&&Ci(i)?i.resolve(e.doc):i,uo(i))for(const r of i.items)sf(e,n,r);else if(Array.isArray(i))for(const r of i)sf(e,n,r);else sf(e,n,i)}function sf(e,n,i){const r=e&&Ci(i)?i.resolve(e.doc):i;if(!co(r))throw new Error("Merge sources must be maps or map aliases");const l=r.toJSON(null,e,Map);for(const[c,d]of l)n instanceof Map?n.has(c)||n.set(c,d):n instanceof Set?n.add(c):Object.prototype.hasOwnProperty.call(n,c)||Object.defineProperty(n,c,{value:d,writable:!0,enumerable:!0,configurable:!0});return n}function f1(e,n,{key:i,value:r}){if(bt(i)&&i.addToJSMap)i.addToJSMap(e,n,r);else if(zD(e,i))d1(e,n,r);else{const l=jn(i,"",e);if(n instanceof Map)n.set(l,jn(r,l,e));else if(n instanceof Set)n.add(l);else{const c=CD(i,l,e),d=jn(r,c,e);c in n?Object.defineProperty(n,c,{value:d,writable:!0,enumerable:!0,configurable:!0}):n[c]=d}}return n}function CD(e,n,i){if(n===null)return"";if(typeof n!="object")return String(n);if(bt(e)&&i?.doc){const r=u1(i.doc,{});r.anchors=new Set;for(const c of i.anchors.keys())r.anchors.add(c.anchor);r.inFlow=!0,r.inStringifyKey=!0;const l=e.toString(r);if(!i.mapKeyWarned){let c=JSON.stringify(l);c.length>40&&(c=c.substring(0,36)+'..."'),_D(i.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${c}. Set mapAsMap: true to use object keys.`),i.mapKeyWarned=!0}return l}return JSON.stringify(n)}function Sp(e,n,i){const r=ro(e,void 0,i),l=ro(n,void 0,i);return new Ht(r,l)}class Ht{constructor(n,i=null){Object.defineProperty(this,Nn,{value:n1}),this.key=n,this.value=i}clone(n){let{key:i,value:r}=this;return bt(i)&&(i=i.clone(n)),bt(r)&&(r=r.clone(n)),new Ht(i,r)}toJSON(n,i){const r=i?.mapAsMap?new Map:{};return f1(i,r,this)}toString(n,i,r){return n?.doc?AD(this,n,i,r):JSON.stringify(this)}}function p1(e,n,i){return(n.inFlow??e.flow?ED:TD)(e,n,i)}function TD({comment:e,items:n},i,{blockItemPrefix:r,flowChars:l,itemIndent:c,onChompKeep:d,onComment:m}){const{indent:g,options:{commentString:b}}=i,v=Object.assign({},i,{indent:c,type:null});let S=!1;const w=[];for(let C=0;C<n.length;++C){const N=n[C];let T=null;if(bt(N))!S&&N.spaceBefore&&w.push(""),lc(i,w,N.commentBefore,S),N.comment&&(T=N.comment);else if(vt(N)){const Z=bt(N.key)?N.key:null;Z&&(!S&&Z.spaceBefore&&w.push(""),lc(i,w,Z.commentBefore,S))}S=!1;let L=Us(N,v,()=>T=null,()=>S=!0);T&&(L+=Si(L,c,b(T))),S&&T&&(S=!1),w.push(r+L)}let _;if(w.length===0)_=l.start+l.end;else{_=w[0];for(let C=1;C<w.length;++C){const N=w[C];_+=N?`
108
+ ${g}${N}`:`
109
+ `}}return e?(_+=`
110
+ `+pa(b(e),g),m&&m()):S&&d&&d(),_}function ED({items:e},n,{flowChars:i,itemIndent:r}){const{indent:l,indentStep:c,flowCollectionPadding:d,options:{commentString:m}}=n;r+=c;const g=Object.assign({},n,{indent:r,inFlow:!0,type:null});let b=!1,v=0;const S=[];for(let C=0;C<e.length;++C){const N=e[C];let T=null;if(bt(N))N.spaceBefore&&S.push(""),lc(n,S,N.commentBefore,!1),N.comment&&(T=N.comment);else if(vt(N)){const Z=bt(N.key)?N.key:null;Z&&(Z.spaceBefore&&S.push(""),lc(n,S,Z.commentBefore,!1),Z.comment&&(b=!0));const J=bt(N.value)?N.value:null;J?(J.comment&&(T=J.comment),J.commentBefore&&(b=!0)):N.value==null&&Z?.comment&&(T=Z.comment)}T&&(b=!0);let L=Us(N,g,()=>T=null);C<e.length-1&&(L+=","),T&&(L+=Si(L,r,m(T))),!b&&(S.length>v||L.includes(`
111
+ `))&&(b=!0),S.push(L),v=S.length}const{start:w,end:_}=i;if(S.length===0)return w+_;if(!b){const C=S.reduce((N,T)=>N+T.length+2,2);b=n.options.lineWidth>0&&C>n.options.lineWidth}if(b){let C=w;for(const N of S)C+=N?`
112
+ ${c}${l}${N}`:`
113
+ `;return`${C}
114
+ ${l}${_}`}else return`${w}${d}${S.join(" ")}${d}${_}`}function lc({indent:e,options:{commentString:n}},i,r,l){if(r&&l&&(r=r.replace(/^\n+/,"")),r){const c=pa(n(r),e);i.push(c.trimStart())}}function xi(e,n){const i=nt(n)?n.value:n;for(const r of e)if(vt(r)&&(r.key===n||r.key===i||nt(r.key)&&r.key.value===i))return r}class wn extends l1{static get tagName(){return"tag:yaml.org,2002:map"}constructor(n){super(Ha,n),this.items=[]}static from(n,i,r){const{keepUndefined:l,replacer:c}=r,d=new this(n),m=(g,b)=>{if(typeof c=="function")b=c.call(i,g,b);else if(Array.isArray(c)&&!c.includes(g))return;(b!==void 0||l)&&d.items.push(Sp(g,b,r))};if(i instanceof Map)for(const[g,b]of i)m(g,b);else if(i&&typeof i=="object")for(const g of Object.keys(i))m(g,i[g]);return typeof n.sortMapEntries=="function"&&d.items.sort(n.sortMapEntries),d}add(n,i){let r;vt(n)?r=n:!n||typeof n!="object"||!("key"in n)?r=new Ht(n,n?.value):r=new Ht(n.key,n.value);const l=xi(this.items,r.key),c=this.schema?.sortMapEntries;if(l){if(!i)throw new Error(`Key ${r.key} already set`);nt(l.value)&&o1(r.value)?l.value.value=r.value:l.value=r.value}else if(c){const d=this.items.findIndex(m=>c(r,m)<0);d===-1?this.items.push(r):this.items.splice(d,0,r)}else this.items.push(r)}delete(n){const i=xi(this.items,n);return i?this.items.splice(this.items.indexOf(i),1).length>0:!1}get(n,i){const l=xi(this.items,n)?.value;return(!i&&nt(l)?l.value:l)??void 0}has(n){return!!xi(this.items,n)}set(n,i){this.add(new Ht(n,i),!0)}toJSON(n,i,r){const l=r?new r:i?.mapAsMap?new Map:{};i?.onCreate&&i.onCreate(l);for(const c of this.items)f1(i,l,c);return l}toString(n,i,r){if(!n)return JSON.stringify(this);for(const l of this.items)if(!vt(l))throw new Error(`Map items must all be pairs; found ${JSON.stringify(l)} instead`);return!n.allNullValues&&this.hasAllNullValues(!1)&&(n=Object.assign({},n,{allNullValues:!0})),p1(this,n,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:n.indent||"",onChompKeep:r,onComment:i})}}const Xs={collection:"map",default:!0,nodeClass:wn,tag:"tag:yaml.org,2002:map",resolve(e,n){return co(e)||n("Expected a mapping for this tag"),e},createNode:(e,n,i)=>wn.from(e,n,i)};class ki extends l1{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(n){super(Qs,n),this.items=[]}add(n){this.items.push(n)}delete(n){const i=Vl(n);return typeof i!="number"?!1:this.items.splice(i,1).length>0}get(n,i){const r=Vl(n);if(typeof r!="number")return;const l=this.items[r];return!i&&nt(l)?l.value:l}has(n){const i=Vl(n);return typeof i=="number"&&i<this.items.length}set(n,i){const r=Vl(n);if(typeof r!="number")throw new Error(`Expected a valid index, not ${n}.`);const l=this.items[r];nt(l)&&o1(i)?l.value=i:this.items[r]=i}toJSON(n,i){const r=[];i?.onCreate&&i.onCreate(r);let l=0;for(const c of this.items)r.push(jn(c,String(l++),i));return r}toString(n,i,r){return n?p1(this,n,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(n.indent||"")+" ",onChompKeep:r,onComment:i}):JSON.stringify(this)}static from(n,i,r){const{replacer:l}=r,c=new this(n);if(i&&Symbol.iterator in Object(i)){let d=0;for(let m of i){if(typeof l=="function"){const g=i instanceof Set?m:String(d++);m=l.call(i,g,m)}c.items.push(ro(m,void 0,r))}}return c}}function Vl(e){let n=nt(e)?e.value:e;return n&&typeof n=="string"&&(n=Number(n)),typeof n=="number"&&Number.isInteger(n)&&n>=0?n:null}const Js={collection:"seq",default:!0,nodeClass:ki,tag:"tag:yaml.org,2002:seq",resolve(e,n){return uo(e)||n("Expected a sequence for this tag"),e},createNode:(e,n,i)=>ki.from(e,n,i)},Ac={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,n,i,r){return n=Object.assign({actualString:!0},n),vp(e,n,i,r)}},_c={identify:e=>e==null,createNode:()=>new ke(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new ke(null),stringify:({source:e},n)=>typeof e=="string"&&_c.test.test(e)?e:n.options.nullStr},xp={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new ke(e[0]==="t"||e[0]==="T"),stringify({source:e,value:n},i){if(e&&xp.test.test(e)){const r=e[0]==="t"||e[0]==="T";if(n===r)return e}return n?i.options.trueStr:i.options.falseStr}};function Bn({format:e,minFractionDigits:n,tag:i,value:r}){if(typeof r=="bigint")return String(r);const l=typeof r=="number"?r:Number(r);if(!isFinite(l))return isNaN(l)?".nan":l<0?"-.inf":".inf";let c=Object.is(r,-0)?"-0":JSON.stringify(r);if(!e&&n&&(!i||i==="tag:yaml.org,2002:float")&&/^\d/.test(c)){let d=c.indexOf(".");d<0&&(d=c.length,c+=".");let m=n-(c.length-d-1);for(;m-- >0;)c+="0"}return c}const m1={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Bn},h1={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 n=Number(e.value);return isFinite(n)?n.toExponential():Bn(e)}},g1={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){const n=new ke(parseFloat(e)),i=e.indexOf(".");return i!==-1&&e[e.length-1]==="0"&&(n.minFractionDigits=e.length-i-1),n},stringify:Bn},zc=e=>typeof e=="bigint"||Number.isInteger(e),wp=(e,n,i,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(n),i);function y1(e,n,i){const{value:r}=e;return zc(r)&&r>=0?i+r.toString(n):Bn(e)}const b1={identify:e=>zc(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,n,i)=>wp(e,2,8,i),stringify:e=>y1(e,8,"0o")},v1={identify:zc,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,n,i)=>wp(e,0,10,i),stringify:Bn},S1={identify:e=>zc(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,n,i)=>wp(e,2,16,i),stringify:e=>y1(e,16,"0x")},OD=[Xs,Js,Ac,_c,xp,b1,v1,S1,m1,h1,g1];function Mb(e){return typeof e=="bigint"||Number.isInteger(e)}const Gl=({value:e})=>JSON.stringify(e),DD=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:Gl},{identify:e=>e==null,createNode:()=>new ke(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Gl},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:Gl},{identify:Mb,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,n,{intAsBigInt:i})=>i?BigInt(e):parseInt(e,10),stringify:({value:e})=>Mb(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:Gl}],RD={default:!0,tag:"",test:/^/,resolve(e,n){return n(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},MD=[Xs,Js].concat(DD,RD),jp={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,n){if(typeof atob=="function"){const i=atob(e.replace(/[\n\r]/g,"")),r=new Uint8Array(i.length);for(let l=0;l<i.length;++l)r[l]=i.charCodeAt(l);return r}else return n("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:n,value:i},r,l,c){if(!i)return"";const d=i;let m;if(typeof btoa=="function"){let g="";for(let b=0;b<d.length;++b)g+=String.fromCharCode(d[b]);m=btoa(g)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(n??(n=ke.BLOCK_LITERAL),n!==ke.QUOTE_DOUBLE){const g=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),b=Math.ceil(m.length/g),v=new Array(b);for(let S=0,w=0;S<b;++S,w+=g)v[S]=m.substr(w,g);m=v.join(n===ke.BLOCK_LITERAL?`
115
+ `:" ")}return vp({comment:e,type:n,value:m},r,l,c)}};function x1(e,n){if(uo(e))for(let i=0;i<e.items.length;++i){let r=e.items[i];if(!vt(r)){if(co(r)){r.items.length>1&&n("Each pair must have its own sequence indicator");const l=r.items[0]||new Ht(new ke(null));if(r.commentBefore&&(l.key.commentBefore=l.key.commentBefore?`${r.commentBefore}
116
+ ${l.key.commentBefore}`:r.commentBefore),r.comment){const c=l.value??l.key;c.comment=c.comment?`${r.comment}
117
+ ${c.comment}`:r.comment}r=l}e.items[i]=vt(r)?r:new Ht(r)}}else n("Expected a sequence for this tag");return e}function w1(e,n,i){const{replacer:r}=i,l=new ki(e);l.tag="tag:yaml.org,2002:pairs";let c=0;if(n&&Symbol.iterator in Object(n))for(let d of n){typeof r=="function"&&(d=r.call(n,String(c++),d));let m,g;if(Array.isArray(d))if(d.length===2)m=d[0],g=d[1];else throw new TypeError(`Expected [key, value] tuple: ${d}`);else if(d&&d instanceof Object){const b=Object.keys(d);if(b.length===1)m=b[0],g=d[m];else throw new TypeError(`Expected tuple with one key, not ${b.length} keys`)}else m=d;l.items.push(Sp(m,g,i))}return l}const Np={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:x1,createNode:w1};class Ms extends ki{constructor(){super(),this.add=wn.prototype.add.bind(this),this.delete=wn.prototype.delete.bind(this),this.get=wn.prototype.get.bind(this),this.has=wn.prototype.has.bind(this),this.set=wn.prototype.set.bind(this),this.tag=Ms.tag}toJSON(n,i){if(!i)return super.toJSON(n);const r=new Map;i?.onCreate&&i.onCreate(r);for(const l of this.items){let c,d;if(vt(l)?(c=jn(l.key,"",i),d=jn(l.value,c,i)):c=jn(l,"",i),r.has(c))throw new Error("Ordered maps must not include duplicate keys");r.set(c,d)}return r}static from(n,i,r){const l=w1(n,i,r),c=new this;return c.items=l.items,c}}Ms.tag="tag:yaml.org,2002:omap";const kp={collection:"seq",identify:e=>e instanceof Map,nodeClass:Ms,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,n){const i=x1(e,n),r=[];for(const{key:l}of i.items)nt(l)&&(r.includes(l.value)?n(`Ordered maps must not include duplicate keys: ${l.value}`):r.push(l.value));return Object.assign(new Ms,i)},createNode:(e,n,i)=>Ms.from(e,n,i)};function j1({value:e,source:n},i){return n&&(e?N1:k1).test.test(n)?n:e?i.options.trueStr:i.options.falseStr}const N1={identify:e=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new ke(!0),stringify:j1},k1={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 ke(!1),stringify:j1},BD={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:Bn},LD={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 n=Number(e.value);return isFinite(n)?n.toExponential():Bn(e)}},qD={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){const n=new ke(parseFloat(e.replace(/_/g,""))),i=e.indexOf(".");if(i!==-1){const r=e.substring(i+1).replace(/_/g,"");r[r.length-1]==="0"&&(n.minFractionDigits=r.length)}return n},stringify:Bn},fo=e=>typeof e=="bigint"||Number.isInteger(e);function Cc(e,n,i,{intAsBigInt:r}){const l=e[0];if((l==="-"||l==="+")&&(n+=1),e=e.substring(n).replace(/_/g,""),r){switch(i){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}const d=BigInt(e);return l==="-"?BigInt(-1)*d:d}const c=parseInt(e,i);return l==="-"?-1*c:c}function Ap(e,n,i){const{value:r}=e;if(fo(r)){const l=r.toString(n);return r<0?"-"+i+l.substr(1):i+l}return Bn(e)}const $D={identify:fo,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,n,i)=>Cc(e,2,2,i),stringify:e=>Ap(e,2,"0b")},UD={identify:fo,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,n,i)=>Cc(e,1,8,i),stringify:e=>Ap(e,8,"0")},VD={identify:fo,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,n,i)=>Cc(e,0,10,i),stringify:Bn},GD={identify:fo,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,n,i)=>Cc(e,2,16,i),stringify:e=>Ap(e,16,"0x")};class Bs extends wn{constructor(n){super(n),this.tag=Bs.tag}add(n){let i;vt(n)?i=n:n&&typeof n=="object"&&"key"in n&&"value"in n&&n.value===null?i=new Ht(n.key,null):i=new Ht(n,null),xi(this.items,i.key)||this.items.push(i)}get(n,i){const r=xi(this.items,n);return!i&&vt(r)?nt(r.key)?r.key.value:r.key:r}set(n,i){if(typeof i!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof i}`);const r=xi(this.items,n);r&&!i?this.items.splice(this.items.indexOf(r),1):!r&&i&&this.items.push(new Ht(n))}toJSON(n,i){return super.toJSON(n,i,Set)}toString(n,i,r){if(!n)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},n,{allNullValues:!0}),i,r);throw new Error("Set items must all have null values")}static from(n,i,r){const{replacer:l}=r,c=new this(n);if(i&&Symbol.iterator in Object(i))for(let d of i)typeof l=="function"&&(d=l.call(i,d,d)),c.items.push(Sp(d,null,r));return c}}Bs.tag="tag:yaml.org,2002:set";const _p={collection:"map",identify:e=>e instanceof Set,nodeClass:Bs,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,n,i)=>Bs.from(e,n,i),resolve(e,n){if(co(e)){if(e.hasAllNullValues(!0))return Object.assign(new Bs,e);n("Set items must all have null values")}else n("Expected a mapping for this tag");return e}};function zp(e,n){const i=e[0],r=i==="-"||i==="+"?e.substring(1):e,l=d=>n?BigInt(d):Number(d),c=r.replace(/_/g,"").split(":").reduce((d,m)=>d*l(60)+l(m),l(0));return i==="-"?l(-1)*c:c}function A1(e){let{value:n}=e,i=d=>d;if(typeof n=="bigint")i=d=>BigInt(d);else if(isNaN(n)||!isFinite(n))return Bn(e);let r="";n<0&&(r="-",n*=i(-1));const l=i(60),c=[n%l];return n<60?c.unshift(0):(n=(n-c[0])/l,c.unshift(n%l),n>=60&&(n=(n-c[0])/l,c.unshift(n))),r+c.map(d=>String(d).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const _1={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,n,{intAsBigInt:i})=>zp(e,i),stringify:A1},z1={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>zp(e,!1),stringify:A1},Tc={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 n=e.match(Tc.test);if(!n)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,i,r,l,c,d,m]=n.map(Number),g=n[7]?Number((n[7]+"00").substr(1,3)):0;let b=Date.UTC(i,r-1,l,c||0,d||0,m||0,g);const v=n[8];if(v&&v!=="Z"){let S=zp(v,!1);Math.abs(S)<30&&(S*=60),b-=6e4*S}return new Date(b)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""},Bb=[Xs,Js,Ac,_c,N1,k1,$D,UD,VD,GD,BD,LD,qD,jp,ma,kp,Np,_p,_1,z1,Tc],Lb=new Map([["core",OD],["failsafe",[Xs,Js,Ac]],["json",MD],["yaml11",Bb],["yaml-1.1",Bb]]),qb={binary:jp,bool:xp,float:g1,floatExp:h1,floatNaN:m1,floatTime:z1,int:v1,intHex:S1,intOct:b1,intTime:_1,map:Xs,merge:ma,null:_c,omap:kp,pairs:Np,seq:Js,set:_p,timestamp:Tc},ID={"tag:yaml.org,2002:binary":jp,"tag:yaml.org,2002:merge":ma,"tag:yaml.org,2002:omap":kp,"tag:yaml.org,2002:pairs":Np,"tag:yaml.org,2002:set":_p,"tag:yaml.org,2002:timestamp":Tc};function rf(e,n,i){const r=Lb.get(n);if(r&&!e)return i&&!r.includes(ma)?r.concat(ma):r.slice();let l=r;if(!l)if(Array.isArray(e))l=[];else{const c=Array.from(Lb.keys()).filter(d=>d!=="yaml11").map(d=>JSON.stringify(d)).join(", ");throw new Error(`Unknown schema "${n}"; use one of ${c} or define customTags array`)}if(Array.isArray(e))for(const c of e)l=l.concat(c);else typeof e=="function"&&(l=e(l.slice()));return i&&(l=l.concat(ma)),l.reduce((c,d)=>{const m=typeof d=="string"?qb[d]:d;if(!m){const g=JSON.stringify(d),b=Object.keys(qb).map(v=>JSON.stringify(v)).join(", ");throw new Error(`Unknown custom tag ${g}; use one of ${b}`)}return c.includes(m)||c.push(m),c},[])}const HD=(e,n)=>e.key<n.key?-1:e.key>n.key?1:0;class Cp{constructor({compat:n,customTags:i,merge:r,resolveKnownTags:l,schema:c,sortMapEntries:d,toStringDefaults:m}){this.compat=Array.isArray(n)?rf(n,"compat"):n?rf(null,n):null,this.name=typeof c=="string"&&c||"core",this.knownTags=l?ID:{},this.tags=rf(i,this.name,r),this.toStringOptions=m??null,Object.defineProperty(this,Ha,{value:Xs}),Object.defineProperty(this,Hn,{value:Ac}),Object.defineProperty(this,Qs,{value:Js}),this.sortMapEntries=typeof d=="function"?d:d===!0?HD:null}clone(){const n=Object.create(Cp.prototype,Object.getOwnPropertyDescriptors(this));return n.tags=this.tags.slice(),n}}function ZD(e,n){const i=[];let r=n.directives===!0;if(n.directives!==!1&&e.directives){const g=e.directives.toString(e);g?(i.push(g),r=!0):e.directives.docStart&&(r=!0)}r&&i.push("---");const l=u1(e,n),{commentString:c}=l.options;if(e.commentBefore){i.length!==1&&i.unshift("");const g=c(e.commentBefore);i.unshift(pa(g,""))}let d=!1,m=null;if(e.contents){if(bt(e.contents)){if(e.contents.spaceBefore&&r&&i.push(""),e.contents.commentBefore){const v=c(e.contents.commentBefore);i.push(pa(v,""))}l.forceBlockIndent=!!e.comment,m=e.contents.comment}const g=m?void 0:()=>d=!0;let b=Us(e.contents,l,()=>m=null,g);m&&(b+=Si(b,"",c(m))),(b[0]==="|"||b[0]===">")&&i[i.length-1]==="---"?i[i.length-1]=`--- ${b}`:i.push(b)}else i.push(Us(e.contents,l));if(e.directives?.docEnd)if(e.comment){const g=c(e.comment);g.includes(`
118
+ `)?(i.push("..."),i.push(pa(g,""))):i.push(`... ${g}`)}else i.push("...");else{let g=e.comment;g&&d&&(g=g.replace(/^\n+/,"")),g&&((!d||m)&&i[i.length-1]!==""&&i.push(""),i.push(pa(c(g),"")))}return i.join(`
119
+ `)+`
120
+ `}class Ec{constructor(n,i,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Nn,{value:Af});let l=null;typeof i=="function"||Array.isArray(i)?l=i:r===void 0&&i&&(r=i,i=void 0);const c=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=c;let{version:d}=c;r?._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(d=this.directives.yaml.version)):this.directives=new Gt({version:d}),this.setSchema(d,r),this.contents=n===void 0?null:this.createNode(n,l,r)}clone(){const n=Object.create(Ec.prototype,{[Nn]:{value:Af}});return n.commentBefore=this.commentBefore,n.comment=this.comment,n.errors=this.errors.slice(),n.warnings=this.warnings.slice(),n.options=Object.assign({},this.options),this.directives&&(n.directives=this.directives.clone()),n.schema=this.schema.clone(),n.contents=bt(this.contents)?this.contents.clone(n.schema):this.contents,this.range&&(n.range=this.range.slice()),n}add(n){As(this.contents)&&this.contents.add(n)}addIn(n,i){As(this.contents)&&this.contents.addIn(n,i)}createAlias(n,i){if(!n.anchor){const r=s1(this);n.anchor=!i||r.has(i)?r1(i||"a",r):i}return new bp(n.anchor)}createNode(n,i,r){let l;if(typeof i=="function")n=i.call({"":n},"",n),l=i;else if(Array.isArray(i)){const T=Z=>typeof Z=="number"||Z instanceof String||Z instanceof Number,L=i.filter(T).map(String);L.length>0&&(i=i.concat(L)),l=i}else r===void 0&&i&&(r=i,i=void 0);const{aliasDuplicateObjects:c,anchorPrefix:d,flow:m,keepUndefined:g,onTagObj:b,tag:v}=r??{},{onAnchor:S,setAnchors:w,sourceObjects:_}=bD(this,d||"a"),C={aliasDuplicateObjects:c??!0,keepUndefined:g??!1,onAnchor:S,onTagObj:b,replacer:l,schema:this.schema,sourceObjects:_},N=ro(n,v,C);return m&&yt(N)&&(N.flow=!0),w(),N}createPair(n,i,r={}){const l=this.createNode(n,null,r),c=this.createNode(i,null,r);return new Ht(l,c)}delete(n){return As(this.contents)?this.contents.delete(n):!1}deleteIn(n){return to(n)?this.contents==null?!1:(this.contents=null,!0):As(this.contents)?this.contents.deleteIn(n):!1}get(n,i){return yt(this.contents)?this.contents.get(n,i):void 0}getIn(n,i){return to(n)?!i&&nt(this.contents)?this.contents.value:this.contents:yt(this.contents)?this.contents.getIn(n,i):void 0}has(n){return yt(this.contents)?this.contents.has(n):!1}hasIn(n){return to(n)?this.contents!==void 0:yt(this.contents)?this.contents.hasIn(n):!1}set(n,i){this.contents==null?this.contents=oc(this.schema,[n],i):As(this.contents)&&this.contents.set(n,i)}setIn(n,i){to(n)?this.contents=i:this.contents==null?this.contents=oc(this.schema,Array.from(n),i):As(this.contents)&&this.contents.setIn(n,i)}setSchema(n,i={}){typeof n=="number"&&(n=String(n));let r;switch(n){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Gt({version:"1.1"}),r={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=n:this.directives=new Gt({version:n}),r={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,r=null;break;default:{const l=JSON.stringify(n);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${l}`)}}if(i.schema instanceof Object)this.schema=i.schema;else if(r)this.schema=new Cp(Object.assign(r,i));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:n,jsonArg:i,mapAsMap:r,maxAliasCount:l,onAnchor:c,reviver:d}={}){const m={anchors:new Map,doc:this,keep:!n,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof l=="number"?l:100},g=jn(this.contents,i??"",m);if(typeof c=="function")for(const{count:b,res:v}of m.anchors.values())c(v,b);return typeof d=="function"?Es(d,{"":g},"",g):g}toJSON(n,i){return this.toJS({json:!0,jsonArg:n,mapAsMap:!1,onAnchor:i})}toString(n={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in n&&(!Number.isInteger(n.indent)||Number(n.indent)<=0)){const i=JSON.stringify(n.indent);throw new Error(`"indent" option must be a positive integer, not ${i}`)}return ZD(this,n)}}function As(e){if(yt(e))return!0;throw new Error("Expected a YAML collection as document contents")}class C1 extends Error{constructor(n,i,r,l){super(),this.name=n,this.code=r,this.message=l,this.pos=i}}class Il extends C1{constructor(n,i,r){super("YAMLParseError",n,i,r)}}class PD extends C1{constructor(n,i,r){super("YAMLWarning",n,i,r)}}const $b=(e,n)=>i=>{if(i.pos[0]===-1)return;i.linePos=i.pos.map(m=>n.linePos(m));const{line:r,col:l}=i.linePos[0];i.message+=` at line ${r}, column ${l}`;let c=l-1,d=e.substring(n.lineStarts[r-1],n.lineStarts[r]).replace(/[\n\r]+$/,"");if(c>=60&&d.length>80){const m=Math.min(c-39,d.length-79);d="…"+d.substring(m),c-=m-1}if(d.length>80&&(d=d.substring(0,79)+"…"),r>1&&/^ *$/.test(d.substring(0,c))){let m=e.substring(n.lineStarts[r-2],n.lineStarts[r-1]);m.length>80&&(m=m.substring(0,79)+`…
121
+ `),d=m+d}if(/[^ ]/.test(d)){let m=1;const g=i.linePos[1];g?.line===r&&g.col>l&&(m=Math.max(1,Math.min(g.col-l,80-c)));const b=" ".repeat(c)+"^".repeat(m);i.message+=`:
122
+
123
+ ${d}
124
+ ${b}
125
+ `}};function Vs(e,{flow:n,indicator:i,next:r,offset:l,onError:c,parentIndent:d,startOnNewline:m}){let g=!1,b=m,v=m,S="",w="",_=!1,C=!1,N=null,T=null,L=null,Z=null,J=null,K=null,X=null;for(const R of e)switch(C&&(R.type!=="space"&&R.type!=="newline"&&R.type!=="comma"&&c(R.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),C=!1),N&&(b&&R.type!=="comment"&&R.type!=="newline"&&c(N,"TAB_AS_INDENT","Tabs are not allowed as indentation"),N=null),R.type){case"space":!n&&(i!=="doc-start"||r?.type!=="flow-collection")&&R.source.includes(" ")&&(N=R),v=!0;break;case"comment":{v||c(R,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const oe=R.source.substring(1)||" ";S?S+=w+oe:S=oe,w="",b=!1;break}case"newline":b?S?S+=R.source:(!K||i!=="seq-item-ind")&&(g=!0):w+=R.source,b=!0,_=!0,(T||L)&&(Z=R),v=!0;break;case"anchor":T&&c(R,"MULTIPLE_ANCHORS","A node can have at most one anchor"),R.source.endsWith(":")&&c(R.offset+R.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),T=R,X??(X=R.offset),b=!1,v=!1,C=!0;break;case"tag":{L&&c(R,"MULTIPLE_TAGS","A node can have at most one tag"),L=R,X??(X=R.offset),b=!1,v=!1,C=!0;break}case i:(T||L)&&c(R,"BAD_PROP_ORDER",`Anchors and tags must be after the ${R.source} indicator`),K&&c(R,"UNEXPECTED_TOKEN",`Unexpected ${R.source} in ${n??"collection"}`),K=R,b=i==="seq-item-ind"||i==="explicit-key-ind",v=!1;break;case"comma":if(n){J&&c(R,"UNEXPECTED_TOKEN",`Unexpected , in ${n}`),J=R,b=!1,v=!1;break}default:c(R,"UNEXPECTED_TOKEN",`Unexpected ${R.type} token`),b=!1,v=!1}const G=e[e.length-1],D=G?G.offset+G.source.length:l;return C&&r&&r.type!=="space"&&r.type!=="newline"&&r.type!=="comma"&&(r.type!=="scalar"||r.source!=="")&&c(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),N&&(b&&N.indent<=d||r?.type==="block-map"||r?.type==="block-seq")&&c(N,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:J,found:K,spaceBefore:g,comment:S,hasNewline:_,anchor:T,tag:L,newlineAfterProp:Z,end:D,start:X??D}}function oo(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(`
126
+ `))return!0;if(e.end){for(const n of e.end)if(n.type==="newline")return!0}return!1;case"flow-collection":for(const n of e.items){for(const i of n.start)if(i.type==="newline")return!0;if(n.sep){for(const i of n.sep)if(i.type==="newline")return!0}if(oo(n.key)||oo(n.value))return!0}return!1;default:return!0}}function Tf(e,n,i){if(n?.type==="flow-collection"){const r=n.end[0];r.indent===e&&(r.source==="]"||r.source==="}")&&oo(n)&&i(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function T1(e,n,i){const{uniqueKeys:r}=e.options;if(r===!1)return!1;const l=typeof r=="function"?r:(c,d)=>c===d||nt(c)&&nt(d)&&c.value===d.value;return n.some(c=>l(c.key,i))}const Ub="All mapping items must start at the same column";function KD({composeNode:e,composeEmptyNode:n},i,r,l,c){const d=c?.nodeClass??wn,m=new d(i.schema);i.atRoot&&(i.atRoot=!1);let g=r.offset,b=null;for(const v of r.items){const{start:S,key:w,sep:_,value:C}=v,N=Vs(S,{indicator:"explicit-key-ind",next:w??_?.[0],offset:g,onError:l,parentIndent:r.indent,startOnNewline:!0}),T=!N.found;if(T){if(w&&(w.type==="block-seq"?l(g,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in w&&w.indent!==r.indent&&l(g,"BAD_INDENT",Ub)),!N.anchor&&!N.tag&&!_){b=N.end,N.comment&&(m.comment?m.comment+=`
127
+ `+N.comment:m.comment=N.comment);continue}(N.newlineAfterProp||oo(w))&&l(w??S[S.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else N.found?.indent!==r.indent&&l(g,"BAD_INDENT",Ub);i.atKey=!0;const L=N.end,Z=w?e(i,w,N,l):n(i,L,S,null,N,l);i.schema.compat&&Tf(r.indent,w,l),i.atKey=!1,T1(i,m.items,Z)&&l(L,"DUPLICATE_KEY","Map keys must be unique");const J=Vs(_??[],{indicator:"map-value-ind",next:C,offset:Z.range[2],onError:l,parentIndent:r.indent,startOnNewline:!w||w.type==="block-scalar"});if(g=J.end,J.found){T&&(C?.type==="block-map"&&!J.hasNewline&&l(g,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),i.options.strict&&N.start<J.found.offset-1024&&l(Z.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const K=C?e(i,C,J,l):n(i,g,_,null,J,l);i.schema.compat&&Tf(r.indent,C,l),g=K.range[2];const X=new Ht(Z,K);i.options.keepSourceTokens&&(X.srcToken=v),m.items.push(X)}else{T&&l(Z.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),J.comment&&(Z.comment?Z.comment+=`
128
+ `+J.comment:Z.comment=J.comment);const K=new Ht(Z);i.options.keepSourceTokens&&(K.srcToken=v),m.items.push(K)}}return b&&b<g&&l(b,"IMPOSSIBLE","Map comment with trailing content"),m.range=[r.offset,g,b??g],m}function QD({composeNode:e,composeEmptyNode:n},i,r,l,c){const d=c?.nodeClass??ki,m=new d(i.schema);i.atRoot&&(i.atRoot=!1),i.atKey&&(i.atKey=!1);let g=r.offset,b=null;for(const{start:v,value:S}of r.items){const w=Vs(v,{indicator:"seq-item-ind",next:S,offset:g,onError:l,parentIndent:r.indent,startOnNewline:!0});if(!w.found)if(w.anchor||w.tag||S)S?.type==="block-seq"?l(w.end,"BAD_INDENT","All sequence items must start at the same column"):l(g,"MISSING_CHAR","Sequence item without - indicator");else{b=w.end,w.comment&&(m.comment=w.comment);continue}const _=S?e(i,S,w,l):n(i,w.end,v,null,w,l);i.schema.compat&&Tf(r.indent,S,l),g=_.range[2],m.items.push(_)}return m.range=[r.offset,g,b??g],m}function po(e,n,i,r){let l="";if(e){let c=!1,d="";for(const m of e){const{source:g,type:b}=m;switch(b){case"space":c=!0;break;case"comment":{i&&!c&&r(m,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const v=g.substring(1)||" ";l?l+=d+v:l=v,d="";break}case"newline":l&&(d+=g),c=!0;break;default:r(m,"UNEXPECTED_TOKEN",`Unexpected ${b} at node end`)}n+=g.length}}return{comment:l,offset:n}}const of="Block collections are not allowed within flow collections",lf=e=>e&&(e.type==="block-map"||e.type==="block-seq");function YD({composeNode:e,composeEmptyNode:n},i,r,l,c){const d=r.start.source==="{",m=d?"flow map":"flow sequence",g=c?.nodeClass??(d?wn:ki),b=new g(i.schema);b.flow=!0;const v=i.atRoot;v&&(i.atRoot=!1),i.atKey&&(i.atKey=!1);let S=r.offset+r.start.source.length;for(let T=0;T<r.items.length;++T){const L=r.items[T],{start:Z,key:J,sep:K,value:X}=L,G=Vs(Z,{flow:m,indicator:"explicit-key-ind",next:J??K?.[0],offset:S,onError:l,parentIndent:r.indent,startOnNewline:!1});if(!G.found){if(!G.anchor&&!G.tag&&!K&&!X){T===0&&G.comma?l(G.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${m}`):T<r.items.length-1&&l(G.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${m}`),G.comment&&(b.comment?b.comment+=`
129
+ `+G.comment:b.comment=G.comment),S=G.end;continue}!d&&i.options.strict&&oo(J)&&l(J,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(T===0)G.comma&&l(G.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${m}`);else if(G.comma||l(G.start,"MISSING_CHAR",`Missing , between ${m} items`),G.comment){let D="";e:for(const R of Z)switch(R.type){case"comma":case"space":break;case"comment":D=R.source.substring(1);break e;default:break e}if(D){let R=b.items[b.items.length-1];vt(R)&&(R=R.value??R.key),R.comment?R.comment+=`
130
+ `+D:R.comment=D,G.comment=G.comment.substring(D.length+1)}}if(!d&&!K&&!G.found){const D=X?e(i,X,G,l):n(i,G.end,K,null,G,l);b.items.push(D),S=D.range[2],lf(X)&&l(D.range,"BLOCK_IN_FLOW",of)}else{i.atKey=!0;const D=G.end,R=J?e(i,J,G,l):n(i,D,Z,null,G,l);lf(J)&&l(R.range,"BLOCK_IN_FLOW",of),i.atKey=!1;const oe=Vs(K??[],{flow:m,indicator:"map-value-ind",next:X,offset:R.range[2],onError:l,parentIndent:r.indent,startOnNewline:!1});if(oe.found){if(!d&&!G.found&&i.options.strict){if(K)for(const de of K){if(de===oe.found)break;if(de.type==="newline"){l(de,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}G.start<oe.found.offset-1024&&l(oe.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else X&&("source"in X&&X.source?.[0]===":"?l(X,"MISSING_CHAR",`Missing space after : in ${m}`):l(oe.start,"MISSING_CHAR",`Missing , or : between ${m} items`));const Ne=X?e(i,X,oe,l):oe.found?n(i,oe.end,K,null,oe,l):null;Ne?lf(X)&&l(Ne.range,"BLOCK_IN_FLOW",of):oe.comment&&(R.comment?R.comment+=`
131
+ `+oe.comment:R.comment=oe.comment);const te=new Ht(R,Ne);if(i.options.keepSourceTokens&&(te.srcToken=L),d){const de=b;T1(i,de.items,R)&&l(D,"DUPLICATE_KEY","Map keys must be unique"),de.items.push(te)}else{const de=new wn(i.schema);de.flow=!0,de.items.push(te);const Me=(Ne??R).range;de.range=[R.range[0],Me[1],Me[2]],b.items.push(de)}S=Ne?Ne.range[2]:oe.end}}const w=d?"}":"]",[_,...C]=r.end;let N=S;if(_?.source===w)N=_.offset+_.source.length;else{const T=m[0].toUpperCase()+m.substring(1),L=v?`${T} must end with a ${w}`:`${T} in block collection must be sufficiently indented and end with a ${w}`;l(S,v?"MISSING_CHAR":"BAD_INDENT",L),_&&_.source.length!==1&&C.unshift(_)}if(C.length>0){const T=po(C,N,i.options.strict,l);T.comment&&(b.comment?b.comment+=`
132
+ `+T.comment:b.comment=T.comment),b.range=[r.offset,N,T.offset]}else b.range=[r.offset,N,N];return b}function cf(e,n,i,r,l,c){const d=i.type==="block-map"?KD(e,n,i,r,c):i.type==="block-seq"?QD(e,n,i,r,c):YD(e,n,i,r,c),m=d.constructor;return l==="!"||l===m.tagName?(d.tag=m.tagName,d):(l&&(d.tag=l),d)}function XD(e,n,i,r,l){const c=r.tag,d=c?n.directives.tagName(c.source,w=>l(c,"TAG_RESOLVE_FAILED",w)):null;if(i.type==="block-seq"){const{anchor:w,newlineAfterProp:_}=r,C=w&&c?w.offset>c.offset?w:c:w??c;C&&(!_||_.offset<C.offset)&&l(C,"MISSING_CHAR","Missing newline after block sequence props")}const m=i.type==="block-map"?"map":i.type==="block-seq"?"seq":i.start.source==="{"?"map":"seq";if(!c||!d||d==="!"||d===wn.tagName&&m==="map"||d===ki.tagName&&m==="seq")return cf(e,n,i,l,d);let g=n.schema.tags.find(w=>w.tag===d&&w.collection===m);if(!g){const w=n.schema.knownTags[d];if(w?.collection===m)n.schema.tags.push(Object.assign({},w,{default:!1})),g=w;else return w?l(c,"BAD_COLLECTION_TYPE",`${w.tag} used for ${m} collection, but expects ${w.collection??"scalar"}`,!0):l(c,"TAG_RESOLVE_FAILED",`Unresolved tag: ${d}`,!0),cf(e,n,i,l,d)}const b=cf(e,n,i,l,d,g),v=g.resolve?.(b,w=>l(c,"TAG_RESOLVE_FAILED",w),n.options)??b,S=bt(v)?v:new ke(v);return S.range=b.range,S.tag=d,g?.format&&(S.format=g.format),S}function JD(e,n,i){const r=n.offset,l=FD(n,e.options.strict,i);if(!l)return{value:"",type:null,comment:"",range:[r,r,r]};const c=l.mode===">"?ke.BLOCK_FOLDED:ke.BLOCK_LITERAL,d=n.source?WD(n.source):[];let m=d.length;for(let N=d.length-1;N>=0;--N){const T=d[N][1];if(T===""||T==="\r")m=N;else break}if(m===0){const N=l.chomp==="+"&&d.length>0?`
133
+ `.repeat(Math.max(1,d.length-1)):"";let T=r+l.length;return n.source&&(T+=n.source.length),{value:N,type:c,comment:l.comment,range:[r,T,T]}}let g=n.indent+l.indent,b=n.offset+l.length,v=0;for(let N=0;N<m;++N){const[T,L]=d[N];if(L===""||L==="\r")l.indent===0&&T.length>g&&(g=T.length);else{T.length<g&&i(b+T.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),l.indent===0&&(g=T.length),v=N,g===0&&!e.atRoot&&i(b,"BAD_INDENT","Block scalar values in collections must be indented");break}b+=T.length+L.length+1}for(let N=d.length-1;N>=m;--N)d[N][0].length>g&&(m=N+1);let S="",w="",_=!1;for(let N=0;N<v;++N)S+=d[N][0].slice(g)+`
134
+ `;for(let N=v;N<m;++N){let[T,L]=d[N];b+=T.length+L.length+1;const Z=L[L.length-1]==="\r";if(Z&&(L=L.slice(0,-1)),L&&T.length<g){const K=`Block scalar lines must not be less indented than their ${l.indent?"explicit indentation indicator":"first line"}`;i(b-L.length-(Z?2:1),"BAD_INDENT",K),T=""}c===ke.BLOCK_LITERAL?(S+=w+T.slice(g)+L,w=`
135
+ `):T.length>g||L[0]===" "?(w===" "?w=`
136
+ `:!_&&w===`
137
+ `&&(w=`
138
+
139
+ `),S+=w+T.slice(g)+L,w=`
140
+ `,_=!0):L===""?w===`
141
+ `?S+=`
142
+ `:w=`
143
+ `:(S+=w+L,w=" ",_=!1)}switch(l.chomp){case"-":break;case"+":for(let N=m;N<d.length;++N)S+=`
144
+ `+d[N][0].slice(g);S[S.length-1]!==`
145
+ `&&(S+=`
146
+ `);break;default:S+=`
147
+ `}const C=r+l.length+n.source.length;return{value:S,type:c,comment:l.comment,range:[r,C,C]}}function FD({offset:e,props:n},i,r){if(n[0].type!=="block-scalar-header")return r(n[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:l}=n[0],c=l[0];let d=0,m="",g=-1;for(let w=1;w<l.length;++w){const _=l[w];if(!m&&(_==="-"||_==="+"))m=_;else{const C=Number(_);!d&&C?d=C:g===-1&&(g=e+w)}}g!==-1&&r(g,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${l}`);let b=!1,v="",S=l.length;for(let w=1;w<n.length;++w){const _=n[w];switch(_.type){case"space":b=!0;case"newline":S+=_.source.length;break;case"comment":i&&!b&&r(_,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),S+=_.source.length,v=_.source.substring(1);break;case"error":r(_,"UNEXPECTED_TOKEN",_.message),S+=_.source.length;break;default:{const C=`Unexpected token in block scalar header: ${_.type}`;r(_,"UNEXPECTED_TOKEN",C);const N=_.source;N&&typeof N=="string"&&(S+=N.length)}}}return{mode:c,indent:d,chomp:m,comment:v,length:S}}function WD(e){const n=e.split(/\n( *)/),i=n[0],r=i.match(/^( *)/),c=[r?.[1]?[r[1],i.slice(r[1].length)]:["",i]];for(let d=1;d<n.length;d+=2)c.push([n[d],n[d+1]]);return c}function e5(e,n,i){const{offset:r,type:l,source:c,end:d}=e;let m,g;const b=(w,_,C)=>i(r+w,_,C);switch(l){case"scalar":m=ke.PLAIN,g=t5(c,b);break;case"single-quoted-scalar":m=ke.QUOTE_SINGLE,g=n5(c,b);break;case"double-quoted-scalar":m=ke.QUOTE_DOUBLE,g=a5(c,b);break;default:return i(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${l}`),{value:"",type:null,comment:"",range:[r,r+c.length,r+c.length]}}const v=r+c.length,S=po(d,v,n,i);return{value:g,type:m,comment:S.comment,range:[r,v,S.offset]}}function t5(e,n){let i="";switch(e[0]){case" ":i="a tab character";break;case",":i="flow indicator character ,";break;case"%":i="directive indicator character %";break;case"|":case">":{i=`block scalar indicator ${e[0]}`;break}case"@":case"`":{i=`reserved character ${e[0]}`;break}}return i&&n(0,"BAD_SCALAR_START",`Plain value cannot start with ${i}`),E1(e)}function n5(e,n){return(e[e.length-1]!=="'"||e.length===1)&&n(e.length,"MISSING_CHAR","Missing closing 'quote"),E1(e.slice(1,-1)).replace(/''/g,"'")}function E1(e){let n,i;try{n=new RegExp(`(.*?)(?<![ ])[ ]*\r?
148
+ `,"sy"),i=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
149
+ `,"sy")}catch{n=/(.*?)[ \t]*\r?\n/sy,i=/[ \t]*(.*?)[ \t]*\r?\n/sy}let r=n.exec(e);if(!r)return e;let l=r[1],c=" ",d=n.lastIndex;for(i.lastIndex=d;r=i.exec(e);)r[1]===""?c===`
150
+ `?l+=c:c=`
151
+ `:(l+=c+r[1],c=" "),d=i.lastIndex;const m=/[ \t]*(.*)/sy;return m.lastIndex=d,r=m.exec(e),l+c+(r?.[1]??"")}function a5(e,n){let i="";for(let r=1;r<e.length-1;++r){const l=e[r];if(!(l==="\r"&&e[r+1]===`
152
+ `))if(l===`
153
+ `){const{fold:c,offset:d}=i5(e,r);i+=c,r=d}else if(l==="\\"){let c=e[++r];const d=s5[c];if(d)i+=d;else if(c===`
154
+ `)for(c=e[r+1];c===" "||c===" ";)c=e[++r+1];else if(c==="\r"&&e[r+1]===`
155
+ `)for(c=e[++r+1];c===" "||c===" ";)c=e[++r+1];else if(c==="x"||c==="u"||c==="U"){const m={x:2,u:4,U:8}[c];i+=r5(e,r+1,m,n),r+=m}else{const m=e.substr(r-1,2);n(r-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${m}`),i+=m}}else if(l===" "||l===" "){const c=r;let d=e[r+1];for(;d===" "||d===" ";)d=e[++r+1];d!==`
156
+ `&&!(d==="\r"&&e[r+2]===`
157
+ `)&&(i+=r>c?e.slice(c,r+1):l)}else i+=l}return(e[e.length-1]!=='"'||e.length===1)&&n(e.length,"MISSING_CHAR",'Missing closing "quote'),i}function i5(e,n){let i="",r=e[n+1];for(;(r===" "||r===" "||r===`
158
+ `||r==="\r")&&!(r==="\r"&&e[n+2]!==`
159
+ `);)r===`
160
+ `&&(i+=`
161
+ `),n+=1,r=e[n+1];return i||(i=" "),{fold:i,offset:n}}const s5={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
162
+ `,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function r5(e,n,i,r){const l=e.substr(n,i),d=l.length===i&&/^[0-9a-fA-F]+$/.test(l)?parseInt(l,16):NaN;if(isNaN(d)){const m=e.substr(n-2,i+2);return r(n-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${m}`),m}return String.fromCodePoint(d)}function O1(e,n,i,r){const{value:l,type:c,comment:d,range:m}=n.type==="block-scalar"?JD(e,n,r):e5(n,e.options.strict,r),g=i?e.directives.tagName(i.source,S=>r(i,"TAG_RESOLVE_FAILED",S)):null;let b;e.options.stringKeys&&e.atKey?b=e.schema[Hn]:g?b=o5(e.schema,l,g,i,r):n.type==="scalar"?b=l5(e,l,n,r):b=e.schema[Hn];let v;try{const S=b.resolve(l,w=>r(i??n,"TAG_RESOLVE_FAILED",w),e.options);v=nt(S)?S:new ke(S)}catch(S){const w=S instanceof Error?S.message:String(S);r(i??n,"TAG_RESOLVE_FAILED",w),v=new ke(l)}return v.range=m,v.source=l,c&&(v.type=c),g&&(v.tag=g),b.format&&(v.format=b.format),d&&(v.comment=d),v}function o5(e,n,i,r,l){if(i==="!")return e[Hn];const c=[];for(const m of e.tags)if(!m.collection&&m.tag===i)if(m.default&&m.test)c.push(m);else return m;for(const m of c)if(m.test?.test(n))return m;const d=e.knownTags[i];return d&&!d.collection?(e.tags.push(Object.assign({},d,{default:!1,test:void 0})),d):(l(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${i}`,i!=="tag:yaml.org,2002:str"),e[Hn])}function l5({atKey:e,directives:n,schema:i},r,l,c){const d=i.tags.find(m=>(m.default===!0||e&&m.default==="key")&&m.test?.test(r))||i[Hn];if(i.compat){const m=i.compat.find(g=>g.default&&g.test?.test(r))??i[Hn];if(d.tag!==m.tag){const g=n.tagString(d.tag),b=n.tagString(m.tag),v=`Value may be parsed as either ${g} or ${b}`;c(l,"TAG_RESOLVE_FAILED",v,!0)}}return d}function c5(e,n,i){if(n){i??(i=n.length);for(let r=i-1;r>=0;--r){let l=n[r];switch(l.type){case"space":case"comment":case"newline":e-=l.source.length;continue}for(l=n[++r];l?.type==="space";)e+=l.source.length,l=n[++r];break}}return e}const u5={composeNode:D1,composeEmptyNode:Tp};function D1(e,n,i,r){const l=e.atKey,{spaceBefore:c,comment:d,anchor:m,tag:g}=i;let b,v=!0;switch(n.type){case"alias":b=d5(e,n,r),(m||g)&&r(n,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":b=O1(e,n,g,r),m&&(b.anchor=m.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":b=XD(u5,e,n,i,r),m&&(b.anchor=m.source.substring(1));break;default:{const S=n.type==="error"?n.message:`Unsupported token (type: ${n.type})`;r(n,"UNEXPECTED_TOKEN",S),b=Tp(e,n.offset,void 0,null,i,r),v=!1}}return m&&b.anchor===""&&r(m,"BAD_ALIAS","Anchor cannot be an empty string"),l&&e.options.stringKeys&&(!nt(b)||typeof b.value!="string"||b.tag&&b.tag!=="tag:yaml.org,2002:str")&&r(g??n,"NON_STRING_KEY","With stringKeys, all keys must be strings"),c&&(b.spaceBefore=!0),d&&(n.type==="scalar"&&n.source===""?b.comment=d:b.commentBefore=d),e.options.keepSourceTokens&&v&&(b.srcToken=n),b}function Tp(e,n,i,r,{spaceBefore:l,comment:c,anchor:d,tag:m,end:g},b){const v={type:"scalar",offset:c5(n,i,r),indent:-1,source:""},S=O1(e,v,m,b);return d&&(S.anchor=d.source.substring(1),S.anchor===""&&b(d,"BAD_ALIAS","Anchor cannot be an empty string")),l&&(S.spaceBefore=!0),c&&(S.comment=c,S.range[2]=g),S}function d5({options:e},{offset:n,source:i,end:r},l){const c=new bp(i.substring(1));c.source===""&&l(n,"BAD_ALIAS","Alias cannot be an empty string"),c.source.endsWith(":")&&l(n+i.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const d=n+i.length,m=po(r,d,e.strict,l);return c.range=[n,d,m.offset],m.comment&&(c.comment=m.comment),c}function f5(e,n,{offset:i,start:r,value:l,end:c},d){const m=Object.assign({_directives:n},e),g=new Ec(void 0,m),b={atKey:!1,atRoot:!0,directives:g.directives,options:g.options,schema:g.schema},v=Vs(r,{indicator:"doc-start",next:l??c?.[0],offset:i,onError:d,parentIndent:0,startOnNewline:!0});v.found&&(g.directives.docStart=!0,l&&(l.type==="block-map"||l.type==="block-seq")&&!v.hasNewline&&d(v.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),g.contents=l?D1(b,l,v,d):Tp(b,v.end,r,null,v,d);const S=g.contents.range[2],w=po(c,S,!1,d);return w.comment&&(g.comment=w.comment),g.range=[i,S,w.offset],g}function Wr(e){if(typeof e=="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];const{offset:n,source:i}=e;return[n,n+(typeof i=="string"?i.length:1)]}function Vb(e){let n="",i=!1,r=!1;for(let l=0;l<e.length;++l){const c=e[l];switch(c[0]){case"#":n+=(n===""?"":r?`
163
+
164
+ `:`
165
+ `)+(c.substring(1)||" "),i=!0,r=!1;break;case"%":e[l+1]?.[0]!=="#"&&(l+=1),i=!1;break;default:i||(r=!0),i=!1}}return{comment:n,afterEmptyLine:r}}class p5{constructor(n={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(i,r,l,c)=>{const d=Wr(i);c?this.warnings.push(new PD(d,r,l)):this.errors.push(new Il(d,r,l))},this.directives=new Gt({version:n.version||"1.2"}),this.options=n}decorate(n,i){const{comment:r,afterEmptyLine:l}=Vb(this.prelude);if(r){const c=n.contents;if(i)n.comment=n.comment?`${n.comment}
166
+ ${r}`:r;else if(l||n.directives.docStart||!c)n.commentBefore=r;else if(yt(c)&&!c.flow&&c.items.length>0){let d=c.items[0];vt(d)&&(d=d.key);const m=d.commentBefore;d.commentBefore=m?`${r}
167
+ ${m}`:r}else{const d=c.commentBefore;c.commentBefore=d?`${r}
168
+ ${d}`:r}}i?(Array.prototype.push.apply(n.errors,this.errors),Array.prototype.push.apply(n.warnings,this.warnings)):(n.errors=this.errors,n.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Vb(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(n,i=!1,r=-1){for(const l of n)yield*this.next(l);yield*this.end(i,r)}*next(n){switch(n.type){case"directive":this.directives.add(n.source,(i,r,l)=>{const c=Wr(n);c[0]+=i,this.onError(c,"BAD_DIRECTIVE",r,l)}),this.prelude.push(n.source),this.atDirectives=!0;break;case"document":{const i=f5(this.options,this.directives,n,this.onError);this.atDirectives&&!i.directives.docStart&&this.onError(n,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(i,!1),this.doc&&(yield this.doc),this.doc=i,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(n.source);break;case"error":{const i=n.source?`${n.message}: ${JSON.stringify(n.source)}`:n.message,r=new Il(Wr(n),"UNEXPECTED_TOKEN",i);this.atDirectives||!this.doc?this.errors.push(r):this.doc.errors.push(r);break}case"doc-end":{if(!this.doc){const r="Unexpected doc-end without preceding document";this.errors.push(new Il(Wr(n),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;const i=po(n.end,n.offset+n.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),i.comment){const r=this.doc.comment;this.doc.comment=r?`${r}
169
+ ${i.comment}`:i.comment}this.doc.range[2]=i.offset;break}default:this.errors.push(new Il(Wr(n),"UNEXPECTED_TOKEN",`Unsupported token ${n.type}`))}}*end(n=!1,i=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(n){const r=Object.assign({_directives:this.directives},this.options),l=new Ec(void 0,r);this.atDirectives&&this.onError(i,"MISSING_CHAR","Missing directives-end indicator line"),l.range=[0,i,i],this.decorate(l,!1),yield l}}}const R1="\uFEFF",M1="",B1="",Ef="";function m5(e){switch(e){case R1:return"byte-order-mark";case M1:return"doc-mode";case B1:return"flow-error-end";case Ef:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
170
+ `:case`\r
171
+ `: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 Dn(e){switch(e){case void 0:case" ":case`
172
+ `:case"\r":case" ":return!0;default:return!1}}const Gb=new Set("0123456789ABCDEFabcdef"),h5=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Hl=new Set(",[]{}"),g5=new Set(` ,[]{}
173
+ \r `),uf=e=>!e||g5.has(e);class y5{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(n,i=!1){if(n){if(typeof n!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+n:n,this.lineEndPos=null}this.atEnd=!i;let r=this.next??"stream";for(;r&&(i||this.hasChars(1));)r=yield*this.parseNext(r)}atLineEnd(){let n=this.pos,i=this.buffer[n];for(;i===" "||i===" ";)i=this.buffer[++n];return!i||i==="#"||i===`
174
+ `?!0:i==="\r"?this.buffer[n+1]===`
175
+ `:!1}charAt(n){return this.buffer[this.pos+n]}continueScalar(n){let i=this.buffer[n];if(this.indentNext>0){let r=0;for(;i===" ";)i=this.buffer[++r+n];if(i==="\r"){const l=this.buffer[r+n+1];if(l===`
176
+ `||!l&&!this.atEnd)return n+r+1}return i===`
177
+ `||r>=this.indentNext||!i&&!this.atEnd?n+r:-1}if(i==="-"||i==="."){const r=this.buffer.substr(n,3);if((r==="---"||r==="...")&&Dn(this.buffer[n+3]))return-1}return n}getLine(){let n=this.lineEndPos;return(typeof n!="number"||n!==-1&&n<this.pos)&&(n=this.buffer.indexOf(`
178
+ `,this.pos),this.lineEndPos=n),n===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[n-1]==="\r"&&(n-=1),this.buffer.substring(this.pos,n))}hasChars(n){return this.pos+n<=this.buffer.length}setNext(n){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=n,null}peek(n){return this.buffer.substr(this.pos,n)}*parseNext(n){switch(n){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 n=this.getLine();if(n===null)return this.setNext("stream");if(n[0]===R1&&(yield*this.pushCount(1),n=n.substring(1)),n[0]==="%"){let i=n.length,r=n.indexOf("#");for(;r!==-1;){const c=n[r-1];if(c===" "||c===" "){i=r-1;break}else r=n.indexOf("#",r+1)}for(;;){const c=n[i-1];if(c===" "||c===" ")i-=1;else break}const l=(yield*this.pushCount(i))+(yield*this.pushSpaces(!0));return yield*this.pushCount(n.length-l),this.pushNewline(),"stream"}if(this.atLineEnd()){const i=yield*this.pushSpaces(!0);return yield*this.pushCount(n.length-i),yield*this.pushNewline(),"stream"}return yield M1,yield*this.parseLineStart()}*parseLineStart(){const n=this.charAt(0);if(!n&&!this.atEnd)return this.setNext("line-start");if(n==="-"||n==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");const i=this.peek(3);if((i==="---"||i==="...")&&Dn(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,i==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!Dn(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[n,i]=this.peek(2);if(!i&&!this.atEnd)return this.setNext("block-start");if((n==="-"||n==="?"||n===":")&&Dn(i)){const r=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=r,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const n=this.getLine();if(n===null)return this.setNext("doc");let i=yield*this.pushIndicators();switch(n[i]){case"#":yield*this.pushCount(n.length-i);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(uf),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return i+=yield*this.parseBlockScalarHeader(),i+=yield*this.pushSpaces(!0),yield*this.pushCount(n.length-i),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let n,i,r=-1;do n=yield*this.pushNewline(),n>0?(i=yield*this.pushSpaces(!1),this.indentValue=r=i):i=0,i+=yield*this.pushSpaces(!0);while(n+i>0);const l=this.getLine();if(l===null)return this.setNext("flow");if((r!==-1&&r<this.indentNext&&l[0]!=="#"||r===0&&(l.startsWith("---")||l.startsWith("..."))&&Dn(l[3]))&&!(r===this.indentNext-1&&this.flowLevel===1&&(l[0]==="]"||l[0]==="}")))return this.flowLevel=0,yield B1,yield*this.parseLineStart();let c=0;for(;l[c]===",";)c+=yield*this.pushCount(1),c+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(c+=yield*this.pushIndicators(),l[c]){case void 0:return"flow";case"#":return yield*this.pushCount(l.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(uf),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const d=this.charAt(1);if(this.flowKey||Dn(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 n=this.charAt(0);let i=this.buffer.indexOf(n,this.pos+1);if(n==="'")for(;i!==-1&&this.buffer[i+1]==="'";)i=this.buffer.indexOf("'",i+2);else for(;i!==-1;){let c=0;for(;this.buffer[i-1-c]==="\\";)c+=1;if(c%2===0)break;i=this.buffer.indexOf('"',i+1)}const r=this.buffer.substring(0,i);let l=r.indexOf(`
179
+ `,this.pos);if(l!==-1){for(;l!==-1;){const c=this.continueScalar(l+1);if(c===-1)break;l=r.indexOf(`
180
+ `,c)}l!==-1&&(i=l-(r[l-1]==="\r"?2:1))}if(i===-1){if(!this.atEnd)return this.setNext("quoted-scalar");i=this.buffer.length}return yield*this.pushToIndex(i+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let n=this.pos;for(;;){const i=this.buffer[++n];if(i==="+")this.blockScalarKeep=!0;else if(i>"0"&&i<="9")this.blockScalarIndent=Number(i)-1;else if(i!=="-")break}return yield*this.pushUntil(i=>Dn(i)||i==="#")}*parseBlockScalar(){let n=this.pos-1,i=0,r;e:for(let c=this.pos;r=this.buffer[c];++c)switch(r){case" ":i+=1;break;case`
181
+ `:n=c,i=0;break;case"\r":{const d=this.buffer[c+1];if(!d&&!this.atEnd)return this.setNext("block-scalar");if(d===`
182
+ `)break}default:break e}if(!r&&!this.atEnd)return this.setNext("block-scalar");if(i>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=i:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{const c=this.continueScalar(n+1);if(c===-1)break;n=this.buffer.indexOf(`
183
+ `,c)}while(n!==-1);if(n===-1){if(!this.atEnd)return this.setNext("block-scalar");n=this.buffer.length}}let l=n+1;for(r=this.buffer[l];r===" ";)r=this.buffer[++l];if(r===" "){for(;r===" "||r===" "||r==="\r"||r===`
184
+ `;)r=this.buffer[++l];n=l-1}else if(!this.blockScalarKeep)do{let c=n-1,d=this.buffer[c];d==="\r"&&(d=this.buffer[--c]);const m=c;for(;d===" ";)d=this.buffer[--c];if(d===`
185
+ `&&c>=this.pos&&c+1+i>m)n=c;else break}while(!0);return yield Ef,yield*this.pushToIndex(n+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const n=this.flowLevel>0;let i=this.pos-1,r=this.pos-1,l;for(;l=this.buffer[++r];)if(l===":"){const c=this.buffer[r+1];if(Dn(c)||n&&Hl.has(c))break;i=r}else if(Dn(l)){let c=this.buffer[r+1];if(l==="\r"&&(c===`
186
+ `?(r+=1,l=`
187
+ `,c=this.buffer[r+1]):i=r),c==="#"||n&&Hl.has(c))break;if(l===`
188
+ `){const d=this.continueScalar(r+1);if(d===-1)break;r=Math.max(r,d-2)}}else{if(n&&Hl.has(l))break;i=r}return!l&&!this.atEnd?this.setNext("plain-scalar"):(yield Ef,yield*this.pushToIndex(i+1,!0),n?"flow":"doc")}*pushCount(n){return n>0?(yield this.buffer.substr(this.pos,n),this.pos+=n,n):0}*pushToIndex(n,i){const r=this.buffer.slice(this.pos,n);return r?(yield r,this.pos+=r.length,r.length):(i&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(uf))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const n=this.flowLevel>0,i=this.charAt(1);if(Dn(i)||n&&Hl.has(i))return n?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 n=this.pos+2,i=this.buffer[n];for(;!Dn(i)&&i!==">";)i=this.buffer[++n];return yield*this.pushToIndex(i===">"?n+1:n,!1)}else{let n=this.pos+1,i=this.buffer[n];for(;i;)if(h5.has(i))i=this.buffer[++n];else if(i==="%"&&Gb.has(this.buffer[n+1])&&Gb.has(this.buffer[n+2]))i=this.buffer[n+=3];else break;return yield*this.pushToIndex(n,!1)}}*pushNewline(){const n=this.buffer[this.pos];return n===`
189
+ `?yield*this.pushCount(1):n==="\r"&&this.charAt(1)===`
190
+ `?yield*this.pushCount(2):0}*pushSpaces(n){let i=this.pos-1,r;do r=this.buffer[++i];while(r===" "||n&&r===" ");const l=i-this.pos;return l>0&&(yield this.buffer.substr(this.pos,l),this.pos=i),l}*pushUntil(n){let i=this.pos,r=this.buffer[i];for(;!n(r);)r=this.buffer[++i];return yield*this.pushToIndex(i,!1)}}class b5{constructor(){this.lineStarts=[],this.addNewLine=n=>this.lineStarts.push(n),this.linePos=n=>{let i=0,r=this.lineStarts.length;for(;i<r;){const c=i+r>>1;this.lineStarts[c]<n?i=c+1:r=c}if(this.lineStarts[i]===n)return{line:i+1,col:1};if(i===0)return{line:0,col:n};const l=this.lineStarts[i-1];return{line:i,col:n-l+1}}}}function Ia(e,n){for(let i=0;i<e.length;++i)if(e[i].type===n)return!0;return!1}function Ib(e){for(let n=0;n<e.length;++n)switch(e[n].type){case"space":case"comment":case"newline":break;default:return n}return-1}function L1(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 Zl(e){switch(e.type){case"document":return e.start;case"block-map":{const n=e.items[e.items.length-1];return n.sep??n.start}case"block-seq":return e.items[e.items.length-1].start;default:return[]}}function _s(e){if(e.length===0)return[];let n=e.length;e:for(;--n>=0;)switch(e[n].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;e[++n]?.type==="space";);return e.splice(n,e.length)}function Hb(e){if(e.start.type==="flow-seq-start")for(const n of e.items)n.sep&&!n.value&&!Ia(n.start,"explicit-key-ind")&&!Ia(n.sep,"map-value-ind")&&(n.key&&(n.value=n.key),delete n.key,L1(n.value)?n.value.end?Array.prototype.push.apply(n.value.end,n.sep):n.value.end=n.sep:Array.prototype.push.apply(n.start,n.sep),delete n.sep)}class v5{constructor(n){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new y5,this.onNewLine=n}*parse(n,i=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const r of this.lexer.lex(n,i))yield*this.next(r);i||(yield*this.end())}*next(n){if(this.source=n,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=n.length;return}const i=m5(n);if(i)if(i==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=i,yield*this.step(),i){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+n.length);break;case"space":this.atNewLine&&n[0]===" "&&(this.indent+=n.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=n.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=n.length}else{const r=`Not a YAML token: ${n}`;yield*this.pop({type:"error",offset:this.offset,message:r,source:n}),this.offset+=n.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 n=this.peek(1);if(this.type==="doc-end"&&n?.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(!n)return yield*this.stream();switch(n.type){case"document":return yield*this.document(n);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(n);case"block-scalar":return yield*this.blockScalar(n);case"block-map":return yield*this.blockMap(n);case"block-seq":return yield*this.blockSequence(n);case"flow-collection":return yield*this.flowCollection(n);case"doc-end":return yield*this.documentEnd(n)}yield*this.pop()}peek(n){return this.stack[this.stack.length-n]}*pop(n){const i=n??this.stack.pop();if(!i)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield i;else{const r=this.peek(1);switch(i.type==="block-scalar"?i.indent="indent"in r?r.indent:0:i.type==="flow-collection"&&r.type==="document"&&(i.indent=0),i.type==="flow-collection"&&Hb(i),r.type){case"document":r.value=i;break;case"block-scalar":r.props.push(i);break;case"block-map":{const l=r.items[r.items.length-1];if(l.value){r.items.push({start:[],key:i,sep:[]}),this.onKeyLine=!0;return}else if(l.sep)l.value=i;else{Object.assign(l,{key:i,sep:[]}),this.onKeyLine=!l.explicitKey;return}break}case"block-seq":{const l=r.items[r.items.length-1];l.value?r.items.push({start:[],value:i}):l.value=i;break}case"flow-collection":{const l=r.items[r.items.length-1];!l||l.value?r.items.push({start:[],key:i,sep:[]}):l.sep?l.value=i:Object.assign(l,{key:i,sep:[]});return}default:yield*this.pop(),yield*this.pop(i)}if((r.type==="document"||r.type==="block-map"||r.type==="block-seq")&&(i.type==="block-map"||i.type==="block-seq")){const l=i.items[i.items.length-1];l&&!l.sep&&!l.value&&l.start.length>0&&Ib(l.start)===-1&&(i.indent===0||l.start.every(c=>c.type!=="comment"||c.indent<i.indent))&&(r.type==="document"?r.end=l.start:r.items.push({start:l.start}),i.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 n={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&n.start.push(this.sourceToken),this.stack.push(n);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(n){if(n.value)return yield*this.lineEnd(n);switch(this.type){case"doc-start":{Ib(n.start)!==-1?(yield*this.pop(),yield*this.step()):n.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":n.start.push(this.sourceToken);return}const i=this.startBlockValue(n);i?this.stack.push(i):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(n){if(this.type==="map-value-ind"){const i=Zl(this.peek(2)),r=_s(i);let l;n.end?(l=n.end,l.push(this.sourceToken),delete n.end):l=[this.sourceToken];const c={type:"block-map",offset:n.offset,indent:n.indent,items:[{start:r,key:n,sep:l}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=c}else yield*this.lineEnd(n)}*blockScalar(n){switch(this.type){case"space":case"comment":case"newline":n.props.push(this.sourceToken);return;case"scalar":if(n.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let i=this.source.indexOf(`
191
+ `)+1;for(;i!==0;)this.onNewLine(this.offset+i),i=this.source.indexOf(`
192
+ `,i)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(n){const i=n.items[n.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,i.value){const r="end"in i.value?i.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):n.items.push({start:[this.sourceToken]})}else i.sep?i.sep.push(this.sourceToken):i.start.push(this.sourceToken);return;case"space":case"comment":if(i.value)n.items.push({start:[this.sourceToken]});else if(i.sep)i.sep.push(this.sourceToken);else{if(this.atIndentedComment(i.start,n.indent)){const l=n.items[n.items.length-2]?.value?.end;if(Array.isArray(l)){Array.prototype.push.apply(l,i.start),l.push(this.sourceToken),n.items.pop();return}}i.start.push(this.sourceToken)}return}if(this.indent>=n.indent){const r=!this.onKeyLine&&this.indent===n.indent,l=r&&(i.sep||i.explicitKey)&&this.type!=="seq-item-ind";let c=[];if(l&&i.sep&&!i.value){const d=[];for(let m=0;m<i.sep.length;++m){const g=i.sep[m];switch(g.type){case"newline":d.push(m);break;case"space":break;case"comment":g.indent>n.indent&&(d.length=0);break;default:d.length=0}}d.length>=2&&(c=i.sep.splice(d[1]))}switch(this.type){case"anchor":case"tag":l||i.value?(c.push(this.sourceToken),n.items.push({start:c}),this.onKeyLine=!0):i.sep?i.sep.push(this.sourceToken):i.start.push(this.sourceToken);return;case"explicit-key-ind":!i.sep&&!i.explicitKey?(i.start.push(this.sourceToken),i.explicitKey=!0):l||i.value?(c.push(this.sourceToken),n.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(i.explicitKey)if(i.sep)if(i.value)n.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Ia(i.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(L1(i.key)&&!Ia(i.sep,"newline")){const d=_s(i.start),m=i.key,g=i.sep;g.push(this.sourceToken),delete i.key,delete i.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:d,key:m,sep:g}]})}else c.length>0?i.sep=i.sep.concat(c,this.sourceToken):i.sep.push(this.sourceToken);else if(Ia(i.start,"newline"))Object.assign(i,{key:null,sep:[this.sourceToken]});else{const d=_s(i.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:d,key:null,sep:[this.sourceToken]}]})}else i.sep?i.value||l?n.items.push({start:c,key:null,sep:[this.sourceToken]}):Ia(i.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):i.sep.push(this.sourceToken):Object.assign(i,{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);l||i.value?(n.items.push({start:c,key:d,sep:[]}),this.onKeyLine=!0):i.sep?this.stack.push(d):(Object.assign(i,{key:d,sep:[]}),this.onKeyLine=!0);return}default:{const d=this.startBlockValue(n);if(d){if(d.type==="block-seq"){if(!i.explicitKey&&i.sep&&!Ia(i.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 r&&n.items.push({start:c});this.stack.push(d);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(n){const i=n.items[n.items.length-1];switch(this.type){case"newline":if(i.value){const r="end"in i.value?i.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):n.items.push({start:[this.sourceToken]})}else i.start.push(this.sourceToken);return;case"space":case"comment":if(i.value)n.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(i.start,n.indent)){const l=n.items[n.items.length-2]?.value?.end;if(Array.isArray(l)){Array.prototype.push.apply(l,i.start),l.push(this.sourceToken),n.items.pop();return}}i.start.push(this.sourceToken)}return;case"anchor":case"tag":if(i.value||this.indent<=n.indent)break;i.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==n.indent)break;i.value||Ia(i.start,"seq-item-ind")?n.items.push({start:[this.sourceToken]}):i.start.push(this.sourceToken);return}if(this.indent>n.indent){const r=this.startBlockValue(n);if(r){this.stack.push(r);return}}yield*this.pop(),yield*this.step()}*flowCollection(n){const i=n.items[n.items.length-1];if(this.type==="flow-error-end"){let r;do yield*this.pop(),r=this.peek(1);while(r?.type==="flow-collection")}else if(n.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!i||i.sep?n.items.push({start:[this.sourceToken]}):i.start.push(this.sourceToken);return;case"map-value-ind":!i||i.value?n.items.push({start:[],key:null,sep:[this.sourceToken]}):i.sep?i.sep.push(this.sourceToken):Object.assign(i,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!i||i.value?n.items.push({start:[this.sourceToken]}):i.sep?i.sep.push(this.sourceToken):i.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const l=this.flowScalar(this.type);!i||i.value?n.items.push({start:[],key:l,sep:[]}):i.sep?this.stack.push(l):Object.assign(i,{key:l,sep:[]});return}case"flow-map-end":case"flow-seq-end":n.end.push(this.sourceToken);return}const r=this.startBlockValue(n);r?this.stack.push(r):(yield*this.pop(),yield*this.step())}else{const r=this.peek(2);if(r.type==="block-map"&&(this.type==="map-value-ind"&&r.indent===n.indent||this.type==="newline"&&!r.items[r.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&r.type!=="flow-collection"){const l=Zl(r),c=_s(l);Hb(n);const d=n.end.splice(1,n.end.length);d.push(this.sourceToken);const m={type:"block-map",offset:n.offset,indent:n.indent,items:[{start:c,key:n,sep:d}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=m}else yield*this.lineEnd(n)}}flowScalar(n){if(this.onNewLine){let i=this.source.indexOf(`
193
+ `)+1;for(;i!==0;)this.onNewLine(this.offset+i),i=this.source.indexOf(`
194
+ `,i)+1}return{type:n,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(n){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 i=Zl(n),r=_s(i);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const i=Zl(n),r=_s(i);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(n,i){return this.type!=="comment"||this.indent<=i?!1:n.every(r=>r.type==="newline"||r.type==="space")}*documentEnd(n){this.type!=="doc-mode"&&(n.end?n.end.push(this.sourceToken):n.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(n){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:n.end?n.end.push(this.sourceToken):n.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function S5(e){const n=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||n&&new b5||null,prettyErrors:n}}function x5(e,n={}){const{lineCounter:i,prettyErrors:r}=S5(n),l=new v5(i?.addNewLine),c=new p5(n),d=Array.from(c.compose(l.parse(e)));if(r&&i)for(const m of d)m.errors.forEach($b(e,i)),m.warnings.forEach($b(e,i));return d.length>0?d:Object.assign([],{empty:!0},c.streamInfo())}function w5({onApplied:e}){const[n,i]=U.useState(""),[r,l]=U.useState(!1),[c,d]=U.useState([]),[m,g]=U.useState([]),b=async()=>{if(!n.trim())return;l(!0),d([]),g([]);const v=x5(n),S=[],w=[];for(let _=0;_<v.length;_++){const C=v[_];if(C.errors.length>0){S.push(`Document ${_+1}: ${C.errors[0]?.message}`);continue}const N=C.toJSON();if(!(!N||typeof N!="object"))try{const T=await HN(N);w.push(`Applied "${T.displayName||T.name}" (revision ${T.configRevision})`)}catch(T){S.push(`Document ${_+1}: ${T instanceof Error?T.message:String(T)}`)}}d(w),g(S),l(!1),w.length>0&&(cn({title:"YAML applied",detail:`Applied ${w.length} document${w.length===1?"":"s"} successfully.`,tone:S.length>0?"caution":"positive",dedupeKey:"yaml:apply",dedupeMode:"replace"}),e())};return f.jsxs("section",{className:"mt-8",children:[f.jsx("div",{className:"page-section-divider"}),f.jsx("div",{className:"section-head mt-6",children:f.jsxs("div",{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"Config as code"}),f.jsx("h2",{className:"text-sm font-medium text-zinc-200",children:"Apply YAML"})]})}),f.jsxs("p",{className:"text-zinc-500 text-sm mb-3",children:["Paste a ",f.jsx("code",{className:"text-zinc-400",children:"canonry.yaml"})," config (multi-document YAML with ",f.jsx("code",{className:"text-zinc-400",children:"---"})," separators supported)."]}),f.jsx("textarea",{className:"setup-input w-full font-mono text-xs",rows:10,placeholder:`apiVersion: canonry/v1
195
+ kind: Project
196
+ metadata:
197
+ name: my-project
198
+ spec:
199
+ canonicalDomain: example.com
200
+ country: US
201
+ language: en
202
+ queries: []`,value:n,onChange:v=>i(v.target.value)}),c.length>0&&f.jsx("ul",{className:"mt-2 space-y-1",children:c.map((v,S)=>f.jsx("li",{className:"text-emerald-400 text-sm",children:v},S))}),m.length>0&&f.jsx("ul",{className:"mt-2 space-y-1",children:m.map((v,S)=>f.jsx("li",{className:"text-rose-400 text-sm",children:v},S))}),f.jsx("div",{className:"mt-3",children:f.jsx(Le,{type:"button",disabled:!n.trim()||r,onClick:Sn(b),children:r?"Applying...":"Apply"})})]})}function j5(){const{dashboard:e,isLoading:n,refetch:i}=Sc();if(!e||n)return f.jsxs("div",{className:"page-skeleton",children:[f.jsxs("div",{className:"page-skeleton-header",children:[f.jsx("div",{className:"skeleton-text h-6 w-28"}),f.jsx("div",{className:"skeleton-text-sm w-40"})]}),f.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 overflow-hidden",children:[f.jsx("div",{className:"p-3 border-b border-zinc-800/60 flex gap-8",children:["Name","Domain","Mentions","Last run","Country"].map(D=>f.jsx("div",{className:"skeleton-text-sm w-16"},D))}),[1,2,3].map(D=>f.jsxs("div",{className:"p-3 border-b border-zinc-800/40 flex gap-8 items-center",children:[f.jsxs("div",{className:"flex-1 space-y-1",children:[f.jsx("div",{className:"skeleton-text w-28"}),f.jsx("div",{className:"skeleton-text-sm w-16"})]}),f.jsx("div",{className:"skeleton-text w-24"}),f.jsx("div",{className:"skeleton h-5 w-14 rounded-full"}),f.jsx("div",{className:"skeleton h-5 w-16 rounded-full"}),f.jsx("div",{className:"skeleton-text-sm w-8"})]},D))]})]});const r=e.projects,l=cc(),[c,d]=U.useState(!1),[m,g]=U.useState(""),[b,v]=U.useState(""),[S,w]=U.useState(""),[_,C]=U.useState("US"),[N,T]=U.useState("en"),[L,Z]=U.useState(!1),[J,K]=U.useState(null),X=m.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),G=async()=>{if(!(!X||!S)){Z(!0),K(null);try{const D=await lo(X,{displayName:b||m,canonicalDomain:S,country:_,language:N});cn({title:"Project created",detail:`${D.displayName||D.name} is ready to configure.`,tone:"positive",dedupeKey:`project:create:${D.name}`,dedupeMode:"drop"}),i(),g(""),v(""),w(""),C("US"),T("en"),d(!1),l({to:"/projects/$projectId",params:{projectId:D.id}})}catch(D){K(D instanceof Error?D.message:"Failed to create project")}finally{Z(!1)}}};return f.jsxs("div",{className:"page-container",children:[f.jsxs("div",{className:"page-header",children:[f.jsxs("div",{className:"page-header-left",children:[f.jsx("h1",{className:"page-title",children:"Projects"}),f.jsxs("p",{className:"page-subtitle",children:[r.length," project",r.length!==1?"s":""," tracked"]})]}),f.jsx("div",{className:"page-header-right",children:f.jsxs(Le,{type:"button",onClick:()=>d(D=>!D),children:[f.jsx(My,{className:"size-4 mr-1.5"}),"Add project"]})})]}),c?f.jsxs(xn,{className:"surface-card mb-6",children:[f.jsx("div",{className:"section-head",children:f.jsxs("div",{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"New project"}),f.jsx("h2",{className:"text-sm font-medium text-zinc-200",children:"Create a new monitoring project"})]})}),f.jsxs("div",{className:"compact-stack mt-4",children:[f.jsxs("div",{className:"setup-field-row",children:[f.jsxs("div",{className:"setup-field",children:[f.jsx("label",{className:"setup-label",htmlFor:"new-project-name",children:"Project name"}),f.jsx("input",{id:"new-project-name",className:"setup-input",type:"text",placeholder:"my-project",value:m,onChange:D=>g(D.target.value)}),X&&X!==m?f.jsxs("p",{className:"supporting-copy",children:["Slug: ",X]}):null]}),f.jsxs("div",{className:"setup-field",children:[f.jsx("label",{className:"setup-label",htmlFor:"new-display-name",children:"Display name"}),f.jsx("input",{id:"new-display-name",className:"setup-input",type:"text",placeholder:"My Project",value:b,onChange:D=>v(D.target.value)})]})]}),f.jsxs("div",{className:"setup-field",children:[f.jsx("label",{className:"setup-label",htmlFor:"new-domain",children:"Canonical domain"}),f.jsx("input",{id:"new-domain",className:"setup-input",type:"text",placeholder:"example.com",value:S,onChange:D=>w(D.target.value)})]}),f.jsxs("div",{className:"setup-field-row",children:[f.jsxs("div",{className:"setup-field",children:[f.jsx("label",{className:"setup-label",htmlFor:"new-country",children:"Country"}),f.jsx("input",{id:"new-country",className:"setup-input",type:"text",placeholder:"US",maxLength:2,value:_,onChange:D=>C(D.target.value.toUpperCase())})]}),f.jsxs("div",{className:"setup-field",children:[f.jsx("label",{className:"setup-label",htmlFor:"new-language",children:"Language"}),f.jsx("input",{id:"new-language",className:"setup-input",type:"text",placeholder:"en",maxLength:5,value:N,onChange:D=>T(D.target.value.toLowerCase())})]})]})]}),J?f.jsx("p",{className:"text-rose-400 text-sm mt-3",children:J}):null,f.jsxs("div",{className:"flex items-center gap-3 mt-4",children:[f.jsx(Le,{type:"button",disabled:!X||!S||L,onClick:Sn(G),children:L?"Creating...":"Create project"}),f.jsx(Le,{type:"button",variant:"ghost",onClick:()=>d(!1),children:"Cancel"})]})]}):null,r.length>0?f.jsx("div",{className:"data-table-wrapper",children:f.jsxs("table",{className:"data-table",children:[f.jsx("thead",{children:f.jsxs("tr",{children:[f.jsx("th",{children:"Name"}),f.jsx("th",{children:"Domain"}),f.jsx("th",{children:"Mentions"}),f.jsx("th",{children:"Last run"}),f.jsx("th",{className:"text-right",children:"Country"})]})}),f.jsx("tbody",{children:r.map(D=>{const R=D.recentRuns[0];return f.jsxs("tr",{className:"cursor-pointer",onClick:()=>{l({to:"/projects/$projectId",params:{projectId:D.project.id}})},children:[f.jsxs("td",{children:[f.jsx(rt,{to:"/projects/$projectId",params:{projectId:D.project.id},className:"text-zinc-100 font-medium hover:underline",onClick:oe=>oe.stopPropagation(),children:D.project.displayName||D.project.name}),f.jsx("p",{className:"text-[11px] text-zinc-500",children:D.project.name})]}),f.jsx("td",{className:"text-zinc-400",children:D.project.canonicalDomain}),f.jsx("td",{children:f.jsx(Mn,{tone:D.mentionSummary.tone,children:D.mentionSummary.value})}),f.jsx("td",{className:"text-zinc-500 text-sm",children:R?f.jsx(cp,{status:R.status}):f.jsx("span",{className:"text-zinc-600",children:"No runs"})}),f.jsx("td",{className:"text-right text-zinc-500",children:D.project.country})]},D.project.id)})})]})}):c?null:f.jsxs(xn,{className:"surface-card empty-card",children:[f.jsx("h3",{children:"No projects yet"}),f.jsx("p",{className:"supporting-copy",children:"Create your first monitoring project to start tracking AI visibility."}),f.jsxs(Le,{type:"button",onClick:()=>d(!0),children:[f.jsx(My,{className:"size-4 mr-1.5"}),"Add project"]})]}),f.jsx(w5,{onApplied:()=>{i()}})]})}function q1(e){e.invalidateQueries({queryKey:rp({client:ie})}),e.invalidateQueries({queryKey:Ks({client:ie})})}function N5(e){return e==="gsc-sync"?"GSC sync queued":e==="inspect-sitemap"?"Sitemap inspection queued":"Visibility sweep queued"}function k5(e,n){const i=e??"Project";return n==="gsc-sync"?`${i} will refresh after the sync completes.`:n==="inspect-sitemap"?`${i} will notify you when sitemap inspection finishes.`:`${i} will notify you when the run finishes.`}function Oc(e,n){z0({id:e.id,projectId:e.projectId,kind:e.kind,projectLabel:n.projectLabel,sourceAction:n.sourceAction,lastAnnouncedStatus:"queued"}),cn({title:N5(e.kind),detail:k5(n.projectLabel,e.kind),tone:"neutral",dedupeKey:`run:${e.id}`,dedupeMode:"replace"})}function A5(e){const n=e.filter(l=>l.status!=="conflict"),i=e.filter(l=>l.status==="conflict");if(n.length===0){cn({title:"No runs queued",detail:i.length>0?`${i.length} project${i.length===1?"":"s"} already had a run in progress.`:"No projects were available to queue.",tone:"caution",durationMs:8e3,dedupeKey:"run-all:conflict",dedupeMode:"replace"});return}for(const l of n)z0({id:l.id,projectId:l.projectId,kind:l.kind,projectLabel:l.projectName,sourceAction:"run-all",lastAnnouncedStatus:"queued"});const r=ZO({runIds:n.map(l=>l.id),queuedCount:n.length,skippedCount:i.length});cn({title:"Run-all batch queued",detail:i.length>0?`${n.length} project${n.length===1?"":"s"} queued, ${i.length} skipped because a run is already active.`:`${n.length} project${n.length===1?"":"s"} queued.`,tone:i.length>0?"caution":"neutral",dedupeKey:`batch:${r}`,dedupeMode:"replace"})}function Dc(e,n){if(e instanceof In&&e.code==="RUN_IN_PROGRESS"){cn({title:"Run already in progress",detail:n?.projectLabel?`${n.projectLabel} already has an active run. Wait for it to finish, then retry.`:"This project already has an active run. Wait for it to finish, then retry.",tone:"caution",durationMs:8e3,dedupeKey:`run-in-progress:${n?.projectKey??"project"}:${n?.sourceAction??"run"}`,dedupeMode:"replace"});return}cn({title:e instanceof Error?e.message:"Failed to queue run",tone:"negative"})}function _5(){const e=Ka();return Ai({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:n,opts:i})=>$N(n,i),onSuccess:(n,i)=>{q1(e),Oc(n,{projectLabel:i.projectLabel??i.projectName,sourceAction:i.sourceAction})},onError:(n,i)=>{Dc(n,{projectKey:i.projectName,projectLabel:i.projectLabel??i.projectName,sourceAction:i.sourceAction})}})}function r6(){const e=Ka();return Ai({meta:{skipGlobalErrorToast:!0},mutationFn:n=>ZN(n),onSuccess:n=>{q1(e),A5(n)},onError:n=>{cn({title:n instanceof Error?n.message:"Failed to queue runs",tone:"negative"})}})}function o6(){const e=Ka();return Ai({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:n,opts:i})=>PN(n,i),onSuccess:(n,i)=>{xc(e,Te["gsc-sync"],i.projectName),Oc(n,{projectLabel:i.projectLabel??i.projectName,sourceAction:"gsc-sync"})},onError:(n,i)=>{Dc(n,{projectKey:i.projectName,projectLabel:i.projectLabel??i.projectName,sourceAction:"gsc-sync"})}})}function l6(){const e=Ka();return Ai({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:n})=>YN(n),onSuccess:(n,i)=>{xc(e,n.run.kind,i.projectName),Oc(n.run,{projectLabel:i.projectLabel??i.projectName,sourceAction:"discover-sitemaps"})},onError:(n,i)=>{Dc(n,{projectKey:i.projectName,projectLabel:i.projectLabel??i.projectName,sourceAction:"discover-sitemaps"})}})}function c6(){const e=Ka();return Ai({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:n,opts:i})=>QN(n,i),onSuccess:(n,i)=>{xc(e,Te["inspect-sitemap"],i.projectName),Oc(n,{projectLabel:i.projectLabel??i.projectName,sourceAction:"inspect-sitemap"})},onError:(n,i)=>{Dc(n,{projectKey:i.projectName,projectLabel:i.projectLabel??i.projectName,sourceAction:"inspect-sitemap"})}})}function $1(e){return Array.isArray(e.queryKey)&&e.queryKey[0]==="projects"&&e.queryKey.length>1}function u6(){const e=Ka();return Ai({mutationFn:({projectName:n,queries:i})=>BN(n,i),onSuccess:()=>{e.invalidateQueries({queryKey:Ks({client:ie})}),e.invalidateQueries({predicate:$1})}})}function d6(){const e=Ka();return Ai({mutationFn:({projectName:n,body:i})=>LN(n,i),onSuccess:()=>{e.invalidateQueries({predicate:n=>Array.isArray(n.queryKey)&&typeof n.queryKey[0]=="object"&&n.queryKey[0]!==null&&"_id"in n.queryKey[0]&&typeof n.queryKey[0]._id=="string"&&n.queryKey[0]._id.startsWith("getApiV1ProjectsByName")}),e.invalidateQueries({predicate:$1})}})}const z5=[{label:"System check",description:"Verify your instance is ready"},{label:"Create project",description:"Name, domain, and locale"},{label:"Queries",description:"Add queries to track"},{label:"Competitors",description:"Add competitor domains"},{label:"Launch",description:"Start your first visibility sweep"}];function C5({current:e,labels:n}){return f.jsx("div",{className:"setup-steps",role:"list","aria-label":"Setup progress",children:n.map((i,r)=>{const l=r<e,c=r===e;return f.jsxs("div",{className:`setup-step ${l?"setup-step-done":""} ${c?"setup-step-active":""}`,role:"listitem","aria-current":c?"step":void 0,children:[f.jsx("span",{className:"setup-step-number",children:l?"✓":r+1}),f.jsx("span",{className:"setup-step-label",children:i.label})]},i.label)})})}function T5(){const e=vc(),{dashboard:n,isLoading:i,refetch:r}=Sc(),l=n??e?.dashboard;if(!l||i)return f.jsxs("div",{className:"page-skeleton",children:[f.jsxs("div",{className:"page-skeleton-header",children:[f.jsx("div",{className:"skeleton-text h-6 w-24"}),f.jsx("div",{className:"skeleton-text-sm w-80"})]}),f.jsxs("div",{className:"page-skeleton-card",children:[f.jsx("div",{className:"skeleton-text w-32"}),f.jsx("div",{className:"space-y-3 mt-3",children:[1,2,3].map(ee=>f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsxs("div",{className:"space-y-1 flex-1",children:[f.jsx("div",{className:"skeleton-text w-24"}),f.jsx("div",{className:"skeleton-text-sm w-48"})]}),f.jsx("div",{className:"skeleton h-6 w-16 rounded-full"})]},ee))})]})]});const c=l.settings,g=dp(!e,e?.health).data??e?.health??{apiStatus:{label:"API",state:"checking",detail:"Checking service health"},workerStatus:{label:"Worker",state:"checking",detail:"Checking service health"}},b=$O(l.setup,g,c),v=cc(),[S,w]=U.useState(0),[_,C]=U.useState(""),[N,T]=U.useState(""),[L,Z]=U.useState(""),[J,K]=U.useState("US"),[X,G]=U.useState("en"),[D,R]=U.useState(!1),[oe,Ne]=U.useState(null),[te,de]=U.useState(null),[Me,Qe]=U.useState(null),[be,$]=U.useState(!1),[F,pe]=U.useState(""),[je,se]=U.useState(!1),[Ye,Q]=U.useState(null),[le,ne]=U.useState(!1),ue=c.providerStatuses.filter(ee=>ee.state==="ready"),[ae,Ae]=U.useState(ue[0]?.name??""),[tt,xe]=U.useState(5),[$e,Ze]=U.useState(!1),[Ct,_n]=U.useState(null),[Tt,Fs]=U.useState(""),[Ei,Rc]=U.useState(!1),[Ws,Oi]=U.useState(null),[Di,Ri]=U.useState(!1),[mo,Mc]=U.useState(!1),[Lt,ho]=U.useState(!1),[er,go]=U.useState(null),Mi=_5(),Bc=Gn({...N0({client:ie,path:{id:er??""}}),enabled:!!er,refetchInterval:({state:ee})=>{const We=ee.data?.status;return We==="completed"||We==="partial"||We==="failed"||We==="cancelled"?!1:2e3},refetchIntervalInBackground:!0}),[Bi,yo]=U.useState(""),[tr,ga]=U.useState(!1),[qt,zn]=U.useState(null),mt=_.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),Ln=F.split(`
203
+ `).map(ee=>ee.trim()).filter(Boolean),Fa=Tt.split(`
204
+ `).map(ee=>ee.trim()).filter(Boolean),Lc=b.healthChecks.some(ee=>ee.id==="api"&&ee.state==="ready"),Li=async()=>{if(!(!mt||!L)){$(!0),Qe(null);try{const ee=await lo(mt,{displayName:N||_,canonicalDomain:L,country:J,language:X,autoExtractBacklinks:D});Ne(mt),de(ee.id),cn({title:"Project created",detail:`${ee.displayName||ee.name} is ready for setup.`,tone:"positive",dedupeKey:`project:create:${ee.name}`,dedupeMode:"drop"}),await r(),w(2)}catch(ee){Qe(ee instanceof Error?ee.message:"Failed to create project")}finally{$(!1)}}},qi=async()=>{if(!oe)return;const ee=Ln;if(ee.length!==0){ne(!0),Q(null);try{await MN(oe,ee),se(!0),await r(),w(3)}catch(We){Q(We instanceof Error?We.message:"Failed to save queries")}finally{ne(!1)}}},$i=async()=>{if(!(!oe||!ae)){Ze(!0),_n(null);try{const ee=await IN(oe,ae,tt);if(ee.queries.length>0){const We=F?F.trimEnd()+`
205
+ `+ee.queries.join(`
206
+ `):ee.queries.join(`
207
+ `);pe(We)}}catch(ee){_n(ee instanceof Error?ee.message:"Failed to generate queries")}finally{Ze(!1)}}},Pn=async()=>{if(!oe)return;const ee=Fa;if(ee.length!==0){Ri(!0),Oi(null);try{await qN(oe,ee),Rc(!0),await r(),w(4)}catch(We){Oi(We instanceof Error?We.message:"Failed to save competitors")}finally{Ri(!1)}}},Ui=async()=>{const ee=Bi.trim();if(ee){ga(!0),zn(null);try{await GN("gemini",{apiKey:ee}),cn({title:"Gemini configured",detail:"Provider is ready — continuing setup.",tone:"positive",dedupeKey:"setup:gemini:configured",dedupeMode:"drop"}),yo(""),await r()}catch(We){zn(We instanceof Error?We.message:"Failed to save Gemini key")}finally{ga(!1)}}},Wa=async()=>{if(oe){ho(!0);try{const ee=await Mi.mutateAsync({projectName:oe,projectLabel:N||_||oe,sourceAction:"setup-launch"});go(ee.id),Mc(!0),await r()}catch{}finally{ho(!1)}}},Kn=()=>w(ee=>Math.max(0,ee-1)),bo=(()=>{switch(S){case 0:return f.jsxs(xn,{className:"surface-card step-card",children:[f.jsx("div",{className:"section-head",children:f.jsxs("div",{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 1 of 5"}),f.jsx("h2",{children:"System ready"})]})}),f.jsx("p",{className:"supporting-copy",children:"Checking that your Canonry instance is configured and reachable."}),f.jsx("div",{className:"compact-stack",children:b.healthChecks.map(ee=>f.jsxs("div",{className:"health-check-row",children:[f.jsxs("div",{children:[f.jsx("p",{className:"run-row-title",children:ee.label}),f.jsx("p",{className:"supporting-copy",children:ee.detail}),ee.id==="provider"&&ee.state!=="ready"&&f.jsxs("div",{className:"mt-3 rounded-md border border-zinc-800/60 bg-zinc-900/40 p-3 space-y-2",children:[f.jsxs("p",{className:"text-xs text-zinc-400",children:["Paste a Gemini key to enable visibility checks (free at"," ",f.jsx("a",{href:"https://aistudio.google.com/apikey",target:"_blank",rel:"noreferrer",className:"text-emerald-400 hover:text-emerald-300 underline underline-offset-2",children:"aistudio.google.com"}),")."]}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("input",{type:"password",value:Bi,onChange:We=>yo(We.target.value),placeholder:"AI... (paste here)",className:"flex-1 rounded-md border border-zinc-800 bg-zinc-950 px-2.5 py-1.5 text-sm text-zinc-100 placeholder:text-zinc-600 focus:border-zinc-600 focus:outline-none font-mono",disabled:tr}),f.jsx(Le,{type:"button",size:"sm",disabled:tr||!Bi.trim(),onClick:Sn(Ui),children:tr?"Saving...":"Save"})]}),qt&&f.jsx("p",{className:"text-xs text-rose-400",children:qt}),f.jsxs("p",{className:"text-[11px] text-zinc-600",children:["Other providers (OpenAI, Claude, Perplexity) configurable later via"," ",f.jsx(rt,{to:"/settings",className:"text-zinc-500 hover:text-zinc-300 underline underline-offset-2",children:"/settings"}),"."]})]})]}),f.jsx(Mn,{tone:ee.state==="ready"?"positive":"caution",title:ee.id==="api"?$s(g.apiStatus):ee.id==="worker"?$s(g.workerStatus):ee.detail,children:ee.state==="ready"?"Ready":"Attention"})]},ee.id))}),f.jsxs("div",{className:"setup-nav",children:[f.jsx("span",{}),f.jsx(Le,{type:"button",disabled:!Lc,onClick:()=>w(1),children:"Continue"})]})]});case 1:return f.jsxs(xn,{className:"surface-card step-card",children:[f.jsxs("div",{className:"section-head",children:[f.jsxs("div",{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 2 of 5"}),f.jsx("h2",{children:"Create project"})]}),oe?f.jsx(Mn,{tone:"positive",children:"Created"}):null]}),oe?f.jsxs("div",{className:"compact-stack",children:[f.jsxs("p",{className:"text-zinc-300",children:["Project ",f.jsx("span",{className:"text-zinc-100 font-medium",children:oe})," created successfully."]}),f.jsxs("div",{className:"setup-nav",children:[f.jsx(Le,{type:"button",variant:"outline",onClick:Kn,children:"Back"}),f.jsx(Le,{type:"button",onClick:()=>w(2),children:"Continue"})]})]}):f.jsxs("div",{className:"compact-stack",children:[f.jsxs("div",{className:"setup-field",children:[f.jsx("label",{className:"setup-label",htmlFor:"project-name",children:"Project name"}),f.jsx("input",{id:"project-name",className:"setup-input",type:"text",placeholder:"my-website",value:_,onChange:ee=>C(ee.target.value)}),mt&&mt!==_?f.jsxs("p",{className:"supporting-copy",children:["Slug: ",mt]}):null]}),f.jsxs("div",{className:"setup-field",children:[f.jsx("label",{className:"setup-label",htmlFor:"display-name",children:"Display name (optional)"}),f.jsx("input",{id:"display-name",className:"setup-input",type:"text",placeholder:"My Website",value:N,onChange:ee=>T(ee.target.value)})]}),f.jsxs("div",{className:"setup-field",children:[f.jsx("label",{className:"setup-label",htmlFor:"domain",children:"Canonical domain"}),f.jsx("input",{id:"domain",className:"setup-input",type:"text",placeholder:"example.com",value:L,onChange:ee=>Z(ee.target.value)})]}),f.jsxs("div",{className:"setup-field-row",children:[f.jsxs("div",{className:"setup-field",children:[f.jsx("label",{className:"setup-label",htmlFor:"country",children:"Country"}),f.jsx("input",{id:"country",className:"setup-input",type:"text",placeholder:"US",maxLength:2,value:J,onChange:ee=>K(ee.target.value.toUpperCase())})]}),f.jsxs("div",{className:"setup-field",children:[f.jsx("label",{className:"setup-label",htmlFor:"language",children:"Language"}),f.jsx("input",{id:"language",className:"setup-input",type:"text",placeholder:"en",maxLength:5,value:X,onChange:ee=>G(ee.target.value.toLowerCase())})]})]}),f.jsxs("label",{className:"flex items-start gap-3 rounded-md border border-zinc-800/60 bg-zinc-900/30 p-3 cursor-pointer hover:border-zinc-700",children:[f.jsx("input",{type:"checkbox",className:"mt-0.5 h-4 w-4 rounded border-zinc-700 bg-zinc-950",checked:D,onChange:ee=>R(ee.target.checked)}),f.jsxs("span",{className:"flex-1",children:[f.jsx("span",{className:"block text-sm text-zinc-100",children:"Auto-extract backlinks"}),f.jsxs("span",{className:"block text-xs text-zinc-500 mt-0.5",children:["When a new Common Crawl release syncs, automatically extract backlinks for this project."," ",f.jsx(rt,{to:"/backlinks",className:"text-emerald-400 hover:text-emerald-300 underline underline-offset-2",children:"Manage backlinks"})]})]})]}),Me?f.jsx("p",{className:"text-rose-400 text-sm",children:Me}):null,f.jsxs("div",{className:"setup-nav",children:[f.jsx(Le,{type:"button",variant:"outline",onClick:Kn,children:"Back"}),f.jsx(Le,{type:"button",disabled:!mt||!L||be,onClick:Sn(Li),children:be?"Creating...":"Create project"})]})]})]});case 2:return f.jsxs(xn,{className:"surface-card step-card",children:[f.jsxs("div",{className:"section-head",children:[f.jsxs("div",{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 3 of 5"}),f.jsx("h2",{children:"Add queries"})]}),je?f.jsxs(Mn,{tone:"positive",children:[Ln.length," saved"]}):f.jsxs(Mn,{tone:"neutral",children:[Ln.length," quer",Ln.length!==1?"ies":"y"]})]}),f.jsx("p",{className:"supporting-copy",children:"Enter the search queries you want to track. One per line."}),je?f.jsxs("div",{className:"compact-stack",children:[f.jsx("ul",{className:"detail-list",children:Ln.map(ee=>f.jsx("li",{children:ee},ee))}),f.jsxs("div",{className:"setup-nav",children:[f.jsx(Le,{type:"button",variant:"outline",onClick:Kn,children:"Back"}),f.jsx(Le,{type:"button",onClick:()=>w(3),children:"Continue"})]})]}):f.jsxs("div",{className:"compact-stack",children:[ue.length>0?f.jsxs("div",{className:"compact-stack",children:[f.jsxs("div",{className:"flex items-center gap-2 text-zinc-500 text-xs uppercase tracking-wide",children:[f.jsx("span",{className:"flex-1 border-t border-zinc-800"}),"auto-generate",f.jsx("span",{className:"flex-1 border-t border-zinc-800"})]}),f.jsxs("div",{className:"flex items-end gap-2",children:[f.jsxs("div",{className:"setup-field flex-1",children:[f.jsx("label",{className:"setup-label",htmlFor:"gen-provider",children:"Provider"}),f.jsx("select",{id:"gen-provider",className:"setup-input",value:ae,onChange:ee=>Ae(ee.target.value),children:ue.map(ee=>f.jsxs("option",{value:ee.name,children:[ee.displayName??ee.name,ee.model?` (${ee.model})`:""]},ee.name))})]}),f.jsxs("div",{className:"setup-field",children:[f.jsx("label",{className:"setup-label",htmlFor:"gen-count",children:"Count"}),f.jsx("select",{id:"gen-count",className:"setup-input",value:tt,onChange:ee=>xe(Number(ee.target.value)),children:[3,5,10,15,20].map(ee=>f.jsx("option",{value:ee,children:ee},ee))})]}),f.jsx(Le,{type:"button",variant:"outline",disabled:$e||!ae,onClick:Sn($i),children:$e?"Analyzing site...":"Generate"})]}),Ct?f.jsx("p",{className:"text-rose-400 text-sm",children:Ct}):null]}):null,f.jsxs("div",{className:"flex items-center gap-2 text-zinc-500 text-xs uppercase tracking-wide",children:[f.jsx("span",{className:"flex-1 border-t border-zinc-800"}),"or type manually",f.jsx("span",{className:"flex-1 border-t border-zinc-800"})]}),f.jsxs("div",{className:"setup-field",children:[f.jsx("label",{className:"setup-label",htmlFor:"queries",children:"Queries (one per line)"}),f.jsx("textarea",{id:"queries",className:"setup-textarea",rows:6,placeholder:`emergency dentist brooklyn
208
+ best invisalign downtown brooklyn
209
+ pediatric dentist brooklyn heights`,value:F,onChange:ee=>pe(ee.target.value)})]}),Ye?f.jsx("p",{className:"text-rose-400 text-sm",children:Ye}):null,f.jsxs("div",{className:"setup-nav",children:[f.jsx(Le,{type:"button",variant:"outline",onClick:Kn,children:"Back"}),f.jsx(Le,{type:"button",disabled:Ln.length===0||le,onClick:Sn(qi),children:le?"Saving...":`Save ${Ln.length} quer${Ln.length!==1?"ies":"y"}`})]})]})]});case 3:return f.jsxs(xn,{className:"surface-card step-card",children:[f.jsxs("div",{className:"section-head",children:[f.jsxs("div",{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 4 of 5"}),f.jsx("h2",{children:"Add competitors"})]}),Ei?f.jsx(Mn,{tone:"positive",children:"Saved"}):null]}),f.jsx("p",{className:"supporting-copy",children:"Domains that compete for the same queries. One per line."}),Ei?f.jsxs("div",{className:"compact-stack",children:[f.jsx("ul",{className:"detail-list",children:Fa.map(ee=>f.jsx("li",{children:ee},ee))}),f.jsxs("div",{className:"setup-nav",children:[f.jsx(Le,{type:"button",variant:"outline",onClick:Kn,children:"Back"}),f.jsx(Le,{type:"button",onClick:()=>w(4),children:"Continue"})]})]}):f.jsxs("div",{className:"compact-stack",children:[f.jsxs("div",{className:"setup-field",children:[f.jsx("label",{className:"setup-label",htmlFor:"competitors",children:"Competitor domains (one per line)"}),f.jsx("textarea",{id:"competitors",className:"setup-textarea",rows:4,placeholder:`competitor1.com
210
+ competitor2.com`,value:Tt,onChange:ee=>Fs(ee.target.value)})]}),Ws?f.jsx("p",{className:"text-rose-400 text-sm",children:Ws}):null,f.jsxs("div",{className:"setup-nav",children:[f.jsx(Le,{type:"button",variant:"outline",onClick:Kn,children:"Back"}),f.jsxs("div",{className:"flex gap-2",children:[f.jsx(Le,{type:"button",variant:"outline",onClick:()=>w(4),children:"Skip"}),f.jsx(Le,{type:"button",disabled:Fa.length===0||Di,onClick:Sn(Pn),children:Di?"Saving...":`Save ${Fa.length} competitor${Fa.length!==1?"s":""}`})]})]})]})]});case 4:{const ee=Bc.data,We=ee?.status==="completed"||ee?.status==="partial"||ee?.status==="failed"||ee?.status==="cancelled",ei=ee?.snapshots??[],vo=ei.filter(Cn=>Cn.citationState==="cited").length,So=ei.filter(Cn=>Cn.answerMentioned===!0).length,nr=new Set(ei.map(Cn=>Cn.query).filter(Cn=>!!Cn)).size,ar=mo?We&&(ee?.status==="completed"||ee?.status==="partial")?f.jsx(Mn,{tone:"positive",children:"Complete"}):We?f.jsx(Mn,{tone:"negative",children:"Failed"}):f.jsx(Mn,{tone:"caution",children:"Running"}):null;return f.jsxs(xn,{className:"surface-card step-card",children:[f.jsxs("div",{className:"section-head",children:[f.jsxs("div",{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 5 of 5"}),f.jsx("h2",{children:"Launch first run"})]}),ar]}),mo?We?ee?.status==="failed"?f.jsxs("div",{className:"compact-stack",children:[f.jsx("p",{className:"text-rose-400",children:"Sweep failed. Inspect the run on the project page for the provider error and retry from there."}),f.jsxs("div",{className:"setup-nav",children:[f.jsx("span",{}),f.jsx(Le,{type:"button",onClick:()=>{v({to:te?`/projects/${te}`:"/"})},children:"Open project"})]})]}):f.jsxs("div",{className:"compact-stack",children:[f.jsxs("p",{className:"text-zinc-300",children:["Sweep complete. Your first answer-visibility snapshot for"," ",f.jsx("span",{className:"text-zinc-100 font-medium",children:oe}),":"]}),f.jsxs("div",{className:"grid grid-cols-3 gap-2 mt-1",children:[f.jsxs("div",{className:"rounded-md border border-zinc-800/60 bg-zinc-900/30 p-3",children:[f.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500",children:"Mentioned"}),f.jsxs("p",{className:"text-2xl font-bold tabular-nums text-zinc-50 mt-1",children:[So,f.jsxs("span",{className:"text-zinc-600 text-lg",children:[" / ",nr]})]}),f.jsx("p",{className:"text-[11px] text-zinc-500 mt-0.5",children:"queries with brand in answer"})]}),f.jsxs("div",{className:"rounded-md border border-zinc-800/60 bg-zinc-900/30 p-3",children:[f.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500",children:"Cited"}),f.jsxs("p",{className:"text-2xl font-bold tabular-nums text-zinc-50 mt-1",children:[vo,f.jsxs("span",{className:"text-zinc-600 text-lg",children:[" / ",nr]})]}),f.jsx("p",{className:"text-[11px] text-zinc-500 mt-0.5",children:"queries with domain in sources"})]}),f.jsxs("div",{className:"rounded-md border border-zinc-800/60 bg-zinc-900/30 p-3",children:[f.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500",children:"Snapshots"}),f.jsx("p",{className:"text-2xl font-bold tabular-nums text-zinc-50 mt-1",children:ei.length}),f.jsx("p",{className:"text-[11px] text-zinc-500 mt-0.5",children:"total (query × provider)"})]})]}),f.jsx("p",{className:"text-[11px] text-zinc-500 mt-1",children:"Full evidence, per-provider breakdown, and suggested next queries on the project dashboard."}),f.jsxs("div",{className:"setup-nav",children:[f.jsx("span",{}),f.jsx(Le,{type:"button",onClick:()=>{v({to:te?`/projects/${te}`:"/"})},children:"Open project dashboard →"})]})]}):f.jsxs("div",{className:"compact-stack",children:[f.jsx("p",{className:"text-zinc-300",children:"Sweep running — typically 30-60s. Polling every 2s…"}),f.jsx("div",{className:"rounded-md border border-zinc-800/60 bg-zinc-900/30 p-3 text-xs text-zinc-500",children:f.jsxs("p",{children:["Status: ",f.jsx("span",{className:"text-zinc-300",children:ee?.status??"queued"})]})}),f.jsxs("div",{className:"setup-nav",children:[f.jsx("span",{}),f.jsx(Le,{type:"button",variant:"outline",onClick:()=>{v({to:te?`/projects/${te}`:"/"})},children:"Watch on project page"})]})]}):f.jsxs("div",{className:"compact-stack",children:[f.jsxs("p",{className:"supporting-copy",children:["Everything is configured. Launch an answer-visibility sweep to start tracking citations for ",f.jsx("span",{className:"text-zinc-100 font-medium",children:oe}),"."]}),f.jsxs("div",{className:"setup-nav",children:[f.jsx(Le,{type:"button",variant:"outline",onClick:Kn,children:"Back"}),f.jsx(Le,{type:"button",disabled:Lt,onClick:Sn(Wa),children:Lt?"Launching...":"Launch visibility sweep"})]})]})]})}default:return null}})();return f.jsxs("div",{className:"page-container",children:[f.jsx("div",{className:"page-header",children:f.jsxs("div",{className:"page-header-left",children:[f.jsx("h1",{className:"page-title",children:"Setup"}),f.jsx("p",{className:"page-subtitle",children:"Create a project, add queries, add competitors, and launch the first run."})]})}),f.jsx(C5,{current:S,labels:z5}),f.jsx("section",{className:"setup-wizard",children:bo})]})}function E5(){return f.jsx("div",{className:"page-container",children:f.jsx("section",{className:"page-section",children:f.jsxs(xn,{className:"surface-card empty-card",children:[f.jsx("h1",{children:"Route not found"}),f.jsx("p",{children:"The current path does not map to a dashboard view."}),f.jsx(Le,{asChild:!0,children:f.jsx(rt,{to:"/",children:"Return to overview"})})]})})})}const Ti=Gs(()=>Is(()=>import("./ProjectPage-R2cxJb5Y.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8]),import.meta.url),"ProjectPage"),O5=Gs(()=>Is(()=>import("./RunsPage-CfvTJ9Ny.js"),__vite__mapDeps([9,1,2,7,5,8]),import.meta.url),"RunsPage"),D5=Gs(()=>Is(()=>import("./SettingsPage-HfMGIa5v.js"),__vite__mapDeps([10,1,7,5,8]),import.meta.url),"SettingsPage"),R5=Gs(()=>Is(()=>import("./BacklinksPage-DIZCcqsP.js"),__vite__mapDeps([11,1,6,7,5,8]),import.meta.url),"BacklinksPage"),M5=Gs(()=>Is(()=>import("./TrafficPage-DV_Dvpl3.js"),__vite__mapDeps([12,1,4,13,7,5,8]),import.meta.url),"TrafficPage"),B5=Gs(()=>Is(()=>import("./TrafficSourceDetailPage-lefreKBO.js"),__vite__mapDeps([14,1,3,4,5,13,7,8]),import.meta.url),"TrafficSourceDetailPage");function L5(){return f.jsx(lD,{children:f.jsx(oD,{})})}const Ft=rw()({component:L5,validateSearch:e=>({runId:typeof e.runId=="string"?e.runId:void 0,evidenceId:typeof e.evidenceId=="string"?e.evidenceId:void 0})}),q5=Bt({getParentRoute:()=>Ft,path:"/",component:dD,beforeLoad:({context:e})=>{const n=e.queryClient.getQueryData(Ks({client:ie}));if(n&&n.length===0)throw Qb({to:"/setup"})}}),$5=Bt({getParentRoute:()=>Ft,path:"/projects",component:j5}),Ja=Bt({getParentRoute:()=>Ft,path:"/projects/$projectId",component:()=>f.jsx(Kb,{})}),U5=Bt({getParentRoute:()=>Ja,path:"/",component:()=>f.jsx(Ti,{tab:"overview"})}),V5=Bt({getParentRoute:()=>Ja,path:"/search-console",component:()=>f.jsx(Ti,{tab:"search-console"})}),G5=Bt({getParentRoute:()=>Ja,path:"/discovery",component:()=>f.jsx(Ti,{tab:"discovery"})}),I5=Bt({getParentRoute:()=>Ja,path:"/report",component:()=>f.jsx(Ti,{tab:"report"})}),H5=Bt({getParentRoute:()=>Ja,path:"/activity",component:()=>f.jsx(Ti,{tab:"activity"})}),Z5=Bt({getParentRoute:()=>Ja,path:"/backlinks",component:()=>f.jsx(Ti,{tab:"backlinks"})}),P5=Bt({getParentRoute:()=>Ja,path:"/settings",component:()=>f.jsx(Ti,{tab:"settings"})}),K5=Bt({getParentRoute:()=>Ft,path:"/runs",component:O5}),Q5=Bt({getParentRoute:()=>Ft,path:"/settings",component:D5,beforeLoad:({context:e})=>{}}),Y5=Bt({getParentRoute:()=>Ft,path:"/setup",component:T5,beforeLoad:({context:e})=>{const n=e.queryClient.getQueryData(Ks({client:ie}));if(n&&n.length>0)throw Qb({to:"/"})}}),X5=Bt({getParentRoute:()=>Ft,path:"/backlinks",component:R5}),J5=Bt({getParentRoute:()=>Ft,path:"/traffic",component:M5}),F5=Bt({getParentRoute:()=>Ft,path:"/traffic/$projectName/$sourceId",component:B5}),W5=Bt({getParentRoute:()=>Ft,path:"*",component:E5}),eR=Ft.addChildren([q5,$5,Ja.addChildren([U5,V5,G5,I5,H5,Z5,P5]),K5,Q5,Y5,X5,J5,F5,W5]);function tR(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath:"/"}const Zb=tR(),nR=Zb==="/"?"":Zb.replace(/\/$/,"");function aR(e,n){return ow({routeTree:eR,basepath:nR||"/",context:{queryClient:e},...n?.initialEntries})}const iR=6e4;function sR(){const[e,n]=U.useState(Jd()?"ready":"checking"),[i,r]=U.useState(""),[l,c]=U.useState(""),[d,m]=U.useState(null),[g,b]=U.useState(!1),[v,S]=U.useState(!1),w=U.useRef(null),_=U.useRef(null),C=()=>{if(!w.current){const L=ck();_.current=L,w.current=aR(L)}return{queryClient:_.current,router:w.current}};U.useEffect(()=>{if(Jd())return;let L=!1;return Ty().then(Z=>{L||(Z.authenticated?n("ready"):n(Z.setupRequired?"setup":"login"))}).catch(Z=>{L||(m(Z instanceof Error?Z.message:"Failed to reach the Canonry API"),n("login"))}),()=>{L=!0}},[]),U.useEffect(()=>{if(e!=="ready"||Jd())return;const L=setInterval(()=>{Ty().then(Z=>{Z.authenticated||(S(!0),n(Z.setupRequired?"setup":"login"))}).catch(()=>{})},iR);return Cy(()=>{S(!0),n("login")}),()=>{clearInterval(L),Cy(null)}},[e]);const N=async L=>{if(L.preventDefault(),!i.trim()||i.trim().length<8){m("Password must be at least 8 characters");return}if(i!==l){m("Passwords do not match");return}b(!0),m(null);try{if(!(await UN(i.trim())).authenticated){m("Setup failed");return}r(""),c(""),S(!1),n("ready")}catch(Z){m(Z instanceof In||Z instanceof Error?Z.message:"Setup failed")}finally{b(!1)}},T=async L=>{if(L.preventDefault(),!!i.trim()){b(!0),m(null);try{if(!(await VN(i.trim())).authenticated){m("Incorrect password");return}r(""),S(!1),n("ready")}catch(Z){m(Z instanceof In||Z instanceof Error?Z.message:"Authentication failed")}finally{b(!1)}}};if(e==="ready"){const{queryClient:L,router:Z}=C();return f.jsx(lw,{client:L,children:f.jsx(cw,{router:Z})})}return f.jsx("div",{className:"min-h-screen bg-zinc-950 px-4 py-8",children:f.jsx("div",{className:"mx-auto flex min-h-[calc(100vh-4rem)] max-w-md items-center justify-center",children:f.jsx(xn,{className:"surface-card w-full",children:e==="checking"?f.jsx(Pl,{className:"py-8",children:f.jsx("p",{className:"supporting-copy text-center",children:"Connecting to Canonry…"})}):e==="setup"?f.jsxs(f.Fragment,{children:[f.jsxs(jf,{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"First-time setup"}),f.jsx(Nf,{children:"Create a dashboard password"}),f.jsx(kf,{children:"Choose a password to protect the Canonry dashboard. You will use this to sign in on future visits."})]}),f.jsx(Pl,{children:f.jsxs("form",{className:"space-y-4",onSubmit:Sn(N),children:[f.jsxs("label",{className:"block space-y-1.5",children:[f.jsx("span",{className:"text-xs font-medium text-zinc-400",children:"Password"}),f.jsx("input",{autoFocus:!0,className:"w-full rounded-md border border-zinc-800 bg-zinc-950 px-3 py-2 text-sm text-zinc-100 outline-none transition focus:border-zinc-600",type:"password",value:i,onChange:L=>r(L.target.value),placeholder:"At least 8 characters"})]}),f.jsxs("label",{className:"block space-y-1.5",children:[f.jsx("span",{className:"text-xs font-medium text-zinc-400",children:"Confirm password"}),f.jsx("input",{className:"w-full rounded-md border border-zinc-800 bg-zinc-950 px-3 py-2 text-sm text-zinc-100 outline-none transition focus:border-zinc-600",type:"password",value:l,onChange:L=>c(L.target.value),placeholder:"Re-enter password"})]}),d?f.jsx("p",{className:"text-sm text-rose-400",children:d}):null,f.jsx(Le,{type:"submit",disabled:g||!i.trim()||!l.trim(),children:g?"Setting up…":"Create password & open dashboard"})]})})]}):f.jsxs(f.Fragment,{children:[f.jsxs(jf,{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"Dashboard access"}),f.jsx(Nf,{children:"Sign in to Canonry"}),f.jsx(kf,{children:"Enter your dashboard password to continue."})]}),f.jsxs(Pl,{children:[v?f.jsx("p",{className:"mb-4 rounded-md border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-sm text-amber-300",children:"Your session expired — please sign in again."}):null,f.jsxs("form",{className:"space-y-4",onSubmit:Sn(T),children:[f.jsxs("label",{className:"block space-y-1.5",children:[f.jsx("span",{className:"text-xs font-medium text-zinc-400",children:"Password"}),f.jsx("input",{autoFocus:!0,className:"w-full rounded-md border border-zinc-800 bg-zinc-950 px-3 py-2 text-sm text-zinc-100 outline-none transition focus:border-zinc-600",type:"password",value:i,onChange:L=>r(L.target.value),placeholder:"Dashboard password"})]}),d?f.jsx("p",{className:"text-sm text-rose-400",children:d}):null,f.jsx(Le,{type:"submit",disabled:g||!i.trim(),children:g?"Signing in…":"Open dashboard"})]})]})]})})})})}const U1=document.getElementById("root");if(!U1)throw new Error("Expected #root element for web app bootstrap.");gw.createRoot(U1).render(f.jsx(U.StrictMode,{children:f.jsx(sR,{})}));export{cM as $,vR as A,Le as B,nc as C,CM as D,EM as E,OM as F,pM as G,CR as H,ql as I,zR as J,ER as K,cn as L,qR as M,MM as N,BM as O,V4 as P,OR as Q,DM as R,nO as S,Mn as T,RM as U,TM as V,TR as W,DR as X,LM as Y,nM as Z,lM as _,a6 as a,GR as a$,In as a0,uM as a1,uR as a2,Uk as a3,jM as a4,qk as a5,Qk as a6,Te as a7,KO as a8,Xl as a9,wR as aA,jR as aB,AM as aC,NR as aD,kR as aE,_R as aF,AR as aG,Sc as aH,s6 as aI,_5 as aJ,It as aK,DN as aL,yR as aM,dR as aN,fR as aO,bR as aP,BN as aQ,ON as aR,qN as aS,pR as aT,u6 as aU,rO as aV,qM as aW,UM as aX,PN as aY,VM as aZ,IR as a_,dM as aa,lk as ab,YM as ac,e6 as ad,t6 as ae,n6 as af,RR as ag,Ks as ah,MR as ai,rp as aj,QM as ak,PR as al,d6 as am,yM as an,hM as ao,bM as ap,vM as aq,mM as ar,gM as as,gR as at,hR as au,mR as av,xR as aw,zM as ax,ub as ay,_M as az,$f as b,GM as b0,$M as b1,wM as b2,$R as b3,UR as b4,VR as b5,HR as b6,r6 as b7,cp as b8,GN as b9,S0 as bA,Hs as bB,XM as bC,WM as bD,WR as bE,JM as bF,JR as bG,FR as bH,XR as bI,SR as ba,BR as bb,LR as bc,vc as bd,dp as be,ZR as bf,$s as bg,db as bh,eM as bi,aM as bj,sM as bk,rM as bl,gv as bm,tM as bn,iM as bo,oM as bp,G4 as bq,P0 as br,K4 as bs,K0 as bt,Q0 as bu,Rk as bv,sp as bw,My as bx,FM as by,SM as bz,at as c,QC as d,i6 as e,NM as f,xn as g,jb as h,Sn as i,fM as j,IM as k,ie as l,HM as m,ZM as n,KM as o,PM as p,KR as q,YR as r,QR as s,w0 as t,fp as u,o6 as v,l6 as w,c6 as x,xM as y,kM as z};