@ainyc/canonry 4.87.0 → 4.88.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/agent-workspace/skills/canonry/references/server-side-traffic.md +19 -0
- package/assets/assets/{BacklinksPage-BPvsw_Bi.js → BacklinksPage-Dpx6ylmU.js} +1 -1
- package/assets/assets/{ChartPrimitives-BdlKCq7y.js → ChartPrimitives-CG5EGu62.js} +1 -1
- package/assets/assets/{ProjectPage-1Q8YC9Vd.js → ProjectPage-B_xnYE7W.js} +1 -1
- package/assets/assets/{RunRow-DcSsnE5c.js → RunRow-C0V4vf-u.js} +1 -1
- package/assets/assets/{RunsPage-DKoIMkQL.js → RunsPage-9gWTjteG.js} +1 -1
- package/assets/assets/{SettingsPage-bH3PdNKb.js → SettingsPage-kBwz4Glg.js} +1 -1
- package/assets/assets/{TrafficPage-IW_DX-0V.js → TrafficPage-D4adjs8S.js} +1 -1
- package/assets/assets/TrafficSourceDetailPage-CmURRHaU.js +1 -0
- package/assets/assets/{arrow-left-B5Du72nk.js → arrow-left-DJ0-oFbd.js} +1 -1
- package/assets/assets/{extract-error-message-C7Vhd5zH.js → extract-error-message-DfBzETgi.js} +1 -1
- package/assets/assets/{index-C_ZzKZfM.js → index-BeuGfMy8.js} +53 -53
- package/assets/assets/{trash-2-DWcofmpv.js → trash-2-Bjf6mCqw.js} +1 -1
- package/assets/index.html +1 -1
- package/dist/{chunk-DUDFNP5Y.js → chunk-2VEFNAQ3.js} +4 -4
- package/dist/{chunk-MDRDX5R2.js → chunk-JZ67YCHT.js} +168 -0
- package/dist/{chunk-6XMXBAEW.js → chunk-RH3QYFX3.js} +1 -1
- package/dist/{chunk-5LW7CJAO.js → chunk-WMZJO56S.js} +30 -6
- package/dist/cli.js +13 -7
- package/dist/index.js +4 -4
- package/dist/{intelligence-service-XUKYOHKL.js → intelligence-service-WTEEV46F.js} +2 -2
- package/dist/mcp.js +2 -2
- package/package.json +9 -9
- package/assets/assets/TrafficSourceDetailPage-DRHOGn9B.js +0 -1
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ProjectPage-
|
|
2
|
-
import{c as
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ProjectPage-B_xnYE7W.js","./vendor-tanstack-Dq7p98wZ.js","./RunRow-C0V4vf-u.js","./ChartPrimitives-CG5EGu62.js","./extract-error-message-DfBzETgi.js","./vendor-recharts-ClRVR6aX.js","./trash-2-Bjf6mCqw.js","./vendor-radix-B57xfQbP.js","./vendor-markdown-DK7fbRNb.js","./RunsPage-9gWTjteG.js","./SettingsPage-kBwz4Glg.js","./BacklinksPage-Dpx6ylmU.js","./TrafficPage-D4adjs8S.js","./arrow-left-DJ0-oFbd.js","./TrafficSourceDetailPage-CmURRHaU.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{c as jw,d as Nw,Q as kw,M as Aw,r as q,q as Oe,j as f,L as rt,a as _w,e as _s,u as dn,f as Cw,h as hc,k as zw,l as Tw,m as cv,O as uv,n as Ja,o as zi,p as Ew,s as Ct,t as dv,v as Gs,x as Ow,y as Dw,z as Rw}from"./vendor-tanstack-Dq7p98wZ.js";import{S as Mw,O as If,P as fv,C as Vf,a as pv,T as Pf,D as mv,R as hv}from"./vendor-radix-B57xfQbP.js";import{c as gv}from"./vendor-recharts-ClRVR6aX.js";import{M as Bw}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 Fd={exports:{}},Jr={},Wd={exports:{}},ef={};var Ly;function Lw(){return Ly||(Ly=1,(function(e){function n($,W){var fe=$.length;$.push(W);e:for(;0<fe;){var je=fe-1>>>1,se=$[je];if(0<l(se,W))$[je]=W,$[fe]=se,fe=je;else break e}}function i($){return $.length===0?null:$[0]}function r($){if($.length===0)return null;var W=$[0],fe=$.pop();if(fe!==W){$[0]=fe;e:for(var je=0,se=$.length,Ze=se>>>1;je<Ze;){var F=2*(je+1)-1,ue=$[F],ee=F+1,de=$[ee];if(0>l(ue,fe))ee<se&&0>l(de,ue)?($[je]=de,$[ee]=fe,je=ee):($[je]=ue,$[F]=fe,je=F);else if(ee<se&&0>l(de,fe))$[je]=de,$[ee]=fe,je=ee;else break e}}return W}function l($,W){var fe=$.sortIndex-W.sortIndex;return fe!==0?fe:$.id-W.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,h=d.now();e.unstable_now=function(){return d.now()-h}}var g=[],b=[],S=1,x=null,N=3,A=!1,T=!1,k=!1,E=!1,R=typeof setTimeout=="function"?setTimeout:null,V=typeof clearTimeout=="function"?clearTimeout:null,G=typeof setImmediate<"u"?setImmediate:null;function Z($){for(var W=i(b);W!==null;){if(W.callback===null)r(b);else if(W.startTime<=$)r(b),W.sortIndex=W.expirationTime,n(g,W);else break;W=i(b)}}function X($){if(k=!1,Z($),!T)if(i(g)!==null)T=!0,J||(J=!0,ve());else{var W=i(b);W!==null&&me(X,W.startTime-$)}}var J=!1,O=-1,M=5,le=-1;function Ae(){return E?!0:!(e.unstable_now()-le<M)}function Ce(){if(E=!1,J){var $=e.unstable_now();le=$;var W=!0;try{e:{T=!1,k&&(k=!1,V(O),O=-1),A=!0;var fe=N;try{t:{for(Z($),x=i(g);x!==null&&!(x.expirationTime>$&&Ae());){var je=x.callback;if(typeof je=="function"){x.callback=null,N=x.priorityLevel;var se=je(x.expirationTime<=$);if($=e.unstable_now(),typeof se=="function"){x.callback=se,Z($),W=!0;break t}x===i(g)&&r(g),Z($)}else r(g);x=i(g)}if(x!==null)W=!0;else{var Ze=i(b);Ze!==null&&me(X,Ze.startTime-$),W=!1}}break e}finally{x=null,N=fe,A=!1}W=void 0}}finally{W?ve():J=!1}}}var ve;if(typeof G=="function")ve=function(){G(Ce)};else if(typeof MessageChannel<"u"){var tt=new MessageChannel,oe=tt.port2;tt.port1.onmessage=Ce,ve=function(){oe.postMessage(null)}}else ve=function(){R(Ce,0)};function me($,W){O=R(function(){$(e.unstable_now())},W)}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 N},e.unstable_next=function($){switch(N){case 1:case 2:case 3:var W=3;break;default:W=N}var fe=N;N=W;try{return $()}finally{N=fe}},e.unstable_requestPaint=function(){E=!0},e.unstable_runWithPriority=function($,W){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var fe=N;N=$;try{return W()}finally{N=fe}},e.unstable_scheduleCallback=function($,W,fe){var je=e.unstable_now();switch(typeof fe=="object"&&fe!==null?(fe=fe.delay,fe=typeof fe=="number"&&0<fe?je+fe:je):fe=je,$){case 1:var se=-1;break;case 2:se=250;break;case 5:se=1073741823;break;case 4:se=1e4;break;default:se=5e3}return se=fe+se,$={id:S++,callback:W,priorityLevel:$,startTime:fe,expirationTime:se,sortIndex:-1},fe>je?($.sortIndex=fe,n(b,$),i(g)===null&&$===i(b)&&(k?(V(O),O=-1):k=!0,me(X,fe-je))):($.sortIndex=se,n(g,$),T||A||(T=!0,J||(J=!0,ve()))),$},e.unstable_shouldYield=Ae,e.unstable_wrapCallback=function($){var W=N;return function(){var fe=N;N=W;try{return $.apply(this,arguments)}finally{N=fe}}}})(ef)),ef}var qy;function qw(){return qy||(qy=1,Wd.exports=Lw()),Wd.exports}var Uy;function Uw(){if(Uy)return Jr;Uy=1;var e=qw(),n=jw(),i=Nw();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 h(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,w=u.child;w;){if(w===s){y=!0,s=u,o=p;break}if(w===o){y=!0,o=u,s=p;break}w=w.sibling}if(!y){for(w=p.child;w;){if(w===s){y=!0,s=p,o=u;break}if(w===o){y=!0,o=p,s=u;break}w=w.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 S(t){var a=t.tag;if(a===5||a===26||a===27||a===6)return t;for(t=t.child;t!==null;){if(a=S(t),a!==null)return a;t=t.sibling}return null}var x=Object.assign,N=Symbol.for("react.element"),A=Symbol.for("react.transitional.element"),T=Symbol.for("react.portal"),k=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),V=Symbol.for("react.consumer"),G=Symbol.for("react.context"),Z=Symbol.for("react.forward_ref"),X=Symbol.for("react.suspense"),J=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),M=Symbol.for("react.lazy"),le=Symbol.for("react.activity"),Ae=Symbol.for("react.memo_cache_sentinel"),Ce=Symbol.iterator;function ve(t){return t===null||typeof t!="object"?null:(t=Ce&&t[Ce]||t["@@iterator"],typeof t=="function"?t:null)}var tt=Symbol.for("react.client.reference");function oe(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===tt?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case k:return"Fragment";case R:return"Profiler";case E:return"StrictMode";case X:return"Suspense";case J:return"SuspenseList";case le:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case T:return"Portal";case G:return t.displayName||"Context";case V:return(t._context.displayName||"Context")+".Consumer";case Z:var a=t.render;return t=t.displayName,t||(t=a.displayName||a.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case O:return a=t.displayName||null,a!==null?a:oe(t.type)||"Memo";case M:a=t._payload,t=t._init;try{return oe(t(a))}catch{}}return null}var me=Array.isArray,$=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,fe={pending:!1,data:null,method:null,action:null},je=[],se=-1;function Ze(t){return{current:t}}function F(t){0>se||(t.current=je[se],je[se]=null,se--)}function ue(t,a){se++,je[se]=t.current,t.current=a}var ee=Ze(null),de=Ze(null),ne=Ze(null),Ne=Ze(null);function nt(t,a){switch(ue(ne,a),ue(de,t),ue(ee,null),a.nodeType){case 9:case 11:t=(t=a.documentElement)&&(t=t.namespaceURI)?ry(t):0;break;default:if(t=a.tagName,a=a.namespaceURI)a=ry(a),t=oy(a,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}F(ee),ue(ee,t)}function xe(){F(ee),F(de),F(ne)}function $e(t){t.memoizedState!==null&&ue(Ne,t);var a=ee.current,s=oy(a,t.type);a!==s&&(ue(de,t),ue(ee,s))}function He(t){de.current===t&&(F(ee),F(de)),Ne.current===t&&(F(Ne),Kr._currentValue=fe)}var Et,zn;function Ot(t){if(Et===void 0)try{throw Error()}catch(s){var a=s.stack.trim().match(/\n( *(at )?)/);Et=a&&a[1]||"",zn=-1<s.stack.indexOf(`
|
|
3
3
|
at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
4
4
|
`+Et+t+zn}var nr=!1;function Di(t,a){if(!t||nr)return"";nr=!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(I){var U=I}Reflect.construct(t,[],Y)}else{try{Y.call()}catch(I){U=I}t.call(Y.prototype)}}else{try{throw Error()}catch(I){U=I}(Y=t())&&typeof Y.catch=="function"&&Y.catch(function(){})}}catch(I){if(I&&U&&typeof I.stack=="string")return[I.stack,U.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],w=p[1];if(y&&w){var C=y.split(`
|
|
5
5
|
`),L=w.split(`
|
|
6
6
|
`);for(u=o=0;o<C.length&&!C[o].includes("DetermineComponentFrameRoot");)o++;for(;u<L.length&&!L[u].includes("DetermineComponentFrameRoot");)u++;if(o===C.length||u===L.length)for(o=C.length-1,u=L.length-1;1<=o&&0<=u&&C[o]!==L[u];)u--;for(;1<=o&&0<=u;o--,u--)if(C[o]!==L[u]){if(o!==1||u!==1)do if(o--,u--,0>u||C[o]!==L[u]){var P=`
|
|
7
7
|
`+C[o].replace(" at new "," at ");return t.displayName&&P.includes("<anonymous>")&&(P=P.replace("<anonymous>",t.displayName)),P}while(1<=o&&0<=u);break}}}finally{nr=!1,Error.prepareStackTrace=s}return(s=t?t.displayName||t.name:"")?Ot(s):""}function Uc(t,a){switch(t.tag){case 26:case 27:case 5:return Ot(t.type);case 16:return Ot("Lazy");case 13:return t.child!==a&&a!==null?Ot("Suspense Fallback"):Ot("Suspense");case 19:return Ot("SuspenseList");case 0:case 15:return Di(t.type,!1);case 11:return Di(t.type.render,!1);case 1:return Di(t.type,!0);case 31:return Ot("Activity");default:return""}}function ar(t){try{var a="",s=null;do a+=Uc(t,s),s=t,t=t.return;while(t);return a}catch(o){return`
|
|
8
8
|
Error generating stack: `+o.message+`
|
|
9
|
-
`+o.stack}}var Ri=Object.prototype.hasOwnProperty,Mi=e.unstable_scheduleCallback,Bi=e.unstable_cancelCallback,xo=e.unstable_shouldYield,$c=e.unstable_requestPaint,Ut=e.unstable_now,wo=e.unstable_getCurrentPriorityLevel,ir=e.unstable_ImmediatePriority,jo=e.unstable_UserBlockingPriority,Li=e.unstable_NormalPriority,Ic=e.unstable_LowPriority,qi=e.unstable_IdlePriority,No=e.log,sr=e.unstable_setDisableYieldValue,va=null,$t=null;function Tn(t){if(typeof No=="function"&&sr(t),$t&&typeof $t.setStrictMode=="function")try{$t.setStrictMode(va,t)}catch{}}var ht=Math.clz32?Math.clz32:Vc,Un=Math.log,ti=Math.LN2;function Vc(t){return t>>>=0,t===0?32:31-(Un(t)/ti|0)|0}var Ui=256,$i=262144,Ii=4194304;function Kn(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 Vi(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 w=o&134217727;return w!==0?(o=w&~p,o!==0?u=Kn(o):(y&=w,y!==0?u=Kn(y):s||(s=w&~t,s!==0&&(u=Kn(s))))):(w=o&~p,w!==0?u=Kn(w):y!==0?u=Kn(y):s||(s=o&~t,s!==0&&(u=Kn(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 ni(t,a){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&a)===0}function Zn(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 ko(){var t=Ii;return Ii<<=1,(Ii&62914560)===0&&(Ii=4194304),t}function te(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 ai(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 w=t.entanglements,C=t.expirationTimes,L=t.hiddenUpdates;for(s=y&~s;0<s;){var P=31-ht(s),Y=1<<P;w[P]=0,C[P]=-1;var U=L[P];if(U!==null)for(L[P]=null,P=0;P<U.length;P++){var I=U[P];I!==null&&(I.lane&=-536870913)}s&=~Y}o!==0&&Ao(t,o,0),p!==0&&u===0&&t.tag!==0&&(t.suspendedLanes|=p&~(y&~a))}function Ao(t,a,s){t.pendingLanes|=a,t.suspendedLanes&=~a;var o=31-ht(a);t.entangledLanes|=a,t.entanglements[o]=t.entanglements[o]|1073741824|s&261930}function _o(t,a){var s=t.entangledLanes|=a;for(t=t.entanglements;s;){var o=31-ht(s),u=1<<o;u&a|t[o]&a&&(t[o]|=a),s&=~u}}function rr(t,a){var s=a&-a;return s=(s&42)!==0?1:or(s),(s&(t.suspendedLanes|a))!==0?0:s}function or(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 En(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function Hp(){var t=W.p;return t!==0?t:(t=window.event,t===void 0?32:Ty(t.type))}function Qp(t,a){var s=W.p;try{return W.p=t,a()}finally{W.p=s}}var Sa=Math.random().toString(36).slice(2),Dt="__reactFiber$"+Sa,Kt="__reactProps$"+Sa,Pi="__reactContainer$"+Sa,Pc="__reactEvents$"+Sa,d1="__reactListeners$"+Sa,f1="__reactHandles$"+Sa,Kp="__reactResources$"+Sa,lr="__reactMarker$"+Sa;function Gc(t){delete t[Dt],delete t[Kt],delete t[Pc],delete t[d1],delete t[f1]}function Gi(t){var a=t[Dt];if(a)return a;for(var s=t.parentNode;s;){if(a=s[Pi]||s[Dt]){if(s=a.alternate,a.child!==null||s!==null&&s.child!==null)for(t=my(t);t!==null;){if(s=t[Dt])return s;t=my(t)}return a}t=s,s=t.parentNode}return null}function Hi(t){if(t=t[Dt]||t[Pi]){var a=t.tag;if(a===5||a===6||a===13||a===31||a===26||a===27||a===3)return t}return null}function cr(t){var a=t.tag;if(a===5||a===26||a===27||a===6)return t.stateNode;throw Error(r(33))}function Qi(t){var a=t[Kp];return a||(a=t[Kp]={hoistableStyles:new Map,hoistableScripts:new Map}),a}function zt(t){t[lr]=!0}var Zp=new Set,Yp={};function ii(t,a){Ki(t,a),Ki(t+"Capture",a)}function Ki(t,a){for(Yp[t]=a,t=0;t<a.length;t++)Zp.add(a[t])}var p1=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]*$"),Xp={},Jp={};function m1(t){return Ri.call(Jp,t)?!0:Ri.call(Xp,t)?!1:p1.test(t)?Jp[t]=!0:(Xp[t]=!0,!1)}function Co(t,a,s){if(m1(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 zo(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 Yn(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 fn(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Fp(t){var a=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function h1(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 Hc(t){if(!t._valueTracker){var a=Fp(t)?"checked":"value";t._valueTracker=h1(t,a,""+t[a])}}function Wp(t){if(!t)return!1;var a=t._valueTracker;if(!a)return!0;var s=a.getValue(),o="";return t&&(o=Fp(t)?t.checked?"true":"false":t.value),t=o,t!==s?(a.setValue(t),!0):!1}function To(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 g1=/[\n"\\]/g;function pn(t){return t.replace(g1,function(a){return"\\"+a.charCodeAt(0).toString(16)+" "})}function Qc(t,a,s,o,u,p,y,w){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=""+fn(a)):t.value!==""+fn(a)&&(t.value=""+fn(a)):y!=="submit"&&y!=="reset"||t.removeAttribute("value"),a!=null?Kc(t,y,fn(a)):s!=null?Kc(t,y,fn(s)):o!=null&&t.removeAttribute("value"),u==null&&p!=null&&(t.defaultChecked=!!p),u!=null&&(t.checked=u&&typeof u!="function"&&typeof u!="symbol"),w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?t.name=""+fn(w):t.removeAttribute("name")}function em(t,a,s,o,u,p,y,w){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)){Hc(t);return}s=s!=null?""+fn(s):"",a=a!=null?""+fn(a):s,w||a===t.value||(t.value=a),t.defaultValue=a}o=o??u,o=typeof o!="function"&&typeof o!="symbol"&&!!o,t.checked=w?t.checked:!!o,t.defaultChecked=!!o,y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(t.name=y),Hc(t)}function Kc(t,a,s){a==="number"&&To(t.ownerDocument)===t||t.defaultValue===""+s||(t.defaultValue=""+s)}function Zi(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=""+fn(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 tm(t,a,s){if(a!=null&&(a=""+fn(a),a!==t.value&&(t.value=a),s==null)){t.defaultValue!==a&&(t.defaultValue=a);return}t.defaultValue=s!=null?""+fn(s):""}function nm(t,a,s,o){if(a==null){if(o!=null){if(s!=null)throw Error(r(92));if(me(o)){if(1<o.length)throw Error(r(93));o=o[0]}s=o}s==null&&(s=""),a=s}s=fn(a),t.defaultValue=s,o=t.textContent,o===s&&o!==""&&o!==null&&(t.value=o),Hc(t)}function Yi(t,a){if(a){var s=t.firstChild;if(s&&s===t.lastChild&&s.nodeType===3){s.nodeValue=a;return}}t.textContent=a}var y1=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 am(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||y1.has(a)?a==="float"?t.cssFloat=s:t[a]=(""+s).trim():t[a]=s+"px"}function im(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&&am(t,u,o)}else for(var p in a)a.hasOwnProperty(p)&&am(t,p,a[p])}function Zc(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 b1=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"]]),v1=/^[\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 Eo(t){return v1.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function Xn(){}var Yc=null;function Xc(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Xi=null,Ji=null;function sm(t){var a=Hi(t);if(a&&(t=a.stateNode)){var s=t[Kt]||null;e:switch(t=a.stateNode,a.type){case"input":if(Qc(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="'+pn(""+a)+'"][type="radio"]'),a=0;a<s.length;a++){var o=s[a];if(o!==t&&o.form===t.form){var u=o[Kt]||null;if(!u)throw Error(r(90));Qc(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&&Wp(o)}break e;case"textarea":tm(t,s.value,s.defaultValue);break e;case"select":a=s.value,a!=null&&Zi(t,!!s.multiple,a,!1)}}}var Jc=!1;function rm(t,a,s){if(Jc)return t(a,s);Jc=!0;try{var o=t(a);return o}finally{if(Jc=!1,(Xi!==null||Ji!==null)&&(bl(),Xi&&(a=Xi,t=Ji,Ji=Xi=null,sm(a),t)))for(a=0;a<t.length;a++)sm(t[a])}}function ur(t,a){var s=t.stateNode;if(s===null)return null;var o=s[Kt]||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 Jn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Fc=!1;if(Jn)try{var dr={};Object.defineProperty(dr,"passive",{get:function(){Fc=!0}}),window.addEventListener("test",dr,dr),window.removeEventListener("test",dr,dr)}catch{Fc=!1}var xa=null,Wc=null,Oo=null;function om(){if(Oo)return Oo;var t,a=Wc,s=a.length,o,u="value"in xa?xa.value:xa.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 Oo=u.slice(t,1<o?1-o:void 0)}function Do(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 Ro(){return!0}function lm(){return!1}function Zt(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 w in t)t.hasOwnProperty(w)&&(s=t[w],this[w]=s?s(p):p[w]);return this.isDefaultPrevented=(p.defaultPrevented!=null?p.defaultPrevented:p.returnValue===!1)?Ro:lm,this.isPropagationStopped=lm,this}return x(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=Ro)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=Ro)},persist:function(){},isPersistent:Ro}),a}var si={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Mo=Zt(si),fr=x({},si,{view:0,detail:0}),S1=Zt(fr),eu,tu,pr,Bo=x({},fr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:au,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!==pr&&(pr&&t.type==="mousemove"?(eu=t.screenX-pr.screenX,tu=t.screenY-pr.screenY):tu=eu=0,pr=t),eu)},movementY:function(t){return"movementY"in t?t.movementY:tu}}),cm=Zt(Bo),x1=x({},Bo,{dataTransfer:0}),w1=Zt(x1),j1=x({},fr,{relatedTarget:0}),nu=Zt(j1),N1=x({},si,{animationName:0,elapsedTime:0,pseudoElement:0}),k1=Zt(N1),A1=x({},si,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),_1=Zt(A1),C1=x({},si,{data:0}),um=Zt(C1),z1={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},T1={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"},E1={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function O1(t){var a=this.nativeEvent;return a.getModifierState?a.getModifierState(t):(t=E1[t])?!!a[t]:!1}function au(){return O1}var D1=x({},fr,{key:function(t){if(t.key){var a=z1[t.key]||t.key;if(a!=="Unidentified")return a}return t.type==="keypress"?(t=Do(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?T1[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:au,charCode:function(t){return t.type==="keypress"?Do(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Do(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),R1=Zt(D1),M1=x({},Bo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),dm=Zt(M1),B1=x({},fr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:au}),L1=Zt(B1),q1=x({},si,{propertyName:0,elapsedTime:0,pseudoElement:0}),U1=Zt(q1),$1=x({},Bo,{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}),I1=Zt($1),V1=x({},si,{newState:0,oldState:0}),P1=Zt(V1),G1=[9,13,27,32],iu=Jn&&"CompositionEvent"in window,mr=null;Jn&&"documentMode"in document&&(mr=document.documentMode);var H1=Jn&&"TextEvent"in window&&!mr,fm=Jn&&(!iu||mr&&8<mr&&11>=mr),pm=" ",mm=!1;function hm(t,a){switch(t){case"keyup":return G1.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function gm(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Fi=!1;function Q1(t,a){switch(t){case"compositionend":return gm(a);case"keypress":return a.which!==32?null:(mm=!0,pm);case"textInput":return t=a.data,t===pm&&mm?null:t;default:return null}}function K1(t,a){if(Fi)return t==="compositionend"||!iu&&hm(t,a)?(t=om(),Oo=Wc=xa=null,Fi=!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 fm&&a.locale!=="ko"?null:a.data;default:return null}}var Z1={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 ym(t){var a=t&&t.nodeName&&t.nodeName.toLowerCase();return a==="input"?!!Z1[t.type]:a==="textarea"}function bm(t,a,s,o){Xi?Ji?Ji.push(o):Ji=[o]:Xi=o,a=kl(a,"onChange"),0<a.length&&(s=new Mo("onChange","change",null,s,o),t.push({event:s,listeners:a}))}var hr=null,gr=null;function Y1(t){ey(t,0)}function Lo(t){var a=cr(t);if(Wp(a))return t}function vm(t,a){if(t==="change")return a}var Sm=!1;if(Jn){var su;if(Jn){var ru="oninput"in document;if(!ru){var xm=document.createElement("div");xm.setAttribute("oninput","return;"),ru=typeof xm.oninput=="function"}su=ru}else su=!1;Sm=su&&(!document.documentMode||9<document.documentMode)}function wm(){hr&&(hr.detachEvent("onpropertychange",jm),gr=hr=null)}function jm(t){if(t.propertyName==="value"&&Lo(gr)){var a=[];bm(a,gr,t,Xc(t)),rm(Y1,a)}}function X1(t,a,s){t==="focusin"?(wm(),hr=a,gr=s,hr.attachEvent("onpropertychange",jm)):t==="focusout"&&wm()}function J1(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Lo(gr)}function F1(t,a){if(t==="click")return Lo(a)}function W1(t,a){if(t==="input"||t==="change")return Lo(a)}function ex(t,a){return t===a&&(t!==0||1/t===1/a)||t!==t&&a!==a}var an=typeof Object.is=="function"?Object.is:ex;function yr(t,a){if(an(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(!Ri.call(a,u)||!an(t[u],a[u]))return!1}return!0}function Nm(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function km(t,a){var s=Nm(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=Nm(s)}}function Am(t,a){return t&&a?t===a?!0:t&&t.nodeType===3?!1:a&&a.nodeType===3?Am(t,a.parentNode):"contains"in t?t.contains(a):t.compareDocumentPosition?!!(t.compareDocumentPosition(a)&16):!1:!1}function _m(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var a=To(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=To(t.document)}return a}function ou(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 tx=Jn&&"documentMode"in document&&11>=document.documentMode,Wi=null,lu=null,br=null,cu=!1;function Cm(t,a,s){var o=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;cu||Wi==null||Wi!==To(o)||(o=Wi,"selectionStart"in o&&ou(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}),br&&yr(br,o)||(br=o,o=kl(lu,"onSelect"),0<o.length&&(a=new Mo("onSelect","select",null,a,s),t.push({event:a,listeners:o}),a.target=Wi)))}function ri(t,a){var s={};return s[t.toLowerCase()]=a.toLowerCase(),s["Webkit"+t]="webkit"+a,s["Moz"+t]="moz"+a,s}var es={animationend:ri("Animation","AnimationEnd"),animationiteration:ri("Animation","AnimationIteration"),animationstart:ri("Animation","AnimationStart"),transitionrun:ri("Transition","TransitionRun"),transitionstart:ri("Transition","TransitionStart"),transitioncancel:ri("Transition","TransitionCancel"),transitionend:ri("Transition","TransitionEnd")},uu={},zm={};Jn&&(zm=document.createElement("div").style,"AnimationEvent"in window||(delete es.animationend.animation,delete es.animationiteration.animation,delete es.animationstart.animation),"TransitionEvent"in window||delete es.transitionend.transition);function oi(t){if(uu[t])return uu[t];if(!es[t])return t;var a=es[t],s;for(s in a)if(a.hasOwnProperty(s)&&s in zm)return uu[t]=a[s];return t}var Tm=oi("animationend"),Em=oi("animationiteration"),Om=oi("animationstart"),nx=oi("transitionrun"),ax=oi("transitionstart"),ix=oi("transitioncancel"),Dm=oi("transitionend"),Rm=new Map,du="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(" ");du.push("scrollEnd");function On(t,a){Rm.set(t,a),ii(a,[t])}var qo=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)},mn=[],ts=0,fu=0;function Uo(){for(var t=ts,a=fu=ts=0;a<t;){var s=mn[a];mn[a++]=null;var o=mn[a];mn[a++]=null;var u=mn[a];mn[a++]=null;var p=mn[a];if(mn[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&&Mm(s,u,p)}}function $o(t,a,s,o){mn[ts++]=t,mn[ts++]=a,mn[ts++]=s,mn[ts++]=o,fu|=o,t.lanes|=o,t=t.alternate,t!==null&&(t.lanes|=o)}function pu(t,a,s,o){return $o(t,a,s,o),Io(t)}function li(t,a){return $o(t,null,null,a),Io(t)}function Mm(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-ht(s),t=p.hiddenUpdates,o=t[u],o===null?t[u]=[a]:o.push(a),a.lane=s|536870912),p):null}function Io(t){if(50<$r)throw $r=0,wd=null,Error(r(185));for(var a=t.return;a!==null;)t=a,a=t.return;return t.tag===3?t.stateNode:null}var ns={};function sx(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 sn(t,a,s,o){return new sx(t,a,s,o)}function mu(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Fn(t,a){var s=t.alternate;return s===null?(s=sn(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 Bm(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 Vo(t,a,s,o,u,p){var y=0;if(o=t,typeof t=="function")mu(t)&&(y=1);else if(typeof t=="string")y=uw(t,s,ee.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case le:return t=sn(31,s,a,u),t.elementType=le,t.lanes=p,t;case k:return ci(s.children,u,p,a);case E:y=8,u|=24;break;case R:return t=sn(12,s,a,u|2),t.elementType=R,t.lanes=p,t;case X:return t=sn(13,s,a,u),t.elementType=X,t.lanes=p,t;case J:return t=sn(19,s,a,u),t.elementType=J,t.lanes=p,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case G:y=10;break e;case V:y=9;break e;case Z:y=11;break e;case O: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=sn(y,s,a,u),a.elementType=t,a.type=o,a.lanes=p,a}function ci(t,a,s,o){return t=sn(7,t,o,a),t.lanes=s,t}function hu(t,a,s){return t=sn(6,t,null,a),t.lanes=s,t}function Lm(t){var a=sn(18,null,null,0);return a.stateNode=t,a}function gu(t,a,s){return a=sn(4,t.children!==null?t.children:[],t.key,a),a.lanes=s,a.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},a}var qm=new WeakMap;function hn(t,a){if(typeof t=="object"&&t!==null){var s=qm.get(t);return s!==void 0?s:(a={value:t,source:a,stack:ar(a)},qm.set(t,a),a)}return{value:t,source:a,stack:ar(a)}}var as=[],is=0,Po=null,vr=0,gn=[],yn=0,wa=null,$n=1,In="";function Wn(t,a){as[is++]=vr,as[is++]=Po,Po=t,vr=a}function Um(t,a,s){gn[yn++]=$n,gn[yn++]=In,gn[yn++]=wa,wa=t;var o=$n;t=In;var u=32-ht(o)-1;o&=~(1<<u),s+=1;var p=32-ht(a)+u;if(30<p){var y=u-u%5;p=(o&(1<<y)-1).toString(32),o>>=y,u-=y,$n=1<<32-ht(a)+u|s<<u|o,In=p+t}else $n=1<<p|s<<u|o,In=t}function yu(t){t.return!==null&&(Wn(t,1),Um(t,1,0))}function bu(t){for(;t===Po;)Po=as[--is],as[is]=null,vr=as[--is],as[is]=null;for(;t===wa;)wa=gn[--yn],gn[yn]=null,In=gn[--yn],gn[yn]=null,$n=gn[--yn],gn[yn]=null}function $m(t,a){gn[yn++]=$n,gn[yn++]=In,gn[yn++]=wa,$n=a.id,In=a.overflow,wa=t}var Rt=null,it=null,qe=!1,ja=null,bn=!1,vu=Error(r(519));function Na(t){var a=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Sr(hn(a,t)),vu}function Im(t){var a=t.stateNode,s=t.type,o=t.memoizedProps;switch(a[Dt]=t,a[Kt]=o,s){case"dialog":Me("cancel",a),Me("close",a);break;case"iframe":case"object":case"embed":Me("load",a);break;case"video":case"audio":for(s=0;s<Vr.length;s++)Me(Vr[s],a);break;case"source":Me("error",a);break;case"img":case"image":case"link":Me("error",a),Me("load",a);break;case"details":Me("toggle",a);break;case"input":Me("invalid",a),em(a,o.value,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name,!0);break;case"select":Me("invalid",a);break;case"textarea":Me("invalid",a),nm(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||iy(a.textContent,s)?(o.popover!=null&&(Me("beforetoggle",a),Me("toggle",a)),o.onScroll!=null&&Me("scroll",a),o.onScrollEnd!=null&&Me("scrollend",a),o.onClick!=null&&(a.onclick=Xn),a=!0):a=!1,a||Na(t,!0)}function Vm(t){for(Rt=t.return;Rt;)switch(Rt.tag){case 5:case 31:case 13:bn=!1;return;case 27:case 3:bn=!0;return;default:Rt=Rt.return}}function ss(t){if(t!==Rt)return!1;if(!qe)return Vm(t),qe=!0,!1;var a=t.tag,s;if((s=a!==3&&a!==27)&&((s=a===5)&&(s=t.type,s=!(s!=="form"&&s!=="button")||Ld(t.type,t.memoizedProps)),s=!s),s&&it&&Na(t),Vm(t),a===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(317));it=py(t)}else if(a===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(317));it=py(t)}else a===27?(a=it,qa(t.type)?(t=Vd,Vd=null,it=t):it=a):it=Rt?Sn(t.stateNode.nextSibling):null;return!0}function ui(){it=Rt=null,qe=!1}function Su(){var t=ja;return t!==null&&(Ft===null?Ft=t:Ft.push.apply(Ft,t),ja=null),t}function Sr(t){ja===null?ja=[t]:ja.push(t)}var xu=Ze(null),di=null,ea=null;function ka(t,a,s){ue(xu,a._currentValue),a._currentValue=s}function ta(t){t._currentValue=xu.current,F(xu)}function wu(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 ju(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 w=p;p=u;for(var C=0;C<a.length;C++)if(w.context===a[C]){p.lanes|=s,w=p.alternate,w!==null&&(w.lanes|=s),wu(p.return,s,t),o||(y=null);break e}p=w.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),wu(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 rs(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 w=u.type;an(u.pendingProps.value,y.value)||(t!==null?t.push(w):t=[w])}}else if(u===Ne.current){if(y=u.alternate,y===null)throw Error(r(387));y.memoizedState.memoizedState!==u.memoizedState.memoizedState&&(t!==null?t.push(Kr):t=[Kr])}u=u.return}t!==null&&ju(a,t,s,o),a.flags|=262144}function Go(t){for(t=t.firstContext;t!==null;){if(!an(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function fi(t){di=t,ea=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function Mt(t){return Pm(di,t)}function Ho(t,a){return di===null&&fi(t),Pm(t,a)}function Pm(t,a){var s=a._currentValue;if(a={context:a,memoizedValue:s,next:null},ea===null){if(t===null)throw Error(r(308));ea=a,t.dependencies={lanes:0,firstContext:a},t.flags|=524288}else ea=ea.next=a;return s}var rx=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()})}},ox=e.unstable_scheduleCallback,lx=e.unstable_NormalPriority,xt={$$typeof:G,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Nu(){return{controller:new rx,data:new Map,refCount:0}}function xr(t){t.refCount--,t.refCount===0&&ox(lx,function(){t.controller.abort()})}var wr=null,ku=0,os=0,ls=null;function cx(t,a){if(wr===null){var s=wr=[];ku=0,os=Cd(),ls={status:"pending",value:void 0,then:function(o){s.push(o)}}}return ku++,a.then(Gm,Gm),a}function Gm(){if(--ku===0&&wr!==null){ls!==null&&(ls.status="fulfilled");var t=wr;wr=null,os=0,ls=null;for(var a=0;a<t.length;a++)(0,t[a])()}}function ux(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 Hm=$.S;$.S=function(t,a){Cg=Ut(),typeof a=="object"&&a!==null&&typeof a.then=="function"&&cx(t,a),Hm!==null&&Hm(t,a)};var pi=Ze(null);function Au(){var t=pi.current;return t!==null?t:We.pooledCache}function Qo(t,a){a===null?ue(pi,pi.current):ue(pi,a.pool)}function Qm(){var t=Au();return t===null?null:{parent:xt._currentValue,pool:t}}var cs=Error(r(460)),_u=Error(r(474)),Ko=Error(r(542)),Zo={then:function(){}};function Km(t){return t=t.status,t==="fulfilled"||t==="rejected"}function Zm(t,a,s){switch(s=t[s],s===void 0?t.push(a):s!==a&&(a.then(Xn,Xn),a=s),a.status){case"fulfilled":return a.value;case"rejected":throw t=a.reason,Xm(t),t;default:if(typeof a.status=="string")a.then(Xn,Xn);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,Xm(t),t}throw hi=a,cs}}function mi(t){try{var a=t._init;return a(t._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(hi=s,cs):s}}var hi=null;function Ym(){if(hi===null)throw Error(r(459));var t=hi;return hi=null,t}function Xm(t){if(t===cs||t===Ko)throw Error(r(483))}var us=null,jr=0;function Yo(t){var a=jr;return jr+=1,us===null&&(us=[]),Zm(us,t,a)}function Nr(t,a){a=a.props.ref,t.ref=a!==void 0?a:null}function Xo(t,a){throw a.$$typeof===N?Error(r(525)):(t=Object.prototype.toString.call(a),Error(r(31,t==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":t)))}function Jm(t){function a(D,z){if(t){var B=D.deletions;B===null?(D.deletions=[z],D.flags|=16):B.push(z)}}function s(D,z){if(!t)return null;for(;z!==null;)a(D,z),z=z.sibling;return null}function o(D){for(var z=new Map;D!==null;)D.key!==null?z.set(D.key,D):z.set(D.index,D),D=D.sibling;return z}function u(D,z){return D=Fn(D,z),D.index=0,D.sibling=null,D}function p(D,z,B){return D.index=B,t?(B=D.alternate,B!==null?(B=B.index,B<z?(D.flags|=67108866,z):B):(D.flags|=67108866,z)):(D.flags|=1048576,z)}function y(D){return t&&D.alternate===null&&(D.flags|=67108866),D}function w(D,z,B,Q){return z===null||z.tag!==6?(z=hu(B,D.mode,Q),z.return=D,z):(z=u(z,B),z.return=D,z)}function C(D,z,B,Q){var Se=B.type;return Se===k?P(D,z,B.props.children,Q,B.key):z!==null&&(z.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===M&&mi(Se)===z.type)?(z=u(z,B.props),Nr(z,B),z.return=D,z):(z=Vo(B.type,B.key,B.props,null,D.mode,Q),Nr(z,B),z.return=D,z)}function L(D,z,B,Q){return z===null||z.tag!==4||z.stateNode.containerInfo!==B.containerInfo||z.stateNode.implementation!==B.implementation?(z=gu(B,D.mode,Q),z.return=D,z):(z=u(z,B.children||[]),z.return=D,z)}function P(D,z,B,Q,Se){return z===null||z.tag!==7?(z=ci(B,D.mode,Q,Se),z.return=D,z):(z=u(z,B),z.return=D,z)}function Y(D,z,B){if(typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint")return z=hu(""+z,D.mode,B),z.return=D,z;if(typeof z=="object"&&z!==null){switch(z.$$typeof){case A:return B=Vo(z.type,z.key,z.props,null,D.mode,B),Nr(B,z),B.return=D,B;case T:return z=gu(z,D.mode,B),z.return=D,z;case M:return z=mi(z),Y(D,z,B)}if(me(z)||ve(z))return z=ci(z,D.mode,B,null),z.return=D,z;if(typeof z.then=="function")return Y(D,Yo(z),B);if(z.$$typeof===G)return Y(D,Ho(D,z),B);Xo(D,z)}return null}function U(D,z,B,Q){var Se=z!==null?z.key:null;if(typeof B=="string"&&B!==""||typeof B=="number"||typeof B=="bigint")return Se!==null?null:w(D,z,""+B,Q);if(typeof B=="object"&&B!==null){switch(B.$$typeof){case A:return B.key===Se?C(D,z,B,Q):null;case T:return B.key===Se?L(D,z,B,Q):null;case M:return B=mi(B),U(D,z,B,Q)}if(me(B)||ve(B))return Se!==null?null:P(D,z,B,Q,null);if(typeof B.then=="function")return U(D,z,Yo(B),Q);if(B.$$typeof===G)return U(D,z,Ho(D,B),Q);Xo(D,B)}return null}function I(D,z,B,Q,Se){if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return D=D.get(B)||null,w(z,D,""+Q,Se);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case A:return D=D.get(Q.key===null?B:Q.key)||null,C(z,D,Q,Se);case T:return D=D.get(Q.key===null?B:Q.key)||null,L(z,D,Q,Se);case M:return Q=mi(Q),I(D,z,B,Q,Se)}if(me(Q)||ve(Q))return D=D.get(B)||null,P(z,D,Q,Se,null);if(typeof Q.then=="function")return I(D,z,B,Yo(Q),Se);if(Q.$$typeof===G)return I(D,z,B,Ho(z,Q),Se);Xo(z,Q)}return null}function pe(D,z,B,Q){for(var Se=null,Ie=null,ye=z,Te=z=0,Le=null;ye!==null&&Te<B.length;Te++){ye.index>Te?(Le=ye,ye=null):Le=ye.sibling;var Ve=U(D,ye,B[Te],Q);if(Ve===null){ye===null&&(ye=Le);break}t&&ye&&Ve.alternate===null&&a(D,ye),z=p(Ve,z,Te),Ie===null?Se=Ve:Ie.sibling=Ve,Ie=Ve,ye=Le}if(Te===B.length)return s(D,ye),qe&&Wn(D,Te),Se;if(ye===null){for(;Te<B.length;Te++)ye=Y(D,B[Te],Q),ye!==null&&(z=p(ye,z,Te),Ie===null?Se=ye:Ie.sibling=ye,Ie=ye);return qe&&Wn(D,Te),Se}for(ye=o(ye);Te<B.length;Te++)Le=I(ye,D,Te,B[Te],Q),Le!==null&&(t&&Le.alternate!==null&&ye.delete(Le.key===null?Te:Le.key),z=p(Le,z,Te),Ie===null?Se=Le:Ie.sibling=Le,Ie=Le);return t&&ye.forEach(function(Pa){return a(D,Pa)}),qe&&Wn(D,Te),Se}function we(D,z,B,Q){if(B==null)throw Error(r(151));for(var Se=null,Ie=null,ye=z,Te=z=0,Le=null,Ve=B.next();ye!==null&&!Ve.done;Te++,Ve=B.next()){ye.index>Te?(Le=ye,ye=null):Le=ye.sibling;var Pa=U(D,ye,Ve.value,Q);if(Pa===null){ye===null&&(ye=Le);break}t&&ye&&Pa.alternate===null&&a(D,ye),z=p(Pa,z,Te),Ie===null?Se=Pa:Ie.sibling=Pa,Ie=Pa,ye=Le}if(Ve.done)return s(D,ye),qe&&Wn(D,Te),Se;if(ye===null){for(;!Ve.done;Te++,Ve=B.next())Ve=Y(D,Ve.value,Q),Ve!==null&&(z=p(Ve,z,Te),Ie===null?Se=Ve:Ie.sibling=Ve,Ie=Ve);return qe&&Wn(D,Te),Se}for(ye=o(ye);!Ve.done;Te++,Ve=B.next())Ve=I(ye,D,Te,Ve.value,Q),Ve!==null&&(t&&Ve.alternate!==null&&ye.delete(Ve.key===null?Te:Ve.key),z=p(Ve,z,Te),Ie===null?Se=Ve:Ie.sibling=Ve,Ie=Ve);return t&&ye.forEach(function(xw){return a(D,xw)}),qe&&Wn(D,Te),Se}function Je(D,z,B,Q){if(typeof B=="object"&&B!==null&&B.type===k&&B.key===null&&(B=B.props.children),typeof B=="object"&&B!==null){switch(B.$$typeof){case A:e:{for(var Se=B.key;z!==null;){if(z.key===Se){if(Se=B.type,Se===k){if(z.tag===7){s(D,z.sibling),Q=u(z,B.props.children),Q.return=D,D=Q;break e}}else if(z.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===M&&mi(Se)===z.type){s(D,z.sibling),Q=u(z,B.props),Nr(Q,B),Q.return=D,D=Q;break e}s(D,z);break}else a(D,z);z=z.sibling}B.type===k?(Q=ci(B.props.children,D.mode,Q,B.key),Q.return=D,D=Q):(Q=Vo(B.type,B.key,B.props,null,D.mode,Q),Nr(Q,B),Q.return=D,D=Q)}return y(D);case T: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(D,z.sibling),Q=u(z,B.children||[]),Q.return=D,D=Q;break e}else{s(D,z);break}else a(D,z);z=z.sibling}Q=gu(B,D.mode,Q),Q.return=D,D=Q}return y(D);case M:return B=mi(B),Je(D,z,B,Q)}if(me(B))return pe(D,z,B,Q);if(ve(B)){if(Se=ve(B),typeof Se!="function")throw Error(r(150));return B=Se.call(B),we(D,z,B,Q)}if(typeof B.then=="function")return Je(D,z,Yo(B),Q);if(B.$$typeof===G)return Je(D,z,Ho(D,B),Q);Xo(D,B)}return typeof B=="string"&&B!==""||typeof B=="number"||typeof B=="bigint"?(B=""+B,z!==null&&z.tag===6?(s(D,z.sibling),Q=u(z,B),Q.return=D,D=Q):(s(D,z),Q=hu(B,D.mode,Q),Q.return=D,D=Q),y(D)):s(D,z)}return function(D,z,B,Q){try{jr=0;var Se=Je(D,z,B,Q);return us=null,Se}catch(ye){if(ye===cs||ye===Ko)throw ye;var Ie=sn(29,ye,null,D.mode);return Ie.lanes=Q,Ie.return=D,Ie}}}var gi=Jm(!0),Fm=Jm(!1),Aa=!1;function Cu(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function zu(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 _a(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Ca(t,a,s){var o=t.updateQueue;if(o===null)return null;if(o=o.shared,(Pe&2)!==0){var u=o.pending;return u===null?a.next=a:(a.next=u.next,u.next=a),o.pending=a,a=Io(t),Mm(t,null,s),a}return $o(t,o,a,s),Io(t)}function kr(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,_o(t,s)}}function Tu(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 Eu=!1;function Ar(){if(Eu){var t=ls;if(t!==null)throw t}}function _r(t,a,s,o){Eu=!1;var u=t.updateQueue;Aa=!1;var p=u.firstBaseUpdate,y=u.lastBaseUpdate,w=u.shared.pending;if(w!==null){u.shared.pending=null;var C=w,L=C.next;C.next=null,y===null?p=L:y.next=L,y=C;var P=t.alternate;P!==null&&(P=P.updateQueue,w=P.lastBaseUpdate,w!==y&&(w===null?P.firstBaseUpdate=L:w.next=L,P.lastBaseUpdate=C))}if(p!==null){var Y=u.baseState;y=0,P=L=C=null,w=p;do{var U=w.lane&-536870913,I=U!==w.lane;if(I?(Be&U)===U:(o&U)===U){U!==0&&U===os&&(Eu=!0),P!==null&&(P=P.next={lane:0,tag:w.tag,payload:w.payload,callback:null,next:null});e:{var pe=t,we=w;U=a;var Je=s;switch(we.tag){case 1:if(pe=we.payload,typeof pe=="function"){Y=pe.call(Je,Y,U);break e}Y=pe;break e;case 3:pe.flags=pe.flags&-65537|128;case 0:if(pe=we.payload,U=typeof pe=="function"?pe.call(Je,Y,U):pe,U==null)break e;Y=x({},Y,U);break e;case 2:Aa=!0}}U=w.callback,U!==null&&(t.flags|=64,I&&(t.flags|=8192),I=u.callbacks,I===null?u.callbacks=[U]:I.push(U))}else I={lane:U,tag:w.tag,payload:w.payload,callback:w.callback,next:null},P===null?(L=P=I,C=Y):P=P.next=I,y|=U;if(w=w.next,w===null){if(w=u.shared.pending,w===null)break;I=w,w=I.next,I.next=null,u.lastBaseUpdate=I,u.shared.pending=null}}while(!0);P===null&&(C=Y),u.baseState=C,u.firstBaseUpdate=L,u.lastBaseUpdate=P,p===null&&(u.shared.lanes=0),Da|=y,t.lanes=y,t.memoizedState=Y}}function Wm(t,a){if(typeof t!="function")throw Error(r(191,t));t.call(a)}function eh(t,a){var s=t.callbacks;if(s!==null)for(t.callbacks=null,t=0;t<s.length;t++)Wm(s[t],a)}var ds=Ze(null),Jo=Ze(0);function th(t,a){t=ua,ue(Jo,t),ue(ds,a),ua=t|a.baseLanes}function Ou(){ue(Jo,ua),ue(ds,ds.current)}function Du(){ua=Jo.current,F(ds),F(Jo)}var rn=Ze(null),vn=null;function za(t){var a=t.alternate;ue(gt,gt.current&1),ue(rn,t),vn===null&&(a===null||ds.current!==null||a.memoizedState!==null)&&(vn=t)}function Ru(t){ue(gt,gt.current),ue(rn,t),vn===null&&(vn=t)}function nh(t){t.tag===22?(ue(gt,gt.current),ue(rn,t),vn===null&&(vn=t)):Ta()}function Ta(){ue(gt,gt.current),ue(rn,rn.current)}function on(t){F(rn),vn===t&&(vn=null),F(gt)}var gt=Ze(0);function Fo(t){for(var a=t;a!==null;){if(a.tag===13){var s=a.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||$d(s)||Id(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 na=0,ze=null,Ye=null,wt=null,Wo=!1,fs=!1,yi=!1,el=0,Cr=0,ps=null,dx=0;function ft(){throw Error(r(321))}function Mu(t,a){if(a===null)return!1;for(var s=0;s<a.length&&s<t.length;s++)if(!an(t[s],a[s]))return!1;return!0}function Bu(t,a,s,o,u,p){return na=p,ze=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,$.H=t===null||t.memoizedState===null?Uh:Ju,yi=!1,p=s(o,u),yi=!1,fs&&(p=ih(a,s,o,u)),ah(t),p}function ah(t){$.H=Er;var a=Ye!==null&&Ye.next!==null;if(na=0,wt=Ye=ze=null,Wo=!1,Cr=0,ps=null,a)throw Error(r(300));t===null||jt||(t=t.dependencies,t!==null&&Go(t)&&(jt=!0))}function ih(t,a,s,o){ze=t;var u=0;do{if(fs&&(ps=null),Cr=0,fs=!1,25<=u)throw Error(r(301));if(u+=1,wt=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=$h,p=a(s,o)}while(fs);return p}function fx(){var t=$.H,a=t.useState()[0];return a=typeof a.then=="function"?zr(a):a,t=t.useState()[0],(Ye!==null?Ye.memoizedState:null)!==t&&(ze.flags|=1024),a}function Lu(){var t=el!==0;return el=0,t}function qu(t,a,s){a.updateQueue=t.updateQueue,a.flags&=-2053,t.lanes&=~s}function Uu(t){if(Wo){for(t=t.memoizedState;t!==null;){var a=t.queue;a!==null&&(a.pending=null),t=t.next}Wo=!1}na=0,wt=Ye=ze=null,fs=!1,Cr=el=0,ps=null}function Vt(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return wt===null?ze.memoizedState=wt=t:wt=wt.next=t,wt}function yt(){if(Ye===null){var t=ze.alternate;t=t!==null?t.memoizedState:null}else t=Ye.next;var a=wt===null?ze.memoizedState:wt.next;if(a!==null)wt=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},wt===null?ze.memoizedState=wt=t:wt=wt.next=t}return wt}function tl(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function zr(t){var a=Cr;return Cr+=1,ps===null&&(ps=[]),t=Zm(ps,t,a),a=ze,(wt===null?a.memoizedState:wt.next)===null&&(a=a.alternate,$.H=a===null||a.memoizedState===null?Uh:Ju),t}function nl(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return zr(t);if(t.$$typeof===G)return Mt(t)}throw Error(r(438,String(t)))}function $u(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=tl(),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]=Ae;return a.index++,s}function aa(t,a){return typeof a=="function"?a(t):a}function al(t){var a=yt();return Iu(a,Ye,t)}function Iu(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 w=y=null,C=null,L=a,P=!1;do{var Y=L.lane&-536870913;if(Y!==L.lane?(Be&Y)===Y:(na&Y)===Y){var U=L.revertLane;if(U===0)C!==null&&(C=C.next={lane:0,revertLane:0,gesture:null,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null}),Y===os&&(P=!0);else if((na&U)===U){L=L.next,U===os&&(P=!0);continue}else Y={lane:0,revertLane:L.revertLane,gesture:null,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null},C===null?(w=C=Y,y=p):C=C.next=Y,ze.lanes|=U,Da|=U;Y=L.action,yi&&s(p,Y),p=L.hasEagerState?L.eagerState:s(p,Y)}else U={lane:Y,revertLane:L.revertLane,gesture:L.gesture,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null},C===null?(w=C=U,y=p):C=C.next=U,ze.lanes|=Y,Da|=Y;L=L.next}while(L!==null&&L!==a);if(C===null?y=p:C.next=w,!an(p,t.memoizedState)&&(jt=!0,P&&(s=ls,s!==null)))throw s;t.memoizedState=p,t.baseState=y,t.baseQueue=C,o.lastRenderedState=p}return u===null&&(o.lanes=0),[t.memoizedState,o.dispatch]}function Vu(t){var a=yt(),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);an(p,a.memoizedState)||(jt=!0),a.memoizedState=p,a.baseQueue===null&&(a.baseState=p),s.lastRenderedState=p}return[p,o]}function sh(t,a,s){var o=ze,u=yt(),p=qe;if(p){if(s===void 0)throw Error(r(407));s=s()}else s=a();var y=!an((Ye||u).memoizedState,s);if(y&&(u.memoizedState=s,jt=!0),u=u.queue,Hu(lh.bind(null,o,u,t),[t]),u.getSnapshot!==a||y||wt!==null&&wt.memoizedState.tag&1){if(o.flags|=2048,ms(9,{destroy:void 0},oh.bind(null,o,u,s,a),null),We===null)throw Error(r(349));p||(na&127)!==0||rh(o,a,s)}return s}function rh(t,a,s){t.flags|=16384,t={getSnapshot:a,value:s},a=ze.updateQueue,a===null?(a=tl(),ze.updateQueue=a,a.stores=[t]):(s=a.stores,s===null?a.stores=[t]:s.push(t))}function oh(t,a,s,o){a.value=s,a.getSnapshot=o,ch(a)&&uh(t)}function lh(t,a,s){return s(function(){ch(a)&&uh(t)})}function ch(t){var a=t.getSnapshot;t=t.value;try{var s=a();return!an(t,s)}catch{return!0}}function uh(t){var a=li(t,2);a!==null&&Wt(a,t,2)}function Pu(t){var a=Vt();if(typeof t=="function"){var s=t;if(t=s(),yi){Tn(!0);try{s()}finally{Tn(!1)}}}return a.memoizedState=a.baseState=t,a.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:aa,lastRenderedState:t},a}function dh(t,a,s,o){return t.baseState=s,Iu(t,Ye,typeof o=="function"?o:aa)}function px(t,a,s,o,u){if(rl(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,fh(a,p)):(p.next=s.next,a.pending=s.next=p)}}function fh(t,a){var s=a.action,o=a.payload,u=t.state;if(a.isTransition){var p=$.T,y={};$.T=y;try{var w=s(u,o),C=$.S;C!==null&&C(y,w),ph(t,a,w)}catch(L){Gu(t,a,L)}finally{p!==null&&y.types!==null&&(p.types=y.types),$.T=p}}else try{p=s(u,o),ph(t,a,p)}catch(L){Gu(t,a,L)}}function ph(t,a,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(o){mh(t,a,o)},function(o){return Gu(t,a,o)}):mh(t,a,s)}function mh(t,a,s){a.status="fulfilled",a.value=s,hh(a),t.state=s,a=t.pending,a!==null&&(s=a.next,s===a?t.pending=null:(s=s.next,a.next=s,fh(t,s)))}function Gu(t,a,s){var o=t.pending;if(t.pending=null,o!==null){o=o.next;do a.status="rejected",a.reason=s,hh(a),a=a.next;while(a!==o)}t.action=null}function hh(t){t=t.listeners;for(var a=0;a<t.length;a++)(0,t[a])()}function gh(t,a){return a}function yh(t,a){if(qe){var s=We.formState;if(s!==null){e:{var o=ze;if(qe){if(it){t:{for(var u=it,p=bn;u.nodeType!==8;){if(!p){u=null;break t}if(u=Sn(u.nextSibling),u===null){u=null;break t}}p=u.data,u=p==="F!"||p==="F"?u:null}if(u){it=Sn(u.nextSibling),o=u.data==="F!";break e}}Na(o)}o=!1}o&&(a=s[0])}}return s=Vt(),s.memoizedState=s.baseState=a,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:gh,lastRenderedState:a},s.queue=o,s=Bh.bind(null,ze,o),o.dispatch=s,o=Pu(!1),p=Xu.bind(null,ze,!1,o.queue),o=Vt(),u={state:a,dispatch:null,action:t,pending:null},o.queue=u,s=px.bind(null,ze,u,p,s),u.dispatch=s,o.memoizedState=t,[a,s,!1]}function bh(t){var a=yt();return vh(a,Ye,t)}function vh(t,a,s){if(a=Iu(t,a,gh)[0],t=al(aa)[0],typeof a=="object"&&a!==null&&typeof a.then=="function")try{var o=zr(a)}catch(y){throw y===cs?Ko:y}else o=a;a=yt();var u=a.queue,p=u.dispatch;return s!==a.memoizedState&&(ze.flags|=2048,ms(9,{destroy:void 0},mx.bind(null,u,s),null)),[o,p,t]}function mx(t,a){t.action=a}function Sh(t){var a=yt(),s=Ye;if(s!==null)return vh(a,s,t);yt(),a=a.memoizedState,s=yt();var o=s.queue.dispatch;return s.memoizedState=t,[a,o,!1]}function ms(t,a,s,o){return t={tag:t,create:s,deps:o,inst:a,next:null},a=ze.updateQueue,a===null&&(a=tl(),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 xh(){return yt().memoizedState}function il(t,a,s,o){var u=Vt();ze.flags|=t,u.memoizedState=ms(1|a,{destroy:void 0},s,o===void 0?null:o)}function sl(t,a,s,o){var u=yt();o=o===void 0?null:o;var p=u.memoizedState.inst;Ye!==null&&o!==null&&Mu(o,Ye.memoizedState.deps)?u.memoizedState=ms(a,p,s,o):(ze.flags|=t,u.memoizedState=ms(1|a,p,s,o))}function wh(t,a){il(8390656,8,t,a)}function Hu(t,a){sl(2048,8,t,a)}function hx(t){ze.flags|=4;var a=ze.updateQueue;if(a===null)a=tl(),ze.updateQueue=a,a.events=[t];else{var s=a.events;s===null?a.events=[t]:s.push(t)}}function jh(t){var a=yt().memoizedState;return hx({ref:a,nextImpl:t}),function(){if((Pe&2)!==0)throw Error(r(440));return a.impl.apply(void 0,arguments)}}function Nh(t,a){return sl(4,2,t,a)}function kh(t,a){return sl(4,4,t,a)}function Ah(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 _h(t,a,s){s=s!=null?s.concat([t]):null,sl(4,4,Ah.bind(null,a,t),s)}function Qu(){}function Ch(t,a){var s=yt();a=a===void 0?null:a;var o=s.memoizedState;return a!==null&&Mu(a,o[1])?o[0]:(s.memoizedState=[t,a],t)}function zh(t,a){var s=yt();a=a===void 0?null:a;var o=s.memoizedState;if(a!==null&&Mu(a,o[1]))return o[0];if(o=t(),yi){Tn(!0);try{t()}finally{Tn(!1)}}return s.memoizedState=[o,a],o}function Ku(t,a,s){return s===void 0||(na&1073741824)!==0&&(Be&261930)===0?t.memoizedState=a:(t.memoizedState=s,t=Tg(),ze.lanes|=t,Da|=t,s)}function Th(t,a,s,o){return an(s,a)?s:ds.current!==null?(t=Ku(t,s,o),an(t,a)||(jt=!0),t):(na&42)===0||(na&1073741824)!==0&&(Be&261930)===0?(jt=!0,t.memoizedState=s):(t=Tg(),ze.lanes|=t,Da|=t,a)}function Eh(t,a,s,o,u){var p=W.p;W.p=p!==0&&8>p?p:8;var y=$.T,w={};$.T=w,Xu(t,!1,a,s);try{var C=u(),L=$.S;if(L!==null&&L(w,C),C!==null&&typeof C=="object"&&typeof C.then=="function"){var P=ux(C,o);Tr(t,a,P,un(t))}else Tr(t,a,o,un(t))}catch(Y){Tr(t,a,{then:function(){},status:"rejected",reason:Y},un())}finally{W.p=p,y!==null&&w.types!==null&&(y.types=w.types),$.T=y}}function gx(){}function Zu(t,a,s,o){if(t.tag!==5)throw Error(r(476));var u=Oh(t).queue;Eh(t,u,a,fe,s===null?gx:function(){return Dh(t),s(o)})}function Oh(t){var a=t.memoizedState;if(a!==null)return a;a={memoizedState:fe,baseState:fe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:aa,lastRenderedState:fe},next:null};var s={};return a.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:aa,lastRenderedState:s},next:null},t.memoizedState=a,t=t.alternate,t!==null&&(t.memoizedState=a),a}function Dh(t){var a=Oh(t);a.next===null&&(a=t.alternate.memoizedState),Tr(t,a.next.queue,{},un())}function Yu(){return Mt(Kr)}function Rh(){return yt().memoizedState}function Mh(){return yt().memoizedState}function yx(t){for(var a=t.return;a!==null;){switch(a.tag){case 24:case 3:var s=un();t=_a(s);var o=Ca(a,t,s);o!==null&&(Wt(o,a,s),kr(o,a,s)),a={cache:Nu()},t.payload=a;return}a=a.return}}function bx(t,a,s){var o=un();s={lane:o,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},rl(t)?Lh(a,s):(s=pu(t,a,s,o),s!==null&&(Wt(s,t,o),qh(s,a,o)))}function Bh(t,a,s){var o=un();Tr(t,a,s,o)}function Tr(t,a,s,o){var u={lane:o,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(rl(t))Lh(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,w=p(y,s);if(u.hasEagerState=!0,u.eagerState=w,an(w,y))return $o(t,a,u,0),We===null&&Uo(),!1}catch{}if(s=pu(t,a,u,o),s!==null)return Wt(s,t,o),qh(s,a,o),!0}return!1}function Xu(t,a,s,o){if(o={lane:2,revertLane:Cd(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},rl(t)){if(a)throw Error(r(479))}else a=pu(t,s,o,2),a!==null&&Wt(a,t,2)}function rl(t){var a=t.alternate;return t===ze||a!==null&&a===ze}function Lh(t,a){fs=Wo=!0;var s=t.pending;s===null?a.next=a:(a.next=s.next,s.next=a),t.pending=a}function qh(t,a,s){if((s&4194048)!==0){var o=a.lanes;o&=t.pendingLanes,s|=o,a.lanes=s,_o(t,s)}}var Er={readContext:Mt,use:nl,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};Er.useEffectEvent=ft;var Uh={readContext:Mt,use:nl,useCallback:function(t,a){return Vt().memoizedState=[t,a===void 0?null:a],t},useContext:Mt,useEffect:wh,useImperativeHandle:function(t,a,s){s=s!=null?s.concat([t]):null,il(4194308,4,Ah.bind(null,a,t),s)},useLayoutEffect:function(t,a){return il(4194308,4,t,a)},useInsertionEffect:function(t,a){il(4,2,t,a)},useMemo:function(t,a){var s=Vt();a=a===void 0?null:a;var o=t();if(yi){Tn(!0);try{t()}finally{Tn(!1)}}return s.memoizedState=[o,a],o},useReducer:function(t,a,s){var o=Vt();if(s!==void 0){var u=s(a);if(yi){Tn(!0);try{s(a)}finally{Tn(!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=bx.bind(null,ze,t),[o.memoizedState,t]},useRef:function(t){var a=Vt();return t={current:t},a.memoizedState=t},useState:function(t){t=Pu(t);var a=t.queue,s=Bh.bind(null,ze,a);return a.dispatch=s,[t.memoizedState,s]},useDebugValue:Qu,useDeferredValue:function(t,a){var s=Vt();return Ku(s,t,a)},useTransition:function(){var t=Pu(!1);return t=Eh.bind(null,ze,t.queue,!0,!1),Vt().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,a,s){var o=ze,u=Vt();if(qe){if(s===void 0)throw Error(r(407));s=s()}else{if(s=a(),We===null)throw Error(r(349));(Be&127)!==0||rh(o,a,s)}u.memoizedState=s;var p={value:s,getSnapshot:a};return u.queue=p,wh(lh.bind(null,o,p,t),[t]),o.flags|=2048,ms(9,{destroy:void 0},oh.bind(null,o,p,s,a),null),s},useId:function(){var t=Vt(),a=We.identifierPrefix;if(qe){var s=In,o=$n;s=(o&~(1<<32-ht(o)-1)).toString(32)+s,a="_"+a+"R_"+s,s=el++,0<s&&(a+="H"+s.toString(32)),a+="_"}else s=dx++,a="_"+a+"r_"+s.toString(32)+"_";return t.memoizedState=a},useHostTransitionStatus:Yu,useFormState:yh,useActionState:yh,useOptimistic:function(t){var a=Vt();a.memoizedState=a.baseState=t;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return a.queue=s,a=Xu.bind(null,ze,!0,s),s.dispatch=a,[t,a]},useMemoCache:$u,useCacheRefresh:function(){return Vt().memoizedState=yx.bind(null,ze)},useEffectEvent:function(t){var a=Vt(),s={impl:t};return a.memoizedState=s,function(){if((Pe&2)!==0)throw Error(r(440));return s.impl.apply(void 0,arguments)}}},Ju={readContext:Mt,use:nl,useCallback:Ch,useContext:Mt,useEffect:Hu,useImperativeHandle:_h,useInsertionEffect:Nh,useLayoutEffect:kh,useMemo:zh,useReducer:al,useRef:xh,useState:function(){return al(aa)},useDebugValue:Qu,useDeferredValue:function(t,a){var s=yt();return Th(s,Ye.memoizedState,t,a)},useTransition:function(){var t=al(aa)[0],a=yt().memoizedState;return[typeof t=="boolean"?t:zr(t),a]},useSyncExternalStore:sh,useId:Rh,useHostTransitionStatus:Yu,useFormState:bh,useActionState:bh,useOptimistic:function(t,a){var s=yt();return dh(s,Ye,t,a)},useMemoCache:$u,useCacheRefresh:Mh};Ju.useEffectEvent=jh;var $h={readContext:Mt,use:nl,useCallback:Ch,useContext:Mt,useEffect:Hu,useImperativeHandle:_h,useInsertionEffect:Nh,useLayoutEffect:kh,useMemo:zh,useReducer:Vu,useRef:xh,useState:function(){return Vu(aa)},useDebugValue:Qu,useDeferredValue:function(t,a){var s=yt();return Ye===null?Ku(s,t,a):Th(s,Ye.memoizedState,t,a)},useTransition:function(){var t=Vu(aa)[0],a=yt().memoizedState;return[typeof t=="boolean"?t:zr(t),a]},useSyncExternalStore:sh,useId:Rh,useHostTransitionStatus:Yu,useFormState:Sh,useActionState:Sh,useOptimistic:function(t,a){var s=yt();return Ye!==null?dh(s,Ye,t,a):(s.baseState=t,[t,s.queue.dispatch])},useMemoCache:$u,useCacheRefresh:Mh};$h.useEffectEvent=jh;function Fu(t,a,s,o){a=t.memoizedState,s=s(o,a),s=s==null?a:x({},a,s),t.memoizedState=s,t.lanes===0&&(t.updateQueue.baseState=s)}var Wu={enqueueSetState:function(t,a,s){t=t._reactInternals;var o=un(),u=_a(o);u.payload=a,s!=null&&(u.callback=s),a=Ca(t,u,o),a!==null&&(Wt(a,t,o),kr(a,t,o))},enqueueReplaceState:function(t,a,s){t=t._reactInternals;var o=un(),u=_a(o);u.tag=1,u.payload=a,s!=null&&(u.callback=s),a=Ca(t,u,o),a!==null&&(Wt(a,t,o),kr(a,t,o))},enqueueForceUpdate:function(t,a){t=t._reactInternals;var s=un(),o=_a(s);o.tag=2,a!=null&&(o.callback=a),a=Ca(t,o,s),a!==null&&(Wt(a,t,s),kr(a,t,s))}};function Ih(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?!yr(s,o)||!yr(u,p):!0}function Vh(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&&Wu.enqueueReplaceState(a,a.state,null)}function bi(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=x({},s));for(var u in t)s[u]===void 0&&(s[u]=t[u])}return s}function Ph(t){qo(t)}function Gh(t){console.error(t)}function Hh(t){qo(t)}function ol(t,a){try{var s=t.onUncaughtError;s(a.value,{componentStack:a.stack})}catch(o){setTimeout(function(){throw o})}}function Qh(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 ed(t,a,s){return s=_a(s),s.tag=3,s.payload={element:null},s.callback=function(){ol(t,a)},s}function Kh(t){return t=_a(t),t.tag=3,t}function Zh(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(){Qh(a,s,o)}}var y=s.stateNode;y!==null&&typeof y.componentDidCatch=="function"&&(t.callback=function(){Qh(a,s,o),typeof u!="function"&&(Ra===null?Ra=new Set([this]):Ra.add(this));var w=o.stack;this.componentDidCatch(o.value,{componentStack:w!==null?w:""})})}function vx(t,a,s,o,u){if(s.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){if(a=s.alternate,a!==null&&rs(a,s,u,!0),s=rn.current,s!==null){switch(s.tag){case 31:case 13:return vn===null?vl():s.alternate===null&&pt===0&&(pt=3),s.flags&=-257,s.flags|=65536,s.lanes=u,o===Zo?s.flags|=16384:(a=s.updateQueue,a===null?s.updateQueue=new Set([o]):a.add(o),kd(t,o,u)),!1;case 22:return s.flags|=65536,o===Zo?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)),kd(t,o,u)),!1}throw Error(r(435,s.tag))}return kd(t,o,u),vl(),!1}if(qe)return a=rn.current,a!==null?((a.flags&65536)===0&&(a.flags|=256),a.flags|=65536,a.lanes=u,o!==vu&&(t=Error(r(422),{cause:o}),Sr(hn(t,s)))):(o!==vu&&(a=Error(r(423),{cause:o}),Sr(hn(a,s))),t=t.current.alternate,t.flags|=65536,u&=-u,t.lanes|=u,o=hn(o,s),u=ed(t.stateNode,o,u),Tu(t,u),pt!==4&&(pt=2)),!1;var p=Error(r(520),{cause:o});if(p=hn(p,s),Ur===null?Ur=[p]:Ur.push(p),pt!==4&&(pt=2),a===null)return!0;o=hn(o,s),s=a;do{switch(s.tag){case 3:return s.flags|=65536,t=u&-u,s.lanes|=t,t=ed(s.stateNode,o,t),Tu(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"&&(Ra===null||!Ra.has(p))))return s.flags|=65536,u&=-u,s.lanes|=u,u=Kh(u),Zh(u,t,s,o),Tu(s,u),!1}s=s.return}while(s!==null);return!1}var td=Error(r(461)),jt=!1;function Bt(t,a,s,o){a.child=t===null?Fm(a,null,s,o):gi(a,t.child,s,o)}function Yh(t,a,s,o,u){s=s.render;var p=a.ref;if("ref"in o){var y={};for(var w in o)w!=="ref"&&(y[w]=o[w])}else y=o;return fi(a),o=Bu(t,a,s,y,p,u),w=Lu(),t!==null&&!jt?(qu(t,a,u),ia(t,a,u)):(qe&&w&&yu(a),a.flags|=1,Bt(t,a,o,u),a.child)}function Xh(t,a,s,o,u){if(t===null){var p=s.type;return typeof p=="function"&&!mu(p)&&p.defaultProps===void 0&&s.compare===null?(a.tag=15,a.type=p,Jh(t,a,p,o,u)):(t=Vo(s.type,null,o,a,a.mode,u),t.ref=a.ref,t.return=a,a.child=t)}if(p=t.child,!cd(t,u)){var y=p.memoizedProps;if(s=s.compare,s=s!==null?s:yr,s(y,o)&&t.ref===a.ref)return ia(t,a,u)}return a.flags|=1,t=Fn(p,o),t.ref=a.ref,t.return=a,a.child=t}function Jh(t,a,s,o,u){if(t!==null){var p=t.memoizedProps;if(yr(p,o)&&t.ref===a.ref)if(jt=!1,a.pendingProps=o=p,cd(t,u))(t.flags&131072)!==0&&(jt=!0);else return a.lanes=t.lanes,ia(t,a,u)}return nd(t,a,s,o,u)}function Fh(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 Wh(t,a,p,s,o)}if((s&536870912)!==0)a.memoizedState={baseLanes:0,cachePool:null},t!==null&&Qo(a,p!==null?p.cachePool:null),p!==null?th(a,p):Ou(),nh(a);else return o=a.lanes=536870912,Wh(t,a,p!==null?p.baseLanes|s:s,s,o)}else p!==null?(Qo(a,p.cachePool),th(a,p),Ta(),a.memoizedState=null):(t!==null&&Qo(a,null),Ou(),Ta());return Bt(t,a,u,s),a.child}function Or(t,a){return t!==null&&t.tag===22||a.stateNode!==null||(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.sibling}function Wh(t,a,s,o,u){var p=Au();return p=p===null?null:{parent:xt._currentValue,pool:p},a.memoizedState={baseLanes:s,cachePool:p},t!==null&&Qo(a,null),Ou(),nh(a),t!==null&&rs(t,a,o,!0),a.childLanes=u,null}function ll(t,a){return a=ul({mode:a.mode,children:a.children},t.mode),a.ref=t.ref,t.child=a,a.return=t,a}function eg(t,a,s){return gi(a,t.child,null,s),t=ll(a,a.pendingProps),t.flags|=2,on(a),a.memoizedState=null,t}function Sx(t,a,s){var o=a.pendingProps,u=(a.flags&128)!==0;if(a.flags&=-129,t===null){if(qe){if(o.mode==="hidden")return t=ll(a,o),a.lanes=536870912,Or(null,t);if(Ru(a),(t=it)?(t=fy(t,bn),t=t!==null&&t.data==="&"?t:null,t!==null&&(a.memoizedState={dehydrated:t,treeContext:wa!==null?{id:$n,overflow:In}:null,retryLane:536870912,hydrationErrors:null},s=Lm(t),s.return=a,a.child=s,Rt=a,it=null)):t=null,t===null)throw Na(a);return a.lanes=536870912,null}return ll(a,o)}var p=t.memoizedState;if(p!==null){var y=p.dehydrated;if(Ru(a),u)if(a.flags&256)a.flags&=-257,a=eg(t,a,s);else if(a.memoizedState!==null)a.child=t.child,a.flags|=128,a=null;else throw Error(r(558));else if(jt||rs(t,a,s,!1),u=(s&t.childLanes)!==0,jt||u){if(o=We,o!==null&&(y=rr(o,s),y!==0&&y!==p.retryLane))throw p.retryLane=y,li(t,y),Wt(o,t,y),td;vl(),a=eg(t,a,s)}else t=p.treeContext,it=Sn(y.nextSibling),Rt=a,qe=!0,ja=null,bn=!1,t!==null&&$m(a,t),a=ll(a,o),a.flags|=4096;return a}return t=Fn(t.child,{mode:o.mode,children:o.children}),t.ref=a.ref,a.child=t,t.return=a,t}function cl(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 nd(t,a,s,o,u){return fi(a),s=Bu(t,a,s,o,void 0,u),o=Lu(),t!==null&&!jt?(qu(t,a,u),ia(t,a,u)):(qe&&o&&yu(a),a.flags|=1,Bt(t,a,s,u),a.child)}function tg(t,a,s,o,u,p){return fi(a),a.updateQueue=null,s=ih(a,o,s,u),ah(t),o=Lu(),t!==null&&!jt?(qu(t,a,p),ia(t,a,p)):(qe&&o&&yu(a),a.flags|=1,Bt(t,a,s,p),a.child)}function ng(t,a,s,o,u){if(fi(a),a.stateNode===null){var p=ns,y=s.contextType;typeof y=="object"&&y!==null&&(p=Mt(y)),p=new s(o,p),a.memoizedState=p.state!==null&&p.state!==void 0?p.state:null,p.updater=Wu,a.stateNode=p,p._reactInternals=a,p=a.stateNode,p.props=o,p.state=a.memoizedState,p.refs={},Cu(a),y=s.contextType,p.context=typeof y=="object"&&y!==null?Mt(y):ns,p.state=a.memoizedState,y=s.getDerivedStateFromProps,typeof y=="function"&&(Fu(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&&Wu.enqueueReplaceState(p,p.state,null),_r(a,o,p,u),Ar(),p.state=a.memoizedState),typeof p.componentDidMount=="function"&&(a.flags|=4194308),o=!0}else if(t===null){p=a.stateNode;var w=a.memoizedProps,C=bi(s,w);p.props=C;var L=p.context,P=s.contextType;y=ns,typeof P=="object"&&P!==null&&(y=Mt(P));var Y=s.getDerivedStateFromProps;P=typeof Y=="function"||typeof p.getSnapshotBeforeUpdate=="function",w=a.pendingProps!==w,P||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(w||L!==y)&&Vh(a,p,o,y),Aa=!1;var U=a.memoizedState;p.state=U,_r(a,o,p,u),Ar(),L=a.memoizedState,w||U!==L||Aa?(typeof Y=="function"&&(Fu(a,s,Y,o),L=a.memoizedState),(C=Aa||Ih(a,s,C,o,U,L,y))?(P||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=C):(typeof p.componentDidMount=="function"&&(a.flags|=4194308),o=!1)}else{p=a.stateNode,zu(t,a),y=a.memoizedProps,P=bi(s,y),p.props=P,Y=a.pendingProps,U=p.context,L=s.contextType,C=ns,typeof L=="object"&&L!==null&&(C=Mt(L)),w=s.getDerivedStateFromProps,(L=typeof w=="function"||typeof p.getSnapshotBeforeUpdate=="function")||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(y!==Y||U!==C)&&Vh(a,p,o,C),Aa=!1,U=a.memoizedState,p.state=U,_r(a,o,p,u),Ar();var I=a.memoizedState;y!==Y||U!==I||Aa||t!==null&&t.dependencies!==null&&Go(t.dependencies)?(typeof w=="function"&&(Fu(a,s,w,o),I=a.memoizedState),(P=Aa||Ih(a,s,P,o,U,I,C)||t!==null&&t.dependencies!==null&&Go(t.dependencies))?(L||typeof p.UNSAFE_componentWillUpdate!="function"&&typeof p.componentWillUpdate!="function"||(typeof p.componentWillUpdate=="function"&&p.componentWillUpdate(o,I,C),typeof p.UNSAFE_componentWillUpdate=="function"&&p.UNSAFE_componentWillUpdate(o,I,C)),typeof p.componentDidUpdate=="function"&&(a.flags|=4),typeof p.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof p.componentDidUpdate!="function"||y===t.memoizedProps&&U===t.memoizedState||(a.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||y===t.memoizedProps&&U===t.memoizedState||(a.flags|=1024),a.memoizedProps=o,a.memoizedState=I),p.props=o,p.state=I,p.context=C,o=P):(typeof p.componentDidUpdate!="function"||y===t.memoizedProps&&U===t.memoizedState||(a.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||y===t.memoizedProps&&U===t.memoizedState||(a.flags|=1024),o=!1)}return p=o,cl(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=gi(a,t.child,null,u),a.child=gi(a,null,s,u)):Bt(t,a,s,u),a.memoizedState=p.state,t=a.child):t=ia(t,a,u),t}function ag(t,a,s,o){return ui(),a.flags|=256,Bt(t,a,s,o),a.child}var ad={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function id(t){return{baseLanes:t,cachePool:Qm()}}function sd(t,a,s){return t=t!==null?t.childLanes&~s:0,a&&(t|=cn),t}function ig(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:(gt.current&2)!==0),y&&(u=!0,a.flags&=-129),y=(a.flags&32)!==0,a.flags&=-33,t===null){if(qe){if(u?za(a):Ta(),(t=it)?(t=fy(t,bn),t=t!==null&&t.data!=="&"?t:null,t!==null&&(a.memoizedState={dehydrated:t,treeContext:wa!==null?{id:$n,overflow:In}:null,retryLane:536870912,hydrationErrors:null},s=Lm(t),s.return=a,a.child=s,Rt=a,it=null)):t=null,t===null)throw Na(a);return Id(t)?a.lanes=32:a.lanes=536870912,null}var w=o.children;return o=o.fallback,u?(Ta(),u=a.mode,w=ul({mode:"hidden",children:w},u),o=ci(o,u,s,null),w.return=a,o.return=a,w.sibling=o,a.child=w,o=a.child,o.memoizedState=id(s),o.childLanes=sd(t,y,s),a.memoizedState=ad,Or(null,o)):(za(a),rd(a,w))}var C=t.memoizedState;if(C!==null&&(w=C.dehydrated,w!==null)){if(p)a.flags&256?(za(a),a.flags&=-257,a=od(t,a,s)):a.memoizedState!==null?(Ta(),a.child=t.child,a.flags|=128,a=null):(Ta(),w=o.fallback,u=a.mode,o=ul({mode:"visible",children:o.children},u),w=ci(w,u,s,null),w.flags|=2,o.return=a,w.return=a,o.sibling=w,a.child=o,gi(a,t.child,null,s),o=a.child,o.memoizedState=id(s),o.childLanes=sd(t,y,s),a.memoizedState=ad,a=Or(null,o));else if(za(a),Id(w)){if(y=w.nextSibling&&w.nextSibling.dataset,y)var L=y.dgst;y=L,o=Error(r(419)),o.stack="",o.digest=y,Sr({value:o,source:null,stack:null}),a=od(t,a,s)}else if(jt||rs(t,a,s,!1),y=(s&t.childLanes)!==0,jt||y){if(y=We,y!==null&&(o=rr(y,s),o!==0&&o!==C.retryLane))throw C.retryLane=o,li(t,o),Wt(y,t,o),td;$d(w)||vl(),a=od(t,a,s)}else $d(w)?(a.flags|=192,a.child=t.child,a=null):(t=C.treeContext,it=Sn(w.nextSibling),Rt=a,qe=!0,ja=null,bn=!1,t!==null&&$m(a,t),a=rd(a,o.children),a.flags|=4096);return a}return u?(Ta(),w=o.fallback,u=a.mode,C=t.child,L=C.sibling,o=Fn(C,{mode:"hidden",children:o.children}),o.subtreeFlags=C.subtreeFlags&65011712,L!==null?w=Fn(L,w):(w=ci(w,u,s,null),w.flags|=2),w.return=a,o.return=a,o.sibling=w,a.child=o,Or(null,o),o=a.child,w=t.child.memoizedState,w===null?w=id(s):(u=w.cachePool,u!==null?(C=xt._currentValue,u=u.parent!==C?{parent:C,pool:C}:u):u=Qm(),w={baseLanes:w.baseLanes|s,cachePool:u}),o.memoizedState=w,o.childLanes=sd(t,y,s),a.memoizedState=ad,Or(t.child,o)):(za(a),s=t.child,t=s.sibling,s=Fn(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 rd(t,a){return a=ul({mode:"visible",children:a},t.mode),a.return=t,t.child=a}function ul(t,a){return t=sn(22,t,null,a),t.lanes=0,t}function od(t,a,s){return gi(a,t.child,null,s),t=rd(a,a.pendingProps.children),t.flags|=2,a.memoizedState=null,t}function sg(t,a,s){t.lanes|=a;var o=t.alternate;o!==null&&(o.lanes|=a),wu(t.return,a,s)}function ld(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 rg(t,a,s){var o=a.pendingProps,u=o.revealOrder,p=o.tail;o=o.children;var y=gt.current,w=(y&2)!==0;if(w?(y=y&1|2,a.flags|=128):y&=1,ue(gt,y),Bt(t,a,o,s),o=qe?vr:0,!w&&t!==null&&(t.flags&128)!==0)e:for(t=a.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&sg(t,s,a);else if(t.tag===19)sg(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&&Fo(t)===null&&(u=s),s=s.sibling;s=u,s===null?(u=a.child,a.child=null):(u=s.sibling,s.sibling=null),ld(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&&Fo(t)===null){a.child=u;break}t=u.sibling,u.sibling=s,s=u,u=t}ld(a,!0,s,null,p,o);break;case"together":ld(a,!1,null,null,void 0,o);break;default:a.memoizedState=null}return a.child}function ia(t,a,s){if(t!==null&&(a.dependencies=t.dependencies),Da|=a.lanes,(s&a.childLanes)===0)if(t!==null){if(rs(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=Fn(t,t.pendingProps),a.child=s,s.return=a;t.sibling!==null;)t=t.sibling,s=s.sibling=Fn(t,t.pendingProps),s.return=a;s.sibling=null}return a.child}function cd(t,a){return(t.lanes&a)!==0?!0:(t=t.dependencies,!!(t!==null&&Go(t)))}function xx(t,a,s){switch(a.tag){case 3:nt(a,a.stateNode.containerInfo),ka(a,xt,t.memoizedState.cache),ui();break;case 27:case 5:$e(a);break;case 4:nt(a,a.stateNode.containerInfo);break;case 10:ka(a,a.type,a.memoizedProps.value);break;case 31:if(a.memoizedState!==null)return a.flags|=128,Ru(a),null;break;case 13:var o=a.memoizedState;if(o!==null)return o.dehydrated!==null?(za(a),a.flags|=128,null):(s&a.child.childLanes)!==0?ig(t,a,s):(za(a),t=ia(t,a,s),t!==null?t.sibling:null);za(a);break;case 19:var u=(t.flags&128)!==0;if(o=(s&a.childLanes)!==0,o||(rs(t,a,s,!1),o=(s&a.childLanes)!==0),u){if(o)return rg(t,a,s);a.flags|=128}if(u=a.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),ue(gt,gt.current),o)break;return null;case 22:return a.lanes=0,Fh(t,a,s,a.pendingProps);case 24:ka(a,xt,t.memoizedState.cache)}return ia(t,a,s)}function og(t,a,s){if(t!==null)if(t.memoizedProps!==a.pendingProps)jt=!0;else{if(!cd(t,s)&&(a.flags&128)===0)return jt=!1,xx(t,a,s);jt=(t.flags&131072)!==0}else jt=!1,qe&&(a.flags&1048576)!==0&&Um(a,vr,a.index);switch(a.lanes=0,a.tag){case 16:e:{var o=a.pendingProps;if(t=mi(a.elementType),a.type=t,typeof t=="function")mu(t)?(o=bi(t,o),a.tag=1,a=ng(null,a,t,o,s)):(a.tag=0,a=nd(null,a,t,o,s));else{if(t!=null){var u=t.$$typeof;if(u===Z){a.tag=11,a=Yh(null,a,t,o,s);break e}else if(u===O){a.tag=14,a=Xh(null,a,t,o,s);break e}}throw a=oe(t)||t,Error(r(306,a,""))}}return a;case 0:return nd(t,a,a.type,a.pendingProps,s);case 1:return o=a.type,u=bi(o,a.pendingProps),ng(t,a,o,u,s);case 3:e:{if(nt(a,a.stateNode.containerInfo),t===null)throw Error(r(387));o=a.pendingProps;var p=a.memoizedState;u=p.element,zu(t,a),_r(a,o,null,s);var y=a.memoizedState;if(o=y.cache,ka(a,xt,o),o!==p.cache&&ju(a,[xt],s,!0),Ar(),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=ag(t,a,o,s);break e}else if(o!==u){u=hn(Error(r(424)),a),Sr(u),a=ag(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=Sn(t.firstChild),Rt=a,qe=!0,ja=null,bn=!0,s=Fm(a,null,o,s),a.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling;else{if(ui(),o===u){a=ia(t,a,s);break e}Bt(t,a,o,s)}a=a.child}return a;case 26:return cl(t,a),t===null?(s=by(a.type,null,a.pendingProps,null))?a.memoizedState=s:qe||(s=a.type,t=a.pendingProps,o=Al(ne.current).createElement(s),o[Dt]=a,o[Kt]=t,Lt(o,s,t),zt(o),a.stateNode=o):a.memoizedState=by(a.type,t.memoizedProps,a.pendingProps,t.memoizedState),null;case 27:return $e(a),t===null&&qe&&(o=a.stateNode=hy(a.type,a.pendingProps,ne.current),Rt=a,bn=!0,u=it,qa(a.type)?(Vd=u,it=Sn(o.firstChild)):it=u),Bt(t,a,a.pendingProps.children,s),cl(t,a),t===null&&(a.flags|=4194304),a.child;case 5:return t===null&&qe&&((u=o=it)&&(o=Jx(o,a.type,a.pendingProps,bn),o!==null?(a.stateNode=o,Rt=a,it=Sn(o.firstChild),bn=!1,u=!0):u=!1),u||Na(a)),$e(a),u=a.type,p=a.pendingProps,y=t!==null?t.memoizedProps:null,o=p.children,Ld(u,p)?o=null:y!==null&&Ld(u,y)&&(a.flags|=32),a.memoizedState!==null&&(u=Bu(t,a,fx,null,null,s),Kr._currentValue=u),cl(t,a),Bt(t,a,o,s),a.child;case 6:return t===null&&qe&&((t=s=it)&&(s=Fx(s,a.pendingProps,bn),s!==null?(a.stateNode=s,Rt=a,it=null,t=!0):t=!1),t||Na(a)),null;case 13:return ig(t,a,s);case 4:return nt(a,a.stateNode.containerInfo),o=a.pendingProps,t===null?a.child=gi(a,null,o,s):Bt(t,a,o,s),a.child;case 11:return Yh(t,a,a.type,a.pendingProps,s);case 7:return Bt(t,a,a.pendingProps,s),a.child;case 8:return Bt(t,a,a.pendingProps.children,s),a.child;case 12:return Bt(t,a,a.pendingProps.children,s),a.child;case 10:return o=a.pendingProps,ka(a,a.type,o.value),Bt(t,a,o.children,s),a.child;case 9:return u=a.type._context,o=a.pendingProps.children,fi(a),u=Mt(u),o=o(u),a.flags|=1,Bt(t,a,o,s),a.child;case 14:return Xh(t,a,a.type,a.pendingProps,s);case 15:return Jh(t,a,a.type,a.pendingProps,s);case 19:return rg(t,a,s);case 31:return Sx(t,a,s);case 22:return Fh(t,a,s,a.pendingProps);case 24:return fi(a),o=Mt(xt),t===null?(u=Au(),u===null&&(u=We,p=Nu(),u.pooledCache=p,p.refCount++,p!==null&&(u.pooledCacheLanes|=s),u=p),a.memoizedState={parent:o,cache:u},Cu(a),ka(a,xt,u)):((t.lanes&s)!==0&&(zu(t,a),_r(a,null,null,s),Ar()),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),ka(a,xt,o)):(o=p.cache,ka(a,xt,o),o!==u.cache&&ju(a,[xt],s,!0))),Bt(t,a,a.pendingProps.children,s),a.child;case 29:throw a.pendingProps}throw Error(r(156,a.tag))}function sa(t){t.flags|=4}function ud(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(Rg())t.flags|=8192;else throw hi=Zo,_u}else t.flags&=-16777217}function lg(t,a){if(a.type!=="stylesheet"||(a.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!jy(a))if(Rg())t.flags|=8192;else throw hi=Zo,_u}function dl(t,a){a!==null&&(t.flags|=4),t.flags&16384&&(a=t.tag!==22?ko():536870912,t.lanes|=a,bs|=a)}function Dr(t,a){if(!qe)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 wx(t,a,s){var o=a.pendingProps;switch(bu(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),ta(xt),xe(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(t===null||t.child===null)&&(ss(a)?sa(a):t===null||t.memoizedState.isDehydrated&&(a.flags&256)===0||(a.flags|=1024,Su())),st(a),null;case 26:var u=a.type,p=a.memoizedState;return t===null?(sa(a),p!==null?(st(a),lg(a,p)):(st(a),ud(a,u,null,o,s))):p?p!==t.memoizedState?(sa(a),st(a),lg(a,p)):(st(a),a.flags&=-16777217):(t=t.memoizedProps,t!==o&&sa(a),st(a),ud(a,u,t,o,s)),null;case 27:if(He(a),s=ne.current,u=a.type,t!==null&&a.stateNode!=null)t.memoizedProps!==o&&sa(a);else{if(!o){if(a.stateNode===null)throw Error(r(166));return st(a),null}t=ee.current,ss(a)?Im(a):(t=hy(u,o,s),a.stateNode=t,sa(a))}return st(a),null;case 5:if(He(a),u=a.type,t!==null&&a.stateNode!=null)t.memoizedProps!==o&&sa(a);else{if(!o){if(a.stateNode===null)throw Error(r(166));return st(a),null}if(p=ee.current,ss(a))Im(a);else{var y=Al(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[Dt]=a,p[Kt]=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(Lt(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&&sa(a)}}return st(a),ud(a,a.type,t===null?null:t.memoizedProps,a.pendingProps,s),null;case 6:if(t&&a.stateNode!=null)t.memoizedProps!==o&&sa(a);else{if(typeof o!="string"&&a.stateNode===null)throw Error(r(166));if(t=ne.current,ss(a)){if(t=a.stateNode,s=a.memoizedProps,o=null,u=Rt,u!==null)switch(u.tag){case 27:case 5:o=u.memoizedProps}t[Dt]=a,t=!!(t.nodeValue===s||o!==null&&o.suppressHydrationWarning===!0||iy(t.nodeValue,s)),t||Na(a,!0)}else t=Al(t).createTextNode(o),t[Dt]=a,a.stateNode=t}return st(a),null;case 31:if(s=a.memoizedState,t===null||t.memoizedState!==null){if(o=ss(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[Dt]=a}else ui(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;st(a),t=!1}else s=Su(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=s),t=!0;if(!t)return a.flags&256?(on(a),a):(on(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=ss(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[Dt]=a}else ui(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;st(a),u=!1}else u=Su(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=u),u=!0;if(!u)return a.flags&256?(on(a),a):(on(a),null)}return on(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),dl(a,a.updateQueue),st(a),null);case 4:return xe(),t===null&&Od(a.stateNode.containerInfo),st(a),null;case 10:return ta(a.type),st(a),null;case 19:if(F(gt),o=a.memoizedState,o===null)return st(a),null;if(u=(a.flags&128)!==0,p=o.rendering,p===null)if(u)Dr(o,!1);else{if(pt!==0||t!==null&&(t.flags&128)!==0)for(t=a.child;t!==null;){if(p=Fo(t),p!==null){for(a.flags|=128,Dr(o,!1),t=p.updateQueue,a.updateQueue=t,dl(a,t),a.subtreeFlags=0,t=s,s=a.child;s!==null;)Bm(s,t),s=s.sibling;return ue(gt,gt.current&1|2),qe&&Wn(a,o.treeForkCount),a.child}t=t.sibling}o.tail!==null&&Ut()>gl&&(a.flags|=128,u=!0,Dr(o,!1),a.lanes=4194304)}else{if(!u)if(t=Fo(p),t!==null){if(a.flags|=128,u=!0,t=t.updateQueue,a.updateQueue=t,dl(a,t),Dr(o,!0),o.tail===null&&o.tailMode==="hidden"&&!p.alternate&&!qe)return st(a),null}else 2*Ut()-o.renderingStartTime>gl&&s!==536870912&&(a.flags|=128,u=!0,Dr(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=Ut(),t.sibling=null,s=gt.current,ue(gt,u?s&1|2:s&1),qe&&Wn(a,o.treeForkCount),t):(st(a),null);case 22:case 23:return on(a),Du(),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&&dl(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&&F(pi),null;case 24:return s=null,t!==null&&(s=t.memoizedState.cache),a.memoizedState.cache!==s&&(a.flags|=2048),ta(xt),st(a),null;case 25:return null;case 30:return null}throw Error(r(156,a.tag))}function jx(t,a){switch(bu(a),a.tag){case 1:return t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 3:return ta(xt),xe(),t=a.flags,(t&65536)!==0&&(t&128)===0?(a.flags=t&-65537|128,a):null;case 26:case 27:case 5:return He(a),null;case 31:if(a.memoizedState!==null){if(on(a),a.alternate===null)throw Error(r(340));ui()}return t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 13:if(on(a),t=a.memoizedState,t!==null&&t.dehydrated!==null){if(a.alternate===null)throw Error(r(340));ui()}return t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 19:return F(gt),null;case 4:return xe(),null;case 10:return ta(a.type),null;case 22:case 23:return on(a),Du(),t!==null&&F(pi),t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 24:return ta(xt),null;case 25:return null;default:return null}}function cg(t,a){switch(bu(a),a.tag){case 3:ta(xt),xe();break;case 26:case 27:case 5:He(a);break;case 4:xe();break;case 31:a.memoizedState!==null&&on(a);break;case 13:on(a);break;case 19:F(gt);break;case 10:ta(a.type);break;case 22:case 23:on(a),Du(),t!==null&&F(pi);break;case 24:ta(xt)}}function Rr(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(w){Ke(a,a.return,w)}}function Ea(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,w=y.destroy;if(w!==void 0){y.destroy=void 0,u=a;var C=s,L=w;try{L()}catch(P){Ke(u,C,P)}}}o=o.next}while(o!==p)}}catch(P){Ke(a,a.return,P)}}function ug(t){var a=t.updateQueue;if(a!==null){var s=t.stateNode;try{eh(a,s)}catch(o){Ke(t,t.return,o)}}}function dg(t,a,s){s.props=bi(t.type,t.memoizedProps),s.state=t.memoizedState;try{s.componentWillUnmount()}catch(o){Ke(t,a,o)}}function Mr(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 fg(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 dd(t,a,s){try{var o=t.stateNode;Hx(o,t.type,s,a),o[Kt]=a}catch(u){Ke(t,t.return,u)}}function pg(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&qa(t.type)||t.tag===4}function fd(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||pg(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&&qa(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 pd(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=Xn));else if(o!==4&&(o===27&&qa(t.type)&&(s=t.stateNode,a=null),t=t.child,t!==null))for(pd(t,a,s),t=t.sibling;t!==null;)pd(t,a,s),t=t.sibling}function fl(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&&qa(t.type)&&(s=t.stateNode),t=t.child,t!==null))for(fl(t,a,s),t=t.sibling;t!==null;)fl(t,a,s),t=t.sibling}function mg(t){var a=t.stateNode,s=t.memoizedProps;try{for(var o=t.type,u=a.attributes;u.length;)a.removeAttributeNode(u[0]);Lt(a,o,s),a[Dt]=t,a[Kt]=s}catch(p){Ke(t,t.return,p)}}var ra=!1,Nt=!1,md=!1,hg=typeof WeakSet=="function"?WeakSet:Set,Tt=null;function Nx(t,a){if(t=t.containerInfo,Md=Dl,t=_m(t),ou(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,w=-1,C=-1,L=0,P=0,Y=t,U=null;t:for(;;){for(var I;Y!==s||u!==0&&Y.nodeType!==3||(w=y+u),Y!==p||o!==0&&Y.nodeType!==3||(C=y+o),Y.nodeType===3&&(y+=Y.nodeValue.length),(I=Y.firstChild)!==null;)U=Y,Y=I;for(;;){if(Y===t)break t;if(U===s&&++L===u&&(w=y),U===p&&++P===o&&(C=y),(I=Y.nextSibling)!==null)break;Y=U,U=Y.parentNode}Y=I}s=w===-1||C===-1?null:{start:w,end:C}}else s=null}s=s||{start:0,end:0}}else s=null;for(Bd={focusedElem:t,selectionRange:s},Dl=!1,Tt=a;Tt!==null;)if(a=Tt,t=a.child,(a.subtreeFlags&1028)!==0&&t!==null)t.return=a,Tt=t;else for(;Tt!==null;){switch(a=Tt,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 pe=bi(s.type,u);t=o.getSnapshotBeforeUpdate(pe,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)Ud(t);else if(s===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":Ud(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,Tt=t;break}Tt=a.return}}function gg(t,a,s){var o=s.flags;switch(s.tag){case 0:case 11:case 15:la(t,s),o&4&&Rr(5,s);break;case 1:if(la(t,s),o&4)if(t=s.stateNode,a===null)try{t.componentDidMount()}catch(y){Ke(s,s.return,y)}else{var u=bi(s.type,a.memoizedProps);a=a.memoizedState;try{t.componentDidUpdate(u,a,t.__reactInternalSnapshotBeforeUpdate)}catch(y){Ke(s,s.return,y)}}o&64&&ug(s),o&512&&Mr(s,s.return);break;case 3:if(la(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{eh(t,a)}catch(y){Ke(s,s.return,y)}}break;case 27:a===null&&o&4&&mg(s);case 26:case 5:la(t,s),a===null&&o&4&&fg(s),o&512&&Mr(s,s.return);break;case 12:la(t,s);break;case 31:la(t,s),o&4&&vg(t,s);break;case 13:la(t,s),o&4&&Sg(t,s),o&64&&(t=s.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(s=Dx.bind(null,s),Wx(t,s))));break;case 22:if(o=s.memoizedState!==null||ra,!o){a=a!==null&&a.memoizedState!==null||Nt,u=ra;var p=Nt;ra=o,(Nt=a)&&!p?ca(t,s,(s.subtreeFlags&8772)!==0):la(t,s),ra=u,Nt=p}break;case 30:break;default:la(t,s)}}function yg(t){var a=t.alternate;a!==null&&(t.alternate=null,yg(a)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(a=t.stateNode,a!==null&&Gc(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,Yt=!1;function oa(t,a,s){for(s=s.child;s!==null;)bg(t,a,s),s=s.sibling}function bg(t,a,s){if($t&&typeof $t.onCommitFiberUnmount=="function")try{$t.onCommitFiberUnmount(va,s)}catch{}switch(s.tag){case 26:Nt||Vn(s,a),oa(t,a,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:Nt||Vn(s,a);var o=ot,u=Yt;qa(s.type)&&(ot=s.stateNode,Yt=!1),oa(t,a,s),Gr(s.stateNode),ot=o,Yt=u;break;case 5:Nt||Vn(s,a);case 6:if(o=ot,u=Yt,ot=null,oa(t,a,s),ot=o,Yt=u,ot!==null)if(Yt)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&&(Yt?(t=ot,uy(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,s.stateNode),As(t)):uy(ot,s.stateNode));break;case 4:o=ot,u=Yt,ot=s.stateNode.containerInfo,Yt=!0,oa(t,a,s),ot=o,Yt=u;break;case 0:case 11:case 14:case 15:Ea(2,s,a),Nt||Ea(4,s,a),oa(t,a,s);break;case 1:Nt||(Vn(s,a),o=s.stateNode,typeof o.componentWillUnmount=="function"&&dg(s,a,o)),oa(t,a,s);break;case 21:oa(t,a,s);break;case 22:Nt=(o=Nt)||s.memoizedState!==null,oa(t,a,s),Nt=o;break;default:oa(t,a,s)}}function vg(t,a){if(a.memoizedState===null&&(t=a.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{As(t)}catch(s){Ke(a,a.return,s)}}}function Sg(t,a){if(a.memoizedState===null&&(t=a.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{As(t)}catch(s){Ke(a,a.return,s)}}function kx(t){switch(t.tag){case 31:case 13:case 19:var a=t.stateNode;return a===null&&(a=t.stateNode=new hg),a;case 22:return t=t.stateNode,a=t._retryCache,a===null&&(a=t._retryCache=new hg),a;default:throw Error(r(435,t.tag))}}function pl(t,a){var s=kx(t);a.forEach(function(o){if(!s.has(o)){s.add(o);var u=Rx.bind(null,t,o);o.then(u,u)}})}function Xt(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,w=y;e:for(;w!==null;){switch(w.tag){case 27:if(qa(w.type)){ot=w.stateNode,Yt=!1;break e}break;case 5:ot=w.stateNode,Yt=!1;break e;case 3:case 4:ot=w.stateNode.containerInfo,Yt=!0;break e}w=w.return}if(ot===null)throw Error(r(160));bg(p,y,u),ot=null,Yt=!1,p=u.alternate,p!==null&&(p.return=null),u.return=null}if(a.subtreeFlags&13886)for(a=a.child;a!==null;)xg(a,t),a=a.sibling}var Dn=null;function xg(t,a){var s=t.alternate,o=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Xt(a,t),Jt(t),o&4&&(Ea(3,t,t.return),Rr(3,t),Ea(5,t,t.return));break;case 1:Xt(a,t),Jt(t),o&512&&(Nt||s===null||Vn(s,s.return)),o&64&&ra&&(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=Dn;if(Xt(a,t),Jt(t),o&512&&(Nt||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[lr]||p[Dt]||p.namespaceURI==="http://www.w3.org/2000/svg"||p.hasAttribute("itemprop"))&&(p=u.createElement(o),u.head.insertBefore(p,u.querySelector("head > title"))),Lt(p,o,s),p[Dt]=t,zt(p),o=p;break e;case"link":var y=xy("link","href",u).get(o+(s.href||""));if(y){for(var w=0;w<y.length;w++)if(p=y[w],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(w,1);break t}}p=u.createElement(o),Lt(p,o,s),u.head.appendChild(p);break;case"meta":if(y=xy("meta","content",u).get(o+(s.content||""))){for(w=0;w<y.length;w++)if(p=y[w],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(w,1);break t}}p=u.createElement(o),Lt(p,o,s),u.head.appendChild(p);break;default:throw Error(r(468,o))}p[Dt]=t,zt(p),o=p}t.stateNode=o}else wy(u,t.type,t.stateNode);else t.stateNode=Sy(u,o,t.memoizedProps);else p!==o?(p===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):p.count--,o===null?wy(u,t.type,t.stateNode):Sy(u,o,t.memoizedProps)):o===null&&t.stateNode!==null&&dd(t,t.memoizedProps,s.memoizedProps)}break;case 27:Xt(a,t),Jt(t),o&512&&(Nt||s===null||Vn(s,s.return)),s!==null&&o&4&&dd(t,t.memoizedProps,s.memoizedProps);break;case 5:if(Xt(a,t),Jt(t),o&512&&(Nt||s===null||Vn(s,s.return)),t.flags&32){u=t.stateNode;try{Yi(u,"")}catch(pe){Ke(t,t.return,pe)}}o&4&&t.stateNode!=null&&(u=t.memoizedProps,dd(t,u,s!==null?s.memoizedProps:u)),o&1024&&(md=!0);break;case 6:if(Xt(a,t),Jt(t),o&4){if(t.stateNode===null)throw Error(r(162));o=t.memoizedProps,s=t.stateNode;try{s.nodeValue=o}catch(pe){Ke(t,t.return,pe)}}break;case 3:if(zl=null,u=Dn,Dn=_l(a.containerInfo),Xt(a,t),Dn=u,Jt(t),o&4&&s!==null&&s.memoizedState.isDehydrated)try{As(a.containerInfo)}catch(pe){Ke(t,t.return,pe)}md&&(md=!1,wg(t));break;case 4:o=Dn,Dn=_l(t.stateNode.containerInfo),Xt(a,t),Jt(t),Dn=o;break;case 12:Xt(a,t),Jt(t);break;case 31:Xt(a,t),Jt(t),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,pl(t,o)));break;case 13:Xt(a,t),Jt(t),t.child.flags&8192&&t.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(hl=Ut()),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,pl(t,o)));break;case 22:u=t.memoizedState!==null;var C=s!==null&&s.memoizedState!==null,L=ra,P=Nt;if(ra=L||u,Nt=P||C,Xt(a,t),Nt=P,ra=L,Jt(t),o&8192)e:for(a=t.stateNode,a._visibility=u?a._visibility&-2:a._visibility|1,u&&(s===null||C||ra||Nt||vi(t)),s=null,a=t;;){if(a.tag===5||a.tag===26){if(s===null){C=s=a;try{if(p=C.stateNode,u)y=p.style,typeof y.setProperty=="function"?y.setProperty("display","none","important"):y.display="none";else{w=C.stateNode;var Y=C.memoizedProps.style,U=Y!=null&&Y.hasOwnProperty("display")?Y.display:null;w.style.display=U==null||typeof U=="boolean"?"":(""+U).trim()}}catch(pe){Ke(C,C.return,pe)}}}else if(a.tag===6){if(s===null){C=a;try{C.stateNode.nodeValue=u?"":C.memoizedProps}catch(pe){Ke(C,C.return,pe)}}}else if(a.tag===18){if(s===null){C=a;try{var I=C.stateNode;u?dy(I,!0):dy(C.stateNode,!1)}catch(pe){Ke(C,C.return,pe)}}}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,pl(t,s))));break;case 19:Xt(a,t),Jt(t),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,pl(t,o)));break;case 30:break;case 21:break;default:Xt(a,t),Jt(t)}}function Jt(t){var a=t.flags;if(a&2){try{for(var s,o=t.return;o!==null;){if(pg(o)){s=o;break}o=o.return}if(s==null)throw Error(r(160));switch(s.tag){case 27:var u=s.stateNode,p=fd(t);fl(t,p,u);break;case 5:var y=s.stateNode;s.flags&32&&(Yi(y,""),s.flags&=-33);var w=fd(t);fl(t,w,y);break;case 3:case 4:var C=s.stateNode.containerInfo,L=fd(t);pd(t,L,C);break;default:throw Error(r(161))}}catch(P){Ke(t,t.return,P)}t.flags&=-3}a&4096&&(t.flags&=-4097)}function wg(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var a=t;wg(a),a.tag===5&&a.flags&1024&&a.stateNode.reset(),t=t.sibling}}function la(t,a){if(a.subtreeFlags&8772)for(a=a.child;a!==null;)gg(t,a.alternate,a),a=a.sibling}function vi(t){for(t=t.child;t!==null;){var a=t;switch(a.tag){case 0:case 11:case 14:case 15:Ea(4,a,a.return),vi(a);break;case 1:Vn(a,a.return);var s=a.stateNode;typeof s.componentWillUnmount=="function"&&dg(a,a.return,s),vi(a);break;case 27:Gr(a.stateNode);case 26:case 5:Vn(a,a.return),vi(a);break;case 22:a.memoizedState===null&&vi(a);break;case 30:vi(a);break;default:vi(a)}t=t.sibling}}function ca(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:ca(u,p,s),Rr(4,p);break;case 1:if(ca(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 w=o.stateNode;try{var C=u.shared.hiddenCallbacks;if(C!==null)for(u.shared.hiddenCallbacks=null,u=0;u<C.length;u++)Wm(C[u],w)}catch(L){Ke(o,o.return,L)}}s&&y&64&&ug(p),Mr(p,p.return);break;case 27:mg(p);case 26:case 5:ca(u,p,s),s&&o===null&&y&4&&fg(p),Mr(p,p.return);break;case 12:ca(u,p,s);break;case 31:ca(u,p,s),s&&y&4&&vg(u,p);break;case 13:ca(u,p,s),s&&y&4&&Sg(u,p);break;case 22:p.memoizedState===null&&ca(u,p,s),Mr(p,p.return);break;case 30:break;default:ca(u,p,s)}a=a.sibling}}function hd(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&&xr(s))}function gd(t,a){t=null,a.alternate!==null&&(t=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==t&&(a.refCount++,t!=null&&xr(t))}function Rn(t,a,s,o){if(a.subtreeFlags&10256)for(a=a.child;a!==null;)jg(t,a,s,o),a=a.sibling}function jg(t,a,s,o){var u=a.flags;switch(a.tag){case 0:case 11:case 15:Rn(t,a,s,o),u&2048&&Rr(9,a);break;case 1:Rn(t,a,s,o);break;case 3:Rn(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&&xr(t)));break;case 12:if(u&2048){Rn(t,a,s,o),t=a.stateNode;try{var p=a.memoizedProps,y=p.id,w=p.onPostCommit;typeof w=="function"&&w(y,a.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(C){Ke(a,a.return,C)}}else Rn(t,a,s,o);break;case 31:Rn(t,a,s,o);break;case 13:Rn(t,a,s,o);break;case 23:break;case 22:p=a.stateNode,y=a.alternate,a.memoizedState!==null?p._visibility&2?Rn(t,a,s,o):Br(t,a):p._visibility&2?Rn(t,a,s,o):(p._visibility|=2,hs(t,a,s,o,(a.subtreeFlags&10256)!==0||!1)),u&2048&&hd(y,a);break;case 24:Rn(t,a,s,o),u&2048&&gd(a.alternate,a);break;default:Rn(t,a,s,o)}}function hs(t,a,s,o,u){for(u=u&&((a.subtreeFlags&10256)!==0||!1),a=a.child;a!==null;){var p=t,y=a,w=s,C=o,L=y.flags;switch(y.tag){case 0:case 11:case 15:hs(p,y,w,C,u),Rr(8,y);break;case 23:break;case 22:var P=y.stateNode;y.memoizedState!==null?P._visibility&2?hs(p,y,w,C,u):Br(p,y):(P._visibility|=2,hs(p,y,w,C,u)),u&&L&2048&&hd(y.alternate,y);break;case 24:hs(p,y,w,C,u),u&&L&2048&&gd(y.alternate,y);break;default:hs(p,y,w,C,u)}a=a.sibling}}function Br(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:Br(s,o),u&2048&&hd(o.alternate,o);break;case 24:Br(s,o),u&2048&&gd(o.alternate,o);break;default:Br(s,o)}a=a.sibling}}var Lr=8192;function gs(t,a,s){if(t.subtreeFlags&Lr)for(t=t.child;t!==null;)Ng(t,a,s),t=t.sibling}function Ng(t,a,s){switch(t.tag){case 26:gs(t,a,s),t.flags&Lr&&t.memoizedState!==null&&dw(s,Dn,t.memoizedState,t.memoizedProps);break;case 5:gs(t,a,s);break;case 3:case 4:var o=Dn;Dn=_l(t.stateNode.containerInfo),gs(t,a,s),Dn=o;break;case 22:t.memoizedState===null&&(o=t.alternate,o!==null&&o.memoizedState!==null?(o=Lr,Lr=16777216,gs(t,a,s),Lr=o):gs(t,a,s));break;default:gs(t,a,s)}}function kg(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 qr(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];Tt=o,_g(o,t)}kg(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Ag(t),t=t.sibling}function Ag(t){switch(t.tag){case 0:case 11:case 15:qr(t),t.flags&2048&&Ea(9,t,t.return);break;case 3:qr(t);break;case 12:qr(t);break;case 22:var a=t.stateNode;t.memoizedState!==null&&a._visibility&2&&(t.return===null||t.return.tag!==13)?(a._visibility&=-3,ml(t)):qr(t);break;default:qr(t)}}function ml(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];Tt=o,_g(o,t)}kg(t)}for(t=t.child;t!==null;){switch(a=t,a.tag){case 0:case 11:case 15:Ea(8,a,a.return),ml(a);break;case 22:s=a.stateNode,s._visibility&2&&(s._visibility&=-3,ml(a));break;default:ml(a)}t=t.sibling}}function _g(t,a){for(;Tt!==null;){var s=Tt;switch(s.tag){case 0:case 11:case 15:Ea(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:xr(s.memoizedState.cache)}if(o=s.child,o!==null)o.return=s,Tt=o;else e:for(s=t;Tt!==null;){o=Tt;var u=o.sibling,p=o.return;if(yg(o),o===s){Tt=null;break e}if(u!==null){u.return=p,Tt=u;break e}Tt=p}}}var Ax={getCacheForType:function(t){var a=Mt(xt),s=a.data.get(t);return s===void 0&&(s=t(),a.data.set(t,s)),s},cacheSignal:function(){return Mt(xt).controller.signal}},_x=typeof WeakMap=="function"?WeakMap:Map,Pe=0,We=null,Re=null,Be=0,Qe=0,ln=null,Oa=!1,ys=!1,yd=!1,ua=0,pt=0,Da=0,Si=0,bd=0,cn=0,bs=0,Ur=null,Ft=null,vd=!1,hl=0,Cg=0,gl=1/0,yl=null,Ra=null,At=0,Ma=null,vs=null,da=0,Sd=0,xd=null,zg=null,$r=0,wd=null;function un(){return(Pe&2)!==0&&Be!==0?Be&-Be:$.T!==null?Cd():Hp()}function Tg(){if(cn===0)if((Be&536870912)===0||qe){var t=$i;$i<<=1,($i&3932160)===0&&($i=262144),cn=t}else cn=536870912;return t=rn.current,t!==null&&(t.flags|=32),cn}function Wt(t,a,s){(t===We&&(Qe===2||Qe===9)||t.cancelPendingCommit!==null)&&(Ss(t,0),Ba(t,Be,cn,!1)),Fe(t,s),((Pe&2)===0||t!==We)&&(t===We&&((Pe&2)===0&&(Si|=s),pt===4&&Ba(t,Be,cn,!1)),Pn(t))}function Eg(t,a,s){if((Pe&6)!==0)throw Error(r(327));var o=!s&&(a&127)===0&&(a&t.expiredLanes)===0||ni(t,a),u=o?Tx(t,a):Nd(t,a,!0),p=o;do{if(u===0){ys&&!o&&Ba(t,a,0,!1);break}else{if(s=t.current.alternate,p&&!Cx(s)){u=Nd(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 w=t;u=Ur;var C=w.current.memoizedState.isDehydrated;if(C&&(Ss(w,y).flags|=256),y=Nd(w,y,!1),y!==2){if(yd&&!C){w.errorRecoveryDisabledLanes|=p,Si|=p,u=4;break e}p=Ft,Ft=u,p!==null&&(Ft===null?Ft=p:Ft.push.apply(Ft,p))}u=y}if(p=!1,u!==2)continue}}if(u===1){Ss(t,0),Ba(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:Ba(o,a,cn,!Oa);break e;case 2:Ft=null;break;case 3:case 5:break;default:throw Error(r(329))}if((a&62914560)===a&&(u=hl+300-Ut(),10<u)){if(Ba(o,a,cn,!Oa),Vi(o,0,!0)!==0)break e;da=a,o.timeoutHandle=ly(Og.bind(null,o,s,Ft,yl,vd,a,cn,Si,bs,Oa,p,"Throttled",-0,0),u);break e}Og(o,s,Ft,yl,vd,a,cn,Si,bs,Oa,p,null,-0,0)}}break}while(!0);Pn(t)}function Og(t,a,s,o,u,p,y,w,C,L,P,Y,U,I){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:Xn},Ng(a,p,Y);var pe=(p&62914560)===p?hl-Ut():(p&4194048)===p?Cg-Ut():0;if(pe=fw(Y,pe),pe!==null){da=p,t.cancelPendingCommit=pe($g.bind(null,t,a,p,s,o,u,y,w,C,P,Y,null,U,I)),Ba(t,p,y,!L);return}}$g(t,a,p,s,o,u,y,w,C)}function Cx(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(!an(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 Ba(t,a,s,o){a&=~bd,a&=~Si,t.suspendedLanes|=a,t.pingedLanes&=~a,o&&(t.warmLanes|=a),o=t.expirationTimes;for(var u=a;0<u;){var p=31-ht(u),y=1<<p;o[p]=-1,u&=~y}s!==0&&Ao(t,s,a)}function bl(){return(Pe&6)===0?(Ir(0),!1):!0}function jd(){if(Re!==null){if(Qe===0)var t=Re.return;else t=Re,ea=di=null,Uu(t),us=null,jr=0,t=Re;for(;t!==null;)cg(t.alternate,t),t=t.return;Re=null}}function Ss(t,a){var s=t.timeoutHandle;s!==-1&&(t.timeoutHandle=-1,Zx(s)),s=t.cancelPendingCommit,s!==null&&(t.cancelPendingCommit=null,s()),da=0,jd(),We=t,Re=s=Fn(t.current,null),Be=a,Qe=0,ln=null,Oa=!1,ys=ni(t,a),yd=!1,bs=cn=bd=Si=Da=pt=0,Ft=Ur=null,vd=!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-ht(o),p=1<<u;a|=t[u],o&=~p}return ua=a,Uo(),s}function Dg(t,a){ze=null,$.H=Er,a===cs||a===Ko?(a=Ym(),Qe=3):a===_u?(a=Ym(),Qe=4):Qe=a===td?8:a!==null&&typeof a=="object"&&typeof a.then=="function"?6:1,ln=a,Re===null&&(pt=1,ol(t,hn(a,t.current)))}function Rg(){var t=rn.current;return t===null?!0:(Be&4194048)===Be?vn===null:(Be&62914560)===Be||(Be&536870912)!==0?t===vn:!1}function Mg(){var t=$.H;return $.H=Er,t===null?Er:t}function Bg(){var t=$.A;return $.A=Ax,t}function vl(){pt=4,Oa||(Be&4194048)!==Be&&rn.current!==null||(ys=!0),(Da&134217727)===0&&(Si&134217727)===0||We===null||Ba(We,Be,cn,!1)}function Nd(t,a,s){var o=Pe;Pe|=2;var u=Mg(),p=Bg();(We!==t||Be!==a)&&(yl=null,Ss(t,a)),a=!1;var y=pt;e:do try{if(Qe!==0&&Re!==null){var w=Re,C=ln;switch(Qe){case 8:jd(),y=6;break e;case 3:case 2:case 9:case 6:rn.current===null&&(a=!0);var L=Qe;if(Qe=0,ln=null,xs(t,w,C,L),s&&ys){y=0;break e}break;default:L=Qe,Qe=0,ln=null,xs(t,w,C,L)}}zx(),y=pt;break}catch(P){Dg(t,P)}while(!0);return a&&t.shellSuspendCounter++,ea=di=null,Pe=o,$.H=u,$.A=p,Re===null&&(We=null,Be=0,Uo()),y}function zx(){for(;Re!==null;)Lg(Re)}function Tx(t,a){var s=Pe;Pe|=2;var o=Mg(),u=Bg();We!==t||Be!==a?(yl=null,gl=Ut()+500,Ss(t,a)):ys=ni(t,a);e:do try{if(Qe!==0&&Re!==null){a=Re;var p=ln;t:switch(Qe){case 1:Qe=0,ln=null,xs(t,a,p,1);break;case 2:case 9:if(Km(p)){Qe=0,ln=null,qg(a);break}a=function(){Qe!==2&&Qe!==9||We!==t||(Qe=7),Pn(t)},p.then(a,a);break e;case 3:Qe=7;break e;case 4:Qe=5;break e;case 7:Km(p)?(Qe=0,ln=null,qg(a)):(Qe=0,ln=null,xs(t,a,p,7));break;case 5:var y=null;switch(Re.tag){case 26:y=Re.memoizedState;case 5:case 27:var w=Re;if(y?jy(y):w.stateNode.complete){Qe=0,ln=null;var C=w.sibling;if(C!==null)Re=C;else{var L=w.return;L!==null?(Re=L,Sl(L)):Re=null}break t}}Qe=0,ln=null,xs(t,a,p,5);break;case 6:Qe=0,ln=null,xs(t,a,p,6);break;case 8:jd(),pt=6;break e;default:throw Error(r(462))}}Ex();break}catch(P){Dg(t,P)}while(!0);return ea=di=null,$.H=o,$.A=u,Pe=s,Re!==null?0:(We=null,Be=0,Uo(),pt)}function Ex(){for(;Re!==null&&!xo();)Lg(Re)}function Lg(t){var a=og(t.alternate,t,ua);t.memoizedProps=t.pendingProps,a===null?Sl(t):Re=a}function qg(t){var a=t,s=a.alternate;switch(a.tag){case 15:case 0:a=tg(s,a,a.pendingProps,a.type,void 0,Be);break;case 11:a=tg(s,a,a.pendingProps,a.type.render,a.ref,Be);break;case 5:Uu(a);default:cg(s,a),a=Re=Bm(a,ua),a=og(s,a,ua)}t.memoizedProps=t.pendingProps,a===null?Sl(t):Re=a}function xs(t,a,s,o){ea=di=null,Uu(a),us=null,jr=0;var u=a.return;try{if(vx(t,u,a,s,Be)){pt=1,ol(t,hn(s,t.current)),Re=null;return}}catch(p){if(u!==null)throw Re=u,p;pt=1,ol(t,hn(s,t.current)),Re=null;return}a.flags&32768?(qe||o===1?t=!0:ys||(Be&536870912)!==0?t=!1:(Oa=t=!0,(o===2||o===9||o===3||o===6)&&(o=rn.current,o!==null&&o.tag===13&&(o.flags|=16384))),Ug(a,t)):Sl(a)}function Sl(t){var a=t;do{if((a.flags&32768)!==0){Ug(a,Oa);return}t=a.return;var s=wx(a.alternate,a,ua);if(s!==null){Re=s;return}if(a=a.sibling,a!==null){Re=a;return}Re=a=t}while(a!==null);pt===0&&(pt=5)}function Ug(t,a){do{var s=jx(t.alternate,t);if(s!==null){s.flags&=32767,Re=s;return}if(s=t.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!a&&(t=t.sibling,t!==null)){Re=t;return}Re=t=s}while(t!==null);pt=6,Re=null}function $g(t,a,s,o,u,p,y,w,C){t.cancelPendingCommit=null;do xl();while(At!==0);if((Pe&6)!==0)throw Error(r(327));if(a!==null){if(a===t.current)throw Error(r(177));if(p=a.lanes|a.childLanes,p|=fu,ai(t,s,p,y,w,C),t===We&&(Re=We=null,Be=0),vs=a,Ma=t,da=s,Sd=p,xd=u,zg=o,(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,Mx(Li,function(){return Hg(),null})):(t.callbackNode=null,t.callbackPriority=0),o=(a.flags&13878)!==0,(a.subtreeFlags&13878)!==0||o){o=$.T,$.T=null,u=W.p,W.p=2,y=Pe,Pe|=4;try{Nx(t,a,s)}finally{Pe=y,W.p=u,$.T=o}}At=1,Ig(),Vg(),Pg()}}function Ig(){if(At===1){At=0;var t=Ma,a=vs,s=(a.flags&13878)!==0;if((a.subtreeFlags&13878)!==0||s){s=$.T,$.T=null;var o=W.p;W.p=2;var u=Pe;Pe|=4;try{xg(a,t);var p=Bd,y=_m(t.containerInfo),w=p.focusedElem,C=p.selectionRange;if(y!==w&&w&&w.ownerDocument&&Am(w.ownerDocument.documentElement,w)){if(C!==null&&ou(w)){var L=C.start,P=C.end;if(P===void 0&&(P=L),"selectionStart"in w)w.selectionStart=L,w.selectionEnd=Math.min(P,w.value.length);else{var Y=w.ownerDocument||document,U=Y&&Y.defaultView||window;if(U.getSelection){var I=U.getSelection(),pe=w.textContent.length,we=Math.min(C.start,pe),Je=C.end===void 0?we:Math.min(C.end,pe);!I.extend&&we>Je&&(y=Je,Je=we,we=y);var D=km(w,we),z=km(w,Je);if(D&&z&&(I.rangeCount!==1||I.anchorNode!==D.node||I.anchorOffset!==D.offset||I.focusNode!==z.node||I.focusOffset!==z.offset)){var B=Y.createRange();B.setStart(D.node,D.offset),I.removeAllRanges(),we>Je?(I.addRange(B),I.extend(z.node,z.offset)):(B.setEnd(z.node,z.offset),I.addRange(B))}}}}for(Y=[],I=w;I=I.parentNode;)I.nodeType===1&&Y.push({element:I,left:I.scrollLeft,top:I.scrollTop});for(typeof w.focus=="function"&&w.focus(),w=0;w<Y.length;w++){var Q=Y[w];Q.element.scrollLeft=Q.left,Q.element.scrollTop=Q.top}}Dl=!!Md,Bd=Md=null}finally{Pe=u,W.p=o,$.T=s}}t.current=a,At=2}}function Vg(){if(At===2){At=0;var t=Ma,a=vs,s=(a.flags&8772)!==0;if((a.subtreeFlags&8772)!==0||s){s=$.T,$.T=null;var o=W.p;W.p=2;var u=Pe;Pe|=4;try{gg(t,a.alternate,a)}finally{Pe=u,W.p=o,$.T=s}}At=3}}function Pg(){if(At===4||At===3){At=0,$c();var t=Ma,a=vs,s=da,o=zg;(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?At=5:(At=0,vs=Ma=null,Gg(t,t.pendingLanes));var u=t.pendingLanes;if(u===0&&(Ra=null),En(s),a=a.stateNode,$t&&typeof $t.onCommitFiberRoot=="function")try{$t.onCommitFiberRoot(va,a,void 0,(a.current.flags&128)===128)}catch{}if(o!==null){a=$.T,u=W.p,W.p=2,$.T=null;try{for(var p=t.onRecoverableError,y=0;y<o.length;y++){var w=o[y];p(w.value,{componentStack:w.stack})}}finally{$.T=a,W.p=u}}(da&3)!==0&&xl(),Pn(t),u=t.pendingLanes,(s&261930)!==0&&(u&42)!==0?t===wd?$r++:($r=0,wd=t):$r=0,Ir(0)}}function Gg(t,a){(t.pooledCacheLanes&=a)===0&&(a=t.pooledCache,a!=null&&(t.pooledCache=null,xr(a)))}function xl(){return Ig(),Vg(),Pg(),Hg()}function Hg(){if(At!==5)return!1;var t=Ma,a=Sd;Sd=0;var s=En(da),o=$.T,u=W.p;try{W.p=32>s?32:s,$.T=null,s=xd,xd=null;var p=Ma,y=da;if(At=0,vs=Ma=null,da=0,(Pe&6)!==0)throw Error(r(331));var w=Pe;if(Pe|=4,Ag(p.current),jg(p,p.current,y,s),Pe=w,Ir(0,!1),$t&&typeof $t.onPostCommitFiberRoot=="function")try{$t.onPostCommitFiberRoot(va,p)}catch{}return!0}finally{W.p=u,$.T=o,Gg(t,a)}}function Qg(t,a,s){a=hn(s,a),a=ed(t.stateNode,a,2),t=Ca(t,a,2),t!==null&&(Fe(t,2),Pn(t))}function Ke(t,a,s){if(t.tag===3)Qg(t,t,s);else for(;a!==null;){if(a.tag===3){Qg(a,t,s);break}else if(a.tag===1){var o=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(Ra===null||!Ra.has(o))){t=hn(s,t),s=Kh(2),o=Ca(a,s,2),o!==null&&(Zh(s,o,a,t),Fe(o,2),Pn(o));break}}a=a.return}}function kd(t,a,s){var o=t.pingCache;if(o===null){o=t.pingCache=new _x;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)||(yd=!0,u.add(s),t=Ox.bind(null,t,a,s),a.then(t,t))}function Ox(t,a,s){var o=t.pingCache;o!==null&&o.delete(a),t.pingedLanes|=t.suspendedLanes&s,t.warmLanes&=~s,We===t&&(Be&s)===s&&(pt===4||pt===3&&(Be&62914560)===Be&&300>Ut()-hl?(Pe&2)===0&&Ss(t,0):bd|=s,bs===Be&&(bs=0)),Pn(t)}function Kg(t,a){a===0&&(a=ko()),t=li(t,a),t!==null&&(Fe(t,a),Pn(t))}function Dx(t){var a=t.memoizedState,s=0;a!==null&&(s=a.retryLane),Kg(t,s)}function Rx(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),Kg(t,s)}function Mx(t,a){return Mi(t,a)}var wl=null,ws=null,Ad=!1,jl=!1,_d=!1,La=0;function Pn(t){t!==ws&&t.next===null&&(ws===null?wl=ws=t:ws=ws.next=t),jl=!0,Ad||(Ad=!0,Lx())}function Ir(t,a){if(!_d&&jl){_d=!0;do for(var s=!1,o=wl;o!==null;){if(t!==0){var u=o.pendingLanes;if(u===0)var p=0;else{var y=o.suspendedLanes,w=o.pingedLanes;p=(1<<31-ht(42|t)+1)-1,p&=u&~(y&~w),p=p&201326741?p&201326741|1:p?p|2:0}p!==0&&(s=!0,Jg(o,p))}else p=Be,p=Vi(o,o===We?p:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(p&3)===0||ni(o,p)||(s=!0,Jg(o,p));o=o.next}while(s);_d=!1}}function Bx(){Zg()}function Zg(){jl=Ad=!1;var t=0;La!==0&&Kx()&&(t=La);for(var a=Ut(),s=null,o=wl;o!==null;){var u=o.next,p=Yg(o,a);p===0?(o.next=null,s===null?wl=u:s.next=u,u===null&&(ws=s)):(s=o,(t!==0||(p&3)!==0)&&(jl=!0)),o=u}At!==0&&At!==5||Ir(t),La!==0&&(La=0)}function Yg(t,a){for(var s=t.suspendedLanes,o=t.pingedLanes,u=t.expirationTimes,p=t.pendingLanes&-62914561;0<p;){var y=31-ht(p),w=1<<y,C=u[y];C===-1?((w&s)===0||(w&o)!==0)&&(u[y]=Zn(w,a)):C<=a&&(t.expiredLanes|=w),p&=~w}if(a=We,s=Be,s=Vi(t,t===a?s:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),o=t.callbackNode,s===0||t===a&&(Qe===2||Qe===9)||t.cancelPendingCommit!==null)return o!==null&&o!==null&&Bi(o),t.callbackNode=null,t.callbackPriority=0;if((s&3)===0||ni(t,s)){if(a=s&-s,a===t.callbackPriority)return a;switch(o!==null&&Bi(o),En(s)){case 2:case 8:s=jo;break;case 32:s=Li;break;case 268435456:s=qi;break;default:s=Li}return o=Xg.bind(null,t),s=Mi(s,o),t.callbackPriority=a,t.callbackNode=s,a}return o!==null&&o!==null&&Bi(o),t.callbackPriority=2,t.callbackNode=null,2}function Xg(t,a){if(At!==0&&At!==5)return t.callbackNode=null,t.callbackPriority=0,null;var s=t.callbackNode;if(xl()&&t.callbackNode!==s)return null;var o=Be;return o=Vi(t,t===We?o:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),o===0?null:(Eg(t,o,a),Yg(t,Ut()),t.callbackNode!=null&&t.callbackNode===s?Xg.bind(null,t):null)}function Jg(t,a){if(xl())return null;Eg(t,a,!0)}function Lx(){Yx(function(){(Pe&6)!==0?Mi(ir,Bx):Zg()})}function Cd(){if(La===0){var t=os;t===0&&(t=Ui,Ui<<=1,(Ui&261888)===0&&(Ui=256)),La=t}return La}function Fg(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Eo(""+t)}function Wg(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 qx(t,a,s,o,u){if(a==="submit"&&s&&s.stateNode===u){var p=Fg((u[Kt]||null).action),y=o.submitter;y&&(a=(a=y[Kt]||null)?Fg(a.formAction):y.getAttribute("formAction"),a!==null&&(p=a,y=null));var w=new Mo("action","action",null,o,u);t.push({event:w,listeners:[{instance:null,listener:function(){if(o.defaultPrevented){if(La!==0){var C=y?Wg(u,y):new FormData(u);Zu(s,{pending:!0,data:C,method:u.method,action:p},null,C)}}else typeof p=="function"&&(w.preventDefault(),C=y?Wg(u,y):new FormData(u),Zu(s,{pending:!0,data:C,method:u.method,action:p},p,C))},currentTarget:u}]})}}for(var zd=0;zd<du.length;zd++){var Td=du[zd],Ux=Td.toLowerCase(),$x=Td[0].toUpperCase()+Td.slice(1);On(Ux,"on"+$x)}On(Tm,"onAnimationEnd"),On(Em,"onAnimationIteration"),On(Om,"onAnimationStart"),On("dblclick","onDoubleClick"),On("focusin","onFocus"),On("focusout","onBlur"),On(nx,"onTransitionRun"),On(ax,"onTransitionStart"),On(ix,"onTransitionCancel"),On(Dm,"onTransitionEnd"),Ki("onMouseEnter",["mouseout","mouseover"]),Ki("onMouseLeave",["mouseout","mouseover"]),Ki("onPointerEnter",["pointerout","pointerover"]),Ki("onPointerLeave",["pointerout","pointerover"]),ii("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ii("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ii("onBeforeInput",["compositionend","keypress","textInput","paste"]),ii("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ii("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ii("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Vr="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(" "),Ix=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Vr));function ey(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 w=o[y],C=w.instance,L=w.currentTarget;if(w=w.listener,C!==p&&u.isPropagationStopped())break e;p=w,u.currentTarget=L;try{p(u)}catch(P){qo(P)}u.currentTarget=null,p=C}else for(y=0;y<o.length;y++){if(w=o[y],C=w.instance,L=w.currentTarget,w=w.listener,C!==p&&u.isPropagationStopped())break e;p=w,u.currentTarget=L;try{p(u)}catch(P){qo(P)}u.currentTarget=null,p=C}}}}function Me(t,a){var s=a[Pc];s===void 0&&(s=a[Pc]=new Set);var o=t+"__bubble";s.has(o)||(ty(a,t,2,!1),s.add(o))}function Ed(t,a,s){var o=0;a&&(o|=4),ty(s,t,o,a)}var Nl="_reactListening"+Math.random().toString(36).slice(2);function Od(t){if(!t[Nl]){t[Nl]=!0,Zp.forEach(function(s){s!=="selectionchange"&&(Ix.has(s)||Ed(s,!1,t),Ed(s,!0,t))});var a=t.nodeType===9?t:t.ownerDocument;a===null||a[Nl]||(a[Nl]=!0,Ed("selectionchange",!1,a))}}function ty(t,a,s,o){switch(Ty(a)){case 2:var u=hw;break;case 8:u=gw;break;default:u=Kd}s=u.bind(null,a,s,t),u=void 0,!Fc||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 Dd(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 w=o.stateNode.containerInfo;if(w===u)break;if(y===4)for(y=o.return;y!==null;){var C=y.tag;if((C===3||C===4)&&y.stateNode.containerInfo===u)return;y=y.return}for(;w!==null;){if(y=Gi(w),y===null)return;if(C=y.tag,C===5||C===6||C===26||C===27){o=p=y;continue e}w=w.parentNode}}o=o.return}rm(function(){var L=p,P=Xc(s),Y=[];e:{var U=Rm.get(t);if(U!==void 0){var I=Mo,pe=t;switch(t){case"keypress":if(Do(s)===0)break e;case"keydown":case"keyup":I=R1;break;case"focusin":pe="focus",I=nu;break;case"focusout":pe="blur",I=nu;break;case"beforeblur":case"afterblur":I=nu;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":I=cm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":I=w1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":I=L1;break;case Tm:case Em:case Om:I=k1;break;case Dm:I=U1;break;case"scroll":case"scrollend":I=S1;break;case"wheel":I=I1;break;case"copy":case"cut":case"paste":I=_1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":I=dm;break;case"toggle":case"beforetoggle":I=P1}var we=(a&4)!==0,Je=!we&&(t==="scroll"||t==="scrollend"),D=we?U!==null?U+"Capture":null:U;we=[];for(var z=L,B;z!==null;){var Q=z;if(B=Q.stateNode,Q=Q.tag,Q!==5&&Q!==26&&Q!==27||B===null||D===null||(Q=ur(z,D),Q!=null&&we.push(Pr(z,Q,B))),Je)break;z=z.return}0<we.length&&(U=new I(U,pe,null,s,P),Y.push({event:U,listeners:we}))}}if((a&7)===0){e:{if(U=t==="mouseover"||t==="pointerover",I=t==="mouseout"||t==="pointerout",U&&s!==Yc&&(pe=s.relatedTarget||s.fromElement)&&(Gi(pe)||pe[Pi]))break e;if((I||U)&&(U=P.window===P?P:(U=P.ownerDocument)?U.defaultView||U.parentWindow:window,I?(pe=s.relatedTarget||s.toElement,I=L,pe=pe?Gi(pe):null,pe!==null&&(Je=c(pe),we=pe.tag,pe!==Je||we!==5&&we!==27&&we!==6)&&(pe=null)):(I=null,pe=L),I!==pe)){if(we=cm,Q="onMouseLeave",D="onMouseEnter",z="mouse",(t==="pointerout"||t==="pointerover")&&(we=dm,Q="onPointerLeave",D="onPointerEnter",z="pointer"),Je=I==null?U:cr(I),B=pe==null?U:cr(pe),U=new we(Q,z+"leave",I,s,P),U.target=Je,U.relatedTarget=B,Q=null,Gi(P)===L&&(we=new we(D,z+"enter",pe,s,P),we.target=B,we.relatedTarget=Je,Q=we),Je=Q,I&&pe)t:{for(we=Vx,D=I,z=pe,B=0,Q=D;Q;Q=we(Q))B++;Q=0;for(var Se=z;Se;Se=we(Se))Q++;for(;0<B-Q;)D=we(D),B--;for(;0<Q-B;)z=we(z),Q--;for(;B--;){if(D===z||z!==null&&D===z.alternate){we=D;break t}D=we(D),z=we(z)}we=null}else we=null;I!==null&&ny(Y,U,I,we,!1),pe!==null&&Je!==null&&ny(Y,Je,pe,we,!0)}}e:{if(U=L?cr(L):window,I=U.nodeName&&U.nodeName.toLowerCase(),I==="select"||I==="input"&&U.type==="file")var Ie=vm;else if(ym(U))if(Sm)Ie=W1;else{Ie=J1;var ye=X1}else I=U.nodeName,!I||I.toLowerCase()!=="input"||U.type!=="checkbox"&&U.type!=="radio"?L&&Zc(L.elementType)&&(Ie=vm):Ie=F1;if(Ie&&(Ie=Ie(t,L))){bm(Y,Ie,s,P);break e}ye&&ye(t,U,L),t==="focusout"&&L&&U.type==="number"&&L.memoizedProps.value!=null&&Kc(U,"number",U.value)}switch(ye=L?cr(L):window,t){case"focusin":(ym(ye)||ye.contentEditable==="true")&&(Wi=ye,lu=L,br=null);break;case"focusout":br=lu=Wi=null;break;case"mousedown":cu=!0;break;case"contextmenu":case"mouseup":case"dragend":cu=!1,Cm(Y,s,P);break;case"selectionchange":if(tx)break;case"keydown":case"keyup":Cm(Y,s,P)}var Te;if(iu)e:{switch(t){case"compositionstart":var Le="onCompositionStart";break e;case"compositionend":Le="onCompositionEnd";break e;case"compositionupdate":Le="onCompositionUpdate";break e}Le=void 0}else Fi?hm(t,s)&&(Le="onCompositionEnd"):t==="keydown"&&s.keyCode===229&&(Le="onCompositionStart");Le&&(fm&&s.locale!=="ko"&&(Fi||Le!=="onCompositionStart"?Le==="onCompositionEnd"&&Fi&&(Te=om()):(xa=P,Wc="value"in xa?xa.value:xa.textContent,Fi=!0)),ye=kl(L,Le),0<ye.length&&(Le=new um(Le,t,null,s,P),Y.push({event:Le,listeners:ye}),Te?Le.data=Te:(Te=gm(s),Te!==null&&(Le.data=Te)))),(Te=H1?Q1(t,s):K1(t,s))&&(Le=kl(L,"onBeforeInput"),0<Le.length&&(ye=new um("onBeforeInput","beforeinput",null,s,P),Y.push({event:ye,listeners:Le}),ye.data=Te)),qx(Y,t,L,s,P)}ey(Y,a)})}function Pr(t,a,s){return{instance:t,listener:a,currentTarget:s}}function kl(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=ur(t,s),u!=null&&o.unshift(Pr(t,u,p)),u=ur(t,a),u!=null&&o.push(Pr(t,u,p))),t.tag===3)return o;t=t.return}return[]}function Vx(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function ny(t,a,s,o,u){for(var p=a._reactName,y=[];s!==null&&s!==o;){var w=s,C=w.alternate,L=w.stateNode;if(w=w.tag,C!==null&&C===o)break;w!==5&&w!==26&&w!==27||L===null||(C=L,u?(L=ur(s,p),L!=null&&y.unshift(Pr(s,L,C))):u||(L=ur(s,p),L!=null&&y.push(Pr(s,L,C)))),s=s.return}y.length!==0&&t.push({event:a,listeners:y})}var Px=/\r\n?/g,Gx=/\u0000|\uFFFD/g;function ay(t){return(typeof t=="string"?t:""+t).replace(Px,`
|
|
10
|
-
`).replace(Gx,"")}function iy(t,a){return a=ay(a),ay(t)===a}function Xe(t,a,s,o,u,p){switch(s){case"children":typeof o=="string"?a==="body"||a==="textarea"&&o===""||Yi(t,o):(typeof o=="number"||typeof o=="bigint")&&a!=="body"&&Yi(t,""+o);break;case"className":zo(t,"class",o);break;case"tabIndex":zo(t,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":zo(t,s,o);break;case"style":im(t,o,p);break;case"data":if(a!=="object"){zo(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=Eo(""+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=Eo(""+o),t.setAttribute(s,o);break;case"onClick":o!=null&&(t.onclick=Xn);break;case"onScroll":o!=null&&Me("scroll",t);break;case"onScrollEnd":o!=null&&Me("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=Eo(""+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":Me("beforetoggle",t),Me("toggle",t),Co(t,"popover",o);break;case"xlinkActuate":Yn(t,"http://www.w3.org/1999/xlink","xlink:actuate",o);break;case"xlinkArcrole":Yn(t,"http://www.w3.org/1999/xlink","xlink:arcrole",o);break;case"xlinkRole":Yn(t,"http://www.w3.org/1999/xlink","xlink:role",o);break;case"xlinkShow":Yn(t,"http://www.w3.org/1999/xlink","xlink:show",o);break;case"xlinkTitle":Yn(t,"http://www.w3.org/1999/xlink","xlink:title",o);break;case"xlinkType":Yn(t,"http://www.w3.org/1999/xlink","xlink:type",o);break;case"xmlBase":Yn(t,"http://www.w3.org/XML/1998/namespace","xml:base",o);break;case"xmlLang":Yn(t,"http://www.w3.org/XML/1998/namespace","xml:lang",o);break;case"xmlSpace":Yn(t,"http://www.w3.org/XML/1998/namespace","xml:space",o);break;case"is":Co(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=b1.get(s)||s,Co(t,s,o))}}function Rd(t,a,s,o,u,p){switch(s){case"style":im(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"?Yi(t,o):(typeof o=="number"||typeof o=="bigint")&&Yi(t,""+o);break;case"onScroll":o!=null&&Me("scroll",t);break;case"onScrollEnd":o!=null&&Me("scrollend",t);break;case"onClick":o!=null&&(t.onclick=Xn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Yp.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[Kt]||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,""):Co(t,s,o)}}}function Lt(t,a,s){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Me("error",t),Me("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":Me("invalid",t);var w=p=y=u=null,C=null,L=null;for(o in s)if(s.hasOwnProperty(o)){var P=s[o];if(P!=null)switch(o){case"name":u=P;break;case"type":y=P;break;case"checked":C=P;break;case"defaultChecked":L=P;break;case"value":p=P;break;case"defaultValue":w=P;break;case"children":case"dangerouslySetInnerHTML":if(P!=null)throw Error(r(137,a));break;default:Xe(t,a,o,P,s,null)}}em(t,p,w,C,L,y,u,!1);return;case"select":Me("invalid",t),o=y=p=null;for(u in s)if(s.hasOwnProperty(u)&&(w=s[u],w!=null))switch(u){case"value":p=w;break;case"defaultValue":y=w;break;case"multiple":o=w;default:Xe(t,a,u,w,s,null)}a=p,s=y,t.multiple=!!o,a!=null?Zi(t,!!o,a,!1):s!=null&&Zi(t,!!o,s,!0);return;case"textarea":Me("invalid",t),p=u=o=null;for(y in s)if(s.hasOwnProperty(y)&&(w=s[y],w!=null))switch(y){case"value":o=w;break;case"defaultValue":u=w;break;case"children":p=w;break;case"dangerouslySetInnerHTML":if(w!=null)throw Error(r(91));break;default:Xe(t,a,y,w,s,null)}nm(t,o,u,p);return;case"option":for(C in s)s.hasOwnProperty(C)&&(o=s[C],o!=null)&&(C==="selected"?t.selected=o&&typeof o!="function"&&typeof o!="symbol":Xe(t,a,C,o,s,null));return;case"dialog":Me("beforetoggle",t),Me("toggle",t),Me("cancel",t),Me("close",t);break;case"iframe":case"object":Me("load",t);break;case"video":case"audio":for(o=0;o<Vr.length;o++)Me(Vr[o],t);break;case"image":Me("error",t),Me("load",t);break;case"details":Me("toggle",t);break;case"embed":case"source":case"link":Me("error",t),Me("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(Zc(a)){for(P in s)s.hasOwnProperty(P)&&(o=s[P],o!==void 0&&Rd(t,a,P,o,s,void 0));return}}for(w in s)s.hasOwnProperty(w)&&(o=s[w],o!=null&&Xe(t,a,w,o,s,null))}function Hx(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,w=null,C=null,L=null,P=null;for(I in s){var Y=s[I];if(s.hasOwnProperty(I)&&Y!=null)switch(I){case"checked":break;case"value":break;case"defaultValue":C=Y;default:o.hasOwnProperty(I)||Xe(t,a,I,null,o,Y)}}for(var U in o){var I=o[U];if(Y=s[U],o.hasOwnProperty(U)&&(I!=null||Y!=null))switch(U){case"type":p=I;break;case"name":u=I;break;case"checked":L=I;break;case"defaultChecked":P=I;break;case"value":y=I;break;case"defaultValue":w=I;break;case"children":case"dangerouslySetInnerHTML":if(I!=null)throw Error(r(137,a));break;default:I!==Y&&Xe(t,a,U,I,o,Y)}}Qc(t,y,w,C,L,P,p,u);return;case"select":I=y=w=U=null;for(p in s)if(C=s[p],s.hasOwnProperty(p)&&C!=null)switch(p){case"value":break;case"multiple":I=C;default:o.hasOwnProperty(p)||Xe(t,a,p,null,o,C)}for(u in o)if(p=o[u],C=s[u],o.hasOwnProperty(u)&&(p!=null||C!=null))switch(u){case"value":U=p;break;case"defaultValue":w=p;break;case"multiple":y=p;default:p!==C&&Xe(t,a,u,p,o,C)}a=w,s=y,o=I,U!=null?Zi(t,!!s,U,!1):!!o!=!!s&&(a!=null?Zi(t,!!s,a,!0):Zi(t,!!s,s?[]:"",!1));return;case"textarea":I=U=null;for(w in s)if(u=s[w],s.hasOwnProperty(w)&&u!=null&&!o.hasOwnProperty(w))switch(w){case"value":break;case"children":break;default:Xe(t,a,w,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":U=u;break;case"defaultValue":I=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)}tm(t,U,I);return;case"option":for(var pe in s)U=s[pe],s.hasOwnProperty(pe)&&U!=null&&!o.hasOwnProperty(pe)&&(pe==="selected"?t.selected=!1:Xe(t,a,pe,null,o,U));for(C in o)U=o[C],I=s[C],o.hasOwnProperty(C)&&U!==I&&(U!=null||I!=null)&&(C==="selected"?t.selected=U&&typeof U!="function"&&typeof U!="symbol":Xe(t,a,C,U,o,I));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)U=s[we],s.hasOwnProperty(we)&&U!=null&&!o.hasOwnProperty(we)&&Xe(t,a,we,null,o,U);for(L in o)if(U=o[L],I=s[L],o.hasOwnProperty(L)&&U!==I&&(U!=null||I!=null))switch(L){case"children":case"dangerouslySetInnerHTML":if(U!=null)throw Error(r(137,a));break;default:Xe(t,a,L,U,o,I)}return;default:if(Zc(a)){for(var Je in s)U=s[Je],s.hasOwnProperty(Je)&&U!==void 0&&!o.hasOwnProperty(Je)&&Rd(t,a,Je,void 0,o,U);for(P in o)U=o[P],I=s[P],!o.hasOwnProperty(P)||U===I||U===void 0&&I===void 0||Rd(t,a,P,U,o,I);return}}for(var D in s)U=s[D],s.hasOwnProperty(D)&&U!=null&&!o.hasOwnProperty(D)&&Xe(t,a,D,null,o,U);for(Y in o)U=o[Y],I=s[Y],!o.hasOwnProperty(Y)||U===I||U==null&&I==null||Xe(t,a,Y,U,o,I)}function sy(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Qx(){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,w=u.duration;if(p&&w&&sy(y)){for(y=0,w=u.responseEnd,o+=1;o<s.length;o++){var C=s[o],L=C.startTime;if(L>w)break;var P=C.transferSize,Y=C.initiatorType;P&&sy(Y)&&(C=C.responseEnd,y+=P*(C<w?1:(w-L)/(C-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 Md=null,Bd=null;function Al(t){return t.nodeType===9?t:t.ownerDocument}function ry(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 oy(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 Ld(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 qd=null;function Kx(){var t=window.event;return t&&t.type==="popstate"?t===qd?!1:(qd=t,!0):(qd=null,!1)}var ly=typeof setTimeout=="function"?setTimeout:void 0,Zx=typeof clearTimeout=="function"?clearTimeout:void 0,cy=typeof Promise=="function"?Promise:void 0,Yx=typeof queueMicrotask=="function"?queueMicrotask:typeof cy<"u"?function(t){return cy.resolve(null).then(t).catch(Xx)}:ly;function Xx(t){setTimeout(function(){throw t})}function qa(t){return t==="head"}function uy(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),As(a);return}o--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")o++;else if(s==="html")Gr(t.ownerDocument.documentElement);else if(s==="head"){s=t.ownerDocument.head,Gr(s);for(var p=s.firstChild;p;){var y=p.nextSibling,w=p.nodeName;p[lr]||w==="SCRIPT"||w==="STYLE"||w==="LINK"&&p.rel.toLowerCase()==="stylesheet"||s.removeChild(p),p=y}}else s==="body"&&Gr(t.ownerDocument.body);s=u}while(s);As(a)}function dy(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 Ud(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":Ud(s),Gc(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}t.removeChild(s)}}function Jx(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[lr])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=Sn(t.nextSibling),t===null)break}return null}function Fx(t,a,s){if(a==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!s||(t=Sn(t.nextSibling),t===null))return null;return t}function fy(t,a){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!a||(t=Sn(t.nextSibling),t===null))return null;return t}function $d(t){return t.data==="$?"||t.data==="$~"}function Id(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function Wx(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 Sn(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 Vd=null;function py(t){t=t.nextSibling;for(var a=0;t;){if(t.nodeType===8){var s=t.data;if(s==="/$"||s==="/&"){if(a===0)return Sn(t.nextSibling);a--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||a++}t=t.nextSibling}return null}function my(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 hy(t,a,s){switch(a=Al(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 Gr(t){for(var a=t.attributes;a.length;)t.removeAttributeNode(a[0]);Gc(t)}var xn=new Map,gy=new Set;function _l(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var fa=W.d;W.d={f:ew,r:tw,D:nw,C:aw,L:iw,m:sw,X:ow,S:rw,M:lw};function ew(){var t=fa.f(),a=bl();return t||a}function tw(t){var a=Hi(t);a!==null&&a.tag===5&&a.type==="form"?Dh(a):fa.r(t)}var js=typeof document>"u"?null:document;function yy(t,a,s){var o=js;if(o&&typeof a=="string"&&a){var u=pn(a);u='link[rel="'+t+'"][href="'+u+'"]',typeof s=="string"&&(u+='[crossorigin="'+s+'"]'),gy.has(u)||(gy.add(u),t={rel:t,crossOrigin:s,href:a},o.querySelector(u)===null&&(a=o.createElement("link"),Lt(a,"link",t),zt(a),o.head.appendChild(a)))}}function nw(t){fa.D(t),yy("dns-prefetch",t,null)}function aw(t,a){fa.C(t,a),yy("preconnect",t,a)}function iw(t,a,s){fa.L(t,a,s);var o=js;if(o&&t&&a){var u='link[rel="preload"][as="'+pn(a)+'"]';a==="image"&&s&&s.imageSrcSet?(u+='[imagesrcset="'+pn(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(u+='[imagesizes="'+pn(s.imageSizes)+'"]')):u+='[href="'+pn(t)+'"]';var p=u;switch(a){case"style":p=Ns(t);break;case"script":p=ks(t)}xn.has(p)||(t=x({rel:"preload",href:a==="image"&&s&&s.imageSrcSet?void 0:t,as:a},s),xn.set(p,t),o.querySelector(u)!==null||a==="style"&&o.querySelector(Hr(p))||a==="script"&&o.querySelector(Qr(p))||(a=o.createElement("link"),Lt(a,"link",t),zt(a),o.head.appendChild(a)))}}function sw(t,a){fa.m(t,a);var s=js;if(s&&t){var o=a&&typeof a.as=="string"?a.as:"script",u='link[rel="modulepreload"][as="'+pn(o)+'"][href="'+pn(t)+'"]',p=u;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":p=ks(t)}if(!xn.has(p)&&(t=x({rel:"modulepreload",href:t},a),xn.set(p,t),s.querySelector(u)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(Qr(p)))return}o=s.createElement("link"),Lt(o,"link",t),zt(o),s.head.appendChild(o)}}}function rw(t,a,s){fa.S(t,a,s);var o=js;if(o&&t){var u=Qi(o).hoistableStyles,p=Ns(t);a=a||"default";var y=u.get(p);if(!y){var w={loading:0,preload:null};if(y=o.querySelector(Hr(p)))w.loading=5;else{t=x({rel:"stylesheet",href:t,"data-precedence":a},s),(s=xn.get(p))&&Pd(t,s);var C=y=o.createElement("link");zt(C),Lt(C,"link",t),C._p=new Promise(function(L,P){C.onload=L,C.onerror=P}),C.addEventListener("load",function(){w.loading|=1}),C.addEventListener("error",function(){w.loading|=2}),w.loading|=4,Cl(y,a,o)}y={type:"stylesheet",instance:y,count:1,state:w},u.set(p,y)}}}function ow(t,a){fa.X(t,a);var s=js;if(s&&t){var o=Qi(s).hoistableScripts,u=ks(t),p=o.get(u);p||(p=s.querySelector(Qr(u)),p||(t=x({src:t,async:!0},a),(a=xn.get(u))&&Gd(t,a),p=s.createElement("script"),zt(p),Lt(p,"link",t),s.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},o.set(u,p))}}function lw(t,a){fa.M(t,a);var s=js;if(s&&t){var o=Qi(s).hoistableScripts,u=ks(t),p=o.get(u);p||(p=s.querySelector(Qr(u)),p||(t=x({src:t,async:!0,type:"module"},a),(a=xn.get(u))&&Gd(t,a),p=s.createElement("script"),zt(p),Lt(p,"link",t),s.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},o.set(u,p))}}function by(t,a,s,o){var u=(u=ne.current)?_l(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=Ns(s.href),s=Qi(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=Ns(s.href);var p=Qi(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(Hr(t)))&&!p._p&&(y.instance=p,y.state.loading=5),xn.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},xn.set(t,s),p||cw(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=ks(s),s=Qi(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 Ns(t){return'href="'+pn(t)+'"'}function Hr(t){return'link[rel="stylesheet"]['+t+"]"}function vy(t){return x({},t,{"data-precedence":t.precedence,precedence:null})}function cw(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}),Lt(a,"link",s),zt(a),t.head.appendChild(a))}function ks(t){return'[src="'+pn(t)+'"]'}function Qr(t){return"script[async]"+t}function Sy(t,a,s){if(a.count++,a.instance===null)switch(a.type){case"style":var o=t.querySelector('style[data-href~="'+pn(s.href)+'"]');if(o)return a.instance=o,zt(o),o;var u=x({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return o=(t.ownerDocument||t).createElement("style"),zt(o),Lt(o,"style",u),Cl(o,s.precedence,t),a.instance=o;case"stylesheet":u=Ns(s.href);var p=t.querySelector(Hr(u));if(p)return a.state.loading|=4,a.instance=p,zt(p),p;o=vy(s),(u=xn.get(u))&&Pd(o,u),p=(t.ownerDocument||t).createElement("link"),zt(p);var y=p;return y._p=new Promise(function(w,C){y.onload=w,y.onerror=C}),Lt(p,"link",o),a.state.loading|=4,Cl(p,s.precedence,t),a.instance=p;case"script":return p=ks(s.src),(u=t.querySelector(Qr(p)))?(a.instance=u,zt(u),u):(o=s,(u=xn.get(p))&&(o=x({},s),Gd(o,u)),t=t.ownerDocument||t,u=t.createElement("script"),zt(u),Lt(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,Cl(o,s.precedence,t));return a.instance}function Cl(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 w=o[y];if(w.dataset.precedence===a)p=w;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 Pd(t,a){t.crossOrigin==null&&(t.crossOrigin=a.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=a.referrerPolicy),t.title==null&&(t.title=a.title)}function Gd(t,a){t.crossOrigin==null&&(t.crossOrigin=a.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=a.referrerPolicy),t.integrity==null&&(t.integrity=a.integrity)}var zl=null;function xy(t,a,s){if(zl===null){var o=new Map,u=zl=new Map;u.set(s,o)}else u=zl,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[lr]||p[Dt]||t==="link"&&p.getAttribute("rel")==="stylesheet")&&p.namespaceURI!=="http://www.w3.org/2000/svg"){var y=p.getAttribute(a)||"";y=t+y;var w=o.get(y);w?w.push(p):o.set(y,[p])}}return o}function wy(t,a,s){t=t.ownerDocument||t,t.head.insertBefore(s,a==="title"?t.querySelector("head > title"):null)}function uw(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 jy(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function dw(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=Ns(o.href),p=a.querySelector(Hr(u));if(p){a=p._p,a!==null&&typeof a=="object"&&typeof a.then=="function"&&(t.count++,t=Tl.bind(t),a.then(t,t)),s.state.loading|=4,s.instance=p,zt(p);return}p=a.ownerDocument||a,o=vy(o),(u=xn.get(u))&&Pd(o,u),p=p.createElement("link"),zt(p);var y=p;y._p=new Promise(function(w,C){y.onload=w,y.onerror=C}),Lt(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=Tl.bind(t),a.addEventListener("load",s),a.addEventListener("error",s))}}var Hd=0;function fw(t,a){return t.stylesheets&&t.count===0&&Ol(t,t.stylesheets),0<t.count||0<t.imgCount?function(s){var o=setTimeout(function(){if(t.stylesheets&&Ol(t,t.stylesheets),t.unsuspend){var p=t.unsuspend;t.unsuspend=null,p()}},6e4+a);0<t.imgBytes&&Hd===0&&(Hd=62500*Qx());var u=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&Ol(t,t.stylesheets),t.unsuspend)){var p=t.unsuspend;t.unsuspend=null,p()}},(t.imgBytes>Hd?50:800)+a);return t.unsuspend=s,function(){t.unsuspend=null,clearTimeout(o),clearTimeout(u)}}:null}function Tl(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ol(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var El=null;function Ol(t,a){t.stylesheets=null,t.unsuspend!==null&&(t.count++,El=new Map,a.forEach(pw,t),El=null,Tl.call(t))}function pw(t,a){if(!(a.state.loading&4)){var s=El.get(t);if(s)var o=s.get(null);else{s=new Map,El.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=Tl.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 Kr={$$typeof:G,Provider:null,Consumer:null,_currentValue:fe,_currentValue2:fe,_threadCount:0};function mw(t,a,s,o,u,p,y,w,C){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=te(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=te(0),this.hiddenUpdates=te(null),this.identifierPrefix=o,this.onUncaughtError=u,this.onCaughtError=p,this.onRecoverableError=y,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=C,this.incompleteTransitions=new Map}function Ny(t,a,s,o,u,p,y,w,C,L,P,Y){return t=new mw(t,a,s,y,C,L,P,Y,w),a=1,p===!0&&(a|=24),p=sn(3,null,null,a),t.current=p,p.stateNode=t,a=Nu(),a.refCount++,t.pooledCache=a,a.refCount++,p.memoizedState={element:o,isDehydrated:s,cache:a},Cu(p),t}function ky(t){return t?(t=ns,t):ns}function Ay(t,a,s,o,u,p){u=ky(u),o.context===null?o.context=u:o.pendingContext=u,o=_a(a),o.payload={element:s},p=p===void 0?null:p,p!==null&&(o.callback=p),s=Ca(t,o,a),s!==null&&(Wt(s,t,a),kr(s,t,a))}function _y(t,a){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var s=t.retryLane;t.retryLane=s!==0&&s<a?s:a}}function Qd(t,a){_y(t,a),(t=t.alternate)&&_y(t,a)}function Cy(t){if(t.tag===13||t.tag===31){var a=li(t,67108864);a!==null&&Wt(a,t,67108864),Qd(t,67108864)}}function zy(t){if(t.tag===13||t.tag===31){var a=un();a=or(a);var s=li(t,a);s!==null&&Wt(s,t,a),Qd(t,a)}}var Dl=!0;function hw(t,a,s,o){var u=$.T;$.T=null;var p=W.p;try{W.p=2,Kd(t,a,s,o)}finally{W.p=p,$.T=u}}function gw(t,a,s,o){var u=$.T;$.T=null;var p=W.p;try{W.p=8,Kd(t,a,s,o)}finally{W.p=p,$.T=u}}function Kd(t,a,s,o){if(Dl){var u=Zd(o);if(u===null)Dd(t,a,o,Rl,s),Ey(t,o);else if(bw(u,t,a,s,o))o.stopPropagation();else if(Ey(t,o),a&4&&-1<yw.indexOf(t)){for(;u!==null;){var p=Hi(u);if(p!==null)switch(p.tag){case 3:if(p=p.stateNode,p.current.memoizedState.isDehydrated){var y=Kn(p.pendingLanes);if(y!==0){var w=p;for(w.pendingLanes|=2,w.entangledLanes|=2;y;){var C=1<<31-ht(y);w.entanglements[1]|=C,y&=~C}Pn(p),(Pe&6)===0&&(gl=Ut()+500,Ir(0))}}break;case 31:case 13:w=li(p,2),w!==null&&Wt(w,p,2),bl(),Qd(p,2)}if(p=Zd(o),p===null&&Dd(t,a,o,Rl,s),p===u)break;u=p}u!==null&&o.stopPropagation()}else Dd(t,a,o,null,s)}}function Zd(t){return t=Xc(t),Yd(t)}var Rl=null;function Yd(t){if(Rl=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=h(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 Rl=t,null}function Ty(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(wo()){case ir:return 2;case jo:return 8;case Li:case Ic:return 32;case qi:return 268435456;default:return 32}default:return 32}}var Xd=!1,Ua=null,$a=null,Ia=null,Zr=new Map,Yr=new Map,Va=[],yw="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 Ey(t,a){switch(t){case"focusin":case"focusout":Ua=null;break;case"dragenter":case"dragleave":$a=null;break;case"mouseover":case"mouseout":Ia=null;break;case"pointerover":case"pointerout":Zr.delete(a.pointerId);break;case"gotpointercapture":case"lostpointercapture":Yr.delete(a.pointerId)}}function Xr(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=Hi(a),a!==null&&Cy(a)),t):(t.eventSystemFlags|=o,a=t.targetContainers,u!==null&&a.indexOf(u)===-1&&a.push(u),t)}function bw(t,a,s,o,u){switch(a){case"focusin":return Ua=Xr(Ua,t,a,s,o,u),!0;case"dragenter":return $a=Xr($a,t,a,s,o,u),!0;case"mouseover":return Ia=Xr(Ia,t,a,s,o,u),!0;case"pointerover":var p=u.pointerId;return Zr.set(p,Xr(Zr.get(p)||null,t,a,s,o,u)),!0;case"gotpointercapture":return p=u.pointerId,Yr.set(p,Xr(Yr.get(p)||null,t,a,s,o,u)),!0}return!1}function Oy(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,Qp(t.priority,function(){zy(s)});return}}else if(a===31){if(a=h(s),a!==null){t.blockedOn=a,Qp(t.priority,function(){zy(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 Ml(t){if(t.blockedOn!==null)return!1;for(var a=t.targetContainers;0<a.length;){var s=Zd(t.nativeEvent);if(s===null){s=t.nativeEvent;var o=new s.constructor(s.type,s);Yc=o,s.target.dispatchEvent(o),Yc=null}else return a=Hi(s),a!==null&&Cy(a),t.blockedOn=s,!1;a.shift()}return!0}function Dy(t,a,s){Ml(t)&&s.delete(a)}function vw(){Xd=!1,Ua!==null&&Ml(Ua)&&(Ua=null),$a!==null&&Ml($a)&&($a=null),Ia!==null&&Ml(Ia)&&(Ia=null),Zr.forEach(Dy),Yr.forEach(Dy)}function Bl(t,a){t.blockedOn===a&&(t.blockedOn=null,Xd||(Xd=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,vw)))}var Ll=null;function Ry(t){Ll!==t&&(Ll=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Ll===t&&(Ll=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(Yd(o||s)===null)continue;break}var p=Hi(s);p!==null&&(t.splice(a,3),a-=3,Zu(p,{pending:!0,data:u,method:s.method,action:o},o,u))}}))}function As(t){function a(C){return Bl(C,t)}Ua!==null&&Bl(Ua,t),$a!==null&&Bl($a,t),Ia!==null&&Bl(Ia,t),Zr.forEach(a),Yr.forEach(a);for(var s=0;s<Va.length;s++){var o=Va[s];o.blockedOn===t&&(o.blockedOn=null)}for(;0<Va.length&&(s=Va[0],s.blockedOn===null);)Oy(s),s.blockedOn===null&&Va.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[Kt]||null;if(typeof p=="function")y||Ry(s);else if(y){var w=null;if(p&&p.hasAttribute("formAction")){if(u=p,y=p[Kt]||null)w=y.formAction;else if(Yd(u)!==null)continue}else w=y.action;typeof w=="function"?s[o+1]=w:(s.splice(o,3),o-=3),Ry(s)}}}function My(){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 Jd(t){this._internalRoot=t}ql.prototype.render=Jd.prototype.render=function(t){var a=this._internalRoot;if(a===null)throw Error(r(409));var s=a.current,o=un();Ay(s,o,t,a,null,null)},ql.prototype.unmount=Jd.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var a=t.containerInfo;Ay(t.current,2,null,t,null,null),bl(),a[Pi]=null}};function ql(t){this._internalRoot=t}ql.prototype.unstable_scheduleHydration=function(t){if(t){var a=Hp();t={blockedOn:null,target:t,priority:a};for(var s=0;s<Va.length&&a!==0&&a<Va[s].priority;s++);Va.splice(s,0,t),s===0&&Oy(t)}};var By=n.version;if(By!=="19.2.4")throw Error(r(527,By,"19.2.4"));W.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?S(t):null,t=t===null?null:t.stateNode,t};var Sw={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:$,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ul=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ul.isDisabled&&Ul.supportsFiber)try{va=Ul.inject(Sw),$t=Ul}catch{}}return Jr.createRoot=function(t,a){if(!l(t))throw Error(r(299));var s=!1,o="",u=Ph,p=Gh,y=Hh;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=Ny(t,1,!1,null,null,s,o,null,u,p,y,My),t[Pi]=a.current,Od(t),new Jd(a)},Jr.hydrateRoot=function(t,a,s){if(!l(t))throw Error(r(299));var o=!1,u="",p=Ph,y=Gh,w=Hh,C=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&&(w=s.onRecoverableError),s.formState!==void 0&&(C=s.formState)),a=Ny(t,1,!0,a,s??null,o,u,C,p,y,w,My),a.context=ky(null),s=a.current,o=un(),o=or(o),u=_a(o),u.callback=null,Ca(s,u,o),s=o,a.current.lanes=s,Fe(a,s),Pn(a),t[Pi]=a.current,Od(t),new ql(a)},Jr.version="19.2.4",Jr}var $y;function Uw(){if($y)return Fd.exports;$y=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(),Fd.exports=qw(),Fd.exports}var $w=Uw();const Iw={bodySerializer:e=>JSON.stringify(e,(n,i)=>typeof i=="bigint"?i.toString():i)},Vw=({onRequest:e,onSseError:n,onSseEvent:i,responseTransformer:r,responseValidator:l,sseDefaultRetryDelay:c,sseMaxRetryAttempts:d,sseMaxRetryDelay:h,sseSleepFn:g,url:b,...S})=>{let x;const N=g??(k=>new Promise(E=>setTimeout(E,k)));return{stream:async function*(){let k=c??3e3,E=0;const R=S.signal??new AbortController().signal;for(;!R.aborted;){E++;const V=S.headers instanceof Headers?S.headers:new Headers(S.headers);x!==void 0&&V.set("Last-Event-ID",x);try{const G={redirect:"follow",...S,body:S.serializedBody,headers:V,signal:R};let Z=new Request(b,G);e&&(Z=await e(b,G));const J=await(S.fetch??globalThis.fetch)(Z);if(!J.ok)throw new Error(`SSE failed: ${J.status} ${J.statusText}`);if(!J.body)throw new Error("No body in SSE response");const O=J.body.pipeThrough(new TextDecoderStream).getReader();let M="";const le=()=>{try{O.cancel()}catch{}};R.addEventListener("abort",le);try{for(;;){const{done:Ae,value:Ce}=await O.read();if(Ae)break;M+=Ce;const ve=M.split(`
|
|
9
|
+
`+o.stack}}var Ri=Object.prototype.hasOwnProperty,Mi=e.unstable_scheduleCallback,Bi=e.unstable_cancelCallback,xo=e.unstable_shouldYield,$c=e.unstable_requestPaint,Ut=e.unstable_now,wo=e.unstable_getCurrentPriorityLevel,ir=e.unstable_ImmediatePriority,jo=e.unstable_UserBlockingPriority,Li=e.unstable_NormalPriority,Ic=e.unstable_LowPriority,qi=e.unstable_IdlePriority,No=e.log,sr=e.unstable_setDisableYieldValue,va=null,$t=null;function Tn(t){if(typeof No=="function"&&sr(t),$t&&typeof $t.setStrictMode=="function")try{$t.setStrictMode(va,t)}catch{}}var ht=Math.clz32?Math.clz32:Vc,Un=Math.log,ti=Math.LN2;function Vc(t){return t>>>=0,t===0?32:31-(Un(t)/ti|0)|0}var Ui=256,$i=262144,Ii=4194304;function Kn(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 Vi(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 w=o&134217727;return w!==0?(o=w&~p,o!==0?u=Kn(o):(y&=w,y!==0?u=Kn(y):s||(s=w&~t,s!==0&&(u=Kn(s))))):(w=o&~p,w!==0?u=Kn(w):y!==0?u=Kn(y):s||(s=o&~t,s!==0&&(u=Kn(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 ni(t,a){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&a)===0}function Zn(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 ko(){var t=Ii;return Ii<<=1,(Ii&62914560)===0&&(Ii=4194304),t}function te(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 ai(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 w=t.entanglements,C=t.expirationTimes,L=t.hiddenUpdates;for(s=y&~s;0<s;){var P=31-ht(s),Y=1<<P;w[P]=0,C[P]=-1;var U=L[P];if(U!==null)for(L[P]=null,P=0;P<U.length;P++){var I=U[P];I!==null&&(I.lane&=-536870913)}s&=~Y}o!==0&&Ao(t,o,0),p!==0&&u===0&&t.tag!==0&&(t.suspendedLanes|=p&~(y&~a))}function Ao(t,a,s){t.pendingLanes|=a,t.suspendedLanes&=~a;var o=31-ht(a);t.entangledLanes|=a,t.entanglements[o]=t.entanglements[o]|1073741824|s&261930}function _o(t,a){var s=t.entangledLanes|=a;for(t=t.entanglements;s;){var o=31-ht(s),u=1<<o;u&a|t[o]&a&&(t[o]|=a),s&=~u}}function rr(t,a){var s=a&-a;return s=(s&42)!==0?1:or(s),(s&(t.suspendedLanes|a))!==0?0:s}function or(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 En(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function Hp(){var t=W.p;return t!==0?t:(t=window.event,t===void 0?32:Ty(t.type))}function Qp(t,a){var s=W.p;try{return W.p=t,a()}finally{W.p=s}}var Sa=Math.random().toString(36).slice(2),Dt="__reactFiber$"+Sa,Kt="__reactProps$"+Sa,Pi="__reactContainer$"+Sa,Pc="__reactEvents$"+Sa,f1="__reactListeners$"+Sa,p1="__reactHandles$"+Sa,Kp="__reactResources$"+Sa,lr="__reactMarker$"+Sa;function Gc(t){delete t[Dt],delete t[Kt],delete t[Pc],delete t[f1],delete t[p1]}function Gi(t){var a=t[Dt];if(a)return a;for(var s=t.parentNode;s;){if(a=s[Pi]||s[Dt]){if(s=a.alternate,a.child!==null||s!==null&&s.child!==null)for(t=my(t);t!==null;){if(s=t[Dt])return s;t=my(t)}return a}t=s,s=t.parentNode}return null}function Hi(t){if(t=t[Dt]||t[Pi]){var a=t.tag;if(a===5||a===6||a===13||a===31||a===26||a===27||a===3)return t}return null}function cr(t){var a=t.tag;if(a===5||a===26||a===27||a===6)return t.stateNode;throw Error(r(33))}function Qi(t){var a=t[Kp];return a||(a=t[Kp]={hoistableStyles:new Map,hoistableScripts:new Map}),a}function zt(t){t[lr]=!0}var Zp=new Set,Yp={};function ii(t,a){Ki(t,a),Ki(t+"Capture",a)}function Ki(t,a){for(Yp[t]=a,t=0;t<a.length;t++)Zp.add(a[t])}var m1=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]*$"),Xp={},Jp={};function h1(t){return Ri.call(Jp,t)?!0:Ri.call(Xp,t)?!1:m1.test(t)?Jp[t]=!0:(Xp[t]=!0,!1)}function Co(t,a,s){if(h1(a))if(s===null)t.removeAttribute(a);else{switch(typeof s){case"undefined":case"function":case"symbol":t.removeAttribute(a);return;case"boolean":var o=a.toLowerCase().slice(0,5);if(o!=="data-"&&o!=="aria-"){t.removeAttribute(a);return}}t.setAttribute(a,""+s)}}function zo(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 Yn(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 fn(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Fp(t){var a=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function g1(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 Hc(t){if(!t._valueTracker){var a=Fp(t)?"checked":"value";t._valueTracker=g1(t,a,""+t[a])}}function Wp(t){if(!t)return!1;var a=t._valueTracker;if(!a)return!0;var s=a.getValue(),o="";return t&&(o=Fp(t)?t.checked?"true":"false":t.value),t=o,t!==s?(a.setValue(t),!0):!1}function To(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 y1=/[\n"\\]/g;function pn(t){return t.replace(y1,function(a){return"\\"+a.charCodeAt(0).toString(16)+" "})}function Qc(t,a,s,o,u,p,y,w){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=""+fn(a)):t.value!==""+fn(a)&&(t.value=""+fn(a)):y!=="submit"&&y!=="reset"||t.removeAttribute("value"),a!=null?Kc(t,y,fn(a)):s!=null?Kc(t,y,fn(s)):o!=null&&t.removeAttribute("value"),u==null&&p!=null&&(t.defaultChecked=!!p),u!=null&&(t.checked=u&&typeof u!="function"&&typeof u!="symbol"),w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?t.name=""+fn(w):t.removeAttribute("name")}function em(t,a,s,o,u,p,y,w){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)){Hc(t);return}s=s!=null?""+fn(s):"",a=a!=null?""+fn(a):s,w||a===t.value||(t.value=a),t.defaultValue=a}o=o??u,o=typeof o!="function"&&typeof o!="symbol"&&!!o,t.checked=w?t.checked:!!o,t.defaultChecked=!!o,y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(t.name=y),Hc(t)}function Kc(t,a,s){a==="number"&&To(t.ownerDocument)===t||t.defaultValue===""+s||(t.defaultValue=""+s)}function Zi(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=""+fn(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 tm(t,a,s){if(a!=null&&(a=""+fn(a),a!==t.value&&(t.value=a),s==null)){t.defaultValue!==a&&(t.defaultValue=a);return}t.defaultValue=s!=null?""+fn(s):""}function nm(t,a,s,o){if(a==null){if(o!=null){if(s!=null)throw Error(r(92));if(me(o)){if(1<o.length)throw Error(r(93));o=o[0]}s=o}s==null&&(s=""),a=s}s=fn(a),t.defaultValue=s,o=t.textContent,o===s&&o!==""&&o!==null&&(t.value=o),Hc(t)}function Yi(t,a){if(a){var s=t.firstChild;if(s&&s===t.lastChild&&s.nodeType===3){s.nodeValue=a;return}}t.textContent=a}var b1=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 am(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||b1.has(a)?a==="float"?t.cssFloat=s:t[a]=(""+s).trim():t[a]=s+"px"}function im(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&&am(t,u,o)}else for(var p in a)a.hasOwnProperty(p)&&am(t,p,a[p])}function Zc(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 v1=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"]]),S1=/^[\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 Eo(t){return S1.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function Xn(){}var Yc=null;function Xc(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Xi=null,Ji=null;function sm(t){var a=Hi(t);if(a&&(t=a.stateNode)){var s=t[Kt]||null;e:switch(t=a.stateNode,a.type){case"input":if(Qc(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="'+pn(""+a)+'"][type="radio"]'),a=0;a<s.length;a++){var o=s[a];if(o!==t&&o.form===t.form){var u=o[Kt]||null;if(!u)throw Error(r(90));Qc(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&&Wp(o)}break e;case"textarea":tm(t,s.value,s.defaultValue);break e;case"select":a=s.value,a!=null&&Zi(t,!!s.multiple,a,!1)}}}var Jc=!1;function rm(t,a,s){if(Jc)return t(a,s);Jc=!0;try{var o=t(a);return o}finally{if(Jc=!1,(Xi!==null||Ji!==null)&&(bl(),Xi&&(a=Xi,t=Ji,Ji=Xi=null,sm(a),t)))for(a=0;a<t.length;a++)sm(t[a])}}function ur(t,a){var s=t.stateNode;if(s===null)return null;var o=s[Kt]||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 Jn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Fc=!1;if(Jn)try{var dr={};Object.defineProperty(dr,"passive",{get:function(){Fc=!0}}),window.addEventListener("test",dr,dr),window.removeEventListener("test",dr,dr)}catch{Fc=!1}var xa=null,Wc=null,Oo=null;function om(){if(Oo)return Oo;var t,a=Wc,s=a.length,o,u="value"in xa?xa.value:xa.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 Oo=u.slice(t,1<o?1-o:void 0)}function Do(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 Ro(){return!0}function lm(){return!1}function Zt(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 w in t)t.hasOwnProperty(w)&&(s=t[w],this[w]=s?s(p):p[w]);return this.isDefaultPrevented=(p.defaultPrevented!=null?p.defaultPrevented:p.returnValue===!1)?Ro:lm,this.isPropagationStopped=lm,this}return x(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=Ro)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=Ro)},persist:function(){},isPersistent:Ro}),a}var si={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Mo=Zt(si),fr=x({},si,{view:0,detail:0}),x1=Zt(fr),eu,tu,pr,Bo=x({},fr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:au,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!==pr&&(pr&&t.type==="mousemove"?(eu=t.screenX-pr.screenX,tu=t.screenY-pr.screenY):tu=eu=0,pr=t),eu)},movementY:function(t){return"movementY"in t?t.movementY:tu}}),cm=Zt(Bo),w1=x({},Bo,{dataTransfer:0}),j1=Zt(w1),N1=x({},fr,{relatedTarget:0}),nu=Zt(N1),k1=x({},si,{animationName:0,elapsedTime:0,pseudoElement:0}),A1=Zt(k1),_1=x({},si,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),C1=Zt(_1),z1=x({},si,{data:0}),um=Zt(z1),T1={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},E1={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"},O1={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function D1(t){var a=this.nativeEvent;return a.getModifierState?a.getModifierState(t):(t=O1[t])?!!a[t]:!1}function au(){return D1}var R1=x({},fr,{key:function(t){if(t.key){var a=T1[t.key]||t.key;if(a!=="Unidentified")return a}return t.type==="keypress"?(t=Do(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?E1[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:au,charCode:function(t){return t.type==="keypress"?Do(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Do(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),M1=Zt(R1),B1=x({},Bo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),dm=Zt(B1),L1=x({},fr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:au}),q1=Zt(L1),U1=x({},si,{propertyName:0,elapsedTime:0,pseudoElement:0}),$1=Zt(U1),I1=x({},Bo,{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}),V1=Zt(I1),P1=x({},si,{newState:0,oldState:0}),G1=Zt(P1),H1=[9,13,27,32],iu=Jn&&"CompositionEvent"in window,mr=null;Jn&&"documentMode"in document&&(mr=document.documentMode);var Q1=Jn&&"TextEvent"in window&&!mr,fm=Jn&&(!iu||mr&&8<mr&&11>=mr),pm=" ",mm=!1;function hm(t,a){switch(t){case"keyup":return H1.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function gm(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Fi=!1;function K1(t,a){switch(t){case"compositionend":return gm(a);case"keypress":return a.which!==32?null:(mm=!0,pm);case"textInput":return t=a.data,t===pm&&mm?null:t;default:return null}}function Z1(t,a){if(Fi)return t==="compositionend"||!iu&&hm(t,a)?(t=om(),Oo=Wc=xa=null,Fi=!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 fm&&a.locale!=="ko"?null:a.data;default:return null}}var Y1={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 ym(t){var a=t&&t.nodeName&&t.nodeName.toLowerCase();return a==="input"?!!Y1[t.type]:a==="textarea"}function bm(t,a,s,o){Xi?Ji?Ji.push(o):Ji=[o]:Xi=o,a=kl(a,"onChange"),0<a.length&&(s=new Mo("onChange","change",null,s,o),t.push({event:s,listeners:a}))}var hr=null,gr=null;function X1(t){ey(t,0)}function Lo(t){var a=cr(t);if(Wp(a))return t}function vm(t,a){if(t==="change")return a}var Sm=!1;if(Jn){var su;if(Jn){var ru="oninput"in document;if(!ru){var xm=document.createElement("div");xm.setAttribute("oninput","return;"),ru=typeof xm.oninput=="function"}su=ru}else su=!1;Sm=su&&(!document.documentMode||9<document.documentMode)}function wm(){hr&&(hr.detachEvent("onpropertychange",jm),gr=hr=null)}function jm(t){if(t.propertyName==="value"&&Lo(gr)){var a=[];bm(a,gr,t,Xc(t)),rm(X1,a)}}function J1(t,a,s){t==="focusin"?(wm(),hr=a,gr=s,hr.attachEvent("onpropertychange",jm)):t==="focusout"&&wm()}function F1(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Lo(gr)}function W1(t,a){if(t==="click")return Lo(a)}function ex(t,a){if(t==="input"||t==="change")return Lo(a)}function tx(t,a){return t===a&&(t!==0||1/t===1/a)||t!==t&&a!==a}var an=typeof Object.is=="function"?Object.is:tx;function yr(t,a){if(an(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(!Ri.call(a,u)||!an(t[u],a[u]))return!1}return!0}function Nm(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function km(t,a){var s=Nm(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=Nm(s)}}function Am(t,a){return t&&a?t===a?!0:t&&t.nodeType===3?!1:a&&a.nodeType===3?Am(t,a.parentNode):"contains"in t?t.contains(a):t.compareDocumentPosition?!!(t.compareDocumentPosition(a)&16):!1:!1}function _m(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var a=To(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=To(t.document)}return a}function ou(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 nx=Jn&&"documentMode"in document&&11>=document.documentMode,Wi=null,lu=null,br=null,cu=!1;function Cm(t,a,s){var o=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;cu||Wi==null||Wi!==To(o)||(o=Wi,"selectionStart"in o&&ou(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}),br&&yr(br,o)||(br=o,o=kl(lu,"onSelect"),0<o.length&&(a=new Mo("onSelect","select",null,a,s),t.push({event:a,listeners:o}),a.target=Wi)))}function ri(t,a){var s={};return s[t.toLowerCase()]=a.toLowerCase(),s["Webkit"+t]="webkit"+a,s["Moz"+t]="moz"+a,s}var es={animationend:ri("Animation","AnimationEnd"),animationiteration:ri("Animation","AnimationIteration"),animationstart:ri("Animation","AnimationStart"),transitionrun:ri("Transition","TransitionRun"),transitionstart:ri("Transition","TransitionStart"),transitioncancel:ri("Transition","TransitionCancel"),transitionend:ri("Transition","TransitionEnd")},uu={},zm={};Jn&&(zm=document.createElement("div").style,"AnimationEvent"in window||(delete es.animationend.animation,delete es.animationiteration.animation,delete es.animationstart.animation),"TransitionEvent"in window||delete es.transitionend.transition);function oi(t){if(uu[t])return uu[t];if(!es[t])return t;var a=es[t],s;for(s in a)if(a.hasOwnProperty(s)&&s in zm)return uu[t]=a[s];return t}var Tm=oi("animationend"),Em=oi("animationiteration"),Om=oi("animationstart"),ax=oi("transitionrun"),ix=oi("transitionstart"),sx=oi("transitioncancel"),Dm=oi("transitionend"),Rm=new Map,du="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(" ");du.push("scrollEnd");function On(t,a){Rm.set(t,a),ii(a,[t])}var qo=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)},mn=[],ts=0,fu=0;function Uo(){for(var t=ts,a=fu=ts=0;a<t;){var s=mn[a];mn[a++]=null;var o=mn[a];mn[a++]=null;var u=mn[a];mn[a++]=null;var p=mn[a];if(mn[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&&Mm(s,u,p)}}function $o(t,a,s,o){mn[ts++]=t,mn[ts++]=a,mn[ts++]=s,mn[ts++]=o,fu|=o,t.lanes|=o,t=t.alternate,t!==null&&(t.lanes|=o)}function pu(t,a,s,o){return $o(t,a,s,o),Io(t)}function li(t,a){return $o(t,null,null,a),Io(t)}function Mm(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-ht(s),t=p.hiddenUpdates,o=t[u],o===null?t[u]=[a]:o.push(a),a.lane=s|536870912),p):null}function Io(t){if(50<$r)throw $r=0,wd=null,Error(r(185));for(var a=t.return;a!==null;)t=a,a=t.return;return t.tag===3?t.stateNode:null}var ns={};function rx(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 sn(t,a,s,o){return new rx(t,a,s,o)}function mu(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Fn(t,a){var s=t.alternate;return s===null?(s=sn(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 Bm(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 Vo(t,a,s,o,u,p){var y=0;if(o=t,typeof t=="function")mu(t)&&(y=1);else if(typeof t=="string")y=dw(t,s,ee.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case le:return t=sn(31,s,a,u),t.elementType=le,t.lanes=p,t;case k:return ci(s.children,u,p,a);case E:y=8,u|=24;break;case R:return t=sn(12,s,a,u|2),t.elementType=R,t.lanes=p,t;case X:return t=sn(13,s,a,u),t.elementType=X,t.lanes=p,t;case J:return t=sn(19,s,a,u),t.elementType=J,t.lanes=p,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case G:y=10;break e;case V:y=9;break e;case Z:y=11;break e;case O: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=sn(y,s,a,u),a.elementType=t,a.type=o,a.lanes=p,a}function ci(t,a,s,o){return t=sn(7,t,o,a),t.lanes=s,t}function hu(t,a,s){return t=sn(6,t,null,a),t.lanes=s,t}function Lm(t){var a=sn(18,null,null,0);return a.stateNode=t,a}function gu(t,a,s){return a=sn(4,t.children!==null?t.children:[],t.key,a),a.lanes=s,a.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},a}var qm=new WeakMap;function hn(t,a){if(typeof t=="object"&&t!==null){var s=qm.get(t);return s!==void 0?s:(a={value:t,source:a,stack:ar(a)},qm.set(t,a),a)}return{value:t,source:a,stack:ar(a)}}var as=[],is=0,Po=null,vr=0,gn=[],yn=0,wa=null,$n=1,In="";function Wn(t,a){as[is++]=vr,as[is++]=Po,Po=t,vr=a}function Um(t,a,s){gn[yn++]=$n,gn[yn++]=In,gn[yn++]=wa,wa=t;var o=$n;t=In;var u=32-ht(o)-1;o&=~(1<<u),s+=1;var p=32-ht(a)+u;if(30<p){var y=u-u%5;p=(o&(1<<y)-1).toString(32),o>>=y,u-=y,$n=1<<32-ht(a)+u|s<<u|o,In=p+t}else $n=1<<p|s<<u|o,In=t}function yu(t){t.return!==null&&(Wn(t,1),Um(t,1,0))}function bu(t){for(;t===Po;)Po=as[--is],as[is]=null,vr=as[--is],as[is]=null;for(;t===wa;)wa=gn[--yn],gn[yn]=null,In=gn[--yn],gn[yn]=null,$n=gn[--yn],gn[yn]=null}function $m(t,a){gn[yn++]=$n,gn[yn++]=In,gn[yn++]=wa,$n=a.id,In=a.overflow,wa=t}var Rt=null,it=null,qe=!1,ja=null,bn=!1,vu=Error(r(519));function Na(t){var a=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Sr(hn(a,t)),vu}function Im(t){var a=t.stateNode,s=t.type,o=t.memoizedProps;switch(a[Dt]=t,a[Kt]=o,s){case"dialog":Me("cancel",a),Me("close",a);break;case"iframe":case"object":case"embed":Me("load",a);break;case"video":case"audio":for(s=0;s<Vr.length;s++)Me(Vr[s],a);break;case"source":Me("error",a);break;case"img":case"image":case"link":Me("error",a),Me("load",a);break;case"details":Me("toggle",a);break;case"input":Me("invalid",a),em(a,o.value,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name,!0);break;case"select":Me("invalid",a);break;case"textarea":Me("invalid",a),nm(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||iy(a.textContent,s)?(o.popover!=null&&(Me("beforetoggle",a),Me("toggle",a)),o.onScroll!=null&&Me("scroll",a),o.onScrollEnd!=null&&Me("scrollend",a),o.onClick!=null&&(a.onclick=Xn),a=!0):a=!1,a||Na(t,!0)}function Vm(t){for(Rt=t.return;Rt;)switch(Rt.tag){case 5:case 31:case 13:bn=!1;return;case 27:case 3:bn=!0;return;default:Rt=Rt.return}}function ss(t){if(t!==Rt)return!1;if(!qe)return Vm(t),qe=!0,!1;var a=t.tag,s;if((s=a!==3&&a!==27)&&((s=a===5)&&(s=t.type,s=!(s!=="form"&&s!=="button")||Ld(t.type,t.memoizedProps)),s=!s),s&&it&&Na(t),Vm(t),a===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(317));it=py(t)}else if(a===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(317));it=py(t)}else a===27?(a=it,qa(t.type)?(t=Vd,Vd=null,it=t):it=a):it=Rt?Sn(t.stateNode.nextSibling):null;return!0}function ui(){it=Rt=null,qe=!1}function Su(){var t=ja;return t!==null&&(Ft===null?Ft=t:Ft.push.apply(Ft,t),ja=null),t}function Sr(t){ja===null?ja=[t]:ja.push(t)}var xu=Ze(null),di=null,ea=null;function ka(t,a,s){ue(xu,a._currentValue),a._currentValue=s}function ta(t){t._currentValue=xu.current,F(xu)}function wu(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 ju(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 w=p;p=u;for(var C=0;C<a.length;C++)if(w.context===a[C]){p.lanes|=s,w=p.alternate,w!==null&&(w.lanes|=s),wu(p.return,s,t),o||(y=null);break e}p=w.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),wu(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 rs(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 w=u.type;an(u.pendingProps.value,y.value)||(t!==null?t.push(w):t=[w])}}else if(u===Ne.current){if(y=u.alternate,y===null)throw Error(r(387));y.memoizedState.memoizedState!==u.memoizedState.memoizedState&&(t!==null?t.push(Kr):t=[Kr])}u=u.return}t!==null&&ju(a,t,s,o),a.flags|=262144}function Go(t){for(t=t.firstContext;t!==null;){if(!an(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function fi(t){di=t,ea=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function Mt(t){return Pm(di,t)}function Ho(t,a){return di===null&&fi(t),Pm(t,a)}function Pm(t,a){var s=a._currentValue;if(a={context:a,memoizedValue:s,next:null},ea===null){if(t===null)throw Error(r(308));ea=a,t.dependencies={lanes:0,firstContext:a},t.flags|=524288}else ea=ea.next=a;return s}var ox=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()})}},lx=e.unstable_scheduleCallback,cx=e.unstable_NormalPriority,xt={$$typeof:G,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Nu(){return{controller:new ox,data:new Map,refCount:0}}function xr(t){t.refCount--,t.refCount===0&&lx(cx,function(){t.controller.abort()})}var wr=null,ku=0,os=0,ls=null;function ux(t,a){if(wr===null){var s=wr=[];ku=0,os=Cd(),ls={status:"pending",value:void 0,then:function(o){s.push(o)}}}return ku++,a.then(Gm,Gm),a}function Gm(){if(--ku===0&&wr!==null){ls!==null&&(ls.status="fulfilled");var t=wr;wr=null,os=0,ls=null;for(var a=0;a<t.length;a++)(0,t[a])()}}function dx(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 Hm=$.S;$.S=function(t,a){Cg=Ut(),typeof a=="object"&&a!==null&&typeof a.then=="function"&&ux(t,a),Hm!==null&&Hm(t,a)};var pi=Ze(null);function Au(){var t=pi.current;return t!==null?t:We.pooledCache}function Qo(t,a){a===null?ue(pi,pi.current):ue(pi,a.pool)}function Qm(){var t=Au();return t===null?null:{parent:xt._currentValue,pool:t}}var cs=Error(r(460)),_u=Error(r(474)),Ko=Error(r(542)),Zo={then:function(){}};function Km(t){return t=t.status,t==="fulfilled"||t==="rejected"}function Zm(t,a,s){switch(s=t[s],s===void 0?t.push(a):s!==a&&(a.then(Xn,Xn),a=s),a.status){case"fulfilled":return a.value;case"rejected":throw t=a.reason,Xm(t),t;default:if(typeof a.status=="string")a.then(Xn,Xn);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,Xm(t),t}throw hi=a,cs}}function mi(t){try{var a=t._init;return a(t._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(hi=s,cs):s}}var hi=null;function Ym(){if(hi===null)throw Error(r(459));var t=hi;return hi=null,t}function Xm(t){if(t===cs||t===Ko)throw Error(r(483))}var us=null,jr=0;function Yo(t){var a=jr;return jr+=1,us===null&&(us=[]),Zm(us,t,a)}function Nr(t,a){a=a.props.ref,t.ref=a!==void 0?a:null}function Xo(t,a){throw a.$$typeof===N?Error(r(525)):(t=Object.prototype.toString.call(a),Error(r(31,t==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":t)))}function Jm(t){function a(D,z){if(t){var B=D.deletions;B===null?(D.deletions=[z],D.flags|=16):B.push(z)}}function s(D,z){if(!t)return null;for(;z!==null;)a(D,z),z=z.sibling;return null}function o(D){for(var z=new Map;D!==null;)D.key!==null?z.set(D.key,D):z.set(D.index,D),D=D.sibling;return z}function u(D,z){return D=Fn(D,z),D.index=0,D.sibling=null,D}function p(D,z,B){return D.index=B,t?(B=D.alternate,B!==null?(B=B.index,B<z?(D.flags|=67108866,z):B):(D.flags|=67108866,z)):(D.flags|=1048576,z)}function y(D){return t&&D.alternate===null&&(D.flags|=67108866),D}function w(D,z,B,Q){return z===null||z.tag!==6?(z=hu(B,D.mode,Q),z.return=D,z):(z=u(z,B),z.return=D,z)}function C(D,z,B,Q){var Se=B.type;return Se===k?P(D,z,B.props.children,Q,B.key):z!==null&&(z.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===M&&mi(Se)===z.type)?(z=u(z,B.props),Nr(z,B),z.return=D,z):(z=Vo(B.type,B.key,B.props,null,D.mode,Q),Nr(z,B),z.return=D,z)}function L(D,z,B,Q){return z===null||z.tag!==4||z.stateNode.containerInfo!==B.containerInfo||z.stateNode.implementation!==B.implementation?(z=gu(B,D.mode,Q),z.return=D,z):(z=u(z,B.children||[]),z.return=D,z)}function P(D,z,B,Q,Se){return z===null||z.tag!==7?(z=ci(B,D.mode,Q,Se),z.return=D,z):(z=u(z,B),z.return=D,z)}function Y(D,z,B){if(typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint")return z=hu(""+z,D.mode,B),z.return=D,z;if(typeof z=="object"&&z!==null){switch(z.$$typeof){case A:return B=Vo(z.type,z.key,z.props,null,D.mode,B),Nr(B,z),B.return=D,B;case T:return z=gu(z,D.mode,B),z.return=D,z;case M:return z=mi(z),Y(D,z,B)}if(me(z)||ve(z))return z=ci(z,D.mode,B,null),z.return=D,z;if(typeof z.then=="function")return Y(D,Yo(z),B);if(z.$$typeof===G)return Y(D,Ho(D,z),B);Xo(D,z)}return null}function U(D,z,B,Q){var Se=z!==null?z.key:null;if(typeof B=="string"&&B!==""||typeof B=="number"||typeof B=="bigint")return Se!==null?null:w(D,z,""+B,Q);if(typeof B=="object"&&B!==null){switch(B.$$typeof){case A:return B.key===Se?C(D,z,B,Q):null;case T:return B.key===Se?L(D,z,B,Q):null;case M:return B=mi(B),U(D,z,B,Q)}if(me(B)||ve(B))return Se!==null?null:P(D,z,B,Q,null);if(typeof B.then=="function")return U(D,z,Yo(B),Q);if(B.$$typeof===G)return U(D,z,Ho(D,B),Q);Xo(D,B)}return null}function I(D,z,B,Q,Se){if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return D=D.get(B)||null,w(z,D,""+Q,Se);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case A:return D=D.get(Q.key===null?B:Q.key)||null,C(z,D,Q,Se);case T:return D=D.get(Q.key===null?B:Q.key)||null,L(z,D,Q,Se);case M:return Q=mi(Q),I(D,z,B,Q,Se)}if(me(Q)||ve(Q))return D=D.get(B)||null,P(z,D,Q,Se,null);if(typeof Q.then=="function")return I(D,z,B,Yo(Q),Se);if(Q.$$typeof===G)return I(D,z,B,Ho(z,Q),Se);Xo(z,Q)}return null}function pe(D,z,B,Q){for(var Se=null,Ie=null,ye=z,Te=z=0,Le=null;ye!==null&&Te<B.length;Te++){ye.index>Te?(Le=ye,ye=null):Le=ye.sibling;var Ve=U(D,ye,B[Te],Q);if(Ve===null){ye===null&&(ye=Le);break}t&&ye&&Ve.alternate===null&&a(D,ye),z=p(Ve,z,Te),Ie===null?Se=Ve:Ie.sibling=Ve,Ie=Ve,ye=Le}if(Te===B.length)return s(D,ye),qe&&Wn(D,Te),Se;if(ye===null){for(;Te<B.length;Te++)ye=Y(D,B[Te],Q),ye!==null&&(z=p(ye,z,Te),Ie===null?Se=ye:Ie.sibling=ye,Ie=ye);return qe&&Wn(D,Te),Se}for(ye=o(ye);Te<B.length;Te++)Le=I(ye,D,Te,B[Te],Q),Le!==null&&(t&&Le.alternate!==null&&ye.delete(Le.key===null?Te:Le.key),z=p(Le,z,Te),Ie===null?Se=Le:Ie.sibling=Le,Ie=Le);return t&&ye.forEach(function(Pa){return a(D,Pa)}),qe&&Wn(D,Te),Se}function we(D,z,B,Q){if(B==null)throw Error(r(151));for(var Se=null,Ie=null,ye=z,Te=z=0,Le=null,Ve=B.next();ye!==null&&!Ve.done;Te++,Ve=B.next()){ye.index>Te?(Le=ye,ye=null):Le=ye.sibling;var Pa=U(D,ye,Ve.value,Q);if(Pa===null){ye===null&&(ye=Le);break}t&&ye&&Pa.alternate===null&&a(D,ye),z=p(Pa,z,Te),Ie===null?Se=Pa:Ie.sibling=Pa,Ie=Pa,ye=Le}if(Ve.done)return s(D,ye),qe&&Wn(D,Te),Se;if(ye===null){for(;!Ve.done;Te++,Ve=B.next())Ve=Y(D,Ve.value,Q),Ve!==null&&(z=p(Ve,z,Te),Ie===null?Se=Ve:Ie.sibling=Ve,Ie=Ve);return qe&&Wn(D,Te),Se}for(ye=o(ye);!Ve.done;Te++,Ve=B.next())Ve=I(ye,D,Te,Ve.value,Q),Ve!==null&&(t&&Ve.alternate!==null&&ye.delete(Ve.key===null?Te:Ve.key),z=p(Ve,z,Te),Ie===null?Se=Ve:Ie.sibling=Ve,Ie=Ve);return t&&ye.forEach(function(ww){return a(D,ww)}),qe&&Wn(D,Te),Se}function Je(D,z,B,Q){if(typeof B=="object"&&B!==null&&B.type===k&&B.key===null&&(B=B.props.children),typeof B=="object"&&B!==null){switch(B.$$typeof){case A:e:{for(var Se=B.key;z!==null;){if(z.key===Se){if(Se=B.type,Se===k){if(z.tag===7){s(D,z.sibling),Q=u(z,B.props.children),Q.return=D,D=Q;break e}}else if(z.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===M&&mi(Se)===z.type){s(D,z.sibling),Q=u(z,B.props),Nr(Q,B),Q.return=D,D=Q;break e}s(D,z);break}else a(D,z);z=z.sibling}B.type===k?(Q=ci(B.props.children,D.mode,Q,B.key),Q.return=D,D=Q):(Q=Vo(B.type,B.key,B.props,null,D.mode,Q),Nr(Q,B),Q.return=D,D=Q)}return y(D);case T: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(D,z.sibling),Q=u(z,B.children||[]),Q.return=D,D=Q;break e}else{s(D,z);break}else a(D,z);z=z.sibling}Q=gu(B,D.mode,Q),Q.return=D,D=Q}return y(D);case M:return B=mi(B),Je(D,z,B,Q)}if(me(B))return pe(D,z,B,Q);if(ve(B)){if(Se=ve(B),typeof Se!="function")throw Error(r(150));return B=Se.call(B),we(D,z,B,Q)}if(typeof B.then=="function")return Je(D,z,Yo(B),Q);if(B.$$typeof===G)return Je(D,z,Ho(D,B),Q);Xo(D,B)}return typeof B=="string"&&B!==""||typeof B=="number"||typeof B=="bigint"?(B=""+B,z!==null&&z.tag===6?(s(D,z.sibling),Q=u(z,B),Q.return=D,D=Q):(s(D,z),Q=hu(B,D.mode,Q),Q.return=D,D=Q),y(D)):s(D,z)}return function(D,z,B,Q){try{jr=0;var Se=Je(D,z,B,Q);return us=null,Se}catch(ye){if(ye===cs||ye===Ko)throw ye;var Ie=sn(29,ye,null,D.mode);return Ie.lanes=Q,Ie.return=D,Ie}}}var gi=Jm(!0),Fm=Jm(!1),Aa=!1;function Cu(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function zu(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 _a(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Ca(t,a,s){var o=t.updateQueue;if(o===null)return null;if(o=o.shared,(Pe&2)!==0){var u=o.pending;return u===null?a.next=a:(a.next=u.next,u.next=a),o.pending=a,a=Io(t),Mm(t,null,s),a}return $o(t,o,a,s),Io(t)}function kr(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,_o(t,s)}}function Tu(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 Eu=!1;function Ar(){if(Eu){var t=ls;if(t!==null)throw t}}function _r(t,a,s,o){Eu=!1;var u=t.updateQueue;Aa=!1;var p=u.firstBaseUpdate,y=u.lastBaseUpdate,w=u.shared.pending;if(w!==null){u.shared.pending=null;var C=w,L=C.next;C.next=null,y===null?p=L:y.next=L,y=C;var P=t.alternate;P!==null&&(P=P.updateQueue,w=P.lastBaseUpdate,w!==y&&(w===null?P.firstBaseUpdate=L:w.next=L,P.lastBaseUpdate=C))}if(p!==null){var Y=u.baseState;y=0,P=L=C=null,w=p;do{var U=w.lane&-536870913,I=U!==w.lane;if(I?(Be&U)===U:(o&U)===U){U!==0&&U===os&&(Eu=!0),P!==null&&(P=P.next={lane:0,tag:w.tag,payload:w.payload,callback:null,next:null});e:{var pe=t,we=w;U=a;var Je=s;switch(we.tag){case 1:if(pe=we.payload,typeof pe=="function"){Y=pe.call(Je,Y,U);break e}Y=pe;break e;case 3:pe.flags=pe.flags&-65537|128;case 0:if(pe=we.payload,U=typeof pe=="function"?pe.call(Je,Y,U):pe,U==null)break e;Y=x({},Y,U);break e;case 2:Aa=!0}}U=w.callback,U!==null&&(t.flags|=64,I&&(t.flags|=8192),I=u.callbacks,I===null?u.callbacks=[U]:I.push(U))}else I={lane:U,tag:w.tag,payload:w.payload,callback:w.callback,next:null},P===null?(L=P=I,C=Y):P=P.next=I,y|=U;if(w=w.next,w===null){if(w=u.shared.pending,w===null)break;I=w,w=I.next,I.next=null,u.lastBaseUpdate=I,u.shared.pending=null}}while(!0);P===null&&(C=Y),u.baseState=C,u.firstBaseUpdate=L,u.lastBaseUpdate=P,p===null&&(u.shared.lanes=0),Da|=y,t.lanes=y,t.memoizedState=Y}}function Wm(t,a){if(typeof t!="function")throw Error(r(191,t));t.call(a)}function eh(t,a){var s=t.callbacks;if(s!==null)for(t.callbacks=null,t=0;t<s.length;t++)Wm(s[t],a)}var ds=Ze(null),Jo=Ze(0);function th(t,a){t=ua,ue(Jo,t),ue(ds,a),ua=t|a.baseLanes}function Ou(){ue(Jo,ua),ue(ds,ds.current)}function Du(){ua=Jo.current,F(ds),F(Jo)}var rn=Ze(null),vn=null;function za(t){var a=t.alternate;ue(gt,gt.current&1),ue(rn,t),vn===null&&(a===null||ds.current!==null||a.memoizedState!==null)&&(vn=t)}function Ru(t){ue(gt,gt.current),ue(rn,t),vn===null&&(vn=t)}function nh(t){t.tag===22?(ue(gt,gt.current),ue(rn,t),vn===null&&(vn=t)):Ta()}function Ta(){ue(gt,gt.current),ue(rn,rn.current)}function on(t){F(rn),vn===t&&(vn=null),F(gt)}var gt=Ze(0);function Fo(t){for(var a=t;a!==null;){if(a.tag===13){var s=a.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||$d(s)||Id(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 na=0,ze=null,Ye=null,wt=null,Wo=!1,fs=!1,yi=!1,el=0,Cr=0,ps=null,fx=0;function ft(){throw Error(r(321))}function Mu(t,a){if(a===null)return!1;for(var s=0;s<a.length&&s<t.length;s++)if(!an(t[s],a[s]))return!1;return!0}function Bu(t,a,s,o,u,p){return na=p,ze=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,$.H=t===null||t.memoizedState===null?Uh:Ju,yi=!1,p=s(o,u),yi=!1,fs&&(p=ih(a,s,o,u)),ah(t),p}function ah(t){$.H=Er;var a=Ye!==null&&Ye.next!==null;if(na=0,wt=Ye=ze=null,Wo=!1,Cr=0,ps=null,a)throw Error(r(300));t===null||jt||(t=t.dependencies,t!==null&&Go(t)&&(jt=!0))}function ih(t,a,s,o){ze=t;var u=0;do{if(fs&&(ps=null),Cr=0,fs=!1,25<=u)throw Error(r(301));if(u+=1,wt=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=$h,p=a(s,o)}while(fs);return p}function px(){var t=$.H,a=t.useState()[0];return a=typeof a.then=="function"?zr(a):a,t=t.useState()[0],(Ye!==null?Ye.memoizedState:null)!==t&&(ze.flags|=1024),a}function Lu(){var t=el!==0;return el=0,t}function qu(t,a,s){a.updateQueue=t.updateQueue,a.flags&=-2053,t.lanes&=~s}function Uu(t){if(Wo){for(t=t.memoizedState;t!==null;){var a=t.queue;a!==null&&(a.pending=null),t=t.next}Wo=!1}na=0,wt=Ye=ze=null,fs=!1,Cr=el=0,ps=null}function Vt(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return wt===null?ze.memoizedState=wt=t:wt=wt.next=t,wt}function yt(){if(Ye===null){var t=ze.alternate;t=t!==null?t.memoizedState:null}else t=Ye.next;var a=wt===null?ze.memoizedState:wt.next;if(a!==null)wt=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},wt===null?ze.memoizedState=wt=t:wt=wt.next=t}return wt}function tl(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function zr(t){var a=Cr;return Cr+=1,ps===null&&(ps=[]),t=Zm(ps,t,a),a=ze,(wt===null?a.memoizedState:wt.next)===null&&(a=a.alternate,$.H=a===null||a.memoizedState===null?Uh:Ju),t}function nl(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return zr(t);if(t.$$typeof===G)return Mt(t)}throw Error(r(438,String(t)))}function $u(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=tl(),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]=Ae;return a.index++,s}function aa(t,a){return typeof a=="function"?a(t):a}function al(t){var a=yt();return Iu(a,Ye,t)}function Iu(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 w=y=null,C=null,L=a,P=!1;do{var Y=L.lane&-536870913;if(Y!==L.lane?(Be&Y)===Y:(na&Y)===Y){var U=L.revertLane;if(U===0)C!==null&&(C=C.next={lane:0,revertLane:0,gesture:null,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null}),Y===os&&(P=!0);else if((na&U)===U){L=L.next,U===os&&(P=!0);continue}else Y={lane:0,revertLane:L.revertLane,gesture:null,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null},C===null?(w=C=Y,y=p):C=C.next=Y,ze.lanes|=U,Da|=U;Y=L.action,yi&&s(p,Y),p=L.hasEagerState?L.eagerState:s(p,Y)}else U={lane:Y,revertLane:L.revertLane,gesture:L.gesture,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null},C===null?(w=C=U,y=p):C=C.next=U,ze.lanes|=Y,Da|=Y;L=L.next}while(L!==null&&L!==a);if(C===null?y=p:C.next=w,!an(p,t.memoizedState)&&(jt=!0,P&&(s=ls,s!==null)))throw s;t.memoizedState=p,t.baseState=y,t.baseQueue=C,o.lastRenderedState=p}return u===null&&(o.lanes=0),[t.memoizedState,o.dispatch]}function Vu(t){var a=yt(),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);an(p,a.memoizedState)||(jt=!0),a.memoizedState=p,a.baseQueue===null&&(a.baseState=p),s.lastRenderedState=p}return[p,o]}function sh(t,a,s){var o=ze,u=yt(),p=qe;if(p){if(s===void 0)throw Error(r(407));s=s()}else s=a();var y=!an((Ye||u).memoizedState,s);if(y&&(u.memoizedState=s,jt=!0),u=u.queue,Hu(lh.bind(null,o,u,t),[t]),u.getSnapshot!==a||y||wt!==null&&wt.memoizedState.tag&1){if(o.flags|=2048,ms(9,{destroy:void 0},oh.bind(null,o,u,s,a),null),We===null)throw Error(r(349));p||(na&127)!==0||rh(o,a,s)}return s}function rh(t,a,s){t.flags|=16384,t={getSnapshot:a,value:s},a=ze.updateQueue,a===null?(a=tl(),ze.updateQueue=a,a.stores=[t]):(s=a.stores,s===null?a.stores=[t]:s.push(t))}function oh(t,a,s,o){a.value=s,a.getSnapshot=o,ch(a)&&uh(t)}function lh(t,a,s){return s(function(){ch(a)&&uh(t)})}function ch(t){var a=t.getSnapshot;t=t.value;try{var s=a();return!an(t,s)}catch{return!0}}function uh(t){var a=li(t,2);a!==null&&Wt(a,t,2)}function Pu(t){var a=Vt();if(typeof t=="function"){var s=t;if(t=s(),yi){Tn(!0);try{s()}finally{Tn(!1)}}}return a.memoizedState=a.baseState=t,a.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:aa,lastRenderedState:t},a}function dh(t,a,s,o){return t.baseState=s,Iu(t,Ye,typeof o=="function"?o:aa)}function mx(t,a,s,o,u){if(rl(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,fh(a,p)):(p.next=s.next,a.pending=s.next=p)}}function fh(t,a){var s=a.action,o=a.payload,u=t.state;if(a.isTransition){var p=$.T,y={};$.T=y;try{var w=s(u,o),C=$.S;C!==null&&C(y,w),ph(t,a,w)}catch(L){Gu(t,a,L)}finally{p!==null&&y.types!==null&&(p.types=y.types),$.T=p}}else try{p=s(u,o),ph(t,a,p)}catch(L){Gu(t,a,L)}}function ph(t,a,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(o){mh(t,a,o)},function(o){return Gu(t,a,o)}):mh(t,a,s)}function mh(t,a,s){a.status="fulfilled",a.value=s,hh(a),t.state=s,a=t.pending,a!==null&&(s=a.next,s===a?t.pending=null:(s=s.next,a.next=s,fh(t,s)))}function Gu(t,a,s){var o=t.pending;if(t.pending=null,o!==null){o=o.next;do a.status="rejected",a.reason=s,hh(a),a=a.next;while(a!==o)}t.action=null}function hh(t){t=t.listeners;for(var a=0;a<t.length;a++)(0,t[a])()}function gh(t,a){return a}function yh(t,a){if(qe){var s=We.formState;if(s!==null){e:{var o=ze;if(qe){if(it){t:{for(var u=it,p=bn;u.nodeType!==8;){if(!p){u=null;break t}if(u=Sn(u.nextSibling),u===null){u=null;break t}}p=u.data,u=p==="F!"||p==="F"?u:null}if(u){it=Sn(u.nextSibling),o=u.data==="F!";break e}}Na(o)}o=!1}o&&(a=s[0])}}return s=Vt(),s.memoizedState=s.baseState=a,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:gh,lastRenderedState:a},s.queue=o,s=Bh.bind(null,ze,o),o.dispatch=s,o=Pu(!1),p=Xu.bind(null,ze,!1,o.queue),o=Vt(),u={state:a,dispatch:null,action:t,pending:null},o.queue=u,s=mx.bind(null,ze,u,p,s),u.dispatch=s,o.memoizedState=t,[a,s,!1]}function bh(t){var a=yt();return vh(a,Ye,t)}function vh(t,a,s){if(a=Iu(t,a,gh)[0],t=al(aa)[0],typeof a=="object"&&a!==null&&typeof a.then=="function")try{var o=zr(a)}catch(y){throw y===cs?Ko:y}else o=a;a=yt();var u=a.queue,p=u.dispatch;return s!==a.memoizedState&&(ze.flags|=2048,ms(9,{destroy:void 0},hx.bind(null,u,s),null)),[o,p,t]}function hx(t,a){t.action=a}function Sh(t){var a=yt(),s=Ye;if(s!==null)return vh(a,s,t);yt(),a=a.memoizedState,s=yt();var o=s.queue.dispatch;return s.memoizedState=t,[a,o,!1]}function ms(t,a,s,o){return t={tag:t,create:s,deps:o,inst:a,next:null},a=ze.updateQueue,a===null&&(a=tl(),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 xh(){return yt().memoizedState}function il(t,a,s,o){var u=Vt();ze.flags|=t,u.memoizedState=ms(1|a,{destroy:void 0},s,o===void 0?null:o)}function sl(t,a,s,o){var u=yt();o=o===void 0?null:o;var p=u.memoizedState.inst;Ye!==null&&o!==null&&Mu(o,Ye.memoizedState.deps)?u.memoizedState=ms(a,p,s,o):(ze.flags|=t,u.memoizedState=ms(1|a,p,s,o))}function wh(t,a){il(8390656,8,t,a)}function Hu(t,a){sl(2048,8,t,a)}function gx(t){ze.flags|=4;var a=ze.updateQueue;if(a===null)a=tl(),ze.updateQueue=a,a.events=[t];else{var s=a.events;s===null?a.events=[t]:s.push(t)}}function jh(t){var a=yt().memoizedState;return gx({ref:a,nextImpl:t}),function(){if((Pe&2)!==0)throw Error(r(440));return a.impl.apply(void 0,arguments)}}function Nh(t,a){return sl(4,2,t,a)}function kh(t,a){return sl(4,4,t,a)}function Ah(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 _h(t,a,s){s=s!=null?s.concat([t]):null,sl(4,4,Ah.bind(null,a,t),s)}function Qu(){}function Ch(t,a){var s=yt();a=a===void 0?null:a;var o=s.memoizedState;return a!==null&&Mu(a,o[1])?o[0]:(s.memoizedState=[t,a],t)}function zh(t,a){var s=yt();a=a===void 0?null:a;var o=s.memoizedState;if(a!==null&&Mu(a,o[1]))return o[0];if(o=t(),yi){Tn(!0);try{t()}finally{Tn(!1)}}return s.memoizedState=[o,a],o}function Ku(t,a,s){return s===void 0||(na&1073741824)!==0&&(Be&261930)===0?t.memoizedState=a:(t.memoizedState=s,t=Tg(),ze.lanes|=t,Da|=t,s)}function Th(t,a,s,o){return an(s,a)?s:ds.current!==null?(t=Ku(t,s,o),an(t,a)||(jt=!0),t):(na&42)===0||(na&1073741824)!==0&&(Be&261930)===0?(jt=!0,t.memoizedState=s):(t=Tg(),ze.lanes|=t,Da|=t,a)}function Eh(t,a,s,o,u){var p=W.p;W.p=p!==0&&8>p?p:8;var y=$.T,w={};$.T=w,Xu(t,!1,a,s);try{var C=u(),L=$.S;if(L!==null&&L(w,C),C!==null&&typeof C=="object"&&typeof C.then=="function"){var P=dx(C,o);Tr(t,a,P,un(t))}else Tr(t,a,o,un(t))}catch(Y){Tr(t,a,{then:function(){},status:"rejected",reason:Y},un())}finally{W.p=p,y!==null&&w.types!==null&&(y.types=w.types),$.T=y}}function yx(){}function Zu(t,a,s,o){if(t.tag!==5)throw Error(r(476));var u=Oh(t).queue;Eh(t,u,a,fe,s===null?yx:function(){return Dh(t),s(o)})}function Oh(t){var a=t.memoizedState;if(a!==null)return a;a={memoizedState:fe,baseState:fe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:aa,lastRenderedState:fe},next:null};var s={};return a.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:aa,lastRenderedState:s},next:null},t.memoizedState=a,t=t.alternate,t!==null&&(t.memoizedState=a),a}function Dh(t){var a=Oh(t);a.next===null&&(a=t.alternate.memoizedState),Tr(t,a.next.queue,{},un())}function Yu(){return Mt(Kr)}function Rh(){return yt().memoizedState}function Mh(){return yt().memoizedState}function bx(t){for(var a=t.return;a!==null;){switch(a.tag){case 24:case 3:var s=un();t=_a(s);var o=Ca(a,t,s);o!==null&&(Wt(o,a,s),kr(o,a,s)),a={cache:Nu()},t.payload=a;return}a=a.return}}function vx(t,a,s){var o=un();s={lane:o,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},rl(t)?Lh(a,s):(s=pu(t,a,s,o),s!==null&&(Wt(s,t,o),qh(s,a,o)))}function Bh(t,a,s){var o=un();Tr(t,a,s,o)}function Tr(t,a,s,o){var u={lane:o,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(rl(t))Lh(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,w=p(y,s);if(u.hasEagerState=!0,u.eagerState=w,an(w,y))return $o(t,a,u,0),We===null&&Uo(),!1}catch{}if(s=pu(t,a,u,o),s!==null)return Wt(s,t,o),qh(s,a,o),!0}return!1}function Xu(t,a,s,o){if(o={lane:2,revertLane:Cd(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},rl(t)){if(a)throw Error(r(479))}else a=pu(t,s,o,2),a!==null&&Wt(a,t,2)}function rl(t){var a=t.alternate;return t===ze||a!==null&&a===ze}function Lh(t,a){fs=Wo=!0;var s=t.pending;s===null?a.next=a:(a.next=s.next,s.next=a),t.pending=a}function qh(t,a,s){if((s&4194048)!==0){var o=a.lanes;o&=t.pendingLanes,s|=o,a.lanes=s,_o(t,s)}}var Er={readContext:Mt,use:nl,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};Er.useEffectEvent=ft;var Uh={readContext:Mt,use:nl,useCallback:function(t,a){return Vt().memoizedState=[t,a===void 0?null:a],t},useContext:Mt,useEffect:wh,useImperativeHandle:function(t,a,s){s=s!=null?s.concat([t]):null,il(4194308,4,Ah.bind(null,a,t),s)},useLayoutEffect:function(t,a){return il(4194308,4,t,a)},useInsertionEffect:function(t,a){il(4,2,t,a)},useMemo:function(t,a){var s=Vt();a=a===void 0?null:a;var o=t();if(yi){Tn(!0);try{t()}finally{Tn(!1)}}return s.memoizedState=[o,a],o},useReducer:function(t,a,s){var o=Vt();if(s!==void 0){var u=s(a);if(yi){Tn(!0);try{s(a)}finally{Tn(!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=vx.bind(null,ze,t),[o.memoizedState,t]},useRef:function(t){var a=Vt();return t={current:t},a.memoizedState=t},useState:function(t){t=Pu(t);var a=t.queue,s=Bh.bind(null,ze,a);return a.dispatch=s,[t.memoizedState,s]},useDebugValue:Qu,useDeferredValue:function(t,a){var s=Vt();return Ku(s,t,a)},useTransition:function(){var t=Pu(!1);return t=Eh.bind(null,ze,t.queue,!0,!1),Vt().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,a,s){var o=ze,u=Vt();if(qe){if(s===void 0)throw Error(r(407));s=s()}else{if(s=a(),We===null)throw Error(r(349));(Be&127)!==0||rh(o,a,s)}u.memoizedState=s;var p={value:s,getSnapshot:a};return u.queue=p,wh(lh.bind(null,o,p,t),[t]),o.flags|=2048,ms(9,{destroy:void 0},oh.bind(null,o,p,s,a),null),s},useId:function(){var t=Vt(),a=We.identifierPrefix;if(qe){var s=In,o=$n;s=(o&~(1<<32-ht(o)-1)).toString(32)+s,a="_"+a+"R_"+s,s=el++,0<s&&(a+="H"+s.toString(32)),a+="_"}else s=fx++,a="_"+a+"r_"+s.toString(32)+"_";return t.memoizedState=a},useHostTransitionStatus:Yu,useFormState:yh,useActionState:yh,useOptimistic:function(t){var a=Vt();a.memoizedState=a.baseState=t;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return a.queue=s,a=Xu.bind(null,ze,!0,s),s.dispatch=a,[t,a]},useMemoCache:$u,useCacheRefresh:function(){return Vt().memoizedState=bx.bind(null,ze)},useEffectEvent:function(t){var a=Vt(),s={impl:t};return a.memoizedState=s,function(){if((Pe&2)!==0)throw Error(r(440));return s.impl.apply(void 0,arguments)}}},Ju={readContext:Mt,use:nl,useCallback:Ch,useContext:Mt,useEffect:Hu,useImperativeHandle:_h,useInsertionEffect:Nh,useLayoutEffect:kh,useMemo:zh,useReducer:al,useRef:xh,useState:function(){return al(aa)},useDebugValue:Qu,useDeferredValue:function(t,a){var s=yt();return Th(s,Ye.memoizedState,t,a)},useTransition:function(){var t=al(aa)[0],a=yt().memoizedState;return[typeof t=="boolean"?t:zr(t),a]},useSyncExternalStore:sh,useId:Rh,useHostTransitionStatus:Yu,useFormState:bh,useActionState:bh,useOptimistic:function(t,a){var s=yt();return dh(s,Ye,t,a)},useMemoCache:$u,useCacheRefresh:Mh};Ju.useEffectEvent=jh;var $h={readContext:Mt,use:nl,useCallback:Ch,useContext:Mt,useEffect:Hu,useImperativeHandle:_h,useInsertionEffect:Nh,useLayoutEffect:kh,useMemo:zh,useReducer:Vu,useRef:xh,useState:function(){return Vu(aa)},useDebugValue:Qu,useDeferredValue:function(t,a){var s=yt();return Ye===null?Ku(s,t,a):Th(s,Ye.memoizedState,t,a)},useTransition:function(){var t=Vu(aa)[0],a=yt().memoizedState;return[typeof t=="boolean"?t:zr(t),a]},useSyncExternalStore:sh,useId:Rh,useHostTransitionStatus:Yu,useFormState:Sh,useActionState:Sh,useOptimistic:function(t,a){var s=yt();return Ye!==null?dh(s,Ye,t,a):(s.baseState=t,[t,s.queue.dispatch])},useMemoCache:$u,useCacheRefresh:Mh};$h.useEffectEvent=jh;function Fu(t,a,s,o){a=t.memoizedState,s=s(o,a),s=s==null?a:x({},a,s),t.memoizedState=s,t.lanes===0&&(t.updateQueue.baseState=s)}var Wu={enqueueSetState:function(t,a,s){t=t._reactInternals;var o=un(),u=_a(o);u.payload=a,s!=null&&(u.callback=s),a=Ca(t,u,o),a!==null&&(Wt(a,t,o),kr(a,t,o))},enqueueReplaceState:function(t,a,s){t=t._reactInternals;var o=un(),u=_a(o);u.tag=1,u.payload=a,s!=null&&(u.callback=s),a=Ca(t,u,o),a!==null&&(Wt(a,t,o),kr(a,t,o))},enqueueForceUpdate:function(t,a){t=t._reactInternals;var s=un(),o=_a(s);o.tag=2,a!=null&&(o.callback=a),a=Ca(t,o,s),a!==null&&(Wt(a,t,s),kr(a,t,s))}};function Ih(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?!yr(s,o)||!yr(u,p):!0}function Vh(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&&Wu.enqueueReplaceState(a,a.state,null)}function bi(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=x({},s));for(var u in t)s[u]===void 0&&(s[u]=t[u])}return s}function Ph(t){qo(t)}function Gh(t){console.error(t)}function Hh(t){qo(t)}function ol(t,a){try{var s=t.onUncaughtError;s(a.value,{componentStack:a.stack})}catch(o){setTimeout(function(){throw o})}}function Qh(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 ed(t,a,s){return s=_a(s),s.tag=3,s.payload={element:null},s.callback=function(){ol(t,a)},s}function Kh(t){return t=_a(t),t.tag=3,t}function Zh(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(){Qh(a,s,o)}}var y=s.stateNode;y!==null&&typeof y.componentDidCatch=="function"&&(t.callback=function(){Qh(a,s,o),typeof u!="function"&&(Ra===null?Ra=new Set([this]):Ra.add(this));var w=o.stack;this.componentDidCatch(o.value,{componentStack:w!==null?w:""})})}function Sx(t,a,s,o,u){if(s.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){if(a=s.alternate,a!==null&&rs(a,s,u,!0),s=rn.current,s!==null){switch(s.tag){case 31:case 13:return vn===null?vl():s.alternate===null&&pt===0&&(pt=3),s.flags&=-257,s.flags|=65536,s.lanes=u,o===Zo?s.flags|=16384:(a=s.updateQueue,a===null?s.updateQueue=new Set([o]):a.add(o),kd(t,o,u)),!1;case 22:return s.flags|=65536,o===Zo?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)),kd(t,o,u)),!1}throw Error(r(435,s.tag))}return kd(t,o,u),vl(),!1}if(qe)return a=rn.current,a!==null?((a.flags&65536)===0&&(a.flags|=256),a.flags|=65536,a.lanes=u,o!==vu&&(t=Error(r(422),{cause:o}),Sr(hn(t,s)))):(o!==vu&&(a=Error(r(423),{cause:o}),Sr(hn(a,s))),t=t.current.alternate,t.flags|=65536,u&=-u,t.lanes|=u,o=hn(o,s),u=ed(t.stateNode,o,u),Tu(t,u),pt!==4&&(pt=2)),!1;var p=Error(r(520),{cause:o});if(p=hn(p,s),Ur===null?Ur=[p]:Ur.push(p),pt!==4&&(pt=2),a===null)return!0;o=hn(o,s),s=a;do{switch(s.tag){case 3:return s.flags|=65536,t=u&-u,s.lanes|=t,t=ed(s.stateNode,o,t),Tu(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"&&(Ra===null||!Ra.has(p))))return s.flags|=65536,u&=-u,s.lanes|=u,u=Kh(u),Zh(u,t,s,o),Tu(s,u),!1}s=s.return}while(s!==null);return!1}var td=Error(r(461)),jt=!1;function Bt(t,a,s,o){a.child=t===null?Fm(a,null,s,o):gi(a,t.child,s,o)}function Yh(t,a,s,o,u){s=s.render;var p=a.ref;if("ref"in o){var y={};for(var w in o)w!=="ref"&&(y[w]=o[w])}else y=o;return fi(a),o=Bu(t,a,s,y,p,u),w=Lu(),t!==null&&!jt?(qu(t,a,u),ia(t,a,u)):(qe&&w&&yu(a),a.flags|=1,Bt(t,a,o,u),a.child)}function Xh(t,a,s,o,u){if(t===null){var p=s.type;return typeof p=="function"&&!mu(p)&&p.defaultProps===void 0&&s.compare===null?(a.tag=15,a.type=p,Jh(t,a,p,o,u)):(t=Vo(s.type,null,o,a,a.mode,u),t.ref=a.ref,t.return=a,a.child=t)}if(p=t.child,!cd(t,u)){var y=p.memoizedProps;if(s=s.compare,s=s!==null?s:yr,s(y,o)&&t.ref===a.ref)return ia(t,a,u)}return a.flags|=1,t=Fn(p,o),t.ref=a.ref,t.return=a,a.child=t}function Jh(t,a,s,o,u){if(t!==null){var p=t.memoizedProps;if(yr(p,o)&&t.ref===a.ref)if(jt=!1,a.pendingProps=o=p,cd(t,u))(t.flags&131072)!==0&&(jt=!0);else return a.lanes=t.lanes,ia(t,a,u)}return nd(t,a,s,o,u)}function Fh(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 Wh(t,a,p,s,o)}if((s&536870912)!==0)a.memoizedState={baseLanes:0,cachePool:null},t!==null&&Qo(a,p!==null?p.cachePool:null),p!==null?th(a,p):Ou(),nh(a);else return o=a.lanes=536870912,Wh(t,a,p!==null?p.baseLanes|s:s,s,o)}else p!==null?(Qo(a,p.cachePool),th(a,p),Ta(),a.memoizedState=null):(t!==null&&Qo(a,null),Ou(),Ta());return Bt(t,a,u,s),a.child}function Or(t,a){return t!==null&&t.tag===22||a.stateNode!==null||(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.sibling}function Wh(t,a,s,o,u){var p=Au();return p=p===null?null:{parent:xt._currentValue,pool:p},a.memoizedState={baseLanes:s,cachePool:p},t!==null&&Qo(a,null),Ou(),nh(a),t!==null&&rs(t,a,o,!0),a.childLanes=u,null}function ll(t,a){return a=ul({mode:a.mode,children:a.children},t.mode),a.ref=t.ref,t.child=a,a.return=t,a}function eg(t,a,s){return gi(a,t.child,null,s),t=ll(a,a.pendingProps),t.flags|=2,on(a),a.memoizedState=null,t}function xx(t,a,s){var o=a.pendingProps,u=(a.flags&128)!==0;if(a.flags&=-129,t===null){if(qe){if(o.mode==="hidden")return t=ll(a,o),a.lanes=536870912,Or(null,t);if(Ru(a),(t=it)?(t=fy(t,bn),t=t!==null&&t.data==="&"?t:null,t!==null&&(a.memoizedState={dehydrated:t,treeContext:wa!==null?{id:$n,overflow:In}:null,retryLane:536870912,hydrationErrors:null},s=Lm(t),s.return=a,a.child=s,Rt=a,it=null)):t=null,t===null)throw Na(a);return a.lanes=536870912,null}return ll(a,o)}var p=t.memoizedState;if(p!==null){var y=p.dehydrated;if(Ru(a),u)if(a.flags&256)a.flags&=-257,a=eg(t,a,s);else if(a.memoizedState!==null)a.child=t.child,a.flags|=128,a=null;else throw Error(r(558));else if(jt||rs(t,a,s,!1),u=(s&t.childLanes)!==0,jt||u){if(o=We,o!==null&&(y=rr(o,s),y!==0&&y!==p.retryLane))throw p.retryLane=y,li(t,y),Wt(o,t,y),td;vl(),a=eg(t,a,s)}else t=p.treeContext,it=Sn(y.nextSibling),Rt=a,qe=!0,ja=null,bn=!1,t!==null&&$m(a,t),a=ll(a,o),a.flags|=4096;return a}return t=Fn(t.child,{mode:o.mode,children:o.children}),t.ref=a.ref,a.child=t,t.return=a,t}function cl(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 nd(t,a,s,o,u){return fi(a),s=Bu(t,a,s,o,void 0,u),o=Lu(),t!==null&&!jt?(qu(t,a,u),ia(t,a,u)):(qe&&o&&yu(a),a.flags|=1,Bt(t,a,s,u),a.child)}function tg(t,a,s,o,u,p){return fi(a),a.updateQueue=null,s=ih(a,o,s,u),ah(t),o=Lu(),t!==null&&!jt?(qu(t,a,p),ia(t,a,p)):(qe&&o&&yu(a),a.flags|=1,Bt(t,a,s,p),a.child)}function ng(t,a,s,o,u){if(fi(a),a.stateNode===null){var p=ns,y=s.contextType;typeof y=="object"&&y!==null&&(p=Mt(y)),p=new s(o,p),a.memoizedState=p.state!==null&&p.state!==void 0?p.state:null,p.updater=Wu,a.stateNode=p,p._reactInternals=a,p=a.stateNode,p.props=o,p.state=a.memoizedState,p.refs={},Cu(a),y=s.contextType,p.context=typeof y=="object"&&y!==null?Mt(y):ns,p.state=a.memoizedState,y=s.getDerivedStateFromProps,typeof y=="function"&&(Fu(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&&Wu.enqueueReplaceState(p,p.state,null),_r(a,o,p,u),Ar(),p.state=a.memoizedState),typeof p.componentDidMount=="function"&&(a.flags|=4194308),o=!0}else if(t===null){p=a.stateNode;var w=a.memoizedProps,C=bi(s,w);p.props=C;var L=p.context,P=s.contextType;y=ns,typeof P=="object"&&P!==null&&(y=Mt(P));var Y=s.getDerivedStateFromProps;P=typeof Y=="function"||typeof p.getSnapshotBeforeUpdate=="function",w=a.pendingProps!==w,P||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(w||L!==y)&&Vh(a,p,o,y),Aa=!1;var U=a.memoizedState;p.state=U,_r(a,o,p,u),Ar(),L=a.memoizedState,w||U!==L||Aa?(typeof Y=="function"&&(Fu(a,s,Y,o),L=a.memoizedState),(C=Aa||Ih(a,s,C,o,U,L,y))?(P||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=C):(typeof p.componentDidMount=="function"&&(a.flags|=4194308),o=!1)}else{p=a.stateNode,zu(t,a),y=a.memoizedProps,P=bi(s,y),p.props=P,Y=a.pendingProps,U=p.context,L=s.contextType,C=ns,typeof L=="object"&&L!==null&&(C=Mt(L)),w=s.getDerivedStateFromProps,(L=typeof w=="function"||typeof p.getSnapshotBeforeUpdate=="function")||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(y!==Y||U!==C)&&Vh(a,p,o,C),Aa=!1,U=a.memoizedState,p.state=U,_r(a,o,p,u),Ar();var I=a.memoizedState;y!==Y||U!==I||Aa||t!==null&&t.dependencies!==null&&Go(t.dependencies)?(typeof w=="function"&&(Fu(a,s,w,o),I=a.memoizedState),(P=Aa||Ih(a,s,P,o,U,I,C)||t!==null&&t.dependencies!==null&&Go(t.dependencies))?(L||typeof p.UNSAFE_componentWillUpdate!="function"&&typeof p.componentWillUpdate!="function"||(typeof p.componentWillUpdate=="function"&&p.componentWillUpdate(o,I,C),typeof p.UNSAFE_componentWillUpdate=="function"&&p.UNSAFE_componentWillUpdate(o,I,C)),typeof p.componentDidUpdate=="function"&&(a.flags|=4),typeof p.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof p.componentDidUpdate!="function"||y===t.memoizedProps&&U===t.memoizedState||(a.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||y===t.memoizedProps&&U===t.memoizedState||(a.flags|=1024),a.memoizedProps=o,a.memoizedState=I),p.props=o,p.state=I,p.context=C,o=P):(typeof p.componentDidUpdate!="function"||y===t.memoizedProps&&U===t.memoizedState||(a.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||y===t.memoizedProps&&U===t.memoizedState||(a.flags|=1024),o=!1)}return p=o,cl(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=gi(a,t.child,null,u),a.child=gi(a,null,s,u)):Bt(t,a,s,u),a.memoizedState=p.state,t=a.child):t=ia(t,a,u),t}function ag(t,a,s,o){return ui(),a.flags|=256,Bt(t,a,s,o),a.child}var ad={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function id(t){return{baseLanes:t,cachePool:Qm()}}function sd(t,a,s){return t=t!==null?t.childLanes&~s:0,a&&(t|=cn),t}function ig(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:(gt.current&2)!==0),y&&(u=!0,a.flags&=-129),y=(a.flags&32)!==0,a.flags&=-33,t===null){if(qe){if(u?za(a):Ta(),(t=it)?(t=fy(t,bn),t=t!==null&&t.data!=="&"?t:null,t!==null&&(a.memoizedState={dehydrated:t,treeContext:wa!==null?{id:$n,overflow:In}:null,retryLane:536870912,hydrationErrors:null},s=Lm(t),s.return=a,a.child=s,Rt=a,it=null)):t=null,t===null)throw Na(a);return Id(t)?a.lanes=32:a.lanes=536870912,null}var w=o.children;return o=o.fallback,u?(Ta(),u=a.mode,w=ul({mode:"hidden",children:w},u),o=ci(o,u,s,null),w.return=a,o.return=a,w.sibling=o,a.child=w,o=a.child,o.memoizedState=id(s),o.childLanes=sd(t,y,s),a.memoizedState=ad,Or(null,o)):(za(a),rd(a,w))}var C=t.memoizedState;if(C!==null&&(w=C.dehydrated,w!==null)){if(p)a.flags&256?(za(a),a.flags&=-257,a=od(t,a,s)):a.memoizedState!==null?(Ta(),a.child=t.child,a.flags|=128,a=null):(Ta(),w=o.fallback,u=a.mode,o=ul({mode:"visible",children:o.children},u),w=ci(w,u,s,null),w.flags|=2,o.return=a,w.return=a,o.sibling=w,a.child=o,gi(a,t.child,null,s),o=a.child,o.memoizedState=id(s),o.childLanes=sd(t,y,s),a.memoizedState=ad,a=Or(null,o));else if(za(a),Id(w)){if(y=w.nextSibling&&w.nextSibling.dataset,y)var L=y.dgst;y=L,o=Error(r(419)),o.stack="",o.digest=y,Sr({value:o,source:null,stack:null}),a=od(t,a,s)}else if(jt||rs(t,a,s,!1),y=(s&t.childLanes)!==0,jt||y){if(y=We,y!==null&&(o=rr(y,s),o!==0&&o!==C.retryLane))throw C.retryLane=o,li(t,o),Wt(y,t,o),td;$d(w)||vl(),a=od(t,a,s)}else $d(w)?(a.flags|=192,a.child=t.child,a=null):(t=C.treeContext,it=Sn(w.nextSibling),Rt=a,qe=!0,ja=null,bn=!1,t!==null&&$m(a,t),a=rd(a,o.children),a.flags|=4096);return a}return u?(Ta(),w=o.fallback,u=a.mode,C=t.child,L=C.sibling,o=Fn(C,{mode:"hidden",children:o.children}),o.subtreeFlags=C.subtreeFlags&65011712,L!==null?w=Fn(L,w):(w=ci(w,u,s,null),w.flags|=2),w.return=a,o.return=a,o.sibling=w,a.child=o,Or(null,o),o=a.child,w=t.child.memoizedState,w===null?w=id(s):(u=w.cachePool,u!==null?(C=xt._currentValue,u=u.parent!==C?{parent:C,pool:C}:u):u=Qm(),w={baseLanes:w.baseLanes|s,cachePool:u}),o.memoizedState=w,o.childLanes=sd(t,y,s),a.memoizedState=ad,Or(t.child,o)):(za(a),s=t.child,t=s.sibling,s=Fn(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 rd(t,a){return a=ul({mode:"visible",children:a},t.mode),a.return=t,t.child=a}function ul(t,a){return t=sn(22,t,null,a),t.lanes=0,t}function od(t,a,s){return gi(a,t.child,null,s),t=rd(a,a.pendingProps.children),t.flags|=2,a.memoizedState=null,t}function sg(t,a,s){t.lanes|=a;var o=t.alternate;o!==null&&(o.lanes|=a),wu(t.return,a,s)}function ld(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 rg(t,a,s){var o=a.pendingProps,u=o.revealOrder,p=o.tail;o=o.children;var y=gt.current,w=(y&2)!==0;if(w?(y=y&1|2,a.flags|=128):y&=1,ue(gt,y),Bt(t,a,o,s),o=qe?vr:0,!w&&t!==null&&(t.flags&128)!==0)e:for(t=a.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&sg(t,s,a);else if(t.tag===19)sg(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&&Fo(t)===null&&(u=s),s=s.sibling;s=u,s===null?(u=a.child,a.child=null):(u=s.sibling,s.sibling=null),ld(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&&Fo(t)===null){a.child=u;break}t=u.sibling,u.sibling=s,s=u,u=t}ld(a,!0,s,null,p,o);break;case"together":ld(a,!1,null,null,void 0,o);break;default:a.memoizedState=null}return a.child}function ia(t,a,s){if(t!==null&&(a.dependencies=t.dependencies),Da|=a.lanes,(s&a.childLanes)===0)if(t!==null){if(rs(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=Fn(t,t.pendingProps),a.child=s,s.return=a;t.sibling!==null;)t=t.sibling,s=s.sibling=Fn(t,t.pendingProps),s.return=a;s.sibling=null}return a.child}function cd(t,a){return(t.lanes&a)!==0?!0:(t=t.dependencies,!!(t!==null&&Go(t)))}function wx(t,a,s){switch(a.tag){case 3:nt(a,a.stateNode.containerInfo),ka(a,xt,t.memoizedState.cache),ui();break;case 27:case 5:$e(a);break;case 4:nt(a,a.stateNode.containerInfo);break;case 10:ka(a,a.type,a.memoizedProps.value);break;case 31:if(a.memoizedState!==null)return a.flags|=128,Ru(a),null;break;case 13:var o=a.memoizedState;if(o!==null)return o.dehydrated!==null?(za(a),a.flags|=128,null):(s&a.child.childLanes)!==0?ig(t,a,s):(za(a),t=ia(t,a,s),t!==null?t.sibling:null);za(a);break;case 19:var u=(t.flags&128)!==0;if(o=(s&a.childLanes)!==0,o||(rs(t,a,s,!1),o=(s&a.childLanes)!==0),u){if(o)return rg(t,a,s);a.flags|=128}if(u=a.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),ue(gt,gt.current),o)break;return null;case 22:return a.lanes=0,Fh(t,a,s,a.pendingProps);case 24:ka(a,xt,t.memoizedState.cache)}return ia(t,a,s)}function og(t,a,s){if(t!==null)if(t.memoizedProps!==a.pendingProps)jt=!0;else{if(!cd(t,s)&&(a.flags&128)===0)return jt=!1,wx(t,a,s);jt=(t.flags&131072)!==0}else jt=!1,qe&&(a.flags&1048576)!==0&&Um(a,vr,a.index);switch(a.lanes=0,a.tag){case 16:e:{var o=a.pendingProps;if(t=mi(a.elementType),a.type=t,typeof t=="function")mu(t)?(o=bi(t,o),a.tag=1,a=ng(null,a,t,o,s)):(a.tag=0,a=nd(null,a,t,o,s));else{if(t!=null){var u=t.$$typeof;if(u===Z){a.tag=11,a=Yh(null,a,t,o,s);break e}else if(u===O){a.tag=14,a=Xh(null,a,t,o,s);break e}}throw a=oe(t)||t,Error(r(306,a,""))}}return a;case 0:return nd(t,a,a.type,a.pendingProps,s);case 1:return o=a.type,u=bi(o,a.pendingProps),ng(t,a,o,u,s);case 3:e:{if(nt(a,a.stateNode.containerInfo),t===null)throw Error(r(387));o=a.pendingProps;var p=a.memoizedState;u=p.element,zu(t,a),_r(a,o,null,s);var y=a.memoizedState;if(o=y.cache,ka(a,xt,o),o!==p.cache&&ju(a,[xt],s,!0),Ar(),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=ag(t,a,o,s);break e}else if(o!==u){u=hn(Error(r(424)),a),Sr(u),a=ag(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=Sn(t.firstChild),Rt=a,qe=!0,ja=null,bn=!0,s=Fm(a,null,o,s),a.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling;else{if(ui(),o===u){a=ia(t,a,s);break e}Bt(t,a,o,s)}a=a.child}return a;case 26:return cl(t,a),t===null?(s=by(a.type,null,a.pendingProps,null))?a.memoizedState=s:qe||(s=a.type,t=a.pendingProps,o=Al(ne.current).createElement(s),o[Dt]=a,o[Kt]=t,Lt(o,s,t),zt(o),a.stateNode=o):a.memoizedState=by(a.type,t.memoizedProps,a.pendingProps,t.memoizedState),null;case 27:return $e(a),t===null&&qe&&(o=a.stateNode=hy(a.type,a.pendingProps,ne.current),Rt=a,bn=!0,u=it,qa(a.type)?(Vd=u,it=Sn(o.firstChild)):it=u),Bt(t,a,a.pendingProps.children,s),cl(t,a),t===null&&(a.flags|=4194304),a.child;case 5:return t===null&&qe&&((u=o=it)&&(o=Fx(o,a.type,a.pendingProps,bn),o!==null?(a.stateNode=o,Rt=a,it=Sn(o.firstChild),bn=!1,u=!0):u=!1),u||Na(a)),$e(a),u=a.type,p=a.pendingProps,y=t!==null?t.memoizedProps:null,o=p.children,Ld(u,p)?o=null:y!==null&&Ld(u,y)&&(a.flags|=32),a.memoizedState!==null&&(u=Bu(t,a,px,null,null,s),Kr._currentValue=u),cl(t,a),Bt(t,a,o,s),a.child;case 6:return t===null&&qe&&((t=s=it)&&(s=Wx(s,a.pendingProps,bn),s!==null?(a.stateNode=s,Rt=a,it=null,t=!0):t=!1),t||Na(a)),null;case 13:return ig(t,a,s);case 4:return nt(a,a.stateNode.containerInfo),o=a.pendingProps,t===null?a.child=gi(a,null,o,s):Bt(t,a,o,s),a.child;case 11:return Yh(t,a,a.type,a.pendingProps,s);case 7:return Bt(t,a,a.pendingProps,s),a.child;case 8:return Bt(t,a,a.pendingProps.children,s),a.child;case 12:return Bt(t,a,a.pendingProps.children,s),a.child;case 10:return o=a.pendingProps,ka(a,a.type,o.value),Bt(t,a,o.children,s),a.child;case 9:return u=a.type._context,o=a.pendingProps.children,fi(a),u=Mt(u),o=o(u),a.flags|=1,Bt(t,a,o,s),a.child;case 14:return Xh(t,a,a.type,a.pendingProps,s);case 15:return Jh(t,a,a.type,a.pendingProps,s);case 19:return rg(t,a,s);case 31:return xx(t,a,s);case 22:return Fh(t,a,s,a.pendingProps);case 24:return fi(a),o=Mt(xt),t===null?(u=Au(),u===null&&(u=We,p=Nu(),u.pooledCache=p,p.refCount++,p!==null&&(u.pooledCacheLanes|=s),u=p),a.memoizedState={parent:o,cache:u},Cu(a),ka(a,xt,u)):((t.lanes&s)!==0&&(zu(t,a),_r(a,null,null,s),Ar()),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),ka(a,xt,o)):(o=p.cache,ka(a,xt,o),o!==u.cache&&ju(a,[xt],s,!0))),Bt(t,a,a.pendingProps.children,s),a.child;case 29:throw a.pendingProps}throw Error(r(156,a.tag))}function sa(t){t.flags|=4}function ud(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(Rg())t.flags|=8192;else throw hi=Zo,_u}else t.flags&=-16777217}function lg(t,a){if(a.type!=="stylesheet"||(a.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!jy(a))if(Rg())t.flags|=8192;else throw hi=Zo,_u}function dl(t,a){a!==null&&(t.flags|=4),t.flags&16384&&(a=t.tag!==22?ko():536870912,t.lanes|=a,bs|=a)}function Dr(t,a){if(!qe)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 jx(t,a,s){var o=a.pendingProps;switch(bu(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),ta(xt),xe(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(t===null||t.child===null)&&(ss(a)?sa(a):t===null||t.memoizedState.isDehydrated&&(a.flags&256)===0||(a.flags|=1024,Su())),st(a),null;case 26:var u=a.type,p=a.memoizedState;return t===null?(sa(a),p!==null?(st(a),lg(a,p)):(st(a),ud(a,u,null,o,s))):p?p!==t.memoizedState?(sa(a),st(a),lg(a,p)):(st(a),a.flags&=-16777217):(t=t.memoizedProps,t!==o&&sa(a),st(a),ud(a,u,t,o,s)),null;case 27:if(He(a),s=ne.current,u=a.type,t!==null&&a.stateNode!=null)t.memoizedProps!==o&&sa(a);else{if(!o){if(a.stateNode===null)throw Error(r(166));return st(a),null}t=ee.current,ss(a)?Im(a):(t=hy(u,o,s),a.stateNode=t,sa(a))}return st(a),null;case 5:if(He(a),u=a.type,t!==null&&a.stateNode!=null)t.memoizedProps!==o&&sa(a);else{if(!o){if(a.stateNode===null)throw Error(r(166));return st(a),null}if(p=ee.current,ss(a))Im(a);else{var y=Al(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[Dt]=a,p[Kt]=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(Lt(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&&sa(a)}}return st(a),ud(a,a.type,t===null?null:t.memoizedProps,a.pendingProps,s),null;case 6:if(t&&a.stateNode!=null)t.memoizedProps!==o&&sa(a);else{if(typeof o!="string"&&a.stateNode===null)throw Error(r(166));if(t=ne.current,ss(a)){if(t=a.stateNode,s=a.memoizedProps,o=null,u=Rt,u!==null)switch(u.tag){case 27:case 5:o=u.memoizedProps}t[Dt]=a,t=!!(t.nodeValue===s||o!==null&&o.suppressHydrationWarning===!0||iy(t.nodeValue,s)),t||Na(a,!0)}else t=Al(t).createTextNode(o),t[Dt]=a,a.stateNode=t}return st(a),null;case 31:if(s=a.memoizedState,t===null||t.memoizedState!==null){if(o=ss(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[Dt]=a}else ui(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;st(a),t=!1}else s=Su(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=s),t=!0;if(!t)return a.flags&256?(on(a),a):(on(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=ss(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[Dt]=a}else ui(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;st(a),u=!1}else u=Su(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=u),u=!0;if(!u)return a.flags&256?(on(a),a):(on(a),null)}return on(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),dl(a,a.updateQueue),st(a),null);case 4:return xe(),t===null&&Od(a.stateNode.containerInfo),st(a),null;case 10:return ta(a.type),st(a),null;case 19:if(F(gt),o=a.memoizedState,o===null)return st(a),null;if(u=(a.flags&128)!==0,p=o.rendering,p===null)if(u)Dr(o,!1);else{if(pt!==0||t!==null&&(t.flags&128)!==0)for(t=a.child;t!==null;){if(p=Fo(t),p!==null){for(a.flags|=128,Dr(o,!1),t=p.updateQueue,a.updateQueue=t,dl(a,t),a.subtreeFlags=0,t=s,s=a.child;s!==null;)Bm(s,t),s=s.sibling;return ue(gt,gt.current&1|2),qe&&Wn(a,o.treeForkCount),a.child}t=t.sibling}o.tail!==null&&Ut()>gl&&(a.flags|=128,u=!0,Dr(o,!1),a.lanes=4194304)}else{if(!u)if(t=Fo(p),t!==null){if(a.flags|=128,u=!0,t=t.updateQueue,a.updateQueue=t,dl(a,t),Dr(o,!0),o.tail===null&&o.tailMode==="hidden"&&!p.alternate&&!qe)return st(a),null}else 2*Ut()-o.renderingStartTime>gl&&s!==536870912&&(a.flags|=128,u=!0,Dr(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=Ut(),t.sibling=null,s=gt.current,ue(gt,u?s&1|2:s&1),qe&&Wn(a,o.treeForkCount),t):(st(a),null);case 22:case 23:return on(a),Du(),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&&dl(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&&F(pi),null;case 24:return s=null,t!==null&&(s=t.memoizedState.cache),a.memoizedState.cache!==s&&(a.flags|=2048),ta(xt),st(a),null;case 25:return null;case 30:return null}throw Error(r(156,a.tag))}function Nx(t,a){switch(bu(a),a.tag){case 1:return t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 3:return ta(xt),xe(),t=a.flags,(t&65536)!==0&&(t&128)===0?(a.flags=t&-65537|128,a):null;case 26:case 27:case 5:return He(a),null;case 31:if(a.memoizedState!==null){if(on(a),a.alternate===null)throw Error(r(340));ui()}return t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 13:if(on(a),t=a.memoizedState,t!==null&&t.dehydrated!==null){if(a.alternate===null)throw Error(r(340));ui()}return t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 19:return F(gt),null;case 4:return xe(),null;case 10:return ta(a.type),null;case 22:case 23:return on(a),Du(),t!==null&&F(pi),t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 24:return ta(xt),null;case 25:return null;default:return null}}function cg(t,a){switch(bu(a),a.tag){case 3:ta(xt),xe();break;case 26:case 27:case 5:He(a);break;case 4:xe();break;case 31:a.memoizedState!==null&&on(a);break;case 13:on(a);break;case 19:F(gt);break;case 10:ta(a.type);break;case 22:case 23:on(a),Du(),t!==null&&F(pi);break;case 24:ta(xt)}}function Rr(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(w){Ke(a,a.return,w)}}function Ea(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,w=y.destroy;if(w!==void 0){y.destroy=void 0,u=a;var C=s,L=w;try{L()}catch(P){Ke(u,C,P)}}}o=o.next}while(o!==p)}}catch(P){Ke(a,a.return,P)}}function ug(t){var a=t.updateQueue;if(a!==null){var s=t.stateNode;try{eh(a,s)}catch(o){Ke(t,t.return,o)}}}function dg(t,a,s){s.props=bi(t.type,t.memoizedProps),s.state=t.memoizedState;try{s.componentWillUnmount()}catch(o){Ke(t,a,o)}}function Mr(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 fg(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 dd(t,a,s){try{var o=t.stateNode;Qx(o,t.type,s,a),o[Kt]=a}catch(u){Ke(t,t.return,u)}}function pg(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&qa(t.type)||t.tag===4}function fd(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||pg(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&&qa(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 pd(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=Xn));else if(o!==4&&(o===27&&qa(t.type)&&(s=t.stateNode,a=null),t=t.child,t!==null))for(pd(t,a,s),t=t.sibling;t!==null;)pd(t,a,s),t=t.sibling}function fl(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&&qa(t.type)&&(s=t.stateNode),t=t.child,t!==null))for(fl(t,a,s),t=t.sibling;t!==null;)fl(t,a,s),t=t.sibling}function mg(t){var a=t.stateNode,s=t.memoizedProps;try{for(var o=t.type,u=a.attributes;u.length;)a.removeAttributeNode(u[0]);Lt(a,o,s),a[Dt]=t,a[Kt]=s}catch(p){Ke(t,t.return,p)}}var ra=!1,Nt=!1,md=!1,hg=typeof WeakSet=="function"?WeakSet:Set,Tt=null;function kx(t,a){if(t=t.containerInfo,Md=Dl,t=_m(t),ou(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,w=-1,C=-1,L=0,P=0,Y=t,U=null;t:for(;;){for(var I;Y!==s||u!==0&&Y.nodeType!==3||(w=y+u),Y!==p||o!==0&&Y.nodeType!==3||(C=y+o),Y.nodeType===3&&(y+=Y.nodeValue.length),(I=Y.firstChild)!==null;)U=Y,Y=I;for(;;){if(Y===t)break t;if(U===s&&++L===u&&(w=y),U===p&&++P===o&&(C=y),(I=Y.nextSibling)!==null)break;Y=U,U=Y.parentNode}Y=I}s=w===-1||C===-1?null:{start:w,end:C}}else s=null}s=s||{start:0,end:0}}else s=null;for(Bd={focusedElem:t,selectionRange:s},Dl=!1,Tt=a;Tt!==null;)if(a=Tt,t=a.child,(a.subtreeFlags&1028)!==0&&t!==null)t.return=a,Tt=t;else for(;Tt!==null;){switch(a=Tt,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 pe=bi(s.type,u);t=o.getSnapshotBeforeUpdate(pe,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)Ud(t);else if(s===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":Ud(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,Tt=t;break}Tt=a.return}}function gg(t,a,s){var o=s.flags;switch(s.tag){case 0:case 11:case 15:la(t,s),o&4&&Rr(5,s);break;case 1:if(la(t,s),o&4)if(t=s.stateNode,a===null)try{t.componentDidMount()}catch(y){Ke(s,s.return,y)}else{var u=bi(s.type,a.memoizedProps);a=a.memoizedState;try{t.componentDidUpdate(u,a,t.__reactInternalSnapshotBeforeUpdate)}catch(y){Ke(s,s.return,y)}}o&64&&ug(s),o&512&&Mr(s,s.return);break;case 3:if(la(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{eh(t,a)}catch(y){Ke(s,s.return,y)}}break;case 27:a===null&&o&4&&mg(s);case 26:case 5:la(t,s),a===null&&o&4&&fg(s),o&512&&Mr(s,s.return);break;case 12:la(t,s);break;case 31:la(t,s),o&4&&vg(t,s);break;case 13:la(t,s),o&4&&Sg(t,s),o&64&&(t=s.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(s=Rx.bind(null,s),ew(t,s))));break;case 22:if(o=s.memoizedState!==null||ra,!o){a=a!==null&&a.memoizedState!==null||Nt,u=ra;var p=Nt;ra=o,(Nt=a)&&!p?ca(t,s,(s.subtreeFlags&8772)!==0):la(t,s),ra=u,Nt=p}break;case 30:break;default:la(t,s)}}function yg(t){var a=t.alternate;a!==null&&(t.alternate=null,yg(a)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(a=t.stateNode,a!==null&&Gc(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,Yt=!1;function oa(t,a,s){for(s=s.child;s!==null;)bg(t,a,s),s=s.sibling}function bg(t,a,s){if($t&&typeof $t.onCommitFiberUnmount=="function")try{$t.onCommitFiberUnmount(va,s)}catch{}switch(s.tag){case 26:Nt||Vn(s,a),oa(t,a,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:Nt||Vn(s,a);var o=ot,u=Yt;qa(s.type)&&(ot=s.stateNode,Yt=!1),oa(t,a,s),Gr(s.stateNode),ot=o,Yt=u;break;case 5:Nt||Vn(s,a);case 6:if(o=ot,u=Yt,ot=null,oa(t,a,s),ot=o,Yt=u,ot!==null)if(Yt)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&&(Yt?(t=ot,uy(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,s.stateNode),As(t)):uy(ot,s.stateNode));break;case 4:o=ot,u=Yt,ot=s.stateNode.containerInfo,Yt=!0,oa(t,a,s),ot=o,Yt=u;break;case 0:case 11:case 14:case 15:Ea(2,s,a),Nt||Ea(4,s,a),oa(t,a,s);break;case 1:Nt||(Vn(s,a),o=s.stateNode,typeof o.componentWillUnmount=="function"&&dg(s,a,o)),oa(t,a,s);break;case 21:oa(t,a,s);break;case 22:Nt=(o=Nt)||s.memoizedState!==null,oa(t,a,s),Nt=o;break;default:oa(t,a,s)}}function vg(t,a){if(a.memoizedState===null&&(t=a.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{As(t)}catch(s){Ke(a,a.return,s)}}}function Sg(t,a){if(a.memoizedState===null&&(t=a.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{As(t)}catch(s){Ke(a,a.return,s)}}function Ax(t){switch(t.tag){case 31:case 13:case 19:var a=t.stateNode;return a===null&&(a=t.stateNode=new hg),a;case 22:return t=t.stateNode,a=t._retryCache,a===null&&(a=t._retryCache=new hg),a;default:throw Error(r(435,t.tag))}}function pl(t,a){var s=Ax(t);a.forEach(function(o){if(!s.has(o)){s.add(o);var u=Mx.bind(null,t,o);o.then(u,u)}})}function Xt(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,w=y;e:for(;w!==null;){switch(w.tag){case 27:if(qa(w.type)){ot=w.stateNode,Yt=!1;break e}break;case 5:ot=w.stateNode,Yt=!1;break e;case 3:case 4:ot=w.stateNode.containerInfo,Yt=!0;break e}w=w.return}if(ot===null)throw Error(r(160));bg(p,y,u),ot=null,Yt=!1,p=u.alternate,p!==null&&(p.return=null),u.return=null}if(a.subtreeFlags&13886)for(a=a.child;a!==null;)xg(a,t),a=a.sibling}var Dn=null;function xg(t,a){var s=t.alternate,o=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Xt(a,t),Jt(t),o&4&&(Ea(3,t,t.return),Rr(3,t),Ea(5,t,t.return));break;case 1:Xt(a,t),Jt(t),o&512&&(Nt||s===null||Vn(s,s.return)),o&64&&ra&&(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=Dn;if(Xt(a,t),Jt(t),o&512&&(Nt||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[lr]||p[Dt]||p.namespaceURI==="http://www.w3.org/2000/svg"||p.hasAttribute("itemprop"))&&(p=u.createElement(o),u.head.insertBefore(p,u.querySelector("head > title"))),Lt(p,o,s),p[Dt]=t,zt(p),o=p;break e;case"link":var y=xy("link","href",u).get(o+(s.href||""));if(y){for(var w=0;w<y.length;w++)if(p=y[w],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(w,1);break t}}p=u.createElement(o),Lt(p,o,s),u.head.appendChild(p);break;case"meta":if(y=xy("meta","content",u).get(o+(s.content||""))){for(w=0;w<y.length;w++)if(p=y[w],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(w,1);break t}}p=u.createElement(o),Lt(p,o,s),u.head.appendChild(p);break;default:throw Error(r(468,o))}p[Dt]=t,zt(p),o=p}t.stateNode=o}else wy(u,t.type,t.stateNode);else t.stateNode=Sy(u,o,t.memoizedProps);else p!==o?(p===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):p.count--,o===null?wy(u,t.type,t.stateNode):Sy(u,o,t.memoizedProps)):o===null&&t.stateNode!==null&&dd(t,t.memoizedProps,s.memoizedProps)}break;case 27:Xt(a,t),Jt(t),o&512&&(Nt||s===null||Vn(s,s.return)),s!==null&&o&4&&dd(t,t.memoizedProps,s.memoizedProps);break;case 5:if(Xt(a,t),Jt(t),o&512&&(Nt||s===null||Vn(s,s.return)),t.flags&32){u=t.stateNode;try{Yi(u,"")}catch(pe){Ke(t,t.return,pe)}}o&4&&t.stateNode!=null&&(u=t.memoizedProps,dd(t,u,s!==null?s.memoizedProps:u)),o&1024&&(md=!0);break;case 6:if(Xt(a,t),Jt(t),o&4){if(t.stateNode===null)throw Error(r(162));o=t.memoizedProps,s=t.stateNode;try{s.nodeValue=o}catch(pe){Ke(t,t.return,pe)}}break;case 3:if(zl=null,u=Dn,Dn=_l(a.containerInfo),Xt(a,t),Dn=u,Jt(t),o&4&&s!==null&&s.memoizedState.isDehydrated)try{As(a.containerInfo)}catch(pe){Ke(t,t.return,pe)}md&&(md=!1,wg(t));break;case 4:o=Dn,Dn=_l(t.stateNode.containerInfo),Xt(a,t),Jt(t),Dn=o;break;case 12:Xt(a,t),Jt(t);break;case 31:Xt(a,t),Jt(t),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,pl(t,o)));break;case 13:Xt(a,t),Jt(t),t.child.flags&8192&&t.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(hl=Ut()),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,pl(t,o)));break;case 22:u=t.memoizedState!==null;var C=s!==null&&s.memoizedState!==null,L=ra,P=Nt;if(ra=L||u,Nt=P||C,Xt(a,t),Nt=P,ra=L,Jt(t),o&8192)e:for(a=t.stateNode,a._visibility=u?a._visibility&-2:a._visibility|1,u&&(s===null||C||ra||Nt||vi(t)),s=null,a=t;;){if(a.tag===5||a.tag===26){if(s===null){C=s=a;try{if(p=C.stateNode,u)y=p.style,typeof y.setProperty=="function"?y.setProperty("display","none","important"):y.display="none";else{w=C.stateNode;var Y=C.memoizedProps.style,U=Y!=null&&Y.hasOwnProperty("display")?Y.display:null;w.style.display=U==null||typeof U=="boolean"?"":(""+U).trim()}}catch(pe){Ke(C,C.return,pe)}}}else if(a.tag===6){if(s===null){C=a;try{C.stateNode.nodeValue=u?"":C.memoizedProps}catch(pe){Ke(C,C.return,pe)}}}else if(a.tag===18){if(s===null){C=a;try{var I=C.stateNode;u?dy(I,!0):dy(C.stateNode,!1)}catch(pe){Ke(C,C.return,pe)}}}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,pl(t,s))));break;case 19:Xt(a,t),Jt(t),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,pl(t,o)));break;case 30:break;case 21:break;default:Xt(a,t),Jt(t)}}function Jt(t){var a=t.flags;if(a&2){try{for(var s,o=t.return;o!==null;){if(pg(o)){s=o;break}o=o.return}if(s==null)throw Error(r(160));switch(s.tag){case 27:var u=s.stateNode,p=fd(t);fl(t,p,u);break;case 5:var y=s.stateNode;s.flags&32&&(Yi(y,""),s.flags&=-33);var w=fd(t);fl(t,w,y);break;case 3:case 4:var C=s.stateNode.containerInfo,L=fd(t);pd(t,L,C);break;default:throw Error(r(161))}}catch(P){Ke(t,t.return,P)}t.flags&=-3}a&4096&&(t.flags&=-4097)}function wg(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var a=t;wg(a),a.tag===5&&a.flags&1024&&a.stateNode.reset(),t=t.sibling}}function la(t,a){if(a.subtreeFlags&8772)for(a=a.child;a!==null;)gg(t,a.alternate,a),a=a.sibling}function vi(t){for(t=t.child;t!==null;){var a=t;switch(a.tag){case 0:case 11:case 14:case 15:Ea(4,a,a.return),vi(a);break;case 1:Vn(a,a.return);var s=a.stateNode;typeof s.componentWillUnmount=="function"&&dg(a,a.return,s),vi(a);break;case 27:Gr(a.stateNode);case 26:case 5:Vn(a,a.return),vi(a);break;case 22:a.memoizedState===null&&vi(a);break;case 30:vi(a);break;default:vi(a)}t=t.sibling}}function ca(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:ca(u,p,s),Rr(4,p);break;case 1:if(ca(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 w=o.stateNode;try{var C=u.shared.hiddenCallbacks;if(C!==null)for(u.shared.hiddenCallbacks=null,u=0;u<C.length;u++)Wm(C[u],w)}catch(L){Ke(o,o.return,L)}}s&&y&64&&ug(p),Mr(p,p.return);break;case 27:mg(p);case 26:case 5:ca(u,p,s),s&&o===null&&y&4&&fg(p),Mr(p,p.return);break;case 12:ca(u,p,s);break;case 31:ca(u,p,s),s&&y&4&&vg(u,p);break;case 13:ca(u,p,s),s&&y&4&&Sg(u,p);break;case 22:p.memoizedState===null&&ca(u,p,s),Mr(p,p.return);break;case 30:break;default:ca(u,p,s)}a=a.sibling}}function hd(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&&xr(s))}function gd(t,a){t=null,a.alternate!==null&&(t=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==t&&(a.refCount++,t!=null&&xr(t))}function Rn(t,a,s,o){if(a.subtreeFlags&10256)for(a=a.child;a!==null;)jg(t,a,s,o),a=a.sibling}function jg(t,a,s,o){var u=a.flags;switch(a.tag){case 0:case 11:case 15:Rn(t,a,s,o),u&2048&&Rr(9,a);break;case 1:Rn(t,a,s,o);break;case 3:Rn(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&&xr(t)));break;case 12:if(u&2048){Rn(t,a,s,o),t=a.stateNode;try{var p=a.memoizedProps,y=p.id,w=p.onPostCommit;typeof w=="function"&&w(y,a.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(C){Ke(a,a.return,C)}}else Rn(t,a,s,o);break;case 31:Rn(t,a,s,o);break;case 13:Rn(t,a,s,o);break;case 23:break;case 22:p=a.stateNode,y=a.alternate,a.memoizedState!==null?p._visibility&2?Rn(t,a,s,o):Br(t,a):p._visibility&2?Rn(t,a,s,o):(p._visibility|=2,hs(t,a,s,o,(a.subtreeFlags&10256)!==0||!1)),u&2048&&hd(y,a);break;case 24:Rn(t,a,s,o),u&2048&&gd(a.alternate,a);break;default:Rn(t,a,s,o)}}function hs(t,a,s,o,u){for(u=u&&((a.subtreeFlags&10256)!==0||!1),a=a.child;a!==null;){var p=t,y=a,w=s,C=o,L=y.flags;switch(y.tag){case 0:case 11:case 15:hs(p,y,w,C,u),Rr(8,y);break;case 23:break;case 22:var P=y.stateNode;y.memoizedState!==null?P._visibility&2?hs(p,y,w,C,u):Br(p,y):(P._visibility|=2,hs(p,y,w,C,u)),u&&L&2048&&hd(y.alternate,y);break;case 24:hs(p,y,w,C,u),u&&L&2048&&gd(y.alternate,y);break;default:hs(p,y,w,C,u)}a=a.sibling}}function Br(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:Br(s,o),u&2048&&hd(o.alternate,o);break;case 24:Br(s,o),u&2048&&gd(o.alternate,o);break;default:Br(s,o)}a=a.sibling}}var Lr=8192;function gs(t,a,s){if(t.subtreeFlags&Lr)for(t=t.child;t!==null;)Ng(t,a,s),t=t.sibling}function Ng(t,a,s){switch(t.tag){case 26:gs(t,a,s),t.flags&Lr&&t.memoizedState!==null&&fw(s,Dn,t.memoizedState,t.memoizedProps);break;case 5:gs(t,a,s);break;case 3:case 4:var o=Dn;Dn=_l(t.stateNode.containerInfo),gs(t,a,s),Dn=o;break;case 22:t.memoizedState===null&&(o=t.alternate,o!==null&&o.memoizedState!==null?(o=Lr,Lr=16777216,gs(t,a,s),Lr=o):gs(t,a,s));break;default:gs(t,a,s)}}function kg(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 qr(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];Tt=o,_g(o,t)}kg(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Ag(t),t=t.sibling}function Ag(t){switch(t.tag){case 0:case 11:case 15:qr(t),t.flags&2048&&Ea(9,t,t.return);break;case 3:qr(t);break;case 12:qr(t);break;case 22:var a=t.stateNode;t.memoizedState!==null&&a._visibility&2&&(t.return===null||t.return.tag!==13)?(a._visibility&=-3,ml(t)):qr(t);break;default:qr(t)}}function ml(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];Tt=o,_g(o,t)}kg(t)}for(t=t.child;t!==null;){switch(a=t,a.tag){case 0:case 11:case 15:Ea(8,a,a.return),ml(a);break;case 22:s=a.stateNode,s._visibility&2&&(s._visibility&=-3,ml(a));break;default:ml(a)}t=t.sibling}}function _g(t,a){for(;Tt!==null;){var s=Tt;switch(s.tag){case 0:case 11:case 15:Ea(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:xr(s.memoizedState.cache)}if(o=s.child,o!==null)o.return=s,Tt=o;else e:for(s=t;Tt!==null;){o=Tt;var u=o.sibling,p=o.return;if(yg(o),o===s){Tt=null;break e}if(u!==null){u.return=p,Tt=u;break e}Tt=p}}}var _x={getCacheForType:function(t){var a=Mt(xt),s=a.data.get(t);return s===void 0&&(s=t(),a.data.set(t,s)),s},cacheSignal:function(){return Mt(xt).controller.signal}},Cx=typeof WeakMap=="function"?WeakMap:Map,Pe=0,We=null,Re=null,Be=0,Qe=0,ln=null,Oa=!1,ys=!1,yd=!1,ua=0,pt=0,Da=0,Si=0,bd=0,cn=0,bs=0,Ur=null,Ft=null,vd=!1,hl=0,Cg=0,gl=1/0,yl=null,Ra=null,At=0,Ma=null,vs=null,da=0,Sd=0,xd=null,zg=null,$r=0,wd=null;function un(){return(Pe&2)!==0&&Be!==0?Be&-Be:$.T!==null?Cd():Hp()}function Tg(){if(cn===0)if((Be&536870912)===0||qe){var t=$i;$i<<=1,($i&3932160)===0&&($i=262144),cn=t}else cn=536870912;return t=rn.current,t!==null&&(t.flags|=32),cn}function Wt(t,a,s){(t===We&&(Qe===2||Qe===9)||t.cancelPendingCommit!==null)&&(Ss(t,0),Ba(t,Be,cn,!1)),Fe(t,s),((Pe&2)===0||t!==We)&&(t===We&&((Pe&2)===0&&(Si|=s),pt===4&&Ba(t,Be,cn,!1)),Pn(t))}function Eg(t,a,s){if((Pe&6)!==0)throw Error(r(327));var o=!s&&(a&127)===0&&(a&t.expiredLanes)===0||ni(t,a),u=o?Ex(t,a):Nd(t,a,!0),p=o;do{if(u===0){ys&&!o&&Ba(t,a,0,!1);break}else{if(s=t.current.alternate,p&&!zx(s)){u=Nd(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 w=t;u=Ur;var C=w.current.memoizedState.isDehydrated;if(C&&(Ss(w,y).flags|=256),y=Nd(w,y,!1),y!==2){if(yd&&!C){w.errorRecoveryDisabledLanes|=p,Si|=p,u=4;break e}p=Ft,Ft=u,p!==null&&(Ft===null?Ft=p:Ft.push.apply(Ft,p))}u=y}if(p=!1,u!==2)continue}}if(u===1){Ss(t,0),Ba(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:Ba(o,a,cn,!Oa);break e;case 2:Ft=null;break;case 3:case 5:break;default:throw Error(r(329))}if((a&62914560)===a&&(u=hl+300-Ut(),10<u)){if(Ba(o,a,cn,!Oa),Vi(o,0,!0)!==0)break e;da=a,o.timeoutHandle=ly(Og.bind(null,o,s,Ft,yl,vd,a,cn,Si,bs,Oa,p,"Throttled",-0,0),u);break e}Og(o,s,Ft,yl,vd,a,cn,Si,bs,Oa,p,null,-0,0)}}break}while(!0);Pn(t)}function Og(t,a,s,o,u,p,y,w,C,L,P,Y,U,I){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:Xn},Ng(a,p,Y);var pe=(p&62914560)===p?hl-Ut():(p&4194048)===p?Cg-Ut():0;if(pe=pw(Y,pe),pe!==null){da=p,t.cancelPendingCommit=pe($g.bind(null,t,a,p,s,o,u,y,w,C,P,Y,null,U,I)),Ba(t,p,y,!L);return}}$g(t,a,p,s,o,u,y,w,C)}function zx(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(!an(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 Ba(t,a,s,o){a&=~bd,a&=~Si,t.suspendedLanes|=a,t.pingedLanes&=~a,o&&(t.warmLanes|=a),o=t.expirationTimes;for(var u=a;0<u;){var p=31-ht(u),y=1<<p;o[p]=-1,u&=~y}s!==0&&Ao(t,s,a)}function bl(){return(Pe&6)===0?(Ir(0),!1):!0}function jd(){if(Re!==null){if(Qe===0)var t=Re.return;else t=Re,ea=di=null,Uu(t),us=null,jr=0,t=Re;for(;t!==null;)cg(t.alternate,t),t=t.return;Re=null}}function Ss(t,a){var s=t.timeoutHandle;s!==-1&&(t.timeoutHandle=-1,Yx(s)),s=t.cancelPendingCommit,s!==null&&(t.cancelPendingCommit=null,s()),da=0,jd(),We=t,Re=s=Fn(t.current,null),Be=a,Qe=0,ln=null,Oa=!1,ys=ni(t,a),yd=!1,bs=cn=bd=Si=Da=pt=0,Ft=Ur=null,vd=!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-ht(o),p=1<<u;a|=t[u],o&=~p}return ua=a,Uo(),s}function Dg(t,a){ze=null,$.H=Er,a===cs||a===Ko?(a=Ym(),Qe=3):a===_u?(a=Ym(),Qe=4):Qe=a===td?8:a!==null&&typeof a=="object"&&typeof a.then=="function"?6:1,ln=a,Re===null&&(pt=1,ol(t,hn(a,t.current)))}function Rg(){var t=rn.current;return t===null?!0:(Be&4194048)===Be?vn===null:(Be&62914560)===Be||(Be&536870912)!==0?t===vn:!1}function Mg(){var t=$.H;return $.H=Er,t===null?Er:t}function Bg(){var t=$.A;return $.A=_x,t}function vl(){pt=4,Oa||(Be&4194048)!==Be&&rn.current!==null||(ys=!0),(Da&134217727)===0&&(Si&134217727)===0||We===null||Ba(We,Be,cn,!1)}function Nd(t,a,s){var o=Pe;Pe|=2;var u=Mg(),p=Bg();(We!==t||Be!==a)&&(yl=null,Ss(t,a)),a=!1;var y=pt;e:do try{if(Qe!==0&&Re!==null){var w=Re,C=ln;switch(Qe){case 8:jd(),y=6;break e;case 3:case 2:case 9:case 6:rn.current===null&&(a=!0);var L=Qe;if(Qe=0,ln=null,xs(t,w,C,L),s&&ys){y=0;break e}break;default:L=Qe,Qe=0,ln=null,xs(t,w,C,L)}}Tx(),y=pt;break}catch(P){Dg(t,P)}while(!0);return a&&t.shellSuspendCounter++,ea=di=null,Pe=o,$.H=u,$.A=p,Re===null&&(We=null,Be=0,Uo()),y}function Tx(){for(;Re!==null;)Lg(Re)}function Ex(t,a){var s=Pe;Pe|=2;var o=Mg(),u=Bg();We!==t||Be!==a?(yl=null,gl=Ut()+500,Ss(t,a)):ys=ni(t,a);e:do try{if(Qe!==0&&Re!==null){a=Re;var p=ln;t:switch(Qe){case 1:Qe=0,ln=null,xs(t,a,p,1);break;case 2:case 9:if(Km(p)){Qe=0,ln=null,qg(a);break}a=function(){Qe!==2&&Qe!==9||We!==t||(Qe=7),Pn(t)},p.then(a,a);break e;case 3:Qe=7;break e;case 4:Qe=5;break e;case 7:Km(p)?(Qe=0,ln=null,qg(a)):(Qe=0,ln=null,xs(t,a,p,7));break;case 5:var y=null;switch(Re.tag){case 26:y=Re.memoizedState;case 5:case 27:var w=Re;if(y?jy(y):w.stateNode.complete){Qe=0,ln=null;var C=w.sibling;if(C!==null)Re=C;else{var L=w.return;L!==null?(Re=L,Sl(L)):Re=null}break t}}Qe=0,ln=null,xs(t,a,p,5);break;case 6:Qe=0,ln=null,xs(t,a,p,6);break;case 8:jd(),pt=6;break e;default:throw Error(r(462))}}Ox();break}catch(P){Dg(t,P)}while(!0);return ea=di=null,$.H=o,$.A=u,Pe=s,Re!==null?0:(We=null,Be=0,Uo(),pt)}function Ox(){for(;Re!==null&&!xo();)Lg(Re)}function Lg(t){var a=og(t.alternate,t,ua);t.memoizedProps=t.pendingProps,a===null?Sl(t):Re=a}function qg(t){var a=t,s=a.alternate;switch(a.tag){case 15:case 0:a=tg(s,a,a.pendingProps,a.type,void 0,Be);break;case 11:a=tg(s,a,a.pendingProps,a.type.render,a.ref,Be);break;case 5:Uu(a);default:cg(s,a),a=Re=Bm(a,ua),a=og(s,a,ua)}t.memoizedProps=t.pendingProps,a===null?Sl(t):Re=a}function xs(t,a,s,o){ea=di=null,Uu(a),us=null,jr=0;var u=a.return;try{if(Sx(t,u,a,s,Be)){pt=1,ol(t,hn(s,t.current)),Re=null;return}}catch(p){if(u!==null)throw Re=u,p;pt=1,ol(t,hn(s,t.current)),Re=null;return}a.flags&32768?(qe||o===1?t=!0:ys||(Be&536870912)!==0?t=!1:(Oa=t=!0,(o===2||o===9||o===3||o===6)&&(o=rn.current,o!==null&&o.tag===13&&(o.flags|=16384))),Ug(a,t)):Sl(a)}function Sl(t){var a=t;do{if((a.flags&32768)!==0){Ug(a,Oa);return}t=a.return;var s=jx(a.alternate,a,ua);if(s!==null){Re=s;return}if(a=a.sibling,a!==null){Re=a;return}Re=a=t}while(a!==null);pt===0&&(pt=5)}function Ug(t,a){do{var s=Nx(t.alternate,t);if(s!==null){s.flags&=32767,Re=s;return}if(s=t.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!a&&(t=t.sibling,t!==null)){Re=t;return}Re=t=s}while(t!==null);pt=6,Re=null}function $g(t,a,s,o,u,p,y,w,C){t.cancelPendingCommit=null;do xl();while(At!==0);if((Pe&6)!==0)throw Error(r(327));if(a!==null){if(a===t.current)throw Error(r(177));if(p=a.lanes|a.childLanes,p|=fu,ai(t,s,p,y,w,C),t===We&&(Re=We=null,Be=0),vs=a,Ma=t,da=s,Sd=p,xd=u,zg=o,(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,Bx(Li,function(){return Hg(),null})):(t.callbackNode=null,t.callbackPriority=0),o=(a.flags&13878)!==0,(a.subtreeFlags&13878)!==0||o){o=$.T,$.T=null,u=W.p,W.p=2,y=Pe,Pe|=4;try{kx(t,a,s)}finally{Pe=y,W.p=u,$.T=o}}At=1,Ig(),Vg(),Pg()}}function Ig(){if(At===1){At=0;var t=Ma,a=vs,s=(a.flags&13878)!==0;if((a.subtreeFlags&13878)!==0||s){s=$.T,$.T=null;var o=W.p;W.p=2;var u=Pe;Pe|=4;try{xg(a,t);var p=Bd,y=_m(t.containerInfo),w=p.focusedElem,C=p.selectionRange;if(y!==w&&w&&w.ownerDocument&&Am(w.ownerDocument.documentElement,w)){if(C!==null&&ou(w)){var L=C.start,P=C.end;if(P===void 0&&(P=L),"selectionStart"in w)w.selectionStart=L,w.selectionEnd=Math.min(P,w.value.length);else{var Y=w.ownerDocument||document,U=Y&&Y.defaultView||window;if(U.getSelection){var I=U.getSelection(),pe=w.textContent.length,we=Math.min(C.start,pe),Je=C.end===void 0?we:Math.min(C.end,pe);!I.extend&&we>Je&&(y=Je,Je=we,we=y);var D=km(w,we),z=km(w,Je);if(D&&z&&(I.rangeCount!==1||I.anchorNode!==D.node||I.anchorOffset!==D.offset||I.focusNode!==z.node||I.focusOffset!==z.offset)){var B=Y.createRange();B.setStart(D.node,D.offset),I.removeAllRanges(),we>Je?(I.addRange(B),I.extend(z.node,z.offset)):(B.setEnd(z.node,z.offset),I.addRange(B))}}}}for(Y=[],I=w;I=I.parentNode;)I.nodeType===1&&Y.push({element:I,left:I.scrollLeft,top:I.scrollTop});for(typeof w.focus=="function"&&w.focus(),w=0;w<Y.length;w++){var Q=Y[w];Q.element.scrollLeft=Q.left,Q.element.scrollTop=Q.top}}Dl=!!Md,Bd=Md=null}finally{Pe=u,W.p=o,$.T=s}}t.current=a,At=2}}function Vg(){if(At===2){At=0;var t=Ma,a=vs,s=(a.flags&8772)!==0;if((a.subtreeFlags&8772)!==0||s){s=$.T,$.T=null;var o=W.p;W.p=2;var u=Pe;Pe|=4;try{gg(t,a.alternate,a)}finally{Pe=u,W.p=o,$.T=s}}At=3}}function Pg(){if(At===4||At===3){At=0,$c();var t=Ma,a=vs,s=da,o=zg;(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?At=5:(At=0,vs=Ma=null,Gg(t,t.pendingLanes));var u=t.pendingLanes;if(u===0&&(Ra=null),En(s),a=a.stateNode,$t&&typeof $t.onCommitFiberRoot=="function")try{$t.onCommitFiberRoot(va,a,void 0,(a.current.flags&128)===128)}catch{}if(o!==null){a=$.T,u=W.p,W.p=2,$.T=null;try{for(var p=t.onRecoverableError,y=0;y<o.length;y++){var w=o[y];p(w.value,{componentStack:w.stack})}}finally{$.T=a,W.p=u}}(da&3)!==0&&xl(),Pn(t),u=t.pendingLanes,(s&261930)!==0&&(u&42)!==0?t===wd?$r++:($r=0,wd=t):$r=0,Ir(0)}}function Gg(t,a){(t.pooledCacheLanes&=a)===0&&(a=t.pooledCache,a!=null&&(t.pooledCache=null,xr(a)))}function xl(){return Ig(),Vg(),Pg(),Hg()}function Hg(){if(At!==5)return!1;var t=Ma,a=Sd;Sd=0;var s=En(da),o=$.T,u=W.p;try{W.p=32>s?32:s,$.T=null,s=xd,xd=null;var p=Ma,y=da;if(At=0,vs=Ma=null,da=0,(Pe&6)!==0)throw Error(r(331));var w=Pe;if(Pe|=4,Ag(p.current),jg(p,p.current,y,s),Pe=w,Ir(0,!1),$t&&typeof $t.onPostCommitFiberRoot=="function")try{$t.onPostCommitFiberRoot(va,p)}catch{}return!0}finally{W.p=u,$.T=o,Gg(t,a)}}function Qg(t,a,s){a=hn(s,a),a=ed(t.stateNode,a,2),t=Ca(t,a,2),t!==null&&(Fe(t,2),Pn(t))}function Ke(t,a,s){if(t.tag===3)Qg(t,t,s);else for(;a!==null;){if(a.tag===3){Qg(a,t,s);break}else if(a.tag===1){var o=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(Ra===null||!Ra.has(o))){t=hn(s,t),s=Kh(2),o=Ca(a,s,2),o!==null&&(Zh(s,o,a,t),Fe(o,2),Pn(o));break}}a=a.return}}function kd(t,a,s){var o=t.pingCache;if(o===null){o=t.pingCache=new Cx;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)||(yd=!0,u.add(s),t=Dx.bind(null,t,a,s),a.then(t,t))}function Dx(t,a,s){var o=t.pingCache;o!==null&&o.delete(a),t.pingedLanes|=t.suspendedLanes&s,t.warmLanes&=~s,We===t&&(Be&s)===s&&(pt===4||pt===3&&(Be&62914560)===Be&&300>Ut()-hl?(Pe&2)===0&&Ss(t,0):bd|=s,bs===Be&&(bs=0)),Pn(t)}function Kg(t,a){a===0&&(a=ko()),t=li(t,a),t!==null&&(Fe(t,a),Pn(t))}function Rx(t){var a=t.memoizedState,s=0;a!==null&&(s=a.retryLane),Kg(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),Kg(t,s)}function Bx(t,a){return Mi(t,a)}var wl=null,ws=null,Ad=!1,jl=!1,_d=!1,La=0;function Pn(t){t!==ws&&t.next===null&&(ws===null?wl=ws=t:ws=ws.next=t),jl=!0,Ad||(Ad=!0,qx())}function Ir(t,a){if(!_d&&jl){_d=!0;do for(var s=!1,o=wl;o!==null;){if(t!==0){var u=o.pendingLanes;if(u===0)var p=0;else{var y=o.suspendedLanes,w=o.pingedLanes;p=(1<<31-ht(42|t)+1)-1,p&=u&~(y&~w),p=p&201326741?p&201326741|1:p?p|2:0}p!==0&&(s=!0,Jg(o,p))}else p=Be,p=Vi(o,o===We?p:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(p&3)===0||ni(o,p)||(s=!0,Jg(o,p));o=o.next}while(s);_d=!1}}function Lx(){Zg()}function Zg(){jl=Ad=!1;var t=0;La!==0&&Zx()&&(t=La);for(var a=Ut(),s=null,o=wl;o!==null;){var u=o.next,p=Yg(o,a);p===0?(o.next=null,s===null?wl=u:s.next=u,u===null&&(ws=s)):(s=o,(t!==0||(p&3)!==0)&&(jl=!0)),o=u}At!==0&&At!==5||Ir(t),La!==0&&(La=0)}function Yg(t,a){for(var s=t.suspendedLanes,o=t.pingedLanes,u=t.expirationTimes,p=t.pendingLanes&-62914561;0<p;){var y=31-ht(p),w=1<<y,C=u[y];C===-1?((w&s)===0||(w&o)!==0)&&(u[y]=Zn(w,a)):C<=a&&(t.expiredLanes|=w),p&=~w}if(a=We,s=Be,s=Vi(t,t===a?s:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),o=t.callbackNode,s===0||t===a&&(Qe===2||Qe===9)||t.cancelPendingCommit!==null)return o!==null&&o!==null&&Bi(o),t.callbackNode=null,t.callbackPriority=0;if((s&3)===0||ni(t,s)){if(a=s&-s,a===t.callbackPriority)return a;switch(o!==null&&Bi(o),En(s)){case 2:case 8:s=jo;break;case 32:s=Li;break;case 268435456:s=qi;break;default:s=Li}return o=Xg.bind(null,t),s=Mi(s,o),t.callbackPriority=a,t.callbackNode=s,a}return o!==null&&o!==null&&Bi(o),t.callbackPriority=2,t.callbackNode=null,2}function Xg(t,a){if(At!==0&&At!==5)return t.callbackNode=null,t.callbackPriority=0,null;var s=t.callbackNode;if(xl()&&t.callbackNode!==s)return null;var o=Be;return o=Vi(t,t===We?o:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),o===0?null:(Eg(t,o,a),Yg(t,Ut()),t.callbackNode!=null&&t.callbackNode===s?Xg.bind(null,t):null)}function Jg(t,a){if(xl())return null;Eg(t,a,!0)}function qx(){Xx(function(){(Pe&6)!==0?Mi(ir,Lx):Zg()})}function Cd(){if(La===0){var t=os;t===0&&(t=Ui,Ui<<=1,(Ui&261888)===0&&(Ui=256)),La=t}return La}function Fg(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Eo(""+t)}function Wg(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 Ux(t,a,s,o,u){if(a==="submit"&&s&&s.stateNode===u){var p=Fg((u[Kt]||null).action),y=o.submitter;y&&(a=(a=y[Kt]||null)?Fg(a.formAction):y.getAttribute("formAction"),a!==null&&(p=a,y=null));var w=new Mo("action","action",null,o,u);t.push({event:w,listeners:[{instance:null,listener:function(){if(o.defaultPrevented){if(La!==0){var C=y?Wg(u,y):new FormData(u);Zu(s,{pending:!0,data:C,method:u.method,action:p},null,C)}}else typeof p=="function"&&(w.preventDefault(),C=y?Wg(u,y):new FormData(u),Zu(s,{pending:!0,data:C,method:u.method,action:p},p,C))},currentTarget:u}]})}}for(var zd=0;zd<du.length;zd++){var Td=du[zd],$x=Td.toLowerCase(),Ix=Td[0].toUpperCase()+Td.slice(1);On($x,"on"+Ix)}On(Tm,"onAnimationEnd"),On(Em,"onAnimationIteration"),On(Om,"onAnimationStart"),On("dblclick","onDoubleClick"),On("focusin","onFocus"),On("focusout","onBlur"),On(ax,"onTransitionRun"),On(ix,"onTransitionStart"),On(sx,"onTransitionCancel"),On(Dm,"onTransitionEnd"),Ki("onMouseEnter",["mouseout","mouseover"]),Ki("onMouseLeave",["mouseout","mouseover"]),Ki("onPointerEnter",["pointerout","pointerover"]),Ki("onPointerLeave",["pointerout","pointerover"]),ii("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ii("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ii("onBeforeInput",["compositionend","keypress","textInput","paste"]),ii("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ii("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ii("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Vr="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(" "),Vx=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Vr));function ey(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 w=o[y],C=w.instance,L=w.currentTarget;if(w=w.listener,C!==p&&u.isPropagationStopped())break e;p=w,u.currentTarget=L;try{p(u)}catch(P){qo(P)}u.currentTarget=null,p=C}else for(y=0;y<o.length;y++){if(w=o[y],C=w.instance,L=w.currentTarget,w=w.listener,C!==p&&u.isPropagationStopped())break e;p=w,u.currentTarget=L;try{p(u)}catch(P){qo(P)}u.currentTarget=null,p=C}}}}function Me(t,a){var s=a[Pc];s===void 0&&(s=a[Pc]=new Set);var o=t+"__bubble";s.has(o)||(ty(a,t,2,!1),s.add(o))}function Ed(t,a,s){var o=0;a&&(o|=4),ty(s,t,o,a)}var Nl="_reactListening"+Math.random().toString(36).slice(2);function Od(t){if(!t[Nl]){t[Nl]=!0,Zp.forEach(function(s){s!=="selectionchange"&&(Vx.has(s)||Ed(s,!1,t),Ed(s,!0,t))});var a=t.nodeType===9?t:t.ownerDocument;a===null||a[Nl]||(a[Nl]=!0,Ed("selectionchange",!1,a))}}function ty(t,a,s,o){switch(Ty(a)){case 2:var u=gw;break;case 8:u=yw;break;default:u=Kd}s=u.bind(null,a,s,t),u=void 0,!Fc||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 Dd(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 w=o.stateNode.containerInfo;if(w===u)break;if(y===4)for(y=o.return;y!==null;){var C=y.tag;if((C===3||C===4)&&y.stateNode.containerInfo===u)return;y=y.return}for(;w!==null;){if(y=Gi(w),y===null)return;if(C=y.tag,C===5||C===6||C===26||C===27){o=p=y;continue e}w=w.parentNode}}o=o.return}rm(function(){var L=p,P=Xc(s),Y=[];e:{var U=Rm.get(t);if(U!==void 0){var I=Mo,pe=t;switch(t){case"keypress":if(Do(s)===0)break e;case"keydown":case"keyup":I=M1;break;case"focusin":pe="focus",I=nu;break;case"focusout":pe="blur",I=nu;break;case"beforeblur":case"afterblur":I=nu;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":I=cm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":I=j1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":I=q1;break;case Tm:case Em:case Om:I=A1;break;case Dm:I=$1;break;case"scroll":case"scrollend":I=x1;break;case"wheel":I=V1;break;case"copy":case"cut":case"paste":I=C1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":I=dm;break;case"toggle":case"beforetoggle":I=G1}var we=(a&4)!==0,Je=!we&&(t==="scroll"||t==="scrollend"),D=we?U!==null?U+"Capture":null:U;we=[];for(var z=L,B;z!==null;){var Q=z;if(B=Q.stateNode,Q=Q.tag,Q!==5&&Q!==26&&Q!==27||B===null||D===null||(Q=ur(z,D),Q!=null&&we.push(Pr(z,Q,B))),Je)break;z=z.return}0<we.length&&(U=new I(U,pe,null,s,P),Y.push({event:U,listeners:we}))}}if((a&7)===0){e:{if(U=t==="mouseover"||t==="pointerover",I=t==="mouseout"||t==="pointerout",U&&s!==Yc&&(pe=s.relatedTarget||s.fromElement)&&(Gi(pe)||pe[Pi]))break e;if((I||U)&&(U=P.window===P?P:(U=P.ownerDocument)?U.defaultView||U.parentWindow:window,I?(pe=s.relatedTarget||s.toElement,I=L,pe=pe?Gi(pe):null,pe!==null&&(Je=c(pe),we=pe.tag,pe!==Je||we!==5&&we!==27&&we!==6)&&(pe=null)):(I=null,pe=L),I!==pe)){if(we=cm,Q="onMouseLeave",D="onMouseEnter",z="mouse",(t==="pointerout"||t==="pointerover")&&(we=dm,Q="onPointerLeave",D="onPointerEnter",z="pointer"),Je=I==null?U:cr(I),B=pe==null?U:cr(pe),U=new we(Q,z+"leave",I,s,P),U.target=Je,U.relatedTarget=B,Q=null,Gi(P)===L&&(we=new we(D,z+"enter",pe,s,P),we.target=B,we.relatedTarget=Je,Q=we),Je=Q,I&&pe)t:{for(we=Px,D=I,z=pe,B=0,Q=D;Q;Q=we(Q))B++;Q=0;for(var Se=z;Se;Se=we(Se))Q++;for(;0<B-Q;)D=we(D),B--;for(;0<Q-B;)z=we(z),Q--;for(;B--;){if(D===z||z!==null&&D===z.alternate){we=D;break t}D=we(D),z=we(z)}we=null}else we=null;I!==null&&ny(Y,U,I,we,!1),pe!==null&&Je!==null&&ny(Y,Je,pe,we,!0)}}e:{if(U=L?cr(L):window,I=U.nodeName&&U.nodeName.toLowerCase(),I==="select"||I==="input"&&U.type==="file")var Ie=vm;else if(ym(U))if(Sm)Ie=ex;else{Ie=F1;var ye=J1}else I=U.nodeName,!I||I.toLowerCase()!=="input"||U.type!=="checkbox"&&U.type!=="radio"?L&&Zc(L.elementType)&&(Ie=vm):Ie=W1;if(Ie&&(Ie=Ie(t,L))){bm(Y,Ie,s,P);break e}ye&&ye(t,U,L),t==="focusout"&&L&&U.type==="number"&&L.memoizedProps.value!=null&&Kc(U,"number",U.value)}switch(ye=L?cr(L):window,t){case"focusin":(ym(ye)||ye.contentEditable==="true")&&(Wi=ye,lu=L,br=null);break;case"focusout":br=lu=Wi=null;break;case"mousedown":cu=!0;break;case"contextmenu":case"mouseup":case"dragend":cu=!1,Cm(Y,s,P);break;case"selectionchange":if(nx)break;case"keydown":case"keyup":Cm(Y,s,P)}var Te;if(iu)e:{switch(t){case"compositionstart":var Le="onCompositionStart";break e;case"compositionend":Le="onCompositionEnd";break e;case"compositionupdate":Le="onCompositionUpdate";break e}Le=void 0}else Fi?hm(t,s)&&(Le="onCompositionEnd"):t==="keydown"&&s.keyCode===229&&(Le="onCompositionStart");Le&&(fm&&s.locale!=="ko"&&(Fi||Le!=="onCompositionStart"?Le==="onCompositionEnd"&&Fi&&(Te=om()):(xa=P,Wc="value"in xa?xa.value:xa.textContent,Fi=!0)),ye=kl(L,Le),0<ye.length&&(Le=new um(Le,t,null,s,P),Y.push({event:Le,listeners:ye}),Te?Le.data=Te:(Te=gm(s),Te!==null&&(Le.data=Te)))),(Te=Q1?K1(t,s):Z1(t,s))&&(Le=kl(L,"onBeforeInput"),0<Le.length&&(ye=new um("onBeforeInput","beforeinput",null,s,P),Y.push({event:ye,listeners:Le}),ye.data=Te)),Ux(Y,t,L,s,P)}ey(Y,a)})}function Pr(t,a,s){return{instance:t,listener:a,currentTarget:s}}function kl(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=ur(t,s),u!=null&&o.unshift(Pr(t,u,p)),u=ur(t,a),u!=null&&o.push(Pr(t,u,p))),t.tag===3)return o;t=t.return}return[]}function Px(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function ny(t,a,s,o,u){for(var p=a._reactName,y=[];s!==null&&s!==o;){var w=s,C=w.alternate,L=w.stateNode;if(w=w.tag,C!==null&&C===o)break;w!==5&&w!==26&&w!==27||L===null||(C=L,u?(L=ur(s,p),L!=null&&y.unshift(Pr(s,L,C))):u||(L=ur(s,p),L!=null&&y.push(Pr(s,L,C)))),s=s.return}y.length!==0&&t.push({event:a,listeners:y})}var Gx=/\r\n?/g,Hx=/\u0000|\uFFFD/g;function ay(t){return(typeof t=="string"?t:""+t).replace(Gx,`
|
|
10
|
+
`).replace(Hx,"")}function iy(t,a){return a=ay(a),ay(t)===a}function Xe(t,a,s,o,u,p){switch(s){case"children":typeof o=="string"?a==="body"||a==="textarea"&&o===""||Yi(t,o):(typeof o=="number"||typeof o=="bigint")&&a!=="body"&&Yi(t,""+o);break;case"className":zo(t,"class",o);break;case"tabIndex":zo(t,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":zo(t,s,o);break;case"style":im(t,o,p);break;case"data":if(a!=="object"){zo(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=Eo(""+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=Eo(""+o),t.setAttribute(s,o);break;case"onClick":o!=null&&(t.onclick=Xn);break;case"onScroll":o!=null&&Me("scroll",t);break;case"onScrollEnd":o!=null&&Me("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=Eo(""+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":Me("beforetoggle",t),Me("toggle",t),Co(t,"popover",o);break;case"xlinkActuate":Yn(t,"http://www.w3.org/1999/xlink","xlink:actuate",o);break;case"xlinkArcrole":Yn(t,"http://www.w3.org/1999/xlink","xlink:arcrole",o);break;case"xlinkRole":Yn(t,"http://www.w3.org/1999/xlink","xlink:role",o);break;case"xlinkShow":Yn(t,"http://www.w3.org/1999/xlink","xlink:show",o);break;case"xlinkTitle":Yn(t,"http://www.w3.org/1999/xlink","xlink:title",o);break;case"xlinkType":Yn(t,"http://www.w3.org/1999/xlink","xlink:type",o);break;case"xmlBase":Yn(t,"http://www.w3.org/XML/1998/namespace","xml:base",o);break;case"xmlLang":Yn(t,"http://www.w3.org/XML/1998/namespace","xml:lang",o);break;case"xmlSpace":Yn(t,"http://www.w3.org/XML/1998/namespace","xml:space",o);break;case"is":Co(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=v1.get(s)||s,Co(t,s,o))}}function Rd(t,a,s,o,u,p){switch(s){case"style":im(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"?Yi(t,o):(typeof o=="number"||typeof o=="bigint")&&Yi(t,""+o);break;case"onScroll":o!=null&&Me("scroll",t);break;case"onScrollEnd":o!=null&&Me("scrollend",t);break;case"onClick":o!=null&&(t.onclick=Xn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Yp.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[Kt]||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,""):Co(t,s,o)}}}function Lt(t,a,s){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Me("error",t),Me("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":Me("invalid",t);var w=p=y=u=null,C=null,L=null;for(o in s)if(s.hasOwnProperty(o)){var P=s[o];if(P!=null)switch(o){case"name":u=P;break;case"type":y=P;break;case"checked":C=P;break;case"defaultChecked":L=P;break;case"value":p=P;break;case"defaultValue":w=P;break;case"children":case"dangerouslySetInnerHTML":if(P!=null)throw Error(r(137,a));break;default:Xe(t,a,o,P,s,null)}}em(t,p,w,C,L,y,u,!1);return;case"select":Me("invalid",t),o=y=p=null;for(u in s)if(s.hasOwnProperty(u)&&(w=s[u],w!=null))switch(u){case"value":p=w;break;case"defaultValue":y=w;break;case"multiple":o=w;default:Xe(t,a,u,w,s,null)}a=p,s=y,t.multiple=!!o,a!=null?Zi(t,!!o,a,!1):s!=null&&Zi(t,!!o,s,!0);return;case"textarea":Me("invalid",t),p=u=o=null;for(y in s)if(s.hasOwnProperty(y)&&(w=s[y],w!=null))switch(y){case"value":o=w;break;case"defaultValue":u=w;break;case"children":p=w;break;case"dangerouslySetInnerHTML":if(w!=null)throw Error(r(91));break;default:Xe(t,a,y,w,s,null)}nm(t,o,u,p);return;case"option":for(C in s)s.hasOwnProperty(C)&&(o=s[C],o!=null)&&(C==="selected"?t.selected=o&&typeof o!="function"&&typeof o!="symbol":Xe(t,a,C,o,s,null));return;case"dialog":Me("beforetoggle",t),Me("toggle",t),Me("cancel",t),Me("close",t);break;case"iframe":case"object":Me("load",t);break;case"video":case"audio":for(o=0;o<Vr.length;o++)Me(Vr[o],t);break;case"image":Me("error",t),Me("load",t);break;case"details":Me("toggle",t);break;case"embed":case"source":case"link":Me("error",t),Me("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(Zc(a)){for(P in s)s.hasOwnProperty(P)&&(o=s[P],o!==void 0&&Rd(t,a,P,o,s,void 0));return}}for(w in s)s.hasOwnProperty(w)&&(o=s[w],o!=null&&Xe(t,a,w,o,s,null))}function Qx(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,w=null,C=null,L=null,P=null;for(I in s){var Y=s[I];if(s.hasOwnProperty(I)&&Y!=null)switch(I){case"checked":break;case"value":break;case"defaultValue":C=Y;default:o.hasOwnProperty(I)||Xe(t,a,I,null,o,Y)}}for(var U in o){var I=o[U];if(Y=s[U],o.hasOwnProperty(U)&&(I!=null||Y!=null))switch(U){case"type":p=I;break;case"name":u=I;break;case"checked":L=I;break;case"defaultChecked":P=I;break;case"value":y=I;break;case"defaultValue":w=I;break;case"children":case"dangerouslySetInnerHTML":if(I!=null)throw Error(r(137,a));break;default:I!==Y&&Xe(t,a,U,I,o,Y)}}Qc(t,y,w,C,L,P,p,u);return;case"select":I=y=w=U=null;for(p in s)if(C=s[p],s.hasOwnProperty(p)&&C!=null)switch(p){case"value":break;case"multiple":I=C;default:o.hasOwnProperty(p)||Xe(t,a,p,null,o,C)}for(u in o)if(p=o[u],C=s[u],o.hasOwnProperty(u)&&(p!=null||C!=null))switch(u){case"value":U=p;break;case"defaultValue":w=p;break;case"multiple":y=p;default:p!==C&&Xe(t,a,u,p,o,C)}a=w,s=y,o=I,U!=null?Zi(t,!!s,U,!1):!!o!=!!s&&(a!=null?Zi(t,!!s,a,!0):Zi(t,!!s,s?[]:"",!1));return;case"textarea":I=U=null;for(w in s)if(u=s[w],s.hasOwnProperty(w)&&u!=null&&!o.hasOwnProperty(w))switch(w){case"value":break;case"children":break;default:Xe(t,a,w,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":U=u;break;case"defaultValue":I=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)}tm(t,U,I);return;case"option":for(var pe in s)U=s[pe],s.hasOwnProperty(pe)&&U!=null&&!o.hasOwnProperty(pe)&&(pe==="selected"?t.selected=!1:Xe(t,a,pe,null,o,U));for(C in o)U=o[C],I=s[C],o.hasOwnProperty(C)&&U!==I&&(U!=null||I!=null)&&(C==="selected"?t.selected=U&&typeof U!="function"&&typeof U!="symbol":Xe(t,a,C,U,o,I));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)U=s[we],s.hasOwnProperty(we)&&U!=null&&!o.hasOwnProperty(we)&&Xe(t,a,we,null,o,U);for(L in o)if(U=o[L],I=s[L],o.hasOwnProperty(L)&&U!==I&&(U!=null||I!=null))switch(L){case"children":case"dangerouslySetInnerHTML":if(U!=null)throw Error(r(137,a));break;default:Xe(t,a,L,U,o,I)}return;default:if(Zc(a)){for(var Je in s)U=s[Je],s.hasOwnProperty(Je)&&U!==void 0&&!o.hasOwnProperty(Je)&&Rd(t,a,Je,void 0,o,U);for(P in o)U=o[P],I=s[P],!o.hasOwnProperty(P)||U===I||U===void 0&&I===void 0||Rd(t,a,P,U,o,I);return}}for(var D in s)U=s[D],s.hasOwnProperty(D)&&U!=null&&!o.hasOwnProperty(D)&&Xe(t,a,D,null,o,U);for(Y in o)U=o[Y],I=s[Y],!o.hasOwnProperty(Y)||U===I||U==null&&I==null||Xe(t,a,Y,U,o,I)}function sy(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Kx(){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,w=u.duration;if(p&&w&&sy(y)){for(y=0,w=u.responseEnd,o+=1;o<s.length;o++){var C=s[o],L=C.startTime;if(L>w)break;var P=C.transferSize,Y=C.initiatorType;P&&sy(Y)&&(C=C.responseEnd,y+=P*(C<w?1:(w-L)/(C-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 Md=null,Bd=null;function Al(t){return t.nodeType===9?t:t.ownerDocument}function ry(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 oy(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 Ld(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 qd=null;function Zx(){var t=window.event;return t&&t.type==="popstate"?t===qd?!1:(qd=t,!0):(qd=null,!1)}var ly=typeof setTimeout=="function"?setTimeout:void 0,Yx=typeof clearTimeout=="function"?clearTimeout:void 0,cy=typeof Promise=="function"?Promise:void 0,Xx=typeof queueMicrotask=="function"?queueMicrotask:typeof cy<"u"?function(t){return cy.resolve(null).then(t).catch(Jx)}:ly;function Jx(t){setTimeout(function(){throw t})}function qa(t){return t==="head"}function uy(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),As(a);return}o--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")o++;else if(s==="html")Gr(t.ownerDocument.documentElement);else if(s==="head"){s=t.ownerDocument.head,Gr(s);for(var p=s.firstChild;p;){var y=p.nextSibling,w=p.nodeName;p[lr]||w==="SCRIPT"||w==="STYLE"||w==="LINK"&&p.rel.toLowerCase()==="stylesheet"||s.removeChild(p),p=y}}else s==="body"&&Gr(t.ownerDocument.body);s=u}while(s);As(a)}function dy(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 Ud(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":Ud(s),Gc(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}t.removeChild(s)}}function Fx(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[lr])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=Sn(t.nextSibling),t===null)break}return null}function Wx(t,a,s){if(a==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!s||(t=Sn(t.nextSibling),t===null))return null;return t}function fy(t,a){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!a||(t=Sn(t.nextSibling),t===null))return null;return t}function $d(t){return t.data==="$?"||t.data==="$~"}function Id(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function ew(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 Sn(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 Vd=null;function py(t){t=t.nextSibling;for(var a=0;t;){if(t.nodeType===8){var s=t.data;if(s==="/$"||s==="/&"){if(a===0)return Sn(t.nextSibling);a--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||a++}t=t.nextSibling}return null}function my(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 hy(t,a,s){switch(a=Al(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 Gr(t){for(var a=t.attributes;a.length;)t.removeAttributeNode(a[0]);Gc(t)}var xn=new Map,gy=new Set;function _l(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var fa=W.d;W.d={f:tw,r:nw,D:aw,C:iw,L:sw,m:rw,X:lw,S:ow,M:cw};function tw(){var t=fa.f(),a=bl();return t||a}function nw(t){var a=Hi(t);a!==null&&a.tag===5&&a.type==="form"?Dh(a):fa.r(t)}var js=typeof document>"u"?null:document;function yy(t,a,s){var o=js;if(o&&typeof a=="string"&&a){var u=pn(a);u='link[rel="'+t+'"][href="'+u+'"]',typeof s=="string"&&(u+='[crossorigin="'+s+'"]'),gy.has(u)||(gy.add(u),t={rel:t,crossOrigin:s,href:a},o.querySelector(u)===null&&(a=o.createElement("link"),Lt(a,"link",t),zt(a),o.head.appendChild(a)))}}function aw(t){fa.D(t),yy("dns-prefetch",t,null)}function iw(t,a){fa.C(t,a),yy("preconnect",t,a)}function sw(t,a,s){fa.L(t,a,s);var o=js;if(o&&t&&a){var u='link[rel="preload"][as="'+pn(a)+'"]';a==="image"&&s&&s.imageSrcSet?(u+='[imagesrcset="'+pn(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(u+='[imagesizes="'+pn(s.imageSizes)+'"]')):u+='[href="'+pn(t)+'"]';var p=u;switch(a){case"style":p=Ns(t);break;case"script":p=ks(t)}xn.has(p)||(t=x({rel:"preload",href:a==="image"&&s&&s.imageSrcSet?void 0:t,as:a},s),xn.set(p,t),o.querySelector(u)!==null||a==="style"&&o.querySelector(Hr(p))||a==="script"&&o.querySelector(Qr(p))||(a=o.createElement("link"),Lt(a,"link",t),zt(a),o.head.appendChild(a)))}}function rw(t,a){fa.m(t,a);var s=js;if(s&&t){var o=a&&typeof a.as=="string"?a.as:"script",u='link[rel="modulepreload"][as="'+pn(o)+'"][href="'+pn(t)+'"]',p=u;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":p=ks(t)}if(!xn.has(p)&&(t=x({rel:"modulepreload",href:t},a),xn.set(p,t),s.querySelector(u)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(Qr(p)))return}o=s.createElement("link"),Lt(o,"link",t),zt(o),s.head.appendChild(o)}}}function ow(t,a,s){fa.S(t,a,s);var o=js;if(o&&t){var u=Qi(o).hoistableStyles,p=Ns(t);a=a||"default";var y=u.get(p);if(!y){var w={loading:0,preload:null};if(y=o.querySelector(Hr(p)))w.loading=5;else{t=x({rel:"stylesheet",href:t,"data-precedence":a},s),(s=xn.get(p))&&Pd(t,s);var C=y=o.createElement("link");zt(C),Lt(C,"link",t),C._p=new Promise(function(L,P){C.onload=L,C.onerror=P}),C.addEventListener("load",function(){w.loading|=1}),C.addEventListener("error",function(){w.loading|=2}),w.loading|=4,Cl(y,a,o)}y={type:"stylesheet",instance:y,count:1,state:w},u.set(p,y)}}}function lw(t,a){fa.X(t,a);var s=js;if(s&&t){var o=Qi(s).hoistableScripts,u=ks(t),p=o.get(u);p||(p=s.querySelector(Qr(u)),p||(t=x({src:t,async:!0},a),(a=xn.get(u))&&Gd(t,a),p=s.createElement("script"),zt(p),Lt(p,"link",t),s.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},o.set(u,p))}}function cw(t,a){fa.M(t,a);var s=js;if(s&&t){var o=Qi(s).hoistableScripts,u=ks(t),p=o.get(u);p||(p=s.querySelector(Qr(u)),p||(t=x({src:t,async:!0,type:"module"},a),(a=xn.get(u))&&Gd(t,a),p=s.createElement("script"),zt(p),Lt(p,"link",t),s.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},o.set(u,p))}}function by(t,a,s,o){var u=(u=ne.current)?_l(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=Ns(s.href),s=Qi(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=Ns(s.href);var p=Qi(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(Hr(t)))&&!p._p&&(y.instance=p,y.state.loading=5),xn.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},xn.set(t,s),p||uw(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=ks(s),s=Qi(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 Ns(t){return'href="'+pn(t)+'"'}function Hr(t){return'link[rel="stylesheet"]['+t+"]"}function vy(t){return x({},t,{"data-precedence":t.precedence,precedence:null})}function uw(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}),Lt(a,"link",s),zt(a),t.head.appendChild(a))}function ks(t){return'[src="'+pn(t)+'"]'}function Qr(t){return"script[async]"+t}function Sy(t,a,s){if(a.count++,a.instance===null)switch(a.type){case"style":var o=t.querySelector('style[data-href~="'+pn(s.href)+'"]');if(o)return a.instance=o,zt(o),o;var u=x({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return o=(t.ownerDocument||t).createElement("style"),zt(o),Lt(o,"style",u),Cl(o,s.precedence,t),a.instance=o;case"stylesheet":u=Ns(s.href);var p=t.querySelector(Hr(u));if(p)return a.state.loading|=4,a.instance=p,zt(p),p;o=vy(s),(u=xn.get(u))&&Pd(o,u),p=(t.ownerDocument||t).createElement("link"),zt(p);var y=p;return y._p=new Promise(function(w,C){y.onload=w,y.onerror=C}),Lt(p,"link",o),a.state.loading|=4,Cl(p,s.precedence,t),a.instance=p;case"script":return p=ks(s.src),(u=t.querySelector(Qr(p)))?(a.instance=u,zt(u),u):(o=s,(u=xn.get(p))&&(o=x({},s),Gd(o,u)),t=t.ownerDocument||t,u=t.createElement("script"),zt(u),Lt(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,Cl(o,s.precedence,t));return a.instance}function Cl(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 w=o[y];if(w.dataset.precedence===a)p=w;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 Pd(t,a){t.crossOrigin==null&&(t.crossOrigin=a.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=a.referrerPolicy),t.title==null&&(t.title=a.title)}function Gd(t,a){t.crossOrigin==null&&(t.crossOrigin=a.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=a.referrerPolicy),t.integrity==null&&(t.integrity=a.integrity)}var zl=null;function xy(t,a,s){if(zl===null){var o=new Map,u=zl=new Map;u.set(s,o)}else u=zl,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[lr]||p[Dt]||t==="link"&&p.getAttribute("rel")==="stylesheet")&&p.namespaceURI!=="http://www.w3.org/2000/svg"){var y=p.getAttribute(a)||"";y=t+y;var w=o.get(y);w?w.push(p):o.set(y,[p])}}return o}function wy(t,a,s){t=t.ownerDocument||t,t.head.insertBefore(s,a==="title"?t.querySelector("head > title"):null)}function dw(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 jy(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function fw(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=Ns(o.href),p=a.querySelector(Hr(u));if(p){a=p._p,a!==null&&typeof a=="object"&&typeof a.then=="function"&&(t.count++,t=Tl.bind(t),a.then(t,t)),s.state.loading|=4,s.instance=p,zt(p);return}p=a.ownerDocument||a,o=vy(o),(u=xn.get(u))&&Pd(o,u),p=p.createElement("link"),zt(p);var y=p;y._p=new Promise(function(w,C){y.onload=w,y.onerror=C}),Lt(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=Tl.bind(t),a.addEventListener("load",s),a.addEventListener("error",s))}}var Hd=0;function pw(t,a){return t.stylesheets&&t.count===0&&Ol(t,t.stylesheets),0<t.count||0<t.imgCount?function(s){var o=setTimeout(function(){if(t.stylesheets&&Ol(t,t.stylesheets),t.unsuspend){var p=t.unsuspend;t.unsuspend=null,p()}},6e4+a);0<t.imgBytes&&Hd===0&&(Hd=62500*Kx());var u=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&Ol(t,t.stylesheets),t.unsuspend)){var p=t.unsuspend;t.unsuspend=null,p()}},(t.imgBytes>Hd?50:800)+a);return t.unsuspend=s,function(){t.unsuspend=null,clearTimeout(o),clearTimeout(u)}}:null}function Tl(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ol(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var El=null;function Ol(t,a){t.stylesheets=null,t.unsuspend!==null&&(t.count++,El=new Map,a.forEach(mw,t),El=null,Tl.call(t))}function mw(t,a){if(!(a.state.loading&4)){var s=El.get(t);if(s)var o=s.get(null);else{s=new Map,El.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=Tl.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 Kr={$$typeof:G,Provider:null,Consumer:null,_currentValue:fe,_currentValue2:fe,_threadCount:0};function hw(t,a,s,o,u,p,y,w,C){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=te(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=te(0),this.hiddenUpdates=te(null),this.identifierPrefix=o,this.onUncaughtError=u,this.onCaughtError=p,this.onRecoverableError=y,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=C,this.incompleteTransitions=new Map}function Ny(t,a,s,o,u,p,y,w,C,L,P,Y){return t=new hw(t,a,s,y,C,L,P,Y,w),a=1,p===!0&&(a|=24),p=sn(3,null,null,a),t.current=p,p.stateNode=t,a=Nu(),a.refCount++,t.pooledCache=a,a.refCount++,p.memoizedState={element:o,isDehydrated:s,cache:a},Cu(p),t}function ky(t){return t?(t=ns,t):ns}function Ay(t,a,s,o,u,p){u=ky(u),o.context===null?o.context=u:o.pendingContext=u,o=_a(a),o.payload={element:s},p=p===void 0?null:p,p!==null&&(o.callback=p),s=Ca(t,o,a),s!==null&&(Wt(s,t,a),kr(s,t,a))}function _y(t,a){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var s=t.retryLane;t.retryLane=s!==0&&s<a?s:a}}function Qd(t,a){_y(t,a),(t=t.alternate)&&_y(t,a)}function Cy(t){if(t.tag===13||t.tag===31){var a=li(t,67108864);a!==null&&Wt(a,t,67108864),Qd(t,67108864)}}function zy(t){if(t.tag===13||t.tag===31){var a=un();a=or(a);var s=li(t,a);s!==null&&Wt(s,t,a),Qd(t,a)}}var Dl=!0;function gw(t,a,s,o){var u=$.T;$.T=null;var p=W.p;try{W.p=2,Kd(t,a,s,o)}finally{W.p=p,$.T=u}}function yw(t,a,s,o){var u=$.T;$.T=null;var p=W.p;try{W.p=8,Kd(t,a,s,o)}finally{W.p=p,$.T=u}}function Kd(t,a,s,o){if(Dl){var u=Zd(o);if(u===null)Dd(t,a,o,Rl,s),Ey(t,o);else if(vw(u,t,a,s,o))o.stopPropagation();else if(Ey(t,o),a&4&&-1<bw.indexOf(t)){for(;u!==null;){var p=Hi(u);if(p!==null)switch(p.tag){case 3:if(p=p.stateNode,p.current.memoizedState.isDehydrated){var y=Kn(p.pendingLanes);if(y!==0){var w=p;for(w.pendingLanes|=2,w.entangledLanes|=2;y;){var C=1<<31-ht(y);w.entanglements[1]|=C,y&=~C}Pn(p),(Pe&6)===0&&(gl=Ut()+500,Ir(0))}}break;case 31:case 13:w=li(p,2),w!==null&&Wt(w,p,2),bl(),Qd(p,2)}if(p=Zd(o),p===null&&Dd(t,a,o,Rl,s),p===u)break;u=p}u!==null&&o.stopPropagation()}else Dd(t,a,o,null,s)}}function Zd(t){return t=Xc(t),Yd(t)}var Rl=null;function Yd(t){if(Rl=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=h(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 Rl=t,null}function Ty(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(wo()){case ir:return 2;case jo:return 8;case Li:case Ic:return 32;case qi:return 268435456;default:return 32}default:return 32}}var Xd=!1,Ua=null,$a=null,Ia=null,Zr=new Map,Yr=new Map,Va=[],bw="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 Ey(t,a){switch(t){case"focusin":case"focusout":Ua=null;break;case"dragenter":case"dragleave":$a=null;break;case"mouseover":case"mouseout":Ia=null;break;case"pointerover":case"pointerout":Zr.delete(a.pointerId);break;case"gotpointercapture":case"lostpointercapture":Yr.delete(a.pointerId)}}function Xr(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=Hi(a),a!==null&&Cy(a)),t):(t.eventSystemFlags|=o,a=t.targetContainers,u!==null&&a.indexOf(u)===-1&&a.push(u),t)}function vw(t,a,s,o,u){switch(a){case"focusin":return Ua=Xr(Ua,t,a,s,o,u),!0;case"dragenter":return $a=Xr($a,t,a,s,o,u),!0;case"mouseover":return Ia=Xr(Ia,t,a,s,o,u),!0;case"pointerover":var p=u.pointerId;return Zr.set(p,Xr(Zr.get(p)||null,t,a,s,o,u)),!0;case"gotpointercapture":return p=u.pointerId,Yr.set(p,Xr(Yr.get(p)||null,t,a,s,o,u)),!0}return!1}function Oy(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,Qp(t.priority,function(){zy(s)});return}}else if(a===31){if(a=h(s),a!==null){t.blockedOn=a,Qp(t.priority,function(){zy(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 Ml(t){if(t.blockedOn!==null)return!1;for(var a=t.targetContainers;0<a.length;){var s=Zd(t.nativeEvent);if(s===null){s=t.nativeEvent;var o=new s.constructor(s.type,s);Yc=o,s.target.dispatchEvent(o),Yc=null}else return a=Hi(s),a!==null&&Cy(a),t.blockedOn=s,!1;a.shift()}return!0}function Dy(t,a,s){Ml(t)&&s.delete(a)}function Sw(){Xd=!1,Ua!==null&&Ml(Ua)&&(Ua=null),$a!==null&&Ml($a)&&($a=null),Ia!==null&&Ml(Ia)&&(Ia=null),Zr.forEach(Dy),Yr.forEach(Dy)}function Bl(t,a){t.blockedOn===a&&(t.blockedOn=null,Xd||(Xd=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,Sw)))}var Ll=null;function Ry(t){Ll!==t&&(Ll=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Ll===t&&(Ll=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(Yd(o||s)===null)continue;break}var p=Hi(s);p!==null&&(t.splice(a,3),a-=3,Zu(p,{pending:!0,data:u,method:s.method,action:o},o,u))}}))}function As(t){function a(C){return Bl(C,t)}Ua!==null&&Bl(Ua,t),$a!==null&&Bl($a,t),Ia!==null&&Bl(Ia,t),Zr.forEach(a),Yr.forEach(a);for(var s=0;s<Va.length;s++){var o=Va[s];o.blockedOn===t&&(o.blockedOn=null)}for(;0<Va.length&&(s=Va[0],s.blockedOn===null);)Oy(s),s.blockedOn===null&&Va.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[Kt]||null;if(typeof p=="function")y||Ry(s);else if(y){var w=null;if(p&&p.hasAttribute("formAction")){if(u=p,y=p[Kt]||null)w=y.formAction;else if(Yd(u)!==null)continue}else w=y.action;typeof w=="function"?s[o+1]=w:(s.splice(o,3),o-=3),Ry(s)}}}function My(){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 Jd(t){this._internalRoot=t}ql.prototype.render=Jd.prototype.render=function(t){var a=this._internalRoot;if(a===null)throw Error(r(409));var s=a.current,o=un();Ay(s,o,t,a,null,null)},ql.prototype.unmount=Jd.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var a=t.containerInfo;Ay(t.current,2,null,t,null,null),bl(),a[Pi]=null}};function ql(t){this._internalRoot=t}ql.prototype.unstable_scheduleHydration=function(t){if(t){var a=Hp();t={blockedOn:null,target:t,priority:a};for(var s=0;s<Va.length&&a!==0&&a<Va[s].priority;s++);Va.splice(s,0,t),s===0&&Oy(t)}};var By=n.version;if(By!=="19.2.4")throw Error(r(527,By,"19.2.4"));W.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?S(t):null,t=t===null?null:t.stateNode,t};var xw={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:$,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ul=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ul.isDisabled&&Ul.supportsFiber)try{va=Ul.inject(xw),$t=Ul}catch{}}return Jr.createRoot=function(t,a){if(!l(t))throw Error(r(299));var s=!1,o="",u=Ph,p=Gh,y=Hh;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=Ny(t,1,!1,null,null,s,o,null,u,p,y,My),t[Pi]=a.current,Od(t),new Jd(a)},Jr.hydrateRoot=function(t,a,s){if(!l(t))throw Error(r(299));var o=!1,u="",p=Ph,y=Gh,w=Hh,C=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&&(w=s.onRecoverableError),s.formState!==void 0&&(C=s.formState)),a=Ny(t,1,!0,a,s??null,o,u,C,p,y,w,My),a.context=ky(null),s=a.current,o=un(),o=or(o),u=_a(o),u.callback=null,Ca(s,u,o),s=o,a.current.lanes=s,Fe(a,s),Pn(a),t[Pi]=a.current,Od(t),new ql(a)},Jr.version="19.2.4",Jr}var $y;function $w(){if($y)return Fd.exports;$y=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(),Fd.exports=Uw(),Fd.exports}var Iw=$w();const Vw={bodySerializer:e=>JSON.stringify(e,(n,i)=>typeof i=="bigint"?i.toString():i)},Pw=({onRequest:e,onSseError:n,onSseEvent:i,responseTransformer:r,responseValidator:l,sseDefaultRetryDelay:c,sseMaxRetryAttempts:d,sseMaxRetryDelay:h,sseSleepFn:g,url:b,...S})=>{let x;const N=g??(k=>new Promise(E=>setTimeout(E,k)));return{stream:async function*(){let k=c??3e3,E=0;const R=S.signal??new AbortController().signal;for(;!R.aborted;){E++;const V=S.headers instanceof Headers?S.headers:new Headers(S.headers);x!==void 0&&V.set("Last-Event-ID",x);try{const G={redirect:"follow",...S,body:S.serializedBody,headers:V,signal:R};let Z=new Request(b,G);e&&(Z=await e(b,G));const J=await(S.fetch??globalThis.fetch)(Z);if(!J.ok)throw new Error(`SSE failed: ${J.status} ${J.statusText}`);if(!J.body)throw new Error("No body in SSE response");const O=J.body.pipeThrough(new TextDecoderStream).getReader();let M="";const le=()=>{try{O.cancel()}catch{}};R.addEventListener("abort",le);try{for(;;){const{done:Ae,value:Ce}=await O.read();if(Ae)break;M+=Ce;const ve=M.split(`
|
|
11
11
|
|
|
12
12
|
`);M=ve.pop()??"";for(const tt of ve){const oe=tt.split(`
|
|
13
13
|
`),me=[];let $;for(const je of oe)if(je.startsWith("data:"))me.push(je.replace(/^data:\s*/,""));else if(je.startsWith("event:"))$=je.replace(/^event:\s*/,"");else if(je.startsWith("id:"))x=je.replace(/^id:\s*/,"");else if(je.startsWith("retry:")){const se=Number.parseInt(je.replace(/^retry:\s*/,""),10);Number.isNaN(se)||(k=se)}let W,fe=!1;if(me.length){const je=me.join(`
|
|
14
|
-
`);try{W=JSON.parse(je),fe=!0}catch{W=je}}fe&&(l&&await l(W),r&&(W=await r(W))),i?.({data:W,event:$,id:x,retry:k}),me.length&&(yield W)}}}finally{R.removeEventListener("abort",le),O.releaseLock()}break}catch(G){if(n?.(G),d!==void 0&&E>=d)break;const Z=Math.min(k*2**(E-1),h??3e4);await N(Z)}}}()}},Pw=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},Gw=e=>{switch(e){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},Hw=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},yv=({allowReserved:e,explode:n,name:i,style:r,value:l})=>{if(!n){const h=(e?l:l.map(g=>encodeURIComponent(g))).join(Gw(r));switch(r){case"label":return`.${h}`;case"matrix":return`;${i}=${h}`;case"simple":return h;default:return`${i}=${h}`}}const c=Pw(r),d=l.map(h=>r==="label"||r==="simple"?e?h:encodeURIComponent(h):gc({allowReserved:e,name:i,value:h})).join(c);return r==="label"||r==="matrix"?c+d:d},gc=({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)}`},bv=({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(([S,x])=>{g=[...g,S,e?x:encodeURIComponent(x)]});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=Hw(r),h=Object.entries(l).map(([g,b])=>gc({allowReserved:e,name:r==="deepObject"?`${i}[${g}]`:g,value:b})).join(d);return r==="label"||r==="matrix"?d+h:h},Qw=/\{[^{}]+\}/g,Kw=({path:e,url:n})=>{let i=n;const r=n.match(Qw);if(r)for(const l of r){let c=!1,d=l.substring(1,l.length-1),h="simple";d.endsWith("*")&&(c=!0,d=d.substring(0,d.length-1)),d.startsWith(".")?(d=d.substring(1),h="label"):d.startsWith(";")&&(d=d.substring(1),h="matrix");const g=e[d];if(g==null)continue;if(Array.isArray(g)){i=i.replace(l,yv({explode:c,name:d,style:h,value:g}));continue}if(typeof g=="object"){i=i.replace(l,bv({explode:c,name:d,style:h,value:g,valueOnly:!0}));continue}if(h==="matrix"){i=i.replace(l,`;${gc({name:d,value:g})}`);continue}const b=encodeURIComponent(h==="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=Kw({path:n,url:d}));let h=i?r(i):"";return h.startsWith("?")&&(h=h.substring(1)),h&&(d+=`?${h}`),d};function Yw(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 Xw=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},vv=({allowReserved:e,array:n,object:i}={})=>l=>{const c=[];if(l&&typeof l=="object")for(const d in l){const h=l[d];if(h!=null)if(Array.isArray(h)){const g=yv({allowReserved:e,explode:!0,name:d,style:"form",value:h,...n});g&&c.push(g)}else if(typeof h=="object"){const g=bv({allowReserved:e,explode:!0,name:d,style:"deepObject",value:h,...i});g&&c.push(g)}else{const g=gc({allowReserved:e,name:d,value:h});g&&c.push(g)}}return c.join("&")},Jw=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"}},Fw=(e,n)=>n?!!(e.headers.has(n)||e.query?.[n]||e.headers.get("Cookie")?.includes(`${n}=`)):!1,Ww=async({security:e,...n})=>{for(const i of e){if(Fw(n,i.name))continue;const r=await Xw(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}}},Iy=e=>Zw({baseUrl:e.baseUrl,path:e.path,query:e.query,querySerializer:typeof e.querySerializer=="function"?e.querySerializer:vv(e.querySerializer),url:e.url}),Vy=(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},ej=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?ej(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 tf{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 tj=()=>({error:new tf,request:new tf,response:new tf}),nj=vv({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),aj={"Content-Type":"application/json"},xv=(e={})=>({...Iw,headers:aj,parseAs:"auto",querySerializer:nj,...e}),wv=(e={})=>{let n=Vy(xv(),e);const i=()=>({...n}),r=b=>(n=Vy(n,b),i()),l=tj(),c=async b=>{const S={...n,...b,fetch:b.fetch??n.fetch??globalThis.fetch,headers:Sv(n.headers,b.headers),serializedBody:void 0};S.security&&await Ww({...S,security:S.security}),S.requestValidator&&await S.requestValidator(S),S.body!==void 0&&S.bodySerializer&&(S.serializedBody=S.bodySerializer(S.body)),(S.body===void 0||S.serializedBody==="")&&S.headers.delete("Content-Type");const x=Iy(S);return{opts:S,url:x}},d=async b=>{const{opts:S,url:x}=await c(b),N={redirect:"follow",...S,body:Yw(S)};let A=new Request(x,N);for(const X of l.request.fns)X&&(A=await X(A,S));const T=S.fetch;let k=await T(A);for(const X of l.response.fns)X&&(k=await X(k,A,S));const E={request:A,response:k};if(k.ok){const X=(S.parseAs==="auto"?Jw(k.headers.get("Content-Type")):S.parseAs)??"json";if(k.status===204||k.headers.get("Content-Length")==="0"){let O;switch(X){case"arrayBuffer":case"blob":case"text":O=await k[X]();break;case"formData":O=new FormData;break;case"stream":O=k.body;break;default:O={};break}return S.responseStyle==="data"?O:{data:O,...E}}let J;switch(X){case"arrayBuffer":case"blob":case"formData":case"json":case"text":J=await k[X]();break;case"stream":return S.responseStyle==="data"?k.body:{data:k.body,...E}}return X==="json"&&(S.responseValidator&&await S.responseValidator(J),S.responseTransformer&&(J=await S.responseTransformer(J))),S.responseStyle==="data"?J:{data:J,...E}}const R=await k.text();let V;try{V=JSON.parse(R)}catch{}const G=V??R;let Z=G;for(const X of l.error.fns)X&&(Z=await X(G,k,A,S));if(Z=Z||{},S.throwOnError)throw Z;return S.responseStyle==="data"?void 0:{error:Z,...E}},h=b=>S=>d({...S,method:b}),g=b=>async S=>{const{opts:x,url:N}=await c(S);return Vw({...x,body:x.body,headers:x.headers,method:b,onRequest:async(A,T)=>{let k=new Request(A,T);for(const E of l.request.fns)E&&(k=await E(k,x));return k},url:N})};return{buildUrl:Iy,connect:h("CONNECT"),delete:h("DELETE"),get:h("GET"),getConfig:i,head:h("HEAD"),interceptors:l,options:h("OPTIONS"),patch:h("PATCH"),post:h("POST"),put:h("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:h("TRACE")}},K=wv(xv()),ij=e=>(e.client??K).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}",...e}),jv=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}",...e}),sj=e=>(e.client??K).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}",...e,headers:{"Content-Type":"application/json",...e.headers}}),rj=e=>(e?.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects",...e}),oj=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/locations",...e,headers:{"Content-Type":"application/json",...e.headers}}),lj=e=>(e.client??K).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/locations/{label}",...e}),cj=e=>(e.client??K).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/locations/default",...e,headers:{"Content-Type":"application/json",...e.headers}}),uj=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/export",...e}),dj=e=>(e.client??K).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/queries",...e,headers:{"Content-Type":"application/json",...e.headers}}),fj=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/queries",...e}),pj=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/queries",...e,headers:{"Content-Type":"application/json",...e.headers}}),mj=e=>(e.client??K).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/queries",...e,headers:{"Content-Type":"application/json",...e.headers}}),hj=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/queries/generate",...e,headers:{"Content-Type":"application/json",...e.headers}}),gj=e=>(e.client??K).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/competitors",...e,headers:{"Content-Type":"application/json",...e.headers}}),yj=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/competitors",...e}),bj=e=>(e.client??K).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/competitors",...e,headers:{"Content-Type":"application/json",...e.headers}}),vj=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/runs",...e}),Sj=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/runs",...e,headers:{"Content-Type":"application/json",...e.headers}}),xj=e=>(e?.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/runs",...e}),wj=e=>(e?.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/runs",...e,headers:{"Content-Type":"application/json",...e?.headers}}),Nv=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/runs/{id}",...e}),jj=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/apply",...e,headers:{"Content-Type":"application/json",...e.headers}}),Nj=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/timeline",...e}),kj=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/analytics/metrics",...e}),kv=e=>(e?.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/settings",...e}),Aj=e=>(e.client??K).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/settings/providers/{name}",...e,headers:{"Content-Type":"application/json",...e.headers}}),_j=e=>(e.client??K).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/settings/google",...e,headers:{"Content-Type":"application/json",...e.headers}}),Cj=e=>(e.client??K).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/settings/bing",...e,headers:{"Content-Type":"application/json",...e.headers}}),zj=e=>(e.client??K).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/settings/cdp",...e,headers:{"Content-Type":"application/json",...e.headers}}),Tj=e=>(e.client??K).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/schedule",...e}),Ej=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/schedule",...e}),Oj=e=>(e.client??K).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/schedule",...e,headers:{"Content-Type":"application/json",...e.headers}}),Dj=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/notifications",...e}),Rj=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/notifications",...e,headers:{"Content-Type":"application/json",...e.headers}}),Mj=e=>(e.client??K).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/notifications/{id}",...e}),Bj=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/notifications/{id}/test",...e}),Lj=e=>(e?.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/cdp/status",...e}),qj=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/connections",...e}),Uj=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/connect",...e,headers:{"Content-Type":"application/json",...e.headers}}),$j=e=>(e.client??K).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/connections/{type}",...e}),Ij=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/properties",...e}),Vj=e=>(e.client??K).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/connections/{type}/property",...e,headers:{"Content-Type":"application/json",...e.headers}}),Pj=e=>(e.client??K).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/connections/{type}/sitemap",...e,headers:{"Content-Type":"application/json",...e.headers}}),Gj=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/sync",...e,headers:{"Content-Type":"application/json",...e.headers}}),Hj=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/performance",...e}),Qj=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/performance/daily",...e}),Kj=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/inspect",...e,headers:{"Content-Type":"application/json",...e.headers}}),Zj=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/inspections",...e}),Yj=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/deindexed",...e}),Av=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/coverage",...e}),Xj=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/coverage/history",...e}),Jj=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/sitemaps",...e}),Fj=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/discover-sitemaps",...e}),Wj=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/inspect-sitemap",...e,headers:{"Content-Type":"application/json",...e.headers}}),eN=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/indexing/request",...e,headers:{"Content-Type":"application/json",...e.headers}}),tN=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/gbp/locations",...e}),nN=e=>(e.client??K).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/gbp/locations/{locationName}/selection",...e,headers:{"Content-Type":"application/json",...e.headers}}),aN=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/gbp/sync",...e,headers:{"Content-Type":"application/json",...e.headers}}),iN=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/gbp/keywords",...e}),sN=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/gbp/places",...e}),rN=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/gbp/summary",...e}),oN=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/connect",...e,headers:{"Content-Type":"application/json",...e.headers}}),lN=e=>(e.client??K).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/disconnect",...e}),cN=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/status",...e}),uN=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/sites",...e}),dN=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/set-site",...e,headers:{"Content-Type":"application/json",...e.headers}}),_v=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/coverage",...e}),fN=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/inspections",...e}),pN=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/inspect-url",...e,headers:{"Content-Type":"application/json",...e.headers}}),mN=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/inspect-sitemap",...e,headers:{"Content-Type":"application/json",...e.headers}}),hN=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/request-indexing",...e,headers:{"Content-Type":"application/json",...e.headers}}),gN=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/performance",...e}),yN=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/ga/connect",...e,headers:{"Content-Type":"application/json",...e.headers}}),bN=e=>(e.client??K).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/ga/disconnect",...e}),vN=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/ga/status",...e}),SN=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/ga/sync",...e,headers:{"Content-Type":"application/json",...e.headers}}),xN=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/ga/traffic",...e}),wN=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/ga/ai-referral-history",...e}),jN=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/ga/social-referral-history",...e}),NN=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/ga/session-history",...e}),kN=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/insights",...e}),AN=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/report",...e}),_N=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/citations/visibility",...e}),CN=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/content/dismissals",...e,headers:{"Content-Type":"application/json",...e.headers}}),zN=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/overview",...e}),TN=e=>(e?.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/backlinks/status",...e}),EN=e=>(e?.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/backlinks/install",...e}),ON=e=>(e?.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/backlinks/syncs",...e}),DN=e=>(e?.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/backlinks/syncs",...e,headers:{"Content-Type":"application/json",...e?.headers}}),RN=e=>(e?.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/backlinks/syncs/latest",...e}),MN=e=>(e?.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/backlinks/releases",...e}),BN=e=>(e?.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/backlinks/latest-release",...e}),LN=e=>(e.client??K).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/backlinks/cache/{release}",...e}),qN=e=>(e.client??K).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??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/backlinks/summary",...e}),$N=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/backlinks/domains",...e}),IN=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/backlinks/history",...e}),VN=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/backlinks/sources",...e}),PN=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/backlinks/bing-sync",...e}),GN=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/traffic/connect/cloud-run",...e,headers:{"Content-Type":"application/json",...e.headers}}),HN=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/traffic/connect/wordpress",...e,headers:{"Content-Type":"application/json",...e.headers}}),QN=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/traffic/connect/vercel",...e,headers:{"Content-Type":"application/json",...e.headers}}),KN=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/traffic/sources/{id}/sync",...e,headers:{"Content-Type":"application/json",...e.headers}}),ZN=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/traffic/sources/{id}/backfill",...e,headers:{"Content-Type":"application/json",...e.headers}}),YN=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/traffic/sources",...e}),XN=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/traffic/status",...e}),JN=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/traffic/sources/{id}",...e}),FN=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/traffic/events",...e}),WN=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/discover/run",...e,headers:{"Content-Type":"application/json",...e.headers}}),ek=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/discover/sessions",...e}),tk=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/discover/sessions/{id}",...e}),nk=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/discover/sessions/{id}/promote",...e}),ak=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/discover/sessions/{id}/promote",...e,headers:{"Content-Type":"application/json",...e.headers}}),ik=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/technical-aeo",...e}),sk=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/technical-aeo/pages",...e}),rk=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/technical-aeo/trend",...e}),ok=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/technical-aeo/runs",...e,headers:{"Content-Type":"application/json",...e.headers}}),lk=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/agent/providers",...e});function ck(e){const n={baseUrl:e.baseUrl,fetch:e.fetch,headers:{...e.headers??{}}};return wv(n)}class Gn extends Error{code;statusCode;details;constructor(n,i,r,l){super(n),this.name="ApiError",this.code=r??"UNKNOWN",this.statusCode=i,this.details=l}}function uk(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,"")+"/api/v1":"/api/v1"}const Cv=uk();function dk(){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 fk(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,""):""}function pk(e){return`${fk()}${e}`}function mk(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 hk(){return""}function nf(){return!!hk()}let zv=null;function Py(e){zv=e}function Gf(){zv?.()}const ae=ck({baseUrl:dk()});ae.interceptors.response.use((e,n)=>(e.status===401&&!n.url.includes("/api/v1/session")&&Gf(),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,c;if(typeof n.error=="object"&&n.error!==null){const d=n.error.error;if(typeof d=="string")r=d;else if(d&&typeof d=="object"){const h=d;h.message&&(r=h.message),h.code&&(l=h.code),h.details&&(c=h.details)}else{const h=n.error;h.message&&(r=h.message),h.code&&(l=h.code),h.details&&(c=h.details)}}else typeof n.error=="string"&&(r=n.error);throw new Gn(r,i,l,c)}if(n.response.status!==204)return n.data}async function Hf(e,n){const i=n?.body!=null,r=await fetch(`${Cv}${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,h;if(l)try{const g=JSON.parse(l);typeof g.error=="string"?c=g.error:g.error?.message?(c=g.error.message,d=g.error.code,h=g.error.details):g.message&&(c=g.message)}catch{c=l}throw r.status===401&&!e.startsWith("/session")&&Gf(),new Gn(c,r.status,d,h)}if(r.status!==204)return r.json()}function Qf(e){return ce(()=>jv({client:ae,path:{name:e}}))}function F5(e){return ce(()=>vj({client:ae,path:{name:e}}))}function nc(e){return ce(()=>Nv({client:ae,path:{id:e}}))}function gk(e){return ce(()=>fj({client:ae,path:{name:e}}))}function yk(e){return ce(()=>yj({client:ae,path:{name:e}}))}function bk(e,n){return ce(()=>Nj({client:ae,path:{name:e},query:{location:n}}))}function Tv(e,n){return ce(()=>zN({client:ae,path:{name:e},query:{location:n?.location,since:n?.since}}))}function ho(e,n){return ce(()=>sj({client:ae,path:{name:e},body:n}))}function vk(e,n){return ce(()=>mj({client:ae,path:{name:e},body:{queries:n}}))}function Sk(e,n){return ce(()=>pj({client:ae,path:{name:e},body:{queries:n}}))}function W5(e,n){return ce(()=>dj({client:ae,path:{name:e},body:{queries:n}}))}function xk(e,n){return ce(()=>CN({client:ae,path:{name:e},body:n}))}function wk(e,n){return ce(()=>bj({client:ae,path:{name:e},body:{competitors:n}}))}function eB(e,n){return ce(()=>gj({client:ae,path:{name:e},body:{competitors:n}}))}async function tB(e,n){const i=await Qf(e);return ho(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 nB(e,n){const i=await Qf(e);return ho(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 aB(e,n){const i=await Qf(e);return ho(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 jk(e,n){const i={};return n?.location&&(i.location=n.location),n?.allLocations&&(i.allLocations=!0),n?.noLocation&&(i.noLocation=!0),ce(()=>Sj({client:ae,path:{name:e},body:i}))}function iB(e,n){return ce(()=>oj({client:ae,path:{name:e},body:n}))}async function sB(e,n){await ce(()=>lj({client:ae,path:{name:e,label:n}}))}function rB(e,n){return ce(()=>cj({client:ae,path:{name:e},body:{label:n}}))}async function oB(e){await ce(()=>ij({client:ae,path:{name:e}}))}function lB(e){return ce(()=>uj({client:ae,path:{name:e}}))}function cB(){return ce(()=>kv({client:ae}))}function Gy(){return Hf("/session")}function Nk(e){return Hf("/session/setup",{method:"POST",body:JSON.stringify({password:e})})}function kk(e){return Hf("/session",{method:"POST",body:JSON.stringify({password:e})})}function Ak(e,n){return ce(()=>Aj({client:ae,path:{name:e},body:n}))}function uB(e){return ce(()=>_j({client:ae,body:e}))}async function dB(e){try{return await ce(()=>Ej({client:ae,path:{name:e}}))}catch(n){if(n instanceof Gn&&n.statusCode===404)return null;throw n}}function fB(e,n){return ce(()=>Oj({client:ae,path:{name:e},body:n}))}async function pB(e){await ce(()=>Tj({client:ae,path:{name:e}}))}function mB(e){return ce(()=>Dj({client:ae,path:{name:e}}))}function hB(e,n){return ce(()=>Rj({client:ae,path:{name:e},body:n}))}async function gB(e,n){await ce(()=>Mj({client:ae,path:{name:e,id:n}}))}function yB(e,n){return ce(()=>Bj({client:ae,path:{name:e,id:n}}))}function _k(e,n,i){return ce(()=>hj({client:ae,path:{name:e},body:{provider:n,count:i}}))}function Ck(e){return ce(()=>jj({client:ae,body:e}))}function zk(e){return ce(()=>wj({client:ae,body:e??{}}))}function bB(e,n){return ce(()=>Uj({client:ae,path:{name:e},body:{type:n}}))}function vB(e,n){return ce(()=>$j({client:ae,path:{name:e,type:n}}))}function SB(e,n,i){return ce(()=>Vj({client:ae,path:{name:e,type:n},body:{propertyId:i}}))}function xB(e,n,i){return ce(()=>Pj({client:ae,path:{name:e,type:n},body:{sitemapUrl:i}}))}function Tk(e,n){return ce(()=>Gj({client:ae,path:{name:e},body:n??{}}))}function wB(e,n){const i={};return n&&n!=="all"&&(i.window=n),ce(()=>kj({client:ae,path:{name:e},query:i}))}function jB(e,n){return ce(()=>Kj({client:ae,path:{name:e},body:{url:n}}))}function Ek(e){return ce(()=>Av({client:ae,path:{name:e}}))}function Ok(e,n){return ce(()=>Wj({client:ae,path:{name:e},body:n??{}}))}function NB(e){return ce(()=>Jj({client:ae,path:{name:e}}))}function Dk(e){return ce(()=>Fj({client:ae,path:{name:e}}))}function kB(e,n){return ce(()=>ok({client:ae,path:{name:e},body:{}}))}function AB(e,n){return ce(()=>WN({client:ae,path:{name:e},body:n??{}}))}function _B(e,n,i){return ce(()=>ak({client:ae,path:{name:e,id:n},body:i??{}}))}function CB(){return ce(()=>Lj({client:ae}))}function zB(e,n){return ce(()=>zj({client:ae,body:{host:e,port:n}}))}function TB(e,n){return ce(()=>eN({client:ae,path:{name:e},body:n}))}function EB(e,n){return ce(()=>oN({client:ae,path:{name:e},body:{apiKey:n}}))}function OB(e){return ce(()=>lN({client:ae,path:{name:e}}))}function DB(e,n){return ce(()=>dN({client:ae,path:{name:e},body:{siteUrl:n}}))}function Rk(e){return ce(()=>_v({client:ae,path:{name:e}}))}function RB(e,n){return ce(()=>pN({client:ae,path:{name:e},body:{url:n}}))}function MB(e,n){return ce(()=>mN({client:ae,path:{name:e},body:{}}))}function BB(e,n){return ce(()=>hN({client:ae,path:{name:e},body:n}))}function LB(e){return ce(()=>Cj({client:ae,body:{apiKey:e}}))}function Mk(e){return e?/filename\s*=\s*"?([^";]+)"?/i.exec(e)?.[1]??null:null}async function qB(e,n="agency"){const i=new URLSearchParams({audience:n}),r=await fetch(`${Cv}/projects/${encodeURIComponent(e)}/report.html?${i.toString()}`,{credentials:"same-origin",headers:{}});if(!r.ok)throw new Gn(`Failed to download report: ${r.status}`,r.status);const l=await r.blob(),c=URL.createObjectURL(l),d=Mk(r.headers.get("Content-Disposition"))??`canonry-report-${e}.html`,h=document.createElement("a");h.href=c,h.download=d,document.body.appendChild(h),h.click(),document.body.removeChild(h),URL.revokeObjectURL(c)}function UB(e,n){return ce(()=>SN({client:ae,path:{name:e},body:{}}))}function $B(e,n){return ce(()=>yN({client:ae,path:{name:e},body:n}))}function IB(e){return ce(()=>bN({client:ae,path:{name:e}}))}function VB(e,n){return ce(()=>GN({client:ae,path:{name:e},body:n}))}function PB(e,n){return ce(()=>HN({client:ae,path:{name:e},body:n}))}function GB(e,n){return ce(()=>QN({client:ae,path:{name:e},body:n}))}function HB(e,n,i){return ce(()=>KN({client:ae,path:{name:e,id:n},body:i??{}}))}function QB(e,n,i){return ce(()=>ZN({client:ae,path:{name:e,id:n},body:{}}))}function Bk(e,n){return ce(()=>kN({client:ae,path:{name:e},query:{runId:n}}))}function Lk(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 qk(e,n){const i=pk(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:mk(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,h=typeof l.lastHeartbeatAt=="string"?l.lastHeartbeatAt:void 0,g=Lk(l.updateAvailable),b=[c,d===!1?"database not configured":"database configured",h?`heartbeat ${h}`:void 0].filter(Boolean).join(" · ");return{label:n,state:"ok",detail:b,version:c,databaseConfigured:d,lastHeartbeatAt:h,...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 KB(){return ce(()=>TN({client:ae}))}function ZB(){return ce(()=>EN({client:ae}))}function YB(){return ce(()=>RN({client:ae}))}function XB(){return ce(()=>ON({client:ae}))}function JB(e){return ce(()=>DN({client:ae,body:e?{release:e}:{}}))}function FB(){return ce(()=>MN({client:ae}))}function WB(){return ce(()=>BN({client:ae}))}function eL(e){return ce(()=>LN({client:ae,path:{release:e}}))}function tL(e,n={}){return ce(()=>UN({client:ae,path:{name:e},query:{release:n.release,excludeCrawlers:n.excludeCrawlers?"1":void 0,source:n.source}}))}function nL(e,n={}){return ce(()=>$N({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,source:n.source}}))}function aL(e,n={}){return ce(()=>IN({client:ae,path:{name:e},query:{source:n.source}}))}function iL(e,n={}){return ce(()=>VN({client:ae,path:{name:e},query:{excludeCrawlers:n.excludeCrawlers?"1":void 0}}))}function sL(e,n){return ce(()=>qN({client:ae,path:{name:e},body:{release:void 0}}))}function rL(e){return ce(()=>PN({client:ae,path:{name:e}}))}function wn(e){return(...n)=>{e(...n)}}const Uk=6e3,$k=5,Ik=180;let It=[],Vk=0;const bf=new Set,vf=new Map,Sf=new Map;function ac(){const e=[...It];for(const n of bf)n(e)}function Kf(e){const n=vf.get(e);n&&(clearTimeout(n),vf.delete(e));const i=Sf.get(e);i&&(clearTimeout(i),Sf.delete(e))}function Ev(e){Kf(e);const n=It.length;It=It.filter(i=>i.id!==e),It.length!==n&&ac()}function Hy(e){Kf(e.id),vf.set(e.id,setTimeout(()=>{xf(e.id)},e.durationMs))}function Pk(e,n,i){return typeof e=="string"?{title:e,tone:n,durationMs:i}:e}function en(e,n="negative",i=Uk){const r=Pk(e,n,i),l={id:String(++Vk),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=It.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 It=It.map(h=>h.id===c.id?d:h),ac(),Hy(d),c.id}}return It.length>=$k&&Ev(It[0].id),It=[...It,l],ac(),Hy(l),l.id}function xf(e){const n=It.find(i=>i.id===e);!n||n.state==="closing"||(Kf(e),It=It.map(i=>i.id===e?{...i,state:"closing"}:i),ac(),Sf.set(e,setTimeout(()=>{Ev(e)},Ik)))}function Gk(e){return bf.add(e),()=>{bf.delete(e)}}function Qy(){return It}const Hk=5*6e4,wf=30*6e4,oL=3e4,lL=6e4,lo=3e4,Qk=2e3,Kk=5e3;function Zk(){return new Nw({defaultOptions:{queries:{staleTime:Hk,retry:1,refetchOnWindowFocus:!1}},mutationCache:new kw({onError:(e,n,i,r)=>{r.meta?.skipGlobalErrorToast||en({title:e instanceof Error?e.message:"An unexpected error occurred",tone:"negative"})}})})}const Yk="modulepreload",Xk=function(e,n){return new URL(e,n).href},Ky={},Hs=function(n,i,r){let l=Promise.resolve();if(i&&i.length>0){let b=function(S){return Promise.all(S.map(x=>Promise.resolve(x).then(N=>({status:"fulfilled",value:N}),N=>({status:"rejected",reason:N}))))};const d=document.getElementsByTagName("link"),h=document.querySelector("meta[property=csp-nonce]"),g=h?.nonce||h?.getAttribute("nonce");l=b(i.map(S=>{if(S=Xk(S,r),S in Ky)return;Ky[S]=!0;const x=S.endsWith(".css"),N=x?'[rel="stylesheet"]':"";if(r)for(let T=d.length-1;T>=0;T--){const k=d[T];if(k.href===S&&(!x||k.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${S}"]${N}`))return;const A=document.createElement("link");if(A.rel=x?"stylesheet":Yk,x||(A.as="script"),A.crossOrigin="",A.href=S,g&&A.setAttribute("nonce",g),document.head.appendChild(A),x)return new Promise((T,k)=>{A.addEventListener("load",T),A.addEventListener("error",()=>k(new Error(`Unable to preload CSS for ${S}`)))})}))}function c(d){const h=new Event("vite:preloadError",{cancelable:!0});if(h.payload=d,window.dispatchEvent(h),!h.defaultPrevented)throw d}return l.then(d=>{for(const h of d||[])h.status==="rejected"&&c(h.reason);return n().catch(c)})};const Jk=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Fk=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,i,r)=>r?r.toUpperCase():i.toLowerCase()),Zy=e=>{const n=Fk(e);return n.charAt(0).toUpperCase()+n.slice(1)},Ov=(...e)=>e.filter((n,i,r)=>!!n&&n.trim()!==""&&r.indexOf(n)===i).join(" ").trim(),Wk=e=>{for(const n in e)if(n.startsWith("aria-")||n==="role"||n==="title")return!0};var eA={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 tA=q.forwardRef(({color:e="currentColor",size:n=24,strokeWidth:i=2,absoluteStrokeWidth:r,className:l="",children:c,iconNode:d,...h},g)=>q.createElement("svg",{ref:g,...eA,width:n,height:n,stroke:e,strokeWidth:r?Number(i)*24/Number(n):i,className:Ov("lucide",l),...!c&&!Wk(h)&&{"aria-hidden":"true"},...h},[...d.map(([b,S])=>q.createElement(b,S)),...Array.isArray(c)?c:[c]]));const et=(e,n)=>{const i=q.forwardRef(({className:r,...l},c)=>q.createElement(tA,{ref:c,iconNode:n,className:Ov(`lucide-${Jk(Zy(e))}`,`lucide-${e}`,r),...l}));return i.displayName=Zy(e),i};const nA=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],aA=et("arrow-right",nA);const iA=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],sA=et("arrow-up",iA);const rA=[["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"}]],oA=et("book-open",rA);const lA=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Dv=et("check",lA);const cA=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],uA=et("chevron-down",cA);const dA=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Zf=et("chevron-right",dA);const fA=[["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"}]],pA=et("copy",fA);const mA=[["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"}]],hA=et("file-text",mA);const gA=[["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"}]],yA=et("github",gA);const bA=[["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"}]],vA=et("globe",bA);const SA=[["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"}]],xA=et("layout-dashboard",SA);const wA=[["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"}]],jA=et("link-2",wA);const NA=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],kA=et("loader-circle",NA);const AA=[["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"}]],_A=et("maximize-2",AA);const CA=[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]],zA=et("menu",CA);const TA=[["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"}]],EA=et("minimize-2",TA);const OA=[["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"}]],DA=et("play",OA);const RA=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Yy=et("plus",RA);const MA=[["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"}]],BA=et("radar",MA);const LA=[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],Xy=et("radio",LA);const qA=[["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"}]],UA=et("rocket",qA);const $A=[["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"}]],Rv=et("rotate-ccw",$A);const IA=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],VA=et("search",IA);const PA=[["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"}]],GA=et("settings",PA);const HA=[["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"}]],Mv=et("triangle-alert",HA);const QA=[["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"}]],KA=et("wrench",QA);const ZA=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Qs=et("x",ZA);function H(e,n,i){function r(h,g){if(h._zod||Object.defineProperty(h,"_zod",{value:{def:g,constr:d,traits:new Set},enumerable:!1}),h._zod.traits.has(e))return;h._zod.traits.add(e),n(h,g);const b=d.prototype,S=Object.keys(b);for(let x=0;x<S.length;x++){const N=S[x];N in h||(h[N]=b[N].bind(h))}}const l=i?.Parent??Object;class c extends l{}Object.defineProperty(c,"name",{value:e});function d(h){var g;const b=i?.Parent?new c:this;r(b,h),(g=b._zod).deferred??(g.deferred=[]);for(const S of b._zod.deferred)S();return b}return Object.defineProperty(d,"init",{value:r}),Object.defineProperty(d,Symbol.hasInstance,{value:h=>i?.Parent&&h instanceof i.Parent?!0:h?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}class Ms extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Bv extends Error{constructor(n){super(`Encountered unidirectional transform during encode: ${n}`),this.name="ZodEncodeError"}}const Lv={};function Ya(e){return Lv}function qv(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 jf(e,n){return typeof n=="bigint"?n.toString():n}function yc(e){return{get value(){{const n=e();return Object.defineProperty(this,"value",{value:n}),n}}}}function Yf(e){return e==null}function Xf(e){const n=e.startsWith("^")?1:0,i=e.endsWith("$")?e.length-1:e.length;return e.slice(n,i)}function YA(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(".","")),h=Number.parseInt(n.toFixed(c).replace(".",""));return d%h/10**c}const Jy=Symbol("evaluating");function Ge(e,n,i){let r;Object.defineProperty(e,n,{get(){if(r!==Jy)return r===void 0&&(r=Jy,r=i()),r},set(l){Object.defineProperty(e,n,{value:l})},configurable:!0})}function Ti(e,n,i){Object.defineProperty(e,n,{value:i,writable:!0,enumerable:!0,configurable:!0})}function Fa(...e){const n={};for(const i of e){const r=Object.getOwnPropertyDescriptors(i);Object.assign(n,r)}return Object.defineProperties({},n)}function Fy(e){return JSON.stringify(e)}function XA(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Uv="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function co(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const JA=yc(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Us(e){if(co(e)===!1)return!1;const n=e.constructor;if(n===void 0||typeof n!="function")return!0;const i=n.prototype;return!(co(i)===!1||Object.prototype.hasOwnProperty.call(i,"isPrototypeOf")===!1)}function $v(e){return Us(e)?{...e}:Array.isArray(e)?[...e]:e}const FA=new Set(["string","number","symbol"]);function $s(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Wa(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 WA(e){return Object.keys(e).filter(n=>e[n]._zod.optin==="optional"&&e[n]._zod.optout==="optional")}const e2={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 t2(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=Fa(e._zod.def,{get shape(){const d={};for(const h in n){if(!(h in i.shape))throw new Error(`Unrecognized key: "${h}"`);n[h]&&(d[h]=i.shape[h])}return Ti(this,"shape",d),d},checks:[]});return Wa(e,c)}function n2(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=Fa(e._zod.def,{get shape(){const d={...e._zod.def.shape};for(const h in n){if(!(h in i.shape))throw new Error(`Unrecognized key: "${h}"`);n[h]&&delete d[h]}return Ti(this,"shape",d),d},checks:[]});return Wa(e,c)}function a2(e,n){if(!Us(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=Fa(e._zod.def,{get shape(){const c={...e._zod.def.shape,...n};return Ti(this,"shape",c),c}});return Wa(e,l)}function i2(e,n){if(!Us(n))throw new Error("Invalid input to safeExtend: expected a plain object");const i=Fa(e._zod.def,{get shape(){const r={...e._zod.def.shape,...n};return Ti(this,"shape",r),r}});return Wa(e,i)}function s2(e,n){const i=Fa(e._zod.def,{get shape(){const r={...e._zod.def.shape,...n._zod.def.shape};return Ti(this,"shape",r),r},get catchall(){return n._zod.def.catchall},checks:[]});return Wa(e,i)}function r2(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=Fa(n._zod.def,{get shape(){const h=n._zod.def.shape,g={...h};if(i)for(const b in i){if(!(b in h))throw new Error(`Unrecognized key: "${b}"`);i[b]&&(g[b]=e?new e({type:"optional",innerType:h[b]}):h[b])}else for(const b in h)g[b]=e?new e({type:"optional",innerType:h[b]}):h[b];return Ti(this,"shape",g),g},checks:[]});return Wa(n,d)}function o2(e,n,i){const r=Fa(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 Ti(this,"shape",c),c}});return Wa(n,r)}function Ts(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 Es(e,n){return n.map(i=>{var r;return(r=i).path??(r.path=[]),i.path.unshift(e),i})}function $l(e){return typeof e=="string"?e:e?.message}function Xa(e,n,i){const r={...e,path:e.path??[]};if(!e.message){const l=$l(e.inst?._zod.def?.error?.(e))??$l(n?.error?.(e))??$l(i.customError?.(e))??$l(i.localeError?.(e))??"Invalid input";r.message=l}return delete r.inst,delete r.continue,n?.reportInput||delete r.input,r}function Jf(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function uo(...e){const[n,i,r]=e;return typeof n=="string"?{message:n,code:"custom",input:i,inst:r}:{...n}}const Iv=(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,jf,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Vv=H("$ZodError",Iv),Pv=H("$ZodError",Iv,{Parent:Error});function l2(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 c2(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,h=0;for(;h<c.path.length;){const g=c.path[h];h===c.path.length-1?(d[g]=d[g]||{_errors:[]},d[g]._errors.push(n(c))):d[g]=d[g]||{_errors:[]},d=d[g],h++}}};return r(e),i}const Ff=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 Ms;if(d.issues.length){const h=new(l?.Err??e)(d.issues.map(g=>Xa(g,c,Ya())));throw Uv(h,l?.callee),h}return d.value},Wf=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 h=new(l?.Err??e)(d.issues.map(g=>Xa(g,c,Ya())));throw Uv(h,l?.callee),h}return d.value},bc=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 Ms;return c.issues.length?{success:!1,error:new(e??Vv)(c.issues.map(d=>Xa(d,l,Ya())))}:{success:!0,data:c.value}},u2=bc(Pv),vc=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=>Xa(d,l,Ya())))}:{success:!0,data:c.value}},d2=vc(Pv),f2=e=>(n,i,r)=>{const l=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Ff(e)(n,i,l)},p2=e=>(n,i,r)=>Ff(e)(n,i,r),m2=e=>async(n,i,r)=>{const l=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Wf(e)(n,i,l)},h2=e=>async(n,i,r)=>Wf(e)(n,i,r),g2=e=>(n,i,r)=>{const l=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return bc(e)(n,i,l)},y2=e=>(n,i,r)=>bc(e)(n,i,r),b2=e=>async(n,i,r)=>{const l=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return vc(e)(n,i,l)},v2=e=>async(n,i,r)=>vc(e)(n,i,r),S2=/^[cC][^\s-]{8,}$/,x2=/^[0-9a-z]+$/,w2=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,j2=/^[0-9a-vA-V]{20}$/,N2=/^[A-Za-z0-9]{27}$/,k2=/^[a-zA-Z0-9_-]{21}$/,A2=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,_2=/^([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})$/,Wy=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)$/,C2=/^(?!\.)(?!.*\.\.)([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 T2(){return new RegExp(z2,"u")}const E2=/^(?:(?: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])$/,O2=/^(([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}|:))$/,D2=/^((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])$/,R2=/^(([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])$/,M2=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Gv=/^[A-Za-z0-9_-]*$/,B2=/^\+[1-9]\d{6,14}$/,Hv="(?:(?:\\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])))",L2=new RegExp(`^${Hv}$`);function Qv(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 q2(e){return new RegExp(`^${Qv(e)}$`)}function U2(e){const n=Qv({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(`^${Hv}T(?:${r})$`)}const $2=e=>{const n=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${n}$`)},I2=/^-?\d+$/,Kv=/^-?\d+(?:\.\d+)?$/,V2=/^(?:true|false)$/i,P2=/^[^A-Z]*$/,G2=/^[^a-z]*$/,nn=H("$ZodCheck",(e,n)=>{var i;e._zod??(e._zod={}),e._zod.def=n,(i=e._zod).onattach??(i.onattach=[])}),Zv={number:"number",bigint:"bigint",object:"date"},Yv=H("$ZodCheckLessThan",(e,n)=>{nn.init(e,n);const i=Zv[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})}}),Xv=H("$ZodCheckGreaterThan",(e,n)=>{nn.init(e,n);const i=Zv[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})}}),H2=H("$ZodCheckMultipleOf",(e,n)=>{nn.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):YA(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})}}),Q2=H("$ZodCheckNumberFormat",(e,n)=>{nn.init(e,n),n.format=n.format||"float64";const i=n.format?.includes("int"),r=i?"int":"number",[l,c]=e2[n.format];e._zod.onattach.push(d=>{const h=d._zod.bag;h.format=n.format,h.minimum=l,h.maximum=c,i&&(h.pattern=I2)}),e._zod.check=d=>{const h=d.value;if(i){if(!Number.isInteger(h)){d.issues.push({expected:r,format:n.format,code:"invalid_type",continue:!1,input:h,inst:e});return}if(!Number.isSafeInteger(h)){h>0?d.issues.push({input:h,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:h,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}}h<l&&d.issues.push({origin:"number",input:h,code:"too_small",minimum:l,inclusive:!0,inst:e,continue:!n.abort}),h>c&&d.issues.push({origin:"number",input:h,code:"too_big",maximum:c,inclusive:!0,inst:e,continue:!n.abort})}}),K2=H("$ZodCheckMaxLength",(e,n)=>{var i;nn.init(e,n),(i=e._zod.def).when??(i.when=r=>{const l=r.value;return!Yf(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=Jf(l);r.issues.push({origin:d,code:"too_big",maximum:n.maximum,inclusive:!0,input:l,inst:e,continue:!n.abort})}}),Z2=H("$ZodCheckMinLength",(e,n)=>{var i;nn.init(e,n),(i=e._zod.def).when??(i.when=r=>{const l=r.value;return!Yf(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=Jf(l);r.issues.push({origin:d,code:"too_small",minimum:n.minimum,inclusive:!0,input:l,inst:e,continue:!n.abort})}}),Y2=H("$ZodCheckLengthEquals",(e,n)=>{var i;nn.init(e,n),(i=e._zod.def).when??(i.when=r=>{const l=r.value;return!Yf(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=Jf(l),h=c>n.length;r.issues.push({origin:d,...h?{code:"too_big",maximum:n.length}:{code:"too_small",minimum:n.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!n.abort})}}),Sc=H("$ZodCheckStringFormat",(e,n)=>{var i,r;nn.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=()=>{})}),X2=H("$ZodCheckRegex",(e,n)=>{Sc.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})}}),J2=H("$ZodCheckLowerCase",(e,n)=>{n.pattern??(n.pattern=P2),Sc.init(e,n)}),F2=H("$ZodCheckUpperCase",(e,n)=>{n.pattern??(n.pattern=G2),Sc.init(e,n)}),W2=H("$ZodCheckIncludes",(e,n)=>{nn.init(e,n);const i=$s(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})}}),e_=H("$ZodCheckStartsWith",(e,n)=>{nn.init(e,n);const i=new RegExp(`^${$s(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})}}),t_=H("$ZodCheckEndsWith",(e,n)=>{nn.init(e,n);const i=new RegExp(`.*${$s(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})}}),n_=H("$ZodCheckOverwrite",(e,n)=>{nn.init(e,n),e._zod.check=i=>{i.value=n.tx(i.value)}});class a_{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(`
|
|
14
|
+
`);try{W=JSON.parse(je),fe=!0}catch{W=je}}fe&&(l&&await l(W),r&&(W=await r(W))),i?.({data:W,event:$,id:x,retry:k}),me.length&&(yield W)}}}finally{R.removeEventListener("abort",le),O.releaseLock()}break}catch(G){if(n?.(G),d!==void 0&&E>=d)break;const Z=Math.min(k*2**(E-1),h??3e4);await N(Z)}}}()}},Gw=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},Hw=e=>{switch(e){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},Qw=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},yv=({allowReserved:e,explode:n,name:i,style:r,value:l})=>{if(!n){const h=(e?l:l.map(g=>encodeURIComponent(g))).join(Hw(r));switch(r){case"label":return`.${h}`;case"matrix":return`;${i}=${h}`;case"simple":return h;default:return`${i}=${h}`}}const c=Gw(r),d=l.map(h=>r==="label"||r==="simple"?e?h:encodeURIComponent(h):gc({allowReserved:e,name:i,value:h})).join(c);return r==="label"||r==="matrix"?c+d:d},gc=({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)}`},bv=({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(([S,x])=>{g=[...g,S,e?x:encodeURIComponent(x)]});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=Qw(r),h=Object.entries(l).map(([g,b])=>gc({allowReserved:e,name:r==="deepObject"?`${i}[${g}]`:g,value:b})).join(d);return r==="label"||r==="matrix"?d+h:h},Kw=/\{[^{}]+\}/g,Zw=({path:e,url:n})=>{let i=n;const r=n.match(Kw);if(r)for(const l of r){let c=!1,d=l.substring(1,l.length-1),h="simple";d.endsWith("*")&&(c=!0,d=d.substring(0,d.length-1)),d.startsWith(".")?(d=d.substring(1),h="label"):d.startsWith(";")&&(d=d.substring(1),h="matrix");const g=e[d];if(g==null)continue;if(Array.isArray(g)){i=i.replace(l,yv({explode:c,name:d,style:h,value:g}));continue}if(typeof g=="object"){i=i.replace(l,bv({explode:c,name:d,style:h,value:g,valueOnly:!0}));continue}if(h==="matrix"){i=i.replace(l,`;${gc({name:d,value:g})}`);continue}const b=encodeURIComponent(h==="label"?`.${g}`:g);i=i.replace(l,b)}return i},Yw=({baseUrl:e,path:n,query:i,querySerializer:r,url:l})=>{const c=l.startsWith("/")?l:`/${l}`;let d=(e??"")+c;n&&(d=Zw({path:n,url:d}));let h=i?r(i):"";return h.startsWith("?")&&(h=h.substring(1)),h&&(d+=`?${h}`),d};function Xw(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 Jw=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},vv=({allowReserved:e,array:n,object:i}={})=>l=>{const c=[];if(l&&typeof l=="object")for(const d in l){const h=l[d];if(h!=null)if(Array.isArray(h)){const g=yv({allowReserved:e,explode:!0,name:d,style:"form",value:h,...n});g&&c.push(g)}else if(typeof h=="object"){const g=bv({allowReserved:e,explode:!0,name:d,style:"deepObject",value:h,...i});g&&c.push(g)}else{const g=gc({allowReserved:e,name:d,value:h});g&&c.push(g)}}return c.join("&")},Fw=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"}},Ww=(e,n)=>n?!!(e.headers.has(n)||e.query?.[n]||e.headers.get("Cookie")?.includes(`${n}=`)):!1,ej=async({security:e,...n})=>{for(const i of e){if(Ww(n,i.name))continue;const r=await Jw(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}}},Iy=e=>Yw({baseUrl:e.baseUrl,path:e.path,query:e.query,querySerializer:typeof e.querySerializer=="function"?e.querySerializer:vv(e.querySerializer),url:e.url}),Vy=(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},tj=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?tj(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 tf{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 nj=()=>({error:new tf,request:new tf,response:new tf}),aj=vv({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),ij={"Content-Type":"application/json"},xv=(e={})=>({...Vw,headers:ij,parseAs:"auto",querySerializer:aj,...e}),wv=(e={})=>{let n=Vy(xv(),e);const i=()=>({...n}),r=b=>(n=Vy(n,b),i()),l=nj(),c=async b=>{const S={...n,...b,fetch:b.fetch??n.fetch??globalThis.fetch,headers:Sv(n.headers,b.headers),serializedBody:void 0};S.security&&await ej({...S,security:S.security}),S.requestValidator&&await S.requestValidator(S),S.body!==void 0&&S.bodySerializer&&(S.serializedBody=S.bodySerializer(S.body)),(S.body===void 0||S.serializedBody==="")&&S.headers.delete("Content-Type");const x=Iy(S);return{opts:S,url:x}},d=async b=>{const{opts:S,url:x}=await c(b),N={redirect:"follow",...S,body:Xw(S)};let A=new Request(x,N);for(const X of l.request.fns)X&&(A=await X(A,S));const T=S.fetch;let k=await T(A);for(const X of l.response.fns)X&&(k=await X(k,A,S));const E={request:A,response:k};if(k.ok){const X=(S.parseAs==="auto"?Fw(k.headers.get("Content-Type")):S.parseAs)??"json";if(k.status===204||k.headers.get("Content-Length")==="0"){let O;switch(X){case"arrayBuffer":case"blob":case"text":O=await k[X]();break;case"formData":O=new FormData;break;case"stream":O=k.body;break;default:O={};break}return S.responseStyle==="data"?O:{data:O,...E}}let J;switch(X){case"arrayBuffer":case"blob":case"formData":case"json":case"text":J=await k[X]();break;case"stream":return S.responseStyle==="data"?k.body:{data:k.body,...E}}return X==="json"&&(S.responseValidator&&await S.responseValidator(J),S.responseTransformer&&(J=await S.responseTransformer(J))),S.responseStyle==="data"?J:{data:J,...E}}const R=await k.text();let V;try{V=JSON.parse(R)}catch{}const G=V??R;let Z=G;for(const X of l.error.fns)X&&(Z=await X(G,k,A,S));if(Z=Z||{},S.throwOnError)throw Z;return S.responseStyle==="data"?void 0:{error:Z,...E}},h=b=>S=>d({...S,method:b}),g=b=>async S=>{const{opts:x,url:N}=await c(S);return Pw({...x,body:x.body,headers:x.headers,method:b,onRequest:async(A,T)=>{let k=new Request(A,T);for(const E of l.request.fns)E&&(k=await E(k,x));return k},url:N})};return{buildUrl:Iy,connect:h("CONNECT"),delete:h("DELETE"),get:h("GET"),getConfig:i,head:h("HEAD"),interceptors:l,options:h("OPTIONS"),patch:h("PATCH"),post:h("POST"),put:h("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:h("TRACE")}},K=wv(xv()),sj=e=>(e.client??K).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}",...e}),jv=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}",...e}),rj=e=>(e.client??K).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}",...e,headers:{"Content-Type":"application/json",...e.headers}}),oj=e=>(e?.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects",...e}),lj=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/locations",...e,headers:{"Content-Type":"application/json",...e.headers}}),cj=e=>(e.client??K).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/locations/{label}",...e}),uj=e=>(e.client??K).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/locations/default",...e,headers:{"Content-Type":"application/json",...e.headers}}),dj=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/export",...e}),fj=e=>(e.client??K).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/queries",...e,headers:{"Content-Type":"application/json",...e.headers}}),pj=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/queries",...e}),mj=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/queries",...e,headers:{"Content-Type":"application/json",...e.headers}}),hj=e=>(e.client??K).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/queries",...e,headers:{"Content-Type":"application/json",...e.headers}}),gj=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/queries/generate",...e,headers:{"Content-Type":"application/json",...e.headers}}),yj=e=>(e.client??K).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/competitors",...e,headers:{"Content-Type":"application/json",...e.headers}}),bj=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/competitors",...e}),vj=e=>(e.client??K).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/competitors",...e,headers:{"Content-Type":"application/json",...e.headers}}),Sj=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/runs",...e}),xj=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/runs",...e,headers:{"Content-Type":"application/json",...e.headers}}),wj=e=>(e?.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/runs",...e}),jj=e=>(e?.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/runs",...e,headers:{"Content-Type":"application/json",...e?.headers}}),Nv=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/runs/{id}",...e}),Nj=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/apply",...e,headers:{"Content-Type":"application/json",...e.headers}}),kj=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/timeline",...e}),Aj=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/analytics/metrics",...e}),kv=e=>(e?.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/settings",...e}),_j=e=>(e.client??K).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/settings/providers/{name}",...e,headers:{"Content-Type":"application/json",...e.headers}}),Cj=e=>(e.client??K).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/settings/google",...e,headers:{"Content-Type":"application/json",...e.headers}}),zj=e=>(e.client??K).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/settings/bing",...e,headers:{"Content-Type":"application/json",...e.headers}}),Tj=e=>(e.client??K).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/settings/cdp",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ej=e=>(e.client??K).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/schedule",...e}),Oj=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/schedule",...e}),Dj=e=>(e.client??K).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/schedule",...e,headers:{"Content-Type":"application/json",...e.headers}}),Rj=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/notifications",...e}),Mj=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/notifications",...e,headers:{"Content-Type":"application/json",...e.headers}}),Bj=e=>(e.client??K).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/notifications/{id}",...e}),Lj=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/notifications/{id}/test",...e}),qj=e=>(e?.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/cdp/status",...e}),Uj=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/connections",...e}),$j=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/connect",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ij=e=>(e.client??K).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/connections/{type}",...e}),Vj=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/properties",...e}),Pj=e=>(e.client??K).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/connections/{type}/property",...e,headers:{"Content-Type":"application/json",...e.headers}}),Gj=e=>(e.client??K).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/connections/{type}/sitemap",...e,headers:{"Content-Type":"application/json",...e.headers}}),Hj=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/sync",...e,headers:{"Content-Type":"application/json",...e.headers}}),Qj=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/performance",...e}),Kj=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/performance/daily",...e}),Zj=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/inspect",...e,headers:{"Content-Type":"application/json",...e.headers}}),Yj=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/inspections",...e}),Xj=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/deindexed",...e}),Av=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/coverage",...e}),Jj=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/coverage/history",...e}),Fj=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/sitemaps",...e}),Wj=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/discover-sitemaps",...e}),eN=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/inspect-sitemap",...e,headers:{"Content-Type":"application/json",...e.headers}}),tN=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/indexing/request",...e,headers:{"Content-Type":"application/json",...e.headers}}),nN=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/gbp/locations",...e}),aN=e=>(e.client??K).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/gbp/locations/{locationName}/selection",...e,headers:{"Content-Type":"application/json",...e.headers}}),iN=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/gbp/sync",...e,headers:{"Content-Type":"application/json",...e.headers}}),sN=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/gbp/keywords",...e}),rN=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/gbp/places",...e}),oN=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/gbp/summary",...e}),lN=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/connect",...e,headers:{"Content-Type":"application/json",...e.headers}}),cN=e=>(e.client??K).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/disconnect",...e}),uN=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/status",...e}),dN=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/sites",...e}),fN=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/set-site",...e,headers:{"Content-Type":"application/json",...e.headers}}),_v=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/coverage",...e}),pN=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/inspections",...e}),mN=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/inspect-url",...e,headers:{"Content-Type":"application/json",...e.headers}}),hN=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/inspect-sitemap",...e,headers:{"Content-Type":"application/json",...e.headers}}),gN=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/request-indexing",...e,headers:{"Content-Type":"application/json",...e.headers}}),yN=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/performance",...e}),bN=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/ga/connect",...e,headers:{"Content-Type":"application/json",...e.headers}}),vN=e=>(e.client??K).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/ga/disconnect",...e}),SN=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/ga/status",...e}),xN=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/ga/sync",...e,headers:{"Content-Type":"application/json",...e.headers}}),wN=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/ga/traffic",...e}),jN=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/ga/ai-referral-history",...e}),NN=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/ga/social-referral-history",...e}),kN=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/ga/session-history",...e}),AN=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/insights",...e}),_N=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/report",...e}),CN=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/citations/visibility",...e}),zN=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/content/dismissals",...e,headers:{"Content-Type":"application/json",...e.headers}}),TN=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/overview",...e}),EN=e=>(e?.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/backlinks/status",...e}),ON=e=>(e?.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/backlinks/install",...e}),DN=e=>(e?.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/backlinks/syncs",...e}),RN=e=>(e?.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/backlinks/syncs",...e,headers:{"Content-Type":"application/json",...e?.headers}}),MN=e=>(e?.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/backlinks/syncs/latest",...e}),BN=e=>(e?.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/backlinks/releases",...e}),LN=e=>(e?.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/backlinks/latest-release",...e}),qN=e=>(e.client??K).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/backlinks/cache/{release}",...e}),UN=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/backlinks/extract",...e,headers:{"Content-Type":"application/json",...e.headers}}),$N=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/backlinks/summary",...e}),IN=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/backlinks/domains",...e}),VN=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/backlinks/history",...e}),PN=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/backlinks/sources",...e}),GN=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/backlinks/bing-sync",...e}),HN=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/traffic/connect/cloud-run",...e,headers:{"Content-Type":"application/json",...e.headers}}),QN=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/traffic/connect/wordpress",...e,headers:{"Content-Type":"application/json",...e.headers}}),KN=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/traffic/connect/vercel",...e,headers:{"Content-Type":"application/json",...e.headers}}),ZN=e=>(e.client??K).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??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/traffic/sources/{id}/backfill",...e,headers:{"Content-Type":"application/json",...e.headers}}),XN=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/traffic/sources",...e}),JN=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/traffic/status",...e}),FN=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/traffic/sources/{id}",...e}),WN=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/traffic/events",...e}),ek=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/discover/run",...e,headers:{"Content-Type":"application/json",...e.headers}}),tk=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/discover/sessions",...e}),nk=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/discover/sessions/{id}",...e}),ak=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/discover/sessions/{id}/promote",...e}),ik=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/discover/sessions/{id}/promote",...e,headers:{"Content-Type":"application/json",...e.headers}}),sk=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/technical-aeo",...e}),rk=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/technical-aeo/pages",...e}),ok=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/technical-aeo/trend",...e}),lk=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/technical-aeo/runs",...e,headers:{"Content-Type":"application/json",...e.headers}}),ck=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/agent/providers",...e});function uk(e){const n={baseUrl:e.baseUrl,fetch:e.fetch,headers:{...e.headers??{}}};return wv(n)}class Gn extends Error{code;statusCode;details;constructor(n,i,r,l){super(n),this.name="ApiError",this.code=r??"UNKNOWN",this.statusCode=i,this.details=l}}function dk(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,"")+"/api/v1":"/api/v1"}const Cv=dk();function fk(){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 pk(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,""):""}function mk(e){return`${pk()}${e}`}function hk(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 gk(){return""}function nf(){return!!gk()}let zv=null;function Py(e){zv=e}function Gf(){zv?.()}const ie=uk({baseUrl:fk()});ie.interceptors.response.use((e,n)=>(e.status===401&&!n.url.includes("/api/v1/session")&&Gf(),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,c;if(typeof n.error=="object"&&n.error!==null){const d=n.error.error;if(typeof d=="string")r=d;else if(d&&typeof d=="object"){const h=d;h.message&&(r=h.message),h.code&&(l=h.code),h.details&&(c=h.details)}else{const h=n.error;h.message&&(r=h.message),h.code&&(l=h.code),h.details&&(c=h.details)}}else typeof n.error=="string"&&(r=n.error);throw new Gn(r,i,l,c)}if(n.response.status!==204)return n.data}async function Hf(e,n){const i=n?.body!=null,r=await fetch(`${Cv}${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,h;if(l)try{const g=JSON.parse(l);typeof g.error=="string"?c=g.error:g.error?.message?(c=g.error.message,d=g.error.code,h=g.error.details):g.message&&(c=g.message)}catch{c=l}throw r.status===401&&!e.startsWith("/session")&&Gf(),new Gn(c,r.status,d,h)}if(r.status!==204)return r.json()}function Qf(e){return ce(()=>jv({client:ie,path:{name:e}}))}function eB(e){return ce(()=>Sj({client:ie,path:{name:e}}))}function nc(e){return ce(()=>Nv({client:ie,path:{id:e}}))}function yk(e){return ce(()=>pj({client:ie,path:{name:e}}))}function bk(e){return ce(()=>bj({client:ie,path:{name:e}}))}function vk(e,n){return ce(()=>kj({client:ie,path:{name:e},query:{location:n}}))}function Tv(e,n){return ce(()=>TN({client:ie,path:{name:e},query:{location:n?.location,since:n?.since}}))}function ho(e,n){return ce(()=>rj({client:ie,path:{name:e},body:n}))}function Sk(e,n){return ce(()=>hj({client:ie,path:{name:e},body:{queries:n}}))}function xk(e,n){return ce(()=>mj({client:ie,path:{name:e},body:{queries:n}}))}function tB(e,n){return ce(()=>fj({client:ie,path:{name:e},body:{queries:n}}))}function wk(e,n){return ce(()=>zN({client:ie,path:{name:e},body:n}))}function jk(e,n){return ce(()=>vj({client:ie,path:{name:e},body:{competitors:n}}))}function nB(e,n){return ce(()=>yj({client:ie,path:{name:e},body:{competitors:n}}))}async function aB(e,n){const i=await Qf(e);return ho(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 iB(e,n){const i=await Qf(e);return ho(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 sB(e,n){const i=await Qf(e);return ho(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 Nk(e,n){const i={};return n?.location&&(i.location=n.location),n?.allLocations&&(i.allLocations=!0),n?.noLocation&&(i.noLocation=!0),ce(()=>xj({client:ie,path:{name:e},body:i}))}function rB(e,n){return ce(()=>lj({client:ie,path:{name:e},body:n}))}async function oB(e,n){await ce(()=>cj({client:ie,path:{name:e,label:n}}))}function lB(e,n){return ce(()=>uj({client:ie,path:{name:e},body:{label:n}}))}async function cB(e){await ce(()=>sj({client:ie,path:{name:e}}))}function uB(e){return ce(()=>dj({client:ie,path:{name:e}}))}function dB(){return ce(()=>kv({client:ie}))}function Gy(){return Hf("/session")}function kk(e){return Hf("/session/setup",{method:"POST",body:JSON.stringify({password:e})})}function Ak(e){return Hf("/session",{method:"POST",body:JSON.stringify({password:e})})}function _k(e,n){return ce(()=>_j({client:ie,path:{name:e},body:n}))}function fB(e){return ce(()=>Cj({client:ie,body:e}))}async function pB(e){try{return await ce(()=>Oj({client:ie,path:{name:e}}))}catch(n){if(n instanceof Gn&&n.statusCode===404)return null;throw n}}function mB(e,n){return ce(()=>Dj({client:ie,path:{name:e},body:n}))}async function hB(e){await ce(()=>Ej({client:ie,path:{name:e}}))}function gB(e){return ce(()=>Rj({client:ie,path:{name:e}}))}function yB(e,n){return ce(()=>Mj({client:ie,path:{name:e},body:n}))}async function bB(e,n){await ce(()=>Bj({client:ie,path:{name:e,id:n}}))}function vB(e,n){return ce(()=>Lj({client:ie,path:{name:e,id:n}}))}function Ck(e,n,i){return ce(()=>gj({client:ie,path:{name:e},body:{provider:n,count:i}}))}function zk(e){return ce(()=>Nj({client:ie,body:e}))}function Tk(e){return ce(()=>jj({client:ie,body:e??{}}))}function SB(e,n){return ce(()=>$j({client:ie,path:{name:e},body:{type:n}}))}function xB(e,n){return ce(()=>Ij({client:ie,path:{name:e,type:n}}))}function wB(e,n,i){return ce(()=>Pj({client:ie,path:{name:e,type:n},body:{propertyId:i}}))}function jB(e,n,i){return ce(()=>Gj({client:ie,path:{name:e,type:n},body:{sitemapUrl:i}}))}function Ek(e,n){return ce(()=>Hj({client:ie,path:{name:e},body:n??{}}))}function NB(e,n){const i={};return n&&n!=="all"&&(i.window=n),ce(()=>Aj({client:ie,path:{name:e},query:i}))}function kB(e,n){return ce(()=>Zj({client:ie,path:{name:e},body:{url:n}}))}function Ok(e){return ce(()=>Av({client:ie,path:{name:e}}))}function Dk(e,n){return ce(()=>eN({client:ie,path:{name:e},body:n??{}}))}function AB(e){return ce(()=>Fj({client:ie,path:{name:e}}))}function Rk(e){return ce(()=>Wj({client:ie,path:{name:e}}))}function _B(e,n){return ce(()=>lk({client:ie,path:{name:e},body:{}}))}function CB(e,n){return ce(()=>ek({client:ie,path:{name:e},body:n??{}}))}function zB(e,n,i){return ce(()=>ik({client:ie,path:{name:e,id:n},body:i??{}}))}function TB(){return ce(()=>qj({client:ie}))}function EB(e,n){return ce(()=>Tj({client:ie,body:{host:e,port:n}}))}function OB(e,n){return ce(()=>tN({client:ie,path:{name:e},body:n}))}function DB(e,n){return ce(()=>lN({client:ie,path:{name:e},body:{apiKey:n}}))}function RB(e){return ce(()=>cN({client:ie,path:{name:e}}))}function MB(e,n){return ce(()=>fN({client:ie,path:{name:e},body:{siteUrl:n}}))}function Mk(e){return ce(()=>_v({client:ie,path:{name:e}}))}function BB(e,n){return ce(()=>mN({client:ie,path:{name:e},body:{url:n}}))}function LB(e,n){return ce(()=>hN({client:ie,path:{name:e},body:{}}))}function qB(e,n){return ce(()=>gN({client:ie,path:{name:e},body:n}))}function UB(e){return ce(()=>zj({client:ie,body:{apiKey:e}}))}function Bk(e){return e?/filename\s*=\s*"?([^";]+)"?/i.exec(e)?.[1]??null:null}async function $B(e,n="agency"){const i=new URLSearchParams({audience:n}),r=await fetch(`${Cv}/projects/${encodeURIComponent(e)}/report.html?${i.toString()}`,{credentials:"same-origin",headers:{}});if(!r.ok)throw new Gn(`Failed to download report: ${r.status}`,r.status);const l=await r.blob(),c=URL.createObjectURL(l),d=Bk(r.headers.get("Content-Disposition"))??`canonry-report-${e}.html`,h=document.createElement("a");h.href=c,h.download=d,document.body.appendChild(h),h.click(),document.body.removeChild(h),URL.revokeObjectURL(c)}function IB(e,n){return ce(()=>xN({client:ie,path:{name:e},body:{}}))}function VB(e,n){return ce(()=>bN({client:ie,path:{name:e},body:n}))}function PB(e){return ce(()=>vN({client:ie,path:{name:e}}))}function GB(e,n){return ce(()=>HN({client:ie,path:{name:e},body:n}))}function HB(e,n){return ce(()=>QN({client:ie,path:{name:e},body:n}))}function QB(e,n){return ce(()=>KN({client:ie,path:{name:e},body:n}))}function KB(e,n,i){return ce(()=>ZN({client:ie,path:{name:e,id:n},body:i??{}}))}function ZB(e,n,i){return ce(()=>YN({client:ie,path:{name:e,id:n},body:{}}))}function Lk(e,n){return ce(()=>AN({client:ie,path:{name:e},query:{runId:n}}))}function qk(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 Uk(e,n){const i=mk(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:hk(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,h=typeof l.lastHeartbeatAt=="string"?l.lastHeartbeatAt:void 0,g=qk(l.updateAvailable),b=[c,d===!1?"database not configured":"database configured",h?`heartbeat ${h}`:void 0].filter(Boolean).join(" · ");return{label:n,state:"ok",detail:b,version:c,databaseConfigured:d,lastHeartbeatAt:h,...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 YB(){return ce(()=>EN({client:ie}))}function XB(){return ce(()=>ON({client:ie}))}function JB(){return ce(()=>MN({client:ie}))}function FB(){return ce(()=>DN({client:ie}))}function WB(e){return ce(()=>RN({client:ie,body:e?{release:e}:{}}))}function eL(){return ce(()=>BN({client:ie}))}function tL(){return ce(()=>LN({client:ie}))}function nL(e){return ce(()=>qN({client:ie,path:{release:e}}))}function aL(e,n={}){return ce(()=>$N({client:ie,path:{name:e},query:{release:n.release,excludeCrawlers:n.excludeCrawlers?"1":void 0,source:n.source}}))}function iL(e,n={}){return ce(()=>IN({client:ie,path:{name:e},query:{limit:n.limit!==void 0?String(n.limit):void 0,offset:n.offset!==void 0?String(n.offset):void 0,release:n.release,excludeCrawlers:n.excludeCrawlers?"1":void 0,source:n.source}}))}function sL(e,n={}){return ce(()=>VN({client:ie,path:{name:e},query:{source:n.source}}))}function rL(e,n={}){return ce(()=>PN({client:ie,path:{name:e},query:{excludeCrawlers:n.excludeCrawlers?"1":void 0}}))}function oL(e,n){return ce(()=>UN({client:ie,path:{name:e},body:{release:void 0}}))}function lL(e){return ce(()=>GN({client:ie,path:{name:e}}))}function wn(e){return(...n)=>{e(...n)}}const $k=6e3,Ik=5,Vk=180;let It=[],Pk=0;const bf=new Set,vf=new Map,Sf=new Map;function ac(){const e=[...It];for(const n of bf)n(e)}function Kf(e){const n=vf.get(e);n&&(clearTimeout(n),vf.delete(e));const i=Sf.get(e);i&&(clearTimeout(i),Sf.delete(e))}function Ev(e){Kf(e);const n=It.length;It=It.filter(i=>i.id!==e),It.length!==n&&ac()}function Hy(e){Kf(e.id),vf.set(e.id,setTimeout(()=>{xf(e.id)},e.durationMs))}function Gk(e,n,i){return typeof e=="string"?{title:e,tone:n,durationMs:i}:e}function en(e,n="negative",i=$k){const r=Gk(e,n,i),l={id:String(++Pk),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=It.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 It=It.map(h=>h.id===c.id?d:h),ac(),Hy(d),c.id}}return It.length>=Ik&&Ev(It[0].id),It=[...It,l],ac(),Hy(l),l.id}function xf(e){const n=It.find(i=>i.id===e);!n||n.state==="closing"||(Kf(e),It=It.map(i=>i.id===e?{...i,state:"closing"}:i),ac(),Sf.set(e,setTimeout(()=>{Ev(e)},Vk)))}function Hk(e){return bf.add(e),()=>{bf.delete(e)}}function Qy(){return It}const Qk=5*6e4,wf=30*6e4,cL=3e4,uL=6e4,lo=3e4,Kk=2e3,Zk=5e3;function Yk(){return new kw({defaultOptions:{queries:{staleTime:Qk,retry:1,refetchOnWindowFocus:!1}},mutationCache:new Aw({onError:(e,n,i,r)=>{r.meta?.skipGlobalErrorToast||en({title:e instanceof Error?e.message:"An unexpected error occurred",tone:"negative"})}})})}const Xk="modulepreload",Jk=function(e,n){return new URL(e,n).href},Ky={},Hs=function(n,i,r){let l=Promise.resolve();if(i&&i.length>0){let b=function(S){return Promise.all(S.map(x=>Promise.resolve(x).then(N=>({status:"fulfilled",value:N}),N=>({status:"rejected",reason:N}))))};const d=document.getElementsByTagName("link"),h=document.querySelector("meta[property=csp-nonce]"),g=h?.nonce||h?.getAttribute("nonce");l=b(i.map(S=>{if(S=Jk(S,r),S in Ky)return;Ky[S]=!0;const x=S.endsWith(".css"),N=x?'[rel="stylesheet"]':"";if(r)for(let T=d.length-1;T>=0;T--){const k=d[T];if(k.href===S&&(!x||k.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${S}"]${N}`))return;const A=document.createElement("link");if(A.rel=x?"stylesheet":Xk,x||(A.as="script"),A.crossOrigin="",A.href=S,g&&A.setAttribute("nonce",g),document.head.appendChild(A),x)return new Promise((T,k)=>{A.addEventListener("load",T),A.addEventListener("error",()=>k(new Error(`Unable to preload CSS for ${S}`)))})}))}function c(d){const h=new Event("vite:preloadError",{cancelable:!0});if(h.payload=d,window.dispatchEvent(h),!h.defaultPrevented)throw d}return l.then(d=>{for(const h of d||[])h.status==="rejected"&&c(h.reason);return n().catch(c)})};const Fk=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Wk=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,i,r)=>r?r.toUpperCase():i.toLowerCase()),Zy=e=>{const n=Wk(e);return n.charAt(0).toUpperCase()+n.slice(1)},Ov=(...e)=>e.filter((n,i,r)=>!!n&&n.trim()!==""&&r.indexOf(n)===i).join(" ").trim(),eA=e=>{for(const n in e)if(n.startsWith("aria-")||n==="role"||n==="title")return!0};var tA={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 nA=q.forwardRef(({color:e="currentColor",size:n=24,strokeWidth:i=2,absoluteStrokeWidth:r,className:l="",children:c,iconNode:d,...h},g)=>q.createElement("svg",{ref:g,...tA,width:n,height:n,stroke:e,strokeWidth:r?Number(i)*24/Number(n):i,className:Ov("lucide",l),...!c&&!eA(h)&&{"aria-hidden":"true"},...h},[...d.map(([b,S])=>q.createElement(b,S)),...Array.isArray(c)?c:[c]]));const et=(e,n)=>{const i=q.forwardRef(({className:r,...l},c)=>q.createElement(nA,{ref:c,iconNode:n,className:Ov(`lucide-${Fk(Zy(e))}`,`lucide-${e}`,r),...l}));return i.displayName=Zy(e),i};const aA=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],iA=et("arrow-right",aA);const sA=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],rA=et("arrow-up",sA);const oA=[["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"}]],lA=et("book-open",oA);const cA=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Dv=et("check",cA);const uA=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],dA=et("chevron-down",uA);const fA=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Zf=et("chevron-right",fA);const pA=[["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"}]],mA=et("copy",pA);const hA=[["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"}]],gA=et("file-text",hA);const yA=[["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"}]],bA=et("github",yA);const vA=[["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"}]],SA=et("globe",vA);const xA=[["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"}]],wA=et("layout-dashboard",xA);const jA=[["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"}]],NA=et("link-2",jA);const kA=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],AA=et("loader-circle",kA);const _A=[["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"}]],CA=et("maximize-2",_A);const zA=[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]],TA=et("menu",zA);const EA=[["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"}]],OA=et("minimize-2",EA);const DA=[["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"}]],RA=et("play",DA);const MA=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Yy=et("plus",MA);const BA=[["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"}]],LA=et("radar",BA);const qA=[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],Xy=et("radio",qA);const UA=[["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"}]],$A=et("rocket",UA);const IA=[["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"}]],Rv=et("rotate-ccw",IA);const VA=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],PA=et("search",VA);const GA=[["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"}]],HA=et("settings",GA);const QA=[["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"}]],Mv=et("triangle-alert",QA);const KA=[["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"}]],ZA=et("wrench",KA);const YA=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Qs=et("x",YA);function H(e,n,i){function r(h,g){if(h._zod||Object.defineProperty(h,"_zod",{value:{def:g,constr:d,traits:new Set},enumerable:!1}),h._zod.traits.has(e))return;h._zod.traits.add(e),n(h,g);const b=d.prototype,S=Object.keys(b);for(let x=0;x<S.length;x++){const N=S[x];N in h||(h[N]=b[N].bind(h))}}const l=i?.Parent??Object;class c extends l{}Object.defineProperty(c,"name",{value:e});function d(h){var g;const b=i?.Parent?new c:this;r(b,h),(g=b._zod).deferred??(g.deferred=[]);for(const S of b._zod.deferred)S();return b}return Object.defineProperty(d,"init",{value:r}),Object.defineProperty(d,Symbol.hasInstance,{value:h=>i?.Parent&&h instanceof i.Parent?!0:h?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}class Ms extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Bv extends Error{constructor(n){super(`Encountered unidirectional transform during encode: ${n}`),this.name="ZodEncodeError"}}const Lv={};function Ya(e){return Lv}function qv(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 jf(e,n){return typeof n=="bigint"?n.toString():n}function yc(e){return{get value(){{const n=e();return Object.defineProperty(this,"value",{value:n}),n}}}}function Yf(e){return e==null}function Xf(e){const n=e.startsWith("^")?1:0,i=e.endsWith("$")?e.length-1:e.length;return e.slice(n,i)}function XA(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(".","")),h=Number.parseInt(n.toFixed(c).replace(".",""));return d%h/10**c}const Jy=Symbol("evaluating");function Ge(e,n,i){let r;Object.defineProperty(e,n,{get(){if(r!==Jy)return r===void 0&&(r=Jy,r=i()),r},set(l){Object.defineProperty(e,n,{value:l})},configurable:!0})}function Ti(e,n,i){Object.defineProperty(e,n,{value:i,writable:!0,enumerable:!0,configurable:!0})}function Fa(...e){const n={};for(const i of e){const r=Object.getOwnPropertyDescriptors(i);Object.assign(n,r)}return Object.defineProperties({},n)}function Fy(e){return JSON.stringify(e)}function JA(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Uv="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function co(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const FA=yc(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Us(e){if(co(e)===!1)return!1;const n=e.constructor;if(n===void 0||typeof n!="function")return!0;const i=n.prototype;return!(co(i)===!1||Object.prototype.hasOwnProperty.call(i,"isPrototypeOf")===!1)}function $v(e){return Us(e)?{...e}:Array.isArray(e)?[...e]:e}const WA=new Set(["string","number","symbol"]);function $s(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Wa(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 e2(e){return Object.keys(e).filter(n=>e[n]._zod.optin==="optional"&&e[n]._zod.optout==="optional")}const t2={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 n2(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=Fa(e._zod.def,{get shape(){const d={};for(const h in n){if(!(h in i.shape))throw new Error(`Unrecognized key: "${h}"`);n[h]&&(d[h]=i.shape[h])}return Ti(this,"shape",d),d},checks:[]});return Wa(e,c)}function a2(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=Fa(e._zod.def,{get shape(){const d={...e._zod.def.shape};for(const h in n){if(!(h in i.shape))throw new Error(`Unrecognized key: "${h}"`);n[h]&&delete d[h]}return Ti(this,"shape",d),d},checks:[]});return Wa(e,c)}function i2(e,n){if(!Us(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=Fa(e._zod.def,{get shape(){const c={...e._zod.def.shape,...n};return Ti(this,"shape",c),c}});return Wa(e,l)}function s2(e,n){if(!Us(n))throw new Error("Invalid input to safeExtend: expected a plain object");const i=Fa(e._zod.def,{get shape(){const r={...e._zod.def.shape,...n};return Ti(this,"shape",r),r}});return Wa(e,i)}function r2(e,n){const i=Fa(e._zod.def,{get shape(){const r={...e._zod.def.shape,...n._zod.def.shape};return Ti(this,"shape",r),r},get catchall(){return n._zod.def.catchall},checks:[]});return Wa(e,i)}function o2(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=Fa(n._zod.def,{get shape(){const h=n._zod.def.shape,g={...h};if(i)for(const b in i){if(!(b in h))throw new Error(`Unrecognized key: "${b}"`);i[b]&&(g[b]=e?new e({type:"optional",innerType:h[b]}):h[b])}else for(const b in h)g[b]=e?new e({type:"optional",innerType:h[b]}):h[b];return Ti(this,"shape",g),g},checks:[]});return Wa(n,d)}function l2(e,n,i){const r=Fa(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 Ti(this,"shape",c),c}});return Wa(n,r)}function Ts(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 Es(e,n){return n.map(i=>{var r;return(r=i).path??(r.path=[]),i.path.unshift(e),i})}function $l(e){return typeof e=="string"?e:e?.message}function Xa(e,n,i){const r={...e,path:e.path??[]};if(!e.message){const l=$l(e.inst?._zod.def?.error?.(e))??$l(n?.error?.(e))??$l(i.customError?.(e))??$l(i.localeError?.(e))??"Invalid input";r.message=l}return delete r.inst,delete r.continue,n?.reportInput||delete r.input,r}function Jf(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function uo(...e){const[n,i,r]=e;return typeof n=="string"?{message:n,code:"custom",input:i,inst:r}:{...n}}const Iv=(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,jf,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Vv=H("$ZodError",Iv),Pv=H("$ZodError",Iv,{Parent:Error});function c2(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 u2(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,h=0;for(;h<c.path.length;){const g=c.path[h];h===c.path.length-1?(d[g]=d[g]||{_errors:[]},d[g]._errors.push(n(c))):d[g]=d[g]||{_errors:[]},d=d[g],h++}}};return r(e),i}const Ff=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 Ms;if(d.issues.length){const h=new(l?.Err??e)(d.issues.map(g=>Xa(g,c,Ya())));throw Uv(h,l?.callee),h}return d.value},Wf=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 h=new(l?.Err??e)(d.issues.map(g=>Xa(g,c,Ya())));throw Uv(h,l?.callee),h}return d.value},bc=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 Ms;return c.issues.length?{success:!1,error:new(e??Vv)(c.issues.map(d=>Xa(d,l,Ya())))}:{success:!0,data:c.value}},d2=bc(Pv),vc=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=>Xa(d,l,Ya())))}:{success:!0,data:c.value}},f2=vc(Pv),p2=e=>(n,i,r)=>{const l=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Ff(e)(n,i,l)},m2=e=>(n,i,r)=>Ff(e)(n,i,r),h2=e=>async(n,i,r)=>{const l=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Wf(e)(n,i,l)},g2=e=>async(n,i,r)=>Wf(e)(n,i,r),y2=e=>(n,i,r)=>{const l=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return bc(e)(n,i,l)},b2=e=>(n,i,r)=>bc(e)(n,i,r),v2=e=>async(n,i,r)=>{const l=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return vc(e)(n,i,l)},S2=e=>async(n,i,r)=>vc(e)(n,i,r),x2=/^[cC][^\s-]{8,}$/,w2=/^[0-9a-z]+$/,j2=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,N2=/^[0-9a-vA-V]{20}$/,k2=/^[A-Za-z0-9]{27}$/,A2=/^[a-zA-Z0-9_-]{21}$/,_2=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,C2=/^([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})$/,Wy=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)$/,z2=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,T2="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function E2(){return new RegExp(T2,"u")}const O2=/^(?:(?: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])$/,D2=/^(([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}|:))$/,R2=/^((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])$/,M2=/^(([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])$/,B2=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Gv=/^[A-Za-z0-9_-]*$/,L2=/^\+[1-9]\d{6,14}$/,Hv="(?:(?:\\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])))",q2=new RegExp(`^${Hv}$`);function Qv(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 U2(e){return new RegExp(`^${Qv(e)}$`)}function $2(e){const n=Qv({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(`^${Hv}T(?:${r})$`)}const I2=e=>{const n=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${n}$`)},V2=/^-?\d+$/,Kv=/^-?\d+(?:\.\d+)?$/,P2=/^(?:true|false)$/i,G2=/^[^A-Z]*$/,H2=/^[^a-z]*$/,nn=H("$ZodCheck",(e,n)=>{var i;e._zod??(e._zod={}),e._zod.def=n,(i=e._zod).onattach??(i.onattach=[])}),Zv={number:"number",bigint:"bigint",object:"date"},Yv=H("$ZodCheckLessThan",(e,n)=>{nn.init(e,n);const i=Zv[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})}}),Xv=H("$ZodCheckGreaterThan",(e,n)=>{nn.init(e,n);const i=Zv[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})}}),Q2=H("$ZodCheckMultipleOf",(e,n)=>{nn.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):XA(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})}}),K2=H("$ZodCheckNumberFormat",(e,n)=>{nn.init(e,n),n.format=n.format||"float64";const i=n.format?.includes("int"),r=i?"int":"number",[l,c]=t2[n.format];e._zod.onattach.push(d=>{const h=d._zod.bag;h.format=n.format,h.minimum=l,h.maximum=c,i&&(h.pattern=V2)}),e._zod.check=d=>{const h=d.value;if(i){if(!Number.isInteger(h)){d.issues.push({expected:r,format:n.format,code:"invalid_type",continue:!1,input:h,inst:e});return}if(!Number.isSafeInteger(h)){h>0?d.issues.push({input:h,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:h,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}}h<l&&d.issues.push({origin:"number",input:h,code:"too_small",minimum:l,inclusive:!0,inst:e,continue:!n.abort}),h>c&&d.issues.push({origin:"number",input:h,code:"too_big",maximum:c,inclusive:!0,inst:e,continue:!n.abort})}}),Z2=H("$ZodCheckMaxLength",(e,n)=>{var i;nn.init(e,n),(i=e._zod.def).when??(i.when=r=>{const l=r.value;return!Yf(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=Jf(l);r.issues.push({origin:d,code:"too_big",maximum:n.maximum,inclusive:!0,input:l,inst:e,continue:!n.abort})}}),Y2=H("$ZodCheckMinLength",(e,n)=>{var i;nn.init(e,n),(i=e._zod.def).when??(i.when=r=>{const l=r.value;return!Yf(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=Jf(l);r.issues.push({origin:d,code:"too_small",minimum:n.minimum,inclusive:!0,input:l,inst:e,continue:!n.abort})}}),X2=H("$ZodCheckLengthEquals",(e,n)=>{var i;nn.init(e,n),(i=e._zod.def).when??(i.when=r=>{const l=r.value;return!Yf(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=Jf(l),h=c>n.length;r.issues.push({origin:d,...h?{code:"too_big",maximum:n.length}:{code:"too_small",minimum:n.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!n.abort})}}),Sc=H("$ZodCheckStringFormat",(e,n)=>{var i,r;nn.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=()=>{})}),J2=H("$ZodCheckRegex",(e,n)=>{Sc.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})}}),F2=H("$ZodCheckLowerCase",(e,n)=>{n.pattern??(n.pattern=G2),Sc.init(e,n)}),W2=H("$ZodCheckUpperCase",(e,n)=>{n.pattern??(n.pattern=H2),Sc.init(e,n)}),e_=H("$ZodCheckIncludes",(e,n)=>{nn.init(e,n);const i=$s(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})}}),t_=H("$ZodCheckStartsWith",(e,n)=>{nn.init(e,n);const i=new RegExp(`^${$s(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})}}),n_=H("$ZodCheckEndsWith",(e,n)=>{nn.init(e,n);const i=new RegExp(`.*${$s(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})}}),a_=H("$ZodCheckOverwrite",(e,n)=>{nn.init(e,n),e._zod.check=i=>{i.value=n.tx(i.value)}});class i_{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
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
|
|
16
|
+
`))}}const s_={major:4,minor:3,patch:6},ct=H("$ZodType",(e,n)=>{var i;e??(e={}),e._zod.def=n,e._zod.bag=e._zod.bag||{},e._zod.version=s_;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,h,g)=>{let b=Ts(d),S;for(const x of h){if(x._zod.def.when){if(!x._zod.def.when(d))continue}else if(b)continue;const N=d.issues.length,A=x._zod.check(d);if(A instanceof Promise&&g?.async===!1)throw new Ms;if(S||A instanceof Promise)S=(S??Promise.resolve()).then(async()=>{await A,d.issues.length!==N&&(b||(b=Ts(d,N)))});else{if(d.issues.length===N)continue;b||(b=Ts(d,N))}}return S?S.then(()=>d):d},c=(d,h,g)=>{if(Ts(d))return d.aborted=!0,d;const b=l(h,r,g);if(b instanceof Promise){if(g.async===!1)throw new Ms;return b.then(S=>e._zod.parse(S,g))}return e._zod.parse(b,g)};e._zod.run=(d,h)=>{if(h.skipChecks)return e._zod.parse(d,h);if(h.direction==="backward"){const b=e._zod.parse({value:d.value,issues:[]},{...h,skipChecks:!0});return b instanceof Promise?b.then(S=>c(S,d,h)):c(b,d,h)}const g=e._zod.parse(d,h);if(g instanceof Promise){if(h.async===!1)throw new Ms;return g.then(b=>l(b,r,h))}return l(g,r,h)}}Ge(e,"~standard",()=>({validate:l=>{try{const c=d2(e,l);return c.success?{value:c.data}:{issues:c.error?.issues}}catch{return f2(e,l).then(d=>d.success?{value:d.data}:{issues:d.error?.issues})}},vendor:"zod",version:1}))}),ep=H("$ZodString",(e,n)=>{ct.init(e,n),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??I2(e._zod.bag),e._zod.parse=(i,r)=>{if(n.coerce)try{i.value=String(i.value)}catch{}return typeof i.value=="string"||i.issues.push({expected:"string",code:"invalid_type",input:i.value,inst:e}),i}}),lt=H("$ZodStringFormat",(e,n)=>{Sc.init(e,n),ep.init(e,n)}),r_=H("$ZodGUID",(e,n)=>{n.pattern??(n.pattern=C2),lt.init(e,n)}),o_=H("$ZodUUID",(e,n)=>{if(n.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[n.version];if(r===void 0)throw new Error(`Invalid UUID version: "${n.version}"`);n.pattern??(n.pattern=Wy(r))}else n.pattern??(n.pattern=Wy());lt.init(e,n)}),l_=H("$ZodEmail",(e,n)=>{n.pattern??(n.pattern=z2),lt.init(e,n)}),c_=H("$ZodURL",(e,n)=>{lt.init(e,n),e._zod.check=i=>{try{const r=i.value.trim(),l=new URL(r);n.hostname&&(n.hostname.lastIndex=0,n.hostname.test(l.hostname)||i.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:n.hostname.source,input:i.value,inst:e,continue:!n.abort})),n.protocol&&(n.protocol.lastIndex=0,n.protocol.test(l.protocol.endsWith(":")?l.protocol.slice(0,-1):l.protocol)||i.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:n.protocol.source,input:i.value,inst:e,continue:!n.abort})),n.normalize?i.value=l.href:i.value=r;return}catch{i.issues.push({code:"invalid_format",format:"url",input:i.value,inst:e,continue:!n.abort})}}}),u_=H("$ZodEmoji",(e,n)=>{n.pattern??(n.pattern=E2()),lt.init(e,n)}),d_=H("$ZodNanoID",(e,n)=>{n.pattern??(n.pattern=A2),lt.init(e,n)}),f_=H("$ZodCUID",(e,n)=>{n.pattern??(n.pattern=x2),lt.init(e,n)}),p_=H("$ZodCUID2",(e,n)=>{n.pattern??(n.pattern=w2),lt.init(e,n)}),m_=H("$ZodULID",(e,n)=>{n.pattern??(n.pattern=j2),lt.init(e,n)}),h_=H("$ZodXID",(e,n)=>{n.pattern??(n.pattern=N2),lt.init(e,n)}),g_=H("$ZodKSUID",(e,n)=>{n.pattern??(n.pattern=k2),lt.init(e,n)}),y_=H("$ZodISODateTime",(e,n)=>{n.pattern??(n.pattern=$2(n)),lt.init(e,n)}),b_=H("$ZodISODate",(e,n)=>{n.pattern??(n.pattern=q2),lt.init(e,n)}),v_=H("$ZodISOTime",(e,n)=>{n.pattern??(n.pattern=U2(n)),lt.init(e,n)}),S_=H("$ZodISODuration",(e,n)=>{n.pattern??(n.pattern=_2),lt.init(e,n)}),x_=H("$ZodIPv4",(e,n)=>{n.pattern??(n.pattern=O2),lt.init(e,n),e._zod.bag.format="ipv4"}),w_=H("$ZodIPv6",(e,n)=>{n.pattern??(n.pattern=D2),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})}}}),j_=H("$ZodCIDRv4",(e,n)=>{n.pattern??(n.pattern=R2),lt.init(e,n)}),N_=H("$ZodCIDRv6",(e,n)=>{n.pattern??(n.pattern=M2),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 Jv(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const k_=H("$ZodBase64",(e,n)=>{n.pattern??(n.pattern=B2),lt.init(e,n),e._zod.bag.contentEncoding="base64",e._zod.check=i=>{Jv(i.value)||i.issues.push({code:"invalid_format",format:"base64",input:i.value,inst:e,continue:!n.abort})}});function A_(e){if(!Gv.test(e))return!1;const n=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),i=n.padEnd(Math.ceil(n.length/4)*4,"=");return Jv(i)}const __=H("$ZodBase64URL",(e,n)=>{n.pattern??(n.pattern=Gv),lt.init(e,n),e._zod.bag.contentEncoding="base64url",e._zod.check=i=>{A_(i.value)||i.issues.push({code:"invalid_format",format:"base64url",input:i.value,inst:e,continue:!n.abort})}}),C_=H("$ZodE164",(e,n)=>{n.pattern??(n.pattern=L2),lt.init(e,n)});function z_(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 T_=H("$ZodJWT",(e,n)=>{lt.init(e,n),e._zod.check=i=>{z_(i.value,n.alg)||i.issues.push({code:"invalid_format",format:"jwt",input:i.value,inst:e,continue:!n.abort})}}),Fv=H("$ZodNumber",(e,n)=>{ct.init(e,n),e._zod.pattern=e._zod.bag.pattern??Kv,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}}),E_=H("$ZodNumberFormat",(e,n)=>{K2.init(e,n),Fv.init(e,n)}),O_=H("$ZodBoolean",(e,n)=>{ct.init(e,n),e._zod.pattern=P2,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}}),D_=H("$ZodUnknown",(e,n)=>{ct.init(e,n),e._zod.parse=i=>i}),R_=H("$ZodNever",(e,n)=>{ct.init(e,n),e._zod.parse=(i,r)=>(i.issues.push({expected:"never",code:"invalid_type",input:i.value,inst:e}),i)});function eb(e,n,i){e.issues.length&&n.issues.push(...Es(i,e.issues)),n.value[i]=e.value}const M_=H("$ZodArray",(e,n)=>{ct.init(e,n),e._zod.parse=(i,r)=>{const l=i.value;if(!Array.isArray(l))return i.issues.push({expected:"array",code:"invalid_type",input:l,inst:e}),i;i.value=Array(l.length);const c=[];for(let d=0;d<l.length;d++){const h=l[d],g=n.element._zod.run({value:h,issues:[]},r);g instanceof Promise?c.push(g.then(b=>eb(b,i,d))):eb(g,i,d)}return c.length?Promise.all(c).then(()=>i):i}});function ic(e,n,i,r,l){if(e.issues.length){if(l&&!(i in r))return;n.issues.push(...Es(i,e.issues))}e.value===void 0?i in r&&(n.value[i]=void 0):n.value[i]=e.value}function Wv(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=e2(e.shape);return{...e,keys:n,keySet:new Set(n),numKeys:n.length,optionalKeys:new Set(i)}}function e0(e,n,i,r,l,c){const d=[],h=l.keySet,g=l.catchall._zod,b=g.def.type,S=g.optout==="optional";for(const x in n){if(h.has(x))continue;if(b==="never"){d.push(x);continue}const N=g.run({value:n[x],issues:[]},r);N instanceof Promise?e.push(N.then(A=>ic(A,i,x,n,S))):ic(N,i,x,n,S)}return d.length&&i.issues.push({code:"unrecognized_keys",keys:d,input:n,inst:c}),e.length?Promise.all(e).then(()=>i):i}const B_=H("$ZodObject",(e,n)=>{if(ct.init(e,n),!Object.getOwnPropertyDescriptor(n,"shape")?.get){const h=n.shape;Object.defineProperty(n,"shape",{get:()=>{const g={...h};return Object.defineProperty(n,"shape",{value:g}),g}})}const r=yc(()=>Wv(n));Ge(e._zod,"propValues",()=>{const h=n.shape,g={};for(const b in h){const S=h[b]._zod;if(S.values){g[b]??(g[b]=new Set);for(const x of S.values)g[b].add(x)}}return g});const l=co,c=n.catchall;let d;e._zod.parse=(h,g)=>{d??(d=r.value);const b=h.value;if(!l(b))return h.issues.push({expected:"object",code:"invalid_type",input:b,inst:e}),h;h.value={};const S=[],x=d.shape;for(const N of d.keys){const A=x[N],T=A._zod.optout==="optional",k=A._zod.run({value:b[N],issues:[]},g);k instanceof Promise?S.push(k.then(E=>ic(E,h,N,b,T))):ic(k,h,N,b,T)}return c?e0(S,b,h,g,r.value,e):S.length?Promise.all(S).then(()=>h):h}}),L_=H("$ZodObjectJIT",(e,n)=>{B_.init(e,n);const i=e._zod.parse,r=yc(()=>Wv(n)),l=N=>{const A=new i_(["shape","payload","ctx"]),T=r.value,k=G=>{const Z=Fy(G);return`shape[${Z}]._zod.run({ value: input[${Z}], issues: [] }, ctx)`};A.write("const input = payload.value;");const E=Object.create(null);let R=0;for(const G of T.keys)E[G]=`key_${R++}`;A.write("const newResult = {};");for(const G of T.keys){const Z=E[G],X=Fy(G),O=N[G]?._zod?.optout==="optional";A.write(`const ${Z} = ${k(G)};`),O?A.write(`
|
|
17
17
|
if (${Z}.issues.length) {
|
|
18
18
|
if (${X} in input) {
|
|
19
19
|
payload.issues = payload.issues.concat(${Z}.issues.map(iss => ({
|
|
@@ -47,40 +47,40 @@ Error generating stack: `+o.message+`
|
|
|
47
47
|
newResult[${X}] = ${Z}.value;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
`)}A.write("payload.value = newResult;"),A.write("return payload;");const V=A.compile();return(G,Z)=>V(N,G,Z)};let c;const d=co,h=!Lv.jitless,b=h&&JA.value,S=n.catchall;let x;e._zod.parse=(N,A)=>{x??(x=r.value);const T=N.value;return d(T)?h&&b&&A?.async===!1&&A.jitless!==!0?(c||(c=l(n.shape)),N=c(N,A),S?e0([],T,N,A,x,e):N):i(N,A):(N.issues.push({expected:"object",code:"invalid_type",input:T,inst:e}),N)}});function tb(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=>!Ts(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=>Xa(d,r,Ya())))}),n)}const t0=H("$ZodUnion",(e,n)=>{ct.init(e,n),Ge(e._zod,"optin",()=>n.options.some(l=>l._zod.optin==="optional")?"optional":void 0),Ge(e._zod,"optout",()=>n.options.some(l=>l._zod.optout==="optional")?"optional":void 0),Ge(e._zod,"values",()=>{if(n.options.every(l=>l._zod.values))return new Set(n.options.flatMap(l=>Array.from(l._zod.values)))}),Ge(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=>Xf(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 h=[];for(const g of n.options){const b=g._zod.run({value:l.value,issues:[]},c);if(b instanceof Promise)h.push(b),d=!0;else{if(b.issues.length===0)return b;h.push(b)}}return d?Promise.all(h).then(g=>tb(g,l,e,c)):tb(h,l,e,c)}}),L_=H("$ZodDiscriminatedUnion",(e,n)=>{n.inclusive=!1,t0.init(e,n);const i=e._zod.parse;Ge(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[h,g]of Object.entries(d)){l[h]||(l[h]=new Set);for(const b of g)l[h].add(b)}}return l});const r=yc(()=>{const l=n.options,c=new Map;for(const d of l){const h=d._zod.propValues?.[n.discriminator];if(!h||h.size===0)throw new Error(`Invalid discriminated union option at index "${n.options.indexOf(d)}"`);for(const g of h){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(!co(d))return l.issues.push({code:"invalid_type",expected:"object",input:d,inst:e}),l;const h=r.value.get(d?.[n.discriminator]);return h?h._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)}}),q_=H("$ZodIntersection",(e,n)=>{ct.init(e,n),e._zod.parse=(i,r)=>{const l=i.value,c=n.left._zod.run({value:l,issues:[]},r),d=n.right._zod.run({value:l,issues:[]},r);return c instanceof Promise||d instanceof Promise?Promise.all([c,d]).then(([g,b])=>nb(i,g,b)):nb(i,c,d)}});function Nf(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(Us(e)&&Us(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=Nf(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=Nf(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 nb(e,n,i){const r=new Map;let l;for(const h of n.issues)if(h.code==="unrecognized_keys"){l??(l=h);for(const g of h.keys)r.has(g)||r.set(g,{}),r.get(g).l=!0}else e.issues.push(h);for(const h of i.issues)if(h.code==="unrecognized_keys")for(const g of h.keys)r.has(g)||r.set(g,{}),r.get(g).r=!0;else e.issues.push(h);const c=[...r].filter(([,h])=>h.l&&h.r).map(([h])=>h);if(c.length&&l&&e.issues.push({...l,keys:c}),Ts(e))return e;const d=Nf(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 U_=H("$ZodRecord",(e,n)=>{ct.init(e,n),e._zod.parse=(i,r)=>{const l=i.value;if(!Us(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 h=new Set;for(const b of d)if(typeof b=="string"||typeof b=="number"||typeof b=="symbol"){h.add(typeof b=="number"?b.toString():b);const S=n.valueType._zod.run({value:l[b],issues:[]},r);S instanceof Promise?c.push(S.then(x=>{x.issues.length&&i.issues.push(...Es(b,x.issues)),i.value[b]=x.value})):(S.issues.length&&i.issues.push(...Es(b,S.issues)),i.value[b]=S.value)}let g;for(const b in l)h.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 h of Reflect.ownKeys(l)){if(h==="__proto__")continue;let g=n.keyType._zod.run({value:h,issues:[]},r);if(g instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof h=="string"&&Kv.test(h)&&g.issues.length){const x=n.keyType._zod.run({value:Number(h),issues:[]},r);if(x instanceof Promise)throw new Error("Async schemas not supported in object keys currently");x.issues.length===0&&(g=x)}if(g.issues.length){n.mode==="loose"?i.value[h]=l[h]:i.issues.push({code:"invalid_key",origin:"record",issues:g.issues.map(x=>Xa(x,r,Ya())),input:h,path:[h],inst:e});continue}const S=n.valueType._zod.run({value:l[h],issues:[]},r);S instanceof Promise?c.push(S.then(x=>{x.issues.length&&i.issues.push(...Es(h,x.issues)),i.value[g.value]=x.value})):(S.issues.length&&i.issues.push(...Es(h,S.issues)),i.value[g.value]=S.value)}}return c.length?Promise.all(c).then(()=>i):i}}),$_=H("$ZodEnum",(e,n)=>{ct.init(e,n);const i=qv(n.entries),r=new Set(i);e._zod.values=r,e._zod.pattern=new RegExp(`^(${i.filter(l=>FA.has(typeof l)).map(l=>typeof l=="string"?$s(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}}),I_=H("$ZodLiteral",(e,n)=>{if(ct.init(e,n),n.values.length===0)throw new Error("Cannot create literal schema with no valid values");const i=new Set(n.values);e._zod.values=i,e._zod.pattern=new RegExp(`^(${n.values.map(r=>typeof r=="string"?$s(r):r?$s(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}}),V_=H("$ZodTransform",(e,n)=>{ct.init(e,n),e._zod.parse=(i,r)=>{if(r.direction==="backward")throw new Bv(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 Ms;return i.value=l,i}});function ab(e,n){return e.issues.length&&n===void 0?{issues:[],value:void 0}:e}const n0=H("$ZodOptional",(e,n)=>{ct.init(e,n),e._zod.optin="optional",e._zod.optout="optional",Ge(e._zod,"values",()=>n.innerType._zod.values?new Set([...n.innerType._zod.values,void 0]):void 0),Ge(e._zod,"pattern",()=>{const i=n.innerType._zod.pattern;return i?new RegExp(`^(${Xf(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=>ab(c,i.value)):ab(l,i.value)}return i.value===void 0?i:n.innerType._zod.run(i,r)}}),P_=H("$ZodExactOptional",(e,n)=>{n0.init(e,n),Ge(e._zod,"values",()=>n.innerType._zod.values),Ge(e._zod,"pattern",()=>n.innerType._zod.pattern),e._zod.parse=(i,r)=>n.innerType._zod.run(i,r)}),G_=H("$ZodNullable",(e,n)=>{ct.init(e,n),Ge(e._zod,"optin",()=>n.innerType._zod.optin),Ge(e._zod,"optout",()=>n.innerType._zod.optout),Ge(e._zod,"pattern",()=>{const i=n.innerType._zod.pattern;return i?new RegExp(`^(${Xf(i.source)}|null)$`):void 0}),Ge(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)}),H_=H("$ZodDefault",(e,n)=>{ct.init(e,n),e._zod.optin="optional",Ge(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=>ib(c,n)):ib(l,n)}});function ib(e,n){return e.value===void 0&&(e.value=n.defaultValue),e}const Q_=H("$ZodPrefault",(e,n)=>{ct.init(e,n),e._zod.optin="optional",Ge(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))}),K_=H("$ZodNonOptional",(e,n)=>{ct.init(e,n),Ge(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=>sb(c,e)):sb(l,e)}});function sb(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 Z_=H("$ZodCatch",(e,n)=>{ct.init(e,n),Ge(e._zod,"optin",()=>n.innerType._zod.optin),Ge(e._zod,"optout",()=>n.innerType._zod.optout),Ge(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=>Xa(d,r,Ya()))},input:i.value}),i.issues=[]),i)):(i.value=l.value,l.issues.length&&(i.value=n.catchValue({...i,error:{issues:l.issues.map(c=>Xa(c,r,Ya()))},input:i.value}),i.issues=[]),i)}}),Y_=H("$ZodPipe",(e,n)=>{ct.init(e,n),Ge(e._zod,"values",()=>n.in._zod.values),Ge(e._zod,"optin",()=>n.in._zod.optin),Ge(e._zod,"optout",()=>n.out._zod.optout),Ge(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=>Il(d,n.in,r)):Il(c,n.in,r)}const l=n.in._zod.run(i,r);return l instanceof Promise?l.then(c=>Il(c,n.out,r)):Il(l,n.out,r)}});function Il(e,n,i){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:e.value,issues:e.issues},i)}const X_=H("$ZodReadonly",(e,n)=>{ct.init(e,n),Ge(e._zod,"propValues",()=>n.innerType._zod.propValues),Ge(e._zod,"values",()=>n.innerType._zod.values),Ge(e._zod,"optin",()=>n.innerType?._zod?.optin),Ge(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(rb):rb(l)}});function rb(e){return e.value=Object.freeze(e.value),e}const J_=H("$ZodCustom",(e,n)=>{nn.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=>ob(c,i,r,e));ob(l,i,r,e)}});function ob(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(uo(l))}}var lb;class F_{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 W_(){return new F_}(lb=globalThis).__zod_globalRegistry??(lb.__zod_globalRegistry=W_());const io=globalThis.__zod_globalRegistry;function eC(e,n){return new e({type:"string",...be(n)})}function tC(e,n){return new e({type:"string",format:"email",check:"string_format",abort:!1,...be(n)})}function cb(e,n){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...be(n)})}function nC(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...be(n)})}function aC(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...be(n)})}function iC(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...be(n)})}function sC(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...be(n)})}function rC(e,n){return new e({type:"string",format:"url",check:"string_format",abort:!1,...be(n)})}function oC(e,n){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...be(n)})}function lC(e,n){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...be(n)})}function cC(e,n){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...be(n)})}function uC(e,n){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...be(n)})}function dC(e,n){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...be(n)})}function fC(e,n){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...be(n)})}function pC(e,n){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...be(n)})}function mC(e,n){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...be(n)})}function hC(e,n){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...be(n)})}function gC(e,n){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...be(n)})}function yC(e,n){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...be(n)})}function bC(e,n){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...be(n)})}function vC(e,n){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...be(n)})}function SC(e,n){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...be(n)})}function xC(e,n){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...be(n)})}function wC(e,n){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...be(n)})}function jC(e,n){return new e({type:"string",format:"date",check:"string_format",...be(n)})}function NC(e,n){return new e({type:"string",format:"time",check:"string_format",precision:null,...be(n)})}function kC(e,n){return new e({type:"string",format:"duration",check:"string_format",...be(n)})}function AC(e,n){return new e({type:"number",checks:[],...be(n)})}function _C(e,n){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...be(n)})}function CC(e,n){return new e({type:"boolean",...be(n)})}function zC(e){return new e({type:"unknown"})}function TC(e,n){return new e({type:"never",...be(n)})}function ub(e,n){return new Yv({check:"less_than",...be(n),value:e,inclusive:!1})}function af(e,n){return new Yv({check:"less_than",...be(n),value:e,inclusive:!0})}function db(e,n){return new Xv({check:"greater_than",...be(n),value:e,inclusive:!1})}function sf(e,n){return new Xv({check:"greater_than",...be(n),value:e,inclusive:!0})}function fb(e,n){return new H2({check:"multiple_of",...be(n),value:e})}function a0(e,n){return new K2({check:"max_length",...be(n),maximum:e})}function sc(e,n){return new Z2({check:"min_length",...be(n),minimum:e})}function i0(e,n){return new Y2({check:"length_equals",...be(n),length:e})}function EC(e,n){return new X2({check:"string_format",format:"regex",...be(n),pattern:e})}function OC(e){return new J2({check:"string_format",format:"lowercase",...be(e)})}function DC(e){return new F2({check:"string_format",format:"uppercase",...be(e)})}function RC(e,n){return new W2({check:"string_format",format:"includes",...be(n),includes:e})}function MC(e,n){return new e_({check:"string_format",format:"starts_with",...be(n),prefix:e})}function BC(e,n){return new t_({check:"string_format",format:"ends_with",...be(n),suffix:e})}function Ks(e){return new n_({check:"overwrite",tx:e})}function LC(e){return Ks(n=>n.normalize(e))}function qC(){return Ks(e=>e.trim())}function UC(){return Ks(e=>e.toLowerCase())}function $C(){return Ks(e=>e.toUpperCase())}function IC(){return Ks(e=>XA(e))}function VC(e,n,i){return new e({type:"array",element:n,...be(i)})}function PC(e,n,i){return new e({type:"custom",check:"custom",fn:n,...be(i)})}function GC(e){const n=HC(i=>(i.addIssue=r=>{if(typeof r=="string")i.issues.push(uo(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(uo(l))}},e(i.value,i)));return n}function HC(e,n){const i=new nn({check:"custom",...be(n)});return i._zod.check=e,i}function s0(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??io,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 kt(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 h=e._zod.toJSONSchema?.();if(h)d.schema=h;else{const S={...i,schemaPath:[...i.schemaPath,e],path:i.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(n,d.schema,S);else{const N=d.schema,A=n.processors[l.type];if(!A)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${l.type}`);A(e,n,N,S)}const x=e._zod.parent;x&&(d.ref||(d.ref=x),kt(x,n,S),n.seen.get(x).isParent=!0)}const g=n.metadataRegistry.get(e);return g&&Object.assign(d.schema,g),n.io==="input"&&Pt(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 r0(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 h=e.metadataRegistry.get(d[0])?.id;if(h){const g=r.get(h);if(g&&g!==d[0])throw new Error(`Duplicate schema id "${h}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(h,d[0])}}const l=d=>{const h=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const x=e.external.registry.get(d[0])?.id,N=e.external.uri??(T=>T);if(x)return{ref:N(x)};const A=d[1].defId??d[1].schema.id??`schema${e.counter++}`;return d[1].defId=A,{defId:A,ref:`${N("__shared")}#/${h}/${A}`}}if(d[1]===i)return{ref:"#"};const b=`#/${h}/`,S=d[1].schema.id??`__schema${e.counter++}`;return{defId:S,ref:b+S}},c=d=>{if(d[1].schema.$ref)return;const h=d[1],{ref:g,defId:b}=l(d);h.def={...h.schema},b&&(h.defId=b);const S=h.schema;for(const x in S)delete S[x];S.$ref=g};if(e.cycles==="throw")for(const d of e.seen.entries()){const h=d[1];if(h.cycle)throw new Error(`Cycle detected: #/${h.cycle?.join("/")}/<root>
|
|
50
|
+
`)}A.write("payload.value = newResult;"),A.write("return payload;");const V=A.compile();return(G,Z)=>V(N,G,Z)};let c;const d=co,h=!Lv.jitless,b=h&&FA.value,S=n.catchall;let x;e._zod.parse=(N,A)=>{x??(x=r.value);const T=N.value;return d(T)?h&&b&&A?.async===!1&&A.jitless!==!0?(c||(c=l(n.shape)),N=c(N,A),S?e0([],T,N,A,x,e):N):i(N,A):(N.issues.push({expected:"object",code:"invalid_type",input:T,inst:e}),N)}});function tb(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=>!Ts(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=>Xa(d,r,Ya())))}),n)}const t0=H("$ZodUnion",(e,n)=>{ct.init(e,n),Ge(e._zod,"optin",()=>n.options.some(l=>l._zod.optin==="optional")?"optional":void 0),Ge(e._zod,"optout",()=>n.options.some(l=>l._zod.optout==="optional")?"optional":void 0),Ge(e._zod,"values",()=>{if(n.options.every(l=>l._zod.values))return new Set(n.options.flatMap(l=>Array.from(l._zod.values)))}),Ge(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=>Xf(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 h=[];for(const g of n.options){const b=g._zod.run({value:l.value,issues:[]},c);if(b instanceof Promise)h.push(b),d=!0;else{if(b.issues.length===0)return b;h.push(b)}}return d?Promise.all(h).then(g=>tb(g,l,e,c)):tb(h,l,e,c)}}),q_=H("$ZodDiscriminatedUnion",(e,n)=>{n.inclusive=!1,t0.init(e,n);const i=e._zod.parse;Ge(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[h,g]of Object.entries(d)){l[h]||(l[h]=new Set);for(const b of g)l[h].add(b)}}return l});const r=yc(()=>{const l=n.options,c=new Map;for(const d of l){const h=d._zod.propValues?.[n.discriminator];if(!h||h.size===0)throw new Error(`Invalid discriminated union option at index "${n.options.indexOf(d)}"`);for(const g of h){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(!co(d))return l.issues.push({code:"invalid_type",expected:"object",input:d,inst:e}),l;const h=r.value.get(d?.[n.discriminator]);return h?h._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)}}),U_=H("$ZodIntersection",(e,n)=>{ct.init(e,n),e._zod.parse=(i,r)=>{const l=i.value,c=n.left._zod.run({value:l,issues:[]},r),d=n.right._zod.run({value:l,issues:[]},r);return c instanceof Promise||d instanceof Promise?Promise.all([c,d]).then(([g,b])=>nb(i,g,b)):nb(i,c,d)}});function Nf(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(Us(e)&&Us(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=Nf(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=Nf(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 nb(e,n,i){const r=new Map;let l;for(const h of n.issues)if(h.code==="unrecognized_keys"){l??(l=h);for(const g of h.keys)r.has(g)||r.set(g,{}),r.get(g).l=!0}else e.issues.push(h);for(const h of i.issues)if(h.code==="unrecognized_keys")for(const g of h.keys)r.has(g)||r.set(g,{}),r.get(g).r=!0;else e.issues.push(h);const c=[...r].filter(([,h])=>h.l&&h.r).map(([h])=>h);if(c.length&&l&&e.issues.push({...l,keys:c}),Ts(e))return e;const d=Nf(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 $_=H("$ZodRecord",(e,n)=>{ct.init(e,n),e._zod.parse=(i,r)=>{const l=i.value;if(!Us(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 h=new Set;for(const b of d)if(typeof b=="string"||typeof b=="number"||typeof b=="symbol"){h.add(typeof b=="number"?b.toString():b);const S=n.valueType._zod.run({value:l[b],issues:[]},r);S instanceof Promise?c.push(S.then(x=>{x.issues.length&&i.issues.push(...Es(b,x.issues)),i.value[b]=x.value})):(S.issues.length&&i.issues.push(...Es(b,S.issues)),i.value[b]=S.value)}let g;for(const b in l)h.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 h of Reflect.ownKeys(l)){if(h==="__proto__")continue;let g=n.keyType._zod.run({value:h,issues:[]},r);if(g instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof h=="string"&&Kv.test(h)&&g.issues.length){const x=n.keyType._zod.run({value:Number(h),issues:[]},r);if(x instanceof Promise)throw new Error("Async schemas not supported in object keys currently");x.issues.length===0&&(g=x)}if(g.issues.length){n.mode==="loose"?i.value[h]=l[h]:i.issues.push({code:"invalid_key",origin:"record",issues:g.issues.map(x=>Xa(x,r,Ya())),input:h,path:[h],inst:e});continue}const S=n.valueType._zod.run({value:l[h],issues:[]},r);S instanceof Promise?c.push(S.then(x=>{x.issues.length&&i.issues.push(...Es(h,x.issues)),i.value[g.value]=x.value})):(S.issues.length&&i.issues.push(...Es(h,S.issues)),i.value[g.value]=S.value)}}return c.length?Promise.all(c).then(()=>i):i}}),I_=H("$ZodEnum",(e,n)=>{ct.init(e,n);const i=qv(n.entries),r=new Set(i);e._zod.values=r,e._zod.pattern=new RegExp(`^(${i.filter(l=>WA.has(typeof l)).map(l=>typeof l=="string"?$s(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}}),V_=H("$ZodLiteral",(e,n)=>{if(ct.init(e,n),n.values.length===0)throw new Error("Cannot create literal schema with no valid values");const i=new Set(n.values);e._zod.values=i,e._zod.pattern=new RegExp(`^(${n.values.map(r=>typeof r=="string"?$s(r):r?$s(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}}),P_=H("$ZodTransform",(e,n)=>{ct.init(e,n),e._zod.parse=(i,r)=>{if(r.direction==="backward")throw new Bv(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 Ms;return i.value=l,i}});function ab(e,n){return e.issues.length&&n===void 0?{issues:[],value:void 0}:e}const n0=H("$ZodOptional",(e,n)=>{ct.init(e,n),e._zod.optin="optional",e._zod.optout="optional",Ge(e._zod,"values",()=>n.innerType._zod.values?new Set([...n.innerType._zod.values,void 0]):void 0),Ge(e._zod,"pattern",()=>{const i=n.innerType._zod.pattern;return i?new RegExp(`^(${Xf(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=>ab(c,i.value)):ab(l,i.value)}return i.value===void 0?i:n.innerType._zod.run(i,r)}}),G_=H("$ZodExactOptional",(e,n)=>{n0.init(e,n),Ge(e._zod,"values",()=>n.innerType._zod.values),Ge(e._zod,"pattern",()=>n.innerType._zod.pattern),e._zod.parse=(i,r)=>n.innerType._zod.run(i,r)}),H_=H("$ZodNullable",(e,n)=>{ct.init(e,n),Ge(e._zod,"optin",()=>n.innerType._zod.optin),Ge(e._zod,"optout",()=>n.innerType._zod.optout),Ge(e._zod,"pattern",()=>{const i=n.innerType._zod.pattern;return i?new RegExp(`^(${Xf(i.source)}|null)$`):void 0}),Ge(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)}),Q_=H("$ZodDefault",(e,n)=>{ct.init(e,n),e._zod.optin="optional",Ge(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=>ib(c,n)):ib(l,n)}});function ib(e,n){return e.value===void 0&&(e.value=n.defaultValue),e}const K_=H("$ZodPrefault",(e,n)=>{ct.init(e,n),e._zod.optin="optional",Ge(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))}),Z_=H("$ZodNonOptional",(e,n)=>{ct.init(e,n),Ge(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=>sb(c,e)):sb(l,e)}});function sb(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 Y_=H("$ZodCatch",(e,n)=>{ct.init(e,n),Ge(e._zod,"optin",()=>n.innerType._zod.optin),Ge(e._zod,"optout",()=>n.innerType._zod.optout),Ge(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=>Xa(d,r,Ya()))},input:i.value}),i.issues=[]),i)):(i.value=l.value,l.issues.length&&(i.value=n.catchValue({...i,error:{issues:l.issues.map(c=>Xa(c,r,Ya()))},input:i.value}),i.issues=[]),i)}}),X_=H("$ZodPipe",(e,n)=>{ct.init(e,n),Ge(e._zod,"values",()=>n.in._zod.values),Ge(e._zod,"optin",()=>n.in._zod.optin),Ge(e._zod,"optout",()=>n.out._zod.optout),Ge(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=>Il(d,n.in,r)):Il(c,n.in,r)}const l=n.in._zod.run(i,r);return l instanceof Promise?l.then(c=>Il(c,n.out,r)):Il(l,n.out,r)}});function Il(e,n,i){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:e.value,issues:e.issues},i)}const J_=H("$ZodReadonly",(e,n)=>{ct.init(e,n),Ge(e._zod,"propValues",()=>n.innerType._zod.propValues),Ge(e._zod,"values",()=>n.innerType._zod.values),Ge(e._zod,"optin",()=>n.innerType?._zod?.optin),Ge(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(rb):rb(l)}});function rb(e){return e.value=Object.freeze(e.value),e}const F_=H("$ZodCustom",(e,n)=>{nn.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=>ob(c,i,r,e));ob(l,i,r,e)}});function ob(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(uo(l))}}var lb;class W_{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 eC(){return new W_}(lb=globalThis).__zod_globalRegistry??(lb.__zod_globalRegistry=eC());const io=globalThis.__zod_globalRegistry;function tC(e,n){return new e({type:"string",...be(n)})}function nC(e,n){return new e({type:"string",format:"email",check:"string_format",abort:!1,...be(n)})}function cb(e,n){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...be(n)})}function aC(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...be(n)})}function iC(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...be(n)})}function sC(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...be(n)})}function rC(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...be(n)})}function oC(e,n){return new e({type:"string",format:"url",check:"string_format",abort:!1,...be(n)})}function lC(e,n){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...be(n)})}function cC(e,n){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...be(n)})}function uC(e,n){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...be(n)})}function dC(e,n){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...be(n)})}function fC(e,n){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...be(n)})}function pC(e,n){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...be(n)})}function mC(e,n){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...be(n)})}function hC(e,n){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...be(n)})}function gC(e,n){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...be(n)})}function yC(e,n){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...be(n)})}function bC(e,n){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...be(n)})}function vC(e,n){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...be(n)})}function SC(e,n){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...be(n)})}function xC(e,n){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...be(n)})}function wC(e,n){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...be(n)})}function jC(e,n){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...be(n)})}function NC(e,n){return new e({type:"string",format:"date",check:"string_format",...be(n)})}function kC(e,n){return new e({type:"string",format:"time",check:"string_format",precision:null,...be(n)})}function AC(e,n){return new e({type:"string",format:"duration",check:"string_format",...be(n)})}function _C(e,n){return new e({type:"number",checks:[],...be(n)})}function CC(e,n){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...be(n)})}function zC(e,n){return new e({type:"boolean",...be(n)})}function TC(e){return new e({type:"unknown"})}function EC(e,n){return new e({type:"never",...be(n)})}function ub(e,n){return new Yv({check:"less_than",...be(n),value:e,inclusive:!1})}function af(e,n){return new Yv({check:"less_than",...be(n),value:e,inclusive:!0})}function db(e,n){return new Xv({check:"greater_than",...be(n),value:e,inclusive:!1})}function sf(e,n){return new Xv({check:"greater_than",...be(n),value:e,inclusive:!0})}function fb(e,n){return new Q2({check:"multiple_of",...be(n),value:e})}function a0(e,n){return new Z2({check:"max_length",...be(n),maximum:e})}function sc(e,n){return new Y2({check:"min_length",...be(n),minimum:e})}function i0(e,n){return new X2({check:"length_equals",...be(n),length:e})}function OC(e,n){return new J2({check:"string_format",format:"regex",...be(n),pattern:e})}function DC(e){return new F2({check:"string_format",format:"lowercase",...be(e)})}function RC(e){return new W2({check:"string_format",format:"uppercase",...be(e)})}function MC(e,n){return new e_({check:"string_format",format:"includes",...be(n),includes:e})}function BC(e,n){return new t_({check:"string_format",format:"starts_with",...be(n),prefix:e})}function LC(e,n){return new n_({check:"string_format",format:"ends_with",...be(n),suffix:e})}function Ks(e){return new a_({check:"overwrite",tx:e})}function qC(e){return Ks(n=>n.normalize(e))}function UC(){return Ks(e=>e.trim())}function $C(){return Ks(e=>e.toLowerCase())}function IC(){return Ks(e=>e.toUpperCase())}function VC(){return Ks(e=>JA(e))}function PC(e,n,i){return new e({type:"array",element:n,...be(i)})}function GC(e,n,i){return new e({type:"custom",check:"custom",fn:n,...be(i)})}function HC(e){const n=QC(i=>(i.addIssue=r=>{if(typeof r=="string")i.issues.push(uo(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(uo(l))}},e(i.value,i)));return n}function QC(e,n){const i=new nn({check:"custom",...be(n)});return i._zod.check=e,i}function s0(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??io,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 kt(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 h=e._zod.toJSONSchema?.();if(h)d.schema=h;else{const S={...i,schemaPath:[...i.schemaPath,e],path:i.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(n,d.schema,S);else{const N=d.schema,A=n.processors[l.type];if(!A)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${l.type}`);A(e,n,N,S)}const x=e._zod.parent;x&&(d.ref||(d.ref=x),kt(x,n,S),n.seen.get(x).isParent=!0)}const g=n.metadataRegistry.get(e);return g&&Object.assign(d.schema,g),n.io==="input"&&Pt(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 r0(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 h=e.metadataRegistry.get(d[0])?.id;if(h){const g=r.get(h);if(g&&g!==d[0])throw new Error(`Duplicate schema id "${h}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(h,d[0])}}const l=d=>{const h=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const x=e.external.registry.get(d[0])?.id,N=e.external.uri??(T=>T);if(x)return{ref:N(x)};const A=d[1].defId??d[1].schema.id??`schema${e.counter++}`;return d[1].defId=A,{defId:A,ref:`${N("__shared")}#/${h}/${A}`}}if(d[1]===i)return{ref:"#"};const b=`#/${h}/`,S=d[1].schema.id??`__schema${e.counter++}`;return{defId:S,ref:b+S}},c=d=>{if(d[1].schema.$ref)return;const h=d[1],{ref:g,defId:b}=l(d);h.def={...h.schema},b&&(h.defId=b);const S=h.schema;for(const x in S)delete S[x];S.$ref=g};if(e.cycles==="throw")for(const d of e.seen.entries()){const h=d[1];if(h.cycle)throw new Error(`Cycle detected: #/${h.cycle?.join("/")}/<root>
|
|
51
51
|
|
|
52
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const d of e.seen.entries()){const h=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(h.cycle){c(d);continue}if(h.count>1&&e.reused==="ref"){c(d);continue}}}function o0(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 h=e.seen.get(d);if(h.ref===null)return;const g=h.def??h.schema,b={...g},S=h.ref;if(h.ref=null,S){r(S);const N=e.seen.get(S),A=N.schema;if(A.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(g.allOf=g.allOf??[],g.allOf.push(A)):Object.assign(g,A),Object.assign(g,b),d._zod.parent===S)for(const k in g)k==="$ref"||k==="allOf"||k in b||delete g[k];if(A.$ref&&N.def)for(const k in g)k==="$ref"||k==="allOf"||k in N.def&&JSON.stringify(g[k])===JSON.stringify(N.def[k])&&delete g[k]}const x=d._zod.parent;if(x&&x!==S){r(x);const N=e.seen.get(x);if(N?.schema.$ref&&(g.$ref=N.schema.$ref,N.def))for(const A in g)A==="$ref"||A==="allOf"||A in N.def&&JSON.stringify(g[A])===JSON.stringify(N.def[A])&&delete g[A]}e.override({zodSchema:d,jsonSchema:g,path:h.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 h=d[1];h.def&&h.defId&&(c[h.defId]=h.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:rc(n,"input",e.processors),output:rc(n,"output",e.processors)}},enumerable:!1,writable:!1}),d}catch{throw new Error("Error converting schema to JSON.")}}function Pt(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 Pt(r.element,i);if(r.type==="set")return Pt(r.valueType,i);if(r.type==="lazy")return Pt(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 Pt(r.innerType,i);if(r.type==="intersection")return Pt(r.left,i)||Pt(r.right,i);if(r.type==="record"||r.type==="map")return Pt(r.keyType,i)||Pt(r.valueType,i);if(r.type==="pipe")return Pt(r.in,i)||Pt(r.out,i);if(r.type==="object"){for(const l in r.shape)if(Pt(r.shape[l],i))return!0;return!1}if(r.type==="union"){for(const l of r.options)if(Pt(l,i))return!0;return!1}if(r.type==="tuple"){for(const l of r.items)if(Pt(l,i))return!0;return!!(r.rest&&Pt(r.rest,i))}return!1}const QC=(e,n={})=>i=>{const r=s0({...i,processors:n});return kt(e,r),r0(r,e),o0(r,e)},rc=(e,n,i={})=>r=>{const{libraryOptions:l,target:c}=r??{},d=s0({...l??{},target:c,io:n,processors:i});return kt(e,d),r0(d,e),o0(d,e)},KC={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},ZC=(e,n,i,r)=>{const l=i;l.type="string";const{minimum:c,maximum:d,format:h,patterns:g,contentEncoding:b}=e._zod.bag;if(typeof c=="number"&&(l.minLength=c),typeof d=="number"&&(l.maxLength=d),h&&(l.format=KC[h]??h,l.format===""&&delete l.format,h==="time"&&delete l.format),b&&(l.contentEncoding=b),g&&g.size>0){const S=[...g];S.length===1?l.pattern=S[0].source:S.length>1&&(l.allOf=[...S.map(x=>({...n.target==="draft-07"||n.target==="draft-04"||n.target==="openapi-3.0"?{type:"string"}:{},pattern:x.source}))])}},YC=(e,n,i,r)=>{const l=i,{minimum:c,maximum:d,format:h,multipleOf:g,exclusiveMaximum:b,exclusiveMinimum:S}=e._zod.bag;typeof h=="string"&&h.includes("int")?l.type="integer":l.type="number",typeof S=="number"&&(n.target==="draft-04"||n.target==="openapi-3.0"?(l.minimum=S,l.exclusiveMinimum=!0):l.exclusiveMinimum=S),typeof c=="number"&&(l.minimum=c,typeof S=="number"&&n.target!=="draft-04"&&(S>=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)},XC=(e,n,i,r)=>{i.type="boolean"},JC=(e,n,i,r)=>{i.not={}},FC=(e,n,i,r)=>{},WC=(e,n,i,r)=>{const l=e._zod.def,c=qv(l.entries);c.every(d=>typeof d=="number")&&(i.type="number"),c.every(d=>typeof d=="string")&&(i.type="string"),i.enum=c},ez=(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},tz=(e,n,i,r)=>{if(n.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},nz=(e,n,i,r)=>{if(n.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},az=(e,n,i,r)=>{const l=i,c=e._zod.def,{minimum:d,maximum:h}=e._zod.bag;typeof d=="number"&&(l.minItems=d),typeof h=="number"&&(l.maxItems=h),l.type="array",l.items=kt(c.element,n,{...r,path:[...r.path,"items"]})},iz=(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]=kt(d[b],n,{...r,path:[...r.path,"properties",b]});const h=new Set(Object.keys(d)),g=new Set([...h].filter(b=>{const S=c.shape[b]._zod;return n.io==="input"?S.optin===void 0:S.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=kt(c.catchall,n,{...r,path:[...r.path,"additionalProperties"]})):n.io==="output"&&(l.additionalProperties=!1)},sz=(e,n,i,r)=>{const l=e._zod.def,c=l.inclusive===!1,d=l.options.map((h,g)=>kt(h,n,{...r,path:[...r.path,c?"oneOf":"anyOf",g]}));c?i.oneOf=d:i.anyOf=d},rz=(e,n,i,r)=>{const l=e._zod.def,c=kt(l.left,n,{...r,path:[...r.path,"allOf",0]}),d=kt(l.right,n,{...r,path:[...r.path,"allOf",1]}),h=b=>"allOf"in b&&Object.keys(b).length===1,g=[...h(c)?c.allOf:[c],...h(d)?d.allOf:[d]];i.allOf=g},oz=(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 S=kt(c.valueType,n,{...r,path:[...r.path,"patternProperties","*"]});l.patternProperties={};for(const x of g)l.patternProperties[x.source]=S}else(n.target==="draft-07"||n.target==="draft-2020-12")&&(l.propertyNames=kt(c.keyType,n,{...r,path:[...r.path,"propertyNames"]})),l.additionalProperties=kt(c.valueType,n,{...r,path:[...r.path,"additionalProperties"]});const b=d._zod.values;if(b){const S=[...b].filter(x=>typeof x=="string"||typeof x=="number");S.length>0&&(l.required=S)}},lz=(e,n,i,r)=>{const l=e._zod.def,c=kt(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"}]},cz=(e,n,i,r)=>{const l=e._zod.def;kt(l.innerType,n,r);const c=n.seen.get(e);c.ref=l.innerType},uz=(e,n,i,r)=>{const l=e._zod.def;kt(l.innerType,n,r);const c=n.seen.get(e);c.ref=l.innerType,i.default=JSON.parse(JSON.stringify(l.defaultValue))},dz=(e,n,i,r)=>{const l=e._zod.def;kt(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)))},fz=(e,n,i,r)=>{const l=e._zod.def;kt(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},pz=(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;kt(c,n,r);const d=n.seen.get(e);d.ref=c},mz=(e,n,i,r)=>{const l=e._zod.def;kt(l.innerType,n,r);const c=n.seen.get(e);c.ref=l.innerType,i.readOnly=!0},l0=(e,n,i,r)=>{const l=e._zod.def;kt(l.innerType,n,r);const c=n.seen.get(e);c.ref=l.innerType},hz=H("ZodISODateTime",(e,n)=>{g_.init(e,n),dt.init(e,n)});function gz(e){return wC(hz,e)}const yz=H("ZodISODate",(e,n)=>{y_.init(e,n),dt.init(e,n)});function bz(e){return jC(yz,e)}const vz=H("ZodISOTime",(e,n)=>{b_.init(e,n),dt.init(e,n)});function Sz(e){return NC(vz,e)}const xz=H("ZodISODuration",(e,n)=>{v_.init(e,n),dt.init(e,n)});function wz(e){return kC(xz,e)}const jz=(e,n)=>{Vv.init(e,n),e.name="ZodError",Object.defineProperties(e,{format:{value:i=>c2(e,i)},flatten:{value:i=>l2(e,i)},addIssue:{value:i=>{e.issues.push(i),e.message=JSON.stringify(e.issues,jf,2)}},addIssues:{value:i=>{e.issues.push(...i),e.message=JSON.stringify(e.issues,jf,2)}},isEmpty:{get(){return e.issues.length===0}}})},_n=H("ZodError",jz,{Parent:Error}),Nz=Ff(_n),kz=Wf(_n),Az=bc(_n),_z=vc(_n),Cz=f2(_n),zz=p2(_n),Tz=m2(_n),Ez=h2(_n),Oz=g2(_n),Dz=y2(_n),Rz=b2(_n),Mz=v2(_n),ut=H("ZodType",(e,n)=>(ct.init(e,n),Object.assign(e["~standard"],{jsonSchema:{input:rc(e,"input"),output:rc(e,"output")}}),e.toJSONSchema=QC(e,{}),e.def=n,e.type=n.type,Object.defineProperty(e,"_def",{value:n}),e.check=(...i)=>e.clone(Fa(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)=>Wa(e,i,r),e.brand=()=>e,e.register=((i,r)=>(i.add(e,r),e)),e.parse=(i,r)=>Nz(e,i,r,{callee:e.parse}),e.safeParse=(i,r)=>Az(e,i,r),e.parseAsync=async(i,r)=>kz(e,i,r,{callee:e.parseAsync}),e.safeParseAsync=async(i,r)=>_z(e,i,r),e.spa=e.safeParseAsync,e.encode=(i,r)=>Cz(e,i,r),e.decode=(i,r)=>zz(e,i,r),e.encodeAsync=async(i,r)=>Tz(e,i,r),e.decodeAsync=async(i,r)=>Ez(e,i,r),e.safeEncode=(i,r)=>Oz(e,i,r),e.safeDecode=(i,r)=>Dz(e,i,r),e.safeEncodeAsync=async(i,r)=>Rz(e,i,r),e.safeDecodeAsync=async(i,r)=>Mz(e,i,r),e.refine=(i,r)=>e.check(CT(i,r)),e.superRefine=i=>e.check(zT(i)),e.overwrite=i=>e.check(Ks(i)),e.optional=()=>hb(e),e.exactOptional=()=>hT(e),e.nullable=()=>gb(e),e.nullish=()=>hb(gb(e)),e.nonoptional=i=>xT(e,i),e.array=()=>_(e),e.or=i=>f0([e,i]),e.and=i=>cT(e,i),e.transform=i=>yb(e,pT(i)),e.default=i=>bT(e,i),e.prefault=i=>ST(e,i),e.catch=i=>jT(e,i),e.pipe=i=>yb(e,i),e.readonly=()=>AT(e),e.describe=i=>{const r=e.clone();return io.add(r,{description:i}),r},Object.defineProperty(e,"description",{get(){return io.get(e)?.description},configurable:!0}),e.meta=(...i)=>{if(i.length===0)return io.get(e);const r=e.clone();return io.add(r,i[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=i=>i(e),e)),c0=H("_ZodString",(e,n)=>{ep.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(r,l,c)=>ZC(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(EC(...r)),e.includes=(...r)=>e.check(RC(...r)),e.startsWith=(...r)=>e.check(MC(...r)),e.endsWith=(...r)=>e.check(BC(...r)),e.min=(...r)=>e.check(sc(...r)),e.max=(...r)=>e.check(a0(...r)),e.length=(...r)=>e.check(i0(...r)),e.nonempty=(...r)=>e.check(sc(1,...r)),e.lowercase=r=>e.check(OC(r)),e.uppercase=r=>e.check(DC(r)),e.trim=()=>e.check(qC()),e.normalize=(...r)=>e.check(LC(...r)),e.toLowerCase=()=>e.check(UC()),e.toUpperCase=()=>e.check($C()),e.slugify=()=>e.check(IC())}),Bz=H("ZodString",(e,n)=>{ep.init(e,n),c0.init(e,n),e.email=i=>e.check(tC(Lz,i)),e.url=i=>e.check(rC(qz,i)),e.jwt=i=>e.check(xC(Wz,i)),e.emoji=i=>e.check(oC(Uz,i)),e.guid=i=>e.check(cb(pb,i)),e.uuid=i=>e.check(nC(Vl,i)),e.uuidv4=i=>e.check(aC(Vl,i)),e.uuidv6=i=>e.check(iC(Vl,i)),e.uuidv7=i=>e.check(sC(Vl,i)),e.nanoid=i=>e.check(lC($z,i)),e.guid=i=>e.check(cb(pb,i)),e.cuid=i=>e.check(cC(Iz,i)),e.cuid2=i=>e.check(uC(Vz,i)),e.ulid=i=>e.check(dC(Pz,i)),e.base64=i=>e.check(bC(Xz,i)),e.base64url=i=>e.check(vC(Jz,i)),e.xid=i=>e.check(fC(Gz,i)),e.ksuid=i=>e.check(pC(Hz,i)),e.ipv4=i=>e.check(mC(Qz,i)),e.ipv6=i=>e.check(hC(Kz,i)),e.cidrv4=i=>e.check(gC(Zz,i)),e.cidrv6=i=>e.check(yC(Yz,i)),e.e164=i=>e.check(SC(Fz,i)),e.datetime=i=>e.check(gz(i)),e.date=i=>e.check(bz(i)),e.time=i=>e.check(Sz(i)),e.duration=i=>e.check(wz(i))});function m(e){return eC(Bz,e)}const dt=H("ZodStringFormat",(e,n)=>{lt.init(e,n),c0.init(e,n)}),Lz=H("ZodEmail",(e,n)=>{o_.init(e,n),dt.init(e,n)}),pb=H("ZodGUID",(e,n)=>{s_.init(e,n),dt.init(e,n)}),Vl=H("ZodUUID",(e,n)=>{r_.init(e,n),dt.init(e,n)}),qz=H("ZodURL",(e,n)=>{l_.init(e,n),dt.init(e,n)}),Uz=H("ZodEmoji",(e,n)=>{c_.init(e,n),dt.init(e,n)}),$z=H("ZodNanoID",(e,n)=>{u_.init(e,n),dt.init(e,n)}),Iz=H("ZodCUID",(e,n)=>{d_.init(e,n),dt.init(e,n)}),Vz=H("ZodCUID2",(e,n)=>{f_.init(e,n),dt.init(e,n)}),Pz=H("ZodULID",(e,n)=>{p_.init(e,n),dt.init(e,n)}),Gz=H("ZodXID",(e,n)=>{m_.init(e,n),dt.init(e,n)}),Hz=H("ZodKSUID",(e,n)=>{h_.init(e,n),dt.init(e,n)}),Qz=H("ZodIPv4",(e,n)=>{S_.init(e,n),dt.init(e,n)}),Kz=H("ZodIPv6",(e,n)=>{x_.init(e,n),dt.init(e,n)}),Zz=H("ZodCIDRv4",(e,n)=>{w_.init(e,n),dt.init(e,n)}),Yz=H("ZodCIDRv6",(e,n)=>{j_.init(e,n),dt.init(e,n)}),Xz=H("ZodBase64",(e,n)=>{N_.init(e,n),dt.init(e,n)}),Jz=H("ZodBase64URL",(e,n)=>{A_.init(e,n),dt.init(e,n)}),Fz=H("ZodE164",(e,n)=>{__.init(e,n),dt.init(e,n)}),Wz=H("ZodJWT",(e,n)=>{z_.init(e,n),dt.init(e,n)}),u0=H("ZodNumber",(e,n)=>{Fv.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(r,l,c)=>YC(e,r,l),e.gt=(r,l)=>e.check(db(r,l)),e.gte=(r,l)=>e.check(sf(r,l)),e.min=(r,l)=>e.check(sf(r,l)),e.lt=(r,l)=>e.check(ub(r,l)),e.lte=(r,l)=>e.check(af(r,l)),e.max=(r,l)=>e.check(af(r,l)),e.int=r=>e.check(mb(r)),e.safe=r=>e.check(mb(r)),e.positive=r=>e.check(db(0,r)),e.nonnegative=r=>e.check(sf(0,r)),e.negative=r=>e.check(ub(0,r)),e.nonpositive=r=>e.check(af(0,r)),e.multipleOf=(r,l)=>e.check(fb(r,l)),e.step=(r,l)=>e.check(fb(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 v(e){return AC(u0,e)}const eT=H("ZodNumberFormat",(e,n)=>{T_.init(e,n),u0.init(e,n)});function mb(e){return _C(eT,e)}const tT=H("ZodBoolean",(e,n)=>{E_.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(i,r,l)=>XC(e,i,r)});function re(e){return CC(tT,e)}const nT=H("ZodUnknown",(e,n)=>{O_.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(i,r,l)=>FC()});function ga(){return zC(nT)}const aT=H("ZodNever",(e,n)=>{D_.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(i,r,l)=>JC(e,i,r)});function iT(e){return TC(aT,e)}const sT=H("ZodArray",(e,n)=>{R_.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(i,r,l)=>az(e,i,r,l),e.element=n.element,e.min=(i,r)=>e.check(sc(i,r)),e.nonempty=i=>e.check(sc(1,i)),e.max=(i,r)=>e.check(a0(i,r)),e.length=(i,r)=>e.check(i0(i,r)),e.unwrap=()=>e.element});function _(e,n){return VC(sT,e,n)}const rT=H("ZodObject",(e,n)=>{B_.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(i,r,l)=>iz(e,i,r,l),Ge(e,"shape",()=>n.shape),e.keyof=()=>ie(Object.keys(e._zod.def.shape)),e.catchall=i=>e.clone({...e._zod.def,catchall:i}),e.passthrough=()=>e.clone({...e._zod.def,catchall:ga()}),e.loose=()=>e.clone({...e._zod.def,catchall:ga()}),e.strict=()=>e.clone({...e._zod.def,catchall:iT()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=i=>a2(e,i),e.safeExtend=i=>i2(e,i),e.merge=i=>s2(e,i),e.pick=i=>t2(e,i),e.omit=i=>n2(e,i),e.partial=(...i)=>r2(m0,e,i[0]),e.required=(...i)=>o2(h0,e,i[0])});function j(e,n){const i={type:"object",shape:e??{},...be(n)};return new rT(i)}const d0=H("ZodUnion",(e,n)=>{t0.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(i,r,l)=>sz(e,i,r,l),e.options=n.options});function f0(e,n){return new d0({type:"union",options:e,...be(n)})}const oT=H("ZodDiscriminatedUnion",(e,n)=>{d0.init(e,n),L_.init(e,n)});function p0(e,n,i){return new oT({type:"union",options:n,discriminator:e,...be(i)})}const lT=H("ZodIntersection",(e,n)=>{q_.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(i,r,l)=>rz(e,i,r,l)});function cT(e,n){return new lT({type:"intersection",left:e,right:n})}const uT=H("ZodRecord",(e,n)=>{U_.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(i,r,l)=>oz(e,i,r,l),e.keyType=n.keyType,e.valueType=n.valueType});function mt(e,n,i){return new uT({type:"record",keyType:e,valueType:n,...be(i)})}const kf=H("ZodEnum",(e,n)=>{$_.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(r,l,c)=>WC(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 kf({...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 kf({...n,checks:[],...be(l),entries:c})}});function ie(e,n){const i=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new kf({type:"enum",entries:i,...be(n)})}const dT=H("ZodLiteral",(e,n)=>{I_.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(i,r,l)=>ez(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 qt(e,n){return new dT({type:"literal",values:Array.isArray(e)?e:[e],...be(n)})}const fT=H("ZodTransform",(e,n)=>{V_.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(i,r,l)=>nz(e,i),e._zod.parse=(i,r)=>{if(r.direction==="backward")throw new Bv(e.constructor.name);i.addIssue=c=>{if(typeof c=="string")i.issues.push(uo(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(uo(d))}};const l=n.transform(i.value,i);return l instanceof Promise?l.then(c=>(i.value=c,i)):(i.value=l,i)}});function pT(e){return new fT({type:"transform",transform:e})}const m0=H("ZodOptional",(e,n)=>{n0.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(i,r,l)=>l0(e,i,r,l),e.unwrap=()=>e._zod.def.innerType});function hb(e){return new m0({type:"optional",innerType:e})}const mT=H("ZodExactOptional",(e,n)=>{P_.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(i,r,l)=>l0(e,i,r,l),e.unwrap=()=>e._zod.def.innerType});function hT(e){return new mT({type:"optional",innerType:e})}const gT=H("ZodNullable",(e,n)=>{G_.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(i,r,l)=>lz(e,i,r,l),e.unwrap=()=>e._zod.def.innerType});function gb(e){return new gT({type:"nullable",innerType:e})}const yT=H("ZodDefault",(e,n)=>{H_.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(i,r,l)=>uz(e,i,r,l),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function bT(e,n){return new yT({type:"default",innerType:e,get defaultValue(){return typeof n=="function"?n():$v(n)}})}const vT=H("ZodPrefault",(e,n)=>{Q_.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(i,r,l)=>dz(e,i,r,l),e.unwrap=()=>e._zod.def.innerType});function ST(e,n){return new vT({type:"prefault",innerType:e,get defaultValue(){return typeof n=="function"?n():$v(n)}})}const h0=H("ZodNonOptional",(e,n)=>{K_.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(i,r,l)=>cz(e,i,r,l),e.unwrap=()=>e._zod.def.innerType});function xT(e,n){return new h0({type:"nonoptional",innerType:e,...be(n)})}const wT=H("ZodCatch",(e,n)=>{Z_.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(i,r,l)=>fz(e,i,r,l),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function jT(e,n){return new wT({type:"catch",innerType:e,catchValue:typeof n=="function"?n:()=>n})}const NT=H("ZodPipe",(e,n)=>{Y_.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(i,r,l)=>pz(e,i,r,l),e.in=n.in,e.out=n.out});function yb(e,n){return new NT({type:"pipe",in:e,out:n})}const kT=H("ZodReadonly",(e,n)=>{X_.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(i,r,l)=>mz(e,i,r,l),e.unwrap=()=>e._zod.def.innerType});function AT(e){return new kT({type:"readonly",innerType:e})}const _T=H("ZodCustom",(e,n)=>{J_.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(i,r,l)=>tz(e,i)});function CT(e,n={}){return PC(_T,e,n)}function zT(e){return GC(e)}const g0=j({id:m(),name:m(),keyPrefix:m(),scopes:_(m()),readOnly:re(),createdAt:m(),lastUsedAt:m().nullable(),revokedAt:m().nullable()});j({keys:_(g0)});j({name:m().min(1).max(100),scopes:_(m()).min(1).optional()});g0.extend({key:m()});const TT=j({maxConcurrency:v().int().positive(),maxRequestsPerMinute:v().int().positive(),maxRequestsPerDay:v().int().positive()}),ya=m().min(1);m().min(1);const tp=j({label:m().min(1),city:m().min(1),region:m().min(1),country:m().length(2),timezone:m().optional()}),np=ie(["citation.lost","citation.gained","run.completed","run.failed","insight.critical","insight.high"]);j({id:m(),projectId:m(),channel:qt("webhook"),url:m().url(),urlDisplay:m(),urlHost:m(),events:_(np),enabled:re().default(!0),source:m().optional(),webhookSecret:m().optional(),createdAt:m(),updatedAt:m()});j({channel:qt("webhook"),url:m().url(),events:_(np).min(1),source:m().optional()});const y0=ie(["cli","api","config-file"]);function ET(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 OT(e,n){return n?e.some(i=>i.label===n):!0}j({displayName:m().min(1),canonicalDomain:m().min(1),ownedDomains:_(m().min(1)).optional(),aliases:_(m()).optional(),country:m().length(2),language:m().min(2),tags:_(m()).optional(),labels:mt(m(),m()).optional(),providers:_(ya).optional(),locations:_(tp).optional(),defaultLocation:m().nullable().optional(),autoExtractBacklinks:re().optional(),configSource:y0.optional()});const DT=j({id:m(),name:m(),displayName:m().optional(),canonicalDomain:m(),ownedDomains:_(m()).default([]),aliases:_(m()).default([]),country:m().length(2),language:m().min(2),tags:_(m()).default([]),labels:mt(m(),m()).default({}),providers:_(m()).default([]),locations:_(tp).default([]),defaultLocation:m().nullable().optional(),autoExtractBacklinks:re().default(!1),configSource:y0.default("cli"),configRevision:v().int().positive().default(1),createdAt:m().optional(),updatedAt:m().optional()});j({id:m(),query:m(),createdAt:m()});j({id:m(),keyword:m(),createdAt:m()});j({queries:_(m().trim().min(1)).min(1)});j({keywords:_(m().trim().min(1)).min(1)});j({provider:ya,count:v().int().min(1).max(20).optional()});j({id:m(),domain:m(),createdAt:m()});j({competitors:_(m().trim().min(1)).min(1)});function oc(e){let n=e.trim().toLowerCase();try{n.includes("://")&&(n=new URL(n).hostname.toLowerCase())}catch{}return n.replace(/^www\./,"")}const RT=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 MT(e){const n=oc(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 RT.has(l)?r.length>=3?r.slice(-3).join("."):"":r.slice(-2).join(".")}function BT(e){const n=MT(e);return n?n.split(".")[0]??"":""}function LT(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=oc(c);i.has(d)||(i.add(d),r.push(c))}return r}const qT=j({name:m().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:mt(m(),m()).optional().default({})}),UT=j({preset:m().optional(),cron:m().optional(),timezone:m().optional().default("UTC"),providers:_(ya).optional().default([])}).refine(e=>e.preset&&!e.cron||!e.preset&&e.cron,{message:'Exactly one of "preset" or "cron" must be provided'}).optional(),$T=j({channel:qt("webhook"),url:m().url(),events:_(np).min(1)}),IT=j({gsc:j({propertyUrl:m()}).optional(),syncSchedule:j({preset:m().optional(),cron:m().optional()}).optional()}).optional(),bb=_(m().min(1)),VT=j({displayName:m().min(1),canonicalDomain:m().min(1),ownedDomains:_(m().min(1)).optional().default([]),aliases:_(m().min(1)).optional().default([]),country:m().length(2),language:m().min(2),queries:bb.optional(),keywords:bb.optional(),competitors:_(m().min(1)).optional().default([]),providers:_(ya).optional().default([]),locations:_(tp).optional().default([]),defaultLocation:m().optional(),schedule:UT,notifications:_($T).optional().default([]),google:IT,autoExtractBacklinks:re().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=ET(e.locations);i.length>0&&n.addIssue({code:"custom",message:`Duplicate location labels are not allowed: ${i.join(", ")}`,path:["locations"]}),OT(e.locations,e.defaultLocation)||n.addIssue({code:"custom",message:`defaultLocation "${e.defaultLocation}" must match a configured location label`,path:["defaultLocation"]})});j({apiVersion:qt("canonry/v1"),kind:qt("Project"),metadata:qT,spec:VT});const PT=ie(["gsc","ga4","gbp"]);j({id:m(),domain:m(),connectionType:PT,propertyId:m().nullable().optional(),sitemapUrl:m().nullable().optional(),scopes:_(m()).default([]),createdAt:m(),updatedAt:m()});j({date:m(),query:m(),page:m(),country:m().nullable().optional(),device:m().nullable().optional(),clicks:v(),impressions:v(),ctr:v(),position:v()});const GT=j({date:m(),clicks:v(),impressions:v(),ctr:v()});j({totals:j({clicks:v(),impressions:v(),ctr:v(),days:v()}),daily:_(GT)});const Af=j({id:m(),url:m(),indexingState:m().nullable().optional(),verdict:m().nullable().optional(),coverageState:m().nullable().optional(),pageFetchState:m().nullable().optional(),robotsTxtState:m().nullable().optional(),crawlTime:m().nullable().optional(),lastCrawlResult:m().nullable().optional(),isMobileFriendly:re().nullable().optional(),richResults:_(m()).default([]),referringUrls:_(m()).default([]),inspectedAt:m()});ie(["stable","reindexed","deindexed","still-missing","new"]);const HT=j({url:m(),previousState:m().nullable(),currentState:m().nullable(),transitionDate:m()}),QT=j({reason:m(),count:v(),urls:_(Af).default([])});j({summary:j({total:v(),indexed:v(),notIndexed:v(),deindexed:v(),percentage:v()}),lastInspectedAt:m().nullable(),lastSyncedAt:m().nullable(),indexed:_(Af).default([]),notIndexed:_(Af).default([]),deindexed:_(HT).default([]),reasonGroups:_(QT).default([])});j({url:m(),type:ie(["URL_UPDATED","URL_DELETED"]),notifiedAt:m()});const KT=j({url:m(),type:ie(["URL_UPDATED","URL_DELETED"]),notifiedAt:m(),status:ie(["success","error"]),error:m().optional()});j({summary:j({total:v().int().nonnegative(),succeeded:v().int().nonnegative(),failed:v().int().nonnegative()}),results:_(KT).default([])});j({date:m(),indexed:v(),notIndexed:v(),reasonBreakdown:mt(m(),v()).default({})});const ZT=j({siteUrl:m(),permissionLevel:m()});j({sites:_(ZT).default([])});const YT=j({type:m(),submitted:m(),indexed:m()}),XT=j({path:m(),lastSubmitted:m().optional(),isPending:re().optional(),isSitemapsIndex:re().optional(),type:m().optional(),lastDownloaded:m().optional(),warnings:m().optional(),errors:m().optional(),contents:_(YT).optional()});j({sitemaps:_(XT).default([])});const JT=j({name:m(),accountName:m().nullable(),type:m().nullable(),role:m().nullable()});j({accounts:_(JT),total:v().int().nonnegative()});const FT=j({id:m(),projectId:m(),accountName:m(),locationName:m(),displayName:m(),primaryCategoryDisplayName:m().nullable(),storefrontAddress:m().nullable(),websiteUri:m().nullable(),placeId:m().nullable(),mapsUri:m().nullable(),selected:re(),syncedAt:m().nullable(),createdAt:m(),updatedAt:m()});j({locations:_(FT),totalDiscovered:v().int().nonnegative(),totalSelected:v().int().nonnegative()});j({selectAllNew:re().default(!0),accountName:m().optional(),switchAccount:re().default(!1)});j({selected:re()});j({locationNames:_(m()).optional(),daysOfMetrics:v().int().positive().max(540).optional(),monthsOfKeywords:v().int().positive().max(18).optional()});j({runId:m(),status:m()});const WT=j({locationName:m(),date:m(),metric:m(),value:v().int()});j({metrics:_(WT),total:v().int().nonnegative()});const eE=j({locationName:m(),periodStart:m(),periodEnd:m(),keyword:m(),valueCount:v().int().nullable(),valueThreshold:v().int().nullable()});j({keywords:_(eE),total:v().int().nonnegative(),thresholdedPct:v().int().min(0).max(100)});const tE=j({locationName:m(),placeActionLinkName:m(),placeActionType:m(),uri:m().nullable(),isPreferred:re(),providerType:m().nullable()});j({placeActions:_(tE),total:v().int().nonnegative()});const nE=j({locationName:m(),populatedGroupCount:v().int().nonnegative(),syncedAt:m(),attributes:mt(m(),ga())});j({lodging:_(nE),total:v().int().nonnegative()});const aE=j({locationName:m(),placeId:m(),tier:m(),amenities:_(m()),syncedAt:m(),place:mt(m(),ga())});j({places:_(aE),total:v().int().nonnegative()});j({scope:j({locationName:m().nullable(),locationCount:v().int().nonnegative()}),performance:j({totals:mt(m(),v()),recent7d:mt(m(),v()),prior7d:mt(m(),v()),deltaPct:mt(m(),v().nullable())}),freshness:j({dataThroughDate:m().nullable(),latestStoredDate:m().nullable(),pendingDays:v().int().nonnegative()}),timeseries:_(j({date:m(),pending:re(),metrics:mt(m(),v())})),keywords:j({total:v().int().nonnegative(),thresholdedCount:v().int().nonnegative(),thresholdedPct:v().int().min(0).max(100)}),placeActions:j({total:v().int().nonnegative(),hasReservationCta:re(),hasBookingCta:re(),hasDirectMerchantCta:re()}),lodging:j({lodgingLocationCount:v().int().nonnegative(),populatedLodgingCount:v().int().nonnegative(),emptyLodgingCount:v().int().nonnegative()})});const iE={BUSINESS_DIRECTION_REQUESTS:"Direction requests",WEBSITE_CLICKS:"Website clicks",CALL_CLICKS:"Call clicks",BUSINESS_BOOKINGS:"Bookings",BUSINESS_CONVERSATIONS:"Conversations",BUSINESS_FOOD_ORDERS:"Food orders",BUSINESS_FOOD_MENU_CLICKS:"Food menu clicks",BUSINESS_IMPRESSIONS_DESKTOP_SEARCH:"Search impressions (desktop)",BUSINESS_IMPRESSIONS_MOBILE_SEARCH:"Search impressions (mobile)",BUSINESS_IMPRESSIONS_DESKTOP_MAPS:"Maps impressions (desktop)",BUSINESS_IMPRESSIONS_MOBILE_MAPS:"Maps impressions (mobile)"};function sE(e){const n=e.replace(/^BUSINESS_/,"").split("_").filter(Boolean).map(r=>r.toLowerCase());if(n.length===0)return e;const i=n.join(" ");return i.charAt(0).toUpperCase()+i.slice(1)}function cL(e){return iE[e]??sE(e)}const rE=["BUSINESS_DIRECTION_REQUESTS","WEBSITE_CLICKS","CALL_CLICKS"],oE=["BUSINESS_IMPRESSIONS_DESKTOP_SEARCH","BUSINESS_IMPRESSIONS_MOBILE_SEARCH","BUSINESS_IMPRESSIONS_DESKTOP_MAPS","BUSINESS_IMPRESSIONS_MOBILE_MAPS"];function uL(e){return rE.includes(e)?"conversion":oE.includes(e)?"reach":"other"}j({id:m(),domain:m(),siteUrl:m().nullable().optional(),createdAt:m(),updatedAt:m()});const rf=j({id:m(),url:m(),httpCode:v().nullable().optional(),inIndex:re().nullable().optional(),lastCrawledDate:m().nullable().optional(),inIndexDate:m().nullable().optional(),inspectedAt:m(),documentSize:v().nullable().optional(),anchorCount:v().nullable().optional(),discoveryDate:m().nullable().optional()});j({summary:j({total:v(),indexed:v(),notIndexed:v(),unknown:v().optional(),percentage:v()}),lastInspectedAt:m().nullable(),indexed:_(rf).default([]),notIndexed:_(rf).default([]),unknown:_(rf).default([]).optional()});j({query:m(),impressions:v(),clicks:v(),ctr:v(),averagePosition:v()});j({date:m(),indexed:v(),notIndexed:v(),unknown:v()});const lE=j({url:m(),status:ie(["success","error"]),submittedAt:m(),error:m().optional()});j({summary:j({total:v().int().nonnegative(),succeeded:v().int().nonnegative(),failed:v().int().nonnegative()}),results:_(lE).default([])});const b0=j({url:m(),verified:re()});j({sites:_(b0).default([])});j({connected:re(),domain:m(),siteUrl:m().nullable(),createdAt:m().nullable(),updatedAt:m().nullable()});j({connected:re(),domain:m(),siteUrl:m().nullable(),availableSites:_(b0).default([])});j({siteUrl:m()});const cE=j({name:m(),alive:re(),lastUsed:m().nullable()});j({connected:re(),endpoint:m(),version:m().optional(),browserVersion:m().optional(),targets:_(cE).default([])});const Zs=ie(["live","staging"]);j({projectName:m(),url:m(),stagingUrl:m().optional(),username:m(),defaultEnv:Zs,createdAt:m(),updatedAt:m()});const vb=j({url:m(),reachable:re(),pageCount:v().nullable().optional(),version:m().nullable().optional(),error:m().nullable().optional(),plugins:_(m()).optional(),authenticatedUser:j({id:v(),slug:m()}).nullable().optional()});j({connected:re(),projectName:m(),defaultEnv:Zs,live:vb.nullable(),staging:vb.nullable(),adminUrl:m().nullable().optional()});const uE=j({id:v(),slug:m(),title:m(),status:m(),modifiedAt:m().nullable().optional(),link:m().nullable().optional()}),v0=j({title:m().nullable(),description:m().nullable(),noindex:re().nullable(),writable:re().default(!1),writeTargets:_(m()).default([])}),dE=j({type:m(),json:mt(m(),ga())}),fE=uE.extend({env:Zs,content:m(),seo:v0,schemaBlocks:_(dE).default([])}),Sb=fE.extend({contentHash:m(),contentSnippet:m()}),S0=j({manualRequired:qt(!0),targetUrl:m(),adminUrl:m().nullable().optional(),content:m(),nextSteps:_(m()).default([])}),pE=j({slug:m(),severity:ie(["high","medium","low"]),code:ie(["noindex","missing-seo-title","missing-meta-description","missing-schema","thin-content"]),message:m()});j({slug:m(),title:m(),status:m(),wordCount:v(),seo:v0,schemaPresent:re(),issues:_(pE).default([])});const mE=j({slug:m(),status:ie(["applied","skipped","manual"]),error:m().optional(),manualAssist:S0.optional()});j({env:Zs,strategy:ie(["plugin","manual"]),results:_(mE)});const hE=j({slug:m(),status:ie(["deployed","stripped","skipped","failed"]),schemasInjected:_(m()).optional(),manualAssist:S0.optional(),error:m().optional()});j({env:Zs,results:_(hE)});const gE=j({slug:m(),title:m(),canonrySchemas:_(m()),thirdPartySchemas:_(m()),hasCanonrySchema:re()});j({env:Zs,pages:_(gE)});const yE=j({name:m(),status:ie(["completed","skipped","failed"]),summary:m().optional(),error:m().optional()});j({projectName:m(),steps:_(yE)});j({slug:m(),live:Sb,staging:Sb,hasDifferences:re(),differences:j({title:re(),slug:re(),content:re(),seoTitle:re(),seoDescription:re(),noindex:re(),schema:re()})});const bE=j({name:m(),displayName:m().optional(),keyUrl:m().optional(),modelHint:m().optional(),model:m().optional(),defaultModel:m().optional(),configured:re(),quota:TT.optional(),vertexConfigured:re().optional()}),xb=j({configured:re()});j({providers:_(bE).default([]),google:xb,bing:xb});const Ys=ie(["queued","running","completed","partial","failed","cancelled"]),Ht=Ys.enum,x0=ie(["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","gbp-sync","ads-sync"]),ke=x0.enum,w0=ie(["manual","scheduled","config-apply","backfill","probe"]),Bs=w0.enum,Ai=ie(["cited","not-cited"]),lc=Ai.enum,cc=ie(["visible","not-visible"]);cc.enum;const uc=ie(["mentioned","not-mentioned"]);uc.enum;const j0=ie(["new","cited","lost","emerging","not-cited"]);j0.enum;const vE=ie(["new","mentioned","lost","emerging","not-mentioned"]);vE.enum;const SE=ie([Bs.manual,Bs.probe]);j({kind:qt(ke["answer-visibility"]).optional(),trigger:SE.optional(),providers:_(ya).optional(),queries:_(m().min(1)).min(1).optional(),location:m().min(1).optional(),allLocations:re().optional(),noLocation:re().optional()}).refine(e=>+!!e.location+ +!!e.allLocations+ +!!e.noLocation<=1,{message:'Only one of "location", "allLocations", or "noLocation" may be provided'});const xE=j({message:m(),raw:ga().optional()}),wE=j({message:m().optional(),providers:mt(m(),xE).optional()}),jE=j({id:m(),projectId:m(),kind:x0,status:Ys,trigger:w0.default("manual"),location:m().nullable().optional(),queries:_(m()).nullable().optional(),startedAt:m().nullable().optional(),finishedAt:m().nullable().optional(),error:wE.nullable().optional(),createdAt:m()});function ap(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 N0=j({uri:m(),title:m()}),k0=j({id:m(),runId:m(),queryId:m(),query:m().optional(),provider:ya,citationState:Ai,answerMentioned:re().optional(),visibilityState:cc.optional(),mentionState:uc.optional(),transition:j0.optional(),answerText:m().nullable().optional(),citedDomains:_(m()).default([]),competitorOverlap:_(m()).default([]),recommendedCompetitors:_(m()).default([]),matchedTerms:_(m()).default([]),groundingSources:_(N0).default([]),searchQueries:_(m()).default([]),model:m().nullable().optional(),location:m().nullable().optional(),createdAt:m()});j({snapshots:_(k0),total:v().int().nonnegative()});const NE=j({queryId:m().nullable(),query:m().nullable(),run1State:Ai.nullable(),run2State:Ai.nullable(),run1AnswerMentioned:re().nullable(),run2AnswerMentioned:re().nullable(),run1VisibilityState:cc.nullable(),run2VisibilityState:cc.nullable(),run1MentionState:uc.nullable().optional(),run2MentionState:uc.nullable().optional(),changed:re(),visibilityChanged:re()});j({run1:m(),run2:m(),diff:_(NE)});const kE=jE.extend({snapshots:_(k0).optional()}),AE=j({totalRuns:v().int().nonnegative(),run:kE.nullable()});j({id:m(),projectId:m().nullable().optional(),actor:m(),action:m(),entityType:m(),entityId:m().nullable().optional(),diff:ga().optional(),createdAt:m()});const _E=ie(["yes","no","unknown","not-mentioned"]),wb=_(m().min(1));j({companyName:m().min(1),domain:m().min(1),queries:wb.optional(),phrases:wb.optional(),competitors:_(m().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 CE=j({name:m(),count:v().int().nonnegative()}),zE=j({id:m(),name:m(),weight:v(),score:v(),findings:_(j({type:m(),message:m()})).default([]),recommendations:_(m()).default([])}),TE=j({url:m(),finalUrl:m(),auditedAt:m(),overallScore:v(),summary:m(),factors:_(zE).default([])}),EE=j({industry:m(),summary:m(),services:_(m()).default([]),categoryTerms:_(m()).default([])}),OE=j({provider:m(),displayName:m(),model:m().nullable().optional(),mentioned:re(),cited:re(),describedAccurately:_E,accuracyNotes:m().nullable().optional(),incorrectClaims:_(m()).default([]),recommendedCompetitors:_(m()).default([]),citedDomains:_(m()).default([]),groundingSources:_(N0).default([]),searchQueries:_(m()).default([]),answerText:m(),error:m().nullable().optional()}),DE=j({query:m(),providerResults:_(OE).default([])}),RE=j({totalQueries:v().int().nonnegative(),totalProviders:v().int().nonnegative(),totalComparisons:v().int().nonnegative(),mentionCount:v().int().nonnegative(),citationCount:v().int().nonnegative(),topCompetitors:_(CE).default([]),visibilityGap:m(),whatThisMeans:_(m()).default([]),recommendedActions:_(m()).default([])});j({companyName:m(),domain:m(),homepageUrl:m(),generatedAt:m(),queries:_(m()).default([]),competitors:_(m()).default([]),profile:EE,audit:TE,queryResults:_(DE).default([]),summary:RE});const A0=ie(["pass","partial","fail"]);A0.enum;const _0=ie(["up","down","flat"]);_0.enum;const ME=j({id:m(),name:m(),weight:v(),avgScore:v(),status:A0,pagesPassing:v().int().nonnegative(),pagesPartial:v().int().nonnegative(),pagesFailing:v().int().nonnegative()}),BE=j({factorId:m(),factorName:m(),avgScore:v(),affectedPages:v().int().nonnegative(),totalPages:v().int().nonnegative(),affectedPct:v().int().nonnegative(),topRecommendations:_(m()).default([])});j({project:m(),hasData:re(),runId:m().nullable(),runStatus:Ys.nullable(),sitemapUrl:m().nullable(),auditedAt:m().nullable(),aggregateScore:v(),pagesDiscovered:v().int().nonnegative(),pagesAudited:v().int().nonnegative(),pagesSkipped:v().int().nonnegative(),pagesErrored:v().int().nonnegative(),deltaScore:v().nullable(),trend:_0.nullable(),previousScore:v().nullable(),previousAuditedAt:m().nullable(),factors:_(ME).default([]),crossCuttingIssues:_(BE).default([]),prioritizedFixes:_(m()).default([])});const LE=j({id:m(),name:m(),weight:v(),score:v()}),qE=j({url:m(),overallScore:v(),status:ie(["success","error"]),error:m().nullable().optional(),factors:_(LE).default([])});j({project:m(),runId:m().nullable(),auditedAt:m().nullable(),total:v().int().nonnegative(),pages:_(qE).default([])});const UE=j({runId:m(),auditedAt:m(),aggregateScore:v(),pagesAudited:v().int().nonnegative()});j({project:m(),points:_(UE).default([])});j({sitemapUrl:m().url().optional(),limit:v().int().positive().max(2e3).optional()});j({runId:m(),status:Ys});const ip=ie(["answer-visibility","traffic-sync","gbp-sync","data-refresh","backlinks-sync","site-audit","ads-sync"]);ip.enum;j({id:m(),projectId:m(),kind:ip,cronExpr:m(),preset:m().nullable().optional(),timezone:m().default("UTC"),enabled:re().default(!0),providers:_(ya).default([]),sourceId:m().nullable().optional(),lastRunAt:m().nullable().optional(),nextRunAt:m().nullable().optional(),createdAt:m(),updatedAt:m()});j({kind:ip.optional(),preset:m().optional(),cron:m().optional(),timezone:m().optional().default("UTC"),enabled:re().optional().default(!0),providers:_(ya).optional().default([]),sourceId:m().optional()}).refine(e=>e.preset&&!e.cron||!e.preset&&e.cron,{message:'Exactly one of "preset" or "cron" must be provided'});const sp=ie(["competitor","directory","social","forum","news","reference","blog","ecommerce","video","academic","other"]);sp.enum;const rp=ie(["cited","aspirational","wasted-surface"]),jb=rp.enum;jb.cited,jb.aspirational;const xc=ie(["direct-competitor","ota-aggregator","editorial-media","other","unknown"]),$E=xc.enum;$E["direct-competitor"];const wc=ie(["queued","seeding","probing","completed","failed"]);wc.enum;const C0=j({domain:m().min(1),hits:v().int().positive(),competitorType:xc.default("unknown")}),IE=j({id:m(),sessionId:m(),projectId:m(),query:m(),bucket:rp.nullable().default(null),citationState:Ai,citedDomains:_(m()).default([]),answerMentioned:re().nullable().default(null),createdAt:m()}),VE=j({id:m(),projectId:m(),status:wc,icpDescription:m().nullable().optional(),seedProvider:m().nullable().optional(),seedCountRaw:v().int().nullable().optional(),seedCount:v().int().nullable().optional(),dedupThreshold:v().nullable().optional(),probeCount:v().int().nullable().optional(),citedCount:v().int().nullable().default(null),aspirationalCount:v().int().nullable().default(null),wastedCount:v().int().nullable().default(null),competitorMap:_(C0).default([]),warning:m().nullable().optional(),error:m().nullable().optional(),startedAt:m().nullable().optional(),finishedAt:m().nullable().optional(),createdAt:m()});VE.extend({probes:_(IE).default([])});const PE=500;j({icpDescription:m().min(1).optional(),dedupThreshold:v().min(0).max(1).optional(),maxProbes:v().int().positive().max(PE).optional(),locations:_(m().min(1)).optional()});j({buckets:_(rp).min(1).optional(),includeCompetitors:re().optional(),competitorTypes:_(xc).min(1).optional()});j({sessionId:m(),projectId:m(),status:wc,queriesByBucket:j({cited:_(m()),aspirational:_(m()),"wasted-surface":_(m())}),suggestedCompetitors:_(C0)});j({sessionId:m(),projectId:m(),promoted:j({queries:_(m()),competitors:_(m())}),skipped:j({queries:_(m()),competitors:_(m())})});f0([qt("cli"),m().regex(/^discovery:.+$/)]);const GE=j({query:m().min(1),probeHits:v().int().positive()}),HE=j({rawCandidates:v().int().nonnegative(),admitted:v().int().nonnegative(),rejected:j({belowFloor:v().int().nonnegative(),length:v().int().nonnegative(),navigational:v().int().nonnegative(),duplicate:v().int().nonnegative(),offAnchor:v().int().nonnegative(),semanticDuplicate:v().int().nonnegative()})});j({sessionId:m(),projectId:m(),provider:m(),status:wc,minProbeHits:v().int().positive(),anchorApplied:re(),semanticNoveltyApplied:re(),candidates:_(GE),stats:HE});const op=ie(["own","direct-competitor","ota-aggregator","editorial-media","other"]);op.enum;const z0=ie(["7d","30d","90d","all"]),Nb=ie(["improving","declining","stable"]),QE=ie(["mentioned","cited"]);QE.enum;const _f=j({citationRate:v(),cited:v().int(),total:v().int(),mentionRate:v(),mentionedCount:v().int()}),KE=j({startDate:m(),endDate:m(),citationRate:v(),cited:v().int(),total:v().int(),queryCount:v().int(),mentionRate:v(),mentionedCount:v().int(),byProvider:mt(m(),_f)}),ZE=j({date:m(),delta:v().int(),label:m()});j({window:z0,buckets:_(KE),overall:_f,byProvider:mt(m(),_f),trend:Nb,mentionTrend:Nb,queryChanges:_(ZE)});const kb=j({category:sp,label:m(),count:v().int(),percentage:v(),topDomains:_(j({domain:m(),count:v().int()}))}),YE=j({domain:m(),count:v().int(),percentage:v(),category:sp,label:m(),surfaceClass:op}),XE=j({surfaceClass:op,label:m(),count:v().int(),percentage:v(),domainCount:v().int()}),Ab=j({totalCitedSlots:v().int(),domainTotal:v().int(),entries:_(YE),truncatedDomainCount:v().int(),truncatedCitedSlots:v().int(),bySurfaceClass:_(XE)});j({overall:_(kb),byQuery:mt(m(),_(kb)),ranked:Ab,byProvider:mt(m(),Ab),runId:m(),window:z0,limit:v().int().nullable()});const lp=j({total:v().int(),checked:v().int(),mentioned:v().int(),cited:v().int(),mentionRate:v().nullable(),citedRate:v().nullable()}),T0=lp.extend({provider:m(),firstObserved:m(),lastObserved:m()}),JE=lp.extend({queryId:m().nullable(),query:m(),firstObserved:m(),lastObserved:m(),providers:_(T0).optional()}),FE=j({since:m().nullable(),until:m().nullable(),lastRuns:v().int().nullable(),runCount:v().int()}),WE=ie(["provider"]);j({project:m(),groupBy:WE.optional(),window:FE,totals:lp,byProvider:_(T0).optional(),queries:_(JE)});j({id:m(),projectId:m(),propertyId:m(),clientEmail:m(),connected:re(),createdAt:m(),updatedAt:m()});j({date:m(),landingPage:m(),sessions:v(),organicSessions:v(),users:v()});const cp=ie(["session","first_user","manual_utm"]),eO=j({source:m(),medium:m(),sessions:v(),users:v(),sourceDimension:cp}),tO=j({source:m(),medium:m(),sourceDimension:cp,landingPage:m(),sessions:v(),users:v()}),nO=j({source:m(),medium:m(),sessions:v(),users:v(),channelGroup:m()}),Fr=j({sessions:v(),sharePct:v(),sharePctDisplay:m()}),aO=j({organic:Fr,social:Fr,direct:Fr,ai:Fr,other:Fr});j({totalSessions:v(),totalOrganicSessions:v(),totalDirectSessions:v(),totalUsers:v(),topPages:_(j({landingPage:m(),sessions:v(),organicSessions:v(),directSessions:v(),users:v()})),aiReferrals:_(eO),aiReferralLandingPages:_(tO),aiSessionsDeduped:v(),aiUsersDeduped:v(),aiSessionsBySession:v(),aiUsersBySession:v(),socialReferrals:_(nO),socialSessions:v(),socialUsers:v(),channelBreakdown:aO,organicSharePct:v(),aiSharePct:v(),aiSharePctBySession:v(),directSharePct:v(),socialSharePct:v(),organicSharePctDisplay:m(),aiSharePctDisplay:m(),aiSharePctBySessionDisplay:m(),directSharePctDisplay:m(),socialSharePctDisplay:m(),otherSessions:v(),otherSharePct:v(),otherSharePctDisplay:m(),lastSyncedAt:m().nullable()});j({connected:re(),propertyId:m().nullable(),clientEmail:m().nullable(),authMethod:ie(["service-account","oauth"]).nullable(),lastSyncedAt:m().nullable(),createdAt:m().nullable().optional(),updatedAt:m().nullable().optional()});j({synced:re(),rowCount:v().int().nonnegative(),aiReferralCount:v().int().nonnegative(),socialReferralCount:v().int().nonnegative(),days:v().int().nonnegative(),syncedAt:m(),syncedComponents:_(m()).optional()});j({date:m(),source:m(),medium:m(),landingPage:m(),sessions:v(),users:v(),sourceDimension:cp});j({date:m(),source:m(),medium:m(),sessions:v(),users:v(),channelGroup:m()});j({date:m(),sessions:v(),organicSessions:v(),users:v()});function dc(e){return e.toLowerCase().replace(/[^a-z0-9]/g,"")}const E0=ie(["claude","openai","gemini","zai"]),iO=j({id:E0,label:m(),defaultModel:m(),configured:re(),keySource:ie(["config","env"]).nullable()});j({providers:_(iO).default([]),defaultProvider:E0.nullable()});const sO=ie(["aero","user","compaction"]);sO.enum;const O0=128;j({key:m().min(1).max(O0),value:m().min(1)});j({key:m().min(1).max(O0)});const Xs=ie(["commoncrawl","bing-webmaster"]);Xs.enum;const up=ie(["queued","downloading","querying","ready","failed"]);up.enum;j({id:m(),release:m(),status:up,phaseDetail:m().nullable().optional(),vertexPath:m().nullable().optional(),edgesPath:m().nullable().optional(),vertexSha256:m().nullable().optional(),edgesSha256:m().nullable().optional(),vertexBytes:v().int().nullable().optional(),edgesBytes:v().int().nullable().optional(),projectsProcessed:v().int().nullable().optional(),domainsDiscovered:v().int().nullable().optional(),downloadStartedAt:m().nullable().optional(),downloadFinishedAt:m().nullable().optional(),queryStartedAt:m().nullable().optional(),queryFinishedAt:m().nullable().optional(),error:m().nullable().optional(),createdAt:m(),updatedAt:m()});const rO=j({linkingDomain:m(),numHosts:v().int(),source:Xs}),oO=j({projectId:m(),release:m(),targetDomain:m(),totalLinkingDomains:v().int(),totalHosts:v().int(),top10HostsShare:m(),queriedAt:m(),source:Xs,excludedLinkingDomains:v().int().optional(),excludedHosts:v().int().optional()});j({source:Xs,summary:oO.nullable(),total:v().int(),rows:_(rO)});j({release:m(),totalLinkingDomains:v().int(),totalHosts:v().int(),top10HostsShare:m(),queriedAt:m(),source:Xs});const lO=j({source:Xs,connected:re(),hasData:re(),latestRelease:m().nullable(),totalLinkingDomains:v().int(),lastSyncedAt:m().nullable()});j({projectId:m(),targetDomain:m(),sources:_(lO),anyConnected:re(),anyData:re()});j({duckdbInstalled:re(),duckdbVersion:m().nullable().optional(),duckdbSpec:m(),pluginDir:m()});j({installed:re(),version:m(),path:m(),alreadyPresent:re()});j({release:m(),vertexUrl:m(),edgesUrl:m(),vertexBytes:v().int().nullable(),edgesBytes:v().int().nullable(),lastModified:m().nullable()});j({release:m(),syncStatus:up.nullable(),bytes:v().int(),lastUsedAt:m().nullable()});const dp=ie(["positive","caution","negative","neutral"]),Qa=j({label:m(),value:m(),delta:m(),tone:dp,description:m(),tooltip:m().optional(),trend:_(v()),progress:v().optional(),providerCoverage:m().optional()}),cO=Qa.extend({breakdown:j({projectMentionSnapshots:v().int().nonnegative(),competitorMentionSnapshots:v().int().nonnegative(),perCompetitor:_(j({domain:m(),mentionSnapshots:v().int().nonnegative(),shareOfCompetitiveTotal:v()})),snapshotsWithAnswerText:v().int().nonnegative(),snapshotsTotal:v().int().nonnegative()})}),of=j({gained:v().int().nonnegative(),lost:v().int().nonnegative(),tone:dp,hasPreviousRun:re(),gainedQueries:_(m()).optional(),lostQueries:_(m()).optional()}),uO=j({hasPreviousRun:re(),comparable:re(),querySetChanged:re(),previousRunAt:m().nullable(),currentQueryCount:v().int().nonnegative(),previousQueryCount:v().int().nonnegative(),comparableQueryCount:v().int().nonnegative(),addedQueryCount:v().int().nonnegative(),removedQueryCount:v().int().nonnegative(),addedQueries:_(m()),removedQueries:_(m())}),dO=j({id:m(),projectId:m(),runId:m().nullable(),type:ie(["regression","gain","opportunity","first-citation","provider-pickup","persistent-gap","competitor-gained","competitor-lost","gbp-lodging-gap","gbp-listing-discrepancy","gbp-cta-gap","gbp-metric-drop","gbp-keyword-drop"]),severity:ie(["critical","high","medium","low"]),title:m(),query:m(),provider:m(),recommendation:j({action:m(),target:m().optional(),reason:m()}).optional(),cause:j({cause:m(),competitorDomain:m().optional(),details:m().optional()}).optional(),dismissed:re(),createdAt:m()}),fO=j({id:m(),projectId:m(),runId:m().nullable(),overallCitedRate:v(),overallMentionRate:v(),totalPairs:v().int().nonnegative(),citedPairs:v().int().nonnegative(),mentionedPairs:v().int().nonnegative(),providerBreakdown:mt(m(),j({citedRate:v(),mentionRate:v(),cited:v().int().nonnegative(),mentioned:v().int().nonnegative(),total:v().int().nonnegative()})),createdAt:m(),status:ie(["ready","no-data"]),reason:qt("no-runs-yet").optional()});j({project:DT,latestRun:AE,health:fO.nullable(),topInsights:_(dO),queryCounts:j({totalQueries:v().int().nonnegative(),citedQueries:v().int().nonnegative(),notCitedQueries:v().int().nonnegative(),citedRate:v(),mentionedQueries:v().int().nonnegative(),notMentionedQueries:v().int().nonnegative(),mentionRate:v()}),providers:_(j({provider:m(),citedRate:v(),cited:v().int().nonnegative(),total:v().int().nonnegative()})),transitions:j({since:m().nullable(),gained:v().int().nonnegative(),lost:v().int().nonnegative(),emerging:v().int().nonnegative()}),scores:j({mention:Qa,visibility:Qa,mentionShare:cO,gapQueries:Qa,mentionGaps:Qa,indexCoverage:Qa,competitorPressure:Qa,runStatus:Qa}),movementSummary:of,citationMovement:of,mentionMovement:of,movementComparison:uO,competitors:_(j({id:m(),domain:m(),citationCount:v().int().nonnegative(),totalQueries:v().int().nonnegative(),pressureLabel:ie(["None","Low","Moderate","High"]),citedQueries:_(m())})),providerScores:_(j({provider:m(),model:m().nullable(),score:v(),cited:v().int().nonnegative(),total:v().int().nonnegative(),trend:_(v()).optional()})),attentionItems:_(j({id:m(),tone:dp,title:m(),detail:m(),actionLabel:m(),href:m()})),runHistory:_(j({runId:m(),createdAt:m(),citedCount:v().int().nonnegative(),totalCount:v().int().nonnegative(),citationRate:v(),mentionedCount:v().int().nonnegative(),mentionRate:v(),status:m()})),suggestedQueries:j({rows:_(j({query:m(),impressions:v(),clicks:v(),avgPosition:v(),reason:m()})),totalCandidates:v().int().nonnegative(),skippedAlreadyTracked:v().int().nonnegative()}),dateRangeLabel:m(),contextLabel:m()});ie(["snapshot","insight"]);const pO=j({kind:qt("snapshot"),id:m(),runId:m(),query:m(),provider:m(),model:m().nullable(),citationState:Ai,matchedField:ie(["answerText","citedDomains","searchQueries","query"]),snippet:m(),createdAt:m()}),mO=j({kind:qt("insight"),id:m(),runId:m().nullable(),type:ie(["regression","gain","opportunity","first-citation","provider-pickup","persistent-gap","competitor-gained","competitor-lost","gbp-lodging-gap","gbp-listing-discrepancy","gbp-cta-gap","gbp-metric-drop","gbp-keyword-drop"]),severity:ie(["critical","high","medium","low"]),title:m(),query:m(),provider:m(),matchedField:ie(["title","query","recommendation","cause"]),snippet:m(),dismissed:re(),createdAt:m()}),hO=p0("kind",[pO,mO]);j({query:m(),totalHits:v().int().nonnegative(),truncated:re(),hits:_(hO)});const D0=ie(["create","expand","refresh","add-schema"]);D0.enum;function dL(e){switch(e){case"create":return"Create";case"expand":return"Expand";case"refresh":return"Refresh";case"add-schema":return"Add schema"}}const R0=ie(["gsc","competitor-evidence","both"]);R0.enum;const M0=ie(["high","medium","low"]);M0.enum;const gO=ie(["blog-post","comparison","listicle","how-to","guide","glossary"]);gO.enum;const B0=ie(["proposed","briefed","payload-generated","draft-created","published","validated","dismissed"]);B0.enum;const fp=ie(["ownable","ceded"]);fp.enum;const yO=j({url:m(),gscImpressions:v().nonnegative(),gscClicks:v().nonnegative(),gscAvgPosition:v().nonnegative().nullable(),organicSessions:v().nonnegative()}),bO=j({domain:m(),url:m(),title:m(),citationCount:v().int().nonnegative()}),vO=j({demand:v(),competitor:v(),absence:v(),gapSeverity:v()}),SO=j({actionId:m(),state:B0,lastUpdated:m()}),L0=j({targetRef:m(),query:m(),action:D0,ourBestPage:yO.nullable(),winningCompetitor:bO.nullable(),score:v(),scoreBreakdown:vO,drivers:_(m()),demandSource:R0,actionConfidence:M0,existingAction:SO.nullable(),winnabilityClass:fp,winnability:v().min(0).max(1).nullable()});j({targets:_(L0),contextMetrics:j({totalAiReferralSessions:v().int().nonnegative(),latestRunId:m(),runTimestamp:m()})});const xO=j({targetRef:m(),addressedUrl:m().nullable(),note:m().nullable(),dismissedAt:m()});j({dismissals:_(xO)});j({targetRef:m().min(1),addressedUrl:m().url().optional(),note:m().max(500).optional()});j({targetRef:m(),promptVersion:m(),provider:m(),model:m(),responseText:m(),costMillicents:v().int().nonnegative(),generatedAt:m()});j({provider:m().optional(),model:m().optional(),forceRefresh:re().optional()});const wO=j({targetQuery:m().trim().min(1),winnabilityClass:fp,angle:m().trim().min(1),whyWinnable:m().trim().min(1),schemaHookup:m().trim().min(1),controllableSurfaceRationale:m().trim().min(1)});j({targetRef:m(),promptVersion:m(),provider:m(),model:m(),brief:wO,costMillicents:v().int().nonnegative(),generatedAt:m()});const jO=j({domain:m(),competitorType:xc,hits:v().int().nonnegative(),updatedAt:m()});j({classifications:_(jO)});const NO=j({uri:m(),title:m(),domain:m(),isOurDomain:re(),isCompetitor:re(),citationCount:v().int().nonnegative(),providers:_(ya)}),q0=j({query:m(),groundingSources:_(NO)});j({sources:_(q0),latestRunId:m()});const U0=j({query:m(),competitorDomains:_(m()),competitorCount:v().int().nonnegative(),missRate:v().min(0).max(1),lastSeenInRunId:m()});j({gaps:_(U0),latestRunId:m()});const $0=ie(["ok","warn","fail","skipped"]);$0.enum;const pp=ie(["global","project"]);pp.enum;const I0=ie(["auth","config","providers","integrations","database","schedules","agent"]);I0.enum;const kO=j({id:m(),category:I0,scope:pp,title:m(),status:$0,code:m().describe('Stable machine-readable code (e.g. "google.token.refresh-failed"). Use this for filtering and remediation logic.'),summary:m(),remediation:m().nullable().optional().describe('Operator-facing next step. Null when status is "ok" or no specific remediation applies.'),details:mt(m(),ga()).optional().describe("Structured context — principal email, redirect URI, missing scopes, etc. Stable per check id."),durationMs:v().int().nonnegative().describe("How long the check took to execute.")});j({scope:pp,project:m().nullable().describe('Project name when scope is "project", null otherwise.'),generatedAt:m().describe("ISO-8601 timestamp when this doctor run started."),durationMs:v().int().nonnegative(),summary:j({total:v().int().nonnegative(),ok:v().int().nonnegative(),warn:v().int().nonnegative(),fail:v().int().nonnegative(),skipped:v().int().nonnegative()}),checks:_(kO)});const AO=j({provider:m(),citationState:Ai,cited:re(),mentioned:re(),runId:m(),runCreatedAt:m()}),_O=j({queryId:m(),query:m(),providers:_(AO),citedCount:v().int().nonnegative(),mentionedCount:v().int().nonnegative(),totalProviders:v().int().nonnegative()}),CO=j({queryId:m(),query:m(),provider:m(),citingCompetitors:_(m()),runId:m(),runCreatedAt:m()}),zO=j({providersConfigured:v().int().nonnegative(),providersCiting:v().int().nonnegative(),providersMentioning:v().int().nonnegative(),totalQueries:v().int().nonnegative(),queriesCitedAndMentioned:v().int().nonnegative(),queriesCitedOnly:v().int().nonnegative(),queriesMentionedOnly:v().int().nonnegative(),queriesInvisible:v().int().nonnegative(),latestRunId:m().nullable(),latestRunAt:m().nullable()});j({summary:zO,byQuery:_(_O),competitorGaps:_(CO),status:ie(["ready","no-data"]),reason:ie(["no-runs-yet","no-queries"]).optional()});const TO=ie(["prompt","request-param","browser-geo","ignored"]),EO=j({label:m(),city:m(),region:m(),country:m(),otherConfiguredLabels:_(m())}),OO=j({provider:m(),treatment:TO,description:m()}),DO=j({generatedAt:m(),project:j({id:m(),name:m(),displayName:m(),canonicalDomain:m(),country:m(),language:m()}),location:EO.nullable(),providerLocationHandling:_(OO),periodStart:m().nullable(),periodEnd:m().nullable()}),RO=j({citationRate:v(),citedQueryCount:v(),totalQueryCount:v(),mentionRate:v(),mentionedQueryCount:v(),trend:ie(["up","down","flat","unknown"]),queryCount:v(),competitorCount:v(),providerCount:v(),gsc:j({clicks:v(),impressions:v(),ctr:v(),avgPosition:v(),periodStart:m(),periodEnd:m()}).nullable(),ga:j({sessions:v(),users:v(),periodStart:m(),periodEnd:m()}).nullable(),findings:_(j({title:m(),detail:m(),tone:ie(["positive","caution","negative","neutral"])}))}),MO=j({citationState:ie(["cited","not-cited","pending"]),answerMentioned:re().nullable(),model:m().nullable()}),BO=j({queries:_(m()),providers:_(m()),matrix:_(_(MO.nullable())),providerRates:_(j({provider:m(),citedCount:v(),totalCount:v(),citationRate:v()}))}),LO=j({domain:m(),citationCount:v(),totalCount:v(),pressureLabel:ie(["High","Moderate","Low","None"]),citedQueries:_(m()),sharePct:v(),theirCitedPages:_(j({url:m(),citedFor:_(m())}))}),qO=j({projectCitationCount:v(),competitors:_(LO)}),UO=j({domain:m(),mentionCount:v(),totalCount:v(),pressureLabel:ie(["High","Moderate","Low","None"]),mentionedQueries:_(m()),sharePct:v()}),$O=j({projectMentionCount:v(),totalAnswerSnapshots:v(),competitors:_(UO)}),IO=j({category:m(),label:m(),count:v(),sharePct:v()}),VO=j({categories:_(IO),topDomains:_(j({domain:m(),count:v(),isCompetitor:re()}))}),PO=j({query:m(),clicks:v(),impressions:v(),ctr:v(),avgPosition:v(),category:ie(["brand","lead-gen","industry","other"])}),GO=j({periodStart:m(),periodEnd:m(),totalClicks:v(),totalImpressions:v(),ctr:v(),avgPosition:v(),topQueries:_(PO),categoryBreakdown:_(j({category:ie(["brand","lead-gen","industry","other"]),clicks:v(),impressions:v(),sharePct:v()})),trend:_(j({date:m(),clicks:v(),impressions:v()})),trackedButNoGsc:_(m()),gscButNotTracked:_(m())}),HO=j({totalSessions:v(),totalUsers:v(),totalOrganicSessions:v(),periodStart:m(),periodEnd:m(),topLandingPages:_(j({page:m(),sessions:v(),users:v(),organicSessions:v()})),channelBreakdown:_(j({channel:m(),sessions:v(),sharePct:v()}))}),QO=j({totalSessions:v(),organicSessions:v(),paidSessions:v(),channels:_(j({channelGroup:m(),sessions:v(),sharePct:v()})),topCampaigns:_(j({source:m(),medium:m(),sessions:v()}))}),KO=j({totalSessions:v(),totalUsers:v(),bySource:_(j({source:m(),sessions:v(),users:v(),sharePct:v()})),trend:_(j({date:m(),sessions:v()})),topLandingPages:_(j({page:m(),sessions:v(),users:v()}))}),ZO=j({windowStart:m(),windowEnd:m(),hasData:re(),verifiedCrawlerHits:j({current:v(),prior:v(),deltaPct:v().nullable()}),unverifiedCrawlerHits:j({current:v(),prior:v(),deltaPct:v().nullable()}),aiUserFetchHits:j({current:v(),prior:v(),deltaPct:v().nullable()}),referralArrivals:j({current:v(),prior:v(),deltaPct:v().nullable()}),byOperator:_(j({operator:m(),verifiedHits:v(),unverifiedHits:v(),userFetchHits:v(),referralArrivals:v(),deltaPct:v().nullable()})),topCrawledPaths:_(j({path:m(),verifiedHits:v(),distinctOperators:v()})),referralProducts:_(j({product:m(),arrivals:v(),distinctLandingPaths:v()})),dailyTrend:_(j({date:m(),verifiedCrawlerHits:v(),userFetchHits:v(),referralArrivals:v()})),topReferralLandingPaths:_(j({path:m(),arrivals:v(),distinctProducts:v()}))}),YO=j({provider:ie(["google","bing"]).nullable(),total:v(),indexed:v(),notIndexed:v(),deindexed:v(),unknown:v(),indexedPct:v()}),XO=j({runId:m(),date:m(),citationRate:v(),citedQueryCount:v(),totalQueryCount:v(),mentionRate:v(),mentionedQueryCount:v(),providerRates:_(j({provider:m(),citationRate:v()}))}),Cf=j({id:m(),type:ie(["regression","gain","opportunity"]),severity:ie(["critical","high","medium","low"]),title:m(),query:m(),provider:m(),recommendation:m().nullable(),createdAt:m(),instanceCount:v()}),JO=j({horizon:ie(["immediate","short-term","medium-term"]),title:m(),rationale:m()}),Wr=j({current:v(),prior:v(),deltaAbs:v(),direction:ie(["up","down","flat"]),window:v().optional()}),FO=j({provider:m(),current:v(),prior:v(),deltaAbs:v(),direction:ie(["up","down","flat"])}),WO=j({enoughHistory:re(),headline:m(),citationRate:Wr.nullable(),mentionRate:Wr.nullable(),citedQueryCount:Wr.nullable(),gscClicksDelta:Wr.nullable(),aiReferralsDelta:Wr.nullable(),providerMovements:_(FO),wins:_(Cf),regressions:_(Cf)});ie(["agency","client"]);const e4=ie(["agency","client","both"]),t4=ie(["immediate","short-term","medium-term"]),n4=ie(["high","medium","low"]);ie(["positive","caution","negative","neutral"]);const a4=ie(["content","competitors","provider","search-demand","indexing","location","monitoring"]),mp=j({audience:e4,priority:v(),horizon:t4,category:a4,title:m(),action:m(),why:_(m()),evidence:_(m()),successMetric:m(),confidence:n4,targetRef:m().optional()}),i4=j({headline:m(),overview:m(),actionItems:_(mp),confidenceNotes:_(m())}),s4=j({title:m(),detail:m(),severity:ie(["positive","caution","negative","neutral"]),evidence:_(m())}),r4=j({priorities:_(mp),diagnostics:_(s4)});function fL(e){return e.horizon==="immediate"?"negative":e.confidence==="high"?"caution":e.confidence==="low"?"neutral":"caution"}function pL(e){switch(e){case"critical":return"Critical";case"high":return"High";case"medium":return"Medium";case"low":return"Low"}}function mL(e){switch(e){case"immediate":return"Immediate";case"short-term":return"Short term";case"medium-term":return"Medium term"}}function hL(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 gL(e){switch(e){case"high":return"High";case"medium":return"Medium";case"low":return"Low"}}j({meta:DO,executiveSummary:RO,citationScorecard:BO,competitorLandscape:qO,mentionLandscape:$O,aiSourceOrigin:VO,gsc:GO.nullable(),ga:HO.nullable(),socialReferrals:QO.nullable(),aiReferrals:KO.nullable(),serverActivity:ZO.nullable(),indexingHealth:YO.nullable(),citationsTrend:_(XO),whatsChanged:WO,insights:_(Cf),recommendedNextSteps:_(JO),actionPlan:_(mp),clientSummary:i4,agencyDiagnostics:r4,contentOpportunities:_(L0),contentGaps:_(U0),groundingSources:_(q0)});const o4=ie(["claude","codex"]);o4.enum;const l4=ie(["claude","codex","all"]);l4.enum;const hp=ie(["cloud-run","wordpress","cloudflare","vercel","generic-log"]);hp.enum;const c4=ie(["raw-request-events","aggregate-request-metrics","request-url","status-code","user-agent","remote-ip","referer","cursor-pull"]);c4.enum;const u4=ie(["raw-request","aggregate-bucket"]),d4=u4.enum,f4=ie(["observed","provider-aggregated","inferred"]),p4=f4.enum,m4=j({type:m().nullable(),labels:mt(m(),m())}),h4=j({sourceType:hp,evidenceKind:qt(d4["raw-request"]),confidence:qt(p4.observed),eventId:m().min(1),observedAt:m().min(1),method:m().nullable(),requestUrl:m().nullable(),host:m().nullable(),path:m().min(1),queryString:m().nullable(),status:v().int().nullable(),userAgent:m().nullable(),remoteIp:m().nullable(),referer:m().nullable(),latencyMs:v().nullable(),requestSizeBytes:v().int().nullable(),responseSizeBytes:v().int().nullable(),providerResource:m4,providerLabels:mt(m(),m())});j({events:_(h4),rawEntryCount:v().int().nonnegative(),skippedEntryCount:v().int().nonnegative(),nextPageToken:m().optional(),filter:m()});const V0=ie(["connected","paused","error","archived"]),yL=V0.enum,P0=ie(["oauth","service-account"]);P0.enum;const g4=ie(["verified","claimed_unverified","unknown_ai_like"]),bL=g4.enum;j({gcpProjectId:m().min(1),serviceName:m().nullable().optional(),location:m().nullable().optional(),authMode:P0});j({baseUrl:m().url(),username:m().min(1)});const gp=ie(["production","preview"]);gp.enum;j({projectId:m().min(1),teamId:m().min(1),environment:gp});const G0=j({id:m(),projectId:m(),sourceType:hp,displayName:m(),status:V0,lastSyncedAt:m().nullable(),lastCursor:m().nullable(),lastError:m().nullable(),archivedAt:m().nullable(),config:mt(m(),ga()),createdAt:m(),updatedAt:m()});j({gcpProjectId:m().min(1),serviceName:m().min(1).optional(),location:m().min(1).optional(),displayName:m().min(1).optional(),keyJson:m().optional()});j({baseUrl:m().url(),username:m().min(1),applicationPassword:m().min(1),displayName:m().min(1).optional()});j({projectId:m().min(1),teamId:m().min(1),token:m().min(1),environment:gp.optional(),displayName:m().min(1).optional()});j({sourceId:m(),runId:m(),syncedAt:m(),pulledEvents:v().int().nonnegative(),selfTrafficExcluded:v().int().nonnegative(),crawlerHits:v().int().nonnegative(),aiUserFetchHits:v().int().nonnegative(),aiReferralHits:v().int().nonnegative(),unknownHits:v().int().nonnegative(),crawlerBucketRows:v().int().nonnegative(),aiUserFetchBucketRows:v().int().nonnegative(),aiReferralBucketRows:v().int().nonnegative(),sampleRows:v().int().nonnegative(),windowStart:m(),windowEnd:m()});j({days:v().int().positive().optional()});j({advanceToNow:qt(!0)});j({sourceId:m(),runId:m(),status:Ys,windowStart:m(),windowEnd:m(),daysRequested:v().int().positive(),daysApplied:v().int().positive()});const y4=j({crawlerHits:v().int().nonnegative(),aiUserFetchHits:v().int().nonnegative(),aiReferralHits:v().int().nonnegative(),sampleCount:v().int().nonnegative()});j({sources:_(G0)});const b4=G0.extend({totals24h:y4,latestRun:j({runId:m(),status:Ys,startedAt:m().nullable(),finishedAt:m().nullable(),error:m().nullable()}).nullable()});j({sources:_(b4)});const v4=ie(["crawler","ai-user-fetch","ai-referral"]),yp=v4.enum,S4=j({kind:qt(yp.crawler),sourceId:m(),tsHour:m(),botId:m(),operator:m(),verificationStatus:m(),pathNormalized:m(),status:v().int(),hits:v().int().nonnegative()}),x4=j({kind:qt(yp["ai-user-fetch"]),sourceId:m(),tsHour:m(),botId:m(),operator:m(),verificationStatus:m(),pathNormalized:m(),status:v().int(),hits:v().int().nonnegative()}),w4=j({kind:qt(yp["ai-referral"]),sourceId:m(),tsHour:m(),product:m(),operator:m(),sourceDomain:m(),evidenceType:m(),landingPathNormalized:m(),status:v().int(),hits:v().int().nonnegative()}),j4=p0("kind",[S4,x4,w4]);j({windowStart:m(),windowEnd:m(),totals:j({crawlerHits:v().int().nonnegative(),aiUserFetchHits:v().int().nonnegative(),aiReferralHits:v().int().nonnegative()}),events:_(j4)});j({apiKey:m().min(1)});j({connected:re(),adAccountId:m().nullable().optional(),displayName:m().nullable().optional(),currencyCode:m().nullable().optional(),timezone:m().nullable().optional(),status:m().nullable().optional(),lastSyncedAt:m().nullable().optional()});j({disconnected:re()});j({runId:m(),status:m()});const N4=j({type:m().nullable().optional(),title:m().nullable().optional(),body:m().nullable().optional(),targetUrl:m().nullable().optional()}),k4=j({id:m(),adGroupId:m(),name:m(),status:m(),reviewStatus:m().nullable().optional(),creative:N4.nullable().optional()}),A4=j({id:m(),campaignId:m(),name:m(),status:m(),billingEventType:m().nullable().optional(),maxBidMicros:v().int().nullable().optional(),contextHints:_(m()).default([]),ads:_(k4).default([])}),_4=j({id:m(),name:m(),status:m(),biddingType:m().nullable().optional(),dailySpendLimitMicros:v().int().nullable().optional(),lifetimeSpendLimitMicros:v().int().nullable().optional(),adGroups:_(A4).default([])});j({campaigns:_(_4)});const H0=ie(["campaign","ad_group"]);H0.enum;const C4=j({level:H0,entityId:m(),date:m(),impressions:v().int(),clicks:v().int(),spendMicros:v().int(),ctr:v().nullable(),cpcMicros:v().int().nullable()});j({rows:_(C4),currencyCode:m().nullable().optional()});const z4=j({impressions:v().int(),clicks:v().int(),spendMicros:v().int(),ctr:v().nullable(),cpcMicros:v().int().nullable()});j({connected:re(),displayName:m().nullable().optional(),currencyCode:m().nullable().optional(),lastSyncedAt:m().nullable().optional(),campaignCount:v().int(),adGroupCount:v().int(),adCount:v().int(),window:j({from:m().nullable(),to:m().nullable()}),totals:z4});var T4=(e=>(e.Clicks="clicks",e.Impressions="impressions",e.CTR="ctr",e.Position="position",e))(T4||{});const vL={clicks:"Clicks",impressions:"Impressions",ctr:"CTR",position:"Position"},SL={clicks:"Clicks",impressions:"Impr",ctr:"CTR",position:"Pos"},xL=ap;function E4(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}
|
|
52
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const d of e.seen.entries()){const h=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(h.cycle){c(d);continue}if(h.count>1&&e.reused==="ref"){c(d);continue}}}function o0(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 h=e.seen.get(d);if(h.ref===null)return;const g=h.def??h.schema,b={...g},S=h.ref;if(h.ref=null,S){r(S);const N=e.seen.get(S),A=N.schema;if(A.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(g.allOf=g.allOf??[],g.allOf.push(A)):Object.assign(g,A),Object.assign(g,b),d._zod.parent===S)for(const k in g)k==="$ref"||k==="allOf"||k in b||delete g[k];if(A.$ref&&N.def)for(const k in g)k==="$ref"||k==="allOf"||k in N.def&&JSON.stringify(g[k])===JSON.stringify(N.def[k])&&delete g[k]}const x=d._zod.parent;if(x&&x!==S){r(x);const N=e.seen.get(x);if(N?.schema.$ref&&(g.$ref=N.schema.$ref,N.def))for(const A in g)A==="$ref"||A==="allOf"||A in N.def&&JSON.stringify(g[A])===JSON.stringify(N.def[A])&&delete g[A]}e.override({zodSchema:d,jsonSchema:g,path:h.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 h=d[1];h.def&&h.defId&&(c[h.defId]=h.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:rc(n,"input",e.processors),output:rc(n,"output",e.processors)}},enumerable:!1,writable:!1}),d}catch{throw new Error("Error converting schema to JSON.")}}function Pt(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 Pt(r.element,i);if(r.type==="set")return Pt(r.valueType,i);if(r.type==="lazy")return Pt(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 Pt(r.innerType,i);if(r.type==="intersection")return Pt(r.left,i)||Pt(r.right,i);if(r.type==="record"||r.type==="map")return Pt(r.keyType,i)||Pt(r.valueType,i);if(r.type==="pipe")return Pt(r.in,i)||Pt(r.out,i);if(r.type==="object"){for(const l in r.shape)if(Pt(r.shape[l],i))return!0;return!1}if(r.type==="union"){for(const l of r.options)if(Pt(l,i))return!0;return!1}if(r.type==="tuple"){for(const l of r.items)if(Pt(l,i))return!0;return!!(r.rest&&Pt(r.rest,i))}return!1}const KC=(e,n={})=>i=>{const r=s0({...i,processors:n});return kt(e,r),r0(r,e),o0(r,e)},rc=(e,n,i={})=>r=>{const{libraryOptions:l,target:c}=r??{},d=s0({...l??{},target:c,io:n,processors:i});return kt(e,d),r0(d,e),o0(d,e)},ZC={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},YC=(e,n,i,r)=>{const l=i;l.type="string";const{minimum:c,maximum:d,format:h,patterns:g,contentEncoding:b}=e._zod.bag;if(typeof c=="number"&&(l.minLength=c),typeof d=="number"&&(l.maxLength=d),h&&(l.format=ZC[h]??h,l.format===""&&delete l.format,h==="time"&&delete l.format),b&&(l.contentEncoding=b),g&&g.size>0){const S=[...g];S.length===1?l.pattern=S[0].source:S.length>1&&(l.allOf=[...S.map(x=>({...n.target==="draft-07"||n.target==="draft-04"||n.target==="openapi-3.0"?{type:"string"}:{},pattern:x.source}))])}},XC=(e,n,i,r)=>{const l=i,{minimum:c,maximum:d,format:h,multipleOf:g,exclusiveMaximum:b,exclusiveMinimum:S}=e._zod.bag;typeof h=="string"&&h.includes("int")?l.type="integer":l.type="number",typeof S=="number"&&(n.target==="draft-04"||n.target==="openapi-3.0"?(l.minimum=S,l.exclusiveMinimum=!0):l.exclusiveMinimum=S),typeof c=="number"&&(l.minimum=c,typeof S=="number"&&n.target!=="draft-04"&&(S>=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)},JC=(e,n,i,r)=>{i.type="boolean"},FC=(e,n,i,r)=>{i.not={}},WC=(e,n,i,r)=>{},ez=(e,n,i,r)=>{const l=e._zod.def,c=qv(l.entries);c.every(d=>typeof d=="number")&&(i.type="number"),c.every(d=>typeof d=="string")&&(i.type="string"),i.enum=c},tz=(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},nz=(e,n,i,r)=>{if(n.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},az=(e,n,i,r)=>{if(n.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},iz=(e,n,i,r)=>{const l=i,c=e._zod.def,{minimum:d,maximum:h}=e._zod.bag;typeof d=="number"&&(l.minItems=d),typeof h=="number"&&(l.maxItems=h),l.type="array",l.items=kt(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]=kt(d[b],n,{...r,path:[...r.path,"properties",b]});const h=new Set(Object.keys(d)),g=new Set([...h].filter(b=>{const S=c.shape[b]._zod;return n.io==="input"?S.optin===void 0:S.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=kt(c.catchall,n,{...r,path:[...r.path,"additionalProperties"]})):n.io==="output"&&(l.additionalProperties=!1)},rz=(e,n,i,r)=>{const l=e._zod.def,c=l.inclusive===!1,d=l.options.map((h,g)=>kt(h,n,{...r,path:[...r.path,c?"oneOf":"anyOf",g]}));c?i.oneOf=d:i.anyOf=d},oz=(e,n,i,r)=>{const l=e._zod.def,c=kt(l.left,n,{...r,path:[...r.path,"allOf",0]}),d=kt(l.right,n,{...r,path:[...r.path,"allOf",1]}),h=b=>"allOf"in b&&Object.keys(b).length===1,g=[...h(c)?c.allOf:[c],...h(d)?d.allOf:[d]];i.allOf=g},lz=(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 S=kt(c.valueType,n,{...r,path:[...r.path,"patternProperties","*"]});l.patternProperties={};for(const x of g)l.patternProperties[x.source]=S}else(n.target==="draft-07"||n.target==="draft-2020-12")&&(l.propertyNames=kt(c.keyType,n,{...r,path:[...r.path,"propertyNames"]})),l.additionalProperties=kt(c.valueType,n,{...r,path:[...r.path,"additionalProperties"]});const b=d._zod.values;if(b){const S=[...b].filter(x=>typeof x=="string"||typeof x=="number");S.length>0&&(l.required=S)}},cz=(e,n,i,r)=>{const l=e._zod.def,c=kt(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"}]},uz=(e,n,i,r)=>{const l=e._zod.def;kt(l.innerType,n,r);const c=n.seen.get(e);c.ref=l.innerType},dz=(e,n,i,r)=>{const l=e._zod.def;kt(l.innerType,n,r);const c=n.seen.get(e);c.ref=l.innerType,i.default=JSON.parse(JSON.stringify(l.defaultValue))},fz=(e,n,i,r)=>{const l=e._zod.def;kt(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)))},pz=(e,n,i,r)=>{const l=e._zod.def;kt(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},mz=(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;kt(c,n,r);const d=n.seen.get(e);d.ref=c},hz=(e,n,i,r)=>{const l=e._zod.def;kt(l.innerType,n,r);const c=n.seen.get(e);c.ref=l.innerType,i.readOnly=!0},l0=(e,n,i,r)=>{const l=e._zod.def;kt(l.innerType,n,r);const c=n.seen.get(e);c.ref=l.innerType},gz=H("ZodISODateTime",(e,n)=>{y_.init(e,n),dt.init(e,n)});function yz(e){return jC(gz,e)}const bz=H("ZodISODate",(e,n)=>{b_.init(e,n),dt.init(e,n)});function vz(e){return NC(bz,e)}const Sz=H("ZodISOTime",(e,n)=>{v_.init(e,n),dt.init(e,n)});function xz(e){return kC(Sz,e)}const wz=H("ZodISODuration",(e,n)=>{S_.init(e,n),dt.init(e,n)});function jz(e){return AC(wz,e)}const Nz=(e,n)=>{Vv.init(e,n),e.name="ZodError",Object.defineProperties(e,{format:{value:i=>u2(e,i)},flatten:{value:i=>c2(e,i)},addIssue:{value:i=>{e.issues.push(i),e.message=JSON.stringify(e.issues,jf,2)}},addIssues:{value:i=>{e.issues.push(...i),e.message=JSON.stringify(e.issues,jf,2)}},isEmpty:{get(){return e.issues.length===0}}})},_n=H("ZodError",Nz,{Parent:Error}),kz=Ff(_n),Az=Wf(_n),_z=bc(_n),Cz=vc(_n),zz=p2(_n),Tz=m2(_n),Ez=h2(_n),Oz=g2(_n),Dz=y2(_n),Rz=b2(_n),Mz=v2(_n),Bz=S2(_n),ut=H("ZodType",(e,n)=>(ct.init(e,n),Object.assign(e["~standard"],{jsonSchema:{input:rc(e,"input"),output:rc(e,"output")}}),e.toJSONSchema=KC(e,{}),e.def=n,e.type=n.type,Object.defineProperty(e,"_def",{value:n}),e.check=(...i)=>e.clone(Fa(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)=>Wa(e,i,r),e.brand=()=>e,e.register=((i,r)=>(i.add(e,r),e)),e.parse=(i,r)=>kz(e,i,r,{callee:e.parse}),e.safeParse=(i,r)=>_z(e,i,r),e.parseAsync=async(i,r)=>Az(e,i,r,{callee:e.parseAsync}),e.safeParseAsync=async(i,r)=>Cz(e,i,r),e.spa=e.safeParseAsync,e.encode=(i,r)=>zz(e,i,r),e.decode=(i,r)=>Tz(e,i,r),e.encodeAsync=async(i,r)=>Ez(e,i,r),e.decodeAsync=async(i,r)=>Oz(e,i,r),e.safeEncode=(i,r)=>Dz(e,i,r),e.safeDecode=(i,r)=>Rz(e,i,r),e.safeEncodeAsync=async(i,r)=>Mz(e,i,r),e.safeDecodeAsync=async(i,r)=>Bz(e,i,r),e.refine=(i,r)=>e.check(zT(i,r)),e.superRefine=i=>e.check(TT(i)),e.overwrite=i=>e.check(Ks(i)),e.optional=()=>hb(e),e.exactOptional=()=>gT(e),e.nullable=()=>gb(e),e.nullish=()=>hb(gb(e)),e.nonoptional=i=>wT(e,i),e.array=()=>_(e),e.or=i=>f0([e,i]),e.and=i=>uT(e,i),e.transform=i=>yb(e,mT(i)),e.default=i=>vT(e,i),e.prefault=i=>xT(e,i),e.catch=i=>NT(e,i),e.pipe=i=>yb(e,i),e.readonly=()=>_T(e),e.describe=i=>{const r=e.clone();return io.add(r,{description:i}),r},Object.defineProperty(e,"description",{get(){return io.get(e)?.description},configurable:!0}),e.meta=(...i)=>{if(i.length===0)return io.get(e);const r=e.clone();return io.add(r,i[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=i=>i(e),e)),c0=H("_ZodString",(e,n)=>{ep.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(r,l,c)=>YC(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(OC(...r)),e.includes=(...r)=>e.check(MC(...r)),e.startsWith=(...r)=>e.check(BC(...r)),e.endsWith=(...r)=>e.check(LC(...r)),e.min=(...r)=>e.check(sc(...r)),e.max=(...r)=>e.check(a0(...r)),e.length=(...r)=>e.check(i0(...r)),e.nonempty=(...r)=>e.check(sc(1,...r)),e.lowercase=r=>e.check(DC(r)),e.uppercase=r=>e.check(RC(r)),e.trim=()=>e.check(UC()),e.normalize=(...r)=>e.check(qC(...r)),e.toLowerCase=()=>e.check($C()),e.toUpperCase=()=>e.check(IC()),e.slugify=()=>e.check(VC())}),Lz=H("ZodString",(e,n)=>{ep.init(e,n),c0.init(e,n),e.email=i=>e.check(nC(qz,i)),e.url=i=>e.check(oC(Uz,i)),e.jwt=i=>e.check(wC(eT,i)),e.emoji=i=>e.check(lC($z,i)),e.guid=i=>e.check(cb(pb,i)),e.uuid=i=>e.check(aC(Vl,i)),e.uuidv4=i=>e.check(iC(Vl,i)),e.uuidv6=i=>e.check(sC(Vl,i)),e.uuidv7=i=>e.check(rC(Vl,i)),e.nanoid=i=>e.check(cC(Iz,i)),e.guid=i=>e.check(cb(pb,i)),e.cuid=i=>e.check(uC(Vz,i)),e.cuid2=i=>e.check(dC(Pz,i)),e.ulid=i=>e.check(fC(Gz,i)),e.base64=i=>e.check(vC(Jz,i)),e.base64url=i=>e.check(SC(Fz,i)),e.xid=i=>e.check(pC(Hz,i)),e.ksuid=i=>e.check(mC(Qz,i)),e.ipv4=i=>e.check(hC(Kz,i)),e.ipv6=i=>e.check(gC(Zz,i)),e.cidrv4=i=>e.check(yC(Yz,i)),e.cidrv6=i=>e.check(bC(Xz,i)),e.e164=i=>e.check(xC(Wz,i)),e.datetime=i=>e.check(yz(i)),e.date=i=>e.check(vz(i)),e.time=i=>e.check(xz(i)),e.duration=i=>e.check(jz(i))});function m(e){return tC(Lz,e)}const dt=H("ZodStringFormat",(e,n)=>{lt.init(e,n),c0.init(e,n)}),qz=H("ZodEmail",(e,n)=>{l_.init(e,n),dt.init(e,n)}),pb=H("ZodGUID",(e,n)=>{r_.init(e,n),dt.init(e,n)}),Vl=H("ZodUUID",(e,n)=>{o_.init(e,n),dt.init(e,n)}),Uz=H("ZodURL",(e,n)=>{c_.init(e,n),dt.init(e,n)}),$z=H("ZodEmoji",(e,n)=>{u_.init(e,n),dt.init(e,n)}),Iz=H("ZodNanoID",(e,n)=>{d_.init(e,n),dt.init(e,n)}),Vz=H("ZodCUID",(e,n)=>{f_.init(e,n),dt.init(e,n)}),Pz=H("ZodCUID2",(e,n)=>{p_.init(e,n),dt.init(e,n)}),Gz=H("ZodULID",(e,n)=>{m_.init(e,n),dt.init(e,n)}),Hz=H("ZodXID",(e,n)=>{h_.init(e,n),dt.init(e,n)}),Qz=H("ZodKSUID",(e,n)=>{g_.init(e,n),dt.init(e,n)}),Kz=H("ZodIPv4",(e,n)=>{x_.init(e,n),dt.init(e,n)}),Zz=H("ZodIPv6",(e,n)=>{w_.init(e,n),dt.init(e,n)}),Yz=H("ZodCIDRv4",(e,n)=>{j_.init(e,n),dt.init(e,n)}),Xz=H("ZodCIDRv6",(e,n)=>{N_.init(e,n),dt.init(e,n)}),Jz=H("ZodBase64",(e,n)=>{k_.init(e,n),dt.init(e,n)}),Fz=H("ZodBase64URL",(e,n)=>{__.init(e,n),dt.init(e,n)}),Wz=H("ZodE164",(e,n)=>{C_.init(e,n),dt.init(e,n)}),eT=H("ZodJWT",(e,n)=>{T_.init(e,n),dt.init(e,n)}),u0=H("ZodNumber",(e,n)=>{Fv.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(r,l,c)=>XC(e,r,l),e.gt=(r,l)=>e.check(db(r,l)),e.gte=(r,l)=>e.check(sf(r,l)),e.min=(r,l)=>e.check(sf(r,l)),e.lt=(r,l)=>e.check(ub(r,l)),e.lte=(r,l)=>e.check(af(r,l)),e.max=(r,l)=>e.check(af(r,l)),e.int=r=>e.check(mb(r)),e.safe=r=>e.check(mb(r)),e.positive=r=>e.check(db(0,r)),e.nonnegative=r=>e.check(sf(0,r)),e.negative=r=>e.check(ub(0,r)),e.nonpositive=r=>e.check(af(0,r)),e.multipleOf=(r,l)=>e.check(fb(r,l)),e.step=(r,l)=>e.check(fb(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 v(e){return _C(u0,e)}const tT=H("ZodNumberFormat",(e,n)=>{E_.init(e,n),u0.init(e,n)});function mb(e){return CC(tT,e)}const nT=H("ZodBoolean",(e,n)=>{O_.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(i,r,l)=>JC(e,i,r)});function re(e){return zC(nT,e)}const aT=H("ZodUnknown",(e,n)=>{D_.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(i,r,l)=>WC()});function ga(){return TC(aT)}const iT=H("ZodNever",(e,n)=>{R_.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(i,r,l)=>FC(e,i,r)});function sT(e){return EC(iT,e)}const rT=H("ZodArray",(e,n)=>{M_.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(i,r,l)=>iz(e,i,r,l),e.element=n.element,e.min=(i,r)=>e.check(sc(i,r)),e.nonempty=i=>e.check(sc(1,i)),e.max=(i,r)=>e.check(a0(i,r)),e.length=(i,r)=>e.check(i0(i,r)),e.unwrap=()=>e.element});function _(e,n){return PC(rT,e,n)}const oT=H("ZodObject",(e,n)=>{L_.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(i,r,l)=>sz(e,i,r,l),Ge(e,"shape",()=>n.shape),e.keyof=()=>ae(Object.keys(e._zod.def.shape)),e.catchall=i=>e.clone({...e._zod.def,catchall:i}),e.passthrough=()=>e.clone({...e._zod.def,catchall:ga()}),e.loose=()=>e.clone({...e._zod.def,catchall:ga()}),e.strict=()=>e.clone({...e._zod.def,catchall:sT()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=i=>i2(e,i),e.safeExtend=i=>s2(e,i),e.merge=i=>r2(e,i),e.pick=i=>n2(e,i),e.omit=i=>a2(e,i),e.partial=(...i)=>o2(m0,e,i[0]),e.required=(...i)=>l2(h0,e,i[0])});function j(e,n){const i={type:"object",shape:e??{},...be(n)};return new oT(i)}const d0=H("ZodUnion",(e,n)=>{t0.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(i,r,l)=>rz(e,i,r,l),e.options=n.options});function f0(e,n){return new d0({type:"union",options:e,...be(n)})}const lT=H("ZodDiscriminatedUnion",(e,n)=>{d0.init(e,n),q_.init(e,n)});function p0(e,n,i){return new lT({type:"union",options:n,discriminator:e,...be(i)})}const cT=H("ZodIntersection",(e,n)=>{U_.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(i,r,l)=>oz(e,i,r,l)});function uT(e,n){return new cT({type:"intersection",left:e,right:n})}const dT=H("ZodRecord",(e,n)=>{$_.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(i,r,l)=>lz(e,i,r,l),e.keyType=n.keyType,e.valueType=n.valueType});function mt(e,n,i){return new dT({type:"record",keyType:e,valueType:n,...be(i)})}const kf=H("ZodEnum",(e,n)=>{I_.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(r,l,c)=>ez(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 kf({...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 kf({...n,checks:[],...be(l),entries:c})}});function ae(e,n){const i=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new kf({type:"enum",entries:i,...be(n)})}const fT=H("ZodLiteral",(e,n)=>{V_.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(i,r,l)=>tz(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 qt(e,n){return new fT({type:"literal",values:Array.isArray(e)?e:[e],...be(n)})}const pT=H("ZodTransform",(e,n)=>{P_.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(i,r,l)=>az(e,i),e._zod.parse=(i,r)=>{if(r.direction==="backward")throw new Bv(e.constructor.name);i.addIssue=c=>{if(typeof c=="string")i.issues.push(uo(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(uo(d))}};const l=n.transform(i.value,i);return l instanceof Promise?l.then(c=>(i.value=c,i)):(i.value=l,i)}});function mT(e){return new pT({type:"transform",transform:e})}const m0=H("ZodOptional",(e,n)=>{n0.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(i,r,l)=>l0(e,i,r,l),e.unwrap=()=>e._zod.def.innerType});function hb(e){return new m0({type:"optional",innerType:e})}const hT=H("ZodExactOptional",(e,n)=>{G_.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(i,r,l)=>l0(e,i,r,l),e.unwrap=()=>e._zod.def.innerType});function gT(e){return new hT({type:"optional",innerType:e})}const yT=H("ZodNullable",(e,n)=>{H_.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(i,r,l)=>cz(e,i,r,l),e.unwrap=()=>e._zod.def.innerType});function gb(e){return new yT({type:"nullable",innerType:e})}const bT=H("ZodDefault",(e,n)=>{Q_.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(i,r,l)=>dz(e,i,r,l),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function vT(e,n){return new bT({type:"default",innerType:e,get defaultValue(){return typeof n=="function"?n():$v(n)}})}const ST=H("ZodPrefault",(e,n)=>{K_.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(i,r,l)=>fz(e,i,r,l),e.unwrap=()=>e._zod.def.innerType});function xT(e,n){return new ST({type:"prefault",innerType:e,get defaultValue(){return typeof n=="function"?n():$v(n)}})}const h0=H("ZodNonOptional",(e,n)=>{Z_.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(i,r,l)=>uz(e,i,r,l),e.unwrap=()=>e._zod.def.innerType});function wT(e,n){return new h0({type:"nonoptional",innerType:e,...be(n)})}const jT=H("ZodCatch",(e,n)=>{Y_.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(i,r,l)=>pz(e,i,r,l),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function NT(e,n){return new jT({type:"catch",innerType:e,catchValue:typeof n=="function"?n:()=>n})}const kT=H("ZodPipe",(e,n)=>{X_.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(i,r,l)=>mz(e,i,r,l),e.in=n.in,e.out=n.out});function yb(e,n){return new kT({type:"pipe",in:e,out:n})}const AT=H("ZodReadonly",(e,n)=>{J_.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(i,r,l)=>hz(e,i,r,l),e.unwrap=()=>e._zod.def.innerType});function _T(e){return new AT({type:"readonly",innerType:e})}const CT=H("ZodCustom",(e,n)=>{F_.init(e,n),ut.init(e,n),e._zod.processJSONSchema=(i,r,l)=>nz(e,i)});function zT(e,n={}){return GC(CT,e,n)}function TT(e){return HC(e)}const g0=j({id:m(),name:m(),keyPrefix:m(),scopes:_(m()),readOnly:re(),createdAt:m(),lastUsedAt:m().nullable(),revokedAt:m().nullable()});j({keys:_(g0)});j({name:m().min(1).max(100),scopes:_(m()).min(1).optional()});g0.extend({key:m()});const ET=j({maxConcurrency:v().int().positive(),maxRequestsPerMinute:v().int().positive(),maxRequestsPerDay:v().int().positive()}),ya=m().min(1);m().min(1);const tp=j({label:m().min(1),city:m().min(1),region:m().min(1),country:m().length(2),timezone:m().optional()}),np=ae(["citation.lost","citation.gained","run.completed","run.failed","insight.critical","insight.high"]);j({id:m(),projectId:m(),channel:qt("webhook"),url:m().url(),urlDisplay:m(),urlHost:m(),events:_(np),enabled:re().default(!0),source:m().optional(),webhookSecret:m().optional(),createdAt:m(),updatedAt:m()});j({channel:qt("webhook"),url:m().url(),events:_(np).min(1),source:m().optional()});const y0=ae(["cli","api","config-file"]);function OT(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 DT(e,n){return n?e.some(i=>i.label===n):!0}j({displayName:m().min(1),canonicalDomain:m().min(1),ownedDomains:_(m().min(1)).optional(),aliases:_(m()).optional(),country:m().length(2),language:m().min(2),tags:_(m()).optional(),labels:mt(m(),m()).optional(),providers:_(ya).optional(),locations:_(tp).optional(),defaultLocation:m().nullable().optional(),autoExtractBacklinks:re().optional(),configSource:y0.optional()});const RT=j({id:m(),name:m(),displayName:m().optional(),canonicalDomain:m(),ownedDomains:_(m()).default([]),aliases:_(m()).default([]),country:m().length(2),language:m().min(2),tags:_(m()).default([]),labels:mt(m(),m()).default({}),providers:_(m()).default([]),locations:_(tp).default([]),defaultLocation:m().nullable().optional(),autoExtractBacklinks:re().default(!1),configSource:y0.default("cli"),configRevision:v().int().positive().default(1),createdAt:m().optional(),updatedAt:m().optional()});j({id:m(),query:m(),createdAt:m()});j({id:m(),keyword:m(),createdAt:m()});j({queries:_(m().trim().min(1)).min(1)});j({keywords:_(m().trim().min(1)).min(1)});j({provider:ya,count:v().int().min(1).max(20).optional()});j({id:m(),domain:m(),createdAt:m()});j({competitors:_(m().trim().min(1)).min(1)});function oc(e){let n=e.trim().toLowerCase();try{n.includes("://")&&(n=new URL(n).hostname.toLowerCase())}catch{}return n.replace(/^www\./,"")}const MT=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 BT(e){const n=oc(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 MT.has(l)?r.length>=3?r.slice(-3).join("."):"":r.slice(-2).join(".")}function LT(e){const n=BT(e);return n?n.split(".")[0]??"":""}function qT(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=oc(c);i.has(d)||(i.add(d),r.push(c))}return r}const UT=j({name:m().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:mt(m(),m()).optional().default({})}),$T=j({preset:m().optional(),cron:m().optional(),timezone:m().optional().default("UTC"),providers:_(ya).optional().default([])}).refine(e=>e.preset&&!e.cron||!e.preset&&e.cron,{message:'Exactly one of "preset" or "cron" must be provided'}).optional(),IT=j({channel:qt("webhook"),url:m().url(),events:_(np).min(1)}),VT=j({gsc:j({propertyUrl:m()}).optional(),syncSchedule:j({preset:m().optional(),cron:m().optional()}).optional()}).optional(),bb=_(m().min(1)),PT=j({displayName:m().min(1),canonicalDomain:m().min(1),ownedDomains:_(m().min(1)).optional().default([]),aliases:_(m().min(1)).optional().default([]),country:m().length(2),language:m().min(2),queries:bb.optional(),keywords:bb.optional(),competitors:_(m().min(1)).optional().default([]),providers:_(ya).optional().default([]),locations:_(tp).optional().default([]),defaultLocation:m().optional(),schedule:$T,notifications:_(IT).optional().default([]),google:VT,autoExtractBacklinks:re().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=OT(e.locations);i.length>0&&n.addIssue({code:"custom",message:`Duplicate location labels are not allowed: ${i.join(", ")}`,path:["locations"]}),DT(e.locations,e.defaultLocation)||n.addIssue({code:"custom",message:`defaultLocation "${e.defaultLocation}" must match a configured location label`,path:["defaultLocation"]})});j({apiVersion:qt("canonry/v1"),kind:qt("Project"),metadata:UT,spec:PT});const GT=ae(["gsc","ga4","gbp"]);j({id:m(),domain:m(),connectionType:GT,propertyId:m().nullable().optional(),sitemapUrl:m().nullable().optional(),scopes:_(m()).default([]),createdAt:m(),updatedAt:m()});j({date:m(),query:m(),page:m(),country:m().nullable().optional(),device:m().nullable().optional(),clicks:v(),impressions:v(),ctr:v(),position:v()});const HT=j({date:m(),clicks:v(),impressions:v(),ctr:v()});j({totals:j({clicks:v(),impressions:v(),ctr:v(),days:v()}),daily:_(HT)});const Af=j({id:m(),url:m(),indexingState:m().nullable().optional(),verdict:m().nullable().optional(),coverageState:m().nullable().optional(),pageFetchState:m().nullable().optional(),robotsTxtState:m().nullable().optional(),crawlTime:m().nullable().optional(),lastCrawlResult:m().nullable().optional(),isMobileFriendly:re().nullable().optional(),richResults:_(m()).default([]),referringUrls:_(m()).default([]),inspectedAt:m()});ae(["stable","reindexed","deindexed","still-missing","new"]);const QT=j({url:m(),previousState:m().nullable(),currentState:m().nullable(),transitionDate:m()}),KT=j({reason:m(),count:v(),urls:_(Af).default([])});j({summary:j({total:v(),indexed:v(),notIndexed:v(),deindexed:v(),percentage:v()}),lastInspectedAt:m().nullable(),lastSyncedAt:m().nullable(),indexed:_(Af).default([]),notIndexed:_(Af).default([]),deindexed:_(QT).default([]),reasonGroups:_(KT).default([])});j({url:m(),type:ae(["URL_UPDATED","URL_DELETED"]),notifiedAt:m()});const ZT=j({url:m(),type:ae(["URL_UPDATED","URL_DELETED"]),notifiedAt:m(),status:ae(["success","error"]),error:m().optional()});j({summary:j({total:v().int().nonnegative(),succeeded:v().int().nonnegative(),failed:v().int().nonnegative()}),results:_(ZT).default([])});j({date:m(),indexed:v(),notIndexed:v(),reasonBreakdown:mt(m(),v()).default({})});const YT=j({siteUrl:m(),permissionLevel:m()});j({sites:_(YT).default([])});const XT=j({type:m(),submitted:m(),indexed:m()}),JT=j({path:m(),lastSubmitted:m().optional(),isPending:re().optional(),isSitemapsIndex:re().optional(),type:m().optional(),lastDownloaded:m().optional(),warnings:m().optional(),errors:m().optional(),contents:_(XT).optional()});j({sitemaps:_(JT).default([])});const FT=j({name:m(),accountName:m().nullable(),type:m().nullable(),role:m().nullable()});j({accounts:_(FT),total:v().int().nonnegative()});const WT=j({id:m(),projectId:m(),accountName:m(),locationName:m(),displayName:m(),primaryCategoryDisplayName:m().nullable(),storefrontAddress:m().nullable(),websiteUri:m().nullable(),placeId:m().nullable(),mapsUri:m().nullable(),selected:re(),syncedAt:m().nullable(),createdAt:m(),updatedAt:m()});j({locations:_(WT),totalDiscovered:v().int().nonnegative(),totalSelected:v().int().nonnegative()});j({selectAllNew:re().default(!0),accountName:m().optional(),switchAccount:re().default(!1)});j({selected:re()});j({locationNames:_(m()).optional(),daysOfMetrics:v().int().positive().max(540).optional(),monthsOfKeywords:v().int().positive().max(18).optional()});j({runId:m(),status:m()});const eE=j({locationName:m(),date:m(),metric:m(),value:v().int()});j({metrics:_(eE),total:v().int().nonnegative()});const tE=j({locationName:m(),periodStart:m(),periodEnd:m(),keyword:m(),valueCount:v().int().nullable(),valueThreshold:v().int().nullable()});j({keywords:_(tE),total:v().int().nonnegative(),thresholdedPct:v().int().min(0).max(100)});const nE=j({locationName:m(),placeActionLinkName:m(),placeActionType:m(),uri:m().nullable(),isPreferred:re(),providerType:m().nullable()});j({placeActions:_(nE),total:v().int().nonnegative()});const aE=j({locationName:m(),populatedGroupCount:v().int().nonnegative(),syncedAt:m(),attributes:mt(m(),ga())});j({lodging:_(aE),total:v().int().nonnegative()});const iE=j({locationName:m(),placeId:m(),tier:m(),amenities:_(m()),syncedAt:m(),place:mt(m(),ga())});j({places:_(iE),total:v().int().nonnegative()});j({scope:j({locationName:m().nullable(),locationCount:v().int().nonnegative()}),performance:j({totals:mt(m(),v()),recent7d:mt(m(),v()),prior7d:mt(m(),v()),deltaPct:mt(m(),v().nullable())}),freshness:j({dataThroughDate:m().nullable(),latestStoredDate:m().nullable(),pendingDays:v().int().nonnegative()}),timeseries:_(j({date:m(),pending:re(),metrics:mt(m(),v())})),keywords:j({total:v().int().nonnegative(),thresholdedCount:v().int().nonnegative(),thresholdedPct:v().int().min(0).max(100)}),placeActions:j({total:v().int().nonnegative(),hasReservationCta:re(),hasBookingCta:re(),hasDirectMerchantCta:re()}),lodging:j({lodgingLocationCount:v().int().nonnegative(),populatedLodgingCount:v().int().nonnegative(),emptyLodgingCount:v().int().nonnegative()})});const sE={BUSINESS_DIRECTION_REQUESTS:"Direction requests",WEBSITE_CLICKS:"Website clicks",CALL_CLICKS:"Call clicks",BUSINESS_BOOKINGS:"Bookings",BUSINESS_CONVERSATIONS:"Conversations",BUSINESS_FOOD_ORDERS:"Food orders",BUSINESS_FOOD_MENU_CLICKS:"Food menu clicks",BUSINESS_IMPRESSIONS_DESKTOP_SEARCH:"Search impressions (desktop)",BUSINESS_IMPRESSIONS_MOBILE_SEARCH:"Search impressions (mobile)",BUSINESS_IMPRESSIONS_DESKTOP_MAPS:"Maps impressions (desktop)",BUSINESS_IMPRESSIONS_MOBILE_MAPS:"Maps impressions (mobile)"};function rE(e){const n=e.replace(/^BUSINESS_/,"").split("_").filter(Boolean).map(r=>r.toLowerCase());if(n.length===0)return e;const i=n.join(" ");return i.charAt(0).toUpperCase()+i.slice(1)}function dL(e){return sE[e]??rE(e)}const oE=["BUSINESS_DIRECTION_REQUESTS","WEBSITE_CLICKS","CALL_CLICKS"],lE=["BUSINESS_IMPRESSIONS_DESKTOP_SEARCH","BUSINESS_IMPRESSIONS_MOBILE_SEARCH","BUSINESS_IMPRESSIONS_DESKTOP_MAPS","BUSINESS_IMPRESSIONS_MOBILE_MAPS"];function fL(e){return oE.includes(e)?"conversion":lE.includes(e)?"reach":"other"}j({id:m(),domain:m(),siteUrl:m().nullable().optional(),createdAt:m(),updatedAt:m()});const rf=j({id:m(),url:m(),httpCode:v().nullable().optional(),inIndex:re().nullable().optional(),lastCrawledDate:m().nullable().optional(),inIndexDate:m().nullable().optional(),inspectedAt:m(),documentSize:v().nullable().optional(),anchorCount:v().nullable().optional(),discoveryDate:m().nullable().optional()});j({summary:j({total:v(),indexed:v(),notIndexed:v(),unknown:v().optional(),percentage:v()}),lastInspectedAt:m().nullable(),indexed:_(rf).default([]),notIndexed:_(rf).default([]),unknown:_(rf).default([]).optional()});j({query:m(),impressions:v(),clicks:v(),ctr:v(),averagePosition:v()});j({date:m(),indexed:v(),notIndexed:v(),unknown:v()});const cE=j({url:m(),status:ae(["success","error"]),submittedAt:m(),error:m().optional()});j({summary:j({total:v().int().nonnegative(),succeeded:v().int().nonnegative(),failed:v().int().nonnegative()}),results:_(cE).default([])});const b0=j({url:m(),verified:re()});j({sites:_(b0).default([])});j({connected:re(),domain:m(),siteUrl:m().nullable(),createdAt:m().nullable(),updatedAt:m().nullable()});j({connected:re(),domain:m(),siteUrl:m().nullable(),availableSites:_(b0).default([])});j({siteUrl:m()});const uE=j({name:m(),alive:re(),lastUsed:m().nullable()});j({connected:re(),endpoint:m(),version:m().optional(),browserVersion:m().optional(),targets:_(uE).default([])});const Zs=ae(["live","staging"]);j({projectName:m(),url:m(),stagingUrl:m().optional(),username:m(),defaultEnv:Zs,createdAt:m(),updatedAt:m()});const vb=j({url:m(),reachable:re(),pageCount:v().nullable().optional(),version:m().nullable().optional(),error:m().nullable().optional(),plugins:_(m()).optional(),authenticatedUser:j({id:v(),slug:m()}).nullable().optional()});j({connected:re(),projectName:m(),defaultEnv:Zs,live:vb.nullable(),staging:vb.nullable(),adminUrl:m().nullable().optional()});const dE=j({id:v(),slug:m(),title:m(),status:m(),modifiedAt:m().nullable().optional(),link:m().nullable().optional()}),v0=j({title:m().nullable(),description:m().nullable(),noindex:re().nullable(),writable:re().default(!1),writeTargets:_(m()).default([])}),fE=j({type:m(),json:mt(m(),ga())}),pE=dE.extend({env:Zs,content:m(),seo:v0,schemaBlocks:_(fE).default([])}),Sb=pE.extend({contentHash:m(),contentSnippet:m()}),S0=j({manualRequired:qt(!0),targetUrl:m(),adminUrl:m().nullable().optional(),content:m(),nextSteps:_(m()).default([])}),mE=j({slug:m(),severity:ae(["high","medium","low"]),code:ae(["noindex","missing-seo-title","missing-meta-description","missing-schema","thin-content"]),message:m()});j({slug:m(),title:m(),status:m(),wordCount:v(),seo:v0,schemaPresent:re(),issues:_(mE).default([])});const hE=j({slug:m(),status:ae(["applied","skipped","manual"]),error:m().optional(),manualAssist:S0.optional()});j({env:Zs,strategy:ae(["plugin","manual"]),results:_(hE)});const gE=j({slug:m(),status:ae(["deployed","stripped","skipped","failed"]),schemasInjected:_(m()).optional(),manualAssist:S0.optional(),error:m().optional()});j({env:Zs,results:_(gE)});const yE=j({slug:m(),title:m(),canonrySchemas:_(m()),thirdPartySchemas:_(m()),hasCanonrySchema:re()});j({env:Zs,pages:_(yE)});const bE=j({name:m(),status:ae(["completed","skipped","failed"]),summary:m().optional(),error:m().optional()});j({projectName:m(),steps:_(bE)});j({slug:m(),live:Sb,staging:Sb,hasDifferences:re(),differences:j({title:re(),slug:re(),content:re(),seoTitle:re(),seoDescription:re(),noindex:re(),schema:re()})});const vE=j({name:m(),displayName:m().optional(),keyUrl:m().optional(),modelHint:m().optional(),model:m().optional(),defaultModel:m().optional(),configured:re(),quota:ET.optional(),vertexConfigured:re().optional()}),xb=j({configured:re()});j({providers:_(vE).default([]),google:xb,bing:xb});const Ys=ae(["queued","running","completed","partial","failed","cancelled"]),Ht=Ys.enum,x0=ae(["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","gbp-sync","ads-sync"]),ke=x0.enum,w0=ae(["manual","scheduled","config-apply","backfill","probe"]),Bs=w0.enum,Ai=ae(["cited","not-cited"]),lc=Ai.enum,cc=ae(["visible","not-visible"]);cc.enum;const uc=ae(["mentioned","not-mentioned"]);uc.enum;const j0=ae(["new","cited","lost","emerging","not-cited"]);j0.enum;const SE=ae(["new","mentioned","lost","emerging","not-mentioned"]);SE.enum;const xE=ae([Bs.manual,Bs.probe]);j({kind:qt(ke["answer-visibility"]).optional(),trigger:xE.optional(),providers:_(ya).optional(),queries:_(m().min(1)).min(1).optional(),location:m().min(1).optional(),allLocations:re().optional(),noLocation:re().optional()}).refine(e=>+!!e.location+ +!!e.allLocations+ +!!e.noLocation<=1,{message:'Only one of "location", "allLocations", or "noLocation" may be provided'});const wE=j({message:m(),raw:ga().optional()}),jE=j({message:m().optional(),providers:mt(m(),wE).optional()}),NE=j({id:m(),projectId:m(),kind:x0,status:Ys,trigger:w0.default("manual"),location:m().nullable().optional(),queries:_(m()).nullable().optional(),startedAt:m().nullable().optional(),finishedAt:m().nullable().optional(),error:jE.nullable().optional(),createdAt:m()});function ap(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 N0=j({uri:m(),title:m()}),k0=j({id:m(),runId:m(),queryId:m(),query:m().optional(),provider:ya,citationState:Ai,answerMentioned:re().optional(),visibilityState:cc.optional(),mentionState:uc.optional(),transition:j0.optional(),answerText:m().nullable().optional(),citedDomains:_(m()).default([]),competitorOverlap:_(m()).default([]),recommendedCompetitors:_(m()).default([]),matchedTerms:_(m()).default([]),groundingSources:_(N0).default([]),searchQueries:_(m()).default([]),model:m().nullable().optional(),location:m().nullable().optional(),createdAt:m()});j({snapshots:_(k0),total:v().int().nonnegative()});const kE=j({queryId:m().nullable(),query:m().nullable(),run1State:Ai.nullable(),run2State:Ai.nullable(),run1AnswerMentioned:re().nullable(),run2AnswerMentioned:re().nullable(),run1VisibilityState:cc.nullable(),run2VisibilityState:cc.nullable(),run1MentionState:uc.nullable().optional(),run2MentionState:uc.nullable().optional(),changed:re(),visibilityChanged:re()});j({run1:m(),run2:m(),diff:_(kE)});const AE=NE.extend({snapshots:_(k0).optional()}),_E=j({totalRuns:v().int().nonnegative(),run:AE.nullable()});j({id:m(),projectId:m().nullable().optional(),actor:m(),action:m(),entityType:m(),entityId:m().nullable().optional(),diff:ga().optional(),createdAt:m()});const CE=ae(["yes","no","unknown","not-mentioned"]),wb=_(m().min(1));j({companyName:m().min(1),domain:m().min(1),queries:wb.optional(),phrases:wb.optional(),competitors:_(m().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 zE=j({name:m(),count:v().int().nonnegative()}),TE=j({id:m(),name:m(),weight:v(),score:v(),findings:_(j({type:m(),message:m()})).default([]),recommendations:_(m()).default([])}),EE=j({url:m(),finalUrl:m(),auditedAt:m(),overallScore:v(),summary:m(),factors:_(TE).default([])}),OE=j({industry:m(),summary:m(),services:_(m()).default([]),categoryTerms:_(m()).default([])}),DE=j({provider:m(),displayName:m(),model:m().nullable().optional(),mentioned:re(),cited:re(),describedAccurately:CE,accuracyNotes:m().nullable().optional(),incorrectClaims:_(m()).default([]),recommendedCompetitors:_(m()).default([]),citedDomains:_(m()).default([]),groundingSources:_(N0).default([]),searchQueries:_(m()).default([]),answerText:m(),error:m().nullable().optional()}),RE=j({query:m(),providerResults:_(DE).default([])}),ME=j({totalQueries:v().int().nonnegative(),totalProviders:v().int().nonnegative(),totalComparisons:v().int().nonnegative(),mentionCount:v().int().nonnegative(),citationCount:v().int().nonnegative(),topCompetitors:_(zE).default([]),visibilityGap:m(),whatThisMeans:_(m()).default([]),recommendedActions:_(m()).default([])});j({companyName:m(),domain:m(),homepageUrl:m(),generatedAt:m(),queries:_(m()).default([]),competitors:_(m()).default([]),profile:OE,audit:EE,queryResults:_(RE).default([]),summary:ME});const A0=ae(["pass","partial","fail"]);A0.enum;const _0=ae(["up","down","flat"]);_0.enum;const BE=j({id:m(),name:m(),weight:v(),avgScore:v(),status:A0,pagesPassing:v().int().nonnegative(),pagesPartial:v().int().nonnegative(),pagesFailing:v().int().nonnegative()}),LE=j({factorId:m(),factorName:m(),avgScore:v(),affectedPages:v().int().nonnegative(),totalPages:v().int().nonnegative(),affectedPct:v().int().nonnegative(),topRecommendations:_(m()).default([])});j({project:m(),hasData:re(),runId:m().nullable(),runStatus:Ys.nullable(),sitemapUrl:m().nullable(),auditedAt:m().nullable(),aggregateScore:v(),pagesDiscovered:v().int().nonnegative(),pagesAudited:v().int().nonnegative(),pagesSkipped:v().int().nonnegative(),pagesErrored:v().int().nonnegative(),deltaScore:v().nullable(),trend:_0.nullable(),previousScore:v().nullable(),previousAuditedAt:m().nullable(),factors:_(BE).default([]),crossCuttingIssues:_(LE).default([]),prioritizedFixes:_(m()).default([])});const qE=j({id:m(),name:m(),weight:v(),score:v()}),UE=j({url:m(),overallScore:v(),status:ae(["success","error"]),error:m().nullable().optional(),factors:_(qE).default([])});j({project:m(),runId:m().nullable(),auditedAt:m().nullable(),total:v().int().nonnegative(),pages:_(UE).default([])});const $E=j({runId:m(),auditedAt:m(),aggregateScore:v(),pagesAudited:v().int().nonnegative()});j({project:m(),points:_($E).default([])});j({sitemapUrl:m().url().optional(),limit:v().int().positive().max(2e3).optional()});j({runId:m(),status:Ys});const ip=ae(["answer-visibility","traffic-sync","gbp-sync","data-refresh","backlinks-sync","site-audit","ads-sync"]);ip.enum;j({id:m(),projectId:m(),kind:ip,cronExpr:m(),preset:m().nullable().optional(),timezone:m().default("UTC"),enabled:re().default(!0),providers:_(ya).default([]),sourceId:m().nullable().optional(),lastRunAt:m().nullable().optional(),nextRunAt:m().nullable().optional(),createdAt:m(),updatedAt:m()});j({kind:ip.optional(),preset:m().optional(),cron:m().optional(),timezone:m().optional().default("UTC"),enabled:re().optional().default(!0),providers:_(ya).optional().default([]),sourceId:m().optional()}).refine(e=>e.preset&&!e.cron||!e.preset&&e.cron,{message:'Exactly one of "preset" or "cron" must be provided'});const sp=ae(["competitor","directory","social","forum","news","reference","blog","ecommerce","video","academic","other"]);sp.enum;const rp=ae(["cited","aspirational","wasted-surface"]),jb=rp.enum;jb.cited,jb.aspirational;const xc=ae(["direct-competitor","ota-aggregator","editorial-media","other","unknown"]),IE=xc.enum;IE["direct-competitor"];const wc=ae(["queued","seeding","probing","completed","failed"]);wc.enum;const C0=j({domain:m().min(1),hits:v().int().positive(),competitorType:xc.default("unknown")}),VE=j({id:m(),sessionId:m(),projectId:m(),query:m(),bucket:rp.nullable().default(null),citationState:Ai,citedDomains:_(m()).default([]),answerMentioned:re().nullable().default(null),createdAt:m()}),PE=j({id:m(),projectId:m(),status:wc,icpDescription:m().nullable().optional(),seedProvider:m().nullable().optional(),seedCountRaw:v().int().nullable().optional(),seedCount:v().int().nullable().optional(),dedupThreshold:v().nullable().optional(),probeCount:v().int().nullable().optional(),citedCount:v().int().nullable().default(null),aspirationalCount:v().int().nullable().default(null),wastedCount:v().int().nullable().default(null),competitorMap:_(C0).default([]),warning:m().nullable().optional(),error:m().nullable().optional(),startedAt:m().nullable().optional(),finishedAt:m().nullable().optional(),createdAt:m()});PE.extend({probes:_(VE).default([])});const GE=500;j({icpDescription:m().min(1).optional(),dedupThreshold:v().min(0).max(1).optional(),maxProbes:v().int().positive().max(GE).optional(),locations:_(m().min(1)).optional()});j({buckets:_(rp).min(1).optional(),includeCompetitors:re().optional(),competitorTypes:_(xc).min(1).optional()});j({sessionId:m(),projectId:m(),status:wc,queriesByBucket:j({cited:_(m()),aspirational:_(m()),"wasted-surface":_(m())}),suggestedCompetitors:_(C0)});j({sessionId:m(),projectId:m(),promoted:j({queries:_(m()),competitors:_(m())}),skipped:j({queries:_(m()),competitors:_(m())})});f0([qt("cli"),m().regex(/^discovery:.+$/)]);const HE=j({query:m().min(1),probeHits:v().int().positive()}),QE=j({rawCandidates:v().int().nonnegative(),admitted:v().int().nonnegative(),rejected:j({belowFloor:v().int().nonnegative(),length:v().int().nonnegative(),navigational:v().int().nonnegative(),duplicate:v().int().nonnegative(),offAnchor:v().int().nonnegative(),semanticDuplicate:v().int().nonnegative()})});j({sessionId:m(),projectId:m(),provider:m(),status:wc,minProbeHits:v().int().positive(),anchorApplied:re(),semanticNoveltyApplied:re(),candidates:_(HE),stats:QE});const op=ae(["own","direct-competitor","ota-aggregator","editorial-media","other"]);op.enum;const z0=ae(["7d","30d","90d","all"]),Nb=ae(["improving","declining","stable"]),KE=ae(["mentioned","cited"]);KE.enum;const _f=j({citationRate:v(),cited:v().int(),total:v().int(),mentionRate:v(),mentionedCount:v().int()}),ZE=j({startDate:m(),endDate:m(),citationRate:v(),cited:v().int(),total:v().int(),queryCount:v().int(),mentionRate:v(),mentionedCount:v().int(),byProvider:mt(m(),_f)}),YE=j({date:m(),delta:v().int(),label:m()});j({window:z0,buckets:_(ZE),overall:_f,byProvider:mt(m(),_f),trend:Nb,mentionTrend:Nb,queryChanges:_(YE)});const kb=j({category:sp,label:m(),count:v().int(),percentage:v(),topDomains:_(j({domain:m(),count:v().int()}))}),XE=j({domain:m(),count:v().int(),percentage:v(),category:sp,label:m(),surfaceClass:op}),JE=j({surfaceClass:op,label:m(),count:v().int(),percentage:v(),domainCount:v().int()}),Ab=j({totalCitedSlots:v().int(),domainTotal:v().int(),entries:_(XE),truncatedDomainCount:v().int(),truncatedCitedSlots:v().int(),bySurfaceClass:_(JE)});j({overall:_(kb),byQuery:mt(m(),_(kb)),ranked:Ab,byProvider:mt(m(),Ab),runId:m(),window:z0,limit:v().int().nullable()});const lp=j({total:v().int(),checked:v().int(),mentioned:v().int(),cited:v().int(),mentionRate:v().nullable(),citedRate:v().nullable()}),T0=lp.extend({provider:m(),firstObserved:m(),lastObserved:m()}),FE=lp.extend({queryId:m().nullable(),query:m(),firstObserved:m(),lastObserved:m(),providers:_(T0).optional()}),WE=j({since:m().nullable(),until:m().nullable(),lastRuns:v().int().nullable(),runCount:v().int()}),eO=ae(["provider"]);j({project:m(),groupBy:eO.optional(),window:WE,totals:lp,byProvider:_(T0).optional(),queries:_(FE)});j({id:m(),projectId:m(),propertyId:m(),clientEmail:m(),connected:re(),createdAt:m(),updatedAt:m()});j({date:m(),landingPage:m(),sessions:v(),organicSessions:v(),users:v()});const cp=ae(["session","first_user","manual_utm"]),tO=j({source:m(),medium:m(),sessions:v(),users:v(),sourceDimension:cp}),nO=j({source:m(),medium:m(),sourceDimension:cp,landingPage:m(),sessions:v(),users:v()}),aO=j({source:m(),medium:m(),sessions:v(),users:v(),channelGroup:m()}),Fr=j({sessions:v(),sharePct:v(),sharePctDisplay:m()}),iO=j({organic:Fr,social:Fr,direct:Fr,ai:Fr,other:Fr});j({totalSessions:v(),totalOrganicSessions:v(),totalDirectSessions:v(),totalUsers:v(),topPages:_(j({landingPage:m(),sessions:v(),organicSessions:v(),directSessions:v(),users:v()})),aiReferrals:_(tO),aiReferralLandingPages:_(nO),aiSessionsDeduped:v(),aiUsersDeduped:v(),aiSessionsBySession:v(),aiUsersBySession:v(),socialReferrals:_(aO),socialSessions:v(),socialUsers:v(),channelBreakdown:iO,organicSharePct:v(),aiSharePct:v(),aiSharePctBySession:v(),directSharePct:v(),socialSharePct:v(),organicSharePctDisplay:m(),aiSharePctDisplay:m(),aiSharePctBySessionDisplay:m(),directSharePctDisplay:m(),socialSharePctDisplay:m(),otherSessions:v(),otherSharePct:v(),otherSharePctDisplay:m(),lastSyncedAt:m().nullable()});j({connected:re(),propertyId:m().nullable(),clientEmail:m().nullable(),authMethod:ae(["service-account","oauth"]).nullable(),lastSyncedAt:m().nullable(),createdAt:m().nullable().optional(),updatedAt:m().nullable().optional()});j({synced:re(),rowCount:v().int().nonnegative(),aiReferralCount:v().int().nonnegative(),socialReferralCount:v().int().nonnegative(),days:v().int().nonnegative(),syncedAt:m(),syncedComponents:_(m()).optional()});j({date:m(),source:m(),medium:m(),landingPage:m(),sessions:v(),users:v(),sourceDimension:cp});j({date:m(),source:m(),medium:m(),sessions:v(),users:v(),channelGroup:m()});j({date:m(),sessions:v(),organicSessions:v(),users:v()});function dc(e){return e.toLowerCase().replace(/[^a-z0-9]/g,"")}const E0=ae(["claude","openai","gemini","zai"]),sO=j({id:E0,label:m(),defaultModel:m(),configured:re(),keySource:ae(["config","env"]).nullable()});j({providers:_(sO).default([]),defaultProvider:E0.nullable()});const rO=ae(["aero","user","compaction"]);rO.enum;const O0=128;j({key:m().min(1).max(O0),value:m().min(1)});j({key:m().min(1).max(O0)});const Xs=ae(["commoncrawl","bing-webmaster"]);Xs.enum;const up=ae(["queued","downloading","querying","ready","failed"]);up.enum;j({id:m(),release:m(),status:up,phaseDetail:m().nullable().optional(),vertexPath:m().nullable().optional(),edgesPath:m().nullable().optional(),vertexSha256:m().nullable().optional(),edgesSha256:m().nullable().optional(),vertexBytes:v().int().nullable().optional(),edgesBytes:v().int().nullable().optional(),projectsProcessed:v().int().nullable().optional(),domainsDiscovered:v().int().nullable().optional(),downloadStartedAt:m().nullable().optional(),downloadFinishedAt:m().nullable().optional(),queryStartedAt:m().nullable().optional(),queryFinishedAt:m().nullable().optional(),error:m().nullable().optional(),createdAt:m(),updatedAt:m()});const oO=j({linkingDomain:m(),numHosts:v().int(),source:Xs}),lO=j({projectId:m(),release:m(),targetDomain:m(),totalLinkingDomains:v().int(),totalHosts:v().int(),top10HostsShare:m(),queriedAt:m(),source:Xs,excludedLinkingDomains:v().int().optional(),excludedHosts:v().int().optional()});j({source:Xs,summary:lO.nullable(),total:v().int(),rows:_(oO)});j({release:m(),totalLinkingDomains:v().int(),totalHosts:v().int(),top10HostsShare:m(),queriedAt:m(),source:Xs});const cO=j({source:Xs,connected:re(),hasData:re(),latestRelease:m().nullable(),totalLinkingDomains:v().int(),lastSyncedAt:m().nullable()});j({projectId:m(),targetDomain:m(),sources:_(cO),anyConnected:re(),anyData:re()});j({duckdbInstalled:re(),duckdbVersion:m().nullable().optional(),duckdbSpec:m(),pluginDir:m()});j({installed:re(),version:m(),path:m(),alreadyPresent:re()});j({release:m(),vertexUrl:m(),edgesUrl:m(),vertexBytes:v().int().nullable(),edgesBytes:v().int().nullable(),lastModified:m().nullable()});j({release:m(),syncStatus:up.nullable(),bytes:v().int(),lastUsedAt:m().nullable()});const dp=ae(["positive","caution","negative","neutral"]),Qa=j({label:m(),value:m(),delta:m(),tone:dp,description:m(),tooltip:m().optional(),trend:_(v()),progress:v().optional(),providerCoverage:m().optional()}),uO=Qa.extend({breakdown:j({projectMentionSnapshots:v().int().nonnegative(),competitorMentionSnapshots:v().int().nonnegative(),perCompetitor:_(j({domain:m(),mentionSnapshots:v().int().nonnegative(),shareOfCompetitiveTotal:v()})),snapshotsWithAnswerText:v().int().nonnegative(),snapshotsTotal:v().int().nonnegative()})}),of=j({gained:v().int().nonnegative(),lost:v().int().nonnegative(),tone:dp,hasPreviousRun:re(),gainedQueries:_(m()).optional(),lostQueries:_(m()).optional()}),dO=j({hasPreviousRun:re(),comparable:re(),querySetChanged:re(),previousRunAt:m().nullable(),currentQueryCount:v().int().nonnegative(),previousQueryCount:v().int().nonnegative(),comparableQueryCount:v().int().nonnegative(),addedQueryCount:v().int().nonnegative(),removedQueryCount:v().int().nonnegative(),addedQueries:_(m()),removedQueries:_(m())}),fO=j({id:m(),projectId:m(),runId:m().nullable(),type:ae(["regression","gain","opportunity","first-citation","provider-pickup","persistent-gap","competitor-gained","competitor-lost","gbp-lodging-gap","gbp-listing-discrepancy","gbp-cta-gap","gbp-metric-drop","gbp-keyword-drop"]),severity:ae(["critical","high","medium","low"]),title:m(),query:m(),provider:m(),recommendation:j({action:m(),target:m().optional(),reason:m()}).optional(),cause:j({cause:m(),competitorDomain:m().optional(),details:m().optional()}).optional(),dismissed:re(),createdAt:m()}),pO=j({id:m(),projectId:m(),runId:m().nullable(),overallCitedRate:v(),overallMentionRate:v(),totalPairs:v().int().nonnegative(),citedPairs:v().int().nonnegative(),mentionedPairs:v().int().nonnegative(),providerBreakdown:mt(m(),j({citedRate:v(),mentionRate:v(),cited:v().int().nonnegative(),mentioned:v().int().nonnegative(),total:v().int().nonnegative()})),createdAt:m(),status:ae(["ready","no-data"]),reason:qt("no-runs-yet").optional()});j({project:RT,latestRun:_E,health:pO.nullable(),topInsights:_(fO),queryCounts:j({totalQueries:v().int().nonnegative(),citedQueries:v().int().nonnegative(),notCitedQueries:v().int().nonnegative(),citedRate:v(),mentionedQueries:v().int().nonnegative(),notMentionedQueries:v().int().nonnegative(),mentionRate:v()}),providers:_(j({provider:m(),citedRate:v(),cited:v().int().nonnegative(),total:v().int().nonnegative()})),transitions:j({since:m().nullable(),gained:v().int().nonnegative(),lost:v().int().nonnegative(),emerging:v().int().nonnegative()}),scores:j({mention:Qa,visibility:Qa,mentionShare:uO,gapQueries:Qa,mentionGaps:Qa,indexCoverage:Qa,competitorPressure:Qa,runStatus:Qa}),movementSummary:of,citationMovement:of,mentionMovement:of,movementComparison:dO,competitors:_(j({id:m(),domain:m(),citationCount:v().int().nonnegative(),totalQueries:v().int().nonnegative(),pressureLabel:ae(["None","Low","Moderate","High"]),citedQueries:_(m())})),providerScores:_(j({provider:m(),model:m().nullable(),score:v(),cited:v().int().nonnegative(),total:v().int().nonnegative(),trend:_(v()).optional()})),attentionItems:_(j({id:m(),tone:dp,title:m(),detail:m(),actionLabel:m(),href:m()})),runHistory:_(j({runId:m(),createdAt:m(),citedCount:v().int().nonnegative(),totalCount:v().int().nonnegative(),citationRate:v(),mentionedCount:v().int().nonnegative(),mentionRate:v(),status:m()})),suggestedQueries:j({rows:_(j({query:m(),impressions:v(),clicks:v(),avgPosition:v(),reason:m()})),totalCandidates:v().int().nonnegative(),skippedAlreadyTracked:v().int().nonnegative()}),dateRangeLabel:m(),contextLabel:m()});ae(["snapshot","insight"]);const mO=j({kind:qt("snapshot"),id:m(),runId:m(),query:m(),provider:m(),model:m().nullable(),citationState:Ai,matchedField:ae(["answerText","citedDomains","searchQueries","query"]),snippet:m(),createdAt:m()}),hO=j({kind:qt("insight"),id:m(),runId:m().nullable(),type:ae(["regression","gain","opportunity","first-citation","provider-pickup","persistent-gap","competitor-gained","competitor-lost","gbp-lodging-gap","gbp-listing-discrepancy","gbp-cta-gap","gbp-metric-drop","gbp-keyword-drop"]),severity:ae(["critical","high","medium","low"]),title:m(),query:m(),provider:m(),matchedField:ae(["title","query","recommendation","cause"]),snippet:m(),dismissed:re(),createdAt:m()}),gO=p0("kind",[mO,hO]);j({query:m(),totalHits:v().int().nonnegative(),truncated:re(),hits:_(gO)});const D0=ae(["create","expand","refresh","add-schema"]);D0.enum;function pL(e){switch(e){case"create":return"Create";case"expand":return"Expand";case"refresh":return"Refresh";case"add-schema":return"Add schema"}}const R0=ae(["gsc","competitor-evidence","both"]);R0.enum;const M0=ae(["high","medium","low"]);M0.enum;const yO=ae(["blog-post","comparison","listicle","how-to","guide","glossary"]);yO.enum;const B0=ae(["proposed","briefed","payload-generated","draft-created","published","validated","dismissed"]);B0.enum;const fp=ae(["ownable","ceded"]);fp.enum;const bO=j({url:m(),gscImpressions:v().nonnegative(),gscClicks:v().nonnegative(),gscAvgPosition:v().nonnegative().nullable(),organicSessions:v().nonnegative()}),vO=j({domain:m(),url:m(),title:m(),citationCount:v().int().nonnegative()}),SO=j({demand:v(),competitor:v(),absence:v(),gapSeverity:v()}),xO=j({actionId:m(),state:B0,lastUpdated:m()}),L0=j({targetRef:m(),query:m(),action:D0,ourBestPage:bO.nullable(),winningCompetitor:vO.nullable(),score:v(),scoreBreakdown:SO,drivers:_(m()),demandSource:R0,actionConfidence:M0,existingAction:xO.nullable(),winnabilityClass:fp,winnability:v().min(0).max(1).nullable()});j({targets:_(L0),contextMetrics:j({totalAiReferralSessions:v().int().nonnegative(),latestRunId:m(),runTimestamp:m()})});const wO=j({targetRef:m(),addressedUrl:m().nullable(),note:m().nullable(),dismissedAt:m()});j({dismissals:_(wO)});j({targetRef:m().min(1),addressedUrl:m().url().optional(),note:m().max(500).optional()});j({targetRef:m(),promptVersion:m(),provider:m(),model:m(),responseText:m(),costMillicents:v().int().nonnegative(),generatedAt:m()});j({provider:m().optional(),model:m().optional(),forceRefresh:re().optional()});const jO=j({targetQuery:m().trim().min(1),winnabilityClass:fp,angle:m().trim().min(1),whyWinnable:m().trim().min(1),schemaHookup:m().trim().min(1),controllableSurfaceRationale:m().trim().min(1)});j({targetRef:m(),promptVersion:m(),provider:m(),model:m(),brief:jO,costMillicents:v().int().nonnegative(),generatedAt:m()});const NO=j({domain:m(),competitorType:xc,hits:v().int().nonnegative(),updatedAt:m()});j({classifications:_(NO)});const kO=j({uri:m(),title:m(),domain:m(),isOurDomain:re(),isCompetitor:re(),citationCount:v().int().nonnegative(),providers:_(ya)}),q0=j({query:m(),groundingSources:_(kO)});j({sources:_(q0),latestRunId:m()});const U0=j({query:m(),competitorDomains:_(m()),competitorCount:v().int().nonnegative(),missRate:v().min(0).max(1),lastSeenInRunId:m()});j({gaps:_(U0),latestRunId:m()});const $0=ae(["ok","warn","fail","skipped"]);$0.enum;const pp=ae(["global","project"]);pp.enum;const I0=ae(["auth","config","providers","integrations","database","schedules","agent"]);I0.enum;const AO=j({id:m(),category:I0,scope:pp,title:m(),status:$0,code:m().describe('Stable machine-readable code (e.g. "google.token.refresh-failed"). Use this for filtering and remediation logic.'),summary:m(),remediation:m().nullable().optional().describe('Operator-facing next step. Null when status is "ok" or no specific remediation applies.'),details:mt(m(),ga()).optional().describe("Structured context — principal email, redirect URI, missing scopes, etc. Stable per check id."),durationMs:v().int().nonnegative().describe("How long the check took to execute.")});j({scope:pp,project:m().nullable().describe('Project name when scope is "project", null otherwise.'),generatedAt:m().describe("ISO-8601 timestamp when this doctor run started."),durationMs:v().int().nonnegative(),summary:j({total:v().int().nonnegative(),ok:v().int().nonnegative(),warn:v().int().nonnegative(),fail:v().int().nonnegative(),skipped:v().int().nonnegative()}),checks:_(AO)});const _O=j({provider:m(),citationState:Ai,cited:re(),mentioned:re(),runId:m(),runCreatedAt:m()}),CO=j({queryId:m(),query:m(),providers:_(_O),citedCount:v().int().nonnegative(),mentionedCount:v().int().nonnegative(),totalProviders:v().int().nonnegative()}),zO=j({queryId:m(),query:m(),provider:m(),citingCompetitors:_(m()),runId:m(),runCreatedAt:m()}),TO=j({providersConfigured:v().int().nonnegative(),providersCiting:v().int().nonnegative(),providersMentioning:v().int().nonnegative(),totalQueries:v().int().nonnegative(),queriesCitedAndMentioned:v().int().nonnegative(),queriesCitedOnly:v().int().nonnegative(),queriesMentionedOnly:v().int().nonnegative(),queriesInvisible:v().int().nonnegative(),latestRunId:m().nullable(),latestRunAt:m().nullable()});j({summary:TO,byQuery:_(CO),competitorGaps:_(zO),status:ae(["ready","no-data"]),reason:ae(["no-runs-yet","no-queries"]).optional()});const EO=ae(["prompt","request-param","browser-geo","ignored"]),OO=j({label:m(),city:m(),region:m(),country:m(),otherConfiguredLabels:_(m())}),DO=j({provider:m(),treatment:EO,description:m()}),RO=j({generatedAt:m(),project:j({id:m(),name:m(),displayName:m(),canonicalDomain:m(),country:m(),language:m()}),location:OO.nullable(),providerLocationHandling:_(DO),periodStart:m().nullable(),periodEnd:m().nullable()}),MO=j({citationRate:v(),citedQueryCount:v(),totalQueryCount:v(),mentionRate:v(),mentionedQueryCount:v(),trend:ae(["up","down","flat","unknown"]),queryCount:v(),competitorCount:v(),providerCount:v(),gsc:j({clicks:v(),impressions:v(),ctr:v(),avgPosition:v(),periodStart:m(),periodEnd:m()}).nullable(),ga:j({sessions:v(),users:v(),periodStart:m(),periodEnd:m()}).nullable(),findings:_(j({title:m(),detail:m(),tone:ae(["positive","caution","negative","neutral"])}))}),BO=j({citationState:ae(["cited","not-cited","pending"]),answerMentioned:re().nullable(),model:m().nullable()}),LO=j({queries:_(m()),providers:_(m()),matrix:_(_(BO.nullable())),providerRates:_(j({provider:m(),citedCount:v(),totalCount:v(),citationRate:v()}))}),qO=j({domain:m(),citationCount:v(),totalCount:v(),pressureLabel:ae(["High","Moderate","Low","None"]),citedQueries:_(m()),sharePct:v(),theirCitedPages:_(j({url:m(),citedFor:_(m())}))}),UO=j({projectCitationCount:v(),competitors:_(qO)}),$O=j({domain:m(),mentionCount:v(),totalCount:v(),pressureLabel:ae(["High","Moderate","Low","None"]),mentionedQueries:_(m()),sharePct:v()}),IO=j({projectMentionCount:v(),totalAnswerSnapshots:v(),competitors:_($O)}),VO=j({category:m(),label:m(),count:v(),sharePct:v()}),PO=j({categories:_(VO),topDomains:_(j({domain:m(),count:v(),isCompetitor:re()}))}),GO=j({query:m(),clicks:v(),impressions:v(),ctr:v(),avgPosition:v(),category:ae(["brand","lead-gen","industry","other"])}),HO=j({periodStart:m(),periodEnd:m(),totalClicks:v(),totalImpressions:v(),ctr:v(),avgPosition:v(),topQueries:_(GO),categoryBreakdown:_(j({category:ae(["brand","lead-gen","industry","other"]),clicks:v(),impressions:v(),sharePct:v()})),trend:_(j({date:m(),clicks:v(),impressions:v()})),trackedButNoGsc:_(m()),gscButNotTracked:_(m())}),QO=j({totalSessions:v(),totalUsers:v(),totalOrganicSessions:v(),periodStart:m(),periodEnd:m(),topLandingPages:_(j({page:m(),sessions:v(),users:v(),organicSessions:v()})),channelBreakdown:_(j({channel:m(),sessions:v(),sharePct:v()}))}),KO=j({totalSessions:v(),organicSessions:v(),paidSessions:v(),channels:_(j({channelGroup:m(),sessions:v(),sharePct:v()})),topCampaigns:_(j({source:m(),medium:m(),sessions:v()}))}),ZO=j({totalSessions:v(),totalUsers:v(),bySource:_(j({source:m(),sessions:v(),users:v(),sharePct:v()})),trend:_(j({date:m(),sessions:v()})),topLandingPages:_(j({page:m(),sessions:v(),users:v()}))}),YO=j({windowStart:m(),windowEnd:m(),hasData:re(),verifiedCrawlerHits:j({current:v(),prior:v(),deltaPct:v().nullable()}),unverifiedCrawlerHits:j({current:v(),prior:v(),deltaPct:v().nullable()}),aiUserFetchHits:j({current:v(),prior:v(),deltaPct:v().nullable()}),referralArrivals:j({current:v(),prior:v(),deltaPct:v().nullable()}),byOperator:_(j({operator:m(),verifiedHits:v(),unverifiedHits:v(),userFetchHits:v(),referralArrivals:v(),deltaPct:v().nullable()})),topCrawledPaths:_(j({path:m(),verifiedHits:v(),distinctOperators:v()})),referralProducts:_(j({product:m(),arrivals:v(),distinctLandingPaths:v()})),dailyTrend:_(j({date:m(),verifiedCrawlerHits:v(),userFetchHits:v(),referralArrivals:v()})),topReferralLandingPaths:_(j({path:m(),arrivals:v(),distinctProducts:v()}))}),XO=j({provider:ae(["google","bing"]).nullable(),total:v(),indexed:v(),notIndexed:v(),deindexed:v(),unknown:v(),indexedPct:v()}),JO=j({runId:m(),date:m(),citationRate:v(),citedQueryCount:v(),totalQueryCount:v(),mentionRate:v(),mentionedQueryCount:v(),providerRates:_(j({provider:m(),citationRate:v()}))}),Cf=j({id:m(),type:ae(["regression","gain","opportunity"]),severity:ae(["critical","high","medium","low"]),title:m(),query:m(),provider:m(),recommendation:m().nullable(),createdAt:m(),instanceCount:v()}),FO=j({horizon:ae(["immediate","short-term","medium-term"]),title:m(),rationale:m()}),Wr=j({current:v(),prior:v(),deltaAbs:v(),direction:ae(["up","down","flat"]),window:v().optional()}),WO=j({provider:m(),current:v(),prior:v(),deltaAbs:v(),direction:ae(["up","down","flat"])}),e4=j({enoughHistory:re(),headline:m(),citationRate:Wr.nullable(),mentionRate:Wr.nullable(),citedQueryCount:Wr.nullable(),gscClicksDelta:Wr.nullable(),aiReferralsDelta:Wr.nullable(),providerMovements:_(WO),wins:_(Cf),regressions:_(Cf)});ae(["agency","client"]);const t4=ae(["agency","client","both"]),n4=ae(["immediate","short-term","medium-term"]),a4=ae(["high","medium","low"]);ae(["positive","caution","negative","neutral"]);const i4=ae(["content","competitors","provider","search-demand","indexing","location","monitoring"]),mp=j({audience:t4,priority:v(),horizon:n4,category:i4,title:m(),action:m(),why:_(m()),evidence:_(m()),successMetric:m(),confidence:a4,targetRef:m().optional()}),s4=j({headline:m(),overview:m(),actionItems:_(mp),confidenceNotes:_(m())}),r4=j({title:m(),detail:m(),severity:ae(["positive","caution","negative","neutral"]),evidence:_(m())}),o4=j({priorities:_(mp),diagnostics:_(r4)});function mL(e){return e.horizon==="immediate"?"negative":e.confidence==="high"?"caution":e.confidence==="low"?"neutral":"caution"}function hL(e){switch(e){case"critical":return"Critical";case"high":return"High";case"medium":return"Medium";case"low":return"Low"}}function gL(e){switch(e){case"immediate":return"Immediate";case"short-term":return"Short term";case"medium-term":return"Medium term"}}function yL(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 bL(e){switch(e){case"high":return"High";case"medium":return"Medium";case"low":return"Low"}}j({meta:RO,executiveSummary:MO,citationScorecard:LO,competitorLandscape:UO,mentionLandscape:IO,aiSourceOrigin:PO,gsc:HO.nullable(),ga:QO.nullable(),socialReferrals:KO.nullable(),aiReferrals:ZO.nullable(),serverActivity:YO.nullable(),indexingHealth:XO.nullable(),citationsTrend:_(JO),whatsChanged:e4,insights:_(Cf),recommendedNextSteps:_(FO),actionPlan:_(mp),clientSummary:s4,agencyDiagnostics:o4,contentOpportunities:_(L0),contentGaps:_(U0),groundingSources:_(q0)});const l4=ae(["claude","codex"]);l4.enum;const c4=ae(["claude","codex","all"]);c4.enum;const V0=j({content:v().int().nonnegative(),sitemap:v().int().nonnegative(),robots:v().int().nonnegative(),asset:v().int().nonnegative(),other:v().int().nonnegative()}),u4=ae(["content","sitemap","robots","asset","other"]),hp=ae(["cloud-run","wordpress","cloudflare","vercel","generic-log"]);hp.enum;const d4=ae(["raw-request-events","aggregate-request-metrics","request-url","status-code","user-agent","remote-ip","referer","cursor-pull"]);d4.enum;const f4=ae(["raw-request","aggregate-bucket"]),p4=f4.enum,m4=ae(["observed","provider-aggregated","inferred"]),h4=m4.enum,g4=j({type:m().nullable(),labels:mt(m(),m())}),y4=j({sourceType:hp,evidenceKind:qt(p4["raw-request"]),confidence:qt(h4.observed),eventId:m().min(1),observedAt:m().min(1),method:m().nullable(),requestUrl:m().nullable(),host:m().nullable(),path:m().min(1),queryString:m().nullable(),status:v().int().nullable(),userAgent:m().nullable(),remoteIp:m().nullable(),referer:m().nullable(),latencyMs:v().nullable(),requestSizeBytes:v().int().nullable(),responseSizeBytes:v().int().nullable(),providerResource:g4,providerLabels:mt(m(),m())});j({events:_(y4),rawEntryCount:v().int().nonnegative(),skippedEntryCount:v().int().nonnegative(),nextPageToken:m().optional(),filter:m()});const P0=ae(["connected","paused","error","archived"]),vL=P0.enum,G0=ae(["oauth","service-account"]);G0.enum;const b4=ae(["verified","claimed_unverified","unknown_ai_like"]),SL=b4.enum;j({gcpProjectId:m().min(1),serviceName:m().nullable().optional(),location:m().nullable().optional(),authMode:G0});j({baseUrl:m().url(),username:m().min(1)});const gp=ae(["production","preview"]);gp.enum;j({projectId:m().min(1),teamId:m().min(1),environment:gp});const H0=j({id:m(),projectId:m(),sourceType:hp,displayName:m(),status:P0,lastSyncedAt:m().nullable(),lastCursor:m().nullable(),lastError:m().nullable(),archivedAt:m().nullable(),config:mt(m(),ga()),createdAt:m(),updatedAt:m()});j({gcpProjectId:m().min(1),serviceName:m().min(1).optional(),location:m().min(1).optional(),displayName:m().min(1).optional(),keyJson:m().optional()});j({baseUrl:m().url(),username:m().min(1),applicationPassword:m().min(1),displayName:m().min(1).optional()});j({projectId:m().min(1),teamId:m().min(1),token:m().min(1),environment:gp.optional(),displayName:m().min(1).optional()});j({sourceId:m(),runId:m(),syncedAt:m(),pulledEvents:v().int().nonnegative(),selfTrafficExcluded:v().int().nonnegative(),crawlerHits:v().int().nonnegative(),aiUserFetchHits:v().int().nonnegative(),aiReferralHits:v().int().nonnegative(),unknownHits:v().int().nonnegative(),crawlerBucketRows:v().int().nonnegative(),aiUserFetchBucketRows:v().int().nonnegative(),aiReferralBucketRows:v().int().nonnegative(),sampleRows:v().int().nonnegative(),windowStart:m(),windowEnd:m()});j({days:v().int().positive().optional()});j({advanceToNow:qt(!0)});j({sourceId:m(),runId:m(),status:Ys,windowStart:m(),windowEnd:m(),daysRequested:v().int().positive(),daysApplied:v().int().positive()});const v4=j({crawlerHits:v().int().nonnegative(),crawlerContentHits:v().int().nonnegative(),crawlerInfraHits:v().int().nonnegative(),crawlerSegments:V0,aiUserFetchHits:v().int().nonnegative(),aiReferralHits:v().int().nonnegative(),sampleCount:v().int().nonnegative()});j({sources:_(H0)});const S4=H0.extend({totals24h:v4,latestRun:j({runId:m(),status:Ys,startedAt:m().nullable(),finishedAt:m().nullable(),error:m().nullable()}).nullable()});j({sources:_(S4)});const x4=ae(["crawler","ai-user-fetch","ai-referral"]),yp=x4.enum,w4=j({kind:qt(yp.crawler),sourceId:m(),tsHour:m(),botId:m(),operator:m(),verificationStatus:m(),pathNormalized:m(),pathClass:u4,status:v().int(),hits:v().int().nonnegative()}),j4=j({kind:qt(yp["ai-user-fetch"]),sourceId:m(),tsHour:m(),botId:m(),operator:m(),verificationStatus:m(),pathNormalized:m(),status:v().int(),hits:v().int().nonnegative()}),N4=j({kind:qt(yp["ai-referral"]),sourceId:m(),tsHour:m(),product:m(),operator:m(),sourceDomain:m(),evidenceType:m(),landingPathNormalized:m(),status:v().int(),hits:v().int().nonnegative()}),k4=p0("kind",[w4,j4,N4]);j({windowStart:m(),windowEnd:m(),totals:j({crawlerHits:v().int().nonnegative(),crawlerContentHits:v().int().nonnegative(),crawlerInfraHits:v().int().nonnegative(),crawlerSegments:V0,aiUserFetchHits:v().int().nonnegative(),aiReferralHits:v().int().nonnegative()}),events:_(k4)});j({apiKey:m().min(1)});j({connected:re(),adAccountId:m().nullable().optional(),displayName:m().nullable().optional(),currencyCode:m().nullable().optional(),timezone:m().nullable().optional(),status:m().nullable().optional(),lastSyncedAt:m().nullable().optional()});j({disconnected:re()});j({runId:m(),status:m()});const A4=j({type:m().nullable().optional(),title:m().nullable().optional(),body:m().nullable().optional(),targetUrl:m().nullable().optional()}),_4=j({id:m(),adGroupId:m(),name:m(),status:m(),reviewStatus:m().nullable().optional(),creative:A4.nullable().optional()}),C4=j({id:m(),campaignId:m(),name:m(),status:m(),billingEventType:m().nullable().optional(),maxBidMicros:v().int().nullable().optional(),contextHints:_(m()).default([]),ads:_(_4).default([])}),z4=j({id:m(),name:m(),status:m(),biddingType:m().nullable().optional(),dailySpendLimitMicros:v().int().nullable().optional(),lifetimeSpendLimitMicros:v().int().nullable().optional(),adGroups:_(C4).default([])});j({campaigns:_(z4)});const Q0=ae(["campaign","ad_group"]);Q0.enum;const T4=j({level:Q0,entityId:m(),date:m(),impressions:v().int(),clicks:v().int(),spendMicros:v().int(),ctr:v().nullable(),cpcMicros:v().int().nullable()});j({rows:_(T4),currencyCode:m().nullable().optional()});const E4=j({impressions:v().int(),clicks:v().int(),spendMicros:v().int(),ctr:v().nullable(),cpcMicros:v().int().nullable()});j({connected:re(),displayName:m().nullable().optional(),currencyCode:m().nullable().optional(),lastSyncedAt:m().nullable().optional(),campaignCount:v().int(),adGroupCount:v().int(),adCount:v().int(),window:j({from:m().nullable(),to:m().nullable()}),totals:E4});var O4=(e=>(e.Clicks="clicks",e.Impressions="impressions",e.CTR="ctr",e.Position="position",e))(O4||{});const xL={clicks:"Clicks",impressions:"Impressions",ctr:"CTR",position:"Position"},wL={clicks:"Clicks",impressions:"Impr",ctr:"CTR",position:"Pos"},jL=ap;function D4(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
53
|
|
|
54
54
|
${JSON.stringify(r.raw,null,2)}`):n.push(l)}return n.length>0?n.join(`
|
|
55
55
|
|
|
56
|
-
`):"Run failed."}function O4(e){return e.split("-").map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(" ")}function wL(e){if(!e)return"—";try{return new Date(e).toLocaleString()}catch{return e}}function jL(e){return e===null?"Unknown":e?"Pass":"Fail"}function _b(e){return e===0?"12:00 AM":e<12?`${e}:00 AM`:e===12?"12:00 PM":`${e-12}:00 PM`}function NL(e,n){return e==="twice-daily"?"twice-daily":e.startsWith("weekly@")?`${e}@${n}`:`daily@${n}`}function kL(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 AL(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 ${_b(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"},h=c[2]?parseInt(c[2]):6;return`Every ${d[c[1]]} at ${_b(h)} · ${r}`}return`${e} · ${r}`}function D4(e,n){return n&&n!==e?`${e} · ${n}`:e}function _L(){const e=Intl.DateTimeFormat().resolvedOptions().timeZone,n=new Intl.DateTimeFormat("en-US",{timeZoneName:"short"}).formatToParts().find(i=>i.type==="timeZoneName")?.value;return D4(e,n)}const Ee=(e,n,i,r)=>{const l={_id:e,baseUrl:n?.baseUrl||(n?.client??K).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]},R4=e=>Ee("getApiV1ProjectsByName",e),M4=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await jv({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:R4(e)}),Js=e=>Ee("getApiV1Projects",e),bp=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await rj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:Js(e)}),vp=e=>Ee("getApiV1Runs",e),Sp=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await xj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:vp(e)}),B4=e=>Ee("getApiV1RunsById",e),Q0=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Nv({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:B4(e)}),L4=e=>Ee("getApiV1Settings",e),q4=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await kv({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:L4(e)}),U4=e=>Ee("getApiV1ProjectsByNameGoogleConnections",e),CL=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await qj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:U4(e)}),$4=e=>Ee("getApiV1ProjectsByNameGoogleProperties",e),zL=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Ij({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:$4(e)}),I4=e=>Ee("getApiV1ProjectsByNameGoogleGscPerformance",e),TL=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Hj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:I4(e)}),V4=e=>Ee("getApiV1ProjectsByNameGoogleGscPerformanceDaily",e),EL=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Qj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:V4(e)}),P4=e=>Ee("getApiV1ProjectsByNameGoogleGscInspections",e),OL=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Zj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:P4(e)}),G4=e=>Ee("getApiV1ProjectsByNameGoogleGscDeindexed",e),DL=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Yj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:G4(e)}),H4=e=>Ee("getApiV1ProjectsByNameGoogleGscCoverage",e),RL=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Av({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:H4(e)}),Q4=e=>Ee("getApiV1ProjectsByNameGoogleGscCoverageHistory",e),ML=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Xj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:Q4(e)}),BL=e=>Ee("getApiV1ProjectsByNameGoogleGscSitemaps",e),K4=e=>Ee("getApiV1ProjectsByNameGbpLocations",e),LL=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await tN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:K4(e)}),qL=e=>({mutationFn:async i=>{const{data:r}=await nN({...e,...i,throwOnError:!0});return r}}),UL=e=>({mutationFn:async i=>{const{data:r}=await aN({...e,...i,throwOnError:!0});return r}}),Z4=e=>Ee("getApiV1ProjectsByNameGbpKeywords",e),$L=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await iN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:Z4(e)}),Y4=e=>Ee("getApiV1ProjectsByNameGbpPlaces",e),IL=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await sN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:Y4(e)}),X4=e=>Ee("getApiV1ProjectsByNameGbpSummary",e),VL=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await rN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:X4(e)}),J4=e=>Ee("getApiV1ProjectsByNameBingStatus",e),PL=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await cN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:J4(e)}),F4=e=>Ee("getApiV1ProjectsByNameBingSites",e),GL=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await uN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:F4(e)}),W4=e=>Ee("getApiV1ProjectsByNameBingCoverage",e),HL=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await _v({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:W4(e)}),eD=e=>Ee("getApiV1ProjectsByNameBingInspections",e),QL=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await fN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:eD(e)}),tD=e=>Ee("getApiV1ProjectsByNameBingPerformance",e),KL=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await gN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:tD(e)}),nD=e=>Ee("getApiV1ProjectsByNameGaStatus",e),ZL=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await vN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:nD(e)}),aD=e=>Ee("getApiV1ProjectsByNameGaTraffic",e),YL=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await xN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:aD(e)}),iD=e=>Ee("getApiV1ProjectsByNameGaAiReferralHistory",e),XL=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await wN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:iD(e)}),sD=e=>Ee("getApiV1ProjectsByNameGaSocialReferralHistory",e),JL=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await jN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:sD(e)}),rD=e=>Ee("getApiV1ProjectsByNameGaSessionHistory",e),FL=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await NN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:rD(e)}),oD=e=>Ee("getApiV1ProjectsByNameReport",e),WL=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await AN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:oD(e)}),lD=e=>Ee("getApiV1ProjectsByNameCitationsVisibility",e),e6=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await _N({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:lD(e)}),cD=e=>Ee("getApiV1ProjectsByNameTrafficSources",e),t6=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await YN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:cD(e)}),uD=e=>Ee("getApiV1ProjectsByNameTrafficStatus",e),n6=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await XN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:uD(e)}),dD=e=>Ee("getApiV1ProjectsByNameTrafficSourcesById",e),a6=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await JN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:dD(e)}),fD=e=>Ee("getApiV1ProjectsByNameTrafficEvents",e),i6=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await FN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:fD(e)}),pD=e=>Ee("getApiV1ProjectsByNameDiscoverSessions",e),s6=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await ek({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:pD(e)}),mD=e=>Ee("getApiV1ProjectsByNameDiscoverSessionsById",e),r6=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await tk({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:mD(e)}),hD=e=>Ee("getApiV1ProjectsByNameDiscoverSessionsByIdPromote",e),o6=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await nk({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:hD(e)}),gD=e=>Ee("getApiV1ProjectsByNameTechnicalAeo",e),l6=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await ik({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:gD(e)}),yD=e=>Ee("getApiV1ProjectsByNameTechnicalAeoPages",e),c6=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await sk({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:yD(e)}),bD=e=>Ee("getApiV1ProjectsByNameTechnicalAeoTrend",e),u6=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await rk({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:bD(e)}),vD=e=>Ee("getApiV1ProjectsByNameAgentProviders",e),SD=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await lk({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:vD(e)});function Cb(e){return e.state==="ok"?"positive":e.state==="checking"?"neutral":"negative"}function K0(e){switch(e){case"completed":return"positive";case"partial":return"caution";case"failed":return"negative";case"cancelled":return"caution";case"queued":case"running":return"neutral";default:return"neutral"}}function d6(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 f6(e){return e==="High"?"negative":e==="Moderate"?"caution":"neutral"}const p6={positive:"text-emerald-400",caution:"text-amber-400",negative:"text-rose-400",neutral:"text-zinc-400"};function xD(e){return e.displayName??e.name.charAt(0).toUpperCase()+e.name.slice(1)}function Is(e){const n=[e.detail,e.hint].filter(Boolean);return n.length>0?n.join(`
|
|
57
|
-
`):void 0}function wD(e,n,i){return e.map(r=>{if(r.id==="api")return{...r,tone:Cb(n.apiStatus),detail:n.apiStatus.state==="ok"?"Healthy":"Needs attention",meta:n.apiStatus.detail};if(r.id==="worker")return{...r,tone:Cb(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,h=i.providerStatuses.filter(g=>g.state==="ready").map(g=>xD(g)).join(" · ");return{...r,label:"Providers",tone:d?"positive":"caution",detail:`${l} of ${c} configured`,meta:h||"None configured"}})}function jD(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 ND(e,n,i){const r=jD(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(h=>h.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 Z0="canonry.run-tracker",zf=new Set;let zb=!1,kD=0,jc={runs:{},batches:{}};function AD(){const e=_i();for(const n of zf)n(e)}function _D(e){if(!e)return{runs:{},batches:{}};try{const n=JSON.parse(e);return{runs:n.runs??{},batches:n.batches??{}}}catch{return{runs:{},batches:{}}}}function CD(){typeof window>"u"||window.sessionStorage.setItem(Z0,JSON.stringify(jc))}function Y0(){zb||(zb=!0,!(typeof window>"u")&&(jc=_D(window.sessionStorage.getItem(Z0))))}function Nc(e){jc=e,CD(),AD()}function _i(){return Y0(),jc}function zD(e){return Y0(),zf.add(e),()=>{zf.delete(e)}}function X0(e){const n=_i();Nc({...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",trackedAt:e.trackedAt??Date.now()}}})}function lf(e){const n=_i();if(!n.runs[e])return;const{[e]:i,...r}=n.runs;Nc({...n,runs:r})}function TD(e){const n=_i(),i=`batch_${Date.now()}_${++kD}`;return Nc({...n,batches:{...n.batches,[i]:{batchId:i,runIds:e.runIds,queuedCount:e.queuedCount,skippedCount:e.skippedCount}}}),i}function ED(e){const n=_i();if(!n.batches[e])return;const{[e]:i,...r}=n.batches;Nc({...n,batches:r})}function OD(e){return e==="completed"||e==="partial"||e==="failed"||e==="cancelled"}const DD=10*6e4;function RD(e,n,i,r){return e.filter(l=>!n.has(l.runId)&&i-(l.trackedAt??0)>=r)}function MD(e,n){let i=0,r=0,l=0,c=0,d=0;for(const h of e){const g=n[h]?.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 Tb=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Eb=gv,J0=(e,n)=>i=>{var r;if(n?.variants==null)return Eb(e,i?.class,i?.className);const{variants:l,defaultVariants:c}=n,d=Object.keys(l).map(b=>{const S=i?.[b],x=c?.[b];if(S===null)return null;const N=Tb(S)||Tb(x);return l[b][N]}),h=i&&Object.entries(i).reduce((b,S)=>{let[x,N]=S;return N===void 0||(b[x]=N),b},{}),g=n==null||(r=n.compoundVariants)===null||r===void 0?void 0:r.reduce((b,S)=>{let{class:x,className:N,...A}=S;return Object.entries(A).every(T=>{let[k,E]=T;return Array.isArray(E)?E.includes({...c,...h}[k]):{...c,...h}[k]===E})?[...b,x,N]:b},[]);return Eb(e,d,g,i?.class,i?.className)},BD=(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},LD=(e,n)=>({classGroupId:e,validator:n}),F0=(e=new Map,n=null,i)=>({nextPart:e,validators:n,classGroupId:i}),fc="-",Ob=[],qD="arbitrary..",UD=e=>{const n=ID(e),{conflictingClassGroups:i,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:d=>{if(d.startsWith("[")&&d.endsWith("]"))return $D(d);const h=d.split(fc),g=h[0]===""&&h.length>1?1:0;return W0(h,g,n)},getConflictingClassGroupIds:(d,h)=>{if(h){const g=r[d],b=i[d];return g?b?BD(b,g):g:b||Ob}return i[d]||Ob}}},W0=(e,n,i)=>{if(e.length-n===0)return i.classGroupId;const l=e[n],c=i.nextPart.get(l);if(c){const b=W0(e,n+1,c);if(b)return b}const d=i.validators;if(d===null)return;const h=n===0?e.join(fc):e.slice(n).join(fc),g=d.length;for(let b=0;b<g;b++){const S=d[b];if(S.validator(h))return S.classGroupId}},$D=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?qD+r:void 0})(),ID=e=>{const{theme:n,classGroups:i}=e;return VD(i,n)},VD=(e,n)=>{const i=F0();for(const r in e){const l=e[r];xp(l,i,r,n)}return i},xp=(e,n,i,r)=>{const l=e.length;for(let c=0;c<l;c++){const d=e[c];PD(d,n,i,r)}},PD=(e,n,i,r)=>{if(typeof e=="string"){GD(e,n,i);return}if(typeof e=="function"){HD(e,n,i,r);return}QD(e,n,i,r)},GD=(e,n,i)=>{const r=e===""?n:eS(n,e);r.classGroupId=i},HD=(e,n,i,r)=>{if(KD(e)){xp(e(r),n,i,r);return}n.validators===null&&(n.validators=[]),n.validators.push(LD(i,e))},QD=(e,n,i,r)=>{const l=Object.entries(e),c=l.length;for(let d=0;d<c;d++){const[h,g]=l[d];xp(g,eS(n,h),i,r)}},eS=(e,n)=>{let i=e;const r=n.split(fc),l=r.length;for(let c=0;c<l;c++){const d=r[c];let h=i.nextPart.get(d);h||(h=F0(),i.nextPart.set(d,h)),i=h}return i},KD=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,ZD=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)}}},Tf="!",Db=":",YD=[],Rb=(e,n,i,r,l)=>({modifiers:e,hasImportantModifier:n,baseClassName:i,maybePostfixModifierPosition:r,isExternal:l}),XD=e=>{const{prefix:n,experimentalParseClassName:i}=e;let r=l=>{const c=[];let d=0,h=0,g=0,b;const S=l.length;for(let k=0;k<S;k++){const E=l[k];if(d===0&&h===0){if(E===Db){c.push(l.slice(g,k)),g=k+1;continue}if(E==="/"){b=k;continue}}E==="["?d++:E==="]"?d--:E==="("?h++:E===")"&&h--}const x=c.length===0?l:l.slice(g);let N=x,A=!1;x.endsWith(Tf)?(N=x.slice(0,-1),A=!0):x.startsWith(Tf)&&(N=x.slice(1),A=!0);const T=b&&b>g?b-g:void 0;return Rb(c,A,N,T)};if(n){const l=n+Db,c=r;r=d=>d.startsWith(l)?c(d.slice(l.length)):Rb(YD,!1,d,void 0,!0)}if(i){const l=r;r=c=>i({className:c,parseClassName:l})}return r},JD=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],h=d[0]==="[",g=n.has(d);h||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}},FD=e=>({cache:ZD(e.cacheSize),parseClassName:XD(e),sortModifiers:JD(e),...UD(e)}),WD=/\s+/,e3=(e,n)=>{const{parseClassName:i,getClassGroupId:r,getConflictingClassGroupIds:l,sortModifiers:c}=n,d=[],h=e.trim().split(WD);let g="";for(let b=h.length-1;b>=0;b-=1){const S=h[b],{isExternal:x,modifiers:N,hasImportantModifier:A,baseClassName:T,maybePostfixModifierPosition:k}=i(S);if(x){g=S+(g.length>0?" "+g:g);continue}let E=!!k,R=r(E?T.substring(0,k):T);if(!R){if(!E){g=S+(g.length>0?" "+g:g);continue}if(R=r(T),!R){g=S+(g.length>0?" "+g:g);continue}E=!1}const V=N.length===0?"":N.length===1?N[0]:c(N).join(":"),G=A?V+Tf:V,Z=G+R;if(d.indexOf(Z)>-1)continue;d.push(Z);const X=l(R,E);for(let J=0;J<X.length;++J){const O=X[J];d.push(G+O)}g=S+(g.length>0?" "+g:g)}return g},t3=(...e)=>{let n=0,i,r,l="";for(;n<e.length;)(i=e[n++])&&(r=tS(i))&&(l&&(l+=" "),l+=r);return l},tS=e=>{if(typeof e=="string")return e;let n,i="";for(let r=0;r<e.length;r++)e[r]&&(n=tS(e[r]))&&(i&&(i+=" "),i+=n);return i},n3=(e,...n)=>{let i,r,l,c;const d=g=>{const b=n.reduce((S,x)=>x(S),e());return i=FD(b),r=i.cache.get,l=i.cache.set,c=h,h(g)},h=g=>{const b=r(g);if(b)return b;const S=e3(g,i);return l(g,S),S};return c=d,(...g)=>c(t3(...g))},a3=[],_t=e=>{const n=i=>i[e]||a3;return n.isThemeGetter=!0,n},nS=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,aS=/^\((?:(\w[\w-]*):)?(.+)\)$/i,i3=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,s3=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,r3=/\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$/,o3=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,l3=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,c3=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ga=e=>i3.test(e),De=e=>!!e&&!Number.isNaN(Number(e)),Ha=e=>!!e&&Number.isInteger(Number(e)),cf=e=>e.endsWith("%")&&De(e.slice(0,-1)),pa=e=>s3.test(e),iS=()=>!0,u3=e=>r3.test(e)&&!o3.test(e),wp=()=>!1,d3=e=>l3.test(e),f3=e=>c3.test(e),p3=e=>!he(e)&&!ge(e),m3=e=>ei(e,oS,wp),he=e=>nS.test(e),xi=e=>ei(e,lS,u3),Mb=e=>ei(e,w3,De),h3=e=>ei(e,uS,iS),g3=e=>ei(e,cS,wp),Bb=e=>ei(e,sS,wp),y3=e=>ei(e,rS,f3),Pl=e=>ei(e,dS,d3),ge=e=>aS.test(e),eo=e=>Ei(e,lS),b3=e=>Ei(e,cS),Lb=e=>Ei(e,sS),v3=e=>Ei(e,oS),S3=e=>Ei(e,rS),Gl=e=>Ei(e,dS,!0),x3=e=>Ei(e,uS,!0),ei=(e,n,i)=>{const r=nS.exec(e);return r?r[1]?n(r[1]):i(r[2]):!1},Ei=(e,n,i=!1)=>{const r=aS.exec(e);return r?r[1]?n(r[1]):i:!1},sS=e=>e==="position"||e==="percentage",rS=e=>e==="image"||e==="url",oS=e=>e==="length"||e==="size"||e==="bg-size",lS=e=>e==="length",w3=e=>e==="number",cS=e=>e==="family-name",uS=e=>e==="number"||e==="weight",dS=e=>e==="shadow",j3=()=>{const e=_t("color"),n=_t("font"),i=_t("text"),r=_t("font-weight"),l=_t("tracking"),c=_t("leading"),d=_t("breakpoint"),h=_t("container"),g=_t("spacing"),b=_t("radius"),S=_t("shadow"),x=_t("inset-shadow"),N=_t("text-shadow"),A=_t("drop-shadow"),T=_t("blur"),k=_t("perspective"),E=_t("aspect"),R=_t("ease"),V=_t("animate"),G=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Z=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],X=()=>[...Z(),ge,he],J=()=>["auto","hidden","clip","visible","scroll"],O=()=>["auto","contain","none"],M=()=>[ge,he,g],le=()=>[Ga,"full","auto",...M()],Ae=()=>[Ha,"none","subgrid",ge,he],Ce=()=>["auto",{span:["full",Ha,ge,he]},Ha,ge,he],ve=()=>[Ha,"auto",ge,he],tt=()=>["auto","min","max","fr",ge,he],oe=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],me=()=>["start","end","center","stretch","center-safe","end-safe"],$=()=>["auto",...M()],W=()=>[Ga,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...M()],fe=()=>[Ga,"screen","full","dvw","lvw","svw","min","max","fit",...M()],je=()=>[Ga,"screen","full","lh","dvh","lvh","svh","min","max","fit",...M()],se=()=>[e,ge,he],Ze=()=>[...Z(),Lb,Bb,{position:[ge,he]}],F=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ue=()=>["auto","cover","contain",v3,m3,{size:[ge,he]}],ee=()=>[cf,eo,xi],de=()=>["","none","full",b,ge,he],ne=()=>["",De,eo,xi],Ne=()=>["solid","dashed","dotted","double"],nt=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],xe=()=>[De,cf,Lb,Bb],$e=()=>["","none",T,ge,he],He=()=>["none",De,ge,he],Et=()=>["none",De,ge,he],zn=()=>[De,ge,he],Ot=()=>[Ga,"full",...M()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[pa],breakpoint:[pa],color:[iS],container:[pa],"drop-shadow":[pa],ease:["in","out","in-out"],font:[p3],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[pa],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[pa],shadow:[pa],spacing:["px",De],text:[pa],"text-shadow":[pa],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ga,he,ge,E]}],container:["container"],columns:[{columns:[De,he,ge,h]}],"break-after":[{"break-after":G()}],"break-before":[{"break-before":G()}],"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:O()}],"overscroll-x":[{"overscroll-x":O()}],"overscroll-y":[{"overscroll-y":O()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:le()}],"inset-x":[{"inset-x":le()}],"inset-y":[{"inset-y":le()}],start:[{"inset-s":le(),start:le()}],end:[{"inset-e":le(),end:le()}],"inset-bs":[{"inset-bs":le()}],"inset-be":[{"inset-be":le()}],top:[{top:le()}],right:[{right:le()}],bottom:[{bottom:le()}],left:[{left:le()}],visibility:["visible","invisible","collapse"],z:[{z:[Ha,"auto",ge,he]}],basis:[{basis:[Ga,"full","auto",h,...M()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[De,Ga,"auto","initial","none",he]}],grow:[{grow:["",De,ge,he]}],shrink:[{shrink:["",De,ge,he]}],order:[{order:[Ha,"first","last","none",ge,he]}],"grid-cols":[{"grid-cols":Ae()}],"col-start-end":[{col:Ce()}],"col-start":[{"col-start":ve()}],"col-end":[{"col-end":ve()}],"grid-rows":[{"grid-rows":Ae()}],"row-start-end":[{row:Ce()}],"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":tt()}],"auto-rows":[{"auto-rows":tt()}],gap:[{gap:M()}],"gap-x":[{"gap-x":M()}],"gap-y":[{"gap-y":M()}],"justify-content":[{justify:[...oe(),"normal"]}],"justify-items":[{"justify-items":[...me(),"normal"]}],"justify-self":[{"justify-self":["auto",...me()]}],"align-content":[{content:["normal",...oe()]}],"align-items":[{items:[...me(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...me(),{baseline:["","last"]}]}],"place-content":[{"place-content":oe()}],"place-items":[{"place-items":[...me(),"baseline"]}],"place-self":[{"place-self":["auto",...me()]}],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:W()}],"inline-size":[{inline:["auto",...fe()]}],"min-inline-size":[{"min-inline":["auto",...fe()]}],"max-inline-size":[{"max-inline":["none",...fe()]}],"block-size":[{block:["auto",...je()]}],"min-block-size":[{"min-block":["auto",...je()]}],"max-block-size":[{"max-block":["none",...je()]}],w:[{w:[h,"screen",...W()]}],"min-w":[{"min-w":[h,"screen","none",...W()]}],"max-w":[{"max-w":[h,"screen","none","prose",{screen:[d]},...W()]}],h:[{h:["screen","lh",...W()]}],"min-h":[{"min-h":["screen","lh","none",...W()]}],"max-h":[{"max-h":["screen","lh",...W()]}],"font-size":[{text:["base",i,eo,xi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,x3,h3]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",cf,he]}],"font-family":[{font:[b3,g3,n]}],"font-features":[{"font-features":[he]}],"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,ge,he]}],"line-clamp":[{"line-clamp":[De,"none",ge,Mb]}],leading:[{leading:[c,...M()]}],"list-image":[{"list-image":["none",ge,he]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ge,he]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:se()}],"text-color":[{text:se()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ne(),"wavy"]}],"text-decoration-thickness":[{decoration:[De,"from-font","auto",ge,xi]}],"text-decoration-color":[{decoration:se()}],"underline-offset":[{"underline-offset":[De,"auto",ge,he]}],"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",ge,he]}],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",ge,he]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Ze()}],"bg-repeat":[{bg:F()}],"bg-size":[{bg:ue()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ha,ge,he],radial:["",ge,he],conic:[Ha,ge,he]},S3,y3]}],"bg-color":[{bg:se()}],"gradient-from-pos":[{from:ee()}],"gradient-via-pos":[{via:ee()}],"gradient-to-pos":[{to:ee()}],"gradient-from":[{from:se()}],"gradient-via":[{via:se()}],"gradient-to":[{to:se()}],rounded:[{rounded:de()}],"rounded-s":[{"rounded-s":de()}],"rounded-e":[{"rounded-e":de()}],"rounded-t":[{"rounded-t":de()}],"rounded-r":[{"rounded-r":de()}],"rounded-b":[{"rounded-b":de()}],"rounded-l":[{"rounded-l":de()}],"rounded-ss":[{"rounded-ss":de()}],"rounded-se":[{"rounded-se":de()}],"rounded-ee":[{"rounded-ee":de()}],"rounded-es":[{"rounded-es":de()}],"rounded-tl":[{"rounded-tl":de()}],"rounded-tr":[{"rounded-tr":de()}],"rounded-br":[{"rounded-br":de()}],"rounded-bl":[{"rounded-bl":de()}],"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:[...Ne(),"hidden","none"]}],"divide-style":[{divide:[...Ne(),"hidden","none"]}],"border-color":[{border:se()}],"border-color-x":[{"border-x":se()}],"border-color-y":[{"border-y":se()}],"border-color-s":[{"border-s":se()}],"border-color-e":[{"border-e":se()}],"border-color-bs":[{"border-bs":se()}],"border-color-be":[{"border-be":se()}],"border-color-t":[{"border-t":se()}],"border-color-r":[{"border-r":se()}],"border-color-b":[{"border-b":se()}],"border-color-l":[{"border-l":se()}],"divide-color":[{divide:se()}],"outline-style":[{outline:[...Ne(),"none","hidden"]}],"outline-offset":[{"outline-offset":[De,ge,he]}],"outline-w":[{outline:["",De,eo,xi]}],"outline-color":[{outline:se()}],shadow:[{shadow:["","none",S,Gl,Pl]}],"shadow-color":[{shadow:se()}],"inset-shadow":[{"inset-shadow":["none",x,Gl,Pl]}],"inset-shadow-color":[{"inset-shadow":se()}],"ring-w":[{ring:ne()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:se()}],"ring-offset-w":[{"ring-offset":[De,xi]}],"ring-offset-color":[{"ring-offset":se()}],"inset-ring-w":[{"inset-ring":ne()}],"inset-ring-color":[{"inset-ring":se()}],"text-shadow":[{"text-shadow":["none",N,Gl,Pl]}],"text-shadow-color":[{"text-shadow":se()}],opacity:[{opacity:[De,ge,he]}],"mix-blend":[{"mix-blend":[...nt(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":nt()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[De]}],"mask-image-linear-from-pos":[{"mask-linear-from":xe()}],"mask-image-linear-to-pos":[{"mask-linear-to":xe()}],"mask-image-linear-from-color":[{"mask-linear-from":se()}],"mask-image-linear-to-color":[{"mask-linear-to":se()}],"mask-image-t-from-pos":[{"mask-t-from":xe()}],"mask-image-t-to-pos":[{"mask-t-to":xe()}],"mask-image-t-from-color":[{"mask-t-from":se()}],"mask-image-t-to-color":[{"mask-t-to":se()}],"mask-image-r-from-pos":[{"mask-r-from":xe()}],"mask-image-r-to-pos":[{"mask-r-to":xe()}],"mask-image-r-from-color":[{"mask-r-from":se()}],"mask-image-r-to-color":[{"mask-r-to":se()}],"mask-image-b-from-pos":[{"mask-b-from":xe()}],"mask-image-b-to-pos":[{"mask-b-to":xe()}],"mask-image-b-from-color":[{"mask-b-from":se()}],"mask-image-b-to-color":[{"mask-b-to":se()}],"mask-image-l-from-pos":[{"mask-l-from":xe()}],"mask-image-l-to-pos":[{"mask-l-to":xe()}],"mask-image-l-from-color":[{"mask-l-from":se()}],"mask-image-l-to-color":[{"mask-l-to":se()}],"mask-image-x-from-pos":[{"mask-x-from":xe()}],"mask-image-x-to-pos":[{"mask-x-to":xe()}],"mask-image-x-from-color":[{"mask-x-from":se()}],"mask-image-x-to-color":[{"mask-x-to":se()}],"mask-image-y-from-pos":[{"mask-y-from":xe()}],"mask-image-y-to-pos":[{"mask-y-to":xe()}],"mask-image-y-from-color":[{"mask-y-from":se()}],"mask-image-y-to-color":[{"mask-y-to":se()}],"mask-image-radial":[{"mask-radial":[ge,he]}],"mask-image-radial-from-pos":[{"mask-radial-from":xe()}],"mask-image-radial-to-pos":[{"mask-radial-to":xe()}],"mask-image-radial-from-color":[{"mask-radial-from":se()}],"mask-image-radial-to-color":[{"mask-radial-to":se()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":Z()}],"mask-image-conic-pos":[{"mask-conic":[De]}],"mask-image-conic-from-pos":[{"mask-conic-from":xe()}],"mask-image-conic-to-pos":[{"mask-conic-to":xe()}],"mask-image-conic-from-color":[{"mask-conic-from":se()}],"mask-image-conic-to-color":[{"mask-conic-to":se()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Ze()}],"mask-repeat":[{mask:F()}],"mask-size":[{mask:ue()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ge,he]}],filter:[{filter:["","none",ge,he]}],blur:[{blur:$e()}],brightness:[{brightness:[De,ge,he]}],contrast:[{contrast:[De,ge,he]}],"drop-shadow":[{"drop-shadow":["","none",A,Gl,Pl]}],"drop-shadow-color":[{"drop-shadow":se()}],grayscale:[{grayscale:["",De,ge,he]}],"hue-rotate":[{"hue-rotate":[De,ge,he]}],invert:[{invert:["",De,ge,he]}],saturate:[{saturate:[De,ge,he]}],sepia:[{sepia:["",De,ge,he]}],"backdrop-filter":[{"backdrop-filter":["","none",ge,he]}],"backdrop-blur":[{"backdrop-blur":$e()}],"backdrop-brightness":[{"backdrop-brightness":[De,ge,he]}],"backdrop-contrast":[{"backdrop-contrast":[De,ge,he]}],"backdrop-grayscale":[{"backdrop-grayscale":["",De,ge,he]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[De,ge,he]}],"backdrop-invert":[{"backdrop-invert":["",De,ge,he]}],"backdrop-opacity":[{"backdrop-opacity":[De,ge,he]}],"backdrop-saturate":[{"backdrop-saturate":[De,ge,he]}],"backdrop-sepia":[{"backdrop-sepia":["",De,ge,he]}],"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",ge,he]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[De,"initial",ge,he]}],ease:[{ease:["linear","initial",R,ge,he]}],delay:[{delay:[De,ge,he]}],animate:[{animate:["none",V,ge,he]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[k,ge,he]}],"perspective-origin":[{"perspective-origin":X()}],rotate:[{rotate:He()}],"rotate-x":[{"rotate-x":He()}],"rotate-y":[{"rotate-y":He()}],"rotate-z":[{"rotate-z":He()}],scale:[{scale:Et()}],"scale-x":[{"scale-x":Et()}],"scale-y":[{"scale-y":Et()}],"scale-z":[{"scale-z":Et()}],"scale-3d":["scale-3d"],skew:[{skew:zn()}],"skew-x":[{"skew-x":zn()}],"skew-y":[{"skew-y":zn()}],transform:[{transform:[ge,he,"","none","gpu","cpu"]}],"transform-origin":[{origin:X()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ot()}],"translate-x":[{"translate-x":Ot()}],"translate-y":[{"translate-y":Ot()}],"translate-z":[{"translate-z":Ot()}],"translate-none":["translate-none"],accent:[{accent:se()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:se()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ge,he]}],"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",ge,he]}],fill:[{fill:["none",...se()]}],"stroke-w":[{stroke:[De,eo,xi,Mb]}],stroke:[{stroke:["none",...se()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},N3=n3(j3);function Cn(...e){return N3(gv(e))}const k3=J0("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-10 px-4 md:h-9",sm:"h-9 px-3 text-xs md:h-8",icon:"size-10 md:size-9"}},defaultVariants:{variant:"default",size:"default"}}),Ue=q.forwardRef(({className:e,variant:n,size:i,asChild:r=!1,...l},c)=>{const d=r?Rw:"button";return f.jsx(d,{ref:c,className:Cn(k3({variant:n,size:i,className:e})),...l})});Ue.displayName="Button";const A3=J0("inline-flex items-center rounded-md border px-2 py-0.5 text-[11px] font-medium tracking-wide",{variants:{variant:{neutral:"border-zinc-800 bg-zinc-950 text-zinc-300",success:"border-emerald-500/25 bg-emerald-500/10 text-emerald-300",warning:"border-amber-500/25 bg-amber-500/10 text-amber-300",destructive:"border-rose-500/25 bg-rose-500/10 text-rose-300"}},defaultVariants:{variant:"neutral"}});function fS({className:e,variant:n,...i}){return f.jsx("div",{className:Cn(A3({variant:n}),e),...i})}const _3=220;function qb({compact:e=!1,version:n,updateAvailable:i,onDismissUpdate:r}){const l=!e&&n&&n!=="unknown",[c,d]=q.useState(!1),h=!e&&i&&r,g=()=>{d(!0),window.setTimeout(()=>{r?.(),d(!1)},_3)};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"}),h?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(aA,{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(Qs,{className:"size-3","aria-hidden":"true"})})]}):l?f.jsxs("span",{className:"brand-version",children:["v",n]}):null]})]})}function C3({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 Ln({tone:e,children:n,...i}){const r=e==="positive"?"success":e==="caution"?"warning":e==="negative"?"destructive":"neutral";return f.jsx(fS,{variant:r,...i,children:n})}function jp({status:e}){return f.jsx(Ln,{tone:K0(e),children:O4(e)})}const z3=hv,T3=fv,pS=q.forwardRef(({className:e,...n},i)=>f.jsx(If,{ref:i,className:Cn("fixed inset-0 z-50 bg-black/70 backdrop-blur-sm",e),...n}));pS.displayName=If.displayName;const E3=400,O3=1200,D3=720,mS=q.forwardRef(({className:e,children:n,...i},r)=>{const[l,c]=q.useState(D3),d=q.useRef(!1),h=q.useRef(0),g=q.useRef(0),b=q.useCallback(N=>{d.current=!0,h.current=N.clientX,g.current=l,N.target.setPointerCapture(N.pointerId),N.preventDefault()},[l]),S=q.useCallback(N=>{if(!d.current)return;const A=h.current-N.clientX,T=Math.min(O3,Math.max(E3,g.current+A));c(T)},[]),x=q.useCallback(()=>{d.current=!1},[]);return f.jsxs(T3,{children:[f.jsx(pS,{}),f.jsxs(Vf,{ref:r,className:Cn("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:S,onPointerUp:x}),n,f.jsxs(pv,{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(Qs,{className:"size-4"}),f.jsx("span",{className:"sr-only",children:"Close"})]})]})]})});mS.displayName=Vf.displayName;const R3=({className:e,...n})=>f.jsx("div",{className:Cn("flex flex-col gap-1.5 pr-10",e),...n}),hS=q.forwardRef(({className:e,...n},i)=>f.jsx(Pf,{ref:i,className:Cn("text-lg font-medium text-zinc-50",e),...n}));hS.displayName=Pf.displayName;const gS=q.forwardRef(({className:e,...n},i)=>f.jsx(mv,{ref:i,className:Cn("text-sm text-zinc-500",e),...n}));gS.displayName=mv.displayName;function M3({title:e,subtitle:n,children:i,open:r,onClose:l}){return f.jsx(z3,{open:r,onOpenChange:c=>c?void 0:l(),children:f.jsxs(mS,{children:[f.jsxs(R3,{className:"drawer-head",children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:n}),f.jsx(hS,{id:"drawer-title",children:e}),f.jsx(gS,{className:"sr-only",children:n})]}),f.jsx("div",{className:"drawer-body",children:i})]})})}function to({text:e}){const[n,i]=q.useState(null),r=q.useRef(null),l=q.useCallback(()=>{if(!r.current)return;const h=r.current.getBoundingClientRect();i({top:h.top,left:h.left+h.width/2})},[]),c=q.useCallback(()=>i(null),[]),d=q.useCallback(()=>{n===null?l():c()},[n,l,c]);return f.jsxs("span",{className:"info-tooltip-wrapper",onMouseEnter:l,onMouseLeave:c,children:[f.jsx("button",{ref:r,type:"button",className:"info-tooltip-trigger","aria-label":e,"aria-expanded":n!==null,onFocus:l,onBlur:c,onClick:d,onKeyDown:h=>{h.key==="Escape"&&c()},children:f.jsxs("svg",{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&&Aw.createPortal(f.jsx("span",{"aria-hidden":"true",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 B3=/[\s\-_]+/;function L3(e){const n=e.split(B3).filter(Boolean);return n.length===0?null:n.map(i=>i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("[\\s\\-_]*")}function Ub(e,n){const i=q3(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,S)=>b.type==="bold"?_s.createElement("strong",{key:`b-${S}`,className:"text-zinc-200 font-semibold"},b.value):b.value).filter(Boolean);const d=[...l].sort((b,S)=>S.length-b.length).map(L3).filter(b=>!!b);if(d.length===0)return r.map((b,S)=>b.type==="bold"?_s.createElement("strong",{key:`b-${S}`,className:"text-zinc-200 font-semibold"},b.value):b.value).filter(Boolean);const h=new RegExp(`(${d.join("|")})`,"gi"),g=new Map;for(const b of i)for(const S of b.terms){const x=dc(S);x&&!g.has(x)&&g.set(x,b.className)}return r.flatMap((b,S)=>b.value.split(h).map((N,A)=>{if(!N)return null;if(A%2===1){const k=g.get(dc(N))??"answer-highlight";return b.type==="bold"?_s.createElement("mark",{key:`hl-${S}-${A}`,className:k},_s.createElement("strong",{className:"text-zinc-200 font-semibold"},N)):_s.createElement("mark",{key:`hl-${S}-${A}`,className:k},N)}return b.type==="bold"?_s.createElement("strong",{key:`b-${S}-${A}`,className:"text-zinc-200 font-semibold"},N):N})).filter(Boolean)}function q3(e){return e.length===0?[]:typeof e[0]=="string"?[{terms:e,className:"answer-highlight"}]:e}function Ef(e){const n=(e??"").trim();return n&&(n.startsWith("/")||/^https?:\/\//i.test(n)||/^mailto:/i.test(n))?n:null}function uf(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 U3({evidence:e,project:n,onClose:i}){const[r,l]=q.useState(!1),[c,d]=q.useState("mentions"),[h,g]=q.useState(-1),[b,S]=q.useState(null),[x,N]=q.useState(!1),[A,T]=q.useState({}),k=LT(n.project),E=new Set(k.map(oc)),R=e.runHistory,V=R.length>1,[G,Z]=q.useState(null),X=q.useRef(!1);q.useEffect(()=>{if(X.current||e.answerSnippet&&(e.visibilityState!=null||e.answerMentioned!=null))return;const ee=R.at(-1);ee&&(X.current=!0,nc(ee.runId).then(de=>{const ne=de.snapshots?.find(Ne=>Ne.query===e.query&&Ne.provider===e.provider);ne&&Z({citationState:ne.citationState,answerMentioned:ne.answerMentioned,visibilityState:ne.visibilityState,visibilityTransition:ee.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,searchQueries:ne.searchQueries,evidenceUrls:[],changeLabel:e.visibilityChangeLabel??e.changeLabel,summary:e.summary})}).catch(()=>{}))},[e,R]);const J=h>=0&&b!==null,O=J?b:G||{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,searchQueries:e.searchQueries??[],evidenceUrls:e.evidenceUrls,changeLabel:e.visibilityChangeLabel??e.changeLabel,summary:e.summary},M=O.visibilityState==="pending"||O.citationState==="pending",le=M?!1:O.visibilityState!=null?O.visibilityState==="visible":O.answerMentioned!=null?O.answerMentioned:O.citationState===lc.cited||O.citationState==="emerging",Ae=O.answerMentioned!=null||O.visibilityState!=null||O.recommendedCompetitors.length>0,Ce=O.citedDomains.length>0||O.groundingSources.length>0||O.evidenceUrls.length>0,ve=n.project.displayName||n.project.name,tt=[...k.map(oc),ve,ve.split(" ").slice(0,2).join(" "),...O.matchedTerms].filter(ee=>ee.trim().length>2),oe=[...O.competitorDomains.flatMap(ee=>{const de=BT(ee);return de.length>=4?[de]:[]}),...O.recommendedCompetitors].filter(ee=>ee.trim().length>2),me=[{terms:tt,className:"answer-highlight-brand"},...oe.length>0?[{terms:oe,className:"answer-highlight-competitor"}]:[]],$=M?"pending":O.visibilityTransition==="lost"?"lost":le?"mentioned":"not-mentioned",W=q.useRef(0),fe=q.useCallback(async ee=>{const de=++W.current;if(ee===-1||ee===R.length-1){g(-1),S(null),l(!1);return}g(ee),l(!1);const ne=R[ee],Ne=`${ne.runId}::${e.query}::${e.provider}`;if(A[Ne]){S(A[Ne]);return}N(!0);try{const nt=await nc(ne.runId);if(de!==W.current)return;const xe=nt.snapshots?.find(He=>He.query===e.query&&He.provider===e.provider)??nt.snapshots?.find(He=>He.query===e.query),$e=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,searchQueries:xe.searchQueries,evidenceUrls:[],changeLabel:uf(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:[],searchQueries:[],evidenceUrls:[],changeLabel:uf(ne.mentionTransition??ne.visibilityTransition,ne.mentionState??ne.visibilityState),summary:"Snapshot data not available for this run."};T(He=>({...He,[Ne]:$e})),S($e)}catch{if(de!==W.current)return;S({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:[],searchQueries:[],evidenceUrls:[],changeLabel:uf(ne.mentionTransition??ne.visibilityTransition,ne.mentionState??ne.visibilityState),summary:"Failed to load historical run data."})}finally{de===W.current&&N(!1)}},[R,e.query,e.provider,A]),se=(J||e.historyScope!=="provider")&&O.model?`${O.provider} (${O.model}) · ${O.changeLabel.toLowerCase()}`:`${O.provider} · ${O.changeLabel.toLowerCase()}`,Ze=!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(" · "):"",F=le?{label:"Mentioned in answer",title:"Your brand or domain is mentioned in this answer",meta:se}:O.visibilityTransition==="lost"?{label:"Mention lost",title:"Your brand no longer appears in this answer",meta:se}: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:se},ue=()=>{if(!O.answerSnippet)return null;const ee=O.answerSnippet.split(`
|
|
58
|
-
`),de=[];let ne=[],Ne=0;const nt=()=>{if(ne.length===0)return;const xe=ne.join(" ").trim();xe&&de.push(f.jsx("p",{className:de.length>0?"mt-2.5":"",children:Ub(xe,me)},Ne++)),ne=[]};for(const xe of ee){const $e=xe.trim();if(/^[-\u2013\u2014]{3,}$/.test($e)){nt(),de.push(f.jsx("hr",{className:"border-zinc-800/60 my-3"},Ne++));continue}const He=$e.match(/^(#{1,3})\s+(\S.*)$/);if(He){nt();const Et=He[1].length,zn=He[2].replace(/^[\p{Emoji}\p{Emoji_Component}\s]+/u,"").trim()||He[2],Ot=Et===1?"text-[13px] font-semibold text-zinc-100 mt-4 mb-1":Et===2?"text-xs font-semibold text-zinc-200 mt-3 mb-0.5":"text-xs font-medium text-zinc-300 mt-2";de.push(f.jsx("p",{className:Ot,children:Ub(zn,me)},Ne++));continue}if($e===""){nt();continue}ne.push($e)}return nt(),de};return f.jsx(hv,{open:!0,onOpenChange:ee=>{ee||i()},children:f.jsxs(fv,{children:[f.jsx(If,{className:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm"}),f.jsxs(Vf,{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," ","·"," ",O.provider||"All providers"]}),f.jsx(Pf,{className:"text-lg font-semibold text-zinc-50 truncate",children:e.query})]}),f.jsxs(pv,{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(Qs,{className:"size-4"}),f.jsx("span",{className:"sr-only",children:"Close"})]})]}),V&&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((ee,de)=>{const ne=h===-1&&de===R.length-1||h===de,Ne=ee.visibilityState??(ee.answerMentioned?"visible":"not-visible"),nt=ee.visibilityTransition??Ne,xe=Ne==="visible"?"bg-emerald-400":nt==="emerging"?"bg-amber-400":nt==="lost"?"bg-rose-400":"bg-zinc-600",He=new Date(ee.createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"}),Et=!!(ee.model&&de>0&&R[de-1]?.model&&R[de-1].model!==ee.model);return f.jsxs("button",{type:"button",className:`evidence-run-dot ${ne?"evidence-run-dot--selected":""}`,onClick:()=>{fe(de===R.length-1?-1:de)},"aria-label":[`Run ${He}: ${Ne}`,ee.model?`model ${ee.model}`:null,Et?"model changed":null].filter(Boolean).join(" — "),"aria-pressed":ne,children:[f.jsx("span",{className:`size-2 rounded-full ${xe} ${Et?"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:He})]},de)})}),h>=0&&h<R.length&&f.jsxs("p",{className:"text-[11px] text-zinc-500 mt-1",children:["Viewing run from ",new Date(R[h].createdAt).toLocaleString()," ","—"," ",f.jsx("span",{className:"capitalize",children:R[h].visibilityState??(R[h].answerMentioned?"visible":"not-visible")}),f.jsxs("button",{type:"button",className:"text-zinc-400 hover:text-zinc-200 ml-2",onClick:()=>{fe(-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(ee=>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:`${ee.fromModel??"unknown"} -> ${ee.toModel??"unknown"} on ${new Date(ee.createdAt).toLocaleDateString()}`},`${ee.runId}:${ee.toModel??"unknown"}`))})]}),f.jsxs("div",{className:"evidence-modal-body",children:[x&&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","…"]}),!x&&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:F.label}),f.jsx("p",{className:`evidence-position-title evidence-position-title--${$}`,children:F.title}),f.jsx("p",{className:"evidence-position-meta",children:F.meta}),Ze&&f.jsx("p",{className:"mt-1 text-[11px] text-zinc-500",children:Ze})]}),O.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:ue()}),O.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"})]}),!O.answerSnippet&&!x&&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"}),O.searchQueries.length>0&&f.jsxs("div",{children:[f.jsxs("div",{className:"drawer-section-label flex items-center",children:[f.jsx("span",{children:"Web searches the model ran"}),f.jsx(to,{text:"The search queries this AI model issued while researching your prompt. They reveal how the model reformulated the question — the phrasings worth optimizing your content for. Distinct from grounding sources (what it found) and citations (what it linked)."})]}),f.jsx("ul",{className:"grid gap-1",children:O.searchQueries.map((ee,de)=>f.jsxs("li",{className:"flex items-start gap-2 text-sm text-zinc-300",children:[f.jsx(VA,{className:"size-3.5 mt-0.5 shrink-0 text-zinc-600","aria-hidden":"true"}),f.jsx("span",{className:"break-words",children:ee})]},`${de}-${ee}`))})]}),!J&&e.relatedTechnicalSignals.length>0&&f.jsxs("div",{children:[f.jsx("p",{className:"drawer-section-label",children:le?"Why you're visible":"What to fix"}),f.jsx("div",{className:"action-items-list",children:e.relatedTechnicalSignals.map((ee,de)=>f.jsxs("div",{className:"action-item",children:[f.jsx("svg",{className:`action-item-icon ${le?"text-emerald-400":"text-amber-400"}`,viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:le?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:ee})]},de))})]}),O.summary&&f.jsx("p",{className:"text-xs text-zinc-600 border-t border-zinc-800/40 pt-3 mt-1",children:O.summary})]}),f.jsxs("div",{className:"evidence-modal-sidebar",children:[(Ae||Ce)&&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(to,{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--${le?"mentioned":"not-mentioned"}`,children:[f.jsx("span",{className:"mention-status-icon",children:M?"…":le?"✓":"—"}),f.jsx("span",{className:"mention-status-label",children:M?"Pending":le?"Mentioned":"Not mentioned"})]}),O.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:O.matchedTerms.map(ee=>f.jsx("span",{className:"mention-chip mention-chip--brand",children:ee},ee))})]}),!M&&!le&&O.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:tt.map(ee=>f.jsx("span",{className:"mention-chip mention-chip--muted",children:ee},ee))}),f.jsx("p",{className:"text-[11px] text-zinc-600 mt-1.5",children:"None of these appear in the answer text."})]})]}),(O.recommendedCompetitors.length>0||O.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(to,{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 ee=O.competitorDomains.map(Ne=>Ne.replace(/^www\./,"")),de=new Set(ee.map(Ne=>dc(Ne.replace(/\.[^.]+$/,""))));return[...O.recommendedCompetitors.filter(Ne=>!de.has(dc(Ne))),...ee].map(Ne=>f.jsx("span",{className:"mention-chip mention-chip--competitor",children:Ne},Ne))})()})]})]}),c==="sources"&&f.jsxs(f.Fragment,{children:[O.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(to,{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:O.citedDomains.map((ee,de)=>{const ne=ee.toLowerCase().replace(/^www\./,""),Ne=E.has(ne),nt=!Ne&&O.competitorDomains.some($e=>$e.toLowerCase().replace(/^www\./,"")===ne),xe=Ne?"you":nt?"competitor":"other";return f.jsxs("div",{className:`citation-leaderboard-item citation-leaderboard-item--${xe}`,children:[f.jsxs("span",{className:"citation-leaderboard-rank",children:["#",de+1]}),f.jsx("span",{className:"citation-leaderboard-domain",children:ee}),Ne&&f.jsx("span",{className:"citation-leaderboard-tag",children:"You"}),nt&&f.jsx("span",{className:"citation-leaderboard-tag",children:"Competitor"})]},ee)})})]}),O.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 (",O.groundingSources.length,")"]}),f.jsx(to,{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:O.groundingSources.map((ee,de)=>{const ne=Ef(ee.uri),Ne=ee.title||ee.uri;return f.jsx("li",{className:"truncate text-sm",children:ne?f.jsx("a",{href:ne,target:"_blank",rel:"noopener noreferrer",className:"text-zinc-400 hover:text-zinc-200 transition-colors",children:Ne}):f.jsx("span",{className:"text-zinc-400",children:Ne})},de)})})]}),O.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:O.evidenceUrls.map(ee=>{const de=Ef(ee);return f.jsx("li",{className:"truncate text-sm",children:de?f.jsx("a",{href:de,target:"_blank",rel:"noopener noreferrer",className:"text-zinc-400 hover:text-zinc-200 transition-colors",children:ee}):f.jsx("span",{className:"text-zinc-400",children:ee})},ee)})})]}),O.citedDomains.length===0&&O.groundingSources.length===0&&O.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"]})]}),!Ae&&!Ce&&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 Bn(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 df=[{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 kc(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 $3=kc({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"}),I3=kc({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"}),V3=kc({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"}),P3=kc({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"}),G3=[{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:Bn(["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:Bn(["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:Bn(["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:Bn(["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:Bn(["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:Bn(["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:Bn(["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:Bn(["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:Bn(["not-cited","not-cited","not-cited","not-cited","not-cited","cited"])}];df[0],Math.round(1/9*100),Math.round(2/9*100),df[1],Bn(["cited","cited","cited","cited","cited"]),df[2],Math.round(2/7*100),Math.round(3/7*100),Bn(["not-cited","not-cited","not-cited","cited"]);function H3(e,n){return e.runs.find(i=>i.id===n)}function Q3(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 K3(e,n,i){if(e){const r=e.visibilityEvidence.find(l=>l.id===i);if(r)return{project:e,evidence:r}}if(n)return Q3(n,i)}const Z3={regression:"negative",gain:"positive",opportunity:"caution","first-citation":"positive","provider-pickup":"positive","persistent-gap":"caution","competitor-gained":"negative","competitor-lost":"neutral","gbp-lodging-gap":"negative","gbp-listing-discrepancy":"negative","gbp-cta-gap":"caution","gbp-metric-drop":"negative","gbp-keyword-drop":"negative"},Y3={opportunity:"write","persistent-gap":"write","competitor-gained":"write","competitor-lost":"write",regression:"investigate",gain:"monitor","first-citation":"monitor","provider-pickup":"monitor","gbp-lodging-gap":"write","gbp-listing-discrepancy":"write","gbp-cta-gap":"write","gbp-metric-drop":"investigate","gbp-keyword-drop":"investigate"},X3={regression:"lost",gain:"emerging",opportunity:"not-cited","first-citation":"emerging","provider-pickup":"emerging","persistent-gap":"not-cited","competitor-gained":"cited","competitor-lost":"not-cited","gbp-lodging-gap":"not-cited","gbp-listing-discrepancy":"not-cited","gbp-cta-gap":"not-cited","gbp-metric-drop":"lost","gbp-keyword-drop":"lost"},J3={regression:"Regression",gain:"Gain",opportunity:"Opportunity","first-citation":"First citation","provider-pickup":"Pickup","persistent-gap":"Gap","competitor-gained":"Competitor","competitor-lost":"Competitor","gbp-lodging-gap":"Lodging gap","gbp-listing-discrepancy":"Listing gap","gbp-cta-gap":"Booking CTA","gbp-metric-drop":"Metric drop","gbp-keyword-drop":"Keyword drop"};function F3(e){return{id:e.id,tone:Z3[e.type],title:e.title,detail:e.cause?.details??e.cause?.cause??"",actionLabel:e.recommendation?.action??J3[e.type],actionGroup:Y3[e.type],affectedPhrases:[{query:e.query,evidenceId:"",provider:e.provider,citationState:X3[e.type]}]}}function W3(e){return e.filter(n=>!n.dismissed).map(F3)}function yS(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 $b(e){try{return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}catch{return e}}function eR(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 bS(e){switch(e){case ke["answer-visibility"]:return"Answer visibility sweep";case ke["gsc-sync"]:return"GSC sync";case ke["inspect-sitemap"]:return"Sitemap inspection";case ke["ga-sync"]:return"GA sync";case ke["traffic-sync"]:return"Traffic sync";case ke["bing-inspect"]:return"Bing URL inspection";case ke["bing-inspect-sitemap"]:return"Bing sitemap inspection";case ke["site-audit"]:return"Site audit";case ke["backlink-extract"]:return"Backlink extract";case ke["aeo-discover-seed"]:return"Discovery (seed phase)";case ke["aeo-discover-probe"]:return"Discovery (probe phase)";case ke["gbp-sync"]:return"Business Profile sync";case ke["ads-sync"]:return"ChatGPT ads sync"}}function tR(e){return e===Bs.manual?"Manual":e===Bs.scheduled?"Scheduled":e===Bs["config-apply"]?"Config apply":e}function Np(e,n){return{id:e.id,projectId:e.projectId,projectName:n,kind:e.kind,kindLabel:bS(e.kind),status:e.status,trigger:e.trigger??"manual",location:e.location??null,createdAt:e.createdAt,startedAt:e.startedAt?$b(e.startedAt):$b(e.createdAt),duration:eR(e.startedAt??null,e.finishedAt??null),statusDetail:e.error?vS(e.error):nR(e),summary:aR(e),triggerLabel:tR(e.trigger)}}function vS(e){const n=ap(e);return n.length>200?n.slice(0,200)+"…":n}function nR(e){switch(e.status){case Ht.queued:return"Waiting for execution slot.";case Ht.running:return"Provider queries in progress.";case Ht.completed:return"All queries checked.";case Ht.partial:return"Run completed with some queries skipped.";case Ht.failed:return e.error?vS(e.error):"Run failed.";case Ht.cancelled:return"Run was cancelled.";default:return""}}function aR(e){const n=bS(e.kind);switch(e.status){case Ht.queued:return`${n} queued`;case Ht.running:return`${n} in progress`;case Ht.completed:return`${n} completed`;case Ht.partial:return`${n} partially completed`;case Ht.failed:return`${n} failed`;case Ht.cancelled:return`${n} cancelled`;default:return e.status}}function iR(e,n,i,r){const l=[];let c=0;const d=new Set;if(i.length>0){const h=i.flatMap(T=>T.snapshots??[]),g=new Map;for(const T of h)if(T.query){const k=`${T.query}::${T.provider}::${T.location??""}`;g.set(k,T)}const b=new Set(h.map(T=>T.location??null));b.size===0&&b.add(null);const S=new Set(h.map(T=>T.provider)),x=new Set(n.flatMap(T=>Object.keys(T.providerRuns??{}))),N=[...new Set([...S,...x])].sort(),A=N.length>0?N:["gemini"];for(const T of n){if(T.runs.length===0)continue;d.add(T.query);const k=T.runs.at(-1),E=k?.transition??"not-cited";for(const R of A){const V=[...b].filter(X=>g.has(`${T.query}::${R}::${X??""}`)),G=(T.providerRuns?.[R]?.length??0)>0,Z=V.length>0?V:G?[null]:[];for(const X of Z){const J=X??"",O=g.get(`${T.query}::${R}::${J}`),M=O?.model??null,le=M?`${R}:${M}`:null,Ae=T.providerRuns?.[R],Ce=le?T.modelRuns?.[le]:void 0,ve=$e=>$e?.filter(He=>(He.location??null)===X),tt=V.length>0?ve(Ae):Ae,oe=V.length>0?ve(Ce):Ce,me=(tt?.length?tt:null)??(oe?.length?oe:null),$=tt?.length?"provider":oe?.length?"model":"query",W=me?me.at(-1).transition:E,fe=me?me.at(-1).visibilityTransition??(me.at(-1).visibilityState==="visible"?"visible":"not-visible"):k?.visibilityTransition??(k?.visibilityState==="visible"?"visible":"not-visible"),je=me?.at(-1)?.citationState,se=me?.at(-1)?.visibilityState,Ze=O?W==="lost"?"lost":W==="emerging"?"emerging":O.citationState===lc.cited?"cited":"not-cited":je===lc.cited?"cited":"not-cited",F=O?.visibilityState??(se==="visible"?"visible":se==="pending"?"pending":"not-visible"),ue=Ib(me||T.runs),ee=Vb(me||T.runs),de=sR(T,R),ne=(me??T.runs).map($e=>({runId:$e.runId,citationState:$e.citationState,createdAt:$e.createdAt,model:de.get($e.runId)??null,answerMentioned:$e.answerMentioned,visibilityState:$e.visibilityState,visibilityTransition:$e.visibilityTransition,mentionState:$e.mentionState,mentionTransition:$e.mentionTransition})),Ne=rR(ne),nt=$==="provider"&&Ne.length<=1?"model":$,xe=oR(ne);l.push({id:`evidence_${e}_${c++}`,query:T.query,provider:O?.provider??R,model:O?.model??null,location:O?.location??X,citationState:Ze,answerMentioned:O?.answerMentioned,visibilityState:F,visibilityChangeLabel:Pb(fe,ee,{positive:"visible",negative:"not visible",first:"first visibility"}),changeLabel:Pb(W,ue),answerSnippet:O?.answerText??"",citedDomains:O?.citedDomains??[],evidenceUrls:[],competitorDomains:O?.competitorOverlap??[],recommendedCompetitors:O?.recommendedCompetitors??[],matchedTerms:O?.matchedTerms??[],relatedTechnicalSignals:[],groundingSources:O?.groundingSources??[],searchQueries:O?.searchQueries??[],summary:lR(F,fe,T.query),runHistory:ne,historyScope:nt,modelsSeen:Ne,modelTransitions:xe})}}}}for(const h of r)d.has(h.query)||l.push({id:`evidence_${e}_${c++}`,query:h.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:[],searchQueries:[],summary:`"${h.query}" has been added but no visibility run has been triggered yet.`,runHistory:[],historyScope:"query",modelsSeen:[],modelTransitions:[]});return l}function sR(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),h=d==="unknown"?null:d;for(const g of c)i.set(g.runId,h)}return i}function rR(e){const n=new Set;for(const i of e)i.model&&n.add(i.model);return[...n]}function oR(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 Ib(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 Vb(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 Pb(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?`${no(r.positive)} in latest run`:`${no(r.positive)} for ${n} runs`;case"lost":return"Lost since last run";case"emerging":return no(r.first);case"not-cited":case"not-visible":return n<=1?`${no(r.negative)} in latest run`:`${no(r.negative)} across ${n} runs`;default:return e}}function no(e){return e.charAt(0).toUpperCase()+e.slice(1)}function lR(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 SS(e){const n=yS(e.project),i=iR(n.name,e.timeline,e.latestRunDetails,e.queries),l=[...e.runs].sort((c,d)=>d.createdAt.localeCompare(c.createdAt)).map(c=>Np(c,e.project.displayName||e.project.name));return e.overview?cR(n,e.overview,i,l):uR(n,i,l)}function cR(e,n,i,r){const l=W3(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,citationMovement:n.citationMovement,mentionMovement:n.mentionMovement,movementComparison:n.movementComparison,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 uR(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"},citationMovement:{gained:0,lost:0,tone:"neutral",hasPreviousRun:!1},mentionMovement:{gained:0,lost:0,tone:"neutral",hasPreviousRun:!1},movementComparison:{hasPreviousRun:!1,comparable:!1,querySetChanged:!1,previousRunAt:null,currentQueryCount:0,previousQueryCount:0,comparableQueryCount:0,addedQueryCount:0,removedQueryCount:0,addedQueries:[],removedQueries:[]},insights:[],visibilityEvidence:n,competitors:[],recentRuns:i.slice(0,5),suggestedQueries:{rows:[],totalCandidates:0,skippedAlreadyTracked:0}}}function dR(e){const n=yS(e.project),i=[...e.runs].sort((N,A)=>A.createdAt.localeCompare(N.createdAt)),r=i.find(N=>N.kind===ke["answer-visibility"])??i[0],l=e.project.displayName||e.project.name,c=r?Np(r,l):fR(e.project.id,l),d=e.overview;if(!d)return{project:n,mentionScore:0,mentionDelta:"No data",mentionTone:"neutral",lastRun:c,insight:"No runs completed yet.",trend:[],competitorPressureLabel:"None"};const h=d.scores.mention,g=h.progress??0,b=d.queryCounts.mentionedQueries,S=d.queryCounts.totalQueries,x=d.providers.length;return{project:n,mentionScore:g,mentionDelta:S>0?`${b} of ${S} queries`:"No data",mentionTone:h.tone,providerCoverage:h.providerCoverage,lastRun:c,insight:S>0?`${b} of ${S} queries mentioned across ${x} provider${x===1?"":"s"}.`:"No runs completed yet.",trend:h.trend??[],competitorPressureLabel:d.scores.competitorPressure.value}}function fR(e,n){return{id:"none",projectId:e,projectName:n,kind:ke["answer-visibility"],kindLabel:"No runs yet",status:Ht.queued,trigger:Bs.manual,createdAt:"",startedAt:"",duration:"",statusDetail:"",summary:"No runs yet",triggerLabel:""}}function pR(e,n){const i=[],r=[],l=[];for(const d of e){r.push(SS(d)),l.push(dR(d));const h=[...d.runs].sort((g,b)=>b.createdAt.localeCompare(g.createdAt));for(const g of h)i.push(Np(g,d.project.displayName||d.project.name))}i.sort((d,h)=>h.createdAt.localeCompare(d.createdAt));const c=e.length>0;return{portfolioOverview:{projects:l,attentionItems:c?mR(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,defaultModel:d.defaultModel,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 mR(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===Ht.running||c.status===Ht.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."}),n}const xS=q.createContext(null);xS.Provider;function go(){return q.useContext(xS)}function Ac(e){const i=go()?.dashboard??null,r=dn({...bp({client:ae}),enabled:!i,refetchInterval:Qk}),l=dn({...Sp({client:ae,query:{kind:"answer-visibility"}}),enabled:!i,staleTime:lo,refetchInterval:T=>T.state.data?.some(R=>R.status==="running"||R.status==="queued")?3e3:lo}),c=dn({...q4({client:ae}),enabled:!i}),d=r.data??[],h=l.data??[],g=_w({queries:d.map(T=>{const k=h.filter(V=>V.projectId===T.id),E=k.filter(V=>(V.status==="completed"||V.status==="partial")&&V.kind==="answer-visibility"&&V.trigger!=="probe").sort((V,G)=>G.createdAt.localeCompare(V.createdAt)),R=E.length>0?E[0].id:"no-run";return{queryKey:["project-overview-slim",T.id,R],queryFn:async()=>{const V=await Tv(T.name).catch(()=>null);return{project:T,runs:k,queries:[],competitors:[],timeline:[],latestRunDetails:[],previousRunDetails:[],gscCoverage:null,bingCoverage:null,dbInsights:null,overview:V}},enabled:!i&&r.isSuccess&&l.isSuccess,staleTime:wf}})}),b=g.every(T=>T.isSuccess),S=q.useMemo(()=>{if(i)return i;if(!r.data||!l.data||d.length>0&&!b)return null;const T=g.map(k=>k.data?{...k.data,runs:h.filter(E=>E.projectId===k.data.project.id)}:null).filter(k=>k!=null);return pR(T,c.data??null)},[i,r.data,l.data,c.data,b,g,d.length,h]),x=!i&&(r.isError||l.isError),N=!i&&!S&&!x,A=q.useCallback(async()=>{await Promise.all([r.refetch(),l.refetch(),c.refetch()])},[r.refetch,l.refetch,c.refetch]);return{dashboard:S,isLoading:N,isError:x,refetch:A}}function hR(e){const n=go(),i=q.useMemo(()=>!n||!e?null:n.dashboard.projects.find(T=>T.project.name===e)??null,[n,e]),r=dn({...M4({client:ae,path:{name:e??""}}),enabled:!!e&&!i,staleTime:wf,refetchOnWindowFocus:"always"}),l=dn({...Sp({client:ae,query:{kind:"answer-visibility"}}),enabled:!!e,staleTime:lo,refetchOnWindowFocus:"always",refetchInterval:T=>T.state.data?.some(R=>R.projectId===r.data?.id&&(R.status==="running"||R.status==="queued"))?3e3:lo}),c=r.data??null,d=q.useMemo(()=>c?(l.data??[]).filter(T=>T.projectId===c.id):[],[c,l.data]),{latestRunIds:h,previousRunIds:g,latestRunIdsKey:b}=q.useMemo(()=>{const T=d.filter(G=>(G.status==="completed"||G.status==="partial")&&G.kind==="answer-visibility"&&G.trigger!=="probe").sort((G,Z)=>Z.createdAt.localeCompare(G.createdAt)),k=T[0]?.createdAt??null,E=k?T.filter(G=>G.createdAt===k).map(G=>G.id):[],R=T.find(G=>G.createdAt!==k)?.createdAt??null,V=R?T.filter(G=>G.createdAt===R).map(G=>G.id):[];return{latestRunIds:E,previousRunIds:V,latestRunIdsKey:[...E].sort().join(",")}},[d]),S=dn({queryKey:["project-dashboard-full",c?.id??null,b||"none"],queryFn:async()=>{if(!c||!e)return null;const[T,k,E,R,V,G,Z,X,J]=await Promise.all([gk(e).catch(()=>[]),yk(e).catch(()=>[]),bk(e).catch(()=>[]),h.length?Promise.all(h.map(O=>nc(O).catch(()=>null))).then(O=>O.filter(M=>M!=null)):Promise.resolve([]),g.length?Promise.all(g.map(O=>nc(O).catch(()=>null))).then(O=>O.filter(M=>M!=null)):Promise.resolve([]),Ek(e).catch(()=>null),Rk(e).catch(()=>null),Bk(e).catch(()=>null),Tv(e).catch(()=>null)]);return{project:c,runs:d,queries:T,competitors:k,timeline:E,latestRunDetails:R,previousRunDetails:V,gscCoverage:G,bingCoverage:Z,dbInsights:X,overview:J}},enabled:!!c&&!!e&&l.isSuccess,staleTime:wf,refetchOnWindowFocus:"always",refetchInterval:Kk}),x=q.useMemo(()=>S.data?SS({...S.data,runs:d}):i||null,[S.data,d,i]),N=q.useCallback(async()=>{await Promise.all([r.refetch(),l.refetch(),S.refetch()])},[r.refetch,l.refetch,S.refetch]),A=!x&&(r.isLoading||l.isLoading||S.isLoading);return{commandCenter:x,project:c,isLoading:A,isError:r.isError||l.isError||S.isError,refetch:N}}const gR=["health"];async function yR(){const e=await qk("/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 kp(e,n){return dn({queryKey:gR,queryFn:yR,enabled:e,refetchInterval:15e3,initialData:n})}function bR(e){return dn({...Q0({client:ae,path:{id:e??""}}),enabled:!!e,refetchInterval:n=>{const i=n.state.data?.status;return i==="running"||i==="queued"?3e3:!1}})}function Ap(){const e=hc(),n=Cw({strict:!1}),i=zw({select:g=>g.location.pathname}),r=n.runId??null,l=n.evidenceId??null;return{runId:r,evidenceId:l,openRun:g=>{e({to:i,from:tn.to,search:b=>({...b,runId:g,evidenceId:void 0})})},openEvidence:g=>{e({to:i,from:tn.to,search:b=>({...b,evidenceId:g,runId:void 0})})},closeDrawer:()=>{e({to:i,from:tn.to,search:g=>({...g,runId:void 0,evidenceId:void 0})})}}}const vR={negative:"toast-card-negative",caution:"toast-card-caution",positive:"toast-card-positive",neutral:"toast-card-neutral"};function SR(e){if(e.cta)return`${e.cta.label}: ${e.title}`}function xR(){const e=q.useSyncExternalStore(Gk,Qy,Qy),n=hc(),{openRun:i}=Ap(),r=q.useCallback(c=>{xf(c)},[]),l=q.useCallback(c=>{c.cta&&(c.cta.intent==="open-run-drawer"?i(c.cta.runId):n({to:"/runs"}),xf(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 ${vR[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":SR(c),children:c.cta.label}):null]}),f.jsx("button",{type:"button",onClick:()=>r(c.id),className:"toast-dismiss","aria-label":"Dismiss",children:f.jsx(Qs,{className:"size-3.5"})})]},c.id))})}function wR(e,n={}){const{threshold:i=80}=n,r=q.useRef(null),l=q.useRef({scrollHeight:0,wasAtEnd:!0});function c(g){return g.scrollHeight-g.scrollTop-g.clientHeight}function d(){const g=r.current;return g?c(g)<=i:!0}function h(){const g=r.current;g&&(g.scrollTop=g.scrollHeight,l.current.wasAtEnd=!0,l.current.scrollHeight=g.scrollHeight)}return q.useEffect(()=>{const g=r.current;if(!g)return;const b=()=>{l.current.wasAtEnd=c(g)<=i};return g.addEventListener("scroll",b,{passive:!0}),()=>g.removeEventListener("scroll",b)},[i]),q.useLayoutEffect(()=>{const g=r.current;if(!g)return;const b=g.scrollHeight;b>l.current.scrollHeight&&l.current.wasAtEnd&&(g.scrollTop=b),l.current.scrollHeight=b},e),q.useEffect(()=>{const g=r.current;if(!g||typeof ResizeObserver>"u")return;const b=new ResizeObserver(()=>{const S=g.scrollHeight;S>l.current.scrollHeight&&l.current.wasAtEnd&&(g.scrollTop=S),l.current.scrollHeight=S});return b.observe(g),g.firstElementChild&&b.observe(g.firstElementChild),()=>b.disconnect()},[]),{ref:r,scrollToEnd:h,isAtEnd:d}}async function _p(e){try{return await e.json()}catch{return{}}}function jR(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,"")+"/api/v1":"/api/v1"}const Cp=jR();function zp(e){e===401&&Gf()}async function Gb(e){const n=await fetch(`${Cp}/projects/${encodeURIComponent(e)}/agent/transcript`,{credentials:"include"});if(!n.ok){zp(n.status);const i=await _p(n);throw new Gn(i.error?.message??`transcript fetch failed: ${n.status}`,n.status,i.error?.code)}return await n.json()}async function NR(e){const n=await fetch(`${Cp}/projects/${encodeURIComponent(e)}/agent/transcript`,{method:"DELETE",credentials:"include"});if(!n.ok){zp(n.status);const i=await _p(n);throw new Gn(i.error?.message??`reset failed: ${n.status}`,n.status,i.error?.code)}}async function kR({project:e,prompt:n,provider:i,modelId:r,scope:l,signal:c,onEvent:d}){const h={prompt:n};i&&(h.provider=i),r&&(h.modelId=r),l&&(h.scope=l);const g=await fetch(`${Cp}/projects/${encodeURIComponent(e)}/agent/prompt`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(h),signal:c});if(!g.ok||!g.body){zp(g.status);const A=await _p(g);throw new Gn(A.error?.message??`prompt failed: ${g.status}`,g.status,A.error?.code)}const b=g.body.getReader(),S=new TextDecoder;let x="";const N=()=>{b.cancel().catch(()=>{})};c?.addEventListener("abort",N,{once:!0});try{for(;;){const{value:A,done:T}=await b.read();if(T)break;x+=S.decode(A,{stream:!0});let k=x.indexOf(`
|
|
56
|
+
`):"Run failed."}function R4(e){return e.split("-").map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(" ")}function NL(e){if(!e)return"—";try{return new Date(e).toLocaleString()}catch{return e}}function kL(e){return e===null?"Unknown":e?"Pass":"Fail"}function _b(e){return e===0?"12:00 AM":e<12?`${e}:00 AM`:e===12?"12:00 PM":`${e-12}:00 PM`}function AL(e,n){return e==="twice-daily"?"twice-daily":e.startsWith("weekly@")?`${e}@${n}`:`daily@${n}`}function _L(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 CL(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 ${_b(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"},h=c[2]?parseInt(c[2]):6;return`Every ${d[c[1]]} at ${_b(h)} · ${r}`}return`${e} · ${r}`}function M4(e,n){return n&&n!==e?`${e} · ${n}`:e}function zL(){const e=Intl.DateTimeFormat().resolvedOptions().timeZone,n=new Intl.DateTimeFormat("en-US",{timeZoneName:"short"}).formatToParts().find(i=>i.type==="timeZoneName")?.value;return M4(e,n)}const Ee=(e,n,i,r)=>{const l={_id:e,baseUrl:n?.baseUrl||(n?.client??K).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]},B4=e=>Ee("getApiV1ProjectsByName",e),L4=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await jv({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:B4(e)}),Js=e=>Ee("getApiV1Projects",e),bp=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await oj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:Js(e)}),vp=e=>Ee("getApiV1Runs",e),Sp=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await wj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:vp(e)}),q4=e=>Ee("getApiV1RunsById",e),K0=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Nv({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:q4(e)}),U4=e=>Ee("getApiV1Settings",e),$4=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await kv({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:U4(e)}),I4=e=>Ee("getApiV1ProjectsByNameGoogleConnections",e),TL=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Uj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:I4(e)}),V4=e=>Ee("getApiV1ProjectsByNameGoogleProperties",e),EL=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Vj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:V4(e)}),P4=e=>Ee("getApiV1ProjectsByNameGoogleGscPerformance",e),OL=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Qj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:P4(e)}),G4=e=>Ee("getApiV1ProjectsByNameGoogleGscPerformanceDaily",e),DL=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Kj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:G4(e)}),H4=e=>Ee("getApiV1ProjectsByNameGoogleGscInspections",e),RL=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Yj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:H4(e)}),Q4=e=>Ee("getApiV1ProjectsByNameGoogleGscDeindexed",e),ML=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Xj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:Q4(e)}),K4=e=>Ee("getApiV1ProjectsByNameGoogleGscCoverage",e),BL=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Av({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:K4(e)}),Z4=e=>Ee("getApiV1ProjectsByNameGoogleGscCoverageHistory",e),LL=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Jj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:Z4(e)}),qL=e=>Ee("getApiV1ProjectsByNameGoogleGscSitemaps",e),Y4=e=>Ee("getApiV1ProjectsByNameGbpLocations",e),UL=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await nN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:Y4(e)}),$L=e=>({mutationFn:async i=>{const{data:r}=await aN({...e,...i,throwOnError:!0});return r}}),IL=e=>({mutationFn:async i=>{const{data:r}=await iN({...e,...i,throwOnError:!0});return r}}),X4=e=>Ee("getApiV1ProjectsByNameGbpKeywords",e),VL=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await sN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:X4(e)}),J4=e=>Ee("getApiV1ProjectsByNameGbpPlaces",e),PL=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await rN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:J4(e)}),F4=e=>Ee("getApiV1ProjectsByNameGbpSummary",e),GL=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await oN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:F4(e)}),W4=e=>Ee("getApiV1ProjectsByNameBingStatus",e),HL=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await uN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:W4(e)}),eD=e=>Ee("getApiV1ProjectsByNameBingSites",e),QL=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await dN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:eD(e)}),tD=e=>Ee("getApiV1ProjectsByNameBingCoverage",e),KL=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await _v({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:tD(e)}),nD=e=>Ee("getApiV1ProjectsByNameBingInspections",e),ZL=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await pN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:nD(e)}),aD=e=>Ee("getApiV1ProjectsByNameBingPerformance",e),YL=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await yN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:aD(e)}),iD=e=>Ee("getApiV1ProjectsByNameGaStatus",e),XL=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await SN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:iD(e)}),sD=e=>Ee("getApiV1ProjectsByNameGaTraffic",e),JL=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await wN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:sD(e)}),rD=e=>Ee("getApiV1ProjectsByNameGaAiReferralHistory",e),FL=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await jN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:rD(e)}),oD=e=>Ee("getApiV1ProjectsByNameGaSocialReferralHistory",e),WL=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await NN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:oD(e)}),lD=e=>Ee("getApiV1ProjectsByNameGaSessionHistory",e),e6=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await kN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:lD(e)}),cD=e=>Ee("getApiV1ProjectsByNameReport",e),t6=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await _N({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:cD(e)}),uD=e=>Ee("getApiV1ProjectsByNameCitationsVisibility",e),n6=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await CN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:uD(e)}),dD=e=>Ee("getApiV1ProjectsByNameTrafficSources",e),a6=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await XN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:dD(e)}),fD=e=>Ee("getApiV1ProjectsByNameTrafficStatus",e),i6=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await JN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:fD(e)}),pD=e=>Ee("getApiV1ProjectsByNameTrafficSourcesById",e),s6=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await FN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:pD(e)}),mD=e=>Ee("getApiV1ProjectsByNameTrafficEvents",e),r6=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await WN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:mD(e)}),hD=e=>Ee("getApiV1ProjectsByNameDiscoverSessions",e),o6=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await tk({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:hD(e)}),gD=e=>Ee("getApiV1ProjectsByNameDiscoverSessionsById",e),l6=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await nk({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:gD(e)}),yD=e=>Ee("getApiV1ProjectsByNameDiscoverSessionsByIdPromote",e),c6=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await ak({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:yD(e)}),bD=e=>Ee("getApiV1ProjectsByNameTechnicalAeo",e),u6=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await sk({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:bD(e)}),vD=e=>Ee("getApiV1ProjectsByNameTechnicalAeoPages",e),d6=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await rk({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:vD(e)}),SD=e=>Ee("getApiV1ProjectsByNameTechnicalAeoTrend",e),f6=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await ok({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:SD(e)}),xD=e=>Ee("getApiV1ProjectsByNameAgentProviders",e),wD=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await ck({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:xD(e)});function Cb(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 p6(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 m6(e){return e==="High"?"negative":e==="Moderate"?"caution":"neutral"}const h6={positive:"text-emerald-400",caution:"text-amber-400",negative:"text-rose-400",neutral:"text-zinc-400"};function jD(e){return e.displayName??e.name.charAt(0).toUpperCase()+e.name.slice(1)}function Is(e){const n=[e.detail,e.hint].filter(Boolean);return n.length>0?n.join(`
|
|
57
|
+
`):void 0}function ND(e,n,i){return e.map(r=>{if(r.id==="api")return{...r,tone:Cb(n.apiStatus),detail:n.apiStatus.state==="ok"?"Healthy":"Needs attention",meta:n.apiStatus.detail};if(r.id==="worker")return{...r,tone:Cb(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,h=i.providerStatuses.filter(g=>g.state==="ready").map(g=>jD(g)).join(" · ");return{...r,label:"Providers",tone:d?"positive":"caution",detail:`${l} of ${c} configured`,meta:h||"None configured"}})}function kD(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 AD(e,n,i){const r=kD(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(h=>h.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 Y0="canonry.run-tracker",zf=new Set;let zb=!1,_D=0,jc={runs:{},batches:{}};function CD(){const e=_i();for(const n of zf)n(e)}function zD(e){if(!e)return{runs:{},batches:{}};try{const n=JSON.parse(e);return{runs:n.runs??{},batches:n.batches??{}}}catch{return{runs:{},batches:{}}}}function TD(){typeof window>"u"||window.sessionStorage.setItem(Y0,JSON.stringify(jc))}function X0(){zb||(zb=!0,!(typeof window>"u")&&(jc=zD(window.sessionStorage.getItem(Y0))))}function Nc(e){jc=e,TD(),CD()}function _i(){return X0(),jc}function ED(e){return X0(),zf.add(e),()=>{zf.delete(e)}}function J0(e){const n=_i();Nc({...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",trackedAt:e.trackedAt??Date.now()}}})}function lf(e){const n=_i();if(!n.runs[e])return;const{[e]:i,...r}=n.runs;Nc({...n,runs:r})}function OD(e){const n=_i(),i=`batch_${Date.now()}_${++_D}`;return Nc({...n,batches:{...n.batches,[i]:{batchId:i,runIds:e.runIds,queuedCount:e.queuedCount,skippedCount:e.skippedCount}}}),i}function DD(e){const n=_i();if(!n.batches[e])return;const{[e]:i,...r}=n.batches;Nc({...n,batches:r})}function RD(e){return e==="completed"||e==="partial"||e==="failed"||e==="cancelled"}const MD=10*6e4;function BD(e,n,i,r){return e.filter(l=>!n.has(l.runId)&&i-(l.trackedAt??0)>=r)}function LD(e,n){let i=0,r=0,l=0,c=0,d=0;for(const h of e){const g=n[h]?.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 Tb=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Eb=gv,F0=(e,n)=>i=>{var r;if(n?.variants==null)return Eb(e,i?.class,i?.className);const{variants:l,defaultVariants:c}=n,d=Object.keys(l).map(b=>{const S=i?.[b],x=c?.[b];if(S===null)return null;const N=Tb(S)||Tb(x);return l[b][N]}),h=i&&Object.entries(i).reduce((b,S)=>{let[x,N]=S;return N===void 0||(b[x]=N),b},{}),g=n==null||(r=n.compoundVariants)===null||r===void 0?void 0:r.reduce((b,S)=>{let{class:x,className:N,...A}=S;return Object.entries(A).every(T=>{let[k,E]=T;return Array.isArray(E)?E.includes({...c,...h}[k]):{...c,...h}[k]===E})?[...b,x,N]:b},[]);return Eb(e,d,g,i?.class,i?.className)},qD=(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},UD=(e,n)=>({classGroupId:e,validator:n}),W0=(e=new Map,n=null,i)=>({nextPart:e,validators:n,classGroupId:i}),fc="-",Ob=[],$D="arbitrary..",ID=e=>{const n=PD(e),{conflictingClassGroups:i,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:d=>{if(d.startsWith("[")&&d.endsWith("]"))return VD(d);const h=d.split(fc),g=h[0]===""&&h.length>1?1:0;return eS(h,g,n)},getConflictingClassGroupIds:(d,h)=>{if(h){const g=r[d],b=i[d];return g?b?qD(b,g):g:b||Ob}return i[d]||Ob}}},eS=(e,n,i)=>{if(e.length-n===0)return i.classGroupId;const l=e[n],c=i.nextPart.get(l);if(c){const b=eS(e,n+1,c);if(b)return b}const d=i.validators;if(d===null)return;const h=n===0?e.join(fc):e.slice(n).join(fc),g=d.length;for(let b=0;b<g;b++){const S=d[b];if(S.validator(h))return S.classGroupId}},VD=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?$D+r:void 0})(),PD=e=>{const{theme:n,classGroups:i}=e;return GD(i,n)},GD=(e,n)=>{const i=W0();for(const r in e){const l=e[r];xp(l,i,r,n)}return i},xp=(e,n,i,r)=>{const l=e.length;for(let c=0;c<l;c++){const d=e[c];HD(d,n,i,r)}},HD=(e,n,i,r)=>{if(typeof e=="string"){QD(e,n,i);return}if(typeof e=="function"){KD(e,n,i,r);return}ZD(e,n,i,r)},QD=(e,n,i)=>{const r=e===""?n:tS(n,e);r.classGroupId=i},KD=(e,n,i,r)=>{if(YD(e)){xp(e(r),n,i,r);return}n.validators===null&&(n.validators=[]),n.validators.push(UD(i,e))},ZD=(e,n,i,r)=>{const l=Object.entries(e),c=l.length;for(let d=0;d<c;d++){const[h,g]=l[d];xp(g,tS(n,h),i,r)}},tS=(e,n)=>{let i=e;const r=n.split(fc),l=r.length;for(let c=0;c<l;c++){const d=r[c];let h=i.nextPart.get(d);h||(h=W0(),i.nextPart.set(d,h)),i=h}return i},YD=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,XD=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)}}},Tf="!",Db=":",JD=[],Rb=(e,n,i,r,l)=>({modifiers:e,hasImportantModifier:n,baseClassName:i,maybePostfixModifierPosition:r,isExternal:l}),FD=e=>{const{prefix:n,experimentalParseClassName:i}=e;let r=l=>{const c=[];let d=0,h=0,g=0,b;const S=l.length;for(let k=0;k<S;k++){const E=l[k];if(d===0&&h===0){if(E===Db){c.push(l.slice(g,k)),g=k+1;continue}if(E==="/"){b=k;continue}}E==="["?d++:E==="]"?d--:E==="("?h++:E===")"&&h--}const x=c.length===0?l:l.slice(g);let N=x,A=!1;x.endsWith(Tf)?(N=x.slice(0,-1),A=!0):x.startsWith(Tf)&&(N=x.slice(1),A=!0);const T=b&&b>g?b-g:void 0;return Rb(c,A,N,T)};if(n){const l=n+Db,c=r;r=d=>d.startsWith(l)?c(d.slice(l.length)):Rb(JD,!1,d,void 0,!0)}if(i){const l=r;r=c=>i({className:c,parseClassName:l})}return r},WD=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],h=d[0]==="[",g=n.has(d);h||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}},e3=e=>({cache:XD(e.cacheSize),parseClassName:FD(e),sortModifiers:WD(e),...ID(e)}),t3=/\s+/,n3=(e,n)=>{const{parseClassName:i,getClassGroupId:r,getConflictingClassGroupIds:l,sortModifiers:c}=n,d=[],h=e.trim().split(t3);let g="";for(let b=h.length-1;b>=0;b-=1){const S=h[b],{isExternal:x,modifiers:N,hasImportantModifier:A,baseClassName:T,maybePostfixModifierPosition:k}=i(S);if(x){g=S+(g.length>0?" "+g:g);continue}let E=!!k,R=r(E?T.substring(0,k):T);if(!R){if(!E){g=S+(g.length>0?" "+g:g);continue}if(R=r(T),!R){g=S+(g.length>0?" "+g:g);continue}E=!1}const V=N.length===0?"":N.length===1?N[0]:c(N).join(":"),G=A?V+Tf:V,Z=G+R;if(d.indexOf(Z)>-1)continue;d.push(Z);const X=l(R,E);for(let J=0;J<X.length;++J){const O=X[J];d.push(G+O)}g=S+(g.length>0?" "+g:g)}return g},a3=(...e)=>{let n=0,i,r,l="";for(;n<e.length;)(i=e[n++])&&(r=nS(i))&&(l&&(l+=" "),l+=r);return l},nS=e=>{if(typeof e=="string")return e;let n,i="";for(let r=0;r<e.length;r++)e[r]&&(n=nS(e[r]))&&(i&&(i+=" "),i+=n);return i},i3=(e,...n)=>{let i,r,l,c;const d=g=>{const b=n.reduce((S,x)=>x(S),e());return i=e3(b),r=i.cache.get,l=i.cache.set,c=h,h(g)},h=g=>{const b=r(g);if(b)return b;const S=n3(g,i);return l(g,S),S};return c=d,(...g)=>c(a3(...g))},s3=[],_t=e=>{const n=i=>i[e]||s3;return n.isThemeGetter=!0,n},aS=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,iS=/^\((?:(\w[\w-]*):)?(.+)\)$/i,r3=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,o3=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,l3=/\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$/,c3=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,u3=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,d3=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ga=e=>r3.test(e),De=e=>!!e&&!Number.isNaN(Number(e)),Ha=e=>!!e&&Number.isInteger(Number(e)),cf=e=>e.endsWith("%")&&De(e.slice(0,-1)),pa=e=>o3.test(e),sS=()=>!0,f3=e=>l3.test(e)&&!c3.test(e),wp=()=>!1,p3=e=>u3.test(e),m3=e=>d3.test(e),h3=e=>!he(e)&&!ge(e),g3=e=>ei(e,lS,wp),he=e=>aS.test(e),xi=e=>ei(e,cS,f3),Mb=e=>ei(e,N3,De),y3=e=>ei(e,dS,sS),b3=e=>ei(e,uS,wp),Bb=e=>ei(e,rS,wp),v3=e=>ei(e,oS,m3),Pl=e=>ei(e,fS,p3),ge=e=>iS.test(e),eo=e=>Ei(e,cS),S3=e=>Ei(e,uS),Lb=e=>Ei(e,rS),x3=e=>Ei(e,lS),w3=e=>Ei(e,oS),Gl=e=>Ei(e,fS,!0),j3=e=>Ei(e,dS,!0),ei=(e,n,i)=>{const r=aS.exec(e);return r?r[1]?n(r[1]):i(r[2]):!1},Ei=(e,n,i=!1)=>{const r=iS.exec(e);return r?r[1]?n(r[1]):i:!1},rS=e=>e==="position"||e==="percentage",oS=e=>e==="image"||e==="url",lS=e=>e==="length"||e==="size"||e==="bg-size",cS=e=>e==="length",N3=e=>e==="number",uS=e=>e==="family-name",dS=e=>e==="number"||e==="weight",fS=e=>e==="shadow",k3=()=>{const e=_t("color"),n=_t("font"),i=_t("text"),r=_t("font-weight"),l=_t("tracking"),c=_t("leading"),d=_t("breakpoint"),h=_t("container"),g=_t("spacing"),b=_t("radius"),S=_t("shadow"),x=_t("inset-shadow"),N=_t("text-shadow"),A=_t("drop-shadow"),T=_t("blur"),k=_t("perspective"),E=_t("aspect"),R=_t("ease"),V=_t("animate"),G=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Z=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],X=()=>[...Z(),ge,he],J=()=>["auto","hidden","clip","visible","scroll"],O=()=>["auto","contain","none"],M=()=>[ge,he,g],le=()=>[Ga,"full","auto",...M()],Ae=()=>[Ha,"none","subgrid",ge,he],Ce=()=>["auto",{span:["full",Ha,ge,he]},Ha,ge,he],ve=()=>[Ha,"auto",ge,he],tt=()=>["auto","min","max","fr",ge,he],oe=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],me=()=>["start","end","center","stretch","center-safe","end-safe"],$=()=>["auto",...M()],W=()=>[Ga,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...M()],fe=()=>[Ga,"screen","full","dvw","lvw","svw","min","max","fit",...M()],je=()=>[Ga,"screen","full","lh","dvh","lvh","svh","min","max","fit",...M()],se=()=>[e,ge,he],Ze=()=>[...Z(),Lb,Bb,{position:[ge,he]}],F=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ue=()=>["auto","cover","contain",x3,g3,{size:[ge,he]}],ee=()=>[cf,eo,xi],de=()=>["","none","full",b,ge,he],ne=()=>["",De,eo,xi],Ne=()=>["solid","dashed","dotted","double"],nt=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],xe=()=>[De,cf,Lb,Bb],$e=()=>["","none",T,ge,he],He=()=>["none",De,ge,he],Et=()=>["none",De,ge,he],zn=()=>[De,ge,he],Ot=()=>[Ga,"full",...M()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[pa],breakpoint:[pa],color:[sS],container:[pa],"drop-shadow":[pa],ease:["in","out","in-out"],font:[h3],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[pa],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[pa],shadow:[pa],spacing:["px",De],text:[pa],"text-shadow":[pa],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ga,he,ge,E]}],container:["container"],columns:[{columns:[De,he,ge,h]}],"break-after":[{"break-after":G()}],"break-before":[{"break-before":G()}],"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:O()}],"overscroll-x":[{"overscroll-x":O()}],"overscroll-y":[{"overscroll-y":O()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:le()}],"inset-x":[{"inset-x":le()}],"inset-y":[{"inset-y":le()}],start:[{"inset-s":le(),start:le()}],end:[{"inset-e":le(),end:le()}],"inset-bs":[{"inset-bs":le()}],"inset-be":[{"inset-be":le()}],top:[{top:le()}],right:[{right:le()}],bottom:[{bottom:le()}],left:[{left:le()}],visibility:["visible","invisible","collapse"],z:[{z:[Ha,"auto",ge,he]}],basis:[{basis:[Ga,"full","auto",h,...M()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[De,Ga,"auto","initial","none",he]}],grow:[{grow:["",De,ge,he]}],shrink:[{shrink:["",De,ge,he]}],order:[{order:[Ha,"first","last","none",ge,he]}],"grid-cols":[{"grid-cols":Ae()}],"col-start-end":[{col:Ce()}],"col-start":[{"col-start":ve()}],"col-end":[{"col-end":ve()}],"grid-rows":[{"grid-rows":Ae()}],"row-start-end":[{row:Ce()}],"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":tt()}],"auto-rows":[{"auto-rows":tt()}],gap:[{gap:M()}],"gap-x":[{"gap-x":M()}],"gap-y":[{"gap-y":M()}],"justify-content":[{justify:[...oe(),"normal"]}],"justify-items":[{"justify-items":[...me(),"normal"]}],"justify-self":[{"justify-self":["auto",...me()]}],"align-content":[{content:["normal",...oe()]}],"align-items":[{items:[...me(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...me(),{baseline:["","last"]}]}],"place-content":[{"place-content":oe()}],"place-items":[{"place-items":[...me(),"baseline"]}],"place-self":[{"place-self":["auto",...me()]}],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:W()}],"inline-size":[{inline:["auto",...fe()]}],"min-inline-size":[{"min-inline":["auto",...fe()]}],"max-inline-size":[{"max-inline":["none",...fe()]}],"block-size":[{block:["auto",...je()]}],"min-block-size":[{"min-block":["auto",...je()]}],"max-block-size":[{"max-block":["none",...je()]}],w:[{w:[h,"screen",...W()]}],"min-w":[{"min-w":[h,"screen","none",...W()]}],"max-w":[{"max-w":[h,"screen","none","prose",{screen:[d]},...W()]}],h:[{h:["screen","lh",...W()]}],"min-h":[{"min-h":["screen","lh","none",...W()]}],"max-h":[{"max-h":["screen","lh",...W()]}],"font-size":[{text:["base",i,eo,xi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,j3,y3]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",cf,he]}],"font-family":[{font:[S3,b3,n]}],"font-features":[{"font-features":[he]}],"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,ge,he]}],"line-clamp":[{"line-clamp":[De,"none",ge,Mb]}],leading:[{leading:[c,...M()]}],"list-image":[{"list-image":["none",ge,he]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ge,he]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:se()}],"text-color":[{text:se()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ne(),"wavy"]}],"text-decoration-thickness":[{decoration:[De,"from-font","auto",ge,xi]}],"text-decoration-color":[{decoration:se()}],"underline-offset":[{"underline-offset":[De,"auto",ge,he]}],"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",ge,he]}],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",ge,he]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Ze()}],"bg-repeat":[{bg:F()}],"bg-size":[{bg:ue()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ha,ge,he],radial:["",ge,he],conic:[Ha,ge,he]},w3,v3]}],"bg-color":[{bg:se()}],"gradient-from-pos":[{from:ee()}],"gradient-via-pos":[{via:ee()}],"gradient-to-pos":[{to:ee()}],"gradient-from":[{from:se()}],"gradient-via":[{via:se()}],"gradient-to":[{to:se()}],rounded:[{rounded:de()}],"rounded-s":[{"rounded-s":de()}],"rounded-e":[{"rounded-e":de()}],"rounded-t":[{"rounded-t":de()}],"rounded-r":[{"rounded-r":de()}],"rounded-b":[{"rounded-b":de()}],"rounded-l":[{"rounded-l":de()}],"rounded-ss":[{"rounded-ss":de()}],"rounded-se":[{"rounded-se":de()}],"rounded-ee":[{"rounded-ee":de()}],"rounded-es":[{"rounded-es":de()}],"rounded-tl":[{"rounded-tl":de()}],"rounded-tr":[{"rounded-tr":de()}],"rounded-br":[{"rounded-br":de()}],"rounded-bl":[{"rounded-bl":de()}],"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:[...Ne(),"hidden","none"]}],"divide-style":[{divide:[...Ne(),"hidden","none"]}],"border-color":[{border:se()}],"border-color-x":[{"border-x":se()}],"border-color-y":[{"border-y":se()}],"border-color-s":[{"border-s":se()}],"border-color-e":[{"border-e":se()}],"border-color-bs":[{"border-bs":se()}],"border-color-be":[{"border-be":se()}],"border-color-t":[{"border-t":se()}],"border-color-r":[{"border-r":se()}],"border-color-b":[{"border-b":se()}],"border-color-l":[{"border-l":se()}],"divide-color":[{divide:se()}],"outline-style":[{outline:[...Ne(),"none","hidden"]}],"outline-offset":[{"outline-offset":[De,ge,he]}],"outline-w":[{outline:["",De,eo,xi]}],"outline-color":[{outline:se()}],shadow:[{shadow:["","none",S,Gl,Pl]}],"shadow-color":[{shadow:se()}],"inset-shadow":[{"inset-shadow":["none",x,Gl,Pl]}],"inset-shadow-color":[{"inset-shadow":se()}],"ring-w":[{ring:ne()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:se()}],"ring-offset-w":[{"ring-offset":[De,xi]}],"ring-offset-color":[{"ring-offset":se()}],"inset-ring-w":[{"inset-ring":ne()}],"inset-ring-color":[{"inset-ring":se()}],"text-shadow":[{"text-shadow":["none",N,Gl,Pl]}],"text-shadow-color":[{"text-shadow":se()}],opacity:[{opacity:[De,ge,he]}],"mix-blend":[{"mix-blend":[...nt(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":nt()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[De]}],"mask-image-linear-from-pos":[{"mask-linear-from":xe()}],"mask-image-linear-to-pos":[{"mask-linear-to":xe()}],"mask-image-linear-from-color":[{"mask-linear-from":se()}],"mask-image-linear-to-color":[{"mask-linear-to":se()}],"mask-image-t-from-pos":[{"mask-t-from":xe()}],"mask-image-t-to-pos":[{"mask-t-to":xe()}],"mask-image-t-from-color":[{"mask-t-from":se()}],"mask-image-t-to-color":[{"mask-t-to":se()}],"mask-image-r-from-pos":[{"mask-r-from":xe()}],"mask-image-r-to-pos":[{"mask-r-to":xe()}],"mask-image-r-from-color":[{"mask-r-from":se()}],"mask-image-r-to-color":[{"mask-r-to":se()}],"mask-image-b-from-pos":[{"mask-b-from":xe()}],"mask-image-b-to-pos":[{"mask-b-to":xe()}],"mask-image-b-from-color":[{"mask-b-from":se()}],"mask-image-b-to-color":[{"mask-b-to":se()}],"mask-image-l-from-pos":[{"mask-l-from":xe()}],"mask-image-l-to-pos":[{"mask-l-to":xe()}],"mask-image-l-from-color":[{"mask-l-from":se()}],"mask-image-l-to-color":[{"mask-l-to":se()}],"mask-image-x-from-pos":[{"mask-x-from":xe()}],"mask-image-x-to-pos":[{"mask-x-to":xe()}],"mask-image-x-from-color":[{"mask-x-from":se()}],"mask-image-x-to-color":[{"mask-x-to":se()}],"mask-image-y-from-pos":[{"mask-y-from":xe()}],"mask-image-y-to-pos":[{"mask-y-to":xe()}],"mask-image-y-from-color":[{"mask-y-from":se()}],"mask-image-y-to-color":[{"mask-y-to":se()}],"mask-image-radial":[{"mask-radial":[ge,he]}],"mask-image-radial-from-pos":[{"mask-radial-from":xe()}],"mask-image-radial-to-pos":[{"mask-radial-to":xe()}],"mask-image-radial-from-color":[{"mask-radial-from":se()}],"mask-image-radial-to-color":[{"mask-radial-to":se()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":Z()}],"mask-image-conic-pos":[{"mask-conic":[De]}],"mask-image-conic-from-pos":[{"mask-conic-from":xe()}],"mask-image-conic-to-pos":[{"mask-conic-to":xe()}],"mask-image-conic-from-color":[{"mask-conic-from":se()}],"mask-image-conic-to-color":[{"mask-conic-to":se()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Ze()}],"mask-repeat":[{mask:F()}],"mask-size":[{mask:ue()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ge,he]}],filter:[{filter:["","none",ge,he]}],blur:[{blur:$e()}],brightness:[{brightness:[De,ge,he]}],contrast:[{contrast:[De,ge,he]}],"drop-shadow":[{"drop-shadow":["","none",A,Gl,Pl]}],"drop-shadow-color":[{"drop-shadow":se()}],grayscale:[{grayscale:["",De,ge,he]}],"hue-rotate":[{"hue-rotate":[De,ge,he]}],invert:[{invert:["",De,ge,he]}],saturate:[{saturate:[De,ge,he]}],sepia:[{sepia:["",De,ge,he]}],"backdrop-filter":[{"backdrop-filter":["","none",ge,he]}],"backdrop-blur":[{"backdrop-blur":$e()}],"backdrop-brightness":[{"backdrop-brightness":[De,ge,he]}],"backdrop-contrast":[{"backdrop-contrast":[De,ge,he]}],"backdrop-grayscale":[{"backdrop-grayscale":["",De,ge,he]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[De,ge,he]}],"backdrop-invert":[{"backdrop-invert":["",De,ge,he]}],"backdrop-opacity":[{"backdrop-opacity":[De,ge,he]}],"backdrop-saturate":[{"backdrop-saturate":[De,ge,he]}],"backdrop-sepia":[{"backdrop-sepia":["",De,ge,he]}],"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",ge,he]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[De,"initial",ge,he]}],ease:[{ease:["linear","initial",R,ge,he]}],delay:[{delay:[De,ge,he]}],animate:[{animate:["none",V,ge,he]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[k,ge,he]}],"perspective-origin":[{"perspective-origin":X()}],rotate:[{rotate:He()}],"rotate-x":[{"rotate-x":He()}],"rotate-y":[{"rotate-y":He()}],"rotate-z":[{"rotate-z":He()}],scale:[{scale:Et()}],"scale-x":[{"scale-x":Et()}],"scale-y":[{"scale-y":Et()}],"scale-z":[{"scale-z":Et()}],"scale-3d":["scale-3d"],skew:[{skew:zn()}],"skew-x":[{"skew-x":zn()}],"skew-y":[{"skew-y":zn()}],transform:[{transform:[ge,he,"","none","gpu","cpu"]}],"transform-origin":[{origin:X()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ot()}],"translate-x":[{"translate-x":Ot()}],"translate-y":[{"translate-y":Ot()}],"translate-z":[{"translate-z":Ot()}],"translate-none":["translate-none"],accent:[{accent:se()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:se()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ge,he]}],"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",ge,he]}],fill:[{fill:["none",...se()]}],"stroke-w":[{stroke:[De,eo,xi,Mb]}],stroke:[{stroke:["none",...se()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},A3=i3(k3);function Cn(...e){return A3(gv(e))}const _3=F0("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-10 px-4 md:h-9",sm:"h-9 px-3 text-xs md:h-8",icon:"size-10 md:size-9"}},defaultVariants:{variant:"default",size:"default"}}),Ue=q.forwardRef(({className:e,variant:n,size:i,asChild:r=!1,...l},c)=>{const d=r?Mw:"button";return f.jsx(d,{ref:c,className:Cn(_3({variant:n,size:i,className:e})),...l})});Ue.displayName="Button";const C3=F0("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 pS({className:e,variant:n,...i}){return f.jsx("div",{className:Cn(C3({variant:n}),e),...i})}const z3=220;function qb({compact:e=!1,version:n,updateAvailable:i,onDismissUpdate:r}){const l=!e&&n&&n!=="unknown",[c,d]=q.useState(!1),h=!e&&i&&r,g=()=>{d(!0),window.setTimeout(()=>{r?.(),d(!1)},z3)};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"}),h?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(iA,{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(Qs,{className:"size-3","aria-hidden":"true"})})]}):l?f.jsxs("span",{className:"brand-version",children:["v",n]}):null]})]})}function T3({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 Ln({tone:e,children:n,...i}){const r=e==="positive"?"success":e==="caution"?"warning":e==="negative"?"destructive":"neutral";return f.jsx(pS,{variant:r,...i,children:n})}function jp({status:e}){return f.jsx(Ln,{tone:Z0(e),children:R4(e)})}const E3=hv,O3=fv,mS=q.forwardRef(({className:e,...n},i)=>f.jsx(If,{ref:i,className:Cn("fixed inset-0 z-50 bg-black/70 backdrop-blur-sm",e),...n}));mS.displayName=If.displayName;const D3=400,R3=1200,M3=720,hS=q.forwardRef(({className:e,children:n,...i},r)=>{const[l,c]=q.useState(M3),d=q.useRef(!1),h=q.useRef(0),g=q.useRef(0),b=q.useCallback(N=>{d.current=!0,h.current=N.clientX,g.current=l,N.target.setPointerCapture(N.pointerId),N.preventDefault()},[l]),S=q.useCallback(N=>{if(!d.current)return;const A=h.current-N.clientX,T=Math.min(R3,Math.max(D3,g.current+A));c(T)},[]),x=q.useCallback(()=>{d.current=!1},[]);return f.jsxs(O3,{children:[f.jsx(mS,{}),f.jsxs(Vf,{ref:r,className:Cn("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:S,onPointerUp:x}),n,f.jsxs(pv,{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(Qs,{className:"size-4"}),f.jsx("span",{className:"sr-only",children:"Close"})]})]})]})});hS.displayName=Vf.displayName;const B3=({className:e,...n})=>f.jsx("div",{className:Cn("flex flex-col gap-1.5 pr-10",e),...n}),gS=q.forwardRef(({className:e,...n},i)=>f.jsx(Pf,{ref:i,className:Cn("text-lg font-medium text-zinc-50",e),...n}));gS.displayName=Pf.displayName;const yS=q.forwardRef(({className:e,...n},i)=>f.jsx(mv,{ref:i,className:Cn("text-sm text-zinc-500",e),...n}));yS.displayName=mv.displayName;function L3({title:e,subtitle:n,children:i,open:r,onClose:l}){return f.jsx(E3,{open:r,onOpenChange:c=>c?void 0:l(),children:f.jsxs(hS,{children:[f.jsxs(B3,{className:"drawer-head",children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:n}),f.jsx(gS,{id:"drawer-title",children:e}),f.jsx(yS,{className:"sr-only",children:n})]}),f.jsx("div",{className:"drawer-body",children:i})]})})}function to({text:e}){const[n,i]=q.useState(null),r=q.useRef(null),l=q.useCallback(()=>{if(!r.current)return;const h=r.current.getBoundingClientRect();i({top:h.top,left:h.left+h.width/2})},[]),c=q.useCallback(()=>i(null),[]),d=q.useCallback(()=>{n===null?l():c()},[n,l,c]);return f.jsxs("span",{className:"info-tooltip-wrapper",onMouseEnter:l,onMouseLeave:c,children:[f.jsx("button",{ref:r,type:"button",className:"info-tooltip-trigger","aria-label":e,"aria-expanded":n!==null,onFocus:l,onBlur:c,onClick:d,onKeyDown:h=>{h.key==="Escape"&&c()},children:f.jsxs("svg",{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&&_w.createPortal(f.jsx("span",{"aria-hidden":"true",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 q3=/[\s\-_]+/;function U3(e){const n=e.split(q3).filter(Boolean);return n.length===0?null:n.map(i=>i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("[\\s\\-_]*")}function Ub(e,n){const i=$3(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,S)=>b.type==="bold"?_s.createElement("strong",{key:`b-${S}`,className:"text-zinc-200 font-semibold"},b.value):b.value).filter(Boolean);const d=[...l].sort((b,S)=>S.length-b.length).map(U3).filter(b=>!!b);if(d.length===0)return r.map((b,S)=>b.type==="bold"?_s.createElement("strong",{key:`b-${S}`,className:"text-zinc-200 font-semibold"},b.value):b.value).filter(Boolean);const h=new RegExp(`(${d.join("|")})`,"gi"),g=new Map;for(const b of i)for(const S of b.terms){const x=dc(S);x&&!g.has(x)&&g.set(x,b.className)}return r.flatMap((b,S)=>b.value.split(h).map((N,A)=>{if(!N)return null;if(A%2===1){const k=g.get(dc(N))??"answer-highlight";return b.type==="bold"?_s.createElement("mark",{key:`hl-${S}-${A}`,className:k},_s.createElement("strong",{className:"text-zinc-200 font-semibold"},N)):_s.createElement("mark",{key:`hl-${S}-${A}`,className:k},N)}return b.type==="bold"?_s.createElement("strong",{key:`b-${S}-${A}`,className:"text-zinc-200 font-semibold"},N):N})).filter(Boolean)}function $3(e){return e.length===0?[]:typeof e[0]=="string"?[{terms:e,className:"answer-highlight"}]:e}function Ef(e){const n=(e??"").trim();return n&&(n.startsWith("/")||/^https?:\/\//i.test(n)||/^mailto:/i.test(n))?n:null}function uf(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 I3({evidence:e,project:n,onClose:i}){const[r,l]=q.useState(!1),[c,d]=q.useState("mentions"),[h,g]=q.useState(-1),[b,S]=q.useState(null),[x,N]=q.useState(!1),[A,T]=q.useState({}),k=qT(n.project),E=new Set(k.map(oc)),R=e.runHistory,V=R.length>1,[G,Z]=q.useState(null),X=q.useRef(!1);q.useEffect(()=>{if(X.current||e.answerSnippet&&(e.visibilityState!=null||e.answerMentioned!=null))return;const ee=R.at(-1);ee&&(X.current=!0,nc(ee.runId).then(de=>{const ne=de.snapshots?.find(Ne=>Ne.query===e.query&&Ne.provider===e.provider);ne&&Z({citationState:ne.citationState,answerMentioned:ne.answerMentioned,visibilityState:ne.visibilityState,visibilityTransition:ee.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,searchQueries:ne.searchQueries,evidenceUrls:[],changeLabel:e.visibilityChangeLabel??e.changeLabel,summary:e.summary})}).catch(()=>{}))},[e,R]);const J=h>=0&&b!==null,O=J?b:G||{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,searchQueries:e.searchQueries??[],evidenceUrls:e.evidenceUrls,changeLabel:e.visibilityChangeLabel??e.changeLabel,summary:e.summary},M=O.visibilityState==="pending"||O.citationState==="pending",le=M?!1:O.visibilityState!=null?O.visibilityState==="visible":O.answerMentioned!=null?O.answerMentioned:O.citationState===lc.cited||O.citationState==="emerging",Ae=O.answerMentioned!=null||O.visibilityState!=null||O.recommendedCompetitors.length>0,Ce=O.citedDomains.length>0||O.groundingSources.length>0||O.evidenceUrls.length>0,ve=n.project.displayName||n.project.name,tt=[...k.map(oc),ve,ve.split(" ").slice(0,2).join(" "),...O.matchedTerms].filter(ee=>ee.trim().length>2),oe=[...O.competitorDomains.flatMap(ee=>{const de=LT(ee);return de.length>=4?[de]:[]}),...O.recommendedCompetitors].filter(ee=>ee.trim().length>2),me=[{terms:tt,className:"answer-highlight-brand"},...oe.length>0?[{terms:oe,className:"answer-highlight-competitor"}]:[]],$=M?"pending":O.visibilityTransition==="lost"?"lost":le?"mentioned":"not-mentioned",W=q.useRef(0),fe=q.useCallback(async ee=>{const de=++W.current;if(ee===-1||ee===R.length-1){g(-1),S(null),l(!1);return}g(ee),l(!1);const ne=R[ee],Ne=`${ne.runId}::${e.query}::${e.provider}`;if(A[Ne]){S(A[Ne]);return}N(!0);try{const nt=await nc(ne.runId);if(de!==W.current)return;const xe=nt.snapshots?.find(He=>He.query===e.query&&He.provider===e.provider)??nt.snapshots?.find(He=>He.query===e.query),$e=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,searchQueries:xe.searchQueries,evidenceUrls:[],changeLabel:uf(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:[],searchQueries:[],evidenceUrls:[],changeLabel:uf(ne.mentionTransition??ne.visibilityTransition,ne.mentionState??ne.visibilityState),summary:"Snapshot data not available for this run."};T(He=>({...He,[Ne]:$e})),S($e)}catch{if(de!==W.current)return;S({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:[],searchQueries:[],evidenceUrls:[],changeLabel:uf(ne.mentionTransition??ne.visibilityTransition,ne.mentionState??ne.visibilityState),summary:"Failed to load historical run data."})}finally{de===W.current&&N(!1)}},[R,e.query,e.provider,A]),se=(J||e.historyScope!=="provider")&&O.model?`${O.provider} (${O.model}) · ${O.changeLabel.toLowerCase()}`:`${O.provider} · ${O.changeLabel.toLowerCase()}`,Ze=!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(" · "):"",F=le?{label:"Mentioned in answer",title:"Your brand or domain is mentioned in this answer",meta:se}:O.visibilityTransition==="lost"?{label:"Mention lost",title:"Your brand no longer appears in this answer",meta:se}: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:se},ue=()=>{if(!O.answerSnippet)return null;const ee=O.answerSnippet.split(`
|
|
58
|
+
`),de=[];let ne=[],Ne=0;const nt=()=>{if(ne.length===0)return;const xe=ne.join(" ").trim();xe&&de.push(f.jsx("p",{className:de.length>0?"mt-2.5":"",children:Ub(xe,me)},Ne++)),ne=[]};for(const xe of ee){const $e=xe.trim();if(/^[-\u2013\u2014]{3,}$/.test($e)){nt(),de.push(f.jsx("hr",{className:"border-zinc-800/60 my-3"},Ne++));continue}const He=$e.match(/^(#{1,3})\s+(\S.*)$/);if(He){nt();const Et=He[1].length,zn=He[2].replace(/^[\p{Emoji}\p{Emoji_Component}\s]+/u,"").trim()||He[2],Ot=Et===1?"text-[13px] font-semibold text-zinc-100 mt-4 mb-1":Et===2?"text-xs font-semibold text-zinc-200 mt-3 mb-0.5":"text-xs font-medium text-zinc-300 mt-2";de.push(f.jsx("p",{className:Ot,children:Ub(zn,me)},Ne++));continue}if($e===""){nt();continue}ne.push($e)}return nt(),de};return f.jsx(hv,{open:!0,onOpenChange:ee=>{ee||i()},children:f.jsxs(fv,{children:[f.jsx(If,{className:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm"}),f.jsxs(Vf,{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," ","·"," ",O.provider||"All providers"]}),f.jsx(Pf,{className:"text-lg font-semibold text-zinc-50 truncate",children:e.query})]}),f.jsxs(pv,{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(Qs,{className:"size-4"}),f.jsx("span",{className:"sr-only",children:"Close"})]})]}),V&&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((ee,de)=>{const ne=h===-1&&de===R.length-1||h===de,Ne=ee.visibilityState??(ee.answerMentioned?"visible":"not-visible"),nt=ee.visibilityTransition??Ne,xe=Ne==="visible"?"bg-emerald-400":nt==="emerging"?"bg-amber-400":nt==="lost"?"bg-rose-400":"bg-zinc-600",He=new Date(ee.createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"}),Et=!!(ee.model&&de>0&&R[de-1]?.model&&R[de-1].model!==ee.model);return f.jsxs("button",{type:"button",className:`evidence-run-dot ${ne?"evidence-run-dot--selected":""}`,onClick:()=>{fe(de===R.length-1?-1:de)},"aria-label":[`Run ${He}: ${Ne}`,ee.model?`model ${ee.model}`:null,Et?"model changed":null].filter(Boolean).join(" — "),"aria-pressed":ne,children:[f.jsx("span",{className:`size-2 rounded-full ${xe} ${Et?"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:He})]},de)})}),h>=0&&h<R.length&&f.jsxs("p",{className:"text-[11px] text-zinc-500 mt-1",children:["Viewing run from ",new Date(R[h].createdAt).toLocaleString()," ","—"," ",f.jsx("span",{className:"capitalize",children:R[h].visibilityState??(R[h].answerMentioned?"visible":"not-visible")}),f.jsxs("button",{type:"button",className:"text-zinc-400 hover:text-zinc-200 ml-2",onClick:()=>{fe(-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(ee=>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:`${ee.fromModel??"unknown"} -> ${ee.toModel??"unknown"} on ${new Date(ee.createdAt).toLocaleDateString()}`},`${ee.runId}:${ee.toModel??"unknown"}`))})]}),f.jsxs("div",{className:"evidence-modal-body",children:[x&&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","…"]}),!x&&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:F.label}),f.jsx("p",{className:`evidence-position-title evidence-position-title--${$}`,children:F.title}),f.jsx("p",{className:"evidence-position-meta",children:F.meta}),Ze&&f.jsx("p",{className:"mt-1 text-[11px] text-zinc-500",children:Ze})]}),O.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:ue()}),O.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"})]}),!O.answerSnippet&&!x&&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"}),O.searchQueries.length>0&&f.jsxs("div",{children:[f.jsxs("div",{className:"drawer-section-label flex items-center",children:[f.jsx("span",{children:"Web searches the model ran"}),f.jsx(to,{text:"The search queries this AI model issued while researching your prompt. They reveal how the model reformulated the question — the phrasings worth optimizing your content for. Distinct from grounding sources (what it found) and citations (what it linked)."})]}),f.jsx("ul",{className:"grid gap-1",children:O.searchQueries.map((ee,de)=>f.jsxs("li",{className:"flex items-start gap-2 text-sm text-zinc-300",children:[f.jsx(PA,{className:"size-3.5 mt-0.5 shrink-0 text-zinc-600","aria-hidden":"true"}),f.jsx("span",{className:"break-words",children:ee})]},`${de}-${ee}`))})]}),!J&&e.relatedTechnicalSignals.length>0&&f.jsxs("div",{children:[f.jsx("p",{className:"drawer-section-label",children:le?"Why you're visible":"What to fix"}),f.jsx("div",{className:"action-items-list",children:e.relatedTechnicalSignals.map((ee,de)=>f.jsxs("div",{className:"action-item",children:[f.jsx("svg",{className:`action-item-icon ${le?"text-emerald-400":"text-amber-400"}`,viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:le?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:ee})]},de))})]}),O.summary&&f.jsx("p",{className:"text-xs text-zinc-600 border-t border-zinc-800/40 pt-3 mt-1",children:O.summary})]}),f.jsxs("div",{className:"evidence-modal-sidebar",children:[(Ae||Ce)&&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(to,{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--${le?"mentioned":"not-mentioned"}`,children:[f.jsx("span",{className:"mention-status-icon",children:M?"…":le?"✓":"—"}),f.jsx("span",{className:"mention-status-label",children:M?"Pending":le?"Mentioned":"Not mentioned"})]}),O.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:O.matchedTerms.map(ee=>f.jsx("span",{className:"mention-chip mention-chip--brand",children:ee},ee))})]}),!M&&!le&&O.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:tt.map(ee=>f.jsx("span",{className:"mention-chip mention-chip--muted",children:ee},ee))}),f.jsx("p",{className:"text-[11px] text-zinc-600 mt-1.5",children:"None of these appear in the answer text."})]})]}),(O.recommendedCompetitors.length>0||O.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(to,{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 ee=O.competitorDomains.map(Ne=>Ne.replace(/^www\./,"")),de=new Set(ee.map(Ne=>dc(Ne.replace(/\.[^.]+$/,""))));return[...O.recommendedCompetitors.filter(Ne=>!de.has(dc(Ne))),...ee].map(Ne=>f.jsx("span",{className:"mention-chip mention-chip--competitor",children:Ne},Ne))})()})]})]}),c==="sources"&&f.jsxs(f.Fragment,{children:[O.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(to,{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:O.citedDomains.map((ee,de)=>{const ne=ee.toLowerCase().replace(/^www\./,""),Ne=E.has(ne),nt=!Ne&&O.competitorDomains.some($e=>$e.toLowerCase().replace(/^www\./,"")===ne),xe=Ne?"you":nt?"competitor":"other";return f.jsxs("div",{className:`citation-leaderboard-item citation-leaderboard-item--${xe}`,children:[f.jsxs("span",{className:"citation-leaderboard-rank",children:["#",de+1]}),f.jsx("span",{className:"citation-leaderboard-domain",children:ee}),Ne&&f.jsx("span",{className:"citation-leaderboard-tag",children:"You"}),nt&&f.jsx("span",{className:"citation-leaderboard-tag",children:"Competitor"})]},ee)})})]}),O.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 (",O.groundingSources.length,")"]}),f.jsx(to,{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:O.groundingSources.map((ee,de)=>{const ne=Ef(ee.uri),Ne=ee.title||ee.uri;return f.jsx("li",{className:"truncate text-sm",children:ne?f.jsx("a",{href:ne,target:"_blank",rel:"noopener noreferrer",className:"text-zinc-400 hover:text-zinc-200 transition-colors",children:Ne}):f.jsx("span",{className:"text-zinc-400",children:Ne})},de)})})]}),O.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:O.evidenceUrls.map(ee=>{const de=Ef(ee);return f.jsx("li",{className:"truncate text-sm",children:de?f.jsx("a",{href:de,target:"_blank",rel:"noopener noreferrer",className:"text-zinc-400 hover:text-zinc-200 transition-colors",children:ee}):f.jsx("span",{className:"text-zinc-400",children:ee})},ee)})})]}),O.citedDomains.length===0&&O.groundingSources.length===0&&O.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"]})]}),!Ae&&!Ce&&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 Bn(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 df=[{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 kc(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 V3=kc({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"}),P3=kc({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"}),G3=kc({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"}),H3=kc({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"}),Q3=[{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:Bn(["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:Bn(["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:Bn(["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:Bn(["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:Bn(["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:Bn(["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:Bn(["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:Bn(["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:Bn(["not-cited","not-cited","not-cited","not-cited","not-cited","cited"])}];df[0],Math.round(1/9*100),Math.round(2/9*100),df[1],Bn(["cited","cited","cited","cited","cited"]),df[2],Math.round(2/7*100),Math.round(3/7*100),Bn(["not-cited","not-cited","not-cited","cited"]);function K3(e,n){return e.runs.find(i=>i.id===n)}function Z3(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 Y3(e,n,i){if(e){const r=e.visibilityEvidence.find(l=>l.id===i);if(r)return{project:e,evidence:r}}if(n)return Z3(n,i)}const X3={regression:"negative",gain:"positive",opportunity:"caution","first-citation":"positive","provider-pickup":"positive","persistent-gap":"caution","competitor-gained":"negative","competitor-lost":"neutral","gbp-lodging-gap":"negative","gbp-listing-discrepancy":"negative","gbp-cta-gap":"caution","gbp-metric-drop":"negative","gbp-keyword-drop":"negative"},J3={opportunity:"write","persistent-gap":"write","competitor-gained":"write","competitor-lost":"write",regression:"investigate",gain:"monitor","first-citation":"monitor","provider-pickup":"monitor","gbp-lodging-gap":"write","gbp-listing-discrepancy":"write","gbp-cta-gap":"write","gbp-metric-drop":"investigate","gbp-keyword-drop":"investigate"},F3={regression:"lost",gain:"emerging",opportunity:"not-cited","first-citation":"emerging","provider-pickup":"emerging","persistent-gap":"not-cited","competitor-gained":"cited","competitor-lost":"not-cited","gbp-lodging-gap":"not-cited","gbp-listing-discrepancy":"not-cited","gbp-cta-gap":"not-cited","gbp-metric-drop":"lost","gbp-keyword-drop":"lost"},W3={regression:"Regression",gain:"Gain",opportunity:"Opportunity","first-citation":"First citation","provider-pickup":"Pickup","persistent-gap":"Gap","competitor-gained":"Competitor","competitor-lost":"Competitor","gbp-lodging-gap":"Lodging gap","gbp-listing-discrepancy":"Listing gap","gbp-cta-gap":"Booking CTA","gbp-metric-drop":"Metric drop","gbp-keyword-drop":"Keyword drop"};function eR(e){return{id:e.id,tone:X3[e.type],title:e.title,detail:e.cause?.details??e.cause?.cause??"",actionLabel:e.recommendation?.action??W3[e.type],actionGroup:J3[e.type],affectedPhrases:[{query:e.query,evidenceId:"",provider:e.provider,citationState:F3[e.type]}]}}function tR(e){return e.filter(n=>!n.dismissed).map(eR)}function bS(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 $b(e){try{return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}catch{return e}}function nR(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 vS(e){switch(e){case ke["answer-visibility"]:return"Answer visibility sweep";case ke["gsc-sync"]:return"GSC sync";case ke["inspect-sitemap"]:return"Sitemap inspection";case ke["ga-sync"]:return"GA sync";case ke["traffic-sync"]:return"Traffic sync";case ke["bing-inspect"]:return"Bing URL inspection";case ke["bing-inspect-sitemap"]:return"Bing sitemap inspection";case ke["site-audit"]:return"Site audit";case ke["backlink-extract"]:return"Backlink extract";case ke["aeo-discover-seed"]:return"Discovery (seed phase)";case ke["aeo-discover-probe"]:return"Discovery (probe phase)";case ke["gbp-sync"]:return"Business Profile sync";case ke["ads-sync"]:return"ChatGPT ads sync"}}function aR(e){return e===Bs.manual?"Manual":e===Bs.scheduled?"Scheduled":e===Bs["config-apply"]?"Config apply":e}function Np(e,n){return{id:e.id,projectId:e.projectId,projectName:n,kind:e.kind,kindLabel:vS(e.kind),status:e.status,trigger:e.trigger??"manual",location:e.location??null,createdAt:e.createdAt,startedAt:e.startedAt?$b(e.startedAt):$b(e.createdAt),duration:nR(e.startedAt??null,e.finishedAt??null),statusDetail:e.error?SS(e.error):iR(e),summary:sR(e),triggerLabel:aR(e.trigger)}}function SS(e){const n=ap(e);return n.length>200?n.slice(0,200)+"…":n}function iR(e){switch(e.status){case Ht.queued:return"Waiting for execution slot.";case Ht.running:return"Provider queries in progress.";case Ht.completed:return"All queries checked.";case Ht.partial:return"Run completed with some queries skipped.";case Ht.failed:return e.error?SS(e.error):"Run failed.";case Ht.cancelled:return"Run was cancelled.";default:return""}}function sR(e){const n=vS(e.kind);switch(e.status){case Ht.queued:return`${n} queued`;case Ht.running:return`${n} in progress`;case Ht.completed:return`${n} completed`;case Ht.partial:return`${n} partially completed`;case Ht.failed:return`${n} failed`;case Ht.cancelled:return`${n} cancelled`;default:return e.status}}function rR(e,n,i,r){const l=[];let c=0;const d=new Set;if(i.length>0){const h=i.flatMap(T=>T.snapshots??[]),g=new Map;for(const T of h)if(T.query){const k=`${T.query}::${T.provider}::${T.location??""}`;g.set(k,T)}const b=new Set(h.map(T=>T.location??null));b.size===0&&b.add(null);const S=new Set(h.map(T=>T.provider)),x=new Set(n.flatMap(T=>Object.keys(T.providerRuns??{}))),N=[...new Set([...S,...x])].sort(),A=N.length>0?N:["gemini"];for(const T of n){if(T.runs.length===0)continue;d.add(T.query);const k=T.runs.at(-1),E=k?.transition??"not-cited";for(const R of A){const V=[...b].filter(X=>g.has(`${T.query}::${R}::${X??""}`)),G=(T.providerRuns?.[R]?.length??0)>0,Z=V.length>0?V:G?[null]:[];for(const X of Z){const J=X??"",O=g.get(`${T.query}::${R}::${J}`),M=O?.model??null,le=M?`${R}:${M}`:null,Ae=T.providerRuns?.[R],Ce=le?T.modelRuns?.[le]:void 0,ve=$e=>$e?.filter(He=>(He.location??null)===X),tt=V.length>0?ve(Ae):Ae,oe=V.length>0?ve(Ce):Ce,me=(tt?.length?tt:null)??(oe?.length?oe:null),$=tt?.length?"provider":oe?.length?"model":"query",W=me?me.at(-1).transition:E,fe=me?me.at(-1).visibilityTransition??(me.at(-1).visibilityState==="visible"?"visible":"not-visible"):k?.visibilityTransition??(k?.visibilityState==="visible"?"visible":"not-visible"),je=me?.at(-1)?.citationState,se=me?.at(-1)?.visibilityState,Ze=O?W==="lost"?"lost":W==="emerging"?"emerging":O.citationState===lc.cited?"cited":"not-cited":je===lc.cited?"cited":"not-cited",F=O?.visibilityState??(se==="visible"?"visible":se==="pending"?"pending":"not-visible"),ue=Ib(me||T.runs),ee=Vb(me||T.runs),de=oR(T,R),ne=(me??T.runs).map($e=>({runId:$e.runId,citationState:$e.citationState,createdAt:$e.createdAt,model:de.get($e.runId)??null,answerMentioned:$e.answerMentioned,visibilityState:$e.visibilityState,visibilityTransition:$e.visibilityTransition,mentionState:$e.mentionState,mentionTransition:$e.mentionTransition})),Ne=lR(ne),nt=$==="provider"&&Ne.length<=1?"model":$,xe=cR(ne);l.push({id:`evidence_${e}_${c++}`,query:T.query,provider:O?.provider??R,model:O?.model??null,location:O?.location??X,citationState:Ze,answerMentioned:O?.answerMentioned,visibilityState:F,visibilityChangeLabel:Pb(fe,ee,{positive:"visible",negative:"not visible",first:"first visibility"}),changeLabel:Pb(W,ue),answerSnippet:O?.answerText??"",citedDomains:O?.citedDomains??[],evidenceUrls:[],competitorDomains:O?.competitorOverlap??[],recommendedCompetitors:O?.recommendedCompetitors??[],matchedTerms:O?.matchedTerms??[],relatedTechnicalSignals:[],groundingSources:O?.groundingSources??[],searchQueries:O?.searchQueries??[],summary:uR(F,fe,T.query),runHistory:ne,historyScope:nt,modelsSeen:Ne,modelTransitions:xe})}}}}for(const h of r)d.has(h.query)||l.push({id:`evidence_${e}_${c++}`,query:h.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:[],searchQueries:[],summary:`"${h.query}" has been added but no visibility run has been triggered yet.`,runHistory:[],historyScope:"query",modelsSeen:[],modelTransitions:[]});return l}function oR(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),h=d==="unknown"?null:d;for(const g of c)i.set(g.runId,h)}return i}function lR(e){const n=new Set;for(const i of e)i.model&&n.add(i.model);return[...n]}function cR(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 Ib(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 Vb(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 Pb(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?`${no(r.positive)} in latest run`:`${no(r.positive)} for ${n} runs`;case"lost":return"Lost since last run";case"emerging":return no(r.first);case"not-cited":case"not-visible":return n<=1?`${no(r.negative)} in latest run`:`${no(r.negative)} across ${n} runs`;default:return e}}function no(e){return e.charAt(0).toUpperCase()+e.slice(1)}function uR(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 xS(e){const n=bS(e.project),i=rR(n.name,e.timeline,e.latestRunDetails,e.queries),l=[...e.runs].sort((c,d)=>d.createdAt.localeCompare(c.createdAt)).map(c=>Np(c,e.project.displayName||e.project.name));return e.overview?dR(n,e.overview,i,l):fR(n,i,l)}function dR(e,n,i,r){const l=tR(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,citationMovement:n.citationMovement,mentionMovement:n.mentionMovement,movementComparison:n.movementComparison,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 fR(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"},citationMovement:{gained:0,lost:0,tone:"neutral",hasPreviousRun:!1},mentionMovement:{gained:0,lost:0,tone:"neutral",hasPreviousRun:!1},movementComparison:{hasPreviousRun:!1,comparable:!1,querySetChanged:!1,previousRunAt:null,currentQueryCount:0,previousQueryCount:0,comparableQueryCount:0,addedQueryCount:0,removedQueryCount:0,addedQueries:[],removedQueries:[]},insights:[],visibilityEvidence:n,competitors:[],recentRuns:i.slice(0,5),suggestedQueries:{rows:[],totalCandidates:0,skippedAlreadyTracked:0}}}function pR(e){const n=bS(e.project),i=[...e.runs].sort((N,A)=>A.createdAt.localeCompare(N.createdAt)),r=i.find(N=>N.kind===ke["answer-visibility"])??i[0],l=e.project.displayName||e.project.name,c=r?Np(r,l):mR(e.project.id,l),d=e.overview;if(!d)return{project:n,mentionScore:0,mentionDelta:"No data",mentionTone:"neutral",lastRun:c,insight:"No runs completed yet.",trend:[],competitorPressureLabel:"None"};const h=d.scores.mention,g=h.progress??0,b=d.queryCounts.mentionedQueries,S=d.queryCounts.totalQueries,x=d.providers.length;return{project:n,mentionScore:g,mentionDelta:S>0?`${b} of ${S} queries`:"No data",mentionTone:h.tone,providerCoverage:h.providerCoverage,lastRun:c,insight:S>0?`${b} of ${S} queries mentioned across ${x} provider${x===1?"":"s"}.`:"No runs completed yet.",trend:h.trend??[],competitorPressureLabel:d.scores.competitorPressure.value}}function mR(e,n){return{id:"none",projectId:e,projectName:n,kind:ke["answer-visibility"],kindLabel:"No runs yet",status:Ht.queued,trigger:Bs.manual,createdAt:"",startedAt:"",duration:"",statusDetail:"",summary:"No runs yet",triggerLabel:""}}function hR(e,n){const i=[],r=[],l=[];for(const d of e){r.push(xS(d)),l.push(pR(d));const h=[...d.runs].sort((g,b)=>b.createdAt.localeCompare(g.createdAt));for(const g of h)i.push(Np(g,d.project.displayName||d.project.name))}i.sort((d,h)=>h.createdAt.localeCompare(d.createdAt));const c=e.length>0;return{portfolioOverview:{projects:l,attentionItems:c?gR(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,defaultModel:d.defaultModel,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 gR(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===Ht.running||c.status===Ht.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."}),n}const wS=q.createContext(null);wS.Provider;function go(){return q.useContext(wS)}function Ac(e){const i=go()?.dashboard??null,r=dn({...bp({client:ie}),enabled:!i,refetchInterval:Kk}),l=dn({...Sp({client:ie,query:{kind:"answer-visibility"}}),enabled:!i,staleTime:lo,refetchInterval:T=>T.state.data?.some(R=>R.status==="running"||R.status==="queued")?3e3:lo}),c=dn({...$4({client:ie}),enabled:!i}),d=r.data??[],h=l.data??[],g=Cw({queries:d.map(T=>{const k=h.filter(V=>V.projectId===T.id),E=k.filter(V=>(V.status==="completed"||V.status==="partial")&&V.kind==="answer-visibility"&&V.trigger!=="probe").sort((V,G)=>G.createdAt.localeCompare(V.createdAt)),R=E.length>0?E[0].id:"no-run";return{queryKey:["project-overview-slim",T.id,R],queryFn:async()=>{const V=await Tv(T.name).catch(()=>null);return{project:T,runs:k,queries:[],competitors:[],timeline:[],latestRunDetails:[],previousRunDetails:[],gscCoverage:null,bingCoverage:null,dbInsights:null,overview:V}},enabled:!i&&r.isSuccess&&l.isSuccess,staleTime:wf}})}),b=g.every(T=>T.isSuccess),S=q.useMemo(()=>{if(i)return i;if(!r.data||!l.data||d.length>0&&!b)return null;const T=g.map(k=>k.data?{...k.data,runs:h.filter(E=>E.projectId===k.data.project.id)}:null).filter(k=>k!=null);return hR(T,c.data??null)},[i,r.data,l.data,c.data,b,g,d.length,h]),x=!i&&(r.isError||l.isError),N=!i&&!S&&!x,A=q.useCallback(async()=>{await Promise.all([r.refetch(),l.refetch(),c.refetch()])},[r.refetch,l.refetch,c.refetch]);return{dashboard:S,isLoading:N,isError:x,refetch:A}}function yR(e){const n=go(),i=q.useMemo(()=>!n||!e?null:n.dashboard.projects.find(T=>T.project.name===e)??null,[n,e]),r=dn({...L4({client:ie,path:{name:e??""}}),enabled:!!e&&!i,staleTime:wf,refetchOnWindowFocus:"always"}),l=dn({...Sp({client:ie,query:{kind:"answer-visibility"}}),enabled:!!e,staleTime:lo,refetchOnWindowFocus:"always",refetchInterval:T=>T.state.data?.some(R=>R.projectId===r.data?.id&&(R.status==="running"||R.status==="queued"))?3e3:lo}),c=r.data??null,d=q.useMemo(()=>c?(l.data??[]).filter(T=>T.projectId===c.id):[],[c,l.data]),{latestRunIds:h,previousRunIds:g,latestRunIdsKey:b}=q.useMemo(()=>{const T=d.filter(G=>(G.status==="completed"||G.status==="partial")&&G.kind==="answer-visibility"&&G.trigger!=="probe").sort((G,Z)=>Z.createdAt.localeCompare(G.createdAt)),k=T[0]?.createdAt??null,E=k?T.filter(G=>G.createdAt===k).map(G=>G.id):[],R=T.find(G=>G.createdAt!==k)?.createdAt??null,V=R?T.filter(G=>G.createdAt===R).map(G=>G.id):[];return{latestRunIds:E,previousRunIds:V,latestRunIdsKey:[...E].sort().join(",")}},[d]),S=dn({queryKey:["project-dashboard-full",c?.id??null,b||"none"],queryFn:async()=>{if(!c||!e)return null;const[T,k,E,R,V,G,Z,X,J]=await Promise.all([yk(e).catch(()=>[]),bk(e).catch(()=>[]),vk(e).catch(()=>[]),h.length?Promise.all(h.map(O=>nc(O).catch(()=>null))).then(O=>O.filter(M=>M!=null)):Promise.resolve([]),g.length?Promise.all(g.map(O=>nc(O).catch(()=>null))).then(O=>O.filter(M=>M!=null)):Promise.resolve([]),Ok(e).catch(()=>null),Mk(e).catch(()=>null),Lk(e).catch(()=>null),Tv(e).catch(()=>null)]);return{project:c,runs:d,queries:T,competitors:k,timeline:E,latestRunDetails:R,previousRunDetails:V,gscCoverage:G,bingCoverage:Z,dbInsights:X,overview:J}},enabled:!!c&&!!e&&l.isSuccess,staleTime:wf,refetchOnWindowFocus:"always",refetchInterval:Zk}),x=q.useMemo(()=>S.data?xS({...S.data,runs:d}):i||null,[S.data,d,i]),N=q.useCallback(async()=>{await Promise.all([r.refetch(),l.refetch(),S.refetch()])},[r.refetch,l.refetch,S.refetch]),A=!x&&(r.isLoading||l.isLoading||S.isLoading);return{commandCenter:x,project:c,isLoading:A,isError:r.isError||l.isError||S.isError,refetch:N}}const bR=["health"];async function vR(){const e=await Uk("/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 kp(e,n){return dn({queryKey:bR,queryFn:vR,enabled:e,refetchInterval:15e3,initialData:n})}function SR(e){return dn({...K0({client:ie,path:{id:e??""}}),enabled:!!e,refetchInterval:n=>{const i=n.state.data?.status;return i==="running"||i==="queued"?3e3:!1}})}function Ap(){const e=hc(),n=zw({strict:!1}),i=Tw({select:g=>g.location.pathname}),r=n.runId??null,l=n.evidenceId??null;return{runId:r,evidenceId:l,openRun:g=>{e({to:i,from:tn.to,search:b=>({...b,runId:g,evidenceId:void 0})})},openEvidence:g=>{e({to:i,from:tn.to,search:b=>({...b,evidenceId:g,runId:void 0})})},closeDrawer:()=>{e({to:i,from:tn.to,search:g=>({...g,runId:void 0,evidenceId:void 0})})}}}const xR={negative:"toast-card-negative",caution:"toast-card-caution",positive:"toast-card-positive",neutral:"toast-card-neutral"};function wR(e){if(e.cta)return`${e.cta.label}: ${e.title}`}function jR(){const e=q.useSyncExternalStore(Hk,Qy,Qy),n=hc(),{openRun:i}=Ap(),r=q.useCallback(c=>{xf(c)},[]),l=q.useCallback(c=>{c.cta&&(c.cta.intent==="open-run-drawer"?i(c.cta.runId):n({to:"/runs"}),xf(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 ${xR[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":wR(c),children:c.cta.label}):null]}),f.jsx("button",{type:"button",onClick:()=>r(c.id),className:"toast-dismiss","aria-label":"Dismiss",children:f.jsx(Qs,{className:"size-3.5"})})]},c.id))})}function NR(e,n={}){const{threshold:i=80}=n,r=q.useRef(null),l=q.useRef({scrollHeight:0,wasAtEnd:!0});function c(g){return g.scrollHeight-g.scrollTop-g.clientHeight}function d(){const g=r.current;return g?c(g)<=i:!0}function h(){const g=r.current;g&&(g.scrollTop=g.scrollHeight,l.current.wasAtEnd=!0,l.current.scrollHeight=g.scrollHeight)}return q.useEffect(()=>{const g=r.current;if(!g)return;const b=()=>{l.current.wasAtEnd=c(g)<=i};return g.addEventListener("scroll",b,{passive:!0}),()=>g.removeEventListener("scroll",b)},[i]),q.useLayoutEffect(()=>{const g=r.current;if(!g)return;const b=g.scrollHeight;b>l.current.scrollHeight&&l.current.wasAtEnd&&(g.scrollTop=b),l.current.scrollHeight=b},e),q.useEffect(()=>{const g=r.current;if(!g||typeof ResizeObserver>"u")return;const b=new ResizeObserver(()=>{const S=g.scrollHeight;S>l.current.scrollHeight&&l.current.wasAtEnd&&(g.scrollTop=S),l.current.scrollHeight=S});return b.observe(g),g.firstElementChild&&b.observe(g.firstElementChild),()=>b.disconnect()},[]),{ref:r,scrollToEnd:h,isAtEnd:d}}async function _p(e){try{return await e.json()}catch{return{}}}function kR(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,"")+"/api/v1":"/api/v1"}const Cp=kR();function zp(e){e===401&&Gf()}async function Gb(e){const n=await fetch(`${Cp}/projects/${encodeURIComponent(e)}/agent/transcript`,{credentials:"include"});if(!n.ok){zp(n.status);const i=await _p(n);throw new Gn(i.error?.message??`transcript fetch failed: ${n.status}`,n.status,i.error?.code)}return await n.json()}async function AR(e){const n=await fetch(`${Cp}/projects/${encodeURIComponent(e)}/agent/transcript`,{method:"DELETE",credentials:"include"});if(!n.ok){zp(n.status);const i=await _p(n);throw new Gn(i.error?.message??`reset failed: ${n.status}`,n.status,i.error?.code)}}async function _R({project:e,prompt:n,provider:i,modelId:r,scope:l,signal:c,onEvent:d}){const h={prompt:n};i&&(h.provider=i),r&&(h.modelId=r),l&&(h.scope=l);const g=await fetch(`${Cp}/projects/${encodeURIComponent(e)}/agent/prompt`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(h),signal:c});if(!g.ok||!g.body){zp(g.status);const A=await _p(g);throw new Gn(A.error?.message??`prompt failed: ${g.status}`,g.status,A.error?.code)}const b=g.body.getReader(),S=new TextDecoder;let x="";const N=()=>{b.cancel().catch(()=>{})};c?.addEventListener("abort",N,{once:!0});try{for(;;){const{value:A,done:T}=await b.read();if(T)break;x+=S.decode(A,{stream:!0});let k=x.indexOf(`
|
|
59
59
|
|
|
60
60
|
`);for(;k!==-1;){const E=x.slice(0,k);x=x.slice(k+2);for(const R of E.split(`
|
|
61
61
|
`)){if(!R.startsWith("data:"))continue;const V=R.slice(5).trim();if(V)try{d(JSON.parse(V))}catch{}}k=x.indexOf(`
|
|
62
62
|
|
|
63
|
-
`)}}}finally{c?.removeEventListener("abort",N);try{b.releaseLock()}catch{}}}function wS(e){return!e||e.role!=="assistant"?"":e.content.filter(n=>n.type==="text").map(n=>n.text).join("")}const AR=[{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?"}],_R=[{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"}],Hl=e=>`canonry:aero:provider:${e}`,Hb=e=>`canonry:aero:scope:${e}`;function CR({projectName:e}){const[n,i]=q.useState(!1),[r,l]=q.useState(!1),[c,d]=q.useState([]),[h,g]=q.useState(""),[b,S]=q.useState(!1),[x,N]=q.useState([]),[A,T]=q.useState(""),[k,E]=q.useState(null),[R,V]=q.useState(()=>typeof window>"u"?null:window.localStorage.getItem(Hl(e))??null),[G,Z]=q.useState(()=>typeof window>"u"?"read-only":window.localStorage.getItem(Hb(e))==="all"?"all":"read-only"),X=q.useRef(null),{ref:J}=wR([c,A,x]),O=q.useRef(null),[M,le]=q.useState(0),Ae=q.useMemo(()=>{const F=h.trimStart();if(!F.startsWith("/"))return[];if(/\s/.test(F))return[];const ue=F.toLowerCase();return _R.filter(ee=>ee.command.startsWith(ue)||ee.label.toLowerCase().includes(ue.slice(1)))},[h]);q.useEffect(()=>{le(F=>Ae.length===0?0:Math.min(F,Ae.length-1))},[Ae.length]);const Ce=dn({...SD({client:ae,path:{name:e}}),enabled:n,staleTime:6e4}),ve=q.useMemo(()=>{const F=Ce.data?.providers??[];if(R){const ee=F.find(de=>de.id===R&&de.configured);if(ee)return ee}const ue=Ce.data?.defaultProvider;return ue?F.find(ee=>ee.id===ue)??null:null},[R,Ce.data]);q.useEffect(()=>{if(!Ce.data||!R)return;Ce.data.providers.find(ue=>ue.id===R&&ue.configured)||(V(null),window.localStorage.removeItem(Hl(e)))},[Ce.data,R,e]);const tt=q.useCallback(F=>{V(F),!(typeof window>"u")&&(F?window.localStorage.setItem(Hl(e),F):window.localStorage.removeItem(Hl(e)))},[e]),oe=q.useCallback(()=>{Z(F=>{const ue=F==="all"?"read-only":"all";return typeof window<"u"&&window.localStorage.setItem(Hb(e),ue),ue})},[e]);q.useEffect(()=>{if(!n)return;const F=ue=>{ue.key==="Escape"&&(r?l(!1):i(!1))};return window.addEventListener("keydown",F),()=>window.removeEventListener("keydown",F)},[n,r]),q.useEffect(()=>{if(!n)return;let F=!1;E(null);const ue=()=>{F||b||Gb(e).then(ne=>{F||d(ne.messages)}).catch(ne=>{F||E(ne instanceof Error?ne.message:"Failed to load transcript")})};ue();const de=window.setInterval(ue,15e3);return()=>{F=!0,window.clearInterval(de)}},[n,e,b]),q.useEffect(()=>()=>{X.current?.abort()},[e]);async function me(F){const ue=F.trim();if(!ue||b)return;E(null),g(""),S(!0),T(""),N([]);const ee={role:"user",content:ue,timestamp:Date.now()};d(ne=>[...ne,ee]);const de=new AbortController;X.current=de;try{await kR({project:e,prompt:ue,provider:R??void 0,scope:G,signal:de.signal,onEvent:$});const ne=await Gb(e);d(ne.messages)}catch(ne){ne.name!=="AbortError"&&E(ne instanceof Error?ne.message:"Prompt failed")}finally{S(!1),T(""),X.current=null}}function $(F){switch(F.type){case"message_update":T(wS(F.message));break;case"message_end":F.message.role==="assistant"&&T("");break;case"tool_execution_start":N(ue=>[...ue,{id:F.toolCallId,name:F.toolName,args:F.args,startedAt:Date.now()}]);break;case"tool_execution_end":N(ue=>ue.map(ee=>ee.id===F.toolCallId?{...ee,endedAt:Date.now(),isError:F.isError,result:F.result}:ee));break;case"error":E(F.message);break}}async function W(){X.current?.abort();try{await NR(e),d([]),E(null)}catch(F){E(F instanceof Error?F.message:"Reset failed")}}const fe=c.length===0,je=n&&r?"pointer-events-auto fixed inset-0 z-40 flex items-stretch justify-center bg-zinc-950/70 p-4 sm:p-8 backdrop-blur-sm":"pointer-events-none fixed inset-x-0 bottom-0 z-40 flex justify-center p-3",se=r?"pointer-events-auto flex h-full w-full max-w-5xl flex-col overflow-hidden rounded-2xl border border-zinc-800/80 bg-zinc-950/95 shadow-2xl":"pointer-events-auto w-full max-w-3xl",Ze=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:F=>{r&&F.target===F.currentTarget&&l(!1)},children:f.jsx("div",{className:se,children:n?f.jsxs("div",{className:r?"flex h-full flex-col":"flex flex-col overflow-hidden rounded-2xl border border-zinc-800/80 bg-zinc-950/95 shadow-xl backdrop-blur",children:[f.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-zinc-800/70 px-4 py-2.5",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(Xy,{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(zR,{providers:Ce.data?.providers??[],active:ve,override:R,onPick:tt,disabled:b}),f.jsx("button",{type:"button",onClick:wn(W),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(Rv,{className:"h-3.5 w-3.5","aria-hidden":"true"})}),f.jsx("button",{type:"button",onClick:()=>l(F=>!F),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(EA,{className:"h-3.5 w-3.5","aria-hidden":"true"}):f.jsx(_A,{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(Qs,{className:"h-4 w-4","aria-hidden":"true"})})]})]}),f.jsxs("div",{ref:J,className:Ze,children:[k&&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:k}),fe&&!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:AR.map(F=>f.jsx("button",{type:"button",onClick:()=>{me(F.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:F.label},F.label))})]}),RR(c,e,R,G),x.length>0&&f.jsx("div",{className:"mt-3 space-y-1.5",children:x.map(F=>f.jsx(jS,{trail:F},F.id))}),b&&A&&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(NS,{content:A})]}),b&&!A&&x.every(F=>F.endedAt!==void 0)&&f.jsx(qR,{})]}),f.jsx(TR,{projectName:e,activeProvider:ve,scope:G,onToggleScope:oe,disabled:b}),f.jsxs("div",{className:"relative",children:[Ae.length>0&&f.jsx(ER,{matches:Ae,selectedIndex:M,onHover:le,onPick:F=>{g(""),O.current?.focus(),F.action==="clear"?W():me(F.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:F=>{if(F.preventDefault(),Ae.length>0){const ue=Ae[M];g(""),ue.action==="clear"?W():me(ue.prompt);return}me(h)},children:[f.jsx("textarea",{ref:O,value:h,onChange:F=>g(F.target.value),onKeyDown:F=>{if(Ae.length>0){if(F.key==="ArrowDown"){F.preventDefault(),le(ue=>(ue+1)%Ae.length);return}if(F.key==="ArrowUp"){F.preventDefault(),le(ue=>(ue-1+Ae.length)%Ae.length);return}if(F.key==="Tab"){F.preventDefault();const ue=Ae[M];g(`${ue.command} `);return}if(F.key==="Escape"){F.preventDefault(),g("");return}}if(F.key==="Enter"&&!F.shiftKey)if(F.preventDefault(),Ae.length>0){const ue=Ae[M];g(""),ue.action==="clear"?W():me(ue.prompt)}else me(h)},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||!h.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(sA,{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(Xy,{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 zR({providers:e,active:n,override:i,onPick:r,disabled:l}){const[c,d]=q.useState(!1),h=q.useRef(null);if(q.useEffect(()=>{if(!c)return;const S=N=>{h.current?.contains(N.target)||d(!1)},x=N=>{N.key==="Escape"&&d(!1)};return window.addEventListener("mousedown",S),window.addEventListener("keydown",x),()=>{window.removeEventListener("mousedown",S),window.removeEventListener("keydown",x)}},[c]),e.length===0)return null;const g=n?.label.replace(/\s+\(.+\)$/,"")??"No provider",b=n?.defaultModel;return f.jsxs("div",{ref:h,className:"relative",children:[f.jsxs("button",{type:"button",onClick:()=>d(S=>!S),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(uA,{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(S=>{const x=n?.id===S.id,N=i===S.id;return f.jsx("li",{children:f.jsxs("button",{type:"button",role:"option","aria-selected":x,disabled:!S.configured,onClick:()=>{S.configured&&(r(N?null:S.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:x?f.jsx(Dv,{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:S.label}),N&&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"}),!S.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:S.defaultModel}),S.keySource==="env"&&f.jsx("span",{className:"mt-0.5 block text-[10px] text-zinc-600",children:"via env var"}),!S.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:OR(S.id)})]})]})]})},S.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 TR({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 ER({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 OR(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 DR(e,n){const i=e.timestamp??0;return`${e.role}:${i}:${n}`}function RR(e,n,i,r){const l=[];for(let c=0;c<e.length;c++){const d=e[c],h=DR(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(MR,{text:g,projectName:n,providerOverride:i,scope:r},h));continue}if(d.role==="assistant"){const g=new Map;let b=c+1;for(;b<e.length&&e[b].role==="toolResult";){const N=e[b];g.set(N.toolCallId,N),b++}const S=LR(d,g,d.timestamp??0),x=wS(d);l.push(f.jsxs(q.Fragment,{children:[S.length>0&&f.jsx("div",{className:"mt-3 space-y-1.5",children:S.map(N=>f.jsx(jS,{trail:N},N.id))}),x.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(NS,{content:x})]})]},h)),c=b-1;continue}}return l}function MR({text:e,projectName:n,providerOverride:i,scope:r}){const[l,c]=q.useState(!1),d=q.useMemo(()=>BR(n,e,i,r),[n,e,i,r]);async function h(){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:wn(h),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(Dv,{className:"h-2.5 w-2.5 text-emerald-400","aria-hidden":"true"}),"Copied"]}):f.jsxs(f.Fragment,{children:[f.jsx(pA,{className:"h-2.5 w-2.5","aria-hidden":"true"}),"Copy as CLI"]})})]}),f.jsx("div",{className:"whitespace-pre-wrap",children:e})]})}function BR(e,n,i,r){const l=["canonry","agent","ask",Qb(e),Qb(n)];return i&&l.push("--provider",i),r==="read-only"&&l.push("--scope","read-only"),l.join(" ")}function Qb(e){return`'${e.replace(/'/g,"'\\''")}'`}function LR(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 jS({trail:e}){const[n,i]=q.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`,h=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 ${h} ${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(kA,{className:"h-3 w-3 animate-spin text-emerald-400","aria-hidden":"true"}):l?f.jsx(Mv,{className:"h-3 w-3 text-rose-400","aria-hidden":"true"}):f.jsx(KA,{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(Zf,{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:Kb(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:Kb(e.result)})]})]})]})}function Kb(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 NS({content:e}){return f.jsx("div",{className:"aero-markdown text-zinc-100",children:f.jsx(Mw,{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 qR(){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 UR(){const e=cv(),n=/^\/projects\/([^/]+)/.exec(e.pathname),i=n?decodeURIComponent(n[1]):null,r=dn({...bp({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(CR,{projectName:c.name},c.name):null}function wi(e,n){e.invalidateQueries({predicate:i=>{const r=i.queryKey[0];return typeof r?._id=="string"&&r._id.startsWith(n)}})}function fo(e,n,i){switch(e.invalidateQueries({queryKey:vp({client:ae})}),e.invalidateQueries({queryKey:Js({client:ae})}),n){case ke["answer-visibility"]:case ke["site-audit"]:case ke["backlink-extract"]:return;case ke["gsc-sync"]:case ke["inspect-sitemap"]:wi(e,"getApiV1ProjectsByNameGoogleGsc");return;case ke["ga-sync"]:wi(e,"getApiV1ProjectsByNameGa");return;case ke["traffic-sync"]:wi(e,"getApiV1ProjectsByNameGa"),wi(e,"getApiV1ProjectsByNameTraffic");return;case ke["bing-inspect"]:case ke["bing-inspect-sitemap"]:wi(e,"getApiV1ProjectsByNameBing");return;case ke["aeo-discover-seed"]:case ke["aeo-discover-probe"]:return;case ke["gbp-sync"]:wi(e,"getApiV1ProjectsByNameGbp");return;case ke["ads-sync"]:wi(e,"getApiV1ProjectsByNameAds");return;default:return n}}const Zb=[{label:"GitHub",href:"https://github.com/AINYC/canonry",Icon:yA},{label:"Docs",href:"https://github.com/AINYC/canonry/tree/main/docs",Icon:oA},{label:"Changelog",href:"https://github.com/AINYC/canonry/releases",Icon:hA}],Yb=e=>({label:e,state:"checking",detail:"Checking service health"}),$R={apiStatus:Yb("API"),workerStatus:Yb("Worker")};function kS(e){switch(e){case ke["answer-visibility"]:return"Visibility sweep";case ke["gsc-sync"]:return"GSC sync";case ke["inspect-sitemap"]:return"Sitemap inspection";case ke["ga-sync"]:return"GA sync";case ke["traffic-sync"]:return"Traffic sync";case ke["bing-inspect"]:return"Bing URL inspection";case ke["bing-inspect-sitemap"]:return"Bing sitemap inspection";case ke["site-audit"]:return"Site audit";case ke["backlink-extract"]:return"Backlink extract";case ke["aeo-discover-seed"]:return"Discovery (seed phase)";case ke["aeo-discover-probe"]:return"Discovery (probe phase)";case ke["gbp-sync"]:return"Business Profile sync";case ke["ads-sync"]:return"ChatGPT ads sync"}}function IR(e){return e==="completed"?"positive":e==="partial"?"caution":"negative"}function VR(e){const n=kS(e.kind);return e.status==="completed"?`${n} completed`:e.status==="partial"?`${n} completed with partial results`:e.status==="cancelled"?`${n} cancelled`:`${n} failed`}function PR(e,n){return e.error?`${n}: ${ap(e.error)}`:e.location?`${n} · ${e.location}`:n}function Xb(e,n,i){if(n)return n;const r=i.find(l=>l.id===e);return r?.displayName||r?.name||e}function GR(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 HR(e){return e.failed>0||e.cancelled>0?"negative":e.partial>0?"caution":"positive"}function QR(){const e=Ja(),n=q.useSyncExternalStore(zD,_i,_i),i=Object.keys(n.runs).length>0||Object.keys(n.batches).length>0,r=dn({...Sp({client:ae}),enabled:i,staleTime:lo,refetchInterval:3e3}),l=dn({...bp({client:ae}),enabled:i}),c=q.useRef({}),d=q.useCallback(()=>{r.refetch()},[r.refetch]);return q.useEffect(()=>{i&&d()},[i,d]),q.useEffect(()=>{if(!i||typeof window>"u")return;const h=()=>{document.visibilityState==="visible"&&d()};return window.addEventListener("focus",d),document.addEventListener("visibilitychange",h),()=>{window.removeEventListener("focus",d),document.removeEventListener("visibilitychange",h)}},[i,d]),q.useEffect(()=>{const h=r.data??[],g=l.data??[],b=Object.fromEntries(h.map(x=>[x.id,x])),S=Object.fromEntries(h.map(x=>[x.id,x.status]));for(const x of Object.values(n.runs)){const N=b[x.runId];if(!N||!OD(N.status)||(c.current[N.id]??x.lastAnnouncedStatus)===N.status)continue;const T=g.find(E=>E.id===N.projectId);if(T&&fo(e,N.kind,T.name),x.sourceAction==="run-all"){lf(N.id);continue}const k=Xb(N.projectId,x.projectLabel,g);en({title:VR(N),detail:PR(N,k),tone:IR(N.status),dedupeKey:`run:${N.id}`,dedupeMode:"replace",cta:{label:"View run",intent:"open-run-drawer",runId:N.id}}),lf(N.id)}if(r.data!==void 0){const x=new Set(h.map(A=>A.id)),N=RD(Object.values(n.runs),x,Date.now(),DD);for(const A of N){const T=g.find(k=>k.id===A.projectId);T&&fo(e,A.kind,T.name),A.sourceAction!=="run-all"&&en({title:`${kS(A.kind)} status unavailable`,detail:Xb(A.projectId,A.projectLabel,g),tone:"neutral",dedupeKey:`run-stale:${A.runId}`,dedupeMode:"replace"}),lf(A.runId)}}for(const x of Object.values(n.batches)){const N=MD(x.runIds,b);N.finished&&(en({title:"Run-all batch finished",detail:GR(N,x.skippedCount),tone:HR(N),dedupeKey:`batch:${x.batchId}`,dedupeMode:"replace",cta:{label:"View runs",intent:"go-to-runs"}}),ED(x.batchId))}c.current=S},[l.data,r.data,n,e]),null}function KR(){const e=go(),{dashboard:n,isLoading:i,refetch:r}=Ac(),d=kp(!e,e?.health).data??e?.health??$R,h=cv(),{runId:g,evidenceId:b,closeDrawer:S}=Ap(),[x,N]=q.useState(!1),[A,T]=q.useState(()=>{if(typeof window>"u")return null;try{return window.localStorage.getItem("canonry:dismissedUpdateVersion")}catch{return null}}),[k]=q.useState(()=>typeof window>"u"?null:new URLSearchParams(window.location.search).get("force-update")),E=k?{current:d.apiStatus.version??"0.0.0",latest:k,url:"https://www.npmjs.com/package/@ainyc/canonry",upgradeCommand:"npm install -g @ainyc/canonry"}:d.apiStatus.updateAvailable,R=E&&E.latest!==A,V=()=>{if(E){try{window.localStorage.setItem("canonry:dismissedUpdateVersion",E.latest)}catch{}T(E.latest)}},G=bR(g),Z=G.data??null,X=G.isLoading;q.useEffect(()=>{Z&&Z.status!=="running"&&Z.status!=="queued"&&r()},[Z?.status,r]),q.useEffect(()=>{N(!1)},[h.pathname]),q.useEffect(()=>{if(typeof window>"u"||!g&&!b)return;const oe=me=>{me.key==="Escape"&&S()};return window.addEventListener("keydown",oe),()=>{window.removeEventListener("keydown",oe)}},[g,b,S]);const J=n??e?.dashboard??null,O=h.pathname==="/setup"&&J!==null&&J.portfolioOverview.projects.length===0,M=g&&J?H3(J,g):void 0,le=q.useMemo(()=>h.pathname.match(/^\/projects\/([^/]+)/)?.[1]??null,[h.pathname]),Ae=q.useMemo(()=>!le||!J?null:J.projects.find(oe=>oe.project.id===le)?.project.name??null,[le,J]),{commandCenter:Ce}=hR(Ae),ve=q.useMemo(()=>{if(b)return K3(Ce,J,b)},[b,Ce,J]),tt=(()=>{const oe=h.pathname;if(oe==="/")return"Portfolio";if(oe==="/projects")return"Projects";if(oe==="/runs")return"Runs";if(oe==="/settings")return"Settings";if(oe==="/setup")return"Setup";if(oe==="/backlinks")return"Backlinks";if(oe==="/traffic"||oe.startsWith("/traffic/"))return"Server traffic";if(oe.startsWith("/projects/")){const $=oe.split("/").filter(Boolean)[1];if($&&J){const W=J.projects.find(fe=>fe.project.id===$);if(W)return W.project.name}return"Project"}return"Not found"})();return f.jsxs("div",{className:`app-shell ${O?"app-shell-focus":""}`,children:[f.jsx("a",{className:"skip-link",href:"#content",children:"Skip to content"}),!O&&f.jsxs("aside",{className:"sidebar","aria-label":"Primary navigation",children:[f.jsx("div",{className:"sidebar-brand",children:f.jsx(qb,{version:d.apiStatus.version,updateAvailable:R?E:null,onDismissUpdate:V})}),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(xA,{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(vA,{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(DA,{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(BA,{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(jA,{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(GA,{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(oe=>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+oe*15}%`}})]},oe))]}):J&&J.projects.length>0?f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"sidebar-section-title",children:"Projects"}),J.projects.map(oe=>{const me=oe.visibilitySummary.tone;return f.jsxs(rt,{to:"/projects/$projectId",params:{projectId:oe.project.id},className:"sidebar-project",activeProps:{className:"sidebar-project sidebar-project-active"},children:[f.jsx("span",{className:`sidebar-dot sidebar-dot-${me}`}),f.jsx("span",{children:oe.project.displayName||oe.project.name})]},oe.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(UA,{className:"sidebar-icon"}),f.jsx("span",{children:"Setup"})]})]})]}),f.jsx("div",{className:"sidebar-footer",children:Zb.map(({label:oe,href:me,Icon:$})=>f.jsx("a",{className:"sidebar-footer-icon",href:me,target:"_blank",rel:"noopener noreferrer",title:oe,"aria-label":oe,children:f.jsx($,{className:"size-4"})},me))})]}),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(qb,{compact:!0})}),f.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[f.jsx(rt,{to:"/",children:"Home"}),f.jsx(Zf,{className:"breadcrumb-sep size-3"}),f.jsx("span",{className:"breadcrumb-current",children:tt})]})]}),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:Is(d.apiStatus),children:["API ",d.apiStatus.state==="ok"?"ok":d.apiStatus.state]}),f.jsxs("span",{className:`health-pill health-pill-${d.workerStatus.state}`,title:Is(d.workerStatus),children:["Worker ",d.workerStatus.state==="ok"?"ok":d.workerStatus.state]})]}),f.jsxs(Ue,{className:"nav-toggle",variant:"secondary",size:"icon",type:"button","aria-expanded":x,"aria-controls":"mobile-nav",onClick:()=>N(oe=>!oe),children:[f.jsx(zA,{className:"size-4"}),f.jsx("span",{className:"sr-only",children:"Open navigation"})]})]})]}),f.jsxs("div",{id:"mobile-nav",className:`mobile-nav ${x?"mobile-nav-open":""}`,children:[f.jsxs(Ue,{className:"mobile-nav-close",variant:"ghost",size:"icon",type:"button",onClick:()=>N(!1),children:[f.jsx(Qs,{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(oe=>f.jsx(rt,{to:"/projects/$projectId",params:{projectId:oe.project.id},className:"mobile-nav-link",children:oe.project.name},oe.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(oe=>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"})]},oe))}),f.jsx("div",{className:"page-skeleton-grid",style:{gridTemplateColumns:"1fr 1fr"},children:[1,2].map(oe=>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(me=>f.jsx("div",{className:"skeleton-text-sm w-full"},me))})]},oe))})]}):f.jsx(uv,{})}),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:Zb.map(({label:oe,href:me,Icon:$})=>f.jsx("a",{href:me,target:"_blank",rel:"noopener noreferrer",title:oe,"aria-label":oe,className:"footer-icon",children:f.jsx($,{className:"size-3.5"})},me))})]})]}),M?f.jsxs(M3,{open:!0,title:M.summary,subtitle:`${M.projectName} · ${M.kindLabel}`,onClose:S,children:[f.jsxs("div",{className:"flex flex-wrap items-center gap-x-5 gap-y-1 text-sm",children:[f.jsx(jp,{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..."}):Z?.snapshots&&Z.snapshots.length>0?f.jsxs("div",{className:"space-y-2",children:[Z.snapshots.map(oe=>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:oe.query??"Unknown query"}),f.jsxs("div",{className:"flex items-center gap-1.5",children:[f.jsx(C3,{provider:oe.provider}),f.jsx(fS,{variant:oe.citationState===lc.cited?"success":"neutral",children:oe.citationState})]})]}),oe.model&&f.jsx("p",{className:"text-[11px] text-zinc-500 font-mono",children:oe.model}),oe.citedDomains.length>0&&f.jsxs("p",{className:"text-xs text-zinc-500 mt-1",children:[f.jsx("span",{className:"text-zinc-400",children:"Sources:"})," ",oe.citedDomains.join(", ")]}),oe.competitorOverlap.length>0&&f.jsxs("p",{className:"text-xs text-rose-400/80 mt-0.5",children:["Competitor cited: ",oe.competitorOverlap.join(", ")]}),oe.groundingSources&&oe.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:[oe.groundingSources.length," grounding source",oe.groundingSources.length!==1?"s":""]}),f.jsx("ul",{className:"mt-1 space-y-0.5",children:oe.groundingSources.map((me,$)=>{const W=Ef(me.uri),fe=me.title||me.uri;return f.jsx("li",{className:"text-xs text-zinc-500 truncate",children:W?f.jsx("a",{href:W,target:"_blank",rel:"noopener noreferrer",className:"hover:text-zinc-300",children:fe}):f.jsx("span",{children:fe})},$)})})]}),oe.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:oe.answerText})]})]},oe.id)),Z.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..."]})]}):Z&&Z.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..."]}):Z&&Z.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..."]}):Z&&Z.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:E4(Z.error)})]}):f.jsx("p",{className:"text-sm text-zinc-500",children:"No snapshot data available."})]})]}):null,ve?f.jsx(U3,{evidence:ve.evidence,project:ve.project,onClose:S}):null,f.jsx(QR,{}),f.jsx(xR,{}),f.jsx(UR,{})]})}class ZR extends q.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(Mv,{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(Ue,{variant:"secondary",size:"sm",onClick:this.handleReset,children:[f.jsx(Rv,{className:"size-3.5 mr-1.5"}),"Try again"]}),f.jsx(Ue,{variant:"secondary",size:"sm",onClick:()=>{const n=window.__CANONRY_CONFIG__?.basePath?.replace(/\/$/,"")??"";window.location.href=n||"/"},children:"Go home"})]})]})}):this.props.children}}const jn=q.forwardRef(({className:e,...n},i)=>f.jsx("div",{ref:i,className:Cn("rounded-xl border border-zinc-800 bg-zinc-950/75 shadow-[0_0_0_1px_rgba(255,255,255,0.01)]",e),...n}));jn.displayName="Card";const Of=q.forwardRef(({className:e,...n},i)=>f.jsx("div",{ref:i,className:Cn("flex flex-col gap-1.5 p-5",e),...n}));Of.displayName="CardHeader";const Df=q.forwardRef(({className:e,...n},i)=>f.jsx("h3",{ref:i,className:Cn("font-medium tracking-tight text-zinc-50",e),...n}));Df.displayName="CardTitle";const Rf=q.forwardRef(({className:e,...n},i)=>f.jsx("p",{ref:i,className:Cn("text-sm text-zinc-500",e),...n}));Rf.displayName="CardDescription";const Fl=q.forwardRef(({className:e,...n},i)=>f.jsx("div",{ref:i,className:Cn("p-5 pt-0",e),...n}));Fl.displayName="CardContent";function YR({points:e,tone:n}){const i=q.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,S=r-c*2,x=e.map((N,A)=>{const T=c+A/Math.max(e.length-1,1)*b,k=c+(1-(N-d)/g)*S;return`${T},${k}`}).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:S,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:x,vectorEffect:"non-scaling-stroke"})]})}function XR({project:e}){return f.jsxs(rt,{to:"/projects/$projectId",params:{projectId:e.project.id},className:"project-row cursor-pointer",children:[f.jsx("div",{className:"project-row-chart",children:f.jsx(YR,{points:e.trend,tone:K0(e.lastRun.status)})}),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:"Mentioned"}),f.jsx("p",{className:`metric-inline-value ${e.mentionTone==="caution"?"text-amber-400":""}`,children:e.mentionScore}),f.jsx("p",{className:"metric-inline-delta",children:e.mentionDelta}),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.jsx("span",{className:"project-row-link",children:f.jsx(Zf,{className:"h-4 w-4 text-zinc-500"})})]})}function JR(){const e=go(),{dashboard:n,isLoading:i}=Ac(),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(S=>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"})]},S))})]});const l=r.portfolioOverview,h=kp(!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=wD(l.systemHealth,h,r.settings),{openRun:b}=Ap();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(S=>f.jsx(XR,{project:S},S.project.id))}):f.jsxs(jn,{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(Ue,{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(S=>S.href?f.jsxs(rt,{to:S.href,className:`attention-item attention-item-${S.tone}`,children:[f.jsxs("div",{children:[f.jsx("p",{className:"attention-title",children:S.title}),f.jsx("p",{className:"attention-detail",children:S.detail})]}),S.actionLabel&&f.jsx("span",{className:"attention-action",children:S.actionLabel})]},S.id):f.jsxs("div",{className:`attention-item attention-item-static attention-item-${S.tone}`,children:[f.jsxs("div",{children:[f.jsx("p",{className:"attention-title",children:S.title}),f.jsx("p",{className:"attention-detail",children:S.detail})]}),S.actionLabel&&f.jsx("span",{className:"attention-action",children:S.actionLabel})]},S.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(S=>f.jsxs("button",{className:"compact-run",type:"button",onClick:()=>b(S.id),children:[f.jsxs("div",{children:[f.jsx("p",{className:"compact-run-title",children:S.projectName}),f.jsx("p",{className:"compact-run-detail",children:S.summary})]}),f.jsx(jp,{status:S.status})]},S.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(S=>f.jsxs(jn,{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:S.label}),f.jsx("h3",{children:S.detail})]}),f.jsx(Ln,{tone:S.tone,title:S.id==="api"?Is(h.apiStatus):S.id==="worker"?Is(h.workerStatus):void 0,children:S.label})]}),f.jsx("p",{className:"supporting-copy",children:S.meta})]},S.id))})]})]})}const Tp=Symbol.for("yaml.alias"),Mf=Symbol.for("yaml.document"),Za=Symbol.for("yaml.map"),AS=Symbol.for("yaml.pair"),Hn=Symbol.for("yaml.scalar"),Fs=Symbol.for("yaml.seq"),An=Symbol.for("yaml.node.type"),Oi=e=>!!e&&typeof e=="object"&&e[An]===Tp,_c=e=>!!e&&typeof e=="object"&&e[An]===Mf,yo=e=>!!e&&typeof e=="object"&&e[An]===Za,St=e=>!!e&&typeof e=="object"&&e[An]===AS,at=e=>!!e&&typeof e=="object"&&e[An]===Hn,bo=e=>!!e&&typeof e=="object"&&e[An]===Fs;function bt(e){if(e&&typeof e=="object")switch(e[An]){case Za:case Fs:return!0}return!1}function vt(e){if(e&&typeof e=="object")switch(e[An]){case Tp:case Za:case Hn:case Fs:return!0}return!1}const _S=e=>(at(e)||bt(e))&&!!e.anchor,ji=Symbol("break visit"),FR=Symbol("skip children"),ro=Symbol("remove node");function Ws(e,n){const i=WR(n);_c(e)?Os(null,e.contents,i,Object.freeze([e]))===ro&&(e.contents=null):Os(null,e,i,Object.freeze([]))}Ws.BREAK=ji;Ws.SKIP=FR;Ws.REMOVE=ro;function Os(e,n,i,r){const l=eM(e,n,i,r);if(vt(l)||St(l))return tM(e,r,l),Os(e,l,i,r);if(typeof l!="symbol"){if(bt(n)){r=Object.freeze(r.concat(n));for(let c=0;c<n.items.length;++c){const d=Os(c,n.items[c],i,r);if(typeof d=="number")c=d-1;else{if(d===ji)return ji;d===ro&&(n.items.splice(c,1),c-=1)}}}else if(St(n)){r=Object.freeze(r.concat(n));const c=Os("key",n.key,i,r);if(c===ji)return ji;c===ro&&(n.key=null);const d=Os("value",n.value,i,r);if(d===ji)return ji;d===ro&&(n.value=null)}}return l}function WR(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 eM(e,n,i,r){if(typeof i=="function")return i(e,n,r);if(yo(n))return i.Map?.(e,n,r);if(bo(n))return i.Seq?.(e,n,r);if(St(n))return i.Pair?.(e,n,r);if(at(n))return i.Scalar?.(e,n,r);if(Oi(n))return i.Alias?.(e,n,r)}function tM(e,n,i){const r=n[n.length-1];if(bt(r))r.items[e]=i;else if(St(r))e==="key"?r.key=i:r.value=i;else if(_c(r))r.contents=i;else{const l=Oi(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${l} parent`)}}const nM={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},aM=e=>e.replace(/[!,[\]{}]/g,n=>nM[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+aM(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&&vt(n.contents)){const c={};Ws(n.contents,(d,h)=>{vt(h)&&h.tag&&(c[h.tag]=!0)}),l=Object.keys(c)}else l=[];for(const[c,d]of r)c==="!!"&&d==="tag:yaml.org,2002:"||(!n||l.some(h=>h.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
|
|
63
|
+
`)}}}finally{c?.removeEventListener("abort",N);try{b.releaseLock()}catch{}}}function jS(e){return!e||e.role!=="assistant"?"":e.content.filter(n=>n.type==="text").map(n=>n.text).join("")}const CR=[{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?"}],zR=[{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"}],Hl=e=>`canonry:aero:provider:${e}`,Hb=e=>`canonry:aero:scope:${e}`;function TR({projectName:e}){const[n,i]=q.useState(!1),[r,l]=q.useState(!1),[c,d]=q.useState([]),[h,g]=q.useState(""),[b,S]=q.useState(!1),[x,N]=q.useState([]),[A,T]=q.useState(""),[k,E]=q.useState(null),[R,V]=q.useState(()=>typeof window>"u"?null:window.localStorage.getItem(Hl(e))??null),[G,Z]=q.useState(()=>typeof window>"u"?"read-only":window.localStorage.getItem(Hb(e))==="all"?"all":"read-only"),X=q.useRef(null),{ref:J}=NR([c,A,x]),O=q.useRef(null),[M,le]=q.useState(0),Ae=q.useMemo(()=>{const F=h.trimStart();if(!F.startsWith("/"))return[];if(/\s/.test(F))return[];const ue=F.toLowerCase();return zR.filter(ee=>ee.command.startsWith(ue)||ee.label.toLowerCase().includes(ue.slice(1)))},[h]);q.useEffect(()=>{le(F=>Ae.length===0?0:Math.min(F,Ae.length-1))},[Ae.length]);const Ce=dn({...wD({client:ie,path:{name:e}}),enabled:n,staleTime:6e4}),ve=q.useMemo(()=>{const F=Ce.data?.providers??[];if(R){const ee=F.find(de=>de.id===R&&de.configured);if(ee)return ee}const ue=Ce.data?.defaultProvider;return ue?F.find(ee=>ee.id===ue)??null:null},[R,Ce.data]);q.useEffect(()=>{if(!Ce.data||!R)return;Ce.data.providers.find(ue=>ue.id===R&&ue.configured)||(V(null),window.localStorage.removeItem(Hl(e)))},[Ce.data,R,e]);const tt=q.useCallback(F=>{V(F),!(typeof window>"u")&&(F?window.localStorage.setItem(Hl(e),F):window.localStorage.removeItem(Hl(e)))},[e]),oe=q.useCallback(()=>{Z(F=>{const ue=F==="all"?"read-only":"all";return typeof window<"u"&&window.localStorage.setItem(Hb(e),ue),ue})},[e]);q.useEffect(()=>{if(!n)return;const F=ue=>{ue.key==="Escape"&&(r?l(!1):i(!1))};return window.addEventListener("keydown",F),()=>window.removeEventListener("keydown",F)},[n,r]),q.useEffect(()=>{if(!n)return;let F=!1;E(null);const ue=()=>{F||b||Gb(e).then(ne=>{F||d(ne.messages)}).catch(ne=>{F||E(ne instanceof Error?ne.message:"Failed to load transcript")})};ue();const de=window.setInterval(ue,15e3);return()=>{F=!0,window.clearInterval(de)}},[n,e,b]),q.useEffect(()=>()=>{X.current?.abort()},[e]);async function me(F){const ue=F.trim();if(!ue||b)return;E(null),g(""),S(!0),T(""),N([]);const ee={role:"user",content:ue,timestamp:Date.now()};d(ne=>[...ne,ee]);const de=new AbortController;X.current=de;try{await _R({project:e,prompt:ue,provider:R??void 0,scope:G,signal:de.signal,onEvent:$});const ne=await Gb(e);d(ne.messages)}catch(ne){ne.name!=="AbortError"&&E(ne instanceof Error?ne.message:"Prompt failed")}finally{S(!1),T(""),X.current=null}}function $(F){switch(F.type){case"message_update":T(jS(F.message));break;case"message_end":F.message.role==="assistant"&&T("");break;case"tool_execution_start":N(ue=>[...ue,{id:F.toolCallId,name:F.toolName,args:F.args,startedAt:Date.now()}]);break;case"tool_execution_end":N(ue=>ue.map(ee=>ee.id===F.toolCallId?{...ee,endedAt:Date.now(),isError:F.isError,result:F.result}:ee));break;case"error":E(F.message);break}}async function W(){X.current?.abort();try{await AR(e),d([]),E(null)}catch(F){E(F instanceof Error?F.message:"Reset failed")}}const fe=c.length===0,je=n&&r?"pointer-events-auto fixed inset-0 z-40 flex items-stretch justify-center bg-zinc-950/70 p-4 sm:p-8 backdrop-blur-sm":"pointer-events-none fixed inset-x-0 bottom-0 z-40 flex justify-center p-3",se=r?"pointer-events-auto flex h-full w-full max-w-5xl flex-col overflow-hidden rounded-2xl border border-zinc-800/80 bg-zinc-950/95 shadow-2xl":"pointer-events-auto w-full max-w-3xl",Ze=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:F=>{r&&F.target===F.currentTarget&&l(!1)},children:f.jsx("div",{className:se,children:n?f.jsxs("div",{className:r?"flex h-full flex-col":"flex flex-col overflow-hidden rounded-2xl border border-zinc-800/80 bg-zinc-950/95 shadow-xl backdrop-blur",children:[f.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-zinc-800/70 px-4 py-2.5",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(Xy,{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(ER,{providers:Ce.data?.providers??[],active:ve,override:R,onPick:tt,disabled:b}),f.jsx("button",{type:"button",onClick:wn(W),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(Rv,{className:"h-3.5 w-3.5","aria-hidden":"true"})}),f.jsx("button",{type:"button",onClick:()=>l(F=>!F),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(OA,{className:"h-3.5 w-3.5","aria-hidden":"true"}):f.jsx(CA,{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(Qs,{className:"h-4 w-4","aria-hidden":"true"})})]})]}),f.jsxs("div",{ref:J,className:Ze,children:[k&&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:k}),fe&&!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:CR.map(F=>f.jsx("button",{type:"button",onClick:()=>{me(F.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:F.label},F.label))})]}),BR(c,e,R,G),x.length>0&&f.jsx("div",{className:"mt-3 space-y-1.5",children:x.map(F=>f.jsx(NS,{trail:F},F.id))}),b&&A&&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(kS,{content:A})]}),b&&!A&&x.every(F=>F.endedAt!==void 0)&&f.jsx($R,{})]}),f.jsx(OR,{projectName:e,activeProvider:ve,scope:G,onToggleScope:oe,disabled:b}),f.jsxs("div",{className:"relative",children:[Ae.length>0&&f.jsx(DR,{matches:Ae,selectedIndex:M,onHover:le,onPick:F=>{g(""),O.current?.focus(),F.action==="clear"?W():me(F.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:F=>{if(F.preventDefault(),Ae.length>0){const ue=Ae[M];g(""),ue.action==="clear"?W():me(ue.prompt);return}me(h)},children:[f.jsx("textarea",{ref:O,value:h,onChange:F=>g(F.target.value),onKeyDown:F=>{if(Ae.length>0){if(F.key==="ArrowDown"){F.preventDefault(),le(ue=>(ue+1)%Ae.length);return}if(F.key==="ArrowUp"){F.preventDefault(),le(ue=>(ue-1+Ae.length)%Ae.length);return}if(F.key==="Tab"){F.preventDefault();const ue=Ae[M];g(`${ue.command} `);return}if(F.key==="Escape"){F.preventDefault(),g("");return}}if(F.key==="Enter"&&!F.shiftKey)if(F.preventDefault(),Ae.length>0){const ue=Ae[M];g(""),ue.action==="clear"?W():me(ue.prompt)}else me(h)},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||!h.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(rA,{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(Xy,{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 ER({providers:e,active:n,override:i,onPick:r,disabled:l}){const[c,d]=q.useState(!1),h=q.useRef(null);if(q.useEffect(()=>{if(!c)return;const S=N=>{h.current?.contains(N.target)||d(!1)},x=N=>{N.key==="Escape"&&d(!1)};return window.addEventListener("mousedown",S),window.addEventListener("keydown",x),()=>{window.removeEventListener("mousedown",S),window.removeEventListener("keydown",x)}},[c]),e.length===0)return null;const g=n?.label.replace(/\s+\(.+\)$/,"")??"No provider",b=n?.defaultModel;return f.jsxs("div",{ref:h,className:"relative",children:[f.jsxs("button",{type:"button",onClick:()=>d(S=>!S),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(dA,{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(S=>{const x=n?.id===S.id,N=i===S.id;return f.jsx("li",{children:f.jsxs("button",{type:"button",role:"option","aria-selected":x,disabled:!S.configured,onClick:()=>{S.configured&&(r(N?null:S.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:x?f.jsx(Dv,{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:S.label}),N&&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"}),!S.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:S.defaultModel}),S.keySource==="env"&&f.jsx("span",{className:"mt-0.5 block text-[10px] text-zinc-600",children:"via env var"}),!S.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:RR(S.id)})]})]})]})},S.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 OR({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 DR({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 RR(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 MR(e,n){const i=e.timestamp??0;return`${e.role}:${i}:${n}`}function BR(e,n,i,r){const l=[];for(let c=0;c<e.length;c++){const d=e[c],h=MR(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(LR,{text:g,projectName:n,providerOverride:i,scope:r},h));continue}if(d.role==="assistant"){const g=new Map;let b=c+1;for(;b<e.length&&e[b].role==="toolResult";){const N=e[b];g.set(N.toolCallId,N),b++}const S=UR(d,g,d.timestamp??0),x=jS(d);l.push(f.jsxs(q.Fragment,{children:[S.length>0&&f.jsx("div",{className:"mt-3 space-y-1.5",children:S.map(N=>f.jsx(NS,{trail:N},N.id))}),x.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(kS,{content:x})]})]},h)),c=b-1;continue}}return l}function LR({text:e,projectName:n,providerOverride:i,scope:r}){const[l,c]=q.useState(!1),d=q.useMemo(()=>qR(n,e,i,r),[n,e,i,r]);async function h(){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:wn(h),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(Dv,{className:"h-2.5 w-2.5 text-emerald-400","aria-hidden":"true"}),"Copied"]}):f.jsxs(f.Fragment,{children:[f.jsx(mA,{className:"h-2.5 w-2.5","aria-hidden":"true"}),"Copy as CLI"]})})]}),f.jsx("div",{className:"whitespace-pre-wrap",children:e})]})}function qR(e,n,i,r){const l=["canonry","agent","ask",Qb(e),Qb(n)];return i&&l.push("--provider",i),r==="read-only"&&l.push("--scope","read-only"),l.join(" ")}function Qb(e){return`'${e.replace(/'/g,"'\\''")}'`}function UR(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 NS({trail:e}){const[n,i]=q.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`,h=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 ${h} ${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(AA,{className:"h-3 w-3 animate-spin text-emerald-400","aria-hidden":"true"}):l?f.jsx(Mv,{className:"h-3 w-3 text-rose-400","aria-hidden":"true"}):f.jsx(ZA,{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(Zf,{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:Kb(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:Kb(e.result)})]})]})]})}function Kb(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 kS({content:e}){return f.jsx("div",{className:"aero-markdown text-zinc-100",children:f.jsx(Bw,{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 $R(){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 IR(){const e=cv(),n=/^\/projects\/([^/]+)/.exec(e.pathname),i=n?decodeURIComponent(n[1]):null,r=dn({...bp({client:ie}),enabled:i!==null,staleTime:6e4});if(!i)return null;const l=r.data??[],c=l.find(d=>d.id===i)??l.find(d=>d.name===i);return c?f.jsx(TR,{projectName:c.name},c.name):null}function wi(e,n){e.invalidateQueries({predicate:i=>{const r=i.queryKey[0];return typeof r?._id=="string"&&r._id.startsWith(n)}})}function fo(e,n,i){switch(e.invalidateQueries({queryKey:vp({client:ie})}),e.invalidateQueries({queryKey:Js({client:ie})}),n){case ke["answer-visibility"]:case ke["site-audit"]:case ke["backlink-extract"]:return;case ke["gsc-sync"]:case ke["inspect-sitemap"]:wi(e,"getApiV1ProjectsByNameGoogleGsc");return;case ke["ga-sync"]:wi(e,"getApiV1ProjectsByNameGa");return;case ke["traffic-sync"]:wi(e,"getApiV1ProjectsByNameGa"),wi(e,"getApiV1ProjectsByNameTraffic");return;case ke["bing-inspect"]:case ke["bing-inspect-sitemap"]:wi(e,"getApiV1ProjectsByNameBing");return;case ke["aeo-discover-seed"]:case ke["aeo-discover-probe"]:return;case ke["gbp-sync"]:wi(e,"getApiV1ProjectsByNameGbp");return;case ke["ads-sync"]:wi(e,"getApiV1ProjectsByNameAds");return;default:return n}}const Zb=[{label:"GitHub",href:"https://github.com/AINYC/canonry",Icon:bA},{label:"Docs",href:"https://github.com/AINYC/canonry/tree/main/docs",Icon:lA},{label:"Changelog",href:"https://github.com/AINYC/canonry/releases",Icon:gA}],Yb=e=>({label:e,state:"checking",detail:"Checking service health"}),VR={apiStatus:Yb("API"),workerStatus:Yb("Worker")};function AS(e){switch(e){case ke["answer-visibility"]:return"Visibility sweep";case ke["gsc-sync"]:return"GSC sync";case ke["inspect-sitemap"]:return"Sitemap inspection";case ke["ga-sync"]:return"GA sync";case ke["traffic-sync"]:return"Traffic sync";case ke["bing-inspect"]:return"Bing URL inspection";case ke["bing-inspect-sitemap"]:return"Bing sitemap inspection";case ke["site-audit"]:return"Site audit";case ke["backlink-extract"]:return"Backlink extract";case ke["aeo-discover-seed"]:return"Discovery (seed phase)";case ke["aeo-discover-probe"]:return"Discovery (probe phase)";case ke["gbp-sync"]:return"Business Profile sync";case ke["ads-sync"]:return"ChatGPT ads sync"}}function PR(e){return e==="completed"?"positive":e==="partial"?"caution":"negative"}function GR(e){const n=AS(e.kind);return e.status==="completed"?`${n} completed`:e.status==="partial"?`${n} completed with partial results`:e.status==="cancelled"?`${n} cancelled`:`${n} failed`}function HR(e,n){return e.error?`${n}: ${ap(e.error)}`:e.location?`${n} · ${e.location}`:n}function Xb(e,n,i){if(n)return n;const r=i.find(l=>l.id===e);return r?.displayName||r?.name||e}function QR(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 KR(e){return e.failed>0||e.cancelled>0?"negative":e.partial>0?"caution":"positive"}function ZR(){const e=Ja(),n=q.useSyncExternalStore(ED,_i,_i),i=Object.keys(n.runs).length>0||Object.keys(n.batches).length>0,r=dn({...Sp({client:ie}),enabled:i,staleTime:lo,refetchInterval:3e3}),l=dn({...bp({client:ie}),enabled:i}),c=q.useRef({}),d=q.useCallback(()=>{r.refetch()},[r.refetch]);return q.useEffect(()=>{i&&d()},[i,d]),q.useEffect(()=>{if(!i||typeof window>"u")return;const h=()=>{document.visibilityState==="visible"&&d()};return window.addEventListener("focus",d),document.addEventListener("visibilitychange",h),()=>{window.removeEventListener("focus",d),document.removeEventListener("visibilitychange",h)}},[i,d]),q.useEffect(()=>{const h=r.data??[],g=l.data??[],b=Object.fromEntries(h.map(x=>[x.id,x])),S=Object.fromEntries(h.map(x=>[x.id,x.status]));for(const x of Object.values(n.runs)){const N=b[x.runId];if(!N||!RD(N.status)||(c.current[N.id]??x.lastAnnouncedStatus)===N.status)continue;const T=g.find(E=>E.id===N.projectId);if(T&&fo(e,N.kind,T.name),x.sourceAction==="run-all"){lf(N.id);continue}const k=Xb(N.projectId,x.projectLabel,g);en({title:GR(N),detail:HR(N,k),tone:PR(N.status),dedupeKey:`run:${N.id}`,dedupeMode:"replace",cta:{label:"View run",intent:"open-run-drawer",runId:N.id}}),lf(N.id)}if(r.data!==void 0){const x=new Set(h.map(A=>A.id)),N=BD(Object.values(n.runs),x,Date.now(),MD);for(const A of N){const T=g.find(k=>k.id===A.projectId);T&&fo(e,A.kind,T.name),A.sourceAction!=="run-all"&&en({title:`${AS(A.kind)} status unavailable`,detail:Xb(A.projectId,A.projectLabel,g),tone:"neutral",dedupeKey:`run-stale:${A.runId}`,dedupeMode:"replace"}),lf(A.runId)}}for(const x of Object.values(n.batches)){const N=LD(x.runIds,b);N.finished&&(en({title:"Run-all batch finished",detail:QR(N,x.skippedCount),tone:KR(N),dedupeKey:`batch:${x.batchId}`,dedupeMode:"replace",cta:{label:"View runs",intent:"go-to-runs"}}),DD(x.batchId))}c.current=S},[l.data,r.data,n,e]),null}function YR(){const e=go(),{dashboard:n,isLoading:i,refetch:r}=Ac(),d=kp(!e,e?.health).data??e?.health??VR,h=cv(),{runId:g,evidenceId:b,closeDrawer:S}=Ap(),[x,N]=q.useState(!1),[A,T]=q.useState(()=>{if(typeof window>"u")return null;try{return window.localStorage.getItem("canonry:dismissedUpdateVersion")}catch{return null}}),[k]=q.useState(()=>typeof window>"u"?null:new URLSearchParams(window.location.search).get("force-update")),E=k?{current:d.apiStatus.version??"0.0.0",latest:k,url:"https://www.npmjs.com/package/@ainyc/canonry",upgradeCommand:"npm install -g @ainyc/canonry"}:d.apiStatus.updateAvailable,R=E&&E.latest!==A,V=()=>{if(E){try{window.localStorage.setItem("canonry:dismissedUpdateVersion",E.latest)}catch{}T(E.latest)}},G=SR(g),Z=G.data??null,X=G.isLoading;q.useEffect(()=>{Z&&Z.status!=="running"&&Z.status!=="queued"&&r()},[Z?.status,r]),q.useEffect(()=>{N(!1)},[h.pathname]),q.useEffect(()=>{if(typeof window>"u"||!g&&!b)return;const oe=me=>{me.key==="Escape"&&S()};return window.addEventListener("keydown",oe),()=>{window.removeEventListener("keydown",oe)}},[g,b,S]);const J=n??e?.dashboard??null,O=h.pathname==="/setup"&&J!==null&&J.portfolioOverview.projects.length===0,M=g&&J?K3(J,g):void 0,le=q.useMemo(()=>h.pathname.match(/^\/projects\/([^/]+)/)?.[1]??null,[h.pathname]),Ae=q.useMemo(()=>!le||!J?null:J.projects.find(oe=>oe.project.id===le)?.project.name??null,[le,J]),{commandCenter:Ce}=yR(Ae),ve=q.useMemo(()=>{if(b)return Y3(Ce,J,b)},[b,Ce,J]),tt=(()=>{const oe=h.pathname;if(oe==="/")return"Portfolio";if(oe==="/projects")return"Projects";if(oe==="/runs")return"Runs";if(oe==="/settings")return"Settings";if(oe==="/setup")return"Setup";if(oe==="/backlinks")return"Backlinks";if(oe==="/traffic"||oe.startsWith("/traffic/"))return"Server traffic";if(oe.startsWith("/projects/")){const $=oe.split("/").filter(Boolean)[1];if($&&J){const W=J.projects.find(fe=>fe.project.id===$);if(W)return W.project.name}return"Project"}return"Not found"})();return f.jsxs("div",{className:`app-shell ${O?"app-shell-focus":""}`,children:[f.jsx("a",{className:"skip-link",href:"#content",children:"Skip to content"}),!O&&f.jsxs("aside",{className:"sidebar","aria-label":"Primary navigation",children:[f.jsx("div",{className:"sidebar-brand",children:f.jsx(qb,{version:d.apiStatus.version,updateAvailable:R?E:null,onDismissUpdate:V})}),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(wA,{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(SA,{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(RA,{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(LA,{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(NA,{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(HA,{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(oe=>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+oe*15}%`}})]},oe))]}):J&&J.projects.length>0?f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"sidebar-section-title",children:"Projects"}),J.projects.map(oe=>{const me=oe.visibilitySummary.tone;return f.jsxs(rt,{to:"/projects/$projectId",params:{projectId:oe.project.id},className:"sidebar-project",activeProps:{className:"sidebar-project sidebar-project-active"},children:[f.jsx("span",{className:`sidebar-dot sidebar-dot-${me}`}),f.jsx("span",{children:oe.project.displayName||oe.project.name})]},oe.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($A,{className:"sidebar-icon"}),f.jsx("span",{children:"Setup"})]})]})]}),f.jsx("div",{className:"sidebar-footer",children:Zb.map(({label:oe,href:me,Icon:$})=>f.jsx("a",{className:"sidebar-footer-icon",href:me,target:"_blank",rel:"noopener noreferrer",title:oe,"aria-label":oe,children:f.jsx($,{className:"size-4"})},me))})]}),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(qb,{compact:!0})}),f.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[f.jsx(rt,{to:"/",children:"Home"}),f.jsx(Zf,{className:"breadcrumb-sep size-3"}),f.jsx("span",{className:"breadcrumb-current",children:tt})]})]}),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:Is(d.apiStatus),children:["API ",d.apiStatus.state==="ok"?"ok":d.apiStatus.state]}),f.jsxs("span",{className:`health-pill health-pill-${d.workerStatus.state}`,title:Is(d.workerStatus),children:["Worker ",d.workerStatus.state==="ok"?"ok":d.workerStatus.state]})]}),f.jsxs(Ue,{className:"nav-toggle",variant:"secondary",size:"icon",type:"button","aria-expanded":x,"aria-controls":"mobile-nav",onClick:()=>N(oe=>!oe),children:[f.jsx(TA,{className:"size-4"}),f.jsx("span",{className:"sr-only",children:"Open navigation"})]})]})]}),f.jsxs("div",{id:"mobile-nav",className:`mobile-nav ${x?"mobile-nav-open":""}`,children:[f.jsxs(Ue,{className:"mobile-nav-close",variant:"ghost",size:"icon",type:"button",onClick:()=>N(!1),children:[f.jsx(Qs,{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(oe=>f.jsx(rt,{to:"/projects/$projectId",params:{projectId:oe.project.id},className:"mobile-nav-link",children:oe.project.name},oe.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(oe=>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"})]},oe))}),f.jsx("div",{className:"page-skeleton-grid",style:{gridTemplateColumns:"1fr 1fr"},children:[1,2].map(oe=>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(me=>f.jsx("div",{className:"skeleton-text-sm w-full"},me))})]},oe))})]}):f.jsx(uv,{})}),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:Zb.map(({label:oe,href:me,Icon:$})=>f.jsx("a",{href:me,target:"_blank",rel:"noopener noreferrer",title:oe,"aria-label":oe,className:"footer-icon",children:f.jsx($,{className:"size-3.5"})},me))})]})]}),M?f.jsxs(L3,{open:!0,title:M.summary,subtitle:`${M.projectName} · ${M.kindLabel}`,onClose:S,children:[f.jsxs("div",{className:"flex flex-wrap items-center gap-x-5 gap-y-1 text-sm",children:[f.jsx(jp,{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..."}):Z?.snapshots&&Z.snapshots.length>0?f.jsxs("div",{className:"space-y-2",children:[Z.snapshots.map(oe=>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:oe.query??"Unknown query"}),f.jsxs("div",{className:"flex items-center gap-1.5",children:[f.jsx(T3,{provider:oe.provider}),f.jsx(pS,{variant:oe.citationState===lc.cited?"success":"neutral",children:oe.citationState})]})]}),oe.model&&f.jsx("p",{className:"text-[11px] text-zinc-500 font-mono",children:oe.model}),oe.citedDomains.length>0&&f.jsxs("p",{className:"text-xs text-zinc-500 mt-1",children:[f.jsx("span",{className:"text-zinc-400",children:"Sources:"})," ",oe.citedDomains.join(", ")]}),oe.competitorOverlap.length>0&&f.jsxs("p",{className:"text-xs text-rose-400/80 mt-0.5",children:["Competitor cited: ",oe.competitorOverlap.join(", ")]}),oe.groundingSources&&oe.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:[oe.groundingSources.length," grounding source",oe.groundingSources.length!==1?"s":""]}),f.jsx("ul",{className:"mt-1 space-y-0.5",children:oe.groundingSources.map((me,$)=>{const W=Ef(me.uri),fe=me.title||me.uri;return f.jsx("li",{className:"text-xs text-zinc-500 truncate",children:W?f.jsx("a",{href:W,target:"_blank",rel:"noopener noreferrer",className:"hover:text-zinc-300",children:fe}):f.jsx("span",{children:fe})},$)})})]}),oe.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:oe.answerText})]})]},oe.id)),Z.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..."]})]}):Z&&Z.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..."]}):Z&&Z.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..."]}):Z&&Z.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:D4(Z.error)})]}):f.jsx("p",{className:"text-sm text-zinc-500",children:"No snapshot data available."})]})]}):null,ve?f.jsx(I3,{evidence:ve.evidence,project:ve.project,onClose:S}):null,f.jsx(ZR,{}),f.jsx(jR,{}),f.jsx(IR,{})]})}class XR extends q.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(Mv,{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(Ue,{variant:"secondary",size:"sm",onClick:this.handleReset,children:[f.jsx(Rv,{className:"size-3.5 mr-1.5"}),"Try again"]}),f.jsx(Ue,{variant:"secondary",size:"sm",onClick:()=>{const n=window.__CANONRY_CONFIG__?.basePath?.replace(/\/$/,"")??"";window.location.href=n||"/"},children:"Go home"})]})]})}):this.props.children}}const jn=q.forwardRef(({className:e,...n},i)=>f.jsx("div",{ref:i,className:Cn("rounded-xl border border-zinc-800 bg-zinc-950/75 shadow-[0_0_0_1px_rgba(255,255,255,0.01)]",e),...n}));jn.displayName="Card";const Of=q.forwardRef(({className:e,...n},i)=>f.jsx("div",{ref:i,className:Cn("flex flex-col gap-1.5 p-5",e),...n}));Of.displayName="CardHeader";const Df=q.forwardRef(({className:e,...n},i)=>f.jsx("h3",{ref:i,className:Cn("font-medium tracking-tight text-zinc-50",e),...n}));Df.displayName="CardTitle";const Rf=q.forwardRef(({className:e,...n},i)=>f.jsx("p",{ref:i,className:Cn("text-sm text-zinc-500",e),...n}));Rf.displayName="CardDescription";const Fl=q.forwardRef(({className:e,...n},i)=>f.jsx("div",{ref:i,className:Cn("p-5 pt-0",e),...n}));Fl.displayName="CardContent";function JR({points:e,tone:n}){const i=q.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,S=r-c*2,x=e.map((N,A)=>{const T=c+A/Math.max(e.length-1,1)*b,k=c+(1-(N-d)/g)*S;return`${T},${k}`}).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:S,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:x,vectorEffect:"non-scaling-stroke"})]})}function FR({project:e}){return f.jsxs(rt,{to:"/projects/$projectId",params:{projectId:e.project.id},className:"project-row cursor-pointer",children:[f.jsx("div",{className:"project-row-chart",children:f.jsx(JR,{points:e.trend,tone:Z0(e.lastRun.status)})}),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:"Mentioned"}),f.jsx("p",{className:`metric-inline-value ${e.mentionTone==="caution"?"text-amber-400":""}`,children:e.mentionScore}),f.jsx("p",{className:"metric-inline-delta",children:e.mentionDelta}),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.jsx("span",{className:"project-row-link",children:f.jsx(Zf,{className:"h-4 w-4 text-zinc-500"})})]})}function WR(){const e=go(),{dashboard:n,isLoading:i}=Ac(),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(S=>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"})]},S))})]});const l=r.portfolioOverview,h=kp(!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=ND(l.systemHealth,h,r.settings),{openRun:b}=Ap();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(S=>f.jsx(FR,{project:S},S.project.id))}):f.jsxs(jn,{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(Ue,{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(S=>S.href?f.jsxs(rt,{to:S.href,className:`attention-item attention-item-${S.tone}`,children:[f.jsxs("div",{children:[f.jsx("p",{className:"attention-title",children:S.title}),f.jsx("p",{className:"attention-detail",children:S.detail})]}),S.actionLabel&&f.jsx("span",{className:"attention-action",children:S.actionLabel})]},S.id):f.jsxs("div",{className:`attention-item attention-item-static attention-item-${S.tone}`,children:[f.jsxs("div",{children:[f.jsx("p",{className:"attention-title",children:S.title}),f.jsx("p",{className:"attention-detail",children:S.detail})]}),S.actionLabel&&f.jsx("span",{className:"attention-action",children:S.actionLabel})]},S.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(S=>f.jsxs("button",{className:"compact-run",type:"button",onClick:()=>b(S.id),children:[f.jsxs("div",{children:[f.jsx("p",{className:"compact-run-title",children:S.projectName}),f.jsx("p",{className:"compact-run-detail",children:S.summary})]}),f.jsx(jp,{status:S.status})]},S.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(S=>f.jsxs(jn,{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:S.label}),f.jsx("h3",{children:S.detail})]}),f.jsx(Ln,{tone:S.tone,title:S.id==="api"?Is(h.apiStatus):S.id==="worker"?Is(h.workerStatus):void 0,children:S.label})]}),f.jsx("p",{className:"supporting-copy",children:S.meta})]},S.id))})]})]})}const Tp=Symbol.for("yaml.alias"),Mf=Symbol.for("yaml.document"),Za=Symbol.for("yaml.map"),_S=Symbol.for("yaml.pair"),Hn=Symbol.for("yaml.scalar"),Fs=Symbol.for("yaml.seq"),An=Symbol.for("yaml.node.type"),Oi=e=>!!e&&typeof e=="object"&&e[An]===Tp,_c=e=>!!e&&typeof e=="object"&&e[An]===Mf,yo=e=>!!e&&typeof e=="object"&&e[An]===Za,St=e=>!!e&&typeof e=="object"&&e[An]===_S,at=e=>!!e&&typeof e=="object"&&e[An]===Hn,bo=e=>!!e&&typeof e=="object"&&e[An]===Fs;function bt(e){if(e&&typeof e=="object")switch(e[An]){case Za:case Fs:return!0}return!1}function vt(e){if(e&&typeof e=="object")switch(e[An]){case Tp:case Za:case Hn:case Fs:return!0}return!1}const CS=e=>(at(e)||bt(e))&&!!e.anchor,ji=Symbol("break visit"),eM=Symbol("skip children"),ro=Symbol("remove node");function Ws(e,n){const i=tM(n);_c(e)?Os(null,e.contents,i,Object.freeze([e]))===ro&&(e.contents=null):Os(null,e,i,Object.freeze([]))}Ws.BREAK=ji;Ws.SKIP=eM;Ws.REMOVE=ro;function Os(e,n,i,r){const l=nM(e,n,i,r);if(vt(l)||St(l))return aM(e,r,l),Os(e,l,i,r);if(typeof l!="symbol"){if(bt(n)){r=Object.freeze(r.concat(n));for(let c=0;c<n.items.length;++c){const d=Os(c,n.items[c],i,r);if(typeof d=="number")c=d-1;else{if(d===ji)return ji;d===ro&&(n.items.splice(c,1),c-=1)}}}else if(St(n)){r=Object.freeze(r.concat(n));const c=Os("key",n.key,i,r);if(c===ji)return ji;c===ro&&(n.key=null);const d=Os("value",n.value,i,r);if(d===ji)return ji;d===ro&&(n.value=null)}}return l}function tM(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 nM(e,n,i,r){if(typeof i=="function")return i(e,n,r);if(yo(n))return i.Map?.(e,n,r);if(bo(n))return i.Seq?.(e,n,r);if(St(n))return i.Pair?.(e,n,r);if(at(n))return i.Scalar?.(e,n,r);if(Oi(n))return i.Alias?.(e,n,r)}function aM(e,n,i){const r=n[n.length-1];if(bt(r))r.items[e]=i;else if(St(r))e==="key"?r.key=i:r.value=i;else if(_c(r))r.contents=i;else{const l=Oi(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${l} parent`)}}const iM={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},sM=e=>e.replace(/[!,[\]{}]/g,n=>iM[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+sM(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&&vt(n.contents)){const c={};Ws(n.contents,(d,h)=>{vt(h)&&h.tag&&(c[h.tag]=!0)}),l=Object.keys(c)}else l=[];for(const[c,d]of r)c==="!!"&&d==="tag:yaml.org,2002:"||(!n||l.some(h=>h.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 zS(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 TS(e){const n=new Set;return Ws(e,{Value(i,r){r.anchor&&n.add(r.anchor)}}),n}function ES(e,n){for(let i=1;;++i){const r=`${e}${i}`;if(!n.has(r))return r}}function rM(e,n){const i=[],r=new Map;let l=null;return{onAnchor:c=>{i.push(c),l??(l=TS(e));const d=ES(n,l);return l.add(d),d},setAnchors:()=>{for(const c of i){const d=r.get(c);if(typeof d=="object"&&d.anchor&&(at(d.node)||bt(d.node)))d.node.anchor=d.anchor;else{const h=new Error("Failed to resolve repeated object (this should not happen)");throw h.source=c,h}}},sourceObjects:r}}function Ds(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],h=Ds(e,r,String(l),d);h===void 0?delete r[l]:h!==d&&(r[l]=h)}else if(r instanceof Map)for(const l of Array.from(r.keys())){const c=r.get(l),d=Ds(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=Ds(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=Ds(e,r,l,c);d===void 0?delete r[l]:d!==c&&(r[l]=d)}return e.call(n,i,r)}function kn(e,n,i){if(Array.isArray(e))return e.map((r,l)=>kn(r,String(l),i));if(e&&typeof e.toJSON=="function"){if(!i||!CS(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 Ep{constructor(n){Object.defineProperty(this,An,{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(!_c(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},h=kn(this,"",d);if(typeof l=="function")for(const{count:g,res:b}of d.anchors.values())l(b,g);return typeof c=="function"?Ds(c,{"":h},"",h):h}}class Op extends Ep{constructor(n){super(Tp),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=[],Ws(n,{Node:(c,d)=>{(Oi(d)||CS(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 h=r.get(d);if(h||(kn(d,null,i),h=r.get(d)),h?.res===void 0){const g="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(g)}if(c>=0&&(h.count+=1,h.aliasCount===0&&(h.aliasCount=Wl(l,d,r)),h.count*h.aliasCount>c)){const g="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(g)}return h.res}toString(n,i,r){const l=`*${this.source}`;if(n){if(zS(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 Wl(e,n,i){if(Oi(n)){const r=n.resolve(e),l=i&&r&&i.get(r);return l?l.count*l.aliasCount:0}else if(bt(n)){let r=0;for(const l of n.items){const c=Wl(e,l,i);c>r&&(r=c)}return r}else if(St(n)){const r=Wl(e,n.key,i),l=Wl(e,n.value,i);return Math.max(r,l)}return 1}const OS=e=>!e||typeof e!="function"&&typeof e!="object";class _e extends Ep{constructor(n){super(Hn),this.value=n}toJSON(n,i){return i?.keep?this.value:kn(this.value,n,i)}toString(){return String(this.value)}}_e.BLOCK_FOLDED="BLOCK_FOLDED";_e.BLOCK_LITERAL="BLOCK_LITERAL";_e.PLAIN="PLAIN";_e.QUOTE_DOUBLE="QUOTE_DOUBLE";_e.QUOTE_SINGLE="QUOTE_SINGLE";const oM="tag:yaml.org,2002:";function lM(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 po(e,n,i){if(_c(e)&&(e=e.contents),vt(e))return e;if(St(e)){const x=i.schema[Za].createNode?.(i.schema,null,i);return x.items.push(e),x}(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:h}=i;let g;if(r&&e&&typeof e=="object"){if(g=h.get(e),g)return g.anchor??(g.anchor=l(e)),new Op(g.anchor);g={anchor:null,node:null},h.set(e,g)}n?.startsWith("!!")&&(n=oM+n.slice(2));let b=lM(e,n,d.tags);if(!b){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const x=new _e(e);return g&&(g.node=x),x}b=e instanceof Map?d[Za]:Symbol.iterator in Object(e)?d[Fs]:d[Za]}c&&(c(b),delete i.onTagObj);const S=b?.createNode?b.createNode(i.schema,e,i):typeof b?.nodeClass?.from=="function"?b.nodeClass.from(i.schema,e,i):new _e(e);return n?S.tag=n:b.default||(S.tag=b.tag),g&&(g.node=S),S}function pc(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 po(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 so=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class DS extends Ep{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=>vt(r)||St(r)?r.clone(n):r),this.range&&(i.range=this.range.slice()),i}addIn(n,i){if(so(n))this.add(i);else{const[r,...l]=n,c=this.get(r,!0);if(bt(c))c.addIn(l,i);else if(c===void 0&&this.schema)this.set(r,pc(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(bt(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&&at(c)?c.value:c:bt(c)?c.getIn(l,i):void 0}hasAllNullValues(n){return this.items.every(i=>{if(!St(i))return!1;const r=i.value;return r==null||n&&at(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 bt(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(bt(c))c.setIn(l,i);else if(c===void 0&&this.schema)this.set(r,pc(this.schema,l,i));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${l}`)}}}const cM=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function ma(e,n){return/^\n+$/.test(e)?e.substring(1):n?e.replace(/^(?! *$)/gm,n):e}const Ni=(e,n,i)=>e.endsWith(`
|
|
66
66
|
`)?ma(i,n):i.includes(`
|
|
67
67
|
`)?`
|
|
68
|
-
`+ma(i,n):(e.endsWith(" ")?"":" ")+i,
|
|
68
|
+
`+ma(i,n):(e.endsWith(" ")?"":" ")+i,RS="flow",Bf="block",ec="quoted";function Cc(e,n,i="flow",{indentAtStart:r,lineWidth:l=80,minContentWidth:c=20,onFold:d,onOverflow:h}={}){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=[],S={};let x=l-n.length;typeof r=="number"&&(r>l-Math.max(2,c)?b.push(0):x=l-r);let N,A,T=!1,k=-1,E=-1,R=-1;i===Bf&&(k=Jb(e,k,n.length),k!==-1&&(x=k+g));for(let G;G=e[k+=1];){if(i===ec&&G==="\\"){switch(E=k,e[k+1]){case"x":k+=3;break;case"u":k+=5;break;case"U":k+=9;break;default:k+=1}R=k}if(G===`
|
|
69
69
|
`)i===Bf&&(k=Jb(e,k,n.length)),x=k+n.length+g,N=void 0;else{if(G===" "&&A&&A!==" "&&A!==`
|
|
70
70
|
`&&A!==" "){const Z=e[k+1];Z&&Z!==" "&&Z!==`
|
|
71
71
|
`&&Z!==" "&&(N=k)}if(k>=x)if(N)b.push(N),x=N+g,N=void 0;else if(i===ec){for(;A===" "||A===" ";)A=G,G=e[k+=1],T=!0;const Z=k>R+1?k-2:E-1;if(S[Z])return e;b.push(Z),S[Z]=!0,x=Z+g,N=void 0}else T=!0}A=G}if(T&&h&&h(),b.length===0)return e;d&&d();let V=e.slice(0,b[0]);for(let G=0;G<b.length;++G){const Z=b[G],X=b[G+1]||e.length;Z===0?V=`
|
|
72
72
|
${n}${e.slice(0,X)}`:(i===ec&&S[Z]&&(V+=`${e[Z]}\\`),V+=`
|
|
73
73
|
${n}${e.slice(Z+1,X)}`)}return V}function Jb(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 zc=(e,n)=>({indentAtStart:n?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),Tc=e=>/^(%|---|\.\.\.)/m.test(e);function
|
|
74
|
+
`);r=n,l=n+1,c=e[l]}return r}const zc=(e,n)=>({indentAtStart:n?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),Tc=e=>/^(%|---|\.\.\.)/m.test(e);function uM(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
75
|
`){if(c-d>r)return!0;if(d=c+1,l-d<=r)return!1}return!0}function oo(e,n){const i=JSON.stringify(e);if(n.options.doubleQuotedAsJSON)return i;const{implicitKey:r}=n,l=n.options.doubleQuotedMinMultiLineLength,c=n.indent||(Tc(e)?" ":"");let d="",h=0;for(let g=0,b=i[g];b;b=i[++g])if(b===" "&&i[g+1]==="\\"&&i[g+2]==="n"&&(d+=i.slice(h,g)+"\\ ",g+=1,h=g,b="\\"),b==="\\")switch(i[g+1]){case"u":{d+=i.slice(h,g);const S=i.substr(g+2,4);switch(S){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:S.substr(0,2)==="00"?d+="\\x"+S.substr(2):d+=i.substr(g,6)}g+=5,h=g+1}break;case"n":if(r||i[g+2]==='"'||i.length<l)g+=1;else{for(d+=i.slice(h,g)+`
|
|
76
76
|
|
|
77
77
|
`;i[g+2]==="\\"&&i[g+3]==="n"&&i[g+4]!=='"';)d+=`
|
|
78
78
|
`,g+=2;d+=c,i[g+2]===" "&&(d+="\\"),g+=1,h=g+1}break;default:g+=1}return d=h?d+i.slice(h):i,r?d:Cc(d,c,ec,zc(n,!1))}function Lf(e,n){if(n.options.singleQuote===!1||n.implicitKey&&e.includes(`
|
|
79
79
|
`)||/[ \t]\n|\n[ \t]/.test(e))return oo(e,n);const i=n.indent||(Tc(e)?" ":""),r="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
80
|
-
${i}`)+"'";return n.implicitKey?r:Cc(r,i,
|
|
80
|
+
${i}`)+"'";return n.implicitKey?r:Cc(r,i,RS,zc(n,!1))}function Rs(e,n){const{singleQuote:i}=n.options;let r;if(i===!1)r=oo;else{const l=e.includes('"'),c=e.includes("'");l&&!c?r=Lf:c&&!l?r=oo:r=i?Lf:oo}return r(e,n)}let qf;try{qf=new RegExp(`(^|(?<!
|
|
81
81
|
))
|
|
82
82
|
+(?!
|
|
83
|
-
|$)`,"g")}catch{qf=/\n+(?!\n|$)/g}function tc({comment:e,type:n,value:i},r,l,c){const{blockQuote:d,commentString:h,lineWidth:g}=r.options;if(!d||/\n[\t ]+$/.test(i))return Rs(i,r);const b=r.indent||(r.forceBlockIndent||Tc(i)?" ":""),S=d==="literal"?!0:d==="folded"||n===_e.BLOCK_FOLDED?!1:n===_e.BLOCK_LITERAL?!0:!
|
|
83
|
+
|$)`,"g")}catch{qf=/\n+(?!\n|$)/g}function tc({comment:e,type:n,value:i},r,l,c){const{blockQuote:d,commentString:h,lineWidth:g}=r.options;if(!d||/\n[\t ]+$/.test(i))return Rs(i,r);const b=r.indent||(r.forceBlockIndent||Tc(i)?" ":""),S=d==="literal"?!0:d==="folded"||n===_e.BLOCK_FOLDED?!1:n===_e.BLOCK_LITERAL?!0:!uM(i,g,b.length);if(!i)return S?`|
|
|
84
84
|
`:`>
|
|
85
85
|
`;let x,N;for(N=i.length;N>0;--N){const X=i[N-1];if(X!==`
|
|
86
86
|
`&&X!==" "&&X!==" ")break}let A=i.substring(N);const T=A.indexOf(`
|
|
@@ -89,12 +89,12 @@ ${i}`)+"'";return n.implicitKey?r:Cc(r,i,DS,zc(n,!1))}function Rs(e,n){const{sin
|
|
|
89
89
|
`)R=E;else break}let V=i.substring(0,R<E?R+1:E);V&&(i=i.substring(V.length),V=V.replace(/\n+/g,`$&${b}`));let Z=(k?b?"2":"1":"")+x;if(e&&(Z+=" "+h(e.replace(/ ?[\r\n]+/g," ")),l&&l()),!S){const X=i.replace(/\n+/g,`
|
|
90
90
|
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${b}`);let J=!1;const O=zc(r,!0);d!=="folded"&&n!==_e.BLOCK_FOLDED&&(O.onOverflow=()=>{J=!0});const M=Cc(`${V}${X}${A}`,b,Bf,O);if(!J)return`>${Z}
|
|
91
91
|
${b}${M}`}return i=i.replace(/\n+/g,`$&${b}`),`|${Z}
|
|
92
|
-
${b}${V}${i}${A}`}function
|
|
92
|
+
${b}${V}${i}${A}`}function dM(e,n,i,r){const{type:l,value:c}=e,{actualString:d,implicitKey:h,indent:g,indentStep:b,inFlow:S}=n;if(h&&c.includes(`
|
|
93
93
|
`)||S&&/[[\]{},]/.test(c))return Rs(c,n);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(c))return h||S||!c.includes(`
|
|
94
94
|
`)?Rs(c,n):tc(e,n,i,r);if(!h&&!S&&l!==_e.PLAIN&&c.includes(`
|
|
95
95
|
`))return tc(e,n,i,r);if(Tc(c)){if(g==="")return n.forceBlockIndent=!0,tc(e,n,i,r);if(h&&g===b)return Rs(c,n)}const x=c.replace(/\n+/g,`$&
|
|
96
|
-
${g}`);if(d){const N=k=>k.default&&k.tag!=="tag:yaml.org,2002:str"&&k.test?.test(x),{compat:A,tags:T}=n.doc.schema;if(T.some(N)||A?.some(N))return Rs(c,n)}return h?x:Cc(x,g,
|
|
97
|
-
${n.indent}${h}`:h}function
|
|
96
|
+
${g}`);if(d){const N=k=>k.default&&k.tag!=="tag:yaml.org,2002:str"&&k.test?.test(x),{compat:A,tags:T}=n.doc.schema;if(T.some(N)||A?.some(N))return Rs(c,n)}return h?x:Cc(x,g,RS,zc(n,!1))}function Dp(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:h}=e;h!==_e.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(d.value)&&(h=_e.QUOTE_DOUBLE);const g=S=>{switch(S){case _e.BLOCK_FOLDED:case _e.BLOCK_LITERAL:return l||c?Rs(d.value,n):tc(d,n,i,r);case _e.QUOTE_DOUBLE:return oo(d.value,n);case _e.QUOTE_SINGLE:return Lf(d.value,n);case _e.PLAIN:return dM(d,n,i,r);default:return null}};let b=g(h);if(b===null){const{defaultKeyType:S,defaultStringType:x}=n.options,N=l&&S||x;if(b=g(N),b===null)throw new Error(`Unsupported default string type ${N}`)}return b}function MS(e,n){const i=Object.assign({blockQuote:!0,commentString:cM,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 fM(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(at(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 pM(e,n,{anchors:i,doc:r}){if(!r.directives)return"";const l=[],c=(at(e)||bt(e))&&e.anchor;c&&zS(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 Vs(e,n,i,r){if(St(e))return e.toString(n,i,r);if(Oi(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=vt(e)?e:n.doc.createNode(e,{onTagObj:g=>l=g});l??(l=fM(n.doc.schema.tags,c));const d=pM(c,l,n);d.length>0&&(n.indentAtStart=(n.indentAtStart??0)+d.length+1);const h=typeof l.stringify=="function"?l.stringify(c,n,i,r):at(c)?Dp(c,n,i,r):c.toString(n,i,r);return d?at(c)||h[0]==="{"||h[0]==="["?`${d} ${h}`:`${d}
|
|
97
|
+
${n.indent}${h}`:h}function mM({key:e,value:n},i,r,l){const{allNullValues:c,doc:d,indent:h,indentStep:g,options:{commentString:b,indentSeq:S,simpleKeys:x}}=i;let N=vt(e)&&e.comment||null;if(x){if(N)throw new Error("With simple keys, key nodes cannot have comments");if(bt(e)||!vt(e)&&typeof e=="object"){const O="With simple keys, collection cannot be used as a key value";throw new Error(O)}}let A=!x&&(!e||N&&n==null&&!i.inFlow||bt(e)||(at(e)?e.type===_e.BLOCK_FOLDED||e.type===_e.BLOCK_LITERAL:typeof e=="object"));i=Object.assign({},i,{allNullValues:!1,implicitKey:!A&&(x||!c),indent:h+g});let T=!1,k=!1,E=Vs(e,i,()=>T=!0,()=>k=!0);if(!A&&!i.inFlow&&E.length>1024){if(x)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");A=!0}if(i.inFlow){if(c||n==null)return T&&r&&r(),E===""?"?":A?`? ${E}`:E}else if(c&&!x||n==null&&A)return E=`? ${E}`,N&&!T?E+=Ni(E,i.indent,b(N)):k&&l&&l(),E;T&&(N=null),A?(N&&(E+=Ni(E,i.indent,b(N))),E=`? ${E}
|
|
98
98
|
${h}:`):(E=`${E}:`,N&&(E+=Ni(E,i.indent,b(N))));let R,V,G;vt(n)?(R=!!n.spaceBefore,V=n.commentBefore,G=n.comment):(R=!1,V=null,G=null,n&&typeof n=="object"&&(n=d.createNode(n))),i.implicitKey=!1,!A&&!N&&at(n)&&(i.indentAtStart=E.length+1),k=!1,!S&&g.length>=2&&!i.inFlow&&!A&&bo(n)&&!n.flow&&!n.tag&&!n.anchor&&(i.indent=i.indent.substring(2));let Z=!1;const X=Vs(n,i,()=>Z=!0,()=>k=!0);let J=" ";if(N||R||V){if(J=R?`
|
|
99
99
|
`:"",V){const O=b(V);J+=`
|
|
100
100
|
${ma(O,i.indent)}`}X===""&&!i.inFlow?J===`
|
|
@@ -104,32 +104,32 @@ ${ma(O,i.indent)}`}X===""&&!i.inFlow?J===`
|
|
|
104
104
|
${i.indent}`}else if(!A&&bt(n)){const O=X[0],M=X.indexOf(`
|
|
105
105
|
`),le=M!==-1,Ae=i.inFlow??n.flow??n.items.length===0;if(le||!Ae){let Ce=!1;if(le&&(O==="&"||O==="!")){let ve=X.indexOf(" ");O==="&"&&ve!==-1&&ve<M&&X[ve+1]==="!"&&(ve=X.indexOf(" ",ve+1)),(ve===-1||M<ve)&&(Ce=!0)}Ce||(J=`
|
|
106
106
|
${i.indent}`)}}else(X===""||X[0]===`
|
|
107
|
-
`)&&(J="");return E+=J+X,i.inFlow?Z&&r&&r():G&&!Z?E+=Ni(E,i.indent,b(G)):k&&l&&l(),E}function
|
|
107
|
+
`)&&(J="");return E+=J+X,i.inFlow?Z&&r&&r():G&&!Z?E+=Ni(E,i.indent,b(G)):k&&l&&l(),E}function hM(e,n){(e==="debug"||e==="warn")&&console.warn(n)}const Ql="<<",ha={identify:e=>e===Ql||typeof e=="symbol"&&e.description===Ql,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new _e(Symbol(Ql)),{addToJSMap:BS}),stringify:()=>Ql},gM=(e,n)=>(ha.identify(n)||at(n)&&(!n.type||n.type===_e.PLAIN)&&ha.identify(n.value))&&e?.doc.schema.tags.some(i=>i.tag===ha.tag&&i.default);function BS(e,n,i){if(i=e&&Oi(i)?i.resolve(e.doc):i,bo(i))for(const r of i.items)ff(e,n,r);else if(Array.isArray(i))for(const r of i)ff(e,n,r);else ff(e,n,i)}function ff(e,n,i){const r=e&&Oi(i)?i.resolve(e.doc):i;if(!yo(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 LS(e,n,{key:i,value:r}){if(vt(i)&&i.addToJSMap)i.addToJSMap(e,n,r);else if(gM(e,i))BS(e,n,r);else{const l=kn(i,"",e);if(n instanceof Map)n.set(l,kn(r,l,e));else if(n instanceof Set)n.add(l);else{const c=yM(i,l,e),d=kn(r,c,e);c in n?Object.defineProperty(n,c,{value:d,writable:!0,enumerable:!0,configurable:!0}):n[c]=d}}return n}function yM(e,n,i){if(n===null)return"";if(typeof n!="object")return String(n);if(vt(e)&&i?.doc){const r=MS(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)+'..."'),hM(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 Rp(e,n,i){const r=po(e,void 0,i),l=po(n,void 0,i);return new Qt(r,l)}class Qt{constructor(n,i=null){Object.defineProperty(this,An,{value:_S}),this.key=n,this.value=i}clone(n){let{key:i,value:r}=this;return vt(i)&&(i=i.clone(n)),vt(r)&&(r=r.clone(n)),new Qt(i,r)}toJSON(n,i){const r=i?.mapAsMap?new Map:{};return LS(i,r,this)}toString(n,i,r){return n?.doc?mM(this,n,i,r):JSON.stringify(this)}}function qS(e,n,i){return(n.inFlow??e.flow?vM:bM)(e,n,i)}function bM({comment:e,items:n},i,{blockItemPrefix:r,flowChars:l,itemIndent:c,onChompKeep:d,onComment:h}){const{indent:g,options:{commentString:b}}=i,S=Object.assign({},i,{indent:c,type:null});let x=!1;const N=[];for(let T=0;T<n.length;++T){const k=n[T];let E=null;if(vt(k))!x&&k.spaceBefore&&N.push(""),mc(i,N,k.commentBefore,x),k.comment&&(E=k.comment);else if(St(k)){const V=vt(k.key)?k.key:null;V&&(!x&&V.spaceBefore&&N.push(""),mc(i,N,V.commentBefore,x))}x=!1;let R=Vs(k,S,()=>E=null,()=>x=!0);E&&(R+=Ni(R,c,b(E))),x&&E&&(x=!1),N.push(r+R)}let A;if(N.length===0)A=l.start+l.end;else{A=N[0];for(let T=1;T<N.length;++T){const k=N[T];A+=k?`
|
|
108
108
|
${g}${k}`:`
|
|
109
109
|
`}}return e?(A+=`
|
|
110
|
-
`+ma(b(e),g),h&&h()):x&&d&&d(),A}function
|
|
110
|
+
`+ma(b(e),g),h&&h()):x&&d&&d(),A}function vM({items:e},n,{flowChars:i,itemIndent:r}){const{indent:l,indentStep:c,flowCollectionPadding:d,options:{commentString:h}}=n;r+=c;const g=Object.assign({},n,{indent:r,inFlow:!0,type:null});let b=!1,S=0;const x=[];for(let T=0;T<e.length;++T){const k=e[T];let E=null;if(vt(k))k.spaceBefore&&x.push(""),mc(n,x,k.commentBefore,!1),k.comment&&(E=k.comment);else if(St(k)){const V=vt(k.key)?k.key:null;V&&(V.spaceBefore&&x.push(""),mc(n,x,V.commentBefore,!1),V.comment&&(b=!0));const G=vt(k.value)?k.value:null;G?(G.comment&&(E=G.comment),G.commentBefore&&(b=!0)):k.value==null&&V?.comment&&(E=V.comment)}E&&(b=!0);let R=Vs(k,g,()=>E=null);T<e.length-1&&(R+=","),E&&(R+=Ni(R,r,h(E))),!b&&(x.length>S||R.includes(`
|
|
111
111
|
`))&&(b=!0),x.push(R),S=x.length}const{start:N,end:A}=i;if(x.length===0)return N+A;if(!b){const T=x.reduce((k,E)=>k+E.length+2,2);b=n.options.lineWidth>0&&T>n.options.lineWidth}if(b){let T=N;for(const k of x)T+=k?`
|
|
112
112
|
${c}${l}${k}`:`
|
|
113
113
|
`;return`${T}
|
|
114
|
-
${l}${A}`}else return`${N}${d}${x.join(" ")}${d}${A}`}function mc({indent:e,options:{commentString:n}},i,r,l){if(r&&l&&(r=r.replace(/^\n+/,"")),r){const c=ma(n(r),e);i.push(c.trimStart())}}function ki(e,n){const i=at(n)?n.value:n;for(const r of e)if(St(r)&&(r.key===n||r.key===i||at(r.key)&&r.key.value===i))return r}class Nn extends
|
|
115
|
-
`:" ")}return Dp({comment:e,type:n,value:h},r,l,c)}};function
|
|
114
|
+
${l}${A}`}else return`${N}${d}${x.join(" ")}${d}${A}`}function mc({indent:e,options:{commentString:n}},i,r,l){if(r&&l&&(r=r.replace(/^\n+/,"")),r){const c=ma(n(r),e);i.push(c.trimStart())}}function ki(e,n){const i=at(n)?n.value:n;for(const r of e)if(St(r)&&(r.key===n||r.key===i||at(r.key)&&r.key.value===i))return r}class Nn extends DS{static get tagName(){return"tag:yaml.org,2002:map"}constructor(n){super(Za,n),this.items=[]}static from(n,i,r){const{keepUndefined:l,replacer:c}=r,d=new this(n),h=(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(Rp(g,b,r))};if(i instanceof Map)for(const[g,b]of i)h(g,b);else if(i&&typeof i=="object")for(const g of Object.keys(i))h(g,i[g]);return typeof n.sortMapEntries=="function"&&d.items.sort(n.sortMapEntries),d}add(n,i){let r;St(n)?r=n:!n||typeof n!="object"||!("key"in n)?r=new Qt(n,n?.value):r=new Qt(n.key,n.value);const l=ki(this.items,r.key),c=this.schema?.sortMapEntries;if(l){if(!i)throw new Error(`Key ${r.key} already set`);at(l.value)&&OS(r.value)?l.value.value=r.value:l.value=r.value}else if(c){const d=this.items.findIndex(h=>c(r,h)<0);d===-1?this.items.push(r):this.items.splice(d,0,r)}else this.items.push(r)}delete(n){const i=ki(this.items,n);return i?this.items.splice(this.items.indexOf(i),1).length>0:!1}get(n,i){const l=ki(this.items,n)?.value;return(!i&&at(l)?l.value:l)??void 0}has(n){return!!ki(this.items,n)}set(n,i){this.add(new Qt(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)LS(i,l,c);return l}toString(n,i,r){if(!n)return JSON.stringify(this);for(const l of this.items)if(!St(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})),qS(this,n,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:n.indent||"",onChompKeep:r,onComment:i})}}const er={collection:"map",default:!0,nodeClass:Nn,tag:"tag:yaml.org,2002:map",resolve(e,n){return yo(e)||n("Expected a mapping for this tag"),e},createNode:(e,n,i)=>Nn.from(e,n,i)};class Ci extends DS{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(n){super(Fs,n),this.items=[]}add(n){this.items.push(n)}delete(n){const i=Kl(n);return typeof i!="number"?!1:this.items.splice(i,1).length>0}get(n,i){const r=Kl(n);if(typeof r!="number")return;const l=this.items[r];return!i&&at(l)?l.value:l}has(n){const i=Kl(n);return typeof i=="number"&&i<this.items.length}set(n,i){const r=Kl(n);if(typeof r!="number")throw new Error(`Expected a valid index, not ${n}.`);const l=this.items[r];at(l)&&OS(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(kn(c,String(l++),i));return r}toString(n,i,r){return n?qS(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 h of i){if(typeof l=="function"){const g=i instanceof Set?h:String(d++);h=l.call(i,g,h)}c.items.push(po(h,void 0,r))}}return c}}function Kl(e){let n=at(e)?e.value:e;return n&&typeof n=="string"&&(n=Number(n)),typeof n=="number"&&Number.isInteger(n)&&n>=0?n:null}const tr={collection:"seq",default:!0,nodeClass:Ci,tag:"tag:yaml.org,2002:seq",resolve(e,n){return bo(e)||n("Expected a sequence for this tag"),e},createNode:(e,n,i)=>Ci.from(e,n,i)},Ec={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),Dp(e,n,i,r)}},Oc={identify:e=>e==null,createNode:()=>new _e(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new _e(null),stringify:({source:e},n)=>typeof e=="string"&&Oc.test.test(e)?e:n.options.nullStr},Mp={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new _e(e[0]==="t"||e[0]==="T"),stringify({source:e,value:n},i){if(e&&Mp.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 qn({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 h=n-(c.length-d-1);for(;h-- >0;)c+="0"}return c}const US={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:qn},$S={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():qn(e)}},IS={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 _e(parseFloat(e)),i=e.indexOf(".");return i!==-1&&e[e.length-1]==="0"&&(n.minFractionDigits=e.length-i-1),n},stringify:qn},Dc=e=>typeof e=="bigint"||Number.isInteger(e),Bp=(e,n,i,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(n),i);function VS(e,n,i){const{value:r}=e;return Dc(r)&&r>=0?i+r.toString(n):qn(e)}const PS={identify:e=>Dc(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,n,i)=>Bp(e,2,8,i),stringify:e=>VS(e,8,"0o")},GS={identify:Dc,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,n,i)=>Bp(e,0,10,i),stringify:qn},HS={identify:e=>Dc(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,n,i)=>Bp(e,2,16,i),stringify:e=>VS(e,16,"0x")},SM=[er,tr,Ec,Oc,Mp,PS,GS,HS,US,$S,IS];function Fb(e){return typeof e=="bigint"||Number.isInteger(e)}const Zl=({value:e})=>JSON.stringify(e),xM=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:Zl},{identify:e=>e==null,createNode:()=>new _e(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Zl},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:Zl},{identify:Fb,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})=>Fb(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:Zl}],wM={default:!0,tag:"",test:/^/,resolve(e,n){return n(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},jM=[er,tr].concat(xM,wM),Lp={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 h;if(typeof btoa=="function"){let g="";for(let b=0;b<d.length;++b)g+=String.fromCharCode(d[b]);h=btoa(g)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(n??(n=_e.BLOCK_LITERAL),n!==_e.QUOTE_DOUBLE){const g=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),b=Math.ceil(h.length/g),S=new Array(b);for(let x=0,N=0;x<b;++x,N+=g)S[x]=h.substr(N,g);h=S.join(n===_e.BLOCK_LITERAL?`
|
|
115
|
+
`:" ")}return Dp({comment:e,type:n,value:h},r,l,c)}};function QS(e,n){if(bo(e))for(let i=0;i<e.items.length;++i){let r=e.items[i];if(!St(r)){if(yo(r)){r.items.length>1&&n("Each pair must have its own sequence indicator");const l=r.items[0]||new Qt(new _e(null));if(r.commentBefore&&(l.key.commentBefore=l.key.commentBefore?`${r.commentBefore}
|
|
116
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]=St(r)?r:new Qt(r)}}else n("Expected a sequence for this tag");return e}function
|
|
117
|
+
${c.comment}`:r.comment}r=l}e.items[i]=St(r)?r:new Qt(r)}}else n("Expected a sequence for this tag");return e}function KS(e,n,i){const{replacer:r}=i,l=new Ci(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 h,g;if(Array.isArray(d))if(d.length===2)h=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)h=b[0],g=d[h];else throw new TypeError(`Expected tuple with one key, not ${b.length} keys`)}else h=d;l.items.push(Rp(h,g,i))}return l}const qp={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:QS,createNode:KS};class Ls extends Ci{constructor(){super(),this.add=Nn.prototype.add.bind(this),this.delete=Nn.prototype.delete.bind(this),this.get=Nn.prototype.get.bind(this),this.has=Nn.prototype.has.bind(this),this.set=Nn.prototype.set.bind(this),this.tag=Ls.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(St(l)?(c=kn(l.key,"",i),d=kn(l.value,c,i)):c=kn(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=KS(n,i,r),c=new this;return c.items=l.items,c}}Ls.tag="tag:yaml.org,2002:omap";const Up={collection:"seq",identify:e=>e instanceof Map,nodeClass:Ls,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,n){const i=QS(e,n),r=[];for(const{key:l}of i.items)at(l)&&(r.includes(l.value)?n(`Ordered maps must not include duplicate keys: ${l.value}`):r.push(l.value));return Object.assign(new Ls,i)},createNode:(e,n,i)=>Ls.from(e,n,i)};function ZS({value:e,source:n},i){return n&&(e?YS:XS).test.test(n)?n:e?i.options.trueStr:i.options.falseStr}const YS={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 _e(!0),stringify:ZS},XS={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 _e(!1),stringify:ZS},NM={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:qn},kM={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():qn(e)}},AM={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 _e(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:qn},vo=e=>typeof e=="bigint"||Number.isInteger(e);function Rc(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 $p(e,n,i){const{value:r}=e;if(vo(r)){const l=r.toString(n);return r<0?"-"+i+l.substr(1):i+l}return qn(e)}const _M={identify:vo,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,n,i)=>Rc(e,2,2,i),stringify:e=>$p(e,2,"0b")},CM={identify:vo,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,n,i)=>Rc(e,1,8,i),stringify:e=>$p(e,8,"0")},zM={identify:vo,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,n,i)=>Rc(e,0,10,i),stringify:qn},TM={identify:vo,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,n,i)=>Rc(e,2,16,i),stringify:e=>$p(e,16,"0x")};class qs extends Nn{constructor(n){super(n),this.tag=qs.tag}add(n){let i;St(n)?i=n:n&&typeof n=="object"&&"key"in n&&"value"in n&&n.value===null?i=new Qt(n.key,null):i=new Qt(n,null),ki(this.items,i.key)||this.items.push(i)}get(n,i){const r=ki(this.items,n);return!i&&St(r)?at(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=ki(this.items,n);r&&!i?this.items.splice(this.items.indexOf(r),1):!r&&i&&this.items.push(new Qt(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(Rp(d,null,r));return c}}qs.tag="tag:yaml.org,2002:set";const Ip={collection:"map",identify:e=>e instanceof Set,nodeClass:qs,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,n,i)=>qs.from(e,n,i),resolve(e,n){if(yo(e)){if(e.hasAllNullValues(!0))return Object.assign(new qs,e);n("Set items must all have null values")}else n("Expected a mapping for this tag");return e}};function Vp(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,h)=>d*l(60)+l(h),l(0));return i==="-"?l(-1)*c:c}function JS(e){let{value:n}=e,i=d=>d;if(typeof n=="bigint")i=d=>BigInt(d);else if(isNaN(n)||!isFinite(n))return qn(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 FS={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})=>Vp(e,i),stringify:JS},WS={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=>Vp(e,!1),stringify:JS},Mc={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(Mc.test);if(!n)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,i,r,l,c,d,h]=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,h||0,g);const S=n[8];if(S&&S!=="Z"){let x=Vp(S,!1);Math.abs(x)<30&&(x*=60),b-=6e4*x}return new Date(b)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""},Wb=[er,tr,Ec,Oc,YS,XS,_M,CM,zM,TM,NM,kM,AM,Lp,ha,Up,qp,Ip,FS,WS,Mc],ev=new Map([["core",SM],["failsafe",[er,tr,Ec]],["json",jM],["yaml11",Wb],["yaml-1.1",Wb]]),tv={binary:Lp,bool:Mp,float:IS,floatExp:$S,floatNaN:US,floatTime:WS,int:GS,intHex:HS,intOct:PS,intTime:FS,map:er,merge:ha,null:Oc,omap:Up,pairs:qp,seq:tr,set:Ip,timestamp:Mc},EM={"tag:yaml.org,2002:binary":Lp,"tag:yaml.org,2002:merge":ha,"tag:yaml.org,2002:omap":Up,"tag:yaml.org,2002:pairs":qp,"tag:yaml.org,2002:set":Ip,"tag:yaml.org,2002:timestamp":Mc};function pf(e,n,i){const r=ev.get(n);if(r&&!e)return i&&!r.includes(ha)?r.concat(ha):r.slice();let l=r;if(!l)if(Array.isArray(e))l=[];else{const c=Array.from(ev.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(ha)),l.reduce((c,d)=>{const h=typeof d=="string"?tv[d]:d;if(!h){const g=JSON.stringify(d),b=Object.keys(tv).map(S=>JSON.stringify(S)).join(", ");throw new Error(`Unknown custom tag ${g}; use one of ${b}`)}return c.includes(h)||c.push(h),c},[])}const OM=(e,n)=>e.key<n.key?-1:e.key>n.key?1:0;class Pp{constructor({compat:n,customTags:i,merge:r,resolveKnownTags:l,schema:c,sortMapEntries:d,toStringDefaults:h}){this.compat=Array.isArray(n)?pf(n,"compat"):n?pf(null,n):null,this.name=typeof c=="string"&&c||"core",this.knownTags=l?EM:{},this.tags=pf(i,this.name,r),this.toStringOptions=h??null,Object.defineProperty(this,Za,{value:er}),Object.defineProperty(this,Hn,{value:Ec}),Object.defineProperty(this,Fs,{value:tr}),this.sortMapEntries=typeof d=="function"?d:d===!0?OM:null}clone(){const n=Object.create(Pp.prototype,Object.getOwnPropertyDescriptors(this));return n.tags=this.tags.slice(),n}}function DM(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=MS(e,n),{commentString:c}=l.options;if(e.commentBefore){i.length!==1&&i.unshift("");const g=c(e.commentBefore);i.unshift(ma(g,""))}let d=!1,h=null;if(e.contents){if(vt(e.contents)){if(e.contents.spaceBefore&&r&&i.push(""),e.contents.commentBefore){const S=c(e.contents.commentBefore);i.push(ma(S,""))}l.forceBlockIndent=!!e.comment,h=e.contents.comment}const g=h?void 0:()=>d=!0;let b=Vs(e.contents,l,()=>h=null,g);h&&(b+=Ni(b,"",c(h))),(b[0]==="|"||b[0]===">")&&i[i.length-1]==="---"?i[i.length-1]=`--- ${b}`:i.push(b)}else i.push(Vs(e.contents,l));if(e.directives?.docEnd)if(e.comment){const g=c(e.comment);g.includes(`
|
|
118
118
|
`)?(i.push("..."),i.push(ma(g,""))):i.push(`... ${g}`)}else i.push("...");else{let g=e.comment;g&&d&&(g=g.replace(/^\n+/,"")),g&&((!d||h)&&i[i.length-1]!==""&&i.push(""),i.push(ma(c(g),"")))}return i.join(`
|
|
119
119
|
`)+`
|
|
120
|
-
`}class Bc{constructor(n,i,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,An,{value:Mf});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(Bc.prototype,{[An]:{value:Mf}});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=vt(this.contents)?this.contents.clone(n.schema):this.contents,this.range&&(n.range=this.range.slice()),n}add(n){Cs(this.contents)&&this.contents.add(n)}addIn(n,i){Cs(this.contents)&&this.contents.addIn(n,i)}createAlias(n,i){if(!n.anchor){const r=
|
|
120
|
+
`}class Bc{constructor(n,i,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,An,{value:Mf});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(Bc.prototype,{[An]:{value:Mf}});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=vt(this.contents)?this.contents.clone(n.schema):this.contents,this.range&&(n.range=this.range.slice()),n}add(n){Cs(this.contents)&&this.contents.add(n)}addIn(n,i){Cs(this.contents)&&this.contents.addIn(n,i)}createAlias(n,i){if(!n.anchor){const r=TS(this);n.anchor=!i||r.has(i)?ES(i||"a",r):i}return new Op(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 E=V=>typeof V=="number"||V instanceof String||V instanceof Number,R=i.filter(E).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:h,keepUndefined:g,onTagObj:b,tag:S}=r??{},{onAnchor:x,setAnchors:N,sourceObjects:A}=rM(this,d||"a"),T={aliasDuplicateObjects:c??!0,keepUndefined:g??!1,onAnchor:x,onTagObj:b,replacer:l,schema:this.schema,sourceObjects:A},k=po(n,S,T);return h&&bt(k)&&(k.flow=!0),N(),k}createPair(n,i,r={}){const l=this.createNode(n,null,r),c=this.createNode(i,null,r);return new Qt(l,c)}delete(n){return Cs(this.contents)?this.contents.delete(n):!1}deleteIn(n){return so(n)?this.contents==null?!1:(this.contents=null,!0):Cs(this.contents)?this.contents.deleteIn(n):!1}get(n,i){return bt(this.contents)?this.contents.get(n,i):void 0}getIn(n,i){return so(n)?!i&&at(this.contents)?this.contents.value:this.contents:bt(this.contents)?this.contents.getIn(n,i):void 0}has(n){return bt(this.contents)?this.contents.has(n):!1}hasIn(n){return so(n)?this.contents!==void 0:bt(this.contents)?this.contents.hasIn(n):!1}set(n,i){this.contents==null?this.contents=pc(this.schema,[n],i):Cs(this.contents)&&this.contents.set(n,i)}setIn(n,i){so(n)?this.contents=i:this.contents==null?this.contents=pc(this.schema,Array.from(n),i):Cs(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 Pp(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 h={anchors:new Map,doc:this,keep:!n,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof l=="number"?l:100},g=kn(this.contents,i??"",h);if(typeof c=="function")for(const{count:b,res:S}of h.anchors.values())c(S,b);return typeof d=="function"?Ds(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 DM(this,n)}}function Cs(e){if(bt(e))return!0;throw new Error("Expected a YAML collection as document contents")}class e1 extends Error{constructor(n,i,r,l){super(),this.name=n,this.code=r,this.message=l,this.pos=i}}class Yl extends e1{constructor(n,i,r){super("YAMLParseError",n,i,r)}}class RM extends e1{constructor(n,i,r){super("YAMLWarning",n,i,r)}}const nv=(e,n)=>i=>{if(i.pos[0]===-1)return;i.linePos=i.pos.map(h=>n.linePos(h));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 h=Math.min(c-39,d.length-79);d="…"+d.substring(h),c-=h-1}if(d.length>80&&(d=d.substring(0,79)+"…"),r>1&&/^ *$/.test(d.substring(0,c))){let h=e.substring(n.lineStarts[r-2],n.lineStarts[r-1]);h.length>80&&(h=h.substring(0,79)+`…
|
|
121
121
|
`),d=h+d}if(/[^ ]/.test(d)){let h=1;const g=i.linePos[1];g?.line===r&&g.col>l&&(h=Math.max(1,Math.min(g.col-l,80-c)));const b=" ".repeat(c)+"^".repeat(h);i.message+=`:
|
|
122
122
|
|
|
123
123
|
${d}
|
|
124
124
|
${b}
|
|
125
125
|
`}};function Ps(e,{flow:n,indicator:i,next:r,offset:l,onError:c,parentIndent:d,startOnNewline:h}){let g=!1,b=h,S=h,x="",N="",A=!1,T=!1,k=null,E=null,R=null,V=null,G=null,Z=null,X=null;for(const M of e)switch(T&&(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"),T=!1),k&&(b&&M.type!=="comment"&&M.type!=="newline"&&c(k,"TAB_AS_INDENT","Tabs are not allowed as indentation"),k=null),M.type){case"space":!n&&(i!=="doc-start"||r?.type!=="flow-collection")&&M.source.includes(" ")&&(k=M),S=!0;break;case"comment":{S||c(M,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const le=M.source.substring(1)||" ";x?x+=N+le:x=le,N="",b=!1;break}case"newline":b?x?x+=M.source:(!Z||i!=="seq-item-ind")&&(g=!0):N+=M.source,b=!0,A=!0,(E||R)&&(V=M),S=!0;break;case"anchor":E&&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),E=M,X??(X=M.offset),b=!1,S=!1,T=!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,S=!1,T=!0;break}case i:(E||R)&&c(M,"BAD_PROP_ORDER",`Anchors and tags must be after the ${M.source} indicator`),Z&&c(M,"UNEXPECTED_TOKEN",`Unexpected ${M.source} in ${n??"collection"}`),Z=M,b=i==="seq-item-ind"||i==="explicit-key-ind",S=!1;break;case"comma":if(n){G&&c(M,"UNEXPECTED_TOKEN",`Unexpected , in ${n}`),G=M,b=!1,S=!1;break}default:c(M,"UNEXPECTED_TOKEN",`Unexpected ${M.type} token`),b=!1,S=!1}const J=e[e.length-1],O=J?J.offset+J.source.length:l;return T&&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"),k&&(b&&k.indent<=d||r?.type==="block-map"||r?.type==="block-seq")&&c(k,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:G,found:Z,spaceBefore:g,comment:x,hasNewline:A,anchor:E,tag:R,newlineAfterProp:V,end:O,start:X??O}}function mo(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(mo(n.key)||mo(n.value))return!0}return!1;default:return!0}}function Uf(e,n,i){if(n?.type==="flow-collection"){const r=n.end[0];r.indent===e&&(r.source==="]"||r.source==="}")&&mo(n)&&i(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function
|
|
127
|
-
`+k.comment:h.comment=k.comment);continue}(k.newlineAfterProp||mo(N))&&l(N??x[x.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else k.found?.indent!==r.indent&&l(g,"BAD_INDENT",av);i.atKey=!0;const R=k.end,V=N?e(i,N,k,l):n(i,R,x,null,k,l);i.schema.compat&&Uf(r.indent,N,l),i.atKey=!1,
|
|
128
|
-
`+G.comment:V.comment=G.comment);const Z=new Qt(V);i.options.keepSourceTokens&&(Z.srcToken=S),h.items.push(Z)}}return b&&b<g&&l(b,"IMPOSSIBLE","Map comment with trailing content"),h.range=[r.offset,g,b??g],h}function
|
|
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(mo(n.key)||mo(n.value))return!0}return!1;default:return!0}}function Uf(e,n,i){if(n?.type==="flow-collection"){const r=n.end[0];r.indent===e&&(r.source==="]"||r.source==="}")&&mo(n)&&i(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function t1(e,n,i){const{uniqueKeys:r}=e.options;if(r===!1)return!1;const l=typeof r=="function"?r:(c,d)=>c===d||at(c)&&at(d)&&c.value===d.value;return n.some(c=>l(c.key,i))}const av="All mapping items must start at the same column";function MM({composeNode:e,composeEmptyNode:n},i,r,l,c){const d=c?.nodeClass??Nn,h=new d(i.schema);i.atRoot&&(i.atRoot=!1);let g=r.offset,b=null;for(const S of r.items){const{start:x,key:N,sep:A,value:T}=S,k=Ps(x,{indicator:"explicit-key-ind",next:N??A?.[0],offset:g,onError:l,parentIndent:r.indent,startOnNewline:!0}),E=!k.found;if(E){if(N&&(N.type==="block-seq"?l(g,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in N&&N.indent!==r.indent&&l(g,"BAD_INDENT",av)),!k.anchor&&!k.tag&&!A){b=k.end,k.comment&&(h.comment?h.comment+=`
|
|
127
|
+
`+k.comment:h.comment=k.comment);continue}(k.newlineAfterProp||mo(N))&&l(N??x[x.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else k.found?.indent!==r.indent&&l(g,"BAD_INDENT",av);i.atKey=!0;const R=k.end,V=N?e(i,N,k,l):n(i,R,x,null,k,l);i.schema.compat&&Uf(r.indent,N,l),i.atKey=!1,t1(i,h.items,V)&&l(R,"DUPLICATE_KEY","Map keys must be unique");const G=Ps(A??[],{indicator:"map-value-ind",next:T,offset:V.range[2],onError:l,parentIndent:r.indent,startOnNewline:!N||N.type==="block-scalar"});if(g=G.end,G.found){E&&(T?.type==="block-map"&&!G.hasNewline&&l(g,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),i.options.strict&&k.start<G.found.offset-1024&&l(V.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const Z=T?e(i,T,G,l):n(i,g,A,null,G,l);i.schema.compat&&Uf(r.indent,T,l),g=Z.range[2];const X=new Qt(V,Z);i.options.keepSourceTokens&&(X.srcToken=S),h.items.push(X)}else{E&&l(V.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),G.comment&&(V.comment?V.comment+=`
|
|
128
|
+
`+G.comment:V.comment=G.comment);const Z=new Qt(V);i.options.keepSourceTokens&&(Z.srcToken=S),h.items.push(Z)}}return b&&b<g&&l(b,"IMPOSSIBLE","Map comment with trailing content"),h.range=[r.offset,g,b??g],h}function BM({composeNode:e,composeEmptyNode:n},i,r,l,c){const d=c?.nodeClass??Ci,h=new d(i.schema);i.atRoot&&(i.atRoot=!1),i.atKey&&(i.atKey=!1);let g=r.offset,b=null;for(const{start:S,value:x}of r.items){const N=Ps(S,{indicator:"seq-item-ind",next:x,offset:g,onError:l,parentIndent:r.indent,startOnNewline:!0});if(!N.found)if(N.anchor||N.tag||x)x?.type==="block-seq"?l(N.end,"BAD_INDENT","All sequence items must start at the same column"):l(g,"MISSING_CHAR","Sequence item without - indicator");else{b=N.end,N.comment&&(h.comment=N.comment);continue}const A=x?e(i,x,N,l):n(i,N.end,S,null,N,l);i.schema.compat&&Uf(r.indent,x,l),g=A.range[2],h.items.push(A)}return h.range=[r.offset,g,b??g],h}function So(e,n,i,r){let l="";if(e){let c=!1,d="";for(const h of e){const{source:g,type:b}=h;switch(b){case"space":c=!0;break;case"comment":{i&&!c&&r(h,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const S=g.substring(1)||" ";l?l+=d+S:l=S,d="";break}case"newline":l&&(d+=g),c=!0;break;default:r(h,"UNEXPECTED_TOKEN",`Unexpected ${b} at node end`)}n+=g.length}}return{comment:l,offset:n}}const mf="Block collections are not allowed within flow collections",hf=e=>e&&(e.type==="block-map"||e.type==="block-seq");function LM({composeNode:e,composeEmptyNode:n},i,r,l,c){const d=r.start.source==="{",h=d?"flow map":"flow sequence",g=c?.nodeClass??(d?Nn:Ci),b=new g(i.schema);b.flow=!0;const S=i.atRoot;S&&(i.atRoot=!1),i.atKey&&(i.atKey=!1);let x=r.offset+r.start.source.length;for(let E=0;E<r.items.length;++E){const R=r.items[E],{start:V,key:G,sep:Z,value:X}=R,J=Ps(V,{flow:h,indicator:"explicit-key-ind",next:G??Z?.[0],offset:x,onError:l,parentIndent:r.indent,startOnNewline:!1});if(!J.found){if(!J.anchor&&!J.tag&&!Z&&!X){E===0&&J.comma?l(J.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${h}`):E<r.items.length-1&&l(J.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${h}`),J.comment&&(b.comment?b.comment+=`
|
|
129
129
|
`+J.comment:b.comment=J.comment),x=J.end;continue}!d&&i.options.strict&&mo(G)&&l(G,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(E===0)J.comma&&l(J.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${h}`);else if(J.comma||l(J.start,"MISSING_CHAR",`Missing , between ${h} items`),J.comment){let O="";e:for(const M of V)switch(M.type){case"comma":case"space":break;case"comment":O=M.source.substring(1);break e;default:break e}if(O){let M=b.items[b.items.length-1];St(M)&&(M=M.value??M.key),M.comment?M.comment+=`
|
|
130
130
|
`+O:M.comment=O,J.comment=J.comment.substring(O.length+1)}}if(!d&&!Z&&!J.found){const O=X?e(i,X,J,l):n(i,J.end,Z,null,J,l);b.items.push(O),x=O.range[2],hf(X)&&l(O.range,"BLOCK_IN_FLOW",mf)}else{i.atKey=!0;const O=J.end,M=G?e(i,G,J,l):n(i,O,V,null,J,l);hf(G)&&l(M.range,"BLOCK_IN_FLOW",mf),i.atKey=!1;const le=Ps(Z??[],{flow:h,indicator:"map-value-ind",next:X,offset:M.range[2],onError:l,parentIndent:r.indent,startOnNewline:!1});if(le.found){if(!d&&!J.found&&i.options.strict){if(Z)for(const ve of Z){if(ve===le.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<le.found.offset-1024&&l(le.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 ${h}`):l(le.start,"MISSING_CHAR",`Missing , or : between ${h} items`));const Ae=X?e(i,X,le,l):le.found?n(i,le.end,Z,null,le,l):null;Ae?hf(X)&&l(Ae.range,"BLOCK_IN_FLOW",mf):le.comment&&(M.comment?M.comment+=`
|
|
131
|
-
`+le.comment:M.comment=le.comment);const Ce=new Qt(M,Ae);if(i.options.keepSourceTokens&&(Ce.srcToken=R),d){const ve=b;
|
|
132
|
-
`+E.comment:b.comment=E.comment),b.range=[r.offset,k,E.offset]}else b.range=[r.offset,k,k];return b}function gf(e,n,i,r,l,c){const d=i.type==="block-map"?
|
|
131
|
+
`+le.comment:M.comment=le.comment);const Ce=new Qt(M,Ae);if(i.options.keepSourceTokens&&(Ce.srcToken=R),d){const ve=b;t1(i,ve.items,M)&&l(O,"DUPLICATE_KEY","Map keys must be unique"),ve.items.push(Ce)}else{const ve=new Nn(i.schema);ve.flow=!0,ve.items.push(Ce);const tt=(Ae??M).range;ve.range=[M.range[0],tt[1],tt[2]],b.items.push(ve)}x=Ae?Ae.range[2]:le.end}}const N=d?"}":"]",[A,...T]=r.end;let k=x;if(A?.source===N)k=A.offset+A.source.length;else{const E=h[0].toUpperCase()+h.substring(1),R=S?`${E} must end with a ${N}`:`${E} in block collection must be sufficiently indented and end with a ${N}`;l(x,S?"MISSING_CHAR":"BAD_INDENT",R),A&&A.source.length!==1&&T.unshift(A)}if(T.length>0){const E=So(T,k,i.options.strict,l);E.comment&&(b.comment?b.comment+=`
|
|
132
|
+
`+E.comment:b.comment=E.comment),b.range=[r.offset,k,E.offset]}else b.range=[r.offset,k,k];return b}function gf(e,n,i,r,l,c){const d=i.type==="block-map"?MM(e,n,i,r,c):i.type==="block-seq"?BM(e,n,i,r,c):LM(e,n,i,r,c),h=d.constructor;return l==="!"||l===h.tagName?(d.tag=h.tagName,d):(l&&(d.tag=l),d)}function qM(e,n,i,r,l){const c=r.tag,d=c?n.directives.tagName(c.source,N=>l(c,"TAG_RESOLVE_FAILED",N)):null;if(i.type==="block-seq"){const{anchor:N,newlineAfterProp:A}=r,T=N&&c?N.offset>c.offset?N:c:N??c;T&&(!A||A.offset<T.offset)&&l(T,"MISSING_CHAR","Missing newline after block sequence props")}const h=i.type==="block-map"?"map":i.type==="block-seq"?"seq":i.start.source==="{"?"map":"seq";if(!c||!d||d==="!"||d===Nn.tagName&&h==="map"||d===Ci.tagName&&h==="seq")return gf(e,n,i,l,d);let g=n.schema.tags.find(N=>N.tag===d&&N.collection===h);if(!g){const N=n.schema.knownTags[d];if(N?.collection===h)n.schema.tags.push(Object.assign({},N,{default:!1})),g=N;else return N?l(c,"BAD_COLLECTION_TYPE",`${N.tag} used for ${h} collection, but expects ${N.collection??"scalar"}`,!0):l(c,"TAG_RESOLVE_FAILED",`Unresolved tag: ${d}`,!0),gf(e,n,i,l,d)}const b=gf(e,n,i,l,d,g),S=g.resolve?.(b,N=>l(c,"TAG_RESOLVE_FAILED",N),n.options)??b,x=vt(S)?S:new _e(S);return x.range=b.range,x.tag=d,g?.format&&(x.format=g.format),x}function UM(e,n,i){const r=n.offset,l=$M(n,e.options.strict,i);if(!l)return{value:"",type:null,comment:"",range:[r,r,r]};const c=l.mode===">"?_e.BLOCK_FOLDED:_e.BLOCK_LITERAL,d=n.source?IM(n.source):[];let h=d.length;for(let k=d.length-1;k>=0;--k){const E=d[k][1];if(E===""||E==="\r")h=k;else break}if(h===0){const k=l.chomp==="+"&&d.length>0?`
|
|
133
133
|
`.repeat(Math.max(1,d.length-1)):"";let E=r+l.length;return n.source&&(E+=n.source.length),{value:k,type:c,comment:l.comment,range:[r,E,E]}}let g=n.indent+l.indent,b=n.offset+l.length,S=0;for(let k=0;k<h;++k){const[E,R]=d[k];if(R===""||R==="\r")l.indent===0&&E.length>g&&(g=E.length);else{E.length<g&&i(b+E.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),l.indent===0&&(g=E.length),S=k,g===0&&!e.atRoot&&i(b,"BAD_INDENT","Block scalar values in collections must be indented");break}b+=E.length+R.length+1}for(let k=d.length-1;k>=h;--k)d[k][0].length>g&&(h=k+1);let x="",N="",A=!1;for(let k=0;k<S;++k)x+=d[k][0].slice(g)+`
|
|
134
134
|
`;for(let k=S;k<h;++k){let[E,R]=d[k];b+=E.length+R.length+1;const V=R[R.length-1]==="\r";if(V&&(R=R.slice(0,-1)),R&&E.length<g){const Z=`Block scalar lines must not be less indented than their ${l.indent?"explicit indentation indicator":"first line"}`;i(b-R.length-(V?2:1),"BAD_INDENT",Z),E=""}c===_e.BLOCK_LITERAL?(x+=N+E.slice(g)+R,N=`
|
|
135
135
|
`):E.length>g||R[0]===" "?(N===" "?N=`
|
|
@@ -144,38 +144,38 @@ ${b}
|
|
|
144
144
|
`+d[k][0].slice(g);x[x.length-1]!==`
|
|
145
145
|
`&&(x+=`
|
|
146
146
|
`);break;default:x+=`
|
|
147
|
-
`}const T=r+l.length+n.source.length;return{value:x,type:c,comment:l.comment,range:[r,T,T]}}function
|
|
147
|
+
`}const T=r+l.length+n.source.length;return{value:x,type:c,comment:l.comment,range:[r,T,T]}}function $M({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,h="",g=-1;for(let N=1;N<l.length;++N){const A=l[N];if(!h&&(A==="-"||A==="+"))h=A;else{const T=Number(A);!d&&T?d=T:g===-1&&(g=e+N)}}g!==-1&&r(g,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${l}`);let b=!1,S="",x=l.length;for(let N=1;N<n.length;++N){const A=n[N];switch(A.type){case"space":b=!0;case"newline":x+=A.source.length;break;case"comment":i&&!b&&r(A,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),x+=A.source.length,S=A.source.substring(1);break;case"error":r(A,"UNEXPECTED_TOKEN",A.message),x+=A.source.length;break;default:{const T=`Unexpected token in block scalar header: ${A.type}`;r(A,"UNEXPECTED_TOKEN",T);const k=A.source;k&&typeof k=="string"&&(x+=k.length)}}}return{mode:c,indent:d,chomp:h,comment:S,length:x}}function IM(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 VM(e,n,i){const{offset:r,type:l,source:c,end:d}=e;let h,g;const b=(N,A,T)=>i(r+N,A,T);switch(l){case"scalar":h=_e.PLAIN,g=PM(c,b);break;case"single-quoted-scalar":h=_e.QUOTE_SINGLE,g=GM(c,b);break;case"double-quoted-scalar":h=_e.QUOTE_DOUBLE,g=HM(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 S=r+c.length,x=So(d,S,n,i);return{value:g,type:h,comment:x.comment,range:[r,S,x.offset]}}function PM(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}`),n1(e)}function GM(e,n){return(e[e.length-1]!=="'"||e.length===1)&&n(e.length,"MISSING_CHAR","Missing closing 'quote"),n1(e.slice(1,-1)).replace(/''/g,"'")}function n1(e){let n,i;try{n=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
148
148
|
`,"sy"),i=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
149
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
150
|
`?l+=c:c=`
|
|
151
|
-
`:(l+=c+r[1],c=" "),d=i.lastIndex;const h=/[ \t]*(.*)/sy;return h.lastIndex=d,r=h.exec(e),l+c+(r?.[1]??"")}function
|
|
151
|
+
`:(l+=c+r[1],c=" "),d=i.lastIndex;const h=/[ \t]*(.*)/sy;return h.lastIndex=d,r=h.exec(e),l+c+(r?.[1]??"")}function HM(e,n){let i="";for(let r=1;r<e.length-1;++r){const l=e[r];if(!(l==="\r"&&e[r+1]===`
|
|
152
152
|
`))if(l===`
|
|
153
|
-
`){const{fold:c,offset:d}=
|
|
153
|
+
`){const{fold:c,offset:d}=QM(e,r);i+=c,r=d}else if(l==="\\"){let c=e[++r];const d=KM[c];if(d)i+=d;else if(c===`
|
|
154
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 h={x:2,u:4,U:8}[c];i+=
|
|
155
|
+
`)for(c=e[++r+1];c===" "||c===" ";)c=e[++r+1];else if(c==="x"||c==="u"||c==="U"){const h={x:2,u:4,U:8}[c];i+=ZM(e,r+1,h,n),r+=h}else{const h=e.substr(r-1,2);n(r-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${h}`),i+=h}}else if(l===" "||l===" "){const c=r;let d=e[r+1];for(;d===" "||d===" ";)d=e[++r+1];d!==`
|
|
156
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
|
|
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 QM(e,n){let i="",r=e[n+1];for(;(r===" "||r===" "||r===`
|
|
158
158
|
`||r==="\r")&&!(r==="\r"&&e[n+2]!==`
|
|
159
159
|
`);)r===`
|
|
160
160
|
`&&(i+=`
|
|
161
|
-
`),n+=1,r=e[n+1];return i||(i=" "),{fold:i,offset:n}}const
|
|
162
|
-
`,r:"\r",t:" ",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function
|
|
161
|
+
`),n+=1,r=e[n+1];return i||(i=" "),{fold:i,offset:n}}const KM={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
162
|
+
`,r:"\r",t:" ",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function ZM(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 h=e.substr(n-2,i+2);return r(n-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${h}`),h}return String.fromCodePoint(d)}function a1(e,n,i,r){const{value:l,type:c,comment:d,range:h}=n.type==="block-scalar"?UM(e,n,r):VM(n,e.options.strict,r),g=i?e.directives.tagName(i.source,x=>r(i,"TAG_RESOLVE_FAILED",x)):null;let b;e.options.stringKeys&&e.atKey?b=e.schema[Hn]:g?b=YM(e.schema,l,g,i,r):n.type==="scalar"?b=XM(e,l,n,r):b=e.schema[Hn];let S;try{const x=b.resolve(l,N=>r(i??n,"TAG_RESOLVE_FAILED",N),e.options);S=at(x)?x:new _e(x)}catch(x){const N=x instanceof Error?x.message:String(x);r(i??n,"TAG_RESOLVE_FAILED",N),S=new _e(l)}return S.range=h,S.source=l,c&&(S.type=c),g&&(S.tag=g),b.format&&(S.format=b.format),d&&(S.comment=d),S}function YM(e,n,i,r,l){if(i==="!")return e[Hn];const c=[];for(const h of e.tags)if(!h.collection&&h.tag===i)if(h.default&&h.test)c.push(h);else return h;for(const h of c)if(h.test?.test(n))return h;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 XM({atKey:e,directives:n,schema:i},r,l,c){const d=i.tags.find(h=>(h.default===!0||e&&h.default==="key")&&h.test?.test(r))||i[Hn];if(i.compat){const h=i.compat.find(g=>g.default&&g.test?.test(r))??i[Hn];if(d.tag!==h.tag){const g=n.tagString(d.tag),b=n.tagString(h.tag),S=`Value may be parsed as either ${g} or ${b}`;c(l,"TAG_RESOLVE_FAILED",S,!0)}}return d}function JM(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 FM={composeNode:i1,composeEmptyNode:Gp};function i1(e,n,i,r){const l=e.atKey,{spaceBefore:c,comment:d,anchor:h,tag:g}=i;let b,S=!0;switch(n.type){case"alias":b=WM(e,n,r),(h||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=a1(e,n,g,r),h&&(b.anchor=h.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":b=qM(FM,e,n,i,r),h&&(b.anchor=h.source.substring(1));break;default:{const x=n.type==="error"?n.message:`Unsupported token (type: ${n.type})`;r(n,"UNEXPECTED_TOKEN",x),b=Gp(e,n.offset,void 0,null,i,r),S=!1}}return h&&b.anchor===""&&r(h,"BAD_ALIAS","Anchor cannot be an empty string"),l&&e.options.stringKeys&&(!at(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&&S&&(b.srcToken=n),b}function Gp(e,n,i,r,{spaceBefore:l,comment:c,anchor:d,tag:h,end:g},b){const S={type:"scalar",offset:JM(n,i,r),indent:-1,source:""},x=a1(e,S,h,b);return d&&(x.anchor=d.source.substring(1),x.anchor===""&&b(d,"BAD_ALIAS","Anchor cannot be an empty string")),l&&(x.spaceBefore=!0),c&&(x.comment=c,x.range[2]=g),x}function WM({options:e},{offset:n,source:i,end:r},l){const c=new Op(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,h=So(r,d,e.strict,l);return c.range=[n,d,h.offset],h.comment&&(c.comment=h.comment),c}function e5(e,n,{offset:i,start:r,value:l,end:c},d){const h=Object.assign({_directives:n},e),g=new Bc(void 0,h),b={atKey:!1,atRoot:!0,directives:g.directives,options:g.options,schema:g.schema},S=Ps(r,{indicator:"doc-start",next:l??c?.[0],offset:i,onError:d,parentIndent:0,startOnNewline:!0});S.found&&(g.directives.docStart=!0,l&&(l.type==="block-map"||l.type==="block-seq")&&!S.hasNewline&&d(S.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),g.contents=l?i1(b,l,S,d):Gp(b,S.end,r,null,S,d);const x=g.contents.range[2],N=So(c,x,!1,d);return N.comment&&(g.comment=N.comment),g.range=[i,x,N.offset],g}function ao(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 iv(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
163
|
|
|
164
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
|
|
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 t5{constructor(n={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(i,r,l,c)=>{const d=ao(i);c?this.warnings.push(new RM(d,r,l)):this.errors.push(new Yl(d,r,l))},this.directives=new Gt({version:n.version||"1.2"}),this.options=n}decorate(n,i){const{comment:r,afterEmptyLine:l}=iv(this.prelude);if(r){const c=n.contents;if(i)n.comment=n.comment?`${n.comment}
|
|
166
166
|
${r}`:r;else if(l||n.directives.docStart||!c)n.commentBefore=r;else if(bt(c)&&!c.flow&&c.items.length>0){let d=c.items[0];St(d)&&(d=d.key);const h=d.commentBefore;d.commentBefore=h?`${r}
|
|
167
167
|
${h}`: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:iv(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=ao(n);c[0]+=i,this.onError(c,"BAD_DIRECTIVE",r,l)}),this.prelude.push(n.source),this.atDirectives=!0;break;case"document":{const i=
|
|
169
|
-
${i.comment}`:i.comment}this.doc.range[2]=i.offset;break}default:this.errors.push(new Yl(ao(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 Bc(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
|
|
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:iv(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=ao(n);c[0]+=i,this.onError(c,"BAD_DIRECTIVE",r,l)}),this.prelude.push(n.source),this.atDirectives=!0;break;case"document":{const i=e5(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 Yl(ao(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 Yl(ao(n),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;const i=So(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 Yl(ao(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 Bc(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 s1="\uFEFF",r1="",o1="",$f="";function n5(e){switch(e){case s1:return"byte-order-mark";case r1:return"doc-mode";case o1:return"flow-error-end";case $f:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
170
170
|
`:case`\r
|
|
171
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 Mn(e){switch(e){case void 0:case" ":case`
|
|
172
|
-
`:case"\r":case" ":return!0;default:return!1}}const sv=new Set("0123456789ABCDEFabcdef"),
|
|
173
|
-
\r `),yf=e=>!e||
|
|
172
|
+
`:case"\r":case" ":return!0;default:return!1}}const sv=new Set("0123456789ABCDEFabcdef"),a5=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Xl=new Set(",[]{}"),i5=new Set(` ,[]{}
|
|
173
|
+
\r `),yf=e=>!e||i5.has(e);class s5{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
174
|
`?!0:i==="\r"?this.buffer[n+1]===`
|
|
175
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
176
|
`||!l&&!this.atEnd)return n+r+1}return i===`
|
|
177
177
|
`||r>=this.indentNext||!i&&!this.atEnd?n+r:-1}if(i==="-"||i==="."){const r=this.buffer.substr(n,3);if((r==="---"||r==="...")&&Mn(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]===
|
|
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]===s1&&(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 r1,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==="...")&&Mn(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&&!Mn(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===":")&&Mn(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(yf),"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("..."))&&Mn(l[3]))&&!(r===this.indentNext-1&&this.flowLevel===1&&(l[0]==="]"||l[0]==="}")))return this.flowLevel=0,yield o1,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(yf),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const d=this.charAt(1);if(this.flowKey||Mn(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
179
|
`,this.pos);if(l!==-1){for(;l!==-1;){const c=this.continueScalar(l+1);if(c===-1)break;l=r.indexOf(`
|
|
180
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=>Mn(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
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===`
|
|
@@ -185,13 +185,13 @@ ${i.comment}`:i.comment}this.doc.range[2]=i.offset;break}default:this.errors.pus
|
|
|
185
185
|
`&&c>=this.pos&&c+1+i>h)n=c;else break}while(!0);return yield $f,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(Mn(c)||n&&Xl.has(c))break;i=r}else if(Mn(l)){let c=this.buffer[r+1];if(l==="\r"&&(c===`
|
|
186
186
|
`?(r+=1,l=`
|
|
187
187
|
`,c=this.buffer[r+1]):i=r),c==="#"||n&&Xl.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&&Xl.has(l))break;i=r}return!l&&!this.atEnd?this.setNext("plain-scalar"):(yield $f,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(yf))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const n=this.flowLevel>0,i=this.charAt(1);if(Mn(i)||n&&Xl.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(;!Mn(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(
|
|
188
|
+
`){const d=this.continueScalar(r+1);if(d===-1)break;r=Math.max(r,d-2)}}else{if(n&&Xl.has(l))break;i=r}return!l&&!this.atEnd?this.setNext("plain-scalar"):(yield $f,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(yf))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const n=this.flowLevel>0,i=this.charAt(1);if(Mn(i)||n&&Xl.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(;!Mn(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(a5.has(i))i=this.buffer[++n];else if(i==="%"&&sv.has(this.buffer[n+1])&&sv.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
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
|
|
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 r5{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 Ka(e,n){for(let i=0;i<e.length;++i)if(e[i].type===n)return!0;return!1}function rv(e){for(let n=0;n<e.length;++n)switch(e[n].type){case"space":case"comment":case"newline":break;default:return n}return-1}function l1(e){switch(e?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Jl(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 zs(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 ov(e){if(e.start.type==="flow-seq-start")for(const n of e.items)n.sep&&!n.value&&!Ka(n.start,"explicit-key-ind")&&!Ka(n.sep,"map-value-ind")&&(n.key&&(n.value=n.key),delete n.key,l1(n.value)?n.value.end?Array.prototype.push.apply(n.value.end,n.sep):n.value.end=n.sep:Array.prototype.push.apply(n.start,n.sep),delete n.sep)}class o5{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 s5,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=n5(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"&&ov(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&&rv(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":{rv(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=Jl(this.peek(2)),r=zs(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
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 h=0;h<i.sep.length;++h){const g=i.sep[h];switch(g.type){case"newline":d.push(h);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(Ka(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(
|
|
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 h=0;h<i.sep.length;++h){const g=i.sep[h];switch(g.type){case"newline":d.push(h);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(Ka(i.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:c,key:null,sep:[this.sourceToken]}]});else if(l1(i.key)&&!Ka(i.sep,"newline")){const d=zs(i.start),h=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:h,sep:g}]})}else c.length>0?i.sep=i.sep.concat(c,this.sourceToken):i.sep.push(this.sourceToken);else if(Ka(i.start,"newline"))Object.assign(i,{key:null,sep:[this.sourceToken]});else{const d=zs(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]}):Ka(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&&!Ka(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||Ka(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=Jl(r),c=zs(l);ov(n);const d=n.end.splice(1,n.end.length);d.push(this.sourceToken);const h={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]=h}else yield*this.lineEnd(n)}}flowScalar(n){if(this.onNewLine){let i=this.source.indexOf(`
|
|
193
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=Jl(n),r=zs(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=Jl(n),r=zs(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
|
|
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=Jl(n),r=zs(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=Jl(n),r=zs(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 l5(e){const n=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||n&&new r5||null,prettyErrors:n}}function c5(e,n={}){const{lineCounter:i,prettyErrors:r}=l5(n),l=new o5(i?.addNewLine),c=new t5(n),d=Array.from(c.compose(l.parse(e)));if(r&&i)for(const h of d)h.errors.forEach(nv(e,i)),h.warnings.forEach(nv(e,i));return d.length>0?d:Object.assign([],{empty:!0},c.streamInfo())}function u5({onApplied:e}){const[n,i]=q.useState(""),[r,l]=q.useState(!1),[c,d]=q.useState([]),[h,g]=q.useState([]),b=async()=>{if(!n.trim())return;l(!0),d([]),g([]);const S=c5(n),x=[],N=[];for(let A=0;A<S.length;A++){const T=S[A];if(T.errors.length>0){x.push(`Document ${A+1}: ${T.errors[0]?.message}`);continue}const k=T.toJSON();if(!(!k||typeof k!="object"))try{const E=await zk(k);N.push(`Applied "${E.displayName||E.name}" (revision ${E.configRevision})`)}catch(E){x.push(`Document ${A+1}: ${E instanceof Error?E.message:String(E)}`)}}d(N),g(x),l(!1),N.length>0&&(en({title:"YAML applied",detail:`Applied ${N.length} document${N.length===1?"":"s"} successfully.`,tone:x.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
195
|
kind: Project
|
|
196
196
|
metadata:
|
|
197
197
|
name: my-project
|
|
@@ -199,12 +199,12 @@ spec:
|
|
|
199
199
|
canonicalDomain: example.com
|
|
200
200
|
country: US
|
|
201
201
|
language: en
|
|
202
|
-
queries: []`,value:n,onChange:S=>i(S.target.value)}),c.length>0&&f.jsx("ul",{className:"mt-2 space-y-1",children:c.map((S,x)=>f.jsx("li",{className:"text-emerald-400 text-sm",children:S},x))}),h.length>0&&f.jsx("ul",{className:"mt-2 space-y-1",children:h.map((S,x)=>f.jsx("li",{className:"text-rose-400 text-sm",children:S},x))}),f.jsx("div",{className:"mt-3",children:f.jsx(Ue,{type:"button",disabled:!n.trim()||r,onClick:wn(b),children:r?"Applying...":"Apply"})})]})}function c5(){const{dashboard:e,isLoading:n,refetch:i}=Ac();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(O=>f.jsx("div",{className:"skeleton-text-sm w-16"},O))}),[1,2,3].map(O=>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"})]},O))]})]});const r=e.projects,l=hc(),[c,d]=q.useState(!1),[h,g]=q.useState(""),[b,S]=q.useState(""),[x,N]=q.useState(""),[A,T]=q.useState("US"),[k,E]=q.useState("en"),[R,V]=q.useState(!1),[G,Z]=q.useState(null),X=h.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),J=async()=>{if(!(!X||!x)){V(!0),Z(null);try{const O=await ho(X,{displayName:b||h,canonicalDomain:x,country:A,language:k});en({title:"Project created",detail:`${O.displayName||O.name} is ready to configure.`,tone:"positive",dedupeKey:`project:create:${O.name}`,dedupeMode:"drop"}),i(),g(""),S(""),N(""),T("US"),E("en"),d(!1),l({to:"/projects/$projectId",params:{projectId:O.id}})}catch(O){Z(O instanceof Error?O.message:"Failed to create project")}finally{V(!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(Ue,{type:"button",onClick:()=>d(O=>!O),children:[f.jsx(Yy,{className:"size-4 mr-1.5"}),"Add project"]})})]}),c?f.jsxs(jn,{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:h,onChange:O=>g(O.target.value)}),X&&X!==h?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:O=>S(O.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:x,onChange:O=>N(O.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:A,onChange:O=>T(O.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:k,onChange:O=>E(O.target.value.toLowerCase())})]})]})]}),G?f.jsx("p",{className:"text-rose-400 text-sm mt-3",children:G}):null,f.jsxs("div",{className:"flex items-center gap-3 mt-4",children:[f.jsx(Ue,{type:"button",disabled:!X||!x||R,onClick:wn(J),children:R?"Creating...":"Create project"}),f.jsx(Ue,{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(O=>{const M=O.recentRuns[0];return f.jsxs("tr",{className:"cursor-pointer",onClick:()=>{l({to:"/projects/$projectId",params:{projectId:O.project.id}})},children:[f.jsxs("td",{children:[f.jsx(rt,{to:"/projects/$projectId",params:{projectId:O.project.id},className:"text-zinc-100 font-medium hover:underline",onClick:le=>le.stopPropagation(),children:O.project.displayName||O.project.name}),f.jsx("p",{className:"text-[11px] text-zinc-500",children:O.project.name})]}),f.jsx("td",{className:"text-zinc-400",children:O.project.canonicalDomain}),f.jsx("td",{children:f.jsx(Ln,{tone:O.mentionSummary.tone,children:O.mentionSummary.value})}),f.jsx("td",{className:"text-zinc-500 text-sm",children:M?f.jsx(jp,{status:M.status}):f.jsx("span",{className:"text-zinc-600",children:"No runs"})}),f.jsx("td",{className:"text-right text-zinc-500",children:O.project.country})]},O.project.id)})})]})}):c?null:f.jsxs(jn,{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(Ue,{type:"button",onClick:()=>d(!0),children:[f.jsx(Yy,{className:"size-4 mr-1.5"}),"Add project"]})]}),f.jsx(l5,{onApplied:()=>{i()}})]})}function l1(e){e.invalidateQueries({queryKey:vp({client:ae})}),e.invalidateQueries({queryKey:Js({client:ae})})}function u5(e){return e==="gsc-sync"?"GSC sync queued":e==="inspect-sitemap"?"Sitemap inspection queued":"Visibility sweep queued"}function d5(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 Lc(e,n){X0({id:e.id,projectId:e.projectId,kind:e.kind,projectLabel:n.projectLabel,sourceAction:n.sourceAction,lastAnnouncedStatus:"queued"}),en({title:u5(e.kind),detail:d5(n.projectLabel,e.kind),tone:"neutral",dedupeKey:`run:${e.id}`,dedupeMode:"replace"})}function f5(e){const n=e.filter(l=>l.status!=="conflict"),i=e.filter(l=>l.status==="conflict");if(n.length===0){en({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)X0({id:l.id,projectId:l.projectId,kind:l.kind,projectLabel:l.projectName,sourceAction:"run-all",lastAnnouncedStatus:"queued"});const r=TD({runIds:n.map(l=>l.id),queuedCount:n.length,skippedCount:i.length});en({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 qc(e,n){if(e instanceof Gn&&e.code==="RUN_IN_PROGRESS"){en({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}en({title:e instanceof Error?e.message:"Failed to queue run",tone:"negative"})}function p5(){const e=Ja();return zi({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:n,opts:i})=>jk(n,i),onSuccess:(n,i)=>{l1(e),Lc(n,{projectLabel:i.projectLabel??i.projectName,sourceAction:i.sourceAction})},onError:(n,i)=>{qc(n,{projectKey:i.projectName,projectLabel:i.projectLabel??i.projectName,sourceAction:i.sourceAction})}})}function m6(){const e=Ja();return zi({meta:{skipGlobalErrorToast:!0},mutationFn:n=>zk(n),onSuccess:n=>{l1(e),f5(n)},onError:n=>{en({title:n instanceof Error?n.message:"Failed to queue runs",tone:"negative"})}})}function h6(){const e=Ja();return zi({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:n,opts:i})=>Tk(n,i),onSuccess:(n,i)=>{fo(e,ke["gsc-sync"],i.projectName),Lc(n,{projectLabel:i.projectLabel??i.projectName,sourceAction:"gsc-sync"})},onError:(n,i)=>{qc(n,{projectKey:i.projectName,projectLabel:i.projectLabel??i.projectName,sourceAction:"gsc-sync"})}})}function g6(){const e=Ja();return zi({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:n})=>Dk(n),onSuccess:(n,i)=>{fo(e,n.run.kind,i.projectName),Lc(n.run,{projectLabel:i.projectLabel??i.projectName,sourceAction:"discover-sitemaps"})},onError:(n,i)=>{qc(n,{projectKey:i.projectName,projectLabel:i.projectLabel??i.projectName,sourceAction:"discover-sitemaps"})}})}function y6(){const e=Ja();return zi({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:n,opts:i})=>Ok(n,i),onSuccess:(n,i)=>{fo(e,ke["inspect-sitemap"],i.projectName),Lc(n,{projectLabel:i.projectLabel??i.projectName,sourceAction:"inspect-sitemap"})},onError:(n,i)=>{qc(n,{projectKey:i.projectName,projectLabel:i.projectLabel??i.projectName,sourceAction:"inspect-sitemap"})}})}function c1(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 b6(){const e=Ja();return zi({mutationFn:({projectName:n,queries:i})=>Sk(n,i),onSuccess:()=>{e.invalidateQueries({queryKey:Js({client:ae})}),e.invalidateQueries({predicate:c1})}})}function v6(){const e=Ja();return zi({mutationFn:({projectName:n,body:i})=>xk(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:c1})}})}const m5=[{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 h5({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 g5(){const e=go(),{dashboard:n,isLoading:i,refetch:r}=Ac(),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(te=>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"})]},te))})]})]});const c=l.settings,g=kp(!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=ND(l.setup,g,c),S=hc(),[x,N]=q.useState(0),[A,T]=q.useState(""),[k,E]=q.useState(""),[R,V]=q.useState(""),[G,Z]=q.useState("US"),[X,J]=q.useState("en"),[O,M]=q.useState(!1),[le,Ae]=q.useState(null),[Ce,ve]=q.useState(null),[tt,oe]=q.useState(null),[me,$]=q.useState(!1),[W,fe]=q.useState(""),[je,se]=q.useState(!1),[Ze,F]=q.useState(null),[ue,ee]=q.useState(!1),de=c.providerStatuses.filter(te=>te.state==="ready"),[ne,Ne]=q.useState(de[0]?.name??""),[nt,xe]=q.useState(5),[$e,He]=q.useState(!1),[Et,zn]=q.useState(null),[Ot,nr]=q.useState(""),[Di,Uc]=q.useState(!1),[ar,Ri]=q.useState(null),[Mi,Bi]=q.useState(!1),[xo,$c]=q.useState(!1),[Ut,wo]=q.useState(!1),[ir,jo]=q.useState(null),Li=p5(),Ic=dn({...Q0({client:ae,path:{id:ir??""}}),enabled:!!ir,refetchInterval:({state:te})=>{const Fe=te.data?.status;return Fe==="completed"||Fe==="partial"||Fe==="failed"||Fe==="cancelled"?!1:2e3},refetchIntervalInBackground:!0}),[qi,No]=q.useState(""),[sr,va]=q.useState(!1),[$t,Tn]=q.useState(null),ht=A.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),Un=W.split(`
|
|
202
|
+
queries: []`,value:n,onChange:S=>i(S.target.value)}),c.length>0&&f.jsx("ul",{className:"mt-2 space-y-1",children:c.map((S,x)=>f.jsx("li",{className:"text-emerald-400 text-sm",children:S},x))}),h.length>0&&f.jsx("ul",{className:"mt-2 space-y-1",children:h.map((S,x)=>f.jsx("li",{className:"text-rose-400 text-sm",children:S},x))}),f.jsx("div",{className:"mt-3",children:f.jsx(Ue,{type:"button",disabled:!n.trim()||r,onClick:wn(b),children:r?"Applying...":"Apply"})})]})}function d5(){const{dashboard:e,isLoading:n,refetch:i}=Ac();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(O=>f.jsx("div",{className:"skeleton-text-sm w-16"},O))}),[1,2,3].map(O=>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"})]},O))]})]});const r=e.projects,l=hc(),[c,d]=q.useState(!1),[h,g]=q.useState(""),[b,S]=q.useState(""),[x,N]=q.useState(""),[A,T]=q.useState("US"),[k,E]=q.useState("en"),[R,V]=q.useState(!1),[G,Z]=q.useState(null),X=h.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),J=async()=>{if(!(!X||!x)){V(!0),Z(null);try{const O=await ho(X,{displayName:b||h,canonicalDomain:x,country:A,language:k});en({title:"Project created",detail:`${O.displayName||O.name} is ready to configure.`,tone:"positive",dedupeKey:`project:create:${O.name}`,dedupeMode:"drop"}),i(),g(""),S(""),N(""),T("US"),E("en"),d(!1),l({to:"/projects/$projectId",params:{projectId:O.id}})}catch(O){Z(O instanceof Error?O.message:"Failed to create project")}finally{V(!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(Ue,{type:"button",onClick:()=>d(O=>!O),children:[f.jsx(Yy,{className:"size-4 mr-1.5"}),"Add project"]})})]}),c?f.jsxs(jn,{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:h,onChange:O=>g(O.target.value)}),X&&X!==h?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:O=>S(O.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:x,onChange:O=>N(O.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:A,onChange:O=>T(O.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:k,onChange:O=>E(O.target.value.toLowerCase())})]})]})]}),G?f.jsx("p",{className:"text-rose-400 text-sm mt-3",children:G}):null,f.jsxs("div",{className:"flex items-center gap-3 mt-4",children:[f.jsx(Ue,{type:"button",disabled:!X||!x||R,onClick:wn(J),children:R?"Creating...":"Create project"}),f.jsx(Ue,{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(O=>{const M=O.recentRuns[0];return f.jsxs("tr",{className:"cursor-pointer",onClick:()=>{l({to:"/projects/$projectId",params:{projectId:O.project.id}})},children:[f.jsxs("td",{children:[f.jsx(rt,{to:"/projects/$projectId",params:{projectId:O.project.id},className:"text-zinc-100 font-medium hover:underline",onClick:le=>le.stopPropagation(),children:O.project.displayName||O.project.name}),f.jsx("p",{className:"text-[11px] text-zinc-500",children:O.project.name})]}),f.jsx("td",{className:"text-zinc-400",children:O.project.canonicalDomain}),f.jsx("td",{children:f.jsx(Ln,{tone:O.mentionSummary.tone,children:O.mentionSummary.value})}),f.jsx("td",{className:"text-zinc-500 text-sm",children:M?f.jsx(jp,{status:M.status}):f.jsx("span",{className:"text-zinc-600",children:"No runs"})}),f.jsx("td",{className:"text-right text-zinc-500",children:O.project.country})]},O.project.id)})})]})}):c?null:f.jsxs(jn,{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(Ue,{type:"button",onClick:()=>d(!0),children:[f.jsx(Yy,{className:"size-4 mr-1.5"}),"Add project"]})]}),f.jsx(u5,{onApplied:()=>{i()}})]})}function c1(e){e.invalidateQueries({queryKey:vp({client:ie})}),e.invalidateQueries({queryKey:Js({client:ie})})}function f5(e){return e==="gsc-sync"?"GSC sync queued":e==="inspect-sitemap"?"Sitemap inspection queued":"Visibility sweep queued"}function p5(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 Lc(e,n){J0({id:e.id,projectId:e.projectId,kind:e.kind,projectLabel:n.projectLabel,sourceAction:n.sourceAction,lastAnnouncedStatus:"queued"}),en({title:f5(e.kind),detail:p5(n.projectLabel,e.kind),tone:"neutral",dedupeKey:`run:${e.id}`,dedupeMode:"replace"})}function m5(e){const n=e.filter(l=>l.status!=="conflict"),i=e.filter(l=>l.status==="conflict");if(n.length===0){en({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)J0({id:l.id,projectId:l.projectId,kind:l.kind,projectLabel:l.projectName,sourceAction:"run-all",lastAnnouncedStatus:"queued"});const r=OD({runIds:n.map(l=>l.id),queuedCount:n.length,skippedCount:i.length});en({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 qc(e,n){if(e instanceof Gn&&e.code==="RUN_IN_PROGRESS"){en({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}en({title:e instanceof Error?e.message:"Failed to queue run",tone:"negative"})}function h5(){const e=Ja();return zi({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:n,opts:i})=>Nk(n,i),onSuccess:(n,i)=>{c1(e),Lc(n,{projectLabel:i.projectLabel??i.projectName,sourceAction:i.sourceAction})},onError:(n,i)=>{qc(n,{projectKey:i.projectName,projectLabel:i.projectLabel??i.projectName,sourceAction:i.sourceAction})}})}function g6(){const e=Ja();return zi({meta:{skipGlobalErrorToast:!0},mutationFn:n=>Tk(n),onSuccess:n=>{c1(e),m5(n)},onError:n=>{en({title:n instanceof Error?n.message:"Failed to queue runs",tone:"negative"})}})}function y6(){const e=Ja();return zi({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:n,opts:i})=>Ek(n,i),onSuccess:(n,i)=>{fo(e,ke["gsc-sync"],i.projectName),Lc(n,{projectLabel:i.projectLabel??i.projectName,sourceAction:"gsc-sync"})},onError:(n,i)=>{qc(n,{projectKey:i.projectName,projectLabel:i.projectLabel??i.projectName,sourceAction:"gsc-sync"})}})}function b6(){const e=Ja();return zi({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:n})=>Rk(n),onSuccess:(n,i)=>{fo(e,n.run.kind,i.projectName),Lc(n.run,{projectLabel:i.projectLabel??i.projectName,sourceAction:"discover-sitemaps"})},onError:(n,i)=>{qc(n,{projectKey:i.projectName,projectLabel:i.projectLabel??i.projectName,sourceAction:"discover-sitemaps"})}})}function v6(){const e=Ja();return zi({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:n,opts:i})=>Dk(n,i),onSuccess:(n,i)=>{fo(e,ke["inspect-sitemap"],i.projectName),Lc(n,{projectLabel:i.projectLabel??i.projectName,sourceAction:"inspect-sitemap"})},onError:(n,i)=>{qc(n,{projectKey:i.projectName,projectLabel:i.projectLabel??i.projectName,sourceAction:"inspect-sitemap"})}})}function u1(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 S6(){const e=Ja();return zi({mutationFn:({projectName:n,queries:i})=>xk(n,i),onSuccess:()=>{e.invalidateQueries({queryKey:Js({client:ie})}),e.invalidateQueries({predicate:u1})}})}function x6(){const e=Ja();return zi({mutationFn:({projectName:n,body:i})=>wk(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:u1})}})}const g5=[{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 y5({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 b5(){const e=go(),{dashboard:n,isLoading:i,refetch:r}=Ac(),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(te=>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"})]},te))})]})]});const c=l.settings,g=kp(!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=AD(l.setup,g,c),S=hc(),[x,N]=q.useState(0),[A,T]=q.useState(""),[k,E]=q.useState(""),[R,V]=q.useState(""),[G,Z]=q.useState("US"),[X,J]=q.useState("en"),[O,M]=q.useState(!1),[le,Ae]=q.useState(null),[Ce,ve]=q.useState(null),[tt,oe]=q.useState(null),[me,$]=q.useState(!1),[W,fe]=q.useState(""),[je,se]=q.useState(!1),[Ze,F]=q.useState(null),[ue,ee]=q.useState(!1),de=c.providerStatuses.filter(te=>te.state==="ready"),[ne,Ne]=q.useState(de[0]?.name??""),[nt,xe]=q.useState(5),[$e,He]=q.useState(!1),[Et,zn]=q.useState(null),[Ot,nr]=q.useState(""),[Di,Uc]=q.useState(!1),[ar,Ri]=q.useState(null),[Mi,Bi]=q.useState(!1),[xo,$c]=q.useState(!1),[Ut,wo]=q.useState(!1),[ir,jo]=q.useState(null),Li=h5(),Ic=dn({...K0({client:ie,path:{id:ir??""}}),enabled:!!ir,refetchInterval:({state:te})=>{const Fe=te.data?.status;return Fe==="completed"||Fe==="partial"||Fe==="failed"||Fe==="cancelled"?!1:2e3},refetchIntervalInBackground:!0}),[qi,No]=q.useState(""),[sr,va]=q.useState(!1),[$t,Tn]=q.useState(null),ht=A.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),Un=W.split(`
|
|
203
203
|
`).map(te=>te.trim()).filter(Boolean),ti=Ot.split(`
|
|
204
|
-
`).map(te=>te.trim()).filter(Boolean),Vc=b.healthChecks.some(te=>te.id==="api"&&te.state==="ready"),Ui=async()=>{if(!(!ht||!R)){$(!0),oe(null);try{const te=await ho(ht,{displayName:k||A,canonicalDomain:R,country:G,language:X,autoExtractBacklinks:O});Ae(ht),ve(te.id),en({title:"Project created",detail:`${te.displayName||te.name} is ready for setup.`,tone:"positive",dedupeKey:`project:create:${te.name}`,dedupeMode:"drop"}),await r(),N(2)}catch(te){oe(te instanceof Error?te.message:"Failed to create project")}finally{$(!1)}}},$i=async()=>{if(!le)return;const te=Un;if(te.length!==0){ee(!0),F(null);try{await
|
|
204
|
+
`).map(te=>te.trim()).filter(Boolean),Vc=b.healthChecks.some(te=>te.id==="api"&&te.state==="ready"),Ui=async()=>{if(!(!ht||!R)){$(!0),oe(null);try{const te=await ho(ht,{displayName:k||A,canonicalDomain:R,country:G,language:X,autoExtractBacklinks:O});Ae(ht),ve(te.id),en({title:"Project created",detail:`${te.displayName||te.name} is ready for setup.`,tone:"positive",dedupeKey:`project:create:${te.name}`,dedupeMode:"drop"}),await r(),N(2)}catch(te){oe(te instanceof Error?te.message:"Failed to create project")}finally{$(!1)}}},$i=async()=>{if(!le)return;const te=Un;if(te.length!==0){ee(!0),F(null);try{await Sk(le,te),se(!0),await r(),N(3)}catch(Fe){F(Fe instanceof Error?Fe.message:"Failed to save queries")}finally{ee(!1)}}},Ii=async()=>{if(!(!le||!ne)){He(!0),zn(null);try{const te=await Ck(le,ne,nt);if(te.queries.length>0){const Fe=W?W.trimEnd()+`
|
|
205
205
|
`+te.queries.join(`
|
|
206
206
|
`):te.queries.join(`
|
|
207
|
-
`);fe(Fe)}}catch(te){zn(te instanceof Error?te.message:"Failed to generate queries")}finally{He(!1)}}},Kn=async()=>{if(!le)return;const te=ti;if(te.length!==0){Bi(!0),Ri(null);try{await
|
|
207
|
+
`);fe(Fe)}}catch(te){zn(te instanceof Error?te.message:"Failed to generate queries")}finally{He(!1)}}},Kn=async()=>{if(!le)return;const te=ti;if(te.length!==0){Bi(!0),Ri(null);try{await jk(le,te),Uc(!0),await r(),N(4)}catch(Fe){Ri(Fe instanceof Error?Fe.message:"Failed to save competitors")}finally{Bi(!1)}}},Vi=async()=>{const te=qi.trim();if(te){va(!0),Tn(null);try{await _k("gemini",{apiKey:te}),en({title:"Gemini configured",detail:"Provider is ready — continuing setup.",tone:"positive",dedupeKey:"setup:gemini:configured",dedupeMode:"drop"}),No(""),await r()}catch(Fe){Tn(Fe instanceof Error?Fe.message:"Failed to save Gemini key")}finally{va(!1)}}},ni=async()=>{if(le){wo(!0);try{const te=await Li.mutateAsync({projectName:le,projectLabel:k||A||le,sourceAction:"setup-launch"});jo(te.id),$c(!0),await r()}catch{}finally{wo(!1)}}},Zn=()=>N(te=>Math.max(0,te-1)),ko=(()=>{switch(x){case 0:return f.jsxs(jn,{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(te=>f.jsxs("div",{className:"health-check-row",children:[f.jsxs("div",{children:[f.jsx("p",{className:"run-row-title",children:te.label}),f.jsx("p",{className:"supporting-copy",children:te.detail}),te.id==="provider"&&te.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:qi,onChange:Fe=>No(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:sr}),f.jsx(Ue,{type:"button",size:"sm",disabled:sr||!qi.trim(),onClick:wn(Vi),children:sr?"Saving...":"Save"})]}),$t&&f.jsx("p",{className:"text-xs text-rose-400",children:$t}),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(Ln,{tone:te.state==="ready"?"positive":"caution",title:te.id==="api"?Is(g.apiStatus):te.id==="worker"?Is(g.workerStatus):te.detail,children:te.state==="ready"?"Ready":"Attention"})]},te.id))}),f.jsxs("div",{className:"setup-nav",children:[f.jsx("span",{}),f.jsx(Ue,{type:"button",disabled:!Vc,onClick:()=>N(1),children:"Continue"})]})]});case 1:return f.jsxs(jn,{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"})]}),le?f.jsx(Ln,{tone:"positive",children:"Created"}):null]}),le?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:le})," created successfully."]}),f.jsxs("div",{className:"setup-nav",children:[f.jsx(Ue,{type:"button",variant:"outline",onClick:Zn,children:"Back"}),f.jsx(Ue,{type:"button",onClick:()=>N(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:A,onChange:te=>T(te.target.value)}),ht&&ht!==A?f.jsxs("p",{className:"supporting-copy",children:["Slug: ",ht]}):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:k,onChange:te=>E(te.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:te=>V(te.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:G,onChange:te=>Z(te.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:te=>J(te.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:O,onChange:te=>M(te.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"})]})]})]}),tt?f.jsx("p",{className:"text-rose-400 text-sm",children:tt}):null,f.jsxs("div",{className:"setup-nav",children:[f.jsx(Ue,{type:"button",variant:"outline",onClick:Zn,children:"Back"}),f.jsx(Ue,{type:"button",disabled:!ht||!R||me,onClick:wn(Ui),children:me?"Creating...":"Create project"})]})]})]});case 2:return f.jsxs(jn,{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(Ln,{tone:"positive",children:[Un.length," saved"]}):f.jsxs(Ln,{tone:"neutral",children:[Un.length," quer",Un.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:Un.map(te=>f.jsx("li",{children:te},te))}),f.jsxs("div",{className:"setup-nav",children:[f.jsx(Ue,{type:"button",variant:"outline",onClick:Zn,children:"Back"}),f.jsx(Ue,{type:"button",onClick:()=>N(3),children:"Continue"})]})]}):f.jsxs("div",{className:"compact-stack",children:[de.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:te=>Ne(te.target.value),children:de.map(te=>f.jsxs("option",{value:te.name,children:[te.displayName??te.name,te.model?` (${te.model})`:""]},te.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:nt,onChange:te=>xe(Number(te.target.value)),children:[3,5,10,15,20].map(te=>f.jsx("option",{value:te,children:te},te))})]}),f.jsx(Ue,{type:"button",variant:"outline",disabled:$e||!ne,onClick:wn(Ii),children:$e?"Analyzing site...":"Generate"})]}),Et?f.jsx("p",{className:"text-rose-400 text-sm",children:Et}):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
208
|
best invisalign downtown brooklyn
|
|
209
209
|
pediatric dentist brooklyn heights`,value:W,onChange:te=>fe(te.target.value)})]}),Ze?f.jsx("p",{className:"text-rose-400 text-sm",children:Ze}):null,f.jsxs("div",{className:"setup-nav",children:[f.jsx(Ue,{type:"button",variant:"outline",onClick:Zn,children:"Back"}),f.jsx(Ue,{type:"button",disabled:Un.length===0||ue,onClick:wn($i),children:ue?"Saving...":`Save ${Un.length} quer${Un.length!==1?"ies":"y"}`})]})]})]});case 3:return f.jsxs(jn,{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"})]}),Di?f.jsx(Ln,{tone:"positive",children:"Saved"}):null]}),f.jsx("p",{className:"supporting-copy",children:"Domains that compete for the same queries. One per line."}),Di?f.jsxs("div",{className:"compact-stack",children:[f.jsx("ul",{className:"detail-list",children:ti.map(te=>f.jsx("li",{children:te},te))}),f.jsxs("div",{className:"setup-nav",children:[f.jsx(Ue,{type:"button",variant:"outline",onClick:Zn,children:"Back"}),f.jsx(Ue,{type:"button",onClick:()=>N(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:Ot,onChange:te=>nr(te.target.value)})]}),ar?f.jsx("p",{className:"text-rose-400 text-sm",children:ar}):null,f.jsxs("div",{className:"setup-nav",children:[f.jsx(Ue,{type:"button",variant:"outline",onClick:Zn,children:"Back"}),f.jsxs("div",{className:"flex gap-2",children:[f.jsx(Ue,{type:"button",variant:"outline",onClick:()=>N(4),children:"Skip"}),f.jsx(Ue,{type:"button",disabled:ti.length===0||Mi,onClick:wn(Kn),children:Mi?"Saving...":`Save ${ti.length} competitor${ti.length!==1?"s":""}`})]})]})]})]});case 4:{const te=Ic.data,Fe=te?.status==="completed"||te?.status==="partial"||te?.status==="failed"||te?.status==="cancelled",ai=te?.snapshots??[],Ao=ai.filter(En=>En.citationState==="cited").length,_o=ai.filter(En=>En.answerMentioned===!0).length,rr=new Set(ai.map(En=>En.query).filter(En=>!!En)).size,or=xo?Fe&&(te?.status==="completed"||te?.status==="partial")?f.jsx(Ln,{tone:"positive",children:"Complete"}):Fe?f.jsx(Ln,{tone:"negative",children:"Failed"}):f.jsx(Ln,{tone:"caution",children:"Running"}):null;return f.jsxs(jn,{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"})]}),or]}),xo?Fe?te?.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(Ue,{type:"button",onClick:()=>{S({to:Ce?`/projects/${Ce}`:"/"})},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:le}),":"]}),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:[_o,f.jsxs("span",{className:"text-zinc-600 text-lg",children:[" / ",rr]})]}),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:[Ao,f.jsxs("span",{className:"text-zinc-600 text-lg",children:[" / ",rr]})]}),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:ai.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(Ue,{type:"button",onClick:()=>{S({to:Ce?`/projects/${Ce}`:"/"})},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:te?.status??"queued"})]})}),f.jsxs("div",{className:"setup-nav",children:[f.jsx("span",{}),f.jsx(Ue,{type:"button",variant:"outline",onClick:()=>{S({to:Ce?`/projects/${Ce}`:"/"})},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:le}),"."]}),f.jsxs("div",{className:"setup-nav",children:[f.jsx(Ue,{type:"button",variant:"outline",onClick:Zn,children:"Back"}),f.jsx(Ue,{type:"button",disabled:Ut,onClick:wn(ni),children:Ut?"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(h5,{current:x,labels:m5}),f.jsx("section",{className:"setup-wizard",children:ko})]})}function y5(){return f.jsx("div",{className:"page-container",children:f.jsx("section",{className:"page-section",children:f.jsxs(jn,{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(Ue,{asChild:!0,children:f.jsx(rt,{to:"/",children:"Return to overview"})})]})})})}const ba=Gs(()=>Hs(()=>import("./ProjectPage-1Q8YC9Vd.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8]),import.meta.url),"ProjectPage"),b5=Gs(()=>Hs(()=>import("./RunsPage-DKoIMkQL.js"),__vite__mapDeps([9,1,2,7,5,8]),import.meta.url),"RunsPage"),v5=Gs(()=>Hs(()=>import("./SettingsPage-bH3PdNKb.js"),__vite__mapDeps([10,1,7,5,8]),import.meta.url),"SettingsPage"),S5=Gs(()=>Hs(()=>import("./BacklinksPage-BPvsw_Bi.js"),__vite__mapDeps([11,1,6,7,5,8]),import.meta.url),"BacklinksPage"),x5=Gs(()=>Hs(()=>import("./TrafficPage-IW_DX-0V.js"),__vite__mapDeps([12,1,4,13,7,5,8]),import.meta.url),"TrafficPage"),w5=Gs(()=>Hs(()=>import("./TrafficSourceDetailPage-DRHOGn9B.js"),__vite__mapDeps([14,1,4,3,5,13,7,8]),import.meta.url),"TrafficSourceDetailPage");function j5(){return f.jsx(ZR,{children:f.jsx(KR,{})})}const tn=Tw()({component:j5,validateSearch:e=>({runId:typeof e.runId=="string"?e.runId:void 0,evidenceId:typeof e.evidenceId=="string"?e.evidenceId:void 0})}),N5=Ct({getParentRoute:()=>tn,path:"/",component:JR,beforeLoad:({context:e})=>{const n=e.queryClient.getQueryData(Js({client:ae}));if(n&&n.length===0)throw dv({to:"/setup"})}}),k5=Ct({getParentRoute:()=>tn,path:"/projects",component:c5}),Qn=Ct({getParentRoute:()=>tn,path:"/projects/$projectId",component:()=>f.jsx(uv,{})}),A5=Ct({getParentRoute:()=>Qn,path:"/",component:()=>f.jsx(ba,{tab:"overview"})}),_5=Ct({getParentRoute:()=>Qn,path:"/search-console",component:()=>f.jsx(ba,{tab:"search-console"})}),C5=Ct({getParentRoute:()=>Qn,path:"/local",component:()=>f.jsx(ba,{tab:"local"})}),z5=Ct({getParentRoute:()=>Qn,path:"/discovery",component:()=>f.jsx(ba,{tab:"discovery"})}),T5=Ct({getParentRoute:()=>Qn,path:"/report",component:()=>f.jsx(ba,{tab:"report"})}),E5=Ct({getParentRoute:()=>Qn,path:"/activity",component:()=>f.jsx(ba,{tab:"activity"})}),O5=Ct({getParentRoute:()=>Qn,path:"/backlinks",component:()=>f.jsx(ba,{tab:"backlinks"})}),D5=Ct({getParentRoute:()=>Qn,path:"/technical-aeo",component:()=>f.jsx(ba,{tab:"technical-aeo"})}),R5=Ct({getParentRoute:()=>Qn,path:"/settings",component:()=>f.jsx(ba,{tab:"settings"})}),M5=Ct({getParentRoute:()=>tn,path:"/runs",component:b5}),B5=Ct({getParentRoute:()=>tn,path:"/settings",component:v5,beforeLoad:({context:e})=>{}}),L5=Ct({getParentRoute:()=>tn,path:"/setup",component:g5,beforeLoad:({context:e})=>{const n=e.queryClient.getQueryData(Js({client:ae}));if(n&&n.length>0)throw dv({to:"/"})}}),q5=Ct({getParentRoute:()=>tn,path:"/backlinks",component:S5}),U5=Ct({getParentRoute:()=>tn,path:"/traffic",component:x5}),$5=Ct({getParentRoute:()=>tn,path:"/traffic/$projectName/$sourceId",component:w5}),I5=Ct({getParentRoute:()=>tn,path:"*",component:y5}),V5=tn.addChildren([N5,k5,Qn.addChildren([A5,_5,C5,z5,T5,E5,O5,D5,R5]),M5,B5,L5,q5,U5,$5,I5]);function P5(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath:"/"}const lv=P5(),G5=lv==="/"?"":lv.replace(/\/$/,"");function H5(e,n){return Ew({routeTree:V5,basepath:G5||"/",context:{queryClient:e},...n?.initialEntries})}const Q5=6e4;function K5(){const[e,n]=q.useState(nf()?"ready":"checking"),[i,r]=q.useState(""),[l,c]=q.useState(""),[d,h]=q.useState(null),[g,b]=q.useState(!1),[S,x]=q.useState(!1),N=q.useRef(null),A=q.useRef(null),T=()=>{if(!N.current){const R=Zk();A.current=R,N.current=H5(R)}return{queryClient:A.current,router:N.current}};q.useEffect(()=>{if(nf())return;let R=!1;return Gy().then(V=>{R||(V.authenticated?n("ready"):n(V.setupRequired?"setup":"login"))}).catch(V=>{R||(h(V instanceof Error?V.message:"Failed to reach the Canonry API"),n("login"))}),()=>{R=!0}},[]),q.useEffect(()=>{if(e!=="ready"||nf())return;const R=setInterval(()=>{Gy().then(V=>{V.authenticated||(x(!0),n(V.setupRequired?"setup":"login"))}).catch(()=>{})},Q5);return Py(()=>{x(!0),n("login")}),()=>{clearInterval(R),Py(null)}},[e]);const k=async R=>{if(R.preventDefault(),!i.trim()||i.trim().length<8){h("Password must be at least 8 characters");return}if(i!==l){h("Passwords do not match");return}b(!0),h(null);try{if(!(await Nk(i.trim())).authenticated){h("Setup failed");return}r(""),c(""),x(!1),n("ready")}catch(V){h(V instanceof Gn||V instanceof Error?V.message:"Setup failed")}finally{b(!1)}},E=async R=>{if(R.preventDefault(),!!i.trim()){b(!0),h(null);try{if(!(await kk(i.trim())).authenticated){h("Incorrect password");return}r(""),x(!1),n("ready")}catch(V){h(V instanceof Gn||V instanceof Error?V.message:"Authentication failed")}finally{b(!1)}}};if(e==="ready"){const{queryClient:R,router:V}=T();return f.jsx(Ow,{client:R,children:f.jsx(Dw,{router:V})})}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(jn,{className:"surface-card w-full",children:e==="checking"?f.jsx(Fl,{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(Of,{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"First-time setup"}),f.jsx(Df,{children:"Create a dashboard password"}),f.jsx(Rf,{children:"Choose a password to protect the Canonry dashboard. You will use this to sign in on future visits."})]}),f.jsx(Fl,{children:f.jsxs("form",{className:"space-y-4",onSubmit:wn(k),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(Ue,{type:"submit",disabled:g||!i.trim()||!l.trim(),children:g?"Setting up…":"Create password & open dashboard"})]})})]}):f.jsxs(f.Fragment,{children:[f.jsxs(Of,{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"Dashboard access"}),f.jsx(Df,{children:"Sign in to Canonry"}),f.jsx(Rf,{children:"Enter your dashboard password to continue."})]}),f.jsxs(Fl,{children:[S?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:wn(E),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(Ue,{type:"submit",disabled:g||!i.trim(),children:g?"Signing in…":"Open dashboard"})]})]})]})})})})}const u1=document.getElementById("root");if(!u1)throw new Error("Expected #root element for web app bootstrap.");$w.createRoot(u1).render(f.jsx(q.StrictMode,{children:f.jsx(K5,{})}));export{VL as $,jL as A,Ue as B,lc as C,cB as D,CL as E,TL as F,lL as G,EL as H,to as I,vB as J,bB as K,xB as L,en as M,TB as N,RL as O,C3 as P,ML as Q,jB as R,T4 as S,Ln as T,OL as U,DL as V,zL as W,SB as X,NB as Y,BL as Z,LL as _,d6 as a,fB as a$,$L as a0,IL as a1,Bk as a2,X0 as a3,ke as a4,UL as a5,zD as a6,_i as a7,qL as a8,rE as a9,_B as aA,vp as aB,l6 as aC,u6 as aD,c6 as aE,kB as aF,uA as aG,Mv as aH,gD as aI,bD as aJ,yD as aK,WL as aL,qB as aM,v6 as aN,mL as aO,fL as aP,hL as aQ,gL as aR,dL as aS,pL as aT,rB as aU,sB as aV,iB as aW,dB as aX,AL as aY,_b as aZ,kL as a_,oE as aa,uL as ab,cL as ac,iL as ad,YB as ae,tL as af,nL as ag,Gn as ah,aL as ai,F5 as aj,kA as ak,xL as al,jA as am,DA as an,OD as ao,nc as ap,rL as aq,sL as ar,wf as as,e6 as at,wB as au,s6 as av,r6 as aw,o6 as ax,AB as ay,Js as az,Zf as b,Yy as b$,pB as b0,NL as b1,mB as b2,hB as b3,yB as b4,gB as b5,go as b6,bp as b7,hR as b8,p5 as b9,DB as bA,BB as bB,Ac as bC,m6 as bD,jp as bE,Ak as bF,uB as bG,CB as bH,zB as bI,kp as bJ,LB as bK,Is as bL,Cb as bM,KB as bN,XB as bO,FB as bP,WB as bQ,ZB as bR,JB as bS,eL as bT,z3 as bU,mS as bV,R3 as bW,hS as bX,gS as bY,vA as bZ,QB as b_,Ht as ba,bk as bb,oB as bc,tB as bd,nB as be,lB as bf,p6 as bg,yk as bh,wk as bi,eB as bj,W5 as bk,Sk as bl,aB as bm,b6 as bn,q4 as bo,PL as bp,HL as bq,Tk as br,QL as bs,MB as bt,RB as bu,KL as bv,GL as bw,SL as bx,EB as by,OB as bz,et as c,a6 as c0,yL as c1,bL as c2,yp as c3,_L as c4,Qs as c5,t6 as c6,i6 as c7,HB as c8,PB as c9,GB as ca,VB as cb,n6 as cc,BT as d,f6 as e,wL as f,jn as g,Ub as h,wn as i,oL as j,ZL as k,ae as l,YL as m,XL as n,FL as o,JL as p,UB as q,IB as r,$B as s,O4 as t,Ap as u,h6 as v,g6 as w,y6 as x,Ef as y,vL as z};
|
|
210
|
+
competitor2.com`,value:Ot,onChange:te=>nr(te.target.value)})]}),ar?f.jsx("p",{className:"text-rose-400 text-sm",children:ar}):null,f.jsxs("div",{className:"setup-nav",children:[f.jsx(Ue,{type:"button",variant:"outline",onClick:Zn,children:"Back"}),f.jsxs("div",{className:"flex gap-2",children:[f.jsx(Ue,{type:"button",variant:"outline",onClick:()=>N(4),children:"Skip"}),f.jsx(Ue,{type:"button",disabled:ti.length===0||Mi,onClick:wn(Kn),children:Mi?"Saving...":`Save ${ti.length} competitor${ti.length!==1?"s":""}`})]})]})]})]});case 4:{const te=Ic.data,Fe=te?.status==="completed"||te?.status==="partial"||te?.status==="failed"||te?.status==="cancelled",ai=te?.snapshots??[],Ao=ai.filter(En=>En.citationState==="cited").length,_o=ai.filter(En=>En.answerMentioned===!0).length,rr=new Set(ai.map(En=>En.query).filter(En=>!!En)).size,or=xo?Fe&&(te?.status==="completed"||te?.status==="partial")?f.jsx(Ln,{tone:"positive",children:"Complete"}):Fe?f.jsx(Ln,{tone:"negative",children:"Failed"}):f.jsx(Ln,{tone:"caution",children:"Running"}):null;return f.jsxs(jn,{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"})]}),or]}),xo?Fe?te?.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(Ue,{type:"button",onClick:()=>{S({to:Ce?`/projects/${Ce}`:"/"})},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:le}),":"]}),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:[_o,f.jsxs("span",{className:"text-zinc-600 text-lg",children:[" / ",rr]})]}),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:[Ao,f.jsxs("span",{className:"text-zinc-600 text-lg",children:[" / ",rr]})]}),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:ai.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(Ue,{type:"button",onClick:()=>{S({to:Ce?`/projects/${Ce}`:"/"})},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:te?.status??"queued"})]})}),f.jsxs("div",{className:"setup-nav",children:[f.jsx("span",{}),f.jsx(Ue,{type:"button",variant:"outline",onClick:()=>{S({to:Ce?`/projects/${Ce}`:"/"})},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:le}),"."]}),f.jsxs("div",{className:"setup-nav",children:[f.jsx(Ue,{type:"button",variant:"outline",onClick:Zn,children:"Back"}),f.jsx(Ue,{type:"button",disabled:Ut,onClick:wn(ni),children:Ut?"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(y5,{current:x,labels:g5}),f.jsx("section",{className:"setup-wizard",children:ko})]})}function v5(){return f.jsx("div",{className:"page-container",children:f.jsx("section",{className:"page-section",children:f.jsxs(jn,{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(Ue,{asChild:!0,children:f.jsx(rt,{to:"/",children:"Return to overview"})})]})})})}const ba=Gs(()=>Hs(()=>import("./ProjectPage-B_xnYE7W.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8]),import.meta.url),"ProjectPage"),S5=Gs(()=>Hs(()=>import("./RunsPage-9gWTjteG.js"),__vite__mapDeps([9,1,2,7,5,8]),import.meta.url),"RunsPage"),x5=Gs(()=>Hs(()=>import("./SettingsPage-kBwz4Glg.js"),__vite__mapDeps([10,1,7,5,8]),import.meta.url),"SettingsPage"),w5=Gs(()=>Hs(()=>import("./BacklinksPage-Dpx6ylmU.js"),__vite__mapDeps([11,1,6,7,5,8]),import.meta.url),"BacklinksPage"),j5=Gs(()=>Hs(()=>import("./TrafficPage-D4adjs8S.js"),__vite__mapDeps([12,1,4,13,7,5,8]),import.meta.url),"TrafficPage"),N5=Gs(()=>Hs(()=>import("./TrafficSourceDetailPage-CmURRHaU.js"),__vite__mapDeps([14,1,4,3,5,13,7,8]),import.meta.url),"TrafficSourceDetailPage");function k5(){return f.jsx(XR,{children:f.jsx(YR,{})})}const tn=Ew()({component:k5,validateSearch:e=>({runId:typeof e.runId=="string"?e.runId:void 0,evidenceId:typeof e.evidenceId=="string"?e.evidenceId:void 0})}),A5=Ct({getParentRoute:()=>tn,path:"/",component:WR,beforeLoad:({context:e})=>{const n=e.queryClient.getQueryData(Js({client:ie}));if(n&&n.length===0)throw dv({to:"/setup"})}}),_5=Ct({getParentRoute:()=>tn,path:"/projects",component:d5}),Qn=Ct({getParentRoute:()=>tn,path:"/projects/$projectId",component:()=>f.jsx(uv,{})}),C5=Ct({getParentRoute:()=>Qn,path:"/",component:()=>f.jsx(ba,{tab:"overview"})}),z5=Ct({getParentRoute:()=>Qn,path:"/search-console",component:()=>f.jsx(ba,{tab:"search-console"})}),T5=Ct({getParentRoute:()=>Qn,path:"/local",component:()=>f.jsx(ba,{tab:"local"})}),E5=Ct({getParentRoute:()=>Qn,path:"/discovery",component:()=>f.jsx(ba,{tab:"discovery"})}),O5=Ct({getParentRoute:()=>Qn,path:"/report",component:()=>f.jsx(ba,{tab:"report"})}),D5=Ct({getParentRoute:()=>Qn,path:"/activity",component:()=>f.jsx(ba,{tab:"activity"})}),R5=Ct({getParentRoute:()=>Qn,path:"/backlinks",component:()=>f.jsx(ba,{tab:"backlinks"})}),M5=Ct({getParentRoute:()=>Qn,path:"/technical-aeo",component:()=>f.jsx(ba,{tab:"technical-aeo"})}),B5=Ct({getParentRoute:()=>Qn,path:"/settings",component:()=>f.jsx(ba,{tab:"settings"})}),L5=Ct({getParentRoute:()=>tn,path:"/runs",component:S5}),q5=Ct({getParentRoute:()=>tn,path:"/settings",component:x5,beforeLoad:({context:e})=>{}}),U5=Ct({getParentRoute:()=>tn,path:"/setup",component:b5,beforeLoad:({context:e})=>{const n=e.queryClient.getQueryData(Js({client:ie}));if(n&&n.length>0)throw dv({to:"/"})}}),$5=Ct({getParentRoute:()=>tn,path:"/backlinks",component:w5}),I5=Ct({getParentRoute:()=>tn,path:"/traffic",component:j5}),V5=Ct({getParentRoute:()=>tn,path:"/traffic/$projectName/$sourceId",component:N5}),P5=Ct({getParentRoute:()=>tn,path:"*",component:v5}),G5=tn.addChildren([A5,_5,Qn.addChildren([C5,z5,T5,E5,O5,D5,R5,M5,B5]),L5,q5,U5,$5,I5,V5,P5]);function H5(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath:"/"}const lv=H5(),Q5=lv==="/"?"":lv.replace(/\/$/,"");function K5(e,n){return Ow({routeTree:G5,basepath:Q5||"/",context:{queryClient:e},...n?.initialEntries})}const Z5=6e4;function Y5(){const[e,n]=q.useState(nf()?"ready":"checking"),[i,r]=q.useState(""),[l,c]=q.useState(""),[d,h]=q.useState(null),[g,b]=q.useState(!1),[S,x]=q.useState(!1),N=q.useRef(null),A=q.useRef(null),T=()=>{if(!N.current){const R=Yk();A.current=R,N.current=K5(R)}return{queryClient:A.current,router:N.current}};q.useEffect(()=>{if(nf())return;let R=!1;return Gy().then(V=>{R||(V.authenticated?n("ready"):n(V.setupRequired?"setup":"login"))}).catch(V=>{R||(h(V instanceof Error?V.message:"Failed to reach the Canonry API"),n("login"))}),()=>{R=!0}},[]),q.useEffect(()=>{if(e!=="ready"||nf())return;const R=setInterval(()=>{Gy().then(V=>{V.authenticated||(x(!0),n(V.setupRequired?"setup":"login"))}).catch(()=>{})},Z5);return Py(()=>{x(!0),n("login")}),()=>{clearInterval(R),Py(null)}},[e]);const k=async R=>{if(R.preventDefault(),!i.trim()||i.trim().length<8){h("Password must be at least 8 characters");return}if(i!==l){h("Passwords do not match");return}b(!0),h(null);try{if(!(await kk(i.trim())).authenticated){h("Setup failed");return}r(""),c(""),x(!1),n("ready")}catch(V){h(V instanceof Gn||V instanceof Error?V.message:"Setup failed")}finally{b(!1)}},E=async R=>{if(R.preventDefault(),!!i.trim()){b(!0),h(null);try{if(!(await Ak(i.trim())).authenticated){h("Incorrect password");return}r(""),x(!1),n("ready")}catch(V){h(V instanceof Gn||V instanceof Error?V.message:"Authentication failed")}finally{b(!1)}}};if(e==="ready"){const{queryClient:R,router:V}=T();return f.jsx(Dw,{client:R,children:f.jsx(Rw,{router:V})})}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(jn,{className:"surface-card w-full",children:e==="checking"?f.jsx(Fl,{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(Of,{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"First-time setup"}),f.jsx(Df,{children:"Create a dashboard password"}),f.jsx(Rf,{children:"Choose a password to protect the Canonry dashboard. You will use this to sign in on future visits."})]}),f.jsx(Fl,{children:f.jsxs("form",{className:"space-y-4",onSubmit:wn(k),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(Ue,{type:"submit",disabled:g||!i.trim()||!l.trim(),children:g?"Setting up…":"Create password & open dashboard"})]})})]}):f.jsxs(f.Fragment,{children:[f.jsxs(Of,{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"Dashboard access"}),f.jsx(Df,{children:"Sign in to Canonry"}),f.jsx(Rf,{children:"Enter your dashboard password to continue."})]}),f.jsxs(Fl,{children:[S?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:wn(E),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(Ue,{type:"submit",disabled:g||!i.trim(),children:g?"Signing in…":"Open dashboard"})]})]})]})})})})}const d1=document.getElementById("root");if(!d1)throw new Error("Expected #root element for web app bootstrap.");Iw.createRoot(d1).render(f.jsx(q.StrictMode,{children:f.jsx(Y5,{})}));export{GL as $,kL as A,Ue as B,lc as C,dB as D,TL as E,OL as F,uL as G,DL as H,to as I,xB as J,SB as K,jB as L,en as M,OB as N,BL as O,T3 as P,LL as Q,kB as R,O4 as S,Ln as T,RL as U,ML as V,EL as W,wB as X,AB as Y,qL as Z,UL as _,p6 as a,mB as a$,VL as a0,PL as a1,Lk as a2,J0 as a3,ke as a4,IL as a5,ED as a6,_i as a7,$L as a8,oE as a9,zB as aA,vp as aB,u6 as aC,f6 as aD,d6 as aE,_B as aF,dA as aG,Mv as aH,bD as aI,SD as aJ,vD as aK,t6 as aL,$B as aM,x6 as aN,gL as aO,mL as aP,yL as aQ,bL as aR,pL as aS,hL as aT,lB as aU,oB as aV,rB as aW,pB as aX,CL as aY,_b as aZ,_L as a_,lE as aa,fL as ab,dL as ac,rL as ad,JB as ae,aL as af,iL as ag,Gn as ah,sL as ai,eB as aj,AA as ak,jL as al,NA as am,RA as an,RD as ao,nc as ap,lL as aq,oL as ar,wf as as,n6 as at,NB as au,o6 as av,l6 as aw,c6 as ax,CB as ay,Js as az,Zf as b,Yy as b$,hB as b0,AL as b1,gB as b2,yB as b3,vB as b4,bB as b5,go as b6,bp as b7,yR as b8,h5 as b9,MB as bA,qB as bB,Ac as bC,g6 as bD,jp as bE,_k as bF,fB as bG,TB as bH,EB as bI,kp as bJ,UB as bK,Is as bL,Cb as bM,YB as bN,FB as bO,eL as bP,tL as bQ,XB as bR,WB as bS,nL as bT,E3 as bU,hS as bV,B3 as bW,gS as bX,yS as bY,SA as bZ,ZB as b_,Ht as ba,vk as bb,cB as bc,aB as bd,iB as be,uB as bf,h6 as bg,bk as bh,jk as bi,nB as bj,tB as bk,xk as bl,sB as bm,S6 as bn,$4 as bo,HL as bp,KL as bq,Ek as br,ZL as bs,LB as bt,BB as bu,YL as bv,QL as bw,wL as bx,DB as by,RB as bz,et as c,s6 as c0,vL as c1,SL as c2,yp as c3,zL as c4,Qs as c5,a6 as c6,r6 as c7,KB as c8,HB as c9,QB as ca,GB as cb,i6 as cc,LT as d,m6 as e,NL as f,jn as g,Ub as h,wn as i,cL as j,XL as k,ie as l,JL as m,FL as n,e6 as o,WL as p,IB as q,PB as r,VB as s,R4 as t,Ap as u,y6 as v,b6 as w,v6 as x,Ef as y,xL as z};
|