@ainyc/canonry 4.51.2 → 4.51.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -0
- package/assets/assets/{BacklinksPage-BtURdL_I.js → BacklinksPage-9TlM08Wf.js} +1 -1
- package/assets/assets/ProjectPage-CD591qDz.js +6 -0
- package/assets/assets/{RunRow-NfzAq5p2.js → RunRow-D7qdWWRl.js} +1 -1
- package/assets/assets/{RunsPage-CPPFYq6U.js → RunsPage-CvewepfU.js} +1 -1
- package/assets/assets/{SettingsPage-CuB6YrAV.js → SettingsPage-C7BvAhiB.js} +1 -1
- package/assets/assets/{TrafficPage-Dn0XTJoC.js → TrafficPage-DC3NhFOh.js} +1 -1
- package/assets/assets/{TrafficSourceDetailPage-CTG7aAlv.js → TrafficSourceDetailPage-BvtTA6rs.js} +1 -1
- package/assets/assets/{arrow-left-VZ7oOCHS.js → arrow-left-Agb02DMK.js} +1 -1
- package/assets/assets/index-DTCZ93Ne.js +210 -0
- package/assets/assets/{server-traffic-Bym-drXr.js → server-traffic-C-0Ndjpw.js} +1 -1
- package/assets/assets/{trash-2-BNsIoa7t.js → trash-2-lkrXVRRm.js} +1 -1
- package/assets/index.html +1 -1
- package/dist/cli.js +39 -14
- package/package.json +8 -8
- package/assets/assets/ProjectPage-_etyTtZ9.js +0 -6
- package/assets/assets/index-VMFHNbas.js +0 -210
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ProjectPage-CD591qDz.js","./vendor-tanstack-Dq7p98wZ.js","./RunRow-D7qdWWRl.js","./ChartPrimitives-9Kx3gzQL.js","./server-traffic-C-0Ndjpw.js","./vendor-recharts-DWvKDyBF.js","./trash-2-lkrXVRRm.js","./vendor-radix-B57xfQbP.js","./vendor-markdown-DK7fbRNb.js","./RunsPage-CvewepfU.js","./SettingsPage-C7BvAhiB.js","./BacklinksPage-9TlM08Wf.js","./TrafficPage-DC3NhFOh.js","./arrow-left-Agb02DMK.js","./TrafficSourceDetailPage-BvtTA6rs.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{c as nw,d as aw,Q as iw,M as sw,r as U,q as $e,j as f,L as rt,a as rw,e as ks,u as cn,f as ow,h as dc,k as lw,l as cw,m as Qb,O as Yb,n as Ka,o as Ai,p as uw,s as Bt,t as Xb,v as Gs,x as dw,y as fw,z as pw}from"./vendor-tanstack-Dq7p98wZ.js";import{S as mw,O as Df,P as Jb,C as Rf,a as Fb,T as Mf,D as Wb,R as ev}from"./vendor-radix-B57xfQbP.js";import{c as tv}from"./vendor-recharts-DWvKDyBF.js";import{M as hw}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 Qd={exports:{}},Kr={},Yd={exports:{}},Xd={};var ky;function gw(){return ky||(ky=1,(function(e){function n($,F){var de=$.length;$.push(F);e:for(;0<de;){var je=de-1>>>1,ie=$[je];if(0<l(ie,F))$[je]=F,$[de]=ie,de=je;else break e}}function i($){return $.length===0?null:$[0]}function r($){if($.length===0)return null;var F=$[0],de=$.pop();if(de!==F){$[0]=de;e:for(var je=0,ie=$.length,Qe=ie>>>1;je<Qe;){var Q=2*(je+1)-1,le=$[Q],te=Q+1,ue=$[te];if(0>l(le,de))te<ie&&0>l(ue,le)?($[je]=ue,$[te]=de,je=te):($[je]=le,$[Q]=de,je=Q);else if(te<ie&&0>l(ue,de))$[je]=ue,$[te]=de,je=te;else break e}}return F}function l($,F){var de=$.sortIndex-F.sortIndex;return de!==0?de:$.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,R=typeof setTimeout=="function"?setTimeout:null,G=typeof clearTimeout=="function"?clearTimeout:null,H=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,J||(J=!0,ve());else{var F=i(b);F!==null&&pe(X,F.startTime-$)}}var J=!1,D=-1,M=5,oe=-1;function Ne(){return T?!0:!(e.unstable_now()-oe<M)}function Ae(){if(T=!1,J){var $=e.unstable_now();oe=$;var F=!0;try{e:{C=!1,N&&(N=!1,G(D),D=-1),_=!0;var de=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 ie=je(S.expirationTime<=$);if($=e.unstable_now(),typeof ie=="function"){S.callback=ie,K($),F=!0;break t}S===i(g)&&r(g),K($)}else r(g);S=i(g)}if(S!==null)F=!0;else{var Qe=i(b);Qe!==null&&pe(X,Qe.startTime-$),F=!1}}break e}finally{S=null,w=de,_=!1}F=void 0}}finally{F?ve():J=!1}}}var ve;if(typeof H=="function")ve=function(){H(Ae)};else if(typeof MessageChannel<"u"){var et=new MessageChannel,re=et.port2;et.port1.onmessage=Ae,ve=function(){re.postMessage(null)}}else ve=function(){R(Ae,0)};function pe($,F){D=R(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"):M=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 de=w;w=F;try{return $()}finally{w=de}},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 de=w;w=$;try{return F()}finally{w=de}},e.unstable_scheduleCallback=function($,F,de){var je=e.unstable_now();switch(typeof de=="object"&&de!==null?(de=de.delay,de=typeof de=="number"&&0<de?je+de:je):de=je,$){case 1:var ie=-1;break;case 2:ie=250;break;case 5:ie=1073741823;break;case 4:ie=1e4;break;default:ie=5e3}return ie=de+ie,$={id:v++,callback:F,priorityLevel:$,startTime:de,expirationTime:ie,sortIndex:-1},de>je?($.sortIndex=de,n(b,$),i(g)===null&&$===i(b)&&(N?(G(D),D=-1):N=!0,pe(X,de-je))):($.sortIndex=ie,n(g,$),C||_||(C=!0,J||(J=!0,ve()))),$},e.unstable_shouldYield=Ne,e.unstable_wrapCallback=function($){var F=w;return function(){var de=w;w=F;try{return $.apply(this,arguments)}finally{w=de}}}})(Xd)),Xd}var Ay;function yw(){return Ay||(Ay=1,Yd.exports=gw()),Yd.exports}var _y;function bw(){if(_y)return Kr;_y=1;var e=yw(),n=nw(),i=aw();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"),R=Symbol.for("react.profiler"),G=Symbol.for("react.consumer"),H=Symbol.for("react.context"),K=Symbol.for("react.forward_ref"),X=Symbol.for("react.suspense"),J=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),M=Symbol.for("react.lazy"),oe=Symbol.for("react.activity"),Ne=Symbol.for("react.memo_cache_sentinel"),Ae=Symbol.iterator;function ve(t){return t===null||typeof t!="object"?null:(t=Ae&&t[Ae]||t["@@iterator"],typeof t=="function"?t:null)}var et=Symbol.for("react.client.reference");function re(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===et?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case N:return"Fragment";case R:return"Profiler";case T:return"StrictMode";case X:return"Suspense";case J:return"SuspenseList";case oe:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case C:return"Portal";case H:return t.displayName||"Context";case G: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:re(t.type)||"Memo";case M:a=t._payload,t=t._init;try{return re(t(a))}catch{}}return null}var pe=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,de={pending:!1,data:null,method:null,action:null},je=[],ie=-1;function Qe(t){return{current:t}}function Q(t){0>ie||(t.current=je[ie],je[ie]=null,ie--)}function le(t,a){ie++,je[ie]=t.current,t.current=a}var te=Qe(null),ue=Qe(null),ne=Qe(null),_e=Qe(null);function tt(t,a){switch(le(ne,a),le(ue,t),le(te,null),a.nodeType){case 9:case 11:t=(t=a.documentElement)&&(t=t.namespaceURI)?Qg(t):0;break;default:if(t=a.tagName,a=a.namespaceURI)a=Qg(a),t=Yg(a,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}Q(te),le(te,t)}function xe(){Q(te),Q(ue),Q(ne)}function Ue(t){t.memoizedState!==null&&le(_e,t);var a=te.current,s=Yg(a,t.type);a!==s&&(le(ue,t),le(te,s))}function Ze(t){ue.current===t&&(Q(te),Q(ue)),_e.current===t&&(Q(_e),Ir._currentValue=de)}var Ct,zn;function Tt(t){if(Ct===void 0)try{throw Error()}catch(s){var a=s.stack.trim().match(/\n( *(at )?)/);Ct=a&&a[1]||"",zn=-1<s.stack.indexOf(`
|
|
3
|
+
at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
4
|
+
`+Ct+t+zn}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
|
+
`),L=x.split(`
|
|
6
|
+
`);for(u=o=0;o<A.length&&!A[o].includes("DetermineComponentFrameRoot");)o++;for(;u<L.length&&!L[u].includes("DetermineComponentFrameRoot");)u++;if(o===A.length||u===L.length)for(o=A.length-1,u=L.length-1;1<=o&&0<=u&&A[o]!==L[u];)u--;for(;1<=o&&0<=u;o--,u--)if(A[o]!==L[u]){if(o!==1||u!==1)do if(o--,u--,0>u||A[o]!==L[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 Mc(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+=Mc(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,go=e.unstable_shouldYield,Bc=e.unstable_requestPaint,Lt=e.unstable_now,yo=e.unstable_getCurrentPriorityLevel,er=e.unstable_ImmediatePriority,bo=e.unstable_UserBlockingPriority,Mi=e.unstable_NormalPriority,Lc=e.unstable_LowPriority,Bi=e.unstable_IdlePriority,vo=e.log,tr=e.unstable_setDisableYieldValue,ga=null,qt=null;function Cn(t){if(typeof vo=="function"&&tr(t),qt&&typeof qt.setStrictMode=="function")try{qt.setStrictMode(ga,t)}catch{}}var mt=Math.clz32?Math.clz32:qc,qn=Math.log,Fa=Math.LN2;function qc(t){return t>>>=0,t===0?32:31-(qn(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 So(){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 Fe(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,L=t.hiddenUpdates;for(s=y&~s;0<s;){var I=31-mt(s),Y=1<<I;x[I]=0,A[I]=-1;var q=L[I];if(q!==null)for(L[I]=null,I=0;I<q.length;I++){var V=q[I];V!==null&&(V.lane&=-536870913)}s&=~Y}o!==0&&xo(t,o,0),p!==0&&u===0&&t.tag!==0&&(t.suspendedLanes|=p&~(y&~a))}function xo(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 wo(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 Tn(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function Dp(){var t=F.p;return t!==0?t:(t=window.event,t===void 0?32:by(t.type))}function Rp(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,$c="__reactEvents$"+ya,Z1="__reactListeners$"+ya,P1="__reactHandles$"+ya,Mp="__reactResources$"+ya,ir="__reactMarker$"+ya;function Uc(t){delete t[Et],delete t[Zt],delete t[$c],delete t[Z1],delete t[P1]}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=ny(t);t!==null;){if(s=t[Et])return s;t=ny(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[Mp];return a||(a=t[Mp]={hoistableStyles:new Map,hoistableScripts:new Map}),a}function _t(t){t[ir]=!0}var Bp=new Set,Lp={};function ti(t,a){Zi(t,a),Zi(t+"Capture",a)}function Zi(t,a){for(Lp[t]=a,t=0;t<a.length;t++)Bp.add(a[t])}var K1=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]*$"),qp={},$p={};function Q1(t){return Oi.call($p,t)?!0:Oi.call(qp,t)?!1:K1.test(t)?$p[t]=!0:(qp[t]=!0,!1)}function jo(t,a,s){if(Q1(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 No(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 dn(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Up(t){var a=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function Y1(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 Vc(t){if(!t._valueTracker){var a=Up(t)?"checked":"value";t._valueTracker=Y1(t,a,""+t[a])}}function Vp(t){if(!t)return!1;var a=t._valueTracker;if(!a)return!0;var s=a.getValue(),o="";return t&&(o=Up(t)?t.checked?"true":"false":t.value),t=o,t!==s?(a.setValue(t),!0):!1}function ko(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 X1=/[\n"\\]/g;function fn(t){return t.replace(X1,function(a){return"\\"+a.charCodeAt(0).toString(16)+" "})}function Gc(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=""+dn(a)):t.value!==""+dn(a)&&(t.value=""+dn(a)):y!=="submit"&&y!=="reset"||t.removeAttribute("value"),a!=null?Ic(t,y,dn(a)):s!=null?Ic(t,y,dn(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=""+dn(x):t.removeAttribute("name")}function Gp(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)){Vc(t);return}s=s!=null?""+dn(s):"",a=a!=null?""+dn(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),Vc(t)}function Ic(t,a,s){a==="number"&&ko(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=""+dn(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 Ip(t,a,s){if(a!=null&&(a=""+dn(a),a!==t.value&&(t.value=a),s==null)){t.defaultValue!==a&&(t.defaultValue=a);return}t.defaultValue=s!=null?""+dn(s):""}function Hp(t,a,s,o){if(a==null){if(o!=null){if(s!=null)throw Error(r(92));if(pe(o)){if(1<o.length)throw Error(r(93));o=o[0]}s=o}s==null&&(s=""),a=s}s=dn(a),t.defaultValue=s,o=t.textContent,o===s&&o!==""&&o!==null&&(t.value=o),Vc(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 J1=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 Zp(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||J1.has(a)?a==="float"?t.cssFloat=s:t[a]=(""+s).trim():t[a]=s+"px"}function Pp(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&&Zp(t,u,o)}else for(var p in a)a.hasOwnProperty(p)&&Zp(t,p,a[p])}function Hc(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 F1=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"]]),W1=/^[\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 Ao(t){return W1.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function Yn(){}var Zc=null;function Pc(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 Kp(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(Gc(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="'+fn(""+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));Gc(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&&Vp(o)}break e;case"textarea":Ip(t,s.value,s.defaultValue);break e;case"select":a=s.value,a!=null&&Pi(t,!!s.multiple,a,!1)}}}var Kc=!1;function Qp(t,a,s){if(Kc)return t(a,s);Kc=!0;try{var o=t(a);return o}finally{if(Kc=!1,(Qi!==null||Yi!==null)&&(pl(),Qi&&(a=Qi,t=Yi,Yi=Qi=null,Kp(a),t)))for(a=0;a<t.length;a++)Kp(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"),Qc=!1;if(Xn)try{var or={};Object.defineProperty(or,"passive",{get:function(){Qc=!0}}),window.addEventListener("test",or,or),window.removeEventListener("test",or,or)}catch{Qc=!1}var ba=null,Yc=null,_o=null;function Yp(){if(_o)return _o;var t,a=Yc,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 _o=u.slice(t,1<o?1-o:void 0)}function zo(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 Co(){return!0}function Xp(){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)?Co:Xp,this.isPropagationStopped=Xp,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=Co)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=Co)},persist:function(){},isPersistent:Co}),a}var ni={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},To=Pt(ni),lr=S({},ni,{view:0,detail:0}),eS=Pt(lr),Xc,Jc,cr,Eo=S({},lr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Wc,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"?(Xc=t.screenX-cr.screenX,Jc=t.screenY-cr.screenY):Jc=Xc=0,cr=t),Xc)},movementY:function(t){return"movementY"in t?t.movementY:Jc}}),Jp=Pt(Eo),tS=S({},Eo,{dataTransfer:0}),nS=Pt(tS),aS=S({},lr,{relatedTarget:0}),Fc=Pt(aS),iS=S({},ni,{animationName:0,elapsedTime:0,pseudoElement:0}),sS=Pt(iS),rS=S({},ni,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),oS=Pt(rS),lS=S({},ni,{data:0}),Fp=Pt(lS),cS={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},uS={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"},dS={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function fS(t){var a=this.nativeEvent;return a.getModifierState?a.getModifierState(t):(t=dS[t])?!!a[t]:!1}function Wc(){return fS}var pS=S({},lr,{key:function(t){if(t.key){var a=cS[t.key]||t.key;if(a!=="Unidentified")return a}return t.type==="keypress"?(t=zo(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?uS[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Wc,charCode:function(t){return t.type==="keypress"?zo(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?zo(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),mS=Pt(pS),hS=S({},Eo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Wp=Pt(hS),gS=S({},lr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Wc}),yS=Pt(gS),bS=S({},ni,{propertyName:0,elapsedTime:0,pseudoElement:0}),vS=Pt(bS),SS=S({},Eo,{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}),xS=Pt(SS),wS=S({},ni,{newState:0,oldState:0}),jS=Pt(wS),NS=[9,13,27,32],eu=Xn&&"CompositionEvent"in window,ur=null;Xn&&"documentMode"in document&&(ur=document.documentMode);var kS=Xn&&"TextEvent"in window&&!ur,em=Xn&&(!eu||ur&&8<ur&&11>=ur),tm=" ",nm=!1;function am(t,a){switch(t){case"keyup":return NS.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function im(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Xi=!1;function AS(t,a){switch(t){case"compositionend":return im(a);case"keypress":return a.which!==32?null:(nm=!0,tm);case"textInput":return t=a.data,t===tm&&nm?null:t;default:return null}}function _S(t,a){if(Xi)return t==="compositionend"||!eu&&am(t,a)?(t=Yp(),_o=Yc=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 em&&a.locale!=="ko"?null:a.data;default:return null}}var zS={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 sm(t){var a=t&&t.nodeName&&t.nodeName.toLowerCase();return a==="input"?!!zS[t.type]:a==="textarea"}function rm(t,a,s,o){Qi?Yi?Yi.push(o):Yi=[o]:Qi=o,a=Sl(a,"onChange"),0<a.length&&(s=new To("onChange","change",null,s,o),t.push({event:s,listeners:a}))}var dr=null,fr=null;function CS(t){Gg(t,0)}function Oo(t){var a=sr(t);if(Vp(a))return t}function om(t,a){if(t==="change")return a}var lm=!1;if(Xn){var tu;if(Xn){var nu="oninput"in document;if(!nu){var cm=document.createElement("div");cm.setAttribute("oninput","return;"),nu=typeof cm.oninput=="function"}tu=nu}else tu=!1;lm=tu&&(!document.documentMode||9<document.documentMode)}function um(){dr&&(dr.detachEvent("onpropertychange",dm),fr=dr=null)}function dm(t){if(t.propertyName==="value"&&Oo(fr)){var a=[];rm(a,fr,t,Pc(t)),Qp(CS,a)}}function TS(t,a,s){t==="focusin"?(um(),dr=a,fr=s,dr.attachEvent("onpropertychange",dm)):t==="focusout"&&um()}function ES(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Oo(fr)}function OS(t,a){if(t==="click")return Oo(a)}function DS(t,a){if(t==="input"||t==="change")return Oo(a)}function RS(t,a){return t===a&&(t!==0||1/t===1/a)||t!==t&&a!==a}var tn=typeof Object.is=="function"?Object.is:RS;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 fm(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function pm(t,a){var s=fm(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=fm(s)}}function mm(t,a){return t&&a?t===a?!0:t&&t.nodeType===3?!1:a&&a.nodeType===3?mm(t,a.parentNode):"contains"in t?t.contains(a):t.compareDocumentPosition?!!(t.compareDocumentPosition(a)&16):!1:!1}function hm(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var a=ko(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=ko(t.document)}return a}function au(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 MS=Xn&&"documentMode"in document&&11>=document.documentMode,Ji=null,iu=null,mr=null,su=!1;function gm(t,a,s){var o=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;su||Ji==null||Ji!==ko(o)||(o=Ji,"selectionStart"in o&&au(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=Sl(iu,"onSelect"),0<o.length&&(a=new To("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")},ru={},ym={};Xn&&(ym=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(ru[t])return ru[t];if(!Fi[t])return t;var a=Fi[t],s;for(s in a)if(a.hasOwnProperty(s)&&s in ym)return ru[t]=a[s];return t}var bm=ii("animationend"),vm=ii("animationiteration"),Sm=ii("animationstart"),BS=ii("transitionrun"),LS=ii("transitionstart"),qS=ii("transitioncancel"),xm=ii("transitionend"),wm=new Map,ou="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(" ");ou.push("scrollEnd");function En(t,a){wm.set(t,a),ti(a,[t])}var Do=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)},pn=[],Wi=0,lu=0;function Ro(){for(var t=Wi,a=lu=Wi=0;a<t;){var s=pn[a];pn[a++]=null;var o=pn[a];pn[a++]=null;var u=pn[a];pn[a++]=null;var p=pn[a];if(pn[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&&jm(s,u,p)}}function Mo(t,a,s,o){pn[Wi++]=t,pn[Wi++]=a,pn[Wi++]=s,pn[Wi++]=o,lu|=o,t.lanes|=o,t=t.alternate,t!==null&&(t.lanes|=o)}function cu(t,a,s,o){return Mo(t,a,s,o),Bo(t)}function si(t,a){return Mo(t,null,null,a),Bo(t)}function jm(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 Bo(t){if(50<Br)throw Br=0,bd=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 $S(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 $S(t,a,s,o)}function uu(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 Nm(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 Lo(t,a,s,o,u,p){var y=0;if(o=t,typeof t=="function")uu(t)&&(y=1);else if(typeof t=="string")y=Hx(t,s,te.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 R:return t=nn(12,s,a,u|2),t.elementType=R,t.lanes=p,t;case X:return t=nn(13,s,a,u),t.elementType=X,t.lanes=p,t;case J:return t=nn(19,s,a,u),t.elementType=J,t.lanes=p,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case H:y=10;break e;case G:y=9;break e;case K:y=11;break e;case D:y=14;break e;case M: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 du(t,a,s){return t=nn(6,t,null,a),t.lanes=s,t}function km(t){var a=nn(18,null,null,0);return a.stateNode=t,a}function fu(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 Am=new WeakMap;function mn(t,a){if(typeof t=="object"&&t!==null){var s=Am.get(t);return s!==void 0?s:(a={value:t,source:a,stack:Ws(a)},Am.set(t,a),a)}return{value:t,source:a,stack:Ws(a)}}var ts=[],ns=0,qo=null,hr=0,hn=[],gn=0,va=null,$n=1,Un="";function Fn(t,a){ts[ns++]=hr,ts[ns++]=qo,qo=t,hr=a}function _m(t,a,s){hn[gn++]=$n,hn[gn++]=Un,hn[gn++]=va,va=t;var o=$n;t=Un;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,$n=1<<32-mt(a)+u|s<<u|o,Un=p+t}else $n=1<<p|s<<u|o,Un=t}function pu(t){t.return!==null&&(Fn(t,1),_m(t,1,0))}function mu(t){for(;t===qo;)qo=ts[--ns],ts[ns]=null,hr=ts[--ns],ts[ns]=null;for(;t===va;)va=hn[--gn],hn[gn]=null,Un=hn[--gn],hn[gn]=null,$n=hn[--gn],hn[gn]=null}function zm(t,a){hn[gn++]=$n,hn[gn++]=Un,hn[gn++]=va,$n=a.id,Un=a.overflow,va=t}var Ot=null,it=null,Be=!1,Sa=null,yn=!1,hu=Error(r(519));function xa(t){var a=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw gr(mn(a,t)),hu}function Cm(t){var a=t.stateNode,s=t.type,o=t.memoizedProps;switch(a[Et]=t,a[Zt]=o,s){case"dialog":De("cancel",a),De("close",a);break;case"iframe":case"object":case"embed":De("load",a);break;case"video":case"audio":for(s=0;s<qr.length;s++)De(qr[s],a);break;case"source":De("error",a);break;case"img":case"image":case"link":De("error",a),De("load",a);break;case"details":De("toggle",a);break;case"input":De("invalid",a),Gp(a,o.value,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name,!0);break;case"select":De("invalid",a);break;case"textarea":De("invalid",a),Hp(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||Pg(a.textContent,s)?(o.popover!=null&&(De("beforetoggle",a),De("toggle",a)),o.onScroll!=null&&De("scroll",a),o.onScrollEnd!=null&&De("scrollend",a),o.onClick!=null&&(a.onclick=Yn),a=!0):a=!1,a||xa(t,!0)}function Tm(t){for(Ot=t.return;Ot;)switch(Ot.tag){case 5:case 31:case 13:yn=!1;return;case 27:case 3:yn=!0;return;default:Ot=Ot.return}}function as(t){if(t!==Ot)return!1;if(!Be)return Tm(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")||Dd(t.type,t.memoizedProps)),s=!s),s&&it&&xa(t),Tm(t),a===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(317));it=ty(t)}else if(a===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(317));it=ty(t)}else a===27?(a=it,Ma(t.type)?(t=qd,qd=null,it=t):it=a):it=Ot?vn(t.stateNode.nextSibling):null;return!0}function oi(){it=Ot=null,Be=!1}function gu(){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 yu=Qe(null),li=null,Wn=null;function wa(t,a,s){le(yu,a._currentValue),a._currentValue=s}function ea(t){t._currentValue=yu.current,Q(yu)}function bu(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 vu(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),bu(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),bu(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===_e.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&&vu(a,t,s,o),a.flags|=262144}function $o(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 Em(li,t)}function Uo(t,a){return li===null&&ci(t),Em(t,a)}function Em(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 US=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()})}},VS=e.unstable_scheduleCallback,GS=e.unstable_NormalPriority,St={$$typeof:H,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Su(){return{controller:new US,data:new Map,refCount:0}}function yr(t){t.refCount--,t.refCount===0&&VS(GS,function(){t.controller.abort()})}var br=null,xu=0,ss=0,rs=null;function IS(t,a){if(br===null){var s=br=[];xu=0,ss=Nd(),rs={status:"pending",value:void 0,then:function(o){s.push(o)}}}return xu++,a.then(Om,Om),a}function Om(){if(--xu===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 HS(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 Dm=$.S;$.S=function(t,a){gg=Lt(),typeof a=="object"&&a!==null&&typeof a.then=="function"&&IS(t,a),Dm!==null&&Dm(t,a)};var ui=Qe(null);function wu(){var t=ui.current;return t!==null?t:We.pooledCache}function Vo(t,a){a===null?le(ui,ui.current):le(ui,a.pool)}function Rm(){var t=wu();return t===null?null:{parent:St._currentValue,pool:t}}var os=Error(r(460)),ju=Error(r(474)),Go=Error(r(542)),Io={then:function(){}};function Mm(t){return t=t.status,t==="fulfilled"||t==="rejected"}function Bm(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,qm(t),t;default:if(typeof a.status=="string")a.then(Yn,Yn);else{if(t=We,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,qm(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 Lm(){if(fi===null)throw Error(r(459));var t=fi;return fi=null,t}function qm(t){if(t===os||t===Go)throw Error(r(483))}var ls=null,vr=0;function Ho(t){var a=vr;return vr+=1,ls===null&&(ls=[]),Bm(ls,t,a)}function Sr(t,a){a=a.props.ref,t.ref=a!==void 0?a:null}function Zo(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 $m(t){function a(O,z){if(t){var B=O.deletions;B===null?(O.deletions=[z],O.flags|=16):B.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,B){return O.index=B,t?(B=O.alternate,B!==null?(B=B.index,B<z?(O.flags|=67108866,z):B):(O.flags|=67108866,z)):(O.flags|=1048576,z)}function y(O){return t&&O.alternate===null&&(O.flags|=67108866),O}function x(O,z,B,P){return z===null||z.tag!==6?(z=du(B,O.mode,P),z.return=O,z):(z=u(z,B),z.return=O,z)}function A(O,z,B,P){var Se=B.type;return Se===N?I(O,z,B.props.children,P,B.key):z!==null&&(z.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===M&&di(Se)===z.type)?(z=u(z,B.props),Sr(z,B),z.return=O,z):(z=Lo(B.type,B.key,B.props,null,O.mode,P),Sr(z,B),z.return=O,z)}function L(O,z,B,P){return z===null||z.tag!==4||z.stateNode.containerInfo!==B.containerInfo||z.stateNode.implementation!==B.implementation?(z=fu(B,O.mode,P),z.return=O,z):(z=u(z,B.children||[]),z.return=O,z)}function I(O,z,B,P,Se){return z===null||z.tag!==7?(z=ri(B,O.mode,P,Se),z.return=O,z):(z=u(z,B),z.return=O,z)}function Y(O,z,B){if(typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint")return z=du(""+z,O.mode,B),z.return=O,z;if(typeof z=="object"&&z!==null){switch(z.$$typeof){case _:return B=Lo(z.type,z.key,z.props,null,O.mode,B),Sr(B,z),B.return=O,B;case C:return z=fu(z,O.mode,B),z.return=O,z;case M:return z=di(z),Y(O,z,B)}if(pe(z)||ve(z))return z=ri(z,O.mode,B,null),z.return=O,z;if(typeof z.then=="function")return Y(O,Ho(z),B);if(z.$$typeof===H)return Y(O,Uo(O,z),B);Zo(O,z)}return null}function q(O,z,B,P){var Se=z!==null?z.key:null;if(typeof B=="string"&&B!==""||typeof B=="number"||typeof B=="bigint")return Se!==null?null:x(O,z,""+B,P);if(typeof B=="object"&&B!==null){switch(B.$$typeof){case _:return B.key===Se?A(O,z,B,P):null;case C:return B.key===Se?L(O,z,B,P):null;case M:return B=di(B),q(O,z,B,P)}if(pe(B)||ve(B))return Se!==null?null:I(O,z,B,P,null);if(typeof B.then=="function")return q(O,z,Ho(B),P);if(B.$$typeof===H)return q(O,z,Uo(O,B),P);Zo(O,B)}return null}function V(O,z,B,P,Se){if(typeof P=="string"&&P!==""||typeof P=="number"||typeof P=="bigint")return O=O.get(B)||null,x(z,O,""+P,Se);if(typeof P=="object"&&P!==null){switch(P.$$typeof){case _:return O=O.get(P.key===null?B:P.key)||null,A(z,O,P,Se);case C:return O=O.get(P.key===null?B:P.key)||null,L(z,O,P,Se);case M:return P=di(P),V(O,z,B,P,Se)}if(pe(P)||ve(P))return O=O.get(B)||null,I(z,O,P,Se,null);if(typeof P.then=="function")return V(O,z,B,Ho(P),Se);if(P.$$typeof===H)return V(O,z,B,Uo(z,P),Se);Zo(z,P)}return null}function fe(O,z,B,P){for(var Se=null,Ve=null,ge=z,Ce=z=0,Me=null;ge!==null&&Ce<B.length;Ce++){ge.index>Ce?(Me=ge,ge=null):Me=ge.sibling;var Ge=q(O,ge,B[Ce],P);if(Ge===null){ge===null&&(ge=Me);break}t&&ge&&Ge.alternate===null&&a(O,ge),z=p(Ge,z,Ce),Ve===null?Se=Ge:Ve.sibling=Ge,Ve=Ge,ge=Me}if(Ce===B.length)return s(O,ge),Be&&Fn(O,Ce),Se;if(ge===null){for(;Ce<B.length;Ce++)ge=Y(O,B[Ce],P),ge!==null&&(z=p(ge,z,Ce),Ve===null?Se=ge:Ve.sibling=ge,Ve=ge);return Be&&Fn(O,Ce),Se}for(ge=o(ge);Ce<B.length;Ce++)Me=V(ge,O,Ce,B[Ce],P),Me!==null&&(t&&Me.alternate!==null&&ge.delete(Me.key===null?Ce:Me.key),z=p(Me,z,Ce),Ve===null?Se=Me:Ve.sibling=Me,Ve=Me);return t&&ge.forEach(function(Ua){return a(O,Ua)}),Be&&Fn(O,Ce),Se}function we(O,z,B,P){if(B==null)throw Error(r(151));for(var Se=null,Ve=null,ge=z,Ce=z=0,Me=null,Ge=B.next();ge!==null&&!Ge.done;Ce++,Ge=B.next()){ge.index>Ce?(Me=ge,ge=null):Me=ge.sibling;var Ua=q(O,ge,Ge.value,P);if(Ua===null){ge===null&&(ge=Me);break}t&&ge&&Ua.alternate===null&&a(O,ge),z=p(Ua,z,Ce),Ve===null?Se=Ua:Ve.sibling=Ua,Ve=Ua,ge=Me}if(Ge.done)return s(O,ge),Be&&Fn(O,Ce),Se;if(ge===null){for(;!Ge.done;Ce++,Ge=B.next())Ge=Y(O,Ge.value,P),Ge!==null&&(z=p(Ge,z,Ce),Ve===null?Se=Ge:Ve.sibling=Ge,Ve=Ge);return Be&&Fn(O,Ce),Se}for(ge=o(ge);!Ge.done;Ce++,Ge=B.next())Ge=V(ge,O,Ce,Ge.value,P),Ge!==null&&(t&&Ge.alternate!==null&&ge.delete(Ge.key===null?Ce:Ge.key),z=p(Ge,z,Ce),Ve===null?Se=Ge:Ve.sibling=Ge,Ve=Ge);return t&&ge.forEach(function(tw){return a(O,tw)}),Be&&Fn(O,Ce),Se}function Je(O,z,B,P){if(typeof B=="object"&&B!==null&&B.type===N&&B.key===null&&(B=B.props.children),typeof B=="object"&&B!==null){switch(B.$$typeof){case _:e:{for(var Se=B.key;z!==null;){if(z.key===Se){if(Se=B.type,Se===N){if(z.tag===7){s(O,z.sibling),P=u(z,B.props.children),P.return=O,O=P;break e}}else if(z.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===M&&di(Se)===z.type){s(O,z.sibling),P=u(z,B.props),Sr(P,B),P.return=O,O=P;break e}s(O,z);break}else a(O,z);z=z.sibling}B.type===N?(P=ri(B.props.children,O.mode,P,B.key),P.return=O,O=P):(P=Lo(B.type,B.key,B.props,null,O.mode,P),Sr(P,B),P.return=O,O=P)}return y(O);case C:e:{for(Se=B.key;z!==null;){if(z.key===Se)if(z.tag===4&&z.stateNode.containerInfo===B.containerInfo&&z.stateNode.implementation===B.implementation){s(O,z.sibling),P=u(z,B.children||[]),P.return=O,O=P;break e}else{s(O,z);break}else a(O,z);z=z.sibling}P=fu(B,O.mode,P),P.return=O,O=P}return y(O);case M:return B=di(B),Je(O,z,B,P)}if(pe(B))return fe(O,z,B,P);if(ve(B)){if(Se=ve(B),typeof Se!="function")throw Error(r(150));return B=Se.call(B),we(O,z,B,P)}if(typeof B.then=="function")return Je(O,z,Ho(B),P);if(B.$$typeof===H)return Je(O,z,Uo(O,B),P);Zo(O,B)}return typeof B=="string"&&B!==""||typeof B=="number"||typeof B=="bigint"?(B=""+B,z!==null&&z.tag===6?(s(O,z.sibling),P=u(z,B),P.return=O,O=P):(s(O,z),P=du(B,O.mode,P),P.return=O,O=P),y(O)):s(O,z)}return function(O,z,B,P){try{vr=0;var Se=Je(O,z,B,P);return ls=null,Se}catch(ge){if(ge===os||ge===Go)throw ge;var Ve=nn(29,ge,null,O.mode);return Ve.lanes=P,Ve.return=O,Ve}}}var pi=$m(!0),Um=$m(!1),ja=!1;function Nu(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ku(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=Bo(t),jm(t,null,s),a}return Mo(t,o,a,s),Bo(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,wo(t,s)}}function Au(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 _u=!1;function wr(){if(_u){var t=rs;if(t!==null)throw t}}function jr(t,a,s,o){_u=!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,L=A.next;A.next=null,y===null?p=L:y.next=L,y=A;var I=t.alternate;I!==null&&(I=I.updateQueue,x=I.lastBaseUpdate,x!==y&&(x===null?I.firstBaseUpdate=L:x.next=L,I.lastBaseUpdate=A))}if(p!==null){var Y=u.baseState;y=0,I=L=A=null,x=p;do{var q=x.lane&-536870913,V=q!==x.lane;if(V?(Re&q)===q:(o&q)===q){q!==0&&q===ss&&(_u=!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 Je=s;switch(we.tag){case 1:if(fe=we.payload,typeof fe=="function"){Y=fe.call(Je,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(Je,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?(L=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=L,u.lastBaseUpdate=I,p===null&&(u.shared.lanes=0),Ta|=y,t.lanes=y,t.memoizedState=Y}}function Vm(t,a){if(typeof t!="function")throw Error(r(191,t));t.call(a)}function Gm(t,a){var s=t.callbacks;if(s!==null)for(t.callbacks=null,t=0;t<s.length;t++)Vm(s[t],a)}var cs=Qe(null),Po=Qe(0);function Im(t,a){t=ca,le(Po,t),le(cs,a),ca=t|a.baseLanes}function zu(){le(Po,ca),le(cs,cs.current)}function Cu(){ca=Po.current,Q(cs),Q(Po)}var an=Qe(null),bn=null;function Aa(t){var a=t.alternate;le(ht,ht.current&1),le(an,t),bn===null&&(a===null||cs.current!==null||a.memoizedState!==null)&&(bn=t)}function Tu(t){le(ht,ht.current),le(an,t),bn===null&&(bn=t)}function Hm(t){t.tag===22?(le(ht,ht.current),le(an,t),bn===null&&(bn=t)):_a()}function _a(){le(ht,ht.current),le(an,an.current)}function sn(t){Q(an),bn===t&&(bn=null),Q(ht)}var ht=Qe(0);function Ko(t){for(var a=t;a!==null;){if(a.tag===13){var s=a.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||Bd(s)||Ld(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,ze=null,Ye=null,xt=null,Qo=!1,us=!1,mi=!1,Yo=0,Nr=0,ds=null,ZS=0;function ft(){throw Error(r(321))}function Eu(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 Ou(t,a,s,o,u,p){return ta=p,ze=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,$.H=t===null||t.memoizedState===null?_h:Ku,mi=!1,p=s(o,u),mi=!1,us&&(p=Pm(a,s,o,u)),Zm(t),p}function Zm(t){$.H=_r;var a=Ye!==null&&Ye.next!==null;if(ta=0,xt=Ye=ze=null,Qo=!1,Nr=0,ds=null,a)throw Error(r(300));t===null||wt||(t=t.dependencies,t!==null&&$o(t)&&(wt=!0))}function Pm(t,a,s,o){ze=t;var u=0;do{if(us&&(ds=null),Nr=0,us=!1,25<=u)throw Error(r(301));if(u+=1,xt=Ye=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=zh,p=a(s,o)}while(us);return p}function PS(){var t=$.H,a=t.useState()[0];return a=typeof a.then=="function"?kr(a):a,t=t.useState()[0],(Ye!==null?Ye.memoizedState:null)!==t&&(ze.flags|=1024),a}function Du(){var t=Yo!==0;return Yo=0,t}function Ru(t,a,s){a.updateQueue=t.updateQueue,a.flags&=-2053,t.lanes&=~s}function Mu(t){if(Qo){for(t=t.memoizedState;t!==null;){var a=t.queue;a!==null&&(a.pending=null),t=t.next}Qo=!1}ta=0,xt=Ye=ze=null,us=!1,Nr=Yo=0,ds=null}function Ut(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return xt===null?ze.memoizedState=xt=t:xt=xt.next=t,xt}function gt(){if(Ye===null){var t=ze.alternate;t=t!==null?t.memoizedState:null}else t=Ye.next;var a=xt===null?ze.memoizedState:xt.next;if(a!==null)xt=a,Ye=t;else{if(t===null)throw ze.alternate===null?Error(r(467)):Error(r(310));Ye=t,t={memoizedState:Ye.memoizedState,baseState:Ye.baseState,baseQueue:Ye.baseQueue,queue:Ye.queue,next:null},xt===null?ze.memoizedState=xt=t:xt=xt.next=t}return xt}function Xo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function kr(t){var a=Nr;return Nr+=1,ds===null&&(ds=[]),t=Bm(ds,t,a),a=ze,(xt===null?a.memoizedState:xt.next)===null&&(a=a.alternate,$.H=a===null||a.memoizedState===null?_h:Ku),t}function Jo(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return kr(t);if(t.$$typeof===H)return Dt(t)}throw Error(r(438,String(t)))}function Bu(t){var a=null,s=ze.updateQueue;if(s!==null&&(a=s.memoCache),a==null){var o=ze.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=Xo(),ze.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 Fo(t){var a=gt();return Lu(a,Ye,t)}function Lu(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,L=a,I=!1;do{var Y=L.lane&-536870913;if(Y!==L.lane?(Re&Y)===Y:(ta&Y)===Y){var q=L.revertLane;if(q===0)A!==null&&(A=A.next={lane:0,revertLane:0,gesture:null,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null}),Y===ss&&(I=!0);else if((ta&q)===q){L=L.next,q===ss&&(I=!0);continue}else Y={lane:0,revertLane:L.revertLane,gesture:null,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null},A===null?(x=A=Y,y=p):A=A.next=Y,ze.lanes|=q,Ta|=q;Y=L.action,mi&&s(p,Y),p=L.hasEagerState?L.eagerState:s(p,Y)}else q={lane:Y,revertLane:L.revertLane,gesture:L.gesture,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null},A===null?(x=A=q,y=p):A=A.next=q,ze.lanes|=Y,Ta|=Y;L=L.next}while(L!==null&&L!==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 qu(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 Km(t,a,s){var o=ze,u=gt(),p=Be;if(p){if(s===void 0)throw Error(r(407));s=s()}else s=a();var y=!tn((Ye||u).memoizedState,s);if(y&&(u.memoizedState=s,wt=!0),u=u.queue,Vu(Xm.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},Ym.bind(null,o,u,s,a),null),We===null)throw Error(r(349));p||(ta&127)!==0||Qm(o,a,s)}return s}function Qm(t,a,s){t.flags|=16384,t={getSnapshot:a,value:s},a=ze.updateQueue,a===null?(a=Xo(),ze.updateQueue=a,a.stores=[t]):(s=a.stores,s===null?a.stores=[t]:s.push(t))}function Ym(t,a,s,o){a.value=s,a.getSnapshot=o,Jm(a)&&Fm(t)}function Xm(t,a,s){return s(function(){Jm(a)&&Fm(t)})}function Jm(t){var a=t.getSnapshot;t=t.value;try{var s=a();return!tn(t,s)}catch{return!0}}function Fm(t){var a=si(t,2);a!==null&&Jt(a,t,2)}function $u(t){var a=Ut();if(typeof t=="function"){var s=t;if(t=s(),mi){Cn(!0);try{s()}finally{Cn(!1)}}}return a.memoizedState=a.baseState=t,a.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:na,lastRenderedState:t},a}function Wm(t,a,s,o){return t.baseState=s,Lu(t,Ye,typeof o=="function"?o:na)}function KS(t,a,s,o,u){if(tl(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,eh(a,p)):(p.next=s.next,a.pending=s.next=p)}}function eh(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),th(t,a,x)}catch(L){Uu(t,a,L)}finally{p!==null&&y.types!==null&&(p.types=y.types),$.T=p}}else try{p=s(u,o),th(t,a,p)}catch(L){Uu(t,a,L)}}function th(t,a,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(o){nh(t,a,o)},function(o){return Uu(t,a,o)}):nh(t,a,s)}function nh(t,a,s){a.status="fulfilled",a.value=s,ah(a),t.state=s,a=t.pending,a!==null&&(s=a.next,s===a?t.pending=null:(s=s.next,a.next=s,eh(t,s)))}function Uu(t,a,s){var o=t.pending;if(t.pending=null,o!==null){o=o.next;do a.status="rejected",a.reason=s,ah(a),a=a.next;while(a!==o)}t.action=null}function ah(t){t=t.listeners;for(var a=0;a<t.length;a++)(0,t[a])()}function ih(t,a){return a}function sh(t,a){if(Be){var s=We.formState;if(s!==null){e:{var o=ze;if(Be){if(it){t:{for(var u=it,p=yn;u.nodeType!==8;){if(!p){u=null;break t}if(u=vn(u.nextSibling),u===null){u=null;break t}}p=u.data,u=p==="F!"||p==="F"?u:null}if(u){it=vn(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:ih,lastRenderedState:a},s.queue=o,s=Nh.bind(null,ze,o),o.dispatch=s,o=$u(!1),p=Pu.bind(null,ze,!1,o.queue),o=Ut(),u={state:a,dispatch:null,action:t,pending:null},o.queue=u,s=KS.bind(null,ze,u,p,s),u.dispatch=s,o.memoizedState=t,[a,s,!1]}function rh(t){var a=gt();return oh(a,Ye,t)}function oh(t,a,s){if(a=Lu(t,a,ih)[0],t=Fo(na)[0],typeof a=="object"&&a!==null&&typeof a.then=="function")try{var o=kr(a)}catch(y){throw y===os?Go:y}else o=a;a=gt();var u=a.queue,p=u.dispatch;return s!==a.memoizedState&&(ze.flags|=2048,fs(9,{destroy:void 0},QS.bind(null,u,s),null)),[o,p,t]}function QS(t,a){t.action=a}function lh(t){var a=gt(),s=Ye;if(s!==null)return oh(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=ze.updateQueue,a===null&&(a=Xo(),ze.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 ch(){return gt().memoizedState}function Wo(t,a,s,o){var u=Ut();ze.flags|=t,u.memoizedState=fs(1|a,{destroy:void 0},s,o===void 0?null:o)}function el(t,a,s,o){var u=gt();o=o===void 0?null:o;var p=u.memoizedState.inst;Ye!==null&&o!==null&&Eu(o,Ye.memoizedState.deps)?u.memoizedState=fs(a,p,s,o):(ze.flags|=t,u.memoizedState=fs(1|a,p,s,o))}function uh(t,a){Wo(8390656,8,t,a)}function Vu(t,a){el(2048,8,t,a)}function YS(t){ze.flags|=4;var a=ze.updateQueue;if(a===null)a=Xo(),ze.updateQueue=a,a.events=[t];else{var s=a.events;s===null?a.events=[t]:s.push(t)}}function dh(t){var a=gt().memoizedState;return YS({ref:a,nextImpl:t}),function(){if((Ie&2)!==0)throw Error(r(440));return a.impl.apply(void 0,arguments)}}function fh(t,a){return el(4,2,t,a)}function ph(t,a){return el(4,4,t,a)}function mh(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 hh(t,a,s){s=s!=null?s.concat([t]):null,el(4,4,mh.bind(null,a,t),s)}function Gu(){}function gh(t,a){var s=gt();a=a===void 0?null:a;var o=s.memoizedState;return a!==null&&Eu(a,o[1])?o[0]:(s.memoizedState=[t,a],t)}function yh(t,a){var s=gt();a=a===void 0?null:a;var o=s.memoizedState;if(a!==null&&Eu(a,o[1]))return o[0];if(o=t(),mi){Cn(!0);try{t()}finally{Cn(!1)}}return s.memoizedState=[o,a],o}function Iu(t,a,s){return s===void 0||(ta&1073741824)!==0&&(Re&261930)===0?t.memoizedState=a:(t.memoizedState=s,t=bg(),ze.lanes|=t,Ta|=t,s)}function bh(t,a,s,o){return tn(s,a)?s:cs.current!==null?(t=Iu(t,s,o),tn(t,a)||(wt=!0),t):(ta&42)===0||(ta&1073741824)!==0&&(Re&261930)===0?(wt=!0,t.memoizedState=s):(t=bg(),ze.lanes|=t,Ta|=t,a)}function vh(t,a,s,o,u){var p=F.p;F.p=p!==0&&8>p?p:8;var y=$.T,x={};$.T=x,Pu(t,!1,a,s);try{var A=u(),L=$.S;if(L!==null&&L(x,A),A!==null&&typeof A=="object"&&typeof A.then=="function"){var I=HS(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 XS(){}function Hu(t,a,s,o){if(t.tag!==5)throw Error(r(476));var u=Sh(t).queue;vh(t,u,a,de,s===null?XS:function(){return xh(t),s(o)})}function Sh(t){var a=t.memoizedState;if(a!==null)return a;a={memoizedState:de,baseState:de,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:na,lastRenderedState:de},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 xh(t){var a=Sh(t);a.next===null&&(a=t.alternate.memoizedState),Ar(t,a.next.queue,{},ln())}function Zu(){return Dt(Ir)}function wh(){return gt().memoizedState}function jh(){return gt().memoizedState}function JS(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:Su()},t.payload=a;return}a=a.return}}function FS(t,a,s){var o=ln();s={lane:o,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},tl(t)?kh(a,s):(s=cu(t,a,s,o),s!==null&&(Jt(s,t,o),Ah(s,a,o)))}function Nh(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(tl(t))kh(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 Mo(t,a,u,0),We===null&&Ro(),!1}catch{}if(s=cu(t,a,u,o),s!==null)return Jt(s,t,o),Ah(s,a,o),!0}return!1}function Pu(t,a,s,o){if(o={lane:2,revertLane:Nd(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},tl(t)){if(a)throw Error(r(479))}else a=cu(t,s,o,2),a!==null&&Jt(a,t,2)}function tl(t){var a=t.alternate;return t===ze||a!==null&&a===ze}function kh(t,a){us=Qo=!0;var s=t.pending;s===null?a.next=a:(a.next=s.next,s.next=a),t.pending=a}function Ah(t,a,s){if((s&4194048)!==0){var o=a.lanes;o&=t.pendingLanes,s|=o,a.lanes=s,wo(t,s)}}var _r={readContext:Dt,use:Jo,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 _h={readContext:Dt,use:Jo,useCallback:function(t,a){return Ut().memoizedState=[t,a===void 0?null:a],t},useContext:Dt,useEffect:uh,useImperativeHandle:function(t,a,s){s=s!=null?s.concat([t]):null,Wo(4194308,4,mh.bind(null,a,t),s)},useLayoutEffect:function(t,a){return Wo(4194308,4,t,a)},useInsertionEffect:function(t,a){Wo(4,2,t,a)},useMemo:function(t,a){var s=Ut();a=a===void 0?null:a;var o=t();if(mi){Cn(!0);try{t()}finally{Cn(!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){Cn(!0);try{s(a)}finally{Cn(!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=FS.bind(null,ze,t),[o.memoizedState,t]},useRef:function(t){var a=Ut();return t={current:t},a.memoizedState=t},useState:function(t){t=$u(t);var a=t.queue,s=Nh.bind(null,ze,a);return a.dispatch=s,[t.memoizedState,s]},useDebugValue:Gu,useDeferredValue:function(t,a){var s=Ut();return Iu(s,t,a)},useTransition:function(){var t=$u(!1);return t=vh.bind(null,ze,t.queue,!0,!1),Ut().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,a,s){var o=ze,u=Ut();if(Be){if(s===void 0)throw Error(r(407));s=s()}else{if(s=a(),We===null)throw Error(r(349));(Re&127)!==0||Qm(o,a,s)}u.memoizedState=s;var p={value:s,getSnapshot:a};return u.queue=p,uh(Xm.bind(null,o,p,t),[t]),o.flags|=2048,fs(9,{destroy:void 0},Ym.bind(null,o,p,s,a),null),s},useId:function(){var t=Ut(),a=We.identifierPrefix;if(Be){var s=Un,o=$n;s=(o&~(1<<32-mt(o)-1)).toString(32)+s,a="_"+a+"R_"+s,s=Yo++,0<s&&(a+="H"+s.toString(32)),a+="_"}else s=ZS++,a="_"+a+"r_"+s.toString(32)+"_";return t.memoizedState=a},useHostTransitionStatus:Zu,useFormState:sh,useActionState:sh,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=Pu.bind(null,ze,!0,s),s.dispatch=a,[t,a]},useMemoCache:Bu,useCacheRefresh:function(){return Ut().memoizedState=JS.bind(null,ze)},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)}}},Ku={readContext:Dt,use:Jo,useCallback:gh,useContext:Dt,useEffect:Vu,useImperativeHandle:hh,useInsertionEffect:fh,useLayoutEffect:ph,useMemo:yh,useReducer:Fo,useRef:ch,useState:function(){return Fo(na)},useDebugValue:Gu,useDeferredValue:function(t,a){var s=gt();return bh(s,Ye.memoizedState,t,a)},useTransition:function(){var t=Fo(na)[0],a=gt().memoizedState;return[typeof t=="boolean"?t:kr(t),a]},useSyncExternalStore:Km,useId:wh,useHostTransitionStatus:Zu,useFormState:rh,useActionState:rh,useOptimistic:function(t,a){var s=gt();return Wm(s,Ye,t,a)},useMemoCache:Bu,useCacheRefresh:jh};Ku.useEffectEvent=dh;var zh={readContext:Dt,use:Jo,useCallback:gh,useContext:Dt,useEffect:Vu,useImperativeHandle:hh,useInsertionEffect:fh,useLayoutEffect:ph,useMemo:yh,useReducer:qu,useRef:ch,useState:function(){return qu(na)},useDebugValue:Gu,useDeferredValue:function(t,a){var s=gt();return Ye===null?Iu(s,t,a):bh(s,Ye.memoizedState,t,a)},useTransition:function(){var t=qu(na)[0],a=gt().memoizedState;return[typeof t=="boolean"?t:kr(t),a]},useSyncExternalStore:Km,useId:wh,useHostTransitionStatus:Zu,useFormState:lh,useActionState:lh,useOptimistic:function(t,a){var s=gt();return Ye!==null?Wm(s,Ye,t,a):(s.baseState=t,[t,s.queue.dispatch])},useMemoCache:Bu,useCacheRefresh:jh};zh.useEffectEvent=dh;function Qu(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 Yu={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 Ch(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 Th(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&&Yu.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 Eh(t){Do(t)}function Oh(t){console.error(t)}function Dh(t){Do(t)}function nl(t,a){try{var s=t.onUncaughtError;s(a.value,{componentStack:a.stack})}catch(o){setTimeout(function(){throw o})}}function Rh(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 Xu(t,a,s){return s=Na(s),s.tag=3,s.payload={element:null},s.callback=function(){nl(t,a)},s}function Mh(t){return t=Na(t),t.tag=3,t}function Bh(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(){Rh(a,s,o)}}var y=s.stateNode;y!==null&&typeof y.componentDidCatch=="function"&&(t.callback=function(){Rh(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 WS(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 bn===null?ml():s.alternate===null&&pt===0&&(pt=3),s.flags&=-257,s.flags|=65536,s.lanes=u,o===Io?s.flags|=16384:(a=s.updateQueue,a===null?s.updateQueue=new Set([o]):a.add(o),xd(t,o,u)),!1;case 22:return s.flags|=65536,o===Io?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)),xd(t,o,u)),!1}throw Error(r(435,s.tag))}return xd(t,o,u),ml(),!1}if(Be)return a=an.current,a!==null?((a.flags&65536)===0&&(a.flags|=256),a.flags|=65536,a.lanes=u,o!==hu&&(t=Error(r(422),{cause:o}),gr(mn(t,s)))):(o!==hu&&(a=Error(r(423),{cause:o}),gr(mn(a,s))),t=t.current.alternate,t.flags|=65536,u&=-u,t.lanes|=u,o=mn(o,s),u=Xu(t.stateNode,o,u),Au(t,u),pt!==4&&(pt=2)),!1;var p=Error(r(520),{cause:o});if(p=mn(p,s),Mr===null?Mr=[p]:Mr.push(p),pt!==4&&(pt=2),a===null)return!0;o=mn(o,s),s=a;do{switch(s.tag){case 3:return s.flags|=65536,t=u&-u,s.lanes|=t,t=Xu(s.stateNode,o,t),Au(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=Mh(u),Bh(u,t,s,o),Au(s,u),!1}s=s.return}while(s!==null);return!1}var Ju=Error(r(461)),wt=!1;function Rt(t,a,s,o){a.child=t===null?Um(a,null,s,o):pi(a,t.child,s,o)}function Lh(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=Ou(t,a,s,y,p,u),x=Du(),t!==null&&!wt?(Ru(t,a,u),aa(t,a,u)):(Be&&x&&pu(a),a.flags|=1,Rt(t,a,o,u),a.child)}function qh(t,a,s,o,u){if(t===null){var p=s.type;return typeof p=="function"&&!uu(p)&&p.defaultProps===void 0&&s.compare===null?(a.tag=15,a.type=p,$h(t,a,p,o,u)):(t=Lo(s.type,null,o,a,a.mode,u),t.ref=a.ref,t.return=a,a.child=t)}if(p=t.child,!sd(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 $h(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,sd(t,u))(t.flags&131072)!==0&&(wt=!0);else return a.lanes=t.lanes,aa(t,a,u)}return Fu(t,a,s,o,u)}function Uh(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 Vh(t,a,p,s,o)}if((s&536870912)!==0)a.memoizedState={baseLanes:0,cachePool:null},t!==null&&Vo(a,p!==null?p.cachePool:null),p!==null?Im(a,p):zu(),Hm(a);else return o=a.lanes=536870912,Vh(t,a,p!==null?p.baseLanes|s:s,s,o)}else p!==null?(Vo(a,p.cachePool),Im(a,p),_a(),a.memoizedState=null):(t!==null&&Vo(a,null),zu(),_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 Vh(t,a,s,o,u){var p=wu();return p=p===null?null:{parent:St._currentValue,pool:p},a.memoizedState={baseLanes:s,cachePool:p},t!==null&&Vo(a,null),zu(),Hm(a),t!==null&&is(t,a,o,!0),a.childLanes=u,null}function al(t,a){return a=sl({mode:a.mode,children:a.children},t.mode),a.ref=t.ref,t.child=a,a.return=t,a}function Gh(t,a,s){return pi(a,t.child,null,s),t=al(a,a.pendingProps),t.flags|=2,sn(a),a.memoizedState=null,t}function ex(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=al(a,o),a.lanes=536870912,zr(null,t);if(Tu(a),(t=it)?(t=ey(t,yn),t=t!==null&&t.data==="&"?t:null,t!==null&&(a.memoizedState={dehydrated:t,treeContext:va!==null?{id:$n,overflow:Un}:null,retryLane:536870912,hydrationErrors:null},s=km(t),s.return=a,a.child=s,Ot=a,it=null)):t=null,t===null)throw xa(a);return a.lanes=536870912,null}return al(a,o)}var p=t.memoizedState;if(p!==null){var y=p.dehydrated;if(Tu(a),u)if(a.flags&256)a.flags&=-257,a=Gh(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=We,o!==null&&(y=nr(o,s),y!==0&&y!==p.retryLane))throw p.retryLane=y,si(t,y),Jt(o,t,y),Ju;ml(),a=Gh(t,a,s)}else t=p.treeContext,it=vn(y.nextSibling),Ot=a,Be=!0,Sa=null,yn=!1,t!==null&&zm(a,t),a=al(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 il(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 Fu(t,a,s,o,u){return ci(a),s=Ou(t,a,s,o,void 0,u),o=Du(),t!==null&&!wt?(Ru(t,a,u),aa(t,a,u)):(Be&&o&&pu(a),a.flags|=1,Rt(t,a,s,u),a.child)}function Ih(t,a,s,o,u,p){return ci(a),a.updateQueue=null,s=Pm(a,o,s,u),Zm(t),o=Du(),t!==null&&!wt?(Ru(t,a,p),aa(t,a,p)):(Be&&o&&pu(a),a.flags|=1,Rt(t,a,s,p),a.child)}function Hh(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=Yu,a.stateNode=p,p._reactInternals=a,p=a.stateNode,p.props=o,p.state=a.memoizedState,p.refs={},Nu(a),y=s.contextType,p.context=typeof y=="object"&&y!==null?Dt(y):es,p.state=a.memoizedState,y=s.getDerivedStateFromProps,typeof y=="function"&&(Qu(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&&Yu.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 L=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||L!==y)&&Th(a,p,o,y),ja=!1;var q=a.memoizedState;p.state=q,jr(a,o,p,u),wr(),L=a.memoizedState,x||q!==L||ja?(typeof Y=="function"&&(Qu(a,s,Y,o),L=a.memoizedState),(A=ja||Ch(a,s,A,o,q,L,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=L),p.props=o,p.state=L,p.context=y,o=A):(typeof p.componentDidMount=="function"&&(a.flags|=4194308),o=!1)}else{p=a.stateNode,ku(t,a),y=a.memoizedProps,I=hi(s,y),p.props=I,Y=a.pendingProps,q=p.context,L=s.contextType,A=es,typeof L=="object"&&L!==null&&(A=Dt(L)),x=s.getDerivedStateFromProps,(L=typeof x=="function"||typeof p.getSnapshotBeforeUpdate=="function")||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(y!==Y||q!==A)&&Th(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&&$o(t.dependencies)?(typeof x=="function"&&(Qu(a,s,x,o),V=a.memoizedState),(I=ja||Ch(a,s,I,o,q,V,A)||t!==null&&t.dependencies!==null&&$o(t.dependencies))?(L||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,il(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 Zh(t,a,s,o){return oi(),a.flags|=256,Rt(t,a,s,o),a.child}var Wu={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ed(t){return{baseLanes:t,cachePool:Rm()}}function td(t,a,s){return t=t!==null?t.childLanes&~s:0,a&&(t|=on),t}function Ph(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=ey(t,yn),t=t!==null&&t.data!=="&"?t:null,t!==null&&(a.memoizedState={dehydrated:t,treeContext:va!==null?{id:$n,overflow:Un}:null,retryLane:536870912,hydrationErrors:null},s=km(t),s.return=a,a.child=s,Ot=a,it=null)):t=null,t===null)throw xa(a);return Ld(t)?a.lanes=32:a.lanes=536870912,null}var x=o.children;return o=o.fallback,u?(_a(),u=a.mode,x=sl({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=ed(s),o.childLanes=td(t,y,s),a.memoizedState=Wu,zr(null,o)):(Aa(a),nd(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=ad(t,a,s)):a.memoizedState!==null?(_a(),a.child=t.child,a.flags|=128,a=null):(_a(),x=o.fallback,u=a.mode,o=sl({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=ed(s),o.childLanes=td(t,y,s),a.memoizedState=Wu,a=zr(null,o));else if(Aa(a),Ld(x)){if(y=x.nextSibling&&x.nextSibling.dataset,y)var L=y.dgst;y=L,o=Error(r(419)),o.stack="",o.digest=y,gr({value:o,source:null,stack:null}),a=ad(t,a,s)}else if(wt||is(t,a,s,!1),y=(s&t.childLanes)!==0,wt||y){if(y=We,y!==null&&(o=nr(y,s),o!==0&&o!==A.retryLane))throw A.retryLane=o,si(t,o),Jt(y,t,o),Ju;Bd(x)||ml(),a=ad(t,a,s)}else Bd(x)?(a.flags|=192,a.child=t.child,a=null):(t=A.treeContext,it=vn(x.nextSibling),Ot=a,Be=!0,Sa=null,yn=!1,t!==null&&zm(a,t),a=nd(a,o.children),a.flags|=4096);return a}return u?(_a(),x=o.fallback,u=a.mode,A=t.child,L=A.sibling,o=Jn(A,{mode:"hidden",children:o.children}),o.subtreeFlags=A.subtreeFlags&65011712,L!==null?x=Jn(L,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=ed(s):(u=x.cachePool,u!==null?(A=St._currentValue,u=u.parent!==A?{parent:A,pool:A}:u):u=Rm(),x={baseLanes:x.baseLanes|s,cachePool:u}),o.memoizedState=x,o.childLanes=td(t,y,s),a.memoizedState=Wu,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 nd(t,a){return a=sl({mode:"visible",children:a},t.mode),a.return=t,t.child=a}function sl(t,a){return t=nn(22,t,null,a),t.lanes=0,t}function ad(t,a,s){return pi(a,t.child,null,s),t=nd(a,a.pendingProps.children),t.flags|=2,a.memoizedState=null,t}function Kh(t,a,s){t.lanes|=a;var o=t.alternate;o!==null&&(o.lanes|=a),bu(t.return,a,s)}function id(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 Qh(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&&Kh(t,s,a);else if(t.tag===19)Kh(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&&Ko(t)===null&&(u=s),s=s.sibling;s=u,s===null?(u=a.child,a.child=null):(u=s.sibling,s.sibling=null),id(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&&Ko(t)===null){a.child=u;break}t=u.sibling,u.sibling=s,s=u,u=t}id(a,!0,s,null,p,o);break;case"together":id(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 sd(t,a){return(t.lanes&a)!==0?!0:(t=t.dependencies,!!(t!==null&&$o(t)))}function tx(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:Ue(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,Tu(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?Ph(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 Qh(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,Uh(t,a,s,a.pendingProps);case 24:wa(a,St,t.memoizedState.cache)}return aa(t,a,s)}function Yh(t,a,s){if(t!==null)if(t.memoizedProps!==a.pendingProps)wt=!0;else{if(!sd(t,s)&&(a.flags&128)===0)return wt=!1,tx(t,a,s);wt=(t.flags&131072)!==0}else wt=!1,Be&&(a.flags&1048576)!==0&&_m(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")uu(t)?(o=hi(t,o),a.tag=1,a=Hh(null,a,t,o,s)):(a.tag=0,a=Fu(null,a,t,o,s));else{if(t!=null){var u=t.$$typeof;if(u===K){a.tag=11,a=Lh(null,a,t,o,s);break e}else if(u===D){a.tag=14,a=qh(null,a,t,o,s);break e}}throw a=re(t)||t,Error(r(306,a,""))}}return a;case 0:return Fu(t,a,a.type,a.pendingProps,s);case 1:return o=a.type,u=hi(o,a.pendingProps),Hh(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,ku(t,a),jr(a,o,null,s);var y=a.memoizedState;if(o=y.cache,wa(a,St,o),o!==p.cache&&vu(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=Zh(t,a,o,s);break e}else if(o!==u){u=mn(Error(r(424)),a),gr(u),a=Zh(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=vn(t.firstChild),Ot=a,Be=!0,Sa=null,yn=!0,s=Um(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 il(t,a),t===null?(s=ry(a.type,null,a.pendingProps,null))?a.memoizedState=s:Be||(s=a.type,t=a.pendingProps,o=xl(ne.current).createElement(s),o[Et]=a,o[Zt]=t,Mt(o,s,t),_t(o),a.stateNode=o):a.memoizedState=ry(a.type,t.memoizedProps,a.pendingProps,t.memoizedState),null;case 27:return Ue(a),t===null&&Be&&(o=a.stateNode=ay(a.type,a.pendingProps,ne.current),Ot=a,yn=!0,u=it,Ma(a.type)?(qd=u,it=vn(o.firstChild)):it=u),Rt(t,a,a.pendingProps.children,s),il(t,a),t===null&&(a.flags|=4194304),a.child;case 5:return t===null&&Be&&((u=o=it)&&(o=Ex(o,a.type,a.pendingProps,yn),o!==null?(a.stateNode=o,Ot=a,it=vn(o.firstChild),yn=!1,u=!0):u=!1),u||xa(a)),Ue(a),u=a.type,p=a.pendingProps,y=t!==null?t.memoizedProps:null,o=p.children,Dd(u,p)?o=null:y!==null&&Dd(u,y)&&(a.flags|=32),a.memoizedState!==null&&(u=Ou(t,a,PS,null,null,s),Ir._currentValue=u),il(t,a),Rt(t,a,o,s),a.child;case 6:return t===null&&Be&&((t=s=it)&&(s=Ox(s,a.pendingProps,yn),s!==null?(a.stateNode=s,Ot=a,it=null,t=!0):t=!1),t||xa(a)),null;case 13:return Ph(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 Lh(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 qh(t,a,a.type,a.pendingProps,s);case 15:return $h(t,a,a.type,a.pendingProps,s);case 19:return Qh(t,a,s);case 31:return ex(t,a,s);case 22:return Uh(t,a,s,a.pendingProps);case 24:return ci(a),o=Dt(St),t===null?(u=wu(),u===null&&(u=We,p=Su(),u.pooledCache=p,p.refCount++,p!==null&&(u.pooledCacheLanes|=s),u=p),a.memoizedState={parent:o,cache:u},Nu(a),wa(a,St,u)):((t.lanes&s)!==0&&(ku(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&&vu(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 rd(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(wg())t.flags|=8192;else throw fi=Io,ju}else t.flags&=-16777217}function Xh(t,a){if(a.type!=="stylesheet"||(a.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!dy(a))if(wg())t.flags|=8192;else throw fi=Io,ju}function rl(t,a){a!==null&&(t.flags|=4),t.flags&16384&&(a=t.tag!==22?So():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 nx(t,a,s){var o=a.pendingProps;switch(mu(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,gu())),st(a),null;case 26:var u=a.type,p=a.memoizedState;return t===null?(ia(a),p!==null?(st(a),Xh(a,p)):(st(a),rd(a,u,null,o,s))):p?p!==t.memoizedState?(ia(a),st(a),Xh(a,p)):(st(a),a.flags&=-16777217):(t=t.memoizedProps,t!==o&&ia(a),st(a),rd(a,u,t,o,s)),null;case 27:if(Ze(a),s=ne.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=te.current,as(a)?Cm(a):(t=ay(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=te.current,as(a))Cm(a);else{var y=xl(ne.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),rd(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=ne.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||Pg(t.nodeValue,s)),t||xa(a,!0)}else t=xl(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=gu(),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=gu(),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),rl(a,a.updateQueue),st(a),null);case 4:return xe(),t===null&&zd(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=Ko(t),p!==null){for(a.flags|=128,Cr(o,!1),t=p.updateQueue,a.updateQueue=t,rl(a,t),a.subtreeFlags=0,t=s,s=a.child;s!==null;)Nm(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()>dl&&(a.flags|=128,u=!0,Cr(o,!1),a.lanes=4194304)}else{if(!u)if(t=Ko(p),t!==null){if(a.flags|=128,u=!0,t=t.updateQueue,a.updateQueue=t,rl(a,t),Cr(o,!0),o.tail===null&&o.tailMode==="hidden"&&!p.alternate&&!Be)return st(a),null}else 2*Lt()-o.renderingStartTime>dl&&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),Cu(),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&&rl(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 ax(t,a){switch(mu(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),Cu(),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 Jh(t,a){switch(mu(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),Cu(),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,L=x;try{L()}catch(I){Ke(u,A,I)}}}o=o.next}while(o!==p)}}catch(I){Ke(a,a.return,I)}}function Fh(t){var a=t.updateQueue;if(a!==null){var s=t.stateNode;try{Gm(a,s)}catch(o){Ke(t,t.return,o)}}}function Wh(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 Vn(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 eg(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 od(t,a,s){try{var o=t.stateNode;kx(o,t.type,s,a),o[Zt]=a}catch(u){Ke(t,t.return,u)}}function tg(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Ma(t.type)||t.tag===4}function ld(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||tg(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 cd(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(cd(t,a,s),t=t.sibling;t!==null;)cd(t,a,s),t=t.sibling}function ol(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(ol(t,a,s),t=t.sibling;t!==null;)ol(t,a,s),t=t.sibling}function ng(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,ud=!1,ag=typeof WeakSet=="function"?WeakSet:Set,zt=null;function ix(t,a){if(t=t.containerInfo,Ed=zl,t=hm(t),au(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,L=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&&++L===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(Od={focusedElem:t,selectionRange:s},zl=!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)Md(t);else if(s===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":Md(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 ig(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&&Fh(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{Gm(t,a)}catch(y){Ke(s,s.return,y)}}break;case 27:a===null&&o&4&&ng(s);case 26:case 5:oa(t,s),a===null&&o&4&&eg(s),o&512&&Er(s,s.return);break;case 12:oa(t,s);break;case 31:oa(t,s),o&4&&og(t,s);break;case 13:oa(t,s),o&4&&lg(t,s),o&64&&(t=s.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(s=px.bind(null,s),Dx(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 sg(t){var a=t.alternate;a!==null&&(t.alternate=null,sg(a)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(a=t.stateNode,a!==null&&Uc(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;)rg(t,a,s),s=s.sibling}function rg(t,a,s){if(qt&&typeof qt.onCommitFiberUnmount=="function")try{qt.onCommitFiberUnmount(ga,s)}catch{}switch(s.tag){case 26:jt||Vn(s,a),ra(t,a,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:jt||Vn(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||Vn(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,Fg(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,s.stateNode),Ns(t)):Fg(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||(Vn(s,a),o=s.stateNode,typeof o.componentWillUnmount=="function"&&Wh(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 og(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 lg(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 sx(t){switch(t.tag){case 31:case 13:case 19:var a=t.stateNode;return a===null&&(a=t.stateNode=new ag),a;case 22:return t=t.stateNode,a=t._retryCache,a===null&&(a=t._retryCache=new ag),a;default:throw Error(r(435,t.tag))}}function ll(t,a){var s=sx(t);a.forEach(function(o){if(!s.has(o)){s.add(o);var u=mx.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));rg(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;)cg(a,t),a=a.sibling}var On=null;function cg(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||Vn(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=On;if(Qt(a,t),Yt(t),o&512&&(jt||s===null||Vn(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=cy("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=cy("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 uy(u,t.type,t.stateNode);else t.stateNode=ly(u,o,t.memoizedProps);else p!==o?(p===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):p.count--,o===null?uy(u,t.type,t.stateNode):ly(u,o,t.memoizedProps)):o===null&&t.stateNode!==null&&od(t,t.memoizedProps,s.memoizedProps)}break;case 27:Qt(a,t),Yt(t),o&512&&(jt||s===null||Vn(s,s.return)),s!==null&&o&4&&od(t,t.memoizedProps,s.memoizedProps);break;case 5:if(Qt(a,t),Yt(t),o&512&&(jt||s===null||Vn(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,od(t,u,s!==null?s.memoizedProps:u)),o&1024&&(ud=!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(Nl=null,u=On,On=wl(a.containerInfo),Qt(a,t),On=u,Yt(t),o&4&&s!==null&&s.memoizedState.isDehydrated)try{Ns(a.containerInfo)}catch(fe){Ke(t,t.return,fe)}ud&&(ud=!1,ug(t));break;case 4:o=On,On=wl(t.stateNode.containerInfo),Qt(a,t),Yt(t),On=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,ll(t,o)));break;case 13:Qt(a,t),Yt(t),t.child.flags&8192&&t.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(ul=Lt()),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,ll(t,o)));break;case 22:u=t.memoizedState!==null;var A=s!==null&&s.memoizedState!==null,L=sa,I=jt;if(sa=L||u,jt=I||A,Qt(a,t),jt=I,sa=L,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?Wg(V,!0):Wg(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,ll(t,s))));break;case 19:Qt(a,t),Yt(t),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,ll(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(tg(o)){s=o;break}o=o.return}if(s==null)throw Error(r(160));switch(s.tag){case 27:var u=s.stateNode,p=ld(t);ol(t,p,u);break;case 5:var y=s.stateNode;s.flags&32&&(Ki(y,""),s.flags&=-33);var x=ld(t);ol(t,x,y);break;case 3:case 4:var A=s.stateNode.containerInfo,L=ld(t);cd(t,L,A);break;default:throw Error(r(161))}}catch(I){Ke(t,t.return,I)}t.flags&=-3}a&4096&&(t.flags&=-4097)}function ug(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var a=t;ug(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;)ig(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:Vn(a,a.return);var s=a.stateNode;typeof s.componentWillUnmount=="function"&&Wh(a,a.return,s),gi(a);break;case 27:Ur(a.stateNode);case 26:case 5:Vn(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(L){Ke(o,o.return,L)}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++)Vm(A[u],x)}catch(L){Ke(o,o.return,L)}}s&&y&64&&Fh(p),Er(p,p.return);break;case 27:ng(p);case 26:case 5:la(u,p,s),s&&o===null&&y&4&&eg(p),Er(p,p.return);break;case 12:la(u,p,s);break;case 31:la(u,p,s),s&&y&4&&og(u,p);break;case 13:la(u,p,s),s&&y&4&&lg(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 dd(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 fd(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 Dn(t,a,s,o){if(a.subtreeFlags&10256)for(a=a.child;a!==null;)dg(t,a,s,o),a=a.sibling}function dg(t,a,s,o){var u=a.flags;switch(a.tag){case 0:case 11:case 15:Dn(t,a,s,o),u&2048&&Tr(9,a);break;case 1:Dn(t,a,s,o);break;case 3:Dn(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){Dn(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 Dn(t,a,s,o);break;case 31:Dn(t,a,s,o);break;case 13:Dn(t,a,s,o);break;case 23:break;case 22:p=a.stateNode,y=a.alternate,a.memoizedState!==null?p._visibility&2?Dn(t,a,s,o):Or(t,a):p._visibility&2?Dn(t,a,s,o):(p._visibility|=2,ps(t,a,s,o,(a.subtreeFlags&10256)!==0||!1)),u&2048&&dd(y,a);break;case 24:Dn(t,a,s,o),u&2048&&fd(a.alternate,a);break;default:Dn(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,L=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&&L&2048&&dd(y.alternate,y);break;case 24:ps(p,y,x,A,u),u&&L&2048&&fd(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&&dd(o.alternate,o);break;case 24:Or(s,o),u&2048&&fd(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;)fg(t,a,s),t=t.sibling}function fg(t,a,s){switch(t.tag){case 26:ms(t,a,s),t.flags&Dr&&t.memoizedState!==null&&Zx(s,On,t.memoizedState,t.memoizedProps);break;case 5:ms(t,a,s);break;case 3:case 4:var o=On;On=wl(t.stateNode.containerInfo),ms(t,a,s),On=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 pg(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,hg(o,t)}pg(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)mg(t),t=t.sibling}function mg(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,cl(t)):Rr(t);break;default:Rr(t)}}function cl(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,hg(o,t)}pg(t)}for(t=t.child;t!==null;){switch(a=t,a.tag){case 0:case 11:case 15:za(8,a,a.return),cl(a);break;case 22:s=a.stateNode,s._visibility&2&&(s._visibility&=-3,cl(a));break;default:cl(a)}t=t.sibling}}function hg(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(sg(o),o===s){zt=null;break e}if(u!==null){u.return=p,zt=u;break e}zt=p}}}var rx={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}},ox=typeof WeakMap=="function"?WeakMap:Map,Ie=0,We=null,Oe=null,Re=0,Pe=0,rn=null,Ca=!1,hs=!1,pd=!1,ca=0,pt=0,Ta=0,yi=0,md=0,on=0,gs=0,Mr=null,Xt=null,hd=!1,ul=0,gg=0,dl=1/0,fl=null,Ea=null,kt=0,Oa=null,ys=null,ua=0,gd=0,yd=null,yg=null,Br=0,bd=null;function ln(){return(Ie&2)!==0&&Re!==0?Re&-Re:$.T!==null?Nd():Dp()}function bg(){if(on===0)if((Re&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===We&&(Pe===2||Pe===9)||t.cancelPendingCommit!==null)&&(bs(t,0),Da(t,Re,on,!1)),Fe(t,s),((Ie&2)===0||t!==We)&&(t===We&&((Ie&2)===0&&(yi|=s),pt===4&&Da(t,Re,on,!1)),Gn(t))}function vg(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?ux(t,a):Sd(t,a,!0),p=o;do{if(u===0){hs&&!o&&Da(t,a,0,!1);break}else{if(s=t.current.alternate,p&&!lx(s)){u=Sd(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=Sd(x,y,!1),y!==2){if(pd&&!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=ul+300-Lt(),10<u)){if(Da(o,a,on,!Ca),Ui(o,0,!0)!==0)break e;ua=a,o.timeoutHandle=Xg(Sg.bind(null,o,s,Xt,fl,hd,a,on,yi,gs,Ca,p,"Throttled",-0,0),u);break e}Sg(o,s,Xt,fl,hd,a,on,yi,gs,Ca,p,null,-0,0)}}break}while(!0);Gn(t)}function Sg(t,a,s,o,u,p,y,x,A,L,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},fg(a,p,Y);var fe=(p&62914560)===p?ul-Lt():(p&4194048)===p?gg-Lt():0;if(fe=Px(Y,fe),fe!==null){ua=p,t.cancelPendingCommit=fe(zg.bind(null,t,a,p,s,o,u,y,x,A,I,Y,null,q,V)),Da(t,p,y,!L);return}}zg(t,a,p,s,o,u,y,x,A)}function lx(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&=~md,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&&xo(t,s,a)}function pl(){return(Ie&6)===0?(Lr(0),!1):!0}function vd(){if(Oe!==null){if(Pe===0)var t=Oe.return;else t=Oe,Wn=li=null,Mu(t),ls=null,vr=0,t=Oe;for(;t!==null;)Jh(t.alternate,t),t=t.return;Oe=null}}function bs(t,a){var s=t.timeoutHandle;s!==-1&&(t.timeoutHandle=-1,zx(s)),s=t.cancelPendingCommit,s!==null&&(t.cancelPendingCommit=null,s()),ua=0,vd(),We=t,Oe=s=Jn(t.current,null),Re=a,Pe=0,rn=null,Ca=!1,hs=Wa(t,a),pd=!1,gs=on=md=yi=Ta=pt=0,Xt=Mr=null,hd=!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,Ro(),s}function xg(t,a){ze=null,$.H=_r,a===os||a===Go?(a=Lm(),Pe=3):a===ju?(a=Lm(),Pe=4):Pe=a===Ju?8:a!==null&&typeof a=="object"&&typeof a.then=="function"?6:1,rn=a,Oe===null&&(pt=1,nl(t,mn(a,t.current)))}function wg(){var t=an.current;return t===null?!0:(Re&4194048)===Re?bn===null:(Re&62914560)===Re||(Re&536870912)!==0?t===bn:!1}function jg(){var t=$.H;return $.H=_r,t===null?_r:t}function Ng(){var t=$.A;return $.A=rx,t}function ml(){pt=4,Ca||(Re&4194048)!==Re&&an.current!==null||(hs=!0),(Ta&134217727)===0&&(yi&134217727)===0||We===null||Da(We,Re,on,!1)}function Sd(t,a,s){var o=Ie;Ie|=2;var u=jg(),p=Ng();(We!==t||Re!==a)&&(fl=null,bs(t,a)),a=!1;var y=pt;e:do try{if(Pe!==0&&Oe!==null){var x=Oe,A=rn;switch(Pe){case 8:vd(),y=6;break e;case 3:case 2:case 9:case 6:an.current===null&&(a=!0);var L=Pe;if(Pe=0,rn=null,vs(t,x,A,L),s&&hs){y=0;break e}break;default:L=Pe,Pe=0,rn=null,vs(t,x,A,L)}}cx(),y=pt;break}catch(I){xg(t,I)}while(!0);return a&&t.shellSuspendCounter++,Wn=li=null,Ie=o,$.H=u,$.A=p,Oe===null&&(We=null,Re=0,Ro()),y}function cx(){for(;Oe!==null;)kg(Oe)}function ux(t,a){var s=Ie;Ie|=2;var o=jg(),u=Ng();We!==t||Re!==a?(fl=null,dl=Lt()+500,bs(t,a)):hs=Wa(t,a);e:do try{if(Pe!==0&&Oe!==null){a=Oe;var p=rn;t:switch(Pe){case 1:Pe=0,rn=null,vs(t,a,p,1);break;case 2:case 9:if(Mm(p)){Pe=0,rn=null,Ag(a);break}a=function(){Pe!==2&&Pe!==9||We!==t||(Pe=7),Gn(t)},p.then(a,a);break e;case 3:Pe=7;break e;case 4:Pe=5;break e;case 7:Mm(p)?(Pe=0,rn=null,Ag(a)):(Pe=0,rn=null,vs(t,a,p,7));break;case 5:var y=null;switch(Oe.tag){case 26:y=Oe.memoizedState;case 5:case 27:var x=Oe;if(y?dy(y):x.stateNode.complete){Pe=0,rn=null;var A=x.sibling;if(A!==null)Oe=A;else{var L=x.return;L!==null?(Oe=L,hl(L)):Oe=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:vd(),pt=6;break e;default:throw Error(r(462))}}dx();break}catch(I){xg(t,I)}while(!0);return Wn=li=null,$.H=o,$.A=u,Ie=s,Oe!==null?0:(We=null,Re=0,Ro(),pt)}function dx(){for(;Oe!==null&&!go();)kg(Oe)}function kg(t){var a=Yh(t.alternate,t,ca);t.memoizedProps=t.pendingProps,a===null?hl(t):Oe=a}function Ag(t){var a=t,s=a.alternate;switch(a.tag){case 15:case 0:a=Ih(s,a,a.pendingProps,a.type,void 0,Re);break;case 11:a=Ih(s,a,a.pendingProps,a.type.render,a.ref,Re);break;case 5:Mu(a);default:Jh(s,a),a=Oe=Nm(a,ca),a=Yh(s,a,ca)}t.memoizedProps=t.pendingProps,a===null?hl(t):Oe=a}function vs(t,a,s,o){Wn=li=null,Mu(a),ls=null,vr=0;var u=a.return;try{if(WS(t,u,a,s,Re)){pt=1,nl(t,mn(s,t.current)),Oe=null;return}}catch(p){if(u!==null)throw Oe=u,p;pt=1,nl(t,mn(s,t.current)),Oe=null;return}a.flags&32768?(Be||o===1?t=!0:hs||(Re&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))),_g(a,t)):hl(a)}function hl(t){var a=t;do{if((a.flags&32768)!==0){_g(a,Ca);return}t=a.return;var s=nx(a.alternate,a,ca);if(s!==null){Oe=s;return}if(a=a.sibling,a!==null){Oe=a;return}Oe=a=t}while(a!==null);pt===0&&(pt=5)}function _g(t,a){do{var s=ax(t.alternate,t);if(s!==null){s.flags&=32767,Oe=s;return}if(s=t.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!a&&(t=t.sibling,t!==null)){Oe=t;return}Oe=t=s}while(t!==null);pt=6,Oe=null}function zg(t,a,s,o,u,p,y,x,A){t.cancelPendingCommit=null;do gl();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|=lu,ei(t,s,p,y,x,A),t===We&&(Oe=We=null,Re=0),ys=a,Oa=t,ua=s,gd=p,yd=u,yg=o,(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,hx(Mi,function(){return Dg(),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{ix(t,a,s)}finally{Ie=y,F.p=u,$.T=o}}kt=1,Cg(),Tg(),Eg()}}function Cg(){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{cg(a,t);var p=Od,y=hm(t.containerInfo),x=p.focusedElem,A=p.selectionRange;if(y!==x&&x&&x.ownerDocument&&mm(x.ownerDocument.documentElement,x)){if(A!==null&&au(x)){var L=A.start,I=A.end;if(I===void 0&&(I=L),"selectionStart"in x)x.selectionStart=L,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),Je=A.end===void 0?we:Math.min(A.end,fe);!V.extend&&we>Je&&(y=Je,Je=we,we=y);var O=pm(x,we),z=pm(x,Je);if(O&&z&&(V.rangeCount!==1||V.anchorNode!==O.node||V.anchorOffset!==O.offset||V.focusNode!==z.node||V.focusOffset!==z.offset)){var B=Y.createRange();B.setStart(O.node,O.offset),V.removeAllRanges(),we>Je?(V.addRange(B),V.extend(z.node,z.offset)):(B.setEnd(z.node,z.offset),V.addRange(B))}}}}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}}zl=!!Ed,Od=Ed=null}finally{Ie=u,F.p=o,$.T=s}}t.current=a,kt=2}}function Tg(){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{ig(t,a.alternate,a)}finally{Ie=u,F.p=o,$.T=s}}kt=3}}function Eg(){if(kt===4||kt===3){kt=0,Bc();var t=Oa,a=ys,s=ua,o=yg;(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?kt=5:(kt=0,ys=Oa=null,Og(t,t.pendingLanes));var u=t.pendingLanes;if(u===0&&(Ea=null),Tn(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&&gl(),Gn(t),u=t.pendingLanes,(s&261930)!==0&&(u&42)!==0?t===bd?Br++:(Br=0,bd=t):Br=0,Lr(0)}}function Og(t,a){(t.pooledCacheLanes&=a)===0&&(a=t.pooledCache,a!=null&&(t.pooledCache=null,yr(a)))}function gl(){return Cg(),Tg(),Eg(),Dg()}function Dg(){if(kt!==5)return!1;var t=Oa,a=gd;gd=0;var s=Tn(ua),o=$.T,u=F.p;try{F.p=32>s?32:s,$.T=null,s=yd,yd=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,mg(p.current),dg(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,Og(t,a)}}function Rg(t,a,s){a=mn(s,a),a=Xu(t.stateNode,a,2),t=ka(t,a,2),t!==null&&(Fe(t,2),Gn(t))}function Ke(t,a,s){if(t.tag===3)Rg(t,t,s);else for(;a!==null;){if(a.tag===3){Rg(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=mn(s,t),s=Mh(2),o=ka(a,s,2),o!==null&&(Bh(s,o,a,t),Fe(o,2),Gn(o));break}}a=a.return}}function xd(t,a,s){var o=t.pingCache;if(o===null){o=t.pingCache=new ox;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)||(pd=!0,u.add(s),t=fx.bind(null,t,a,s),a.then(t,t))}function fx(t,a,s){var o=t.pingCache;o!==null&&o.delete(a),t.pingedLanes|=t.suspendedLanes&s,t.warmLanes&=~s,We===t&&(Re&s)===s&&(pt===4||pt===3&&(Re&62914560)===Re&&300>Lt()-ul?(Ie&2)===0&&bs(t,0):md|=s,gs===Re&&(gs=0)),Gn(t)}function Mg(t,a){a===0&&(a=So()),t=si(t,a),t!==null&&(Fe(t,a),Gn(t))}function px(t){var a=t.memoizedState,s=0;a!==null&&(s=a.retryLane),Mg(t,s)}function mx(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),Mg(t,s)}function hx(t,a){return Di(t,a)}var yl=null,Ss=null,wd=!1,bl=!1,jd=!1,Ra=0;function Gn(t){t!==Ss&&t.next===null&&(Ss===null?yl=Ss=t:Ss=Ss.next=t),bl=!0,wd||(wd=!0,yx())}function Lr(t,a){if(!jd&&bl){jd=!0;do for(var s=!1,o=yl;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,$g(o,p))}else p=Re,p=Ui(o,o===We?p:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(p&3)===0||Wa(o,p)||(s=!0,$g(o,p));o=o.next}while(s);jd=!1}}function gx(){Bg()}function Bg(){bl=wd=!1;var t=0;Ra!==0&&_x()&&(t=Ra);for(var a=Lt(),s=null,o=yl;o!==null;){var u=o.next,p=Lg(o,a);p===0?(o.next=null,s===null?yl=u:s.next=u,u===null&&(Ss=s)):(s=o,(t!==0||(p&3)!==0)&&(bl=!0)),o=u}kt!==0&&kt!==5||Lr(t),Ra!==0&&(Ra=0)}function Lg(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=We,s=Re,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),Tn(s)){case 2:case 8:s=bo;break;case 32:s=Mi;break;case 268435456:s=Bi;break;default:s=Mi}return o=qg.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 qg(t,a){if(kt!==0&&kt!==5)return t.callbackNode=null,t.callbackPriority=0,null;var s=t.callbackNode;if(gl()&&t.callbackNode!==s)return null;var o=Re;return o=Ui(t,t===We?o:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),o===0?null:(vg(t,o,a),Lg(t,Lt()),t.callbackNode!=null&&t.callbackNode===s?qg.bind(null,t):null)}function $g(t,a){if(gl())return null;vg(t,a,!0)}function yx(){Cx(function(){(Ie&6)!==0?Di(er,gx):Bg()})}function Nd(){if(Ra===0){var t=ss;t===0&&(t=Li,Li<<=1,(Li&261888)===0&&(Li=256)),Ra=t}return Ra}function Ug(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Ao(""+t)}function Vg(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 bx(t,a,s,o,u){if(a==="submit"&&s&&s.stateNode===u){var p=Ug((u[Zt]||null).action),y=o.submitter;y&&(a=(a=y[Zt]||null)?Ug(a.formAction):y.getAttribute("formAction"),a!==null&&(p=a,y=null));var x=new To("action","action",null,o,u);t.push({event:x,listeners:[{instance:null,listener:function(){if(o.defaultPrevented){if(Ra!==0){var A=y?Vg(u,y):new FormData(u);Hu(s,{pending:!0,data:A,method:u.method,action:p},null,A)}}else typeof p=="function"&&(x.preventDefault(),A=y?Vg(u,y):new FormData(u),Hu(s,{pending:!0,data:A,method:u.method,action:p},p,A))},currentTarget:u}]})}}for(var kd=0;kd<ou.length;kd++){var Ad=ou[kd],vx=Ad.toLowerCase(),Sx=Ad[0].toUpperCase()+Ad.slice(1);En(vx,"on"+Sx)}En(bm,"onAnimationEnd"),En(vm,"onAnimationIteration"),En(Sm,"onAnimationStart"),En("dblclick","onDoubleClick"),En("focusin","onFocus"),En("focusout","onBlur"),En(BS,"onTransitionRun"),En(LS,"onTransitionStart"),En(qS,"onTransitionCancel"),En(xm,"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(" "),xx=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(qr));function Gg(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,L=x.currentTarget;if(x=x.listener,A!==p&&u.isPropagationStopped())break e;p=x,u.currentTarget=L;try{p(u)}catch(I){Do(I)}u.currentTarget=null,p=A}else for(y=0;y<o.length;y++){if(x=o[y],A=x.instance,L=x.currentTarget,x=x.listener,A!==p&&u.isPropagationStopped())break e;p=x,u.currentTarget=L;try{p(u)}catch(I){Do(I)}u.currentTarget=null,p=A}}}}function De(t,a){var s=a[$c];s===void 0&&(s=a[$c]=new Set);var o=t+"__bubble";s.has(o)||(Ig(a,t,2,!1),s.add(o))}function _d(t,a,s){var o=0;a&&(o|=4),Ig(s,t,o,a)}var vl="_reactListening"+Math.random().toString(36).slice(2);function zd(t){if(!t[vl]){t[vl]=!0,Bp.forEach(function(s){s!=="selectionchange"&&(xx.has(s)||_d(s,!1,t),_d(s,!0,t))});var a=t.nodeType===9?t:t.ownerDocument;a===null||a[vl]||(a[vl]=!0,_d("selectionchange",!1,a))}}function Ig(t,a,s,o){switch(by(a)){case 2:var u=Yx;break;case 8:u=Xx;break;default:u=Id}s=u.bind(null,a,s,t),u=void 0,!Qc||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 Cd(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}Qp(function(){var L=p,I=Pc(s),Y=[];e:{var q=wm.get(t);if(q!==void 0){var V=To,fe=t;switch(t){case"keypress":if(zo(s)===0)break e;case"keydown":case"keyup":V=mS;break;case"focusin":fe="focus",V=Fc;break;case"focusout":fe="blur",V=Fc;break;case"beforeblur":case"afterblur":V=Fc;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=Jp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":V=nS;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":V=yS;break;case bm:case vm:case Sm:V=sS;break;case xm:V=vS;break;case"scroll":case"scrollend":V=eS;break;case"wheel":V=xS;break;case"copy":case"cut":case"paste":V=oS;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":V=Wp;break;case"toggle":case"beforetoggle":V=jS}var we=(a&4)!==0,Je=!we&&(t==="scroll"||t==="scrollend"),O=we?q!==null?q+"Capture":null:q;we=[];for(var z=L,B;z!==null;){var P=z;if(B=P.stateNode,P=P.tag,P!==5&&P!==26&&P!==27||B===null||O===null||(P=rr(z,O),P!=null&&we.push($r(z,P,B))),Je)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!==Zc&&(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=L,fe=fe?Gi(fe):null,fe!==null&&(Je=c(fe),we=fe.tag,fe!==Je||we!==5&&we!==27&&we!==6)&&(fe=null)):(V=null,fe=L),V!==fe)){if(we=Jp,P="onMouseLeave",O="onMouseEnter",z="mouse",(t==="pointerout"||t==="pointerover")&&(we=Wp,P="onPointerLeave",O="onPointerEnter",z="pointer"),Je=V==null?q:sr(V),B=fe==null?q:sr(fe),q=new we(P,z+"leave",V,s,I),q.target=Je,q.relatedTarget=B,P=null,Gi(I)===L&&(we=new we(O,z+"enter",fe,s,I),we.target=B,we.relatedTarget=Je,P=we),Je=P,V&&fe)t:{for(we=wx,O=V,z=fe,B=0,P=O;P;P=we(P))B++;P=0;for(var Se=z;Se;Se=we(Se))P++;for(;0<B-P;)O=we(O),B--;for(;0<P-B;)z=we(z),P--;for(;B--;){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&&Hg(Y,q,V,we,!1),fe!==null&&Je!==null&&Hg(Y,Je,fe,we,!0)}}e:{if(q=L?sr(L):window,V=q.nodeName&&q.nodeName.toLowerCase(),V==="select"||V==="input"&&q.type==="file")var Ve=om;else if(sm(q))if(lm)Ve=DS;else{Ve=ES;var ge=TS}else V=q.nodeName,!V||V.toLowerCase()!=="input"||q.type!=="checkbox"&&q.type!=="radio"?L&&Hc(L.elementType)&&(Ve=om):Ve=OS;if(Ve&&(Ve=Ve(t,L))){rm(Y,Ve,s,I);break e}ge&&ge(t,q,L),t==="focusout"&&L&&q.type==="number"&&L.memoizedProps.value!=null&&Ic(q,"number",q.value)}switch(ge=L?sr(L):window,t){case"focusin":(sm(ge)||ge.contentEditable==="true")&&(Ji=ge,iu=L,mr=null);break;case"focusout":mr=iu=Ji=null;break;case"mousedown":su=!0;break;case"contextmenu":case"mouseup":case"dragend":su=!1,gm(Y,s,I);break;case"selectionchange":if(MS)break;case"keydown":case"keyup":gm(Y,s,I)}var Ce;if(eu)e:{switch(t){case"compositionstart":var Me="onCompositionStart";break e;case"compositionend":Me="onCompositionEnd";break e;case"compositionupdate":Me="onCompositionUpdate";break e}Me=void 0}else Xi?am(t,s)&&(Me="onCompositionEnd"):t==="keydown"&&s.keyCode===229&&(Me="onCompositionStart");Me&&(em&&s.locale!=="ko"&&(Xi||Me!=="onCompositionStart"?Me==="onCompositionEnd"&&Xi&&(Ce=Yp()):(ba=I,Yc="value"in ba?ba.value:ba.textContent,Xi=!0)),ge=Sl(L,Me),0<ge.length&&(Me=new Fp(Me,t,null,s,I),Y.push({event:Me,listeners:ge}),Ce?Me.data=Ce:(Ce=im(s),Ce!==null&&(Me.data=Ce)))),(Ce=kS?AS(t,s):_S(t,s))&&(Me=Sl(L,"onBeforeInput"),0<Me.length&&(ge=new Fp("onBeforeInput","beforeinput",null,s,I),Y.push({event:ge,listeners:Me}),ge.data=Ce)),bx(Y,t,L,s,I)}Gg(Y,a)})}function $r(t,a,s){return{instance:t,listener:a,currentTarget:s}}function Sl(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 wx(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function Hg(t,a,s,o,u){for(var p=a._reactName,y=[];s!==null&&s!==o;){var x=s,A=x.alternate,L=x.stateNode;if(x=x.tag,A!==null&&A===o)break;x!==5&&x!==26&&x!==27||L===null||(A=L,u?(L=rr(s,p),L!=null&&y.unshift($r(s,L,A))):u||(L=rr(s,p),L!=null&&y.push($r(s,L,A)))),s=s.return}y.length!==0&&t.push({event:a,listeners:y})}var jx=/\r\n?/g,Nx=/\u0000|\uFFFD/g;function Zg(t){return(typeof t=="string"?t:""+t).replace(jx,`
|
|
10
|
+
`).replace(Nx,"")}function Pg(t,a){return a=Zg(a),Zg(t)===a}function Xe(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":No(t,"class",o);break;case"tabIndex":No(t,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":No(t,s,o);break;case"style":Pp(t,o,p);break;case"data":if(a!=="object"){No(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=Ao(""+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"&&Xe(t,a,"name",u.name,u,null),Xe(t,a,"formEncType",u.formEncType,u,null),Xe(t,a,"formMethod",u.formMethod,u,null),Xe(t,a,"formTarget",u.formTarget,u,null)):(Xe(t,a,"encType",u.encType,u,null),Xe(t,a,"method",u.method,u,null),Xe(t,a,"target",u.target,u,null)));if(o==null||typeof o=="symbol"||typeof o=="boolean"){t.removeAttribute(s);break}o=Ao(""+o),t.setAttribute(s,o);break;case"onClick":o!=null&&(t.onclick=Yn);break;case"onScroll":o!=null&&De("scroll",t);break;case"onScrollEnd":o!=null&&De("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=Ao(""+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":De("beforetoggle",t),De("toggle",t),jo(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":jo(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=F1.get(s)||s,jo(t,s,o))}}function Td(t,a,s,o,u,p){switch(s){case"style":Pp(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&&De("scroll",t);break;case"onScrollEnd":o!=null&&De("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(!Lp.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,""):jo(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":De("error",t),De("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:Xe(t,a,p,y,s,null)}}u&&Xe(t,a,"srcSet",s.srcSet,s,null),o&&Xe(t,a,"src",s.src,s,null);return;case"input":De("invalid",t);var x=p=y=u=null,A=null,L=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":L=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:Xe(t,a,o,I,s,null)}}Gp(t,p,x,A,L,y,u,!1);return;case"select":De("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:Xe(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":De("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:Xe(t,a,y,x,s,null)}Hp(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":Xe(t,a,A,o,s,null));return;case"dialog":De("beforetoggle",t),De("toggle",t),De("cancel",t),De("close",t);break;case"iframe":case"object":De("load",t);break;case"video":case"audio":for(o=0;o<qr.length;o++)De(qr[o],t);break;case"image":De("error",t),De("load",t);break;case"details":De("toggle",t);break;case"embed":case"source":case"link":De("error",t),De("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(L in s)if(s.hasOwnProperty(L)&&(o=s[L],o!=null))switch(L){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,a));default:Xe(t,a,L,o,s,null)}return;default:if(Hc(a)){for(I in s)s.hasOwnProperty(I)&&(o=s[I],o!==void 0&&Td(t,a,I,o,s,void 0));return}}for(x in s)s.hasOwnProperty(x)&&(o=s[x],o!=null&&Xe(t,a,x,o,s,null))}function kx(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,L=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)||Xe(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":L=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&&Xe(t,a,q,V,o,Y)}}Gc(t,y,x,A,L,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)||Xe(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&&Xe(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:Xe(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&&Xe(t,a,y,u,o,p)}Ip(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:Xe(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":Xe(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)&&Xe(t,a,we,null,o,q);for(L in o)if(q=o[L],V=s[L],o.hasOwnProperty(L)&&q!==V&&(q!=null||V!=null))switch(L){case"children":case"dangerouslySetInnerHTML":if(q!=null)throw Error(r(137,a));break;default:Xe(t,a,L,q,o,V)}return;default:if(Hc(a)){for(var Je in s)q=s[Je],s.hasOwnProperty(Je)&&q!==void 0&&!o.hasOwnProperty(Je)&&Td(t,a,Je,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||Td(t,a,I,q,o,V);return}}for(var O in s)q=s[O],s.hasOwnProperty(O)&&q!=null&&!o.hasOwnProperty(O)&&Xe(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||Xe(t,a,Y,q,o,V)}function Kg(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Ax(){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&&Kg(y)){for(y=0,x=u.responseEnd,o+=1;o<s.length;o++){var A=s[o],L=A.startTime;if(L>x)break;var I=A.transferSize,Y=A.initiatorType;I&&Kg(Y)&&(A=A.responseEnd,y+=I*(A<x?1:(x-L)/(A-L)))}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 Ed=null,Od=null;function xl(t){return t.nodeType===9?t:t.ownerDocument}function Qg(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 Yg(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 Dd(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 Rd=null;function _x(){var t=window.event;return t&&t.type==="popstate"?t===Rd?!1:(Rd=t,!0):(Rd=null,!1)}var Xg=typeof setTimeout=="function"?setTimeout:void 0,zx=typeof clearTimeout=="function"?clearTimeout:void 0,Jg=typeof Promise=="function"?Promise:void 0,Cx=typeof queueMicrotask=="function"?queueMicrotask:typeof Jg<"u"?function(t){return Jg.resolve(null).then(t).catch(Tx)}:Xg;function Tx(t){setTimeout(function(){throw t})}function Ma(t){return t==="head"}function Fg(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 Wg(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 Md(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":Md(s),Uc(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}t.removeChild(s)}}function Ex(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=vn(t.nextSibling),t===null)break}return null}function Ox(t,a,s){if(a==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!s||(t=vn(t.nextSibling),t===null))return null;return t}function ey(t,a){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!a||(t=vn(t.nextSibling),t===null))return null;return t}function Bd(t){return t.data==="$?"||t.data==="$~"}function Ld(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function Dx(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 vn(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 qd=null;function ty(t){t=t.nextSibling;for(var a=0;t;){if(t.nodeType===8){var s=t.data;if(s==="/$"||s==="/&"){if(a===0)return vn(t.nextSibling);a--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||a++}t=t.nextSibling}return null}function ny(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 ay(t,a,s){switch(a=xl(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]);Uc(t)}var Sn=new Map,iy=new Set;function wl(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var da=F.d;F.d={f:Rx,r:Mx,D:Bx,C:Lx,L:qx,m:$x,X:Vx,S:Ux,M:Gx};function Rx(){var t=da.f(),a=pl();return t||a}function Mx(t){var a=Ii(t);a!==null&&a.tag===5&&a.type==="form"?xh(a):da.r(t)}var xs=typeof document>"u"?null:document;function sy(t,a,s){var o=xs;if(o&&typeof a=="string"&&a){var u=fn(a);u='link[rel="'+t+'"][href="'+u+'"]',typeof s=="string"&&(u+='[crossorigin="'+s+'"]'),iy.has(u)||(iy.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 Bx(t){da.D(t),sy("dns-prefetch",t,null)}function Lx(t,a){da.C(t,a),sy("preconnect",t,a)}function qx(t,a,s){da.L(t,a,s);var o=xs;if(o&&t&&a){var u='link[rel="preload"][as="'+fn(a)+'"]';a==="image"&&s&&s.imageSrcSet?(u+='[imagesrcset="'+fn(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(u+='[imagesizes="'+fn(s.imageSizes)+'"]')):u+='[href="'+fn(t)+'"]';var p=u;switch(a){case"style":p=ws(t);break;case"script":p=js(t)}Sn.has(p)||(t=S({rel:"preload",href:a==="image"&&s&&s.imageSrcSet?void 0:t,as:a},s),Sn.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 $x(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="'+fn(o)+'"][href="'+fn(t)+'"]',p=u;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":p=js(t)}if(!Sn.has(p)&&(t=S({rel:"modulepreload",href:t},a),Sn.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 Ux(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=Sn.get(p))&&$d(t,s);var A=y=o.createElement("link");_t(A),Mt(A,"link",t),A._p=new Promise(function(L,I){A.onload=L,A.onerror=I}),A.addEventListener("load",function(){x.loading|=1}),A.addEventListener("error",function(){x.loading|=2}),x.loading|=4,jl(y,a,o)}y={type:"stylesheet",instance:y,count:1,state:x},u.set(p,y)}}}function Vx(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=Sn.get(u))&&Ud(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 Gx(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=Sn.get(u))&&Ud(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 ry(t,a,s,o){var u=(u=ne.current)?wl(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),Sn.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},Sn.set(t,s),p||Ix(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="'+fn(t)+'"'}function Vr(t){return'link[rel="stylesheet"]['+t+"]"}function oy(t){return S({},t,{"data-precedence":t.precedence,precedence:null})}function Ix(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="'+fn(t)+'"]'}function Gr(t){return"script[async]"+t}function ly(t,a,s){if(a.count++,a.instance===null)switch(a.type){case"style":var o=t.querySelector('style[data-href~="'+fn(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),jl(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=oy(s),(u=Sn.get(u))&&$d(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,jl(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=Sn.get(p))&&(o=S({},s),Ud(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,jl(o,s.precedence,t));return a.instance}function jl(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 $d(t,a){t.crossOrigin==null&&(t.crossOrigin=a.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=a.referrerPolicy),t.title==null&&(t.title=a.title)}function Ud(t,a){t.crossOrigin==null&&(t.crossOrigin=a.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=a.referrerPolicy),t.integrity==null&&(t.integrity=a.integrity)}var Nl=null;function cy(t,a,s){if(Nl===null){var o=new Map,u=Nl=new Map;u.set(s,o)}else u=Nl,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 uy(t,a,s){t=t.ownerDocument||t,t.head.insertBefore(s,a==="title"?t.querySelector("head > title"):null)}function Hx(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 dy(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function Zx(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=kl.bind(t),a.then(t,t)),s.state.loading|=4,s.instance=p,_t(p);return}p=a.ownerDocument||a,o=oy(o),(u=Sn.get(u))&&$d(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=kl.bind(t),a.addEventListener("load",s),a.addEventListener("error",s))}}var Vd=0;function Px(t,a){return t.stylesheets&&t.count===0&&_l(t,t.stylesheets),0<t.count||0<t.imgCount?function(s){var o=setTimeout(function(){if(t.stylesheets&&_l(t,t.stylesheets),t.unsuspend){var p=t.unsuspend;t.unsuspend=null,p()}},6e4+a);0<t.imgBytes&&Vd===0&&(Vd=62500*Ax());var u=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&_l(t,t.stylesheets),t.unsuspend)){var p=t.unsuspend;t.unsuspend=null,p()}},(t.imgBytes>Vd?50:800)+a);return t.unsuspend=s,function(){t.unsuspend=null,clearTimeout(o),clearTimeout(u)}}:null}function kl(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)_l(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Al=null;function _l(t,a){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Al=new Map,a.forEach(Kx,t),Al=null,kl.call(t))}function Kx(t,a){if(!(a.state.loading&4)){var s=Al.get(t);if(s)var o=s.get(null);else{s=new Map,Al.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=kl.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:H,Provider:null,Consumer:null,_currentValue:de,_currentValue2:de,_threadCount:0};function Qx(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 fy(t,a,s,o,u,p,y,x,A,L,I,Y){return t=new Qx(t,a,s,y,A,L,I,Y,x),a=1,p===!0&&(a|=24),p=nn(3,null,null,a),t.current=p,p.stateNode=t,a=Su(),a.refCount++,t.pooledCache=a,a.refCount++,p.memoizedState={element:o,isDehydrated:s,cache:a},Nu(p),t}function py(t){return t?(t=es,t):es}function my(t,a,s,o,u,p){u=py(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 hy(t,a){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var s=t.retryLane;t.retryLane=s!==0&&s<a?s:a}}function Gd(t,a){hy(t,a),(t=t.alternate)&&hy(t,a)}function gy(t){if(t.tag===13||t.tag===31){var a=si(t,67108864);a!==null&&Jt(a,t,67108864),Gd(t,67108864)}}function yy(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),Gd(t,a)}}var zl=!0;function Yx(t,a,s,o){var u=$.T;$.T=null;var p=F.p;try{F.p=2,Id(t,a,s,o)}finally{F.p=p,$.T=u}}function Xx(t,a,s,o){var u=$.T;$.T=null;var p=F.p;try{F.p=8,Id(t,a,s,o)}finally{F.p=p,$.T=u}}function Id(t,a,s,o){if(zl){var u=Hd(o);if(u===null)Cd(t,a,o,Cl,s),vy(t,o);else if(Fx(u,t,a,s,o))o.stopPropagation();else if(vy(t,o),a&4&&-1<Jx.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}Gn(p),(Ie&6)===0&&(dl=Lt()+500,Lr(0))}}break;case 31:case 13:x=si(p,2),x!==null&&Jt(x,p,2),pl(),Gd(p,2)}if(p=Hd(o),p===null&&Cd(t,a,o,Cl,s),p===u)break;u=p}u!==null&&o.stopPropagation()}else Cd(t,a,o,null,s)}}function Hd(t){return t=Pc(t),Zd(t)}var Cl=null;function Zd(t){if(Cl=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 Cl=t,null}function by(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(yo()){case er:return 2;case bo:return 8;case Mi:case Lc:return 32;case Bi:return 268435456;default:return 32}default:return 32}}var Pd=!1,Ba=null,La=null,qa=null,Hr=new Map,Zr=new Map,$a=[],Jx="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 vy(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&&gy(a)),t):(t.eventSystemFlags|=o,a=t.targetContainers,u!==null&&a.indexOf(u)===-1&&a.push(u),t)}function Fx(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 Sy(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,Rp(t.priority,function(){yy(s)});return}}else if(a===31){if(a=m(s),a!==null){t.blockedOn=a,Rp(t.priority,function(){yy(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 Tl(t){if(t.blockedOn!==null)return!1;for(var a=t.targetContainers;0<a.length;){var s=Hd(t.nativeEvent);if(s===null){s=t.nativeEvent;var o=new s.constructor(s.type,s);Zc=o,s.target.dispatchEvent(o),Zc=null}else return a=Ii(s),a!==null&&gy(a),t.blockedOn=s,!1;a.shift()}return!0}function xy(t,a,s){Tl(t)&&s.delete(a)}function Wx(){Pd=!1,Ba!==null&&Tl(Ba)&&(Ba=null),La!==null&&Tl(La)&&(La=null),qa!==null&&Tl(qa)&&(qa=null),Hr.forEach(xy),Zr.forEach(xy)}function El(t,a){t.blockedOn===a&&(t.blockedOn=null,Pd||(Pd=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,Wx)))}var Ol=null;function wy(t){Ol!==t&&(Ol=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Ol===t&&(Ol=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(Zd(o||s)===null)continue;break}var p=Ii(s);p!==null&&(t.splice(a,3),a-=3,Hu(p,{pending:!0,data:u,method:s.method,action:o},o,u))}}))}function Ns(t){function a(A){return El(A,t)}Ba!==null&&El(Ba,t),La!==null&&El(La,t),qa!==null&&El(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);)Sy(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||wy(s);else if(y){var x=null;if(p&&p.hasAttribute("formAction")){if(u=p,y=p[Zt]||null)x=y.formAction;else if(Zd(u)!==null)continue}else x=y.action;typeof x=="function"?s[o+1]=x:(s.splice(o,3),o-=3),wy(s)}}}function jy(){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 Kd(t){this._internalRoot=t}Dl.prototype.render=Kd.prototype.render=function(t){var a=this._internalRoot;if(a===null)throw Error(r(409));var s=a.current,o=ln();my(s,o,t,a,null,null)},Dl.prototype.unmount=Kd.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var a=t.containerInfo;my(t.current,2,null,t,null,null),pl(),a[Vi]=null}};function Dl(t){this._internalRoot=t}Dl.prototype.unstable_scheduleHydration=function(t){if(t){var a=Dp();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&&Sy(t)}};var Ny=n.version;if(Ny!=="19.2.4")throw Error(r(527,Ny,"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 ew={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:$,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Rl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Rl.isDisabled&&Rl.supportsFiber)try{ga=Rl.inject(ew),qt=Rl}catch{}}return Kr.createRoot=function(t,a){if(!l(t))throw Error(r(299));var s=!1,o="",u=Eh,p=Oh,y=Dh;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=fy(t,1,!1,null,null,s,o,null,u,p,y,jy),t[Vi]=a.current,zd(t),new Kd(a)},Kr.hydrateRoot=function(t,a,s){if(!l(t))throw Error(r(299));var o=!1,u="",p=Eh,y=Oh,x=Dh,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=fy(t,1,!0,a,s??null,o,u,A,p,y,x,jy),a.context=py(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,Fe(a,s),Gn(a),t[Vi]=a.current,zd(t),new Dl(a)},Kr.version="19.2.4",Kr}var zy;function vw(){if(zy)return Qd.exports;zy=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(),Qd.exports=bw(),Qd.exports}var Sw=vw();const xw={bodySerializer:e=>JSON.stringify(e,(n,i)=>typeof i=="bigint"?i.toString():i)},ww=({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 R=v.signal??new AbortController().signal;for(;!R.aborted;){T++;const G=v.headers instanceof Headers?v.headers:new Headers(v.headers);S!==void 0&&G.set("Last-Event-ID",S);try{const H={redirect:"follow",...v,body:v.serializedBody,headers:G,signal:R};let K=new Request(b,H);e&&(K=await e(b,H));const J=await(v.fetch??globalThis.fetch)(K);if(!J.ok)throw new Error(`SSE failed: ${J.status} ${J.statusText}`);if(!J.body)throw new Error("No body in SSE response");const D=J.body.pipeThrough(new TextDecoderStream).getReader();let M="";const oe=()=>{try{D.cancel()}catch{}};R.addEventListener("abort",oe);try{for(;;){const{done:Ne,value:Ae}=await D.read();if(Ne)break;M+=Ae;const ve=M.split(`
|
|
11
|
+
|
|
12
|
+
`);M=ve.pop()??"";for(const et of ve){const re=et.split(`
|
|
13
|
+
`),pe=[];let $;for(const je of re)if(je.startsWith("data:"))pe.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 ie=Number.parseInt(je.replace(/^retry:\s*/,""),10);Number.isNaN(ie)||(N=ie)}let F,de=!1;if(pe.length){const je=pe.join(`
|
|
14
|
+
`);try{F=JSON.parse(je),de=!0}catch{F=je}}de&&(l&&await l(F),r&&(F=await r(F))),i?.({data:F,event:$,id:S,retry:N}),pe.length&&(yield F)}}}finally{R.removeEventListener("abort",oe),D.releaseLock()}break}catch(H){if(n?.(H),d!==void 0&&T>=d)break;const K=Math.min(N*2**(T-1),m??3e4);await w(K)}}}()}},jw=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},Nw=e=>{switch(e){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},kw=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},nv=({allowReserved:e,explode:n,name:i,style:r,value:l})=>{if(!n){const m=(e?l:l.map(g=>encodeURIComponent(g))).join(Nw(r));switch(r){case"label":return`.${m}`;case"matrix":return`;${i}=${m}`;case"simple":return m;default:return`${i}=${m}`}}const c=jw(r),d=l.map(m=>r==="label"||r==="simple"?e?m:encodeURIComponent(m):fc({allowReserved:e,name:i,value:m})).join(c);return r==="label"||r==="matrix"?c+d:d},fc=({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)}`},av=({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=kw(r),m=Object.entries(l).map(([g,b])=>fc({allowReserved:e,name:r==="deepObject"?`${i}[${g}]`:g,value:b})).join(d);return r==="label"||r==="matrix"?d+m:m},Aw=/\{[^{}]+\}/g,_w=({path:e,url:n})=>{let i=n;const r=n.match(Aw);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,nv({explode:c,name:d,style:m,value:g}));continue}if(typeof g=="object"){i=i.replace(l,av({explode:c,name:d,style:m,value:g,valueOnly:!0}));continue}if(m==="matrix"){i=i.replace(l,`;${fc({name:d,value:g})}`);continue}const b=encodeURIComponent(m==="label"?`.${g}`:g);i=i.replace(l,b)}return i},zw=({baseUrl:e,path:n,query:i,querySerializer:r,url:l})=>{const c=l.startsWith("/")?l:`/${l}`;let d=(e??"")+c;n&&(d=_w({path:n,url:d}));let m=i?r(i):"";return m.startsWith("?")&&(m=m.substring(1)),m&&(d+=`?${m}`),d};function Cw(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 Tw=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},iv=({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=nv({allowReserved:e,explode:!0,name:d,style:"form",value:m,...n});g&&c.push(g)}else if(typeof m=="object"){const g=av({allowReserved:e,explode:!0,name:d,style:"deepObject",value:m,...i});g&&c.push(g)}else{const g=fc({allowReserved:e,name:d,value:m});g&&c.push(g)}}return c.join("&")},Ew=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"}},Ow=(e,n)=>n?!!(e.headers.has(n)||e.query?.[n]||e.headers.get("Cookie")?.includes(`${n}=`)):!1,Dw=async({security:e,...n})=>{for(const i of e){if(Ow(n,i.name))continue;const r=await Tw(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}}},Cy=e=>zw({baseUrl:e.baseUrl,path:e.path,query:e.query,querySerializer:typeof e.querySerializer=="function"?e.querySerializer:iv(e.querySerializer),url:e.url}),Ty=(e,n)=>{const i={...e,...n};return i.baseUrl?.endsWith("/")&&(i.baseUrl=i.baseUrl.substring(0,i.baseUrl.length-1)),i.headers=sv(e.headers,n.headers),i},Rw=e=>{const n=[];return e.forEach((i,r)=>{n.push([r,i])}),n},sv=(...e)=>{const n=new Headers;for(const i of e){if(!i)continue;const r=i instanceof Headers?Rw(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 Jd{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 Mw=()=>({error:new Jd,request:new Jd,response:new Jd}),Bw=iv({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),Lw={"Content-Type":"application/json"},rv=(e={})=>({...xw,headers:Lw,parseAs:"auto",querySerializer:Bw,...e}),ov=(e={})=>{let n=Ty(rv(),e);const i=()=>({...n}),r=b=>(n=Ty(n,b),i()),l=Mw(),c=async b=>{const v={...n,...b,fetch:b.fetch??n.fetch??globalThis.fetch,headers:sv(n.headers,b.headers),serializedBody:void 0};v.security&&await Dw({...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=Cy(v);return{opts:v,url:S}},d=async b=>{const{opts:v,url:S}=await c(b),w={redirect:"follow",...v,body:Cw(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"?Ew(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 J;switch(X){case"arrayBuffer":case"blob":case"formData":case"json":case"text":J=await N[X]();break;case"stream":return v.responseStyle==="data"?N.body:{data:N.body,...T}}return X==="json"&&(v.responseValidator&&await v.responseValidator(J),v.responseTransformer&&(J=await v.responseTransformer(J))),v.responseStyle==="data"?J:{data:J,...T}}const R=await N.text();let G;try{G=JSON.parse(R)}catch{}const H=G??R;let K=H;for(const X of l.error.fns)X&&(K=await X(H,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 ww({...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:Cy,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=ov(rv()),qw=e=>(e.client??W).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}",...e}),lv=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}",...e}),$w=e=>(e.client??W).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}",...e,headers:{"Content-Type":"application/json",...e.headers}}),Uw=e=>(e?.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects",...e}),Vw=e=>(e.client??W).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/locations",...e,headers:{"Content-Type":"application/json",...e.headers}}),Gw=e=>(e.client??W).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/locations/{label}",...e}),Iw=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}}),Hw=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/export",...e}),Zw=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/queries",...e}),Pw=e=>(e.client??W).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/queries",...e,headers:{"Content-Type":"application/json",...e.headers}}),Kw=e=>(e.client??W).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/queries",...e,headers:{"Content-Type":"application/json",...e.headers}}),Qw=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}}),Yw=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/competitors",...e}),Xw=e=>(e.client??W).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/competitors",...e,headers:{"Content-Type":"application/json",...e.headers}}),Jw=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/runs",...e}),Fw=e=>(e.client??W).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/runs",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ww=e=>(e?.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/runs",...e}),ej=e=>(e?.client??W).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/runs",...e,headers:{"Content-Type":"application/json",...e?.headers}}),cv=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/runs/{id}",...e}),tj=e=>(e.client??W).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/apply",...e,headers:{"Content-Type":"application/json",...e.headers}}),nj=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/timeline",...e}),uv=e=>(e?.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/settings",...e}),aj=e=>(e.client??W).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/settings/providers/{name}",...e,headers:{"Content-Type":"application/json",...e.headers}}),ij=e=>(e.client??W).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/settings/google",...e,headers:{"Content-Type":"application/json",...e.headers}}),sj=e=>(e.client??W).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/settings/bing",...e,headers:{"Content-Type":"application/json",...e.headers}}),rj=e=>(e.client??W).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/settings/cdp",...e,headers:{"Content-Type":"application/json",...e.headers}}),oj=e=>(e.client??W).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/schedule",...e}),lj=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/schedule",...e}),cj=e=>(e.client??W).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/schedule",...e,headers:{"Content-Type":"application/json",...e.headers}}),uj=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/notifications",...e}),dj=e=>(e.client??W).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/notifications",...e,headers:{"Content-Type":"application/json",...e.headers}}),fj=e=>(e.client??W).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/notifications/{id}",...e}),pj=e=>(e.client??W).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/notifications/{id}/test",...e}),mj=e=>(e?.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/cdp/status",...e}),hj=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/connections",...e}),gj=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}}),yj=e=>(e.client??W).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/connections/{type}",...e}),bj=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/properties",...e}),vj=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}}),Sj=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}}),xj=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}}),wj=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/performance",...e}),jj=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/performance/daily",...e}),Nj=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}}),kj=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/inspections",...e}),Aj=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/deindexed",...e}),dv=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/coverage",...e}),_j=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/coverage/history",...e}),zj=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/sitemaps",...e}),Cj=e=>(e.client??W).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/discover-sitemaps",...e}),Tj=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}}),Ej=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}}),Oj=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}}),Dj=e=>(e.client??W).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/disconnect",...e}),Rj=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/status",...e}),Mj=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/sites",...e}),Bj=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}}),fv=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/coverage",...e}),Lj=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/inspections",...e}),qj=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}}),$j=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}}),Uj=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}}),Vj=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/performance",...e}),Gj=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}}),Ij=e=>(e.client??W).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/ga/disconnect",...e}),Hj=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/ga/status",...e}),Zj=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}}),Pj=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/ga/traffic",...e}),Kj=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/ga/ai-referral-history",...e}),Qj=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/ga/social-referral-history",...e}),Yj=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/ga/session-history",...e}),Xj=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/insights",...e}),Jj=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/report",...e}),Fj=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/citations/visibility",...e}),Wj=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}}),eN=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/overview",...e}),tN=e=>(e?.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/backlinks/status",...e}),nN=e=>(e?.client??W).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/backlinks/install",...e}),aN=e=>(e?.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/backlinks/syncs",...e}),iN=e=>(e?.client??W).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/backlinks/syncs",...e,headers:{"Content-Type":"application/json",...e?.headers}}),sN=e=>(e?.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/backlinks/syncs/latest",...e}),rN=e=>(e?.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/backlinks/releases",...e}),oN=e=>(e?.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/backlinks/latest-release",...e}),lN=e=>(e.client??W).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/backlinks/cache/{release}",...e}),cN=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}}),uN=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/backlinks/summary",...e}),dN=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/backlinks/domains",...e}),fN=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/backlinks/history",...e}),pN=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}}),mN=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}}),hN=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}}),gN=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}}),yN=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/traffic/sources",...e}),bN=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/traffic/status",...e}),vN=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/traffic/sources/{id}",...e}),SN=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/traffic/events",...e}),xN=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}}),wN=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/discover/sessions",...e}),jN=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/discover/sessions/{id}",...e}),NN=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/discover/sessions/{id}/promote",...e}),kN=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}}),AN=e=>(e.client??W).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/agent/providers",...e});function _N(e){const n={baseUrl:e.baseUrl,fetch:e.fetch,headers:{...e.headers??{}}};return ov(n)}class In extends Error{code;statusCode;constructor(n,i,r){super(n),this.name="ApiError",this.code=r??"UNKNOWN",this.statusCode=i}}function zN(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,"")+"/api/v1":"/api/v1"}const pv=zN();function CN(){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 TN(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,""):""}function EN(e){return`${TN()}${e}`}function ON(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 DN(){return""}function Fd(){return!!DN()}let mv=null;function Ey(e){mv=e}function Bf(){mv?.()}const ae=_N({baseUrl:CN()});ae.interceptors.response.use((e,n)=>((e.status===401||e.status===403)&&!n.url.includes("/api/v1/session")&&Bf(),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 Lf(e,n){const i=n?.body!=null,r=await fetch(`${pv}${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")&&Bf(),new In(c,r.status,d)}if(r.status!==204)return r.json()}function qf(e){return ce(()=>lv({client:ae,path:{name:e}}))}function hR(e){return ce(()=>Jw({client:ae,path:{name:e}}))}function Fl(e){return ce(()=>cv({client:ae,path:{id:e}}))}function RN(e){return ce(()=>Zw({client:ae,path:{name:e}}))}function MN(e){return ce(()=>Yw({client:ae,path:{name:e}}))}function BN(e,n){return ce(()=>nj({client:ae,path:{name:e},query:{location:n}}))}function hv(e,n){return ce(()=>eN({client:ae,path:{name:e},query:{location:n?.location,since:n?.since}}))}function co(e,n){return ce(()=>$w({client:ae,path:{name:e},body:n}))}function LN(e,n){return ce(()=>Kw({client:ae,path:{name:e},body:{queries:n}}))}function qN(e,n){return ce(()=>Pw({client:ae,path:{name:e},body:{queries:n}}))}function $N(e,n){return ce(()=>Wj({client:ae,path:{name:e},body:n}))}function UN(e,n){return ce(()=>Xw({client:ae,path:{name:e},body:{competitors:n}}))}async function gR(e,n){const i=await qf(e);return co(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 yR(e,n){const i=await qf(e);return co(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 bR(e,n){const i=await qf(e);return co(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 VN(e,n){const i={};return n?.location&&(i.location=n.location),n?.allLocations&&(i.allLocations=!0),n?.noLocation&&(i.noLocation=!0),ce(()=>Fw({client:ae,path:{name:e},body:i}))}function vR(e,n){return ce(()=>Vw({client:ae,path:{name:e},body:n}))}async function SR(e,n){await ce(()=>Gw({client:ae,path:{name:e,label:n}}))}function xR(e,n){return ce(()=>Iw({client:ae,path:{name:e},body:{label:n}}))}async function wR(e){await ce(()=>qw({client:ae,path:{name:e}}))}function jR(e){return ce(()=>Hw({client:ae,path:{name:e}}))}function NR(){return ce(()=>uv({client:ae}))}function Oy(){return Lf("/session")}function GN(e){return Lf("/session/setup",{method:"POST",body:JSON.stringify({password:e})})}function IN(e){return Lf("/session",{method:"POST",body:JSON.stringify({password:e})})}function HN(e,n){return ce(()=>aj({client:ae,path:{name:e},body:n}))}function kR(e){return ce(()=>ij({client:ae,body:e}))}async function AR(e){try{return await ce(()=>lj({client:ae,path:{name:e}}))}catch(n){if(n instanceof In&&n.statusCode===404)return null;throw n}}function _R(e,n){return ce(()=>cj({client:ae,path:{name:e},body:n}))}async function zR(e){await ce(()=>oj({client:ae,path:{name:e}}))}function CR(e){return ce(()=>uj({client:ae,path:{name:e}}))}function TR(e,n){return ce(()=>dj({client:ae,path:{name:e},body:n}))}async function ER(e,n){await ce(()=>fj({client:ae,path:{name:e,id:n}}))}function OR(e,n){return ce(()=>pj({client:ae,path:{name:e,id:n}}))}function ZN(e,n,i){return ce(()=>Qw({client:ae,path:{name:e},body:{provider:n,count:i}}))}function PN(e){return ce(()=>tj({client:ae,body:e}))}function KN(e){return ce(()=>ej({client:ae,body:e??{}}))}function DR(e,n){return ce(()=>gj({client:ae,path:{name:e},body:{type:n}}))}function RR(e,n){return ce(()=>yj({client:ae,path:{name:e,type:n}}))}function MR(e,n,i){return ce(()=>vj({client:ae,path:{name:e,type:n},body:{propertyId:i}}))}function BR(e,n,i){return ce(()=>Sj({client:ae,path:{name:e,type:n},body:{sitemapUrl:i}}))}function QN(e,n){return ce(()=>xj({client:ae,path:{name:e},body:n??{}}))}function LR(e,n){return ce(()=>Nj({client:ae,path:{name:e},body:{url:n}}))}function YN(e){return ce(()=>dv({client:ae,path:{name:e}}))}function XN(e,n){return ce(()=>Tj({client:ae,path:{name:e},body:n??{}}))}function qR(e){return ce(()=>zj({client:ae,path:{name:e}}))}function JN(e){return ce(()=>Cj({client:ae,path:{name:e}}))}function $R(e,n){return ce(()=>xN({client:ae,path:{name:e},body:n??{}}))}function UR(e,n,i){return ce(()=>kN({client:ae,path:{name:e,id:n},body:i??{}}))}function VR(){return ce(()=>mj({client:ae}))}function GR(e,n){return ce(()=>rj({client:ae,body:{host:e,port:n}}))}function IR(e,n){return ce(()=>Ej({client:ae,path:{name:e},body:n}))}function HR(e,n){return ce(()=>Oj({client:ae,path:{name:e},body:{apiKey:n}}))}function ZR(e){return ce(()=>Dj({client:ae,path:{name:e}}))}function PR(e,n){return ce(()=>Bj({client:ae,path:{name:e},body:{siteUrl:n}}))}function FN(e){return ce(()=>fv({client:ae,path:{name:e}}))}function KR(e,n){return ce(()=>qj({client:ae,path:{name:e},body:{url:n}}))}function QR(e,n){return ce(()=>$j({client:ae,path:{name:e},body:{}}))}function YR(e,n){return ce(()=>Uj({client:ae,path:{name:e},body:n}))}function XR(e){return ce(()=>sj({client:ae,body:{apiKey:e}}))}function WN(e){return e?/filename\s*=\s*"?([^";]+)"?/i.exec(e)?.[1]??null:null}async function JR(e,n="agency"){const i=new URLSearchParams({audience:n}),r=await fetch(`${pv}/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=WN(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 FR(e,n){return ce(()=>Zj({client:ae,path:{name:e},body:{}}))}function WR(e,n){return ce(()=>Gj({client:ae,path:{name:e},body:n}))}function eM(e){return ce(()=>Ij({client:ae,path:{name:e}}))}function tM(e,n){return ce(()=>pN({client:ae,path:{name:e},body:n}))}function nM(e,n){return ce(()=>mN({client:ae,path:{name:e},body:n}))}function aM(e,n){return ce(()=>hN({client:ae,path:{name:e},body:n}))}function iM(e,n,i){return ce(()=>gN({client:ae,path:{name:e,id:n},body:i??{}}))}function ek(e,n){return ce(()=>Xj({client:ae,path:{name:e},query:{runId:n}}))}function tk(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 nk(e,n){const i=EN(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:ON(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=tk(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 sM(){return ce(()=>tN({client:ae}))}function rM(){return ce(()=>nN({client:ae}))}function oM(){return ce(()=>sN({client:ae}))}function lM(){return ce(()=>aN({client:ae}))}function cM(e){return ce(()=>iN({client:ae,body:e?{release:e}:{}}))}function uM(){return ce(()=>rN({client:ae}))}function dM(){return ce(()=>oN({client:ae}))}function fM(e){return ce(()=>lN({client:ae,path:{release:e}}))}function pM(e,n={}){return ce(()=>uN({client:ae,path:{name:e},query:{release:n.release,excludeCrawlers:n.excludeCrawlers?"1":void 0}}))}function mM(e,n={}){return ce(()=>dN({client:ae,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 hM(e){return ce(()=>fN({client:ae,path:{name:e}}))}function gM(e,n){return ce(()=>cN({client:ae,path:{name:e},body:{release:void 0}}))}function xn(e){return(...n)=>{e(...n)}}const ak=6e3,ik=5,sk=180;let $t=[],rk=0;const ff=new Set,pf=new Map,mf=new Map;function Wl(){const e=[...$t];for(const n of ff)n(e)}function $f(e){const n=pf.get(e);n&&(clearTimeout(n),pf.delete(e));const i=mf.get(e);i&&(clearTimeout(i),mf.delete(e))}function gv(e){$f(e);const n=$t.length;$t=$t.filter(i=>i.id!==e),$t.length!==n&&Wl()}function Dy(e){$f(e.id),pf.set(e.id,setTimeout(()=>{hf(e.id)},e.durationMs))}function ok(e,n,i){return typeof e=="string"?{title:e,tone:n,durationMs:i}:e}function un(e,n="negative",i=ak){const r=ok(e,n,i),l={id:String(++rk),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),Wl(),Dy(d),c.id}}return $t.length>=ik&&gv($t[0].id),$t=[...$t,l],Wl(),Dy(l),l.id}function hf(e){const n=$t.find(i=>i.id===e);!n||n.state==="closing"||($f(e),$t=$t.map(i=>i.id===e?{...i,state:"closing"}:i),Wl(),mf.set(e,setTimeout(()=>{gv(e)},sk)))}function lk(e){return ff.add(e),()=>{ff.delete(e)}}function Ry(){return $t}const ck=5*6e4,gf=30*6e4,yM=3e4,bM=6e4,io=3e4,uk=2e3,dk=5e3;function fk(){return new iw({defaultOptions:{queries:{staleTime:ck,retry:1,refetchOnWindowFocus:!1}},mutationCache:new sw({onError:(e,n,i,r)=>{r.meta?.skipGlobalErrorToast||un({title:e instanceof Error?e.message:"An unexpected error occurred",tone:"negative"})}})})}const pk="modulepreload",mk=function(e,n){return new URL(e,n).href},My={},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=mk(v,r),v in My)return;My[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":pk,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 hk=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),gk=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,i,r)=>r?r.toUpperCase():i.toLowerCase()),By=e=>{const n=gk(e);return n.charAt(0).toUpperCase()+n.slice(1)},yv=(...e)=>e.filter((n,i,r)=>!!n&&n.trim()!==""&&r.indexOf(n)===i).join(" ").trim(),yk=e=>{for(const n in e)if(n.startsWith("aria-")||n==="role"||n==="title")return!0};var bk={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 vk=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,...bk,width:n,height:n,stroke:e,strokeWidth:r?Number(i)*24/Number(n):i,className:yv("lucide",l),...!c&&!yk(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(vk,{ref:c,iconNode:n,className:yv(`lucide-${hk(By(e))}`,`lucide-${e}`,r),...l}));return i.displayName=By(e),i};const Sk=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],xk=at("arrow-right",Sk);const wk=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],jk=at("arrow-up",wk);const Nk=[["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"}]],kk=at("book-open",Nk);const Ak=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],bv=at("check",Ak);const _k=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],zk=at("chevron-down",_k);const Ck=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Uf=at("chevron-right",Ck);const Tk=[["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"}]],Ek=at("copy",Tk);const Ok=[["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"}]],Dk=at("file-text",Ok);const Rk=[["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"}]],Mk=at("github",Rk);const Bk=[["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"}]],Lk=at("globe",Bk);const qk=[["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"}]],$k=at("layout-dashboard",qk);const Uk=[["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"}]],Vk=at("link-2",Uk);const Gk=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Ik=at("loader-circle",Gk);const Hk=[["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"}]],Zk=at("maximize-2",Hk);const Pk=[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]],Kk=at("menu",Pk);const Qk=[["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"}]],Yk=at("minimize-2",Qk);const Xk=[["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"}]],Jk=at("play",Xk);const Fk=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Ly=at("plus",Fk);const Wk=[["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"}]],e2=at("radar",Wk);const t2=[["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"}]],n2=at("rocket",t2);const a2=[["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"}]],vv=at("rotate-ccw",a2);const i2=[["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"}]],s2=at("settings",i2);const r2=[["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"}]],qy=at("sparkles",r2);const o2=[["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"}]],Sv=at("triangle-alert",o2);const l2=[["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"}]],c2=at("wrench",l2);const u2=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Hs=at("x",u2);function Z(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 xv extends Error{constructor(n){super(`Encountered unidirectional transform during encode: ${n}`),this.name="ZodEncodeError"}}const wv={};function Za(e){return wv}function jv(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 yf(e,n){return typeof n=="bigint"?n.toString():n}function pc(e){return{get value(){{const n=e();return Object.defineProperty(this,"value",{value:n}),n}}}}function Vf(e){return e==null}function Gf(e){const n=e.startsWith("^")?1:0,i=e.endsWith("$")?e.length-1:e.length;return e.slice(n,i)}function d2(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 $y=Symbol("evaluating");function He(e,n,i){let r;Object.defineProperty(e,n,{get(){if(r!==$y)return r===void 0&&(r=$y,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 Uy(e){return JSON.stringify(e)}function f2(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Nv="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function so(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const p2=pc(()=>{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(so(e)===!1)return!1;const n=e.constructor;if(n===void 0||typeof n!="function")return!0;const i=n.prototype;return!(so(i)===!1||Object.prototype.hasOwnProperty.call(i,"isPrototypeOf")===!1)}function kv(e){return Ls(e)?{...e}:Array.isArray(e)?[...e]:e}const m2=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 be(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 h2(e){return Object.keys(e).filter(n=>e[n]._zod.optin==="optional"&&e[n]._zod.optout==="optional")}const g2={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 y2(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 b2(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 v2(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 S2(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 x2(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 w2(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 j2(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 Ml(e){return typeof e=="string"?e:e?.message}function Pa(e,n,i){const r={...e,path:e.path??[]};if(!e.message){const l=Ml(e.inst?._zod.def?.error?.(e))??Ml(n?.error?.(e))??Ml(i.customError?.(e))??Ml(i.localeError?.(e))??"Invalid input";r.message=l}return delete r.inst,delete r.continue,n?.reportInput||delete r.input,r}function If(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function ro(...e){const[n,i,r]=e;return typeof n=="string"?{message:n,code:"custom",input:i,inst:r}:{...n}}const Av=(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,yf,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},_v=Z("$ZodError",Av),zv=Z("$ZodError",Av,{Parent:Error});function N2(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 k2(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 Hf=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 Nv(m,l?.callee),m}return d.value},Zf=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 Nv(m,l?.callee),m}return d.value},mc=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??_v)(c.issues.map(d=>Pa(d,l,Za())))}:{success:!0,data:c.value}},A2=mc(zv),hc=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}},_2=hc(zv),z2=e=>(n,i,r)=>{const l=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Hf(e)(n,i,l)},C2=e=>(n,i,r)=>Hf(e)(n,i,r),T2=e=>async(n,i,r)=>{const l=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Zf(e)(n,i,l)},E2=e=>async(n,i,r)=>Zf(e)(n,i,r),O2=e=>(n,i,r)=>{const l=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return mc(e)(n,i,l)},D2=e=>(n,i,r)=>mc(e)(n,i,r),R2=e=>async(n,i,r)=>{const l=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return hc(e)(n,i,l)},M2=e=>async(n,i,r)=>hc(e)(n,i,r),B2=/^[cC][^\s-]{8,}$/,L2=/^[0-9a-z]+$/,q2=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,$2=/^[0-9a-vA-V]{20}$/,U2=/^[A-Za-z0-9]{27}$/,V2=/^[a-zA-Z0-9_-]{21}$/,G2=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,I2=/^([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})$/,Vy=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)$/,H2=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Z2="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function P2(){return new RegExp(Z2,"u")}const K2=/^(?:(?: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])$/,Q2=/^(([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}|:))$/,Y2=/^((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])$/,X2=/^(([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])$/,J2=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Cv=/^[A-Za-z0-9_-]*$/,F2=/^\+[1-9]\d{6,14}$/,Tv="(?:(?:\\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])))",W2=new RegExp(`^${Tv}$`);function Ev(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 eA(e){return new RegExp(`^${Ev(e)}$`)}function tA(e){const n=Ev({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(`^${Tv}T(?:${r})$`)}const nA=e=>{const n=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${n}$`)},aA=/^-?\d+$/,Ov=/^-?\d+(?:\.\d+)?$/,iA=/^(?:true|false)$/i,sA=/^[^A-Z]*$/,rA=/^[^a-z]*$/,en=Z("$ZodCheck",(e,n)=>{var i;e._zod??(e._zod={}),e._zod.def=n,(i=e._zod).onattach??(i.onattach=[])}),Dv={number:"number",bigint:"bigint",object:"date"},Rv=Z("$ZodCheckLessThan",(e,n)=>{en.init(e,n);const i=Dv[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})}}),Mv=Z("$ZodCheckGreaterThan",(e,n)=>{en.init(e,n);const i=Dv[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})}}),oA=Z("$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):d2(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})}}),lA=Z("$ZodCheckNumberFormat",(e,n)=>{en.init(e,n),n.format=n.format||"float64";const i=n.format?.includes("int"),r=i?"int":"number",[l,c]=g2[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=aA)}),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})}}),cA=Z("$ZodCheckMaxLength",(e,n)=>{var i;en.init(e,n),(i=e._zod.def).when??(i.when=r=>{const l=r.value;return!Vf(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=If(l);r.issues.push({origin:d,code:"too_big",maximum:n.maximum,inclusive:!0,input:l,inst:e,continue:!n.abort})}}),uA=Z("$ZodCheckMinLength",(e,n)=>{var i;en.init(e,n),(i=e._zod.def).when??(i.when=r=>{const l=r.value;return!Vf(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=If(l);r.issues.push({origin:d,code:"too_small",minimum:n.minimum,inclusive:!0,input:l,inst:e,continue:!n.abort})}}),dA=Z("$ZodCheckLengthEquals",(e,n)=>{var i;en.init(e,n),(i=e._zod.def).when??(i.when=r=>{const l=r.value;return!Vf(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=If(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})}}),gc=Z("$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=()=>{})}),fA=Z("$ZodCheckRegex",(e,n)=>{gc.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})}}),pA=Z("$ZodCheckLowerCase",(e,n)=>{n.pattern??(n.pattern=sA),gc.init(e,n)}),mA=Z("$ZodCheckUpperCase",(e,n)=>{n.pattern??(n.pattern=rA),gc.init(e,n)}),hA=Z("$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})}}),gA=Z("$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})}}),yA=Z("$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})}}),bA=Z("$ZodCheckOverwrite",(e,n)=>{en.init(e,n),e._zod.check=i=>{i.value=n.tx(i.value)}});class vA{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 SA={major:4,minor:3,patch:6},ct=Z("$ZodType",(e,n)=>{var i;e??(e={}),e._zod.def=n,e._zod.bag=e._zod.bag||{},e._zod.version=SA;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=A2(e,l);return c.success?{value:c.data}:{issues:c.error?.issues}}catch{return _2(e,l).then(d=>d.success?{value:d.data}:{issues:d.error?.issues})}},vendor:"zod",version:1}))}),Pf=Z("$ZodString",(e,n)=>{ct.init(e,n),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??nA(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=Z("$ZodStringFormat",(e,n)=>{gc.init(e,n),Pf.init(e,n)}),xA=Z("$ZodGUID",(e,n)=>{n.pattern??(n.pattern=I2),lt.init(e,n)}),wA=Z("$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=Vy(r))}else n.pattern??(n.pattern=Vy());lt.init(e,n)}),jA=Z("$ZodEmail",(e,n)=>{n.pattern??(n.pattern=H2),lt.init(e,n)}),NA=Z("$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})}}}),kA=Z("$ZodEmoji",(e,n)=>{n.pattern??(n.pattern=P2()),lt.init(e,n)}),AA=Z("$ZodNanoID",(e,n)=>{n.pattern??(n.pattern=V2),lt.init(e,n)}),_A=Z("$ZodCUID",(e,n)=>{n.pattern??(n.pattern=B2),lt.init(e,n)}),zA=Z("$ZodCUID2",(e,n)=>{n.pattern??(n.pattern=L2),lt.init(e,n)}),CA=Z("$ZodULID",(e,n)=>{n.pattern??(n.pattern=q2),lt.init(e,n)}),TA=Z("$ZodXID",(e,n)=>{n.pattern??(n.pattern=$2),lt.init(e,n)}),EA=Z("$ZodKSUID",(e,n)=>{n.pattern??(n.pattern=U2),lt.init(e,n)}),OA=Z("$ZodISODateTime",(e,n)=>{n.pattern??(n.pattern=tA(n)),lt.init(e,n)}),DA=Z("$ZodISODate",(e,n)=>{n.pattern??(n.pattern=W2),lt.init(e,n)}),RA=Z("$ZodISOTime",(e,n)=>{n.pattern??(n.pattern=eA(n)),lt.init(e,n)}),MA=Z("$ZodISODuration",(e,n)=>{n.pattern??(n.pattern=G2),lt.init(e,n)}),BA=Z("$ZodIPv4",(e,n)=>{n.pattern??(n.pattern=K2),lt.init(e,n),e._zod.bag.format="ipv4"}),LA=Z("$ZodIPv6",(e,n)=>{n.pattern??(n.pattern=Q2),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})}}}),qA=Z("$ZodCIDRv4",(e,n)=>{n.pattern??(n.pattern=Y2),lt.init(e,n)}),$A=Z("$ZodCIDRv6",(e,n)=>{n.pattern??(n.pattern=X2),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 Bv(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const UA=Z("$ZodBase64",(e,n)=>{n.pattern??(n.pattern=J2),lt.init(e,n),e._zod.bag.contentEncoding="base64",e._zod.check=i=>{Bv(i.value)||i.issues.push({code:"invalid_format",format:"base64",input:i.value,inst:e,continue:!n.abort})}});function VA(e){if(!Cv.test(e))return!1;const n=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),i=n.padEnd(Math.ceil(n.length/4)*4,"=");return Bv(i)}const GA=Z("$ZodBase64URL",(e,n)=>{n.pattern??(n.pattern=Cv),lt.init(e,n),e._zod.bag.contentEncoding="base64url",e._zod.check=i=>{VA(i.value)||i.issues.push({code:"invalid_format",format:"base64url",input:i.value,inst:e,continue:!n.abort})}}),IA=Z("$ZodE164",(e,n)=>{n.pattern??(n.pattern=F2),lt.init(e,n)});function HA(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 ZA=Z("$ZodJWT",(e,n)=>{lt.init(e,n),e._zod.check=i=>{HA(i.value,n.alg)||i.issues.push({code:"invalid_format",format:"jwt",input:i.value,inst:e,continue:!n.abort})}}),Lv=Z("$ZodNumber",(e,n)=>{ct.init(e,n),e._zod.pattern=e._zod.bag.pattern??Ov,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}}),PA=Z("$ZodNumberFormat",(e,n)=>{lA.init(e,n),Lv.init(e,n)}),KA=Z("$ZodBoolean",(e,n)=>{ct.init(e,n),e._zod.pattern=iA,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}}),QA=Z("$ZodUnknown",(e,n)=>{ct.init(e,n),e._zod.parse=i=>i}),YA=Z("$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 Gy(e,n,i){e.issues.length&&n.issues.push(...Cs(i,e.issues)),n.value[i]=e.value}const XA=Z("$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=>Gy(b,i,d))):Gy(g,i,d)}return c.length?Promise.all(c).then(()=>i):i}});function ec(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 qv(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=h2(e.shape);return{...e,keys:n,keySet:new Set(n),numKeys:n.length,optionalKeys:new Set(i)}}function $v(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(_=>ec(_,i,S,n,v))):ec(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 JA=Z("$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=pc(()=>qv(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=so,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=>ec(T,m,w,b,C))):ec(N,m,w,b,C)}return c?$v(v,b,m,g,r.value,e):v.length?Promise.all(v).then(()=>m):m}}),FA=Z("$ZodObjectJIT",(e,n)=>{JA.init(e,n);const i=e._zod.parse,r=pc(()=>qv(n)),l=w=>{const _=new vA(["shape","payload","ctx"]),C=r.value,N=H=>{const K=Uy(H);return`shape[${K}]._zod.run({ value: input[${K}], issues: [] }, ctx)`};_.write("const input = payload.value;");const T=Object.create(null);let R=0;for(const H of C.keys)T[H]=`key_${R++}`;_.write("const newResult = {};");for(const H of C.keys){const K=T[H],X=Uy(H),D=w[H]?._zod?.optout==="optional";_.write(`const ${K} = ${N(H)};`),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 G=_.compile();return(H,K)=>G(w,H,K)};let c;const d=so,m=!wv.jitless,b=m&&p2.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?$v([],C,w,_,S,e):w):i(w,_):(w.issues.push({expected:"object",code:"invalid_type",input:C,inst:e}),w)}});function Iy(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 Uv=Z("$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=>Gf(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=>Iy(g,l,e,c)):Iy(m,l,e,c)}}),WA=Z("$ZodDiscriminatedUnion",(e,n)=>{n.inclusive=!1,Uv.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=pc(()=>{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(!so(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)}}),e_=Z("$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])=>Hy(i,g,b)):Hy(i,c,d)}});function bf(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=bf(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=bf(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 Hy(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=bf(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 t_=Z("$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"&&Ov.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}}),n_=Z("$ZodEnum",(e,n)=>{ct.init(e,n);const i=jv(n.entries),r=new Set(i);e._zod.values=r,e._zod.pattern=new RegExp(`^(${i.filter(l=>m2.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}}),a_=Z("$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}}),i_=Z("$ZodTransform",(e,n)=>{ct.init(e,n),e._zod.parse=(i,r)=>{if(r.direction==="backward")throw new xv(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 Zy(e,n){return e.issues.length&&n===void 0?{issues:[],value:void 0}:e}const Vv=Z("$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(`^(${Gf(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=>Zy(c,i.value)):Zy(l,i.value)}return i.value===void 0?i:n.innerType._zod.run(i,r)}}),s_=Z("$ZodExactOptional",(e,n)=>{Vv.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)}),r_=Z("$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(`^(${Gf(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)}),o_=Z("$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=>Py(c,n)):Py(l,n)}});function Py(e,n){return e.value===void 0&&(e.value=n.defaultValue),e}const l_=Z("$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))}),c_=Z("$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=>Ky(c,e)):Ky(l,e)}});function Ky(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 u_=Z("$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)}}),d_=Z("$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=>Bl(d,n.in,r)):Bl(c,n.in,r)}const l=n.in._zod.run(i,r);return l instanceof Promise?l.then(c=>Bl(c,n.out,r)):Bl(l,n.out,r)}});function Bl(e,n,i){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:e.value,issues:e.issues},i)}const f_=Z("$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(Qy):Qy(l)}});function Qy(e){return e.value=Object.freeze(e.value),e}const p_=Z("$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=>Yy(c,i,r,e));Yy(l,i,r,e)}});function Yy(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(ro(l))}}var Xy;class m_{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 h_(){return new m_}(Xy=globalThis).__zod_globalRegistry??(Xy.__zod_globalRegistry=h_());const eo=globalThis.__zod_globalRegistry;function g_(e,n){return new e({type:"string",...be(n)})}function y_(e,n){return new e({type:"string",format:"email",check:"string_format",abort:!1,...be(n)})}function Jy(e,n){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...be(n)})}function b_(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...be(n)})}function v_(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...be(n)})}function S_(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...be(n)})}function x_(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...be(n)})}function w_(e,n){return new e({type:"string",format:"url",check:"string_format",abort:!1,...be(n)})}function j_(e,n){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...be(n)})}function N_(e,n){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...be(n)})}function k_(e,n){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...be(n)})}function A_(e,n){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...be(n)})}function __(e,n){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...be(n)})}function z_(e,n){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...be(n)})}function C_(e,n){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...be(n)})}function T_(e,n){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...be(n)})}function E_(e,n){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...be(n)})}function O_(e,n){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...be(n)})}function D_(e,n){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...be(n)})}function R_(e,n){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...be(n)})}function M_(e,n){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...be(n)})}function B_(e,n){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...be(n)})}function L_(e,n){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...be(n)})}function q_(e,n){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...be(n)})}function $_(e,n){return new e({type:"string",format:"date",check:"string_format",...be(n)})}function U_(e,n){return new e({type:"string",format:"time",check:"string_format",precision:null,...be(n)})}function V_(e,n){return new e({type:"string",format:"duration",check:"string_format",...be(n)})}function G_(e,n){return new e({type:"number",checks:[],...be(n)})}function I_(e,n){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...be(n)})}function H_(e,n){return new e({type:"boolean",...be(n)})}function Z_(e){return new e({type:"unknown"})}function P_(e,n){return new e({type:"never",...be(n)})}function Fy(e,n){return new Rv({check:"less_than",...be(n),value:e,inclusive:!1})}function Wd(e,n){return new Rv({check:"less_than",...be(n),value:e,inclusive:!0})}function Wy(e,n){return new Mv({check:"greater_than",...be(n),value:e,inclusive:!1})}function ef(e,n){return new Mv({check:"greater_than",...be(n),value:e,inclusive:!0})}function eb(e,n){return new oA({check:"multiple_of",...be(n),value:e})}function Gv(e,n){return new cA({check:"max_length",...be(n),maximum:e})}function tc(e,n){return new uA({check:"min_length",...be(n),minimum:e})}function Iv(e,n){return new dA({check:"length_equals",...be(n),length:e})}function K_(e,n){return new fA({check:"string_format",format:"regex",...be(n),pattern:e})}function Q_(e){return new pA({check:"string_format",format:"lowercase",...be(e)})}function Y_(e){return new mA({check:"string_format",format:"uppercase",...be(e)})}function X_(e,n){return new hA({check:"string_format",format:"includes",...be(n),includes:e})}function J_(e,n){return new gA({check:"string_format",format:"starts_with",...be(n),prefix:e})}function F_(e,n){return new yA({check:"string_format",format:"ends_with",...be(n),suffix:e})}function Zs(e){return new bA({check:"overwrite",tx:e})}function W_(e){return Zs(n=>n.normalize(e))}function ez(){return Zs(e=>e.trim())}function tz(){return Zs(e=>e.toLowerCase())}function nz(){return Zs(e=>e.toUpperCase())}function az(){return Zs(e=>f2(e))}function iz(e,n,i){return new e({type:"array",element:n,...be(i)})}function sz(e,n,i){return new e({type:"custom",check:"custom",fn:n,...be(i)})}function rz(e){const n=oz(i=>(i.addIssue=r=>{if(typeof r=="string")i.issues.push(ro(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(ro(l))}},e(i.value,i)));return n}function oz(e,n){const i=new en({check:"custom",...be(n)});return i._zod.check=e,i}function Hv(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 Zv(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 Pv(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:nc(n,"input",e.processors),output:nc(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 lz=(e,n={})=>i=>{const r=Hv({...i,processors:n});return Nt(e,r),Zv(r,e),Pv(r,e)},nc=(e,n,i={})=>r=>{const{libraryOptions:l,target:c}=r??{},d=Hv({...l??{},target:c,io:n,processors:i});return Nt(e,d),Zv(d,e),Pv(d,e)},cz={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},uz=(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=cz[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}))])}},dz=(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)},fz=(e,n,i,r)=>{i.type="boolean"},pz=(e,n,i,r)=>{i.not={}},mz=(e,n,i,r)=>{},hz=(e,n,i,r)=>{const l=e._zod.def,c=jv(l.entries);c.every(d=>typeof d=="number")&&(i.type="number"),c.every(d=>typeof d=="string")&&(i.type="string"),i.enum=c},gz=(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},yz=(e,n,i,r)=>{if(n.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},bz=(e,n,i,r)=>{if(n.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},vz=(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"]})},Sz=(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)},xz=(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},wz=(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},jz=(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)}},Nz=(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"}]},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},Az=(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))},_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,n.io==="input"&&(i._prefault=JSON.parse(JSON.stringify(l.defaultValue)))},zz=(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},Cz=(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},Tz=(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},Kv=(e,n,i,r)=>{const l=e._zod.def;Nt(l.innerType,n,r);const c=n.seen.get(e);c.ref=l.innerType},Ez=Z("ZodISODateTime",(e,n)=>{OA.init(e,n),dt.init(e,n)});function Oz(e){return q_(Ez,e)}const Dz=Z("ZodISODate",(e,n)=>{DA.init(e,n),dt.init(e,n)});function Rz(e){return $_(Dz,e)}const Mz=Z("ZodISOTime",(e,n)=>{RA.init(e,n),dt.init(e,n)});function Bz(e){return U_(Mz,e)}const Lz=Z("ZodISODuration",(e,n)=>{MA.init(e,n),dt.init(e,n)});function qz(e){return V_(Lz,e)}const $z=(e,n)=>{_v.init(e,n),e.name="ZodError",Object.defineProperties(e,{format:{value:i=>k2(e,i)},flatten:{value:i=>N2(e,i)},addIssue:{value:i=>{e.issues.push(i),e.message=JSON.stringify(e.issues,yf,2)}},addIssues:{value:i=>{e.issues.push(...i),e.message=JSON.stringify(e.issues,yf,2)}},isEmpty:{get(){return e.issues.length===0}}})},An=Z("ZodError",$z,{Parent:Error}),Uz=Hf(An),Vz=Zf(An),Gz=mc(An),Iz=hc(An),Hz=z2(An),Zz=C2(An),Pz=T2(An),Kz=E2(An),Qz=O2(An),Yz=D2(An),Xz=R2(An),Jz=M2(An),ut=Z("ZodType",(e,n)=>(ct.init(e,n),Object.assign(e["~standard"],{jsonSchema:{input:nc(e,"input"),output:nc(e,"output")}}),e.toJSONSchema=lz(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)=>Uz(e,i,r,{callee:e.parse}),e.safeParse=(i,r)=>Gz(e,i,r),e.parseAsync=async(i,r)=>Vz(e,i,r,{callee:e.parseAsync}),e.safeParseAsync=async(i,r)=>Iz(e,i,r),e.spa=e.safeParseAsync,e.encode=(i,r)=>Hz(e,i,r),e.decode=(i,r)=>Zz(e,i,r),e.encodeAsync=async(i,r)=>Pz(e,i,r),e.decodeAsync=async(i,r)=>Kz(e,i,r),e.safeEncode=(i,r)=>Qz(e,i,r),e.safeDecode=(i,r)=>Yz(e,i,r),e.safeEncodeAsync=async(i,r)=>Xz(e,i,r),e.safeDecodeAsync=async(i,r)=>Jz(e,i,r),e.refine=(i,r)=>e.check(HC(i,r)),e.superRefine=i=>e.check(ZC(i)),e.overwrite=i=>e.check(Zs(i)),e.optional=()=>ab(e),e.exactOptional=()=>EC(e),e.nullable=()=>ib(e),e.nullish=()=>ab(ib(e)),e.nonoptional=i=>LC(e,i),e.array=()=>E(e),e.or=i=>Jv([e,i]),e.and=i=>kC(e,i),e.transform=i=>sb(e,CC(i)),e.default=i=>RC(e,i),e.prefault=i=>BC(e,i),e.catch=i=>$C(e,i),e.pipe=i=>sb(e,i),e.readonly=()=>GC(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)),Qv=Z("_ZodString",(e,n)=>{Pf.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(r,l,c)=>uz(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(K_(...r)),e.includes=(...r)=>e.check(X_(...r)),e.startsWith=(...r)=>e.check(J_(...r)),e.endsWith=(...r)=>e.check(F_(...r)),e.min=(...r)=>e.check(tc(...r)),e.max=(...r)=>e.check(Gv(...r)),e.length=(...r)=>e.check(Iv(...r)),e.nonempty=(...r)=>e.check(tc(1,...r)),e.lowercase=r=>e.check(Q_(r)),e.uppercase=r=>e.check(Y_(r)),e.trim=()=>e.check(ez()),e.normalize=(...r)=>e.check(W_(...r)),e.toLowerCase=()=>e.check(tz()),e.toUpperCase=()=>e.check(nz()),e.slugify=()=>e.check(az())}),Fz=Z("ZodString",(e,n)=>{Pf.init(e,n),Qv.init(e,n),e.email=i=>e.check(y_(Wz,i)),e.url=i=>e.check(w_(eC,i)),e.jwt=i=>e.check(L_(hC,i)),e.emoji=i=>e.check(j_(tC,i)),e.guid=i=>e.check(Jy(tb,i)),e.uuid=i=>e.check(b_(Ll,i)),e.uuidv4=i=>e.check(v_(Ll,i)),e.uuidv6=i=>e.check(S_(Ll,i)),e.uuidv7=i=>e.check(x_(Ll,i)),e.nanoid=i=>e.check(N_(nC,i)),e.guid=i=>e.check(Jy(tb,i)),e.cuid=i=>e.check(k_(aC,i)),e.cuid2=i=>e.check(A_(iC,i)),e.ulid=i=>e.check(__(sC,i)),e.base64=i=>e.check(R_(fC,i)),e.base64url=i=>e.check(M_(pC,i)),e.xid=i=>e.check(z_(rC,i)),e.ksuid=i=>e.check(C_(oC,i)),e.ipv4=i=>e.check(T_(lC,i)),e.ipv6=i=>e.check(E_(cC,i)),e.cidrv4=i=>e.check(O_(uC,i)),e.cidrv6=i=>e.check(D_(dC,i)),e.e164=i=>e.check(B_(mC,i)),e.datetime=i=>e.check(Oz(i)),e.date=i=>e.check(Rz(i)),e.time=i=>e.check(Bz(i)),e.duration=i=>e.check(qz(i))});function h(e){return g_(Fz,e)}const dt=Z("ZodStringFormat",(e,n)=>{lt.init(e,n),Qv.init(e,n)}),Wz=Z("ZodEmail",(e,n)=>{jA.init(e,n),dt.init(e,n)}),tb=Z("ZodGUID",(e,n)=>{xA.init(e,n),dt.init(e,n)}),Ll=Z("ZodUUID",(e,n)=>{wA.init(e,n),dt.init(e,n)}),eC=Z("ZodURL",(e,n)=>{NA.init(e,n),dt.init(e,n)}),tC=Z("ZodEmoji",(e,n)=>{kA.init(e,n),dt.init(e,n)}),nC=Z("ZodNanoID",(e,n)=>{AA.init(e,n),dt.init(e,n)}),aC=Z("ZodCUID",(e,n)=>{_A.init(e,n),dt.init(e,n)}),iC=Z("ZodCUID2",(e,n)=>{zA.init(e,n),dt.init(e,n)}),sC=Z("ZodULID",(e,n)=>{CA.init(e,n),dt.init(e,n)}),rC=Z("ZodXID",(e,n)=>{TA.init(e,n),dt.init(e,n)}),oC=Z("ZodKSUID",(e,n)=>{EA.init(e,n),dt.init(e,n)}),lC=Z("ZodIPv4",(e,n)=>{BA.init(e,n),dt.init(e,n)}),cC=Z("ZodIPv6",(e,n)=>{LA.init(e,n),dt.init(e,n)}),uC=Z("ZodCIDRv4",(e,n)=>{qA.init(e,n),dt.init(e,n)}),dC=Z("ZodCIDRv6",(e,n)=>{$A.init(e,n),dt.init(e,n)}),fC=Z("ZodBase64",(e,n)=>{UA.init(e,n),dt.init(e,n)}),pC=Z("ZodBase64URL",(e,n)=>{GA.init(e,n),dt.init(e,n)}),mC=Z("ZodE164",(e,n)=>{IA.init(e,n),dt.init(e,n)}),hC=Z("ZodJWT",(e,n)=>{ZA.init(e,n),dt.init(e,n)}),Yv=Z("ZodNumber",(e,n)=>{Lv.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(r,l,c)=>dz(e,r,l),e.gt=(r,l)=>e.check(Wy(r,l)),e.gte=(r,l)=>e.check(ef(r,l)),e.min=(r,l)=>e.check(ef(r,l)),e.lt=(r,l)=>e.check(Fy(r,l)),e.lte=(r,l)=>e.check(Wd(r,l)),e.max=(r,l)=>e.check(Wd(r,l)),e.int=r=>e.check(nb(r)),e.safe=r=>e.check(nb(r)),e.positive=r=>e.check(Wy(0,r)),e.nonnegative=r=>e.check(ef(0,r)),e.negative=r=>e.check(Fy(0,r)),e.nonpositive=r=>e.check(Wd(0,r)),e.multipleOf=(r,l)=>e.check(eb(r,l)),e.step=(r,l)=>e.check(eb(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 G_(Yv,e)}const gC=Z("ZodNumberFormat",(e,n)=>{PA.init(e,n),Yv.init(e,n)});function nb(e){return I_(gC,e)}const yC=Z("ZodBoolean",(e,n)=>{KA.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(i,r,l)=>fz(e,i,r)});function ye(e){return H_(yC,e)}const bC=Z("ZodUnknown",(e,n)=>{QA.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(i,r,l)=>mz()});function wi(){return Z_(bC)}const vC=Z("ZodNever",(e,n)=>{YA.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(i,r,l)=>pz(e,i,r)});function SC(e){return P_(vC,e)}const xC=Z("ZodArray",(e,n)=>{XA.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(i,r,l)=>vz(e,i,r,l),e.element=n.element,e.min=(i,r)=>e.check(tc(i,r)),e.nonempty=i=>e.check(tc(1,i)),e.max=(i,r)=>e.check(Gv(i,r)),e.length=(i,r)=>e.check(Iv(i,r)),e.unwrap=()=>e.element});function E(e,n){return iz(xC,e,n)}const wC=Z("ZodObject",(e,n)=>{FA.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(i,r,l)=>Sz(e,i,r,l),He(e,"shape",()=>n.shape),e.keyof=()=>se(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:SC()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=i=>v2(e,i),e.safeExtend=i=>S2(e,i),e.merge=i=>x2(e,i),e.pick=i=>y2(e,i),e.omit=i=>b2(e,i),e.partial=(...i)=>w2(Wv,e,i[0]),e.required=(...i)=>j2(e0,e,i[0])});function k(e,n){const i={type:"object",shape:e??{},...be(n)};return new wC(i)}const Xv=Z("ZodUnion",(e,n)=>{Uv.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(i,r,l)=>xz(e,i,r,l),e.options=n.options});function Jv(e,n){return new Xv({type:"union",options:e,...be(n)})}const jC=Z("ZodDiscriminatedUnion",(e,n)=>{Xv.init(e,n),WA.init(e,n)});function Fv(e,n,i){return new jC({type:"union",options:n,discriminator:e,...be(i)})}const NC=Z("ZodIntersection",(e,n)=>{e_.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(i,r,l)=>wz(e,i,r,l)});function kC(e,n){return new NC({type:"intersection",left:e,right:n})}const AC=Z("ZodRecord",(e,n)=>{t_.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(i,r,l)=>jz(e,i,r,l),e.keyType=n.keyType,e.valueType=n.valueType});function Zn(e,n,i){return new AC({type:"record",keyType:e,valueType:n,...be(i)})}const vf=Z("ZodEnum",(e,n)=>{n_.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(r,l,c)=>hz(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 vf({...n,checks:[],...be(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 vf({...n,checks:[],...be(l),entries:c})}});function se(e,n){const i=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new vf({type:"enum",entries:i,...be(n)})}const _C=Z("ZodLiteral",(e,n)=>{a_.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(i,r,l)=>gz(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 _C({type:"literal",values:Array.isArray(e)?e:[e],...be(n)})}const zC=Z("ZodTransform",(e,n)=>{i_.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(i,r,l)=>bz(e,i),e._zod.parse=(i,r)=>{if(r.direction==="backward")throw new xv(e.constructor.name);i.addIssue=c=>{if(typeof c=="string")i.issues.push(ro(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(ro(d))}};const l=n.transform(i.value,i);return l instanceof Promise?l.then(c=>(i.value=c,i)):(i.value=l,i)}});function CC(e){return new zC({type:"transform",transform:e})}const Wv=Z("ZodOptional",(e,n)=>{Vv.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(i,r,l)=>Kv(e,i,r,l),e.unwrap=()=>e._zod.def.innerType});function ab(e){return new Wv({type:"optional",innerType:e})}const TC=Z("ZodExactOptional",(e,n)=>{s_.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(i,r,l)=>Kv(e,i,r,l),e.unwrap=()=>e._zod.def.innerType});function EC(e){return new TC({type:"optional",innerType:e})}const OC=Z("ZodNullable",(e,n)=>{r_.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 ib(e){return new OC({type:"nullable",innerType:e})}const DC=Z("ZodDefault",(e,n)=>{o_.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(i,r,l)=>Az(e,i,r,l),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function RC(e,n){return new DC({type:"default",innerType:e,get defaultValue(){return typeof n=="function"?n():kv(n)}})}const MC=Z("ZodPrefault",(e,n)=>{l_.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 BC(e,n){return new MC({type:"prefault",innerType:e,get defaultValue(){return typeof n=="function"?n():kv(n)}})}const e0=Z("ZodNonOptional",(e,n)=>{c_.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(i,r,l)=>kz(e,i,r,l),e.unwrap=()=>e._zod.def.innerType});function LC(e,n){return new e0({type:"nonoptional",innerType:e,...be(n)})}const qC=Z("ZodCatch",(e,n)=>{u_.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(i,r,l)=>zz(e,i,r,l),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function $C(e,n){return new qC({type:"catch",innerType:e,catchValue:typeof n=="function"?n:()=>n})}const UC=Z("ZodPipe",(e,n)=>{d_.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(i,r,l)=>Cz(e,i,r,l),e.in=n.in,e.out=n.out});function sb(e,n){return new UC({type:"pipe",in:e,out:n})}const VC=Z("ZodReadonly",(e,n)=>{f_.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(i,r,l)=>Tz(e,i,r,l),e.unwrap=()=>e._zod.def.innerType});function GC(e){return new VC({type:"readonly",innerType:e})}const IC=Z("ZodCustom",(e,n)=>{p_.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(i,r,l)=>yz(e,i)});function HC(e,n={}){return sz(IC,e,n)}function ZC(e){return rz(e)}const PC=k({maxConcurrency:j().int().positive(),maxRequestsPerMinute:j().int().positive(),maxRequestsPerDay:j().int().positive()}),ha=h().min(1);h().min(1);const Kf=k({label:h().min(1),city:h().min(1),region:h().min(1),country:h().length(2),timezone:h().optional()}),Qf=se(["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(Qf),enabled:ye().default(!0),source:h().optional(),webhookSecret:h().optional(),createdAt:h(),updatedAt:h()});k({channel:Wt("webhook"),url:h().url(),events:E(Qf).min(1),source:h().optional()});const t0=se(["cli","api","config-file"]);function KC(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 QC(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(Kf).optional(),defaultLocation:h().nullable().optional(),autoExtractBacklinks:ye().optional(),configSource:t0.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(Kf).default([]),defaultLocation:h().nullable().optional(),autoExtractBacklinks:ye().default(!1),configSource:t0.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 ac(e){let n=e.trim().toLowerCase();try{n.includes("://")&&(n=new URL(n).hostname.toLowerCase())}catch{}return n.replace(/^www\./,"")}const YC=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 XC(e){const n=ac(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 YC.has(l)?r.length>=3?r.slice(-3).join("."):"":r.slice(-2).join(".")}function JC(e){const n=XC(e);return n?n.split(".")[0]??"":""}function FC(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=ac(c);i.has(d)||(i.add(d),r.push(c))}return r}const WC=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({})}),eT=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(),tT=k({channel:Wt("webhook"),url:h().url(),events:E(Qf).min(1)}),nT=k({gsc:k({propertyUrl:h()}).optional(),syncSchedule:k({preset:h().optional(),cron:h().optional()}).optional()}).optional(),rb=E(h().min(1)),aT=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:rb.optional(),keywords:rb.optional(),competitors:E(h().min(1)).optional().default([]),providers:E(ha).optional().default([]),locations:E(Kf).optional().default([]),defaultLocation:h().optional(),schedule:eT,notifications:E(tT).optional().default([]),google:nT,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=KC(e.locations);i.length>0&&n.addIssue({code:"custom",message:`Duplicate location labels are not allowed: ${i.join(", ")}`,path:["locations"]}),QC(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:WC,spec:aT});const iT=se(["gsc","ga4"]);k({id:h(),domain:h(),connectionType:iT,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 sT=k({date:h(),clicks:j(),impressions:j(),ctr:j()});k({totals:k({clicks:j(),impressions:j(),ctr:j(),days:j()}),daily:E(sT)});const Sf=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()});se(["stable","reindexed","deindexed","still-missing","new"]);const rT=k({url:h(),previousState:h().nullable(),currentState:h().nullable(),transitionDate:h()}),oT=k({reason:h(),count:j(),urls:E(Sf).default([])});k({summary:k({total:j(),indexed:j(),notIndexed:j(),deindexed:j(),percentage:j()}),lastInspectedAt:h().nullable(),lastSyncedAt:h().nullable(),indexed:E(Sf).default([]),notIndexed:E(Sf).default([]),deindexed:E(rT).default([]),reasonGroups:E(oT).default([])});k({url:h(),type:se(["URL_UPDATED","URL_DELETED"]),notifiedAt:h()});const lT=k({url:h(),type:se(["URL_UPDATED","URL_DELETED"]),notifiedAt:h(),status:se(["success","error"]),error:h().optional()});k({summary:k({total:j().int().nonnegative(),succeeded:j().int().nonnegative(),failed:j().int().nonnegative()}),results:E(lT).default([])});k({date:h(),indexed:j(),notIndexed:j(),reasonBreakdown:Zn(h(),j()).default({})});const cT=k({siteUrl:h(),permissionLevel:h()});k({sites:E(cT).default([])});const uT=k({type:h(),submitted:h(),indexed:h()}),dT=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(uT).optional()});k({sitemaps:E(dT).default([])});k({id:h(),domain:h(),siteUrl:h().nullable().optional(),createdAt:h(),updatedAt:h()});const tf=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(tf).default([]),notIndexed:E(tf).default([]),unknown:E(tf).default([]).optional()});k({query:h(),impressions:j(),clicks:j(),ctr:j(),averagePosition:j()});k({date:h(),indexed:j(),notIndexed:j(),unknown:j()});const fT=k({url:h(),status:se(["success","error"]),submittedAt:h(),error:h().optional()});k({summary:k({total:j().int().nonnegative(),succeeded:j().int().nonnegative(),failed:j().int().nonnegative()}),results:E(fT).default([])});const n0=k({url:h(),verified:ye()});k({sites:E(n0).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(n0).default([])});k({siteUrl:h()});const pT=k({name:h(),alive:ye(),lastUsed:h().nullable()});k({connected:ye(),endpoint:h(),version:h().optional(),browserVersion:h().optional(),targets:E(pT).default([])});const Ps=se(["live","staging"]);k({projectName:h(),url:h(),stagingUrl:h().optional(),username:h(),defaultEnv:Ps,createdAt:h(),updatedAt:h()});const ob=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:ob.nullable(),staging:ob.nullable(),adminUrl:h().nullable().optional()});const mT=k({id:j(),slug:h(),title:h(),status:h(),modifiedAt:h().nullable().optional(),link:h().nullable().optional()}),a0=k({title:h().nullable(),description:h().nullable(),noindex:ye().nullable(),writable:ye().default(!1),writeTargets:E(h()).default([])}),hT=k({type:h(),json:Zn(h(),wi())}),gT=mT.extend({env:Ps,content:h(),seo:a0,schemaBlocks:E(hT).default([])}),lb=gT.extend({contentHash:h(),contentSnippet:h()}),i0=k({manualRequired:Wt(!0),targetUrl:h(),adminUrl:h().nullable().optional(),content:h(),nextSteps:E(h()).default([])}),yT=k({slug:h(),severity:se(["high","medium","low"]),code:se(["noindex","missing-seo-title","missing-meta-description","missing-schema","thin-content"]),message:h()});k({slug:h(),title:h(),status:h(),wordCount:j(),seo:a0,schemaPresent:ye(),issues:E(yT).default([])});const bT=k({slug:h(),status:se(["applied","skipped","manual"]),error:h().optional(),manualAssist:i0.optional()});k({env:Ps,strategy:se(["plugin","manual"]),results:E(bT)});const vT=k({slug:h(),status:se(["deployed","stripped","skipped","failed"]),schemasInjected:E(h()).optional(),manualAssist:i0.optional(),error:h().optional()});k({env:Ps,results:E(vT)});const ST=k({slug:h(),title:h(),canonrySchemas:E(h()),thirdPartySchemas:E(h()),hasCanonrySchema:ye()});k({env:Ps,pages:E(ST)});const xT=k({name:h(),status:se(["completed","skipped","failed"]),summary:h().optional(),error:h().optional()});k({projectName:h(),steps:E(xT)});k({slug:h(),live:lb,staging:lb,hasDifferences:ye(),differences:k({title:ye(),slug:ye(),content:ye(),seoTitle:ye(),seoDescription:ye(),noindex:ye(),schema:ye()})});const wT=k({name:h(),displayName:h().optional(),keyUrl:h().optional(),modelHint:h().optional(),model:h().optional(),configured:ye(),quota:PC.optional(),vertexConfigured:ye().optional()}),cb=k({configured:ye()});k({providers:E(wT).default([]),google:cb,bing:cb});const yc=se(["queued","running","completed","partial","failed","cancelled"]),It=yc.enum,s0=se(["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"]),Ee=s0.enum,r0=se(["manual","scheduled","config-apply","backfill","probe"]),Rs=r0.enum,ji=se(["cited","not-cited"]),ic=ji.enum,sc=se(["visible","not-visible"]);sc.enum;const rc=se(["mentioned","not-mentioned"]);rc.enum;const o0=se(["new","cited","lost","emerging","not-cited"]);o0.enum;const jT=se(["new","mentioned","lost","emerging","not-mentioned"]);jT.enum;const NT=se([Rs.manual,Rs.probe]);k({kind:Wt(Ee["answer-visibility"]).optional(),trigger:NT.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 kT=k({message:h(),raw:wi().optional()}),AT=k({message:h().optional(),providers:Zn(h(),kT).optional()}),_T=k({id:h(),projectId:h(),kind:s0,status:yc,trigger:r0.default("manual"),location:h().nullable().optional(),queries:E(h()).nullable().optional(),startedAt:h().nullable().optional(),finishedAt:h().nullable().optional(),error:AT.nullable().optional(),createdAt:h()});function Yf(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 l0=k({uri:h(),title:h()}),c0=k({id:h(),runId:h(),queryId:h(),query:h().optional(),provider:ha,citationState:ji,answerMentioned:ye().optional(),visibilityState:sc.optional(),mentionState:rc.optional(),transition:o0.optional(),answerText:h().nullable().optional(),citedDomains:E(h()).default([]),competitorOverlap:E(h()).default([]),recommendedCompetitors:E(h()).default([]),matchedTerms:E(h()).default([]),groundingSources:E(l0).default([]),searchQueries:E(h()).default([]),model:h().nullable().optional(),location:h().nullable().optional(),createdAt:h()});k({snapshots:E(c0),total:j().int().nonnegative()});const zT=k({queryId:h().nullable(),query:h().nullable(),run1State:ji.nullable(),run2State:ji.nullable(),run1AnswerMentioned:ye().nullable(),run2AnswerMentioned:ye().nullable(),run1VisibilityState:sc.nullable(),run2VisibilityState:sc.nullable(),run1MentionState:rc.nullable().optional(),run2MentionState:rc.nullable().optional(),changed:ye(),visibilityChanged:ye()});k({run1:h(),run2:h(),diff:E(zT)});const CT=_T.extend({snapshots:E(c0).optional()});k({totalRuns:j().int().nonnegative(),run:CT.nullable()});k({id:h(),projectId:h().nullable().optional(),actor:h(),action:h(),entityType:h(),entityId:h().nullable().optional(),diff:wi().optional(),createdAt:h()});const TT=se(["yes","no","unknown","not-mentioned"]),ub=E(h().min(1));k({companyName:h().min(1),domain:h().min(1),queries:ub.optional(),phrases:ub.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 ET=k({name:h(),count:j().int().nonnegative()}),OT=k({id:h(),name:h(),weight:j(),score:j(),grade:h(),status:se(["pass","partial","fail"]),findings:E(k({type:h(),message:h()})).default([]),recommendations:E(h()).default([])}),DT=k({url:h(),finalUrl:h(),auditedAt:h(),overallScore:j(),overallGrade:h(),summary:h(),factors:E(OT).default([])}),RT=k({industry:h(),summary:h(),services:E(h()).default([]),categoryTerms:E(h()).default([])}),MT=k({provider:h(),displayName:h(),model:h().nullable().optional(),mentioned:ye(),cited:ye(),describedAccurately:TT,accuracyNotes:h().nullable().optional(),incorrectClaims:E(h()).default([]),recommendedCompetitors:E(h()).default([]),citedDomains:E(h()).default([]),groundingSources:E(l0).default([]),searchQueries:E(h()).default([]),answerText:h(),error:h().nullable().optional()}),BT=k({query:h(),providerResults:E(MT).default([])}),LT=k({totalQueries:j().int().nonnegative(),totalProviders:j().int().nonnegative(),totalComparisons:j().int().nonnegative(),mentionCount:j().int().nonnegative(),citationCount:j().int().nonnegative(),topCompetitors:E(ET).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:RT,audit:DT,queryResults:E(BT).default([]),summary:LT});const Xf=se(["answer-visibility","traffic-sync"]);Xf.enum;k({id:h(),projectId:h(),kind:Xf,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:Xf.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 qT=se(["mentioned","cited"]);qT.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 Jf=se(["session","first_user","manual_utm"]),$T=k({source:h(),medium:h(),sessions:j(),users:j(),sourceDimension:Jf}),UT=k({source:h(),medium:h(),sourceDimension:Jf,landingPage:h(),sessions:j(),users:j()}),VT=k({source:h(),medium:h(),sessions:j(),users:j(),channelGroup:h()}),Qr=k({sessions:j(),sharePct:j(),sharePctDisplay:h()}),GT=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($T),aiReferralLandingPages:E(UT),aiSessionsDeduped:j(),aiUsersDeduped:j(),aiSessionsBySession:j(),aiUsersBySession:j(),socialReferrals:E(VT),socialSessions:j(),socialUsers:j(),channelBreakdown:GT,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:se(["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:Jf});k({date:h(),source:h(),medium:h(),sessions:j(),users:j(),channelGroup:h()});k({date:h(),sessions:j(),organicSessions:j(),users:j()});function oc(e){return e.toLowerCase().replace(/[^a-z0-9]/g,"")}const u0=se(["claude","openai","gemini","zai"]),IT=k({id:u0,label:h(),defaultModel:h(),configured:ye(),keySource:se(["config","env"]).nullable()});k({providers:E(IT).default([]),defaultProvider:u0.nullable()});const HT=se(["aero","user","compaction"]);HT.enum;const d0=128;k({key:h().min(1).max(d0),value:h().min(1)});k({key:h().min(1).max(d0)});const Ff=se(["queued","downloading","querying","ready","failed"]);Ff.enum;k({id:h(),release:h(),status:Ff,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 ZT=k({linkingDomain:h(),numHosts:j().int()}),PT=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:PT.nullable(),total:j().int(),rows:E(ZT)});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:Ff.nullable(),bytes:j().int(),lastUsedAt:h().nullable()});se(["snapshot","insight"]);const KT=k({kind:Wt("snapshot"),id:h(),runId:h(),query:h(),provider:h(),model:h().nullable(),citationState:ji,matchedField:se(["answerText","citedDomains","searchQueries","query"]),snippet:h(),createdAt:h()}),QT=k({kind:Wt("insight"),id:h(),runId:h().nullable(),type:se(["regression","gain","opportunity","first-citation","provider-pickup","persistent-gap","competitor-gained","competitor-lost"]),severity:se(["critical","high","medium","low"]),title:h(),query:h(),provider:h(),matchedField:se(["title","query","recommendation","cause"]),snippet:h(),dismissed:ye(),createdAt:h()}),YT=Fv("kind",[KT,QT]);k({query:h(),totalHits:j().int().nonnegative(),truncated:ye(),hits:E(YT)});const f0=se(["create","expand","refresh","add-schema"]);f0.enum;function vM(e){switch(e){case"create":return"Create";case"expand":return"Expand";case"refresh":return"Refresh";case"add-schema":return"Add schema"}}const p0=se(["gsc","competitor-evidence","both"]);p0.enum;const m0=se(["high","medium","low"]);m0.enum;const XT=se(["blog-post","comparison","listicle","how-to","guide","glossary"]);XT.enum;const h0=se(["proposed","briefed","payload-generated","draft-created","published","validated","dismissed"]);h0.enum;const JT=k({url:h(),gscImpressions:j().nonnegative(),gscClicks:j().nonnegative(),gscAvgPosition:j().nonnegative().nullable(),organicSessions:j().nonnegative()}),FT=k({domain:h(),url:h(),title:h(),citationCount:j().int().nonnegative()}),WT=k({demand:j(),competitor:j(),absence:j(),gapSeverity:j()}),eE=k({actionId:h(),state:h0,lastUpdated:h()}),g0=k({targetRef:h(),query:h(),action:f0,ourBestPage:JT.nullable(),winningCompetitor:FT.nullable(),score:j(),scoreBreakdown:WT,drivers:E(h()),demandSource:p0,actionConfidence:m0,existingAction:eE.nullable()});k({targets:E(g0),contextMetrics:k({totalAiReferralSessions:j().int().nonnegative(),latestRunId:h(),runTimestamp:h()})});const tE=k({targetRef:h(),addressedUrl:h().nullable(),note:h().nullable(),dismissedAt:h()});k({dismissals:E(tE)});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 nE=k({uri:h(),title:h(),domain:h(),isOurDomain:ye(),isCompetitor:ye(),citationCount:j().int().nonnegative(),providers:E(ha)}),y0=k({query:h(),groundingSources:E(nE)});k({sources:E(y0),latestRunId:h()});const b0=k({query:h(),competitorDomains:E(h()),competitorCount:j().int().nonnegative(),missRate:j().min(0).max(1),lastSeenInRunId:h()});k({gaps:E(b0),latestRunId:h()});const v0=se(["ok","warn","fail","skipped"]);v0.enum;const Wf=se(["global","project"]);Wf.enum;const S0=se(["auth","config","providers","integrations","database","schedules","agent"]);S0.enum;const aE=k({id:h(),category:S0,scope:Wf,title:h(),status:v0,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:Wf,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(aE)});const iE=k({provider:h(),citationState:ji,cited:ye(),mentioned:ye(),runId:h(),runCreatedAt:h()}),sE=k({queryId:h(),query:h(),providers:E(iE),citedCount:j().int().nonnegative(),mentionedCount:j().int().nonnegative(),totalProviders:j().int().nonnegative()}),rE=k({queryId:h(),query:h(),provider:h(),citingCompetitors:E(h()),runId:h(),runCreatedAt:h()}),oE=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:oE,byQuery:E(sE),competitorGaps:E(rE),status:se(["ready","no-data"]),reason:se(["no-runs-yet","no-queries"]).optional()});const lE=se(["prompt","request-param","browser-geo","ignored"]),cE=k({label:h(),city:h(),region:h(),country:h(),otherConfiguredLabels:E(h())}),uE=k({provider:h(),treatment:lE,description:h()}),dE=k({generatedAt:h(),project:k({id:h(),name:h(),displayName:h(),canonicalDomain:h(),country:h(),language:h()}),location:cE.nullable(),providerLocationHandling:E(uE),periodStart:h().nullable(),periodEnd:h().nullable()}),fE=k({citationRate:j(),citedQueryCount:j(),totalQueryCount:j(),mentionRate:j(),mentionedQueryCount:j(),trend:se(["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:se(["positive","caution","negative","neutral"])}))}),pE=k({citationState:se(["cited","not-cited","pending"]),answerMentioned:ye().nullable(),model:h().nullable()}),mE=k({queries:E(h()),providers:E(h()),matrix:E(E(pE.nullable())),providerRates:E(k({provider:h(),citedCount:j(),totalCount:j(),citationRate:j()}))}),hE=k({domain:h(),citationCount:j(),totalCount:j(),pressureLabel:se(["High","Moderate","Low","None"]),citedQueries:E(h()),sharePct:j(),theirCitedPages:E(k({url:h(),citedFor:E(h())}))}),gE=k({projectCitationCount:j(),competitors:E(hE)}),yE=k({domain:h(),mentionCount:j(),totalCount:j(),pressureLabel:se(["High","Moderate","Low","None"]),mentionedQueries:E(h()),sharePct:j()}),bE=k({projectMentionCount:j(),totalAnswerSnapshots:j(),competitors:E(yE)}),vE=k({category:h(),label:h(),count:j(),sharePct:j()}),SE=k({categories:E(vE),topDomains:E(k({domain:h(),count:j(),isCompetitor:ye()}))}),xE=k({query:h(),clicks:j(),impressions:j(),ctr:j(),avgPosition:j(),category:se(["brand","lead-gen","industry","other"])}),wE=k({periodStart:h(),periodEnd:h(),totalClicks:j(),totalImpressions:j(),ctr:j(),avgPosition:j(),topQueries:E(xE),categoryBreakdown:E(k({category:se(["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())}),jE=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()}))}),NE=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()}))}),kE=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()}))}),AE=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()}))}),_E=k({provider:se(["google","bing"]).nullable(),total:j(),indexed:j(),notIndexed:j(),deindexed:j(),unknown:j(),indexedPct:j()}),zE=k({runId:h(),date:h(),citationRate:j(),citedQueryCount:j(),totalQueryCount:j(),mentionRate:j(),mentionedQueryCount:j(),providerRates:E(k({provider:h(),citationRate:j()}))}),xf=k({id:h(),type:se(["regression","gain","opportunity"]),severity:se(["critical","high","medium","low"]),title:h(),query:h(),provider:h(),recommendation:h().nullable(),createdAt:h(),instanceCount:j()}),CE=k({horizon:se(["immediate","short-term","medium-term"]),title:h(),rationale:h()}),Yr=k({current:j(),prior:j(),deltaAbs:j(),direction:se(["up","down","flat"]),window:j().optional()}),TE=k({provider:h(),current:j(),prior:j(),deltaAbs:j(),direction:se(["up","down","flat"])}),EE=k({enoughHistory:ye(),headline:h(),citationRate:Yr.nullable(),mentionRate:Yr.nullable(),citedQueryCount:Yr.nullable(),gscClicksDelta:Yr.nullable(),aiReferralsDelta:Yr.nullable(),providerMovements:E(TE),wins:E(xf),regressions:E(xf)});se(["agency","client"]);const OE=se(["agency","client","both"]),DE=se(["immediate","short-term","medium-term"]),RE=se(["high","medium","low"]);se(["positive","caution","negative","neutral"]);const ME=se(["content","competitors","provider","search-demand","indexing","location","monitoring"]),ep=k({audience:OE,priority:j(),horizon:DE,category:ME,title:h(),action:h(),why:E(h()),evidence:E(h()),successMetric:h(),confidence:RE,targetRef:h().optional()}),BE=k({headline:h(),overview:h(),actionItems:E(ep),confidenceNotes:E(h())}),LE=k({title:h(),detail:h(),severity:se(["positive","caution","negative","neutral"]),evidence:E(h())}),qE=k({priorities:E(ep),diagnostics:E(LE)});function SM(e){return e.horizon==="immediate"?"negative":e.confidence==="high"?"caution":e.confidence==="low"?"neutral":"caution"}function xM(e){switch(e){case"critical":return"Critical";case"high":return"High";case"medium":return"Medium";case"low":return"Low"}}function wM(e){switch(e){case"immediate":return"Immediate";case"short-term":return"Short term";case"medium-term":return"Medium term"}}function jM(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 NM(e){switch(e){case"high":return"High";case"medium":return"Medium";case"low":return"Low"}}k({meta:dE,executiveSummary:fE,citationScorecard:mE,competitorLandscape:gE,mentionLandscape:bE,aiSourceOrigin:SE,gsc:wE.nullable(),ga:jE.nullable(),socialReferrals:NE.nullable(),aiReferrals:kE.nullable(),serverActivity:AE.nullable(),indexingHealth:_E.nullable(),citationsTrend:E(zE),whatsChanged:EE,insights:E(xf),recommendedNextSteps:E(CE),actionPlan:E(ep),clientSummary:BE,agencyDiagnostics:qE,contentOpportunities:E(g0),contentGaps:E(b0),groundingSources:E(y0)});const $E=se(["claude","codex"]);$E.enum;const UE=se(["claude","codex","all"]);UE.enum;const tp=se(["cloud-run","wordpress","cloudflare","vercel","generic-log"]);tp.enum;const VE=se(["raw-request-events","aggregate-request-metrics","request-url","status-code","user-agent","remote-ip","referer","cursor-pull"]);VE.enum;const GE=se(["raw-request","aggregate-bucket"]),IE=GE.enum,HE=se(["observed","provider-aggregated","inferred"]),ZE=HE.enum,PE=k({type:h().nullable(),labels:Zn(h(),h())}),KE=k({sourceType:tp,evidenceKind:Wt(IE["raw-request"]),confidence:Wt(ZE.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:PE,providerLabels:Zn(h(),h())});k({events:E(KE),rawEntryCount:j().int().nonnegative(),skippedEntryCount:j().int().nonnegative(),nextPageToken:h().optional(),filter:h()});const x0=se(["connected","paused","error","archived"]),kM=x0.enum,w0=se(["oauth","service-account"]);w0.enum;const QE=se(["verified","claimed_unverified","unknown_ai_like"]);QE.enum;k({gcpProjectId:h().min(1),serviceName:h().nullable().optional(),location:h().nullable().optional(),authMode:w0});k({baseUrl:h().url(),username:h().min(1)});const np=se(["production","preview"]);np.enum;k({projectId:h().min(1),teamId:h().min(1),environment:np});const j0=k({id:h(),projectId:h(),sourceType:tp,displayName:h(),status:x0,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:np.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:yc,windowStart:h(),windowEnd:h(),daysRequested:j().int().positive(),daysApplied:j().int().positive()});const YE=k({crawlerHits:j().int().nonnegative(),aiReferralHits:j().int().nonnegative(),sampleCount:j().int().nonnegative()});k({sources:E(j0)});const XE=j0.extend({totals24h:YE,latestRun:k({runId:h(),status:yc,startedAt:h().nullable(),finishedAt:h().nullable(),error:h().nullable()}).nullable()});k({sources:E(XE)});const JE=se(["crawler","ai-referral"]),N0=JE.enum,FE=k({kind:Wt(N0.crawler),sourceId:h(),tsHour:h(),botId:h(),operator:h(),verificationStatus:h(),pathNormalized:h(),status:j().int(),hits:j().int().nonnegative()}),WE=k({kind:Wt(N0["ai-referral"]),sourceId:h(),tsHour:h(),product:h(),operator:h(),sourceDomain:h(),evidenceType:h(),landingPathNormalized:h(),status:j().int(),hits:j().int().nonnegative()}),eO=Fv("kind",[FE,WE]);k({windowStart:h(),windowEnd:h(),totals:k({crawlerHits:j().int().nonnegative(),aiReferralHits:j().int().nonnegative()}),events:E(eO)});const ap=se(["cited","aspirational","wasted-surface"]),db=ap.enum;db.cited,db.aspirational;const ip=se(["direct-competitor","ota-aggregator","editorial-media","other","unknown"]),tO=ip.enum;tO["direct-competitor"];const sp=se(["queued","seeding","probing","completed","failed"]);sp.enum;const k0=k({domain:h().min(1),hits:j().int().positive(),competitorType:ip.default("unknown")}),nO=k({id:h(),sessionId:h(),projectId:h(),query:h(),bucket:ap.nullable().default(null),citationState:ji,citedDomains:E(h()).default([]),createdAt:h()}),aO=k({id:h(),projectId:h(),status:sp,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(k0).default([]),error:h().nullable().optional(),startedAt:h().nullable().optional(),finishedAt:h().nullable().optional(),createdAt:h()});aO.extend({probes:E(nO).default([])});const iO=500;k({icpDescription:h().min(1).optional(),dedupThreshold:j().min(0).max(1).optional(),maxProbes:j().int().positive().max(iO).optional(),locations:E(h().min(1)).optional()});k({buckets:E(ap).min(1).optional(),includeCompetitors:ye().optional(),competitorTypes:E(ip).min(1).optional()});k({sessionId:h(),projectId:h(),status:sp,queriesByBucket:k({cited:E(h()),aspirational:E(h()),"wasted-surface":E(h())}),suggestedCompetitors:E(k0)});k({sessionId:h(),projectId:h(),promoted:k({queries:E(h()),competitors:E(h())}),skipped:k({queries:E(h()),competitors:E(h())})});Jv([Wt("cli"),h().regex(/^discovery:.+$/)]);var sO=(e=>(e.Clicks="clicks",e.Impressions="impressions",e.CTR="ctr",e.Position="position",e))(sO||{});const AM={clicks:"Clicks",impressions:"Impressions",ctr:"CTR",position:"Position"},_M={clicks:"Clicks",impressions:"Impr",ctr:"CTR",position:"Pos"},zM=Yf;function rO(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 A0(e){return e.split("-").map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(" ")}function CM(e){if(!e)return"—";try{return new Date(e).toLocaleString()}catch{return e}}function TM(e){return e===null?"Unknown":e?"Pass":"Fail"}function fb(e){return e===0?"12:00 AM":e<12?`${e}:00 AM`:e===12?"12:00 PM":`${e-12}:00 PM`}function EM(e,n){return e==="twice-daily"?"twice-daily":e.startsWith("weekly@")?`${e}@${n}`:`daily@${n}`}function OM(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 DM(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 ${fb(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 ${fb(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]},oO=e=>qe("getApiV1ProjectsByName",e),lO=e=>$e({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await lv({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:oO(e)}),Ks=e=>qe("getApiV1Projects",e),rp=e=>$e({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Uw({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:Ks(e)}),op=e=>qe("getApiV1Runs",e),lp=e=>$e({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Ww({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:op(e)}),cO=e=>qe("getApiV1RunsById",e),_0=e=>$e({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await cv({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:cO(e)}),uO=e=>qe("getApiV1Settings",e),dO=e=>$e({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await uv({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:uO(e)}),fO=e=>qe("getApiV1ProjectsByNameGoogleConnections",e),RM=e=>$e({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await hj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:fO(e)}),pO=e=>qe("getApiV1ProjectsByNameGoogleProperties",e),MM=e=>$e({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await bj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:pO(e)}),mO=e=>qe("getApiV1ProjectsByNameGoogleGscPerformance",e),BM=e=>$e({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await wj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:mO(e)}),hO=e=>qe("getApiV1ProjectsByNameGoogleGscPerformanceDaily",e),LM=e=>$e({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await jj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:hO(e)}),gO=e=>qe("getApiV1ProjectsByNameGoogleGscInspections",e),qM=e=>$e({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await kj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:gO(e)}),yO=e=>qe("getApiV1ProjectsByNameGoogleGscDeindexed",e),$M=e=>$e({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Aj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:yO(e)}),bO=e=>qe("getApiV1ProjectsByNameGoogleGscCoverage",e),UM=e=>$e({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await dv({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:bO(e)}),vO=e=>qe("getApiV1ProjectsByNameGoogleGscCoverageHistory",e),VM=e=>$e({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await _j({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:vO(e)}),GM=e=>qe("getApiV1ProjectsByNameGoogleGscSitemaps",e),SO=e=>qe("getApiV1ProjectsByNameBingStatus",e),IM=e=>$e({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Rj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:SO(e)}),xO=e=>qe("getApiV1ProjectsByNameBingSites",e),HM=e=>$e({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Mj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:xO(e)}),wO=e=>qe("getApiV1ProjectsByNameBingCoverage",e),ZM=e=>$e({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await fv({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:wO(e)}),jO=e=>qe("getApiV1ProjectsByNameBingInspections",e),PM=e=>$e({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Lj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:jO(e)}),NO=e=>qe("getApiV1ProjectsByNameBingPerformance",e),KM=e=>$e({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Vj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:NO(e)}),kO=e=>qe("getApiV1ProjectsByNameGaStatus",e),QM=e=>$e({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Hj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:kO(e)}),AO=e=>qe("getApiV1ProjectsByNameGaTraffic",e),YM=e=>$e({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Pj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:AO(e)}),_O=e=>qe("getApiV1ProjectsByNameGaAiReferralHistory",e),XM=e=>$e({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Kj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:_O(e)}),zO=e=>qe("getApiV1ProjectsByNameGaSocialReferralHistory",e),JM=e=>$e({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Qj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:zO(e)}),CO=e=>qe("getApiV1ProjectsByNameGaSessionHistory",e),FM=e=>$e({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Yj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:CO(e)}),TO=e=>qe("getApiV1ProjectsByNameReport",e),WM=e=>$e({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Jj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:TO(e)}),EO=e=>qe("getApiV1ProjectsByNameCitationsVisibility",e),e6=e=>$e({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Fj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:EO(e)}),OO=e=>qe("getApiV1ProjectsByNameTrafficSources",e),t6=e=>$e({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await yN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:OO(e)}),DO=e=>qe("getApiV1ProjectsByNameTrafficStatus",e),n6=e=>$e({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await bN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:DO(e)}),RO=e=>qe("getApiV1ProjectsByNameTrafficSourcesById",e),a6=e=>$e({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await vN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:RO(e)}),MO=e=>qe("getApiV1ProjectsByNameTrafficEvents",e),i6=e=>$e({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await SN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:MO(e)}),BO=e=>qe("getApiV1ProjectsByNameDiscoverSessions",e),s6=e=>$e({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await wN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:BO(e)}),LO=e=>qe("getApiV1ProjectsByNameDiscoverSessionsById",e),r6=e=>$e({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await jN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:LO(e)}),qO=e=>qe("getApiV1ProjectsByNameDiscoverSessionsByIdPromote",e),o6=e=>$e({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await NN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:qO(e)}),$O=e=>qe("getApiV1ProjectsByNameAgentProviders",e),UO=e=>$e({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await AN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:$O(e)});function pb(e){return e.state==="ok"?"positive":e.state==="checking"?"neutral":"negative"}function z0(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 l6(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 c6(e){return e==="High"?"negative":e==="Moderate"?"caution":"neutral"}function VO(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 GO(e,n,i){return e.map(r=>{if(r.id==="api")return{...r,tone:pb(n.apiStatus),detail:n.apiStatus.state==="ok"?"Healthy":"Needs attention",meta:n.apiStatus.detail};if(r.id==="worker")return{...r,tone:pb(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=>VO(g)).join(" · ");return{...r,label:"Providers",tone:d?"positive":"caution",detail:`${l} of ${c} configured`,meta:m||"None configured"}})}function IO(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 HO(e,n,i){const r=IO(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 C0="canonry.run-tracker",wf=new Set;let mb=!1,ZO=0,bc={runs:{},batches:{}};function PO(){const e=Ni();for(const n of wf)n(e)}function KO(e){if(!e)return{runs:{},batches:{}};try{const n=JSON.parse(e);return{runs:n.runs??{},batches:n.batches??{}}}catch{return{runs:{},batches:{}}}}function QO(){typeof window>"u"||window.sessionStorage.setItem(C0,JSON.stringify(bc))}function T0(){mb||(mb=!0,!(typeof window>"u")&&(bc=KO(window.sessionStorage.getItem(C0))))}function vc(e){bc=e,QO(),PO()}function Ni(){return T0(),bc}function YO(e){return T0(),wf.add(e),()=>{wf.delete(e)}}function E0(e){const n=Ni();vc({...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 hb(e){const n=Ni();if(!n.runs[e])return;const{[e]:i,...r}=n.runs;vc({...n,runs:r})}function XO(e){const n=Ni(),i=`batch_${Date.now()}_${++ZO}`;return vc({...n,batches:{...n.batches,[i]:{batchId:i,runIds:e.runIds,queuedCount:e.queuedCount,skippedCount:e.skippedCount}}}),i}function JO(e){const n=Ni();if(!n.batches[e])return;const{[e]:i,...r}=n.batches;vc({...n,batches:r})}function FO(e){return e==="completed"||e==="partial"||e==="failed"||e==="cancelled"}function WO(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 gb=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,yb=tv,O0=(e,n)=>i=>{var r;if(n?.variants==null)return yb(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=gb(v)||gb(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 yb(e,d,g,i?.class,i?.className)},e4=(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},t4=(e,n)=>({classGroupId:e,validator:n}),D0=(e=new Map,n=null,i)=>({nextPart:e,validators:n,classGroupId:i}),lc="-",bb=[],n4="arbitrary..",a4=e=>{const n=s4(e),{conflictingClassGroups:i,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:d=>{if(d.startsWith("[")&&d.endsWith("]"))return i4(d);const m=d.split(lc),g=m[0]===""&&m.length>1?1:0;return R0(m,g,n)},getConflictingClassGroupIds:(d,m)=>{if(m){const g=r[d],b=i[d];return g?b?e4(b,g):g:b||bb}return i[d]||bb}}},R0=(e,n,i)=>{if(e.length-n===0)return i.classGroupId;const l=e[n],c=i.nextPart.get(l);if(c){const b=R0(e,n+1,c);if(b)return b}const d=i.validators;if(d===null)return;const m=n===0?e.join(lc):e.slice(n).join(lc),g=d.length;for(let b=0;b<g;b++){const v=d[b];if(v.validator(m))return v.classGroupId}},i4=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?n4+r:void 0})(),s4=e=>{const{theme:n,classGroups:i}=e;return r4(i,n)},r4=(e,n)=>{const i=D0();for(const r in e){const l=e[r];cp(l,i,r,n)}return i},cp=(e,n,i,r)=>{const l=e.length;for(let c=0;c<l;c++){const d=e[c];o4(d,n,i,r)}},o4=(e,n,i,r)=>{if(typeof e=="string"){l4(e,n,i);return}if(typeof e=="function"){c4(e,n,i,r);return}u4(e,n,i,r)},l4=(e,n,i)=>{const r=e===""?n:M0(n,e);r.classGroupId=i},c4=(e,n,i,r)=>{if(d4(e)){cp(e(r),n,i,r);return}n.validators===null&&(n.validators=[]),n.validators.push(t4(i,e))},u4=(e,n,i,r)=>{const l=Object.entries(e),c=l.length;for(let d=0;d<c;d++){const[m,g]=l[d];cp(g,M0(n,m),i,r)}},M0=(e,n)=>{let i=e;const r=n.split(lc),l=r.length;for(let c=0;c<l;c++){const d=r[c];let m=i.nextPart.get(d);m||(m=D0(),i.nextPart.set(d,m)),i=m}return i},d4=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,f4=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)}}},jf="!",vb=":",p4=[],Sb=(e,n,i,r,l)=>({modifiers:e,hasImportantModifier:n,baseClassName:i,maybePostfixModifierPosition:r,isExternal:l}),m4=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===vb){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(jf)?(w=S.slice(0,-1),_=!0):S.startsWith(jf)&&(w=S.slice(1),_=!0);const C=b&&b>g?b-g:void 0;return Sb(c,_,w,C)};if(n){const l=n+vb,c=r;r=d=>d.startsWith(l)?c(d.slice(l.length)):Sb(p4,!1,d,void 0,!0)}if(i){const l=r;r=c=>i({className:c,parseClassName:l})}return r},h4=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}},g4=e=>({cache:f4(e.cacheSize),parseClassName:m4(e),sortModifiers:h4(e),...a4(e)}),y4=/\s+/,b4=(e,n)=>{const{parseClassName:i,getClassGroupId:r,getConflictingClassGroupIds:l,sortModifiers:c}=n,d=[],m=e.trim().split(y4);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,R=r(T?C.substring(0,N):C);if(!R){if(!T){g=v+(g.length>0?" "+g:g);continue}if(R=r(C),!R){g=v+(g.length>0?" "+g:g);continue}T=!1}const G=w.length===0?"":w.length===1?w[0]:c(w).join(":"),H=_?G+jf:G,K=H+R;if(d.indexOf(K)>-1)continue;d.push(K);const X=l(R,T);for(let J=0;J<X.length;++J){const D=X[J];d.push(H+D)}g=v+(g.length>0?" "+g:g)}return g},v4=(...e)=>{let n=0,i,r,l="";for(;n<e.length;)(i=e[n++])&&(r=B0(i))&&(l&&(l+=" "),l+=r);return l},B0=e=>{if(typeof e=="string")return e;let n,i="";for(let r=0;r<e.length;r++)e[r]&&(n=B0(e[r]))&&(i&&(i+=" "),i+=n);return i},S4=(e,...n)=>{let i,r,l,c;const d=g=>{const b=n.reduce((v,S)=>S(v),e());return i=g4(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=b4(g,i);return l(g,v),v};return c=d,(...g)=>c(v4(...g))},x4=[],At=e=>{const n=i=>i[e]||x4;return n.isThemeGetter=!0,n},L0=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,q0=/^\((?:(\w[\w-]*):)?(.+)\)$/i,w4=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,j4=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,N4=/\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$/,k4=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,A4=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,_4=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Va=e=>w4.test(e),Te=e=>!!e&&!Number.isNaN(Number(e)),Ga=e=>!!e&&Number.isInteger(Number(e)),nf=e=>e.endsWith("%")&&Te(e.slice(0,-1)),fa=e=>j4.test(e),$0=()=>!0,z4=e=>N4.test(e)&&!k4.test(e),up=()=>!1,C4=e=>A4.test(e),T4=e=>_4.test(e),E4=e=>!me(e)&&!he(e),O4=e=>Xa(e,G0,up),me=e=>L0.test(e),bi=e=>Xa(e,I0,z4),xb=e=>Xa(e,U4,Te),D4=e=>Xa(e,Z0,$0),R4=e=>Xa(e,H0,up),wb=e=>Xa(e,U0,up),M4=e=>Xa(e,V0,T4),ql=e=>Xa(e,P0,C4),he=e=>q0.test(e),Xr=e=>zi(e,I0),B4=e=>zi(e,H0),jb=e=>zi(e,U0),L4=e=>zi(e,G0),q4=e=>zi(e,V0),$l=e=>zi(e,P0,!0),$4=e=>zi(e,Z0,!0),Xa=(e,n,i)=>{const r=L0.exec(e);return r?r[1]?n(r[1]):i(r[2]):!1},zi=(e,n,i=!1)=>{const r=q0.exec(e);return r?r[1]?n(r[1]):i:!1},U0=e=>e==="position"||e==="percentage",V0=e=>e==="image"||e==="url",G0=e=>e==="length"||e==="size"||e==="bg-size",I0=e=>e==="length",U4=e=>e==="number",H0=e=>e==="family-name",Z0=e=>e==="number"||e==="weight",P0=e=>e==="shadow",V4=()=>{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"),R=At("ease"),G=At("animate"),H=()=>["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],J=()=>["auto","hidden","clip","visible","scroll"],D=()=>["auto","contain","none"],M=()=>[he,me,g],oe=()=>[Va,"full","auto",...M()],Ne=()=>[Ga,"none","subgrid",he,me],Ae=()=>["auto",{span:["full",Ga,he,me]},Ga,he,me],ve=()=>[Ga,"auto",he,me],et=()=>["auto","min","max","fr",he,me],re=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],pe=()=>["start","end","center","stretch","center-safe","end-safe"],$=()=>["auto",...M()],F=()=>[Va,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...M()],de=()=>[Va,"screen","full","dvw","lvw","svw","min","max","fit",...M()],je=()=>[Va,"screen","full","lh","dvh","lvh","svh","min","max","fit",...M()],ie=()=>[e,he,me],Qe=()=>[...K(),jb,wb,{position:[he,me]}],Q=()=>["no-repeat",{repeat:["","x","y","space","round"]}],le=()=>["auto","cover","contain",L4,O4,{size:[he,me]}],te=()=>[nf,Xr,bi],ue=()=>["","none","full",b,he,me],ne=()=>["",Te,Xr,bi],_e=()=>["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=()=>[Te,nf,jb,wb],Ue=()=>["","none",C,he,me],Ze=()=>["none",Te,he,me],Ct=()=>["none",Te,he,me],zn=()=>[Te,he,me],Tt=()=>[Va,"full",...M()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[fa],breakpoint:[fa],color:[$0],container:[fa],"drop-shadow":[fa],ease:["in","out","in-out"],font:[E4],"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",Te],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:[Te,me,he,m]}],"break-after":[{"break-after":H()}],"break-before":[{"break-before":H()}],"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:J()}],"overflow-x":[{"overflow-x":J()}],"overflow-y":[{"overflow-y":J()}],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,...M()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Te,Va,"auto","initial","none",me]}],grow:[{grow:["",Te,he,me]}],shrink:[{shrink:["",Te,he,me]}],order:[{order:[Ga,"first","last","none",he,me]}],"grid-cols":[{"grid-cols":Ne()}],"col-start-end":[{col:Ae()}],"col-start":[{"col-start":ve()}],"col-end":[{"col-end":ve()}],"grid-rows":[{"grid-rows":Ne()}],"row-start-end":[{row:Ae()}],"row-start":[{"row-start":ve()}],"row-end":[{"row-end":ve()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":et()}],"auto-rows":[{"auto-rows":et()}],gap:[{gap:M()}],"gap-x":[{"gap-x":M()}],"gap-y":[{"gap-y":M()}],"justify-content":[{justify:[...re(),"normal"]}],"justify-items":[{"justify-items":[...pe(),"normal"]}],"justify-self":[{"justify-self":["auto",...pe()]}],"align-content":[{content:["normal",...re()]}],"align-items":[{items:[...pe(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...pe(),{baseline:["","last"]}]}],"place-content":[{"place-content":re()}],"place-items":[{"place-items":[...pe(),"baseline"]}],"place-self":[{"place-self":["auto",...pe()]}],p:[{p:M()}],px:[{px:M()}],py:[{py:M()}],ps:[{ps:M()}],pe:[{pe:M()}],pbs:[{pbs:M()}],pbe:[{pbe:M()}],pt:[{pt:M()}],pr:[{pr:M()}],pb:[{pb:M()}],pl:[{pl:M()}],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":M()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":M()}],"space-y-reverse":["space-y-reverse"],size:[{size:F()}],"inline-size":[{inline:["auto",...de()]}],"min-inline-size":[{"min-inline":["auto",...de()]}],"max-inline-size":[{"max-inline":["none",...de()]}],"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,$4,D4]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",nf,me]}],"font-family":[{font:[B4,R4,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":[Te,"none",he,xb]}],leading:[{leading:[c,...M()]}],"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:ie()}],"text-color":[{text:ie()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[..._e(),"wavy"]}],"text-decoration-thickness":[{decoration:[Te,"from-font","auto",he,bi]}],"text-decoration-color":[{decoration:ie()}],"underline-offset":[{"underline-offset":[Te,"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:M()}],"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:Qe()}],"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]},q4,M4]}],"bg-color":[{bg:ie()}],"gradient-from-pos":[{from:te()}],"gradient-via-pos":[{via:te()}],"gradient-to-pos":[{to:te()}],"gradient-from":[{from:ie()}],"gradient-via":[{via:ie()}],"gradient-to":[{to:ie()}],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:ne()}],"border-w-x":[{"border-x":ne()}],"border-w-y":[{"border-y":ne()}],"border-w-s":[{"border-s":ne()}],"border-w-e":[{"border-e":ne()}],"border-w-bs":[{"border-bs":ne()}],"border-w-be":[{"border-be":ne()}],"border-w-t":[{"border-t":ne()}],"border-w-r":[{"border-r":ne()}],"border-w-b":[{"border-b":ne()}],"border-w-l":[{"border-l":ne()}],"divide-x":[{"divide-x":ne()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ne()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[..._e(),"hidden","none"]}],"divide-style":[{divide:[..._e(),"hidden","none"]}],"border-color":[{border:ie()}],"border-color-x":[{"border-x":ie()}],"border-color-y":[{"border-y":ie()}],"border-color-s":[{"border-s":ie()}],"border-color-e":[{"border-e":ie()}],"border-color-bs":[{"border-bs":ie()}],"border-color-be":[{"border-be":ie()}],"border-color-t":[{"border-t":ie()}],"border-color-r":[{"border-r":ie()}],"border-color-b":[{"border-b":ie()}],"border-color-l":[{"border-l":ie()}],"divide-color":[{divide:ie()}],"outline-style":[{outline:[..._e(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Te,he,me]}],"outline-w":[{outline:["",Te,Xr,bi]}],"outline-color":[{outline:ie()}],shadow:[{shadow:["","none",v,$l,ql]}],"shadow-color":[{shadow:ie()}],"inset-shadow":[{"inset-shadow":["none",S,$l,ql]}],"inset-shadow-color":[{"inset-shadow":ie()}],"ring-w":[{ring:ne()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:ie()}],"ring-offset-w":[{"ring-offset":[Te,bi]}],"ring-offset-color":[{"ring-offset":ie()}],"inset-ring-w":[{"inset-ring":ne()}],"inset-ring-color":[{"inset-ring":ie()}],"text-shadow":[{"text-shadow":["none",w,$l,ql]}],"text-shadow-color":[{"text-shadow":ie()}],opacity:[{opacity:[Te,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":[Te]}],"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":ie()}],"mask-image-linear-to-color":[{"mask-linear-to":ie()}],"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":ie()}],"mask-image-t-to-color":[{"mask-t-to":ie()}],"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":ie()}],"mask-image-r-to-color":[{"mask-r-to":ie()}],"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":ie()}],"mask-image-b-to-color":[{"mask-b-to":ie()}],"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":ie()}],"mask-image-l-to-color":[{"mask-l-to":ie()}],"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":ie()}],"mask-image-x-to-color":[{"mask-x-to":ie()}],"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":ie()}],"mask-image-y-to-color":[{"mask-y-to":ie()}],"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":ie()}],"mask-image-radial-to-color":[{"mask-radial-to":ie()}],"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":[Te]}],"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":ie()}],"mask-image-conic-to-color":[{"mask-conic-to":ie()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Qe()}],"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:Ue()}],brightness:[{brightness:[Te,he,me]}],contrast:[{contrast:[Te,he,me]}],"drop-shadow":[{"drop-shadow":["","none",_,$l,ql]}],"drop-shadow-color":[{"drop-shadow":ie()}],grayscale:[{grayscale:["",Te,he,me]}],"hue-rotate":[{"hue-rotate":[Te,he,me]}],invert:[{invert:["",Te,he,me]}],saturate:[{saturate:[Te,he,me]}],sepia:[{sepia:["",Te,he,me]}],"backdrop-filter":[{"backdrop-filter":["","none",he,me]}],"backdrop-blur":[{"backdrop-blur":Ue()}],"backdrop-brightness":[{"backdrop-brightness":[Te,he,me]}],"backdrop-contrast":[{"backdrop-contrast":[Te,he,me]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Te,he,me]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Te,he,me]}],"backdrop-invert":[{"backdrop-invert":["",Te,he,me]}],"backdrop-opacity":[{"backdrop-opacity":[Te,he,me]}],"backdrop-saturate":[{"backdrop-saturate":[Te,he,me]}],"backdrop-sepia":[{"backdrop-sepia":["",Te,he,me]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":M()}],"border-spacing-x":[{"border-spacing-x":M()}],"border-spacing-y":[{"border-spacing-y":M()}],"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:[Te,"initial",he,me]}],ease:[{ease:["linear","initial",R,he,me]}],delay:[{delay:[Te,he,me]}],animate:[{animate:["none",G,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:zn()}],"skew-x":[{"skew-x":zn()}],"skew-y":[{"skew-y":zn()}],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:ie()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:ie()}],"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":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mbs":[{"scroll-mbs":M()}],"scroll-mbe":[{"scroll-mbe":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pbs":[{"scroll-pbs":M()}],"scroll-pbe":[{"scroll-pbe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"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",...ie()]}],"stroke-w":[{stroke:[Te,Xr,bi,xb]}],stroke:[{stroke:["none",...ie()]}],"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"]}},G4=S4(V4);function _n(...e){return G4(tv(e))}const I4=O0("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?mw:"button";return f.jsx(d,{ref:c,className:_n(I4({variant:n,size:i,className:e})),...l})});Le.displayName="Button";const H4=O0("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 K0({className:e,variant:n,...i}){return f.jsx("div",{className:_n(H4({variant:n}),e),...i})}const Z4=220;function Nb({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)},Z4)};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(xk,{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 P4({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 Bn({tone:e,children:n,...i}){const r=e==="positive"?"success":e==="caution"?"warning":e==="negative"?"destructive":"neutral";return f.jsx(K0,{variant:r,...i,children:n})}function dp({status:e}){return f.jsx(Bn,{tone:z0(e),children:A0(e)})}const K4=ev,Q4=Jb,Q0=U.forwardRef(({className:e,...n},i)=>f.jsx(Df,{ref:i,className:_n("fixed inset-0 z-50 bg-black/70 backdrop-blur-sm",e),...n}));Q0.displayName=Df.displayName;const Y4=400,X4=1200,J4=720,Y0=U.forwardRef(({className:e,children:n,...i},r)=>{const[l,c]=U.useState(J4),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(X4,Math.max(Y4,g.current+_));c(C)},[]),S=U.useCallback(()=>{d.current=!1},[]);return f.jsxs(Q4,{children:[f.jsx(Q0,{}),f.jsxs(Rf,{ref:r,className:_n("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(Fb,{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"})]})]})]})});Y0.displayName=Rf.displayName;const F4=({className:e,...n})=>f.jsx("div",{className:_n("flex flex-col gap-1.5 pr-10",e),...n}),X0=U.forwardRef(({className:e,...n},i)=>f.jsx(Mf,{ref:i,className:_n("text-lg font-medium text-zinc-50",e),...n}));X0.displayName=Mf.displayName;const J0=U.forwardRef(({className:e,...n},i)=>f.jsx(Wb,{ref:i,className:_n("text-sm text-zinc-500",e),...n}));J0.displayName=Wb.displayName;function W4({title:e,subtitle:n,children:i,open:r,onClose:l}){return f.jsx(K4,{open:r,onOpenChange:c=>c?void 0:l(),children:f.jsxs(Y0,{children:[f.jsxs(F4,{className:"drawer-head",children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:n}),f.jsx(X0,{id:"drawer-title",children:e}),f.jsx(J0,{className:"sr-only",children:n})]}),f.jsx("div",{className:"drawer-body",children:i})]})})}function Ul({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&&rw.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 e3=/[\s\-_]+/;function t3(e){const n=e.split(e3).filter(Boolean);return n.length===0?null:n.map(i=>i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("[\\s\\-_]*")}function kb(e,n){const i=n3(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(t3).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=oc(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(oc(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 n3(e){return e.length===0?[]:typeof e[0]=="string"?[{terms:e,className:"answer-highlight"}]:e}function af(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 a3({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=FC(n.project),T=new Set(N.map(ac)),R=e.runHistory,G=R.length>1,[H,K]=U.useState(null),X=U.useRef(!1);U.useEffect(()=>{if(X.current||e.answerSnippet&&(e.visibilityState!=null||e.answerMentioned!=null))return;const te=R.at(-1);te&&(X.current=!0,Fl(te.runId).then(ue=>{const ne=ue.snapshots?.find(_e=>_e.query===e.query&&_e.provider===e.provider);ne&&K({citationState:ne.citationState,answerMentioned:ne.answerMentioned,visibilityState:ne.visibilityState,visibilityTransition:te.visibilityTransition,provider:ne.provider,model:ne.model??e.model,answerSnippet:ne.answerText??e.answerSnippet,citedDomains:ne.citedDomains??e.citedDomains,competitorDomains:ne.competitorOverlap??e.competitorDomains,recommendedCompetitors:ne.recommendedCompetitors??e.recommendedCompetitors??[],matchedTerms:ne.matchedTerms??e.matchedTerms??[],groundingSources:ne.groundingSources??e.groundingSources,evidenceUrls:[],changeLabel:e.visibilityChangeLabel??e.changeLabel,summary:e.summary})}).catch(()=>{}))},[e,R]);const J=m>=0&&b!==null,D=J?b:H||{citationState:e.citationState,answerMentioned:e.answerMentioned,visibilityState:e.visibilityState,visibilityTransition:R.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},M=D.visibilityState==="pending"||D.citationState==="pending",oe=M?!1:D.visibilityState!=null?D.visibilityState==="visible":D.answerMentioned!=null?D.answerMentioned:D.citationState===ic.cited||D.citationState==="emerging",Ne=D.answerMentioned!=null||D.visibilityState!=null||D.recommendedCompetitors.length>0,Ae=D.citedDomains.length>0||D.groundingSources.length>0||D.evidenceUrls.length>0,ve=n.project.displayName||n.project.name,et=[...N.map(ac),ve,ve.split(" ").slice(0,2).join(" "),...D.matchedTerms].filter(te=>te.trim().length>2),re=[...D.competitorDomains.flatMap(te=>{const ue=JC(te);return ue.length>=4?[ue]:[]}),...D.recommendedCompetitors].filter(te=>te.trim().length>2),pe=[{terms:et,className:"answer-highlight-brand"},...re.length>0?[{terms:re,className:"answer-highlight-competitor"}]:[]],$=M?"pending":D.visibilityTransition==="lost"?"lost":oe?"mentioned":"not-mentioned",F=U.useRef(0),de=U.useCallback(async te=>{const ue=++F.current;if(te===-1||te===R.length-1){g(-1),v(null),l(!1);return}g(te),l(!1);const ne=R[te],_e=`${ne.runId}::${e.query}::${e.provider}`;if(_[_e]){v(_[_e]);return}w(!0);try{const tt=await Fl(ne.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),Ue=xe?{citationState:xe.citationState,answerMentioned:xe.answerMentioned,visibilityState:xe.visibilityState,visibilityTransition:ne.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:af(ne.mentionTransition??ne.visibilityTransition,ne.mentionState??ne.visibilityState),summary:""}:{citationState:ne.citationState,answerMentioned:ne.answerMentioned,visibilityState:ne.visibilityState,visibilityTransition:ne.visibilityTransition,provider:e.provider,model:ne.model??null,answerSnippet:"",citedDomains:[],competitorDomains:[],recommendedCompetitors:[],matchedTerms:[],groundingSources:[],evidenceUrls:[],changeLabel:af(ne.mentionTransition??ne.visibilityTransition,ne.mentionState??ne.visibilityState),summary:"Snapshot data not available for this run."};C(Ze=>({...Ze,[_e]:Ue})),v(Ue)}catch{if(ue!==F.current)return;v({citationState:ne.citationState,answerMentioned:ne.answerMentioned,visibilityState:ne.visibilityState,visibilityTransition:ne.visibilityTransition,provider:e.provider,model:ne.model??null,answerSnippet:"",citedDomains:[],competitorDomains:[],recommendedCompetitors:[],matchedTerms:[],groundingSources:[],evidenceUrls:[],changeLabel:af(ne.mentionTransition??ne.visibilityTransition,ne.mentionState??ne.visibilityState),summary:"Failed to load historical run data."})}finally{ue===F.current&&w(!1)}},[R,e.query,e.provider,_]),ie=(J||e.historyScope!=="provider")&&D.model?`${D.provider} (${D.model}) · ${D.changeLabel.toLowerCase()}`:`${D.provider} · ${D.changeLabel.toLowerCase()}`,Qe=!J&&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:ie}:D.visibilityTransition==="lost"?{label:"Mention lost",title:"Your brand no longer appears in this answer",meta:ie}:M?{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:ie},le=()=>{if(!D.answerSnippet)return null;const te=D.answerSnippet.split(`
|
|
58
|
+
`),ue=[];let ne=[],_e=0;const tt=()=>{if(ne.length===0)return;const xe=ne.join(" ").trim();xe&&ue.push(f.jsx("p",{className:ue.length>0?"mt-2.5":"",children:kb(xe,pe)},_e++)),ne=[]};for(const xe of te){const Ue=xe.trim();if(/^[-\u2013\u2014]{3,}$/.test(Ue)){tt(),ue.push(f.jsx("hr",{className:"border-zinc-800/60 my-3"},_e++));continue}const Ze=Ue.match(/^(#{1,3})\s+(\S.*)$/);if(Ze){tt();const Ct=Ze[1].length,zn=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:kb(zn,pe)},_e++));continue}if(Ue===""){tt();continue}ne.push(Ue)}return tt(),ue};return f.jsx(ev,{open:!0,onOpenChange:te=>{te||i()},children:f.jsxs(Jb,{children:[f.jsx(Df,{className:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm"}),f.jsxs(Rf,{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(Mf,{className:"text-lg font-semibold text-zinc-50 truncate",children:e.query})]}),f.jsxs(Fb,{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"})]})]}),G&&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:R.map((te,ue)=>{const ne=m===-1&&ue===R.length-1||m===ue,_e=te.visibilityState??(te.answerMentioned?"visible":"not-visible"),tt=te.visibilityTransition??_e,xe=_e==="visible"?"bg-emerald-400":tt==="emerging"?"bg-amber-400":tt==="lost"?"bg-rose-400":"bg-zinc-600",Ze=new Date(te.createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"}),Ct=!!(te.model&&ue>0&&R[ue-1]?.model&&R[ue-1].model!==te.model);return f.jsxs("button",{type:"button",className:`evidence-run-dot ${ne?"evidence-run-dot--selected":""}`,onClick:()=>{de(ue===R.length-1?-1:ue)},"aria-label":[`Run ${Ze}: ${_e}`,te.model?`model ${te.model}`:null,Ct?"model changed":null].filter(Boolean).join(" — "),"aria-pressed":ne,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<R.length&&f.jsxs("p",{className:"text-[11px] text-zinc-500 mt-1",children:["Viewing run from ",new Date(R[m].createdAt).toLocaleString()," ","—"," ",f.jsx("span",{className:"capitalize",children:R[m].visibilityState??(R[m].answerMentioned?"visible":"not-visible")}),f.jsxs("button",{type:"button",className:"text-zinc-400 hover:text-zinc-200 ml-2",onClick:()=>{de(-1)},children:["←"," Back to latest"]})]}),!J&&(e.modelTransitions?.length??0)>0&&f.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:e.modelTransitions.map(te=>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:`${te.fromModel??"unknown"} -> ${te.toModel??"unknown"} on ${new Date(te.createdAt).toLocaleDateString()}`},`${te.runId}:${te.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}),Qe&&f.jsx("p",{className:"mt-1 text-[11px] text-zinc-500",children:Qe})]}),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"}),!J&&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((te,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:te})]},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||Ae)&&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(Ul,{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:M?"…":oe?"✓":"—"}),f.jsx("span",{className:"mention-status-label",children:M?"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(te=>f.jsx("span",{className:"mention-chip mention-chip--brand",children:te},te))})]}),!M&&!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:et.map(te=>f.jsx("span",{className:"mention-chip mention-chip--muted",children:te},te))}),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(Ul,{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 te=D.competitorDomains.map(_e=>_e.replace(/^www\./,"")),ue=new Set(te.map(_e=>oc(_e.replace(/\.[^.]+$/,""))));return[...D.recommendedCompetitors.filter(_e=>!ue.has(oc(_e))),...te].map(_e=>f.jsx("span",{className:"mention-chip mention-chip--competitor",children:_e},_e))})()})]})]}),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(Ul,{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((te,ue)=>{const ne=te.toLowerCase().replace(/^www\./,""),_e=T.has(ne),tt=!_e&&D.competitorDomains.some(Ue=>Ue.toLowerCase().replace(/^www\./,"")===ne),xe=_e?"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:te}),_e&&f.jsx("span",{className:"citation-leaderboard-tag",children:"You"}),tt&&f.jsx("span",{className:"citation-leaderboard-tag",children:"Competitor"})]},te)})})]}),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(Ul,{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((te,ue)=>f.jsx("li",{className:"truncate text-sm",children:f.jsx("a",{href:te.uri,target:"_blank",rel:"noopener noreferrer",className:"text-zinc-400 hover:text-zinc-200 transition-colors",children:te.title||te.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(te=>f.jsx("li",{className:"truncate text-sm",children:f.jsx("a",{href:te,target:"_blank",rel:"noopener noreferrer",className:"text-zinc-400 hover:text-zinc-200 transition-colors",children:te})},te))})]}),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 ",J?"for this run":"yet"]})]}),!Ne&&!Ae&&f.jsxs("div",{className:"flex items-center justify-center h-24 text-zinc-600 text-sm",children:["No answer visibility data ",J?"for this run":"yet"]})]})]})]})]})]})})}function Mn(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 sf=[{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 Sc(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 i3=Sc({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"}),s3=Sc({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"}),r3=Sc({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"}),o3=Sc({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"}),l3=[{id:"evidence_citypoint_emergency_gemini",query:"emergency dentist brooklyn",provider:"gemini",model:"gemini-2.5-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:Mn(["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:Mn(["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:Mn(["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:Mn(["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-2.5-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:Mn(["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:Mn(["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:Mn(["not-cited","not-cited","not-cited","not-cited"])},{id:"evidence_citypoint_children_gemini",query:"pediatric dentist brooklyn heights",provider:"gemini",model:"gemini-2.5-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:Mn(["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:Mn(["not-cited","not-cited","not-cited","not-cited","not-cited","cited"])}];sf[0],sf[1],Mn(["cited","cited","cited","cited","cited"]),sf[2],2/7,3/7,Mn(["not-cited","not-cited","not-cited","cited"]);function c3(e,n){return e.runs.find(i=>i.id===n)}function u3(e,n){for(const i of e.projects){const r=i.visibilityEvidence.find(l=>l.id===n);if(r)return{project:i,evidence:r}}}function d3(e,n,i){if(e){const r=e.visibilityEvidence.find(l=>l.id===i);if(r)return{project:e,evidence:r}}if(n)return u3(n,i)}const f3={regression:"negative",gain:"positive",opportunity:"caution","first-citation":"positive","provider-pickup":"positive","persistent-gap":"caution","competitor-gained":"negative","competitor-lost":"neutral"},p3={opportunity:"write","persistent-gap":"write","competitor-gained":"write","competitor-lost":"write",regression:"investigate",gain:"monitor","first-citation":"monitor","provider-pickup":"monitor"},m3={regression:"lost",gain:"emerging",opportunity:"not-cited","first-citation":"emerging","provider-pickup":"emerging","persistent-gap":"not-cited","competitor-gained":"cited","competitor-lost":"not-cited"},h3={regression:"Regression",gain:"Gain",opportunity:"Opportunity","first-citation":"First citation","provider-pickup":"Pickup","persistent-gap":"Gap","competitor-gained":"Competitor","competitor-lost":"Competitor"};function g3(e){return{id:e.id,tone:f3[e.type],title:e.title,detail:e.cause?.details??e.cause?.cause??"",actionLabel:e.recommendation?.action??h3[e.type],actionGroup:p3[e.type],affectedPhrases:[{query:e.query,evidenceId:"",provider:e.provider,citationState:m3[e.type]}]}}function y3(e){return e.filter(n=>!n.dismissed).map(g3)}function F0(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 Ab(e){try{return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}catch{return e}}function b3(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 W0(e){switch(e){case Ee["answer-visibility"]:return"Answer visibility sweep";case Ee["gsc-sync"]:return"GSC sync";case Ee["inspect-sitemap"]:return"Sitemap inspection";case Ee["ga-sync"]:return"GA sync";case Ee["traffic-sync"]:return"Traffic sync";case Ee["bing-inspect"]:return"Bing URL inspection";case Ee["bing-inspect-sitemap"]:return"Bing sitemap inspection";case Ee["site-audit"]:return"Site audit";case Ee["backlink-extract"]:return"Backlink extract";case Ee["aeo-discover-seed"]:return"Discovery (seed phase)";case Ee["aeo-discover-probe"]:return"Discovery (probe phase)"}}function v3(e){return e===Rs.manual?"Manual":e===Rs.scheduled?"Scheduled":e===Rs["config-apply"]?"Config apply":e}function fp(e,n){return{id:e.id,projectId:e.projectId,projectName:n,kind:e.kind,kindLabel:W0(e.kind),status:e.status,trigger:e.trigger??"manual",location:e.location??null,createdAt:e.createdAt,startedAt:e.startedAt?Ab(e.startedAt):Ab(e.createdAt),duration:b3(e.startedAt??null,e.finishedAt??null),statusDetail:e.error?e1(e.error):S3(e),summary:x3(e),triggerLabel:v3(e.trigger)}}function e1(e){const n=Yf(e);return n.length>200?n.slice(0,200)+"…":n}function S3(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?e1(e.error):"Run failed.";case It.cancelled:return"Run was cancelled.";default:return""}}function x3(e){const n=W0(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 w3(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 R of _){const G=[...b].filter(X=>g.has(`${C.query}::${R}::${X??""}`)),H=(C.providerRuns?.[R]?.length??0)>0,K=G.length>0?G:H?[null]:[];for(const X of K){const J=X??"",D=g.get(`${C.query}::${R}::${J}`),M=D?.model??null,oe=M?`${R}:${M}`:null,Ne=C.providerRuns?.[R],Ae=oe?C.modelRuns?.[oe]:void 0,ve=Ue=>Ue?.filter(Ze=>(Ze.location??null)===X),et=G.length>0?ve(Ne):Ne,re=G.length>0?ve(Ae):Ae,pe=(et?.length?et:null)??(re?.length?re:null),$=et?.length?"provider":re?.length?"model":"query",F=pe?pe.at(-1).transition:T,de=pe?pe.at(-1).visibilityTransition??(pe.at(-1).visibilityState==="visible"?"visible":"not-visible"):N?.visibilityTransition??(N?.visibilityState==="visible"?"visible":"not-visible"),je=pe?.at(-1)?.citationState,ie=pe?.at(-1)?.visibilityState,Qe=D?F==="lost"?"lost":F==="emerging"?"emerging":D.citationState===ic.cited?"cited":"not-cited":je===ic.cited?"cited":"not-cited",Q=D?.visibilityState??(ie==="visible"?"visible":ie==="pending"?"pending":"not-visible"),le=_b(pe||C.runs),te=zb(pe||C.runs),ue=j3(C,R),ne=(pe??C.runs).map(Ue=>({runId:Ue.runId,citationState:Ue.citationState,createdAt:Ue.createdAt,model:ue.get(Ue.runId)??null,answerMentioned:Ue.answerMentioned,visibilityState:Ue.visibilityState,visibilityTransition:Ue.visibilityTransition,mentionState:Ue.mentionState,mentionTransition:Ue.mentionTransition})),_e=N3(ne),tt=$==="provider"&&_e.length<=1?"model":$,xe=k3(ne);l.push({id:`evidence_${e}_${c++}`,query:C.query,provider:D?.provider??R,model:D?.model??null,location:D?.location??X,citationState:Qe,answerMentioned:D?.answerMentioned,visibilityState:Q,visibilityChangeLabel:Cb(de,te,{positive:"visible",negative:"not visible",first:"first visibility"}),changeLabel:Cb(F,le),answerSnippet:D?.answerText??"",citedDomains:D?.citedDomains??[],evidenceUrls:[],competitorDomains:D?.competitorOverlap??[],recommendedCompetitors:D?.recommendedCompetitors??[],matchedTerms:D?.matchedTerms??[],relatedTechnicalSignals:[],groundingSources:D?.groundingSources??[],summary:A3(Q,de,C.query),runHistory:ne,historyScope:tt,modelsSeen:_e,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 j3(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 N3(e){const n=new Set;for(const i of e)i.model&&n.add(i.model);return[...n]}function k3(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 _b(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 zb(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 Cb(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 A3(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 t1(e){const n=F0(e.project),i=w3(n.name,e.timeline,e.latestRunDetails,e.queries),l=[...e.runs].sort((c,d)=>d.createdAt.localeCompare(c.createdAt)).map(c=>fp(c,e.project.displayName||e.project.name));return e.overview?_3(n,e.overview,i,l):z3(n,i,l)}function _3(e,n,i,r){const l=y3(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 z3(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 C3(e){const n=F0(e.project),i=[...e.runs].sort((w,_)=>_.createdAt.localeCompare(w.createdAt)),r=i.find(w=>w.kind===Ee["answer-visibility"])??i[0],l=e.project.displayName||e.project.name,c=r?fp(r,l):T3(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 T3(e,n){return{id:"none",projectId:e,projectName:n,kind:Ee["answer-visibility"],kindLabel:"No runs yet",status:It.queued,trigger:Rs.manual,createdAt:"",startedAt:"",duration:"",statusDetail:"",summary:"No runs yet",triggerLabel:""}}function E3(e,n){const i=[],r=[],l=[];for(const d of e){r.push(t1(d)),l.push(C3(d));const m=[...d.runs].sort((g,b)=>b.createdAt.localeCompare(g.createdAt));for(const g of m)i.push(fp(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?O3(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 O3(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 n1=U.createContext(null);n1.Provider;function uo(){return U.useContext(n1)}function xc(e){const i=uo()?.dashboard??null,r=cn({...rp({client:ae}),enabled:!i,refetchInterval:uk}),l=cn({...lp({client:ae,query:{kind:"answer-visibility"}}),enabled:!i,staleTime:io,refetchInterval:C=>C.state.data?.some(R=>R.status==="running"||R.status==="queued")?3e3:io}),c=cn({...dO({client:ae}),enabled:!i}),d=r.data??[],m=l.data??[],g=ow({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,H)=>H.createdAt.localeCompare(G.createdAt)),R=T.length>0?T[0].id:"no-run";return{queryKey:["project-overview-slim",C.id,R],queryFn:async()=>{const G=await hv(C.name).catch(()=>null);return{project:C,runs:N,queries:[],competitors:[],timeline:[],latestRunDetails:[],previousRunDetails:[],gscCoverage:null,bingCoverage:null,dbInsights:null,overview:G}},enabled:!i&&r.isSuccess&&l.isSuccess,staleTime:gf}})}),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 E3(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:_}}function D3(e){const n=uo(),i=U.useMemo(()=>!n||!e?null:n.dashboard.projects.find(C=>C.project.name===e)??null,[n,e]),r=cn({...lO({client:ae,path:{name:e??""}}),enabled:!!e&&!i,staleTime:gf,refetchOnWindowFocus:"always"}),l=cn({...lp({client:ae,query:{kind:"answer-visibility"}}),enabled:!!e,staleTime:io,refetchOnWindowFocus:"always",refetchInterval:C=>C.state.data?.some(R=>R.projectId===r.data?.id&&(R.status==="running"||R.status==="queued"))?3e3:io}),c=r.data??null,d=U.useMemo(()=>c?(l.data??[]).filter(C=>C.projectId===c.id):[],[c,l.data]),{latestRunIds:m,previousRunIds:g,latestRunIdsKey:b}=U.useMemo(()=>{const C=d.filter(H=>(H.status==="completed"||H.status==="partial")&&H.kind==="answer-visibility"&&H.trigger!=="probe").sort((H,K)=>K.createdAt.localeCompare(H.createdAt)),N=C[0]?.createdAt??null,T=N?C.filter(H=>H.createdAt===N).map(H=>H.id):[],R=C.find(H=>H.createdAt!==N)?.createdAt??null,G=R?C.filter(H=>H.createdAt===R).map(H=>H.id):[];return{latestRunIds:T,previousRunIds:G,latestRunIdsKey:[...T].sort().join(",")}},[d]),v=cn({queryKey:["project-dashboard-full",c?.id??null,b||"none"],queryFn:async()=>{if(!c||!e)return null;const[C,N,T,R,G,H,K,X,J]=await Promise.all([RN(e).catch(()=>[]),MN(e).catch(()=>[]),BN(e).catch(()=>[]),m.length?Promise.all(m.map(D=>Fl(D).catch(()=>null))).then(D=>D.filter(M=>M!=null)):Promise.resolve([]),g.length?Promise.all(g.map(D=>Fl(D).catch(()=>null))).then(D=>D.filter(M=>M!=null)):Promise.resolve([]),YN(e).catch(()=>null),FN(e).catch(()=>null),ek(e).catch(()=>null),hv(e).catch(()=>null)]);return{project:c,runs:d,queries:C,competitors:N,timeline:T,latestRunDetails:R,previousRunDetails:G,gscCoverage:H,bingCoverage:K,dbInsights:X,overview:J}},enabled:!!c&&!!e&&l.isSuccess,staleTime:gf,refetchOnWindowFocus:"always",refetchInterval:dk}),S=U.useMemo(()=>v.data?t1({...v.data,runs:d}):i||null,[v.data,d,i]),w=U.useCallback(async()=>{await Promise.all([r.refetch(),l.refetch(),v.refetch()])},[r.refetch,l.refetch,v.refetch]),_=!S&&(r.isLoading||l.isLoading||v.isLoading);return{commandCenter:S,project:c,isLoading:_,isError:r.isError||l.isError||v.isError,refetch:w}}const R3=["health"];async function M3(){const e=await nk("/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 pp(e,n){return cn({queryKey:R3,queryFn:M3,enabled:e,refetchInterval:15e3,initialData:n})}function B3(e){return cn({..._0({client:ae,path:{id:e??""}}),enabled:!!e,refetchInterval:n=>{const i=n.state.data?.status;return i==="running"||i==="queued"?3e3:!1}})}function mp(){const e=dc(),n=lw({strict:!1}),i=cw({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 L3={negative:"toast-card-negative",caution:"toast-card-caution",positive:"toast-card-positive",neutral:"toast-card-neutral"};function q3(e){if(e.cta)return`${e.cta.label}: ${e.title}`}function $3(){const e=U.useSyncExternalStore(lk,Ry,Ry),n=dc(),{openRun:i}=mp(),r=U.useCallback(c=>{hf(c)},[]),l=U.useCallback(c=>{c.cta&&(c.cta.intent==="open-run-drawer"?i(c.cta.runId):n({to:"/runs"}),hf(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 ${L3[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":q3(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 hp(e){try{return await e.json()}catch{return{}}}function U3(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,"")+"/api/v1":"/api/v1"}const gp=U3();function yp(e){(e===401||e===403)&&Bf()}async function Tb(e){const n=await fetch(`${gp}/projects/${encodeURIComponent(e)}/agent/transcript`,{credentials:"include"});if(!n.ok){yp(n.status);const i=await hp(n);throw new In(i.error?.message??`transcript fetch failed: ${n.status}`,n.status,i.error?.code)}return await n.json()}async function V3(e){const n=await fetch(`${gp}/projects/${encodeURIComponent(e)}/agent/transcript`,{method:"DELETE",credentials:"include"});if(!n.ok){yp(n.status);const i=await hp(n);throw new In(i.error?.message??`reset failed: ${n.status}`,n.status,i.error?.code)}}async function G3({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(`${gp}/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){yp(g.status);const _=await hp(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 R of T.split(`
|
|
61
|
+
`)){if(!R.startsWith("data:"))continue;const G=R.slice(5).trim();if(G)try{d(JSON.parse(G))}catch{}}N=S.indexOf(`
|
|
62
|
+
|
|
63
|
+
`)}}}finally{c?.removeEventListener("abort",w);try{b.releaseLock()}catch{}}}function a1(e){return!e||e.role!=="assistant"?"":e.content.filter(n=>n.type==="text").map(n=>n.text).join("")}const I3=[{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?"}],H3=[{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"}],Vl=e=>`canonry:aero:provider:${e}`,Eb=e=>`canonry:aero:scope:${e}`;function Z3({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),[R,G]=U.useState(()=>typeof window>"u"?null:window.localStorage.getItem(Vl(e))??null),[H,K]=U.useState(()=>typeof window>"u"?"read-only":window.localStorage.getItem(Eb(e))==="all"?"all":"read-only"),X=U.useRef(null),J=U.useRef(null),D=U.useRef(null),[M,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 H3.filter(te=>te.command.startsWith(le)||te.label.toLowerCase().includes(le.slice(1)))},[m]);U.useEffect(()=>{oe(Q=>Ne.length===0?0:Math.min(Q,Ne.length-1))},[Ne.length]);const Ae=cn({...UO({client:ae,path:{name:e}}),enabled:n,staleTime:6e4}),ve=U.useMemo(()=>{const Q=Ae.data?.providers??[];if(R){const te=Q.find(ue=>ue.id===R&&ue.configured);if(te)return te}const le=Ae.data?.defaultProvider;return le?Q.find(te=>te.id===le)??null:null},[R,Ae.data]);U.useEffect(()=>{if(!Ae.data||!R)return;Ae.data.providers.find(le=>le.id===R&&le.configured)||(G(null),window.localStorage.removeItem(Vl(e)))},[Ae.data,R,e]);const et=U.useCallback(Q=>{G(Q),!(typeof window>"u")&&(Q?window.localStorage.setItem(Vl(e),Q):window.localStorage.removeItem(Vl(e)))},[e]),re=U.useCallback(()=>{K(Q=>{const le=Q==="all"?"read-only":"all";return typeof window<"u"&&window.localStorage.setItem(Eb(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||Tb(e).then(ne=>{Q||d(ne.messages)}).catch(ne=>{Q||T(ne instanceof Error?ne.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=J.current;Q&&(Q.scrollTop=Q.scrollHeight)},[c,_,S]);async function pe(Q){const le=Q.trim();if(!le||b)return;T(null),g(""),v(!0),C(""),w([]);const te={role:"user",content:le,timestamp:Date.now()};d(ne=>[...ne,te]);const ue=new AbortController;X.current=ue;try{await G3({project:e,prompt:le,provider:R??void 0,scope:H,signal:ue.signal,onEvent:$});const ne=await Tb(e);d(ne.messages)}catch(ne){ne.name!=="AbortError"&&T(ne instanceof Error?ne.message:"Prompt failed")}finally{v(!1),C(""),X.current=null}}function $(Q){switch(Q.type){case"message_update":C(a1(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(te=>te.id===Q.toolCallId?{...te,endedAt:Date.now(),isError:Q.isError,result:Q.result}:te));break;case"error":T(Q.message);break}}async function F(){X.current?.abort();try{await V3(e),d([]),T(null)}catch(Q){T(Q instanceof Error?Q.message:"Reset failed")}}const de=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",ie=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",Qe=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:ie,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(qy,{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(P3,{providers:Ae.data?.providers??[],active:ve,override:R,onPick:et,disabled:b}),f.jsx("button",{type:"button",onClick:xn(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(vv,{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(Yk,{className:"h-3.5 w-3.5","aria-hidden":"true"}):f.jsx(Zk,{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:J,className:Qe,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}),de&&!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:I3.map(Q=>f.jsx("button",{type:"button",onClick:()=>{pe(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))})]}),J3(c,e,R,H),S.length>0&&f.jsx("div",{className:"mt-3 space-y-1.5",children:S.map(Q=>f.jsx(i1,{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(s1,{content:_})]}),b&&!_&&S.every(Q=>Q.endedAt!==void 0)&&f.jsx(tD,{})]}),f.jsx(K3,{projectName:e,activeProvider:ve,scope:H,onToggleScope:re,disabled:b}),f.jsxs("div",{className:"relative",children:[Ne.length>0&&f.jsx(Q3,{matches:Ne,selectedIndex:M,onHover:oe,onPick:Q=>{g(""),D.current?.focus(),Q.action==="clear"?F():pe(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[M];g(""),le.action==="clear"?F():pe(le.prompt);return}pe(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[M];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[M];g(""),le.action==="clear"?F():pe(le.prompt)}else pe(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(jk,{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(qy,{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 P3({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(zk,{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(bv,{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:Y3(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 K3({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 Q3({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 Y3(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 X3(e,n){const i=e.timestamp??0;return`${e.role}:${i}:${n}`}function J3(e,n,i,r){const l=[];for(let c=0;c<e.length;c++){const d=e[c],m=X3(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(F3,{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=eD(d,g,d.timestamp??0),S=a1(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(i1,{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(s1,{content:S})]})]},m)),c=b-1;continue}}return l}function F3({text:e,projectName:n,providerOverride:i,scope:r}){const[l,c]=U.useState(!1),d=U.useMemo(()=>W3(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:xn(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(bv,{className:"h-2.5 w-2.5 text-emerald-400","aria-hidden":"true"}),"Copied"]}):f.jsxs(f.Fragment,{children:[f.jsx(Ek,{className:"h-2.5 w-2.5","aria-hidden":"true"}),"Copy as CLI"]})})]}),f.jsx("div",{className:"whitespace-pre-wrap",children:e})]})}function W3(e,n,i,r){const l=["canonry","agent","ask",Ob(e),Ob(n)];return i&&l.push("--provider",i),r==="read-only"&&l.push("--scope","read-only"),l.join(" ")}function Ob(e){return`'${e.replace(/'/g,"'\\''")}'`}function eD(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 i1({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(Ik,{className:"h-3 w-3 animate-spin text-emerald-400","aria-hidden":"true"}):l?f.jsx(Sv,{className:"h-3 w-3 text-rose-400","aria-hidden":"true"}):f.jsx(c2,{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(Uf,{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:Db(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:Db(e.result)})]})]})]})}function Db(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 s1({content:e}){return f.jsx("div",{className:"aero-markdown text-zinc-100",children:f.jsx(hw,{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 tD(){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 nD(){const e=Qb(),n=/^\/projects\/([^/]+)/.exec(e.pathname),i=n?decodeURIComponent(n[1]):null,r=cn({...rp({client:ae}),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(Z3,{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 wc(e,n,i){switch(e.invalidateQueries({queryKey:op({client:ae})}),e.invalidateQueries({queryKey:Ks({client:ae})}),n){case Ee["answer-visibility"]:case Ee["site-audit"]:case Ee["backlink-extract"]:return;case Ee["gsc-sync"]:case Ee["inspect-sitemap"]:Fr(e,"getApiV1ProjectsByNameGoogleGsc");return;case Ee["ga-sync"]:Fr(e,"getApiV1ProjectsByNameGa");return;case Ee["traffic-sync"]:Fr(e,"getApiV1ProjectsByNameGa"),Fr(e,"getApiV1ProjectsByNameTraffic");return;case Ee["bing-inspect"]:case Ee["bing-inspect-sitemap"]:Fr(e,"getApiV1ProjectsByNameBing");return;case Ee["aeo-discover-seed"]:case Ee["aeo-discover-probe"]:return;default:return n}}const Rb=[{label:"GitHub",href:"https://github.com/AINYC/canonry",Icon:Mk},{label:"Docs",href:"https://github.com/AINYC/canonry/tree/main/docs",Icon:kk},{label:"Changelog",href:"https://github.com/AINYC/canonry/releases",Icon:Dk}],Mb=e=>({label:e,state:"checking",detail:"Checking service health"}),aD={apiStatus:Mb("API"),workerStatus:Mb("Worker")};function iD(e){switch(e){case Ee["answer-visibility"]:return"Visibility sweep";case Ee["gsc-sync"]:return"GSC sync";case Ee["inspect-sitemap"]:return"Sitemap inspection";case Ee["ga-sync"]:return"GA sync";case Ee["traffic-sync"]:return"Traffic sync";case Ee["bing-inspect"]:return"Bing URL inspection";case Ee["bing-inspect-sitemap"]:return"Bing sitemap inspection";case Ee["site-audit"]:return"Site audit";case Ee["backlink-extract"]:return"Backlink extract";case Ee["aeo-discover-seed"]:return"Discovery (seed phase)";case Ee["aeo-discover-probe"]:return"Discovery (probe phase)"}}function sD(e){return e==="completed"?"positive":e==="partial"?"caution":"negative"}function rD(e){const n=iD(e.kind);return e.status==="completed"?`${n} completed`:e.status==="partial"?`${n} completed with partial results`:e.status==="cancelled"?`${n} cancelled`:`${n} failed`}function oD(e,n){return e.error?`${n}: ${Yf(e.error)}`:e.location?`${n} · ${e.location}`:n}function lD(e,n,i){if(n)return n;const r=i.find(l=>l.id===e);return r?.displayName||r?.name||e}function cD(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 uD(e){return e.failed>0||e.cancelled>0?"negative":e.partial>0?"caution":"positive"}function dD(){const e=Ka(),n=U.useSyncExternalStore(YO,Ni,Ni),i=Object.keys(n.runs).length>0||Object.keys(n.batches).length>0,r=cn({...lp({client:ae}),enabled:i,staleTime:io,refetchInterval:3e3}),l=cn({...rp({client:ae}),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||!FO(w.status)||(c.current[w.id]??S.lastAnnouncedStatus)===w.status)continue;const C=g.find(T=>T.id===w.projectId);if(C&&wc(e,w.kind,C.name),S.sourceAction==="run-all"){hb(w.id);continue}const N=lD(w.projectId,S.projectLabel,g);un({title:rD(w),detail:oD(w,N),tone:sD(w.status),dedupeKey:`run:${w.id}`,dedupeMode:"replace",cta:{label:"View run",intent:"open-run-drawer",runId:w.id}}),hb(w.id)}for(const S of Object.values(n.batches)){const w=WO(S.runIds,b);w.finished&&(un({title:"Run-all batch finished",detail:cD(w,S.skippedCount),tone:uD(w),dedupeKey:`batch:${S.batchId}`,dedupeMode:"replace",cta:{label:"View runs",intent:"go-to-runs"}}),JO(S.batchId))}c.current=v},[l.data,r.data,n,e]),null}function fD(){const e=uo(),{dashboard:n,isLoading:i,refetch:r}=xc(),d=pp(!e,e?.health).data??e?.health??aD,m=Qb(),{runId:g,evidenceId:b,closeDrawer:v}=mp(),[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,R=T&&T.latest!==_,G=()=>{if(T){try{window.localStorage.setItem("canonry:dismissedUpdateVersion",T.latest)}catch{}C(T.latest)}},H=B3(g),K=H.data??null,X=H.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 re=pe=>{pe.key==="Escape"&&v()};return window.addEventListener("keydown",re),()=>{window.removeEventListener("keydown",re)}},[g,b,v]);const J=n??e?.dashboard??null,D=m.pathname==="/setup"&&J!==null&&J.portfolioOverview.projects.length===0,M=g&&J?c3(J,g):void 0,oe=U.useMemo(()=>m.pathname.match(/^\/projects\/([^/]+)/)?.[1]??null,[m.pathname]),Ne=U.useMemo(()=>!oe||!J?null:J.projects.find(re=>re.project.id===oe)?.project.name??null,[oe,J]),{commandCenter:Ae}=D3(Ne),ve=U.useMemo(()=>{if(b)return d3(Ae,J,b)},[b,Ae,J]),et=(()=>{const re=m.pathname;if(re==="/")return"Portfolio";if(re==="/projects")return"Projects";if(re==="/runs")return"Runs";if(re==="/settings")return"Settings";if(re==="/setup")return"Setup";if(re==="/backlinks")return"Backlinks";if(re==="/traffic"||re.startsWith("/traffic/"))return"Server traffic";if(re.startsWith("/projects/")){const $=re.split("/").filter(Boolean)[1];if($&&J){const F=J.projects.find(de=>de.project.id===$);if(F)return F.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(Nb,{version:d.apiStatus.version,updateAvailable:R?T:null,onDismissUpdate:G})}),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($k,{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(Lk,{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(Jk,{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(e2,{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(Vk,{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(s2,{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(re=>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+re*15}%`}})]},re))]}):J&&J.projects.length>0?f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"sidebar-section-title",children:"Projects"}),J.projects.map(re=>{const pe=re.visibilitySummary.tone;return f.jsxs(rt,{to:"/projects/$projectId",params:{projectId:re.project.id},className:"sidebar-project",activeProps:{className:"sidebar-project sidebar-project-active"},children:[f.jsx("span",{className:`sidebar-dot sidebar-dot-${pe}`}),f.jsx("span",{children:re.project.displayName||re.project.name})]},re.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(n2,{className:"sidebar-icon"}),f.jsx("span",{children:"Setup"})]})]})]}),f.jsx("div",{className:"sidebar-footer",children:Rb.map(({label:re,href:pe,Icon:$})=>f.jsx("a",{className:"sidebar-footer-icon",href:pe,target:"_blank",rel:"noopener noreferrer",title:re,"aria-label":re,children:f.jsx($,{className:"size-4"})},pe))})]}),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(Nb,{compact:!0})}),f.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[f.jsx(rt,{to:"/",children:"Home"}),f.jsx(Uf,{className:"breadcrumb-sep size-3"}),f.jsx("span",{className:"breadcrumb-current",children:et})]})]}),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(re=>!re),children:[f.jsx(Kk,{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"}),J&&J.projects.length>0?f.jsxs("div",{className:"mobile-nav-section",children:[f.jsx("p",{className:"mobile-nav-section-title",children:"Projects"}),J.projects.map(re=>f.jsx(rt,{to:"/projects/$projectId",params:{projectId:re.project.id},className:"mobile-nav-link",children:re.project.name},re.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(re=>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"})]},re))}),f.jsx("div",{className:"page-skeleton-grid",style:{gridTemplateColumns:"1fr 1fr"},children:[1,2].map(re=>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(pe=>f.jsx("div",{className:"skeleton-text-sm w-full"},pe))})]},re))})]}):f.jsx(Yb,{})}),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:Rb.map(({label:re,href:pe,Icon:$})=>f.jsx("a",{href:pe,target:"_blank",rel:"noopener noreferrer",title:re,"aria-label":re,className:"footer-icon",children:f.jsx($,{className:"size-3.5"})},pe))})]})]}),M?f.jsxs(W4,{open:!0,title:M.summary,subtitle:`${M.projectName} · ${M.kindLabel}`,onClose:v,children:[f.jsxs("div",{className:"flex flex-wrap items-center gap-x-5 gap-y-1 text-sm",children:[f.jsx(dp,{status:M.status}),f.jsx("span",{className:"text-zinc-400",children:M.startedAt}),f.jsx("span",{className:"text-zinc-500",children:M.duration}),f.jsx("span",{className:"text-zinc-600",children:M.triggerLabel})]}),M.status==="failed"&&M.statusDetail&&f.jsx("p",{className:"text-sm text-rose-300/80 mt-2",children:M.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(re=>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:re.query??"Unknown query"}),f.jsxs("div",{className:"flex items-center gap-1.5",children:[f.jsx(P4,{provider:re.provider}),f.jsx(K0,{variant:re.citationState===ic.cited?"success":"neutral",children:re.citationState})]})]}),re.model&&f.jsx("p",{className:"text-[11px] text-zinc-500 font-mono",children:re.model}),re.citedDomains.length>0&&f.jsxs("p",{className:"text-xs text-zinc-500 mt-1",children:[f.jsx("span",{className:"text-zinc-400",children:"Sources:"})," ",re.citedDomains.join(", ")]}),re.competitorOverlap.length>0&&f.jsxs("p",{className:"text-xs text-rose-400/80 mt-0.5",children:["Competitor cited: ",re.competitorOverlap.join(", ")]}),re.groundingSources&&re.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:[re.groundingSources.length," grounding source",re.groundingSources.length!==1?"s":""]}),f.jsx("ul",{className:"mt-1 space-y-0.5",children:re.groundingSources.map((pe,$)=>f.jsx("li",{className:"text-xs text-zinc-500 truncate",children:f.jsx("a",{href:pe.uri,target:"_blank",rel:"noopener noreferrer",className:"hover:text-zinc-300",children:pe.title||pe.uri})},$))})]}),re.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:re.answerText})]})]},re.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:rO(K.error)})]}):f.jsx("p",{className:"text-sm text-zinc-500",children:"No snapshot data available."})]})]}):null,ve?f.jsx(a3,{evidence:ve.evidence,project:ve.project,onClose:v}):null,f.jsx(dD,{}),f.jsx($3,{}),f.jsx(nD,{})]})}class pD 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(Sv,{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(vv,{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 wn=U.forwardRef(({className:e,...n},i)=>f.jsx("div",{ref:i,className:_n("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}));wn.displayName="Card";const Nf=U.forwardRef(({className:e,...n},i)=>f.jsx("div",{ref:i,className:_n("flex flex-col gap-1.5 p-5",e),...n}));Nf.displayName="CardHeader";const kf=U.forwardRef(({className:e,...n},i)=>f.jsx("h3",{ref:i,className:_n("font-medium tracking-tight text-zinc-50",e),...n}));kf.displayName="CardTitle";const Af=U.forwardRef(({className:e,...n},i)=>f.jsx("p",{ref:i,className:_n("text-sm text-zinc-500",e),...n}));Af.displayName="CardDescription";const Ql=U.forwardRef(({className:e,...n},i)=>f.jsx("div",{ref:i,className:_n("p-5 pt-0",e),...n}));Ql.displayName="CardContent";function mD({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 hD({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," · ",A0(e.lastRun.status)]})]})}),f.jsx("div",{className:"project-row-chart",children:f.jsx(mD,{points:e.trend,tone:z0(e.lastRun.status)})}),f.jsx("span",{className:"project-row-link",children:f.jsx(Uf,{className:"h-4 w-4 text-zinc-500"})})]})}function gD(){const e=uo(),{dashboard:n,isLoading:i}=xc(),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=pp(!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=GO(l.systemHealth,m,r.settings),{openRun:b}=mp();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(hD,{project:v},v.project.id))}):f.jsxs(wn,{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(dp,{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(wn,{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(Bn,{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 bp=Symbol.for("yaml.alias"),_f=Symbol.for("yaml.document"),Ha=Symbol.for("yaml.map"),r1=Symbol.for("yaml.pair"),Hn=Symbol.for("yaml.scalar"),Qs=Symbol.for("yaml.seq"),kn=Symbol.for("yaml.node.type"),Ci=e=>!!e&&typeof e=="object"&&e[kn]===bp,jc=e=>!!e&&typeof e=="object"&&e[kn]===_f,fo=e=>!!e&&typeof e=="object"&&e[kn]===Ha,vt=e=>!!e&&typeof e=="object"&&e[kn]===r1,nt=e=>!!e&&typeof e=="object"&&e[kn]===Hn,po=e=>!!e&&typeof e=="object"&&e[kn]===Qs;function yt(e){if(e&&typeof e=="object")switch(e[kn]){case Ha:case Qs:return!0}return!1}function bt(e){if(e&&typeof e=="object")switch(e[kn]){case bp:case Ha:case Hn:case Qs:return!0}return!1}const o1=e=>(nt(e)||yt(e))&&!!e.anchor,vi=Symbol("break visit"),yD=Symbol("skip children"),no=Symbol("remove node");function Ys(e,n){const i=bD(n);jc(e)?Ts(null,e.contents,i,Object.freeze([e]))===no&&(e.contents=null):Ts(null,e,i,Object.freeze([]))}Ys.BREAK=vi;Ys.SKIP=yD;Ys.REMOVE=no;function Ts(e,n,i,r){const l=vD(e,n,i,r);if(bt(l)||vt(l))return SD(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 bD(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 vD(e,n,i,r){if(typeof i=="function")return i(e,n,r);if(fo(n))return i.Map?.(e,n,r);if(po(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 SD(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(jc(r))r.contents=i;else{const l=Ci(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${l} parent`)}}const xD={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},wD=e=>e.replace(/[!,[\]{}]/g,n=>xD[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+wD(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 l1(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 c1(e){const n=new Set;return Ys(e,{Value(i,r){r.anchor&&n.add(r.anchor)}}),n}function u1(e,n){for(let i=1;;++i){const r=`${e}${i}`;if(!n.has(r))return r}}function jD(e,n){const i=[],r=new Map;let l=null;return{onAnchor:c=>{i.push(c),l??(l=c1(e));const d=u1(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 Nn(e,n,i){if(Array.isArray(e))return e.map((r,l)=>Nn(r,String(l),i));if(e&&typeof e.toJSON=="function"){if(!i||!o1(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 vp{constructor(n){Object.defineProperty(this,kn,{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(!jc(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=Nn(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 Sp extends vp{constructor(n){super(bp),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)||o1(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||(Nn(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=Yl(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(l1(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 Yl(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=Yl(e,l,i);c>r&&(r=c)}return r}else if(vt(n)){const r=Yl(e,n.key,i),l=Yl(e,n.value,i);return Math.max(r,l)}return 1}const d1=e=>!e||typeof e!="function"&&typeof e!="object";class ke extends vp{constructor(n){super(Hn),this.value=n}toJSON(n,i){return i?.keep?this.value:Nn(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 ND="tag:yaml.org,2002:";function kD(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 oo(e,n,i){if(jc(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 Sp(g.anchor);g={anchor:null,node:null},m.set(e,g)}n?.startsWith("!!")&&(n=ND+n.slice(2));let b=kD(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 cc(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 oo(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 f1 extends vp{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,cc(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,cc(this.schema,l,i));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${l}`)}}}const AD=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,p1="flow",zf="block",Xl="quoted";function Nc(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,R=-1;i===zf&&(N=Bb(e,N,n.length),N!==-1&&(S=N+g));for(let H;H=e[N+=1];){if(i===Xl&&H==="\\"){switch(T=N,e[N+1]){case"x":N+=3;break;case"u":N+=5;break;case"U":N+=9;break;default:N+=1}R=N}if(H===`
|
|
69
|
+
`)i===zf&&(N=Bb(e,N,n.length)),S=N+n.length+g,w=void 0;else{if(H===" "&&_&&_!==" "&&_!==`
|
|
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===Xl){for(;_===" "||_===" ";)_=H,H=e[N+=1],C=!0;const K=N>R+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}_=H}if(C&&m&&m(),b.length===0)return e;d&&d();let G=e.slice(0,b[0]);for(let H=0;H<b.length;++H){const K=b[H],X=b[H+1]||e.length;K===0?G=`
|
|
72
|
+
${n}${e.slice(0,X)}`:(i===Xl&&v[K]&&(G+=`${e[K]}\\`),G+=`
|
|
73
|
+
${n}${e.slice(K+1,X)}`)}return G}function Bb(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 kc=(e,n)=>({indentAtStart:n?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),Ac=e=>/^(%|---|\.\.\.)/m.test(e);function _D(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||(Ac(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:Nc(d,c,Xl,kc(n,!1))}function Cf(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||(Ac(e)?" ":""),r="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
80
|
+
${i}`)+"'";return n.implicitKey?r:Nc(r,i,p1,kc(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=Cf:c&&!l?r=ao:r=i?Cf:ao}return r(e,n)}let Tf;try{Tf=new RegExp(`(^|(?<!
|
|
81
|
+
))
|
|
82
|
+
+(?!
|
|
83
|
+
|$)`,"g")}catch{Tf=/\n+(?!\n|$)/g}function Jl({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||Ac(i)?" ":""),v=d==="literal"?!0:d==="folded"||n===ke.BLOCK_FOLDED?!1:n===ke.BLOCK_LITERAL?!0:!_D(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(Tf,`$&${b}`));let N=!1,T,R=-1;for(T=0;T<i.length;++T){const X=i[T];if(X===" ")N=!0;else if(X===`
|
|
89
|
+
`)R=T;else break}let G=i.substring(0,R<T?R+1:T);G&&(i=i.substring(G.length),G=G.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 J=!1;const D=kc(r,!0);d!=="folded"&&n!==ke.BLOCK_FOLDED&&(D.onOverflow=()=>{J=!0});const M=Nc(`${G}${X}${_}`,b,zf,D);if(!J)return`>${K}
|
|
91
|
+
${b}${M}`}return i=i.replace(/\n+/g,`$&${b}`),`|${K}
|
|
92
|
+
${b}${G}${i}${_}`}function zD(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):Jl(e,n,i,r);if(!m&&!v&&l!==ke.PLAIN&&c.includes(`
|
|
95
|
+
`))return Jl(e,n,i,r);if(Ac(c)){if(g==="")return n.forceBlockIndent=!0,Jl(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:Nc(S,g,p1,kc(n,!1))}function xp(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):Jl(d,n,i,r);case ke.QUOTE_DOUBLE:return ao(d.value,n);case ke.QUOTE_SINGLE:return Cf(d.value,n);case ke.PLAIN:return zD(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 m1(e,n){const i=Object.assign({blockQuote:!0,commentString:AD,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 CD(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 TD(e,n,{anchors:i,doc:r}){if(!r.directives)return"";const l=[],c=(nt(e)||yt(e))&&e.anchor;c&&l1(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=CD(n.doc.schema.tags,c));const d=TD(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)?xp(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 ED({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 R,G,H;bt(n)?(R=!!n.spaceBefore,G=n.commentBefore,H=n.comment):(R=!1,G=null,H=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&&!_&&po(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 J=" ";if(w||R||G){if(J=R?`
|
|
99
|
+
`:"",G){const D=b(G);J+=`
|
|
100
|
+
${pa(D,i.indent)}`}X===""&&!i.inFlow?J===`
|
|
101
|
+
`&&H&&(J=`
|
|
102
|
+
|
|
103
|
+
`):J+=`
|
|
104
|
+
${i.indent}`}else if(!_&&yt(n)){const D=X[0],M=X.indexOf(`
|
|
105
|
+
`),oe=M!==-1,Ne=i.inFlow??n.flow??n.items.length===0;if(oe||!Ne){let Ae=!1;if(oe&&(D==="&"||D==="!")){let ve=X.indexOf(" ");D==="&"&&ve!==-1&&ve<M&&X[ve+1]==="!"&&(ve=X.indexOf(" ",ve+1)),(ve===-1||M<ve)&&(Ae=!0)}Ae||(J=`
|
|
106
|
+
${i.indent}`)}}else(X===""||X[0]===`
|
|
107
|
+
`)&&(J="");return T+=J+X,i.inFlow?K&&r&&r():H&&!K?T+=Si(T,i.indent,b(H)):N&&l&&l(),T}function OD(e,n){(e==="debug"||e==="warn")&&console.warn(n)}const Gl="<<",ma={identify:e=>e===Gl||typeof e=="symbol"&&e.description===Gl,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new ke(Symbol(Gl)),{addToJSMap:h1}),stringify:()=>Gl},DD=(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 h1(e,n,i){if(i=e&&Ci(i)?i.resolve(e.doc):i,po(i))for(const r of i.items)rf(e,n,r);else if(Array.isArray(i))for(const r of i)rf(e,n,r);else rf(e,n,i)}function rf(e,n,i){const r=e&&Ci(i)?i.resolve(e.doc):i;if(!fo(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 g1(e,n,{key:i,value:r}){if(bt(i)&&i.addToJSMap)i.addToJSMap(e,n,r);else if(DD(e,i))h1(e,n,r);else{const l=Nn(i,"",e);if(n instanceof Map)n.set(l,Nn(r,l,e));else if(n instanceof Set)n.add(l);else{const c=RD(i,l,e),d=Nn(r,c,e);c in n?Object.defineProperty(n,c,{value:d,writable:!0,enumerable:!0,configurable:!0}):n[c]=d}}return n}function RD(e,n,i){if(n===null)return"";if(typeof n!="object")return String(n);if(bt(e)&&i?.doc){const r=m1(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)+'..."'),OD(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 wp(e,n,i){const r=oo(e,void 0,i),l=oo(n,void 0,i);return new Ht(r,l)}class Ht{constructor(n,i=null){Object.defineProperty(this,kn,{value:r1}),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 g1(i,r,this)}toString(n,i,r){return n?.doc?ED(this,n,i,r):JSON.stringify(this)}}function y1(e,n,i){return(n.inFlow??e.flow?BD:MD)(e,n,i)}function MD({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(""),uc(i,w,N.commentBefore,S),N.comment&&(T=N.comment);else if(vt(N)){const G=bt(N.key)?N.key:null;G&&(!S&&G.spaceBefore&&w.push(""),uc(i,w,G.commentBefore,S))}S=!1;let R=Us(N,v,()=>T=null,()=>S=!0);T&&(R+=Si(R,c,b(T))),S&&T&&(S=!1),w.push(r+R)}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 BD({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(""),uc(n,S,N.commentBefore,!1),N.comment&&(T=N.comment);else if(vt(N)){const G=bt(N.key)?N.key:null;G&&(G.spaceBefore&&S.push(""),uc(n,S,G.commentBefore,!1),G.comment&&(b=!0));const H=bt(N.value)?N.value:null;H?(H.comment&&(T=H.comment),H.commentBefore&&(b=!0)):N.value==null&&G?.comment&&(T=G.comment)}T&&(b=!0);let R=Us(N,g,()=>T=null);C<e.length-1&&(R+=","),T&&(R+=Si(R,r,m(T))),!b&&(S.length>v||R.includes(`
|
|
111
|
+
`))&&(b=!0),S.push(R),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 uc({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 jn extends f1{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(wp(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)&&d1(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)g1(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})),y1(this,n,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:n.indent||"",onChompKeep:r,onComment:i})}}const Xs={collection:"map",default:!0,nodeClass:jn,tag:"tag:yaml.org,2002:map",resolve(e,n){return fo(e)||n("Expected a mapping for this tag"),e},createNode:(e,n,i)=>jn.from(e,n,i)};class ki extends f1{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=Il(n);return typeof i!="number"?!1:this.items.splice(i,1).length>0}get(n,i){const r=Il(n);if(typeof r!="number")return;const l=this.items[r];return!i&&nt(l)?l.value:l}has(n){const i=Il(n);return typeof i=="number"&&i<this.items.length}set(n,i){const r=Il(n);if(typeof r!="number")throw new Error(`Expected a valid index, not ${n}.`);const l=this.items[r];nt(l)&&d1(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(Nn(c,String(l++),i));return r}toString(n,i,r){return n?y1(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(oo(m,void 0,r))}}return c}}function Il(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 po(e)||n("Expected a sequence for this tag"),e},createNode:(e,n,i)=>ki.from(e,n,i)},_c={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),xp(e,n,i,r)}},zc={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"&&zc.test.test(e)?e:n.options.nullStr},jp={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&&jp.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 Ln({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 b1={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:Ln},v1={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():Ln(e)}},S1={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:Ln},Cc=e=>typeof e=="bigint"||Number.isInteger(e),Np=(e,n,i,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(n),i);function x1(e,n,i){const{value:r}=e;return Cc(r)&&r>=0?i+r.toString(n):Ln(e)}const w1={identify:e=>Cc(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,n,i)=>Np(e,2,8,i),stringify:e=>x1(e,8,"0o")},j1={identify:Cc,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,n,i)=>Np(e,0,10,i),stringify:Ln},N1={identify:e=>Cc(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,n,i)=>Np(e,2,16,i),stringify:e=>x1(e,16,"0x")},LD=[Xs,Js,_c,zc,jp,w1,j1,N1,b1,v1,S1];function Lb(e){return typeof e=="bigint"||Number.isInteger(e)}const Hl=({value:e})=>JSON.stringify(e),qD=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:Hl},{identify:e=>e==null,createNode:()=>new ke(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Hl},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:Hl},{identify:Lb,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})=>Lb(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:Hl}],$D={default:!0,tag:"",test:/^/,resolve(e,n){return n(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},UD=[Xs,Js].concat(qD,$D),kp={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 xp({comment:e,type:n,value:m},r,l,c)}};function k1(e,n){if(po(e))for(let i=0;i<e.items.length;++i){let r=e.items[i];if(!vt(r)){if(fo(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 A1(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(wp(m,g,i))}return l}const Ap={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:k1,createNode:A1};class Ms extends ki{constructor(){super(),this.add=jn.prototype.add.bind(this),this.delete=jn.prototype.delete.bind(this),this.get=jn.prototype.get.bind(this),this.has=jn.prototype.has.bind(this),this.set=jn.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=Nn(l.key,"",i),d=Nn(l.value,c,i)):c=Nn(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=A1(n,i,r),c=new this;return c.items=l.items,c}}Ms.tag="tag:yaml.org,2002:omap";const _p={collection:"seq",identify:e=>e instanceof Map,nodeClass:Ms,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,n){const i=k1(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 _1({value:e,source:n},i){return n&&(e?z1:C1).test.test(n)?n:e?i.options.trueStr:i.options.falseStr}const z1={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:_1},C1={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:_1},VD={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:Ln},GD={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():Ln(e)}},ID={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:Ln},mo=e=>typeof e=="bigint"||Number.isInteger(e);function Tc(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 zp(e,n,i){const{value:r}=e;if(mo(r)){const l=r.toString(n);return r<0?"-"+i+l.substr(1):i+l}return Ln(e)}const HD={identify:mo,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,n,i)=>Tc(e,2,2,i),stringify:e=>zp(e,2,"0b")},ZD={identify:mo,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,n,i)=>Tc(e,1,8,i),stringify:e=>zp(e,8,"0")},PD={identify:mo,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,n,i)=>Tc(e,0,10,i),stringify:Ln},KD={identify:mo,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,n,i)=>Tc(e,2,16,i),stringify:e=>zp(e,16,"0x")};class Bs extends jn{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(wp(d,null,r));return c}}Bs.tag="tag:yaml.org,2002:set";const Cp={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(fo(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 Tp(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 T1(e){let{value:n}=e,i=d=>d;if(typeof n=="bigint")i=d=>BigInt(d);else if(isNaN(n)||!isFinite(n))return Ln(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 E1={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})=>Tp(e,i),stringify:T1},O1={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=>Tp(e,!1),stringify:T1},Ec={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(Ec.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=Tp(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$/,"")??""},qb=[Xs,Js,_c,zc,z1,C1,HD,ZD,PD,KD,VD,GD,ID,kp,ma,_p,Ap,Cp,E1,O1,Ec],$b=new Map([["core",LD],["failsafe",[Xs,Js,_c]],["json",UD],["yaml11",qb],["yaml-1.1",qb]]),Ub={binary:kp,bool:jp,float:S1,floatExp:v1,floatNaN:b1,floatTime:O1,int:j1,intHex:N1,intOct:w1,intTime:E1,map:Xs,merge:ma,null:zc,omap:_p,pairs:Ap,seq:Js,set:Cp,timestamp:Ec},QD={"tag:yaml.org,2002:binary":kp,"tag:yaml.org,2002:merge":ma,"tag:yaml.org,2002:omap":_p,"tag:yaml.org,2002:pairs":Ap,"tag:yaml.org,2002:set":Cp,"tag:yaml.org,2002:timestamp":Ec};function of(e,n,i){const r=$b.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($b.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"?Ub[d]:d;if(!m){const g=JSON.stringify(d),b=Object.keys(Ub).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 YD=(e,n)=>e.key<n.key?-1:e.key>n.key?1:0;class Ep{constructor({compat:n,customTags:i,merge:r,resolveKnownTags:l,schema:c,sortMapEntries:d,toStringDefaults:m}){this.compat=Array.isArray(n)?of(n,"compat"):n?of(null,n):null,this.name=typeof c=="string"&&c||"core",this.knownTags=l?QD:{},this.tags=of(i,this.name,r),this.toStringOptions=m??null,Object.defineProperty(this,Ha,{value:Xs}),Object.defineProperty(this,Hn,{value:_c}),Object.defineProperty(this,Qs,{value:Js}),this.sortMapEntries=typeof d=="function"?d:d===!0?YD:null}clone(){const n=Object.create(Ep.prototype,Object.getOwnPropertyDescriptors(this));return n.tags=this.tags.slice(),n}}function XD(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=m1(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 Oc{constructor(n,i,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,kn,{value:_f});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(Oc.prototype,{[kn]:{value:_f}});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=c1(this);n.anchor=!i||r.has(i)?u1(i||"a",r):i}return new Sp(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=G=>typeof G=="number"||G instanceof String||G instanceof Number,R=i.filter(T).map(String);R.length>0&&(i=i.concat(R)),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:_}=jD(this,d||"a"),C={aliasDuplicateObjects:c??!0,keepUndefined:g??!1,onAnchor:S,onTagObj:b,replacer:l,schema:this.schema,sourceObjects:_},N=oo(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=cc(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=cc(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 Ep(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=Nn(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 XD(this,n)}}function As(e){if(yt(e))return!0;throw new Error("Expected a YAML collection as document contents")}class D1 extends Error{constructor(n,i,r,l){super(),this.name=n,this.code=r,this.message=l,this.pos=i}}class Zl extends D1{constructor(n,i,r){super("YAMLParseError",n,i,r)}}class JD extends D1{constructor(n,i,r){super("YAMLWarning",n,i,r)}}const Vb=(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,R=null,G=null,H=null,K=null,X=null;for(const M of e)switch(C&&(M.type!=="space"&&M.type!=="newline"&&M.type!=="comma"&&c(M.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),C=!1),N&&(b&&M.type!=="comment"&&M.type!=="newline"&&c(N,"TAB_AS_INDENT","Tabs are not allowed as indentation"),N=null),M.type){case"space":!n&&(i!=="doc-start"||r?.type!=="flow-collection")&&M.source.includes(" ")&&(N=M),v=!0;break;case"comment":{v||c(M,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const oe=M.source.substring(1)||" ";S?S+=w+oe:S=oe,w="",b=!1;break}case"newline":b?S?S+=M.source:(!K||i!=="seq-item-ind")&&(g=!0):w+=M.source,b=!0,_=!0,(T||R)&&(G=M),v=!0;break;case"anchor":T&&c(M,"MULTIPLE_ANCHORS","A node can have at most one anchor"),M.source.endsWith(":")&&c(M.offset+M.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),T=M,X??(X=M.offset),b=!1,v=!1,C=!0;break;case"tag":{R&&c(M,"MULTIPLE_TAGS","A node can have at most one tag"),R=M,X??(X=M.offset),b=!1,v=!1,C=!0;break}case i:(T||R)&&c(M,"BAD_PROP_ORDER",`Anchors and tags must be after the ${M.source} indicator`),K&&c(M,"UNEXPECTED_TOKEN",`Unexpected ${M.source} in ${n??"collection"}`),K=M,b=i==="seq-item-ind"||i==="explicit-key-ind",v=!1;break;case"comma":if(n){H&&c(M,"UNEXPECTED_TOKEN",`Unexpected , in ${n}`),H=M,b=!1,v=!1;break}default:c(M,"UNEXPECTED_TOKEN",`Unexpected ${M.type} token`),b=!1,v=!1}const J=e[e.length-1],D=J?J.offset+J.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:H,found:K,spaceBefore:g,comment:S,hasNewline:_,anchor:T,tag:R,newlineAfterProp:G,end:D,start:X??D}}function lo(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(lo(n.key)||lo(n.value))return!0}return!1;default:return!0}}function Ef(e,n,i){if(n?.type==="flow-collection"){const r=n.end[0];r.indent===e&&(r.source==="]"||r.source==="}")&&lo(n)&&i(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function R1(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 Gb="All mapping items must start at the same column";function FD({composeNode:e,composeEmptyNode:n},i,r,l,c){const d=c?.nodeClass??jn,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",Gb)),!N.anchor&&!N.tag&&!_){b=N.end,N.comment&&(m.comment?m.comment+=`
|
|
127
|
+
`+N.comment:m.comment=N.comment);continue}(N.newlineAfterProp||lo(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",Gb);i.atKey=!0;const R=N.end,G=w?e(i,w,N,l):n(i,R,S,null,N,l);i.schema.compat&&Ef(r.indent,w,l),i.atKey=!1,R1(i,m.items,G)&&l(R,"DUPLICATE_KEY","Map keys must be unique");const H=Vs(_??[],{indicator:"map-value-ind",next:C,offset:G.range[2],onError:l,parentIndent:r.indent,startOnNewline:!w||w.type==="block-scalar"});if(g=H.end,H.found){T&&(C?.type==="block-map"&&!H.hasNewline&&l(g,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),i.options.strict&&N.start<H.found.offset-1024&&l(G.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,H,l):n(i,g,_,null,H,l);i.schema.compat&&Ef(r.indent,C,l),g=K.range[2];const X=new Ht(G,K);i.options.keepSourceTokens&&(X.srcToken=v),m.items.push(X)}else{T&&l(G.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),H.comment&&(G.comment?G.comment+=`
|
|
128
|
+
`+H.comment:G.comment=H.comment);const K=new Ht(G);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 WD({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&&Ef(r.indent,S,l),g=_.range[2],m.items.push(_)}return m.range=[r.offset,g,b??g],m}function ho(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 lf="Block collections are not allowed within flow collections",cf=e=>e&&(e.type==="block-map"||e.type==="block-seq");function e5({composeNode:e,composeEmptyNode:n},i,r,l,c){const d=r.start.source==="{",m=d?"flow map":"flow sequence",g=c?.nodeClass??(d?jn: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 R=r.items[T],{start:G,key:H,sep:K,value:X}=R,J=Vs(G,{flow:m,indicator:"explicit-key-ind",next:H??K?.[0],offset:S,onError:l,parentIndent:r.indent,startOnNewline:!1});if(!J.found){if(!J.anchor&&!J.tag&&!K&&!X){T===0&&J.comma?l(J.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${m}`):T<r.items.length-1&&l(J.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${m}`),J.comment&&(b.comment?b.comment+=`
|
|
129
|
+
`+J.comment:b.comment=J.comment),S=J.end;continue}!d&&i.options.strict&&lo(H)&&l(H,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(T===0)J.comma&&l(J.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${m}`);else if(J.comma||l(J.start,"MISSING_CHAR",`Missing , between ${m} items`),J.comment){let D="";e:for(const M of G)switch(M.type){case"comma":case"space":break;case"comment":D=M.source.substring(1);break e;default:break e}if(D){let M=b.items[b.items.length-1];vt(M)&&(M=M.value??M.key),M.comment?M.comment+=`
|
|
130
|
+
`+D:M.comment=D,J.comment=J.comment.substring(D.length+1)}}if(!d&&!K&&!J.found){const D=X?e(i,X,J,l):n(i,J.end,K,null,J,l);b.items.push(D),S=D.range[2],cf(X)&&l(D.range,"BLOCK_IN_FLOW",lf)}else{i.atKey=!0;const D=J.end,M=H?e(i,H,J,l):n(i,D,G,null,J,l);cf(H)&&l(M.range,"BLOCK_IN_FLOW",lf),i.atKey=!1;const oe=Vs(K??[],{flow:m,indicator:"map-value-ind",next:X,offset:M.range[2],onError:l,parentIndent:r.indent,startOnNewline:!1});if(oe.found){if(!d&&!J.found&&i.options.strict){if(K)for(const ve of K){if(ve===oe.found)break;if(ve.type==="newline"){l(ve,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}J.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?cf(X)&&l(Ne.range,"BLOCK_IN_FLOW",lf):oe.comment&&(M.comment?M.comment+=`
|
|
131
|
+
`+oe.comment:M.comment=oe.comment);const Ae=new Ht(M,Ne);if(i.options.keepSourceTokens&&(Ae.srcToken=R),d){const ve=b;R1(i,ve.items,M)&&l(D,"DUPLICATE_KEY","Map keys must be unique"),ve.items.push(Ae)}else{const ve=new jn(i.schema);ve.flow=!0,ve.items.push(Ae);const et=(Ne??M).range;ve.range=[M.range[0],et[1],et[2]],b.items.push(ve)}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),R=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",R),_&&_.source.length!==1&&C.unshift(_)}if(C.length>0){const T=ho(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 uf(e,n,i,r,l,c){const d=i.type==="block-map"?FD(e,n,i,r,c):i.type==="block-seq"?WD(e,n,i,r,c):e5(e,n,i,r,c),m=d.constructor;return l==="!"||l===m.tagName?(d.tag=m.tagName,d):(l&&(d.tag=l),d)}function t5(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===jn.tagName&&m==="map"||d===ki.tagName&&m==="seq")return uf(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),uf(e,n,i,l,d)}const b=uf(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 n5(e,n,i){const r=n.offset,l=a5(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?i5(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,R]=d[N];if(R===""||R==="\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+R.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,R]=d[N];b+=T.length+R.length+1;const G=R[R.length-1]==="\r";if(G&&(R=R.slice(0,-1)),R&&T.length<g){const K=`Block scalar lines must not be less indented than their ${l.indent?"explicit indentation indicator":"first line"}`;i(b-R.length-(G?2:1),"BAD_INDENT",K),T=""}c===ke.BLOCK_LITERAL?(S+=w+T.slice(g)+R,w=`
|
|
135
|
+
`):T.length>g||R[0]===" "?(w===" "?w=`
|
|
136
|
+
`:!_&&w===`
|
|
137
|
+
`&&(w=`
|
|
138
|
+
|
|
139
|
+
`),S+=w+T.slice(g)+R,w=`
|
|
140
|
+
`,_=!0):R===""?w===`
|
|
141
|
+
`?S+=`
|
|
142
|
+
`:w=`
|
|
143
|
+
`:(S+=w+R,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 a5({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 i5(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 s5(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=r5(c,b);break;case"single-quoted-scalar":m=ke.QUOTE_SINGLE,g=o5(c,b);break;case"double-quoted-scalar":m=ke.QUOTE_DOUBLE,g=l5(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=ho(d,v,n,i);return{value:g,type:m,comment:S.comment,range:[r,v,S.offset]}}function r5(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}`),M1(e)}function o5(e,n){return(e[e.length-1]!=="'"||e.length===1)&&n(e.length,"MISSING_CHAR","Missing closing 'quote"),M1(e.slice(1,-1)).replace(/''/g,"'")}function M1(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 l5(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}=c5(e,r);i+=c,r=d}else if(l==="\\"){let c=e[++r];const d=u5[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+=d5(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 c5(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 u5={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
162
|
+
`,r:"\r",t:" ",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function d5(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 B1(e,n,i,r){const{value:l,type:c,comment:d,range:m}=n.type==="block-scalar"?n5(e,n,r):s5(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=f5(e.schema,l,g,i,r):n.type==="scalar"?b=p5(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 f5(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 p5({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 m5(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 h5={composeNode:L1,composeEmptyNode:Op};function L1(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=g5(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=B1(e,n,g,r),m&&(b.anchor=m.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":b=t5(h5,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=Op(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 Op(e,n,i,r,{spaceBefore:l,comment:c,anchor:d,tag:m,end:g},b){const v={type:"scalar",offset:m5(n,i,r),indent:-1,source:""},S=B1(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 g5({options:e},{offset:n,source:i,end:r},l){const c=new Sp(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=ho(r,d,e.strict,l);return c.range=[n,d,m.offset],m.comment&&(c.comment=m.comment),c}function y5(e,n,{offset:i,start:r,value:l,end:c},d){const m=Object.assign({_directives:n},e),g=new Oc(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?L1(b,l,v,d):Op(b,v.end,r,null,v,d);const S=g.contents.range[2],w=ho(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 Ib(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 b5{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 JD(d,r,l)):this.errors.push(new Zl(d,r,l))},this.directives=new Gt({version:n.version||"1.2"}),this.options=n}decorate(n,i){const{comment:r,afterEmptyLine:l}=Ib(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:Ib(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=y5(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 Zl(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 Zl(Wr(n),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;const i=ho(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 Zl(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 Oc(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 q1="\uFEFF",$1="",U1="",Of="";function v5(e){switch(e){case q1:return"byte-order-mark";case $1:return"doc-mode";case U1:return"flow-error-end";case Of: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 Rn(e){switch(e){case void 0:case" ":case`
|
|
172
|
+
`:case"\r":case" ":return!0;default:return!1}}const Hb=new Set("0123456789ABCDEFabcdef"),S5=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Pl=new Set(",[]{}"),x5=new Set(` ,[]{}
|
|
173
|
+
\r `),df=e=>!e||x5.has(e);class w5{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==="...")&&Rn(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]===q1&&(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 $1,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==="...")&&Rn(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&&!Rn(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===":")&&Rn(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(df),"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("..."))&&Rn(l[3]))&&!(r===this.indentNext-1&&this.flowLevel===1&&(l[0]==="]"||l[0]==="}")))return this.flowLevel=0,yield U1,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(df),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const d=this.charAt(1);if(this.flowKey||Rn(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=>Rn(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 Of,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(Rn(c)||n&&Pl.has(c))break;i=r}else if(Rn(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&&Pl.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&&Pl.has(l))break;i=r}return!l&&!this.atEnd?this.setNext("plain-scalar"):(yield Of,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(df))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const n=this.flowLevel>0,i=this.charAt(1);if(Rn(i)||n&&Pl.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(;!Rn(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(S5.has(i))i=this.buffer[++n];else if(i==="%"&&Hb.has(this.buffer[n+1])&&Hb.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 j5{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 Zb(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 V1(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 Kl(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 Pb(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,V1(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 N5{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 w5,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=v5(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"&&Pb(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&&Zb(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":{Zb(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=Kl(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(V1(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=Kl(r),c=_s(l);Pb(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=Kl(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=Kl(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 k5(e){const n=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||n&&new j5||null,prettyErrors:n}}function A5(e,n={}){const{lineCounter:i,prettyErrors:r}=k5(n),l=new N5(i?.addNewLine),c=new b5(n),d=Array.from(c.compose(l.parse(e)));if(r&&i)for(const m of d)m.errors.forEach(Vb(e,i)),m.warnings.forEach(Vb(e,i));return d.length>0?d:Object.assign([],{empty:!0},c.streamInfo())}function _5({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=A5(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 PN(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&&(un({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:xn(b),children:r?"Applying...":"Apply"})})]})}function z5(){const{dashboard:e,isLoading:n,refetch:i}=xc();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=dc(),[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"),[R,G]=U.useState(!1),[H,K]=U.useState(null),X=m.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),J=async()=>{if(!(!X||!S)){G(!0),K(null);try{const D=await co(X,{displayName:b||m,canonicalDomain:S,country:_,language:N});un({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{G(!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(Ly,{className:"size-4 mr-1.5"}),"Add project"]})})]}),c?f.jsxs(wn,{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())})]})]})]}),H?f.jsx("p",{className:"text-rose-400 text-sm mt-3",children:H}):null,f.jsxs("div",{className:"flex items-center gap-3 mt-4",children:[f.jsx(Le,{type:"button",disabled:!X||!S||R,onClick:xn(J),children:R?"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 M=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(Bn,{tone:D.mentionSummary.tone,children:D.mentionSummary.value})}),f.jsx("td",{className:"text-zinc-500 text-sm",children:M?f.jsx(dp,{status:M.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(wn,{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(Ly,{className:"size-4 mr-1.5"}),"Add project"]})]}),f.jsx(_5,{onApplied:()=>{i()}})]})}function G1(e){e.invalidateQueries({queryKey:op({client:ae})}),e.invalidateQueries({queryKey:Ks({client:ae})})}function C5(e){return e==="gsc-sync"?"GSC sync queued":e==="inspect-sitemap"?"Sitemap inspection queued":"Visibility sweep queued"}function T5(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 Dc(e,n){E0({id:e.id,projectId:e.projectId,kind:e.kind,projectLabel:n.projectLabel,sourceAction:n.sourceAction,lastAnnouncedStatus:"queued"}),un({title:C5(e.kind),detail:T5(n.projectLabel,e.kind),tone:"neutral",dedupeKey:`run:${e.id}`,dedupeMode:"replace"})}function E5(e){const n=e.filter(l=>l.status!=="conflict"),i=e.filter(l=>l.status==="conflict");if(n.length===0){un({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)E0({id:l.id,projectId:l.projectId,kind:l.kind,projectLabel:l.projectName,sourceAction:"run-all",lastAnnouncedStatus:"queued"});const r=XO({runIds:n.map(l=>l.id),queuedCount:n.length,skippedCount:i.length});un({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 Rc(e,n){if(e instanceof In&&e.code==="RUN_IN_PROGRESS"){un({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}un({title:e instanceof Error?e.message:"Failed to queue run",tone:"negative"})}function O5(){const e=Ka();return Ai({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:n,opts:i})=>VN(n,i),onSuccess:(n,i)=>{G1(e),Dc(n,{projectLabel:i.projectLabel??i.projectName,sourceAction:i.sourceAction})},onError:(n,i)=>{Rc(n,{projectKey:i.projectName,projectLabel:i.projectLabel??i.projectName,sourceAction:i.sourceAction})}})}function u6(){const e=Ka();return Ai({meta:{skipGlobalErrorToast:!0},mutationFn:n=>KN(n),onSuccess:n=>{G1(e),E5(n)},onError:n=>{un({title:n instanceof Error?n.message:"Failed to queue runs",tone:"negative"})}})}function d6(){const e=Ka();return Ai({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:n,opts:i})=>QN(n,i),onSuccess:(n,i)=>{wc(e,Ee["gsc-sync"],i.projectName),Dc(n,{projectLabel:i.projectLabel??i.projectName,sourceAction:"gsc-sync"})},onError:(n,i)=>{Rc(n,{projectKey:i.projectName,projectLabel:i.projectLabel??i.projectName,sourceAction:"gsc-sync"})}})}function f6(){const e=Ka();return Ai({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:n})=>JN(n),onSuccess:(n,i)=>{wc(e,n.run.kind,i.projectName),Dc(n.run,{projectLabel:i.projectLabel??i.projectName,sourceAction:"discover-sitemaps"})},onError:(n,i)=>{Rc(n,{projectKey:i.projectName,projectLabel:i.projectLabel??i.projectName,sourceAction:"discover-sitemaps"})}})}function p6(){const e=Ka();return Ai({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:n,opts:i})=>XN(n,i),onSuccess:(n,i)=>{wc(e,Ee["inspect-sitemap"],i.projectName),Dc(n,{projectLabel:i.projectLabel??i.projectName,sourceAction:"inspect-sitemap"})},onError:(n,i)=>{Rc(n,{projectKey:i.projectName,projectLabel:i.projectLabel??i.projectName,sourceAction:"inspect-sitemap"})}})}function I1(e){if(!Array.isArray(e.queryKey)||e.queryKey.length<=1)return!1;const n=e.queryKey[0];return n==="projects"||n==="project-dashboard-full"}function m6(){const e=Ka();return Ai({mutationFn:({projectName:n,queries:i})=>qN(n,i),onSuccess:()=>{e.invalidateQueries({queryKey:Ks({client:ae})}),e.invalidateQueries({predicate:I1})}})}function h6(){const e=Ka();return Ai({mutationFn:({projectName:n,body:i})=>$N(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:I1})}})}const D5=[{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 R5({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 M5(){const e=uo(),{dashboard:n,isLoading:i,refetch:r}=xc(),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=pp(!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=HO(l.setup,g,c),v=dc(),[S,w]=U.useState(0),[_,C]=U.useState(""),[N,T]=U.useState(""),[R,G]=U.useState(""),[H,K]=U.useState("US"),[X,J]=U.useState("en"),[D,M]=U.useState(!1),[oe,Ne]=U.useState(null),[Ae,ve]=U.useState(null),[et,re]=U.useState(null),[pe,$]=U.useState(!1),[F,de]=U.useState(""),[je,ie]=U.useState(!1),[Qe,Q]=U.useState(null),[le,te]=U.useState(!1),ue=c.providerStatuses.filter(ee=>ee.state==="ready"),[ne,_e]=U.useState(ue[0]?.name??""),[tt,xe]=U.useState(5),[Ue,Ze]=U.useState(!1),[Ct,zn]=U.useState(null),[Tt,Fs]=U.useState(""),[Ei,Mc]=U.useState(!1),[Ws,Oi]=U.useState(null),[Di,Ri]=U.useState(!1),[go,Bc]=U.useState(!1),[Lt,yo]=U.useState(!1),[er,bo]=U.useState(null),Mi=O5(),Lc=cn({..._0({client:ae,path:{id:er??""}}),enabled:!!er,refetchInterval:({state:ee})=>{const Fe=ee.data?.status;return Fe==="completed"||Fe==="partial"||Fe==="failed"||Fe==="cancelled"?!1:2e3},refetchIntervalInBackground:!0}),[Bi,vo]=U.useState(""),[tr,ga]=U.useState(!1),[qt,Cn]=U.useState(null),mt=_.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),qn=F.split(`
|
|
203
|
+
`).map(ee=>ee.trim()).filter(Boolean),Fa=Tt.split(`
|
|
204
|
+
`).map(ee=>ee.trim()).filter(Boolean),qc=b.healthChecks.some(ee=>ee.id==="api"&&ee.state==="ready"),Li=async()=>{if(!(!mt||!R)){$(!0),re(null);try{const ee=await co(mt,{displayName:N||_,canonicalDomain:R,country:H,language:X,autoExtractBacklinks:D});Ne(mt),ve(ee.id),un({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){re(ee instanceof Error?ee.message:"Failed to create project")}finally{$(!1)}}},qi=async()=>{if(!oe)return;const ee=qn;if(ee.length!==0){te(!0),Q(null);try{await LN(oe,ee),ie(!0),await r(),w(3)}catch(Fe){Q(Fe instanceof Error?Fe.message:"Failed to save queries")}finally{te(!1)}}},$i=async()=>{if(!(!oe||!ne)){Ze(!0),zn(null);try{const ee=await ZN(oe,ne,tt);if(ee.queries.length>0){const Fe=F?F.trimEnd()+`
|
|
205
|
+
`+ee.queries.join(`
|
|
206
|
+
`):ee.queries.join(`
|
|
207
|
+
`);de(Fe)}}catch(ee){zn(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 UN(oe,ee),Mc(!0),await r(),w(4)}catch(Fe){Oi(Fe instanceof Error?Fe.message:"Failed to save competitors")}finally{Ri(!1)}}},Ui=async()=>{const ee=Bi.trim();if(ee){ga(!0),Cn(null);try{await HN("gemini",{apiKey:ee}),un({title:"Gemini configured",detail:"Provider is ready — continuing setup.",tone:"positive",dedupeKey:"setup:gemini:configured",dedupeMode:"drop"}),vo(""),await r()}catch(Fe){Cn(Fe instanceof Error?Fe.message:"Failed to save Gemini key")}finally{ga(!1)}}},Wa=async()=>{if(oe){yo(!0);try{const ee=await Mi.mutateAsync({projectName:oe,projectLabel:N||_||oe,sourceAction:"setup-launch"});bo(ee.id),Bc(!0),await r()}catch{}finally{yo(!1)}}},Kn=()=>w(ee=>Math.max(0,ee-1)),So=(()=>{switch(S){case 0:return f.jsxs(wn,{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:Fe=>vo(Fe.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:xn(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(Bn,{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:!qc,onClick:()=>w(1),children:"Continue"})]})]});case 1:return f.jsxs(wn,{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(Bn,{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:R,onChange:ee=>G(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:H,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=>J(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=>M(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"})]})]})]}),et?f.jsx("p",{className:"text-rose-400 text-sm",children:et}):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||!R||pe,onClick:xn(Li),children:pe?"Creating...":"Create project"})]})]})]});case 2:return f.jsxs(wn,{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(Bn,{tone:"positive",children:[qn.length," saved"]}):f.jsxs(Bn,{tone:"neutral",children:[qn.length," quer",qn.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:qn.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:ne,onChange:ee=>_e(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:Ue||!ne,onClick:xn($i),children:Ue?"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=>de(ee.target.value)})]}),Qe?f.jsx("p",{className:"text-rose-400 text-sm",children:Qe}):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:qn.length===0||le,onClick:xn(qi),children:le?"Saving...":`Save ${qn.length} quer${qn.length!==1?"ies":"y"}`})]})]})]});case 3:return f.jsxs(wn,{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(Bn,{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:xn(Pn),children:Di?"Saving...":`Save ${Fa.length} competitor${Fa.length!==1?"s":""}`})]})]})]})]});case 4:{const ee=Lc.data,Fe=ee?.status==="completed"||ee?.status==="partial"||ee?.status==="failed"||ee?.status==="cancelled",ei=ee?.snapshots??[],xo=ei.filter(Tn=>Tn.citationState==="cited").length,wo=ei.filter(Tn=>Tn.answerMentioned===!0).length,nr=new Set(ei.map(Tn=>Tn.query).filter(Tn=>!!Tn)).size,ar=go?Fe&&(ee?.status==="completed"||ee?.status==="partial")?f.jsx(Bn,{tone:"positive",children:"Complete"}):Fe?f.jsx(Bn,{tone:"negative",children:"Failed"}):f.jsx(Bn,{tone:"caution",children:"Running"}):null;return f.jsxs(wn,{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]}),go?Fe?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:Ae?`/projects/${Ae}`:"/"})},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:[wo,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:[xo,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:Ae?`/projects/${Ae}`:"/"})},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:Ae?`/projects/${Ae}`:"/"})},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:xn(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(R5,{current:S,labels:D5}),f.jsx("section",{className:"setup-wizard",children:So})]})}function B5(){return f.jsx("div",{className:"page-container",children:f.jsx("section",{className:"page-section",children:f.jsxs(wn,{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-CD591qDz.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8]),import.meta.url),"ProjectPage"),L5=Gs(()=>Is(()=>import("./RunsPage-CvewepfU.js"),__vite__mapDeps([9,1,2,7,5,8]),import.meta.url),"RunsPage"),q5=Gs(()=>Is(()=>import("./SettingsPage-C7BvAhiB.js"),__vite__mapDeps([10,1,7,5,8]),import.meta.url),"SettingsPage"),$5=Gs(()=>Is(()=>import("./BacklinksPage-9TlM08Wf.js"),__vite__mapDeps([11,1,6,7,5,8]),import.meta.url),"BacklinksPage"),U5=Gs(()=>Is(()=>import("./TrafficPage-DC3NhFOh.js"),__vite__mapDeps([12,1,4,13,7,5,8]),import.meta.url),"TrafficPage"),V5=Gs(()=>Is(()=>import("./TrafficSourceDetailPage-BvtTA6rs.js"),__vite__mapDeps([14,1,3,4,5,13,7,8]),import.meta.url),"TrafficSourceDetailPage");function G5(){return f.jsx(pD,{children:f.jsx(fD,{})})}const Ft=uw()({component:G5,validateSearch:e=>({runId:typeof e.runId=="string"?e.runId:void 0,evidenceId:typeof e.evidenceId=="string"?e.evidenceId:void 0})}),I5=Bt({getParentRoute:()=>Ft,path:"/",component:gD,beforeLoad:({context:e})=>{const n=e.queryClient.getQueryData(Ks({client:ae}));if(n&&n.length===0)throw Xb({to:"/setup"})}}),H5=Bt({getParentRoute:()=>Ft,path:"/projects",component:z5}),Ja=Bt({getParentRoute:()=>Ft,path:"/projects/$projectId",component:()=>f.jsx(Yb,{})}),Z5=Bt({getParentRoute:()=>Ja,path:"/",component:()=>f.jsx(Ti,{tab:"overview"})}),P5=Bt({getParentRoute:()=>Ja,path:"/search-console",component:()=>f.jsx(Ti,{tab:"search-console"})}),K5=Bt({getParentRoute:()=>Ja,path:"/discovery",component:()=>f.jsx(Ti,{tab:"discovery"})}),Q5=Bt({getParentRoute:()=>Ja,path:"/report",component:()=>f.jsx(Ti,{tab:"report"})}),Y5=Bt({getParentRoute:()=>Ja,path:"/activity",component:()=>f.jsx(Ti,{tab:"activity"})}),X5=Bt({getParentRoute:()=>Ja,path:"/backlinks",component:()=>f.jsx(Ti,{tab:"backlinks"})}),J5=Bt({getParentRoute:()=>Ja,path:"/settings",component:()=>f.jsx(Ti,{tab:"settings"})}),F5=Bt({getParentRoute:()=>Ft,path:"/runs",component:L5}),W5=Bt({getParentRoute:()=>Ft,path:"/settings",component:q5,beforeLoad:({context:e})=>{}}),eR=Bt({getParentRoute:()=>Ft,path:"/setup",component:M5,beforeLoad:({context:e})=>{const n=e.queryClient.getQueryData(Ks({client:ae}));if(n&&n.length>0)throw Xb({to:"/"})}}),tR=Bt({getParentRoute:()=>Ft,path:"/backlinks",component:$5}),nR=Bt({getParentRoute:()=>Ft,path:"/traffic",component:U5}),aR=Bt({getParentRoute:()=>Ft,path:"/traffic/$projectName/$sourceId",component:V5}),iR=Bt({getParentRoute:()=>Ft,path:"*",component:B5}),sR=Ft.addChildren([I5,H5,Ja.addChildren([Z5,P5,K5,Q5,Y5,X5,J5]),F5,W5,eR,tR,nR,aR,iR]);function rR(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath:"/"}const Kb=rR(),oR=Kb==="/"?"":Kb.replace(/\/$/,"");function lR(e,n){return dw({routeTree:sR,basepath:oR||"/",context:{queryClient:e},...n?.initialEntries})}const cR=6e4;function uR(){const[e,n]=U.useState(Fd()?"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 R=fk();_.current=R,w.current=lR(R)}return{queryClient:_.current,router:w.current}};U.useEffect(()=>{if(Fd())return;let R=!1;return Oy().then(G=>{R||(G.authenticated?n("ready"):n(G.setupRequired?"setup":"login"))}).catch(G=>{R||(m(G instanceof Error?G.message:"Failed to reach the Canonry API"),n("login"))}),()=>{R=!0}},[]),U.useEffect(()=>{if(e!=="ready"||Fd())return;const R=setInterval(()=>{Oy().then(G=>{G.authenticated||(S(!0),n(G.setupRequired?"setup":"login"))}).catch(()=>{})},cR);return Ey(()=>{S(!0),n("login")}),()=>{clearInterval(R),Ey(null)}},[e]);const N=async R=>{if(R.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 GN(i.trim())).authenticated){m("Setup failed");return}r(""),c(""),S(!1),n("ready")}catch(G){m(G instanceof In||G instanceof Error?G.message:"Setup failed")}finally{b(!1)}},T=async R=>{if(R.preventDefault(),!!i.trim()){b(!0),m(null);try{if(!(await IN(i.trim())).authenticated){m("Incorrect password");return}r(""),S(!1),n("ready")}catch(G){m(G instanceof In||G instanceof Error?G.message:"Authentication failed")}finally{b(!1)}}};if(e==="ready"){const{queryClient:R,router:G}=C();return f.jsx(fw,{client:R,children:f.jsx(pw,{router:G})})}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(wn,{className:"surface-card w-full",children:e==="checking"?f.jsx(Ql,{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(Nf,{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"First-time setup"}),f.jsx(kf,{children:"Create a dashboard password"}),f.jsx(Af,{children:"Choose a password to protect the Canonry dashboard. You will use this to sign in on future visits."})]}),f.jsx(Ql,{children:f.jsxs("form",{className:"space-y-4",onSubmit:xn(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:R=>r(R.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:R=>c(R.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(Nf,{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"Dashboard access"}),f.jsx(kf,{children:"Sign in to Canonry"}),f.jsx(Af,{children:"Enter your dashboard password to continue."})]}),f.jsxs(Ql,{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:xn(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:R=>r(R.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 H1=document.getElementById("root");if(!H1)throw new Error("Expected #root element for web app bootstrap.");Sw.createRoot(H1).render(f.jsx(U.StrictMode,{children:f.jsx(uR,{})}));export{mM as $,NR as A,Le as B,ic as C,RM as D,BM as E,LM as F,bM as G,RR as H,Ul as I,DR as J,BR as K,un as L,IR as M,UM as N,VM as O,P4 as P,LR as Q,qM as R,sO as S,Bn as T,$M as U,MM as V,MR as W,qR as X,GM as Y,oM as Z,pM as _,l6 as a,QR as a$,In as a0,hM as a1,hR as a2,Ik as a3,zM as a4,Vk as a5,Jk as a6,Ee as a7,FO as a8,Fl as a9,_R as aA,zR as aB,EM as aC,CR as aD,TR as aE,OR as aF,ER as aG,uo as aH,rp as aI,D3 as aJ,O5 as aK,It as aL,BN as aM,wR as aN,gR as aO,yR as aP,jR as aQ,qN as aR,MN as aS,UN as aT,bR as aU,m6 as aV,dO as aW,IM as aX,ZM as aY,QN as aZ,PM as a_,gM as aa,gf as ab,e6 as ac,s6 as ad,r6 as ae,o6 as af,$R as ag,Ks as ah,UR as ai,op as aj,WM as ak,JR as al,h6 as am,wM as an,SM as ao,jM as ap,NM as aq,vM as ar,xM as as,xR as at,SR as au,vR as av,AR as aw,DM as ax,fb as ay,OM as az,Uf as b,KR as b0,KM as b1,HM as b2,_M as b3,HR as b4,ZR as b5,PR as b6,YR as b7,xc as b8,u6 as b9,N0 as bA,Hs as bB,t6 as bC,i6 as bD,iM as bE,nM as bF,aM as bG,tM as bH,n6 as bI,dp as ba,HN as bb,kR as bc,VR as bd,GR as be,pp as bf,XR as bg,$s as bh,pb as bi,sM as bj,lM as bk,uM as bl,dM as bm,Sv as bn,rM as bo,cM as bp,fM as bq,K4 as br,Y0 as bs,F4 as bt,X0 as bu,J0 as bv,Lk as bw,Ly as bx,a6 as by,kM as bz,at as c,JC as d,c6 as e,CM as f,wn as g,kb as h,xn as i,yM as j,QM as k,ae as l,YM as m,XM as n,FM as o,JM as p,FR as q,eM as r,WR as s,A0 as t,mp as u,d6 as v,f6 as w,p6 as x,AM as y,TM as z};
|