dsh-drydock 1.1.3 → 1.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/client.js CHANGED
@@ -5,74 +5,71 @@ window.__ModuleLoader__.load({
5
5
  var exports = module.exports;
6
6
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
7
7
 
8
- var Df=Object.create;var Wr=Object.defineProperty;var Mf=Object.getOwnPropertyDescriptor;var Uf=Object.getOwnPropertyNames;var Lf=Object.getPrototypeOf,Ff=Object.prototype.hasOwnProperty;var J=(e,t)=>()=>(e&&(t=e(e=0)),t);var Pe=(e,t)=>{for(var r in t)Wr(e,r,{get:t[r],enumerable:!0})},ku=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Uf(t))!Ff.call(e,o)&&o!==r&&Wr(e,o,{get:()=>t[o],enumerable:!(n=Mf(t,o))||n.enumerable});return e};var Hf=(e,t,r)=>(r=e!=null?Df(Lf(e)):{},ku(t||!e||!e.__esModule?Wr(r,"default",{value:e,enumerable:!0}):r,e)),Bf=e=>ku(Wr({},"__esModule",{value:!0}),e);function f(e,t,r){function n(c,u){if(c._zod||Object.defineProperty(c,"_zod",{value:{def:u,constr:s,traits:new Set},enumerable:!1}),c._zod.traits.has(e))return;c._zod.traits.add(e),t(c,u);let d=s.prototype,m=Object.keys(d);for(let h=0;h<m.length;h++){let b=m[h];b in c||(c[b]=d[b].bind(c))}}let o=r?.Parent??Object;class i extends o{}Object.defineProperty(i,"name",{value:e});function s(c){var u;let d=r?.Parent?new i:this;n(d,c),(u=d._zod).deferred??(u.deferred=[]);for(let m of d._zod.deferred)m();return d}return Object.defineProperty(s,"init",{value:n}),Object.defineProperty(s,Symbol.hasInstance,{value:c=>r?.Parent&&c instanceof r.Parent?!0:c?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}function te(e){return e&&Object.assign(it,e),it}var zu,Ho,Bo,Ze,We,it,st=J(()=>{Ho=Object.freeze({status:"aborted"});Bo=Symbol("zod_brand"),Ze=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},We=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(zu=globalThis).__zod_globalConfig??(zu.__zod_globalConfig={});it=globalThis.__zod_globalConfig});var j={};Pe(j,{BIGINT_FORMAT_RANGES:()=>ei,Class:()=>Vo,NUMBER_FORMAT_RANGES:()=>Qo,aborted:()=>Ge,allowsEval:()=>Go,assert:()=>Gf,assertEqual:()=>Wf,assertIs:()=>Jf,assertNever:()=>qf,assertNotEqual:()=>Vf,assignProp:()=>Je,base64ToUint8Array:()=>$u,base64urlToUint8Array:()=>pm,cached:()=>zt,captureStackTrace:()=>qr,cleanEnum:()=>dm,cleanRegex:()=>ar,clone:()=>ue,cloneDef:()=>Yf,createTransparentProxy:()=>nm,defineLazy:()=>F,esc:()=>Jr,escapeRegex:()=>ze,explicitlyAborted:()=>ti,extend:()=>sm,finalizeIssue:()=>de,floatSafeRemainder:()=>Jo,getElementAtPath:()=>Xf,getEnumValues:()=>sr,getLengthableOrigin:()=>ur,getParsedType:()=>rm,getSizableOrigin:()=>cr,hexToUint8Array:()=>mm,isObject:()=>at,isPlainObject:()=>qe,issue:()=>St,joinValues:()=>Vr,jsonStringifyReplacer:()=>kt,merge:()=>lm,mergeDefs:()=>Me,normalizeParams:()=>z,nullish:()=>Ve,numKeys:()=>tm,objectClone:()=>Kf,omit:()=>im,optionalKeys:()=>Xo,parsedType:()=>ri,partial:()=>cm,pick:()=>om,prefixIssues:()=>ge,primitiveTypes:()=>Yo,promiseAllObject:()=>Qf,propertyKeyTypes:()=>lr,randomString:()=>em,required:()=>um,safeExtend:()=>am,shallowClone:()=>Ko,slugify:()=>qo,stringifyPrimitive:()=>Gr,uint8ArrayToBase64:()=>Pu,uint8ArrayToBase64url:()=>fm,uint8ArrayToHex:()=>gm,unwrapMessage:()=>ir});function Wf(e){return e}function Vf(e){return e}function Jf(e){}function qf(e){throw new Error("Unexpected value in exhaustive check")}function Gf(e){}function sr(e){let t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,o])=>t.indexOf(+n)===-1).map(([n,o])=>o)}function Vr(e,t="|"){return e.map(r=>Gr(r)).join(t)}function kt(e,t){return typeof t=="bigint"?t.toString():t}function zt(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function Ve(e){return e==null}function ar(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function Jo(e,t){let r=e/t,n=Math.round(r),o=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-n)<o?0:r-n}function F(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==Su)return n===void 0&&(n=Su,n=r()),n},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function Kf(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Je(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Me(...e){let t={};for(let r of e){let n=Object.getOwnPropertyDescriptors(r);Object.assign(t,n)}return Object.defineProperties({},t)}function Yf(e){return Me(e._zod.def)}function Xf(e,t){return t?t.reduce((r,n)=>r?.[n],e):e}function Qf(e){let t=Object.keys(e),r=t.map(n=>e[n]);return Promise.all(r).then(n=>{let o={};for(let i=0;i<t.length;i++)o[t[i]]=n[i];return o})}function em(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let n=0;n<e;n++)r+=t[Math.floor(Math.random()*t.length)];return r}function Jr(e){return JSON.stringify(e)}function qo(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function at(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function qe(e){if(at(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(at(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Ko(e){return qe(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function tm(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}function ze(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ue(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}function z(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function nm(e){let t;return new Proxy({},{get(r,n,o){return t??(t=e()),Reflect.get(t,n,o)},set(r,n,o,i){return t??(t=e()),Reflect.set(t,n,o,i)},has(r,n){return t??(t=e()),Reflect.has(t,n)},deleteProperty(r,n){return t??(t=e()),Reflect.deleteProperty(t,n)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,n){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,n)},defineProperty(r,n,o){return t??(t=e()),Reflect.defineProperty(t,n,o)}})}function Gr(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function Xo(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}function om(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let i=Me(e._zod.def,{get shape(){let s={};for(let c in t){if(!(c in r.shape))throw new Error(`Unrecognized key: "${c}"`);t[c]&&(s[c]=r.shape[c])}return Je(this,"shape",s),s},checks:[]});return ue(e,i)}function im(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let i=Me(e._zod.def,{get shape(){let s={...e._zod.def.shape};for(let c in t){if(!(c in r.shape))throw new Error(`Unrecognized key: "${c}"`);t[c]&&delete s[c]}return Je(this,"shape",s),s},checks:[]});return ue(e,i)}function sm(e,t){if(!qe(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let i=e._zod.def.shape;for(let s in t)if(Object.getOwnPropertyDescriptor(i,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let o=Me(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t};return Je(this,"shape",i),i}});return ue(e,o)}function am(e,t){if(!qe(t))throw new Error("Invalid input to safeExtend: expected a plain object");let r=Me(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Je(this,"shape",n),n}});return ue(e,r)}function lm(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=Me(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return Je(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return ue(e,r)}function cm(e,t,r){let o=t._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let s=Me(t._zod.def,{get shape(){let c=t._zod.def.shape,u={...c};if(r)for(let d in r){if(!(d in c))throw new Error(`Unrecognized key: "${d}"`);r[d]&&(u[d]=e?new e({type:"optional",innerType:c[d]}):c[d])}else for(let d in c)u[d]=e?new e({type:"optional",innerType:c[d]}):c[d];return Je(this,"shape",u),u},checks:[]});return ue(t,s)}function um(e,t,r){let n=Me(t._zod.def,{get shape(){let o=t._zod.def.shape,i={...o};if(r)for(let s in r){if(!(s in i))throw new Error(`Unrecognized key: "${s}"`);r[s]&&(i[s]=new e({type:"nonoptional",innerType:o[s]}))}else for(let s in o)i[s]=new e({type:"nonoptional",innerType:o[s]});return Je(this,"shape",i),i}});return ue(t,n)}function Ge(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function ti(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function ge(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function ir(e){return typeof e=="string"?e:e?.message}function de(e,t,r){let n=e.message?e.message:ir(e.inst?._zod.def?.error?.(e))??ir(t?.error?.(e))??ir(r.customError?.(e))??ir(r.localeError?.(e))??"Invalid input",{inst:o,continue:i,input:s,...c}=e;return c.path??(c.path=[]),c.message=n,t?.reportInput&&(c.input=s),c}function cr(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function ur(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function ri(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function St(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}function dm(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function $u(e){let t=atob(e),r=new Uint8Array(t.length);for(let n=0;n<t.length;n++)r[n]=t.charCodeAt(n);return r}function Pu(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function pm(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return $u(t+r)}function fm(e){return Pu(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function mm(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let n=0;n<t.length;n+=2)r[n/2]=Number.parseInt(t.slice(n,n+2),16);return r}function gm(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var Su,qr,Go,rm,lr,Yo,Qo,ei,Vo,Se=J(()=>{st();Su=Symbol("evaluating");qr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};Go=zt(()=>{if(it.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});rm=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},lr=new Set(["string","number","symbol"]),Yo=new Set(["string","number","bigint","boolean","symbol","undefined"]);Qo={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]},ei={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};Vo=class{constructor(...t){}}});function pr(e,t=r=>r.message){let r={},n=[];for(let o of e.issues)o.path.length>0?(r[o.path[0]]=r[o.path[0]]||[],r[o.path[0]].push(t(o))):n.push(t(o));return{formErrors:n,fieldErrors:r}}function fr(e,t=r=>r.message){let r={_errors:[]},n=(o,i=[])=>{for(let s of o.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(c=>n({issues:c},[...i,...s.path]));else if(s.code==="invalid_key")n({issues:s.issues},[...i,...s.path]);else if(s.code==="invalid_element")n({issues:s.issues},[...i,...s.path]);else{let c=[...i,...s.path];if(c.length===0)r._errors.push(t(s));else{let u=r,d=0;for(;d<c.length;){let m=c[d];d===c.length-1?(u[m]=u[m]||{_errors:[]},u[m]._errors.push(t(s))):u[m]=u[m]||{_errors:[]},u=u[m],d++}}}};return n(e),r}function ni(e,t=r=>r.message){let r={errors:[]},n=(o,i=[])=>{var s,c;for(let u of o.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map(d=>n({issues:d},[...i,...u.path]));else if(u.code==="invalid_key")n({issues:u.issues},[...i,...u.path]);else if(u.code==="invalid_element")n({issues:u.issues},[...i,...u.path]);else{let d=[...i,...u.path];if(d.length===0){r.errors.push(t(u));continue}let m=r,h=0;for(;h<d.length;){let b=d[h],p=h===d.length-1;typeof b=="string"?(m.properties??(m.properties={}),(s=m.properties)[b]??(s[b]={errors:[]}),m=m.properties[b]):(m.items??(m.items=[]),(c=m.items)[b]??(c[b]={errors:[]}),m=m.items[b]),p&&m.errors.push(t(u)),h++}}};return n(e),r}function Iu(e){let t=[],r=e.map(n=>typeof n=="object"?n.key:n);for(let n of r)typeof n=="number"?t.push(`[${n}]`):typeof n=="symbol"?t.push(`[${JSON.stringify(String(n))}]`):/[^\w$]/.test(n)?t.push(`[${JSON.stringify(n)}]`):(t.length&&t.push("."),t.push(n));return t.join("")}function oi(e){let t=[],r=[...e.issues].sort((n,o)=>(n.path??[]).length-(o.path??[]).length);for(let n of r)t.push(`\u2716 ${n.message}`),n.path?.length&&t.push(` \u2192 at ${Iu(n.path)}`);return t.join(`
9
- `)}var Zu,dr,he,ii=J(()=>{st();Se();Zu=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,kt,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},dr=f("$ZodError",Zu),he=f("$ZodError",Zu,{Parent:Error})});var $t,Kr,Pt,Yr,Zt,si,It,ai,Xr,ym,Qr,bm,en,vm,tn,xm,rn,wm,nn,_m,on,km,sn,zm,li=J(()=>{st();ii();Se();$t=e=>(t,r,n,o)=>{let i=n?{...n,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},i);if(s instanceof Promise)throw new Ze;if(s.issues.length){let c=new(o?.Err??e)(s.issues.map(u=>de(u,i,te())));throw qr(c,o?.callee),c}return s.value},Kr=$t(he),Pt=e=>async(t,r,n,o)=>{let i=n?{...n,async:!0}:{async:!0},s=t._zod.run({value:r,issues:[]},i);if(s instanceof Promise&&(s=await s),s.issues.length){let c=new(o?.Err??e)(s.issues.map(u=>de(u,i,te())));throw qr(c,o?.callee),c}return s.value},Yr=Pt(he),Zt=e=>(t,r,n)=>{let o=n?{...n,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},o);if(i instanceof Promise)throw new Ze;return i.issues.length?{success:!1,error:new(e??dr)(i.issues.map(s=>de(s,o,te())))}:{success:!0,data:i.value}},si=Zt(he),It=e=>async(t,r,n)=>{let o=n?{...n,async:!0}:{async:!0},i=t._zod.run({value:r,issues:[]},o);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(s=>de(s,o,te())))}:{success:!0,data:i.value}},ai=It(he),Xr=e=>(t,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return $t(e)(t,r,o)},ym=Xr(he),Qr=e=>(t,r,n)=>$t(e)(t,r,n),bm=Qr(he),en=e=>async(t,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return Pt(e)(t,r,o)},vm=en(he),tn=e=>async(t,r,n)=>Pt(e)(t,r,n),xm=tn(he),rn=e=>(t,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return Zt(e)(t,r,o)},wm=rn(he),nn=e=>(t,r,n)=>Zt(e)(t,r,n),_m=nn(he),on=e=>async(t,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return It(e)(t,r,o)},km=on(he),sn=e=>async(t,r,n)=>It(e)(t,r,n),zm=sn(he)});var xe={};Pe(xe,{base64:()=>zi,base64url:()=>an,bigint:()=>Ci,boolean:()=>Oi,browserEmail:()=>Tm,cidrv4:()=>_i,cidrv6:()=>ki,cuid:()=>ci,cuid2:()=>ui,date:()=>Pi,datetime:()=>Ii,domain:()=>Am,duration:()=>gi,e164:()=>$i,email:()=>yi,emoji:()=>bi,extendedDuration:()=>Sm,guid:()=>hi,hex:()=>Nm,hostname:()=>Rm,html5Email:()=>Im,httpProtocol:()=>Si,idnEmail:()=>Cm,integer:()=>Ti,ipv4:()=>vi,ipv6:()=>xi,ksuid:()=>fi,lowercase:()=>Ni,mac:()=>wi,md5_base64:()=>Dm,md5_base64url:()=>Mm,md5_hex:()=>jm,nanoid:()=>mi,null:()=>Ri,number:()=>ln,rfc5322Email:()=>Em,sha1_base64:()=>Lm,sha1_base64url:()=>Fm,sha1_hex:()=>Um,sha256_base64:()=>Bm,sha256_base64url:()=>Wm,sha256_hex:()=>Hm,sha384_base64:()=>Jm,sha384_base64url:()=>qm,sha384_hex:()=>Vm,sha512_base64:()=>Km,sha512_base64url:()=>Ym,sha512_hex:()=>Gm,string:()=>Ei,time:()=>Zi,ulid:()=>di,undefined:()=>Ai,unicodeEmail:()=>Eu,uppercase:()=>ji,uuid:()=>lt,uuid4:()=>$m,uuid6:()=>Pm,uuid7:()=>Zm,xid:()=>pi});function bi(){return new RegExp(Om,"u")}function Tu(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Zi(e){return new RegExp(`^${Tu(e)}$`)}function Ii(e){let t=Tu({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let n=`${t}(?:${r.join("|")})`;return new RegExp(`^${Cu}T(?:${n})$`)}function mr(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function gr(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var ci,ui,di,pi,fi,mi,gi,Sm,hi,lt,$m,Pm,Zm,yi,Im,Em,Eu,Cm,Tm,Om,vi,xi,wi,_i,ki,zi,an,Rm,Am,Si,$i,Cu,Pi,Ei,Ci,Ti,ln,Oi,Ri,Ai,Ni,ji,Nm,jm,Dm,Mm,Um,Lm,Fm,Hm,Bm,Wm,Vm,Jm,qm,Gm,Km,Ym,cn=J(()=>{Se();ci=/^[cC][0-9a-z]{6,}$/,ui=/^[0-9a-z]+$/,di=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,pi=/^[0-9a-vA-V]{20}$/,fi=/^[A-Za-z0-9]{27}$/,mi=/^[a-zA-Z0-9_-]{21}$/,gi=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Sm=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,hi=/^([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})$/,lt=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)$/,$m=lt(4),Pm=lt(6),Zm=lt(7),yi=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Im=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Em=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,Eu=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,Cm=Eu,Tm=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Om="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";vi=/^(?:(?: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])$/,xi=/^(([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}|:))$/,wi=e=>{let t=ze(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},_i=/^((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])$/,ki=/^(([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])$/,zi=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,an=/^[A-Za-z0-9_-]*$/,Rm=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,Am=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Si=/^https?$/,$i=/^\+[1-9]\d{6,14}$/,Cu="(?:(?:\\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])))",Pi=new RegExp(`^${Cu}$`);Ei=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Ci=/^-?\d+n?$/,Ti=/^-?\d+$/,ln=/^-?\d+(?:\.\d+)?$/,Oi=/^(?:true|false)$/i,Ri=/^null$/i,Ai=/^undefined$/i,Ni=/^[^A-Z]*$/,ji=/^[^a-z]*$/,Nm=/^[0-9a-fA-F]*$/;jm=/^[0-9a-fA-F]{32}$/,Dm=mr(22,"=="),Mm=gr(22),Um=/^[0-9a-fA-F]{40}$/,Lm=mr(27,"="),Fm=gr(27),Hm=/^[0-9a-fA-F]{64}$/,Bm=mr(43,"="),Wm=gr(43),Vm=/^[0-9a-fA-F]{96}$/,Jm=mr(64,""),qm=gr(64),Gm=/^[0-9a-fA-F]{128}$/,Km=mr(86,"=="),Ym=gr(86)});function Ou(e,t,r){e.issues.length&&t.issues.push(...ge(r,e.issues))}var K,Ru,un,dn,Di,Mi,Ui,Li,Fi,Hi,Bi,Wi,Vi,Et,Ji,qi,Gi,Ki,Yi,Xi,Qi,es,ts,pn=J(()=>{st();cn();Se();K=f("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Ru={number:"number",bigint:"bigint",object:"date"},un=f("$ZodCheckLessThan",(e,t)=>{K.init(e,t);let r=Ru[typeof t.value];e._zod.onattach.push(n=>{let o=n._zod.bag,i=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?o.maximum=t.value:o.exclusiveMaximum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),dn=f("$ZodCheckGreaterThan",(e,t)=>{K.init(e,t);let r=Ru[typeof t.value];e._zod.onattach.push(n=>{let o=n._zod.bag,i=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?o.minimum=t.value:o.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Di=f("$ZodCheckMultipleOf",(e,t)=>{K.init(e,t),e._zod.onattach.push(r=>{var n;(n=r._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):Jo(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),Mi=f("$ZodCheckNumberFormat",(e,t)=>{K.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[o,i]=Qo[t.format];e._zod.onattach.push(s=>{let c=s._zod.bag;c.format=t.format,c.minimum=o,c.maximum=i,r&&(c.pattern=Ti)}),e._zod.check=s=>{let c=s.value;if(r){if(!Number.isInteger(c)){s.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){c>0?s.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):s.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}c<o&&s.issues.push({origin:"number",input:c,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),c>i&&s.issues.push({origin:"number",input:c,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),Ui=f("$ZodCheckBigIntFormat",(e,t)=>{K.init(e,t);let[r,n]=ei[t.format];e._zod.onattach.push(o=>{let i=o._zod.bag;i.format=t.format,i.minimum=r,i.maximum=n}),e._zod.check=o=>{let i=o.value;i<r&&o.issues.push({origin:"bigint",input:i,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),i>n&&o.issues.push({origin:"bigint",input:i,code:"too_big",maximum:n,inclusive:!0,inst:e,continue:!t.abort})}}),Li=f("$ZodCheckMaxSize",(e,t)=>{var r;K.init(e,t),(r=e._zod.def).when??(r.when=n=>{let o=n.value;return!Ve(o)&&o.size!==void 0}),e._zod.onattach.push(n=>{let o=n._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<o&&(n._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let o=n.value;o.size<=t.maximum||n.issues.push({origin:cr(o),code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Fi=f("$ZodCheckMinSize",(e,t)=>{var r;K.init(e,t),(r=e._zod.def).when??(r.when=n=>{let o=n.value;return!Ve(o)&&o.size!==void 0}),e._zod.onattach.push(n=>{let o=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let o=n.value;o.size>=t.minimum||n.issues.push({origin:cr(o),code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Hi=f("$ZodCheckSizeEquals",(e,t)=>{var r;K.init(e,t),(r=e._zod.def).when??(r.when=n=>{let o=n.value;return!Ve(o)&&o.size!==void 0}),e._zod.onattach.push(n=>{let o=n._zod.bag;o.minimum=t.size,o.maximum=t.size,o.size=t.size}),e._zod.check=n=>{let o=n.value,i=o.size;if(i===t.size)return;let s=i>t.size;n.issues.push({origin:cr(o),...s?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Bi=f("$ZodCheckMaxLength",(e,t)=>{var r;K.init(e,t),(r=e._zod.def).when??(r.when=n=>{let o=n.value;return!Ve(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{let o=n._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<o&&(n._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let o=n.value;if(o.length<=t.maximum)return;let s=ur(o);n.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Wi=f("$ZodCheckMinLength",(e,t)=>{var r;K.init(e,t),(r=e._zod.def).when??(r.when=n=>{let o=n.value;return!Ve(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{let o=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let o=n.value;if(o.length>=t.minimum)return;let s=ur(o);n.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Vi=f("$ZodCheckLengthEquals",(e,t)=>{var r;K.init(e,t),(r=e._zod.def).when??(r.when=n=>{let o=n.value;return!Ve(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{let o=n._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=n=>{let o=n.value,i=o.length;if(i===t.length)return;let s=ur(o),c=i>t.length;n.issues.push({origin:s,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Et=f("$ZodCheckStringFormat",(e,t)=>{var r,n;K.init(e,t),e._zod.onattach.push(o=>{let i=o._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),Ji=f("$ZodCheckRegex",(e,t)=>{Et.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),qi=f("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Ni),Et.init(e,t)}),Gi=f("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=ji),Et.init(e,t)}),Ki=f("$ZodCheckIncludes",(e,t)=>{K.init(e,t);let r=ze(t.includes),n=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=n,e._zod.onattach.push(o=>{let i=o._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),Yi=f("$ZodCheckStartsWith",(e,t)=>{K.init(e,t);let r=new RegExp(`^${ze(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Xi=f("$ZodCheckEndsWith",(e,t)=>{K.init(e,t);let r=new RegExp(`.*${ze(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}});Qi=f("$ZodCheckProperty",(e,t)=>{K.init(e,t),e._zod.check=r=>{let n=t.schema._zod.run({value:r.value[t.property],issues:[]},{});if(n instanceof Promise)return n.then(o=>Ou(o,r,t.property));Ou(n,r,t.property)}}),es=f("$ZodCheckMimeType",(e,t)=>{K.init(e,t);let r=new Set(t.mime);e._zod.onattach.push(n=>{n._zod.bag.mime=t.mime}),e._zod.check=n=>{r.has(n.value.type)||n.issues.push({code:"invalid_value",values:t.mime,input:n.value.type,inst:e,continue:!t.abort})}}),ts=f("$ZodCheckOverwrite",(e,t)=>{K.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}})});var hr,rs=J(()=>{hr=class{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let n=t.split(`
10
- `).filter(s=>s),o=Math.min(...n.map(s=>s.length-s.trimStart().length)),i=n.map(s=>s.slice(o)).map(s=>" ".repeat(this.indent*2)+s);for(let s of i)this.content.push(s)}compile(){let t=Function,r=this?.args,o=[...(this?.content??[""]).map(i=>` ${i}`)];return new t(...r,o.join(`
11
- `))}}});var ns,os=J(()=>{ns={major:4,minor:4,patch:3}});function $s(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}function Ku(e){if(!an.test(e))return!1;let t=e.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return $s(r)}function Yu(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[n]=r;if(!n)return!1;let o=JSON.parse(atob(n));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}function Nu(e,t,r){e.issues.length&&t.issues.push(...ge(r,e.issues)),t.value[r]=e.value}function hn(e,t,r,n,o,i){let s=r in n;if(e.issues.length){if(o&&i&&!s)return;t.issues.push(...ge(r,e.issues))}if(!s&&!o){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}e.value===void 0?s&&(t.value[r]=void 0):t.value[r]=e.value}function Xu(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);let r=Xo(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function Qu(e,t,r,n,o,i){let s=[],c=o.keySet,u=o.catchall._zod,d=u.def.type,m=u.optin==="optional",h=u.optout==="optional";for(let b in t){if(b==="__proto__"||c.has(b))continue;if(d==="never"){s.push(b);continue}let p=u.run({value:t[b],issues:[]},n);p instanceof Promise?e.push(p.then(x=>hn(x,r,b,t,m,h))):hn(p,r,b,t,m,h)}return s.length&&r.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:i}),e.length?Promise.all(e).then(()=>r):r}function ju(e,t,r,n){for(let i of e)if(i.issues.length===0)return t.value=i.value,t;let o=e.filter(i=>!Ge(i));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(s=>de(s,n,te())))}),t)}function Du(e,t,r,n){let o=e.filter(i=>i.issues.length===0);return o.length===1?(t.value=o[0].value,t):(o.length===0?t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(s=>de(s,n,te())))}):t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:[],inclusive:!1}),t)}function is(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(qe(e)&&qe(t)){let r=Object.keys(t),n=Object.keys(e).filter(i=>r.indexOf(i)!==-1),o={...e,...t};for(let i of n){let s=is(e[i],t[i]);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};o[i]=s.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let n=0;n<e.length;n++){let o=e[n],i=t[n],s=is(o,i);if(!s.valid)return{valid:!1,mergeErrorPath:[n,...s.mergeErrorPath]};r.push(s.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Mu(e,t,r){let n=new Map,o;for(let c of t.issues)if(c.code==="unrecognized_keys"){o??(o=c);for(let u of c.keys)n.has(u)||n.set(u,{}),n.get(u).l=!0}else e.issues.push(c);for(let c of r.issues)if(c.code==="unrecognized_keys")for(let u of c.keys)n.has(u)||n.set(u,{}),n.get(u).r=!0;else e.issues.push(c);let i=[...n].filter(([,c])=>c.l&&c.r).map(([c])=>c);if(i.length&&o&&e.issues.push({...o,keys:i}),Ge(e))return e;let s=is(t.value,r.value);if(!s.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return e.value=s.data,e}function Uu(e,t){for(let r=e.length-1;r>=0;r--)if(e[r]._zod[t]!=="optional")return r+1;return 0}function Lu(e,t,r){e.issues.length&&t.issues.push(...ge(r,e.issues)),t.value[r]=e.value}function Fu(e,t,r,n,o){for(let i=0;i<r.length;i++){let s=e[i],c=i<n.length;if(s.issues.length){if(!c&&i>=o){t.value.length=i;break}t.issues.push(...ge(i,s.issues))}t.value[i]=s.value}for(let i=t.value.length-1;i>=n.length&&(r[i]._zod.optout==="optional"&&t.value[i]===void 0);i--)t.value.length=i;return t}function Hu(e,t,r,n,o,i,s){e.issues.length&&(lr.has(typeof n)?r.issues.push(...ge(n,e.issues)):r.issues.push({code:"invalid_key",origin:"map",input:o,inst:i,issues:e.issues.map(c=>de(c,s,te()))})),t.issues.length&&(lr.has(typeof n)?r.issues.push(...ge(n,t.issues)):r.issues.push({origin:"map",code:"invalid_element",input:o,inst:i,key:n,issues:t.issues.map(c=>de(c,s,te()))})),r.value.set(e.value,t.value)}function Bu(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}function Wu(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}function Vu(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}function Ju(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}function fn(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},r)}function mn(e,t,r){if(e.issues.length)return e.aborted=!0,e;if((r.direction||"forward")==="forward"){let o=t.transform(e.value,e);return o instanceof Promise?o.then(i=>gn(e,i,t.out,r)):gn(e,o,t.out,r)}else{let o=t.reverseTransform(e.value,e);return o instanceof Promise?o.then(i=>gn(e,i,t.in,r)):gn(e,o,t.in,r)}}function gn(e,t,r,n){return e.issues.length?(e.aborted=!0,e):r._zod.run({value:t,issues:e.issues},n)}function qu(e){return e.value=Object.freeze(e.value),e}function Gu(e,t,r,n){if(!e){let o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),t.issues.push(St(o))}}var M,ct,q,ss,as,ls,cs,us,ds,ps,fs,ms,gs,hs,ys,bs,vs,xs,ws,_s,ks,zs,Ss,Ps,Zs,Is,Es,Cs,yn,Ts,yr,bn,Os,Rs,As,Ns,js,Ds,Ms,Us,Ls,Fs,ed,Hs,br,Bs,Ws,Vs,vn,Js,qs,Gs,Ks,Ys,Xs,Qs,xn,ea,ta,ra,na,oa,ia,sa,aa,wn,vr,la,ca,ua,da,pa,fa,ma,ga=J(()=>{pn();st();rs();li();cn();Se();os();Se();M=f("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=ns;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let o of n)for(let i of o._zod.onattach)i(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let o=(s,c,u)=>{let d=Ge(s),m;for(let h of c){if(h._zod.def.when){if(ti(s)||!h._zod.def.when(s))continue}else if(d)continue;let b=s.issues.length,p=h._zod.check(s);if(p instanceof Promise&&u?.async===!1)throw new Ze;if(m||p instanceof Promise)m=(m??Promise.resolve()).then(async()=>{await p,s.issues.length!==b&&(d||(d=Ge(s,b)))});else{if(s.issues.length===b)continue;d||(d=Ge(s,b))}}return m?m.then(()=>s):s},i=(s,c,u)=>{if(Ge(s))return s.aborted=!0,s;let d=o(c,n,u);if(d instanceof Promise){if(u.async===!1)throw new Ze;return d.then(m=>e._zod.parse(m,u))}return e._zod.parse(d,u)};e._zod.run=(s,c)=>{if(c.skipChecks)return e._zod.parse(s,c);if(c.direction==="backward"){let d=e._zod.parse({value:s.value,issues:[]},{...c,skipChecks:!0});return d instanceof Promise?d.then(m=>i(m,s,c)):i(d,s,c)}let u=e._zod.parse(s,c);if(u instanceof Promise){if(c.async===!1)throw new Ze;return u.then(d=>o(d,n,c))}return o(u,n,c)}}F(e,"~standard",()=>({validate:o=>{try{let i=si(e,o);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return ai(e,o).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}))}),ct=f("$ZodString",(e,t)=>{M.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Ei(e._zod.bag),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),q=f("$ZodStringFormat",(e,t)=>{Et.init(e,t),ct.init(e,t)}),ss=f("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=hi),q.init(e,t)}),as=f("$ZodUUID",(e,t)=>{if(t.version){let n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(n===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=lt(n))}else t.pattern??(t.pattern=lt());q.init(e,t)}),ls=f("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=yi),q.init(e,t)}),cs=f("$ZodURL",(e,t)=>{q.init(e,t),e._zod.check=r=>{try{let n=r.value.trim();if(!t.normalize&&t.protocol?.source===Si.source&&!/^https?:\/\//i.test(n)){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}let o=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=o.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),us=f("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=bi()),q.init(e,t)}),ds=f("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=mi),q.init(e,t)}),ps=f("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=ci),q.init(e,t)}),fs=f("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=ui),q.init(e,t)}),ms=f("$ZodULID",(e,t)=>{t.pattern??(t.pattern=di),q.init(e,t)}),gs=f("$ZodXID",(e,t)=>{t.pattern??(t.pattern=pi),q.init(e,t)}),hs=f("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=fi),q.init(e,t)}),ys=f("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Ii(t)),q.init(e,t)}),bs=f("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Pi),q.init(e,t)}),vs=f("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Zi(t)),q.init(e,t)}),xs=f("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=gi),q.init(e,t)}),ws=f("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=vi),q.init(e,t),e._zod.bag.format="ipv4"}),_s=f("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=xi),q.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),ks=f("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=wi(t.delimiter)),q.init(e,t),e._zod.bag.format="mac"}),zs=f("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=_i),q.init(e,t)}),Ss=f("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=ki),q.init(e,t),e._zod.check=r=>{let n=r.value.split("/");try{if(n.length!==2)throw new Error;let[o,i]=n;if(!i)throw new Error;let s=Number(i);if(`${s}`!==i)throw new Error;if(s<0||s>128)throw new Error;new URL(`http://[${o}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});Ps=f("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=zi),q.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{$s(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});Zs=f("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=an),q.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{Ku(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),Is=f("$ZodE164",(e,t)=>{t.pattern??(t.pattern=$i),q.init(e,t)});Es=f("$ZodJWT",(e,t)=>{q.init(e,t),e._zod.check=r=>{Yu(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),Cs=f("$ZodCustomStringFormat",(e,t)=>{q.init(e,t),e._zod.check=r=>{t.fn(r.value)||r.issues.push({code:"invalid_format",format:t.format,input:r.value,inst:e,continue:!t.abort})}}),yn=f("$ZodNumber",(e,t)=>{M.init(e,t),e._zod.pattern=e._zod.bag.pattern??ln,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;let i=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...i?{received:i}:{}}),r}}),Ts=f("$ZodNumberFormat",(e,t)=>{Mi.init(e,t),yn.init(e,t)}),yr=f("$ZodBoolean",(e,t)=>{M.init(e,t),e._zod.pattern=Oi,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}let o=r.value;return typeof o=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),r}}),bn=f("$ZodBigInt",(e,t)=>{M.init(e,t),e._zod.pattern=Ci,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}}),Os=f("$ZodBigIntFormat",(e,t)=>{Ui.init(e,t),bn.init(e,t)}),Rs=f("$ZodSymbol",(e,t)=>{M.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;return typeof o=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:o,inst:e}),r}}),As=f("$ZodUndefined",(e,t)=>{M.init(e,t),e._zod.pattern=Ai,e._zod.values=new Set([void 0]),e._zod.parse=(r,n)=>{let o=r.value;return typeof o>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:o,inst:e}),r}}),Ns=f("$ZodNull",(e,t)=>{M.init(e,t),e._zod.pattern=Ri,e._zod.values=new Set([null]),e._zod.parse=(r,n)=>{let o=r.value;return o===null||r.issues.push({expected:"null",code:"invalid_type",input:o,inst:e}),r}}),js=f("$ZodAny",(e,t)=>{M.init(e,t),e._zod.parse=r=>r}),Ds=f("$ZodUnknown",(e,t)=>{M.init(e,t),e._zod.parse=r=>r}),Ms=f("$ZodNever",(e,t)=>{M.init(e,t),e._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)}),Us=f("$ZodVoid",(e,t)=>{M.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;return typeof o>"u"||r.issues.push({expected:"void",code:"invalid_type",input:o,inst:e}),r}}),Ls=f("$ZodDate",(e,t)=>{M.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let o=r.value,i=o instanceof Date;return i&&!Number.isNaN(o.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:o,...i?{received:"Invalid Date"}:{},inst:e}),r}});Fs=f("$ZodArray",(e,t)=>{M.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),r;r.value=Array(o.length);let i=[];for(let s=0;s<o.length;s++){let c=o[s],u=t.element._zod.run({value:c,issues:[]},n);u instanceof Promise?i.push(u.then(d=>Nu(d,r,s))):Nu(u,r,s)}return i.length?Promise.all(i).then(()=>r):r}});ed=f("$ZodObject",(e,t)=>{if(M.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let c=t.shape;Object.defineProperty(t,"shape",{get:()=>{let u={...c};return Object.defineProperty(t,"shape",{value:u}),u}})}let n=zt(()=>Xu(t));F(e._zod,"propValues",()=>{let c=t.shape,u={};for(let d in c){let m=c[d]._zod;if(m.values){u[d]??(u[d]=new Set);for(let h of m.values)u[d].add(h)}}return u});let o=at,i=t.catchall,s;e._zod.parse=(c,u)=>{s??(s=n.value);let d=c.value;if(!o(d))return c.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),c;c.value={};let m=[],h=s.shape;for(let b of s.keys){let p=h[b],x=p._zod.optin==="optional",k=p._zod.optout==="optional",y=p._zod.run({value:d[b],issues:[]},u);y instanceof Promise?m.push(y.then($=>hn($,c,b,d,x,k))):hn(y,c,b,d,x,k)}return i?Qu(m,d,c,u,n.value,e):m.length?Promise.all(m).then(()=>c):c}}),Hs=f("$ZodObjectJIT",(e,t)=>{ed.init(e,t);let r=e._zod.parse,n=zt(()=>Xu(t)),o=b=>{let p=new hr(["shape","payload","ctx"]),x=n.value,k=Z=>{let S=Jr(Z);return`shape[${S}]._zod.run({ value: input[${S}], issues: [] }, ctx)`};p.write("const input = payload.value;");let y=Object.create(null),$=0;for(let Z of x.keys)y[Z]=`key_${$++}`;p.write("const newResult = {};");for(let Z of x.keys){let S=y[Z],D=Jr(Z),C=b[Z],B=C?._zod?.optin==="optional",H=C?._zod?.optout==="optional";p.write(`const ${S} = ${k(Z)};`),B&&H?p.write(`
12
- if (${S}.issues.length) {
13
- if (${D} in input) {
14
- payload.issues = payload.issues.concat(${S}.issues.map(iss => ({
15
- ...iss,
16
- path: iss.path ? [${D}, ...iss.path] : [${D}]
17
- })));
8
+ var Dh=Object.create;var to=Object.defineProperty;var Lh=Object.getOwnPropertyDescriptor;var jh=Object.getOwnPropertyNames;var Mh=Object.getPrototypeOf,Uh=Object.prototype.hasOwnProperty;var K=(e,t)=>()=>(e&&(t=e(e=0)),t);var Ue=(e,t)=>{for(var n in t)to(e,n,{get:t[n],enumerable:!0})},Pp=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of jh(t))!Uh.call(e,o)&&o!==n&&to(e,o,{get:()=>t[o],enumerable:!(r=Lh(t,o))||r.enumerable});return e};var Vh=(e,t,n)=>(n=e!=null?Dh(Mh(e)):{},Pp(t||!e||!e.__esModule?to(n,"default",{value:e,enumerable:!0}):n,e)),Fh=e=>Pp(to({},"__esModule",{value:!0}),e);var E={};Ue(E,{BIGINT_FORMAT_RANGES:()=>er,CONSTANT_CATCH:()=>ao,Class:()=>_s,NUMBER_FORMAT_RANGES:()=>Qn,aborted:()=>$e,allowsEval:()=>Ss,assert:()=>Kh,assertEqual:()=>Bh,assertIs:()=>Wh,assertNever:()=>Jh,assertNotEqual:()=>Hh,assignProp:()=>ge,attachSchema:()=>tr,base64ToUint8Array:()=>Ep,base64urlToUint8Array:()=>dy,cached:()=>an,captureStackTrace:()=>oo,cleanEnum:()=>py,cleanRegex:()=>nt,clone:()=>q,cloneDef:()=>Yh,codePointLength:()=>At,constantCatch:()=>Os,createTransparentProxy:()=>ry,defineLazy:()=>$s,defineLazyInternal:()=>W,derived:()=>yy,esc:()=>_e,escapeRegex:()=>je,explicitlyAborted:()=>Ps,extend:()=>sy,finalizeIssue:()=>Ce,floatSafeRemainder:()=>qn,getElementAtPath:()=>Xh,getEnumValues:()=>on,getLengthableOrigin:()=>rr,getParsedType:()=>ny,getSizableOrigin:()=>nr,hexToUint8Array:()=>gy,hide:()=>or,installLazyProp:()=>ky,isObject:()=>Ct,isPlainObject:()=>Le,issue:()=>cn,joinValues:()=>no,jsonStringifyReplacer:()=>sn,members:()=>As,merge:()=>ly,mergeDefs:()=>Ve,normalizeParams:()=>C,nullish:()=>ro,numKeys:()=>ty,objectClone:()=>Gh,omit:()=>iy,optionalKeys:()=>Is,own:()=>ft,parsedType:()=>Cs,partial:()=>uy,pick:()=>oy,prefixIssues:()=>Pe,primitiveTypes:()=>zs,promiseAllObject:()=>Qh,propertyKeyTypes:()=>Xn,randomString:()=>ey,rawShape:()=>ln,required:()=>cy,safeExtend:()=>ay,shallowClone:()=>Yn,sizeCaps:()=>un,slugify:()=>xs,stringifyPrimitive:()=>io,toZod:()=>Gn,uint8ArrayToBase64:()=>Zp,uint8ArrayToBase64url:()=>my,uint8ArrayToHex:()=>hy,unwrapMessage:()=>rn});function Bh(e){return e}function Hh(e){return e}function Gn(){return e=>e}function Wh(e){}function Jh(e){throw new Error("Unexpected value in exhaustive check")}function Kh(e){}function on(e){let t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,o])=>t.indexOf(+r)===-1).map(([r,o])=>o)}function no(e,t="|"){return e.map(n=>io(n)).join(t)}function sn(e,t){return typeof t=="bigint"?t.toString():t}function an(e){return new ks(e)}function ro(e){return e==null}function nt(e){let t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function qn(e,t){let n=e/t,r=Math.round(n),o=4*Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-r)<o?0:n-r}function $s(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Cp)return r===void 0&&(r=Cp,r=n()),r},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function Gh(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function ge(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function ln(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function tt(e){return ln(e._zod.def)??e._zod.def.shape}function Ap(e,t,n){Object.defineProperty(e,t,{get(){let r=n();return ge(this,t,r),r},enumerable:!0,configurable:!0})}function Op(e,t,n){t in e?ge(e,t,n):e[t]=n}function Pt(e,t,n,r){let o=tt(t);for(let i of n){let s=Object.getOwnPropertyDescriptor(o,i);s.enumerable&&(s.get?Ap(e,i,()=>{let a=t._zod.def.shape[i];return r?r(a,i):a}):Op(e,i,r?r(s.value,i):s.value))}}function qh(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?Ap(e,n,()=>t[n]):Op(e,n,r.value))}}function Ve(...e){let t={};for(let n of e){let r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function Yh(e){return Ve(e._zod.def)}function Xh(e,t){return t?t.reduce((n,r)=>n?.[r],e):e}function Qh(e){let t=Object.keys(e),n=t.map(r=>e[r]);return Promise.all(n).then(r=>{let o={};for(let i=0;i<t.length;i++)o[t[i]]=r[i];return o})}function ey(e=10){let t="abcdefghijklmnopqrstuvwxyz",n="";for(let r=0;r<e;r++)n+=t[Math.floor(Math.random()*t.length)];return n}function _e(e){return JSON.stringify(e)}function xs(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function Ct(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Le(e){if(Ct(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let n=t.prototype;return!(Ct(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function Yn(e){return Le(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function ty(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}function je(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function q(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function C(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function ry(e){let t;return new Proxy({},{get(n,r,o){return t??(t=e()),Reflect.get(t,r,o)},set(n,r,o,i){return t??(t=e()),Reflect.set(t,r,o,i)},has(n,r){return t??(t=e()),Reflect.has(t,r)},deleteProperty(n,r){return t??(t=e()),Reflect.deleteProperty(t,r)},ownKeys(n){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,r){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,r)},defineProperty(n,r,o){return t??(t=e()),Reflect.defineProperty(t,r,o)}})}function io(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function Is(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}function oy(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let i={};return Pt(i,e,so(e,t)),q(e,Ve(n,{shape:i,checks:[]}))}function so(e,t){let n=tt(e),r=[];for(let o of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,o)?.enumerable)throw new Error(`Unrecognized key: "${String(o)}"`);t[o]&&r.push(o)}return r}function iy(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let i=new Set(so(e,t)),s={};return Pt(s,e,Reflect.ownKeys(tt(e)).filter(a=>!i.has(a))),q(e,Ve(n,{shape:s,checks:[]}))}function sy(e,t){if(!Le(t))throw new Error("Invalid input to extend: expected a plain object");let n=e._zod.def.checks;if(n&&n.length>0){let o=tt(e);for(let i of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(o,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return q(e,Ve(e._zod.def,{shape:Np(e,t)}))}function Np(e,t){let n={};return Pt(n,e,Reflect.ownKeys(tt(e))),qh(n,t),n}function ay(e,t){if(!Le(t))throw new Error("Invalid input to safeExtend: expected a plain object");return q(e,Ve(e._zod.def,{shape:Np(e,t)}))}function ly(e,t){if(!t?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let n={};Pt(n,e,Reflect.ownKeys(tt(e))),Pt(n,t,Reflect.ownKeys(tt(t)));let r=Ve(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return q(e,r)}function uy(e,t,n,r="partial"){let i=t._zod.def.checks;if(i&&i.length>0)throw new Error(`.${r}() cannot be used on object schemas containing refinements`);let a=n?new Set(so(t,n)):void 0,l={};return Pt(l,t,Reflect.ownKeys(tt(t)),e&&((u,p)=>a&&!a.has(p)?u:new e({type:"optional",innerType:u}))),q(t,Ve(t._zod.def,{shape:l,checks:[]}))}function cy(e,t,n){let r=n?new Set(so(t,n)):void 0,o={};return Pt(o,t,Reflect.ownKeys(tt(t)),(i,s)=>r&&!r.has(s)?i:new e({type:"nonoptional",innerType:i})),q(t,Ve(t._zod.def,{shape:o}))}function $e(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Ps(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function Pe(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function rn(e){return typeof e=="string"?e:e?.message}function un(e){let t=[];for(let n of e??[]){let r=n._zod.def;if(!/_(length|size)$|_equals$/.test(r.check))break;let o=r.maximum??r.length??r.size;o>=0&&t.push([o,n])}return t}function tr(e,t,n){var r;for(let o=t;o<e.length;o++)(r=e[o]).schema??(r.schema=n)}function Ce(e,t,n){var r;let o=e.inst?._zod?.traits;o?.has("$ZodType")&&(o.has("$ZodCheck")?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);let i=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,s=e.message?e.message:rn(e.inst?._zod.def?.error?.(e))??rn(i?.(e))??rn(t?.error?.(e))??rn(n.customError?.(e))??rn(n.localeError?.(e))??"Invalid input",a={};for(let l of Object.keys(e))l==="inst"||l==="schema"||l==="continue"||l==="input"||l==="__proto__"||(a[l]=e[l]);return a.path??(a.path=[]),a.message=s,t?.reportInput&&(a.input=e.input),a}function nr(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function At(e){let t=e.length;if(!fy.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(e.charCodeAt(r)&64512)===55296&&(e.charCodeAt(r+1)&64512)===56320&&(n--,r++);return n}function rr(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Cs(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let n=e;if(n&&Object.getPrototypeOf(n)!==Object.prototype&&"constructor"in n&&n.constructor)return n.constructor.name}}return t}function cn(...e){let[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}function py(e){return Object.entries(e).filter(([t,n])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function Ep(e){let t=atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}function Zp(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function dy(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-t.length%4)%4);return Ep(t+n)}function my(e){return Zp(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function gy(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let n=new Uint8Array(t.length/2);for(let r=0;r<t.length;r+=2)n[r/2]=Number.parseInt(t.slice(r,r+2),16);return n}function hy(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}function As(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):by(e,n,r.value)}}function ft(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function or(e,t,n){return ft(e,t,n,!1)}function yy(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return ft(this,n,r(this))},set(o){ft(this,n,o)}})}return t}function by(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:ft(this,t,n.bind(this))},set(r){ft(this,t,r)}})}function wy(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}function W(e,t,n){let r=Object.getPrototypeOf(e._zod);if(t in r&&vs!==e._zod){vs=void 0;return}vs=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,vy);let o=ct;ct=!1;try{let i=n(this);return ct?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:i}),ct=ct||o,i}catch(i){throw delete this[t],ct=ct||o,i}},set(o){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:o})}})}function ky(e,t,n,r){let o=wy(e,t);o&&Object.defineProperty(o,t,{configurable:!0,get(){let i={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,i),i.value=n(this),Object.defineProperty(this,t,i),i.value},set(i){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:i})}})}function Os(e){let t=()=>e;return t[ao]=!0,t}var ks,Cp,oo,Ss,ny,Xn,zs,Qn,er,fy,_s,vs,ct,vy,ao,le=K(()=>{pt();ks=class{constructor(t){this._getter=t,this._value=void 0}get value(){let t=this._getter;return t!==void 0&&(this._value=t(),this._getter=void 0),this._value}};Cp=Symbol("evaluating");oo="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};Ss=an(()=>{if(me.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});ny=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},Xn=new Set(["string","number","symbol"]),zs=new Set(["string","number","bigint","boolean","symbol","undefined"]);Qn={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]},er={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};fy=/[\uD800-\uDBFF]/;_s=class{constructor(...t){}};ct=!1,vy={configurable:!0,get(){ct=!0}};ao="~constantCatch"});function _y(e){let t=Rp;if(t){let n=t.stackTraceLimit;if(typeof n=="number"){try{t.stackTraceLimit=0}catch{return Rp=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function b(e,t,n,r){let o={};function i(g){this.def=g,this.constr=m,this.traits=new Set}i.prototype=o;let s=n,a=s&&new WeakSet;function l(g,d){if(g._zod){if(g._zod.traits.has(e))return}else{Ns.value=new i(d);try{Object.defineProperty(g,"_zod",Ns)}finally{Ns.value=void 0}}if(g._zod.traits.add(e),t(g,d),a){let y=Object.getPrototypeOf(g),w=g._zod.constr.prototype,_=y;for(;_&&_!==w;)_=Object.getPrototypeOf(_);let v=_??y;a.has(v)||(a.add(v),As(v,s))}let h=m.prototype;for(let y in h)Object.prototype.hasOwnProperty.call(h,y)&&(y in g||(g[y]=h[y].bind(g)))}let u=r?.Parent??Object;class p extends u{}Object.defineProperty(p,"name",{value:e});function m(g){let d=r?.Parent?_y(p):this;l(d,g);let h=d._zod.deferred;if(h){for(let w of h)w();d._zod.deferred=void 0}let y=globalThis.__zod_globalConfig?.postProcessor;return y&&y(d),d}return Object.defineProperty(m,"init",{value:l}),Object.defineProperty(m,Symbol.hasInstance,{value:g=>r?.Parent&&g instanceof r.Parent?!0:g?._zod?.traits?.has(e)}),Object.defineProperty(m,"name",{value:e}),m}function se(e){return e&&Object.assign(me,e),me}var Tp,Es,Ns,Rp,Zs,Ae,dt,me,pt=K(()=>{le();Es=Object.freeze({status:"aborted"}),Ns={value:void 0,enumerable:!1},Rp="captureStackTrace"in Error?Error:null;Zs=Symbol("zod_brand"),Ae=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},dt=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(Tp=globalThis).__zod_globalConfig??(Tp.__zod_globalConfig={});me=globalThis.__zod_globalConfig});function $y(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,sn,2)),e.message}function xy(e){this._zod.message=e}function zy(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t==="__proto__"?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function ir(e,t=n=>n.message){let n={},r=[];for(let o of e.issues)o.path.length>0?zy(n,o.path[0],()=>[]).push(t(o)):r.push(t(o));return{formErrors:r,fieldErrors:n}}function sr(e,t=n=>n.message){let n={_errors:[]},r=(o,i=[])=>{for(let s of o.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(a=>r({issues:a},[...i,...s.path]));else if(s.code==="invalid_key")r({issues:s.issues},[...i,...s.path]);else if(s.code==="invalid_element")r({issues:s.issues},[...i,...s.path]);else{let a=[...i,...s.path];if(a.length===0)n._errors.push(t(s));else{let l=n,u=0;for(;u<a.length;){let p=a[u],m=u===a.length-1;if(p==="_errors"){m&&l._errors.push(t(s)),u++;continue}Object.prototype.hasOwnProperty.call(l,p)||Object.defineProperty(l,p,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let g=l[p];m&&g._errors.push(t(s)),l=g,u++}}}};return r(e),n}function Ls(e,t=n=>n.message){let n={errors:[]},r=(o,i=[])=>{var s;for(let a of o.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(l=>r({issues:l},[...i,...a.path]));else if(a.code==="invalid_key")r({issues:a.issues},[...i,...a.path]);else if(a.code==="invalid_element")r({issues:a.issues},[...i,...a.path]);else{let l=[...i,...a.path];if(l.length===0){n.errors.push(t(a));continue}let u=n,p=0;for(;p<l.length;){let m=l[p],g=p===l.length-1;typeof m=="string"?(u.properties??(u.properties={}),Object.prototype.hasOwnProperty.call(u.properties,m)||Object.defineProperty(u.properties,m,{value:{errors:[]},enumerable:!0,writable:!0,configurable:!0}),u=u.properties[m]):(u.items??(u.items=[]),(s=u.items)[m]??(s[m]={errors:[]}),u=u.items[m]),g&&u.errors.push(t(a)),p++}}};return r(e),n}function jp(e){let t=[],n=e.map(r=>typeof r=="object"?r.key:r);for(let r of n)typeof r=="number"?t.push(`[${r}]`):typeof r=="symbol"?t.push(`[${JSON.stringify(String(r))}]`):/[^\w$]/.test(r)?t.push(`[${JSON.stringify(r)}]`):(t.length&&t.push("."),t.push(r));return t.join("")}function js(e){let t=[],n=[...e.issues].sort((r,o)=>(r.path??[]).length-(o.path??[]).length);for(let r of n)t.push(`\u2716 ${r.message}`),r.path?.length&&t.push(` \u2192 at ${jp(r.path)}`);return t.join(`
9
+ `)}var Sy,Rs,Dp,Lp,Ds,Oe,Ms=K(()=>{pt();le();Sy={get:$y,set:xy,enumerable:!0,configurable:!0},Rs={value:void 0,enumerable:!1},Dp=new WeakSet([Object.prototype,Error.prototype]),Lp=(e,t)=>{e.name="$ZodError",Rs.value=t,Object.defineProperty(e,"issues",Rs),Rs.value=void 0,Object.defineProperty(e,"message",Sy);let n=Object.getPrototypeOf(e);Dp.has(n)||(Dp.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let r=()=>this.message;return Object.defineProperty(this,"toString",{value:r,configurable:!0,writable:!0}),r},set(r){Object.defineProperty(this,"toString",{value:r,configurable:!0,writable:!0})}}))},Ds=b("$ZodError",Lp),Oe=b("$ZodError",Lp,void 0,{Parent:Error})});function lo(e,t){return{callee:t?.callee??e,Err:t?.Err}}function Mp(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(o=>Ce(o,n,se()))),t=void 0,n=void 0),r},set error(o){r=o,t=void 0,n=void 0}}}function Ny(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},o=e._zod.bag.fallbackRun,i;if(o?(r[Oy]=!0,i=o({value:t,issues:[]},r)):i=e._zod.run({value:t,issues:[]},r),i instanceof Promise)throw new Ae;return i.issues.length===0}var fn,uo,pn,co,dn,Py,mn,Cy,Ay,Oy,ar,lr,fo,Ey,po,Zy,mo,Ty,go,Ry,ho,Dy,yo,Ly,bo,jy,wo,My,Us=K(()=>{pt();Ms();le();fn=e=>{let t=(n,r,o,i)=>{let s=o?{...o,async:!1}:{async:!1},a=n._zod.run({value:r,issues:[]},s);if(a instanceof Promise)throw new Ae;if(a.issues.length){let l=new(i?.Err??e)(a.issues.map(u=>Ce(u,s,se())));throw oo(l,i?.callee??t),l}return a.value};return t},uo=fn(Oe),pn=e=>{let t=async(n,r,o,i)=>{let s=o?{...o,async:!0}:{async:!0},a=n._zod.run({value:r,issues:[]},s);if(a instanceof Promise&&(a=await a),a.issues.length){let l=new(i?.Err??e)(a.issues.map(u=>Ce(u,s,se())));throw oo(l,i?.callee??t),l}return a.value};return t},co=pn(Oe),dn=e=>(t,n,r)=>{let o=r?{...r,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},o);if(i instanceof Promise)throw new Ae;return i.issues.length?Mp(e,i.issues,o):{success:!0,data:i.value}},Py=dn(Oe);mn=e=>async(t,n,r)=>{let o=r?{...r,async:!0}:{async:!0},i=t._zod.run({value:n,issues:[]},o);return i instanceof Promise&&(i=await i),i.issues.length?Mp(e,i.issues,o):{success:!0,data:i.value}},Cy=mn(Oe),Ay=Symbol.for("zod.compile.invalid"),Oy=Symbol.for("zod.compile.fallback"),ar=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==Ay)return!0;if(r.definite===!0&&n===void 0)return!1}return Ny(e,t,n)});lr=async(e,t,n)=>{let r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},o=e._zod.run({value:t,issues:[]},r);return o instanceof Promise&&(o=await o),o.issues.length===0},fo=e=>{let t=fn(e),n=(r,o,i,s)=>{let a=i?{...i,direction:"backward"}:{direction:"backward"};return t(r,o,a,lo(n,s))};return n},Ey=fo(Oe),po=e=>{let t=fn(e),n=(r,o,i,s)=>t(r,o,i,lo(n,s));return n},Zy=po(Oe),mo=e=>{let t=pn(e),n=async(r,o,i,s)=>{let a=i?{...i,direction:"backward"}:{direction:"backward"};return await t(r,o,a,lo(n,s))};return n},Ty=mo(Oe),go=e=>{let t=pn(e),n=async(r,o,i,s)=>await t(r,o,i,lo(n,s));return n},Ry=go(Oe),ho=e=>(t,n,r)=>{let o=r?{...r,direction:"backward"}:{direction:"backward"};return dn(e)(t,n,o)},Dy=ho(Oe),yo=e=>(t,n,r)=>dn(e)(t,n,r),Ly=yo(Oe),bo=e=>async(t,n,r)=>{let o=r?{...r,direction:"backward"}:{direction:"backward"};return mn(e)(t,n,o)},jy=bo(Oe),wo=e=>async(t,n,r)=>mn(e)(t,n,r),My=wo(Oe)});var Me={};Ue(Me,{anyString:()=>ma,base64:()=>ia,base64url:()=>sa,bigint:()=>ha,boolean:()=>ya,browserEmail:()=>Ky,cidrv4:()=>ra,cidrv6:()=>oa,creditCard:()=>vo,cuid:()=>Fs,cuid2:()=>Bs,currencyCode:()=>ca,date:()=>fa,datetime:()=>da,domain:()=>la,duration:()=>qs,e164:()=>ua,email:()=>Xs,emoji:()=>Qs,extendedDuration:()=>Uy,guid:()=>Ys,hex:()=>_a,hostname:()=>aa,html5Email:()=>Hy,httpProtocol:()=>ur,iban:()=>ko,idnEmail:()=>Jy,integer:()=>cr,ipv4:()=>ea,ipv6:()=>ta,ksuid:()=>Js,lowercase:()=>va,mac:()=>na,md5_base64:()=>Xy,md5_base64url:()=>Qy,md5_hex:()=>Yy,nanoid:()=>Ks,nanoidOfLength:()=>Gs,null:()=>ba,number:()=>rt,rfc5322Email:()=>Wy,sha1_base64:()=>tb,sha1_base64url:()=>nb,sha1_hex:()=>eb,sha256_base64:()=>ob,sha256_base64url:()=>ib,sha256_hex:()=>rb,sha384_base64:()=>ab,sha384_base64url:()=>lb,sha384_hex:()=>sb,sha512_base64:()=>cb,sha512_base64url:()=>fb,sha512_hex:()=>ub,string:()=>ga,time:()=>pa,ulid:()=>Hs,undefined:()=>wa,unicodeEmail:()=>Up,uppercase:()=>ka,uuid:()=>Ot,uuid4:()=>Vy,uuid6:()=>Fy,uuid7:()=>By,xid:()=>Ws});function Gs(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}function Qs(){return new RegExp(Gy,"u")}function qy(e){return new RegExp(`^${e}$`)}function Vs(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function pa(e){return new RegExp(`^${Vs(e)}$`)}function da(e){let t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let n=`${Vs({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,r=e.local?`${n}|${Vs({precision:e.precision})}`:n;return new RegExp(`^${Vp}T(?:${r})$`)}function fr(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function pr(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var Fs,Bs,Hs,Ws,Js,Ks,qs,Uy,Ys,Ot,Vy,Fy,By,Xs,Hy,Wy,Up,Jy,Ky,Gy,ea,ta,na,ra,oa,ia,sa,aa,la,ur,ua,vo,ca,ko,Vp,fa,ma,ga,ha,cr,rt,ya,ba,wa,va,ka,_a,Yy,Xy,Qy,eb,tb,nb,rb,ob,ib,sb,ab,lb,ub,cb,fb,Nt=K(()=>{le();Fs=/^[cC][0-9a-z]{6,}$/,Bs=/^[0-9a-z]+$/,Hs=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,Ws=/^[0-9a-vA-V]{20}$/,Js=/^[A-Za-z0-9]{27}$/,Ks=/^[a-zA-Z0-9_-]{21}$/;qs=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Uy=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Ys=/^([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})$/,Ot=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)$/,Vy=Ot(4),Fy=Ot(6),By=Ot(7),Xs=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Hy=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Wy=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,Up=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,Jy=Up,Ky=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Gy="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";ea=/^(?:(?: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])$/,ta=/^(([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}|:))$/,na=e=>{let t=je(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},ra=/^((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])$/,oa=/^(([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}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ia=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,sa=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,aa=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,la=/^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$/,ur=/^https?$/,ua=/^\+[1-9]\d{6,14}$/,vo=/^\d(?:[ -]?\d){11,18}$/,ca=/^(?:AED|AFN|ALL|AMD|AOA|ARS|AUD|AWG|AZN|BAM|BBD|BDT|BHD|BIF|BMD|BND|BOB|BOV|BRL|BSD|BTN|BWP|BYN|BZD|CAD|CDF|CHE|CHF|CHW|CLF|CLP|CNY|COP|COU|CRC|CUP|CVE|CZK|DJF|DKK|DOP|DZD|EGP|ERN|ETB|EUR|FJD|FKP|GBP|GEL|GHS|GIP|GMD|GNF|GTQ|GYD|HKD|HNL|HTG|HUF|IDR|ILS|INR|IQD|IRR|ISK|JMD|JOD|JPY|KES|KGS|KHR|KMF|KPW|KRW|KWD|KYD|KZT|LAK|LBP|LKR|LRD|LSL|LYD|MAD|MDL|MGA|MKD|MMK|MNT|MOP|MRU|MUR|MVR|MWK|MXN|MXV|MYR|MZN|NAD|NGN|NIO|NOK|NPR|NZD|OMR|PAB|PEN|PGK|PHP|PKR|PLN|PYG|QAR|RON|RSD|RUB|RWF|SAR|SBD|SCR|SDG|SEK|SGD|SHP|SLE|SOS|SRD|SSP|STN|SVC|SYP|SZL|THB|TJS|TMT|TND|TOP|TRY|TTD|TWD|TZS|UAH|UGX|USD|USN|UYI|UYU|UYW|UZS|VED|VES|VND|VUV|WST|XAD|XAF|XAG|XAU|XBA|XBB|XBC|XBD|XCD|XCG|XDR|XOF|XPD|XPF|XPT|XSU|XTS|XUA|XXX|YER|ZAR|ZMW|ZWG)$/,ko=/^[A-Z]{2}(?!00|01|99)\d{2}[A-Z0-9]{11,30}$/,Vp="(?:(?:\\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])))";fa=qy(Vp);ma=/^[\s\S]{0,}$/,ga=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},ha=/^-?\d+n?$/,cr=/^-?\d+$/,rt=/^-?\d+(?:\.\d+)?$/,ya=/^(?:true|false)$/i,ba=/^null$/i,wa=/^undefined$/i,va=/^[^A-Z]*$/,ka=/^[^a-z]*$/,_a=/^[0-9a-fA-F]*$/;Yy=/^[0-9a-fA-F]{32}$/,Xy=fr(22,"=="),Qy=pr(22),eb=/^[0-9a-fA-F]{40}$/,tb=fr(27,"="),nb=pr(27),rb=/^[0-9a-fA-F]{64}$/,ob=fr(43,"="),ib=pr(43),sb=/^[0-9a-fA-F]{96}$/,ab=fr(64,""),lb=pr(64),ub=/^[0-9a-fA-F]{128}$/,cb=fr(86,"=="),fb=pr(86)});function $o(e,t,n){e.issues.length&&t.issues.push(...Pe(n,e.issues))}var ee,$a,xa,_o,xo,So,Sa,za,Ia,Pa,Ca,Aa,Oa,Na,Ea,gn,Za,Ta,Ra,Da,La,ja,Ma,Ua,Va,Fa,zo=K(()=>{pt();Nt();le();ee=b("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),$a=e=>{let t=e.value;return!ro(t)&&t.size!==void 0},xa=e=>{let t=e.value;return!ro(t)&&t.length!==void 0},_o={number:"number",bigint:"bigint",object:"date"},xo=b("$ZodCheckLessThan",(e,t)=>{ee.init(e,t);let n=_o[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:_o[typeof r.value]??n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),So=b("$ZodCheckGreaterThan",(e,t)=>{ee.init(e,t);let n=_o[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:_o[typeof r.value]??n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Sa=b("$ZodCheckMultipleOf",(e,t)=>{ee.init(e,t),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):qn(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),za=b("$ZodCheckNumberFormat",(e,t)=>{ee.init(e,t),t.format=t.format||"float64";let n=t.format?.includes("int"),r=n?"int":"number",[o,i]=Qn[t.format];e._zod.check=s=>{let a=s.value;if(n){if(!Number.isInteger(a)){s.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}a<o&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),a>i&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),Ia=b("$ZodCheckBigIntFormat",(e,t)=>{ee.init(e,t);let[n,r]=er[t.format];e._zod.check=o=>{let i=o.value;i<n&&o.issues.push({origin:"bigint",input:i,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),i>r&&o.issues.push({origin:"bigint",input:i,code:"too_big",maximum:r,inclusive:!0,inst:e,continue:!t.abort})}}),Pa=b("$ZodCheckMaxSize",(e,t)=>{var n;ee.init(e,t),(n=e._zod.def).when??(n.when=$a),e._zod.check=r=>{let o=r.value;o.size<=t.maximum||r.issues.push({origin:nr(o),code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Ca=b("$ZodCheckMinSize",(e,t)=>{var n;ee.init(e,t),(n=e._zod.def).when??(n.when=$a),e._zod.check=r=>{let o=r.value;o.size>=t.minimum||r.issues.push({origin:nr(o),code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Aa=b("$ZodCheckSizeEquals",(e,t)=>{var n;ee.init(e,t),(n=e._zod.def).when??(n.when=$a),e._zod.check=r=>{let o=r.value,i=o.size;if(i===t.size)return;let s=i>t.size;r.issues.push({origin:nr(o),...s?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),Oa=b("$ZodCheckMaxLength",(e,t)=>{var n;ee.init(e,t),(n=e._zod.def).when??(n.when=xa),e._zod.check=r=>{let o=r.value,i=o.length;if((typeof o=="string"&&i>t.maximum?At(o):i)<=t.maximum)return;let a=rr(o);r.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Na=b("$ZodCheckMinLength",(e,t)=>{var n;ee.init(e,t),(n=e._zod.def).when??(n.when=xa),e._zod.check=r=>{let o=r.value,i=o.length;if((typeof o=="string"&&i>=t.minimum&&i<t.minimum*2?At(o):i)>=t.minimum)return;let a=rr(o);r.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Ea=b("$ZodCheckLengthEquals",(e,t)=>{var n;ee.init(e,t),(n=e._zod.def).when??(n.when=xa),e._zod.check=r=>{let o=r.value,i=o.length,s=typeof o=="string"&&i>=t.length&&i<=t.length*2?At(o):i;if(s===t.length)return;let a=rr(o),l=s>t.length;r.issues.push({origin:a,...l?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),gn=b("$ZodCheckStringFormat",(e,t)=>{var n,r;ee.init(e,t),t.pattern?(n=e._zod).check??(n.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Za=b("$ZodCheckRegex",(e,t)=>{gn.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Ta=b("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=va),gn.init(e,t)}),Ra=b("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=ka),gn.init(e,t)}),Da=b("$ZodCheckIncludes",(e,t)=>{ee.init(e,t);let n=je(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position},}${n}`:n);t.pattern=r,e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),La=b("$ZodCheckStartsWith",(e,t)=>{ee.init(e,t);let n=new RegExp(`^${je(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),ja=b("$ZodCheckEndsWith",(e,t)=>{ee.init(e,t);let n=new RegExp(`.*${je(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}});Ma=b("$ZodCheckProperty",(e,t)=>{ee.init(e,t),e._zod.check=n=>{let r=t.schema._zod.run({value:n.value[t.property],issues:[]},{});if(r instanceof Promise)return r.then(o=>$o(o,n,t.property));$o(r,n,t.property)}}),Ua=b("$ZodCheckProperties",(e,t)=>{ee.init(e,t),or(e,Symbol.iterator,function*(){yield e});let n;e._zod.check=r=>{if(r.value==null){r.issues.push({expected:"object",code:"invalid_type",input:r.value,inst:e});return}n??(n=Reflect.ownKeys(t.shape).map(s=>[s,t.shape[s]]));let o=r.value,i;for(let[s,a]of n){let l=a._zod.run({value:o[s],issues:[]},{});l instanceof Promise?(i??(i=[]),i.push(l.then(u=>$o(u,r,s)))):$o(l,r,s)}if(i)return Promise.all(i).then(()=>{})}}),Va=b("$ZodCheckMimeType",(e,t)=>{ee.init(e,t);let n=new Set(t.mime);e._zod.check=r=>{n.has(r.value.type)||r.issues.push({code:"invalid_value",values:t.mime,input:r.value.type,inst:e,continue:!t.abort})}}),Fa=b("$ZodCheckOverwrite",(e,t)=>{ee.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}})});var Et,Io=K(()=>{Et=class{constructor(t=[],n={}){this.content=[],this.indent=0,this.args=t,this.closed=n}indented(t){this.indent+=1;try{t(this)}finally{this.indent-=1}}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let r=t.split(`
10
+ `).filter(s=>s),o=Math.min(...r.map(s=>s.length-s.trimStart().length)),i=r.map(s=>s.slice(o)).map(s=>" ".repeat(this.indent*2)+s);for(let s of i)this.content.push(s)}compile(){let t=Function,n=this?.content??[""];return new t(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
11
+ ${n.join(`
12
+ `)}
13
+ };`)(...Object.values(this.closed))}}});var Ba,Ha=K(()=>{Ba={major:4,minor:6,patch:6}});async function pb(e,t){let n={async:!0};return id(await e._zod.run({value:t,issues:[]},n),n)}function No(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return id(r,n)}catch{}return pb(e,t)},vendor:"zod",version:1}}function Ya(e){try{return typeof URL<"u"&&typeof URL.canParse=="function"?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function Eo(e,t){return!("normalize"in t)&&!("hostname"in t)&&!("protocol"in t)?Ya(e)||dr:sd(e,t)}function sd(e,t){if(!t.normalize&&t.protocol?.source===ur.source&&!/^https?:\/\//i.test(e))return qa;try{if(typeof URL<"u"){let n=URL;if(typeof n.parse=="function")return n.parse(e)??dr}return new URL(e)}catch{return dr}}function mr(e){return e.replace(db,"")}function Zo(e,t){return t.lastIndex=0,t.test(e.hostname)}function To(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(":")?e.protocol.slice(0,-1):e.protocol)}function gr(e){return mb.test(e)?Ya(`http://[${e}]`):!1}function Ro(e){let t=e.split("/");if(t.length!==2)return!1;let[n,r]=t;if(!r)return!1;let o=Number(r);return`${o}`!==r||o<0||o>128?!1:gr(n)}function hr(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}function Lo(e){if(!yr.test(e))return!1;let t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return hr(n)}function hb(e){let t=e.length,n=1,r=0;for(;t;){let o=e.charCodeAt(--t)-48;n^=1,r+=n?[0,2,4,6,8,1,3,5,7,9][o]:o}return r%10===0}function jo(e){return vo.test(e)?hb(e.replace(gb,"")):!1}function yb(e){let t=0,n=e.length;for(let r=4;r<n;r++){let o=e.charCodeAt(r);t=(o>=65?t*100+(o-55):t*10+(o-48))%97}for(let r=0;r<4;r++){let o=e.charCodeAt(r);t=(o>=65?t*100+(o-55):t*10+(o-48))%97}return t===1}function Mo(e){return ko.test(e)?yb(e):!1}function Uo(e,t=null){try{let n=e.split(".");if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let o=JSON.parse(atob(r));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}function Nl(e,t){let n=un(e._zod.def.checks);if(!n.length)return;let r=Math.min(...n.map(i=>i[0])),o=e._zod.parse;e._zod.parse=(i,s)=>{let a=t(i.value);if(a>r&&!s?.skipChecks&&s?.direction!=="backward"){for(let[l,u]of un(e._zod.def.checks))if(a>l&&u._zod.def.when(i)){let p=i.issues.length;return u._zod.check(i),i.issues[p].continue=!1,tr(i.issues,p,e),i}}return o(i,s)}}function Bp(e,t,n){e.issues.length&&t.issues.push(...Pe(n,e.issues)),t.value[n]=e.value}function Oo(e,t,n,r,o,i){let s=n in r,a=i==="optional";if(!(!s&&a&&o==="optional")){if(e.issues.length){if(o!==void 0&&a&&!s)return;t.issues.push(...Pe(n,e.issues))}if(!s&&o===void 0){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}e.value===void 0?(s||o==="defaulted"&&!a)&&(t.value[n]=void 0):t.value[n]=e.value}}function ad(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:kb,o=r.length?[...t,...r]:t;for(let s of o)if(!e.shape?.[s]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${String(s)}": expected a Zod schema`);let i=Is(e.shape);return{...e,allKeys:o,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(i)}}function ld(e,t,n,r,o,i,s){let a=[],l=o.keySet,u=o.catchall._zod,p=u.def.type,m=u.optin,g=u.optout,d=0;for(let h in t){if(s&&n.issues.length!==d){if($e(n,d))break;d=n.issues.length}if(l.has(h))continue;if(h==="__proto__"){p==="never"&&a.push(h);continue}if(p==="never"){a.push(h);continue}let y=u.run({value:t[h],issues:[]},r);y instanceof Promise?e.push(y.then(w=>Oo(w,n,h,t,m,g))):Oo(y,n,h,t,m,g)}return a.length&&n.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:i,continue:!0}),e.length?Promise.all(e).then(()=>n):n}function Hp(e,t,n,r){for(let i of e)if(i.issues.length===0)return t.value=i.value,t;let o=e.filter(i=>!$e(i));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(i=>i.issues.map(s=>Ce(s,r,se())))}),t)}function Wp(e,t,n,r){let o=[];for(let i=0;i<e.length;i++)e[i].issues.length===0&&o.push(i);return o.length===1?(t.value=e[o[0]].value,t):(o.length===0?t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(i=>i.issues.map(s=>Ce(s,r,se())))}):t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:[],inclusive:!1,matches:o}),t)}function Rl(e,t){let n=e._zod,r=n.bag.optionsMap;r||(r=cd(n.def),n.bag.optionsMap=r);let o=r.get(t);if(o===null)throw new Error(`Ambiguous discriminator value "${String(t)}"`);return o}function cd(e){let t=new Map;for(let n of e.options){let r=n._zod.propValues?.[e.discriminator];if(!r||r.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(n)}"`);for(let o of r)if(t.has(o)){if(o!==void 0)throw new Error(`Duplicate discriminator value "${String(o)}"`);t.set(o,null)}else t.set(o,n)}return t}function hn(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Le(e)&&Le(t)){let n=Object.keys(t),r=Object.keys(e).filter(i=>n.indexOf(i)!==-1),o={...e,...t};Object.prototype.hasOwnProperty.call(o,"__proto__")&&delete o.__proto__;for(let i of r){if(i==="__proto__")continue;let s=hn(e[i],t[i]);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};o[i]=s.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let o=e[r],i=t[r],s=hn(o,i);if(!s.valid)return{valid:!1,mergeErrorPath:[r,...s.mergeErrorPath]};n.push(s.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Jp(e,t,n){let r=new Map,o,i=new Map,s=(u,p)=>{let m;if(u.code==="unrecognized_keys"&&!u.path?.length)o??(o=u),m=u.keys;else if(u.code==="invalid_key"&&u.origin==="record"&&u.path?.length===1){let g=String(u.path[0]);i.has(g)||i.set(g,u),m=[g]}else return!1;for(let g of m)r.has(g)||r.set(g,{}),r.get(g)[p]=!0;return!0};for(let u of t.issues)s(u,"l")||e.issues.push(u);for(let u of n.issues)s(u,"r")||e.issues.push(u);let a=[...r].filter(([,u])=>u.l&&u.r).map(([u])=>u);if(a.length){let u=o?a.filter(p=>o.keys.includes(p)):[];u.length&&e.issues.push({...o,keys:u});for(let p of a)!u.includes(p)&&i.has(p)&&e.issues.push(i.get(p))}let l=hn(t.value,n.value);if(!l.valid){if($e(e))return e;throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(l.mergeErrorPath)}`)}return e.value=l.data,e}function Kp(e,t){for(let n=e.length-1;n>=0;n--)if(!(t==="optin"?e[n]._zod.optin!==void 0:e[n]._zod.optout==="optional"))return n+1;return 0}function Gp(e,t,n){e.issues.length&&t.issues.push(...Pe(n,e.issues)),t.value[n]=e.value}function qp(e,t,n,r,o){for(let i=0;i<n.length;i++){let s=e[i],a=i<r.length;if(!a&&i>=o&&n[i]._zod.optin==="optional"){t.value.length=i;break}if(s.issues.length){if(!a&&i>=o){t.value.length=i;break}t.issues.push(...Pe(i,s.issues))}t.value[i]=s.value}for(let i=t.value.length-1;i>=r.length&&(n[i]._zod.optout==="optional"&&t.value[i]===void 0);i--)t.value.length=i;return t}function Yp(e,t,n,r,o,i,s){e.issues.length&&(Xn.has(typeof r)?n.issues.push(...Pe(r,e.issues)):n.issues.push({code:"invalid_key",origin:"map",input:o,inst:i,issues:e.issues.map(a=>Ce(a,s,se()))})),t.issues.length&&(Xn.has(typeof r)?n.issues.push(...Pe(r,t.issues)):n.issues.push({origin:"map",code:"invalid_element",input:o,inst:i,key:r,issues:t.issues.map(a=>Ce(a,s,se()))})),n.value.set(e.value,t.value)}function Xp(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}function Qp(e,t){return e.value=t.issues.length?void 0:t.value,e}function ed(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}function td(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}function nd(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(o=>Ce(o,r,se()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}function Po(e,t,n){return e.issues.some(r=>r.code!=="unrecognized_keys")?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}function Co(e,t,n){if(e.issues.length)return e.aborted=!0,e;if((n.direction||"forward")==="forward"){let o=t.transform(e.value,e);return o instanceof Promise?o.then(i=>Ao(e,i,t.out,n)):Ao(e,o,t.out,n)}else{let o=t.reverseTransform(e.value,e);return o instanceof Promise?o.then(i=>Ao(e,i,t.in,n)):Ao(e,o,t.in,n)}}function Ao(e,t,n,r){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:t,issues:e.issues},r)}function rd(e){return e.memo||(e.value=Object.freeze(e.value)),e}function _b(e){let t=e._zod.def,n=t.pattern,r=!!t.format?.includes("int"),o,i;for(let a of t.checks??[]){let l=a._zod.def;l.pattern&&(n=l.pattern),r||(r=!!l.format?.includes("int"));let u=l.minimum??l.length,p=l.maximum??l.length;u!==void 0&&(o===void 0||u>o)&&(o=u),p!==void 0&&(i===void 0||p<i)&&(i=p)}if(n)return n.source;if(o!==void 0&&i!==void 0&&o>i)return"(?!)";if(o!==void 0||i!==void 0)return ga({minimum:o,maximum:i}).source;let s=e._zod.pattern;return(r&&s===rt?cr:s)?.source}function Wa(e){let t=e._zod.def,n=e._zod.pattern?.source,r=t.innerType??e._zod.innerType;if(r){let o=r._zod.pattern?.source,i=Wa(r);return n&&o&&i&&i!==o?n.replace(nt(o),()=>nt(i)):n}if(t.options){let o=t.options.map(Wa);if(o.every(Boolean))return`^(${o.map(i=>nt(i)).join("|")})$`}return _b(e)}function od(e,t,n,r){if(!e){let o={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(o.params=r._zod.def.params),t.issues.push(cn(o))}}var F,id,Zt,Y,Ja,Ka,Ga,qa,dr,db,Xa,Qa,el,tl,nl,rl,ol,il,sl,al,ll,ul,cl,mb,fl,pl,dl,ml,Do,gl,yr,hl,yl,gb,bl,wl,vl,kl,Vo,_l,br,Fo,$l,xl,Sl,zl,Il,Pl,Cl,Al,Ol,bb,wb,vb,El,kb,ud,Zl,wr,Tl,Dl,Ll,Bo,jl,Ml,Ul,Vl,Fl,Bl,Hl,Ho,Wl,Jl,Kl,Gl,ql,Yl,Xl,Ql,Wo,vr,eu,tu,nu,ru,ou,kr,iu,yn=K(()=>{zo();pt();Io();Us();Nt();le();Ha();le();F=b("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Ba;let r=e._zod.def.checks,o=e._zod.traits.has("$ZodCheck")?[e,...r??[]]:r?.length?[...r]:[];for(let i of o)for(let s of i._zod.onattach)s(e);if(o.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let i=(a,l,u)=>{if(a.memo)return a;let p=$e(a),m;for(let g of l){if(g._zod.def.when){if(Ps(a)||!g._zod.def.when(a))continue}else if(p)continue;let d=a.issues.length,h=g._zod.check(a);if(h instanceof Promise&&u?.async===!1)throw new Ae;if(m||h instanceof Promise)m=(m??Promise.resolve()).then(async()=>{await h,a.issues.length!==d&&(tr(a.issues,d,e),p||(p=$e(a,d)))});else{if(a.issues.length===d)continue;tr(a.issues,d,e),p||(p=$e(a,d))}}return m?m.then(()=>a):a},s=(a,l,u)=>{if($e(a))return a.aborted=!0,a;let p=i(l,o,u);if(p instanceof Promise){if(u.async===!1)throw new Ae;return p.then(m=>e._zod.parse(m,u))}return e._zod.parse(p,u)};e._zod.run=(a,l)=>{if(l.skipChecks)return e._zod.parse(a,l);if(l.direction==="backward"){let p=e._zod.parse({value:a.value,issues:[]},{...l,skipChecks:!0});return p instanceof Promise?p.then(m=>s(m,a,l)):s(p,a,l)}let u=e._zod.parse(a,l);if(u instanceof Promise){if(l.async===!1)throw new Ae;return u.then(p=>i(p,o,l))}return i(u,o,l)}}},{get"~standard"(){return or(this,"~standard",No(this))},set"~standard"(e){ft(this,"~standard",e)}}),id=(e,t)=>e.issues.length?{issues:e.issues.map(n=>Ce(n,t,se()))}:{value:e.value};Zt=b("$ZodString",(e,t)=>{F.init(e,t),e._zod.pattern=t.pattern??ma,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),Y=b("$ZodStringFormat",(e,t)=>{gn.init(e,t),Zt.init(e,t)}),Ja=b("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Ys),Y.init(e,t)}),Ka=b("$ZodUUID",(e,t)=>{if(t.version){let r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Ot(r))}else t.pattern??(t.pattern=Ot());Y.init(e,t)}),Ga=b("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Xs),Y.init(e,t)}),qa=1,dr=2;db=/[\t\n\r]/g;Xa=b("$ZodURL",(e,t)=>{Y.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),o=Eo(r,t);if(o===qa){n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:e,continue:!t.abort});return}if(o===dr){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort});return}if(o===!0){n.value=mr(r);return}t.hostname&&!Zo(o,t.hostname)&&n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&!To(o,t.protocol)&&n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?o.href:mr(r);return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),Qa=b("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Qs()),Y.init(e,t)}),el=b("$ZodNanoID",(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw new Error(`Invalid nanoid length: ${t.length}`);t.pattern??(t.pattern=t.length===void 0?Ks:Gs(t.length)),Y.init(e,t)}),tl=b("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Fs),Y.init(e,t)}),nl=b("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Bs),Y.init(e,t)}),rl=b("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Hs),Y.init(e,t)}),ol=b("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Ws),Y.init(e,t)}),il=b("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Js),Y.init(e,t)}),sl=b("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=da(t)),Y.init(e,t)}),al=b("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=fa),Y.init(e,t)}),ll=b("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=pa(t)),Y.init(e,t)}),ul=b("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=qs),Y.init(e,t)}),cl=b("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=ea),Y.init(e,t)}),mb=/^[0-9a-fA-F:.]+$/;fl=b("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=ta),Y.init(e,t),e._zod.check=n=>{gr(n.value)||n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}),pl=b("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=na(t.delimiter)),Y.init(e,t)}),dl=b("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=ra),Y.init(e,t)});ml=b("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=oa),Y.init(e,t),e._zod.check=n=>{Ro(n.value)||n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}});Do=/^[0-9a-zA-Z+/]*={0,2}$/,gl=b("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Do),Y.init(e,t),e._zod.check=n=>{hr(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}}),yr=/^[A-Za-z0-9_-]*$/;hl=b("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=yr),Y.init(e,t),e._zod.check=n=>{Lo(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),yl=b("$ZodE164",(e,t)=>{t.pattern??(t.pattern=ua),Y.init(e,t)}),gb=/[- ]/g;bl=b("$ZodCreditCard",(e,t)=>{t.pattern??(t.pattern=vo),Y.init(e,t),e._zod.check=n=>{jo(n.value)||n.issues.push({code:"invalid_format",format:"credit_card",input:n.value,inst:e,continue:!t.abort})}});wl=b("$ZodIBAN",(e,t)=>{t.pattern??(t.pattern=ko),Y.init(e,t),e._zod.check=n=>{Mo(n.value)||n.issues.push({code:"invalid_format",format:"iban",input:n.value,inst:e,continue:!t.abort})}});vl=b("$ZodJWT",(e,t)=>{Y.init(e,t),e._zod.check=n=>{Uo(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),kl=b("$ZodCustomStringFormat",(e,t)=>{Y.init(e,t),e._zod.check=n=>{t.fn(n.value)||n.issues.push({code:"invalid_format",format:t.format,input:n.value,inst:e,continue:!t.abort})}}),Vo=b("$ZodNumber",(e,t)=>{F.init(e,t),e._zod.pattern=rt,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let o=n.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return n;let i=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:String(o):void 0;return n.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...i?{received:i}:{}}),n}}),_l=b("$ZodNumberFormat",(e,t)=>{za.init(e,t),Vo.init(e,t)}),br=b("$ZodBoolean",(e,t)=>{F.init(e,t),e._zod.pattern=ya,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let o=n.value;return typeof o=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),n}}),Fo=b("$ZodBigInt",(e,t)=>{F.init(e,t),e._zod.pattern=ha,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=BigInt(n.value)}catch{}return typeof n.value=="bigint"||n.issues.push({expected:"bigint",code:"invalid_type",input:n.value,inst:e}),n}}),$l=b("$ZodBigIntFormat",(e,t)=>{Ia.init(e,t),Fo.init(e,t)}),xl=b("$ZodSymbol",(e,t)=>{F.init(e,t),e._zod.parse=(n,r)=>{let o=n.value;return typeof o=="symbol"||n.issues.push({expected:"symbol",code:"invalid_type",input:o,inst:e}),n}}),Sl=b("$ZodUndefined",(e,t)=>{F.init(e,t),e._zod.pattern=wa,e._zod.values=new Set([void 0]),e._zod.parse=(n,r)=>{let o=n.value;return typeof o>"u"||n.issues.push({expected:"undefined",code:"invalid_type",input:o,inst:e}),n}}),zl=b("$ZodNull",(e,t)=>{F.init(e,t),e._zod.pattern=ba,e._zod.values=new Set([null]),e._zod.parse=(n,r)=>{let o=n.value;return o===null||n.issues.push({expected:"null",code:"invalid_type",input:o,inst:e}),n}}),Il=b("$ZodAny",(e,t)=>{F.init(e,t),e._zod.parse=n=>n}),Pl=b("$ZodUnknown",(e,t)=>{F.init(e,t),e._zod.parse=n=>n}),Cl=b("$ZodNever",(e,t)=>{F.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)}),Al=b("$ZodVoid",(e,t)=>{F.init(e,t),e._zod.parse=(n,r)=>{let o=n.value;return typeof o>"u"||n.issues.push({expected:"void",code:"invalid_type",input:o,inst:e}),n}}),Ol=b("$ZodDate",(e,t)=>{F.init(e,t),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=new Date(n.value)}catch{}let o=n.value,i=o instanceof Date;return i&&!Number.isNaN(o.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:o,...i?{received:"Invalid Date"}:{},inst:e}),n}});bb=e=>Array.isArray(e)?e.length:-1,wb=e=>e instanceof Map?e.size:-1,vb=e=>e instanceof Set?e.size:-1;El=b("$ZodArray",(e,t)=>{F.init(e,t);let n=me.memoizer;n?.attach(e),e._zod.parse=(r,o)=>{let i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),r;r.value=n?n.alloc(e,r,Array(i.length),o):Array(i.length);let s=[],a=o?.abortEarly;for(let l=0;l<i.length;l++){let u=i[l],p=t.element._zod.run({value:u,issues:[]},o);if(p instanceof Promise)s.push(p.then(m=>Bp(m,r,l)));else if(Bp(p,r,l),a&&p.issues.length!==0&&$e(p))break}return s.length?Promise.all(s).then(()=>r):r},Nl(e,bb)});kb=[];ud=b("$ZodObject",(e,t)=>{F.init(e,t);let n=Object.getOwnPropertyDescriptor(t,"shape"),r=n?.get?n.get.raw:t.shape??{};if(r){let u=()=>{let p={...r};return Object.defineProperty(t,"shape",{value:p}),u.raw=p,p};u.raw=r,Object.defineProperty(t,"shape",{get:u})}let o=an(()=>ad(t));W(e,"propValues",u=>{let p=u.def.shape,m={};for(let g in p){let d=p[g]._zod;if(d.values){Object.prototype.hasOwnProperty.call(m,g)||ge(m,g,new Set);for(let h of d.values)m[g].add(h);d.optin!==void 0&&m[g].add(void 0)}}return m});let i=Ct,s=t.catchall,a,l=me.memoizer;l?.attach(e),e._zod.parse=(u,p)=>{a??(a=o.value);let m=u.value;if(!i(m))return u.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),u;u.value=l?l.alloc(e,u,{},p):{};let g=[],d=a.shape,h=p?.abortEarly,y=u.issues.length;for(let w of a.allKeys){if(h&&u.issues.length!==y){if($e(u,y))break;y=u.issues.length}if(w==="__proto__")continue;let _=d[w],v=_._zod.optin,$=_._zod.optout,z=_._zod.run({value:m[w],issues:[]},p);z instanceof Promise?g.push(z.then(R=>Oo(R,u,w,m,v,$))):Oo(z,u,w,m,v,$)}return s?ld(g,m,u,p,o.value,e,h===!0):g.length?Promise.all(g).then(()=>u):u}}),Zl=b("$ZodObjectJIT",(e,t)=>{ud.init(e,t);let n=e._zod.parse,r=an(()=>ad(t)),o=me.memoizer,i=d=>{let h=r.value,y=h.symbolKeys,w=new Et(["payload","ctx"],{shape:d,inst:e,memo:o,syms:y}),_=R=>`shape[${R}]._zod.run({ value: input[${R}], issues: [] }, ctx)`,v=(R,S)=>`
14
+ let ${R}_ab = false;
15
+ for (let i = 0; i < ${R}.issues.length; i++) {
16
+ const iss = ${R}.issues[i];
17
+ iss.path = iss.path ? [${S}, ...iss.path] : [${S}];
18
+ payload.issues.push(iss);
19
+ if (iss.continue !== true) ${R}_ab = true;
18
20
  }
19
- }
20
-
21
- if (${S}.value === undefined) {
22
- if (${D} in input) {
23
- newResult[${D}] = undefined;
21
+ if (${R}_ab && ctx && ctx.abortEarly) {
22
+ payload.value = newResult;
23
+ return payload;
24
+ }`;w.write("const input = payload.value;");let $=Object.create(null),z=0;for(let R of h.allKeys)$[R]=`key_${z++}`;w.write(o?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(let R of h.allKeys){if(R==="__proto__")continue;let S=$[R],M=typeof R=="symbol"?`syms[${y.indexOf(R)}]`:_e(R),H=`${M} in input`,He=d[R],L=He?._zod?.optin,V=L!==void 0,ve=He?._zod?.optout==="optional";if(w.write(`const ${S} = ${_(M)};`),V&&ve){let ae=L==="optional"?`${S}_present`:`${S}.value !== undefined || ${S}_present`;w.write(`
25
+ const ${S}_present = ${H};
26
+ if (!${S}.issues.length || ${S}_present) {
27
+ if (${S}.issues.length) {${v(S,M)}
28
+ }
29
+
30
+ if (${ae}) {
31
+ newResult[${M}] = ${S}.value;
24
32
  }
25
- } else {
26
- newResult[${D}] = ${S}.value;
27
33
  }
28
-
29
- `):B?p.write(`
30
- if (${S}.issues.length) {
31
- payload.issues = payload.issues.concat(${S}.issues.map(iss => ({
32
- ...iss,
33
- path: iss.path ? [${D}, ...iss.path] : [${D}]
34
- })));
34
+
35
+ `)}else V?(w.write(`
36
+ if (${S}.issues.length) {${v(S,M)}
35
37
  }
36
-
37
- if (${S}.value === undefined) {
38
- if (${D} in input) {
39
- newResult[${D}] = undefined;
40
- }
41
- } else {
42
- newResult[${D}] = ${S}.value;
38
+ `),L==="defaulted"?w.write(`newResult[${M}] = ${S}.value;`):w.write(`
39
+ if (${S}.value !== undefined || ${H}) {
40
+ newResult[${M}] = ${S}.value;
43
41
  }
44
-
45
- `):p.write(`
46
- const ${S}_present = ${D} in input;
47
- if (${S}.issues.length) {
48
- payload.issues = payload.issues.concat(${S}.issues.map(iss => ({
49
- ...iss,
50
- path: iss.path ? [${D}, ...iss.path] : [${D}]
51
- })));
42
+ `)):w.write(`
43
+ const ${S}_present = ${H};
44
+ if (${S}.issues.length) {${v(S,M)}
52
45
  }
53
46
  if (!${S}_present && !${S}.issues.length) {
54
47
  payload.issues.push({
55
48
  code: "invalid_type",
56
49
  expected: "nonoptional",
57
50
  input: undefined,
58
- path: [${D}]
51
+ path: [${M}]
59
52
  });
53
+ if (ctx && ctx.abortEarly) {
54
+ payload.value = newResult;
55
+ return payload;
56
+ }
60
57
  }
61
58
 
62
59
  if (${S}_present) {
63
- if (${S}.value === undefined) {
64
- newResult[${D}] = undefined;
65
- } else {
66
- newResult[${D}] = ${S}.value;
67
- }
60
+ newResult[${M}] = ${S}.value;
68
61
  }
69
62
 
70
- `)}p.write("payload.value = newResult;"),p.write("return payload;");let E=p.compile();return(Z,S)=>E(b,Z,S)},i,s=at,c=!it.jitless,d=c&&Go.value,m=t.catchall,h;e._zod.parse=(b,p)=>{h??(h=n.value);let x=b.value;return s(x)?c&&d&&p?.async===!1&&p.jitless!==!0?(i||(i=o(t.shape)),b=i(b,p),m?Qu([],x,b,p,h,e):b):r(b,p):(b.issues.push({expected:"object",code:"invalid_type",input:x,inst:e}),b)}});br=f("$ZodUnion",(e,t)=>{M.init(e,t),F(e._zod,"optin",()=>t.options.some(n=>n._zod.optin==="optional")?"optional":void 0),F(e._zod,"optout",()=>t.options.some(n=>n._zod.optout==="optional")?"optional":void 0),F(e._zod,"values",()=>{if(t.options.every(n=>n._zod.values))return new Set(t.options.flatMap(n=>Array.from(n._zod.values)))}),F(e._zod,"pattern",()=>{if(t.options.every(n=>n._zod.pattern)){let n=t.options.map(o=>o._zod.pattern);return new RegExp(`^(${n.map(o=>ar(o.source)).join("|")})$`)}});let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(n,o)=>{if(r)return r(n,o);let i=!1,s=[];for(let c of t.options){let u=c._zod.run({value:n.value,issues:[]},o);if(u instanceof Promise)s.push(u),i=!0;else{if(u.issues.length===0)return u;s.push(u)}}return i?Promise.all(s).then(c=>ju(c,n,e,o)):ju(s,n,e,o)}});Bs=f("$ZodXor",(e,t)=>{br.init(e,t),t.inclusive=!1;let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(n,o)=>{if(r)return r(n,o);let i=!1,s=[];for(let c of t.options){let u=c._zod.run({value:n.value,issues:[]},o);u instanceof Promise?(s.push(u),i=!0):s.push(u)}return i?Promise.all(s).then(c=>Du(c,n,e,o)):Du(s,n,e,o)}}),Ws=f("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,br.init(e,t);let r=e._zod.parse;F(e._zod,"propValues",()=>{let o={};for(let i of t.options){let s=i._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(let[c,u]of Object.entries(s)){o[c]||(o[c]=new Set);for(let d of u)o[c].add(d)}}return o});let n=zt(()=>{let o=t.options,i=new Map;for(let s of o){let c=s._zod.propValues?.[t.discriminator];if(!c||c.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let u of c){if(i.has(u))throw new Error(`Duplicate discriminator value "${String(u)}"`);i.set(u,s)}}return i});e._zod.parse=(o,i)=>{let s=o.value;if(!at(s))return o.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),o;let c=n.value.get(s?.[t.discriminator]);return c?c._zod.run(o,i):t.unionFallback||i.direction==="backward"?r(o,i):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(n.value.keys()),input:s,path:[t.discriminator],inst:e}),o)}}),Vs=f("$ZodIntersection",(e,t)=>{M.init(e,t),e._zod.parse=(r,n)=>{let o=r.value,i=t.left._zod.run({value:o,issues:[]},n),s=t.right._zod.run({value:o,issues:[]},n);return i instanceof Promise||s instanceof Promise?Promise.all([i,s]).then(([u,d])=>Mu(r,u,d)):Mu(r,i,s)}});vn=f("$ZodTuple",(e,t)=>{M.init(e,t);let r=t.items;e._zod.parse=(n,o)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({input:i,inst:e,expected:"tuple",code:"invalid_type"}),n;n.value=[];let s=[],c=Uu(r,"optin"),u=Uu(r,"optout");if(!t.rest){if(i.length<c)return n.issues.push({code:"too_small",minimum:c,inclusive:!0,input:i,inst:e,origin:"array"}),n;i.length>r.length&&n.issues.push({code:"too_big",maximum:r.length,inclusive:!0,input:i,inst:e,origin:"array"})}let d=new Array(r.length);for(let m=0;m<r.length;m++){let h=r[m]._zod.run({value:i[m],issues:[]},o);h instanceof Promise?s.push(h.then(b=>{d[m]=b})):d[m]=h}if(t.rest){let m=r.length-1,h=i.slice(r.length);for(let b of h){m++;let p=t.rest._zod.run({value:b,issues:[]},o);p instanceof Promise?s.push(p.then(x=>Lu(x,n,m))):Lu(p,n,m)}}return s.length?Promise.all(s).then(()=>Fu(d,n,r,i,u)):Fu(d,n,r,i,u)}});Js=f("$ZodRecord",(e,t)=>{M.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!qe(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),r;let i=[],s=t.keyType._zod.values;if(s){r.value={};let c=new Set;for(let d of s)if(typeof d=="string"||typeof d=="number"||typeof d=="symbol"){c.add(typeof d=="number"?d.toString():d);let m=t.keyType._zod.run({value:d,issues:[]},n);if(m instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(m.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:m.issues.map(p=>de(p,n,te())),input:d,path:[d],inst:e});continue}let h=m.value,b=t.valueType._zod.run({value:o[d],issues:[]},n);b instanceof Promise?i.push(b.then(p=>{p.issues.length&&r.issues.push(...ge(d,p.issues)),r.value[h]=p.value})):(b.issues.length&&r.issues.push(...ge(d,b.issues)),r.value[h]=b.value)}let u;for(let d in o)c.has(d)||(u=u??[],u.push(d));u&&u.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:u})}else{r.value={};for(let c of Reflect.ownKeys(o)){if(c==="__proto__"||!Object.prototype.propertyIsEnumerable.call(o,c))continue;let u=t.keyType._zod.run({value:c,issues:[]},n);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof c=="string"&&ln.test(c)&&u.issues.length){let h=t.keyType._zod.run({value:Number(c),issues:[]},n);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");h.issues.length===0&&(u=h)}if(u.issues.length){t.mode==="loose"?r.value[c]=o[c]:r.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map(h=>de(h,n,te())),input:c,path:[c],inst:e});continue}let m=t.valueType._zod.run({value:o[c],issues:[]},n);m instanceof Promise?i.push(m.then(h=>{h.issues.length&&r.issues.push(...ge(c,h.issues)),r.value[u.value]=h.value})):(m.issues.length&&r.issues.push(...ge(c,m.issues)),r.value[u.value]=m.value)}}return i.length?Promise.all(i).then(()=>r):r}}),qs=f("$ZodMap",(e,t)=>{M.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!(o instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:o,inst:e}),r;let i=[];r.value=new Map;for(let[s,c]of o){let u=t.keyType._zod.run({value:s,issues:[]},n),d=t.valueType._zod.run({value:c,issues:[]},n);u instanceof Promise||d instanceof Promise?i.push(Promise.all([u,d]).then(([m,h])=>{Hu(m,h,r,s,o,e,n)})):Hu(u,d,r,s,o,e,n)}return i.length?Promise.all(i).then(()=>r):r}});Gs=f("$ZodSet",(e,t)=>{M.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!(o instanceof Set))return r.issues.push({input:o,inst:e,expected:"set",code:"invalid_type"}),r;let i=[];r.value=new Set;for(let s of o){let c=t.valueType._zod.run({value:s,issues:[]},n);c instanceof Promise?i.push(c.then(u=>Bu(u,r))):Bu(c,r)}return i.length?Promise.all(i).then(()=>r):r}});Ks=f("$ZodEnum",(e,t)=>{M.init(e,t);let r=sr(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(o=>lr.has(typeof o)).map(o=>typeof o=="string"?ze(o):o.toString()).join("|")})$`),e._zod.parse=(o,i)=>{let s=o.value;return n.has(s)||o.issues.push({code:"invalid_value",values:r,input:s,inst:e}),o}}),Ys=f("$ZodLiteral",(e,t)=>{if(M.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?ze(n):n?ze(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,o)=>{let i=n.value;return r.has(i)||n.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),n}}),Xs=f("$ZodFile",(e,t)=>{M.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;return o instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:o,inst:e}),r}}),Qs=f("$ZodTransform",(e,t)=>{M.init(e,t),e._zod.optin="optional",e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new We(e.constructor.name);let o=t.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(s=>(r.value=s,r.fallback=!0,r));if(o instanceof Promise)throw new Ze;return r.value=o,r.fallback=!0,r}});xn=f("$ZodOptional",(e,t)=>{M.init(e,t),e._zod.optin="optional",e._zod.optout="optional",F(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),F(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${ar(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){let o=r.value,i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then(s=>Wu(s,o)):Wu(i,o)}return r.value===void 0?r:t.innerType._zod.run(r,n)}}),ea=f("$ZodExactOptional",(e,t)=>{xn.init(e,t),F(e._zod,"values",()=>t.innerType._zod.values),F(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(r,n)=>t.innerType._zod.run(r,n)}),ta=f("$ZodNullable",(e,t)=>{M.init(e,t),F(e._zod,"optin",()=>t.innerType._zod.optin),F(e._zod,"optout",()=>t.innerType._zod.optout),F(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${ar(r.source)}|null)$`):void 0}),F(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)}),ra=f("$ZodDefault",(e,t)=>{M.init(e,t),e._zod.optin="optional",F(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);if(r.value===void 0)return r.value=t.defaultValue,r;let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>Vu(i,t)):Vu(o,t)}});na=f("$ZodPrefault",(e,t)=>{M.init(e,t),e._zod.optin="optional",F(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>(n.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,n))}),oa=f("$ZodNonOptional",(e,t)=>{M.init(e,t),F(e._zod,"values",()=>{let r=t.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),e._zod.parse=(r,n)=>{let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>Ju(i,e)):Ju(o,e)}});ia=f("$ZodSuccess",(e,t)=>{M.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new We("ZodSuccess");let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>(r.value=i.issues.length===0,r)):(r.value=o.issues.length===0,r)}}),sa=f("$ZodCatch",(e,t)=>{M.init(e,t),e._zod.optin="optional",F(e._zod,"optout",()=>t.innerType._zod.optout),F(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>(r.value=i.value,i.issues.length&&(r.value=t.catchValue({...r,error:{issues:i.issues.map(s=>de(s,n,te()))},input:r.value}),r.issues=[],r.fallback=!0),r)):(r.value=o.value,o.issues.length&&(r.value=t.catchValue({...r,error:{issues:o.issues.map(i=>de(i,n,te()))},input:r.value}),r.issues=[],r.fallback=!0),r)}}),aa=f("$ZodNaN",(e,t)=>{M.init(e,t),e._zod.parse=(r,n)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:e,expected:"nan",code:"invalid_type"}),r)}),wn=f("$ZodPipe",(e,t)=>{M.init(e,t),F(e._zod,"values",()=>t.in._zod.values),F(e._zod,"optin",()=>t.in._zod.optin),F(e._zod,"optout",()=>t.out._zod.optout),F(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let i=t.out._zod.run(r,n);return i instanceof Promise?i.then(s=>fn(s,t.in,n)):fn(i,t.in,n)}let o=t.in._zod.run(r,n);return o instanceof Promise?o.then(i=>fn(i,t.out,n)):fn(o,t.out,n)}});vr=f("$ZodCodec",(e,t)=>{M.init(e,t),F(e._zod,"values",()=>t.in._zod.values),F(e._zod,"optin",()=>t.in._zod.optin),F(e._zod,"optout",()=>t.out._zod.optout),F(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if((n.direction||"forward")==="forward"){let i=t.in._zod.run(r,n);return i instanceof Promise?i.then(s=>mn(s,t,n)):mn(i,t,n)}else{let i=t.out._zod.run(r,n);return i instanceof Promise?i.then(s=>mn(s,t,n)):mn(i,t,n)}}});la=f("$ZodPreprocess",(e,t)=>{wn.init(e,t)}),ca=f("$ZodReadonly",(e,t)=>{M.init(e,t),F(e._zod,"propValues",()=>t.innerType._zod.propValues),F(e._zod,"values",()=>t.innerType._zod.values),F(e._zod,"optin",()=>t.innerType?._zod?.optin),F(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(qu):qu(o)}});ua=f("$ZodTemplateLiteral",(e,t)=>{M.init(e,t);let r=[];for(let n of t.parts)if(typeof n=="object"&&n!==null){if(!n._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...n._zod.traits].shift()}`);let o=n._zod.pattern instanceof RegExp?n._zod.pattern.source:n._zod.pattern;if(!o)throw new Error(`Invalid template literal part: ${n._zod.traits}`);let i=o.startsWith("^")?1:0,s=o.endsWith("$")?o.length-1:o.length;r.push(o.slice(i,s))}else if(n===null||Yo.has(typeof n))r.push(ze(`${n}`));else throw new Error(`Invalid template literal part: ${n}`);e._zod.pattern=new RegExp(`^${r.join("")}$`),e._zod.parse=(n,o)=>typeof n.value!="string"?(n.issues.push({input:n.value,inst:e,expected:"string",code:"invalid_type"}),n):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(n.value)||n.issues.push({input:n.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),n)}),da=f("$ZodFunction",(e,t)=>(M.init(e,t),e._def=t,e._zod.def=t,e.implement=r=>{if(typeof r!="function")throw new Error("implement() must be called with a function");return function(...n){let o=e._def.input?Kr(e._def.input,n):n,i=Reflect.apply(r,this,o);return e._def.output?Kr(e._def.output,i):i}},e.implementAsync=r=>{if(typeof r!="function")throw new Error("implementAsync() must be called with a function");return async function(...n){let o=e._def.input?await Yr(e._def.input,n):n,i=await Reflect.apply(r,this,o);return e._def.output?await Yr(e._def.output,i):i}},e._zod.parse=(r,n)=>typeof r.value!="function"?(r.issues.push({code:"invalid_type",expected:"function",input:r.value,inst:e}),r):(e._def.output&&e._def.output._zod.def.type==="promise"?r.value=e.implementAsync(r.value):r.value=e.implement(r.value),r),e.input=(...r)=>{let n=e.constructor;return Array.isArray(r[0])?new n({type:"function",input:new vn({type:"tuple",items:r[0],rest:r[1]}),output:e._def.output}):new n({type:"function",input:r[0],output:e._def.output})},e.output=r=>{let n=e.constructor;return new n({type:"function",input:e._def.input,output:r})},e)),pa=f("$ZodPromise",(e,t)=>{M.init(e,t),e._zod.parse=(r,n)=>Promise.resolve(r.value).then(o=>t.innerType._zod.run({value:o,issues:[]},n))}),fa=f("$ZodLazy",(e,t)=>{M.init(e,t),F(e._zod,"innerType",()=>{let r=t;return r._cachedInner||(r._cachedInner=t.getter()),r._cachedInner}),F(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),F(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),F(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),F(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(r,n)=>e._zod.innerType._zod.run(r,n)}),ma=f("$ZodCustom",(e,t)=>{K.init(e,t),M.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,o=t.fn(n);if(o instanceof Promise)return o.then(i=>Gu(i,r,n,e));Gu(o,r,n,e)}})});var xr={};Pe(xr,{default:()=>Qm});var Qm,ha=J(()=>{Qm={}});function kn(){return new _n}var td,ya,ba,_n,se,wr=J(()=>{ya=Symbol("ZodOutput"),ba=Symbol("ZodInput"),_n=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let n=r[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let o={...n,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};(td=globalThis).__zod_globalRegistry??(td.__zod_globalRegistry=kn());se=globalThis.__zod_globalRegistry});function va(e,t){return new e({type:"string",...z(t)})}function xa(e,t){return new e({type:"string",coerce:!0,...z(t)})}function zn(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...z(t)})}function _r(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...z(t)})}function Sn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...z(t)})}function $n(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...z(t)})}function Pn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...z(t)})}function Zn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...z(t)})}function kr(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...z(t)})}function In(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...z(t)})}function En(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...z(t)})}function Cn(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...z(t)})}function Tn(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...z(t)})}function On(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...z(t)})}function Rn(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...z(t)})}function An(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...z(t)})}function Nn(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...z(t)})}function jn(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...z(t)})}function wa(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...z(t)})}function Dn(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...z(t)})}function Mn(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...z(t)})}function Un(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...z(t)})}function Ln(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...z(t)})}function Fn(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...z(t)})}function Hn(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...z(t)})}function ka(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...z(t)})}function za(e,t){return new e({type:"string",format:"date",check:"string_format",...z(t)})}function Sa(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...z(t)})}function $a(e,t){return new e({type:"string",format:"duration",check:"string_format",...z(t)})}function Pa(e,t){return new e({type:"number",checks:[],...z(t)})}function Za(e,t){return new e({type:"number",coerce:!0,checks:[],...z(t)})}function Ia(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...z(t)})}function Ea(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...z(t)})}function Ca(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...z(t)})}function Ta(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...z(t)})}function Oa(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...z(t)})}function Ra(e,t){return new e({type:"boolean",...z(t)})}function Aa(e,t){return new e({type:"boolean",coerce:!0,...z(t)})}function Na(e,t){return new e({type:"bigint",...z(t)})}function ja(e,t){return new e({type:"bigint",coerce:!0,...z(t)})}function Da(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...z(t)})}function Ma(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...z(t)})}function Ua(e,t){return new e({type:"symbol",...z(t)})}function La(e,t){return new e({type:"undefined",...z(t)})}function Fa(e,t){return new e({type:"null",...z(t)})}function Ha(e){return new e({type:"any"})}function Ba(e){return new e({type:"unknown"})}function Wa(e,t){return new e({type:"never",...z(t)})}function Va(e,t){return new e({type:"void",...z(t)})}function Ja(e,t){return new e({type:"date",...z(t)})}function qa(e,t){return new e({type:"date",coerce:!0,...z(t)})}function Ga(e,t){return new e({type:"nan",...z(t)})}function Ce(e,t){return new un({check:"less_than",...z(t),value:e,inclusive:!1})}function we(e,t){return new un({check:"less_than",...z(t),value:e,inclusive:!0})}function Te(e,t){return new dn({check:"greater_than",...z(t),value:e,inclusive:!1})}function pe(e,t){return new dn({check:"greater_than",...z(t),value:e,inclusive:!0})}function Bn(e){return Te(0,e)}function Wn(e){return Ce(0,e)}function Vn(e){return we(0,e)}function Jn(e){return pe(0,e)}function Ke(e,t){return new Di({check:"multiple_of",...z(t),value:e})}function Ye(e,t){return new Li({check:"max_size",...z(t),maximum:e})}function Oe(e,t){return new Fi({check:"min_size",...z(t),minimum:e})}function ut(e,t){return new Hi({check:"size_equals",...z(t),size:e})}function dt(e,t){return new Bi({check:"max_length",...z(t),maximum:e})}function Ue(e,t){return new Wi({check:"min_length",...z(t),minimum:e})}function pt(e,t){return new Vi({check:"length_equals",...z(t),length:e})}function Ct(e,t){return new Ji({check:"string_format",format:"regex",...z(t),pattern:e})}function Tt(e){return new qi({check:"string_format",format:"lowercase",...z(e)})}function Ot(e){return new Gi({check:"string_format",format:"uppercase",...z(e)})}function Rt(e,t){return new Ki({check:"string_format",format:"includes",...z(t),includes:e})}function At(e,t){return new Yi({check:"string_format",format:"starts_with",...z(t),prefix:e})}function Nt(e,t){return new Xi({check:"string_format",format:"ends_with",...z(t),suffix:e})}function qn(e,t,r){return new Qi({check:"property",property:e,schema:t,...z(r)})}function jt(e,t){return new es({check:"mime_type",mime:e,...z(t)})}function Ie(e){return new ts({check:"overwrite",tx:e})}function Dt(e){return Ie(t=>t.normalize(e))}function Mt(){return Ie(e=>e.trim())}function Ut(){return Ie(e=>e.toLowerCase())}function Lt(){return Ie(e=>e.toUpperCase())}function Ft(){return Ie(e=>qo(e))}function Ka(e,t,r){return new e({type:"array",element:t,...z(r)})}function tg(e,t,r){return new e({type:"union",options:t,...z(r)})}function rg(e,t,r){return new e({type:"union",options:t,inclusive:!1,...z(r)})}function ng(e,t,r,n){return new e({type:"union",options:r,discriminator:t,...z(n)})}function og(e,t,r){return new e({type:"intersection",left:t,right:r})}function ig(e,t,r,n){let o=r instanceof M,i=o?n:r,s=o?r:null;return new e({type:"tuple",items:t,rest:s,...z(i)})}function sg(e,t,r,n){return new e({type:"record",keyType:t,valueType:r,...z(n)})}function ag(e,t,r,n){return new e({type:"map",keyType:t,valueType:r,...z(n)})}function lg(e,t,r){return new e({type:"set",valueType:t,...z(r)})}function cg(e,t,r){let n=Array.isArray(t)?Object.fromEntries(t.map(o=>[o,o])):t;return new e({type:"enum",entries:n,...z(r)})}function ug(e,t,r){return new e({type:"enum",entries:t,...z(r)})}function dg(e,t,r){return new e({type:"literal",values:Array.isArray(t)?t:[t],...z(r)})}function Ya(e,t){return new e({type:"file",...z(t)})}function pg(e,t){return new e({type:"transform",transform:t})}function fg(e,t){return new e({type:"optional",innerType:t})}function mg(e,t){return new e({type:"nullable",innerType:t})}function gg(e,t,r){return new e({type:"default",innerType:t,get defaultValue(){return typeof r=="function"?r():Ko(r)}})}function hg(e,t,r){return new e({type:"nonoptional",innerType:t,...z(r)})}function yg(e,t){return new e({type:"success",innerType:t})}function bg(e,t,r){return new e({type:"catch",innerType:t,catchValue:typeof r=="function"?r:()=>r})}function vg(e,t,r){return new e({type:"pipe",in:t,out:r})}function xg(e,t){return new e({type:"readonly",innerType:t})}function wg(e,t,r){return new e({type:"template_literal",parts:t,...z(r)})}function _g(e,t){return new e({type:"lazy",getter:t})}function kg(e,t){return new e({type:"promise",innerType:t})}function Xa(e,t,r){let n=z(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}function Qa(e,t,r){return new e({type:"custom",check:"custom",fn:t,...z(r)})}function el(e,t){let r=rd(n=>(n.addIssue=o=>{if(typeof o=="string")n.issues.push(St(o,n.value,r._zod.def));else{let i=o;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=n.value),i.inst??(i.inst=r),i.continue??(i.continue=!r._zod.def.abort),n.issues.push(St(i))}},e(n.value,n)),t);return r}function rd(e,t){let r=new K({check:"custom",...z(t)});return r._zod.check=e,r}function tl(e){let t=new K({check:"describe"});return t._zod.onattach=[r=>{let n=se.get(r)??{};se.add(r,{...n,description:e})}],t._zod.check=()=>{},t}function rl(e){let t=new K({check:"meta"});return t._zod.onattach=[r=>{let n=se.get(r)??{};se.add(r,{...n,...e})}],t._zod.check=()=>{},t}function nl(e,t){let r=z(t),n=r.truthy??["true","1","yes","on","y","enabled"],o=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(n=n.map(p=>typeof p=="string"?p.toLowerCase():p),o=o.map(p=>typeof p=="string"?p.toLowerCase():p));let i=new Set(n),s=new Set(o),c=e.Codec??vr,u=e.Boolean??yr,d=e.String??ct,m=new d({type:"string",error:r.error}),h=new u({type:"boolean",error:r.error}),b=new c({type:"pipe",in:m,out:h,transform:((p,x)=>{let k=p;return r.case!=="sensitive"&&(k=k.toLowerCase()),i.has(k)?!0:s.has(k)?!1:(x.issues.push({code:"invalid_value",expected:"stringbool",values:[...i,...s],input:x.value,inst:b,continue:!1}),{})}),reverseTransform:((p,x)=>p===!0?n[0]||"true":o[0]||"false"),error:r.error});return b}function Ht(e,t,r,n={}){let o=z(n),i={...z(n),check:"string_format",type:"string",format:t,fn:typeof r=="function"?r:c=>r.test(c),...o};return r instanceof RegExp&&(i.pattern=r),new e(i)}var _a,nd=J(()=>{pn();wr();ga();Se();_a={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6}});function Xe(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??se,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function V(e,t,r={path:[],schemaPath:[]}){var n;let o=e._zod.def,i=t.seen.get(e);if(i)return i.count++,r.schemaPath.includes(e)&&(i.cycle=r.path),i.schema;let s={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,s);let c=e._zod.toJSONSchema?.();if(c)s.schema=c;else{let m={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,m);else{let b=s.schema,p=t.processors[o.type];if(!p)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);p(e,t,b,m)}let h=e._zod.parent;h&&(s.ref||(s.ref=h),V(h,t,m),t.seen.get(h).isParent=!0)}let u=t.metadataRegistry.get(e);return u&&Object.assign(s.schema,u),t.io==="input"&&fe(e)&&(delete s.schema.examples,delete s.schema.default),t.io==="input"&&"_prefault"in s.schema&&((n=s.schema).default??(n.default=s.schema._prefault)),delete s.schema._prefault,t.seen.get(e).schema}function Qe(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let n=new Map;for(let s of e.seen.entries()){let c=e.metadataRegistry.get(s[0])?.id;if(c){let u=n.get(c);if(u&&u!==s[0])throw new Error(`Duplicate schema id "${c}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(c,s[0])}}let o=s=>{let c=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let h=e.external.registry.get(s[0])?.id,b=e.external.uri??(x=>x);if(h)return{ref:b(h)};let p=s[1].defId??s[1].schema.id??`schema${e.counter++}`;return s[1].defId=p,{defId:p,ref:`${b("__shared")}#/${c}/${p}`}}if(s[1]===r)return{ref:"#"};let d=`#/${c}/`,m=s[1].schema.id??`__schema${e.counter++}`;return{defId:m,ref:d+m}},i=s=>{if(s[1].schema.$ref)return;let c=s[1],{ref:u,defId:d}=o(s);c.def={...c.schema},d&&(c.defId=d);let m=c.schema;for(let h in m)delete m[h];m.$ref=u};if(e.cycles==="throw")for(let s of e.seen.entries()){let c=s[1];if(c.cycle)throw new Error(`Cycle detected: #/${c.cycle?.join("/")}/<root>
63
+ `)}return w.write("payload.value = newResult;"),w.write("return payload;"),w.compile()},s,a=Ct,l=!me.jitless,p=l&&Ss.value,m=t.catchall,g;e._zod.parse=(d,h)=>{g??(g=r.value);let y=d.value;return a(y)?l&&p&&h?.async===!1&&h.jitless!==!0?(s||(s=i(t.shape)),d=s(d,h),m?ld([],y,d,h,g,e,h?.abortEarly===!0):d):n(d,h):(d.issues.push({expected:"object",code:"invalid_type",input:y,inst:e}),d)}});wr=b("$ZodUnion",(e,t)=>{F.init(e,t),W(e,"optin",r=>r.def.options.some(o=>o._zod.optin==="defaulted")?"defaulted":r.def.options.some(o=>o._zod.optin!==void 0)?"optional":void 0),W(e,"optout",r=>r.def.options.some(o=>o._zod.optout==="optional")?"optional":void 0),W(e,"values",r=>{if(r.def.options.every(o=>o._zod.values))return new Set(r.def.options.flatMap(o=>Array.from(o._zod.values)))}),W(e,"pattern",r=>{if(r.def.options.every(o=>o._zod.pattern)){let o=r.def.options.map(i=>i._zod.pattern);return new RegExp(`^(${o.map(i=>nt(i.source)).join("|")})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,o)=>{if(n)return n(r,o);let i=!1,s=[];for(let a of t.options){let l=a._zod.run({value:r.value,issues:[]},o);if(l instanceof Promise)s.push(l),i=!0;else{if(l.issues.length===0)return l;s.push(l)}}return i?Promise.all(s).then(a=>Hp(a,r,e,o)):Hp(s,r,e,o)}});Tl=b("$ZodXor",(e,t)=>{wr.init(e,t),t.inclusive=!1;let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,o)=>{if(n)return n(r,o);let i=!1,s=[];for(let a of t.options){let l=a._zod.run({value:r.value,issues:[]},o);l instanceof Promise?(s.push(l),i=!0):s.push(l)}return i?Promise.all(s).then(a=>Wp(a,r,e,o)):Wp(s,r,e,o)}});Dl=b("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,wr.init(e,t);let n=e._zod.parse;W(e,"propValues",o=>{let i={},s=0;for(let a of o.def.options){let l=a._zod.propValues;if(!l||Object.keys(l).length===0)throw new Error(`Invalid discriminated union option at index "${o.def.options.indexOf(a)}"`);l[o.def.discriminator]?.has(void 0)&&s++;for(let[u,p]of Object.entries(l)){Object.prototype.hasOwnProperty.call(i,u)||ge(i,u,new Set);for(let m of p)i[u].add(m)}}return!o.def.unionFallback&&s>1&&i[o.def.discriminator]?.delete(void 0),i}),t.options.forEach((o,i)=>{let s=ln(o._zod.def);if(s&&!Object.prototype.hasOwnProperty.call(s,t.discriminator))throw new Error(`Invalid discriminated union option at index "${i}"`)});let r=an(()=>cd(t));e._zod.parse=(o,i)=>{let s=o.value;if(!Ct(s))return o.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),o;let a=s?.[t.discriminator],l=r.value.get(a);return l&&(a!==void 0||i.direction!=="backward")?l._zod.run(o,i):t.unionFallback||i.direction==="backward"?n(o,i):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(r.value.keys()).filter(u=>r.value.get(u)!==null),input:s,path:[t.discriminator],inst:e}),o)}}),Ll=b("$ZodIntersection",(e,t)=>{F.init(e,t),e._zod.parse=(n,r)=>{let o=n.value,i=t.left._zod.run({value:o,issues:[]},r),s=t.right._zod.run({value:o,issues:[]},r);return i instanceof Promise||s instanceof Promise?Promise.all([i,s]).then(([l,u])=>Jp(n,l,u)):Jp(n,i,s)}});Bo=b("$ZodTuple",(e,t)=>{F.init(e,t);let n=t.items,r=me.memoizer;r?.attach(e),e._zod.parse=(o,i)=>{let s=o.value;if(!Array.isArray(s))return o.issues.push({input:s,inst:e,expected:"tuple",code:"invalid_type"}),o;o.value=r?r.alloc(e,o,[],i):[];let a=[],l=Kp(n,"optin"),u=Kp(n,"optout");if(!t.rest){if(s.length<l)return o.issues.push({code:"too_small",minimum:l,inclusive:!0,input:s,inst:e,origin:"array"}),o;s.length>n.length&&o.issues.push({code:"too_big",maximum:n.length,inclusive:!0,input:s,inst:e,origin:"array"})}let p=new Array(n.length),m=t.rest?i?.abortEarly:void 0,g=!1;for(let d=0;d<n.length;d++){let h=n[d]._zod.run({value:s[d],issues:[]},i);h instanceof Promise?a.push(h.then(y=>{p[d]=y})):(p[d]=h,m&&!g&&h.issues.length&&(g=$e(h)))}if(t.rest&&!g){let d=n.length-1,h=s.slice(n.length),y=o.issues.length;for(let w of h){if(m&&o.issues.length!==y){if($e(o,y))break;y=o.issues.length}d++;let _=t.rest._zod.run({value:w,issues:[]},i);_ instanceof Promise?a.push(_.then(v=>Gp(v,o,d))):Gp(_,o,d)}}return a.length?Promise.all(a).then(()=>qp(p,o,n,s,u)):qp(p,o,n,s,u)}});jl=b("$ZodRecord",(e,t)=>{F.init(e,t);let n=me.memoizer;n?.attach(e),e._zod.parse=(r,o)=>{let i=r.value;if(!Le(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),r;let s=[],a=t.keyType._zod.values;if(a&&!t.partial){r.value=n?n.alloc(e,r,{},o):{};let l=new Set;for(let p of a)if(typeof p=="string"||typeof p=="number"||typeof p=="symbol"){if(l.add(typeof p=="number"?p.toString():p),p==="__proto__")continue;let m=t.keyType._zod.run({value:p,issues:[]},o);if(m instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(m.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:m.issues.map(h=>Ce(h,o,se())),input:p,path:[p],inst:e});continue}let g=m.value;if(g==="__proto__")continue;let d=t.valueType._zod.run({value:i[p],issues:[]},o);d instanceof Promise?s.push(d.then(h=>{h.issues.length&&r.issues.push(...Pe(p,h.issues)),r.value[g]=h.value})):(d.issues.length&&r.issues.push(...Pe(p,d.issues)),r.value[g]=d.value)}let u;for(let p in i)if(!l.has(p))if(t.mode==="loose"){if(p==="__proto__")continue;r.value[p]=i[p]}else u=u??[],u.push(p);u&&u.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:u,continue:!0})}else{r.value=n?n.alloc(e,r,{},o):{};let l;for(let u of Reflect.ownKeys(i)){if(u==="__proto__"||!Object.prototype.propertyIsEnumerable.call(i,u))continue;let p=t.keyType._zod.run({value:u,issues:[]},o);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof u=="string"&&rt.test(u)&&p.issues.length){let h=t.keyType._zod.run({value:Number(u),issues:[]},o);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");h.issues.length===0&&(p=h)}if(p.issues.length){t.mode==="loose"?r.value[u]=i[u]:a?(l=l??[],l.push(u)):r.issues.push({code:"invalid_key",origin:"record",issues:p.issues.map(h=>Ce(h,o,se())),input:u,path:[u],inst:e});continue}let g=p.value;if(g==="__proto__")continue;let d=t.valueType._zod.run({value:i[u],issues:[]},o);d instanceof Promise?s.push(d.then(h=>{h.issues.length&&r.issues.push(...Pe(u,h.issues)),r.value[g]=h.value})):(d.issues.length&&r.issues.push(...Pe(u,d.issues)),r.value[g]=d.value)}l&&l.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:l,continue:!0})}return s.length?Promise.all(s).then(()=>r):r}}),Ml=b("$ZodMap",(e,t)=>{F.init(e,t);let n=me.memoizer;n?.attach(e),e._zod.parse=(r,o)=>{let i=r.value;if(!(i instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:i,inst:e}),r;let s=[];r.value=n?n.alloc(e,r,new Map,o):new Map;let a=o?.abortEarly,l=r.issues.length;for(let[u,p]of i){if(a&&r.issues.length!==l){if($e(r,l))break;l=r.issues.length}let m=t.keyType._zod.run({value:u,issues:[]},o),g=t.valueType._zod.run({value:p,issues:[]},o);m instanceof Promise||g instanceof Promise?s.push(Promise.all([m,g]).then(([d,h])=>{Yp(d,h,r,u,i,e,o)})):Yp(m,g,r,u,i,e,o)}return s.length?Promise.all(s).then(()=>r):r},Nl(e,wb)});Ul=b("$ZodSet",(e,t)=>{F.init(e,t);let n=me.memoizer;n?.attach(e),e._zod.parse=(r,o)=>{let i=r.value;if(!(i instanceof Set))return r.issues.push({input:i,inst:e,expected:"set",code:"invalid_type"}),r;let s=[];r.value=n?n.alloc(e,r,new Set,o):new Set;let a=o?.abortEarly,l=r.issues.length;for(let u of i){if(a&&r.issues.length!==l){if($e(r,l))break;l=r.issues.length}let p=t.valueType._zod.run({value:u,issues:[]},o);p instanceof Promise?s.push(p.then(m=>Xp(m,r))):Xp(p,r)}return s.length?Promise.all(s).then(()=>r):r},Nl(e,vb)});Vl=b("$ZodEnum",(e,t)=>{F.init(e,t);let n=on(t.entries),r=new Set(n);e._zod.values=r,W(e,"pattern",o=>{let i=on(o.def.entries).filter(s=>Xn.has(typeof s));return new RegExp(i.length?`^(${i.map(s=>je(s.toString())).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(o,i)=>{let s=o.value;return r.has(s)||o.issues.push({code:"invalid_value",values:n,input:s,inst:e}),o}}),Fl=b("$ZodLiteral",(e,t)=>{F.init(e,t);let n=new Set(t.values);e._zod.values=n,W(e,"pattern",r=>{let o=r.def.values;return new RegExp(o.length?`^(${o.map(i=>typeof i=="string"?je(i):i?je(i.toString()):String(i)).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(r,o)=>{let i=r.value;return n.has(i)||r.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),r}}),Bl=b("$ZodFile",(e,t)=>{F.init(e,t),e._zod.parse=(n,r)=>{let o=n.value;return o instanceof File||n.issues.push({expected:"file",code:"invalid_type",input:o,inst:e}),n}}),Hl=b("$ZodTransform",(e,t)=>{F.init(e,t),e._zod.optin="optional",me.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new dt(e.constructor.name);let o=t.transform(n.value,n);if(r.async)return(o instanceof Promise?o:Promise.resolve(o)).then(s=>(n.value=s,n));if(o instanceof Promise)throw new Ae;return n.value=o,n}});Ho=b("$ZodOptional",(e,t)=>{F.init(e,t),W(e,"optin",n=>n.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",W(e,"values",n=>{let r=n.def.innerType._zod.values;return r?new Set([...r,void 0]):void 0}),W(e,"pattern",n=>{let r=n.def.innerType._zod.pattern;return r?new RegExp(`^(${nt(r.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(n.value===void 0){if(t.innerType._zod.optin!=="defaulted")return n;let o=t.innerType._zod.run({value:n.value,issues:[]},r);return o instanceof Promise?o.then(i=>Qp(n,i)):Qp(n,o)}return t.innerType._zod.run(n,r)}}),Wl=b("$ZodExactOptional",(e,t)=>{Ho.init(e,t),W(e,"values",n=>n.def.innerType._zod.values),W(e,"pattern",n=>n.def.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),Jl=b("$ZodNullable",(e,t)=>{F.init(e,t),W(e,"optin",n=>n.def.innerType._zod.optin),W(e,"optout",n=>n.def.innerType._zod.optout),W(e,"pattern",n=>{let r=n.def.innerType._zod.pattern;return r?new RegExp(`^(${nt(r.source)}|null)$`):void 0}),W(e,"values",n=>n.def.innerType._zod.values?new Set([...n.def.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),Kl=b("$ZodDefault",(e,t)=>{F.init(e,t),e._zod.optin="defaulted",W(e,"values",n=>n.def.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;let o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>ed(i,t)):ed(o,t)}});Gl=b("$ZodPrefault",(e,t)=>{F.init(e,t),e._zod.optin="defaulted",W(e,"values",n=>n.def.innerType._zod.values),e._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),ql=b("$ZodNonOptional",(e,t)=>{F.init(e,t),W(e,"values",n=>{let r=n.def.innerType._zod.values;return r?new Set([...r].filter(o=>o!==void 0)):void 0}),e._zod.parse=(n,r)=>{let o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>td(i,e)):td(o,e)}});Yl=b("$ZodSuccess",(e,t)=>{F.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new dt("ZodSuccess");let o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>(n.value=i.issues.length===0,n)):(n.value=o.issues.length===0,n)}});Xl=b("$ZodCatch",(e,t)=>{F.init(e,t),W(e,"optin",n=>n.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),W(e,"optout",n=>n.def.innerType._zod.optout),W(e,"values",n=>n.def.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);let o=t.innerType._zod.run({value:n.value,issues:[]},r);return o instanceof Promise?o.then(i=>nd(n,i,t,r)):nd(n,o,t,r)}}),Ql=b("$ZodNaN",(e,t)=>{F.init(e,t),e._zod.parse=(n,r)=>((typeof n.value!="number"||!Number.isNaN(n.value))&&n.issues.push({input:n.value,inst:e,expected:"nan",code:"invalid_type"}),n)}),Wo=b("$ZodPipe",(e,t)=>{F.init(e,t),W(e,"values",n=>n.def.in._zod.values),W(e,"optin",n=>n.def.in._zod.optin),W(e,"optout",n=>n.def.out._zod.optout),W(e,"propValues",n=>n.def.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){let i=t.out._zod.run(n,r);return i instanceof Promise?i.then(s=>Po(s,t.in,r)):Po(i,t.in,r)}let o=t.in._zod.run(n,r);return o instanceof Promise?o.then(i=>Po(i,t.out,r)):Po(o,t.out,r)}});vr=b("$ZodCodec",(e,t)=>{F.init(e,t),W(e,"values",n=>n.def.in._zod.values),W(e,"optin",n=>n.def.in._zod.optin),W(e,"optout",n=>n.def.out._zod.optout),W(e,"propValues",n=>n.def.in._zod.propValues),e._zod.parse=(n,r)=>{if((r.direction||"forward")==="forward"){let i=t.in._zod.run(n,r);return i instanceof Promise?i.then(s=>Co(s,t,r)):Co(i,t,r)}else{let i=t.out._zod.run(n,r);return i instanceof Promise?i.then(s=>Co(s,t,r)):Co(i,t,r)}}});eu=b("$ZodPreprocess",(e,t)=>{Wo.init(e,t)}),tu=b("$ZodReadonly",(e,t)=>{F.init(e,t),W(e,"propValues",n=>n.def.innerType._zod.propValues),W(e,"values",n=>n.def.innerType._zod.values),W(e,"optin",n=>n.def.innerType?._zod?.optin),W(e,"optout",n=>n.def.innerType?._zod?.optout),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);let o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(rd):rd(o)}});nu=b("$ZodTemplateLiteral",(e,t)=>{F.init(e,t);let n=[];for(let r of t.parts)if(typeof r=="object"&&r!==null){let o=Wa(r);if(!o)throw new Error(`Invalid template literal part, no pattern found: ${[...r._zod.traits].shift()}`);n.push(nt(o))}else if(r===null||zs.has(typeof r))n.push(je(`${r}`));else throw new Error(`Invalid template literal part: ${r}`);e._zod.pattern=new RegExp(`^${n.join("")}$`),e._zod.parse=(r,o)=>typeof r.value!="string"?(r.issues.push({input:r.value,inst:e,expected:"string",code:"invalid_type"}),r):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(r.value)||r.issues.push({input:r.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),r)}),ru=b("$ZodFunction",(e,t)=>(F.init(e,t),Object.defineProperty(e,"_def",{value:t}),e._zod.def=t,e.implement=n=>{if(typeof n!="function")throw new Error("implement() must be called with a function");return Object.defineProperty(function(...r){let o=e._def.input?uo(e._def.input,r):r,i=Reflect.apply(n,this,o);return e._def.output?uo(e._def.output,i):i},"_zod",{value:e._zod,enumerable:!1})},e.implementAsync=n=>{if(typeof n!="function")throw new Error("implementAsync() must be called with a function");return Object.defineProperty(async function(...r){let o=e._def.input?await co(e._def.input,r):r,i=await Reflect.apply(n,this,o);return e._def.output?await co(e._def.output,i):i},"_zod",{value:e._zod,enumerable:!1})},e._zod.parse=(n,r)=>typeof n.value!="function"?(n.issues.push({code:"invalid_type",expected:"function",input:n.value,inst:e}),n):(e._def.output&&e._def.output._zod.def.type==="promise"?n.value=e.implementAsync(n.value):n.value=e.implement(n.value),n),e.input=(...n)=>{let r=e.constructor;return Array.isArray(n[0])?new r({type:"function",input:new Bo({type:"tuple",items:n[0],rest:n[1]}),output:e._def.output}):new r({type:"function",input:n[0],output:e._def.output})},e.output=n=>{let r=e.constructor;return new r({type:"function",input:e._def.input,output:n})},e)),ou=b("$ZodPromise",(e,t)=>{F.init(e,t),e._zod.parse=(n,r)=>Promise.resolve(n.value).then(o=>t.innerType._zod.run({value:o,issues:[]},r))}),kr=b("$ZodLazy",(e,t)=>{F.init(e,t),$s(e._zod,"innerType",()=>{let n=t;return n._cachedInner||(n._cachedInner=t.getter()),n._cachedInner}),W(e,"pattern",n=>n.innerType?._zod?.pattern),W(e,"propValues",n=>n.innerType?._zod?.propValues),W(e,"optin",n=>n.innerType?._zod?.optin??void 0),W(e,"optout",n=>n.innerType?._zod?.optout??void 0),e._zod.parse=(n,r)=>e._zod.innerType._zod.run(n,r)}),iu=b("$ZodCustom",(e,t)=>{ee.init(e,t),F.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{let r=n.value,o=t.fn(r);if(o instanceof Promise)return o.then(i=>od(i,n,r,e));od(o,n,r,e)}})});function dd(e){return e!==null&&typeof e=="object"}function su(e){return e.map(t=>t.path?{...t,path:t.path.slice()}:{...t})}function $r(e,t,n){let r=md.get(e);if(r!==void 0)return r?_r:bn;if(t.has(e))return _r;t.add(e);let o=bn,i=p=>{if(o!==_r&&p?._zod){let m=$r(p,t,n);m>o&&(o=m)}},s=(p,m)=>{let g=bn;for(let d of Reflect.ownKeys(p)){let h=Object.getOwnPropertyDescriptor(p,d);if(m&&!h.enumerable)continue;let y=h.get?Go:h.value?._zod?$r(h.value,t,n):bn;y>g&&(g=y)}return g},a=p=>{p>o&&(o=p)},l=e._zod.def,u=l.type;switch(u){case"object":{let p=ln(l);a(p?s(p,!0):Go),i(l.catchall);break}case"array":i(l.element);break;case"tuple":for(let p of l.items)i(p);i(l.rest);break;case"record":case"map":i(l.keyType),i(l.valueType);break;case"set":i(l.valueType);break;case"union":for(let p of l.options)i(p);break;case"intersection":i(l.left),i(l.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":i(l.innerType);break;case"pipe":i(l.in),i(l.out);break;case"function":i(l.input),i(l.output);break;case"lazy":{let p=l._cachedInner??(n?e._zod.innerType:void 0);a(p?$r(p,t,!1):Go);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(let p in l){let m=Object.getOwnPropertyDescriptor(l,p);if(!m||m.get)continue;let g=m.value;if(!(!g||typeof g!="object")){if(g._zod)i(g);else if(Array.isArray(g))for(let d of g)i(d)}}}return t.delete(e),$b(e,o)}function $b(e,t){return t!==Go&&md.set(e,t===_r),t}function Yo(e){return $r(e,new Set,!0)!==bn}function xb(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}function xr(){return Sb}function Xo(e,t){let n=e[au]?.backEdges;return n!==void 0&&dd(t)&&n.has(t)}var qo,au,pd,md,bn,Go,_r,Jo,Ko,Sb,lu=K(()=>{le();qo=class extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}},au="~memo",pd=[];md=new WeakMap,bn=0,Go=1,_r=2;Ko=[],Sb={alloc(e,t,n){let r=Jo;if(!r)return n;Jo=void 0;let o={value:n,issues:null};return r.set(t.value,o),Ko.push(o),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let n=e._zod.parse,r=(o,i)=>{if(i.direction!=="backward"&&Xo(i,o.value))throw new qo;return n(o,i)};e._zod.parse=r,e._zod.run===n&&(e._zod.run=r)})},attach(e){var t;let n,r=!1,o,i;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let s=e._zod.parse,a=(l,u)=>{if(n===void 0){let _=$r(e,new Set,!1);if(_===bn)return e._zod.parse=s,e._zod.run===a&&(e._zod.run=s),s(l,u);_===_r||r?n=!0:r=!0}let p=l.value;if(!dd(p))return s(l,u);let m=u[au];m||(m={buckets:new WeakMap,backEdges:void 0},u[au]=m);let g;o===u?g=i:(g=xb(m,e),o=u,i=g);let d=g.get(p);if(d)return l.value=d.value,d.issues?d.issues.length&&l.issues.push(...su(d.issues)):(l.memo=!0,m.backEdges??(m.backEdges=new WeakSet),m.backEdges.add(d.value)),l;Jo=g;let h=Ko.length,y=s(l,u);Jo=void 0;let w=Ko.length>h?Ko.pop():void 0;return y instanceof Promise?y.then(_=>(w&&(w.issues=_.issues.length?su(_.issues):pd),_)):(w&&(w.issues=y.issues.length?su(y.issues):pd),y)};e._zod.parse=a,e._zod.run===s&&(e._zod.run=a)})}}});var Sr={};Ue(Sr,{default:()=>zb});var zb,uu=K(()=>{zb={}});function ei(){return new Qo}var gd,cu,fu,Qo,he,zr=K(()=>{cu=Symbol("ZodOutput"),fu=Symbol("ZodInput"),Qo=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){let r=n[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){let n=t._zod.parent;if(n){let r={...this.get(n)??{}};delete r.id;let o={...r,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};(gd=globalThis).__zod_globalRegistry??(gd.__zod_globalRegistry=ei());he=globalThis.__zod_globalRegistry});function Pb(e,t){try{return ni(e,{assertOnly:!0})}catch{return t}}function gu(e,t){try{let n=ni(e),r=ti(e,n);return r._zod.bag.validator=Pb(e,n),r}catch(n){if(t?.strict)throw n;return e}}function ti(e,t){if(Yo(e))throw new J("a schema whose subtree contains a reference cycle");let n=q(e),r=e._zod.run,o=r.__originalRun??r,i=(s,a)=>{if(a?.async||a?.direction==="backward"||a?.skipChecks||a?.[hd]||a&&Xo(a,s.value))return o(s,a);let l=t(s.value);return l!==xe?(s.value=l,s):(a&&(a[hd]=!0),o(s,a))};return i.__originalRun=o,n._zod.bag.fallbackRun=o,n._zod.bag.validator=t,n._zod.run=i,r.__originalRun||Cb(n,e,t),n}function Cb(e,t,n){let r=e,o=t;if(typeof o.safeParse=="function"){let i=o.safeParse;r.safeParse=(s,a)=>{let l=n(s);return l!==xe?{success:!0,data:l}:i(s,a)}}if(typeof o.parse=="function"){let i=o.parse;r.parse=(s,a)=>{let l=n(s);return l!==xe?l:i(s,a)}}}function ni(e,t){let n=!0;try{n=Yo(e)}catch{}if(n)throw new J("a schema whose subtree contains a reference cycle");let r={constants:new Map,constantCounter:0,varCounter:0,definite:!0},o=new Et(["input"]),i=re(o,r,e,"input",!t?.assertOnly);o.write(i===null?"return true;":`return ${i};`);let s=["INVALID",...r.constants.keys()],a=[xe,...r.constants.values()],l=o.content.join(`
64
+ `),u=t?.debug?s.length>0?`// Constants: ${s.join(", ")}
65
+ ${l}`:l:"",p=Function,m=`return (input) => {
66
+ ${l}
67
+ }`,g;try{g=new p(...s,m)(...a)}catch(d){throw new J(`this schema (generated code failed to evaluate: ${d.message})`)}return t?.debug&&(g.code=u),g.definite=r.definite,g}function U(e,t){for(let[r,o]of e.constants)if(o===t)return r;let n=`c${e.constantCounter++}`;return e.constants.set(n,t),n}function Rt(e,t){return e.definite=!1,U(e,t)}function D(e){return`v${e.varCounter++}`}function Ab(e,t){let n=e._zod.run({value:t,issues:[]},{});if(n&&typeof n.then=="function")return xe;let r=n;return r.issues.length===0?r.value:xe}function be(e,t,n,r,o=!0){let i=e.content.length,s=t.constants.size,a=t.constantCounter,l=t.varCounter;try{return re(e,t,n,r,o)}catch(u){if(!(u instanceof J)||!u.islandable)throw u;if(e.content.length=i,t.constants.size>s){let p=Array.from(t.constants.keys()).slice(s);for(let m of p)t.constants.delete(m)}return t.constantCounter=a,t.varCounter=l,Ob(e,t,n,r)}}function Ob(e,t,n,r){t.definite=!1;let o=U(t,n),i=U(t,Ab),s=D(t);return e.write(`const ${s} = ${i}(${o}, ${r});`),e.write(`if (${s} === INVALID) return INVALID;`),s}function Eb(e,t,n,r){let o=n._zod.def.checks;if(!o||o.length===0)return r;let i=r;for(let s of o){let a=s._zod.def;if(a.when&&!Nb.has(a.check))throw new J('check with a custom "when" condition');switch(a.check){case"greater_than":Zb(e,t,a,i);break;case"less_than":Tb(e,t,a,i);break;case"multiple_of":Rb(e,t,a,i);break;case"number_format":_d(e,a,i);break;case"min_length":{let l=mt(a.minimum,"min_length"),u=pu(e,t,i,`${i}.length >= ${l} && ${i}.length < ${a.minimum*2}`);e.write(`if (${u} < ${l}) return INVALID;`);break}case"max_length":{let l=mt(a.maximum,"max_length"),u=pu(e,t,i,`${i}.length > ${l}`);e.write(`if (${u} > ${l}) return INVALID;`);break}case"length_equals":{let l=mt(a.length,"length_equals"),u=pu(e,t,i,`${i}.length >= ${l} && ${i}.length <= ${a.length*2}`);e.write(`if (${u} !== ${l}) return INVALID;`);break}case"min_size":e.write(`if (${i}.size < ${mt(a.minimum,"min_size")}) return INVALID;`);break;case"max_size":e.write(`if (${i}.size > ${mt(a.maximum,"max_size")}) return INVALID;`);break;case"size_equals":e.write(`if (${i}.size !== ${mt(a.size,"size_equals")}) return INVALID;`);break;case"string_format":i=$d(e,t,a,i);break;case"custom":i=Vb(e,t,s,i);break;case"bigint_format":Db(e,a,i);break;case"mime_type":Lb(e,t,a,i);break;case"property":Mb(e,t,a,i);break;case"properties":jb(e,t,a,i);break;case"overwrite":{let l=D(t);Ub(e,t,s,i,l),i=l;break}default:throw new J(`check type ${a.check}`)}}return i}function pu(e,t,n,r){let o=U(t,At),i=D(t);return e.write(`const ${i} = typeof ${n} === "string" && ${r} ? ${o}(${n}) : ${n}.length;`),i}function mt(e,t){if(typeof e!="number"||!Number.isFinite(e))throw new J(`${t} bound of type ${typeof e}`);return`${e}`}function kd(e,t){if(typeof t=="bigint")return`${t}n`;if(typeof t=="number"){if(Number.isNaN(t))throw new J("comparison check with NaN bound");return`${t}`}if(t instanceof Date){if(Number.isNaN(t.getTime()))throw new J("comparison check with Invalid Date bound");return U(e,t)}throw new J(`comparison check bound of type ${typeof t}`)}function Zb(e,t,n,r){let o=n.inclusive?"<":"<=";e.write(`if (${r} ${o} ${kd(t,n.value)}) return INVALID;`)}function Tb(e,t,n,r){let o=n.inclusive?">":">=";e.write(`if (${r} ${o} ${kd(t,n.value)}) return INVALID;`)}function Rb(e,t,n,r){if(typeof n.value=="bigint"){if(n.value===BigInt(0))throw new J("multiple_of check with a zero divisor");e.write(`if (${r} % ${n.value}n !== 0n) return INVALID;`)}else{let o=U(t,qn);e.write(`if (${o}(${r}, ${mt(n.value,"multiple_of")}) !== 0) return INVALID;`)}}function _d(e,t,n){let r=t.format;switch(r){case"safeint":e.write(`if (!Number.isSafeInteger(${n})) return INVALID;`);break;case"int32":e.write(`if (!Number.isInteger(${n}) || ${n} < -2147483648 || ${n} > 2147483647) return INVALID;`);break;case"uint32":e.write(`if (!Number.isInteger(${n}) || ${n} < 0 || ${n} > 4294967295) return INVALID;`);break;case"float32":e.write(`if (!Number.isFinite(${n}) || ${n} < -3.4028234663852886e38 || ${n} > 3.4028234663852886e38) return INVALID;`);break;case"float64":e.write(`if (!Number.isFinite(${n})) return INVALID;`);break;default:throw new J(`number format ${r}`)}}function Db(e,t,n){let r=t.format;if(r)switch(r){case"int64":e.write(`if (${n} < -9223372036854775808n || ${n} > 9223372036854775807n) return INVALID;`);break;case"uint64":e.write(`if (${n} < 0n || ${n} > 18446744073709551615n) return INVALID;`);break;default:throw new J(`bigint format ${r}`)}}function Lb(e,t,n,r){let o=n.mime;if(o&&o.length>0){let i=U(t,new Set(o));e.write(`if (!${i}.has(${r}.type)) return INVALID;`)}}function jb(e,t,n,r){if(n.when)throw new J('check with a custom "when" condition');e.write(`if (${r} == null) return INVALID;`);let o=n.shape;for(let i of Reflect.ownKeys(o)){let s=typeof i=="symbol"?U(t,i):_e(i),a=D(t);e.write(`const ${a} = ${r}[${s}];`),be(e,t,o[i],a,!1)}}function Mb(e,t,n,r){let o=`${r}[${JSON.stringify(n.property)}]`;re(e,t,n.schema,o)}function Ub(e,t,n,r,o){let i=n._zod.def.tx;if(!i)throw new J("overwrite check without a transform function");if(Dt(i))throw new Fe("z.compile: async overwrite transforms are not supported");let s=U(t,i);e.write(`const ${o} = ${s}(${r});`)}function du(){throw new Ae}function hu(e){this.issues.push(e)}function Vb(e,t,n,r){let o=n._zod.def;if(o.fn){if(Dt(o.fn))throw new Fe("z.compile: async .refine() predicates are not supported");let i=Rt(t,o.fn),s=U(t,du),a=D(t);return e.write(`const ${a} = ${i}(${r});`),e.write(`if (${a} instanceof Promise) ${s}();`),e.write(`if (!${a}) return INVALID;`),r}if(n._zod.check){if(Dt(n._zod.check))throw new Fe("z.compile: async .superRefine() / check functions are not supported");let i=n._zod.check,a=Rt(t,u=>{let p={value:u,issues:[],addIssue:hu};return i(p)instanceof Promise&&du(),p.issues.length===0?p.value:xe}),l=D(t);return e.write(`const ${l} = ${a}(${r});`),e.write(`if (${l} === INVALID) return INVALID;`),l}throw new J("custom check without a predicate or check function")}function $d(e,t,n,r,o=!0){let i=n.format;if(i==="base64"){let u=U(t,hr);return e.write(`if (!${u}(${r})) return INVALID;`),r}if(i==="base64url"){let u=U(t,Lo);return e.write(`if (!${u}(${r})) return INVALID;`),r}if(i==="jwt"){let u=U(t,Uo),p=U(t,n.alg??null);return e.write(`if (!${u}(${r}, ${p})) return INVALID;`),r}if(i==="ipv6"){let u=U(t,gr);return e.write(`if (!${u}(${r})) return INVALID;`),r}if(i==="cidrv6"){let u=U(t,Ro);return e.write(`if (!${u}(${r})) return INVALID;`),r}if(i==="credit_card"){let u=U(t,jo);return e.write(`if (!${u}(${r})) return INVALID;`),r}if(i==="iban"){let u=U(t,Mo);return e.write(`if (!${u}(${r})) return INVALID;`),r}let s=n;if(i==="url"||i==="httpurl"||s.normalize||s.hostname!==void 0||s.protocol!==void 0){let u=U(t,Eo),p=U(t,n),m=D(t),g=D(t);if(e.write(`const ${m} = ${r}.trim();`),e.write(`const ${g} = ${u}(${m}, ${p});`),e.write(`if (typeof ${g} === "number") return INVALID;`),s.hostname!==void 0){let y=U(t,Zo);e.write(`if (!${y}(${g}, ${p}.hostname)) return INVALID;`)}if(s.protocol!==void 0){let y=U(t,To);e.write(`if (!${y}(${g}, ${p}.protocol)) return INVALID;`)}if(!o)return null;let d=D(t),h=s.normalize?`${g}.href`:`${U(t,mr)}(${m})`;return e.write(`const ${d} = ${h};`),d}let a=n.fn;if(a){if(Dt(a))throw new J(`async string format ${i}`);let u=U(t,a);return e.write(`if (!${u}(${r})) return INVALID;`),r}if(Fb.has(i)&&n.pattern){let u=U(t,n.pattern);return e.write(`${u}.lastIndex = 0;`),e.write(`if (!${u}.test(${r})) return INVALID;`),r}let l=n.format;switch(l){case"regex":throw new J("regex format without a pattern");case"lowercase":e.write(`if (${r} !== ${r}.toLowerCase()) return INVALID;`);break;case"uppercase":e.write(`if (${r} !== ${r}.toUpperCase()) return INVALID;`);break;case"includes":e.write(`if (!${r}.includes(${_e(n.includes)})) return INVALID;`);break;case"starts_with":{let u=n.prefix;e.write(`if (${r}.slice(0, ${u.length}) !== ${_e(u)}) return INVALID;`);break}case"ends_with":{let u=n.suffix;e.write(`if (${r}.slice(-${u.length}) !== ${_e(u)}) return INVALID;`);break}default:throw new J(`string format ${l}`)}return r}function re(e,t,n,r,o=!0){let i=n._zod.def,s=i.type;if(i.coerce)throw new J(`coercion (z.coerce.${s}())`);let a=o||!!i.checks?.length,l;switch(s){case"string":l=Bb(e,t,n,r,a);break;case"number":l=Hb(e,n,r);break;case"boolean":l=Wb(e,r);break;case"bigint":l=Jb(e,n,r);break;case"symbol":l=Kb(e,r);break;case"undefined":l=Gb(e,r);break;case"null":l=qb(e,r);break;case"any":case"unknown":l=r;break;case"never":e.write("return INVALID;"),l=r;break;case"void":l=Yb(e,r);break;case"nan":l=Xb(e,r);break;case"date":l=Qb(e,r);break;case"object":l=ew(e,t,n,r,a);break;case"optional":l=tw(e,t,n,r,a);break;case"nullable":l=ow(e,t,n,r,a);break;case"array":l=iw(e,t,n,r,a);break;case"literal":l=sw(e,t,n,r);break;case"enum":l=aw(e,t,n,r);break;case"readonly":{let u=bd(e,t,n,r),p=D(t);e.write(`const ${p} = Object.freeze(${u});`),l=p;break}case"success":bd(e,t,n,r),l="true";break;case"default":case"prefault":l=lw(e,t,n,r);break;case"nonoptional":l=uw(e,t,n,r);break;case"tuple":l=cw(e,t,n,r);break;case"union":l=fw(e,t,n,r);break;case"intersection":l=mw(e,t,n,r);break;case"record":l=gw(e,t,n,r);break;case"map":l=yw(e,t,n,r);break;case"set":l=bw(e,t,n,r);break;case"file":l=ww(e,r);break;case"template_literal":l=vw(e,t,n,r);break;case"lazy":l=kw(e,t,n,r);break;case"pipe":l=_w(e,t,n,r);break;case"custom":l=$w(e,t,n,r);break;case"transform":l=zw(e,t,n,r);break;case"catch":l=Sw(e,t,n,r);break;default:throw new J(`schema type ${s}`)}return l===null?null:Eb(e,t,n,l)}function Bb(e,t,n,r,o=!0){e.write(`if (typeof ${r} !== "string") return INVALID;`);let i=n._zod.def;return i.format===void 0?r:$d(e,t,i,r,o)}function Hb(e,t,n){e.write(`if (typeof ${n} !== "number" || !Number.isFinite(${n})) return INVALID;`);let r=t._zod.def;return r.check==="number_format"&&r.format&&_d(e,{format:r.format},n),n}function Wb(e,t){return e.write(`if (typeof ${t} !== "boolean") return INVALID;`),t}function Jb(e,t,n){e.write(`if (typeof ${n} !== "bigint") return INVALID;`);let r=t._zod.def;if(r.format)switch(r.format){case"int64":e.write(`if (${n} < -9223372036854775808n || ${n} > 9223372036854775807n) return INVALID;`);break;case"uint64":e.write(`if (${n} < 0n || ${n} > 18446744073709551615n) return INVALID;`);break}return n}function Kb(e,t){return e.write(`if (typeof ${t} !== "symbol") return INVALID;`),t}function Gb(e,t){return e.write(`if (${t} !== undefined) return INVALID;`),t}function qb(e,t){return e.write(`if (${t} !== null) return INVALID;`),t}function Yb(e,t){return e.write(`if (${t} !== undefined) return INVALID;`),t}function Xb(e,t){return e.write(`if (typeof ${t} !== "number" || !Number.isNaN(${t})) return INVALID;`),t}function Qb(e,t){return e.write(`if (!(${t} instanceof Date) || Number.isNaN(${t}.getTime())) return INVALID;`),t}function ew(e,t,n,r,o=!0){let i=n._zod.def;e.write(`if (typeof ${r} !== "object" || ${r} === null || Array.isArray(${r})) return INVALID;`);let s=i.shape,a=Object.keys(s),l=Object.getOwnPropertySymbols(s),u=l.length?[...a,...l]:a,p=v=>typeof v=="symbol"?U(t,v):_e(v),m=v=>typeof v=="symbol"?`[${p(v)}]`:_e(v),g=s;if(a.includes("__proto__"))throw new J('object shape key "__proto__"');let d=new Map;for(let v of u){let $=g[v],z=p(v),R=D(t);if(e.write(`const ${R} = ${r}[${z}];`),$._zod.optin!==void 0){let S=D(t);e.write(`let ${S} = (() => {`),e.indented(M=>{let H=be(M,t,$,R);M.write(`return ${H};`)}),e.write("})();"),$._zod.optout==="optional"?(e.write(`if (${S} === INVALID) {`),e.indented(M=>{M.write(`if (${z} in ${r}) return INVALID;`),M.write(`${S} = undefined;`)}),e.write("}")):e.write(`if (${S} === INVALID) return INVALID;`),d.set(v,S)}else{rw($)&&e.write(`if (!(${z} in ${r})) return INVALID;`);let S=be(e,t,$,R,o);S!==null&&d.set(v,S)}}let h=i.catchall,y="none";if(h){let v=h._zod.def.type;if(v==="never"){let $=a.map(z=>`k !== ${_e(z)}`).join(" && ")||"true";e.write(`for (const k in ${r}) {`),e.indented(z=>{z.write(`if (${$}) return INVALID;`)}),e.write("}")}else(v==="unknown"||v==="any")&&!h._zod.def.checks?.length?y="passthrough":y="schema"}let w=D(t),_=u.some(v=>yd(g[v])||mu(g[v]));if(!o){if(y==="schema"){let v=a.length>0?U(t,new Set(a)):null;e.write(`for (const k in ${r}) {`),e.indented($=>{$.write('if (k === "__proto__") continue;'),v&&$.write(`if (${v}.has(k)) continue;`);let z=D(t);$.write(`const ${z} = ${r}[k];`),be($,t,h,z,!1)}),e.write("}")}return null}if(_){e.write(`const ${w} = {};`);for(let v of u){let $=p(v),z=d.get(v);mu(g[v])?e.write(`if (${$} in ${r}) ${w}[${$}] = ${z};`):yd(g[v])?e.write(`if (${z} !== undefined || ${$} in ${r}) ${w}[${$}] = ${z};`):e.write(`${w}[${$}] = ${z};`)}}else{let v=u.map($=>`${m($)}: ${d.get($)}`).join(", ");e.write(`const ${w} = { ${v} };`)}if(y!=="none"){let v=a.length>0?U(t,new Set(a)):null;e.write(`for (const k in ${r}) {`),e.indented($=>{if($.write('if (k === "__proto__") continue;'),v&&$.write(`if (${v}.has(k)) continue;`),y==="passthrough")$.write(`${w}[k] = ${r}[k];`);else{let z=D(t);$.write(`const ${z} = ${r}[k];`);let R=be($,t,h,z);$.write(`${w}[k] = ${R};`)}}),e.write("}")}return w}function tw(e,t,n,r,o=!0){let i=n._zod.def;if(nw(n))return re(e,t,i.innerType,r,o);if(i.innerType._zod.optin==="defaulted"){let a=D(t),l=D(t);return e.write(`let ${a};`),e.write(`if (${r} === undefined) {`),e.indented(u=>{u.write(`const ${l} = (() => {`),u.indented(p=>{let m=re(p,t,i.innerType,r);p.write(`return ${m};`)}),u.write("})();"),u.write(`if (${l} !== INVALID) ${a} = ${l};`)}),e.write("} else {"),e.indented(u=>{let p=re(u,t,i.innerType,r);u.write(`${a} = ${p};`)}),e.write("}"),a}let s=o?D(t):null;return s&&e.write(`let ${s};`),e.write(`if (${r} !== undefined) {`),e.indented(a=>{let l=re(a,t,i.innerType,r,o);s&&l!==null&&a.write(`${s} = ${l};`)}),e.write("}"),s}function nw(e){return e._zod.traits?.has("$ZodExactOptional")===!0}function rw(e){return e._zod.optin===void 0&&Tt(e)}function Tt(e){if(e._zod.def.coerce)return!0;let t=e._zod.def;switch(t.type){case"any":case"unknown":case"undefined":case"void":case"default":case"prefault":case"transform":case"custom":case"lazy":return!0;case"string":case"number":case"boolean":case"bigint":case"symbol":case"null":case"never":case"nan":case"date":case"object":case"array":case"tuple":case"record":case"map":case"set":case"file":case"template_literal":return!1;case"nonoptional":return t.innerType?Tt(t.innerType):!1;case"literal":return!!t.values?.includes(void 0);case"enum":return!!e._zod.values?.has(void 0);case"optional":case"nullable":case"readonly":case"success":return t.innerType?Tt(t.innerType):!0;case"catch":return!0;case"union":return t.options?t.options.some(Tt):!0;case"intersection":return!t.left||!t.right?!0:Tt(t.left)&&Tt(t.right);case"pipe":return t.in?Tt(t.in):!0;default:return!0}}function mu(e){return e._zod.optin==="optional"&&e._zod.optout==="optional"}function yd(e){return(e._zod.optin!=="defaulted"||e._zod.optout==="optional")&&wn(e)}function wn(e){let t=e._zod.def;switch(t.type){case"string":case"number":case"boolean":case"bigint":case"symbol":case"null":case"nan":case"date":case"object":case"array":case"tuple":case"record":case"map":case"set":case"file":case"template_literal":case"never":case"success":return!1;case"literal":return!!t.values?.includes(void 0);case"enum":return!!e._zod.values?.has(void 0);case"optional":return!0;case"nullable":case"readonly":case"nonoptional":return t.innerType?wn(t.innerType):!0;case"union":return t.options?t.options.some(wn):!0;case"intersection":return!t.left||!t.right||wn(t.left)||wn(t.right);case"pipe":return t.out?wn(t.out):!0;default:return!0}}function ow(e,t,n,r,o=!0){let i=n._zod.def,s=o?D(t):null;return s&&e.write(`let ${s} = null;`),e.write(`if (${r} !== null) {`),e.indented(a=>{let l=re(a,t,i.innerType,r,o);s&&l!==null&&a.write(`${s} = ${l};`)}),e.write("}"),s}function yu(e,t,n){for(let[r,o]of un(t._zod.def.checks))e.write(`if (${n} > ${mt(r,o._zod.def.check)}) return INVALID;`)}function iw(e,t,n,r,o=!0){let i=n._zod.def;e.write(`if (!Array.isArray(${r})) return INVALID;`),yu(e,n,`${r}.length`);let s=o?D(t):null,a=D(t),l=D(t);return s&&e.write(`const ${s} = new Array(${r}.length);`),e.write(`for (let ${a} = 0; ${a} < ${r}.length; ${a}++) {`),e.indented(u=>{u.write(`const ${l} = ${r}[${a}];`);let p=be(u,t,i.element,l,o);s&&p!==null&&u.write(`${s}[${a}] = ${p};`)}),e.write("}"),s}function sw(e,t,n,r){let i=n._zod.def.values;if(i.length!==1){let a=U(t,new Set(i));return e.write(`if (!${a}.has(${r})) return INVALID;`),r}let s=i[0];if(typeof s=="number"&&Number.isNaN(s)){let a=U(t,new Set(i));return e.write(`if (!${a}.has(${r})) return INVALID;`),r}if(typeof s=="string")e.write(`if (${r} !== ${_e(s)}) return INVALID;`);else if(typeof s=="number"||typeof s=="boolean")e.write(`if (${r} !== ${s}) return INVALID;`);else if(s===null)e.write(`if (${r} !== null) return INVALID;`);else if(s===void 0)e.write(`if (${r} !== undefined) return INVALID;`);else if(typeof s=="bigint")e.write(`if (${r} !== ${s}n) return INVALID;`);else throw new J(`literal type ${typeof s}`);return r}function aw(e,t,n,r){let o=n._zod.values;if(!o)throw new J("enum schema without enumerated values");let i=U(t,o);return e.write(`if (!${i}.has(${r})) return INVALID;`),r}function bd(e,t,n,r){let o=n._zod.def;return re(e,t,o.innerType,r)}function lw(e,t,n,r){let o=n._zod.def,s=Object.getOwnPropertyDescriptor(n._zod.def,"defaultValue")?()=>n._zod.def.defaultValue:void 0;if(n._zod.def.type==="prefault"){if(!s)return re(e,t,o.innerType,r);let l=U(t,s),u=D(t);return e.write(`let ${u} = ${r};`),e.write(`if (${r} === undefined) ${u} = ${l}();`),re(e,t,o.innerType,u)}let a=D(t);if(s){let l=U(t,s),u=U(t,Yn);e.write(`let ${a};`),e.write(`if (${r} === undefined) {`),e.indented(p=>{p.write(`${a} = ${u}(${l}());`)}),e.write("} else {"),e.indented(p=>{let m=re(p,t,o.innerType,r);p.write(`${a} = ${m} === undefined ? ${u}(${l}()) : ${m};`)}),e.write("}")}else e.write(`let ${a};`),e.write(`if (${r} !== undefined) {`),e.indented(l=>{let u=re(l,t,o.innerType,r);l.write(`${a} = ${u};`)}),e.write("}");return a}function uw(e,t,n,r){let o=n._zod.def,i=re(e,t,o.innerType,r),s=D(t);return e.write(`const ${s} = ${i};`),e.write(`if (${s} === undefined) return INVALID;`),s}function cw(e,t,n,r){let o=n._zod.def,i=o.items,s=o.rest;e.write(`if (!Array.isArray(${r})) return INVALID;`);let a=wd(i,"optin"),l=wd(i,"optout");s?e.write(`if (${r}.length < ${a}) return INVALID;`):e.write(`if (${r}.length < ${a} || ${r}.length > ${i.length}) return INVALID;`);let u=D(t);e.write(`const ${u} = [];`);for(let p=0;p<i.length;p++){let m=i[p];if(p>=l)e.write(`if (${u}.length === ${p}) {`),e.indented(g=>{g.write(`if (${p} < ${r}.length) {`),g.indented(d=>{let h=D(t);d.write(`const ${h} = ${r}[${p}];`);let y=be(d,t,m,h);d.write(`${u}[${p}] = ${y};`)}),g.write("} else {"),g.indented(d=>{if(mu(m)){d.write(`${u}.length = ${p};`);return}let h=D(t),y=D(t);d.write(`const ${h} = undefined;`),d.write(`const ${y} = (() => {`),d.indented(w=>{let _=be(w,t,m,h);w.write(`return ${_};`)}),d.write("})();"),d.write(`if (${y} === INVALID || ${y} === undefined) ${u}.length = ${p};`),d.write(`else ${u}[${p}] = ${y};`)}),g.write("}")}),e.write("}");else{let g=D(t);e.write(`const ${g} = ${r}[${p}];`);let d=be(e,t,m,g);e.write(`${u}[${p}] = ${d};`)}}if(s){let p=D(t),m=D(t);e.write(`for (let ${p} = ${i.length}; ${p} < ${r}.length; ${p}++) {`),e.indented(g=>{g.write(`const ${m} = ${r}[${p}];`);let d=be(g,t,s,m);g.write(`${u}[${p}] = ${d};`)}),e.write("}")}return u}function wd(e,t){for(let n=e.length-1;n>=0;n--)if(!(t==="optin"?e[n]._zod.optin!==void 0:e[n]._zod.optout==="optional"))return n+1;return 0}function fw(e,t,n,r){let o=n._zod.def,i=o.options;if(o.discriminator)return pw(e,t,o,r);if(o.inclusive===!1)throw new J("exclusive unions (z.xor)");if(i.length===0)return e.write("return INVALID;"),r;if(i.length===1)return re(e,t,i[0],r);if(i.every(l=>l._zod.def.type==="literal"&&!l._zod.def.checks?.length)){let l=new Set(i.flatMap(p=>p._zod.def.values)),u=U(t,l);return e.write(`if (!${u}.has(${r})) return INVALID;`),r}let a=D(t);e.write(`let ${a};`);for(let l=0;l<i.length;l++){let u=i[l];l===0?e.write(`${a} = (() => {`):e.write(`if (${a} === INVALID) ${a} = (() => {`),e.indented(p=>{let m=re(p,t,u,r);p.write(`return ${m};`)}),e.write("})();")}return e.write(`if (${a} === INVALID) return INVALID;`),a}function pw(e,t,n,r){if(n.unionFallback)throw new J("discriminated union with unionFallback");if(n.options.length===0)return e.write("return INVALID;"),r;let o=D(t),i=D(t);e.write(`const ${o} = ${r}?.[${_e(n.discriminator)}];`),e.write(`let ${i};`);let s=!0,a=new Set;for(let l of n.options){let u=l._zod.propValues?.[n.discriminator];if(!u||u.size===0)throw new J("discriminated union option without static discriminator values");for(let g of u){if(a.has(g))throw new J(`duplicate discriminator value ${String(g)}`);a.add(g)}let p=Array.from(u,g=>dw(t,o,g)),m=s?"if":"else if";e.write(`${m} (${p.join(" || ")}) {`),e.indented(g=>{let d=re(g,t,l,r);g.write(`${i} = ${d};`)}),e.write("}"),s=!1}return e.write("else { return INVALID; }"),i}function dw(e,t,n){if(typeof n=="string")return`${t} === ${_e(n)}`;if(typeof n=="number")return Number.isNaN(n)?`Number.isNaN(${t})`:`${t} === ${n}`;if(typeof n=="boolean")return`${t} === ${n}`;if(n===null)return`${t} === null`;if(n===void 0)return`${t} === undefined`;if(typeof n=="bigint")return`${t} === ${n}n`;if(typeof n=="symbol"){let r=U(e,n);return`${t} === ${r}`}throw new J(`literal discriminator value ${String(n)}`)}function mw(e,t,n,r){let o=n._zod.def;t.definite=!1;let i=be(e,t,o.left,r),s=be(e,t,o.right,r),a=U(t,hn),l=D(t);return e.write(`const ${l} = ${a}(${i}, ${s});`),e.write(`if (!${l}.valid) return INVALID;`),`${l}.data`}function gw(e,t,n,r){let o=n._zod.def,i=U(t,Le);e.write(`if (!${i}(${r})) return INVALID;`);let s=D(t),a=D(t),l=D(t);e.write(`const ${s} = {};`);let u=o,p=u.partial?void 0:o.keyType._zod.values;if(p){let d=[];for(let y of p){if(!(typeof y=="string"||typeof y=="number"||typeof y=="symbol"))throw new J(`record key value ${String(y)}`);let w=typeof y=="number"?y.toString():y;if(w==="__proto__")throw new J('record key "__proto__"');d.push(w);let _=U(t,y),v=re(e,t,o.keyType,_),$=D(t);e.write(`const ${$} = ${r}[${hw(t,w)}];`);let z=be(e,t,o.valueType,$);e.write(`${s}[${v}] = ${z};`)}let h=U(t,new Set(d));return e.write(`for (const ${a} in ${r}) {`),e.indented(y=>{y.write(`if (${h}.has(${a})) continue;`),u.mode==="loose"?y.write(`if (${a} !== "__proto__") ${s}[${a}] = ${r}[${a}];`):y.write("return INVALID;")}),e.write("}"),s}let m=o.keyType._zod.def;if(!(m.type==="string"&&m.format===void 0&&!m.coerce&&(m.checks?.length??0)===0)){let d=o.mode==="loose",h=ni(o.keyType);h.definite===!1&&(t.definite=!1);let y=U(t,h),w=U(t,rt),_=D(t);return vd(e,t,r,a,v=>{v.write(`let ${_} = ${y}(${a});`),v.write(`if (${_} === INVALID && typeof ${a} === "string" && ${w}.test(${a})) ${_} = ${y}(Number(${a}));`),d?v.write(`if (${_} === INVALID) { ${s}[${a}] = ${r}[${a}]; continue; }`):v.write(`if (${_} === INVALID) return INVALID;`),v.write(`if (${_} === "__proto__") continue;`);let $=D(t);v.write(`const ${$} = ${r}[${a}];`);let z=be(v,t,o.valueType,$);v.write(`${s}[${_}] = ${z};`)}),s}return vd(e,t,r,a,d=>{d.write(`const ${l} = ${r}[${a}];`);let h=be(d,t,o.valueType,l);d.write(`${s}[${a}] = ${h};`)},"return INVALID;"),s}function vd(e,t,n,r,o,i){let s=U(t,Object.prototype.propertyIsEnumerable),a=D(t),l=D(t),u=D(t);e.write(`const ${a} = Object.getOwnPropertySymbols(${n});`),e.write(`const ${l} = Object.getOwnPropertyNames(${n});`),e.write(`for (let ${u} = 0; ${u} < ${l}.length; ${u}++) {`),e.indented(p=>{p.write(`const ${r} = ${l}[${u}];`),p.write(`if (${r} === "__proto__" || !${s}.call(${n}, ${r})) continue;`),o(p)}),e.write("}"),e.write(`for (let ${u} = 0; ${u} < ${a}.length; ${u}++) {`),e.indented(p=>{p.write(`const ${r} = ${a}[${u}];`),p.write(`if (!${s}.call(${n}, ${r})) continue;`),i?p.write(i):o(p)}),e.write("}")}function hw(e,t){return typeof t=="string"?_e(t):U(e,t)}function yw(e,t,n,r){let o=n._zod.def;e.write(`if (!(${r} instanceof Map)) return INVALID;`),yu(e,n,`${r}.size`);let i=D(t),s=D(t),a=D(t);return e.write(`const ${i} = new Map();`),e.write(`for (const [${s}, ${a}] of ${r}) {`),e.indented(l=>{let u=re(l,t,o.keyType,s),p=re(l,t,o.valueType,a);l.write(`${i}.set(${u}, ${p});`)}),e.write("}"),i}function bw(e,t,n,r){let o=n._zod.def;e.write(`if (!(${r} instanceof Set)) return INVALID;`),yu(e,n,`${r}.size`);let i=D(t),s=D(t);return e.write(`const ${i} = new Set();`),e.write(`for (const ${s} of ${r}) {`),e.indented(a=>{let l=re(a,t,o.valueType,s);a.write(`${i}.add(${l});`)}),e.write("}"),i}function ww(e,t){return e.write(`if (!(${t} instanceof File)) return INVALID;`),t}function vw(e,t,n,r){e.write(`if (typeof ${r} !== "string") return INVALID;`);let o=n._zod.pattern;if(o){let i=U(t,o);e.write(`${i}.lastIndex = 0;`),e.write(`if (!${i}.test(${r})) return INVALID;`)}return r}function kw(e,t,n,r){let o=n._zod.def,i=Rt(t,o.getter),s=U(t,{parser:null});e.write(`if (!${s}.parser) {`),e.indented(l=>{l.write(`const inner = ${i}();`),l.write(`${s}.parser = function(input) {`),l.indented(u=>{u.write("const result = inner._zod.run({ value: input, issues: [] }, {});"),u.write("return result.issues.length === 0 ? result.value : INVALID;")}),l.write("};")}),e.write("}");let a=D(t);return e.write(`const ${a} = ${s}.parser(${r});`),e.write(`if (${a} === INVALID) return INVALID;`),a}function _w(e,t,n,r){let o=n._zod.def,i=re(e,t,o.in,r);if(o.transform){if(Dt(o.transform))throw new Fe("z.compile: async transforms in pipes are not supported");let s=o.transform,l=Rt(t,p=>{let m={value:p,issues:[],addIssue:hu},g=s(p,m);return g instanceof Promise?xe:m.issues.length===0?g:xe}),u=D(t);return e.write(`const ${u} = ${l}(${i});`),e.write(`if (${u} === INVALID) return INVALID;`),re(e,t,o.out,u)}else return re(e,t,o.out,i)}function Dt(e){return typeof e=="function"&&(e.constructor.name==="AsyncFunction"||e[Symbol.toStringTag]==="AsyncFunction")}function $w(e,t,n,r){let o=n._zod.def;if(o.fn){if(Dt(o.fn))throw new Fe("z.compile: async custom predicates are not supported");let i=Rt(t,o.fn),s=U(t,du),a=D(t);e.write(`const ${a} = ${i}(${r});`),e.write(`if (${a} instanceof Promise) ${s}();`),e.write(`if (!${a}) return INVALID;`)}else throw new J("custom schema without a predicate function");return r}function xw(e,t,n){let r=e._zod.run({value:n,issues:[]},{});if(r&&typeof r.then=="function")return xe;let o=r;return o.issues.length===0?o.value:t()}function Sw(e,t,n,r){let o=n._zod.def;if(!o.catchValue[ao])throw new J("catch with a callback (only a constant catch value compiles)",!1);let i=D(t);e.write(`let ${i} = (() => {`),e.indented(u=>{let p=be(u,t,o.innerType,r);u.write(`return ${p};`)}),e.write("})();");let s=U(t,o.innerType),a=Rt(t,o.catchValue),l=U(t,xw);return e.write(`if (${i} === INVALID) {`),e.indented(u=>{u.write(`${i} = ${l}(${s}, ${a}, ${r});`),u.write(`if (${i} === INVALID) return INVALID;`)}),e.write("}"),i}function zw(e,t,n,r){let o=n._zod.def;if(o.transform){if(Dt(o.transform))throw new Fe("z.compile: async transforms are not supported");let i=o.transform,a=Rt(t,u=>{let p={value:u,issues:[],addIssue:hu},m=i(u,p);return m instanceof Promise?xe:p.issues.length===0?m:xe}),l=D(t);return e.write(`const ${l} = ${a}(${r});`),e.write(`if (${l} === INVALID) return INVALID;`),l}return r}var xe,hd,Fe,J,Nb,Fb,xd=K(()=>{pt();Io();lu();Nt();yn();le();xe=Symbol.for("zod.compile.invalid"),hd=Symbol.for("zod.compile.fallback"),Fe=class extends Error{constructor(t="z.compile does not support async refinements, transforms, or checks"){super(t),this.name="ZodCompileAsyncError"}},J=class extends Error{constructor(t,n=!0){super(`z.compile does not support ${t}; this schema must use the runtime parser`),this.name="ZodCompileUnsupportedError",this.islandable=n}};Nb=new Set(["max_size","min_size","size_equals","max_length","min_length","length_equals"]);Fb=new Set(["cidrv4","cuid","cuid2","date","datetime","duration","e164","email","emoji","ends_with","guid","includes","ipv4","ksuid","lowercase","mac","nanoid","regex","starts_with","time","ulid","uppercase","uuid","xid"])});function ri(e){return e.checks&&(e.checks=[...e.checks]),e}function bu(e,t){return new e(ri({type:"string",...C(t)}))}function wu(e,t){return new e(ri({type:"string",coerce:!0,...C(t)}))}function oi(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...C(t)})}function ii(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...C(t)})}function si(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...C(t)})}function ai(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...C(t)})}function li(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...C(t)})}function ui(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...C(t)})}function Ir(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...C(t)})}function ci(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...C(t)})}function fi(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...C(t)})}function pi(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...C(t)})}function di(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...C(t)})}function mi(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...C(t)})}function gi(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...C(t)})}function hi(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...C(t)})}function yi(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...C(t)})}function bi(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...C(t)})}function vu(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...C(t)})}function wi(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...C(t)})}function vi(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...C(t)})}function ki(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...C(t)})}function _i(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...C(t)})}function $i(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...C(t)})}function ku(e,t){return new e({type:"string",format:"credit_card",check:"string_format",abort:!1,...C(t)})}function _u(e,t){return new e({type:"string",format:"iban",check:"string_format",abort:!1,...C(t)})}function xi(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...C(t)})}function Pr(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...C(t)})}function Cr(e,t){return new e({type:"string",format:"date",check:"string_format",...C(t)})}function Ar(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...C(t)})}function Or(e,t){return new e({type:"string",format:"duration",check:"string_format",...C(t)})}function xu(e,t){return new e(ri({type:"number",checks:[],...C(t)}))}function Su(e,t){return new e(ri({type:"number",coerce:!0,checks:[],...C(t)}))}function zu(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...C(t)})}function Iu(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...C(t)})}function Pu(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...C(t)})}function Cu(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...C(t)})}function Au(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...C(t)})}function Ou(e,t){return new e({type:"boolean",...C(t)})}function Nu(e,t){return new e({type:"boolean",coerce:!0,...C(t)})}function Eu(e,t){return new e({type:"bigint",...C(t)})}function Zu(e,t){return new e({type:"bigint",coerce:!0,...C(t)})}function Tu(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...C(t)})}function Ru(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...C(t)})}function Du(e,t){return new e({type:"symbol",...C(t)})}function Lu(e,t){return new e({type:"undefined",...C(t)})}function ju(e,t){return new e({type:"null",...C(t)})}function Mu(e){return new e({type:"any"})}function Uu(e){return new e({type:"unknown"})}function Vu(e,t){return new e({type:"never",...C(t)})}function Fu(e,t){return new e({type:"void",...C(t)})}function Bu(e,t){return new e({type:"date",...C(t)})}function Hu(e,t){return new e({type:"date",coerce:!0,...C(t)})}function Wu(e,t){return new e({type:"nan",...C(t)})}function Je(e,t){return new xo({check:"less_than",...C(t),value:e,inclusive:!1})}function Ze(e,t){return new xo({check:"less_than",...C(t),value:e,inclusive:!0})}function Ke(e,t){return new So({check:"greater_than",...C(t),value:e,inclusive:!1})}function Te(e,t){return new So({check:"greater_than",...C(t),value:e,inclusive:!0})}function Si(e){return Ke(0,e)}function zi(e){return Je(0,e)}function Ii(e){return Ze(0,e)}function Pi(e){return Te(0,e)}function gt(e,t){return new Sa({check:"multiple_of",...C(t),value:e})}function ht(e,t){return new Pa({check:"max_size",...C(t),maximum:e})}function Ge(e,t){return new Ca({check:"min_size",...C(t),minimum:e})}function Lt(e,t){return new Aa({check:"size_equals",...C(t),size:e})}function jt(e,t){return new Oa({check:"max_length",...C(t),maximum:e})}function ot(e,t){return new Na({check:"min_length",...C(t),minimum:e})}function Mt(e,t){return new Ea({check:"length_equals",...C(t),length:e})}function vn(e,t){return new Za({check:"string_format",format:"regex",...C(t),pattern:e})}function kn(e){return new Ta({check:"string_format",format:"lowercase",...C(e)})}function _n(e){return new Ra({check:"string_format",format:"uppercase",...C(e)})}function $n(e,t){return new Da({check:"string_format",format:"includes",...C(t),includes:e})}function xn(e,t){return new La({check:"string_format",format:"starts_with",...C(t),prefix:e})}function Sn(e,t){return new ja({check:"string_format",format:"ends_with",...C(t),suffix:e})}function Ci(e,t,n){return new Ma({check:"property",property:e,schema:t,...C(n)})}function zn(e,t){return new Ua({check:"properties",shape:e,...C(t)})}function In(e,t){return new Va({check:"mime_type",mime:e,...C(t)})}function Be(e){return new Fa({check:"overwrite",tx:e})}function Pn(e){return Be(t=>t.normalize(e))}function Cn(){return Be(e=>e.trim())}function An(){return Be(e=>e.toLowerCase())}function On(){return Be(e=>e.toUpperCase())}function Nn(){return Be(e=>xs(e))}function Ju(e,t,n){return new e({type:"array",element:t,...C(n)})}function Iw(e,t,n){return new e({type:"union",options:t,...C(n)})}function Pw(e,t,n){return new e({type:"union",options:t,inclusive:!1,...C(n)})}function Cw(e,t,n,r){return new e({type:"union",options:n,discriminator:t,...C(r)})}function Aw(e,t,n){return new e({type:"intersection",left:t,right:n})}function Ow(e,t,n,r){let o=n instanceof F,i=o?r:n,s=o?n:null;return new e({type:"tuple",items:t,rest:s,...C(i)})}function Nw(e,t,n,r){return new e({type:"record",keyType:t,valueType:n,...C(r)})}function Ew(e,t,n,r){return new e({type:"map",keyType:t,valueType:n,...C(r)})}function Zw(e,t,n){return new e({type:"set",valueType:t,...C(n)})}function Tw(e,t,n){let r=Array.isArray(t)?Object.fromEntries(t.map(o=>[o,o])):t;return new e({type:"enum",entries:r,...C(n)})}function Rw(e,t,n){return new e({type:"enum",entries:t,...C(n)})}function Dw(e,t,n){return new e({type:"literal",values:Array.isArray(t)?t:[t],...C(n)})}function Ku(e,t){return new e({type:"file",...C(t)})}function Lw(e,t){return new e({type:"transform",transform:t})}function jw(e,t){return new e({type:"optional",innerType:t})}function Mw(e,t){return new e({type:"nullable",innerType:t})}function Uw(e,t,n){return new e({type:"default",innerType:t,get defaultValue(){return typeof n=="function"?n():Yn(n)}})}function Vw(e,t,n){return new e({type:"nonoptional",innerType:t,...C(n)})}function Fw(e,t){return new e({type:"success",innerType:t})}function Bw(e,t,n){return new e({type:"catch",innerType:t,catchValue:typeof n=="function"?n:Os(n)})}function Hw(e,t,n){return new e({type:"pipe",in:t,out:n})}function Ww(e,t){return new e({type:"readonly",innerType:t})}function Jw(e,t,n){return new e({type:"template_literal",parts:t,...C(n)})}function Kw(e,t){return new e({type:"lazy",getter:t})}function Gw(e,t){return new e({type:"promise",innerType:t})}function Gu(e,t,n){let r=C(n);return r.abort??(r.abort=!0),new e({type:"custom",check:"custom",fn:t,...r})}function qu(e,t,n){return new e({type:"custom",check:"custom",fn:t,...C(n)})}function Yu(e,t){let n=Sd(r=>(r.addIssue=o=>{if(typeof o=="string")r.issues.push(cn(o,r.value,n._zod.def));else{let i=o;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),"input"in i||(i.input=r.value),i.inst??(i.inst=n),i.continue??(i.continue=!n._zod.def.abort),r.issues.push(cn(i))}},e(r.value,r)),t);return n}function Sd(e,t){let n=new ee({check:"custom",...C(t)});return n._zod.check=e,n}function Xu(e){let t=new ee({check:"describe"});return t._zod.onattach=[n=>{let r=he.get(n)??{};he.add(n,{...r,description:e})}],t._zod.check=()=>{},t}function Qu(e){let t=new ee({check:"meta"});return t._zod.onattach=[n=>{let r=he.get(n)??{};he.add(n,{...r,...e})}],t._zod.check=()=>{},t}function ec(e,t){let n=C(t),r=n.truthy??["true","1","yes","on","y","enabled"],o=n.falsy??["false","0","no","off","n","disabled"];n.case!=="sensitive"&&(r=r.map(d=>typeof d=="string"?d.toLowerCase():d),o=o.map(d=>typeof d=="string"?d.toLowerCase():d));let i=new Set(r),s=new Set(o),a=e.Codec??vr,l=e.Boolean??br,u=e.String??Zt,p=new u({type:"string",error:n.error}),m=new l({type:"boolean",error:n.error}),g=new a({type:"pipe",in:p,out:m,transform:((d,h)=>{let y=d;return n.case!=="sensitive"&&(y=y.toLowerCase()),i.has(y)?!0:s.has(y)?!1:(h.issues.push({code:"invalid_value",expected:"stringbool",values:[...i,...s],input:h.value,inst:g,continue:!1}),{})}),reverseTransform:((d,h)=>d===!0?r[0]||"true":o[0]||"false"),error:n.error});return g._zod.bag.truthy=r,g._zod.bag.falsy=o,g._zod.bag.case=n.case??"insensitive",g}function Ut(e,t,n,r={}){let o=C(r),i={check:"string_format",type:"string",format:t,fn:typeof n=="function"?n:a=>n.test(a),...o};return n instanceof RegExp&&(i.pattern=n),new e(i)}var $u,zd=K(()=>{zo();zr();yn();le();$u={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6}});function Nr(e,...t){for(let n of t)for(let r of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,r)&&ge(e,r,n[r]);return e}function yt(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??he,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??"ref",reused:e?.reused??"inline",intersections:[],deferred:[],external:e?.external??void 0}}function pe(e,t,n,r,o){let i=typeof t.unrepresentable=="function"?t.unrepresentable({zodSchema:e,path:r.path,message:o}):t.unrepresentable;if(i==="any")return!1;if(i===void 0||i==="throw")throw new Error(o);return Object.assign(n,i),!0}function X(e,t,n={path:[],schemaPath:[]}){var r;let o=e._zod.def,i=t.seen.get(e);if(i)return i.count++,n.schemaPath.includes(e)&&(i.cycle=n.path),i.schema;let s={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,s),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let a=e._zod.toJSONSchema?.();if(a)s.schema=a;else{let p={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,p);else{let g=s.schema,d=t.processors[o.type];if(!d)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);d(e,t,g,p)}let m=e._zod.parent;m&&(s.ref||(s.ref=m),X(m,t,p),t.seen.get(m).isParent=!0)}let l=t.metadataRegistry.get(e);return l&&Nr(s.schema,l),t.io==="input"&&Se(e)&&(delete s.schema.examples,delete s.schema.default),t.io==="input"&&"_prefault"in s.schema&&((r=s.schema).default??(r.default=s.schema._prefault)),delete s.schema._prefault,t.seen.get(e).schema}function Id(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function bt(e,t){let n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=new Map;for(let s of e.seen.entries()){let a=e.metadataRegistry.get(s[0])?.id;if(a){let l=r.get(a);if(l&&l!==s[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(a,s[0])}}let o=s=>{let a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let m=e.external.registry.get(s[0])?.id,g=e.external.uri??(h=>h);if(m)return{ref:g(m)};let d=s[1].defId??s[1].schema.id??`schema${e.counter++}`;return s[1].defId=d,{defId:d,ref:`${g("__shared")}#/${a}/${Id(d)}`}}let l="#",u=`${l}/${a}/`;if(s[1]===n&&!s[1].schema.id)return{ref:l};let p=s[1].schema.id??`__schema${e.counter++}`;return{defId:p,ref:u+Id(p)}},i=s=>{if(s[1].schema.$ref)return;let a=s[1],{ref:l,defId:u}=o(s);a.def={...a.schema},u&&(a.defId=u);let p=a.schema;for(let m in p)delete p[m];p.$ref=l};if(e.cycles==="throw")for(let s of e.seen.entries()){let a=s[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
71
68
 
72
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let s of e.seen.entries()){let c=s[1];if(t===s[0]){i(s);continue}if(e.external){let d=e.external.registry.get(s[0])?.id;if(t!==s[0]&&d){i(s);continue}}if(e.metadataRegistry.get(s[0])?.id){i(s);continue}if(c.cycle){i(s);continue}if(c.count>1&&e.reused==="ref"){i(s);continue}}}function et(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let n=c=>{let u=e.seen.get(c);if(u.ref===null)return;let d=u.def??u.schema,m={...d},h=u.ref;if(u.ref=null,h){n(h);let p=e.seen.get(h),x=p.schema;if(x.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(d.allOf=d.allOf??[],d.allOf.push(x)):Object.assign(d,x),Object.assign(d,m),c._zod.parent===h)for(let y in d)y==="$ref"||y==="allOf"||y in m||delete d[y];if(x.$ref&&p.def)for(let y in d)y==="$ref"||y==="allOf"||y in p.def&&JSON.stringify(d[y])===JSON.stringify(p.def[y])&&delete d[y]}let b=c._zod.parent;if(b&&b!==h){n(b);let p=e.seen.get(b);if(p?.schema.$ref&&(d.$ref=p.schema.$ref,p.def))for(let x in d)x==="$ref"||x==="allOf"||x in p.def&&JSON.stringify(d[x])===JSON.stringify(p.def[x])&&delete d[x]}e.override({zodSchema:c,jsonSchema:d,path:u.path??[]})};for(let c of[...e.seen.entries()].reverse())n(c[0]);let o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let c=e.external.registry.get(t)?.id;if(!c)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(c)}Object.assign(o,r.def??r.schema);let i=e.metadataRegistry.get(t)?.id;i!==void 0&&o.id===i&&delete o.id;let s=e.external?.defs??{};for(let c of e.seen.entries()){let u=c[1];u.def&&u.defId&&(u.def.id===u.defId&&delete u.def.id,s[u.defId]=u.def)}e.external||Object.keys(s).length>0&&(e.target==="draft-2020-12"?o.$defs=s:o.definitions=s);try{let c=JSON.parse(JSON.stringify(o));return Object.defineProperty(c,"~standard",{value:{...t["~standard"],jsonSchema:{input:Bt(t,"input",e.processors),output:Bt(t,"output",e.processors)}},enumerable:!1,writable:!1}),c}catch{throw new Error("Error converting schema to JSON.")}}function fe(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let n=e._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return fe(n.element,r);if(n.type==="set")return fe(n.valueType,r);if(n.type==="lazy")return fe(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return fe(n.innerType,r);if(n.type==="intersection")return fe(n.left,r)||fe(n.right,r);if(n.type==="record"||n.type==="map")return fe(n.keyType,r)||fe(n.valueType,r);if(n.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:fe(n.in,r)||fe(n.out,r);if(n.type==="object"){for(let o in n.shape)if(fe(n.shape[o],r))return!0;return!1}if(n.type==="union"){for(let o of n.options)if(fe(o,r))return!0;return!1}if(n.type==="tuple"){for(let o of n.items)if(fe(o,r))return!0;return!!(n.rest&&fe(n.rest,r))}return!1}var ol,Bt,zr=J(()=>{wr();ol=(e,t={})=>r=>{let n=Xe({...r,processors:t});return V(e,n),Qe(n,e),et(n,e)},Bt=(e,t,r={})=>n=>{let{libraryOptions:o,target:i}=n??{},s=Xe({...o??{},target:i,io:t,processors:r});return V(e,s),Qe(s,e),et(s,e)}});function Xn(e,t){if("_idmap"in e){let n=e,o=Xe({...t,processors:Gn}),i={};for(let u of n._idmap.entries()){let[d,m]=u;V(m,o)}let s={},c={registry:n,uri:t?.uri,defs:i};o.external=c;for(let u of n._idmap.entries()){let[d,m]=u;Qe(o,m),s[d]=et(o,m)}if(Object.keys(i).length>0){let u=o.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[u]:i}}return{schemas:s}}let r=Xe({...t,processors:Gn});return V(e,r),Qe(r,e),et(r,e)}var zg,il,sl,al,ll,cl,ul,dl,pl,fl,ml,gl,hl,yl,bl,vl,xl,wl,_l,kl,zl,Sl,$l,Pl,Zl,Il,Kn,El,Cl,Tl,Ol,Rl,Al,Nl,jl,Dl,Ml,Ul,Yn,Ll,Gn,Sr=J(()=>{zr();Se();zg={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},il=(e,t,r,n)=>{let o=r;o.type="string";let{minimum:i,maximum:s,format:c,patterns:u,contentEncoding:d}=e._zod.bag;if(typeof i=="number"&&(o.minLength=i),typeof s=="number"&&(o.maxLength=s),c&&(o.format=zg[c]??c,o.format===""&&delete o.format,c==="time"&&delete o.format),d&&(o.contentEncoding=d),u&&u.size>0){let m=[...u];m.length===1?o.pattern=m[0].source:m.length>1&&(o.allOf=[...m.map(h=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:h.source}))])}},sl=(e,t,r,n)=>{let o=r,{minimum:i,maximum:s,format:c,multipleOf:u,exclusiveMaximum:d,exclusiveMinimum:m}=e._zod.bag;typeof c=="string"&&c.includes("int")?o.type="integer":o.type="number";let h=typeof m=="number"&&m>=(i??Number.NEGATIVE_INFINITY),b=typeof d=="number"&&d<=(s??Number.POSITIVE_INFINITY),p=t.target==="draft-04"||t.target==="openapi-3.0";h?p?(o.minimum=m,o.exclusiveMinimum=!0):o.exclusiveMinimum=m:typeof i=="number"&&(o.minimum=i),b?p?(o.maximum=d,o.exclusiveMaximum=!0):o.exclusiveMaximum=d:typeof s=="number"&&(o.maximum=s),typeof u=="number"&&(o.multipleOf=u)},al=(e,t,r,n)=>{r.type="boolean"},ll=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},cl=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},ul=(e,t,r,n)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},dl=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},pl=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},fl=(e,t,r,n)=>{r.not={}},ml=(e,t,r,n)=>{},gl=(e,t,r,n)=>{},hl=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},yl=(e,t,r,n)=>{let o=e._zod.def,i=sr(o.entries);i.every(s=>typeof s=="number")&&(r.type="number"),i.every(s=>typeof s=="string")&&(r.type="string"),r.enum=i},bl=(e,t,r,n)=>{let o=e._zod.def,i=[];for(let s of o.values)if(s===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof s=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");i.push(Number(s))}else i.push(s);if(i.length!==0)if(i.length===1){let s=i[0];r.type=s===null?"null":typeof s,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[s]:r.const=s}else i.every(s=>typeof s=="number")&&(r.type="number"),i.every(s=>typeof s=="string")&&(r.type="string"),i.every(s=>typeof s=="boolean")&&(r.type="boolean"),i.every(s=>s===null)&&(r.type="null"),r.enum=i},vl=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},xl=(e,t,r,n)=>{let o=r,i=e._zod.pattern;if(!i)throw new Error("Pattern not found in template literal");o.type="string",o.pattern=i.source},wl=(e,t,r,n)=>{let o=r,i={type:"string",format:"binary",contentEncoding:"binary"},{minimum:s,maximum:c,mime:u}=e._zod.bag;s!==void 0&&(i.minLength=s),c!==void 0&&(i.maxLength=c),u?u.length===1?(i.contentMediaType=u[0],Object.assign(o,i)):(Object.assign(o,i),o.anyOf=u.map(d=>({contentMediaType:d}))):Object.assign(o,i)},_l=(e,t,r,n)=>{r.type="boolean"},kl=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},zl=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},Sl=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},$l=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},Pl=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},Zl=(e,t,r,n)=>{let o=r,i=e._zod.def,{minimum:s,maximum:c}=e._zod.bag;typeof s=="number"&&(o.minItems=s),typeof c=="number"&&(o.maxItems=c),o.type="array",o.items=V(i.element,t,{...n,path:[...n.path,"items"]})},Il=(e,t,r,n)=>{let o=r,i=e._zod.def;o.type="object",o.properties={};let s=i.shape;for(let d in s)o.properties[d]=V(s[d],t,{...n,path:[...n.path,"properties",d]});let c=new Set(Object.keys(s)),u=new Set([...c].filter(d=>{let m=i.shape[d]._zod;return t.io==="input"?m.optin===void 0:m.optout===void 0}));u.size>0&&(o.required=Array.from(u)),i.catchall?._zod.def.type==="never"?o.additionalProperties=!1:i.catchall?i.catchall&&(o.additionalProperties=V(i.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},Kn=(e,t,r,n)=>{let o=e._zod.def,i=o.inclusive===!1,s=o.options.map((c,u)=>V(c,t,{...n,path:[...n.path,i?"oneOf":"anyOf",u]}));i?r.oneOf=s:r.anyOf=s},El=(e,t,r,n)=>{let o=e._zod.def,i=V(o.left,t,{...n,path:[...n.path,"allOf",0]}),s=V(o.right,t,{...n,path:[...n.path,"allOf",1]}),c=d=>"allOf"in d&&Object.keys(d).length===1,u=[...c(i)?i.allOf:[i],...c(s)?s.allOf:[s]];r.allOf=u},Cl=(e,t,r,n)=>{let o=r,i=e._zod.def;o.type="array";let s=t.target==="draft-2020-12"?"prefixItems":"items",c=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",u=i.items.map((b,p)=>V(b,t,{...n,path:[...n.path,s,p]})),d=i.rest?V(i.rest,t,{...n,path:[...n.path,c,...t.target==="openapi-3.0"?[i.items.length]:[]]}):null;t.target==="draft-2020-12"?(o.prefixItems=u,d&&(o.items=d)):t.target==="openapi-3.0"?(o.items={anyOf:u},d&&o.items.anyOf.push(d),o.minItems=u.length,d||(o.maxItems=u.length)):(o.items=u,d&&(o.additionalItems=d));let{minimum:m,maximum:h}=e._zod.bag;typeof m=="number"&&(o.minItems=m),typeof h=="number"&&(o.maxItems=h)},Tl=(e,t,r,n)=>{let o=r,i=e._zod.def;o.type="object";let s=i.keyType,u=s._zod.bag?.patterns;if(i.mode==="loose"&&u&&u.size>0){let m=V(i.valueType,t,{...n,path:[...n.path,"patternProperties","*"]});o.patternProperties={};for(let h of u)o.patternProperties[h.source]=m}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(o.propertyNames=V(i.keyType,t,{...n,path:[...n.path,"propertyNames"]})),o.additionalProperties=V(i.valueType,t,{...n,path:[...n.path,"additionalProperties"]});let d=s._zod.values;if(d){let m=[...d].filter(h=>typeof h=="string"||typeof h=="number");m.length>0&&(o.required=m)}},Ol=(e,t,r,n)=>{let o=e._zod.def,i=V(o.innerType,t,n),s=t.seen.get(e);t.target==="openapi-3.0"?(s.ref=o.innerType,r.nullable=!0):r.anyOf=[i,{type:"null"}]},Rl=(e,t,r,n)=>{let o=e._zod.def;V(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType},Al=(e,t,r,n)=>{let o=e._zod.def;V(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType,r.default=JSON.parse(JSON.stringify(o.defaultValue))},Nl=(e,t,r,n)=>{let o=e._zod.def;V(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType,t.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},jl=(e,t,r,n)=>{let o=e._zod.def;V(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType;let s;try{s=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=s},Dl=(e,t,r,n)=>{let o=e._zod.def,i=o.in._zod.traits.has("$ZodTransform"),s=t.io==="input"?i?o.out:o.in:o.out;V(s,t,n);let c=t.seen.get(e);c.ref=s},Ml=(e,t,r,n)=>{let o=e._zod.def;V(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType,r.readOnly=!0},Ul=(e,t,r,n)=>{let o=e._zod.def;V(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType},Yn=(e,t,r,n)=>{let o=e._zod.def;V(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType},Ll=(e,t,r,n)=>{let o=e._zod.innerType;V(o,t,n);let i=t.seen.get(e);i.ref=o},Gn={string:il,number:sl,boolean:al,bigint:ll,symbol:cl,null:ul,undefined:dl,void:pl,never:fl,any:ml,unknown:gl,date:hl,enum:yl,literal:bl,nan:vl,template_literal:xl,file:wl,success:_l,custom:kl,function:zl,transform:Sl,map:$l,set:Pl,array:Zl,object:Il,union:Kn,intersection:El,tuple:Cl,record:Tl,nullable:Ol,nonoptional:Rl,default:Al,prefault:Nl,catch:jl,pipe:Dl,readonly:Ml,promise:Ul,optional:Yn,lazy:Ll}});var Qn,od=J(()=>{Sr();zr();Qn=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(t){this.ctx.counter=t}get seen(){return this.ctx.seen}constructor(t){let r=t?.target??"draft-2020-12";r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),this.ctx=Xe({processors:Gn,target:r,...t?.metadata&&{metadata:t.metadata},...t?.unrepresentable&&{unrepresentable:t.unrepresentable},...t?.override&&{override:t.override},...t?.io&&{io:t.io}})}process(t,r={path:[],schemaPath:[]}){return V(t,this.ctx,r)}emit(t,r){r&&(r.cycles&&(this.ctx.cycles=r.cycles),r.reused&&(this.ctx.reused=r.reused),r.external&&(this.ctx.external=r.external)),Qe(this.ctx,t);let n=et(this.ctx,t),{"~standard":o,...i}=n;return i}}});var id={};var sd=J(()=>{});var Le={};Pe(Le,{$ZodAny:()=>js,$ZodArray:()=>Fs,$ZodAsyncError:()=>Ze,$ZodBase64:()=>Ps,$ZodBase64URL:()=>Zs,$ZodBigInt:()=>bn,$ZodBigIntFormat:()=>Os,$ZodBoolean:()=>yr,$ZodCIDRv4:()=>zs,$ZodCIDRv6:()=>Ss,$ZodCUID:()=>ps,$ZodCUID2:()=>fs,$ZodCatch:()=>sa,$ZodCheck:()=>K,$ZodCheckBigIntFormat:()=>Ui,$ZodCheckEndsWith:()=>Xi,$ZodCheckGreaterThan:()=>dn,$ZodCheckIncludes:()=>Ki,$ZodCheckLengthEquals:()=>Vi,$ZodCheckLessThan:()=>un,$ZodCheckLowerCase:()=>qi,$ZodCheckMaxLength:()=>Bi,$ZodCheckMaxSize:()=>Li,$ZodCheckMimeType:()=>es,$ZodCheckMinLength:()=>Wi,$ZodCheckMinSize:()=>Fi,$ZodCheckMultipleOf:()=>Di,$ZodCheckNumberFormat:()=>Mi,$ZodCheckOverwrite:()=>ts,$ZodCheckProperty:()=>Qi,$ZodCheckRegex:()=>Ji,$ZodCheckSizeEquals:()=>Hi,$ZodCheckStartsWith:()=>Yi,$ZodCheckStringFormat:()=>Et,$ZodCheckUpperCase:()=>Gi,$ZodCodec:()=>vr,$ZodCustom:()=>ma,$ZodCustomStringFormat:()=>Cs,$ZodDate:()=>Ls,$ZodDefault:()=>ra,$ZodDiscriminatedUnion:()=>Ws,$ZodE164:()=>Is,$ZodEmail:()=>ls,$ZodEmoji:()=>us,$ZodEncodeError:()=>We,$ZodEnum:()=>Ks,$ZodError:()=>dr,$ZodExactOptional:()=>ea,$ZodFile:()=>Xs,$ZodFunction:()=>da,$ZodGUID:()=>ss,$ZodIPv4:()=>ws,$ZodIPv6:()=>_s,$ZodISODate:()=>bs,$ZodISODateTime:()=>ys,$ZodISODuration:()=>xs,$ZodISOTime:()=>vs,$ZodIntersection:()=>Vs,$ZodJWT:()=>Es,$ZodKSUID:()=>hs,$ZodLazy:()=>fa,$ZodLiteral:()=>Ys,$ZodMAC:()=>ks,$ZodMap:()=>qs,$ZodNaN:()=>aa,$ZodNanoID:()=>ds,$ZodNever:()=>Ms,$ZodNonOptional:()=>oa,$ZodNull:()=>Ns,$ZodNullable:()=>ta,$ZodNumber:()=>yn,$ZodNumberFormat:()=>Ts,$ZodObject:()=>ed,$ZodObjectJIT:()=>Hs,$ZodOptional:()=>xn,$ZodPipe:()=>wn,$ZodPrefault:()=>na,$ZodPreprocess:()=>la,$ZodPromise:()=>pa,$ZodReadonly:()=>ca,$ZodRealError:()=>he,$ZodRecord:()=>Js,$ZodRegistry:()=>_n,$ZodSet:()=>Gs,$ZodString:()=>ct,$ZodStringFormat:()=>q,$ZodSuccess:()=>ia,$ZodSymbol:()=>Rs,$ZodTemplateLiteral:()=>ua,$ZodTransform:()=>Qs,$ZodTuple:()=>vn,$ZodType:()=>M,$ZodULID:()=>ms,$ZodURL:()=>cs,$ZodUUID:()=>as,$ZodUndefined:()=>As,$ZodUnion:()=>br,$ZodUnknown:()=>Ds,$ZodVoid:()=>Us,$ZodXID:()=>gs,$ZodXor:()=>Bs,$brand:()=>Bo,$constructor:()=>f,$input:()=>ba,$output:()=>ya,Doc:()=>hr,JSONSchema:()=>id,JSONSchemaGenerator:()=>Qn,NEVER:()=>Ho,TimePrecision:()=>_a,_any:()=>Ha,_array:()=>Ka,_base64:()=>Un,_base64url:()=>Ln,_bigint:()=>Na,_boolean:()=>Ra,_catch:()=>bg,_check:()=>rd,_cidrv4:()=>Dn,_cidrv6:()=>Mn,_coercedBigint:()=>ja,_coercedBoolean:()=>Aa,_coercedDate:()=>qa,_coercedNumber:()=>Za,_coercedString:()=>xa,_cuid:()=>Cn,_cuid2:()=>Tn,_custom:()=>Xa,_date:()=>Ja,_decode:()=>Qr,_decodeAsync:()=>tn,_default:()=>gg,_discriminatedUnion:()=>ng,_e164:()=>Fn,_email:()=>zn,_emoji:()=>In,_encode:()=>Xr,_encodeAsync:()=>en,_endsWith:()=>Nt,_enum:()=>cg,_file:()=>Ya,_float32:()=>Ea,_float64:()=>Ca,_gt:()=>Te,_gte:()=>pe,_guid:()=>_r,_includes:()=>Rt,_int:()=>Ia,_int32:()=>Ta,_int64:()=>Da,_intersection:()=>og,_ipv4:()=>Nn,_ipv6:()=>jn,_isoDate:()=>za,_isoDateTime:()=>ka,_isoDuration:()=>$a,_isoTime:()=>Sa,_jwt:()=>Hn,_ksuid:()=>An,_lazy:()=>_g,_length:()=>pt,_literal:()=>dg,_lowercase:()=>Tt,_lt:()=>Ce,_lte:()=>we,_mac:()=>wa,_map:()=>ag,_max:()=>we,_maxLength:()=>dt,_maxSize:()=>Ye,_mime:()=>jt,_min:()=>pe,_minLength:()=>Ue,_minSize:()=>Oe,_multipleOf:()=>Ke,_nan:()=>Ga,_nanoid:()=>En,_nativeEnum:()=>ug,_negative:()=>Wn,_never:()=>Wa,_nonnegative:()=>Jn,_nonoptional:()=>hg,_nonpositive:()=>Vn,_normalize:()=>Dt,_null:()=>Fa,_nullable:()=>mg,_number:()=>Pa,_optional:()=>fg,_overwrite:()=>Ie,_parse:()=>$t,_parseAsync:()=>Pt,_pipe:()=>vg,_positive:()=>Bn,_promise:()=>kg,_property:()=>qn,_readonly:()=>xg,_record:()=>sg,_refine:()=>Qa,_regex:()=>Ct,_safeDecode:()=>nn,_safeDecodeAsync:()=>sn,_safeEncode:()=>rn,_safeEncodeAsync:()=>on,_safeParse:()=>Zt,_safeParseAsync:()=>It,_set:()=>lg,_size:()=>ut,_slugify:()=>Ft,_startsWith:()=>At,_string:()=>va,_stringFormat:()=>Ht,_stringbool:()=>nl,_success:()=>yg,_superRefine:()=>el,_symbol:()=>Ua,_templateLiteral:()=>wg,_toLowerCase:()=>Ut,_toUpperCase:()=>Lt,_transform:()=>pg,_trim:()=>Mt,_tuple:()=>ig,_uint32:()=>Oa,_uint64:()=>Ma,_ulid:()=>On,_undefined:()=>La,_union:()=>tg,_unknown:()=>Ba,_uppercase:()=>Ot,_url:()=>kr,_uuid:()=>Sn,_uuidv4:()=>$n,_uuidv6:()=>Pn,_uuidv7:()=>Zn,_void:()=>Va,_xid:()=>Rn,_xor:()=>rg,clone:()=>ue,config:()=>te,createStandardJSONSchemaMethod:()=>Bt,createToJSONSchemaMethod:()=>ol,decode:()=>bm,decodeAsync:()=>xm,describe:()=>tl,encode:()=>ym,encodeAsync:()=>vm,extractDefs:()=>Qe,finalize:()=>et,flattenError:()=>pr,formatError:()=>fr,globalConfig:()=>it,globalRegistry:()=>se,initializeContext:()=>Xe,isValidBase64:()=>$s,isValidBase64URL:()=>Ku,isValidJWT:()=>Yu,locales:()=>xr,meta:()=>rl,parse:()=>Kr,parseAsync:()=>Yr,prettifyError:()=>oi,process:()=>V,regexes:()=>xe,registry:()=>kn,safeDecode:()=>_m,safeDecodeAsync:()=>zm,safeEncode:()=>wm,safeEncodeAsync:()=>km,safeParse:()=>si,safeParseAsync:()=>ai,toDotPath:()=>Iu,toJSONSchema:()=>Xn,treeifyError:()=>ni,util:()=>j,version:()=>ns});var _e=J(()=>{st();li();ii();ga();pn();os();Se();cn();ha();wr();rs();nd();zr();Sr();od();sd()});var eo={};Pe(eo,{endsWith:()=>Nt,gt:()=>Te,gte:()=>pe,includes:()=>Rt,length:()=>pt,lowercase:()=>Tt,lt:()=>Ce,lte:()=>we,maxLength:()=>dt,maxSize:()=>Ye,mime:()=>jt,minLength:()=>Ue,minSize:()=>Oe,multipleOf:()=>Ke,negative:()=>Wn,nonnegative:()=>Jn,nonpositive:()=>Vn,normalize:()=>Dt,overwrite:()=>Ie,positive:()=>Bn,property:()=>qn,regex:()=>Ct,size:()=>ut,slugify:()=>Ft,startsWith:()=>At,toLowerCase:()=>Ut,toUpperCase:()=>Lt,trim:()=>Mt,uppercase:()=>Ot});var to=J(()=>{_e()});var Wt={};Pe(Wt,{ZodISODate:()=>no,ZodISODateTime:()=>ro,ZodISODuration:()=>io,ZodISOTime:()=>oo,date:()=>Hl,datetime:()=>Fl,duration:()=>Wl,time:()=>Bl});function Fl(e){return ka(ro,e)}function Hl(e){return za(no,e)}function Bl(e){return Sa(oo,e)}function Wl(e){return $a(io,e)}var ro,no,oo,io,$r=J(()=>{_e();Zr();ro=f("ZodISODateTime",(e,t)=>{ys.init(e,t),G.init(e,t)});no=f("ZodISODate",(e,t)=>{bs.init(e,t),G.init(e,t)});oo=f("ZodISOTime",(e,t)=>{vs.init(e,t),G.init(e,t)});io=f("ZodISODuration",(e,t)=>{xs.init(e,t),G.init(e,t)})});var ad,$g,ye,Vl=J(()=>{_e();_e();Se();ad=(e,t)=>{dr.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>fr(e,r)},flatten:{value:r=>pr(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,kt,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,kt,2)}},isEmpty:{get(){return e.issues.length===0}}})},$g=f("ZodError",ad),ye=f("ZodError",ad,{Parent:Error})});var Jl,ql,Gl,Kl,Yl,Xl,Ql,ec,tc,rc,nc,oc,ic=J(()=>{_e();Vl();Jl=$t(ye),ql=Pt(ye),Gl=Zt(ye),Kl=It(ye),Yl=Xr(ye),Xl=Qr(ye),Ql=en(ye),ec=tn(ye),tc=rn(ye),rc=nn(ye),nc=on(ye),oc=sn(ye)});var Pr={};Pe(Pr,{ZodAny:()=>fc,ZodArray:()=>yc,ZodBase64:()=>_o,ZodBase64URL:()=>ko,ZodBigInt:()=>Xt,ZodBigIntFormat:()=>$o,ZodBoolean:()=>Yt,ZodCIDRv4:()=>xo,ZodCIDRv6:()=>wo,ZodCUID:()=>fo,ZodCUID2:()=>mo,ZodCatch:()=>Mc,ZodCodec:()=>Ur,ZodCustom:()=>Lr,ZodCustomStringFormat:()=>Gt,ZodDate:()=>Ar,ZodDefault:()=>Oc,ZodDiscriminatedUnion:()=>vc,ZodE164:()=>zo,ZodEmail:()=>co,ZodEmoji:()=>uo,ZodEnum:()=>Jt,ZodExactOptional:()=>Ec,ZodFile:()=>Zc,ZodFunction:()=>Gc,ZodGUID:()=>Er,ZodIPv4:()=>bo,ZodIPv6:()=>vo,ZodIntersection:()=>xc,ZodJWT:()=>So,ZodKSUID:()=>yo,ZodLazy:()=>Vc,ZodLiteral:()=>Pc,ZodMAC:()=>sc,ZodMap:()=>Sc,ZodNaN:()=>Lc,ZodNanoID:()=>po,ZodNever:()=>gc,ZodNonOptional:()=>To,ZodNull:()=>dc,ZodNullable:()=>Tc,ZodNumber:()=>Kt,ZodNumberFormat:()=>mt,ZodObject:()=>jr,ZodOptional:()=>Co,ZodPipe:()=>Mr,ZodPrefault:()=>Ac,ZodPreprocess:()=>Fc,ZodPromise:()=>qc,ZodReadonly:()=>Hc,ZodRecord:()=>Vt,ZodSet:()=>$c,ZodString:()=>qt,ZodStringFormat:()=>G,ZodSuccess:()=>Dc,ZodSymbol:()=>cc,ZodTemplateLiteral:()=>Wc,ZodTransform:()=>Ic,ZodTuple:()=>_c,ZodType:()=>L,ZodULID:()=>go,ZodURL:()=>Rr,ZodUUID:()=>Re,ZodUndefined:()=>uc,ZodUnion:()=>Dr,ZodUnknown:()=>mc,ZodVoid:()=>hc,ZodXID:()=>ho,ZodXor:()=>bc,_ZodString:()=>lo,_default:()=>Rc,_function:()=>gp,any:()=>Vd,array:()=>Nr,base64:()=>Id,base64url:()=>Ed,bigint:()=>Ld,boolean:()=>lc,catch:()=>Uc,check:()=>hp,cidrv4:()=>Pd,cidrv6:()=>Zd,codec:()=>dp,cuid:()=>vd,cuid2:()=>xd,custom:()=>yp,date:()=>qd,describe:()=>bp,discriminatedUnion:()=>ep,e164:()=>Cd,email:()=>cd,emoji:()=>yd,enum:()=>Io,exactOptional:()=>Cc,file:()=>ap,float32:()=>jd,float64:()=>Dd,function:()=>gp,guid:()=>ud,hash:()=>Nd,hex:()=>Ad,hostname:()=>Rd,httpUrl:()=>hd,instanceof:()=>xp,int:()=>so,int32:()=>Md,int64:()=>Fd,intersection:()=>wc,invertCodec:()=>pp,ipv4:()=>zd,ipv6:()=>$d,json:()=>_p,jwt:()=>Td,keyof:()=>Gd,ksuid:()=>kd,lazy:()=>Jc,literal:()=>sp,looseObject:()=>Xd,looseRecord:()=>rp,mac:()=>Sd,map:()=>np,meta:()=>vp,nan:()=>up,nanoid:()=>bd,nativeEnum:()=>ip,never:()=>Po,nonoptional:()=>jc,null:()=>pc,nullable:()=>Tr,nullish:()=>lp,number:()=>ac,object:()=>Kd,optional:()=>Cr,partialRecord:()=>tp,pipe:()=>ao,prefault:()=>Nc,preprocess:()=>kp,promise:()=>mp,readonly:()=>Bc,record:()=>zc,refine:()=>Kc,set:()=>op,strictObject:()=>Yd,string:()=>Ir,stringFormat:()=>Od,stringbool:()=>wp,success:()=>cp,superRefine:()=>Yc,symbol:()=>Bd,templateLiteral:()=>fp,transform:()=>Eo,tuple:()=>kc,uint32:()=>Ud,uint64:()=>Hd,ulid:()=>wd,undefined:()=>Wd,union:()=>Zo,unknown:()=>ft,url:()=>gd,uuid:()=>dd,uuidv4:()=>pd,uuidv6:()=>fd,uuidv7:()=>md,void:()=>Jd,xid:()=>_d,xor:()=>Qd});function Or(e,t,r){let n=Object.getPrototypeOf(e),o=ld.get(n);if(o||(o=new Set,ld.set(n,o)),!o.has(t)){o.add(t);for(let i in r){let s=r[i];Object.defineProperty(n,i,{configurable:!0,enumerable:!1,get(){let c=s.bind(this);return Object.defineProperty(this,i,{configurable:!0,writable:!0,enumerable:!0,value:c}),c},set(c){Object.defineProperty(this,i,{configurable:!0,writable:!0,enumerable:!0,value:c})}})}}}function Ir(e){return va(qt,e)}function cd(e){return zn(co,e)}function ud(e){return _r(Er,e)}function dd(e){return Sn(Re,e)}function pd(e){return $n(Re,e)}function fd(e){return Pn(Re,e)}function md(e){return Zn(Re,e)}function gd(e){return kr(Rr,e)}function hd(e){return kr(Rr,{protocol:xe.httpProtocol,hostname:xe.domain,...j.normalizeParams(e)})}function yd(e){return In(uo,e)}function bd(e){return En(po,e)}function vd(e){return Cn(fo,e)}function xd(e){return Tn(mo,e)}function wd(e){return On(go,e)}function _d(e){return Rn(ho,e)}function kd(e){return An(yo,e)}function zd(e){return Nn(bo,e)}function Sd(e){return wa(sc,e)}function $d(e){return jn(vo,e)}function Pd(e){return Dn(xo,e)}function Zd(e){return Mn(wo,e)}function Id(e){return Un(_o,e)}function Ed(e){return Ln(ko,e)}function Cd(e){return Fn(zo,e)}function Td(e){return Hn(So,e)}function Od(e,t,r={}){return Ht(Gt,e,t,r)}function Rd(e){return Ht(Gt,"hostname",xe.hostname,e)}function Ad(e){return Ht(Gt,"hex",xe.hex,e)}function Nd(e,t){let r=t?.enc??"hex",n=`${e}_${r}`,o=xe[n];if(!o)throw new Error(`Unrecognized hash format: ${n}`);return Ht(Gt,n,o,t)}function ac(e){return Pa(Kt,e)}function so(e){return Ia(mt,e)}function jd(e){return Ea(mt,e)}function Dd(e){return Ca(mt,e)}function Md(e){return Ta(mt,e)}function Ud(e){return Oa(mt,e)}function lc(e){return Ra(Yt,e)}function Ld(e){return Na(Xt,e)}function Fd(e){return Da($o,e)}function Hd(e){return Ma($o,e)}function Bd(e){return Ua(cc,e)}function Wd(e){return La(uc,e)}function pc(e){return Fa(dc,e)}function Vd(){return Ha(fc)}function ft(){return Ba(mc)}function Po(e){return Wa(gc,e)}function Jd(e){return Va(hc,e)}function qd(e){return Ja(Ar,e)}function Nr(e,t){return Ka(yc,e,t)}function Gd(e){let t=e._zod.def.shape;return Io(Object.keys(t))}function Kd(e,t){let r={type:"object",shape:e??{},...j.normalizeParams(t)};return new jr(r)}function Yd(e,t){return new jr({type:"object",shape:e,catchall:Po(),...j.normalizeParams(t)})}function Xd(e,t){return new jr({type:"object",shape:e,catchall:ft(),...j.normalizeParams(t)})}function Zo(e,t){return new Dr({type:"union",options:e,...j.normalizeParams(t)})}function Qd(e,t){return new bc({type:"union",options:e,inclusive:!1,...j.normalizeParams(t)})}function ep(e,t,r){return new vc({type:"union",options:t,discriminator:e,...j.normalizeParams(r)})}function wc(e,t){return new xc({type:"intersection",left:e,right:t})}function kc(e,t,r){let n=t instanceof M,o=n?r:t,i=n?t:null;return new _c({type:"tuple",items:e,rest:i,...j.normalizeParams(o)})}function zc(e,t,r){return!t||!t._zod?new Vt({type:"record",keyType:Ir(),valueType:e,...j.normalizeParams(t)}):new Vt({type:"record",keyType:e,valueType:t,...j.normalizeParams(r)})}function tp(e,t,r){let n=ue(e);return n._zod.values=void 0,new Vt({type:"record",keyType:n,valueType:t,...j.normalizeParams(r)})}function rp(e,t,r){return new Vt({type:"record",keyType:e,valueType:t,mode:"loose",...j.normalizeParams(r)})}function np(e,t,r){return new Sc({type:"map",keyType:e,valueType:t,...j.normalizeParams(r)})}function op(e,t){return new $c({type:"set",valueType:e,...j.normalizeParams(t)})}function Io(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new Jt({type:"enum",entries:r,...j.normalizeParams(t)})}function ip(e,t){return new Jt({type:"enum",entries:e,...j.normalizeParams(t)})}function sp(e,t){return new Pc({type:"literal",values:Array.isArray(e)?e:[e],...j.normalizeParams(t)})}function ap(e){return Ya(Zc,e)}function Eo(e){return new Ic({type:"transform",transform:e})}function Cr(e){return new Co({type:"optional",innerType:e})}function Cc(e){return new Ec({type:"optional",innerType:e})}function Tr(e){return new Tc({type:"nullable",innerType:e})}function lp(e){return Cr(Tr(e))}function Rc(e,t){return new Oc({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():j.shallowClone(t)}})}function Nc(e,t){return new Ac({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():j.shallowClone(t)}})}function jc(e,t){return new To({type:"nonoptional",innerType:e,...j.normalizeParams(t)})}function cp(e){return new Dc({type:"success",innerType:e})}function Uc(e,t){return new Mc({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}function up(e){return Ga(Lc,e)}function ao(e,t){return new Mr({type:"pipe",in:e,out:t})}function dp(e,t,r){return new Ur({type:"pipe",in:e,out:t,transform:r.decode,reverseTransform:r.encode})}function pp(e){let t=e._zod.def;return new Ur({type:"pipe",in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}function Bc(e){return new Hc({type:"readonly",innerType:e})}function fp(e,t){return new Wc({type:"template_literal",parts:e,...j.normalizeParams(t)})}function Jc(e){return new Vc({type:"lazy",getter:e})}function mp(e){return new qc({type:"promise",innerType:e})}function gp(e){return new Gc({type:"function",input:Array.isArray(e?.input)?kc(e?.input):e?.input??Nr(ft()),output:e?.output??ft()})}function hp(e){let t=new K({check:"custom"});return t._zod.check=e,t}function yp(e,t){return Xa(Lr,e??(()=>!0),t)}function Kc(e,t={}){return Qa(Lr,e,t)}function Yc(e,t){return el(e,t)}function xp(e,t={}){let r=new Lr({type:"custom",check:"custom",fn:n=>n instanceof e,abort:!0,...j.normalizeParams(t)});return r._zod.bag.Class=e,r._zod.check=n=>{n.value instanceof e||n.issues.push({code:"invalid_type",expected:e.name,input:n.value,inst:r,path:[...r._zod.def.path??[]]})},r}function _p(e){let t=Jc(()=>Zo([Ir(e),ac(),lc(),pc(),Nr(t),zc(Ir(),t)]));return t}function kp(e,t){return new Fc({type:"pipe",in:Eo(e),out:t})}var ld,L,lo,qt,G,co,Er,Re,Rr,uo,po,fo,mo,go,ho,yo,bo,sc,vo,xo,wo,_o,ko,zo,So,Gt,Kt,mt,Yt,Xt,$o,cc,uc,dc,fc,mc,gc,hc,Ar,yc,jr,Dr,bc,vc,xc,_c,Vt,Sc,$c,Jt,Pc,Zc,Ic,Co,Ec,Tc,Oc,Ac,To,Dc,Mc,Lc,Mr,Ur,Fc,Hc,Wc,Vc,qc,Gc,Lr,bp,vp,wp,Zr=J(()=>{_e();_e();Sr();zr();to();$r();ic();ld=new WeakMap;L=f("ZodType",(e,t)=>(M.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Bt(e,"input"),output:Bt(e,"output")}}),e.toJSONSchema=ol(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(r,n)=>Jl(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>Gl(e,r,n),e.parseAsync=async(r,n)=>ql(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>Kl(e,r,n),e.spa=e.safeParseAsync,e.encode=(r,n)=>Yl(e,r,n),e.decode=(r,n)=>Xl(e,r,n),e.encodeAsync=async(r,n)=>Ql(e,r,n),e.decodeAsync=async(r,n)=>ec(e,r,n),e.safeEncode=(r,n)=>tc(e,r,n),e.safeDecode=(r,n)=>rc(e,r,n),e.safeEncodeAsync=async(r,n)=>nc(e,r,n),e.safeDecodeAsync=async(r,n)=>oc(e,r,n),Or(e,"ZodType",{check(...r){let n=this.def;return this.clone(j.mergeDefs(n,{checks:[...n.checks??[],...r.map(o=>typeof o=="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]}),{parent:!0})},with(...r){return this.check(...r)},clone(r,n){return ue(this,r,n)},brand(){return this},register(r,n){return r.add(this,n),this},refine(r,n){return this.check(Kc(r,n))},superRefine(r,n){return this.check(Yc(r,n))},overwrite(r){return this.check(Ie(r))},optional(){return Cr(this)},exactOptional(){return Cc(this)},nullable(){return Tr(this)},nullish(){return Cr(Tr(this))},nonoptional(r){return jc(this,r)},array(){return Nr(this)},or(r){return Zo([this,r])},and(r){return wc(this,r)},transform(r){return ao(this,Eo(r))},default(r){return Rc(this,r)},prefault(r){return Nc(this,r)},catch(r){return Uc(this,r)},pipe(r){return ao(this,r)},readonly(){return Bc(this)},describe(r){let n=this.clone();return se.add(n,{description:r}),n},meta(...r){if(r.length===0)return se.get(this);let n=this.clone();return se.add(n,r[0]),n},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(r){return r(this)}}),Object.defineProperty(e,"description",{get(){return se.get(e)?.description},configurable:!0}),e)),lo=f("_ZodString",(e,t)=>{ct.init(e,t),L.init(e,t),e._zod.processJSONSchema=(n,o,i)=>il(e,n,o,i);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,Or(e,"_ZodString",{regex(...n){return this.check(Ct(...n))},includes(...n){return this.check(Rt(...n))},startsWith(...n){return this.check(At(...n))},endsWith(...n){return this.check(Nt(...n))},min(...n){return this.check(Ue(...n))},max(...n){return this.check(dt(...n))},length(...n){return this.check(pt(...n))},nonempty(...n){return this.check(Ue(1,...n))},lowercase(n){return this.check(Tt(n))},uppercase(n){return this.check(Ot(n))},trim(){return this.check(Mt())},normalize(...n){return this.check(Dt(...n))},toLowerCase(){return this.check(Ut())},toUpperCase(){return this.check(Lt())},slugify(){return this.check(Ft())}})}),qt=f("ZodString",(e,t)=>{ct.init(e,t),lo.init(e,t),e.email=r=>e.check(zn(co,r)),e.url=r=>e.check(kr(Rr,r)),e.jwt=r=>e.check(Hn(So,r)),e.emoji=r=>e.check(In(uo,r)),e.guid=r=>e.check(_r(Er,r)),e.uuid=r=>e.check(Sn(Re,r)),e.uuidv4=r=>e.check($n(Re,r)),e.uuidv6=r=>e.check(Pn(Re,r)),e.uuidv7=r=>e.check(Zn(Re,r)),e.nanoid=r=>e.check(En(po,r)),e.guid=r=>e.check(_r(Er,r)),e.cuid=r=>e.check(Cn(fo,r)),e.cuid2=r=>e.check(Tn(mo,r)),e.ulid=r=>e.check(On(go,r)),e.base64=r=>e.check(Un(_o,r)),e.base64url=r=>e.check(Ln(ko,r)),e.xid=r=>e.check(Rn(ho,r)),e.ksuid=r=>e.check(An(yo,r)),e.ipv4=r=>e.check(Nn(bo,r)),e.ipv6=r=>e.check(jn(vo,r)),e.cidrv4=r=>e.check(Dn(xo,r)),e.cidrv6=r=>e.check(Mn(wo,r)),e.e164=r=>e.check(Fn(zo,r)),e.datetime=r=>e.check(Fl(r)),e.date=r=>e.check(Hl(r)),e.time=r=>e.check(Bl(r)),e.duration=r=>e.check(Wl(r))});G=f("ZodStringFormat",(e,t)=>{q.init(e,t),lo.init(e,t)}),co=f("ZodEmail",(e,t)=>{ls.init(e,t),G.init(e,t)});Er=f("ZodGUID",(e,t)=>{ss.init(e,t),G.init(e,t)});Re=f("ZodUUID",(e,t)=>{as.init(e,t),G.init(e,t)});Rr=f("ZodURL",(e,t)=>{cs.init(e,t),G.init(e,t)});uo=f("ZodEmoji",(e,t)=>{us.init(e,t),G.init(e,t)});po=f("ZodNanoID",(e,t)=>{ds.init(e,t),G.init(e,t)});fo=f("ZodCUID",(e,t)=>{ps.init(e,t),G.init(e,t)});mo=f("ZodCUID2",(e,t)=>{fs.init(e,t),G.init(e,t)});go=f("ZodULID",(e,t)=>{ms.init(e,t),G.init(e,t)});ho=f("ZodXID",(e,t)=>{gs.init(e,t),G.init(e,t)});yo=f("ZodKSUID",(e,t)=>{hs.init(e,t),G.init(e,t)});bo=f("ZodIPv4",(e,t)=>{ws.init(e,t),G.init(e,t)});sc=f("ZodMAC",(e,t)=>{ks.init(e,t),G.init(e,t)});vo=f("ZodIPv6",(e,t)=>{_s.init(e,t),G.init(e,t)});xo=f("ZodCIDRv4",(e,t)=>{zs.init(e,t),G.init(e,t)});wo=f("ZodCIDRv6",(e,t)=>{Ss.init(e,t),G.init(e,t)});_o=f("ZodBase64",(e,t)=>{Ps.init(e,t),G.init(e,t)});ko=f("ZodBase64URL",(e,t)=>{Zs.init(e,t),G.init(e,t)});zo=f("ZodE164",(e,t)=>{Is.init(e,t),G.init(e,t)});So=f("ZodJWT",(e,t)=>{Es.init(e,t),G.init(e,t)});Gt=f("ZodCustomStringFormat",(e,t)=>{Cs.init(e,t),G.init(e,t)});Kt=f("ZodNumber",(e,t)=>{yn.init(e,t),L.init(e,t),e._zod.processJSONSchema=(n,o,i)=>sl(e,n,o,i),Or(e,"ZodNumber",{gt(n,o){return this.check(Te(n,o))},gte(n,o){return this.check(pe(n,o))},min(n,o){return this.check(pe(n,o))},lt(n,o){return this.check(Ce(n,o))},lte(n,o){return this.check(we(n,o))},max(n,o){return this.check(we(n,o))},int(n){return this.check(so(n))},safe(n){return this.check(so(n))},positive(n){return this.check(Te(0,n))},nonnegative(n){return this.check(pe(0,n))},negative(n){return this.check(Ce(0,n))},nonpositive(n){return this.check(we(0,n))},multipleOf(n,o){return this.check(Ke(n,o))},step(n,o){return this.check(Ke(n,o))},finite(){return this}});let r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});mt=f("ZodNumberFormat",(e,t)=>{Ts.init(e,t),Kt.init(e,t)});Yt=f("ZodBoolean",(e,t)=>{yr.init(e,t),L.init(e,t),e._zod.processJSONSchema=(r,n,o)=>al(e,r,n,o)});Xt=f("ZodBigInt",(e,t)=>{bn.init(e,t),L.init(e,t),e._zod.processJSONSchema=(n,o,i)=>ll(e,n,o,i),e.gte=(n,o)=>e.check(pe(n,o)),e.min=(n,o)=>e.check(pe(n,o)),e.gt=(n,o)=>e.check(Te(n,o)),e.gte=(n,o)=>e.check(pe(n,o)),e.min=(n,o)=>e.check(pe(n,o)),e.lt=(n,o)=>e.check(Ce(n,o)),e.lte=(n,o)=>e.check(we(n,o)),e.max=(n,o)=>e.check(we(n,o)),e.positive=n=>e.check(Te(BigInt(0),n)),e.negative=n=>e.check(Ce(BigInt(0),n)),e.nonpositive=n=>e.check(we(BigInt(0),n)),e.nonnegative=n=>e.check(pe(BigInt(0),n)),e.multipleOf=(n,o)=>e.check(Ke(n,o));let r=e._zod.bag;e.minValue=r.minimum??null,e.maxValue=r.maximum??null,e.format=r.format??null});$o=f("ZodBigIntFormat",(e,t)=>{Os.init(e,t),Xt.init(e,t)});cc=f("ZodSymbol",(e,t)=>{Rs.init(e,t),L.init(e,t),e._zod.processJSONSchema=(r,n,o)=>cl(e,r,n,o)});uc=f("ZodUndefined",(e,t)=>{As.init(e,t),L.init(e,t),e._zod.processJSONSchema=(r,n,o)=>dl(e,r,n,o)});dc=f("ZodNull",(e,t)=>{Ns.init(e,t),L.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ul(e,r,n,o)});fc=f("ZodAny",(e,t)=>{js.init(e,t),L.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ml(e,r,n,o)});mc=f("ZodUnknown",(e,t)=>{Ds.init(e,t),L.init(e,t),e._zod.processJSONSchema=(r,n,o)=>gl(e,r,n,o)});gc=f("ZodNever",(e,t)=>{Ms.init(e,t),L.init(e,t),e._zod.processJSONSchema=(r,n,o)=>fl(e,r,n,o)});hc=f("ZodVoid",(e,t)=>{Us.init(e,t),L.init(e,t),e._zod.processJSONSchema=(r,n,o)=>pl(e,r,n,o)});Ar=f("ZodDate",(e,t)=>{Ls.init(e,t),L.init(e,t),e._zod.processJSONSchema=(n,o,i)=>hl(e,n,o,i),e.min=(n,o)=>e.check(pe(n,o)),e.max=(n,o)=>e.check(we(n,o));let r=e._zod.bag;e.minDate=r.minimum?new Date(r.minimum):null,e.maxDate=r.maximum?new Date(r.maximum):null});yc=f("ZodArray",(e,t)=>{Fs.init(e,t),L.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Zl(e,r,n,o),e.element=t.element,Or(e,"ZodArray",{min(r,n){return this.check(Ue(r,n))},nonempty(r){return this.check(Ue(1,r))},max(r,n){return this.check(dt(r,n))},length(r,n){return this.check(pt(r,n))},unwrap(){return this.element}})});jr=f("ZodObject",(e,t)=>{Hs.init(e,t),L.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Il(e,r,n,o),j.defineLazy(e,"shape",()=>t.shape),Or(e,"ZodObject",{keyof(){return Io(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:ft()})},loose(){return this.clone({...this._zod.def,catchall:ft()})},strict(){return this.clone({...this._zod.def,catchall:Po()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return j.extend(this,r)},safeExtend(r){return j.safeExtend(this,r)},merge(r){return j.merge(this,r)},pick(r){return j.pick(this,r)},omit(r){return j.omit(this,r)},partial(...r){return j.partial(Co,this,r[0])},required(...r){return j.required(To,this,r[0])}})});Dr=f("ZodUnion",(e,t)=>{br.init(e,t),L.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Kn(e,r,n,o),e.options=t.options});bc=f("ZodXor",(e,t)=>{Dr.init(e,t),Bs.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Kn(e,r,n,o),e.options=t.options});vc=f("ZodDiscriminatedUnion",(e,t)=>{Dr.init(e,t),Ws.init(e,t)});xc=f("ZodIntersection",(e,t)=>{Vs.init(e,t),L.init(e,t),e._zod.processJSONSchema=(r,n,o)=>El(e,r,n,o)});_c=f("ZodTuple",(e,t)=>{vn.init(e,t),L.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Cl(e,r,n,o),e.rest=r=>e.clone({...e._zod.def,rest:r})});Vt=f("ZodRecord",(e,t)=>{Js.init(e,t),L.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Tl(e,r,n,o),e.keyType=t.keyType,e.valueType=t.valueType});Sc=f("ZodMap",(e,t)=>{qs.init(e,t),L.init(e,t),e._zod.processJSONSchema=(r,n,o)=>$l(e,r,n,o),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...r)=>e.check(Oe(...r)),e.nonempty=r=>e.check(Oe(1,r)),e.max=(...r)=>e.check(Ye(...r)),e.size=(...r)=>e.check(ut(...r))});$c=f("ZodSet",(e,t)=>{Gs.init(e,t),L.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Pl(e,r,n,o),e.min=(...r)=>e.check(Oe(...r)),e.nonempty=r=>e.check(Oe(1,r)),e.max=(...r)=>e.check(Ye(...r)),e.size=(...r)=>e.check(ut(...r))});Jt=f("ZodEnum",(e,t)=>{Ks.init(e,t),L.init(e,t),e._zod.processJSONSchema=(n,o,i)=>yl(e,n,o,i),e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(n,o)=>{let i={};for(let s of n)if(r.has(s))i[s]=t.entries[s];else throw new Error(`Key ${s} not found in enum`);return new Jt({...t,checks:[],...j.normalizeParams(o),entries:i})},e.exclude=(n,o)=>{let i={...t.entries};for(let s of n)if(r.has(s))delete i[s];else throw new Error(`Key ${s} not found in enum`);return new Jt({...t,checks:[],...j.normalizeParams(o),entries:i})}});Pc=f("ZodLiteral",(e,t)=>{Ys.init(e,t),L.init(e,t),e._zod.processJSONSchema=(r,n,o)=>bl(e,r,n,o),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});Zc=f("ZodFile",(e,t)=>{Xs.init(e,t),L.init(e,t),e._zod.processJSONSchema=(r,n,o)=>wl(e,r,n,o),e.min=(r,n)=>e.check(Oe(r,n)),e.max=(r,n)=>e.check(Ye(r,n)),e.mime=(r,n)=>e.check(jt(Array.isArray(r)?r:[r],n))});Ic=f("ZodTransform",(e,t)=>{Qs.init(e,t),L.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Sl(e,r,n,o),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new We(e.constructor.name);r.addIssue=i=>{if(typeof i=="string")r.issues.push(j.issue(i,r.value,t));else{let s=i;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=e),r.issues.push(j.issue(s))}};let o=t.transform(r.value,r);return o instanceof Promise?o.then(i=>(r.value=i,r.fallback=!0,r)):(r.value=o,r.fallback=!0,r)}});Co=f("ZodOptional",(e,t)=>{xn.init(e,t),L.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Yn(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});Ec=f("ZodExactOptional",(e,t)=>{ea.init(e,t),L.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Yn(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});Tc=f("ZodNullable",(e,t)=>{ta.init(e,t),L.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ol(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});Oc=f("ZodDefault",(e,t)=>{ra.init(e,t),L.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Al(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});Ac=f("ZodPrefault",(e,t)=>{na.init(e,t),L.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Nl(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});To=f("ZodNonOptional",(e,t)=>{oa.init(e,t),L.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Rl(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});Dc=f("ZodSuccess",(e,t)=>{ia.init(e,t),L.init(e,t),e._zod.processJSONSchema=(r,n,o)=>_l(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});Mc=f("ZodCatch",(e,t)=>{sa.init(e,t),L.init(e,t),e._zod.processJSONSchema=(r,n,o)=>jl(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});Lc=f("ZodNaN",(e,t)=>{aa.init(e,t),L.init(e,t),e._zod.processJSONSchema=(r,n,o)=>vl(e,r,n,o)});Mr=f("ZodPipe",(e,t)=>{wn.init(e,t),L.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Dl(e,r,n,o),e.in=t.in,e.out=t.out});Ur=f("ZodCodec",(e,t)=>{Mr.init(e,t),vr.init(e,t)});Fc=f("ZodPreprocess",(e,t)=>{Mr.init(e,t),la.init(e,t)}),Hc=f("ZodReadonly",(e,t)=>{ca.init(e,t),L.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ml(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});Wc=f("ZodTemplateLiteral",(e,t)=>{ua.init(e,t),L.init(e,t),e._zod.processJSONSchema=(r,n,o)=>xl(e,r,n,o)});Vc=f("ZodLazy",(e,t)=>{fa.init(e,t),L.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ll(e,r,n,o),e.unwrap=()=>e._zod.def.getter()});qc=f("ZodPromise",(e,t)=>{pa.init(e,t),L.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ul(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});Gc=f("ZodFunction",(e,t)=>{da.init(e,t),L.init(e,t),e._zod.processJSONSchema=(r,n,o)=>zl(e,r,n,o)});Lr=f("ZodCustom",(e,t)=>{ma.init(e,t),L.init(e,t),e._zod.processJSONSchema=(r,n,o)=>kl(e,r,n,o)});bp=tl,vp=rl;wp=(...e)=>nl({Codec:Ur,Boolean:Yt,String:qt},...e)});function Ig(e){te({customError:e})}function Eg(){return te().customError}var Zg,Xc,zp=J(()=>{_e();Zg={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};Xc||(Xc={})});function Sp(){return{localeError:Cg()}}var Cg,$p=J(()=>{Se();Cg=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(o){return e[o]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},n={nan:"NaN"};return o=>{switch(o.code){case"invalid_type":{let i=n[o.expected]??o.expected,s=ri(o.input),c=n[s]??s;return`Invalid input: expected ${i}, received ${c}`}case"invalid_value":return o.values.length===1?`Invalid input: expected ${Gr(o.values[0])}`:`Invalid option: expected one of ${Vr(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",s=t(o.origin);return s?`Too big: expected ${o.origin??"value"} to have ${i}${o.maximum.toString()} ${s.unit??"elements"}`:`Too big: expected ${o.origin??"value"} to be ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",s=t(o.origin);return s?`Too small: expected ${o.origin} to have ${i}${o.minimum.toString()} ${s.unit}`:`Too small: expected ${o.origin} to be ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;return i.format==="starts_with"?`Invalid string: must start with "${i.prefix}"`:i.format==="ends_with"?`Invalid string: must end with "${i.suffix}"`:i.format==="includes"?`Invalid string: must include "${i.includes}"`:i.format==="regex"?`Invalid string: must match pattern ${i.pattern}`:`Invalid ${r[i.format]??o.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${o.divisor}`;case"unrecognized_keys":return`Unrecognized key${o.keys.length>1?"s":""}: ${Vr(o.keys,", ")}`;case"invalid_key":return`Invalid key in ${o.origin}`;case"invalid_union":return o.options&&Array.isArray(o.options)&&o.options.length>0?`Invalid discriminator value. Expected ${o.options.map(s=>`'${s}'`).join(" | ")}`:"Invalid input";case"invalid_element":return`Invalid value in ${o.origin}`;default:return"Invalid input"}}}});function Og(e,t){let r=e.$schema;return r==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":r==="http://json-schema.org/draft-07/schema#"?"draft-7":r==="http://json-schema.org/draft-04/schema#"?"draft-4":t??"draft-2020-12"}function Rg(e,t){if(!e.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let r=e.slice(1).split("/").filter(Boolean);if(r.length===0)return t.rootSchema;let n=t.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===n){let o=r[1];if(!o||!t.defs[o])throw new Error(`Reference not found: ${e}`);return t.defs[o]}throw new Error(`Reference not found: ${e}`)}function Pp(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return I.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let o=e.$ref;if(t.refs.has(o))return t.refs.get(o);if(t.processing.has(o))return I.lazy(()=>{if(!t.refs.has(o))throw new Error(`Circular reference not resolved: ${o}`);return t.refs.get(o)});t.processing.add(o);let i=Rg(o,t),s=le(i,t);return t.refs.set(o,s),t.processing.delete(o),s}if(e.enum!==void 0){let o=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&o.length===1&&o[0]===null)return I.null();if(o.length===0)return I.never();if(o.length===1)return I.literal(o[0]);if(o.every(s=>typeof s=="string"))return I.enum(o);let i=o.map(s=>I.literal(s));return i.length<2?i[0]:I.union([i[0],i[1],...i.slice(2)])}if(e.const!==void 0)return I.literal(e.const);let r=e.type;if(Array.isArray(r)){let o=r.map(i=>{let s={...e,type:i};return Pp(s,t)});return o.length===0?I.never():o.length===1?o[0]:I.union(o)}if(!r)return I.any();let n;switch(r){case"string":{let o=I.string();if(e.format){let i=e.format;i==="email"?o=o.check(I.email()):i==="uri"||i==="uri-reference"?o=o.check(I.url()):i==="uuid"||i==="guid"?o=o.check(I.uuid()):i==="date-time"?o=o.check(I.iso.datetime()):i==="date"?o=o.check(I.iso.date()):i==="time"?o=o.check(I.iso.time()):i==="duration"?o=o.check(I.iso.duration()):i==="ipv4"?o=o.check(I.ipv4()):i==="ipv6"?o=o.check(I.ipv6()):i==="mac"?o=o.check(I.mac()):i==="cidr"?o=o.check(I.cidrv4()):i==="cidr-v6"?o=o.check(I.cidrv6()):i==="base64"?o=o.check(I.base64()):i==="base64url"?o=o.check(I.base64url()):i==="e164"?o=o.check(I.e164()):i==="jwt"?o=o.check(I.jwt()):i==="emoji"?o=o.check(I.emoji()):i==="nanoid"?o=o.check(I.nanoid()):i==="cuid"?o=o.check(I.cuid()):i==="cuid2"?o=o.check(I.cuid2()):i==="ulid"?o=o.check(I.ulid()):i==="xid"?o=o.check(I.xid()):i==="ksuid"&&(o=o.check(I.ksuid()))}typeof e.minLength=="number"&&(o=o.min(e.minLength)),typeof e.maxLength=="number"&&(o=o.max(e.maxLength)),e.pattern&&(o=o.regex(new RegExp(e.pattern))),n=o;break}case"number":case"integer":{let o=r==="integer"?I.number().int():I.number();typeof e.minimum=="number"&&(o=o.min(e.minimum)),typeof e.maximum=="number"&&(o=o.max(e.maximum)),typeof e.exclusiveMinimum=="number"?o=o.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(o=o.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?o=o.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(o=o.lt(e.maximum)),typeof e.multipleOf=="number"&&(o=o.multipleOf(e.multipleOf)),n=o;break}case"boolean":{n=I.boolean();break}case"null":{n=I.null();break}case"object":{let o={},i=e.properties||{},s=new Set(e.required||[]);for(let[u,d]of Object.entries(i)){let m=le(d,t);o[u]=s.has(u)?m:m.optional()}if(e.propertyNames){let u=le(e.propertyNames,t),d=e.additionalProperties&&typeof e.additionalProperties=="object"?le(e.additionalProperties,t):I.any();if(Object.keys(o).length===0){n=I.record(u,d);break}let m=I.object(o).passthrough(),h=I.looseRecord(u,d);n=I.intersection(m,h);break}if(e.patternProperties){let u=e.patternProperties,d=Object.keys(u),m=[];for(let b of d){let p=le(u[b],t),x=I.string().regex(new RegExp(b));m.push(I.looseRecord(x,p))}let h=[];if(Object.keys(o).length>0&&h.push(I.object(o).passthrough()),h.push(...m),h.length===0)n=I.object({}).passthrough();else if(h.length===1)n=h[0];else{let b=I.intersection(h[0],h[1]);for(let p=2;p<h.length;p++)b=I.intersection(b,h[p]);n=b}break}let c=I.object(o);e.additionalProperties===!1?n=c.strict():typeof e.additionalProperties=="object"?n=c.catchall(le(e.additionalProperties,t)):n=c.passthrough();break}case"array":{let o=e.prefixItems,i=e.items;if(o&&Array.isArray(o)){let s=o.map(u=>le(u,t)),c=i&&typeof i=="object"&&!Array.isArray(i)?le(i,t):void 0;c?n=I.tuple(s).rest(c):n=I.tuple(s),typeof e.minItems=="number"&&(n=n.check(I.minLength(e.minItems))),typeof e.maxItems=="number"&&(n=n.check(I.maxLength(e.maxItems)))}else if(Array.isArray(i)){let s=i.map(u=>le(u,t)),c=e.additionalItems&&typeof e.additionalItems=="object"?le(e.additionalItems,t):void 0;c?n=I.tuple(s).rest(c):n=I.tuple(s),typeof e.minItems=="number"&&(n=n.check(I.minLength(e.minItems))),typeof e.maxItems=="number"&&(n=n.check(I.maxLength(e.maxItems)))}else if(i!==void 0){let s=le(i,t),c=I.array(s);typeof e.minItems=="number"&&(c=c.min(e.minItems)),typeof e.maxItems=="number"&&(c=c.max(e.maxItems)),n=c}else n=I.array(I.any());break}default:throw new Error(`Unsupported type: ${r}`)}return n}function le(e,t){if(typeof e=="boolean")return e?I.any():I.never();let r=Pp(e,t),n=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let c=e.anyOf.map(d=>le(d,t)),u=I.union(c);r=n?I.intersection(r,u):u}if(e.oneOf&&Array.isArray(e.oneOf)){let c=e.oneOf.map(d=>le(d,t)),u=I.xor(c);r=n?I.intersection(r,u):u}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)r=n?r:I.any();else{let c=n?r:le(e.allOf[0],t),u=n?0:1;for(let d=u;d<e.allOf.length;d++)c=I.intersection(c,le(e.allOf[d],t));r=c}e.nullable===!0&&t.version==="openapi-3.0"&&(r=I.nullable(r)),e.readOnly===!0&&(r=I.readonly(r)),e.default!==void 0&&(r=r.default(e.default));let o={},i=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let c of i)c in e&&(o[c]=e[c]);let s=["contentEncoding","contentMediaType","contentSchema"];for(let c of s)c in e&&(o[c]=e[c]);for(let c of Object.keys(e))Tg.has(c)||(o[c]=e[c]);return Object.keys(o).length>0&&t.registry.add(r,o),e.description&&(r=r.describe(e.description)),r}function Zp(e,t){if(typeof e=="boolean")return e?I.any():I.never();let r;try{r=JSON.parse(JSON.stringify(e))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let n=Og(r,t?.defaultTarget),o=r.$defs||r.definitions||{},i={version:n,defs:o,refs:new Map,processing:new Set,rootSchema:r,registry:t?.registry??se};return le(r,i)}var I,Tg,Ip=J(()=>{wr();to();$r();Zr();I={...Pr,...eo,iso:Wt},Tg=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"])});var Qc={};Pe(Qc,{bigint:()=>Dg,boolean:()=>jg,date:()=>Mg,number:()=>Ng,string:()=>Ag});function Ag(e){return xa(qt,e)}function Ng(e){return Za(Kt,e)}function jg(e){return Aa(Yt,e)}function Dg(e){return ja(Xt,e)}function Mg(e){return qa(Ar,e)}var Ep=J(()=>{_e();Zr()});var l={};Pe(l,{$brand:()=>Bo,$input:()=>ba,$output:()=>ya,NEVER:()=>Ho,TimePrecision:()=>_a,ZodAny:()=>fc,ZodArray:()=>yc,ZodBase64:()=>_o,ZodBase64URL:()=>ko,ZodBigInt:()=>Xt,ZodBigIntFormat:()=>$o,ZodBoolean:()=>Yt,ZodCIDRv4:()=>xo,ZodCIDRv6:()=>wo,ZodCUID:()=>fo,ZodCUID2:()=>mo,ZodCatch:()=>Mc,ZodCodec:()=>Ur,ZodCustom:()=>Lr,ZodCustomStringFormat:()=>Gt,ZodDate:()=>Ar,ZodDefault:()=>Oc,ZodDiscriminatedUnion:()=>vc,ZodE164:()=>zo,ZodEmail:()=>co,ZodEmoji:()=>uo,ZodEnum:()=>Jt,ZodError:()=>$g,ZodExactOptional:()=>Ec,ZodFile:()=>Zc,ZodFirstPartyTypeKind:()=>Xc,ZodFunction:()=>Gc,ZodGUID:()=>Er,ZodIPv4:()=>bo,ZodIPv6:()=>vo,ZodISODate:()=>no,ZodISODateTime:()=>ro,ZodISODuration:()=>io,ZodISOTime:()=>oo,ZodIntersection:()=>xc,ZodIssueCode:()=>Zg,ZodJWT:()=>So,ZodKSUID:()=>yo,ZodLazy:()=>Vc,ZodLiteral:()=>Pc,ZodMAC:()=>sc,ZodMap:()=>Sc,ZodNaN:()=>Lc,ZodNanoID:()=>po,ZodNever:()=>gc,ZodNonOptional:()=>To,ZodNull:()=>dc,ZodNullable:()=>Tc,ZodNumber:()=>Kt,ZodNumberFormat:()=>mt,ZodObject:()=>jr,ZodOptional:()=>Co,ZodPipe:()=>Mr,ZodPrefault:()=>Ac,ZodPreprocess:()=>Fc,ZodPromise:()=>qc,ZodReadonly:()=>Hc,ZodRealError:()=>ye,ZodRecord:()=>Vt,ZodSet:()=>$c,ZodString:()=>qt,ZodStringFormat:()=>G,ZodSuccess:()=>Dc,ZodSymbol:()=>cc,ZodTemplateLiteral:()=>Wc,ZodTransform:()=>Ic,ZodTuple:()=>_c,ZodType:()=>L,ZodULID:()=>go,ZodURL:()=>Rr,ZodUUID:()=>Re,ZodUndefined:()=>uc,ZodUnion:()=>Dr,ZodUnknown:()=>mc,ZodVoid:()=>hc,ZodXID:()=>ho,ZodXor:()=>bc,_ZodString:()=>lo,_default:()=>Rc,_function:()=>gp,any:()=>Vd,array:()=>Nr,base64:()=>Id,base64url:()=>Ed,bigint:()=>Ld,boolean:()=>lc,catch:()=>Uc,check:()=>hp,cidrv4:()=>Pd,cidrv6:()=>Zd,clone:()=>ue,codec:()=>dp,coerce:()=>Qc,config:()=>te,core:()=>Le,cuid:()=>vd,cuid2:()=>xd,custom:()=>yp,date:()=>qd,decode:()=>Xl,decodeAsync:()=>ec,describe:()=>bp,discriminatedUnion:()=>ep,e164:()=>Cd,email:()=>cd,emoji:()=>yd,encode:()=>Yl,encodeAsync:()=>Ql,endsWith:()=>Nt,enum:()=>Io,exactOptional:()=>Cc,file:()=>ap,flattenError:()=>pr,float32:()=>jd,float64:()=>Dd,formatError:()=>fr,fromJSONSchema:()=>Zp,function:()=>gp,getErrorMap:()=>Eg,globalRegistry:()=>se,gt:()=>Te,gte:()=>pe,guid:()=>ud,hash:()=>Nd,hex:()=>Ad,hostname:()=>Rd,httpUrl:()=>hd,includes:()=>Rt,instanceof:()=>xp,int:()=>so,int32:()=>Md,int64:()=>Fd,intersection:()=>wc,invertCodec:()=>pp,ipv4:()=>zd,ipv6:()=>$d,iso:()=>Wt,json:()=>_p,jwt:()=>Td,keyof:()=>Gd,ksuid:()=>kd,lazy:()=>Jc,length:()=>pt,literal:()=>sp,locales:()=>xr,looseObject:()=>Xd,looseRecord:()=>rp,lowercase:()=>Tt,lt:()=>Ce,lte:()=>we,mac:()=>Sd,map:()=>np,maxLength:()=>dt,maxSize:()=>Ye,meta:()=>vp,mime:()=>jt,minLength:()=>Ue,minSize:()=>Oe,multipleOf:()=>Ke,nan:()=>up,nanoid:()=>bd,nativeEnum:()=>ip,negative:()=>Wn,never:()=>Po,nonnegative:()=>Jn,nonoptional:()=>jc,nonpositive:()=>Vn,normalize:()=>Dt,null:()=>pc,nullable:()=>Tr,nullish:()=>lp,number:()=>ac,object:()=>Kd,optional:()=>Cr,overwrite:()=>Ie,parse:()=>Jl,parseAsync:()=>ql,partialRecord:()=>tp,pipe:()=>ao,positive:()=>Bn,prefault:()=>Nc,preprocess:()=>kp,prettifyError:()=>oi,promise:()=>mp,property:()=>qn,readonly:()=>Bc,record:()=>zc,refine:()=>Kc,regex:()=>Ct,regexes:()=>xe,registry:()=>kn,safeDecode:()=>rc,safeDecodeAsync:()=>oc,safeEncode:()=>tc,safeEncodeAsync:()=>nc,safeParse:()=>Gl,safeParseAsync:()=>Kl,set:()=>op,setErrorMap:()=>Ig,size:()=>ut,slugify:()=>Ft,startsWith:()=>At,strictObject:()=>Yd,string:()=>Ir,stringFormat:()=>Od,stringbool:()=>wp,success:()=>cp,superRefine:()=>Yc,symbol:()=>Bd,templateLiteral:()=>fp,toJSONSchema:()=>Xn,toLowerCase:()=>Ut,toUpperCase:()=>Lt,transform:()=>Eo,treeifyError:()=>ni,trim:()=>Mt,tuple:()=>kc,uint32:()=>Ud,uint64:()=>Hd,ulid:()=>wd,undefined:()=>Wd,union:()=>Zo,unknown:()=>ft,uppercase:()=>Ot,url:()=>gd,util:()=>j,uuid:()=>dd,uuidv4:()=>pd,uuidv6:()=>fd,uuidv7:()=>md,void:()=>Jd,xid:()=>_d,xor:()=>Qd});var eu=J(()=>{_e();Zr();to();Vl();ic();zp();_e();$p();_e();Sr();Ip();ha();$r();$r();Ep();te(Sp())});var Cp=J(()=>{eu();eu()});var Dp={};Pe(Dp,{TYPERT:()=>Ah,TYPERT_REMOTE:()=>Rh,default:()=>Rh});var Ug,Lg,Fg,Op,ce,Hg,Bg,Wg,Vg,Jg,qg,Gg,Kg,Rp,Yg,Xg,Qg,eh,th,rh,nh,oh,ih,sh,ah,lh,ch,uh,dh,ph,fh,mh,Ap,Oo,gh,hh,Tp,yh,bh,vh,xh,wh,_h,kh,zh,Sh,$h,Ph,Zh,Ih,Eh,tu,Np,Q,Ch,Th,Oh,W,jp,Rh,Ah,Mp=J(()=>{Cp();Ug=l.union([l.literal(null),l.literal("pending"),l.literal("loading"),l.literal("active"),l.literal("failed"),l.literal("unloading")]),Lg=l.union([l.literal("core"),l.literal("recommended"),l.literal("optional")]),Fg=l.object({entryId:l.string(),configId:l.string(),moduleName:l.string(),packageName:l.string(),description:l.string(),necessity:Lg,enabled:l.boolean(),phase:Ug,error:l.string().nullable(),protected:l.boolean(),protectionReason:l.string().nullable(),archived:l.boolean(),origin:l.union([l.literal("builtin"),l.literal("user")]),source:l.union([l.literal("builtin"),l.literal("local"),l.literal("github"),l.literal("npm")]),sourceOverride:l.union([l.literal("builtin"),l.literal("local"),l.literal("github"),l.literal("npm")]).nullable(),installedVersion:l.string().nullable(),latestVersion:l.string().nullable(),updateSource:l.string().nullable(),needsUpdate:l.boolean().nullable(),managed:l.boolean()}).readonly(),Op=l.object({name:l.string(),url:l.string(),enabled:l.boolean(),official:l.boolean(),type:l.union([l.literal("registry"),l.literal("github"),l.literal("dshfind")])}).readonly(),ce=l.object({profileName:l.string(),entries:l.array(Fg).readonly(),sources:l.array(Op).readonly()}).readonly(),Hg=l.object({entryId:l.string(),status:l.union([l.literal("changed"),l.literal("restart-required"),l.literal("unchanged"),l.literal("skipped"),l.literal("failed")]),message:l.string().nullable()}).readonly(),Bg=l.object({enabled:l.boolean(),items:l.array(Hg).readonly(),snapshot:ce}).readonly(),Wg=l.object({packageName:l.string(),status:l.union([l.literal("updated"),l.literal("failed"),l.literal("up-to-date"),l.literal("not-managed")]),message:l.string().nullable(),installedVersion:l.string().nullable(),latestVersion:l.string().nullable()}).readonly(),Vg=l.object({items:l.array(Wg).readonly(),snapshot:ce}).readonly(),Jg=l.object({entryId:l.string(),configId:l.string(),moduleName:l.string(),phase:l.string().nullable(),error:l.string().nullable(),suggestion:l.union([l.literal("disable"),l.literal("uninstall"),l.literal("none")]),canUninstall:l.boolean()}).readonly(),qg=l.object({issues:l.array(Jg).readonly(),snapshot:ce}).readonly(),Gg=l.object({entryId:l.string(),status:l.union([l.literal("disabled"),l.literal("failed"),l.literal("skipped")]),message:l.string().nullable()}).readonly(),Kg=l.object({items:l.array(Gg).readonly(),snapshot:ce}).readonly(),Rp=l.object({action:l.string(),detail:l.string()}).readonly(),Yg=l.object({actions:l.array(Rp).readonly(),restartCommand:l.string(),snapshot:ce}).readonly(),Xg=l.object({accepted:l.boolean(),message:l.string()}).readonly(),Qg=l.object({status:l.union([l.literal("cleaned"),l.literal("skipped"),l.literal("failed"),l.literal("timeout")]),exitCode:l.number().nullable(),message:l.string(),command:l.string().nullable()}).readonly(),eh=l.object({packageName:l.string(),status:l.union([l.literal("removed"),l.literal("rolled-back"),l.literal("failed"),l.literal("not-managed")]),message:l.string().nullable(),affectedEntries:l.array(l.string()).readonly(),removedPatchRows:l.number(),dependentPackages:l.array(l.string()).readonly(),verifyOk:l.boolean().nullable(),residuals:l.array(l.string()).readonly(),backupPath:l.string().nullable(),isSelf:l.boolean(),autostartCleanup:Qg.nullable()}).readonly(),th=l.object({items:l.array(eh).readonly(),snapshot:ce}).readonly(),rh=l.object({configId:l.string(),moduleName:l.string(),enabled:l.boolean()}).readonly(),nh=l.object({packageName:l.string(),type:l.string(),spec:l.string()}).readonly(),oh=l.object({id:l.string(),severity:l.union([l.literal("info"),l.literal("warning"),l.literal("high")]),title:l.string(),detail:l.string()}).readonly(),ih=l.union([l.literal("safe"),l.literal("caution"),l.literal("risky")]),sh=l.object({packageName:l.string(),spec:l.string().nullable(),inBundles:l.boolean(),patchRows:l.number(),affectedEntries:l.array(rh).readonly(),dependents:l.array(nh).readonly(),isSelf:l.boolean(),checks:l.array(oh).readonly(),verdict:ih,verdictReason:l.string(),canUninstall:l.boolean()}).readonly(),ah=l.object({packages:l.array(sh).readonly()}).readonly(),lh=l.object({confirm:l.boolean().default(!1)}).readonly(),ch=l.object({cascade:l.boolean().default(!1)}).readonly(),uh=l.object({configId:l.string(),moduleName:l.string(),enabled:l.boolean()}).readonly(),dh=l.object({type:l.union([l.literal("restore-files"),l.literal("patch-state")]),manifest:l.string().nullable(),patch:l.string().nullable(),packageName:l.string().nullable(),spec:l.string().nullable(),changes:l.array(uh).readonly()}).readonly(),ph=l.object({id:l.string(),at:l.string(),action:l.string(),label:l.string(),detail:l.string().nullable(),result:l.union([l.literal("ok"),l.literal("failed")]),undone:l.boolean(),undo:dh.nullable()}).readonly(),fh=l.object({operations:l.array(ph).readonly()}).readonly(),mh=l.object({ok:l.boolean(),message:l.string(),snapshot:ce}).readonly(),Ap=l.object({id:l.string(),name:l.string(),createdAt:l.string(),updatedAt:l.string(),states:l.record(l.string(),l.boolean()),counts:l.object({enabled:l.number(),disabled:l.number()})}).readonly(),Oo=l.object({scenarios:l.array(Ap).readonly()}).readonly(),gh=l.object({configId:l.string(),moduleName:l.string(),enabled:l.boolean(),current:l.boolean(),changed:l.boolean(),protected:l.boolean(),reason:l.string().nullable(),status:l.union([l.literal("none"),l.literal("changed"),l.literal("skipped"),l.literal("failed")]).nullable()}).readonly(),hh=l.object({items:l.array(gh).readonly(),scenarios:l.array(Ap).readonly(),snapshot:ce}).readonly(),Tp=l.object({autoQuarantine:l.boolean()}).readonly(),yh=l.object({dir:l.string()}).readonly(),bh=l.object({name:l.string(),message:l.string().nullable()}).readonly(),vh=l.object({installed:l.array(l.string()).readonly(),failed:l.array(bh).readonly(),message:l.string().nullable()}).readonly(),xh=l.object({url:l.string().nullable(),message:l.string().nullable(),sourceName:l.string().nullable(),installedVersion:l.string().nullable(),latestVersion:l.string().nullable()}).readonly(),wh=l.object({packageName:l.string(),status:l.union([l.literal("need-download"),l.literal("up-to-date"),l.literal("not-managed"),l.literal("failed")]),url:l.string().nullable(),sourceName:l.string().nullable(),installedVersion:l.string().nullable(),latestVersion:l.string().nullable(),message:l.string().nullable()}).readonly(),_h=l.object({items:l.array(wh).readonly(),snapshot:ce}).readonly(),kh=l.object({kind:l.string(),name:l.string(),reason:l.string()}).readonly(),zh=l.object({ok:l.boolean(),issues:l.array(kh).readonly()}).readonly(),Sh=l.object({ok:l.boolean(),actions:l.array(Rp).readonly(),message:l.string().nullable()}).readonly(),$h=l.object({name:l.string(),npm:l.string().nullable(),url:l.string()}).readonly(),Ph=l.object({name:l.string(),owner:l.string(),url:l.string(),npm:l.string().nullable(),category:l.string(),description:l.record(l.string(),l.string().nullable()).nullable(),stars:l.number().nullable(),added:l.string().nullable()}).readonly(),Zh=l.object({source:l.string(),updated:l.string().nullable(),count:l.number(),categories:l.record(l.string(),l.record(l.string(),l.string())).nullable(),items:l.array(Ph).readonly()}).readonly(),Ih=l.object({status:l.union([l.literal("installed"),l.literal("dry-run"),l.literal("failed"),l.literal("already-installed")]),packageName:l.string().nullable(),url:l.string().nullable(),method:l.string().nullable(),message:l.string().nullable()}).readonly(),Eh=l.object({targetVersion:l.string(),currentVersion:l.string(),channel:l.string(),phase:l.string(),decision:l.string().nullable(),stagedFile:l.string().nullable(),source:l.string().nullable(),fetchedAt:l.string().nullable()}).readonly(),tu=l.object({ok:l.boolean(),message:l.string(),currentVersion:l.string(),channel:l.string(),form:l.string(),canApply:l.boolean(),pending:Eh.nullable(),prompt:l.string()}).readonly(),Np=(e,t)=>({mode:"strict",typeSymbol:e,schema:t,create:()=>t}),Q=(e,t)=>({name:e,wire:e,source:"json",codec:Np(`dsh-drydock/types#${e}`,t)}),Ch=new Set(["list","refresh","getSources","setSources","resetToggles","setRescueConfig","setSourceOverride"]),Th=new Set(["setEnabled","quarantine","uninstallPackages","update"]),Oh={diagnose:"PluginManagerDiagnoseResult",repairHarness:"PluginManagerRepairResult",restartHarness:"PluginManagerRestartResult",getRescueConfig:"PluginManagerRescueConfig",getDownloadConfig:"PluginManagerDownloadConfig",checkDownloads:"PluginManagerCheckDownloadsResult",resolveDownloadUrl:"PluginManagerDownloadUrlResult",verifyProfile:"PluginManagerVerifyResult",fixProfile:"PluginManagerFixResult",updateBrowser:"PluginManagerBrowserReceipt",marketCatalog:"PluginManagerMarketCatalogResult",marketInstall:"PluginManagerMarketInstallResult",uninstallPreview:"PluginManagerUninstallPreviewResult",operationHistory:"PluginManagerHistoryResult",undoOperation:"PluginManagerUndoResult",scenarioList:"PluginManagerScenarioListResult",scenarioSave:"PluginManagerScenarioListResult",scenarioUpdate:"PluginManagerScenarioListResult",scenarioDelete:"PluginManagerScenarioListResult",scenarioApply:"PluginManagerScenarioApplyResult",selfUpdateStatus:"PluginManagerSelfUpdateStatus",selfUpdatePrepare:"PluginManagerSelfUpdateStatus",selfUpdateDecide:"PluginManagerSelfUpdateStatus"},W=(e,t,r)=>({id:`dsh-drydock#pluginManagerPro/${e}`,service:"pluginManagerPro",namespace:"pluginManagerPro",method:e,invocation:{kind:"direct"},parameters:t,result:Np(`dsh-drydock/types#${Ch.has(e)?"PluginManagerSnapshot":Th.has(e)?e==="quarantine"?"PluginManagerQuarantineReceipt":e==="uninstallPackages"?"PluginManagerUninstallReceipt":"PluginManagerMutationReceipt":Oh[e]??"PluginManagerMutationReceipt"}`,r)}),jp=[W("list",[],ce),W("refresh",[],ce),W("getSources",[],ce),W("setSources",[Q("sources",l.array(Op)),Q("options",lh.nullable())],ce),W("setEnabled",[Q("entryId",l.string()),Q("enabled",l.boolean())],Bg),W("resetToggles",[],ce),W("update",[Q("packageNames",l.array(l.string()))],Vg),W("diagnose",[],qg),W("quarantine",[Q("entryIds",l.array(l.string()))],Kg),W("repairHarness",[],Yg),W("restartHarness",[],Xg),W("uninstallPackages",[Q("packageNames",l.array(l.string())),Q("options",ch)],th),W("uninstallPreview",[Q("packageNames",l.array(l.string()))],ah),W("operationHistory",[],fh),W("undoOperation",[Q("id",l.string())],mh),W("setSourceOverride",[Q("packageName",l.string()),Q("source",l.string().nullable())],ce),W("scenarioList",[],Oo),W("scenarioSave",[Q("name",l.string())],Oo),W("scenarioUpdate",[Q("id",l.string())],Oo),W("scenarioDelete",[Q("id",l.string())],Oo),W("scenarioApply",[Q("id",l.string()),Q("dryRun",l.boolean())],hh),W("getRescueConfig",[],Tp),W("setRescueConfig",[Q("config",Tp)],ce),W("getDownloadConfig",[],yh),W("checkDownloads",[],vh),W("resolveDownloadUrl",[Q("packageName",l.string())],xh),W("verifyProfile",[],zh),W("fixProfile",[],Sh),W("updateBrowser",[Q("packageNames",l.array(l.string()))],_h),W("marketCatalog",[],Zh),W("marketInstall",[Q("target",$h),Q("dryRun",l.boolean())],Ih),W("selfUpdateStatus",[],tu),W("selfUpdatePrepare",[],tu),W("selfUpdateDecide",[Q("decision",l.string())],tu)],Rh={package:"dsh-drydock",descriptors:jp},Ah={package:"dsh-drydock",face:"host",schemas:[],invocations:jp,model:{services:[],events:[],objects:[]}}});var Xh={};Pe(Xh,{OfficialPluginsPanel:()=>cf,PluginManagerTab:()=>Xp,SEARCH_DEBOUNCE_MS:()=>Kp,apply:()=>Yh,configSurfacesFor:()=>Gp,entryInstalled:()=>nf,inject:()=>Kh,marketFilterItems:()=>of,sectionKeyOfEntry:()=>iu,shouldDebounceSearch:()=>Yp});module.exports=Bf(Xh);var No=Hf(require("react"),1),a=require("react/jsx-runtime"),{useEffect:$e,useMemo:Qt,useState:O,useSyncExternalStore:qp}=No,Fr="settings.pluginManagerPro",Fe={red:"#ef4444",yellow:"#f59e0b",green:"#22c55e",blue:"#4f8cff",grey:"#9ca3af"},Nh={error:{color:Fe.red,key:"statusError"},update:{color:Fe.yellow,key:"statusUpdate"},disabled:{color:Fe.grey,key:"statusDisabled"},enabled:{color:Fe.green,key:"statusEnabled"}},ru={core:{color:Fe.red,key:"necessityCore"},builtin:{color:Fe.blue,key:"necessityBuiltin"},user:{color:Fe.green,key:"necessityUser"}},Up=["core","builtin","user"],jh=new Set(["@deepseek-ai/dsh-base","@deepseek-ai/dsh-web-app"]),Dh=new Set(["@caob23/dsh-browser-control"]),Lp="dsh-drydock",Mh="drydock";function iu(e){let t=e?.section;if(t==="core"||t==="builtin"||t==="user")return t;let r=String(e?.packageName??e?.moduleName??e?.configId??"").toLocaleLowerCase();return jh.has(r)?"core":e?.origin==="user"?"user":"builtin"}function Uh(e){let t=String(e?.packageName??e?.moduleName??e?.configId??"").toLocaleLowerCase();return Dh.has(t)}var Lh=Object.freeze({rows:Object.freeze([]),bundles:Object.freeze([])}),nu=Object.freeze({getSnapshot:()=>Lh,subscribe:()=>()=>{}}),Fh=Object.freeze([]),ou=Object.freeze({getSnapshot:()=>Fh,subscribe:()=>()=>{}});function Gp(e,t){if(e==null||t===null||t===void 0)return{rows:[],bundles:[]};let r=[e.packageName,e.moduleName,e.configId].filter(i=>typeof i=="string"&&i!=="").map(i=>i.toLocaleLowerCase());if(r.length===0)return{rows:[],bundles:[]};let n=[];for(let i of t.rows??[]){if(typeof i!="string")continue;let s=i.lastIndexOf("#");s<=0||r.includes(i.slice(0,s).toLocaleLowerCase())&&n.push({key:i,rowId:i.slice(s+1)})}n.sort((i,s)=>i.key.localeCompare(s.key));let o=[];for(let i of t.bundles??[])typeof i!="string"||i===""||r.includes(i.toLocaleLowerCase())&&o.push({key:i});return o.sort((i,s)=>i.key.localeCompare(s.key)),{rows:n,bundles:o}}function Hh(e){return e.phase==="failed"||e.error?"error":e.needsUpdate===!0?"update":e.enabled?"enabled":"disabled"}function Fp(e){return typeof e!="string"?e:/EBUSY|EPERM|EACCES|resource busy|used by another process/i.test(e)?`${e} \u2014\u2014 \u6587\u4EF6\u53EF\u80FD\u88AB\u5360\u7528\uFF1A\u8BF7\u5173\u95ED\u6B63\u5728\u4F7F\u7528\u8BE5\u76EE\u5F55\u7684\u7A0B\u5E8F\uFF08\u7EC8\u7AEF / \u7F16\u8F91\u5668 / \u6740\u6BD2\u626B\u63CF\uFF09\u540E\u91CD\u8BD5\uFF0C\u5FC5\u8981\u65F6\u91CD\u542F\u5F15\u64CE\u518D\u8BD5\u3002`:e}var Kp=120;function Yp(e,t){return e!==t}function Xp({list:e,refresh:t,setEnabled:r,update:n,setSources:o,resetToggles:i,diagnose:s,quarantine:c,repairHarness:u,restartHarness:d,uninstallPackages:m,uninstallPreview:h,operationHistory:b,undoOperation:p,setSourceOverride:x,scenarioList:k,scenarioSave:y,scenarioUpdate:$,scenarioDelete:E,scenarioApply:Z,getRescueConfig:S,setRescueConfig:D,getDownloadConfig:C,checkDownloads:B,updateBrowser:H,verifyProfile:tt,fixProfile:N,marketCatalog:U,marketInstall:be,selfUpdateStatus:ie,selfUpdatePrepare:ve,selfUpdateDecide:Ae,t:_,embedded:Ee=!1,onlyUpdatable:rt=!1,renderSlot:Ne,configSurfaces:He}){let[er,g]=O(0),[R,ee]=O(!1),[je,tr]=O(""),[rr,uf]=O(""),[yt,jo]=O("all"),[df,Do]=O(new Set(["core"])),[au,pf]=O(!1),[lu,ff]=O(!1),[cu,uu]=O(!1),[du,mf]=O(!1),[pu,gf]=O(!1),[ke,fu]=O(null),[mu,hf]=O({q:"",n:0}),[gu,hu]=O(null),[Qh,ey]=O(null),[re,yu]=O(null),[nt,X]=O(null),[ne,bt]=O({status:"loading"}),[ae,nr]=O({status:"idle",data:null,busy:null,message:null}),bu=qp((He??nu).subscribe,(He??nu).getSnapshot,(He??nu).getSnapshot),yf=typeof Ne=="function";$e(()=>{let v=!0;return bt({status:"loading"}),e().then(P=>{v&&bt({status:"ready",snapshot:P})},P=>{v&&bt({status:"error",message:P instanceof Error?P.message:String(P)})}),()=>{v=!1}},[e,er]);let bf=rr.trim()!=="";$e(()=>{if(!Yp(je,rr))return;let v=setTimeout(()=>uf(je),Kp);return()=>clearTimeout(v)},[je,rr]);let Mo=Qt(()=>{if(ne.status!=="ready")return[];let v=rr.trim().toLocaleLowerCase(),P=ne.snapshot.entries.filter(w=>(rt||R)&&!(w.needsUpdate===!0&&w.managed)||yt!=="all"&&w.origin!==yt?!1:v?w.configId.toLocaleLowerCase().includes(v)||w.description.toLocaleLowerCase().includes(v)||w.moduleName.toLocaleLowerCase().includes(v):!0);return Up.map(w=>({key:w,entries:P.filter(Y=>iu(Y)===w)})).filter(w=>w.entries.length>0)},[rr,yt,ne.snapshot?.entries,rt,R]),vu=Qt(()=>{if(ne.status!=="ready")return{builtin:0,user:0};let v=0,P=0;for(let w of ne.snapshot.entries)w.origin==="user"?P+=1:v+=1;return{builtin:v,user:P}},[ne.snapshot?.entries]),vf=Qt(()=>{let v=new Map;if(ne.status!=="ready")return v;for(let P of ne.snapshot.entries){let w=Gp(P,bu);(w.rows.length>0||w.bundles.length>0)&&v.set(P.entryId,w)}return v},[bu,ne.snapshot?.entries]),vt=Qt(()=>ne.status!=="ready"?[]:ne.snapshot.entries.filter(v=>v.needsUpdate===!0&&v.managed),[ne.snapshot?.entries]),xu=v=>{typeof requestAnimationFrame>"u"||typeof window>"u"||typeof window.scrollTo!="function"||requestAnimationFrame(()=>window.scrollTo(0,v))},Be=async(v,P)=>{let w=typeof window<"u"&&typeof document<"u"?window.scrollY??window.pageYOffset??document.documentElement?.scrollTop??0:0;yu(v),X(null);try{let Y=await P(),oe=Y?.snapshot??Y;return bt({status:"ready",snapshot:oe}),xu(w),Y}catch(Y){return X({severity:"error",message:Fp(Y instanceof Error?Y.message:String(Y))}),xu(w),null}finally{yu(null)}},wu=()=>Be("refresh",()=>t()).then(v=>{let P=v?.lastRefresh??null;if(P===null)return;let w=Math.max(1,Math.round((P?.durationMs??0)/1e3));P.aborted?X({severity:"warning",message:`${_("refreshAborted")}\uFF08${w}s / ${Math.round((P.budgetMs??0)/1e3)}s\uFF0C\u5DF2\u67E5 ${P.checked??0}/${P.total??0}\uFF09${_("refreshAbortedHint")}`}):X({severity:"success",message:`${_("refreshDone")}\uFF08${w}s\uFF0C${P.checked??0}/${P.total??0}\uFF09`})}),xf=async v=>{let P=String(v.packageName??v.moduleName??v.configId??"").split("/").pop()??"";try{typeof U=="function"&&await U()}catch{}hf(w=>({q:P,n:w.n+1})),uu(!0)},wf=(v,P)=>{let w=P==="auto"?null:P;Be(`source:${v.packageName}`,()=>x(v.packageName,w)).then(Y=>{Y&&X({severity:"success",message:`${v.packageName} \u6765\u6E90\u5DF2\u4FDD\u5B58\u3002`})})},_f=v=>Be(`entry:${v.entryId}`,()=>r(v.entryId,!v.enabled)).then(P=>{if(!P)return;let w=P.items.filter(oe=>oe.status==="failed").map(oe=>oe.message).filter(Boolean).join(" "),Y=P.items.filter(oe=>oe.status==="restart-required").map(oe=>oe.message).filter(Boolean).join(" ");w?X({severity:"error",message:Fp(w)}):Y&&X({severity:"warning",message:Y})}),kf=v=>{try{let P=document.createElement("iframe");return P.style.display="none",P.src=v,document.body.appendChild(P),setTimeout(()=>{P.parentNode!==null&&P.parentNode.removeChild(P)},6e4),!0}catch{return!1}},zf=(v=12e4)=>new Promise(P=>{let w=Date.now(),Y=setInterval(async()=>{try{let oe=await B();if((oe.installed??[]).length>0){clearInterval(Y),P(oe);return}}catch{}Date.now()-w>v&&(clearInterval(Y),P(null))},5e3)}),Sf=v=>Be(`update:${v.packageName}`,()=>H([v.packageName])).then(async P=>{if(!P||P.items.length===0)return;let w=P.items[0];if(w.status==="need-download"&&w.url){X({severity:"warning",message:`${w.packageName} \u2192 ${w.latestVersion}\uFF1A\u5DF2\u89E6\u53D1\u6D4F\u89C8\u5668\u4E0B\u8F7D${w.url.startsWith("magnet:")?"\uFF08P2P \u78C1\u529B\u94FE\u63A5\uFF0C\u6D4F\u89C8\u5668\u53EF\u80FD\u65E0\u6CD5\u76F4\u63A5\u5904\u7406\uFF0C\u53EF\u7528 NDM/\u6BD4\u7279\u5F57\u661F\u5BFC\u5165\uFF09":""}\u3002\u4E0B\u8F7D\u5B8C\u6210\u540E\u7BA1\u7406\u5668\u81EA\u52A8\u5B89\u88C5\uFF08${_("dlDir")}\uFF1A\u89C1\u6551\u63F4\u9762\u677F\uFF09\u3002\u82E5\u6D4F\u89C8\u5668\u672A\u5F00\u59CB\u4E0B\u8F7D\uFF0C\u8BF7\u70B9\u51FB\u300C\u5185\u7F6E\u4E0B\u8F7D\u300D\u3002`}),kf(w.url);let Y=await zf();Y!==null&&X({severity:"success",message:`${w.packageName}: ${_("dlInstalled")} ${Y.installed.join(", ")}\u3002\u91CD\u542F profile \u540E\u751F\u6548\u3002`});return}w.status==="up-to-date"?X({severity:"success",message:`${w.packageName}: ${_("upToDate")}`}):w.status==="failed"?X({severity:"error",message:`${w.packageName}: ${w.message}`}):w.status==="network-error"?X({severity:"warning",message:`${w.packageName}: ${w.message}`}):w.status==="not-found"?X({severity:"warning",message:`${w.packageName}: ${w.message}`}):w.status==="not-managed"&&X({severity:"warning",message:`${w.packageName}: ${w.message}`})}),$f=v=>Be(`update:${v.packageName}`,()=>n([v.packageName])).then(P=>{if(!P||P.items.length===0)return;let w=P.items[0];w.status==="updated"?X({severity:"success",message:`${w.packageName}: ${w.message}`}):w.status==="failed"?X({severity:"error",message:`${w.packageName}: ${w.message}`}):w.status==="network-error"?X({severity:"warning",message:`${w.packageName}: ${w.message}`}):w.status==="not-found"?X({severity:"warning",message:`${w.packageName}: ${w.message}`}):w.status==="not-managed"?X({severity:"warning",message:`${w.packageName}: ${w.message}`}):w.status==="up-to-date"&&X({severity:"success",message:`${w.packageName}: ${_("upToDate")}`})}),Pf=()=>{if(vt.length===0)return;let v=vt.map(P=>P.packageName);Be("update:all",()=>n(v)).then(P=>{if(!P)return;let w=P.items.filter(me=>me.status==="updated").length,Y=P.items.filter(me=>me.status==="failed").map(me=>`${me.packageName}: ${me.message}`).join(" "),oe=P.items.filter(me=>me.status!=="updated"&&me.message).map(me=>`${me.packageName}: ${me.message}`).join("\uFF1B"),T=[];w>0&&T.push(`${w} \u4E2A\u5DF2\u66F4\u65B0`),oe&&T.push(oe),X(Y?{severity:"error",message:T.join("\uFF1B")}:{severity:"success",message:T.join("\uFF1B")})})},Zf=()=>{window.confirm(_("resetConfirm"))&&Be("reset",()=>i()).then(v=>{v&&X({severity:"success",message:_("resetDone")})})},If=v=>{let P=Array.isArray(v)&&v.some(w=>w&&w.authoritative===!0&&w.official!==!0);if(!(P&&!window.confirm(_("sourcesAuthoritativeConfirm"))))return Be("sources",()=>o(v,P?{confirm:!0}:null)).then(w=>{w&&X({severity:"success",message:_("sourcesSaved")}),setTimeout(()=>wu(),400)})},Ef=v=>{Do(P=>{let w=new Set(P);return w.has(v)?w.delete(v):w.add(v),w})},Cf=()=>Do(new Set(Up)),Tf=()=>Do(new Set);$e(()=>{let v=!0;if(typeof ie=="function")return ie().then(P=>{v&&nr(w=>({...w,status:"ready",data:P}))},P=>{v&&nr(w=>({...w,status:"error",message:String(P?.message??P)}))}),()=>{v=!1}},[ie]);let Uo=async v=>{if(!(v==="prepare"?typeof ve!="function":typeof Ae!="function")){nr(P=>({...P,busy:v,message:null}));try{let P=v==="prepare"?await ve():await Ae(v);nr({status:"ready",data:P,busy:null,message:P?.message??null})}catch(P){nr(w=>({...w,busy:null,message:String(P?.message??P)}))}}};if(ne.status==="loading")return(0,a.jsx)("p",{style:{color:"var(--dsw-alias-label-tertiary)",fontSize:13},children:_("loading")});if(ne.status==="error")return(0,a.jsxs)("div",{role:"alert",style:{display:"flex",gap:10,alignItems:"center",color:"var(--dsw-alias-state-error-primary)",fontSize:13},children:[(0,a.jsxs)("span",{children:[_("error")," ",(0,a.jsx)("small",{children:ne.message})]}),(0,a.jsx)("button",{type:"button",onClick:()=>g(v=>v+1),style:A,children:_("retry")})]});let or=ne.snapshot;return(0,a.jsxs)("section",{"aria-label":_("title"),style:{width:"100%",maxWidth:Ee?"none":880,display:"flex",flexDirection:"column",gap:10,color:"var(--dsw-alias-label-primary)"},children:[(0,a.jsxs)("header",{style:{display:"flex",flexDirection:"column",gap:8},children:[Ee?null:(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[(0,a.jsxs)("h3",{style:{margin:0,fontSize:17,fontWeight:700},children:[(0,a.jsx)(lf,{size:18})," ",_("title")]}),(0,a.jsx)("span",{style:{fontSize:11,fontWeight:600,padding:"2px 9px",borderRadius:999,background:"color-mix(in srgb, var(--dsw-alias-state-business-primary, #4f8cff) 14%, transparent)",color:"var(--dsw-alias-state-business-primary, #4f8cff)",whiteSpace:"nowrap"},children:_("managerBadge")}),(0,a.jsxs)("span",{style:{marginLeft:"auto",fontSize:12,color:"var(--dsw-alias-label-tertiary)"},children:[_("profile"),": ",(0,a.jsx)("code",{style:{fontFamily:"var(--ds-font-family-code)"},children:or.profileName})]})]}),ae.data!==null?(0,a.jsxs)("div",{"data-self-update-banner":!0,style:{border:"1px solid var(--dsw-alias-border-l2)",borderRadius:8,padding:"8px 10px",background:"var(--dsw-alias-bg-layer-1)",display:"flex",gap:8,alignItems:"center",flexWrap:"wrap",fontSize:12.5},children:[(0,a.jsx)("span",{style:{fontWeight:600},children:_("selfUpdateTitle")}),(0,a.jsx)("span",{style:{color:"var(--dsw-alias-label-secondary)"},children:ae.data.pending!==null?`${ae.data.pending.currentVersion} \u2192 ${ae.data.pending.targetVersion}\uFF08${ae.data.pending.channel}\uFF09`:_("selfUpdateUpToDate").replace("{v}",ae.data.currentVersion)}),ae.data.pending!==null&&ae.data.pending.phase==="running"?(0,a.jsx)("span",{style:{color:"var(--dsw-alias-label-secondary)"},children:_("selfUpdateRunning")}):ae.data.pending!==null?ae.data.canApply?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("button",{type:"button",onClick:()=>Uo("now"),disabled:ae.busy!==null,style:{...A,fontWeight:600,background:"var(--dsw-alias-state-business-primary, #4f8cff)",borderColor:"var(--dsw-alias-state-business-primary, #4f8cff)",color:"#fff"},children:_("selfUpdateNow")}),(0,a.jsx)("button",{type:"button",onClick:()=>Uo("later"),disabled:ae.busy!==null,style:A,children:_("selfUpdateLater")})]}):(0,a.jsx)("span",{style:{color:"var(--dsw-alias-label-tertiary)"},children:_("selfUpdateDesktopOnly")}):(0,a.jsx)("button",{type:"button",onClick:()=>Uo("prepare"),disabled:ae.busy!==null,style:A,children:ae.busy==="prepare"?_("selfUpdateChecking"):_("selfUpdateCheck")}),ae.message!==null?(0,a.jsx)("span",{style:{color:"var(--dsw-alias-label-secondary)"},children:ae.message}):null]}):null,(0,a.jsxs)("div",{style:{display:"flex",gap:6,alignItems:"center",flexWrap:"wrap"},children:[(0,a.jsxs)("label",{style:{flex:"1 1 210px",position:"relative",display:"inline-flex",alignItems:"center",minWidth:200},children:[(0,a.jsx)("span",{style:{position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0},children:_("search")}),(0,a.jsx)("input",{type:"search",value:je,placeholder:_("search"),onChange:v=>tr(v.currentTarget.value),style:{boxSizing:"border-box",width:"100%",height:32,border:"1px solid var(--dsw-alias-border-l2)",background:"var(--dsw-alias-bg-layer-1)",color:"var(--dsw-alias-label-primary)",borderRadius:8,padding:"0 12px",fontSize:13,font:"inherit"}})]}),vt.length>0?(0,a.jsxs)("button",{type:"button",onClick:Pf,disabled:re!==null,style:{...A,background:"var(--dsw-alias-state-business-primary, #4f8cff)",borderColor:"var(--dsw-alias-state-business-primary, #4f8cff)",color:"#fff",fontWeight:600},children:[_("updateAll")," (",vt.length,")"]}):null,Ee?vt.length>0?(0,a.jsxs)("button",{type:"button",onClick:()=>ee(v=>!v),style:{...A,fontWeight:rt||R?600:400},children:[_("onlyUpdatable")," (",vt.length,")"]}):null:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("button",{type:"button",onClick:()=>uu(v=>!v),disabled:re!==null,style:{...A,color:"var(--dsw-alias-state-business-primary, #4f8cff)",borderColor:"var(--dsw-alias-state-business-primary, #4f8cff)",fontWeight:cu?600:400},children:_("market")}),(0,a.jsx)("button",{type:"button",onClick:()=>ff(v=>!v),disabled:re!==null,style:{...A,color:"var(--dsw-alias-state-error-primary)",borderColor:"var(--dsw-alias-state-error-primary)",fontWeight:lu?600:400},children:_("rescue")}),(0,a.jsx)("button",{type:"button",onClick:()=>pf(v=>!v),style:{...A,fontWeight:au?600:400},children:_("sources")}),(0,a.jsx)("button",{type:"button",onClick:()=>mf(v=>!v),disabled:re!==null,style:{...A,fontWeight:du?600:400},children:_("scenarios")}),(0,a.jsx)("button",{type:"button",onClick:()=>gf(v=>!v),disabled:re!==null,style:{...A,fontWeight:pu?600:400},children:_("history")})]}),(0,a.jsx)("button",{type:"button",onClick:Zf,disabled:re!==null,style:{...A,color:"var(--dsw-alias-state-error-primary)",borderColor:"var(--dsw-alias-state-error-primary)"},children:_("resetToggles")}),(0,a.jsx)("button",{type:"button","aria-label":_("refresh"),title:_("refresh"),onClick:wu,disabled:re!==null,style:{...A,width:32,height:32,display:"grid",placeItems:"center"},children:re==="refresh"?"\u2026":"\u21BB"})]})]}),gu!==null?(0,a.jsx)(ef,{packageName:gu,preview:h,uninstall:m,t:_,onDone:v=>{hu(null),v&&g(P=>P+1)}}):null,au?(0,a.jsx)(af,{sources:or.sources,save:If,busy:re!==null,t:_}):null,cu?(0,a.jsx)(sf,{initialQuery:mu.q,marketCatalog:U,marketInstall:be,busy:re!==null,t:_,entries:ne.status==="ready"?ne.snapshot.entries:[]},mu.n):null,du?(0,a.jsx)(rf,{scenarioList:k,scenarioSave:y,scenarioUpdate:$,scenarioDelete:E,scenarioApply:Z,onSnapshot:v=>bt({status:"ready",snapshot:v}),t:_}):null,pu?(0,a.jsx)(tf,{operationHistory:b,undoOperation:p,onSnapshot:v=>bt({status:"ready",snapshot:v}),t:_}):null,lu?(0,a.jsx)(Qp,{diagnose:s,quarantine:c,repairHarness:u,restartHarness:d,uninstallPackages:m,uninstallPreview:h,getRescueConfig:S,setRescueConfig:D,getDownloadConfig:C,checkDownloads:B,verifyProfile:tt,fixProfile:N,managed:or.entries.filter(v=>v.origin==="user"),t:_}):null,(0,a.jsxs)("div",{style:{display:"flex",gap:6,flexWrap:"wrap",alignItems:"center"},children:[(0,a.jsxs)("span",{style:{fontSize:12,color:"var(--dsw-alias-label-tertiary)",fontWeight:600},children:[_("originLegend"),":"]}),(0,a.jsxs)("button",{type:"button",onClick:()=>jo("all"),style:{...Hr,...yt==="all"?Br:null},children:[_("originAll")," (",ne.snapshot.entries.length,")"]}),(0,a.jsxs)("button",{type:"button",onClick:()=>jo("builtin"),style:{...Hr,...yt==="builtin"?Br:null},children:[_("originBuiltin")," (",vu.builtin,")"]}),(0,a.jsxs)("button",{type:"button",onClick:()=>jo("user"),style:{...Hr,...yt==="user"?Br:null},children:[_("originUser")," (",vu.user,")"]})]}),or.entries.length===0?(0,a.jsx)("p",{style:{color:"var(--dsw-alias-label-tertiary)",fontSize:13},children:_("empty")}):null,or.entries.length>0&&Mo.length===0?(0,a.jsx)("p",{style:{color:"var(--dsw-alias-label-tertiary)",fontSize:13},children:_("emptySearch")}):null,nt?(0,a.jsx)("p",{role:nt.severity==="error"?"alert":"status",style:{margin:0,fontSize:12,lineHeight:"18px",padding:"6px 10px",borderRadius:6,background:nt.severity==="error"?"color-mix(in srgb, var(--dsw-alias-state-error-primary) 12%, transparent)":nt.severity==="warning"?"color-mix(in srgb, var(--dsw-alias-state-warning-primary, #f59e0b) 12%, transparent)":"color-mix(in srgb, var(--dsw-alias-state-success-primary, #22c55e) 12%, transparent)",color:nt.severity==="error"?"var(--dsw-alias-state-error-primary)":nt.severity==="warning"?"var(--dsw-alias-state-warning-primary, #f59e0b)":"var(--dsw-alias-state-success-primary, #22c55e)"},children:nt.message}):null,Mo.length>1?(0,a.jsxs)("div",{style:{display:"flex",gap:6,justifyContent:"flex-end",fontSize:12},children:[(0,a.jsx)("button",{type:"button",onClick:Cf,style:ht,children:_("expandAll")}),(0,a.jsx)("button",{type:"button",onClick:Tf,style:ht,children:_("collapseAll")})]}):null,(0,a.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Mo.map(v=>{let P=ru[v.key],w=v.entries.filter(T=>T.enabled).length,Y=v.entries.filter(T=>T.needsUpdate===!0&&T.managed).length,oe=bf||df.has(v.key);return(0,a.jsxs)("section",{style:{border:"1px solid var(--dsw-alias-border-l2)",background:"var(--dsw-alias-bg-layer-3)",borderRadius:10,overflow:"hidden"},children:[(0,a.jsxs)("header",{style:{display:"flex",alignItems:"center",gap:8,padding:"9px 12px",cursor:"pointer",userSelect:"none"},onClick:()=>Ef(v.key),children:[(0,a.jsx)("span",{"aria-hidden":"true",style:{width:10,height:10,borderRadius:"50%",background:P.color,flex:"none",transition:"opacity 120ms ease",opacity:oe?1:.55}}),(0,a.jsx)("span",{style:{fontSize:13.5,fontWeight:700},children:_(P.key)}),(0,a.jsxs)("span",{style:{fontSize:12,color:"var(--dsw-alias-label-tertiary)"},children:[w,"/",v.entries.length]}),Y>0?(0,a.jsxs)("span",{style:{fontSize:11,padding:"1px 7px",borderRadius:999,background:"color-mix(in srgb, var(--dsw-alias-state-warning-primary, #f59e0b) 16%, transparent)",color:"var(--dsw-alias-state-warning-primary, #f59e0b)",fontWeight:600},children:[_("updateAvailable")," ",Y]}):null,(0,a.jsx)("span",{style:{marginLeft:"auto",fontSize:12,color:"var(--dsw-alias-label-tertiary)"},children:oe?"\u25BE":"\u25B8"})]}),oe?(0,a.jsx)("ul",{style:{listStyle:"none",margin:0,padding:"0 8px 8px",display:"flex",flexDirection:"column",gap:6},children:v.entries.map(T=>{let me=Hh(T),Lo=Nh[me],xt=iu(T),Of=T.packageName===Lp||T.moduleName===Lp||T.configId===Mh,Fo=re===`entry:${T.entryId}`||re===`update:${T.packageName}`,Rf=re===`update:${T.packageName}`||re==="update:all",Af=T.needsUpdate===!0&&T.managed&&!Rf,_u=yf?vf.get(T.entryId):void 0,De=_u?.rows?.[0],ot=_u?.bundles?.[0],wt=De?`row:${De.key}`:null,_t=ot?`bundle:${ot.key}`:null,Nf=ke!==null&&(ke===wt||ke===_t);return(0,a.jsxs)("li",{style:{display:"block",padding:"9px 12px",border:"1px solid var(--dsw-alias-border-l2)",background:"var(--dsw-alias-bg-layer-1)",borderRadius:10,minWidth:0},children:[(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,minWidth:0},children:[(0,a.jsxs)("span",{title:T.error??void 0,style:{display:"inline-flex",alignItems:"center",gap:5,flex:"none",width:86,fontSize:12,color:Lo.color},children:[(0,a.jsx)("i",{style:{width:9,height:9,borderRadius:"50%",background:Lo.color,display:"inline-block",flex:"none"}}),_(Lo.key)]}),(0,a.jsxs)("div",{style:{flex:"1 1 auto",minWidth:0},children:[(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,minWidth:0},children:[(0,a.jsx)("strong",{style:{fontSize:13,fontWeight:600,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:T.configId}),Of?(0,a.jsx)("span",{title:_("managerBadge"),style:{flex:"none",fontSize:11,fontWeight:600,padding:"1px 8px",borderRadius:999,background:"color-mix(in srgb, var(--dsw-alias-state-business-primary, #4f8cff) 14%, transparent)",color:"var(--dsw-alias-state-business-primary, #4f8cff)",whiteSpace:"nowrap"},children:_("managerBadge")}):null,Uh(T)?(0,a.jsx)("span",{title:_("recommendedTagHint"),style:{flex:"none",fontSize:11,fontWeight:600,padding:"1px 8px",borderRadius:999,background:"color-mix(in srgb, var(--dsw-alias-state-success-primary, #22c55e) 14%, transparent)",color:"var(--dsw-alias-state-success-primary, #22c55e)",whiteSpace:"nowrap"},children:_("recommendedTag")}):null,(0,a.jsx)("span",{style:{color:"var(--dsw-alias-label-tertiary)",fontSize:11,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:T.moduleName})]}),(0,a.jsx)("p",{style:{margin:"2px 0 0",color:"var(--dsw-alias-label-secondary)",fontSize:12,lineHeight:"18px"},children:T.description}),De?(0,a.jsx)("div",{style:{margin:"2px 0 0",fontSize:11.5,lineHeight:"17px",color:"var(--dsw-alias-label-tertiary)"},children:Ne("plugins.row.config",{view:"summary"},{entryKey:De.key})}):null,T.installedVersion||T.latestVersion?(0,a.jsxs)("p",{style:{margin:"2px 0 0",color:"var(--dsw-alias-label-tertiary)",fontSize:11,fontFamily:"var(--ds-font-family-code)"},children:[T.installedVersion??"?",T.latestVersion?` \u2192 ${T.latestVersion}`:"",T.updateSource?` (${T.updateSource})`:"",Vh(_,T)]}):null]}),T.needsUpdate===!0&&!T.managed?(0,a.jsx)("span",{title:T.moduleName,style:{flex:"none",fontSize:11,color:"var(--dsw-alias-label-tertiary)"},children:_("notManaged")}):null,(0,a.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-end",gap:6,flex:"none"},children:[(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"nowrap"},children:[T.origin==="user"?(0,a.jsx)("span",{title:_("originUserHint"),style:{flex:"none",fontSize:11,padding:"2px 8px",borderRadius:999,border:"1px solid var(--dsw-alias-state-business-primary, #4f8cff)",color:"var(--dsw-alias-state-business-primary, #4f8cff)",whiteSpace:"nowrap"},children:_("originUser")}):null,(0,a.jsx)("span",{style:{flex:"none",fontSize:11,fontWeight:600,padding:"2px 8px",borderRadius:999,border:`1px solid ${ru[xt]?.color??Fe.yellow}`,color:ru[xt]?.color??Fe.yellow},children:_(xt==="core"?"badgeCore":xt==="builtin"?"badgeBuiltin":"badgeUser")}),T.archived?(0,a.jsx)("span",{title:T.protectionReason,style:{flex:"none",fontSize:11,padding:"2px 8px",borderRadius:999,border:"1px solid var(--dsw-alias-border-l2)",color:"var(--dsw-alias-label-tertiary)",whiteSpace:"nowrap"},children:_("archived")}):null,(0,a.jsxs)("label",{title:T.protected?T.protectionReason:`${T.configId}: ${T.enabled?_("disableEntry"):_("enableEntry")}`,style:{flex:"none",display:"inline-flex",alignItems:"center",cursor:T.protected||Fo?"not-allowed":"pointer",opacity:T.protected?.55:1},children:[(0,a.jsx)("input",{type:"checkbox",checked:T.enabled,disabled:T.protected||Fo,"aria-label":`${T.configId}: ${T.enabled?_("disableEntry"):_("enableEntry")}`,onChange:()=>_f(T),style:{position:"absolute",opacity:0,pointerEvents:"none"}}),(0,a.jsx)("span",{"aria-hidden":"true",style:{position:"relative",width:36,height:20,borderRadius:999,background:T.enabled?"var(--dsw-alias-state-business-primary, #4f8cff)":"var(--dsw-alias-border-l2)",transition:"background 120ms ease"},children:(0,a.jsx)("i",{style:{position:"absolute",top:2,left:T.enabled?18:2,width:16,height:16,borderRadius:"50%",background:"#fff",transition:"left 120ms ease"}})}),Fo?(0,a.jsx)("span",{style:{marginLeft:6,fontSize:12,color:"var(--dsw-alias-label-tertiary)"},children:"\u2026"}):null]})]}),T.origin==="user"||T.protected||De!==void 0||ot!==void 0||xt!=="core"?(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,flexWrap:"nowrap"},children:[T.origin==="user"?(0,a.jsx)("label",{title:_("sourceOverrideHint"),style:{flex:"none",display:"inline-flex",alignItems:"center",gap:3,fontSize:10.5,color:"var(--dsw-alias-label-tertiary)"},children:(0,a.jsxs)("select",{value:T.sourceOverride??T.source??"npm",onChange:jf=>wf(T,jf.currentTarget.value),disabled:re!==null,"aria-label":`${T.configId}: ${_("sourceOverrideHint")}`,style:{fontSize:10.5,borderRadius:5,border:"1px solid var(--dsw-alias-border-l2)",background:"var(--dsw-alias-bg-layer-1)",color:"var(--dsw-alias-label-secondary)",padding:"1px 2px",maxWidth:76,cursor:"pointer"},children:[(0,a.jsx)("option",{value:"auto",children:_("sourceAuto")}),(0,a.jsx)("option",{value:"npm",children:_("sourceNpm")}),(0,a.jsx)("option",{value:"github",children:_("sourceGithub")}),(0,a.jsx)("option",{value:"local",children:_("sourceLocal")}),(0,a.jsx)("option",{value:"builtin",children:_("sourceBuiltin")})]})}):null,Af?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("button",{type:"button",onClick:()=>Sf(T),disabled:re!==null,style:{...A,flex:"none",fontWeight:600,color:"var(--dsw-alias-state-warning-primary, #f59e0b)",borderColor:"var(--dsw-alias-state-warning-primary, #f59e0b)"},children:_("update")}),(0,a.jsx)("button",{type:"button",onClick:()=>$f(T),disabled:re!==null,title:_("updateInternalHint"),style:{...A,flex:"none",fontSize:11,color:"var(--dsw-alias-label-tertiary)"},children:_("updateInternal")})]}):null,T.protected?(0,a.jsx)("span",{title:T.protectionReason,style:{flex:"none",fontSize:12,opacity:.75,cursor:"help"},children:"\u{1F512}"}):null,T.origin==="user"?(0,a.jsx)("button",{type:"button",onClick:()=>hu(T.packageName),disabled:re!==null,title:_("uninstallRowHint"),style:{...A,flex:"none",fontWeight:600,fontSize:11,color:"var(--dsw-alias-state-error-primary)",borderColor:"var(--dsw-alias-state-error-primary)",whiteSpace:"nowrap"},children:_("rescueUninstall")}):null,xt!=="core"?(0,a.jsx)("button",{type:"button",onClick:()=>xf(T),disabled:re!==null,title:_("marketDetailHint"),style:{...A,flex:"none",fontSize:11,whiteSpace:"nowrap"},children:_("marketDetail")}):null,De?(0,a.jsxs)("button",{type:"button",onClick:()=>fu(ke===wt?null:wt),title:`${_("configEntryHint")} \xB7 ${De.key}`,"aria-expanded":ke===wt,style:{...A,flex:"none",fontWeight:600,fontSize:11,color:"var(--dsw-alias-state-business-primary, #4f8cff)",borderColor:"var(--dsw-alias-state-business-primary, #4f8cff)",whiteSpace:"nowrap"},children:["\u2699 ",_(ke===wt?"officialClose":"configEntry")]}):null,ot?(0,a.jsxs)("button",{type:"button",onClick:()=>fu(ke===_t?null:_t),title:`${_("configEntryHint")} \xB7 ${ot.key}`,"aria-expanded":ke===_t,style:{...A,flex:"none",fontWeight:600,fontSize:11,color:"var(--dsw-alias-state-business-primary, #4f8cff)",borderColor:"var(--dsw-alias-state-business-primary, #4f8cff)",whiteSpace:"nowrap"},children:["\u2699 ",_(ke===_t?"officialClose":"configBundleEntry")]}):null]}):null]})]}),Nf?(0,a.jsxs)("div",{"data-plugin-config-entry":ke,style:{marginTop:8,border:"1px solid var(--dsw-alias-border-l2)",borderRadius:8,padding:"10px 12px",background:"var(--dsw-alias-bg-layer-2)",minWidth:0},children:[ke===wt&&De?Ne("plugins.row.config",{view:"page"},{entryKey:De.key}):null,ke===_t&&ot?Ne("plugins.bundle.config",{view:"page"},{entryKey:ot.key}):null]}):null]},T.entryId)})}):null]},v.key)})})]})}var gt=class extends No.Component{constructor(t){super(t),this.state={error:null}}static getDerivedStateFromError(t){return{error:t}}render(){return this.state.error!==null?(0,a.jsxs)("p",{role:"alert",style:{color:"var(--dsw-alias-state-error-primary)",fontSize:13,margin:0},children:["\u63D2\u4EF6\u7BA1\u7406\u5668\u6E32\u67D3\u51FA\u9519\uFF1A",String(this.state.error),"\u3002\u8BF7\u5237\u65B0\u9875\u9762\u540E\u91CD\u8BD5\u3002"]}):this.props.children}};function Qp({diagnose:e,quarantine:t,repairHarness:r,restartHarness:n,uninstallPackages:o,uninstallPreview:i,getRescueConfig:s,setRescueConfig:c,getDownloadConfig:u,checkDownloads:d,verifyProfile:m,fixProfile:h,managed:b,t:p}){let[x,k]=O(null),[y,$]=O(!1),[E,Z]=O(null),[S,D]=O(!1),[C,B]=O(null),[H,tt]=O(null),[N,U]=O(null);$e(()=>{let g=!0;return s().then(R=>{g&&D(R.autoQuarantine===!0)},()=>{}),u().then(R=>{g&&B(R.dir??null)},()=>{}),ie(),()=>{g=!1}},[]);let be=async()=>{let g="http://127.0.0.1:3081/plugins#health";try{let R=await fetch("/plugins-launcher",{headers:{accept:"application/json"}}),ee=R.ok?await R.json():null;ee&&typeof ee.url=="string"&&/^http:\/\//.test(ee.url)&&(g=ee.url.replace(/\/+$/,"")+"/plugins#health")}catch{}window.open(g,"_blank")},ie=async()=>{$(!0),Z(null);try{let g=await e();k(g.issues??[])}catch(g){Z({severity:"error",message:g instanceof Error?g.message:String(g)})}finally{$(!1)}},ve=async g=>{$(!0);try{let ee=(await t([g])).items?.[0];Z({severity:ee?.status==="disabled"?"success":"warning",message:ee?`${ee.status}${ee.message?`\uFF1A${ee.message}`:""}`:"\u5B8C\u6210"}),ie()}catch(R){Z({severity:"error",message:R instanceof Error?R.message:String(R)})}finally{$(!1)}},Ae=async()=>{if(window.confirm(p("rescueRepairConfirm"))){$(!0);try{let g=await r(),R=(g.actions??[]).map(ee=>`\xB7 ${ee.action}: ${ee.detail}`).join(`
73
- `);Z({severity:"success",message:`${p("rescueRepairDone")}
74
- ${R}
75
- ${p("rescueRestartHint")} ${g.restartCommand}`}),ie()}catch(g){Z({severity:"error",message:g instanceof Error?g.message:String(g)})}finally{$(!1)}}},_=async()=>{if(window.confirm(p("rescueRestartConfirm")))try{let g=await n();Z({severity:"warning",message:g.message})}catch(g){Z({severity:"error",message:g instanceof Error?g.message:String(g)})}},Ee=async g=>{U(g)},rt=async g=>{$(!0);try{await c({autoQuarantine:g}),D(g),Z({severity:"success",message:p("rescueAutoSaved")})}catch(R){Z({severity:"error",message:R instanceof Error?R.message:String(R)})}finally{$(!1)}},Ne=async()=>{$(!0);try{let g=await m();tt(g),Z(g.ok?{severity:"success",message:p("verifyOk")}:{severity:"error",message:`${p("verifyBad")} ${(g.issues??[]).map(R=>`${R.name}: ${R.reason}`).join("\uFF1B")}`})}catch(g){Z({severity:"error",message:g instanceof Error?g.message:String(g)})}finally{$(!1)}},He=async()=>{if(window.confirm(p("fixProfileConfirm"))){$(!0);try{let g=await h();Z({severity:g.ok?"success":"error",message:`${g.message??""} ${(g.actions??[]).map(R=>`${R.action}: ${R.detail}`).join("\uFF1B")}`}),Ne()}catch(g){Z({severity:"error",message:g instanceof Error?g.message:String(g)})}finally{$(!1)}}},er=async()=>{$(!0);try{let g=await d(),R=[];(g.installed??[]).length>0&&R.push(`${p("dlInstalled")} ${g.installed.join(", ")}`),(g.failed??[]).length>0&&R.push(`${p("dlFailed")} ${g.failed.map(ee=>`${ee.name}: ${ee.message}`).join("\uFF1B")}`),Z({severity:R.length===0?"success":g.failed?.length>0?"warning":"success",message:R.join("\uFF1B")||p("dlEmpty")})}catch(g){Z({severity:"error",message:g instanceof Error?g.message:String(g)})}finally{$(!1)}};return(0,a.jsxs)("div",{style:{border:"1px solid var(--dsw-alias-state-error-primary)",background:"color-mix(in srgb, var(--dsw-alias-state-error-primary) 6%, transparent)",borderRadius:8,padding:"10px 12px",display:"flex",flexDirection:"column",gap:8},children:[(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:6},children:[(0,a.jsxs)("span",{style:{fontSize:13,fontWeight:600,color:"var(--dsw-alias-state-error-primary)"},children:["\u{1F6DF} ",p("rescueTitle")]}),(0,a.jsxs)("span",{style:{marginLeft:"auto",display:"flex",gap:6},children:[(0,a.jsx)("button",{type:"button",onClick:be,disabled:y,style:A,children:p("rescueModHealth")}),(0,a.jsx)("button",{type:"button",onClick:ie,disabled:y,style:A,children:p("rescueDiagnose")})]})]}),(0,a.jsx)("p",{style:{margin:0,fontSize:12,color:"var(--dsw-alias-label-tertiary)",lineHeight:"18px"},children:p("rescueModHealthHint")}),(0,a.jsx)("p",{style:{margin:0,fontSize:12,color:"var(--dsw-alias-label-tertiary)",lineHeight:"18px"},children:p("rescueHint")}),N!==null?(0,a.jsx)(ef,{packageName:N,preview:i,uninstall:o,t:p,onDone:g=>{U(null),g&&ie()}}):null,x===null?null:x.length===0?(0,a.jsx)("p",{className:"ok-note",style:{margin:0,fontSize:12,color:"var(--dsw-alias-state-success-primary, #22c55e)"},children:p("rescueClean")}):(0,a.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:6},children:x.map(g=>(0,a.jsxs)("div",{style:{border:"1px solid var(--dsw-alias-border-l2)",background:"var(--dsw-alias-bg-layer-1)",borderRadius:8,padding:"8px 10px"},children:[(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[(0,a.jsx)("b",{style:{fontSize:13,color:"var(--dsw-alias-state-error-primary)"},children:g.configId}),(0,a.jsxs)("span",{style:{fontSize:11,color:"var(--dsw-alias-label-tertiary)"},children:[g.moduleName," \xB7 ",g.phase]}),(0,a.jsxs)("span",{style:{marginLeft:"auto",display:"flex",gap:6},children:[g.suggestion==="disable"?(0,a.jsx)("button",{type:"button",onClick:()=>ve(g.entryId),disabled:y,style:{...A,color:"var(--dsw-alias-state-error-primary)",borderColor:"var(--dsw-alias-state-error-primary)"},children:p("rescueDisable")}):(0,a.jsx)("span",{style:{fontSize:11,color:"var(--dsw-alias-label-tertiary)"},children:p("rescueProtected")}),g.canUninstall?(0,a.jsx)("button",{type:"button",onClick:()=>Ee(g.moduleName),disabled:y,style:A,children:p("rescueUninstall")}):null]})]}),g.error?(0,a.jsx)("pre",{style:{margin:"6px 0 0",fontSize:11,color:"var(--dsw-alias-label-secondary)",whiteSpace:"pre-wrap",wordBreak:"break-all",maxHeight:80,overflow:"auto"},children:g.error}):null]},g.entryId))}),(0,a.jsxs)("div",{style:{display:"flex",gap:6,alignItems:"center",flexWrap:"wrap"},children:[(0,a.jsx)("button",{type:"button",onClick:Ae,disabled:y,style:{...A,background:"var(--dsw-alias-state-error-primary)",color:"#fff",fontWeight:600},children:p("rescueRepair")}),(0,a.jsx)("button",{type:"button",onClick:_,disabled:y,style:{...A,color:"var(--dsw-alias-state-error-primary)",borderColor:"var(--dsw-alias-state-error-primary)"},children:p("rescueRestart")}),(0,a.jsxs)("label",{style:{display:"inline-flex",alignItems:"center",gap:4,fontSize:12,cursor:"pointer",marginLeft:8},children:[(0,a.jsx)("input",{type:"checkbox",checked:S,disabled:y,onChange:g=>rt(g.currentTarget.checked)}),p("rescueAuto")]})]}),(0,a.jsxs)("div",{style:{borderTop:"1px solid var(--dsw-alias-border-l2)",paddingTop:8,display:"flex",flexDirection:"column",gap:6},children:[(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[(0,a.jsx)("span",{style:{fontSize:12,fontWeight:600},children:p("verifyTitle")}),(0,a.jsx)("button",{type:"button",onClick:Ne,disabled:y,style:A,children:p("verifyRun")}),(0,a.jsx)("button",{type:"button",onClick:He,disabled:y,style:{...A,color:"var(--dsw-alias-state-error-primary)",borderColor:"var(--dsw-alias-state-error-primary)"},children:p("fixProfile")})]}),H!==null&&!H.ok?(0,a.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:4},children:(H.issues??[]).map((g,R)=>(0,a.jsxs)("p",{style:{margin:0,fontSize:12,color:"var(--dsw-alias-state-error-primary)"},children:["\u26A0 ",g.name,": ",g.reason]},R))}):null,(0,a.jsx)("p",{style:{margin:0,fontSize:11,color:"var(--dsw-alias-label-tertiary)",lineHeight:"16px"},children:p("verifyHint")})]}),(0,a.jsxs)("div",{style:{borderTop:"1px solid var(--dsw-alias-border-l2)",paddingTop:8,display:"flex",flexDirection:"column",gap:6},children:[(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[(0,a.jsx)("span",{style:{fontSize:12,fontWeight:600},children:p("dlTitle")}),(0,a.jsx)("button",{type:"button",onClick:er,disabled:y,style:A,children:p("dlCheck")})]}),(0,a.jsxs)("p",{style:{margin:0,fontSize:12,color:"var(--dsw-alias-label-secondary)"},children:[p("dlDir"),": ",(0,a.jsx)("code",{style:{fontFamily:"var(--ds-font-family-code)",fontSize:11},children:C??"\u2026"})]}),(0,a.jsx)("p",{style:{margin:0,fontSize:11,color:"var(--dsw-alias-label-tertiary)",lineHeight:"16px"},children:p("dlHint")})]}),b.length>0?(0,a.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[(0,a.jsx)("span",{style:{fontSize:12,color:"var(--dsw-alias-label-tertiary)"},children:p("rescueUninstallList")}),(0,a.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:b.map(g=>(0,a.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:6,border:"1px solid var(--dsw-alias-border-l2)",borderRadius:999,padding:"2px 8px",fontSize:11},children:[g.configId,(0,a.jsx)("button",{type:"button",onClick:()=>Ee(g.packageName),disabled:y,style:ht,children:p("rescueUninstall")})]},g.packageName))})]}):null,E?(0,a.jsx)("p",{role:"alert",style:{margin:0,fontSize:12,whiteSpace:"pre-wrap",color:E.severity==="error"?"var(--dsw-alias-state-error-primary)":E.severity==="warning"?"var(--dsw-alias-state-warning-primary, #f59e0b)":"var(--dsw-alias-state-success-primary, #22c55e)"},children:E.message}):null]})}var Hp={safe:{key:"uninstallVerdictSafe",color:"var(--dsw-alias-state-success-primary, #22c55e)"},caution:{key:"uninstallVerdictCaution",color:"var(--dsw-alias-state-warning-primary, #f59e0b)"},risky:{key:"uninstallVerdictRisky",color:"var(--dsw-alias-state-error-primary)"}},Bp={high:{key:"uninstallCheckHigh",color:"var(--dsw-alias-state-error-primary)"},warning:{key:"uninstallCheckWarning",color:"var(--dsw-alias-state-warning-primary, #f59e0b)"},info:{key:"uninstallCheckInfo",color:"var(--dsw-alias-label-secondary)"}},Wp={cleaned:{key:"uninstallAutostartCleaned",color:"var(--dsw-alias-state-success-primary, #22c55e)"},skipped:{key:"uninstallAutostartSkipped",color:"var(--dsw-alias-label-secondary)"},failed:{key:"uninstallAutostartFailed",color:"var(--dsw-alias-state-warning-primary, #f59e0b)"},timeout:{key:"uninstallAutostartTimeout",color:"var(--dsw-alias-state-warning-primary, #f59e0b)"}};function ef({packageName:e,preview:t,uninstall:r,t:n,onDone:o}){let[i,s]=O(null),[c,u]=O(null),[d,m]=O(!1),[h,b]=O(!1),[p,x]=O(null);$e(()=>{let S=!0;return t([e]).then(D=>{S&&s(D.packages?.[0]??null)},D=>{S&&u(D instanceof Error?D.message:String(D))}),()=>{S=!1}},[t,e]);let k=async()=>{b(!0),x(null);try{let S=await r([e],{cascade:d});x(S.items?.[0]??null)}catch(S){x({status:"failed",message:S instanceof Error?S.message:String(S)})}finally{b(!1)}},y=i?.checks??[],$=Hp[i?.verdict??"safe"]??Hp.safe,E=p?.autostartCleanup??null,Z=E===null?null:Wp[E.status]??Wp.failed;return(0,a.jsxs)("div",{style:{border:"1px solid var(--dsw-alias-state-warning-primary, #f59e0b)",background:"color-mix(in srgb, var(--dsw-alias-state-warning-primary, #f59e0b) 8%, transparent)",borderRadius:8,padding:"10px 12px",display:"flex",flexDirection:"column",gap:8},children:[(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[(0,a.jsxs)("span",{style:{fontSize:13,fontWeight:600,color:"var(--dsw-alias-state-warning-primary, #f59e0b)"},children:[n("uninstallTitle"),": ",e]}),(0,a.jsx)("button",{type:"button",onClick:()=>o(!1),disabled:h,style:ht,children:n("cancel")})]}),c?(0,a.jsxs)("p",{role:"alert",style:{margin:0,fontSize:12,color:"var(--dsw-alias-state-error-primary)"},children:[n("uninstallPreviewFail"),": ",c]}):null,i===null&&!c?(0,a.jsx)("p",{style:{margin:0,fontSize:12,color:"var(--dsw-alias-label-tertiary)"},children:n("uninstallPreviewLoading")}):null,i!==null&&!p?(0,a.jsx)(a.Fragment,{children:i.canUninstall?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{"data-check-verdict":i.verdict??"safe",style:{border:`1px solid ${$.color}`,borderRadius:6,padding:"6px 8px",display:"flex",flexDirection:"column",gap:2},children:[(0,a.jsxs)("span",{style:{fontSize:12.5,fontWeight:600,color:$.color},children:[n("uninstallVerdictLine"),"\uFF1A",n($.key)]}),(0,a.jsx)("span",{style:{fontSize:11.5,color:"var(--dsw-alias-label-secondary)",lineHeight:"16px"},"data-check-reason":"1",children:i.verdictReason??""})]}),(0,a.jsx)("p",{style:{margin:0,fontSize:12,color:"var(--dsw-alias-label-secondary)",lineHeight:"18px"},children:n("uninstallPreviewHint")}),(0,a.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:4,fontSize:12},children:[i.affectedEntries.length>0?(0,a.jsxs)("p",{style:{margin:0},children:[n("uninstallAffectedEntries"),": ",(0,a.jsx)("code",{style:{fontFamily:"var(--ds-font-family-code)",fontSize:11},children:i.affectedEntries.map(S=>S.configId).join(", ")})]}):(0,a.jsx)("p",{style:{margin:0,color:"var(--dsw-alias-label-tertiary)"},children:n("uninstallNoEntries")}),i.inBundles?(0,a.jsx)("p",{style:{margin:0},children:n("uninstallBundleRow")}):null,i.patchRows>0?(0,a.jsxs)("p",{style:{margin:0},children:[n("uninstallPatchRows"),": ",i.patchRows]}):null,(0,a.jsxs)("div",{"data-check-list":"1",style:{borderTop:"1px solid var(--dsw-alias-border-l2)",paddingTop:6,display:"flex",flexDirection:"column",gap:3},children:[(0,a.jsxs)("p",{style:{margin:0,fontWeight:600},children:[n("uninstallCheckTitle")," ",(0,a.jsx)("span",{style:{fontWeight:400,color:"var(--dsw-alias-label-tertiary)",fontSize:11},children:n("uninstallCheckHint")})]}),y.length===0?(0,a.jsx)("p",{"data-check-empty":"1",style:{margin:0,fontSize:11.5,color:"var(--dsw-alias-label-tertiary)"},children:n("uninstallCheckEmpty")}):y.map((S,D)=>{let C=Bp[S.severity]??Bp.info;return(0,a.jsxs)("p",{"data-check-id":S.id,"data-check-severity":S.severity,style:{margin:0,fontSize:11.5,lineHeight:"17px"},children:[(0,a.jsxs)("span",{style:{color:C.color,fontWeight:600},children:["[",n(C.key),"]"]})," ",(0,a.jsx)("span",{style:{fontWeight:600},children:S.title})," ",(0,a.jsxs)("span",{style:{color:"var(--dsw-alias-label-tertiary)"},children:["\u2014\u2014 ",S.detail]})]},`${S.id}-${D}`)})]}),i.dependents.length>0?(0,a.jsxs)("div",{style:{border:"1px solid var(--dsw-alias-state-warning-primary, #f59e0b)",borderRadius:6,padding:"6px 8px",display:"flex",flexDirection:"column",gap:4},children:[(0,a.jsxs)("p",{style:{margin:0,fontWeight:600,color:"var(--dsw-alias-state-warning-primary, #f59e0b)"},children:["\u26A0 ",n("uninstallDependents"),":"]}),i.dependents.map((S,D)=>(0,a.jsxs)("p",{style:{margin:0,fontSize:11.5},children:[(0,a.jsx)("code",{style:{fontFamily:"var(--ds-font-family-code)",fontSize:11},children:S.packageName}),(0,a.jsxs)("span",{style:{color:"var(--dsw-alias-label-tertiary)"},children:[" (",S.type,": ",S.spec,")"]})]},D)),(0,a.jsxs)("label",{style:{display:"inline-flex",alignItems:"center",gap:5,fontSize:12,cursor:"pointer"},children:[(0,a.jsx)("input",{type:"checkbox",checked:d,disabled:h,onChange:S=>m(S.currentTarget.checked)}),n("uninstallCascade"),"\uFF08",i.dependents.filter(S=>!0).length,"\uFF09"]})]}):null]}),i.isSelf===!0?(0,a.jsx)("p",{"data-self-hint":"1",style:{margin:0,fontSize:11.5,lineHeight:"17px",color:"var(--dsw-alias-state-warning-primary, #f59e0b)"},children:n("uninstallSelfHint")}):null,(0,a.jsx)("div",{style:{display:"flex",gap:6,justifyContent:"flex-end"},children:(0,a.jsx)("button",{type:"button",onClick:k,disabled:h,style:{...A,background:"var(--dsw-alias-state-error-primary)",color:"#fff",fontWeight:600},children:n(h?"uninstalling":"uninstallConfirm")})})]}):(0,a.jsx)("p",{role:"alert",style:{margin:0,fontSize:12,color:"var(--dsw-alias-state-error-primary)"},children:i.spec===null?n("uninstallNotManaged"):n("uninstallLocalBlocked")})}):null,p!==null?(0,a.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:4,fontSize:12},children:[(0,a.jsxs)("p",{style:{margin:0,color:p.status==="removed"?"var(--dsw-alias-state-success-primary, #22c55e)":"var(--dsw-alias-state-error-primary)"},children:[p.status==="removed"?"\u2713 ":p.status==="rolled-back"?"\u21A9 ":"\u2717 ",n(`uninstallStatus${p.status}`),": ",p.message]}),p.status==="removed"?(0,a.jsxs)(a.Fragment,{children:[p.verifyOk===!0?(0,a.jsxs)("p",{style:{margin:0,color:"var(--dsw-alias-state-success-primary, #22c55e)"},children:["\u2713 ",n("uninstallVerifyOk")]}):null,p.removedPatchRows>0?(0,a.jsxs)("p",{style:{margin:0},children:[n("uninstallReportRows"),": ",p.removedPatchRows]}):null,p.dependentPackages.length>0?(0,a.jsxs)("p",{style:{margin:0},children:[n("uninstallReportCascade"),": ",p.dependentPackages.join(", ")]}):null,p.residuals.length>0?(0,a.jsxs)("p",{style:{margin:0,color:"var(--dsw-alias-state-warning-primary, #f59e0b)"},children:[n("uninstallResiduals"),": ",p.residuals.join(", ")]}):null]}):null,Z!==null&&E!==null?(0,a.jsxs)("p",{"data-autostart-cleanup":E.status,style:{margin:0,color:Z.color,lineHeight:"17px"},children:[n("uninstallAutostartTitle"),": ",n(Z.key)," \u2014\u2014 ",E.message]}):null,p.isSelf===!0&&p.status==="removed"?(0,a.jsx)("p",{"data-self-uninstalled":"1",style:{margin:0,color:"var(--dsw-alias-state-warning-primary, #f59e0b)",lineHeight:"17px"},children:n("uninstallSelfReport")}):null,(0,a.jsx)("div",{style:{display:"flex",gap:6,justifyContent:"flex-end"},children:(0,a.jsx)("button",{type:"button",onClick:()=>o(p.status==="removed"),style:A,children:n("done")})})]}):null]})}function tf({operationHistory:e,undoOperation:t,onSnapshot:r,t:n}){let[o,i]=O(null),[s,c]=O(null),[u,d]=O(null),[m,h]=O(0);$e(()=>{let p=!0;return e().then(x=>{p&&i(x.operations??[])},x=>{p&&d({severity:"error",message:x instanceof Error?x.message:String(x)})}),()=>{p=!1}},[e,m]);let b=async p=>{c(p),d(null);try{let x=await t(p);d({severity:x.ok?"success":"warning",message:x.message}),x.snapshot&&r(x.snapshot),h(k=>k+1)}catch(x){d({severity:"error",message:x instanceof Error?x.message:String(x)})}finally{c(null)}};return(0,a.jsxs)("div",{style:{border:"1px solid var(--dsw-alias-border-l2)",background:"var(--dsw-alias-bg-layer-2)",borderRadius:8,padding:"10px 12px",display:"flex",flexDirection:"column",gap:8},children:[(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8},children:[(0,a.jsx)("span",{style:{fontSize:13,fontWeight:600},children:n("historyTitle")}),(0,a.jsx)("span",{style:{fontSize:11,color:"var(--dsw-alias-label-tertiary)"},children:n("historyHint")}),(0,a.jsx)("button",{type:"button",onClick:()=>h(p=>p+1),disabled:s!==null,style:ht,children:n("refresh")})]}),u?(0,a.jsx)("p",{role:"alert",style:{margin:0,fontSize:12,color:u.severity==="error"?"var(--dsw-alias-state-error-primary)":u.severity==="warning"?"var(--dsw-alias-state-warning-primary, #f59e0b)":"var(--dsw-alias-state-success-primary, #22c55e)"},children:u.message}):null,o===null?(0,a.jsx)("p",{style:{margin:0,fontSize:12,color:"var(--dsw-alias-label-tertiary)"},children:n("loading")}):o.length===0?(0,a.jsx)("p",{style:{margin:0,fontSize:12,color:"var(--dsw-alias-label-tertiary)"},children:n("historyEmpty")}):(0,a.jsx)("ul",{style:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column",gap:4,maxHeight:320,overflow:"auto"},children:o.map(p=>(0,a.jsxs)("li",{style:{display:"flex",alignItems:"center",gap:8,fontSize:12,border:"1px solid var(--dsw-alias-border-l2)",background:"var(--dsw-alias-bg-layer-1)",borderRadius:6,padding:"6px 8px"},children:[(0,a.jsxs)("span",{style:{flex:"1 1 auto",minWidth:0},children:[(0,a.jsx)("span",{style:{fontWeight:600},children:p.label}),p.detail?(0,a.jsx)("span",{style:{color:"var(--dsw-alias-label-tertiary)",marginLeft:6},children:p.detail}):null,(0,a.jsxs)("span",{style:{display:"block",fontSize:10.5,color:"var(--dsw-alias-label-tertiary)"},children:[p.at.slice(0,16).replace("T"," ")," \xB7 ",p.action,p.undone?` \xB7 ${n("historyUndone")}`:""]})]}),p.undo&&!p.undone?(0,a.jsx)("button",{type:"button",onClick:()=>b(p.id),disabled:s!==null,style:{...A,flex:"none",color:"var(--dsw-alias-state-business-primary, #4f8cff)",borderColor:"var(--dsw-alias-state-business-primary, #4f8cff)"},children:s===p.id?"\u2026":n("historyUndo")}):null]},p.id))})]})}function rf({scenarioList:e,scenarioSave:t,scenarioUpdate:r,scenarioDelete:n,scenarioApply:o,onSnapshot:i,t:s}){let[c,u]=O(null),[d,m]=O(""),[h,b]=O(null),[p,x]=O(null),[k,y]=O(null),[$,E]=O(null),[Z,S]=O(null),D=()=>e().then(N=>u(N.scenarios??[]),N=>x({severity:"error",message:N instanceof Error?N.message:String(N)}));$e(()=>{D()},[]);let C=async()=>{b("save"),x(null);try{let N=await t(d.trim());u(N.scenarios??[]),m(""),x({severity:"success",message:s("scenarioSaved")})}catch(N){x({severity:"error",message:N instanceof Error?N.message:String(N)})}finally{b(null)}},B=async N=>{b(`preview:${N.id}`),x(null),E(N.id);try{let U=await o(N.id,!0),be=(U.items??[]).filter(ie=>ie.changed);y(be.length>0?{scenario:U.scenarios?.find(ie=>ie.id===N.id)??N,items:be}:null)}catch(U){x({severity:"error",message:U instanceof Error?U.message:String(U)})}finally{b(null)}},H=async N=>{S(N.id),x(null);try{let U=await o(N.id,!1),be=(U.items??[]).filter(ve=>ve.status==="changed").length,ie=(U.items??[]).filter(ve=>ve.status==="skipped").length;u(U.scenarios??[]),U.snapshot&&i(U.snapshot),y(null),E(null),x({severity:be>0?"success":"warning",message:`${s("scenarioApplied")}\uFF1A${be} \u9879\u5207\u6362${ie>0?`\uFF0C${ie} \u9879\u88AB\u4FDD\u62A4\u8DF3\u8FC7`:""}\u3002${be>0?s("restartHint"):""}`})}catch(U){x({severity:"error",message:U instanceof Error?U.message:String(U)})}finally{S(null)}},tt=async N=>{if(window.confirm(`${s("scenarioDeleteConfirm")} ${N.name}\uFF1F`)){b(`delete:${N.id}`);try{let U=await n(N.id);u(U.scenarios??[])}catch(U){x({severity:"error",message:U instanceof Error?U.message:String(U)})}finally{b(null)}}};return(0,a.jsxs)("div",{style:{border:"1px solid var(--dsw-alias-border-l2)",background:"var(--dsw-alias-bg-layer-2)",borderRadius:8,padding:"10px 12px",display:"flex",flexDirection:"column",gap:8},children:[(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8},children:[(0,a.jsx)("span",{style:{fontSize:13,fontWeight:600},children:s("scenarioTitle")}),(0,a.jsx)("span",{style:{fontSize:11,color:"var(--dsw-alias-label-tertiary)"},children:s("scenarioHint")})]}),(0,a.jsxs)("div",{style:{display:"flex",gap:6,alignItems:"center"},children:[(0,a.jsx)("input",{value:d,placeholder:s("scenarioName"),onChange:N=>m(N.currentTarget.value),style:{...su,flex:"1 1 160px"}}),(0,a.jsx)("button",{type:"button",onClick:C,disabled:h!==null||d.trim()==="",style:A,children:s("scenarioSave")})]}),p?(0,a.jsx)("p",{role:"alert",style:{margin:0,fontSize:12,color:p.severity==="error"?"var(--dsw-alias-state-error-primary)":p.severity==="warning"?"var(--dsw-alias-state-warning-primary, #f59e0b)":"var(--dsw-alias-state-success-primary, #22c55e)"},children:p.message}):null,c===null?(0,a.jsx)("p",{style:{margin:0,fontSize:12,color:"var(--dsw-alias-label-tertiary)"},children:s("loading")}):c.length===0?(0,a.jsx)("p",{style:{margin:0,fontSize:12,color:"var(--dsw-alias-label-tertiary)"},children:s("scenarioEmpty")}):(0,a.jsx)("ul",{style:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column",gap:6},children:c.map(N=>(0,a.jsxs)("li",{style:{border:"1px solid var(--dsw-alias-border-l2)",background:"var(--dsw-alias-bg-layer-1)",borderRadius:8,padding:"8px 10px",display:"flex",flexDirection:"column",gap:6},children:[(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[(0,a.jsx)("b",{style:{fontSize:13},children:N.name}),(0,a.jsxs)("span",{style:{fontSize:11,color:"var(--dsw-alias-label-tertiary)"},children:[s("scenarioCounts"),": ",N.counts?.enabled??0,"/",N.counts?.disabled??0," \xB7 ",N.updatedAt.slice(0,10)]}),(0,a.jsxs)("span",{style:{marginLeft:"auto",display:"flex",gap:6},children:[$===N.id&&k===null&&h===`preview:${N.id}`?(0,a.jsx)("span",{style:{fontSize:11,color:"var(--dsw-alias-label-tertiary)"},children:s("scenarioCalculating")}):(0,a.jsx)("button",{type:"button",onClick:()=>B(N),disabled:h!==null,style:A,children:s("scenarioApply")}),(0,a.jsx)("button",{type:"button",onClick:()=>r(N.id).then(U=>u(U.scenarios??[])).catch(U=>x({severity:"error",message:U.message})),disabled:h!==null,title:s("scenarioUpdateHint"),style:A,children:s("scenarioUpdate")}),(0,a.jsx)("button",{type:"button",onClick:()=>tt(N),disabled:h!==null,style:{...A,color:"var(--dsw-alias-state-error-primary)",borderColor:"var(--dsw-alias-state-error-primary)"},children:s("scenarioDelete")})]})]}),$===N.id&&k!==null?(0,a.jsxs)("div",{style:{border:"1px dashed var(--dsw-alias-state-warning-primary, #f59e0b)",borderRadius:6,padding:"6px 8px",display:"flex",flexDirection:"column",gap:4},children:[(0,a.jsx)("p",{style:{margin:0,fontSize:11.5,fontWeight:600,color:"var(--dsw-alias-state-warning-primary, #f59e0b)"},children:s("scenarioPreviewTitle")}),k.items.map(U=>(0,a.jsxs)("p",{style:{margin:0,fontSize:11.5},children:[(0,a.jsx)("code",{style:{fontFamily:"var(--ds-font-family-code)",fontSize:11},children:U.configId})," ",U.current?s("statusEnabled"):s("statusDisabled")," \u2192 ",U.enabled?s("statusEnabled"):s("statusDisabled"),U.protected?(0,a.jsxs)("span",{style:{color:"var(--dsw-alias-label-tertiary)",marginLeft:6},children:["\u{1F512} ",U.reason??""]}):null]},U.configId)),(0,a.jsxs)("div",{style:{display:"flex",gap:6,justifyContent:"flex-end"},children:[(0,a.jsx)("button",{type:"button",onClick:()=>H(N),disabled:Z!==null,style:{...A,background:"var(--dsw-alias-state-warning-primary, #b45309)",color:"#fff",fontWeight:600},children:Z===N.id?s("scenarioApplying"):s("scenarioApplyConfirm")}),(0,a.jsx)("button",{type:"button",onClick:()=>{y(null),E(null)},disabled:Z!==null,style:A,children:s("cancel")})]})]}):null]},N.id))})]})}var Ro=null,Bh=20;function Wh(){try{let e=typeof window<"u"&&window.navigator?window.navigator:null;return(e&&(e.language||e.userLanguage)||"zh").toLowerCase().startsWith("zh")?"zh":"en"}catch{return"zh"}}function Vh(e,t){return t.needsUpdate!==null||!t.installedVersion?"":t.updateReason==="network"||t.updateReason==="timeout"?` (${e("versionNetworkError")})`:t.updateReason==="not-found"?` (${e("versionNotFound")})`:t.updateReason==="backoff"?` (${e("versionBackoff")})`:` (${e("versionUnknown")})`}function nf(e,t,r){if(r.has(e.name)||typeof e.npm=="string"&&(t.has(e.npm)||r.has(e.npm))||t.has(e.name))return!0;let n=/^https:\/\/github\.com\/([^/]+\/[^/]+?)(?:\/tree\/.+)?\/?$/.exec(e.url||"");return!!(n!==null&&t.has(n[1].split("/")[1]))}function of(e,t,r,n){if(!e)return[];let o=t.trim().toLocaleLowerCase();return[...e.items.filter(s=>r!=="all"&&s.category!==r?!1:!o||s.name.toLocaleLowerCase().includes(o)||s.owner.toLocaleLowerCase().includes(o)||typeof s.npm=="string"&&s.npm.toLocaleLowerCase().includes(o)?!0:(s.description?Object.values(s.description).filter(Boolean).join(" "):"").toLocaleLowerCase().includes(o))].sort((s,c)=>n==="added"?String(c.added||"").localeCompare(String(s.added||"")):(c.stars??-1)-(s.stars??-1))}function sf({marketCatalog:e,marketInstall:t,busy:r,t:n,entries:o,initialQuery:i=""}){let[s,c]=O(Ro),[u,d]=O(null),[m,h]=O(0),[b,p]=O(i),[x,k]=O("all"),[y,$]=O("stars"),[E,Z]=O(1),[S,D]=O(null),[C,B]=O(null),[H,tt]=O(()=>new Set),[N,U]=O(null),be=Wh(),ie=Qt(()=>{let g=new Set;for(let R of o||[])R.packageName&&g.add(R.packageName);return g},[o]);$e(()=>{let g=!0;if(Ro===null)return e().then(R=>{g&&(Ro=R,c(R),d(null))},R=>{g&&d(R instanceof Error?R.message:String(R))}),()=>{g=!1}},[e,m]);let ve=Qt(()=>of(s,b,x,y),[s,b,x,y]);$e(()=>{Z(1)},[b,x,y]);let Ae=ve.slice(0,E*Bh),_=Ae.length<ve.length,Ee=()=>{Ro=null,c(null),d(null),h(g=>g+1)},rt=async g=>{B(g.name),U(null);try{let R=await t({name:g.name,npm:g.npm,url:g.url},!1),ee=R.status==="installed"?"success":R.status==="already-installed"?"warning":"error";U({severity:ee,message:R.message??R.status}),R.status==="installed"&&(tt(je=>{let tr=new Set(je);return tr.add(R.packageName??g.name),tr.add(g.name),tr}),D(null))}catch(R){U({severity:"error",message:R instanceof Error?R.message:String(R)})}finally{B(null)}},Ne=s?.categories?Object.keys(s.categories):[],He=g=>{let R=s?.categories?.[g];return R&&(R[be]||R.en)||g},er={live:n("marketSourceLive"),cache:n("marketSourceCache"),"github-fallback":n("marketSourceFallback"),error:n("marketSourceError")}[s?.source]??s?.source;return(0,a.jsxs)("div",{style:{border:"1px solid var(--dsw-alias-border-l2)",background:"var(--dsw-alias-bg-layer-2)",borderRadius:8,padding:"10px 12px",display:"flex",flexDirection:"column",gap:8},children:[(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[(0,a.jsx)("span",{style:{fontSize:13,fontWeight:600},children:n("marketTitle")}),s?(0,a.jsxs)("span",{className:"muted",style:{fontSize:11,color:"var(--dsw-alias-label-tertiary)"},title:s.updated??"",children:[er," \xB7 ",s.count," ",n("marketPlugins"),s.updated?` \xB7 ${n("marketUpdated")} ${s.updated.slice(0,10)}`:""]}):null,(0,a.jsx)("input",{type:"search",value:b,placeholder:n("marketSearch"),onChange:g=>p(g.currentTarget.value),style:{boxSizing:"border-box",flex:"1 1 200px",height:30,border:"1px solid var(--dsw-alias-border-l2)",background:"var(--dsw-alias-bg-layer-1)",color:"var(--dsw-alias-label-primary)",borderRadius:6,padding:"0 10px",fontSize:12,font:"inherit"}}),(0,a.jsxs)("select",{value:y,onChange:g=>$(g.currentTarget.value),style:{height:30,fontSize:12,borderRadius:6,border:"1px solid var(--dsw-alias-border-l2)",background:"var(--dsw-alias-bg-layer-1)",color:"var(--dsw-alias-label-primary)"},"aria-label":n("marketSort"),children:[(0,a.jsx)("option",{value:"stars",children:n("marketSortStars")}),(0,a.jsx)("option",{value:"added",children:n("marketSortAdded")})]}),(0,a.jsx)("button",{type:"button",onClick:Ee,disabled:r,title:n("marketRefresh"),style:{...A,width:30,height:30,display:"grid",placeItems:"center"},children:"\u21BB"})]}),s?(0,a.jsxs)("div",{style:{display:"flex",gap:6,flexWrap:"wrap"},children:[(0,a.jsx)("button",{type:"button",onClick:()=>k("all"),style:{...Hr,...x==="all"?Br:null},children:n("marketAll")}),Ne.map(g=>(0,a.jsx)("button",{type:"button",onClick:()=>k(g),style:{...Hr,...x===g?Br:null},children:He(g)},g))]}):null,(0,a.jsx)("p",{className:"muted",style:{margin:0,fontSize:11,color:"var(--dsw-alias-label-tertiary)"},children:n("marketHint")}),N?(0,a.jsx)("p",{role:"alert",style:{margin:0,fontSize:12,whiteSpace:"pre-wrap",color:N.severity==="error"?"var(--dsw-alias-state-error-primary)":N.severity==="warning"?"var(--dsw-alias-state-warning-primary, #f59e0b)":"var(--dsw-alias-state-success-primary, #22c55e)"},children:N.message}):null,u?(0,a.jsxs)("p",{style:{margin:0,fontSize:12,color:"var(--dsw-alias-state-error-primary)"},children:[n("marketLoadFail"),": ",u,(0,a.jsx)("button",{type:"button",onClick:Ee,style:{...A,marginLeft:8},children:n("marketRetry")})]}):null,s===null&&!u?(0,a.jsxs)("p",{style:{margin:0,fontSize:12,color:"var(--dsw-alias-label-tertiary)"},children:[n("marketLoading")," ",n("marketLoadingSlow")]}):null,s?.source==="error"?(0,a.jsxs)("p",{style:{margin:0,fontSize:12,color:"var(--dsw-alias-state-warning-primary, #f59e0b)"},children:[n("marketSourceErrorHint"),(0,a.jsx)("button",{type:"button",onClick:Ee,style:{...A,marginLeft:8},children:n("marketRetry")})]}):null,s!==null&&ve.length===0&&!u?(0,a.jsx)("p",{style:{margin:0,fontSize:12,color:"var(--dsw-alias-label-tertiary)"},children:n("marketEmpty")}):null,Ae.length>0?(0,a.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:6,maxHeight:420,overflow:"auto"},children:Ae.map(g=>{let R=nf(g,ie,H),ee=S===g.name&&C!==g.name;return(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,border:"1px solid var(--dsw-alias-border-l2)",background:"var(--dsw-alias-bg-layer-1)",borderRadius:8,padding:"8px 10px"},children:[(0,a.jsxs)("div",{style:{flex:"1 1 auto",minWidth:0},children:[(0,a.jsxs)("span",{style:{display:"flex",alignItems:"baseline",gap:6,flexWrap:"wrap"},children:[(0,a.jsx)("strong",{style:{fontSize:12.5},children:g.name}),g.owner?(0,a.jsx)("span",{style:{fontSize:11,color:"var(--dsw-alias-label-tertiary)"},children:g.owner}):null,g.stars!==null?(0,a.jsxs)("span",{style:{fontSize:11,color:"var(--dsw-alias-label-tertiary)"},children:["\u2605 ",g.stars]}):null,g.added?(0,a.jsxs)("span",{style:{fontSize:11,color:"var(--dsw-alias-label-tertiary)"},children:[n("marketUpdated")," ",g.added.slice(0,10)]}):null,(0,a.jsx)("span",{style:{fontSize:10,color:"var(--dsw-alias-label-tertiary)",border:"1px solid var(--dsw-alias-border-l2)",borderRadius:4,padding:"0 4px"},children:He(g.category)})]}),g.description?(()=>{let je=g.description[be]||g.description.en;return je?(0,a.jsx)("p",{style:{margin:"2px 0 0",fontSize:12,color:"var(--dsw-alias-label-secondary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:je}):null})():null]}),R?(0,a.jsxs)("span",{style:{fontSize:11,color:"var(--dsw-alias-state-success-primary, #22c55e)",flex:"none",whiteSpace:"nowrap"},children:["\u2713 ",n("marketInstalledBadge")]}):C===g.name?(0,a.jsx)("button",{type:"button",disabled:!0,style:{...A,flex:"none",fontWeight:600,opacity:.6},children:n("marketInstalling")}):ee?(0,a.jsx)("button",{type:"button",onClick:()=>rt(g),disabled:r||C!==null,style:{...A,flex:"none",fontWeight:700,color:"#fff",background:"var(--dsw-alias-state-error-primary, #d64541)",borderColor:"var(--dsw-alias-state-error-primary, #d64541)"},children:n("marketConfirmInstall")}):(0,a.jsx)("button",{type:"button",onClick:()=>D(g.name),disabled:r||C!==null,style:{...A,flex:"none",fontWeight:600,color:"var(--dsw-alias-state-business-primary, #4f8cff)",borderColor:"var(--dsw-alias-state-business-primary, #4f8cff)"},children:n("marketInstall")})]},g.url||g.name)})}):null,_?(0,a.jsxs)("button",{type:"button",onClick:()=>Z(g=>g+1),disabled:r,style:{...A,alignSelf:"center"},children:[n("marketMore"),"\uFF08",ve.length-Ae.length,"\uFF09"]}):null]})}var Hr={height:26,fontSize:11.5,borderRadius:999,border:"1px solid var(--dsw-alias-border-l2)",background:"var(--dsw-alias-bg-layer-1)",color:"var(--dsw-alias-label-secondary)",padding:"0 12px",cursor:"pointer"},Br={borderColor:"var(--dsw-alias-state-business-primary, #4f8cff)",color:"var(--dsw-alias-state-business-primary, #4f8cff)",fontWeight:600};function af({sources:e,save:t,busy:r,t:n}){let[o,i]=O(e),[s,c]=O(""),[u,d]=O("");$e(()=>{i(e)},[e]);let m=(y,$)=>{i(E=>E.map((Z,S)=>S===y?{...Z,enabled:$}:Z))},h=(y,$)=>{i(E=>E.map((Z,S)=>S===y?{...Z,authoritative:$}:Z))},b=(y,$)=>{i(E=>E.map((Z,S)=>S===y?{...Z,allowInsecure:$}:Z))},p=y=>{i($=>$.filter((E,Z)=>Z!==y))},x=()=>{let y=u.trim();if(!y||!/^https?:\/\//.test(y))return;let $="registry";/^https?:\/\/github\.com\//.test(y)&&($="github"),i(E=>[...E,{name:s.trim()||y,url:y,enabled:!0,official:!1,authoritative:!1,allowInsecure:!1,type:$}]),c(""),d("")},k=()=>{i([{name:"\u5B98\u65B9\u6E90 (npm)",url:"https://registry.npmjs.org",enabled:!0,official:!0,authoritative:!0,type:"registry"},{name:"GitHub \u5B98\u65B9\u4ED3\u5E93",url:"https://github.com/deepseek-ai/deepseek-harness",enabled:!1,official:!1,authoritative:!1,type:"github"},{name:"npmmirror \u955C\u50CF",url:"https://registry.npmmirror.com",enabled:!1,official:!0,authoritative:!0,type:"registry"}])};return(0,a.jsxs)("div",{style:{border:"1px solid var(--dsw-alias-border-l2)",background:"var(--dsw-alias-bg-layer-2)",borderRadius:8,padding:"10px 12px",display:"flex",flexDirection:"column",gap:8},children:[(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[(0,a.jsx)("span",{style:{fontSize:13,fontWeight:600},children:n("sourcesTitle")}),(0,a.jsx)("button",{type:"button",onClick:k,style:ht,children:n("resetSources")})]}),(0,a.jsx)("p",{style:{margin:0,fontSize:12,color:"var(--dsw-alias-label-tertiary)",lineHeight:"18px"},children:n("sourcesHint")}),o.length===0?(0,a.jsx)("p",{style:{margin:0,fontSize:12,color:"var(--dsw-alias-state-error-primary)"},children:n("noSources")}):null,(0,a.jsx)("ul",{style:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column",gap:4},children:o.map((y,$)=>(0,a.jsxs)("li",{style:{display:"flex",alignItems:"center",gap:8,fontSize:12},children:[(0,a.jsxs)("label",{style:{display:"inline-flex",alignItems:"center",gap:4,flex:"none",cursor:"pointer"},children:[(0,a.jsx)("input",{type:"checkbox",checked:y.enabled,onChange:E=>m($,E.currentTarget.checked)}),n("enabled")]}),(0,a.jsxs)("span",{style:{fontWeight:600,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:180},title:y.name,children:[y.name,y.official?(0,a.jsx)("em",{style:{fontStyle:"normal",fontSize:10,color:"var(--dsw-alias-state-business-primary, #4f8cff)",marginLeft:4},children:n("official")}):null,!y.official&&y.authoritative?(0,a.jsx)("em",{style:{fontStyle:"normal",fontSize:10,color:"var(--dsw-alias-state-business-primary, #4f8cff)",marginLeft:4},children:n("authoritative")}):null,y.insecure?(0,a.jsx)("em",{title:y.note??n("plaintextFallbackHint"),style:{fontStyle:"normal",fontSize:10,color:"var(--dsw-alias-state-warning-primary, #b8860b)",marginLeft:4},children:y.official||y.authoritative?n("plaintextAuthoritative"):n("plaintextFallback")}):null,y.type==="github"?(0,a.jsx)("em",{style:{fontStyle:"normal",fontSize:10,color:"var(--dsw-alias-label-tertiary)",marginLeft:4},children:"GitHub"}):null]}),(0,a.jsx)("code",{style:{flex:"1 1 auto",fontFamily:"var(--ds-font-family-code)",fontSize:11,color:"var(--dsw-alias-label-secondary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:y.url}),y.official?null:(0,a.jsxs)("label",{title:n("authoritativeHint"),style:{display:"inline-flex",alignItems:"center",gap:4,flex:"none",cursor:"pointer",fontSize:11},children:[(0,a.jsx)("input",{type:"checkbox",checked:y.authoritative===!0,onChange:E=>h($,E.currentTarget.checked)}),n("authoritative")]}),!y.official&&y.insecure?(0,a.jsxs)("label",{title:n("allowInsecureHint"),style:{display:"inline-flex",alignItems:"center",gap:4,flex:"none",cursor:"pointer",fontSize:11},children:[(0,a.jsx)("input",{type:"checkbox",checked:y.allowInsecure===!0,onChange:E=>b($,E.currentTarget.checked)}),n("allowInsecure")]}):null,(0,a.jsx)("button",{type:"button",onClick:()=>p($),style:ht,disabled:r,children:n("remove")})]},$))}),(0,a.jsxs)("div",{style:{display:"flex",gap:6,alignItems:"center",flexWrap:"wrap"},children:[(0,a.jsx)("input",{value:s,placeholder:n("sourceName"),onChange:y=>c(y.currentTarget.value),style:su}),(0,a.jsx)("input",{value:u,placeholder:n("sourceUrl"),onChange:y=>d(y.currentTarget.value),style:{...su,flex:"1 1 220px"}}),(0,a.jsx)("button",{type:"button",onClick:x,style:A,children:n("addSource")})]}),(0,a.jsx)("div",{style:{display:"flex",justifyContent:"flex-end"},children:(0,a.jsx)("button",{type:"button",onClick:()=>t(o),disabled:r,style:{...A,background:"var(--dsw-alias-state-business-primary, #4f8cff)",color:"#fff",fontWeight:600},children:n("saveSources")})})]})}var A={border:"1px solid var(--dsw-alias-border-l2)",color:"var(--dsw-alias-label-primary)",font:"inherit",cursor:"pointer",background:"transparent",borderRadius:6,padding:"4px 10px",fontSize:12},ht={border:"none",background:"none",color:"var(--dsw-alias-state-business-primary, #4f8cff)",font:"inherit",fontSize:12,cursor:"pointer",padding:"2px 4px"},su={boxSizing:"border-box",height:30,border:"1px solid var(--dsw-alias-border-l2)",background:"var(--dsw-alias-bg-layer-1)",color:"var(--dsw-alias-label-primary)",borderRadius:6,padding:"0 10px",fontSize:12,font:"inherit",flex:"1 1 140px"};function lf({size:e=18}){return(0,a.jsxs)("svg",{className:"drydock-logo-mark",width:e,height:e,viewBox:"0 0 64 64",fill:"currentColor",role:"img","aria-label":"drydock logo",style:{flex:"none",verticalAlign:"-0.15em"},children:[(0,a.jsx)("g",{transform:"translate(9.5,14) scale(1.85)",children:(0,a.jsx)("path",{d:"M23.748 4.651c-.254-.124-.364.113-.512.233-.051.04-.094.09-.137.137-.372.397-.806.657-1.373.626-.829-.046-1.537.214-2.163.848-.133-.782-.575-1.248-1.247-1.548-.352-.155-.708-.311-.955-.65-.172-.24-.219-.509-.305-.774-.055-.16-.11-.323-.293-.35-.2-.031-.278.136-.356.276-.313.572-.434 1.202-.422 1.84.027 1.436.633 2.58 1.838 3.393.137.094.172.187.129.323-.082.28-.18.553-.266.833-.055.179-.137.218-.328.14a5.5 5.5 0 0 1-1.737-1.179c-.857-.828-1.631-1.743-2.597-2.46a12 12 0 0 0-.689-.47c-.985-.957.13-1.743.387-1.836.27-.098.094-.433-.778-.428-.872.003-1.67.295-2.687.685a3 3 0 0 1-.465.136 9.6 9.6 0 0 0-2.883-.101c-1.885.21-3.39 1.1-4.497 2.622C.082 8.776-.231 10.854.152 13.02c.403 2.284 1.568 4.175 3.36 5.653 1.857 1.533 3.997 2.284 6.438 2.14 1.482-.085 3.132-.284 4.994-1.86.47.234.962.328 1.78.398.629.058 1.235-.031 1.705-.129.735-.155.684-.836.418-.961-2.155-1.004-1.682-.595-2.112-.926 1.095-1.295 2.768-3.598 3.284-6.733.05-.346.115-.834.108-1.114-.004-.171.035-.238.23-.257a4.2 4.2 0 0 0 1.545-.475c1.397-.763 1.96-2.016 2.093-3.517.02-.23-.004-.467-.247-.588M11.58 18.168c-2.088-1.642-3.101-2.183-3.52-2.16-.39.024-.32.472-.234.763.09.288.207.487.371.74.114.167.192.416-.113.603-.673.416-1.842-.14-1.897-.168-1.361-.801-2.5-1.86-3.301-3.306-.775-1.393-1.225-2.888-1.299-4.482-.02-.385.094-.522.477-.592a4.7 4.7 0 0 1 1.53-.038c2.131.311 3.946 1.264 5.467 2.774.868.86 1.525 1.887 2.202 2.89.72 1.066 1.494 2.082 2.48 2.915.348.291.626.513.892.677-.802.09-2.14.109-3.055-.615zm1.001-6.44a.306.306 0 0 1 .415-.287.3.3 0 0 1 .113.074.3.3 0 0 1 .086.214c0 .17-.136.307-.308.307a.303.303 0 0 1-.306-.307m3.11 1.596c-.2.081-.4.151-.591.16a1.25 1.25 0 0 1-.798-.254c-.274-.23-.47-.358-.551-.758a1.7 1.7 0 0 1 .015-.588c.07-.327-.007-.537-.238-.727-.188-.156-.426-.199-.689-.199a.6.6 0 0 1-.254-.078.253.253 0 0 1-.114-.358 1 1 0 0 1 .192-.21c.356-.202.767-.136 1.146.016.352.144.618.408 1.001.782.392.451.462.576.685.915.176.264.336.536.446.848.066.194-.02.353-.25.45"})}),(0,a.jsxs)("g",{children:[(0,a.jsx)("rect",{x:"19",y:"16.5",width:"6.2",height:"5.5",rx:"0.5"}),(0,a.jsx)("rect",{x:"26.4",y:"16.5",width:"6.2",height:"5.5",rx:"0.5"}),(0,a.jsx)("rect",{x:"19",y:"9.8",width:"6.2",height:"5.5",rx:"0.5"})]})]})}function Jh(e){let t=e&&e.size||18;return(0,a.jsxs)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,a.jsx)("rect",{x:"3.5",y:"3.5",width:"7",height:"7",rx:"1.6"}),(0,a.jsx)("rect",{x:"13.5",y:"3.5",width:"7",height:"7",rx:"1.6"}),(0,a.jsx)("rect",{x:"3.5",y:"13.5",width:"7",height:"7",rx:"1.6"}),(0,a.jsx)("rect",{x:"13.5",y:"13.5",width:"7",height:"7",rx:"1.6"})]})}var Vp={"@deepseek-ai/dsh-experimental-agent-team-profile":{name:"Agent Team \u7EC4\u5408\u5305",note:"\u591A\u667A\u80FD\u4F53\u56E2\u961F\u534F\u4F5C\uFF1A\u6210\u5458\u3001\u4EFB\u52A1\u770B\u677F\u3001\u6D88\u606F",glyph:"\u{1F465}"},"@deepseek-ai/dsh-experimental-voice-input-bundle":{name:"\u8BED\u97F3\u8F93\u5165",note:"\u672C\u5730\u8BED\u97F3\u8F6C\u5199\uFF0C\u8F93\u5165\u6846\u9EA6\u514B\u98CE\u5165\u53E3",glyph:"\u{1F399}"},"@deepseek-ai/dsh-experimental-auto-review":{name:"\u81EA\u52A8\u5BA1\u9605",note:"\u9AD8\u98CE\u9669\u64CD\u4F5C\u5148\u81EA\u52A8\u5BA1\u9605\u518D\u6267\u884C",glyph:"\u{1F6E1}"}};function Ao(e){if(e&&typeof e=="object"&&"ok"in e){if(e.ok===!0)return e.value;let t=e.error??{};throw new Error(`${t.code??"remote"}: ${t.message??"\u8C03\u7528\u5931\u8D25"}`)}return e}function cf({officialApi:e,itemsSource:t,renderSlot:r,t:n}){let[o,i]=O({status:"loading"}),[s,c]=O(null),[u,d]=O(null),[m,h]=O(null),[b,p]=O(0),x=qp((t??ou).subscribe,(t??ou).getSnapshot,(t??ou).getSnapshot);$e(()=>{let C=!0;return!e||typeof e.listBundles!="function"?(i({status:"unavailable"}),()=>{C=!1}):(i({status:"loading"}),Promise.all([e.listBundles().then(Ao),typeof e.listVersionExemptions=="function"?e.listVersionExemptions().then(Ao).catch(()=>({exemptions:{}})):Promise.resolve({exemptions:{}})]).then(([B,H])=>{C&&i({status:"ready",bundles:Array.isArray(B)?B:[],exemptions:H&&H.exemptions?H.exemptions:{}})},B=>{C&&i({status:"error",message:B instanceof Error?B.message:String(B)})}),()=>{C=!1})},[e,b]);let k=o.status==="ready"?o.bundles.filter(C=>C.optional===!0||Vp[C.name]!==void 0):[],y=async(C,B)=>{if(s===null){c(C.name),d(null);try{await e.setBundleEnabled(C.name,B).then(Ao),d({severity:"status",message:`${C.name}\uFF1A\u5DF2${B?"\u542F\u7528":"\u505C\u7528"}\uFF08\u5237\u65B0\u9875\u9762\u540E\u751F\u6548\uFF09\u3002`}),p(H=>H+1)}catch(H){d({severity:"error",message:`${C.name}\uFF1A${H instanceof Error?H.message:String(H)}`})}finally{c(null)}}},$=async(C,B)=>{if(s===null){c(C);try{await e.setVersionExemption(C,B,!1,!0).then(Ao),d({severity:"status",message:`${C}\uFF1A\u5DF2\u64A4\u9500 ${B} \u7684\u8C41\u514D\u3002`}),p(H=>H+1)}catch(H){d({severity:"error",message:String(H instanceof Error?H.message:H)})}finally{c(null)}}},E={display:"flex",alignItems:"center",gap:12,border:"1px solid var(--dsw-alias-border-l2)",background:"var(--dsw-alias-bg-layer-1)",borderRadius:10,padding:"12px 14px"},Z={width:38,height:38,flex:"0 0 auto",borderRadius:9,background:"var(--dsw-alias-bg-layer-3)",display:"grid",placeItems:"center",fontSize:17},S=C=>({border:`1px solid ${C??"var(--dsw-alias-border-l2)"}`,color:C??"var(--dsw-alias-label-tertiary)",borderRadius:999,padding:"1px 7px",fontSize:11,whiteSpace:"nowrap"}),D=Object.entries(o.exemptions??{});return o.status==="unavailable"?(0,a.jsx)("p",{style:{margin:0,fontSize:13,color:"var(--dsw-alias-label-tertiary)"},children:n("officialUnavailable")}):o.status==="loading"?(0,a.jsx)("p",{style:{margin:0,fontSize:13,color:"var(--dsw-alias-label-tertiary)"},children:n("loading")}):o.status==="error"?(0,a.jsxs)("div",{role:"alert",style:{display:"flex",gap:10,alignItems:"center",fontSize:13,color:"var(--dsw-alias-state-error-primary)"},children:[(0,a.jsx)("span",{children:o.message}),(0,a.jsx)("button",{type:"button",onClick:()=>p(C=>C+1),style:A,children:n("retry")})]}):(0,a.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[(0,a.jsx)("p",{style:{margin:0,fontSize:12.5,color:"var(--dsw-alias-label-tertiary)"},children:n("officialIntro")}),u?(0,a.jsx)("p",{role:u.severity==="error"?"alert":"status",style:{margin:0,fontSize:12,color:u.severity==="error"?"var(--dsw-alias-state-error-primary)":"var(--dsw-alias-label-tertiary)"},children:u.message}):null,(0,a.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:8,fontSize:13,fontWeight:600},children:[n("officialTitle"),(0,a.jsxs)("span",{style:{color:"var(--dsw-alias-label-tertiary)",fontWeight:400,fontSize:12},children:["(",k.length,")"]})]}),k.length===0?(0,a.jsx)("p",{style:{margin:0,fontSize:13,color:"var(--dsw-alias-label-tertiary)"},children:n("officialEmpty")}):(0,a.jsx)("ul",{style:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column",gap:8},children:k.map(C=>{let B=Vp[C.name]??{name:C.name,note:C.description??"",glyph:"\u{1F4E6}"},H=s===C.name;return(0,a.jsxs)("li",{style:{display:"block"},children:[(0,a.jsxs)("div",{style:E,children:[(0,a.jsx)("div",{style:Z,children:B.glyph}),(0,a.jsxs)("div",{style:{minWidth:0,flex:"1 1 auto"},children:[(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:7,flexWrap:"wrap"},children:[(0,a.jsx)("span",{style:{fontSize:14,fontWeight:600},children:B.name}),C.version?(0,a.jsxs)("span",{style:{fontSize:11.5,color:"var(--dsw-alias-label-tertiary)"},children:["v",C.version]}):null,(0,a.jsx)("span",{style:S(),children:n("officialOptional")}),(0,a.jsx)("span",{style:S(C.enabled?"var(--dsw-alias-state-success-primary, #22c55e)":"var(--dsw-alias-state-warning-primary, #f59e0b)"),children:C.enabled?n("officialEnabled"):n("officialNotEnabled")}),C.installed?(0,a.jsx)("span",{style:S(),children:n("officialInstalled")}):null,C.error?(0,a.jsx)("span",{style:S("var(--dsw-alias-state-error-primary)"),children:String(C.error.code??"\u9519\u8BEF")}):null]}),(0,a.jsx)("div",{style:{fontSize:12.5,color:"var(--dsw-alias-label-tertiary)",marginTop:3},children:B.note||C.name}),(0,a.jsx)("div",{style:{fontSize:11,color:"var(--dsw-alias-label-tertiary)",marginTop:2,fontFamily:"var(--ds-font-family-code)"},children:C.name})]}),(0,a.jsx)("div",{style:{marginLeft:"auto",display:"flex",alignItems:"center",gap:8,flex:"0 0 auto"},children:C.enabled?(0,a.jsx)("button",{type:"button",disabled:s!==null,onClick:()=>y(C,!1),style:{...A,...s!==null?{opacity:.6,cursor:"default"}:null},children:n("officialDisable")}):(0,a.jsx)("button",{type:"button",disabled:s!==null,onClick:()=>y(C,!0),style:{...A,background:"var(--dsw-alias-state-business-primary, #4f8cff)",borderColor:"transparent",color:"#fff",fontWeight:600,...s!==null?{opacity:.6,cursor:"default"}:null},children:n(H?"officialInstalling":"officialInstall")})})]}),C.installed?null:(0,a.jsx)("div",{style:{marginLeft:50,marginTop:4,fontSize:11.5,color:"var(--dsw-alias-label-tertiary)"},children:n("installHint")})]},C.name)})}),x.length>0?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:8,fontSize:13,fontWeight:600,marginTop:6},children:[n("officialItems"),(0,a.jsxs)("span",{style:{color:"var(--dsw-alias-label-tertiary)",fontWeight:400,fontSize:12},children:["(",x.length,")"]})]}),(0,a.jsx)("ul",{style:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column",gap:8},children:x.map(C=>{let B=m===C.id,H=typeof r=="function";return(0,a.jsxs)("li",{style:{display:"block"},children:[(0,a.jsxs)("div",{style:E,children:[(0,a.jsx)("div",{style:Z,children:"\u{1F9E9}"}),(0,a.jsxs)("div",{style:{minWidth:0,flex:"1 1 auto"},children:[(0,a.jsx)("div",{style:{fontSize:14,fontWeight:600},children:C.label}),(0,a.jsx)("div",{style:{fontSize:11,color:"var(--dsw-alias-label-tertiary)",fontFamily:"var(--ds-font-family-code)"},children:C.id}),H?(0,a.jsx)("div",{style:{marginTop:3,fontSize:12,lineHeight:"18px",color:"var(--dsw-alias-label-secondary)"},children:r("plugins.item",{view:"summary"},{only:C.id})}):(0,a.jsx)("div",{style:{marginTop:3,fontSize:11.5,color:"var(--dsw-alias-label-tertiary)"},children:n("configMainPageHint")})]}),H?(0,a.jsx)("button",{type:"button",onClick:()=>h(B?null:C.id),style:A,children:n(B?"officialClose":"officialOpen")}):null]}),B&&H?(0,a.jsx)("div",{style:{marginTop:8,marginLeft:50,border:"1px solid var(--dsw-alias-border-l2)",borderRadius:10,padding:"12px 14px",background:"var(--dsw-alias-bg-layer-1)"},children:r("plugins.item",{view:"page"},{only:C.id})}):null]},C.id)})})]}):null,(0,a.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:8,fontSize:13,fontWeight:600,marginTop:6},children:[n("exemptions"),(0,a.jsxs)("span",{style:{color:"var(--dsw-alias-label-tertiary)",fontWeight:400,fontSize:12},children:["(",D.length,")"]})]}),D.length===0?(0,a.jsx)("p",{style:{margin:0,fontSize:12.5,color:"var(--dsw-alias-label-tertiary)"},children:n("exemptionsEmpty")}):(0,a.jsx)("ul",{style:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column",gap:6},children:D.flatMap(([C,B])=>(Array.isArray(B)?B:[]).map(H=>(0,a.jsxs)("li",{style:{display:"flex",alignItems:"center",gap:8,fontSize:12.5,color:"var(--dsw-alias-label-secondary, var(--dsw-alias-label-tertiary))"},children:[(0,a.jsx)("code",{style:{fontFamily:"var(--ds-font-family-code)"},children:C}),(0,a.jsx)("span",{style:{color:"var(--dsw-alias-label-tertiary)"},children:"\u2190"}),(0,a.jsx)("code",{style:{fontFamily:"var(--ds-font-family-code)"},children:H}),(0,a.jsx)("button",{type:"button",disabled:s!==null,onClick:()=>$(C,H),style:{...A,marginLeft:"auto"},children:n("exemptionRevoke")})]},`${C}@${H}`)))})]})}function Jp(e){let t=e.t,[r,n]=O("official"),[o,i]=O("history"),[s,c]=O("sources"),[u,d]=O(null),[m,h]=O(null);$e(()=>{if(r!=="market"&&r!=="maintenance")return;let $=!0;return e.list().then(E=>{$&&d(E)},()=>{}),()=>{$=!1}},[r,e.list]);let b=[{id:"official",label:t("tabOfficial")},{id:"list",label:t("tabAll")},{id:"market",label:t("tabMarket")},{id:"ops",label:t("tabOps")},{id:"maintenance",label:t("tabMaintenance")}],p=$=>({padding:"7px 11px",fontSize:13,font:"inherit",cursor:"pointer",background:"transparent",border:"none",borderBottom:`2px solid ${$?"var(--dsw-alias-state-business-primary, #4f8cff)":"transparent"}`,color:$?"var(--dsw-alias-label-primary)":"var(--dsw-alias-label-tertiary)",fontWeight:$?600:400}),x=($,E,Z)=>(0,a.jsx)("div",{style:{display:"flex",gap:6,marginBottom:12,flexWrap:"wrap"},children:$.map(S=>(0,a.jsx)("button",{type:"button",onClick:()=>Z(S.id),style:{...A,fontWeight:E===S.id?600:400,color:E===S.id?"var(--dsw-alias-state-business-primary, #4f8cff)":"var(--dsw-alias-label-primary)",borderColor:E===S.id?"var(--dsw-alias-state-business-primary, #4f8cff)":"var(--dsw-alias-border-l2)"},children:S.label},S.id))}),k=async $=>{let E=Array.isArray($)&&$.some(Z=>Z&&Z.authoritative===!0&&Z.official!==!0);if(!(E&&!window.confirm(t("sourcesAuthoritativeConfirm")))){h("sources");try{let Z=await e.setSources($,E?{confirm:!0}:null);d(Z)}finally{h(null)}}},y=u!==null?u.entries:[];return(0,a.jsx)("section",{"data-plugin-panel":"drydock",style:{boxSizing:"border-box",height:"100%",overflowY:"auto",overflowX:"hidden",padding:"22px 26px 44px",color:"var(--dsw-alias-label-primary)"},children:(0,a.jsxs)("div",{style:{maxWidth:960,margin:"0 auto",display:"flex",flexDirection:"column",gap:14},children:[(0,a.jsxs)("header",{"data-window-drag":"true",children:[(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,flexWrap:"wrap"},children:[(0,a.jsxs)("h1",{style:{margin:0,fontSize:20,fontWeight:600},children:[(0,a.jsx)(lf,{size:20})," ",t("title")]}),(0,a.jsx)("span",{style:{fontSize:11,fontWeight:600,padding:"2px 9px",borderRadius:999,background:"color-mix(in srgb, var(--dsw-alias-state-business-primary, #4f8cff) 14%, transparent)",color:"var(--dsw-alias-state-business-primary, #4f8cff)"},children:t("managerBadge")})]}),(0,a.jsx)("p",{style:{margin:"4px 0 0",fontSize:12.5,color:"var(--dsw-alias-label-tertiary)"},children:t("pageSubtitle")})]}),(0,a.jsx)("nav",{style:{display:"flex",gap:4,borderBottom:"1px solid var(--dsw-alias-border-l2)",flexWrap:"wrap"},children:b.map($=>(0,a.jsx)("button",{type:"button",onClick:()=>n($.id),style:p(r===$.id),children:$.label},$.id))}),r==="official"?(0,a.jsx)(gt,{children:(0,a.jsx)(cf,{officialApi:e.officialApi,itemsSource:e.officialItemsSource,renderSlot:e.renderSlot,t})}):null,r==="list"?(0,a.jsx)(gt,{children:(0,a.jsx)(Xp,{...e,embedded:!0})}):null,r==="market"?(0,a.jsx)(gt,{children:(0,a.jsx)(sf,{marketCatalog:e.marketCatalog,marketInstall:e.marketInstall,busy:m!==null,t,entries:y})}):null,r==="ops"?(0,a.jsxs)(gt,{children:[x([{id:"history",label:t("history")},{id:"scenarios",label:t("scenarios")}],o,i),o==="history"?(0,a.jsx)(tf,{operationHistory:e.operationHistory,undoOperation:e.undoOperation,onSnapshot:d,t}):(0,a.jsx)(rf,{scenarioList:e.scenarioList,scenarioSave:e.scenarioSave,scenarioUpdate:e.scenarioUpdate,scenarioDelete:e.scenarioDelete,scenarioApply:e.scenarioApply,onSnapshot:d,t})]}):null,r==="maintenance"?(0,a.jsxs)(gt,{children:[x([{id:"sources",label:t("sources")},{id:"rescue",label:t("rescue")}],s,c),s==="sources"?(0,a.jsx)(af,{sources:u!==null?u.sources:[],save:k,busy:m!==null,t}):(0,a.jsx)(Qp,{diagnose:e.diagnose,quarantine:e.quarantine,repairHarness:e.repairHarness,restartHarness:e.restartHarness,uninstallPackages:e.uninstallPackages,uninstallPreview:e.uninstallPreview,getRescueConfig:e.getRescueConfig,setRescueConfig:e.setRescueConfig,getDownloadConfig:e.getDownloadConfig,checkDownloads:e.checkDownloads,verifyProfile:e.verifyProfile,fixProfile:e.fixProfile,managed:y.filter($=>$.origin==="user"),t})]}):null]})})}var qh={tab:"\u63D2\u4EF6\u7BA1\u7406",tabOfficial:"\u5B98\u65B9\u5185\u7F6E\uFF08\u53EF\u9009\uFF09",tabAll:"\u5168\u90E8\u63D2\u4EF6",tabUpdate:"\u53EF\u66F4\u65B0",tabMarket:"\u63D2\u4EF6\u5E02\u573A",tabOps:"\u64CD\u4F5C\u4E0E\u573A\u666F",tabMaintenance:"\u7EF4\u62A4",onlyUpdatable:"\u4EC5\u663E\u793A\u53EF\u66F4\u65B0",pageSubtitle:"\u5DF2\u63A5\u7BA1\u5185\u7F6E\u63D2\u4EF6\u9875 \xB7 \u4FA7\u8FB9\u680F\u300C\u63D2\u4EF6\u7BA1\u7406\u300D",officialTitle:"\u5B98\u65B9\u5185\u7F6E\u53EF\u9009\u63D2\u4EF6",officialIntro:"\u5F15\u64CE\u81EA\u5E26\u3001\u9ED8\u8BA4\u672A\u542F\u7528\u7684\u80FD\u529B\u5305\uFF1B\u542F\u7528\u540E\u5373\u53EF\u4F7F\u7528\uFF0C\u90E8\u5206\u63D2\u4EF6\u8FD8\u81EA\u5E26\u914D\u7F6E\u9875\u3002",officialEmpty:"\u6CA1\u6709\u53D1\u73B0\u5B98\u65B9\u53EF\u9009\u63D2\u4EF6\u3002",officialUnavailable:"\u5F15\u64CE\u672A\u63D0\u4F9B\u5B98\u65B9\u63D2\u4EF6\u6E05\u5355\u63A5\u53E3\uFF08pluginManager remote \u4E0D\u53EF\u7528\uFF09\u3002",officialInstall:"\u542F\u7528",officialInstalling:"\u542F\u7528\u4E2D\u2026",officialDisable:"\u505C\u7528",officialInstalled:"\u5DF2\u5B89\u88C5",officialNotInstalled:"\u672A\u5B89\u88C5",officialEnabled:"\u5DF2\u542F\u7528",officialNotEnabled:"\u672A\u542F\u7528",officialOptional:"\u53EF\u9009",officialItems:"\u81EA\u5E26\u914D\u7F6E\u9875\u7684\u5B98\u65B9\u63D2\u4EF6",officialOpen:"\u6253\u5F00\u914D\u7F6E\u9875",officialClose:"\u6536\u8D77",exemptions:"\u7248\u672C\u8C41\u514D",exemptionsEmpty:"\u6682\u65E0\u7248\u672C\u8C41\u514D\u8BB0\u5F55\u3002",exemptionRevoke:"\u64A4\u9500",installHint:"\u300C\u542F\u7528\u300D\u4F1A\u901A\u8FC7 pnpm \u5B89\u88C5\u8BE5\u7EC4\u5408\u5305\uFF0C\u53EF\u80FD\u9700\u8981\u4E0B\u8F7D\u4F9D\u8D56\u3002",title:"\u5F15\u64CE\u4E0E\u63D2\u4EF6\u7BA1\u7406\u53F0",profile:"\u5F53\u524D\u914D\u7F6E",search:"\u641C\u7D22\u63D2\u4EF6\u540D\u79F0/\u7B80\u4ECB/\u5305\u540D",refresh:"\u68C0\u67E5\u66F4\u65B0\u5E76\u5237\u65B0\u72B6\u6001",refreshDone:"\u68C0\u67E5\u66F4\u65B0\u5B8C\u6210",refreshAborted:"\u7F51\u7EDC\u8F83\u6162\uFF1A\u68C0\u67E5\u66F4\u65B0\u5DF2\u5728\u603B\u9884\u7B97\u5185\u4E2D\u6B62",refreshAbortedHint:"\uFF0C\u7ED3\u679C\u53EF\u80FD\u4E0D\u5B8C\u6574\uFF08\u5931\u8D25\u4E0D\u4F1A\u88AB\u7F13\u5B58\uFF09\uFF0C\u7F51\u7EDC\u6062\u590D\u540E\u53EF\u76F4\u63A5\u91CD\u8BD5\u3002",loading:"\u6B63\u5728\u8BFB\u53D6\u63D2\u4EF6\u2026",error:"\u6682\u65F6\u65E0\u6CD5\u8BFB\u53D6\u63D2\u4EF6\u3002",retry:"\u91CD\u8BD5",empty:"\u6682\u65E0\u53EF\u663E\u793A\u7684\u63D2\u4EF6\u3002",emptySearch:"\u6CA1\u6709\u5339\u914D\u7684\u63D2\u4EF6\u3002",legendNecessity:"\u5FC5\u8981\u7A0B\u5EA6",legendStatus:"\u542F\u7528\u72B6\u6001",legendOrigin:"\u6765\u6E90",originLegend:"\u6765\u6E90",originAll:"\u5168\u90E8",originBuiltin:"\u67B6\u6784\u81EA\u5E26",originUser:"\u7528\u6237\u5B89\u88C5",originUserHint:"\u7528\u6237/agent \u5B89\u88C5\uFF1Adsh plugin add \u6216\u63D2\u4EF6\u5E02\u573A\u5B89\u88C5",configEntry:"\u914D\u7F6E",configEntryHint:"\u6253\u5F00\u8BE5\u63D2\u4EF6\u7684\u81EA\u5E26\u914D\u7F6E\u9762\u677F\uFF08\u7531\u63D2\u4EF6\u81EA\u8EAB\u63D0\u4F9B\uFF09",configBundleEntry:"\u63D2\u4EF6\u914D\u7F6E",configMainPageHint:"\u8BF7\u5728\u4FA7\u8FB9\u680F\u300C\u63D2\u4EF6\u7BA1\u7406\u300D\u9875\u4E2D\u6253\u5F00\u8BE5\u914D\u7F6E\u9875\u3002",necessityCore:"\u6838\u5FC3\u7EC4\u4EF6\uFF08\u5F15\u64CE\u5FC5\u9700\uFF0C\u4E0D\u5141\u8BB8\u7981\u7528\uFF09",badgeCore:"\u6838\u5FC3",necessityBuiltin:"\u5F15\u64CE\u5185\u7F6E\u7EC4\u4EF6",badgeBuiltin:"\u5185\u7F6E",necessityUser:"\u7528\u6237\u63D2\u4EF6",badgeUser:"\u7528\u6237",recommendedTag:"\u63A8\u8350",recommendedTagHint:"\u63A8\u8350\u52A0\u88C5\uFF1A\u7BA1\u7406\u5668\u5EFA\u8BAE\u5B89\u88C5\u7684\u7B2C\u4E09\u65B9\u589E\u5F3A\u63D2\u4EF6",managerBadge:"\u7BA1\u7406\u5668",marketDetail:"\u5E02\u573A\u8BE6\u60C5",marketDetailHint:"\u5728\u63D2\u4EF6\u5E02\u573A\uFF08ADP \u7CBE\u9009\u76EE\u5F55\uFF09\u4E2D\u67E5\u770B\u8BE5\u63D2\u4EF6",statusError:"\u9519\u8BEF/\u9700\u68C0\u67E5",statusUpdate:"\u9700\u66F4\u65B0",statusDisabled:"\u672A\u542F\u7528",statusEnabled:"\u542F\u7528",enableEntry:"\u542F\u7528",disableEntry:"\u505C\u7528",versionUnknown:"\u7248\u672C\u672A\u77E5",versionNetworkError:"\u7F51\u7EDC\u4E0D\u53EF\u8FBE\uFF0C\u53EF\u91CD\u8BD5",versionNotFound:"\u66F4\u65B0\u6E90\u6CA1\u6709\u6B64\u63D2\u4EF6/\u65E0\u66F4\u65B0",versionBackoff:"\u66F4\u65B0\u6E90\u9650\u6D41\u51B7\u5374\u4E2D\uFF0C\u7A0D\u540E\u81EA\u52A8\u91CD\u8BD5",update:"\u66F4\u65B0",updateInternal:"\u5185\u7F6E",updateInternalHint:"\u4F7F\u7528\u7BA1\u7406\u5668\u5185\u7F6E\u4E0B\u8F7D\u5668\uFF08HTTP/P2P/aria2\uFF09\uFF0C\u4E0D\u8D70\u6D4F\u89C8\u5668\u4E0B\u8F7D",updateAll:"\u68C0\u67E5\u66F4\u65B0",upToDate:"\u5DF2\u662F\u6700\u65B0\u7248\u672C",notManaged:"\u968F\u5B89\u88C5\u66F4\u65B0",updateAvailable:"\u53EF\u66F4\u65B0",selfUpdateTitle:"\u7BA1\u7406\u5668\u81EA\u8EAB",selfUpdateUpToDate:"\u5DF2\u662F\u6700\u65B0\uFF08\u5F53\u524D {v}\uFF09",selfUpdateCheck:"\u68C0\u67E5\u81EA\u8EAB\u66F4\u65B0",selfUpdateChecking:"\u68C0\u67E5\u4E2D\u2026\uFF08\u4E0B\u8F7D\u5E76\u6821\u9A8C\uFF09",selfUpdateNow:"\u73B0\u5728\u5347\u7EA7",selfUpdateLater:"\u7A0D\u540E",selfUpdateRunning:"\u6B63\u5728\u5347\u7EA7\uFF1A\u5F15\u64CE\u4F1A\u77ED\u6682\u91CD\u542F\uFF0C\u5B8C\u6210\u540E\u5237\u65B0\u672C\u9875",selfUpdateDesktopOnly:"\u684C\u9762\u5F62\u6001\u4E0D\u81EA\u52A8\u5B89\u88C5\uFF08profile \u7531\u5B98\u65B9\u5E94\u7528\u72EC\u5360\uFF09\uFF1A\u8BF7\u6309\u63D0\u793A\u7528\u684C\u9762\u7248\u81EA\u5E26 CLI \u5B89\u88C5",expandAll:"\u5168\u90E8\u5C55\u5F00",collapseAll:"\u5168\u90E8\u6536\u8D77",sources:"\u66F4\u65B0\u6E90",sourcesTitle:"\u66F4\u65B0\u6E90\u914D\u7F6E",sourcesHint:"\u7248\u672C\u68C0\u67E5\u4E0E\u66F4\u65B0\u4ECE\u542F\u7528\u7684\u6E90\u83B7\u53D6\uFF1B\u5B98\u65B9 npm \u6E90\u3001npmmirror \u4E0E GitHub \u5B98\u65B9\u4ED3\u5E93\u5DF2\u9884\u586B\u3002\u81EA\u5B9A\u4E49\u6E90\u9ED8\u8BA4\u53EA\u4F5C\u515C\u5E95\uFF08degraded\uFF09\uFF0C\u4E0D\u4E0E\u5B98\u65B9\u6E90\u6DF7\u6BD4\u7248\u672C\uFF1B\u8981\u8BA9\u5B83\u53C2\u4E0E\u6743\u5A01\u88C1\u51B3\u9700\u663E\u5F0F\u52FE\u9009\u300C\u6743\u5A01\u300D\u3002http:// \u6E90\u9ED8\u8BA4\u6807\u6CE8\u300C\u660E\u6587\xB7\u4EC5\u515C\u5E95\u300D\uFF0C\u5347\u6743\u5A01\u8FD8\u987B\u540C\u65F6\u52FE\u9009\u300C\u5141\u8BB8\u660E\u6587\u300D\u3002GitHub \u6E90\u9002\u7528\u4E8E\u4ED3\u5E93\u6839 package.json \u7684 name \u5339\u914D\u5305\u540D\u3001\u5E76\u4EE5 GitHub Releases \u53D1\u7248\u7684\u63D2\u4EF6\u3002",sourcesSaved:"\u66F4\u65B0\u6E90\u5DF2\u4FDD\u5B58\uFF0C\u6B63\u5728\u91CD\u65B0\u68C0\u67E5\u7248\u672C\u2026",sourcesAuthoritativeConfirm:"\u5C06\u628A\u975E\u5185\u7F6E\u6E90\u5347\u4E3A\u300C\u6743\u5A01\u300D\uFF1A\u7248\u672C\u88C1\u51B3\u4E0E\u5B89\u88C5\u6765\u6E90\u90FD\u4EE5\u5B83\u4E3A\u51C6\u3002\u786E\u8BA4\u53EA\u5BF9\u53EF\u4FE1\u7684\u5185\u7F51/\u79BB\u7EBF\u955C\u50CF\u5F00\u542F\uFF1F",resetSources:"\u6062\u590D\u9ED8\u8BA4\u6E90",authoritative:"\u6743\u5A01",authoritativeHint:"\u628A\u8BE5\u6E90\u5347\u4E3A\u6743\u5A01\u5C42\uFF1A\u7248\u672C\u88C1\u51B3\u4E0E\u5B89\u88C5\u4EE5\u5B83\u4E3A\u51C6\uFF08\u5B98\u65B9\u6E90\u4E0D\u53EF\u7528\u65F6\u4ECD\u53EF\u7528\uFF09\u3002\u53EA\u5BF9\u53EF\u4FE1\u7684\u5185\u7F51\u955C\u50CF/\u79BB\u7EBF\u6E90\u5F00\u542F\u3002",allowInsecure:"\u5141\u8BB8\u660E\u6587",allowInsecureHint:"\u8BE5\u6E90\u662F http:// \u660E\u6587\u4F20\u8F93\uFF0C\u9ED8\u8BA4\u53EA\u4F5C\u515C\u5E95\uFF1B\u5347\u4E3A\u6743\u5A01\u5FC5\u987B\u540C\u65F6\u663E\u5F0F\u786E\u8BA4\u6B64\u9879\u3002",plaintextFallback:"\u660E\u6587\xB7\u4EC5\u515C\u5E95",plaintextAuthoritative:"\u660E\u6587\xB7\u6743\u5A01",plaintextFallbackHint:"\u660E\u6587 http:// \u6E90\uFF1A\u5185\u5BB9\u53EF\u5728\u4F20\u8F93\u4E2D\u88AB\u7BE1\u6539\uFF0C\u9ED8\u8BA4\u53EA\u4F5C fallback \u515C\u5E95\uFF0C\u4E0D\u53C2\u4E0E\u6743\u5A01\u7248\u672C\u88C1\u51B3\u3002",addSource:"\u6DFB\u52A0",remove:"\u5220\u9664",sourceName:"\u6E90\u540D\u79F0",sourceUrl:"\u6E90\u5730\u5740 (https://\u2026)",saveSources:"\u4FDD\u5B58\u66F4\u65B0\u6E90",official:"\u5B98\u65B9",enabled:"\u542F\u7528",noSources:"\u6CA1\u6709\u542F\u7528\u7684\u66F4\u65B0\u6E90\uFF0C\u7248\u672C\u68C0\u67E5\u4E0D\u53EF\u7528\u3002",resetToggles:"\u91CD\u7F6E\u5F00\u5173",resetConfirm:"\u786E\u5B9A\u8FD8\u539F\u6240\u6709\u7531\u7BA1\u7406\u5668\u4FEE\u6539\u7684\u63D2\u4EF6\u5F00\u5173\u72B6\u6001\uFF1F\uFF08\u4EC5\u6E05\u9664\u7BA1\u7406\u5668\u5199\u5165\u7684\u884C\uFF0C\u4E0D\u5F71\u54CD\u7528\u6237\u81EA\u5B9A\u4E49\u914D\u7F6E\uFF09",resetDone:"\u5DF2\u8FD8\u539F\u6240\u6709\u5F00\u5173\u72B6\u6001\u3002",archived:"\u67B6\u6784\u4FDD\u7559",rescue:"\u6551\u63F4",rescueTitle:"\u6551\u63F4\u4E2D\u5FC3",rescueHint:"\u8BCA\u65AD\u52A0\u8F7D\u5931\u8D25\u7684\u63D2\u4EF6\u5E76\u9694\u79BB/\u5378\u8F7D\uFF1B\u4E00\u952E\u4FEE\u590D\u4F1A\u91CD\u7F6E\u5F00\u5173\u3001\u9694\u79BB\u95EE\u9898\u63D2\u4EF6\u3001\u6E05\u7A7A\u7F13\u5B58\u3002\u72EC\u7ACB\u6551\u63F4\u9875 /rescue \u5728\u8BBE\u7F6E\u9875\u4E0D\u53EF\u7528\u65F6\u4ECD\u53EF\u8BBF\u95EE\uFF08\u53F3\u4E0B\u89D2 \u{1F6DF} \u6309\u94AE\uFF09\u3002",rescueDiagnose:"\u8FD0\u884C\u8BCA\u65AD",rescueModHealth:"\u{1FA7A} mod \u4F53\u68C0",rescueModHealthHint:"mod \u4F53\u68C0\uFF08preflight \u53EA\u8BFB\u6821\u9A8C + \u5F15\u64CE\u65E5\u5FD7\u9519\u8BEF\u805A\u5408\uFF09\u7531\u542F\u52A8\u5668\u515C\u5E95\u9875\u63D0\u4F9B\uFF0C\u70B9\u51FB\u300Cmod \u4F53\u68C0\u300D\u5728\u542F\u52A8\u5668\u515C\u5E95\u9875\u67E5\u770B\uFF1B\u6551\u63F4\u8BCA\u65AD\u4E0E\u672C\u9762\u677F\u5171\u7528\u6551\u63F4\u7403\u5165\u53E3\u3002",rescueClean:"\u2713 \u672A\u53D1\u73B0\u52A0\u8F7D\u5931\u8D25\u6216\u8FD0\u884C\u671F\u9519\u8BEF\u3002",rescueDisable:"\u7981\u7528\u6B64\u63D2\u4EF6",rescueUninstall:"\u5378\u8F7D",rescueProtected:"\u6551\u63F4\u4FDD\u62A4\u6761\u76EE",rescueRepair:"\u4E00\u952E\u4FEE\u590D\u5F15\u64CE",rescueRepairConfirm:"\u786E\u8BA4\u6267\u884C\u4FEE\u590D\uFF1F\u5C06\u91CD\u7F6E\u7BA1\u7406\u5668\u5F00\u5173\u3001\u9694\u79BB\u5168\u90E8\u5931\u8D25\u63D2\u4EF6\u5E76\u6E05\u7A7A\u7F13\u5B58\u3002",rescueRepairDone:"\u2713 \u4FEE\u590D\u5B8C\u6210",rescueRestartHint:"\u91CD\u542F\u547D\u4EE4\uFF1A",rescueRestart:"\u91CD\u542F\u5F15\u64CE",rescueRestartConfirm:"\u786E\u8BA4\u91CD\u542F dsh web \u5F15\u64CE\uFF1F\u5F53\u524D\u9875\u9762\u5C06\u65AD\u8FDE\uFF0C\u7EA6 3-5 \u79D2\u540E\u6062\u590D\uFF08\u8BF7\u5237\u65B0\u9875\u9762\uFF09\u3002",rescueAuto:"\u5931\u8D25\u63D2\u4EF6\u81EA\u52A8\u9694\u79BB",rescueAutoSaved:"\u81EA\u52A8\u9694\u79BB\u8BBE\u7F6E\u5DF2\u4FDD\u5B58\u3002",rescueUninstallList:"\u53EF\u5378\u8F7D\u7684 profile \u4F9D\u8D56\uFF1A",rescueUninstallConfirm:"\u786E\u8BA4\u5378\u8F7D",sourceOverrideHint:"\u6765\u6E90\u6807\u7B7E\uFF08\u81EA\u52A8\u5224\u5B9A\uFF0C\u53EF\u624B\u52A8\u8986\u76D6\u5E76\u6301\u4E45\u5316\uFF09",sourceAuto:"\u81EA\u52A8",sourceNpm:"npm",sourceGithub:"GitHub",sourceLocal:"\u672C\u5730",sourceBuiltin:"\u5185\u7F6E",uninstallTitle:"\u5378\u8F7D\u5F71\u54CD\u9884\u89C8",uninstallRowHint:"\u5378\u8F7D\u8BE5\u63D2\u4EF6",uninstallPreviewLoading:"\u6B63\u5728\u5206\u6790\u5F71\u54CD\u8303\u56F4\u2026",uninstallPreviewFail:"\u5F71\u54CD\u9884\u89C8\u5931\u8D25",uninstallPreviewHint:"\u5C06\u6267\u884C\u4E8B\u52A1\u5316\u5378\u8F7D\uFF1A\u5907\u4EFD\u914D\u7F6E \u2192 \u5220\u9664\u76EE\u6807\u5305\u4E0E\u8865\u4E01\u884C \u2192 \u6821\u9A8C \u2192 \u5F02\u5E38\u81EA\u52A8\u56DE\u6EDA\u3002\u8BF7\u786E\u8BA4\u5F71\u54CD\u8303\u56F4\uFF1A",uninstallAffectedEntries:"\u5C06\u79FB\u9664\u7684\u63D2\u4EF6\u6761\u76EE",uninstallNoEntries:"\u8BE5\u5305\u6CA1\u6709\u6CE8\u518C\u63D2\u4EF6\u6761\u76EE\uFF08\u4EC5\u79FB\u9664\u4F9D\u8D56\uFF09\u3002",uninstallBundleRow:"\u8BE5\u5305\u5728 bundles \u6E05\u5355\u4E2D\uFF08\u5C06\u79FB\u9664\u542F\u52A8\u58F0\u660E\uFF09\u3002",uninstallPatchRows:"\u5C06\u6E05\u7406\u7684\u7BA1\u7406\u5668\u5F00\u5173\u884C",uninstallDependents:"\u4EE5\u4E0B\u5DF2\u5B89\u88C5\u63D2\u4EF6\u4F9D\u8D56\u8BE5\u5305\uFF0C\u5378\u8F7D\u4F1A\u9020\u6210\u4F9D\u8D56\u65AD\u88C2",uninstallCascade:"\u7EA7\u8054\u5378\u8F7D\u4F9D\u8D56\u63D2\u4EF6",uninstallVerdictLine:"\u672C\u6B21\u5378\u8F7D",uninstallVerdictSafe:"\u5B89\u5168",uninstallVerdictCaution:"\u9700\u6CE8\u610F",uninstallVerdictRisky:"\u6709\u98CE\u9669",uninstallCheckTitle:"\u5378\u8F7D\u524D\u4F53\u68C0",uninstallCheckHint:"\u4E09\u7C7B\u53EA\u8BFB\u68C0\u67E5\uFF1A\u4F9D\u8D56\u65AD\u88C2 / patch \u6B8B\u7559 / \u91CD\u590D service\xB7\u7AEF\u53E3\uFF08\u4E0D\u4F1A\u6539\u52A8\u4EFB\u4F55 profile \u6587\u4EF6\uFF09",uninstallCheckHigh:"\u9AD8\u98CE\u9669",uninstallCheckWarning:"\u63D0\u793A",uninstallCheckInfo:"\u4FE1\u606F",uninstallCheckEmpty:"\u6CA1\u6709\u9700\u8981\u63D0\u793A\u7684\u4F53\u68C0\u9879\u3002",uninstallSelfHint:"\u8FD9\u662F\u7BA1\u7406\u5668\u81EA\u8EAB\uFF1A\u5378\u8F7D\u524D\u4F1A\u5148\u6267\u884C bin/open-boot.mjs --uninstall \u6E05\u7406\u5F00\u673A\u81EA\u542F\uFF08\u505C\u672C profile \u5B88\u62A4 \u2192 \u5220 DSHWeb* \u81EA\u542F\u503C \u2192 \u5220 .vbs \u2192 \u6E05 pid\uFF09\u3002\u5931\u8D25\u6216\u8D85\u65F6\u4E0D\u963B\u65AD\u5378\u8F7D\uFF0C\u7ED3\u679C\u4F1A\u5199\u8FDB\u5378\u8F7D\u62A5\u544A\u4E0E\u64CD\u4F5C\u5386\u53F2\u3002",uninstallSelfReport:"\u7BA1\u7406\u5668\u81EA\u8EAB\u5DF2\u5378\u8F7D\uFF1A\u91CD\u542F\u5F15\u64CE\u540E\u672C\u9875\u9762\u6D88\u5931\uFF1B\u5982\u8981\u88C5\u56DE\uFF0C\u7528 dsh plugin --profile <name> add dsh-drydock\u3002",uninstallAutostartTitle:"\u5F00\u673A\u81EA\u542F\u6E05\u7406",uninstallAutostartCleaned:"\u5DF2\u5B8C\u6210",uninstallAutostartSkipped:"\u5DF2\u8DF3\u8FC7\uFF08\u5305\u5185\u6CA1\u6709 --uninstall\uFF0C\u65E7\u7248\u672C\uFF09",uninstallAutostartFailed:"\u672A\u6210\u529F\uFF08\u4E0D\u5F71\u54CD\u5378\u8F7D\uFF09",uninstallAutostartTimeout:"\u8D85\u65F6\uFF08\u4E0D\u5F71\u54CD\u5378\u8F7D\uFF09",uninstallConfirm:"\u786E\u8BA4\u5378\u8F7D",uninstalling:"\u5378\u8F7D\u4E2D\u2026",uninstallStatusremoved:"\u5DF2\u5378\u8F7D",uninstallStatusrolledback:"\u5DF2\u56DE\u6EDA",uninstallStatusfailed:"\u5931\u8D25","uninstallStatusnot-managed":"\u65E0\u6CD5\u5378\u8F7D",uninstallVerifyOk:"\u5378\u8F7D\u540E\u81EA\u68C0\u901A\u8FC7\uFF0C\u91CD\u542F profile \u540E\u751F\u6548\u3002",uninstallReportRows:"\u6E05\u7406\u7684\u5F00\u5173\u884C",uninstallReportCascade:"\u7EA7\u8054\u5378\u8F7D",uninstallResiduals:"\u6B8B\u7559\u76EE\u5F55\uFF08\u4E0B\u6B21\u542F\u52A8\u81EA\u52A8\u6E05\u7406\uFF09",uninstallNotManaged:"\u8BE5\u5305\u4E0D\u662F\u672C profile \u7684\u4F9D\u8D56\uFF0C\u65E0\u6CD5\u5378\u8F7D\u3002",uninstallLocalBlocked:"\u672C\u5730\u5305\u8BF7\u7528 dsh plugin --profile <name> remove \u5378\u8F7D\u3002",done:"\u5B8C\u6210",cancel:"\u53D6\u6D88",history:"\u5386\u53F2",historyTitle:"\u64CD\u4F5C\u5386\u53F2",historyHint:"\u6700\u8FD1 20 \u6B21\u64CD\u4F5C\uFF08\u5378\u8F7D/\u5F00\u5173/\u573A\u666F/\u91CD\u7F6E\uFF09\uFF0C\u53EF\u4E00\u952E\u64A4\u9500",historyEmpty:"\u6682\u65E0\u64CD\u4F5C\u8BB0\u5F55\u3002",historyUndo:"\u64A4\u9500",historyUndone:"\u5DF2\u64A4\u9500",scenarios:"\u573A\u666F",scenarioTitle:"\u573A\u666F\u65B9\u6848",scenarioHint:"\u4FDD\u5B58\u5F53\u524D\u63D2\u4EF6\u542F\u505C\u7EC4\u5408\uFF0C\u4E00\u952E\u5207\u6362\uFF08\u5E94\u7528\u524D\u5C55\u793A\u53D8\u66F4\u9884\u89C8\uFF1B\u53D7\u4FDD\u62A4\u6761\u76EE\u81EA\u52A8\u8DF3\u8FC7\uFF09",scenarioName:"\u573A\u666F\u540D\u79F0\uFF08\u5982\uFF1A\u529E\u516C / \u5199\u4F5C / \u6F14\u793A\uFF09",scenarioSave:"\u4FDD\u5B58\u5F53\u524D\u72B6\u6001",scenarioSaved:"\u573A\u666F\u5DF2\u4FDD\u5B58\u3002",scenarioEmpty:"\u6682\u65E0\u573A\u666F\u3002\u8C03\u6574\u63D2\u4EF6\u5F00\u5173\u540E\u70B9\u300C\u4FDD\u5B58\u5F53\u524D\u72B6\u6001\u300D\u521B\u5EFA\u3002",scenarioApply:"\u5E94\u7528",scenarioApplyConfirm:"\u786E\u8BA4\u5207\u6362\uFF1F",scenarioApplying:"\u5207\u6362\u4E2D\u2026",scenarioCalculating:"\u6B63\u5728\u8BA1\u7B97\u53D8\u66F4\u2026",scenarioPreviewTitle:"\u5207\u6362\u9884\u89C8\uFF08\u8BE5\u573A\u666F\u4F1A\u53D8\u66F4\u4EE5\u4E0B\u6761\u76EE\uFF09\uFF1A",scenarioCounts:"\u542F/\u505C",scenarioUpdate:"\u66F4\u65B0",scenarioUpdateHint:"\u7528\u5F53\u524D\u72B6\u6001\u8986\u76D6\u6B64\u573A\u666F",scenarioDelete:"\u5220\u9664",scenarioDeleteConfirm:"\u786E\u8BA4\u5220\u9664\u573A\u666F",scenarioApplied:"\u573A\u666F\u5DF2\u5E94\u7528",restartHint:"\u5982\u8FD0\u884C\u671F\u672A\u6536\u655B\uFF0C\u91CD\u542F profile \u540E\u751F\u6548\u3002",market:"\u5E02\u573A",marketTitle:"\u63D2\u4EF6\u5E02\u573A\uFF08ADP \u7CBE\u9009\u76EE\u5F55\uFF09",marketSearch:"\u641C\u7D22\u63D2\u4EF6\uFF08\u540D\u79F0/\u4ED3\u5E93/\u63CF\u8FF0\uFF09\u2026",marketHint:"\u76EE\u5F55\u6765\u81EA awesome-dsh-plugin \u7CBE\u9009\u6536\u5F55\uFF1B\u5E26 npm \u5305\u540D\u7684\u4F18\u5148\u8D70 npm registry \u76F4\u88C5\uFF08\u9884\u6784\u5EFA\u4EA7\u7269\uFF09\uFF0CGitHub \u4ED3\u5E93\u8D70\u5185\u7F6E\u4E0B\u8F7D\u5668\u3002\u88C5\u5B8C\u5728\u7BA1\u7406\u5217\u8868\u53EF\u89C1\uFF0C\u91CD\u542F\u540E\u751F\u6548\u3002",marketLoading:"\u52A0\u8F7D\u76EE\u5F55\u4E2D\u2026",marketLoadingSlow:"\uFF08\u5F31\u7F51\u6700\u591A\u7B49 45 \u79D2\uFF1B\u5DF2\u4E0D\u518D\u53D7\u66F4\u65B0/\u5378\u8F7D\u7B49\u957F\u4EFB\u52A1\u6392\u961F\u5F71\u54CD\uFF09",marketEmpty:"\u6CA1\u6709\u5339\u914D\u7684\u63D2\u4EF6\u3002",marketMore:"\u52A0\u8F7D\u66F4\u591A",marketInstall:"\u5B89\u88C5",marketConfirmInstall:"\u786E\u8BA4\u5B89\u88C5\uFF1F",marketInstalling:"\u5B89\u88C5\u4E2D\u2026",marketInstalledBadge:"\u5DF2\u5B89\u88C5",marketLoadFail:"\u76EE\u5F55\u52A0\u8F7D\u5931\u8D25",marketRetry:"\u91CD\u8BD5",marketRefresh:"\u5237\u65B0\u76EE\u5F55",marketAll:"\u5168\u90E8",marketSort:"\u6392\u5E8F",marketSortStars:"\u6309\u661F\u6807",marketSortAdded:"\u6309\u6536\u5F55\u65F6\u95F4",marketPlugins:"\u4E2A\u63D2\u4EF6",marketUpdated:"\u6536\u5F55",marketSourceLive:"\u5728\u7EBF\u76EE\u5F55",marketSourceCache:"\u7F13\u5B58",marketSourceFallback:"GitHub \u515C\u5E95",marketSourceError:"\u76EE\u5F55\u4E0D\u53EF\u7528",marketSourceErrorHint:"\u7F51\u7EDC\u4E0D\u53EF\u8FBE\uFF0C\u53EF\u91CD\u8BD5\uFF1A\u76EE\u5F55\u8BF7\u6C42\u5168\u90E8\u5931\u8D25\uFF08\u65AD\u7F51/\u4EE3\u7406/\u9650\u6D41\u90FD\u53EF\u80FD\uFF09\uFF0C\u70B9\u51FB\u91CD\u8BD5\u91CD\u65B0\u52A0\u8F7D\u3002",verifyTitle:"\u542F\u52A8\u524D\u81EA\u68C0",verifyRun:"\u8FD0\u884C\u68C0\u67E5",verifyOk:"\u2713 profile \u914D\u7F6E\u6B63\u5E38\uFF0C\u5F15\u64CE\u53EF\u4EE5\u6B63\u5E38\u542F\u52A8\u3002",verifyBad:"\u26A0 \u53D1\u73B0\u95EE\u9898\uFF08\u5F15\u64CE\u53EF\u80FD\u65E0\u6CD5\u542F\u52A8\uFF09\uFF1A",verifyHint:"\u635F\u574F\u7684 bundle\uFF08\u5305\u672A\u5B89\u88C5/\u672A\u58F0\u660E dsh.bundle\uFF09\u6216\u65E0\u6CD5\u89E3\u6790\u7684 cordis.patch.yml \u4F1A\u8BA9\u5F15\u64CE\u5728\u542F\u52A8\u9636\u6BB5\u5931\u8D25\u2014\u2014\u8FD9\u662F\u6551\u63F4\u6D41\u7A0B\u7684\u9996\u8981\u4FEE\u590D\u76EE\u6807\uFF1B\u53CC\u51FB\u684C\u9762\u5FEB\u6377\u65B9\u5F0F\u542F\u52A8\u65F6\u4E5F\u4F1A\u81EA\u52A8\u6267\u884C\u540C\u6837\u7684\u68C0\u67E5\u3002",fixProfile:"\u4FEE\u590D\u5F15\u64CE\u914D\u7F6E",fixProfileConfirm:"\u786E\u8BA4\u6267\u884C\uFF1F\u5C06\u5907\u4EFD\u5E76\u9694\u79BB\u635F\u574F\u7684 bundle\u3001\u8FD8\u539F\u635F\u574F\u7684\u8865\u4E01\u6587\u4EF6\u3002",dlTitle:"\u4E0B\u8F7D\u76EE\u5F55\uFF08\u81EA\u52A8\u5B89\u88C5\uFF09",dlCheck:"\u68C0\u67E5\u4E0B\u8F7D",dlDir:"\u4E0B\u8F7D\u76EE\u5F55",dlHint:"\u7528\u6D4F\u89C8\u5668 / NDM / aria2 \u7B49\u4EFB\u610F\u65B9\u5F0F\u628A\u63D2\u4EF6\u5305\uFF08.tgz\uFF09\u4E0B\u8F7D\u5230\u8BE5\u76EE\u5F55\uFF0C\u70B9\u51FB\u300C\u68C0\u67E5\u4E0B\u8F7D\u300D\u6216\u91CD\u542F\u540E\u81EA\u52A8\u5B89\u88C5\u3002NDM \u6269\u5C55\u53EF\u76F4\u63A5\u6355\u83B7\u4E0B\u8F7D\u5230\u6B64\u76EE\u5F55\u3002",dlInstalled:"\u5DF2\u5B89\u88C5\uFF1A",dlFailed:"\u5931\u8D25\uFF1A",dlEmpty:"\u76EE\u5F55\u4E2D\u6CA1\u6709\u5F85\u5B89\u88C5\u7684\u65B0\u63D2\u4EF6\u5305\u3002"},Gh={tab:"Plugin manager",tabOfficial:"Official (optional)",tabAll:"All plugins",tabUpdate:"Updates",tabMarket:"Market",tabOps:"Operations",tabMaintenance:"Maintenance",onlyUpdatable:"Updates only",pageSubtitle:"Takes over the built-in Plugins page \xB7 sidebar entry",officialTitle:"Official optional plugins",officialIntro:"Capability bundles shipped with the engine but off by default. Some register their own configuration page.",officialEmpty:"No official optional plugins found.",officialUnavailable:"The engine's official plugin inventory is unavailable (pluginManager remote missing).",officialInstall:"Enable",officialInstalling:"Enabling\u2026",officialDisable:"Disable",officialInstalled:"Installed",officialNotInstalled:"Not installed",officialEnabled:"Enabled",officialNotEnabled:"Off",officialOptional:"Optional",officialItems:"Official plugins with their own page",officialOpen:"Open page",officialClose:"Collapse",exemptions:"Version exemptions",exemptionsEmpty:"No version exemptions.",exemptionRevoke:"Revoke",installHint:"Enabling installs this bundle through pnpm and may download packages.",title:"Engine & Plugin Console",profile:"Active profile",search:"Search by name, description or package",refresh:"Check updates and refresh",refreshDone:"Update check complete",refreshAborted:"Slow network: update check stopped at its total budget",refreshAbortedHint:", results may be partial (failures are not cached); retry once the network recovers.",loading:"Reading plugins\u2026",error:"Plugins are temporarily unavailable.",retry:"Retry",empty:"No plugins are available.",emptySearch:"No matching plugins.",legendNecessity:"Necessity",legendStatus:"Status",legendOrigin:"Origin",originLegend:"Origin",originAll:"All",originBuiltin:"Built-in",originUser:"User-installed",originUserHint:"Installed by you or an agent via `dsh plugin add` or the plugin market",configEntry:"Config",configEntryHint:"Open this plugin's own config panel (provided by the plugin itself)",configBundleEntry:"Plugin config",configMainPageHint:"Open this config page from the sidebar Plugin manager entry.",necessityCore:"Core components (engine-required \u2014 cannot be disabled)",badgeCore:"Core",necessityBuiltin:"Engine built-ins",badgeBuiltin:"Built-in",necessityUser:"User plugins",badgeUser:"User",recommendedTag:"Recommended",recommendedTagHint:"Recommended add-on: a third-party enhancement plugin suggested by the manager",managerBadge:"Manager",marketDetail:"Market",marketDetailHint:"View this plugin in the curated market (ADP)",statusError:"Error/Check",statusUpdate:"Update",statusDisabled:"Disabled",statusEnabled:"Enabled",enableEntry:"Enable",disableEntry:"Disable",versionUnknown:"version unknown",versionNetworkError:"network unreachable, retryable",versionNotFound:"not on the update source / no update",versionBackoff:"source rate-limited, retrying automatically",update:"Update",updateInternal:"Built-in",updateInternalHint:"Use the manager's built-in downloader (HTTP/P2P/aria2) instead of the browser",updateAll:"Check updates",upToDate:"Already up to date",notManaged:"ships with install",updateAvailable:"updates",selfUpdateTitle:"Drydock itself",selfUpdateUpToDate:"Up to date ({v})",selfUpdateCheck:"Check self-update",selfUpdateChecking:"Checking\u2026 (download + verify)",selfUpdateNow:"Update now",selfUpdateLater:"Later",selfUpdateRunning:"Updating: the engine will restart briefly \u2014 reload this page afterwards",selfUpdateDesktopOnly:"Not auto-installed on desktop (the app owns the profile): install with the bundled CLI as prompted",expandAll:"Expand all",collapseAll:"Collapse all",sources:"Sources",sourcesTitle:"Update sources",sourcesHint:"Version checks and updates use the enabled sources; the official npm source, npmmirror and the GitHub official repo are pre-filled. A custom source only acts as a fallback (degraded) by default \u2014 it does not compete with the official source unless you explicitly mark it authoritative. http:// sources are labelled plaintext\xB7fallback-only; making one authoritative also requires the explicit allow-plaintext confirmation. A GitHub source applies to packages whose repo-root package.json name matches and which release via GitHub Releases.",sourcesSaved:"Sources saved; re-checking versions\u2026",sourcesAuthoritativeConfirm:"This will promote a non-built-in source to authoritative: version resolution and installs will follow it. Enable only for a trusted internal mirror / offline registry?",resetSources:"Reset to defaults",authoritative:"authoritative",authoritativeHint:"Trust this source as authoritative: version resolution and installs use it (still usable when the official source is unreachable). Enable only for a trusted internal mirror / offline registry.",allowInsecure:"allow plaintext",allowInsecureHint:"This source uses plaintext http:// and is fallback-only by default; making it authoritative requires this explicit confirmation.",plaintextFallback:"plaintext \xB7 fallback only",plaintextAuthoritative:"plaintext \xB7 authoritative",plaintextFallbackHint:"Plaintext http:// source: content can be modified in transit; it is fallback-only and never participates in authoritative version resolution by default.",addSource:"Add",remove:"Remove",sourceName:"Name",sourceUrl:"URL (https://\u2026)",saveSources:"Save sources",official:"official",enabled:"enabled",noSources:"No enabled sources; version checks unavailable.",resetToggles:"Reset toggles",resetConfirm:"Reset every plugin toggle changed by this manager? (Only manager-owned rows are cleared; your own config is untouched.)",resetDone:"All toggles have been reset.",archived:"archived",rescue:"Rescue",rescueTitle:"Rescue center",rescueHint:"Diagnose failing plugins and quarantine/uninstall them; one-click repair resets toggles, quarantines failing plugins and clears caches. The standalone rescue page /rescue works even when the settings page is broken (\u{1F6DF} button, bottom right).",rescueDiagnose:"Diagnose",rescueModHealth:"Mod health check",rescueModHealthHint:"Mod health (preflight read-only check + engine log error aggregation) is served by the launcher fallback page; open it from the launcher page.",rescueClean:"\u2713 No failing plugins found.",rescueDisable:"Disable",rescueUninstall:"Uninstall",rescueProtected:"protected",rescueRepair:"Repair harness",rescueRepairConfirm:"Run repair? This resets manager toggles, quarantines every failing plugin and clears caches.",rescueRepairDone:"\u2713 Repair done",rescueRestartHint:"Restart command:",rescueRestart:"Restart engine",rescueRestartConfirm:"Restart the dsh web engine? This page will disconnect and return in ~3-5s (refresh then).",rescueAuto:"Auto-quarantine failing plugins",rescueAutoSaved:"Auto-quarantine setting saved.",rescueUninstallList:"Uninstallable profile dependencies:",rescueUninstallConfirm:"Uninstall",sourceOverrideHint:"Source label (auto-detected; can be overridden and persisted)",sourceAuto:"auto",sourceNpm:"npm",sourceGithub:"GitHub",sourceLocal:"local",sourceBuiltin:"built-in",uninstallTitle:"Uninstall impact preview",uninstallRowHint:"Uninstall this plugin",uninstallPreviewLoading:"Analyzing impact\u2026",uninstallPreviewFail:"Preview failed",uninstallPreviewHint:"Transactional uninstall: backup configs \u2192 remove the package and patch rows \u2192 verify \u2192 automatic rollback on failure. Review the impact:",uninstallAffectedEntries:"Plugin entries to be removed",uninstallNoEntries:"This package registers no plugin entries (dependency only).",uninstallBundleRow:"It is listed in the profile bundles (boot declaration will be removed).",uninstallPatchRows:"Manager patch rows to be cleaned",uninstallDependents:"These installed plugins depend on this package; uninstalling will break them",uninstallCascade:"Cascade-uninstall dependents",uninstallVerdictLine:"This uninstall",uninstallVerdictSafe:"safe",uninstallVerdictCaution:"needs attention",uninstallVerdictRisky:"risky",uninstallCheckTitle:"Pre-uninstall check",uninstallCheckHint:"Three read-only checks: broken dependencies / patch leftovers / duplicate services\xB7ports (no profile file is modified)",uninstallCheckHigh:"high risk",uninstallCheckWarning:"note",uninstallCheckInfo:"info",uninstallCheckEmpty:"No findings to report.",uninstallSelfHint:"This is the manager itself: before removal it runs bin/open-boot.mjs --uninstall to clear autostart (stops this profile's daemon \u2192 deletes DSHWeb* Run values \u2192 deletes .vbs shims \u2192 clears the pid file). Failure or timeout never blocks the uninstall, and the outcome is written to the report and operation history.",uninstallSelfReport:"The manager itself was removed: this page disappears after an engine restart; reinstall with dsh plugin --profile <name> add dsh-drydock.",uninstallAutostartTitle:"Autostart cleanup",uninstallAutostartCleaned:"done",uninstallAutostartSkipped:"skipped (no --uninstall in this package \u2014 older version)",uninstallAutostartFailed:"did not succeed (uninstall unaffected)",uninstallAutostartTimeout:"timed out (uninstall unaffected)",uninstallConfirm:"Confirm uninstall",uninstalling:"Uninstalling\u2026",uninstallStatusremoved:"Removed",uninstallStatusrolledback:"Rolled back",uninstallStatusfailed:"Failed","uninstallStatusnot-managed":"Not managed",uninstallVerifyOk:"Post-uninstall health check passed; it takes effect after a profile restart.",uninstallReportRows:"Patch rows cleaned",uninstallReportCascade:"Cascade removed",uninstallResiduals:"Residual directories (auto-cleaned at next start)",uninstallNotManaged:"This package is not a dependency of this profile; it cannot be uninstalled.",uninstallLocalBlocked:"Local package \u2014 use `dsh plugin --profile <name> remove`.",done:"Done",cancel:"Cancel",history:"History",historyTitle:"Operation history",historyHint:"Last 20 operations (uninstall/toggle/scenario/reset), one-click undo",historyEmpty:"No operations yet.",historyUndo:"Undo",historyUndone:"undone",scenarios:"Scenarios",scenarioTitle:"Scenarios",scenarioHint:"Save the current plugin state as a named scenario and switch with one click (change preview before applying; protected entries are skipped)",scenarioName:"Scenario name (e.g. office / writing / demo)",scenarioSave:"Save current state",scenarioSaved:"Scenario saved.",scenarioEmpty:'No scenarios. Toggle plugins, then click "Save current state".',scenarioApply:"Apply",scenarioApplyConfirm:"Confirm switch?",scenarioApplying:"Switching\u2026",scenarioCalculating:"Calculating changes\u2026",scenarioPreviewTitle:"Preview (this scenario changes):",scenarioCounts:"on/off",scenarioUpdate:"Update",scenarioUpdateHint:"Overwrite this scenario with the current state",scenarioDelete:"Delete",scenarioDeleteConfirm:"Delete scenario",scenarioApplied:"Scenario applied",restartHint:"If runtime state does not converge, restart the profile.",market:"Market",marketTitle:"Plugin market (ADP curated catalog)",marketSearch:"Search plugins (name/repo/description)\u2026",marketHint:"Catalog from awesome-dsh-plugin; entries with an npm name install from the npm registry (prebuilt), GitHub repos use the built-in downloader. Installed plugins appear in the management list after restart.",marketLoading:"Loading catalog\u2026",marketLoadingSlow:"(up to 45s on a slow network; no longer queued behind long operations)",marketEmpty:"No matching plugins.",marketMore:"Load more",marketInstall:"Install",marketConfirmInstall:"Confirm install?",marketInstalling:"Installing\u2026",marketInstalledBadge:"Installed",marketLoadFail:"Failed to load catalog",marketRetry:"Retry",marketRefresh:"Refresh catalog",marketAll:"All",marketSort:"Sort",marketSortStars:"By stars",marketSortAdded:"By added date",marketPlugins:"plugins",marketUpdated:"Added",marketSourceLive:"live catalog",marketSourceCache:"cached",marketSourceFallback:"GitHub fallback",marketSourceError:"catalog unavailable",marketSourceErrorHint:"Network unreachable, retryable: all catalog requests failed (offline/proxy/rate limit). Click Retry to reload.",verifyTitle:"Pre-boot check",verifyRun:"Run check",verifyOk:"\u2713 Profile configuration is healthy; the engine can boot.",verifyBad:"\u26A0 Issues found (the engine may fail to boot):",verifyHint:"Broken bundles (uninstalled / no dsh.bundle) or an unparsable cordis.patch.yml fail the engine during boot \u2014 the primary rescue target. The desktop shortcut runs the same check on double-click.",fixProfile:"Fix engine config",fixProfileConfirm:"Run fix? Broken bundles will be backed up and removed from the profile; a corrupt patch file will be restored.",dlTitle:"Download folder (auto-install)",dlCheck:"Check folder",dlDir:"Download folder",dlHint:'Download plugin packages (.tgz) into this folder with any tool (browser / NDM / aria2), then click "Check folder" or restart \u2014 they are installed automatically. The NDM extension can capture downloads there.',dlInstalled:"Installed:",dlFailed:"Failed:",dlEmpty:"No new packages waiting in the download folder."},Kh=["slots","locale","remote"];async function Yh(e){let t=(await Promise.resolve().then(()=>(Mp(),Dp))).TYPERT_REMOTE,r=await e.remote.$mount(t),n=e.locale.register(Fr,{zh:qh,en:Gh}),o=e.inject(["remote.pluginManagerPro"],s=>{let c=s.locale.bind(Fr),u=k=>{if(k.ok)return k.value;throw new Error(`${k.error.code}: ${k.error.message}`)},d=(k,y,$=3e4)=>Promise.race([k,new Promise((E,Z)=>setTimeout(()=>Z(new Error(`${y}\uFF1A\u64CD\u4F5C\u8D85\u65F6\uFF08${Math.round($/1e3)} \u79D2\uFF09`)),$))]),m={list:async()=>u(await d(s.remote.pluginManagerPro.list(),"\u8BFB\u53D6\u63D2\u4EF6\u5217\u8868")),refresh:async()=>u(await d(s.remote.pluginManagerPro.refresh(),"\u68C0\u67E5\u66F4\u65B0",12e4)),setEnabled:async(k,y)=>u(await d(s.remote.pluginManagerPro.setEnabled(k,y),"\u5207\u6362\u63D2\u4EF6\u72B6\u6001")),update:async k=>u(await d(s.remote.pluginManagerPro.update(k),"\u66F4\u65B0\u63D2\u4EF6")),setSources:async(k,y)=>u(await d(s.remote.pluginManagerPro.setSources(k,y??null),"\u4FDD\u5B58\u66F4\u65B0\u6E90")),resetToggles:async()=>u(await d(s.remote.pluginManagerPro.resetToggles(),"\u91CD\u7F6E\u5F00\u5173")),diagnose:async()=>u(await d(s.remote.pluginManagerPro.diagnose(),"\u8BCA\u65AD")),quarantine:async k=>u(await d(s.remote.pluginManagerPro.quarantine(k),"\u9694\u79BB\u63D2\u4EF6")),repairHarness:async()=>u(await d(s.remote.pluginManagerPro.repairHarness(),"\u4FEE\u590D\u5F15\u64CE")),restartHarness:async()=>u(await d(s.remote.pluginManagerPro.restartHarness(),"\u91CD\u542F\u5F15\u64CE")),uninstallPackages:async(k,y)=>u(await d(s.remote.pluginManagerPro.uninstallPackages(k,y??{cascade:!1}),"\u5378\u8F7D\u63D2\u4EF6",3e5)),uninstallPreview:async k=>u(await d(s.remote.pluginManagerPro.uninstallPreview(k),"\u5378\u8F7D\u5F71\u54CD\u9884\u89C8",6e4)),operationHistory:async()=>u(await d(s.remote.pluginManagerPro.operationHistory(),"\u8BFB\u53D6\u64CD\u4F5C\u5386\u53F2")),undoOperation:async k=>u(await d(s.remote.pluginManagerPro.undoOperation(k),"\u64A4\u9500\u64CD\u4F5C",3e5)),setSourceOverride:async(k,y)=>u(await d(s.remote.pluginManagerPro.setSourceOverride(k,y),"\u4FDD\u5B58\u6765\u6E90\u6807\u7B7E")),scenarioList:async()=>u(await d(s.remote.pluginManagerPro.scenarioList(),"\u8BFB\u53D6\u573A\u666F\u65B9\u6848")),scenarioSave:async k=>u(await d(s.remote.pluginManagerPro.scenarioSave(k),"\u4FDD\u5B58\u573A\u666F")),scenarioUpdate:async k=>u(await d(s.remote.pluginManagerPro.scenarioUpdate(k),"\u66F4\u65B0\u573A\u666F")),scenarioDelete:async k=>u(await d(s.remote.pluginManagerPro.scenarioDelete(k),"\u5220\u9664\u573A\u666F")),scenarioApply:async(k,y)=>u(await d(s.remote.pluginManagerPro.scenarioApply(k,y),"\u5E94\u7528\u573A\u666F")),getRescueConfig:async()=>u(await d(s.remote.pluginManagerPro.getRescueConfig(),"\u8BFB\u53D6\u6551\u63F4\u914D\u7F6E")),setRescueConfig:async k=>u(await d(s.remote.pluginManagerPro.setRescueConfig(k),"\u4FDD\u5B58\u6551\u63F4\u914D\u7F6E")),getDownloadConfig:async()=>u(await d(s.remote.pluginManagerPro.getDownloadConfig(),"\u8BFB\u53D6\u4E0B\u8F7D\u76EE\u5F55")),checkDownloads:async()=>u(await d(s.remote.pluginManagerPro.checkDownloads(),"\u68C0\u67E5\u4E0B\u8F7D\u76EE\u5F55")),resolveDownloadUrl:async k=>u(await d(s.remote.pluginManagerPro.resolveDownloadUrl(k),"\u89E3\u6790\u4E0B\u8F7D\u94FE\u63A5")),verifyProfile:async()=>u(await d(s.remote.pluginManagerPro.verifyProfile(),"\u542F\u52A8\u524D\u81EA\u68C0")),fixProfile:async()=>u(await d(s.remote.pluginManagerPro.fixProfile(),"\u4FEE\u590D\u5F15\u64CE\u914D\u7F6E")),updateBrowser:async k=>u(await d(s.remote.pluginManagerPro.updateBrowser(k),"\u89E3\u6790\u4E0B\u8F7D\u94FE\u63A5")),marketCatalog:async()=>u(await d(s.remote.pluginManagerPro.marketCatalog(),"\u52A0\u8F7D\u63D2\u4EF6\u5E02\u573A",45e3)),marketInstall:async(k,y)=>u(await d(s.remote.pluginManagerPro.marketInstall(k,y),"\u5B89\u88C5\u63D2\u4EF6",24e4)),selfUpdateStatus:async()=>u(await d(s.remote.pluginManagerPro.selfUpdateStatus(),"\u8BFB\u53D6\u81EA\u66F4\u65B0\u72B6\u6001",45e3)),selfUpdatePrepare:async()=>u(await d(s.remote.pluginManagerPro.selfUpdatePrepare(),"\u68C0\u67E5\u7BA1\u7406\u5668\u66F4\u65B0",3e5)),selfUpdateDecide:async k=>u(await d(s.remote.pluginManagerPro.selfUpdateDecide(k),"\u6267\u884C\u66F4\u65B0\u51B3\u7B56",12e4))},h=(()=>{let k="",y={rows:[],bundles:[]},$=()=>{let E=Z=>{let S=[];for(let D of s.slots.entriesOfSlot(Z)??[]){let C=D?.options?.key;typeof C=="string"&&C!==""&&S.push(C)}return S.sort()};return{rows:E("plugins.row.config"),bundles:E("plugins.bundle.config")}};return{getSnapshot:()=>{let E=`${s.slots.getVersion("plugins.row.config")}:${s.slots.getVersion("plugins.bundle.config")}`;return E!==k&&(k=E,y=$()),y},subscribe:E=>{let Z=s.slots.subscribe("plugins.row.config",E),S=s.slots.subscribe("plugins.bundle.config",E);return()=>{Z(),S()}}}})(),b={api:null};e.inject(["remote.pluginManager"],k=>{let y=k.remote.pluginManager;y!==void 0&&(b.api={listBundles:()=>y.listBundles(),setBundleEnabled:($,E)=>y.setBundleEnabled($,E),listVersionExemptions:()=>y.listVersionExemptions(),setVersionExemption:($,E,Z,S)=>y.setVersionExemption($,E,Z,S)})});let p=(()=>{let k="",y=[],$=()=>{try{return(s.slots.entriesOfSlot("plugins.item")??[]).map(E=>{let Z=E?.options?.id??"",S=Z;try{let D=E?.options?.label;typeof D=="function"&&(S=String(D()??Z))}catch{}return{id:Z,label:S}}).filter(E=>E.id!=="")}catch{return[]}};return{getSnapshot:()=>{let E=`${s.slots.getVersion("plugins.item")}:${s.locale.getSnapshot().revision}`;return E!==k&&(k=E,y=$()),y},subscribe:E=>{let Z=s.slots.subscribe("plugins.item",E),S=s.locale.subscribe(E);return()=>{Z(),S()}}}})(),x=()=>({...m,t:c,officialApi:b.api,officialItemsSource:p,configSurfaces:h});s.slots.inject("settings.plugins.tab",()=>s.slots.register({name:"settings.plugins.tab",id:"pluginManagerPro",order:60,label:()=>c("tab"),locale:Fr,inject:x},Jp)),s.slots.inject("sidebar.panellist",()=>s.slots.register({name:"sidebar.panellist",id:"plugins",order:0,label:()=>c("tab"),locale:Fr},Jh)),s.slots.inject("main",function*(){yield s.slots.register({name:"main",key:"plugins",locale:Fr,inject:x,children:{"plugins.item":{kind:"list",scope:"root"},"plugins.bundle.activation":{kind:"keyed",scope:"root"},"plugins.bundle.config":{kind:"keyed",scope:"root"},"plugins.row.config":{kind:"keyed",scope:"root"},"plugins.detail.actions":{kind:"list",scope:"root"},"plugins.detail.badge":{kind:"list",scope:"root"},"plugins.detail.section":{kind:"list",scope:"root"}}},Jp)}),e.inject(["layout"],k=>{let y=typeof k.get=="function"?k.get("layout"):k.layout;y===void 0||typeof y.selectPanel!="function"||k.effect(()=>k.reflect.provide("pluginNavigation",{openBundle:()=>{try{y.selectPanel("plugins")}catch{}}}))})}),i=null;if(typeof document<"u"&&document.body!==null){i=document.createElement("button"),i.textContent="\u{1F6DF}",i.title="DSH \u6551\u63F4\u4E2D\u5FC3\uFF08\u53EF\u62D6\u52A8\u6362\u4F4D\uFF1B\u5355\u51FB\u6253\u5F00\u3002\u8BBE\u7F6E\u9875\u4E0D\u53EF\u7528\u65F6\u7684\u6551\u63F4\u5165\u53E3\uFF09",i.setAttribute("aria-label","DSH \u6551\u63F4\u4E2D\u5FC3"),i.style.cssText="position:fixed;right:14px;bottom:14px;width:40px;height:40px;border-radius:50%;border:1px solid #d64541;background:#d64541;color:#fff;font-size:18px;cursor:pointer;z-index:2147483000;box-shadow:0 2px 10px rgba(0,0,0,.45);display:grid;place-items:center;touch-action:none;user-select:none;";try{let p=JSON.parse(localStorage.getItem("dsh-rescue-ball")||"null");p&&Number.isFinite(p.left)&&Number.isFinite(p.top)&&p.left>=0&&p.top>=0&&p.left<window.innerWidth&&p.top<window.innerHeight&&(i.style.left=`${Math.round(p.left)}px`,i.style.top=`${Math.round(p.top)}px`,i.style.right="auto",i.style.bottom="auto")}catch{}let s=!1,c=!1,u=0,d=0,m=0,h=0;i.addEventListener("pointerdown",p=>{if(p.button!==0)return;s=!0,c=!1,u=p.clientX,d=p.clientY;let x=i.getBoundingClientRect();m=x.left,h=x.top;try{i.setPointerCapture(p.pointerId)}catch{}}),i.addEventListener("pointermove",p=>{if(!s)return;let x=p.clientX-u,k=p.clientY-d;if(!c&&Math.abs(x)+Math.abs(k)<=4)return;c=!0;let y=i.offsetWidth,$=i.offsetHeight,E=Math.min(Math.max(0,m+x),Math.max(0,window.innerWidth-y)),Z=Math.min(Math.max(0,h+k),Math.max(0,window.innerHeight-$));i.style.left=`${Math.round(E)}px`,i.style.top=`${Math.round(Z)}px`,i.style.right="auto",i.style.bottom="auto"});let b=p=>{if(s){s=!1;try{i.releasePointerCapture(p.pointerId)}catch{}if(c)try{localStorage.setItem("dsh-rescue-ball",JSON.stringify({left:parseFloat(i.style.left)||0,top:parseFloat(i.style.top)||0}))}catch{}}};i.addEventListener("pointerup",b),i.addEventListener("pointercancel",b),i.addEventListener("click",()=>{if(c){c=!1;return}window.open("/rescue","_blank")}),document.body.appendChild(i)}return async()=>{i!==null&&i.parentNode!==null&&i.parentNode.removeChild(i),await o.dispose(),n(),await r()}}
69
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let s of e.seen.entries()){let a=s[1];if(t===s[0]){i(s);continue}if(e.external){let u=e.external.registry.get(s[0])?.id;if(t!==s[0]&&u){i(s);continue}}if(e.metadataRegistry.get(s[0])?.id){i(s);continue}if(a.cycle){i(s);continue}a.count>1&&e.reused==="ref"&&i(s)}e.external&&(e.sharedDefsExtractedFor=e.external)}function Ad(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let r of t){if(!r||typeof r!="object")return;Ad(r);let o=Object.keys(r);if(o.length!==1||o[0]!=="type")return;let i=r.type;for(let s of Array.isArray(i)?i:[i]){if(typeof s!="string")return;n.includes(s)||n.push(s)}}delete e.anyOf,e.type=n.length===1?n[0]:n}function Cd(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!="object"||t===null?null:Object.keys(t).length?t:null}function tc(e){let t=[];for(let i of e){if(typeof i!="object"||i.type!=="object")return null;for(let s in i)if(!Od.has(s))return null;t.push(i)}let n={},r=new Set;for(let i of t){for(let s in i.properties){if(Object.prototype.hasOwnProperty.call(n,s))continue;let a=[];for(let u of t){let p=u.properties?.[s]??Cd(u);p!=null&&(a.some(m=>JSON.stringify(m)===JSON.stringify(p))||a.push(p))}let l=a.length===1?a[0]:tc(a)??{allOf:a};ge(n,s,l)}for(let s of i.required??[])r.add(s)}let o={type:"object",properties:n};if(r.size&&(o.required=[...r]),t.every(i=>i.additionalProperties===!1))o.additionalProperties=!1;else{let i=[];for(let s of t){let a=Cd(s);a&&!i.some(l=>JSON.stringify(l)===JSON.stringify(a))&&i.push(a)}i.length===1?o.additionalProperties=i[0]:i.length>1&&(o.additionalProperties={allOf:i})}return o}function qw(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let o of Od)if(o in e)return;let n=t.filter(o=>Pd.some(i=>Array.isArray(o[i]))),r=null;if(!n.length)r=tc(t);else{let o=n[0],i=Pd.find(l=>Array.isArray(o[l]));if(Object.keys(o).length!==1)return;let s=t.filter(l=>l!==o),a=o[i].map(l=>tc([...s,l]));if(a.some(l=>!l))return;r={[i]:a}}r&&(delete e.allOf,Nr(e,r))}function wt(e,t){let n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");let r=a=>{let l=e.seen.get(a);if(l.ref===null)return;let u=l.def??l.schema,p={...u},m=l.ref;if(l.ref=null,m){r(m);let d=e.seen.get(m),h=d.schema;if(h.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(h)):Nr(u,h),Nr(u,p),a._zod.parent===m)for(let w in u)w==="$ref"||w==="allOf"||w in p||delete u[w];if(h.$ref&&d.def)for(let w in u)w==="$ref"||w==="allOf"||w in d.def&&JSON.stringify(u[w])===JSON.stringify(d.def[w])&&delete u[w]}let g=a._zod.parent;if(g&&g!==m){r(g);let d=e.seen.get(g);if(d?.schema.$ref&&(u.$ref=d.schema.$ref,d.def))for(let h in u)h==="$ref"||h==="allOf"||h in d.def&&JSON.stringify(u[h])===JSON.stringify(d.def[h])&&delete u[h]}e.override({zodSchema:a,jsonSchema:u,path:l.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let a of[...e.seen.entries()].reverse())r(a[0]);if(e.target!=="openapi-3.0")for(let a of e.seen.entries())Ad(a[1].def??a[1].schema);for(let a of e.deferred)a();if(e.intersections.length){let a=new Map;for(let l of e.seen.values())for(let u of[l.schema,l.def]){let p=u?.allOf;if(!Array.isArray(p))continue;let m=a.get(p);m?m.push(u):a.set(p,[u])}for(let l of e.intersections)for(let u of a.get(l)??[])qw(u)}}let o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let a=e.external.registry.get(t)?.id;if(!a)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(a)}Nr(o,n.defId?n.schema:n.def??n.schema);let i=e.metadataRegistry.get(t)?.id;i!==void 0&&o.id===i&&delete o.id;let s=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let a of e.seen.entries()){let l=a[1];l.def&&l.defId&&(l.def.id===l.defId&&delete l.def.id,ge(s,l.defId,l.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(s).length>0&&(e.target==="draft-2020-12"?o.$defs=s:o.definitions=s);try{let a=JSON.parse(JSON.stringify(o));return Object.defineProperty(a,"~standard",{value:{...t["~standard"],jsonSchema:{input:En(t,"input",e.processors),output:En(t,"output",e.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function Se(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return Se(r.element,n);if(r.type==="set")return Se(r.valueType,n);if(r.type==="lazy")return Se(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault"||r.type==="catch")return Se(r.innerType,n);if(r.type==="intersection")return Se(r.left,n)||Se(r.right,n);if(r.type==="record"||r.type==="map")return Se(r.keyType,n)||Se(r.valueType,n);if(r.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:Se(r.in,n)||Se(r.out,n);if(r.type==="object"){for(let o in r.shape)if(Se(r.shape[o],n))return!0;return!1}if(r.type==="union"){for(let o of r.options)if(Se(o,n))return!0;return!1}if(r.type==="tuple"){for(let o of r.items)if(Se(o,n))return!0;return!!(r.rest&&Se(r.rest,n))}return!1}var Od,Pd,nc,En,Er=K(()=>{zr();le();Od=new Set(["type","properties","required","additionalProperties"]),Pd=["oneOf","anyOf"];nc=(e,t={})=>n=>{let r=yt({...n,processors:t});return X(e,r),bt(r,e),wt(r,e)},En=(e,t,n={})=>r=>{let{libraryOptions:o,target:i}=r??{},s=yt({...o??{},target:i,io:t,processors:n});return X(e,s),bt(s,e),wt(s,e)}});function de(e){let t={},n=e._zod.def,r=e._zod.traits.has("$ZodCheck")?[e,...n.checks??[]]:n.checks??[];for(let i of r)Yw[i._zod.def.check]?.(t,i._zod.def);let o=e._zod.bag;o.minimum!==void 0&&Zn(t,"minimum",o.minimum),o.exclusiveMinimum!==void 0&&Zn(t,"exclusiveMinimum",o.exclusiveMinimum),o.maximum!==void 0&&Tn(t,"maximum",o.maximum),o.exclusiveMaximum!==void 0&&Tn(t,"exclusiveMaximum",o.exclusiveMaximum),o.multipleOf!==void 0&&Rd(t,o.multipleOf),o.format!==void 0&&(t.format??(t.format=o.format),o.format.includes("int")&&(t.isInt=!0)),o.mime&&Ld(t,o.mime);for(let i of o.patterns??[])Dd(t,i);return t}function Zr(e){let t=e._zod.def;return t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform")?Zr(t.out):t.type==="catch"?Zr(t.innerType):e._zod.optin}function rc(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);let h=e.get(t)?.def;if(!h)return t;let y=rc(e,h,n);return y===h?t:y}for(let h of["anyOf","oneOf"]){let y=t[h];if(!Array.isArray(y))continue;let w=y.map(_=>rc(e,_,n));w.some((_,v)=>_!==y[v])&&(t={...t,[h]:w})}let r=Array.isArray(t.type)?t.type:[t.type],o=!r.includes("string")&&r.some(h=>h==="number"||h==="integer"),i=t.enum??(t.const!==void 0?[t.const]:void 0);if(!o&&!i?.some(h=>typeof h=="number"))return t;let{minimum:s,maximum:a,exclusiveMinimum:l,exclusiveMaximum:u,multipleOf:p,format:m,id:g,...d}=t;return d.enum?d.enum=d.enum.map(h=>typeof h=="number"?String(h):h):typeof d.const=="number"&&(d.const=String(d.const)),o&&(d.type="string",i||(d.pattern=(r.includes("number")?rt:cr).source)),d}function ev(e){let t=new Map;for(let r of e.seen.values())r.def&&!t.has(r.schema)&&t.set(r.schema,r);let n=new Map;for(let r of oc.get(e)??[]){let o=e.seen.get(r),i=(o?.def??o?.schema)?.propertyNames;if(!i||i===!0||n.has(i))continue;let s=rc(t,i,new Set);s!==i&&n.set(i,s)}if(n.size)for(let r of e.seen.values())for(let o of[r.schema,r.def]){let i=o&&n.get(o.propertyNames);i&&(o.propertyNames=i)}}function Ud(e,t,n,r,o){let i=!1,s=JSON.stringify(e,(a,l)=>typeof l!="bigint"?l:(i=!0,null));return i?(pe(t,n,r,o,"BigInt defaults cannot be represented in JSON Schema"),Tc):JSON.parse(s)}function Ei(e,t){if("_idmap"in e){let r=e,o=yt({...t,processors:Ai}),i={};for(let l of r._idmap.entries()){let[u,p]=l;X(p,o)}let s={},a={registry:r,uri:t?.uri,defs:i};o.external=a;for(let l of r._idmap.entries()){let[u,p]=l;bt(o,p),ge(s,u,wt(o,p))}if(Object.keys(i).length>0){let l=o.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[l]:i}}return{schemas:s}}let n=yt({...t,processors:Ai});return X(e,n),bt(n,e),wt(n,e)}var Zn,Tn,Nd,Rd,Dd,Ld,jd,Ed,Zd,Td,Yw,Xw,Qw,Md,ic,sc,ac,lc,uc,cc,fc,pc,dc,mc,gc,hc,yc,bc,wc,vc,kc,_c,$c,xc,Sc,zc,Ic,Pc,Cc,Oi,Ac,Oc,oc,Nc,Ec,Zc,Tc,Rc,Dc,Lc,jc,Mc,Uc,Ni,Vc,Ai,Tr=K(()=>{Nt();yn();Er();le();Zn=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},Tn=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},Nd=(e,t)=>{Zn(e,"minimum",t),Tn(e,"maximum",t)},Rd=(e,t)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(t)||e.multipleOf.push(t)},Dd=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},Ld=(e,t)=>{e.mime=e.mime?e.mime.filter(n=>t.includes(n)):[...t]},jd=(e,t)=>{e.format=t,t.includes("int")&&(e.isInt=!0)},Ed=(e,t)=>Zn(e,"minimum",t.minimum),Zd=(e,t)=>Tn(e,"maximum",t.maximum),Td=e=>(t,n)=>{jd(t,n.format);let[r,o]=e[n.format];Zn(t,"minimum",r),Tn(t,"maximum",o)},Yw={greater_than:(e,t)=>Zn(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>Tn(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>Rd(e,t.value),number_format:Td(Qn),bigint_format:Td(er),min_length:Ed,max_length:Zd,length_equals:(e,t)=>Nd(e,t.length),min_size:Ed,max_size:Zd,size_equals:(e,t)=>Nd(e,t.size),string_format:(e,t)=>{jd(e,t.format),t.pattern&&Dd(e,t.pattern),(t.format==="base64"||t.format==="base64url")&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>Ld(e,t.mime)};Xw={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Qw=new Map([[Do,ia],[yr,sa]]),Md=e=>Qw.get(e)??e,ic=(e,t,n,r)=>{let o=n;o.type="string";let{minimum:i,maximum:s,format:a,patterns:l,contentEncoding:u,laxFormat:p}=de(e);if(typeof i=="number"&&(o.minLength=i),typeof s=="number"&&(o.maxLength=s),a&&(o.format=Xw[a]??a,o.format===""&&delete o.format,(a==="time"||p)&&delete o.format),u&&(o.contentEncoding=u),l&&l.size>0){let m=[...l].map(Md);m.length===1?o.pattern=m[0].source:m.length>1&&(o.allOf=[...m.map(g=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:g.source}))])}},sc=(e,t,n,r)=>{let o=n,{minimum:i,maximum:s,multipleOf:a,exclusiveMaximum:l,exclusiveMinimum:u,isInt:p}=de(e);o.type=p?"integer":"number";let m=typeof u=="number"&&u>=(i??Number.NEGATIVE_INFINITY),g=typeof l=="number"&&l<=(s??Number.POSITIVE_INFINITY),d=t.target==="draft-04"||t.target==="openapi-3.0";if(m?d?(o.minimum=u,o.exclusiveMinimum=!0):o.exclusiveMinimum=u:typeof i=="number"&&(o.minimum=i),g?d?(o.maximum=l,o.exclusiveMaximum=!0):o.exclusiveMaximum=l:typeof s=="number"&&(o.maximum=s),a){let h=new Set;for(let _ of a)Number.isFinite(_)&&_!==0?h.add(Math.abs(_)):pe(e,t,o,r,`A multipleOf divisor of ${_} cannot be represented in JSON Schema`);let[y,...w]=h;y!==void 0&&(o.multipleOf=y),w.length&&(o.allOf=[...o.allOf??[],...w.map(_=>({multipleOf:_}))])}},ac=(e,t,n,r)=>{n.type="boolean"},lc=(e,t,n,r)=>{pe(e,t,n,r,"BigInt cannot be represented in JSON Schema")},uc=(e,t,n,r)=>{pe(e,t,n,r,"Symbols cannot be represented in JSON Schema")},cc=(e,t,n,r)=>{t.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},fc=(e,t,n,r)=>{pe(e,t,n,r,"Undefined cannot be represented in JSON Schema")},pc=(e,t,n,r)=>{pe(e,t,n,r,"Void cannot be represented in JSON Schema")},dc=(e,t,n,r)=>{n.not={}},mc=(e,t,n,r)=>{},gc=(e,t,n,r)=>{},hc=(e,t,n,r)=>{pe(e,t,n,r,"Date cannot be represented in JSON Schema")},yc=(e,t,n,r)=>{let o=e._zod.def,i=on(o.entries);if(i.length===0){n.not={};return}i.every(s=>typeof s=="number")&&(n.type="number"),i.every(s=>typeof s=="string")&&(n.type="string"),n.enum=i},bc=(e,t,n,r)=>{let o=e._zod.def;if(o.values.length===0){n.not={};return}let i=[];for(let s of o.values)if(s===void 0){if(pe(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof s=="bigint"){if(pe(e,t,n,r,"BigInt literals cannot be represented in JSON Schema"))return;i.push(Number(s))}else i.push(s);if(i.length!==0)if(i.length===1){let s=i[0];n.type=s===null?"null":typeof s,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[s]:n.const=s}else i.every(s=>typeof s=="number")&&(n.type="number"),i.every(s=>typeof s=="string")&&(n.type="string"),i.every(s=>typeof s=="boolean")&&(n.type="boolean"),i.every(s=>s===null)&&(n.type="null"),n.enum=i},wc=(e,t,n,r)=>{pe(e,t,n,r,"NaN cannot be represented in JSON Schema")},vc=(e,t,n,r)=>{let o=n,i=e._zod.pattern;if(!i)throw new Error("Pattern not found in template literal");o.type="string",o.pattern=i.source},kc=(e,t,n,r)=>{let o=n;o.type="string",o.format="binary",o.contentEncoding="binary";let{minimum:i,maximum:s,mime:a}=de(e);i!==void 0&&(o.minLength=i),s!==void 0&&(o.maxLength=s),a&&(a.length===0?o.not={}:a.length===1?o.contentMediaType=a[0]:o.anyOf=a.map(l=>({contentMediaType:l})))},_c=(e,t,n,r)=>{n.type="boolean"},$c=(e,t,n,r)=>{pe(e,t,n,r,"Custom types cannot be represented in JSON Schema")},xc=(e,t,n,r)=>{pe(e,t,n,r,"Function types cannot be represented in JSON Schema")},Sc=(e,t,n,r)=>{pe(e,t,n,r,"Transforms cannot be represented in JSON Schema")},zc=(e,t,n,r)=>{pe(e,t,n,r,"Map cannot be represented in JSON Schema")},Ic=(e,t,n,r)=>{pe(e,t,n,r,"Set cannot be represented in JSON Schema")},Pc=(e,t,n,r)=>{let o=n,i=e._zod.def,{minimum:s,maximum:a}=de(e);typeof s=="number"&&(o.minItems=s),typeof a=="number"&&(o.maxItems=a),o.type="array",o.items=X(i.element,t,{...r,path:[...r.path,"items"]})};Cc=(e,t,n,r)=>{let o=n,i=e._zod.def,s=i.shape;if(Object.getOwnPropertySymbols(s).length&&pe(e,t,o,r,"Symbol keys cannot be represented in JSON Schema"))return;o.type="object",o.properties={};for(let u in s)ge(o.properties,u,X(s[u],t,{...r,path:[...r.path,"properties",u]}));let l=[];for(let u of Object.keys(s)){let p=i.shape[u];(t.io==="input"?Zr(p)===void 0:p._zod.optout===void 0)&&l.push(u)}l.length>0&&(o.required=l),i.catchall?._zod.def.type==="never"?o.additionalProperties=!1:i.catchall?i.catchall&&(o.additionalProperties=X(i.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},Oi=(e,t,n,r)=>{let o=e._zod.def,i=o.inclusive===!1,s=o.options.map((a,l)=>X(a,t,{...r,path:[...r.path,i?"oneOf":"anyOf",l]}));i?n.oneOf=s:n.anyOf=s},Ac=(e,t,n,r)=>{let o=e._zod.def,i=X(o.left,t,{...r,path:[...r.path,"allOf",0]}),s=X(o.right,t,{...r,path:[...r.path,"allOf",1]}),a=u=>"allOf"in u&&Object.keys(u).length===1,l=[...a(i)?i.allOf:[i],...a(s)?s.allOf:[s]];n.allOf=l,t.intersections.push(l)},Oc=(e,t,n,r)=>{let o=n,i=e._zod.def;o.type="array";let s=t.target==="draft-2020-12"?"prefixItems":"items",a=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",l=i.items.map((y,w)=>X(y,t,{...r,path:[...r.path,s,w]})),u=i.rest?X(i.rest,t,{...r,path:[...r.path,a,...t.target==="openapi-3.0"?[i.items.length]:[]]}):null,p=i.items.length;for(;p>0;){let y=i.items[p-1];if(!(t.io==="input"?Zr(y)!==void 0:y._zod.optout==="optional"))break;p--}let m=i.items.length,g=!i.rest;t.target==="draft-2020-12"?(o.prefixItems=l,g?o.items=!1:u&&(o.items=u),p>0&&(o.minItems=p),g&&(o.maxItems=m)):t.target==="openapi-3.0"?(o.items={anyOf:l},u&&o.items.anyOf.push(u),p>0&&(o.minItems=p),g&&(o.maxItems=m)):(o.items=l,g?o.additionalItems=!1:u&&(o.additionalItems=u),p>0&&(o.minItems=p),g&&(o.maxItems=m));let{minimum:d,maximum:h}=de(e);typeof d=="number"&&(o.minItems=d),typeof h=="number"&&(o.maxItems=h)};oc=new WeakMap;Nc=(e,t,n,r)=>{let o=n,i=e._zod.def;o.type="object";let s=i.keyType,a=de(s).patterns;if(i.mode==="loose"&&a&&a.size>0){let p=X(i.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});o.patternProperties={};for(let m of a)ge(o.patternProperties,Md(m).source,p)}else{if(t.target==="draft-07"||t.target==="draft-2020-12"){o.propertyNames=X(i.keyType,t,{...r,path:[...r.path,"propertyNames"]});let p=oc.get(t);p||(p=[],oc.set(t,p),t.deferred.push(()=>ev(t))),p.push(e)}o.additionalProperties=X(i.valueType,t,{...r,path:[...r.path,"additionalProperties"]})}let l=s._zod.values,u=t.io==="input"&&Zr(i.valueType)!==void 0;if(l&&!i.partial&&!u){let p=[...l].filter(m=>typeof m=="string"||typeof m=="number");p.length>0&&(o.required=p.map(String))}},Ec=(e,t,n,r)=>{let o=e._zod.def,i=X(o.innerType,t,r),s=t.seen.get(e);t.target==="openapi-3.0"?(s.ref=o.innerType,n.nullable=!0):n.anyOf=[i,{type:"null"}]},Zc=(e,t,n,r)=>{let o=e._zod.def;X(o.innerType,t,r);let i=t.seen.get(e);i.ref=o.innerType},Tc=Symbol();Rc=(e,t,n,r)=>{let o=e._zod.def;X(o.innerType,t,r);let i=t.seen.get(e);i.ref=o.innerType;let s=Ud(o.defaultValue,e,t,n,r);s!==Tc&&(n.default=s)},Dc=(e,t,n,r)=>{let o=e._zod.def;X(o.innerType,t,r);let i=t.seen.get(e);if(i.ref=o.innerType,t.io!=="input")return;let s=Ud(o.defaultValue,e,t,n,r);s!==Tc&&(n._prefault=s)},Lc=(e,t,n,r)=>{let o=e._zod.def;X(o.innerType,t,r);let i=t.seen.get(e);i.ref=o.innerType;let s;try{s=o.catchValue(void 0)}catch{pe(e,t,n,r,"Dynamic catch values are not supported in JSON Schema");return}n.default=s},jc=(e,t,n,r)=>{let o=e._zod.def,i=o.in._zod.traits.has("$ZodTransform"),s=t.io==="input"?i?o.out:o.in:o.out;X(s,t,r);let a=t.seen.get(e);a.ref=s},Mc=(e,t,n,r)=>{let o=e._zod.def;X(o.innerType,t,r);let i=t.seen.get(e);i.ref=o.innerType,n.readOnly=!0},Uc=(e,t,n,r)=>{let o=e._zod.def;X(o.innerType,t,r);let i=t.seen.get(e);i.ref=o.innerType},Ni=(e,t,n,r)=>{let o=e._zod.def;X(o.innerType,t,r);let i=t.seen.get(e);i.ref=o.innerType},Vc=(e,t,n,r)=>{let o=e._zod.innerType;X(o,t,r);let i=t.seen.get(e);i.ref=o},Ai={string:ic,number:sc,boolean:ac,bigint:lc,symbol:uc,null:cc,undefined:fc,void:pc,never:dc,any:mc,unknown:gc,date:hc,enum:yc,literal:bc,nan:wc,template_literal:vc,file:kc,success:_c,custom:$c,function:xc,transform:Sc,map:zc,set:Ic,array:Pc,object:Cc,union:Oi,intersection:Ac,tuple:Oc,record:Nc,nullable:Ec,nonoptional:Zc,default:Rc,prefault:Dc,catch:Lc,pipe:jc,readonly:Mc,promise:Uc,optional:Ni,lazy:Vc}});var Zi,Vd=K(()=>{Tr();Er();Zi=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(t){this.ctx.counter=t}get seen(){return this.ctx.seen}constructor(t){let n=t?.target??"draft-2020-12";n==="draft-4"&&(n="draft-04"),n==="draft-7"&&(n="draft-07"),this.ctx=yt({processors:Ai,target:n,...t?.metadata&&{metadata:t.metadata},...t?.unrepresentable&&{unrepresentable:t.unrepresentable},...t?.override&&{override:t.override},...t?.io&&{io:t.io}})}process(t,n={path:[],schemaPath:[]}){return X(t,this.ctx,n)}emit(t,n){n&&(n.cycles&&(this.ctx.cycles=n.cycles),n.reused&&(this.ctx.reused=n.reused),n.external&&(this.ctx.external=n.external)),this.ctx.sharedDefsExtractedFor=void 0,this.ctx.sharedEmitDoneFor=void 0,bt(this.ctx,t);let r=wt(this.ctx,t),{"~standard":o,...i}=r;return i}}});var Fd={};var Bd=K(()=>{});var it={};Ue(it,{$ZodAny:()=>Il,$ZodArray:()=>El,$ZodAsyncError:()=>Ae,$ZodBase64:()=>gl,$ZodBase64URL:()=>hl,$ZodBigInt:()=>Fo,$ZodBigIntFormat:()=>$l,$ZodBoolean:()=>br,$ZodCIDRv4:()=>dl,$ZodCIDRv6:()=>ml,$ZodCUID:()=>tl,$ZodCUID2:()=>nl,$ZodCatch:()=>Xl,$ZodCheck:()=>ee,$ZodCheckBigIntFormat:()=>Ia,$ZodCheckEndsWith:()=>ja,$ZodCheckGreaterThan:()=>So,$ZodCheckIncludes:()=>Da,$ZodCheckLengthEquals:()=>Ea,$ZodCheckLessThan:()=>xo,$ZodCheckLowerCase:()=>Ta,$ZodCheckMaxLength:()=>Oa,$ZodCheckMaxSize:()=>Pa,$ZodCheckMimeType:()=>Va,$ZodCheckMinLength:()=>Na,$ZodCheckMinSize:()=>Ca,$ZodCheckMultipleOf:()=>Sa,$ZodCheckNumberFormat:()=>za,$ZodCheckOverwrite:()=>Fa,$ZodCheckProperties:()=>Ua,$ZodCheckProperty:()=>Ma,$ZodCheckRegex:()=>Za,$ZodCheckSizeEquals:()=>Aa,$ZodCheckStartsWith:()=>La,$ZodCheckStringFormat:()=>gn,$ZodCheckUpperCase:()=>Ra,$ZodCodec:()=>vr,$ZodCreditCard:()=>bl,$ZodCustom:()=>iu,$ZodCustomStringFormat:()=>kl,$ZodCyclicError:()=>qo,$ZodDate:()=>Ol,$ZodDefault:()=>Kl,$ZodDiscriminatedUnion:()=>Dl,$ZodE164:()=>yl,$ZodEmail:()=>Ga,$ZodEmoji:()=>Qa,$ZodEncodeError:()=>dt,$ZodEnum:()=>Vl,$ZodError:()=>Ds,$ZodExactOptional:()=>Wl,$ZodFile:()=>Bl,$ZodFunction:()=>ru,$ZodGUID:()=>Ja,$ZodIBAN:()=>wl,$ZodIPv4:()=>cl,$ZodIPv6:()=>fl,$ZodISODate:()=>al,$ZodISODateTime:()=>sl,$ZodISODuration:()=>ul,$ZodISOTime:()=>ll,$ZodIntersection:()=>Ll,$ZodJWT:()=>vl,$ZodKSUID:()=>il,$ZodLazy:()=>kr,$ZodLiteral:()=>Fl,$ZodMAC:()=>pl,$ZodMap:()=>Ml,$ZodNaN:()=>Ql,$ZodNanoID:()=>el,$ZodNever:()=>Cl,$ZodNonOptional:()=>ql,$ZodNull:()=>zl,$ZodNullable:()=>Jl,$ZodNumber:()=>Vo,$ZodNumberFormat:()=>_l,$ZodObject:()=>ud,$ZodObjectJIT:()=>Zl,$ZodOptional:()=>Ho,$ZodPipe:()=>Wo,$ZodPrefault:()=>Gl,$ZodPreprocess:()=>eu,$ZodPromise:()=>ou,$ZodReadonly:()=>tu,$ZodRealError:()=>Oe,$ZodRecord:()=>jl,$ZodRegistry:()=>Qo,$ZodSet:()=>Ul,$ZodString:()=>Zt,$ZodStringFormat:()=>Y,$ZodSuccess:()=>Yl,$ZodSymbol:()=>xl,$ZodTemplateLiteral:()=>nu,$ZodTransform:()=>Hl,$ZodTuple:()=>Bo,$ZodType:()=>F,$ZodULID:()=>rl,$ZodURL:()=>Xa,$ZodUUID:()=>Ka,$ZodUndefined:()=>Sl,$ZodUnion:()=>wr,$ZodUnknown:()=>Pl,$ZodVoid:()=>Al,$ZodXID:()=>ol,$ZodXor:()=>Tl,$brand:()=>Zs,$constructor:()=>b,$input:()=>fu,$output:()=>cu,Doc:()=>Et,INVALID:()=>xe,JSONSchema:()=>Fd,JSONSchemaGenerator:()=>Zi,NEVER:()=>Es,TimePrecision:()=>$u,URL_BAD_FORMAT:()=>qa,URL_UNPARSEABLE:()=>dr,ZodCompileAsyncError:()=>Fe,ZodCompileUnsupportedError:()=>J,_any:()=>Mu,_array:()=>Ju,_base64:()=>ki,_base64url:()=>_i,_bigint:()=>Eu,_boolean:()=>Ou,_catch:()=>Bw,_check:()=>Sd,_cidrv4:()=>wi,_cidrv6:()=>vi,_coercedBigint:()=>Zu,_coercedBoolean:()=>Nu,_coercedDate:()=>Hu,_coercedNumber:()=>Su,_coercedString:()=>wu,_creditCard:()=>ku,_cuid:()=>pi,_cuid2:()=>di,_custom:()=>Gu,_date:()=>Bu,_decode:()=>po,_decodeAsync:()=>go,_default:()=>Uw,_discriminatedUnion:()=>Cw,_e164:()=>$i,_email:()=>oi,_emoji:()=>ci,_encode:()=>fo,_encodeAsync:()=>mo,_endsWith:()=>Sn,_enum:()=>Tw,_file:()=>Ku,_float32:()=>Iu,_float64:()=>Pu,_gt:()=>Ke,_gte:()=>Te,_guid:()=>ii,_iban:()=>_u,_includes:()=>$n,_int:()=>zu,_int32:()=>Cu,_int64:()=>Tu,_intersection:()=>Aw,_ipv4:()=>yi,_ipv6:()=>bi,_isoDate:()=>Cr,_isoDateTime:()=>Pr,_isoDuration:()=>Or,_isoTime:()=>Ar,_jwt:()=>xi,_ksuid:()=>hi,_lazy:()=>Kw,_length:()=>Mt,_literal:()=>Dw,_lowercase:()=>kn,_lt:()=>Je,_lte:()=>Ze,_mac:()=>vu,_map:()=>Ew,_max:()=>Ze,_maxLength:()=>jt,_maxSize:()=>ht,_mime:()=>In,_min:()=>Te,_minLength:()=>ot,_minSize:()=>Ge,_multipleOf:()=>gt,_nan:()=>Wu,_nanoid:()=>fi,_nativeEnum:()=>Rw,_negative:()=>zi,_never:()=>Vu,_nonnegative:()=>Pi,_nonoptional:()=>Vw,_nonpositive:()=>Ii,_normalize:()=>Pn,_null:()=>ju,_nullable:()=>Mw,_number:()=>xu,_optional:()=>jw,_overwrite:()=>Be,_parse:()=>fn,_parseAsync:()=>pn,_pipe:()=>Hw,_positive:()=>Si,_promise:()=>Gw,_properties:()=>zn,_property:()=>Ci,_readonly:()=>Ww,_record:()=>Nw,_refine:()=>qu,_regex:()=>vn,_safeDecode:()=>yo,_safeDecodeAsync:()=>wo,_safeEncode:()=>ho,_safeEncodeAsync:()=>bo,_safeParse:()=>dn,_safeParseAsync:()=>mn,_set:()=>Zw,_size:()=>Lt,_slugify:()=>Nn,_startsWith:()=>xn,_string:()=>bu,_stringFormat:()=>Ut,_stringbool:()=>ec,_success:()=>Fw,_superRefine:()=>Yu,_symbol:()=>Du,_templateLiteral:()=>Jw,_toLowerCase:()=>An,_toUpperCase:()=>On,_transform:()=>Lw,_trim:()=>Cn,_tuple:()=>Ow,_uint32:()=>Au,_uint64:()=>Ru,_ulid:()=>mi,_undefined:()=>Lu,_union:()=>Iw,_unknown:()=>Uu,_uppercase:()=>_n,_url:()=>Ir,_uuid:()=>si,_uuidv4:()=>ai,_uuidv6:()=>li,_uuidv7:()=>ui,_void:()=>Fu,_xid:()=>gi,_xor:()=>Pw,base64Charset:()=>Do,base64urlCharset:()=>yr,canParseURL:()=>Ya,clone:()=>q,compile:()=>gu,compileFn:()=>ni,config:()=>se,createStandardJSONSchemaMethod:()=>En,createToJSONSchemaMethod:()=>nc,decode:()=>Zy,decodeAsync:()=>Ry,describe:()=>Xu,encode:()=>Ey,encodeAsync:()=>Ty,extractDefs:()=>bt,finalize:()=>wt,flattenError:()=>ir,formatError:()=>sr,getDiscriminatedOption:()=>Rl,globalConfig:()=>me,globalRegistry:()=>he,handleUnrepresentable:()=>pe,initializeContext:()=>yt,isBackEdge:()=>Xo,isRecursiveSchema:()=>Yo,isValidBase64:()=>hr,isValidBase64URL:()=>Lo,isValidCIDRv6:()=>Ro,isValidCreditCard:()=>jo,isValidIBAN:()=>Mo,isValidIPv6:()=>gr,isValidJWT:()=>Uo,locales:()=>Sr,memoizer:()=>xr,mergeValues:()=>hn,meta:()=>Qu,parse:()=>uo,parseAsync:()=>co,parseURLObject:()=>sd,prettifyError:()=>js,process:()=>X,processSchema:()=>X,regexes:()=>Me,registry:()=>ei,safeDecode:()=>Ly,safeDecodeAsync:()=>My,safeEncode:()=>Dy,safeEncodeAsync:()=>jy,safeParse:()=>Py,safeParseAsync:()=>Cy,standardProps:()=>No,stripTabAndNewline:()=>mr,toDotPath:()=>jp,toJSONSchema:()=>Ei,toZod:()=>Gn,treeifyError:()=>Ls,urlHostnameOk:()=>Zo,urlProtocolOk:()=>To,util:()=>E,validate:()=>ar,validateAsync:()=>lr,validateURL:()=>Eo,version:()=>Ba,withParser:()=>ti});var Re=K(()=>{pt();Us();Ms();yn();lu();zo();Ha();le();le();Nt();uu();zr();Io();xd();zd();Er();Tr();Vd();Bd()});function Hd(){return{localeError:nv()}}var nv,Wd=K(()=>{le();nv=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(i){return e[i]??null}let n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",currency_code:"currency code",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},r={nan:"NaN"};function o(i,s){return i==="number"&&typeof s=="number"&&!Number.isFinite(s)?String(s):r[i]??i}return i=>{switch(i.code){case"invalid_type":{let s=o(i.expected),a=Cs(i.input),l=o(a,i.input);return`Invalid input: expected ${s}, received ${l}`}case"invalid_value":return i.values.length===1?`Invalid input: expected ${io(i.values[0])}`:`Invalid option: expected one of ${no(i.values,"|")}`;case"too_big":{let s=i.exact?"exactly ":i.inclusive?"<=":"<",a=t(i.origin);return a?`Too big: expected ${i.origin??"value"} to have ${s}${i.maximum.toString()} ${a.unit??"elements"}`:`Too big: expected ${i.origin??"value"} to be ${s}${i.maximum.toString()}`}case"too_small":{let s=i.exact?"exactly ":i.inclusive?">=":">",a=t(i.origin);return a?`Too small: expected ${i.origin} to have ${s}${i.minimum.toString()} ${a.unit}`:`Too small: expected ${i.origin} to be ${s}${i.minimum.toString()}`}case"invalid_format":{let s=i;return s.format==="starts_with"?`Invalid string: must start with "${s.prefix}"`:s.format==="ends_with"?`Invalid string: must end with "${s.suffix}"`:s.format==="includes"?`Invalid string: must include "${s.includes}"`:s.format==="regex"?`Invalid string: must match pattern ${s.pattern}`:`Invalid ${n[s.format]??i.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${i.divisor}`;case"unrecognized_keys":return`Unrecognized key${i.keys.length>1?"s":""}: ${no(i.keys,", ")}`;case"invalid_key":return`Invalid key in ${i.origin}`;case"invalid_union":return i.options&&Array.isArray(i.options)&&i.options.length>0?`Invalid discriminator value. Expected ${i.options.map(a=>`'${a}'`).join(" | ")}`:i.inclusive===!1?"Invalid input: more than one option matched":"Invalid input";case"invalid_element":return`Invalid value in ${i.origin}`;default:return"Invalid input"}}}});var Ti={};Ue(Ti,{endsWith:()=>Sn,gt:()=>Ke,gte:()=>Te,includes:()=>$n,length:()=>Mt,lowercase:()=>kn,lt:()=>Je,lte:()=>Ze,maxLength:()=>jt,maxSize:()=>ht,mime:()=>In,minLength:()=>ot,minSize:()=>Ge,multipleOf:()=>gt,negative:()=>zi,nonnegative:()=>Pi,nonpositive:()=>Ii,normalize:()=>Pn,overwrite:()=>Be,positive:()=>Si,properties:()=>zn,property:()=>Ci,regex:()=>vn,size:()=>Lt,slugify:()=>Nn,startsWith:()=>xn,toLowerCase:()=>An,toUpperCase:()=>On,trim:()=>Cn,uppercase:()=>_n});var Ri=K(()=>{Re()});function Di(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let r=n(this);return Object.defineProperty(this,t,{value:r,configurable:!0,writable:!0}),r},set(r){Object.defineProperty(this,t,{value:r,configurable:!0,writable:!0})}})}var Jd,Kd,rv,Ne,Fc=K(()=>{Re();Re();le();Jd=new WeakSet([Object.prototype,Error.prototype]);Kd=(e,t)=>{Ds.init(e,t),e.name="ZodError";let n=Object.getPrototypeOf(e);Jd.has(n)||(Jd.add(n),Di(n,"format",r=>o=>sr(r,o)),Di(n,"flatten",r=>o=>ir(r,o)),Di(n,"addIssue",r=>o=>{r.issues.push(o),r.message=JSON.stringify(r.issues,sn,2)}),Di(n,"addIssues",r=>o=>{r.issues.push(...o),r.message=JSON.stringify(r.issues,sn,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},rv=b("ZodError",Kd),Ne=b("ZodError",Kd,void 0,{Parent:Error})});var Bc,Hc,Wc,Jc,Kc,Gc,qc,Yc,Xc,Qc,ef,tf,nf=K(()=>{Re();Fc();Re();Bc=fn(Ne),Hc=pn(Ne),Wc=dn(Ne),Jc=mn(Ne),Kc=fo(Ne),Gc=po(Ne),qc=mo(Ne),Yc=go(Ne),Xc=ho(Ne),Qc=yo(Ne),ef=bo(Ne),tf=wo(Ne)});var Fn={};Ue(Fn,{ZodAny:()=>df,ZodArray:()=>yf,ZodBase64:()=>es,ZodBase64URL:()=>ts,ZodBigInt:()=>Un,ZodBigIntFormat:()=>os,ZodBoolean:()=>Mn,ZodCIDRv4:()=>Xi,ZodCIDRv6:()=>Qi,ZodCUID:()=>Hi,ZodCUID2:()=>Wi,ZodCatch:()=>Lf,ZodCodec:()=>Hr,ZodCreditCard:()=>of,ZodCustom:()=>Wr,ZodCustomStringFormat:()=>Ht,ZodDate:()=>jr,ZodDefault:()=>Nf,ZodDiscriminatedUnion:()=>wf,ZodE164:()=>ns,ZodEmail:()=>Ui,ZodEmoji:()=>Fi,ZodEnum:()=>Dn,ZodExactOptional:()=>ls,ZodFile:()=>Pf,ZodFunction:()=>Kf,ZodGUID:()=>Vi,ZodIBAN:()=>sf,ZodIPv4:()=>qi,ZodIPv6:()=>Yi,ZodISODate:()=>kt,ZodISODateTime:()=>vt,ZodISODuration:()=>$t,ZodISOTime:()=>_t,ZodInstanceOf:()=>Yf,ZodIntersection:()=>vf,ZodJWT:()=>rs,ZodKSUID:()=>Gi,ZodLazy:()=>Hf,ZodLiteral:()=>If,ZodMAC:()=>rf,ZodMap:()=>Sf,ZodNaN:()=>Mf,ZodNanoID:()=>Bi,ZodNever:()=>gf,ZodNonOptional:()=>us,ZodNull:()=>ff,ZodNullable:()=>Of,ZodNumber:()=>jn,ZodNumberFormat:()=>Wt,ZodObject:()=>Ur,ZodOptional:()=>Fr,ZodPipe:()=>Br,ZodPrefault:()=>Zf,ZodPreprocess:()=>Uf,ZodPromise:()=>Jf,ZodReadonly:()=>Vf,ZodRecord:()=>Rn,ZodSet:()=>zf,ZodString:()=>Ln,ZodStringFormat:()=>Q,ZodSuccess:()=>Df,ZodSymbol:()=>uf,ZodTemplateLiteral:()=>Bf,ZodTransform:()=>Cf,ZodTuple:()=>_f,ZodType:()=>B,ZodULID:()=>Ji,ZodURL:()=>Lr,ZodUUID:()=>qe,ZodUndefined:()=>cf,ZodUnion:()=>Vr,ZodUnknown:()=>mf,ZodVoid:()=>hf,ZodXID:()=>Ki,ZodXor:()=>bf,_ZodString:()=>Mi,_default:()=>Ef,_function:()=>og,any:()=>Tm,array:()=>Mr,base64:()=>gm,base64url:()=>hm,bigint:()=>Am,boolean:()=>lf,catch:()=>jf,check:()=>ig,cidrv4:()=>dm,cidrv6:()=>mm,codec:()=>eg,creditCard:()=>bm,cuid:()=>im,cuid2:()=>sm,currencyCode:()=>xm,custom:()=>sg,date:()=>Dm,describe:()=>ag,discriminatedUnion:()=>Fm,e164:()=>ym,email:()=>Gd,emoji:()=>rm,enum:()=>ss,exactOptional:()=>Af,file:()=>qm,float32:()=>zm,float64:()=>Im,function:()=>og,guid:()=>qd,hash:()=>Sm,hex:()=>$m,hostname:()=>_m,httpUrl:()=>nm,iban:()=>wm,instanceof:()=>ug,int:()=>Li,int32:()=>Pm,int64:()=>Om,intersection:()=>kf,invertCodec:()=>tg,ipv4:()=>cm,ipv6:()=>pm,json:()=>fg,jwt:()=>vm,keyof:()=>Lm,ksuid:()=>um,lazy:()=>Wf,literal:()=>Gm,looseObject:()=>Um,looseRecord:()=>Hm,mac:()=>fm,map:()=>Wm,meta:()=>lg,nan:()=>Qm,nanoid:()=>om,nativeEnum:()=>Km,never:()=>is,nonoptional:()=>Rf,null:()=>pf,nullable:()=>Dr,nullish:()=>Ym,number:()=>af,object:()=>jm,optional:()=>Ft,partialRecord:()=>Bm,pipe:()=>ji,prefault:()=>Tf,preprocess:()=>pg,promise:()=>rg,readonly:()=>Ff,record:()=>xf,refine:()=>Gf,set:()=>Jm,strictObject:()=>Mm,string:()=>Rr,stringFormat:()=>km,stringbool:()=>cg,success:()=>Xm,superRefine:()=>qf,symbol:()=>Em,templateLiteral:()=>ng,transform:()=>as,tuple:()=>$f,uint32:()=>Cm,uint64:()=>Nm,ulid:()=>am,undefined:()=>Zm,union:()=>Vn,unknown:()=>Vt,url:()=>tm,uuid:()=>Yd,uuidv4:()=>Xd,uuidv6:()=>Qd,uuidv7:()=>em,void:()=>Rm,xid:()=>lm,xor:()=>Vm});function iv(){me.localeError||se(Hd())}function Bt(){me.memoizer||se({memoizer:xr()})}function Rr(e){return bu(Ln,e)}function Gd(e){return oi(Ui,e)}function qd(e){return ii(Vi,e)}function Yd(e){return si(qe,e)}function Xd(e){return ai(qe,e)}function Qd(e){return li(qe,e)}function em(e){return ui(qe,e)}function tm(e){return Ir(Lr,e)}function nm(e){return Ir(Lr,{protocol:ur,hostname:la,...E.normalizeParams(e)})}function rm(e){return ci(Fi,e)}function om(e){return fi(Bi,e)}function im(e){return pi(Hi,e)}function sm(e){return di(Wi,e)}function am(e){return mi(Ji,e)}function lm(e){return gi(Ki,e)}function um(e){return hi(Gi,e)}function cm(e){return yi(qi,e)}function fm(e){return vu(rf,e)}function pm(e){return bi(Yi,e)}function dm(e){return wi(Xi,e)}function mm(e){return vi(Qi,e)}function gm(e){return ki(es,e)}function hm(e){return _i(ts,e)}function ym(e){return $i(ns,e)}function bm(e){return ku(of,e)}function wm(e){return _u(sf,e)}function vm(e){return xi(rs,e)}function km(e,t,n={}){return Ut(Ht,e,t,n)}function _m(e){return Ut(Ht,"hostname",aa,e)}function $m(e){return Ut(Ht,"hex",_a,e)}function xm(e){return Ut(Ht,"currency_code",ca,e)}function Sm(e,t){let n=t?.enc??"hex",r=`${e}_${n}`,o=Me[r];if(!o)throw new Error(`Unrecognized hash format: ${r}`);return Ut(Ht,r,o,t)}function af(e){return xu(jn,e)}function Li(e){return zu(Wt,e)}function zm(e){return Iu(Wt,e)}function Im(e){return Pu(Wt,e)}function Pm(e){return Cu(Wt,e)}function Cm(e){return Au(Wt,e)}function lf(e){return Ou(Mn,e)}function Am(e){return Eu(Un,e)}function Om(e){return Tu(os,e)}function Nm(e){return Ru(os,e)}function Em(e){return Du(uf,e)}function Zm(e){return Lu(cf,e)}function pf(e){return ju(ff,e)}function Tm(){return Mu(df)}function Vt(){return Uu(mf)}function is(e){return Vu(gf,e)}function Rm(e){return Fu(hf,e)}function Dm(e){return Bu(jr,e)}function Mr(e,t){return Ju(yf,e,t)}function Lm(e){let t=e._zod.def.shape;return ss(Object.keys(t))}function jm(e,t){let n={type:"object",shape:e??{},...E.normalizeParams(t)};return new Ur(n)}function Mm(e,t){return new Ur({type:"object",shape:e,catchall:is(),...E.normalizeParams(t)})}function Um(e,t){return new Ur({type:"object",shape:e,catchall:Vt(),...E.normalizeParams(t)})}function Vn(e,t){return new Vr({type:"union",options:e,...E.normalizeParams(t)})}function Vm(e,t){return new bf({type:"union",options:e,inclusive:!1,...E.normalizeParams(t)})}function Fm(e,t,n){return new wf({type:"union",options:t,discriminator:e,...E.normalizeParams(n)})}function kf(e,t){return new vf({type:"intersection",left:e,right:t})}function $f(e,t,n){let r=t instanceof F,o=r?n:t,i=r?t:null;return new _f({type:"tuple",items:e,rest:i,...E.normalizeParams(o)})}function xf(e,t,n){return!t||!t._zod?new Rn({type:"record",keyType:Rr(),valueType:e,...E.normalizeParams(t)}):new Rn({type:"record",keyType:e,valueType:t,...E.normalizeParams(n)})}function Bm(e,t,n){return new Rn({type:"record",keyType:e,valueType:t,...E.normalizeParams(n),partial:!0})}function Hm(e,t,n){return new Rn({type:"record",keyType:e,valueType:t,mode:"loose",...E.normalizeParams(n)})}function Wm(e,t,n){return new Sf({type:"map",keyType:e,valueType:t,...E.normalizeParams(n)})}function Jm(e,t){return new zf({type:"set",valueType:e,...E.normalizeParams(t)})}function ss(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new Dn({type:"enum",entries:n,...E.normalizeParams(t)})}function Km(e,t){return new Dn({type:"enum",entries:e,...E.normalizeParams(t)})}function Gm(e,t){return new If({type:"literal",values:Array.isArray(e)?e:[e],...E.normalizeParams(t)})}function qm(e){return Ku(Pf,e)}function as(e){return new Cf({type:"transform",transform:e})}function Ft(e){return new Fr({type:"optional",innerType:e})}function Af(e){return new ls({type:"optional",innerType:e})}function Dr(e){return new Of({type:"nullable",innerType:e})}function Ym(e){return Ft(Dr(e))}function Ef(e,t){return new Nf({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():E.shallowClone(t)}})}function Tf(e,t){return new Zf({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():E.shallowClone(t)}})}function Rf(e,t){return new us({type:"nonoptional",innerType:e,...E.normalizeParams(t)})}function Xm(e){return new Df({type:"success",innerType:e})}function jf(e,t){return new Lf({type:"catch",innerType:e,catchValue:typeof t=="function"?t:E.constantCatch(t)})}function Qm(e){return Wu(Mf,e)}function ji(e,t){return new Br({type:"pipe",in:e,out:t})}function eg(e,t,n){return new Hr({type:"pipe",in:e,out:t,transform:n.decode,reverseTransform:n.encode})}function tg(e){let t=e._zod.def;return new Hr({type:"pipe",in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}function Ff(e){return new Vf({type:"readonly",innerType:e})}function ng(e,t){return new Bf({type:"template_literal",parts:e,...E.normalizeParams(t)})}function Wf(e){return new Hf({type:"lazy",getter:e})}function rg(e){return new Jf({type:"promise",innerType:e})}function og(e){return new Kf({type:"function",input:Array.isArray(e?.input)?$f(e?.input):e?.input??Mr(Vt()),output:e?.output??Vt()})}function ig(e){let t=new ee({check:"custom"});return t._zod.check=e,t}function sg(e,t){return Gu(Wr,e??(()=>!0),t)}function Gf(e,t={}){return qu(Wr,e,t)}function qf(e,t){return Yu(e,t)}function ug(e,t={}){let n=new Yf({type:"custom",check:"custom",fn:r=>r instanceof e,abort:!0,...E.normalizeParams(t)});return n._zod.bag.Class=e,n._zod.check=r=>{r.value instanceof e||r.issues.push({code:"invalid_type",expected:e.name,input:r.value,inst:n,path:[...n._zod.def.path??[]]})},n}function fg(e){let t=Wf(()=>Vn([Rr(e),af(),lf(),pf(),Mr(t),xf(Rr(),t)]));return t}function pg(e,t){return new Uf({type:"pipe",in:as(e),out:t})}var B,Mi,Ln,Q,vt,kt,_t,$t,Ui,Vi,qe,Lr,Fi,Bi,Hi,Wi,Ji,Ki,Gi,qi,rf,Yi,Xi,Qi,es,ts,ns,of,sf,rs,Ht,jn,Wt,Mn,Un,os,uf,cf,ff,df,mf,gf,hf,jr,yf,Ur,Vr,bf,wf,vf,_f,Rn,Sf,zf,Dn,If,Pf,Cf,Fr,ls,Of,Nf,Zf,us,Df,Lf,Mf,Br,Hr,Uf,Vf,Bf,Hf,Jf,Kf,Wr,ag,lg,Yf,cg,xt=K(()=>{Re();Re();Tr();Nt();Er();Wd();Ri();nf();B=b("ZodType",(e,t)=>(iv(),F.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(E.mergeDefs(t,{checks:[...t.checks??[],...e.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return q(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Gf(e,t))},superRefine(e,t){return this.check(qf(e,t))},overwrite(e){return this.check(Be(e))},optional(){return Ft(this)},exactOptional(){return Af(this)},nullable(){return Dr(this)},nullish(){return Ft(Dr(this))},nonoptional(e){return Rf(this,e)},array(){return Mr(this)},or(e){return Vn([this,e])},and(e){return kf(this,e)},transform(e){return ji(this,as(e))},default(e){return Ef(this,e)},prefault(e){return Tf(this,e)},catch(e){return jf(this,e)},pipe(e){return ji(this,e)},readonly(){return Ff(this)},describe(e){let t=this.clone();return he.add(t,{description:e}),t},meta(...e){if(e.length===0)return he.get(this);let t=this.clone();return he.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return E.hide(this,"~standard",{...No(this),jsonSchema:{input:En(this,"input"),output:En(this,"output")}})},set"~standard"(e){E.own(this,"~standard",e)},parse:function e(t,n){return Bc(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await Hc(this,t,n,{callee:e})},safeParse(e,t){return Wc(this,e,t)},async safeParseAsync(e,t){return Jc(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){E.own(this,"spa",e)},validate(e,t){return ar(this,e,t)},validateAsync(e,t){return lr(this,e,t)},encode:function e(t,n){return Kc(this,t,n,{callee:e})},decode:function e(t,n){return Gc(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await qc(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await Yc(this,t,n,{callee:e})},safeEncode(e,t){return Xc(this,e,t)},safeDecode(e,t){return Qc(this,e,t)},async safeEncodeAsync(e,t){return ef(this,e,t)},async safeDecodeAsync(e,t){return tf(this,e,t)},toJSONSchema(e){return nc(this,{})(e)},get description(){return he.get(this)?.description},get _def(){return this._zod.def}}),Mi=b("_ZodString",(e,t)=>{Zt.init(e,t),B.init(e,t),e._zod.processJSONSchema=(n,r,o)=>ic(e,n,r,o)},E.derived({format:e=>de(e).format??null,minLength:e=>de(e).minimum??null,maxLength:e=>de(e).maximum??null},{regex(...e){return this.check(vn(...e))},includes(...e){return this.check($n(...e))},startsWith(...e){return this.check(xn(...e))},endsWith(...e){return this.check(Sn(...e))},min(...e){return this.check(ot(...e))},max(...e){return this.check(jt(...e))},length(...e){return this.check(Mt(...e))},nonempty(...e){return this.check(ot(1,...e))},lowercase(e){return this.check(kn(e))},uppercase(e){return this.check(_n(e))},trim(){return this.check(Cn())},normalize(...e){return this.check(Pn(...e))},toLowerCase(){return this.check(An())},toUpperCase(){return this.check(On())},slugify(){return this.check(Nn())}})),Ln=b("ZodString",(e,t)=>{Zt.init(e,t),Mi.init(e,t)},{email(e){return this.check(oi(Ui,e))},url(e){return this.check(Ir(Lr,e))},jwt(e){return this.check(xi(rs,e))},emoji(e){return this.check(ci(Fi,e))},guid(e){return this.check(ii(Vi,e))},uuid(e){return this.check(si(qe,e))},uuidv4(e){return this.check(ai(qe,e))},uuidv6(e){return this.check(li(qe,e))},uuidv7(e){return this.check(ui(qe,e))},nanoid(e){return this.check(fi(Bi,e))},cuid(e){return this.check(pi(Hi,e))},cuid2(e){return this.check(di(Wi,e))},ulid(e){return this.check(mi(Ji,e))},base64(e){return this.check(ki(es,e))},base64url(e){return this.check(_i(ts,e))},xid(e){return this.check(gi(Ki,e))},ksuid(e){return this.check(hi(Gi,e))},ipv4(e){return this.check(yi(qi,e))},ipv6(e){return this.check(bi(Yi,e))},cidrv4(e){return this.check(wi(Xi,e))},cidrv6(e){return this.check(vi(Qi,e))},e164(e){return this.check($i(ns,e))},datetime(e){return this.check(Pr(vt,e))},date(e){return this.check(Cr(kt,e))},time(e){return this.check(Ar(_t,e))},duration(e){return this.check(Or($t,e))}});Q=b("ZodStringFormat",(e,t)=>{Y.init(e,t),Mi.init(e,t)}),vt=b("ZodISODateTime",(e,t)=>{sl.init(e,t),Q.init(e,t)}),kt=b("ZodISODate",(e,t)=>{al.init(e,t),Q.init(e,t)}),_t=b("ZodISOTime",(e,t)=>{ll.init(e,t),Q.init(e,t)}),$t=b("ZodISODuration",(e,t)=>{ul.init(e,t),Q.init(e,t)}),Ui=b("ZodEmail",(e,t)=>{Ga.init(e,t),Q.init(e,t)});Vi=b("ZodGUID",(e,t)=>{Ja.init(e,t),Q.init(e,t)});qe=b("ZodUUID",(e,t)=>{Ka.init(e,t),Q.init(e,t)});Lr=b("ZodURL",(e,t)=>{Xa.init(e,t),Q.init(e,t)});Fi=b("ZodEmoji",(e,t)=>{Qa.init(e,t),Q.init(e,t)});Bi=b("ZodNanoID",(e,t)=>{el.init(e,t),Q.init(e,t)});Hi=b("ZodCUID",(e,t)=>{tl.init(e,t),Q.init(e,t)});Wi=b("ZodCUID2",(e,t)=>{nl.init(e,t),Q.init(e,t)});Ji=b("ZodULID",(e,t)=>{rl.init(e,t),Q.init(e,t)});Ki=b("ZodXID",(e,t)=>{ol.init(e,t),Q.init(e,t)});Gi=b("ZodKSUID",(e,t)=>{il.init(e,t),Q.init(e,t)});qi=b("ZodIPv4",(e,t)=>{cl.init(e,t),Q.init(e,t)});rf=b("ZodMAC",(e,t)=>{pl.init(e,t),Q.init(e,t)});Yi=b("ZodIPv6",(e,t)=>{fl.init(e,t),Q.init(e,t)});Xi=b("ZodCIDRv4",(e,t)=>{dl.init(e,t),Q.init(e,t)});Qi=b("ZodCIDRv6",(e,t)=>{ml.init(e,t),Q.init(e,t)});es=b("ZodBase64",(e,t)=>{gl.init(e,t),Q.init(e,t)});ts=b("ZodBase64URL",(e,t)=>{hl.init(e,t),Q.init(e,t)});ns=b("ZodE164",(e,t)=>{yl.init(e,t),Q.init(e,t)});of=b("ZodCreditCard",(e,t)=>{bl.init(e,t),Q.init(e,t)});sf=b("ZodIBAN",(e,t)=>{wl.init(e,t),Q.init(e,t)});rs=b("ZodJWT",(e,t)=>{vl.init(e,t),Q.init(e,t)});Ht=b("ZodCustomStringFormat",(e,t)=>{kl.init(e,t),Q.init(e,t)});jn=b("ZodNumber",(e,t)=>{Vo.init(e,t),B.init(e,t),e._zod.processJSONSchema=(n,r,o)=>sc(e,n,r,o),e.isFinite=!0},E.derived({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=de(e);return Math.max(t??Number.NEGATIVE_INFINITY,n??Number.NEGATIVE_INFINITY)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=de(e);return Math.min(t??Number.POSITIVE_INFINITY,n??Number.POSITIVE_INFINITY)},isInt:e=>{let{isInt:t,multipleOf:n}=de(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>de(e).format??null},{gt(e,t){return this.check(Ke(e,t))},gte(e,t){return this.check(Te(e,t))},min(e,t){return this.check(Te(e,t))},lt(e,t){return this.check(Je(e,t))},lte(e,t){return this.check(Ze(e,t))},max(e,t){return this.check(Ze(e,t))},int(e){return this.check(Li(e))},safe(e){return this.check(Li(e))},positive(e){return this.check(Ke(0,e))},nonnegative(e){return this.check(Te(0,e))},negative(e){return this.check(Je(0,e))},nonpositive(e){return this.check(Ze(0,e))},multipleOf(e,t){return this.check(gt(e,t))},step(e,t){return this.check(gt(e,t))},finite(){return this}}));Wt=b("ZodNumberFormat",(e,t)=>{_l.init(e,t),jn.init(e,t)});Mn=b("ZodBoolean",(e,t)=>{br.init(e,t),B.init(e,t),e._zod.processJSONSchema=(n,r,o)=>ac(e,n,r,o)});Un=b("ZodBigInt",(e,t)=>{Fo.init(e,t),B.init(e,t),e._zod.processJSONSchema=(n,r,o)=>lc(e,n,r,o)},E.derived({minValue:e=>de(e).minimum??null,maxValue:e=>de(e).maximum??null,format:e=>de(e).format??null},{gte(e,t){return this.check(Te(e,t))},min(e,t){return this.check(Te(e,t))},gt(e,t){return this.check(Ke(e,t))},lt(e,t){return this.check(Je(e,t))},lte(e,t){return this.check(Ze(e,t))},max(e,t){return this.check(Ze(e,t))},positive(e){return this.check(Ke(BigInt(0),e))},negative(e){return this.check(Je(BigInt(0),e))},nonpositive(e){return this.check(Ze(BigInt(0),e))},nonnegative(e){return this.check(Te(BigInt(0),e))},multipleOf(e,t){return this.check(gt(e,t))}}));os=b("ZodBigIntFormat",(e,t)=>{$l.init(e,t),Un.init(e,t)});uf=b("ZodSymbol",(e,t)=>{xl.init(e,t),B.init(e,t),e._zod.processJSONSchema=(n,r,o)=>uc(e,n,r,o)});cf=b("ZodUndefined",(e,t)=>{Sl.init(e,t),B.init(e,t),e._zod.processJSONSchema=(n,r,o)=>fc(e,n,r,o)});ff=b("ZodNull",(e,t)=>{zl.init(e,t),B.init(e,t),e._zod.processJSONSchema=(n,r,o)=>cc(e,n,r,o)});df=b("ZodAny",(e,t)=>{Il.init(e,t),B.init(e,t),e._zod.processJSONSchema=(n,r,o)=>mc(e,n,r,o)});mf=b("ZodUnknown",(e,t)=>{Pl.init(e,t),B.init(e,t),e._zod.processJSONSchema=(n,r,o)=>gc(e,n,r,o)});gf=b("ZodNever",(e,t)=>{Cl.init(e,t),B.init(e,t),e._zod.processJSONSchema=(n,r,o)=>dc(e,n,r,o)});hf=b("ZodVoid",(e,t)=>{Al.init(e,t),B.init(e,t),e._zod.processJSONSchema=(n,r,o)=>pc(e,n,r,o)});jr=b("ZodDate",(e,t)=>{Ol.init(e,t),B.init(e,t),e._zod.processJSONSchema=(n,r,o)=>hc(e,n,r,o),e.min=(n,r)=>e.check(Te(n,r)),e.max=(n,r)=>e.check(Ze(n,r))},E.derived({minDate:e=>{let{minimum:t}=de(e);return t?new Date(t):null},maxDate:e=>{let{maximum:t}=de(e);return t?new Date(t):null}},{}));yf=b("ZodArray",(e,t)=>{Bt(),El.init(e,t),B.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Pc(e,n,r,o),e.element=t.element},{min(e,t){return this.check(ot(e,t))},nonempty(e){return this.check(ot(1,e))},max(e,t){return this.check(jt(e,t))},length(e,t){return this.check(Mt(e,t))},unwrap(){return this.element}});Ur=b("ZodObject",(e,t)=>{Bt(),Zl.init(e,t),B.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Cc(e,n,r,o),E.installLazyProp(e,"shape",n=>n._zod.def.shape,!1)},{keyof(){return ss(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(E.mergeDefs(this._zod.def,{catchall:e}))},passthrough(){return this.clone(E.mergeDefs(this._zod.def,{catchall:Vt()}))},loose(){return this.clone(E.mergeDefs(this._zod.def,{catchall:Vt()}))},strict(){return this.clone(E.mergeDefs(this._zod.def,{catchall:is()}))},strip(){return this.clone(E.mergeDefs(this._zod.def,{catchall:void 0}))},extend(e){return E.extend(this,e)},safeExtend(e){return E.safeExtend(this,e)},merge(e){return E.merge(this,e)},pick(e){return E.pick(this,e)},omit(e){return E.omit(this,e)},partial(...e){return E.partial(Fr,this,e[0])},exactPartial(...e){return E.partial(ls,this,e[0],"exactPartial")},required(...e){return E.required(us,this,e[0])}});Vr=b("ZodUnion",(e,t)=>{wr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Oi(e,n,r,o),e.options=t.options});bf=b("ZodXor",(e,t)=>{Vr.init(e,t),Tl.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Oi(e,n,r,o),e.options=t.options});wf=b("ZodDiscriminatedUnion",(e,t)=>{Vr.init(e,t),Dl.init(e,t)});vf=b("ZodIntersection",(e,t)=>{Ll.init(e,t),B.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Ac(e,n,r,o)});_f=b("ZodTuple",(e,t)=>{Bt(),Bo.init(e,t),B.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Oc(e,n,r,o)},{rest(e){return this.clone({...this._zod.def,rest:e})},partial(){let e=this._zod.def;if(e.checks?.length)throw new Error(".partial() cannot be used on tuple schemas containing refinements");return this.clone({...e,items:e.items.map(t=>new Fr({type:"optional",innerType:t}))})}});Rn=b("ZodRecord",(e,t)=>{Bt(),jl.init(e,t),B.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Nc(e,n,r,o),e.keyType=t.keyType,e.valueType=t.valueType});Sf=b("ZodMap",(e,t)=>{Bt(),Ml.init(e,t),B.init(e,t),e._zod.processJSONSchema=(n,r,o)=>zc(e,n,r,o),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...n)=>e.check(Ge(...n)),e.nonempty=n=>e.check(Ge(1,n)),e.max=(...n)=>e.check(ht(...n)),e.size=(...n)=>e.check(Lt(...n))});zf=b("ZodSet",(e,t)=>{Bt(),Ul.init(e,t),B.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Ic(e,n,r,o),e.min=(...n)=>e.check(Ge(...n)),e.nonempty=n=>e.check(Ge(1,n)),e.max=(...n)=>e.check(ht(...n)),e.size=(...n)=>e.check(Lt(...n))});Dn=b("ZodEnum",(e,t)=>{Vl.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,i)=>yc(e,r,o,i),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(r,o)=>{let i={};for(let s of r)if(n.has(s))i[s]=t.entries[s];else throw new Error(`Key ${s} not found in enum`);return new Dn({...t,checks:[],...E.normalizeParams(o),entries:i})},e.exclude=(r,o)=>{let i={...t.entries};for(let s of r)if(n.has(s))delete i[s];else throw new Error(`Key ${s} not found in enum`);return new Dn({...t,checks:[],...E.normalizeParams(o),entries:i})}});If=b("ZodLiteral",(e,t)=>{Fl.init(e,t),B.init(e,t),e._zod.processJSONSchema=(n,r,o)=>bc(e,n,r,o),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});Pf=b("ZodFile",(e,t)=>{Bl.init(e,t),B.init(e,t),e._zod.processJSONSchema=(n,r,o)=>kc(e,n,r,o),e.min=(n,r)=>e.check(Ge(n,r)),e.max=(n,r)=>e.check(ht(n,r)),e.mime=(n,r)=>e.check(In(Array.isArray(n)?n:[n],r))});Cf=b("ZodTransform",(e,t)=>{Bt(),Hl.init(e,t),B.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Sc(e,n,r,o),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new dt(e.constructor.name);n.addIssue=i=>{if(typeof i=="string")n.issues.push(E.issue(i,n.value,t));else{let s=i;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),"input"in s||(s.input=n.value),s.inst??(s.inst=e),n.issues.push(E.issue(s))}};let o=t.transform(n.value,n);return o instanceof Promise?o.then(i=>(n.value=i,n)):(n.value=o,n)}});Fr=b("ZodOptional",(e,t)=>{Ho.init(e,t),B.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Ni(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});ls=b("ZodExactOptional",(e,t)=>{Wl.init(e,t),B.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Ni(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});Of=b("ZodNullable",(e,t)=>{Jl.init(e,t),B.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Ec(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});Nf=b("ZodDefault",(e,t)=>{Kl.init(e,t),B.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Rc(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});Zf=b("ZodPrefault",(e,t)=>{Gl.init(e,t),B.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Dc(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});us=b("ZodNonOptional",(e,t)=>{ql.init(e,t),B.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Zc(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});Df=b("ZodSuccess",(e,t)=>{Yl.init(e,t),B.init(e,t),e._zod.processJSONSchema=(n,r,o)=>_c(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});Lf=b("ZodCatch",(e,t)=>{Xl.init(e,t),B.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Lc(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});Mf=b("ZodNaN",(e,t)=>{Ql.init(e,t),B.init(e,t),e._zod.processJSONSchema=(n,r,o)=>wc(e,n,r,o)});Br=b("ZodPipe",(e,t)=>{Wo.init(e,t),B.init(e,t),e._zod.processJSONSchema=(n,r,o)=>jc(e,n,r,o),e.in=t.in,e.out=t.out});Hr=b("ZodCodec",(e,t)=>{Br.init(e,t),vr.init(e,t)});Uf=b("ZodPreprocess",(e,t)=>{Br.init(e,t),eu.init(e,t)}),Vf=b("ZodReadonly",(e,t)=>{tu.init(e,t),B.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Mc(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});Bf=b("ZodTemplateLiteral",(e,t)=>{nu.init(e,t),B.init(e,t),e._zod.processJSONSchema=(n,r,o)=>vc(e,n,r,o)});Hf=b("ZodLazy",(e,t)=>{kr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Vc(e,n,r,o),e.unwrap=()=>e._zod.def.getter()});Jf=b("ZodPromise",(e,t)=>{ou.init(e,t),B.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Uc(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});Kf=b("ZodFunction",(e,t)=>{ru.init(e,t),B.init(e,t),e._zod.processJSONSchema=(n,r,o)=>xc(e,n,r,o)});Wr=b("ZodCustom",(e,t)=>{iu.init(e,t),B.init(e,t),e._zod.processJSONSchema=(n,r,o)=>$c(e,n,r,o)});ag=Xu,lg=Qu,Yf=b("ZodInstanceOf",(e,t)=>{Wr.init(e,t)},{properties(e,t){return this.check(zn(e,t))}});cg=(...e)=>ec({Codec:Hr,Boolean:Mn,String:Ln},...e)});function av(e){se({customError:e})}function lv(){return se().customError}var sv,Xf,dg=K(()=>{Re();sv={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};Xf||(Xf={})});var Jr={};Ue(Jr,{ZodISODate:()=>kt,ZodISODateTime:()=>vt,ZodISODuration:()=>$t,ZodISOTime:()=>_t,date:()=>cv,datetime:()=>uv,duration:()=>pv,time:()=>fv});function uv(e){return Pr(vt,e)}function cv(e){return Cr(kt,e)}function fv(e){return Ar(_t,e)}function pv(e){return Or($t,e)}var cs=K(()=>{Re();xt();xt()});function mv(e,t){let n=e.$schema;return n==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":n==="http://json-schema.org/draft-07/schema#"?"draft-7":n==="http://json-schema.org/draft-04/schema#"?"draft-4":t??"draft-2020-12"}function mg(e,t){return e.map((n,r)=>r<t?n:n.optional())}function gv(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function hv(e,t){if(!e.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let n=e.slice(1).split("/").filter(Boolean);if(n.length===0)return t.rootSchema;let r=t.version==="draft-2020-12"?"$defs":"definitions";if(n[0]===r){let o=n[1]===void 0?void 0:gv(n[1]);if(!o||!t.defs[o])throw new Error(`Reference not found: ${e}`);return t.defs[o]}throw new Error(`Reference not found: ${e}`)}function yv(e,t){return O.transform(r=>r).check(r=>{let o=r.value;if(typeof o!="object"||o===null||Array.isArray(o))return;let i=Object.getOwnPropertyNames(o);if(t.minProperties!==void 0&&i.length<t.minProperties&&r.issues.push({origin:"object",code:"too_small",minimum:t.minProperties,inclusive:!0,message:`Too small: expected object to have >=${t.minProperties} properties`,input:o,inst:e,continue:!0}),t.maxProperties!==void 0&&i.length>t.maxProperties&&r.issues.push({origin:"object",code:"too_big",maximum:t.maxProperties,inclusive:!0,message:`Too big: expected object to have <=${t.maxProperties} properties`,input:o,inst:e,continue:!0}),t.keySchema)for(let s of i){let a=t.keySchema.safeParse(s);a.success||r.issues.push({code:"invalid_key",origin:"record",issues:a.error.issues,input:s,path:[s],continue:!0})}}).pipe(e)}function Qf(e,t){if(e===null)return"z";let n=typeof e;if(n!=="object"){if(n==="number"&&Number.isNaN(e))return null;let r=String(e);return`${n[0]}${r.length}:${r}`}if(t.has(e))return null;t.add(e);try{if(Array.isArray(e)){let i=[];for(let s of e){let a=Qf(s,t);if(a===null)return null;i.push(a)}return`a${i.length}:[${i.join(",")}]`}let r=Object.keys(e).sort(),o=[];for(let i of r){let s=Qf(e[i],t);if(s===null)return null;o.push(`${i.length}:${i}=${s}`)}return`o${o.length}:{${o.join(",")}}`}finally{t.delete(e)}}function Kr(e){return typeof e!="object"||e===null?!1:Array.isArray(e)?e.some(Kr):typeof e.$ref=="string"?!0:Object.entries(e).some(([t,n])=>bv.has(t)?Kr(n):!wv.has(t)||typeof n!="object"||n===null?!1:Object.values(n).some(Kr))}function gg(e){return e===1?"element":"elements"}function vv(e,t){return O.transform(r=>r).check(r=>{let o=r.value;if(Array.isArray(o)){if(t.uniqueItems===!0){let i=new Map;for(let s=0;s<o.length;s++){let a=Qf(o[s],new Set);if(a===null)continue;let l=i.get(a);if(l===void 0){i.set(a,s);continue}r.issues.push({code:"custom",message:`Array items must be unique: element at index ${s} duplicates the one at index ${l}`,input:o,path:[s],continue:!0})}}if(t.containsSchema){let i=t.minContains??1,s=t.maxContains!==void 0?t.maxContains+1:Number.POSITIVE_INFINITY,a=0;for(let l of o)if(t.containsSchema.safeParse(l).success&&++a>=s)break;a<i&&r.issues.push({code:"custom",message:`Array must contain at least ${i} matching ${gg(i)}; found ${a}`,input:o,continue:!0}),t.maxContains!==void 0&&a>t.maxContains&&r.issues.push({code:"custom",message:`Array must contain at most ${t.maxContains} matching ${gg(t.maxContains)}`,input:o,continue:!0})}}}).pipe(e)}function hg(e,t){if(e!==!1)return e===void 0||e===!0?O.any():ze(e,t)}function yg(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return O.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let o=e.$ref;if(t.refs.has(o))return t.refs.get(o);if(t.processing.has(o))return O.lazy(()=>{if(!t.refs.has(o))throw new Error(`Circular reference not resolved: ${o}`);return t.refs.get(o)});t.processing.add(o);let i=hv(o,t),s=ze(i,t);return t.refs.set(o,s),t.processing.delete(o),s}if(e.enum!==void 0){let o=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&o.length===1&&o[0]===null)return O.null();if(o.length===0)return O.never();if(o.length===1)return O.literal(o[0]);if(o.every(s=>typeof s=="string"))return O.enum(o);let i=o.map(s=>O.literal(s));return i.length<2?i[0]:O.union([i[0],i[1],...i.slice(2)])}if(e.const!==void 0)return O.literal(e.const);let n=e.type;if(Array.isArray(n)){let o=n.map(i=>{let s={...e,type:i};return yg(s,t)});return o.length===0?O.never():o.length===1?o[0]:O.union(o)}if(!n)return O.any();let r;switch(n){case"string":{let o=O.string();if(e.format){let i=e.format;i==="email"?o=o.check(O.email()):i==="uri"||i==="uri-reference"?o=o.check(O.url()):i==="uuid"||i==="guid"?o=o.check(O.uuid()):i==="date-time"?o=o.check(O.iso.datetime({offset:!0})):i==="date"?o=o.check(O.iso.date()):i==="time"?o=o.check(O.regex(kv)):i==="duration"?o=o.check(O.iso.duration()):i==="hostname"?o=o.check(O.hostname()):i==="ipv4"?o=o.check(O.ipv4()):i==="ipv6"?o=o.check(O.ipv6()):i==="mac"?o=o.check(O.mac()):i==="cidr"?o=o.check(O.cidrv4()):i==="cidr-v6"?o=o.check(O.cidrv6()):i==="base64"?o=o.check(O.base64()):i==="base64url"?o=o.check(O.base64url()):i==="e164"?o=o.check(O.e164()):i==="credit_card"?o=o.check(O.creditCard()):i==="iban"?o=o.check(O.iban()):i==="jwt"?o=o.check(O.jwt()):i==="emoji"?o=o.check(O.emoji()):i==="nanoid"?o=o.check(O.nanoid()):i==="cuid"?o=o.check(O.cuid()):i==="cuid2"?o=o.check(O.cuid2()):i==="ulid"?o=o.check(O.ulid()):i==="xid"?o=o.check(O.xid()):i==="ksuid"&&(o=o.check(O.ksuid()))}typeof e.minLength=="number"&&(o=o.min(e.minLength)),typeof e.maxLength=="number"&&(o=o.max(e.maxLength)),e.pattern&&(o=o.regex(new RegExp(e.pattern))),r=o;break}case"number":case"integer":{let o=n==="integer"?O.number().int():O.number();typeof e.minimum=="number"&&e.exclusiveMinimum!==!0&&(o=o.min(e.minimum)),typeof e.maximum=="number"&&e.exclusiveMaximum!==!0&&(o=o.max(e.maximum)),typeof e.exclusiveMinimum=="number"?o=o.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(o=o.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?o=o.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(o=o.lt(e.maximum)),typeof e.multipleOf=="number"&&(o=o.multipleOf(e.multipleOf)),r=o;break}case"boolean":{r=O.boolean();break}case"null":{r=O.null();break}case"object":{let o={},i=e.properties||{},s=new Set(e.required||[]),a=typeof e.additionalProperties=="object"?ze(e.additionalProperties,t):void 0;for(let[m,g]of Object.entries(i)){let d=ze(g,t);ge(o,m,s.has(m)?d:d.optional())}if(e.patternProperties){let m=e.patternProperties,g=Object.keys(m),d=[];for(let y of g){let w=ze(m[y],t),_=O.string().regex(new RegExp(y));d.push(O.looseRecord(_,w))}let h=[];if(Object.keys(o).length>0&&h.push(O.object(o).passthrough()),h.push(...d),h.length===0)r=O.object({}).passthrough();else if(h.length===1)r=h[0];else{let y=O.intersection(h[0],h[1]);for(let w=2;w<h.length;w++)y=O.intersection(y,h[w]);r=y}if(e.additionalProperties===!1){let y=Object.keys(o),w=g.map(v=>new RegExp(v)),_=r;r=r.check(v=>{if(!Le(v.value))return;let $=[];for(let z of Object.keys(v.value))y.includes(z)||w.some(R=>R.test(z))||$.push(z);$.length&&v.issues.push({code:"unrecognized_keys",keys:$,input:v.value,inst:_})})}}else{let m=O.object(o);e.additionalProperties===!1?r=m.strict():a?r=m.catchall(a):r=m.passthrough()}let l=e.propertyNames!==void 0&&e.propertyNames!==!0,u=typeof e.minProperties=="number"?e.minProperties:void 0,p=typeof e.maxProperties=="number"?e.maxProperties:void 0;if(l||u!==void 0||p!==void 0){let m;if(l){let g=typeof e.propertyNames=="object"&&e.propertyNames.type===void 0?{type:"string",...e.propertyNames}:e.propertyNames;m=ze(g,t)}r=yv(r,{keySchema:m,minProperties:u,maxProperties:p})}break}case"array":{let o=e.prefixItems,i=e.items;if(o&&Array.isArray(o)){let s=typeof e.minItems=="number"?e.minItems:0,a=o.map(m=>ze(m,t)),l=mg(a,s),u=Array.isArray(i)?void 0:hg(i,t),p=O.tuple(l);r=u?p.rest(u):p,typeof e.minItems=="number"&&(r=r.check(O.minLength(e.minItems))),typeof e.maxItems=="number"&&(r=r.check(O.maxLength(e.maxItems)))}else if(Array.isArray(i)){let s=typeof e.minItems=="number"?e.minItems:0,a=i.map(m=>ze(m,t)),l=mg(a,s),u=hg(e.additionalItems,t),p=O.tuple(l);r=u?p.rest(u):p,typeof e.minItems=="number"&&(r=r.check(O.minLength(e.minItems))),typeof e.maxItems=="number"&&(r=r.check(O.maxLength(e.maxItems)))}else if(i!==void 0){let s=ze(i,t),a=O.array(s);typeof e.minItems=="number"&&(a=a.min(e.minItems)),typeof e.maxItems=="number"&&(a=a.max(e.maxItems)),r=a}else r=O.array(O.any());(e.uniqueItems===!0||e.contains!==void 0)&&(r=vv(r,{uniqueItems:e.uniqueItems===!0,containsSchema:e.contains!==void 0?ze(e.contains,t):void 0,minContains:typeof e.minContains=="number"?e.minContains:void 0,maxContains:typeof e.maxContains=="number"?e.maxContains:void 0}));break}default:throw new Error(`Unsupported type: ${n}`)}return r}function ze(e,t){if(typeof e=="boolean")return e?O.any():O.never();let n=yg(e,t),r=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let a=e.anyOf.map(u=>ze(u,t)),l=O.union(a);n=r?O.intersection(n,l):l}if(e.oneOf&&Array.isArray(e.oneOf)){let a=e.oneOf.map(u=>ze(u,t)),l=O.xor(a);n=r?O.intersection(n,l):l}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)n=r?n:O.any();else{let a=r?n:ze(e.allOf[0],t),l=r?0:1;for(let u=l;u<e.allOf.length;u++)a=O.intersection(a,ze(e.allOf[u],t));n=a}e.nullable===!0&&t.version==="openapi-3.0"&&(n=O.nullable(n)),e.readOnly===!0&&(n=O.readonly(n)),e.default!==void 0&&(n=n.default(e.default));let o={},i=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let a of i)a in e&&(o[a]=e[a]);let s=["contentEncoding","contentMediaType","contentSchema"];for(let a of s)a in e&&(o[a]=e[a]);if(e.type==="object"&&e.$ref===void 0){e.propertyNames!==void 0&&!Kr(e.propertyNames)&&(o.propertyNames=e.propertyNames);for(let a of["minProperties","maxProperties"])e[a]!==void 0&&(o[a]=e[a])}if(e.type==="array"&&e.$ref===void 0){e.contains!==void 0&&!Kr(e.contains)&&(o.contains=e.contains);for(let a of["uniqueItems","minContains","maxContains"])e[a]!==void 0&&(o[a]=e[a])}for(let a of Object.keys(e))dv.has(a)||ge(o,a,e[a]);return Object.keys(o).length>0&&t.registry.add(n,o),e.description&&(n=n.describe(e.description)),n}function bg(e,t){if(typeof e=="boolean")return e?O.any():O.never();let n;try{n=JSON.parse(JSON.stringify(e))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let r=mv(n,t?.defaultTarget),o=n.$defs||n.definitions||{},i={version:r,defs:o,refs:new Map,processing:new Set,rootSchema:n,registry:t?.registry??he};return ze(n,i)}var O,dv,bv,wv,kv,wg=K(()=>{zr();le();Ri();cs();xt();O={...Fn,...Ti,iso:Jr},dv=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);bv=new Set(["items","prefixItems","additionalItems","additionalProperties","contains","propertyNames","not","if","then","else","allOf","anyOf","oneOf","unevaluatedItems","unevaluatedProperties","contentSchema"]),wv=new Set(["properties","patternProperties","dependentSchemas","dependencies","$defs","definitions"]);kv=/^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/});function Gr(e,t){let n=typeof t=="function"?t:(s,a)=>{let l=t[s._zod.def.type];return l?l(s,a):s},r=new Map;function o(s){let a=r.get(s);if(a===vg)return new kr({type:"lazy",getter:()=>r.get(s)});if(a!==void 0)return a;r.set(s,vg);let l=i(s),u=n(l,l!==s);return r.set(s,u),u}function i(s){let a=s._zod.def,l=a.type;switch(l){case"object":{let u=a.shape,p=Object.keys(u),m=!1,g={};for(let h of p){let y=o(u[h]);y!==u[h]&&(m=!0),g[h]=y}let d=a.catchall;return a.catchall&&(d=o(a.catchall),d!==a.catchall&&(m=!0)),m?q(s,{...a,shape:g,catchall:d}):s}case"array":{let u=o(a.element);return u===a.element?s:q(s,{...a,element:u})}case"tuple":{let u=a.items,p=!1,m=[];for(let d of u){let h=o(d);h!==d&&(p=!0),m.push(h)}let g=a.rest;return a.rest&&(g=o(a.rest),g!==a.rest&&(p=!0)),p?q(s,{...a,items:m,rest:g}):s}case"record":case"map":{let u=o(a.keyType),p=o(a.valueType);return u===a.keyType&&p===a.valueType?s:q(s,{...a,keyType:u,valueType:p})}case"set":{let u=o(a.valueType);return u===a.valueType?s:q(s,{...a,valueType:u})}case"union":{let u=a.options,p=!1,m=[];for(let g of u){let d=o(g);d!==g&&(p=!0),m.push(d)}return p?q(s,{...a,options:m}):s}case"intersection":{let u=o(a.left),p=o(a.right);return u===a.left&&p===a.right?s:q(s,{...a,left:u,right:p})}case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":{let u=o(a.innerType);return u===a.innerType?s:q(s,{...a,innerType:u})}case"pipe":{let u=o(a.in),p=o(a.out);return u===a.in&&p===a.out?s:q(s,{...a,in:u,out:p})}case"function":{let u=o(a.input),p=o(a.output);return u===a.input&&p===a.output?s:q(s,{...a,input:u,output:p})}case"lazy":{let u=a.getter,{_cachedInner:p,...m}=a;return q(s,{...m,getter:()=>o(u())})}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":return s;default:return s}}return o(e)}var vg,ep=K(()=>{yn();le();vg=Symbol("z.visit/resolving")});function kg(e){return Gr(e,{object:t=>t.partial(),union:t=>{let n=t._zod.def;return n.discriminator===void 0?t:Vn(n.options)}})}var _g=K(()=>{ep();xt()});function _v(e,t){if(!t?.length)return e;let n=e._zod.def;return q(e,Ve(n,{checks:[...n.checks??[],...t]}),{parent:!0})}function $g(e){return _v(e.out,e.checks)}function $v(e){return e.in._zod.traits.has("$ZodTransform")?$g(e):e.in}function xg(e){return Gr(e,{pipe:t=>$v(t._zod.def),default:(t,n)=>n?Ft(t._zod.def.innerType):t,catch:(t,n)=>n?t._zod.def.innerType:t})}function Sg(e){return Gr(e,{pipe:t=>$g(t._zod.def),prefault:(t,n)=>n?t._zod.def.innerType:t})}var zg=K(()=>{le();ep();xt()});var tp={};Ue(tp,{bigint:()=>Iv,boolean:()=>zv,date:()=>Pv,number:()=>Sv,string:()=>xv});function xv(e){return wu(Ln,e)}function Sv(e){return Su(jn,e)}function zv(e){return Nu(Mn,e)}function Iv(e){return Zu(Un,e)}function Pv(e){return Hu(jr,e)}var Ig=K(()=>{Re();xt()});var f={};Ue(f,{$brand:()=>Zs,$input:()=>fu,$output:()=>cu,INVALID:()=>xe,NEVER:()=>Es,TimePrecision:()=>$u,ZodAny:()=>df,ZodArray:()=>yf,ZodBase64:()=>es,ZodBase64URL:()=>ts,ZodBigInt:()=>Un,ZodBigIntFormat:()=>os,ZodBoolean:()=>Mn,ZodCIDRv4:()=>Xi,ZodCIDRv6:()=>Qi,ZodCUID:()=>Hi,ZodCUID2:()=>Wi,ZodCatch:()=>Lf,ZodCodec:()=>Hr,ZodCompileAsyncError:()=>Fe,ZodCompileUnsupportedError:()=>J,ZodCreditCard:()=>of,ZodCustom:()=>Wr,ZodCustomStringFormat:()=>Ht,ZodDate:()=>jr,ZodDefault:()=>Nf,ZodDiscriminatedUnion:()=>wf,ZodE164:()=>ns,ZodEmail:()=>Ui,ZodEmoji:()=>Fi,ZodEnum:()=>Dn,ZodError:()=>rv,ZodExactOptional:()=>ls,ZodFile:()=>Pf,ZodFirstPartyTypeKind:()=>Xf,ZodFunction:()=>Kf,ZodGUID:()=>Vi,ZodIBAN:()=>sf,ZodIPv4:()=>qi,ZodIPv6:()=>Yi,ZodISODate:()=>kt,ZodISODateTime:()=>vt,ZodISODuration:()=>$t,ZodISOTime:()=>_t,ZodInstanceOf:()=>Yf,ZodIntersection:()=>vf,ZodIssueCode:()=>sv,ZodJWT:()=>rs,ZodKSUID:()=>Gi,ZodLazy:()=>Hf,ZodLiteral:()=>If,ZodMAC:()=>rf,ZodMap:()=>Sf,ZodNaN:()=>Mf,ZodNanoID:()=>Bi,ZodNever:()=>gf,ZodNonOptional:()=>us,ZodNull:()=>ff,ZodNullable:()=>Of,ZodNumber:()=>jn,ZodNumberFormat:()=>Wt,ZodObject:()=>Ur,ZodOptional:()=>Fr,ZodPipe:()=>Br,ZodPrefault:()=>Zf,ZodPreprocess:()=>Uf,ZodPromise:()=>Jf,ZodReadonly:()=>Vf,ZodRealError:()=>Ne,ZodRecord:()=>Rn,ZodSet:()=>zf,ZodString:()=>Ln,ZodStringFormat:()=>Q,ZodSuccess:()=>Df,ZodSymbol:()=>uf,ZodTemplateLiteral:()=>Bf,ZodTransform:()=>Cf,ZodTuple:()=>_f,ZodType:()=>B,ZodULID:()=>Ji,ZodURL:()=>Lr,ZodUUID:()=>qe,ZodUndefined:()=>cf,ZodUnion:()=>Vr,ZodUnknown:()=>mf,ZodVoid:()=>hf,ZodXID:()=>Ki,ZodXor:()=>bf,_ZodString:()=>Mi,_default:()=>Ef,_function:()=>og,any:()=>Tm,array:()=>Mr,base64:()=>gm,base64url:()=>hm,bigint:()=>Am,boolean:()=>lf,catch:()=>jf,check:()=>ig,cidrv4:()=>dm,cidrv6:()=>mm,clone:()=>q,codec:()=>eg,coerce:()=>tp,compile:()=>gu,config:()=>se,core:()=>it,creditCard:()=>bm,cuid:()=>im,cuid2:()=>sm,currencyCode:()=>xm,custom:()=>sg,date:()=>Dm,decode:()=>Gc,decodeAsync:()=>Yc,deepPartial:()=>kg,describe:()=>ag,discriminatedUnion:()=>Fm,e164:()=>ym,email:()=>Gd,emoji:()=>rm,encode:()=>Kc,encodeAsync:()=>qc,endsWith:()=>Sn,enum:()=>ss,exactOptional:()=>Af,file:()=>qm,flattenError:()=>ir,float32:()=>zm,float64:()=>Im,formatError:()=>sr,fromJSONSchema:()=>bg,function:()=>og,getDiscriminatedOption:()=>Rl,getErrorMap:()=>lv,globalRegistry:()=>he,gt:()=>Ke,gte:()=>Te,guid:()=>qd,hash:()=>Sm,hex:()=>$m,hostname:()=>_m,httpUrl:()=>nm,iban:()=>wm,includes:()=>$n,input:()=>xg,instanceof:()=>ug,int:()=>Li,int32:()=>Pm,int64:()=>Om,intersection:()=>kf,invertCodec:()=>tg,ipv4:()=>cm,ipv6:()=>pm,iso:()=>Jr,json:()=>fg,jwt:()=>vm,keyof:()=>Lm,ksuid:()=>um,lazy:()=>Wf,length:()=>Mt,literal:()=>Gm,locales:()=>Sr,looseObject:()=>Um,looseRecord:()=>Hm,lowercase:()=>kn,lt:()=>Je,lte:()=>Ze,mac:()=>fm,map:()=>Wm,maxLength:()=>jt,maxSize:()=>ht,memoizer:()=>xr,meta:()=>lg,mime:()=>In,minLength:()=>ot,minSize:()=>Ge,multipleOf:()=>gt,nan:()=>Qm,nanoid:()=>om,nativeEnum:()=>Km,negative:()=>zi,never:()=>is,nonnegative:()=>Pi,nonoptional:()=>Rf,nonpositive:()=>Ii,normalize:()=>Pn,null:()=>pf,nullable:()=>Dr,nullish:()=>Ym,number:()=>af,object:()=>jm,optional:()=>Ft,output:()=>Sg,overwrite:()=>Be,parse:()=>Bc,parseAsync:()=>Hc,partialRecord:()=>Bm,pipe:()=>ji,positive:()=>Si,prefault:()=>Tf,preprocess:()=>pg,prettifyError:()=>js,promise:()=>rg,properties:()=>zn,property:()=>Ci,readonly:()=>Ff,record:()=>xf,refine:()=>Gf,regex:()=>vn,regexes:()=>Me,registry:()=>ei,safeDecode:()=>Qc,safeDecodeAsync:()=>tf,safeEncode:()=>Xc,safeEncodeAsync:()=>ef,safeParse:()=>Wc,safeParseAsync:()=>Jc,set:()=>Jm,setErrorMap:()=>av,size:()=>Lt,slugify:()=>Nn,startsWith:()=>xn,strictObject:()=>Mm,string:()=>Rr,stringFormat:()=>km,stringbool:()=>cg,success:()=>Xm,superRefine:()=>qf,symbol:()=>Em,templateLiteral:()=>ng,toJSONSchema:()=>Ei,toLowerCase:()=>An,toUpperCase:()=>On,toZod:()=>Gn,transform:()=>as,treeifyError:()=>Ls,trim:()=>Cn,tuple:()=>$f,uint32:()=>Cm,uint64:()=>Nm,ulid:()=>am,undefined:()=>Zm,union:()=>Vn,unknown:()=>Vt,uppercase:()=>_n,url:()=>tm,util:()=>E,uuid:()=>Yd,uuidv4:()=>Xd,uuidv6:()=>Qd,uuidv7:()=>em,validate:()=>ar,validateAsync:()=>lr,void:()=>Rm,withParser:()=>ti,xid:()=>lm,xor:()=>Vm});var np=K(()=>{Re();xt();Ri();Fc();nf();dg();Re();Tr();wg();_g();zg();uu();cs();cs();Ig()});var Pg=K(()=>{np();np()});var Tg={};Ue(Tg,{TYPERT:()=>Sk,TYPERT_REMOTE:()=>xk,default:()=>xk});var Cv,Av,Ov,Ag,we,Nv,Ev,Zv,Tv,Rv,Dv,Lv,jv,Og,Mv,Uv,Vv,Fv,Bv,Hv,Wv,Jv,Kv,Gv,qv,Yv,Xv,Qv,ek,tk,nk,rk,Ng,fs,ok,ik,Cg,sk,ak,lk,uk,ck,fk,pk,dk,mk,gk,hk,yk,bk,wk,rp,Eg,oe,vk,kk,_k,G,qr,$k,Zg,xk,Sk,Rg=K(()=>{Pg();Cv=f.union([f.literal(null),f.literal("pending"),f.literal("loading"),f.literal("active"),f.literal("failed"),f.literal("unloading")]),Av=f.union([f.literal("core"),f.literal("recommended"),f.literal("optional")]),Ov=f.object({entryId:f.string(),configId:f.string(),moduleName:f.string(),packageName:f.string(),description:f.string(),necessity:Av,enabled:f.boolean(),phase:Cv,error:f.string().nullable(),protected:f.boolean(),protectionReason:f.string().nullable(),archived:f.boolean(),origin:f.union([f.literal("builtin"),f.literal("user")]),source:f.union([f.literal("builtin"),f.literal("local"),f.literal("github"),f.literal("npm")]),sourceOverride:f.union([f.literal("builtin"),f.literal("local"),f.literal("github"),f.literal("npm")]).nullable(),installedVersion:f.string().nullable(),latestVersion:f.string().nullable(),updateSource:f.string().nullable(),needsUpdate:f.boolean().nullable(),managed:f.boolean()}).readonly(),Ag=f.object({name:f.string(),url:f.string(),enabled:f.boolean(),official:f.boolean(),type:f.union([f.literal("registry"),f.literal("github"),f.literal("dshfind")])}).readonly(),we=f.object({profileName:f.string(),entries:f.array(Ov).readonly(),sources:f.array(Ag).readonly()}).readonly(),Nv=f.object({entryId:f.string(),status:f.union([f.literal("changed"),f.literal("restart-required"),f.literal("unchanged"),f.literal("skipped"),f.literal("failed")]),message:f.string().nullable()}).readonly(),Ev=f.object({enabled:f.boolean(),items:f.array(Nv).readonly(),snapshot:we}).readonly(),Zv=f.object({packageName:f.string(),status:f.union([f.literal("updated"),f.literal("failed"),f.literal("up-to-date"),f.literal("not-managed")]),message:f.string().nullable(),installedVersion:f.string().nullable(),latestVersion:f.string().nullable()}).readonly(),Tv=f.object({items:f.array(Zv).readonly(),snapshot:we}).readonly(),Rv=f.object({entryId:f.string(),configId:f.string(),moduleName:f.string(),phase:f.string().nullable(),error:f.string().nullable(),suggestion:f.union([f.literal("disable"),f.literal("uninstall"),f.literal("none")]),canUninstall:f.boolean()}).readonly(),Dv=f.object({issues:f.array(Rv).readonly(),snapshot:we}).readonly(),Lv=f.object({entryId:f.string(),status:f.union([f.literal("disabled"),f.literal("failed"),f.literal("skipped")]),message:f.string().nullable()}).readonly(),jv=f.object({items:f.array(Lv).readonly(),snapshot:we}).readonly(),Og=f.object({action:f.string(),detail:f.string()}).readonly(),Mv=f.object({actions:f.array(Og).readonly(),restartCommand:f.string(),snapshot:we}).readonly(),Uv=f.object({accepted:f.boolean(),message:f.string()}).readonly(),Vv=f.object({status:f.union([f.literal("cleaned"),f.literal("skipped"),f.literal("failed"),f.literal("timeout")]),exitCode:f.number().nullable(),message:f.string(),command:f.string().nullable()}).readonly(),Fv=f.object({packageName:f.string(),status:f.union([f.literal("removed"),f.literal("rolled-back"),f.literal("failed"),f.literal("not-managed")]),message:f.string().nullable(),affectedEntries:f.array(f.string()).readonly(),removedPatchRows:f.number(),dependentPackages:f.array(f.string()).readonly(),verifyOk:f.boolean().nullable(),residuals:f.array(f.string()).readonly(),backupPath:f.string().nullable(),isSelf:f.boolean(),autostartCleanup:Vv.nullable()}).readonly(),Bv=f.object({items:f.array(Fv).readonly(),snapshot:we}).readonly(),Hv=f.object({configId:f.string(),moduleName:f.string(),enabled:f.boolean()}).readonly(),Wv=f.object({packageName:f.string(),type:f.string(),spec:f.string()}).readonly(),Jv=f.object({id:f.string(),severity:f.union([f.literal("info"),f.literal("warning"),f.literal("high")]),title:f.string(),detail:f.string()}).readonly(),Kv=f.union([f.literal("safe"),f.literal("caution"),f.literal("risky")]),Gv=f.object({packageName:f.string(),spec:f.string().nullable(),inBundles:f.boolean(),patchRows:f.number(),affectedEntries:f.array(Hv).readonly(),dependents:f.array(Wv).readonly(),isSelf:f.boolean(),checks:f.array(Jv).readonly(),verdict:Kv,verdictReason:f.string(),canUninstall:f.boolean()}).readonly(),qv=f.object({packages:f.array(Gv).readonly()}).readonly(),Yv=f.object({confirm:f.boolean().default(!1)}).readonly(),Xv=f.object({cascade:f.boolean().default(!1)}).readonly(),Qv=f.object({configId:f.string(),moduleName:f.string(),enabled:f.boolean()}).readonly(),ek=f.object({type:f.union([f.literal("restore-files"),f.literal("patch-state")]),manifest:f.string().nullable(),patch:f.string().nullable(),packageName:f.string().nullable(),spec:f.string().nullable(),changes:f.array(Qv).readonly()}).readonly(),tk=f.object({id:f.string(),at:f.string(),action:f.string(),label:f.string(),detail:f.string().nullable(),result:f.union([f.literal("ok"),f.literal("failed")]),undone:f.boolean(),undo:ek.nullable()}).readonly(),nk=f.object({operations:f.array(tk).readonly()}).readonly(),rk=f.object({ok:f.boolean(),message:f.string(),snapshot:we}).readonly(),Ng=f.object({id:f.string(),name:f.string(),createdAt:f.string(),updatedAt:f.string(),states:f.record(f.string(),f.boolean()),counts:f.object({enabled:f.number(),disabled:f.number()})}).readonly(),fs=f.object({scenarios:f.array(Ng).readonly()}).readonly(),ok=f.object({configId:f.string(),moduleName:f.string(),enabled:f.boolean(),current:f.boolean(),changed:f.boolean(),protected:f.boolean(),reason:f.string().nullable(),status:f.union([f.literal("none"),f.literal("changed"),f.literal("skipped"),f.literal("failed")]).nullable()}).readonly(),ik=f.object({items:f.array(ok).readonly(),scenarios:f.array(Ng).readonly(),snapshot:we}).readonly(),Cg=f.object({autoQuarantine:f.boolean()}).readonly(),sk=f.object({dir:f.string()}).readonly(),ak=f.object({name:f.string(),message:f.string().nullable()}).readonly(),lk=f.object({installed:f.array(f.string()).readonly(),failed:f.array(ak).readonly(),message:f.string().nullable()}).readonly(),uk=f.object({url:f.string().nullable(),message:f.string().nullable(),sourceName:f.string().nullable(),installedVersion:f.string().nullable(),latestVersion:f.string().nullable()}).readonly(),ck=f.object({packageName:f.string(),status:f.union([f.literal("need-download"),f.literal("up-to-date"),f.literal("not-managed"),f.literal("failed")]),url:f.string().nullable(),sourceName:f.string().nullable(),installedVersion:f.string().nullable(),latestVersion:f.string().nullable(),message:f.string().nullable()}).readonly(),fk=f.object({items:f.array(ck).readonly(),snapshot:we}).readonly(),pk=f.object({kind:f.string(),name:f.string(),reason:f.string()}).readonly(),dk=f.object({ok:f.boolean(),issues:f.array(pk).readonly()}).readonly(),mk=f.object({ok:f.boolean(),actions:f.array(Og).readonly(),message:f.string().nullable()}).readonly(),gk=f.object({name:f.string(),npm:f.string().nullable(),url:f.string()}).readonly(),hk=f.object({name:f.string(),owner:f.string(),url:f.string(),npm:f.string().nullable(),category:f.string(),description:f.record(f.string(),f.string().nullable()).nullable(),stars:f.number().nullable(),added:f.string().nullable()}).readonly(),yk=f.object({source:f.string(),updated:f.string().nullable(),count:f.number(),categories:f.record(f.string(),f.record(f.string(),f.string())).nullable(),items:f.array(hk).readonly()}).readonly(),bk=f.object({status:f.union([f.literal("installed"),f.literal("dry-run"),f.literal("failed"),f.literal("already-installed")]),packageName:f.string().nullable(),url:f.string().nullable(),method:f.string().nullable(),message:f.string().nullable()}).readonly(),wk=f.object({targetVersion:f.string(),currentVersion:f.string(),channel:f.string(),phase:f.string(),decision:f.string().nullable(),stagedFile:f.string().nullable(),source:f.string().nullable(),fetchedAt:f.string().nullable()}).readonly(),rp=f.object({ok:f.boolean(),message:f.string(),currentVersion:f.string(),channel:f.string(),form:f.string(),canApply:f.boolean(),pending:wk.nullable(),prompt:f.string()}).readonly(),Eg=(e,t)=>({mode:"strict",typeSymbol:e,schema:t,create:()=>t}),oe=(e,t)=>({name:e,wire:e,source:"json",codec:Eg(`dsh-drydock/types#${e}`,t)}),vk=new Set(["list","refresh","getSources","setSources","resetToggles","setRescueConfig","setSourceOverride"]),kk=new Set(["setEnabled","quarantine","uninstallPackages","update"]),_k={diagnose:"PluginManagerDiagnoseResult",repairHarness:"PluginManagerRepairResult",restartHarness:"PluginManagerRestartResult",getRescueConfig:"PluginManagerRescueConfig",getDownloadConfig:"PluginManagerDownloadConfig",checkDownloads:"PluginManagerCheckDownloadsResult",resolveDownloadUrl:"PluginManagerDownloadUrlResult",verifyProfile:"PluginManagerVerifyResult",fixProfile:"PluginManagerFixResult",updateBrowser:"PluginManagerBrowserReceipt",marketCatalog:"PluginManagerMarketCatalogResult",marketInstall:"PluginManagerMarketInstallResult",uninstallPreview:"PluginManagerUninstallPreviewResult",operationHistory:"PluginManagerHistoryResult",undoOperation:"PluginManagerUndoResult",scenarioList:"PluginManagerScenarioListResult",scenarioSave:"PluginManagerScenarioListResult",scenarioUpdate:"PluginManagerScenarioListResult",scenarioDelete:"PluginManagerScenarioListResult",scenarioApply:"PluginManagerScenarioApplyResult",selfUpdateStatus:"PluginManagerSelfUpdateStatus",selfUpdatePrepare:"PluginManagerSelfUpdateStatus",selfUpdateDecide:"PluginManagerSelfUpdateStatus"},G=(e,t,n)=>({id:`dsh-drydock#pluginManagerPro/${e}`,service:"pluginManagerPro",namespace:"pluginManagerPro",method:e,invocation:{kind:"direct"},parameters:t,result:Eg(`dsh-drydock/types#${vk.has(e)?"PluginManagerSnapshot":kk.has(e)?e==="quarantine"?"PluginManagerQuarantineReceipt":e==="uninstallPackages"?"PluginManagerUninstallReceipt":"PluginManagerMutationReceipt":_k[e]??"PluginManagerMutationReceipt"}`,n)}),qr=500,$k=50,Zg=[G("list",[],we),G("refresh",[],we),G("getSources",[],we),G("setSources",[oe("sources",f.array(Ag).max($k)),oe("options",Yv.nullable())],we),G("setEnabled",[oe("entryId",f.string()),oe("enabled",f.boolean())],Ev),G("resetToggles",[],we),G("update",[oe("packageNames",f.array(f.string()).max(qr))],Tv),G("diagnose",[],Dv),G("quarantine",[oe("entryIds",f.array(f.string()).max(qr))],jv),G("repairHarness",[],Mv),G("restartHarness",[],Uv),G("uninstallPackages",[oe("packageNames",f.array(f.string()).max(qr)),oe("options",Xv)],Bv),G("uninstallPreview",[oe("packageNames",f.array(f.string()).max(qr))],qv),G("operationHistory",[],nk),G("undoOperation",[oe("id",f.string())],rk),G("setSourceOverride",[oe("packageName",f.string()),oe("source",f.string().nullable())],we),G("scenarioList",[],fs),G("scenarioSave",[oe("name",f.string())],fs),G("scenarioUpdate",[oe("id",f.string())],fs),G("scenarioDelete",[oe("id",f.string())],fs),G("scenarioApply",[oe("id",f.string()),oe("dryRun",f.boolean())],ik),G("getRescueConfig",[],Cg),G("setRescueConfig",[oe("config",Cg)],we),G("getDownloadConfig",[],sk),G("checkDownloads",[],lk),G("resolveDownloadUrl",[oe("packageName",f.string())],uk),G("verifyProfile",[],dk),G("fixProfile",[],mk),G("updateBrowser",[oe("packageNames",f.array(f.string()).max(qr))],fk),G("marketCatalog",[],yk),G("marketInstall",[oe("target",gk),oe("dryRun",f.boolean())],bk),G("selfUpdateStatus",[],rp),G("selfUpdatePrepare",[],rp),G("selfUpdateDecide",[oe("decision",f.string())],rp)],xk={package:"dsh-drydock",descriptors:Zg},Sk={package:"dsh-drydock",face:"host",schemas:[],invocations:Zg,model:{services:[],events:[],objects:[]}}});var Fk={};Ue(Fk,{OfficialPluginsPanel:()=>sh,PluginManagerTab:()=>qg,SEARCH_DEBOUNCE_MS:()=>Kg,VISIBLE_ROWS_INITIAL:()=>ap,VISIBLE_ROWS_STEP:()=>Wg,apply:()=>Vk,configSurfacesFor:()=>Jg,entryInstalled:()=>th,inject:()=>Uk,marketFilterItems:()=>nh,sectionKeyOfEntry:()=>lp,shouldDebounceSearch:()=>Gg});module.exports=Fh(Fk);var Kt=Vh(require("react"),1),c=require("react/jsx-runtime"),{useEffect:Ie,useMemo:Bn,useState:N,useSyncExternalStore:Hg}=Kt,Yr="settings.pluginManagerPro",st={red:"#ef4444",yellow:"#f59e0b",green:"#22c55e",blue:"#4f8cff",grey:"#9ca3af"},zk={error:{color:st.red,key:"statusError"},update:{color:st.yellow,key:"statusUpdate"},disabled:{color:st.grey,key:"statusDisabled"},enabled:{color:st.green,key:"statusEnabled"}},op={core:{color:st.red,key:"necessityCore"},builtin:{color:st.blue,key:"necessityBuiltin"},user:{color:st.green,key:"necessityUser"}},Dg=["core","builtin","user"],ap=80,Wg=80,Ik=new Set(["@deepseek-ai/dsh-base","@deepseek-ai/dsh-web-app"]),Pk=new Set(["@caob23/dsh-browser-control"]),Lg="dsh-drydock",Ck="drydock";function lp(e){let t=e?.section;if(t==="core"||t==="builtin"||t==="user")return t;let n=String(e?.packageName??e?.moduleName??e?.configId??"").toLocaleLowerCase();return Ik.has(n)?"core":e?.origin==="user"?"user":"builtin"}function Ak(e){let t=String(e?.packageName??e?.moduleName??e?.configId??"").toLocaleLowerCase();return Pk.has(t)}var Ok=Object.freeze({rows:Object.freeze([]),bundles:Object.freeze([])}),ip=Object.freeze({getSnapshot:()=>Ok,subscribe:()=>()=>{}}),Nk=Object.freeze([]),sp=Object.freeze({getSnapshot:()=>Nk,subscribe:()=>()=>{}});function Jg(e,t){if(e==null||t===null||t===void 0)return{rows:[],bundles:[]};let n=[e.packageName,e.moduleName,e.configId].filter(i=>typeof i=="string"&&i!=="").map(i=>i.toLocaleLowerCase());if(n.length===0)return{rows:[],bundles:[]};let r=[];for(let i of t.rows??[]){if(typeof i!="string")continue;let s=i.lastIndexOf("#");s<=0||n.includes(i.slice(0,s).toLocaleLowerCase())&&r.push({key:i,rowId:i.slice(s+1)})}r.sort((i,s)=>i.key.localeCompare(s.key));let o=[];for(let i of t.bundles??[])typeof i!="string"||i===""||n.includes(i.toLocaleLowerCase())&&o.push({key:i});return o.sort((i,s)=>i.key.localeCompare(s.key)),{rows:r,bundles:o}}function Ek(e){return e.phase==="failed"||e.error?"error":e.needsUpdate===!0?"update":e.enabled?"enabled":"disabled"}function jg(e){return typeof e!="string"?e:/EBUSY|EPERM|EACCES|resource busy|used by another process/i.test(e)?`${e} \u2014\u2014 \u6587\u4EF6\u53EF\u80FD\u88AB\u5360\u7528\uFF1A\u8BF7\u5173\u95ED\u6B63\u5728\u4F7F\u7528\u8BE5\u76EE\u5F55\u7684\u7A0B\u5E8F\uFF08\u7EC8\u7AEF / \u7F16\u8F91\u5668 / \u6740\u6BD2\u626B\u63CF\uFF09\u540E\u91CD\u8BD5\uFF0C\u5FC5\u8981\u65F6\u91CD\u542F\u5F15\u64CE\u518D\u8BD5\u3002`:e}var Kg=120;function Gg(e,t){return e!==t}function Zk({onReveal:e}){let t=Kt.useRef(null),n=Kt.useRef(e);return Ie(()=>{n.current=e}),Ie(()=>{if(typeof IntersectionObserver!="function")return;let r=t.current;if(r==null)return;let o=null;try{o=new IntersectionObserver(i=>{i.some(s=>s.isIntersecting)&&n.current()},{rootMargin:"600px"}),o.observe(r)}catch{o=null}return()=>{try{o?.disconnect()}catch{}}},[]),(0,c.jsx)("li",{ref:t,"aria-hidden":"true",style:{height:1,margin:0,padding:0,listStyle:"none"}})}function qg({list:e,refresh:t,setEnabled:n,update:r,setSources:o,resetToggles:i,diagnose:s,quarantine:a,repairHarness:l,restartHarness:u,uninstallPackages:p,uninstallPreview:m,operationHistory:g,undoOperation:d,setSourceOverride:h,scenarioList:y,scenarioSave:w,scenarioUpdate:_,scenarioDelete:v,scenarioApply:$,getRescueConfig:z,setRescueConfig:R,getDownloadConfig:S,checkDownloads:M,updateBrowser:H,verifyProfile:He,fixProfile:L,marketCatalog:V,marketInstall:ve,selfUpdateStatus:ae,selfUpdatePrepare:Ee,selfUpdateDecide:Ye,t:I,embedded:We=!1,onlyUpdatable:at=!1,renderSlot:Xe,configSurfaces:lt}){let[Hn,k]=N(0),[T,ie]=N(!1),[Qe,Wn]=N(""),[qt,ah]=N(""),[St,ms]=N("all"),[lh,cp]=N({}),[uh,gs]=N(new Set(["core"])),[fp,ch]=N(!1),[pp,fh]=N(!1),[dp,mp]=N(!1),[gp,ph]=N(!1),[hp,dh]=N(!1),[De,yp]=N(null),[bp,mh]=N({q:"",n:0}),[wp,vp]=N(null),[Bk,Hk]=N(null),[ue,kp]=N(null),[zt,ne]=N(null),[ce,Yt]=N({status:"loading"}),[ye,Jn]=N({status:"idle",data:null,busy:null,message:null}),_p=Hg((lt??ip).subscribe,(lt??ip).getSnapshot,(lt??ip).getSnapshot),gh=typeof Xe=="function";Ie(()=>{let x=!0;return Yt({status:"loading"}),e().then(A=>{x&&Yt({status:"ready",snapshot:A})},A=>{x&&Yt({status:"error",message:A instanceof Error?A.message:String(A)})}),()=>{x=!1}},[e,Hn]);let hh=qt.trim()!=="";Ie(()=>{if(!Gg(Qe,qt))return;let x=setTimeout(()=>ah(Qe),Kg);return()=>clearTimeout(x)},[Qe,qt]);let hs=Bn(()=>{if(ce.status!=="ready")return[];let x=qt.trim().toLocaleLowerCase(),A=ce.snapshot.entries.filter(P=>(at||T)&&!(P.needsUpdate===!0&&P.managed)||St!=="all"&&P.origin!==St?!1:x?P.configId.toLocaleLowerCase().includes(x)||P.description.toLocaleLowerCase().includes(x)||P.moduleName.toLocaleLowerCase().includes(x):!0);return Dg.map(P=>({key:P,entries:A.filter(te=>lp(te)===P)})).filter(P=>P.entries.length>0)},[qt,St,ce.snapshot?.entries,at,T]);Ie(()=>{cp(x=>Object.keys(x).length===0?x:{})},[qt,St,at,T]);let $p=x=>{cp(A=>({...A,[x]:(A[x]??ap)+Wg}))},xp=Bn(()=>{if(ce.status!=="ready")return{builtin:0,user:0};let x=0,A=0;for(let P of ce.snapshot.entries)P.origin==="user"?A+=1:x+=1;return{builtin:x,user:A}},[ce.snapshot?.entries]),yh=Bn(()=>{let x=new Map;if(ce.status!=="ready")return x;for(let A of ce.snapshot.entries){let P=Jg(A,_p);(P.rows.length>0||P.bundles.length>0)&&x.set(A.entryId,P)}return x},[_p,ce.snapshot?.entries]),Xt=Bn(()=>ce.status!=="ready"?[]:ce.snapshot.entries.filter(x=>x.needsUpdate===!0&&x.managed),[ce.snapshot?.entries]),Sp=x=>{typeof requestAnimationFrame>"u"||typeof window>"u"||typeof window.scrollTo!="function"||requestAnimationFrame(()=>window.scrollTo(0,x))},ut=async(x,A)=>{let P=typeof window<"u"&&typeof document<"u"?window.scrollY??window.pageYOffset??document.documentElement?.scrollTop??0:0;kp(x),ne(null);try{let te=await A(),fe=te?.snapshot??te;return Yt({status:"ready",snapshot:fe}),Sp(P),te}catch(te){return ne({severity:"error",message:jg(te instanceof Error?te.message:String(te))}),Sp(P),null}finally{kp(null)}},zp=()=>ut("refresh",()=>t()).then(x=>{let A=x?.lastRefresh??null;if(A===null)return;let P=Math.max(1,Math.round((A?.durationMs??0)/1e3));A.aborted?ne({severity:"warning",message:`${I("refreshAborted")}\uFF08${P}s / ${Math.round((A.budgetMs??0)/1e3)}s\uFF0C\u5DF2\u67E5 ${A.checked??0}/${A.total??0}\uFF09${I("refreshAbortedHint")}`}):ne({severity:"success",message:`${I("refreshDone")}\uFF08${P}s\uFF0C${A.checked??0}/${A.total??0}\uFF09`})}),bh=async x=>{let A=String(x.packageName??x.moduleName??x.configId??"").split("/").pop()??"";try{typeof V=="function"&&await V()}catch{}mh(P=>({q:A,n:P.n+1})),mp(!0)},wh=(x,A)=>{let P=A==="auto"?null:A;ut(`source:${x.packageName}`,()=>h(x.packageName,P)).then(te=>{te&&ne({severity:"success",message:`${x.packageName} \u6765\u6E90\u5DF2\u4FDD\u5B58\u3002`})})},vh=x=>ut(`entry:${x.entryId}`,()=>n(x.entryId,!x.enabled)).then(A=>{if(!A)return;let P=A.items.filter(fe=>fe.status==="failed").map(fe=>fe.message).filter(Boolean).join(" "),te=A.items.filter(fe=>fe.status==="restart-required").map(fe=>fe.message).filter(Boolean).join(" ");P?ne({severity:"error",message:jg(P)}):te&&ne({severity:"warning",message:te})}),kh=x=>{try{let A=document.createElement("iframe");return A.style.display="none",A.src=x,document.body.appendChild(A),setTimeout(()=>{A.parentNode!==null&&A.parentNode.removeChild(A)},6e4),!0}catch{return!1}},_h=(x=12e4)=>new Promise(A=>{let P=Date.now(),te=setInterval(async()=>{try{let fe=await M();if((fe.installed??[]).length>0){clearInterval(te),A(fe);return}}catch{}Date.now()-P>x&&(clearInterval(te),A(null))},5e3)}),$h=x=>ut(`update:${x.packageName}`,()=>H([x.packageName])).then(async A=>{if(!A||A.items.length===0)return;let P=A.items[0];if(P.status==="need-download"&&P.url){ne({severity:"warning",message:`${P.packageName} \u2192 ${P.latestVersion}\uFF1A\u5DF2\u89E6\u53D1\u6D4F\u89C8\u5668\u4E0B\u8F7D${P.url.startsWith("magnet:")?"\uFF08P2P \u78C1\u529B\u94FE\u63A5\uFF0C\u6D4F\u89C8\u5668\u53EF\u80FD\u65E0\u6CD5\u76F4\u63A5\u5904\u7406\uFF0C\u53EF\u7528 NDM/\u6BD4\u7279\u5F57\u661F\u5BFC\u5165\uFF09":""}\u3002\u4E0B\u8F7D\u5B8C\u6210\u540E\u7BA1\u7406\u5668\u81EA\u52A8\u5B89\u88C5\uFF08${I("dlDir")}\uFF1A\u89C1\u6551\u63F4\u9762\u677F\uFF09\u3002\u82E5\u6D4F\u89C8\u5668\u672A\u5F00\u59CB\u4E0B\u8F7D\uFF0C\u8BF7\u70B9\u51FB\u300C\u5185\u7F6E\u4E0B\u8F7D\u300D\u3002`}),kh(P.url);let te=await _h();te!==null&&ne({severity:"success",message:`${P.packageName}: ${I("dlInstalled")} ${te.installed.join(", ")}\u3002\u91CD\u542F profile \u540E\u751F\u6548\u3002`});return}P.status==="up-to-date"?ne({severity:"success",message:`${P.packageName}: ${I("upToDate")}`}):P.status==="failed"?ne({severity:"error",message:`${P.packageName}: ${P.message}`}):P.status==="network-error"?ne({severity:"warning",message:`${P.packageName}: ${P.message}`}):P.status==="not-found"?ne({severity:"warning",message:`${P.packageName}: ${P.message}`}):P.status==="not-managed"&&ne({severity:"warning",message:`${P.packageName}: ${P.message}`})}),xh=x=>ut(`update:${x.packageName}`,()=>r([x.packageName])).then(A=>{if(!A||A.items.length===0)return;let P=A.items[0];P.status==="updated"?ne({severity:"success",message:`${P.packageName}: ${P.message}`}):P.status==="failed"?ne({severity:"error",message:`${P.packageName}: ${P.message}`}):P.status==="network-error"?ne({severity:"warning",message:`${P.packageName}: ${P.message}`}):P.status==="not-found"?ne({severity:"warning",message:`${P.packageName}: ${P.message}`}):P.status==="not-managed"?ne({severity:"warning",message:`${P.packageName}: ${P.message}`}):P.status==="up-to-date"&&ne({severity:"success",message:`${P.packageName}: ${I("upToDate")}`})}),Sh=()=>{if(Xt.length===0)return;let x=Xt.map(A=>A.packageName);ut("update:all",()=>r(x)).then(A=>{if(!A)return;let P=A.items.filter(ke=>ke.status==="updated").length,te=A.items.filter(ke=>ke.status==="failed").map(ke=>`${ke.packageName}: ${ke.message}`).join(" "),fe=A.items.filter(ke=>ke.status!=="updated"&&ke.message).map(ke=>`${ke.packageName}: ${ke.message}`).join("\uFF1B"),Qt=[];P>0&&Qt.push(`${P} \u4E2A\u5DF2\u66F4\u65B0`),fe&&Qt.push(fe),ne(te?{severity:"error",message:Qt.join("\uFF1B")}:{severity:"success",message:Qt.join("\uFF1B")})})},zh=()=>{window.confirm(I("resetConfirm"))&&ut("reset",()=>i()).then(x=>{x&&ne({severity:"success",message:I("resetDone")})})},Ih=x=>{let A=Array.isArray(x)&&x.some(P=>P&&P.authoritative===!0&&P.official!==!0);if(!(A&&!window.confirm(I("sourcesAuthoritativeConfirm"))))return ut("sources",()=>o(x,A?{confirm:!0}:null)).then(P=>{P&&ne({severity:"success",message:I("sourcesSaved")}),setTimeout(()=>zp(),400)})},Ph=x=>{gs(A=>{let P=new Set(A);return P.has(x)?P.delete(x):P.add(x),P})},Ch=()=>gs(new Set(Dg)),Ah=()=>gs(new Set);Ie(()=>{let x=!0;if(typeof ae=="function")return ae().then(A=>{x&&Jn(P=>({...P,status:"ready",data:A}))},A=>{x&&Jn(P=>({...P,status:"error",message:String(A?.message??A)}))}),()=>{x=!1}},[ae]);let ys=async x=>{if(!(x==="prepare"?typeof Ee!="function":typeof Ye!="function")){Jn(A=>({...A,busy:x,message:null}));try{let A=x==="prepare"?await Ee():await Ye(x);Jn({status:"ready",data:A,busy:null,message:A?.message??null})}catch(A){Jn(P=>({...P,busy:null,message:String(A?.message??A)}))}}};if(ce.status==="loading")return(0,c.jsx)("p",{style:{color:"var(--dsw-alias-label-tertiary)",fontSize:13},children:I("loading")});if(ce.status==="error")return(0,c.jsxs)("div",{role:"alert",style:{display:"flex",gap:10,alignItems:"center",color:"var(--dsw-alias-state-error-primary)",fontSize:13},children:[(0,c.jsxs)("span",{children:[I("error")," ",(0,c.jsx)("small",{children:ce.message})]}),(0,c.jsx)("button",{type:"button",onClick:()=>k(x=>x+1),style:j,children:I("retry")})]});let Kn=ce.snapshot;return(0,c.jsxs)("section",{"aria-label":I("title"),style:{width:"100%",maxWidth:We?"none":880,display:"flex",flexDirection:"column",gap:10,color:"var(--dsw-alias-label-primary)"},children:[(0,c.jsxs)("header",{style:{display:"flex",flexDirection:"column",gap:8},children:[We?null:(0,c.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[(0,c.jsxs)("h3",{style:{margin:0,fontSize:17,fontWeight:700},children:[(0,c.jsx)(ih,{size:18})," ",I("title")]}),(0,c.jsx)("span",{style:{fontSize:11,fontWeight:600,padding:"2px 9px",borderRadius:999,background:"color-mix(in srgb, var(--dsw-alias-state-business-primary, #4f8cff) 14%, transparent)",color:"var(--dsw-alias-state-business-primary, #4f8cff)",whiteSpace:"nowrap"},children:I("managerBadge")}),(0,c.jsxs)("span",{style:{marginLeft:"auto",fontSize:12,color:"var(--dsw-alias-label-tertiary)"},children:[I("profile"),": ",(0,c.jsx)("code",{style:{fontFamily:"var(--ds-font-family-code)"},children:Kn.profileName})]})]}),ye.data!==null?(0,c.jsxs)("div",{"data-self-update-banner":!0,style:{border:"1px solid var(--dsw-alias-border-l2)",borderRadius:8,padding:"8px 10px",background:"var(--dsw-alias-bg-layer-1)",display:"flex",gap:8,alignItems:"center",flexWrap:"wrap",fontSize:12.5},children:[(0,c.jsx)("span",{style:{fontWeight:600},children:I("selfUpdateTitle")}),(0,c.jsx)("span",{style:{color:"var(--dsw-alias-label-secondary)"},children:ye.data.pending!==null?`${ye.data.pending.currentVersion} \u2192 ${ye.data.pending.targetVersion}\uFF08${ye.data.pending.channel}\uFF09`:I("selfUpdateUpToDate").replace("{v}",ye.data.currentVersion)}),ye.data.pending!==null&&ye.data.pending.phase==="running"?(0,c.jsx)("span",{style:{color:"var(--dsw-alias-label-secondary)"},children:I("selfUpdateRunning")}):ye.data.pending!==null?ye.data.canApply?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("button",{type:"button",onClick:()=>ys("now"),disabled:ye.busy!==null,style:{...j,fontWeight:600,background:"var(--dsw-alias-state-business-primary, #4f8cff)",borderColor:"var(--dsw-alias-state-business-primary, #4f8cff)",color:"#fff"},children:I("selfUpdateNow")}),(0,c.jsx)("button",{type:"button",onClick:()=>ys("later"),disabled:ye.busy!==null,style:j,children:I("selfUpdateLater")})]}):(0,c.jsx)("span",{style:{color:"var(--dsw-alias-label-tertiary)"},children:I("selfUpdateDesktopOnly")}):(0,c.jsx)("button",{type:"button",onClick:()=>ys("prepare"),disabled:ye.busy!==null,style:j,children:ye.busy==="prepare"?I("selfUpdateChecking"):I("selfUpdateCheck")}),ye.message!==null?(0,c.jsx)("span",{style:{color:"var(--dsw-alias-label-secondary)"},children:ye.message}):null]}):null,(0,c.jsxs)("div",{style:{display:"flex",gap:6,alignItems:"center",flexWrap:"wrap"},children:[(0,c.jsxs)("label",{style:{flex:"1 1 210px",position:"relative",display:"inline-flex",alignItems:"center",minWidth:200},children:[(0,c.jsx)("span",{style:{position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0},children:I("search")}),(0,c.jsx)("input",{type:"search",value:Qe,placeholder:I("search"),onChange:x=>Wn(x.currentTarget.value),style:{boxSizing:"border-box",width:"100%",height:32,border:"1px solid var(--dsw-alias-border-l2)",background:"var(--dsw-alias-bg-layer-1)",color:"var(--dsw-alias-label-primary)",borderRadius:8,padding:"0 12px",fontSize:13,font:"inherit"}})]}),Xt.length>0?(0,c.jsxs)("button",{type:"button",onClick:Sh,disabled:ue!==null,style:{...j,background:"var(--dsw-alias-state-business-primary, #4f8cff)",borderColor:"var(--dsw-alias-state-business-primary, #4f8cff)",color:"#fff",fontWeight:600},children:[I("updateAll")," (",Xt.length,")"]}):null,We?Xt.length>0?(0,c.jsxs)("button",{type:"button",onClick:()=>ie(x=>!x),style:{...j,fontWeight:at||T?600:400},children:[I("onlyUpdatable")," (",Xt.length,")"]}):null:(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("button",{type:"button",onClick:()=>mp(x=>!x),disabled:ue!==null,style:{...j,color:"var(--dsw-alias-state-business-primary, #4f8cff)",borderColor:"var(--dsw-alias-state-business-primary, #4f8cff)",fontWeight:dp?600:400},children:I("market")}),(0,c.jsx)("button",{type:"button",onClick:()=>fh(x=>!x),disabled:ue!==null,style:{...j,color:"var(--dsw-alias-state-error-primary)",borderColor:"var(--dsw-alias-state-error-primary)",fontWeight:pp?600:400},children:I("rescue")}),(0,c.jsx)("button",{type:"button",onClick:()=>ch(x=>!x),style:{...j,fontWeight:fp?600:400},children:I("sources")}),(0,c.jsx)("button",{type:"button",onClick:()=>ph(x=>!x),disabled:ue!==null,style:{...j,fontWeight:gp?600:400},children:I("scenarios")}),(0,c.jsx)("button",{type:"button",onClick:()=>dh(x=>!x),disabled:ue!==null,style:{...j,fontWeight:hp?600:400},children:I("history")})]}),(0,c.jsx)("button",{type:"button",onClick:zh,disabled:ue!==null,style:{...j,color:"var(--dsw-alias-state-error-primary)",borderColor:"var(--dsw-alias-state-error-primary)"},children:I("resetToggles")}),(0,c.jsx)("button",{type:"button","aria-label":I("refresh"),title:I("refresh"),onClick:zp,disabled:ue!==null,style:{...j,width:32,height:32,display:"grid",placeItems:"center"},children:ue==="refresh"?"\u2026":"\u21BB"})]})]}),wp!==null?(0,c.jsx)(Xg,{packageName:wp,preview:m,uninstall:p,t:I,onDone:x=>{vp(null),x&&k(A=>A+1)}}):null,fp?(0,c.jsx)(oh,{sources:Kn.sources,save:Ih,busy:ue!==null,t:I}):null,dp?(0,c.jsx)(rh,{initialQuery:bp.q,marketCatalog:V,marketInstall:ve,busy:ue!==null,t:I,entries:ce.status==="ready"?ce.snapshot.entries:[]},bp.n):null,gp?(0,c.jsx)(eh,{scenarioList:y,scenarioSave:w,scenarioUpdate:_,scenarioDelete:v,scenarioApply:$,onSnapshot:x=>Yt({status:"ready",snapshot:x}),t:I}):null,hp?(0,c.jsx)(Qg,{operationHistory:g,undoOperation:d,onSnapshot:x=>Yt({status:"ready",snapshot:x}),t:I}):null,pp?(0,c.jsx)(Yg,{diagnose:s,quarantine:a,repairHarness:l,restartHarness:u,uninstallPackages:p,uninstallPreview:m,getRescueConfig:z,setRescueConfig:R,getDownloadConfig:S,checkDownloads:M,verifyProfile:He,fixProfile:L,managed:Kn.entries.filter(x=>x.origin==="user"),t:I}):null,(0,c.jsxs)("div",{style:{display:"flex",gap:6,flexWrap:"wrap",alignItems:"center"},children:[(0,c.jsxs)("span",{style:{fontSize:12,color:"var(--dsw-alias-label-tertiary)",fontWeight:600},children:[I("originLegend"),":"]}),(0,c.jsxs)("button",{type:"button",onClick:()=>ms("all"),style:{...Xr,...St==="all"?Qr:null},children:[I("originAll")," (",ce.snapshot.entries.length,")"]}),(0,c.jsxs)("button",{type:"button",onClick:()=>ms("builtin"),style:{...Xr,...St==="builtin"?Qr:null},children:[I("originBuiltin")," (",xp.builtin,")"]}),(0,c.jsxs)("button",{type:"button",onClick:()=>ms("user"),style:{...Xr,...St==="user"?Qr:null},children:[I("originUser")," (",xp.user,")"]})]}),Kn.entries.length===0?(0,c.jsx)("p",{style:{color:"var(--dsw-alias-label-tertiary)",fontSize:13},children:I("empty")}):null,Kn.entries.length>0&&hs.length===0?(0,c.jsx)("p",{style:{color:"var(--dsw-alias-label-tertiary)",fontSize:13},children:I("emptySearch")}):null,zt?(0,c.jsx)("p",{role:zt.severity==="error"?"alert":"status",style:{margin:0,fontSize:12,lineHeight:"18px",padding:"6px 10px",borderRadius:6,background:zt.severity==="error"?"color-mix(in srgb, var(--dsw-alias-state-error-primary) 12%, transparent)":zt.severity==="warning"?"color-mix(in srgb, var(--dsw-alias-state-warning-primary, #f59e0b) 12%, transparent)":"color-mix(in srgb, var(--dsw-alias-state-success-primary, #22c55e) 12%, transparent)",color:zt.severity==="error"?"var(--dsw-alias-state-error-primary)":zt.severity==="warning"?"var(--dsw-alias-state-warning-primary, #f59e0b)":"var(--dsw-alias-state-success-primary, #22c55e)"},children:zt.message}):null,hs.length>1?(0,c.jsxs)("div",{style:{display:"flex",gap:6,justifyContent:"flex-end",fontSize:12},children:[(0,c.jsx)("button",{type:"button",onClick:Ch,style:Gt,children:I("expandAll")}),(0,c.jsx)("button",{type:"button",onClick:Ah,style:Gt,children:I("collapseAll")})]}):null,(0,c.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:8},children:hs.map(x=>{let A=op[x.key],P=x.entries.filter(Z=>Z.enabled).length,te=x.entries.filter(Z=>Z.needsUpdate===!0&&Z.managed).length,fe=hh||uh.has(x.key),Qt=lh[x.key]??ap,ke=x.entries.slice(0,Qt),eo=x.entries.length-ke.length;return(0,c.jsxs)("section",{style:{border:"1px solid var(--dsw-alias-border-l2)",background:"var(--dsw-alias-bg-layer-3)",borderRadius:10,overflow:"hidden"},children:[(0,c.jsxs)("header",{style:{display:"flex",alignItems:"center",gap:8,padding:"9px 12px",cursor:"pointer",userSelect:"none"},onClick:()=>Ph(x.key),children:[(0,c.jsx)("span",{"aria-hidden":"true",style:{width:10,height:10,borderRadius:"50%",background:A.color,flex:"none",transition:"opacity 120ms ease",opacity:fe?1:.55}}),(0,c.jsx)("span",{style:{fontSize:13.5,fontWeight:700},children:I(A.key)}),(0,c.jsxs)("span",{style:{fontSize:12,color:"var(--dsw-alias-label-tertiary)"},children:[P,"/",x.entries.length]}),te>0?(0,c.jsxs)("span",{style:{fontSize:11,padding:"1px 7px",borderRadius:999,background:"color-mix(in srgb, var(--dsw-alias-state-warning-primary, #f59e0b) 16%, transparent)",color:"var(--dsw-alias-state-warning-primary, #f59e0b)",fontWeight:600},children:[I("updateAvailable")," ",te]}):null,(0,c.jsx)("span",{style:{marginLeft:"auto",fontSize:12,color:"var(--dsw-alias-label-tertiary)"},children:fe?"\u25BE":"\u25B8"})]}),fe?(0,c.jsxs)("ul",{style:{listStyle:"none",margin:0,padding:"0 8px 8px",display:"flex",flexDirection:"column",gap:6},children:[ke.map(Z=>{let Oh=Ek(Z),bs=zk[Oh],en=lp(Z),Nh=Z.packageName===Lg||Z.moduleName===Lg||Z.configId===Ck,ws=ue===`entry:${Z.entryId}`||ue===`update:${Z.packageName}`,Eh=ue===`update:${Z.packageName}`||ue==="update:all",Zh=Z.needsUpdate===!0&&Z.managed&&!Eh,Ip=gh?yh.get(Z.entryId):void 0,et=Ip?.rows?.[0],It=Ip?.bundles?.[0],tn=et?`row:${et.key}`:null,nn=It?`bundle:${It.key}`:null,Th=De!==null&&(De===tn||De===nn);return(0,c.jsxs)("li",{"data-entry-row":"1",style:{display:"block",padding:"9px 12px",border:"1px solid var(--dsw-alias-border-l2)",background:"var(--dsw-alias-bg-layer-1)",borderRadius:10,minWidth:0},children:[(0,c.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,minWidth:0},children:[(0,c.jsxs)("span",{title:Z.error??void 0,style:{display:"inline-flex",alignItems:"center",gap:5,flex:"none",width:86,fontSize:12,color:bs.color},children:[(0,c.jsx)("i",{style:{width:9,height:9,borderRadius:"50%",background:bs.color,display:"inline-block",flex:"none"}}),I(bs.key)]}),(0,c.jsxs)("div",{style:{flex:"1 1 auto",minWidth:0},children:[(0,c.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,minWidth:0},children:[(0,c.jsx)("strong",{style:{fontSize:13,fontWeight:600,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:Z.configId}),Nh?(0,c.jsx)("span",{title:I("managerBadge"),style:{flex:"none",fontSize:11,fontWeight:600,padding:"1px 8px",borderRadius:999,background:"color-mix(in srgb, var(--dsw-alias-state-business-primary, #4f8cff) 14%, transparent)",color:"var(--dsw-alias-state-business-primary, #4f8cff)",whiteSpace:"nowrap"},children:I("managerBadge")}):null,Ak(Z)?(0,c.jsx)("span",{title:I("recommendedTagHint"),style:{flex:"none",fontSize:11,fontWeight:600,padding:"1px 8px",borderRadius:999,background:"color-mix(in srgb, var(--dsw-alias-state-success-primary, #22c55e) 14%, transparent)",color:"var(--dsw-alias-state-success-primary, #22c55e)",whiteSpace:"nowrap"},children:I("recommendedTag")}):null,(0,c.jsx)("span",{style:{color:"var(--dsw-alias-label-tertiary)",fontSize:11,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:Z.moduleName})]}),(0,c.jsx)("p",{style:{margin:"2px 0 0",color:"var(--dsw-alias-label-secondary)",fontSize:12,lineHeight:"18px"},children:Z.description}),et?(0,c.jsx)("div",{style:{margin:"2px 0 0",fontSize:11.5,lineHeight:"17px",color:"var(--dsw-alias-label-tertiary)"},children:Xe("plugins.row.config",{view:"summary"},{entryKey:et.key})}):null,Z.installedVersion||Z.latestVersion?(0,c.jsxs)("p",{style:{margin:"2px 0 0",color:"var(--dsw-alias-label-tertiary)",fontSize:11,fontFamily:"var(--ds-font-family-code)"},children:[Z.installedVersion??"?",Z.latestVersion?` \u2192 ${Z.latestVersion}`:"",Z.updateSource?` (${Z.updateSource})`:"",Dk(I,Z)]}):null]}),Z.needsUpdate===!0&&!Z.managed?(0,c.jsx)("span",{title:Z.moduleName,style:{flex:"none",fontSize:11,color:"var(--dsw-alias-label-tertiary)"},children:I("notManaged")}):null,(0,c.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-end",gap:6,flex:"none"},children:[(0,c.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"nowrap"},children:[Z.origin==="user"?(0,c.jsx)("span",{title:I("originUserHint"),style:{flex:"none",fontSize:11,padding:"2px 8px",borderRadius:999,border:"1px solid var(--dsw-alias-state-business-primary, #4f8cff)",color:"var(--dsw-alias-state-business-primary, #4f8cff)",whiteSpace:"nowrap"},children:I("originUser")}):null,(0,c.jsx)("span",{style:{flex:"none",fontSize:11,fontWeight:600,padding:"2px 8px",borderRadius:999,border:`1px solid ${op[en]?.color??st.yellow}`,color:op[en]?.color??st.yellow},children:I(en==="core"?"badgeCore":en==="builtin"?"badgeBuiltin":"badgeUser")}),Z.archived?(0,c.jsx)("span",{title:Z.protectionReason,style:{flex:"none",fontSize:11,padding:"2px 8px",borderRadius:999,border:"1px solid var(--dsw-alias-border-l2)",color:"var(--dsw-alias-label-tertiary)",whiteSpace:"nowrap"},children:I("archived")}):null,(0,c.jsxs)("label",{title:Z.protected?Z.protectionReason:`${Z.configId}: ${Z.enabled?I("disableEntry"):I("enableEntry")}`,style:{flex:"none",display:"inline-flex",alignItems:"center",cursor:Z.protected||ws?"not-allowed":"pointer",opacity:Z.protected?.55:1},children:[(0,c.jsx)("input",{type:"checkbox",checked:Z.enabled,disabled:Z.protected||ws,"aria-label":`${Z.configId}: ${Z.enabled?I("disableEntry"):I("enableEntry")}`,onChange:()=>vh(Z),style:{position:"absolute",opacity:0,pointerEvents:"none"}}),(0,c.jsx)("span",{"aria-hidden":"true",style:{position:"relative",width:36,height:20,borderRadius:999,background:Z.enabled?"var(--dsw-alias-state-business-primary, #4f8cff)":"var(--dsw-alias-border-l2)",transition:"background 120ms ease"},children:(0,c.jsx)("i",{style:{position:"absolute",top:2,left:Z.enabled?18:2,width:16,height:16,borderRadius:"50%",background:"#fff",transition:"left 120ms ease"}})}),ws?(0,c.jsx)("span",{style:{marginLeft:6,fontSize:12,color:"var(--dsw-alias-label-tertiary)"},children:"\u2026"}):null]})]}),Z.origin==="user"||Z.protected||et!==void 0||It!==void 0||en!=="core"?(0,c.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,flexWrap:"nowrap"},children:[Z.origin==="user"?(0,c.jsx)("label",{title:I("sourceOverrideHint"),style:{flex:"none",display:"inline-flex",alignItems:"center",gap:3,fontSize:10.5,color:"var(--dsw-alias-label-tertiary)"},children:(0,c.jsxs)("select",{value:Z.sourceOverride??Z.source??"npm",onChange:Rh=>wh(Z,Rh.currentTarget.value),disabled:ue!==null,"aria-label":`${Z.configId}: ${I("sourceOverrideHint")}`,style:{fontSize:10.5,borderRadius:5,border:"1px solid var(--dsw-alias-border-l2)",background:"var(--dsw-alias-bg-layer-1)",color:"var(--dsw-alias-label-secondary)",padding:"1px 2px",maxWidth:76,cursor:"pointer"},children:[(0,c.jsx)("option",{value:"auto",children:I("sourceAuto")}),(0,c.jsx)("option",{value:"npm",children:I("sourceNpm")}),(0,c.jsx)("option",{value:"github",children:I("sourceGithub")}),(0,c.jsx)("option",{value:"local",children:I("sourceLocal")}),(0,c.jsx)("option",{value:"builtin",children:I("sourceBuiltin")})]})}):null,Zh?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("button",{type:"button",onClick:()=>$h(Z),disabled:ue!==null,style:{...j,flex:"none",fontWeight:600,color:"var(--dsw-alias-state-warning-primary, #f59e0b)",borderColor:"var(--dsw-alias-state-warning-primary, #f59e0b)"},children:I("update")}),(0,c.jsx)("button",{type:"button",onClick:()=>xh(Z),disabled:ue!==null,title:I("updateInternalHint"),style:{...j,flex:"none",fontSize:11,color:"var(--dsw-alias-label-tertiary)"},children:I("updateInternal")})]}):null,Z.protected?(0,c.jsx)("span",{title:Z.protectionReason,style:{flex:"none",fontSize:12,opacity:.75,cursor:"help"},children:"\u{1F512}"}):null,Z.origin==="user"?(0,c.jsx)("button",{type:"button",onClick:()=>vp(Z.packageName),disabled:ue!==null,title:I("uninstallRowHint"),style:{...j,flex:"none",fontWeight:600,fontSize:11,color:"var(--dsw-alias-state-error-primary)",borderColor:"var(--dsw-alias-state-error-primary)",whiteSpace:"nowrap"},children:I("rescueUninstall")}):null,en!=="core"?(0,c.jsx)("button",{type:"button",onClick:()=>bh(Z),disabled:ue!==null,title:I("marketDetailHint"),style:{...j,flex:"none",fontSize:11,whiteSpace:"nowrap"},children:I("marketDetail")}):null,et?(0,c.jsxs)("button",{type:"button",onClick:()=>yp(De===tn?null:tn),title:`${I("configEntryHint")} \xB7 ${et.key}`,"aria-expanded":De===tn,style:{...j,flex:"none",fontWeight:600,fontSize:11,color:"var(--dsw-alias-state-business-primary, #4f8cff)",borderColor:"var(--dsw-alias-state-business-primary, #4f8cff)",whiteSpace:"nowrap"},children:["\u2699 ",I(De===tn?"officialClose":"configEntry")]}):null,It?(0,c.jsxs)("button",{type:"button",onClick:()=>yp(De===nn?null:nn),title:`${I("configEntryHint")} \xB7 ${It.key}`,"aria-expanded":De===nn,style:{...j,flex:"none",fontWeight:600,fontSize:11,color:"var(--dsw-alias-state-business-primary, #4f8cff)",borderColor:"var(--dsw-alias-state-business-primary, #4f8cff)",whiteSpace:"nowrap"},children:["\u2699 ",I(De===nn?"officialClose":"configBundleEntry")]}):null]}):null]})]}),Th?(0,c.jsxs)("div",{"data-plugin-config-entry":De,style:{marginTop:8,border:"1px solid var(--dsw-alias-border-l2)",borderRadius:8,padding:"10px 12px",background:"var(--dsw-alias-bg-layer-2)",minWidth:0},children:[De===tn&&et?Xe("plugins.row.config",{view:"page"},{entryKey:et.key}):null,De===nn&&It?Xe("plugins.bundle.config",{view:"page"},{entryKey:It.key}):null]}):null]},Z.entryId)}),eo>0?(0,c.jsx)("li",{"data-show-more":"1",style:{listStyle:"none",display:"flex",justifyContent:"center",padding:"2px 0 6px"},children:(0,c.jsx)("button",{type:"button","data-remaining":eo,onClick:()=>$p(x.key),style:j,children:I("showMoreRows").replace("{n}",String(eo))})}):null,eo>0&&typeof IntersectionObserver=="function"?(0,c.jsx)(Zk,{onReveal:()=>$p(x.key)}):null]}):null]},x.key)})})]})}var Jt=class extends Kt.Component{constructor(t){super(t),this.state={error:null}}static getDerivedStateFromError(t){return{error:t}}render(){return this.state.error!==null?(0,c.jsxs)("p",{role:"alert",style:{color:"var(--dsw-alias-state-error-primary)",fontSize:13,margin:0},children:["\u63D2\u4EF6\u7BA1\u7406\u5668\u6E32\u67D3\u51FA\u9519\uFF1A",String(this.state.error),"\u3002\u8BF7\u5237\u65B0\u9875\u9762\u540E\u91CD\u8BD5\u3002"]}):this.props.children}};function Yg({diagnose:e,quarantine:t,repairHarness:n,restartHarness:r,uninstallPackages:o,uninstallPreview:i,getRescueConfig:s,setRescueConfig:a,getDownloadConfig:l,checkDownloads:u,verifyProfile:p,fixProfile:m,managed:g,t:d}){let[h,y]=N(null),[w,_]=N(!1),[v,$]=N(null),[z,R]=N(!1),[S,M]=N(null),[H,He]=N(null),[L,V]=N(null);Ie(()=>{let k=!0;return s().then(T=>{k&&R(T.autoQuarantine===!0)},()=>{}),l().then(T=>{k&&M(T.dir??null)},()=>{}),ae(),()=>{k=!1}},[]);let ve=async()=>{let k="http://127.0.0.1:3081/plugins#health";try{let T=await fetch("/plugins-launcher",{headers:{accept:"application/json"}}),ie=T.ok?await T.json():null;ie&&typeof ie.url=="string"&&/^http:\/\//.test(ie.url)&&(k=ie.url.replace(/\/+$/,"")+"/plugins#health")}catch{}window.open(k,"_blank")},ae=async()=>{_(!0),$(null);try{let k=await e();y(k.issues??[])}catch(k){$({severity:"error",message:k instanceof Error?k.message:String(k)})}finally{_(!1)}},Ee=async k=>{_(!0);try{let ie=(await t([k])).items?.[0];$({severity:ie?.status==="disabled"?"success":"warning",message:ie?`${ie.status}${ie.message?`\uFF1A${ie.message}`:""}`:"\u5B8C\u6210"}),ae()}catch(T){$({severity:"error",message:T instanceof Error?T.message:String(T)})}finally{_(!1)}},Ye=async()=>{if(window.confirm(d("rescueRepairConfirm"))){_(!0);try{let k=await n(),T=(k.actions??[]).map(ie=>`\xB7 ${ie.action}: ${ie.detail}`).join(`
70
+ `);$({severity:"success",message:`${d("rescueRepairDone")}
71
+ ${T}
72
+ ${d("rescueRestartHint")} ${k.restartCommand}`}),ae()}catch(k){$({severity:"error",message:k instanceof Error?k.message:String(k)})}finally{_(!1)}}},I=async()=>{if(window.confirm(d("rescueRestartConfirm")))try{let k=await r();$({severity:"warning",message:k.message})}catch(k){$({severity:"error",message:k instanceof Error?k.message:String(k)})}},We=async k=>{V(k)},at=async k=>{_(!0);try{await a({autoQuarantine:k}),R(k),$({severity:"success",message:d("rescueAutoSaved")})}catch(T){$({severity:"error",message:T instanceof Error?T.message:String(T)})}finally{_(!1)}},Xe=async()=>{_(!0);try{let k=await p();He(k),$(k.ok?{severity:"success",message:d("verifyOk")}:{severity:"error",message:`${d("verifyBad")} ${(k.issues??[]).map(T=>`${T.name}: ${T.reason}`).join("\uFF1B")}`})}catch(k){$({severity:"error",message:k instanceof Error?k.message:String(k)})}finally{_(!1)}},lt=async()=>{if(window.confirm(d("fixProfileConfirm"))){_(!0);try{let k=await m();$({severity:k.ok?"success":"error",message:`${k.message??""} ${(k.actions??[]).map(T=>`${T.action}: ${T.detail}`).join("\uFF1B")}`}),Xe()}catch(k){$({severity:"error",message:k instanceof Error?k.message:String(k)})}finally{_(!1)}}},Hn=async()=>{_(!0);try{let k=await u(),T=[];(k.installed??[]).length>0&&T.push(`${d("dlInstalled")} ${k.installed.join(", ")}`),(k.failed??[]).length>0&&T.push(`${d("dlFailed")} ${k.failed.map(ie=>`${ie.name}: ${ie.message}`).join("\uFF1B")}`),$({severity:T.length===0?"success":k.failed?.length>0?"warning":"success",message:T.join("\uFF1B")||d("dlEmpty")})}catch(k){$({severity:"error",message:k instanceof Error?k.message:String(k)})}finally{_(!1)}};return(0,c.jsxs)("div",{style:{border:"1px solid var(--dsw-alias-state-error-primary)",background:"color-mix(in srgb, var(--dsw-alias-state-error-primary) 6%, transparent)",borderRadius:8,padding:"10px 12px",display:"flex",flexDirection:"column",gap:8},children:[(0,c.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:6},children:[(0,c.jsxs)("span",{style:{fontSize:13,fontWeight:600,color:"var(--dsw-alias-state-error-primary)"},children:["\u{1F6DF} ",d("rescueTitle")]}),(0,c.jsxs)("span",{style:{marginLeft:"auto",display:"flex",gap:6},children:[(0,c.jsx)("button",{type:"button",onClick:ve,disabled:w,style:j,children:d("rescueModHealth")}),(0,c.jsx)("button",{type:"button",onClick:ae,disabled:w,style:j,children:d("rescueDiagnose")})]})]}),(0,c.jsx)("p",{style:{margin:0,fontSize:12,color:"var(--dsw-alias-label-tertiary)",lineHeight:"18px"},children:d("rescueModHealthHint")}),(0,c.jsx)("p",{style:{margin:0,fontSize:12,color:"var(--dsw-alias-label-tertiary)",lineHeight:"18px"},children:d("rescueHint")}),L!==null?(0,c.jsx)(Xg,{packageName:L,preview:i,uninstall:o,t:d,onDone:k=>{V(null),k&&ae()}}):null,h===null?null:h.length===0?(0,c.jsx)("p",{className:"ok-note",style:{margin:0,fontSize:12,color:"var(--dsw-alias-state-success-primary, #22c55e)"},children:d("rescueClean")}):(0,c.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:6},children:h.map(k=>(0,c.jsxs)("div",{style:{border:"1px solid var(--dsw-alias-border-l2)",background:"var(--dsw-alias-bg-layer-1)",borderRadius:8,padding:"8px 10px"},children:[(0,c.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[(0,c.jsx)("b",{style:{fontSize:13,color:"var(--dsw-alias-state-error-primary)"},children:k.configId}),(0,c.jsxs)("span",{style:{fontSize:11,color:"var(--dsw-alias-label-tertiary)"},children:[k.moduleName," \xB7 ",k.phase]}),(0,c.jsxs)("span",{style:{marginLeft:"auto",display:"flex",gap:6},children:[k.suggestion==="disable"?(0,c.jsx)("button",{type:"button",onClick:()=>Ee(k.entryId),disabled:w,style:{...j,color:"var(--dsw-alias-state-error-primary)",borderColor:"var(--dsw-alias-state-error-primary)"},children:d("rescueDisable")}):(0,c.jsx)("span",{style:{fontSize:11,color:"var(--dsw-alias-label-tertiary)"},children:d("rescueProtected")}),k.canUninstall?(0,c.jsx)("button",{type:"button",onClick:()=>We(k.moduleName),disabled:w,style:j,children:d("rescueUninstall")}):null]})]}),k.error?(0,c.jsx)("pre",{style:{margin:"6px 0 0",fontSize:11,color:"var(--dsw-alias-label-secondary)",whiteSpace:"pre-wrap",wordBreak:"break-all",maxHeight:80,overflow:"auto"},children:k.error}):null]},k.entryId))}),(0,c.jsxs)("div",{style:{display:"flex",gap:6,alignItems:"center",flexWrap:"wrap"},children:[(0,c.jsx)("button",{type:"button",onClick:Ye,disabled:w,style:{...j,background:"var(--dsw-alias-state-error-primary)",color:"#fff",fontWeight:600},children:d("rescueRepair")}),(0,c.jsx)("button",{type:"button",onClick:I,disabled:w,style:{...j,color:"var(--dsw-alias-state-error-primary)",borderColor:"var(--dsw-alias-state-error-primary)"},children:d("rescueRestart")}),(0,c.jsxs)("label",{style:{display:"inline-flex",alignItems:"center",gap:4,fontSize:12,cursor:"pointer",marginLeft:8},children:[(0,c.jsx)("input",{type:"checkbox",checked:z,disabled:w,onChange:k=>at(k.currentTarget.checked)}),d("rescueAuto")]})]}),(0,c.jsxs)("div",{style:{borderTop:"1px solid var(--dsw-alias-border-l2)",paddingTop:8,display:"flex",flexDirection:"column",gap:6},children:[(0,c.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[(0,c.jsx)("span",{style:{fontSize:12,fontWeight:600},children:d("verifyTitle")}),(0,c.jsx)("button",{type:"button",onClick:Xe,disabled:w,style:j,children:d("verifyRun")}),(0,c.jsx)("button",{type:"button",onClick:lt,disabled:w,style:{...j,color:"var(--dsw-alias-state-error-primary)",borderColor:"var(--dsw-alias-state-error-primary)"},children:d("fixProfile")})]}),H!==null&&!H.ok?(0,c.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:4},children:(H.issues??[]).map((k,T)=>(0,c.jsxs)("p",{style:{margin:0,fontSize:12,color:"var(--dsw-alias-state-error-primary)"},children:["\u26A0 ",k.name,": ",k.reason]},T))}):null,(0,c.jsx)("p",{style:{margin:0,fontSize:11,color:"var(--dsw-alias-label-tertiary)",lineHeight:"16px"},children:d("verifyHint")})]}),(0,c.jsxs)("div",{style:{borderTop:"1px solid var(--dsw-alias-border-l2)",paddingTop:8,display:"flex",flexDirection:"column",gap:6},children:[(0,c.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[(0,c.jsx)("span",{style:{fontSize:12,fontWeight:600},children:d("dlTitle")}),(0,c.jsx)("button",{type:"button",onClick:Hn,disabled:w,style:j,children:d("dlCheck")})]}),(0,c.jsxs)("p",{style:{margin:0,fontSize:12,color:"var(--dsw-alias-label-secondary)"},children:[d("dlDir"),": ",(0,c.jsx)("code",{style:{fontFamily:"var(--ds-font-family-code)",fontSize:11},children:S??"\u2026"})]}),(0,c.jsx)("p",{style:{margin:0,fontSize:11,color:"var(--dsw-alias-label-tertiary)",lineHeight:"16px"},children:d("dlHint")})]}),g.length>0?(0,c.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[(0,c.jsx)("span",{style:{fontSize:12,color:"var(--dsw-alias-label-tertiary)"},children:d("rescueUninstallList")}),(0,c.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:g.map(k=>(0,c.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:6,border:"1px solid var(--dsw-alias-border-l2)",borderRadius:999,padding:"2px 8px",fontSize:11},children:[k.configId,(0,c.jsx)("button",{type:"button",onClick:()=>We(k.packageName),disabled:w,style:Gt,children:d("rescueUninstall")})]},k.packageName))})]}):null,v?(0,c.jsx)("p",{role:"alert",style:{margin:0,fontSize:12,whiteSpace:"pre-wrap",color:v.severity==="error"?"var(--dsw-alias-state-error-primary)":v.severity==="warning"?"var(--dsw-alias-state-warning-primary, #f59e0b)":"var(--dsw-alias-state-success-primary, #22c55e)"},children:v.message}):null]})}var Mg={safe:{key:"uninstallVerdictSafe",color:"var(--dsw-alias-state-success-primary, #22c55e)"},caution:{key:"uninstallVerdictCaution",color:"var(--dsw-alias-state-warning-primary, #f59e0b)"},risky:{key:"uninstallVerdictRisky",color:"var(--dsw-alias-state-error-primary)"}},Ug={high:{key:"uninstallCheckHigh",color:"var(--dsw-alias-state-error-primary)"},warning:{key:"uninstallCheckWarning",color:"var(--dsw-alias-state-warning-primary, #f59e0b)"},info:{key:"uninstallCheckInfo",color:"var(--dsw-alias-label-secondary)"}},Vg={cleaned:{key:"uninstallAutostartCleaned",color:"var(--dsw-alias-state-success-primary, #22c55e)"},skipped:{key:"uninstallAutostartSkipped",color:"var(--dsw-alias-label-secondary)"},failed:{key:"uninstallAutostartFailed",color:"var(--dsw-alias-state-warning-primary, #f59e0b)"},timeout:{key:"uninstallAutostartTimeout",color:"var(--dsw-alias-state-warning-primary, #f59e0b)"}};function Xg({packageName:e,preview:t,uninstall:n,t:r,onDone:o}){let[i,s]=N(null),[a,l]=N(null),[u,p]=N(!1),[m,g]=N(!1),[d,h]=N(null);Ie(()=>{let z=!0;return t([e]).then(R=>{z&&s(R.packages?.[0]??null)},R=>{z&&l(R instanceof Error?R.message:String(R))}),()=>{z=!1}},[t,e]);let y=async()=>{g(!0),h(null);try{let z=await n([e],{cascade:u});h(z.items?.[0]??null)}catch(z){h({status:"failed",message:z instanceof Error?z.message:String(z)})}finally{g(!1)}},w=i?.checks??[],_=Mg[i?.verdict??"safe"]??Mg.safe,v=d?.autostartCleanup??null,$=v===null?null:Vg[v.status]??Vg.failed;return(0,c.jsxs)("div",{style:{border:"1px solid var(--dsw-alias-state-warning-primary, #f59e0b)",background:"color-mix(in srgb, var(--dsw-alias-state-warning-primary, #f59e0b) 8%, transparent)",borderRadius:8,padding:"10px 12px",display:"flex",flexDirection:"column",gap:8},children:[(0,c.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[(0,c.jsxs)("span",{style:{fontSize:13,fontWeight:600,color:"var(--dsw-alias-state-warning-primary, #f59e0b)"},children:[r("uninstallTitle"),": ",e]}),(0,c.jsx)("button",{type:"button",onClick:()=>o(!1),disabled:m,style:Gt,children:r("cancel")})]}),a?(0,c.jsxs)("p",{role:"alert",style:{margin:0,fontSize:12,color:"var(--dsw-alias-state-error-primary)"},children:[r("uninstallPreviewFail"),": ",a]}):null,i===null&&!a?(0,c.jsx)("p",{style:{margin:0,fontSize:12,color:"var(--dsw-alias-label-tertiary)"},children:r("uninstallPreviewLoading")}):null,i!==null&&!d?(0,c.jsx)(c.Fragment,{children:i.canUninstall?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)("div",{"data-check-verdict":i.verdict??"safe",style:{border:`1px solid ${_.color}`,borderRadius:6,padding:"6px 8px",display:"flex",flexDirection:"column",gap:2},children:[(0,c.jsxs)("span",{style:{fontSize:12.5,fontWeight:600,color:_.color},children:[r("uninstallVerdictLine"),"\uFF1A",r(_.key)]}),(0,c.jsx)("span",{style:{fontSize:11.5,color:"var(--dsw-alias-label-secondary)",lineHeight:"16px"},"data-check-reason":"1",children:i.verdictReason??""})]}),(0,c.jsx)("p",{style:{margin:0,fontSize:12,color:"var(--dsw-alias-label-secondary)",lineHeight:"18px"},children:r("uninstallPreviewHint")}),(0,c.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:4,fontSize:12},children:[i.affectedEntries.length>0?(0,c.jsxs)("p",{style:{margin:0},children:[r("uninstallAffectedEntries"),": ",(0,c.jsx)("code",{style:{fontFamily:"var(--ds-font-family-code)",fontSize:11},children:i.affectedEntries.map(z=>z.configId).join(", ")})]}):(0,c.jsx)("p",{style:{margin:0,color:"var(--dsw-alias-label-tertiary)"},children:r("uninstallNoEntries")}),i.inBundles?(0,c.jsx)("p",{style:{margin:0},children:r("uninstallBundleRow")}):null,i.patchRows>0?(0,c.jsxs)("p",{style:{margin:0},children:[r("uninstallPatchRows"),": ",i.patchRows]}):null,(0,c.jsxs)("div",{"data-check-list":"1",style:{borderTop:"1px solid var(--dsw-alias-border-l2)",paddingTop:6,display:"flex",flexDirection:"column",gap:3},children:[(0,c.jsxs)("p",{style:{margin:0,fontWeight:600},children:[r("uninstallCheckTitle")," ",(0,c.jsx)("span",{style:{fontWeight:400,color:"var(--dsw-alias-label-tertiary)",fontSize:11},children:r("uninstallCheckHint")})]}),w.length===0?(0,c.jsx)("p",{"data-check-empty":"1",style:{margin:0,fontSize:11.5,color:"var(--dsw-alias-label-tertiary)"},children:r("uninstallCheckEmpty")}):w.map((z,R)=>{let S=Ug[z.severity]??Ug.info;return(0,c.jsxs)("p",{"data-check-id":z.id,"data-check-severity":z.severity,style:{margin:0,fontSize:11.5,lineHeight:"17px"},children:[(0,c.jsxs)("span",{style:{color:S.color,fontWeight:600},children:["[",r(S.key),"]"]})," ",(0,c.jsx)("span",{style:{fontWeight:600},children:z.title})," ",(0,c.jsxs)("span",{style:{color:"var(--dsw-alias-label-tertiary)"},children:["\u2014\u2014 ",z.detail]})]},`${z.id}-${R}`)})]}),i.dependents.length>0?(0,c.jsxs)("div",{style:{border:"1px solid var(--dsw-alias-state-warning-primary, #f59e0b)",borderRadius:6,padding:"6px 8px",display:"flex",flexDirection:"column",gap:4},children:[(0,c.jsxs)("p",{style:{margin:0,fontWeight:600,color:"var(--dsw-alias-state-warning-primary, #f59e0b)"},children:["\u26A0 ",r("uninstallDependents"),":"]}),i.dependents.map((z,R)=>(0,c.jsxs)("p",{style:{margin:0,fontSize:11.5},children:[(0,c.jsx)("code",{style:{fontFamily:"var(--ds-font-family-code)",fontSize:11},children:z.packageName}),(0,c.jsxs)("span",{style:{color:"var(--dsw-alias-label-tertiary)"},children:[" (",z.type,": ",z.spec,")"]})]},R)),(0,c.jsxs)("label",{style:{display:"inline-flex",alignItems:"center",gap:5,fontSize:12,cursor:"pointer"},children:[(0,c.jsx)("input",{type:"checkbox",checked:u,disabled:m,onChange:z=>p(z.currentTarget.checked)}),r("uninstallCascade"),"\uFF08",i.dependents.filter(z=>!0).length,"\uFF09"]})]}):null]}),i.isSelf===!0?(0,c.jsx)("p",{"data-self-hint":"1",style:{margin:0,fontSize:11.5,lineHeight:"17px",color:"var(--dsw-alias-state-warning-primary, #f59e0b)"},children:r("uninstallSelfHint")}):null,(0,c.jsx)("div",{style:{display:"flex",gap:6,justifyContent:"flex-end"},children:(0,c.jsx)("button",{type:"button",onClick:y,disabled:m,style:{...j,background:"var(--dsw-alias-state-error-primary)",color:"#fff",fontWeight:600},children:r(m?"uninstalling":"uninstallConfirm")})})]}):(0,c.jsx)("p",{role:"alert",style:{margin:0,fontSize:12,color:"var(--dsw-alias-state-error-primary)"},children:i.spec===null?r("uninstallNotManaged"):r("uninstallLocalBlocked")})}):null,d!==null?(0,c.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:4,fontSize:12},children:[(0,c.jsxs)("p",{style:{margin:0,color:d.status==="removed"?"var(--dsw-alias-state-success-primary, #22c55e)":"var(--dsw-alias-state-error-primary)"},children:[d.status==="removed"?"\u2713 ":d.status==="rolled-back"?"\u21A9 ":"\u2717 ",r(`uninstallStatus${d.status}`),": ",d.message]}),d.status==="removed"?(0,c.jsxs)(c.Fragment,{children:[d.verifyOk===!0?(0,c.jsxs)("p",{style:{margin:0,color:"var(--dsw-alias-state-success-primary, #22c55e)"},children:["\u2713 ",r("uninstallVerifyOk")]}):null,d.removedPatchRows>0?(0,c.jsxs)("p",{style:{margin:0},children:[r("uninstallReportRows"),": ",d.removedPatchRows]}):null,d.dependentPackages.length>0?(0,c.jsxs)("p",{style:{margin:0},children:[r("uninstallReportCascade"),": ",d.dependentPackages.join(", ")]}):null,d.residuals.length>0?(0,c.jsxs)("p",{style:{margin:0,color:"var(--dsw-alias-state-warning-primary, #f59e0b)"},children:[r("uninstallResiduals"),": ",d.residuals.join(", ")]}):null]}):null,$!==null&&v!==null?(0,c.jsxs)("p",{"data-autostart-cleanup":v.status,style:{margin:0,color:$.color,lineHeight:"17px"},children:[r("uninstallAutostartTitle"),": ",r($.key)," \u2014\u2014 ",v.message]}):null,d.isSelf===!0&&d.status==="removed"?(0,c.jsx)("p",{"data-self-uninstalled":"1",style:{margin:0,color:"var(--dsw-alias-state-warning-primary, #f59e0b)",lineHeight:"17px"},children:r("uninstallSelfReport")}):null,(0,c.jsx)("div",{style:{display:"flex",gap:6,justifyContent:"flex-end"},children:(0,c.jsx)("button",{type:"button",onClick:()=>o(d.status==="removed"),style:j,children:r("done")})})]}):null]})}function Qg({operationHistory:e,undoOperation:t,onSnapshot:n,t:r}){let[o,i]=N(null),[s,a]=N(null),[l,u]=N(null),[p,m]=N(0);Ie(()=>{let d=!0;return e().then(h=>{d&&i(h.operations??[])},h=>{d&&u({severity:"error",message:h instanceof Error?h.message:String(h)})}),()=>{d=!1}},[e,p]);let g=async d=>{a(d),u(null);try{let h=await t(d);u({severity:h.ok?"success":"warning",message:h.message}),h.snapshot&&n(h.snapshot),m(y=>y+1)}catch(h){u({severity:"error",message:h instanceof Error?h.message:String(h)})}finally{a(null)}};return(0,c.jsxs)("div",{style:{border:"1px solid var(--dsw-alias-border-l2)",background:"var(--dsw-alias-bg-layer-2)",borderRadius:8,padding:"10px 12px",display:"flex",flexDirection:"column",gap:8},children:[(0,c.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8},children:[(0,c.jsx)("span",{style:{fontSize:13,fontWeight:600},children:r("historyTitle")}),(0,c.jsx)("span",{style:{fontSize:11,color:"var(--dsw-alias-label-tertiary)"},children:r("historyHint")}),(0,c.jsx)("button",{type:"button",onClick:()=>m(d=>d+1),disabled:s!==null,style:Gt,children:r("refresh")})]}),l?(0,c.jsx)("p",{role:"alert",style:{margin:0,fontSize:12,color:l.severity==="error"?"var(--dsw-alias-state-error-primary)":l.severity==="warning"?"var(--dsw-alias-state-warning-primary, #f59e0b)":"var(--dsw-alias-state-success-primary, #22c55e)"},children:l.message}):null,o===null?(0,c.jsx)("p",{style:{margin:0,fontSize:12,color:"var(--dsw-alias-label-tertiary)"},children:r("loading")}):o.length===0?(0,c.jsx)("p",{style:{margin:0,fontSize:12,color:"var(--dsw-alias-label-tertiary)"},children:r("historyEmpty")}):(0,c.jsx)("ul",{style:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column",gap:4,maxHeight:320,overflow:"auto"},children:o.map(d=>(0,c.jsxs)("li",{style:{display:"flex",alignItems:"center",gap:8,fontSize:12,border:"1px solid var(--dsw-alias-border-l2)",background:"var(--dsw-alias-bg-layer-1)",borderRadius:6,padding:"6px 8px"},children:[(0,c.jsxs)("span",{style:{flex:"1 1 auto",minWidth:0},children:[(0,c.jsx)("span",{style:{fontWeight:600},children:d.label}),d.detail?(0,c.jsx)("span",{style:{color:"var(--dsw-alias-label-tertiary)",marginLeft:6},children:d.detail}):null,(0,c.jsxs)("span",{style:{display:"block",fontSize:10.5,color:"var(--dsw-alias-label-tertiary)"},children:[d.at.slice(0,16).replace("T"," ")," \xB7 ",d.action,d.undone?` \xB7 ${r("historyUndone")}`:""]})]}),d.undo&&!d.undone?(0,c.jsx)("button",{type:"button",onClick:()=>g(d.id),disabled:s!==null,style:{...j,flex:"none",color:"var(--dsw-alias-state-business-primary, #4f8cff)",borderColor:"var(--dsw-alias-state-business-primary, #4f8cff)"},children:s===d.id?"\u2026":r("historyUndo")}):null]},d.id))})]})}function eh({scenarioList:e,scenarioSave:t,scenarioUpdate:n,scenarioDelete:r,scenarioApply:o,onSnapshot:i,t:s}){let[a,l]=N(null),[u,p]=N(""),[m,g]=N(null),[d,h]=N(null),[y,w]=N(null),[_,v]=N(null),[$,z]=N(null),R=()=>e().then(L=>l(L.scenarios??[]),L=>h({severity:"error",message:L instanceof Error?L.message:String(L)}));Ie(()=>{R()},[]);let S=async()=>{g("save"),h(null);try{let L=await t(u.trim());l(L.scenarios??[]),p(""),h({severity:"success",message:s("scenarioSaved")})}catch(L){h({severity:"error",message:L instanceof Error?L.message:String(L)})}finally{g(null)}},M=async L=>{g(`preview:${L.id}`),h(null),v(L.id);try{let V=await o(L.id,!0),ve=(V.items??[]).filter(ae=>ae.changed);w(ve.length>0?{scenario:V.scenarios?.find(ae=>ae.id===L.id)??L,items:ve}:null)}catch(V){h({severity:"error",message:V instanceof Error?V.message:String(V)})}finally{g(null)}},H=async L=>{z(L.id),h(null);try{let V=await o(L.id,!1),ve=(V.items??[]).filter(Ee=>Ee.status==="changed").length,ae=(V.items??[]).filter(Ee=>Ee.status==="skipped").length;l(V.scenarios??[]),V.snapshot&&i(V.snapshot),w(null),v(null),h({severity:ve>0?"success":"warning",message:`${s("scenarioApplied")}\uFF1A${ve} \u9879\u5207\u6362${ae>0?`\uFF0C${ae} \u9879\u88AB\u4FDD\u62A4\u8DF3\u8FC7`:""}\u3002${ve>0?s("restartHint"):""}`})}catch(V){h({severity:"error",message:V instanceof Error?V.message:String(V)})}finally{z(null)}},He=async L=>{if(window.confirm(`${s("scenarioDeleteConfirm")} ${L.name}\uFF1F`)){g(`delete:${L.id}`);try{let V=await r(L.id);l(V.scenarios??[])}catch(V){h({severity:"error",message:V instanceof Error?V.message:String(V)})}finally{g(null)}}};return(0,c.jsxs)("div",{style:{border:"1px solid var(--dsw-alias-border-l2)",background:"var(--dsw-alias-bg-layer-2)",borderRadius:8,padding:"10px 12px",display:"flex",flexDirection:"column",gap:8},children:[(0,c.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8},children:[(0,c.jsx)("span",{style:{fontSize:13,fontWeight:600},children:s("scenarioTitle")}),(0,c.jsx)("span",{style:{fontSize:11,color:"var(--dsw-alias-label-tertiary)"},children:s("scenarioHint")})]}),(0,c.jsxs)("div",{style:{display:"flex",gap:6,alignItems:"center"},children:[(0,c.jsx)("input",{value:u,placeholder:s("scenarioName"),onChange:L=>p(L.currentTarget.value),style:{...up,flex:"1 1 160px"}}),(0,c.jsx)("button",{type:"button",onClick:S,disabled:m!==null||u.trim()==="",style:j,children:s("scenarioSave")})]}),d?(0,c.jsx)("p",{role:"alert",style:{margin:0,fontSize:12,color:d.severity==="error"?"var(--dsw-alias-state-error-primary)":d.severity==="warning"?"var(--dsw-alias-state-warning-primary, #f59e0b)":"var(--dsw-alias-state-success-primary, #22c55e)"},children:d.message}):null,a===null?(0,c.jsx)("p",{style:{margin:0,fontSize:12,color:"var(--dsw-alias-label-tertiary)"},children:s("loading")}):a.length===0?(0,c.jsx)("p",{style:{margin:0,fontSize:12,color:"var(--dsw-alias-label-tertiary)"},children:s("scenarioEmpty")}):(0,c.jsx)("ul",{style:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column",gap:6},children:a.map(L=>(0,c.jsxs)("li",{style:{border:"1px solid var(--dsw-alias-border-l2)",background:"var(--dsw-alias-bg-layer-1)",borderRadius:8,padding:"8px 10px",display:"flex",flexDirection:"column",gap:6},children:[(0,c.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[(0,c.jsx)("b",{style:{fontSize:13},children:L.name}),(0,c.jsxs)("span",{style:{fontSize:11,color:"var(--dsw-alias-label-tertiary)"},children:[s("scenarioCounts"),": ",L.counts?.enabled??0,"/",L.counts?.disabled??0," \xB7 ",L.updatedAt.slice(0,10)]}),(0,c.jsxs)("span",{style:{marginLeft:"auto",display:"flex",gap:6},children:[_===L.id&&y===null&&m===`preview:${L.id}`?(0,c.jsx)("span",{style:{fontSize:11,color:"var(--dsw-alias-label-tertiary)"},children:s("scenarioCalculating")}):(0,c.jsx)("button",{type:"button",onClick:()=>M(L),disabled:m!==null,style:j,children:s("scenarioApply")}),(0,c.jsx)("button",{type:"button",onClick:()=>n(L.id).then(V=>l(V.scenarios??[])).catch(V=>h({severity:"error",message:V.message})),disabled:m!==null,title:s("scenarioUpdateHint"),style:j,children:s("scenarioUpdate")}),(0,c.jsx)("button",{type:"button",onClick:()=>He(L),disabled:m!==null,style:{...j,color:"var(--dsw-alias-state-error-primary)",borderColor:"var(--dsw-alias-state-error-primary)"},children:s("scenarioDelete")})]})]}),_===L.id&&y!==null?(0,c.jsxs)("div",{style:{border:"1px dashed var(--dsw-alias-state-warning-primary, #f59e0b)",borderRadius:6,padding:"6px 8px",display:"flex",flexDirection:"column",gap:4},children:[(0,c.jsx)("p",{style:{margin:0,fontSize:11.5,fontWeight:600,color:"var(--dsw-alias-state-warning-primary, #f59e0b)"},children:s("scenarioPreviewTitle")}),y.items.map(V=>(0,c.jsxs)("p",{style:{margin:0,fontSize:11.5},children:[(0,c.jsx)("code",{style:{fontFamily:"var(--ds-font-family-code)",fontSize:11},children:V.configId})," ",V.current?s("statusEnabled"):s("statusDisabled")," \u2192 ",V.enabled?s("statusEnabled"):s("statusDisabled"),V.protected?(0,c.jsxs)("span",{style:{color:"var(--dsw-alias-label-tertiary)",marginLeft:6},children:["\u{1F512} ",V.reason??""]}):null]},V.configId)),(0,c.jsxs)("div",{style:{display:"flex",gap:6,justifyContent:"flex-end"},children:[(0,c.jsx)("button",{type:"button",onClick:()=>H(L),disabled:$!==null,style:{...j,background:"var(--dsw-alias-state-warning-primary, #b45309)",color:"#fff",fontWeight:600},children:$===L.id?s("scenarioApplying"):s("scenarioApplyConfirm")}),(0,c.jsx)("button",{type:"button",onClick:()=>{w(null),v(null)},disabled:$!==null,style:j,children:s("cancel")})]})]}):null]},L.id))})]})}var ps=null,Tk=20;function Rk(){try{let e=typeof window<"u"&&window.navigator?window.navigator:null;return(e&&(e.language||e.userLanguage)||"zh").toLowerCase().startsWith("zh")?"zh":"en"}catch{return"zh"}}function Dk(e,t){return t.needsUpdate!==null||!t.installedVersion?"":t.updateReason==="network"||t.updateReason==="timeout"?` (${e("versionNetworkError")})`:t.updateReason==="not-found"?` (${e("versionNotFound")})`:t.updateReason==="backoff"?` (${e("versionBackoff")})`:` (${e("versionUnknown")})`}function th(e,t,n){if(n.has(e.name)||typeof e.npm=="string"&&(t.has(e.npm)||n.has(e.npm))||t.has(e.name))return!0;let r=/^https:\/\/github\.com\/([^/]+\/[^/]+?)(?:\/tree\/.+)?\/?$/.exec(e.url||"");return!!(r!==null&&t.has(r[1].split("/")[1]))}function nh(e,t,n,r){if(!e)return[];let o=t.trim().toLocaleLowerCase();return[...e.items.filter(s=>n!=="all"&&s.category!==n?!1:!o||s.name.toLocaleLowerCase().includes(o)||s.owner.toLocaleLowerCase().includes(o)||typeof s.npm=="string"&&s.npm.toLocaleLowerCase().includes(o)?!0:(s.description?Object.values(s.description).filter(Boolean).join(" "):"").toLocaleLowerCase().includes(o))].sort((s,a)=>r==="added"?String(a.added||"").localeCompare(String(s.added||"")):(a.stars??-1)-(s.stars??-1))}function rh({marketCatalog:e,marketInstall:t,busy:n,t:r,entries:o,initialQuery:i=""}){let[s,a]=N(ps),[l,u]=N(null),[p,m]=N(0),[g,d]=N(i),[h,y]=N("all"),[w,_]=N("stars"),[v,$]=N(1),[z,R]=N(null),[S,M]=N(null),[H,He]=N(()=>new Set),[L,V]=N(null),ve=Rk(),ae=Bn(()=>{let k=new Set;for(let T of o||[])T.packageName&&k.add(T.packageName);return k},[o]);Ie(()=>{let k=!0;if(ps===null)return e().then(T=>{k&&(ps=T,a(T),u(null))},T=>{k&&u(T instanceof Error?T.message:String(T))}),()=>{k=!1}},[e,p]);let Ee=Bn(()=>nh(s,g,h,w),[s,g,h,w]);Ie(()=>{$(1)},[g,h,w]);let Ye=Ee.slice(0,v*Tk),I=Ye.length<Ee.length,We=()=>{ps=null,a(null),u(null),m(k=>k+1)},at=async k=>{M(k.name),V(null);try{let T=await t({name:k.name,npm:k.npm,url:k.url},!1),ie=T.status==="installed"?"success":T.status==="already-installed"?"warning":"error";V({severity:ie,message:T.message??T.status}),T.status==="installed"&&(He(Qe=>{let Wn=new Set(Qe);return Wn.add(T.packageName??k.name),Wn.add(k.name),Wn}),R(null))}catch(T){V({severity:"error",message:T instanceof Error?T.message:String(T)})}finally{M(null)}},Xe=s?.categories?Object.keys(s.categories):[],lt=k=>{let T=s?.categories?.[k];return T&&(T[ve]||T.en)||k},Hn={live:r("marketSourceLive"),cache:r("marketSourceCache"),"github-fallback":r("marketSourceFallback"),error:r("marketSourceError")}[s?.source]??s?.source;return(0,c.jsxs)("div",{style:{border:"1px solid var(--dsw-alias-border-l2)",background:"var(--dsw-alias-bg-layer-2)",borderRadius:8,padding:"10px 12px",display:"flex",flexDirection:"column",gap:8},children:[(0,c.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[(0,c.jsx)("span",{style:{fontSize:13,fontWeight:600},children:r("marketTitle")}),s?(0,c.jsxs)("span",{className:"muted",style:{fontSize:11,color:"var(--dsw-alias-label-tertiary)"},title:s.updated??"",children:[Hn," \xB7 ",s.count," ",r("marketPlugins"),s.updated?` \xB7 ${r("marketUpdated")} ${s.updated.slice(0,10)}`:""]}):null,(0,c.jsx)("input",{type:"search",value:g,placeholder:r("marketSearch"),onChange:k=>d(k.currentTarget.value),style:{boxSizing:"border-box",flex:"1 1 200px",height:30,border:"1px solid var(--dsw-alias-border-l2)",background:"var(--dsw-alias-bg-layer-1)",color:"var(--dsw-alias-label-primary)",borderRadius:6,padding:"0 10px",fontSize:12,font:"inherit"}}),(0,c.jsxs)("select",{value:w,onChange:k=>_(k.currentTarget.value),style:{height:30,fontSize:12,borderRadius:6,border:"1px solid var(--dsw-alias-border-l2)",background:"var(--dsw-alias-bg-layer-1)",color:"var(--dsw-alias-label-primary)"},"aria-label":r("marketSort"),children:[(0,c.jsx)("option",{value:"stars",children:r("marketSortStars")}),(0,c.jsx)("option",{value:"added",children:r("marketSortAdded")})]}),(0,c.jsx)("button",{type:"button",onClick:We,disabled:n,title:r("marketRefresh"),style:{...j,width:30,height:30,display:"grid",placeItems:"center"},children:"\u21BB"})]}),s?(0,c.jsxs)("div",{style:{display:"flex",gap:6,flexWrap:"wrap"},children:[(0,c.jsx)("button",{type:"button",onClick:()=>y("all"),style:{...Xr,...h==="all"?Qr:null},children:r("marketAll")}),Xe.map(k=>(0,c.jsx)("button",{type:"button",onClick:()=>y(k),style:{...Xr,...h===k?Qr:null},children:lt(k)},k))]}):null,(0,c.jsx)("p",{className:"muted",style:{margin:0,fontSize:11,color:"var(--dsw-alias-label-tertiary)"},children:r("marketHint")}),L?(0,c.jsx)("p",{role:"alert",style:{margin:0,fontSize:12,whiteSpace:"pre-wrap",color:L.severity==="error"?"var(--dsw-alias-state-error-primary)":L.severity==="warning"?"var(--dsw-alias-state-warning-primary, #f59e0b)":"var(--dsw-alias-state-success-primary, #22c55e)"},children:L.message}):null,l?(0,c.jsxs)("p",{style:{margin:0,fontSize:12,color:"var(--dsw-alias-state-error-primary)"},children:[r("marketLoadFail"),": ",l,(0,c.jsx)("button",{type:"button",onClick:We,style:{...j,marginLeft:8},children:r("marketRetry")})]}):null,s===null&&!l?(0,c.jsxs)("p",{style:{margin:0,fontSize:12,color:"var(--dsw-alias-label-tertiary)"},children:[r("marketLoading")," ",r("marketLoadingSlow")]}):null,s?.source==="error"?(0,c.jsxs)("p",{style:{margin:0,fontSize:12,color:"var(--dsw-alias-state-warning-primary, #f59e0b)"},children:[r("marketSourceErrorHint"),(0,c.jsx)("button",{type:"button",onClick:We,style:{...j,marginLeft:8},children:r("marketRetry")})]}):null,s!==null&&Ee.length===0&&!l?(0,c.jsx)("p",{style:{margin:0,fontSize:12,color:"var(--dsw-alias-label-tertiary)"},children:r("marketEmpty")}):null,Ye.length>0?(0,c.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:6,maxHeight:420,overflow:"auto"},children:Ye.map(k=>{let T=th(k,ae,H),ie=z===k.name&&S!==k.name;return(0,c.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,border:"1px solid var(--dsw-alias-border-l2)",background:"var(--dsw-alias-bg-layer-1)",borderRadius:8,padding:"8px 10px"},children:[(0,c.jsxs)("div",{style:{flex:"1 1 auto",minWidth:0},children:[(0,c.jsxs)("span",{style:{display:"flex",alignItems:"baseline",gap:6,flexWrap:"wrap"},children:[(0,c.jsx)("strong",{style:{fontSize:12.5},children:k.name}),k.owner?(0,c.jsx)("span",{style:{fontSize:11,color:"var(--dsw-alias-label-tertiary)"},children:k.owner}):null,k.stars!==null?(0,c.jsxs)("span",{style:{fontSize:11,color:"var(--dsw-alias-label-tertiary)"},children:["\u2605 ",k.stars]}):null,k.added?(0,c.jsxs)("span",{style:{fontSize:11,color:"var(--dsw-alias-label-tertiary)"},children:[r("marketUpdated")," ",k.added.slice(0,10)]}):null,(0,c.jsx)("span",{style:{fontSize:10,color:"var(--dsw-alias-label-tertiary)",border:"1px solid var(--dsw-alias-border-l2)",borderRadius:4,padding:"0 4px"},children:lt(k.category)})]}),k.description?(()=>{let Qe=k.description[ve]||k.description.en;return Qe?(0,c.jsx)("p",{style:{margin:"2px 0 0",fontSize:12,color:"var(--dsw-alias-label-secondary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Qe}):null})():null]}),T?(0,c.jsxs)("span",{style:{fontSize:11,color:"var(--dsw-alias-state-success-primary, #22c55e)",flex:"none",whiteSpace:"nowrap"},children:["\u2713 ",r("marketInstalledBadge")]}):S===k.name?(0,c.jsx)("button",{type:"button",disabled:!0,style:{...j,flex:"none",fontWeight:600,opacity:.6},children:r("marketInstalling")}):ie?(0,c.jsx)("button",{type:"button",onClick:()=>at(k),disabled:n||S!==null,style:{...j,flex:"none",fontWeight:700,color:"#fff",background:"var(--dsw-alias-state-error-primary, #d64541)",borderColor:"var(--dsw-alias-state-error-primary, #d64541)"},children:r("marketConfirmInstall")}):(0,c.jsx)("button",{type:"button",onClick:()=>R(k.name),disabled:n||S!==null,style:{...j,flex:"none",fontWeight:600,color:"var(--dsw-alias-state-business-primary, #4f8cff)",borderColor:"var(--dsw-alias-state-business-primary, #4f8cff)"},children:r("marketInstall")})]},k.url||k.name)})}):null,I?(0,c.jsxs)("button",{type:"button",onClick:()=>$(k=>k+1),disabled:n,style:{...j,alignSelf:"center"},children:[r("marketMore"),"\uFF08",Ee.length-Ye.length,"\uFF09"]}):null]})}var Xr={height:26,fontSize:11.5,borderRadius:999,border:"1px solid var(--dsw-alias-border-l2)",background:"var(--dsw-alias-bg-layer-1)",color:"var(--dsw-alias-label-secondary)",padding:"0 12px",cursor:"pointer"},Qr={borderColor:"var(--dsw-alias-state-business-primary, #4f8cff)",color:"var(--dsw-alias-state-business-primary, #4f8cff)",fontWeight:600};function oh({sources:e,save:t,busy:n,t:r}){let[o,i]=N(e),[s,a]=N(""),[l,u]=N("");Ie(()=>{i(e)},[e]);let p=(w,_)=>{i(v=>v.map(($,z)=>z===w?{...$,enabled:_}:$))},m=(w,_)=>{i(v=>v.map(($,z)=>z===w?{...$,authoritative:_}:$))},g=(w,_)=>{i(v=>v.map(($,z)=>z===w?{...$,allowInsecure:_}:$))},d=w=>{i(_=>_.filter((v,$)=>$!==w))},h=()=>{let w=l.trim();if(!w||!/^https?:\/\//.test(w))return;let _="registry";/^https?:\/\/github\.com\//.test(w)&&(_="github"),i(v=>[...v,{name:s.trim()||w,url:w,enabled:!0,official:!1,authoritative:!1,allowInsecure:!1,type:_}]),a(""),u("")},y=()=>{i([{name:"\u5B98\u65B9\u6E90 (npm)",url:"https://registry.npmjs.org",enabled:!0,official:!0,authoritative:!0,type:"registry"},{name:"GitHub \u5B98\u65B9\u4ED3\u5E93",url:"https://github.com/deepseek-ai/deepseek-harness",enabled:!1,official:!1,authoritative:!1,type:"github"},{name:"npmmirror \u955C\u50CF",url:"https://registry.npmmirror.com",enabled:!1,official:!0,authoritative:!0,type:"registry"}])};return(0,c.jsxs)("div",{style:{border:"1px solid var(--dsw-alias-border-l2)",background:"var(--dsw-alias-bg-layer-2)",borderRadius:8,padding:"10px 12px",display:"flex",flexDirection:"column",gap:8},children:[(0,c.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[(0,c.jsx)("span",{style:{fontSize:13,fontWeight:600},children:r("sourcesTitle")}),(0,c.jsx)("button",{type:"button",onClick:y,style:Gt,children:r("resetSources")})]}),(0,c.jsx)("p",{style:{margin:0,fontSize:12,color:"var(--dsw-alias-label-tertiary)",lineHeight:"18px"},children:r("sourcesHint")}),o.length===0?(0,c.jsx)("p",{style:{margin:0,fontSize:12,color:"var(--dsw-alias-state-error-primary)"},children:r("noSources")}):null,(0,c.jsx)("ul",{style:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column",gap:4},children:o.map((w,_)=>(0,c.jsxs)("li",{style:{display:"flex",alignItems:"center",gap:8,fontSize:12},children:[(0,c.jsxs)("label",{style:{display:"inline-flex",alignItems:"center",gap:4,flex:"none",cursor:"pointer"},children:[(0,c.jsx)("input",{type:"checkbox",checked:w.enabled,onChange:v=>p(_,v.currentTarget.checked)}),r("enabled")]}),(0,c.jsxs)("span",{style:{fontWeight:600,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:180},title:w.name,children:[w.name,w.official?(0,c.jsx)("em",{style:{fontStyle:"normal",fontSize:10,color:"var(--dsw-alias-state-business-primary, #4f8cff)",marginLeft:4},children:r("official")}):null,!w.official&&w.authoritative?(0,c.jsx)("em",{style:{fontStyle:"normal",fontSize:10,color:"var(--dsw-alias-state-business-primary, #4f8cff)",marginLeft:4},children:r("authoritative")}):null,w.insecure?(0,c.jsx)("em",{title:w.note??r("plaintextFallbackHint"),style:{fontStyle:"normal",fontSize:10,color:"var(--dsw-alias-state-warning-primary, #b8860b)",marginLeft:4},children:w.official||w.authoritative?r("plaintextAuthoritative"):r("plaintextFallback")}):null,w.type==="github"?(0,c.jsx)("em",{style:{fontStyle:"normal",fontSize:10,color:"var(--dsw-alias-label-tertiary)",marginLeft:4},children:"GitHub"}):null]}),(0,c.jsx)("code",{style:{flex:"1 1 auto",fontFamily:"var(--ds-font-family-code)",fontSize:11,color:"var(--dsw-alias-label-secondary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:w.url}),w.official?null:(0,c.jsxs)("label",{title:r("authoritativeHint"),style:{display:"inline-flex",alignItems:"center",gap:4,flex:"none",cursor:"pointer",fontSize:11},children:[(0,c.jsx)("input",{type:"checkbox",checked:w.authoritative===!0,onChange:v=>m(_,v.currentTarget.checked)}),r("authoritative")]}),!w.official&&w.insecure?(0,c.jsxs)("label",{title:r("allowInsecureHint"),style:{display:"inline-flex",alignItems:"center",gap:4,flex:"none",cursor:"pointer",fontSize:11},children:[(0,c.jsx)("input",{type:"checkbox",checked:w.allowInsecure===!0,onChange:v=>g(_,v.currentTarget.checked)}),r("allowInsecure")]}):null,(0,c.jsx)("button",{type:"button",onClick:()=>d(_),style:Gt,disabled:n,children:r("remove")})]},_))}),(0,c.jsxs)("div",{style:{display:"flex",gap:6,alignItems:"center",flexWrap:"wrap"},children:[(0,c.jsx)("input",{value:s,placeholder:r("sourceName"),onChange:w=>a(w.currentTarget.value),style:up}),(0,c.jsx)("input",{value:l,placeholder:r("sourceUrl"),onChange:w=>u(w.currentTarget.value),style:{...up,flex:"1 1 220px"}}),(0,c.jsx)("button",{type:"button",onClick:h,style:j,children:r("addSource")})]}),(0,c.jsx)("div",{style:{display:"flex",justifyContent:"flex-end"},children:(0,c.jsx)("button",{type:"button",onClick:()=>t(o),disabled:n,style:{...j,background:"var(--dsw-alias-state-business-primary, #4f8cff)",color:"#fff",fontWeight:600},children:r("saveSources")})})]})}var j={border:"1px solid var(--dsw-alias-border-l2)",color:"var(--dsw-alias-label-primary)",font:"inherit",cursor:"pointer",background:"transparent",borderRadius:6,padding:"4px 10px",fontSize:12},Gt={border:"none",background:"none",color:"var(--dsw-alias-state-business-primary, #4f8cff)",font:"inherit",fontSize:12,cursor:"pointer",padding:"2px 4px"},up={boxSizing:"border-box",height:30,border:"1px solid var(--dsw-alias-border-l2)",background:"var(--dsw-alias-bg-layer-1)",color:"var(--dsw-alias-label-primary)",borderRadius:6,padding:"0 10px",fontSize:12,font:"inherit",flex:"1 1 140px"};function ih({size:e=18}){return(0,c.jsxs)("svg",{className:"drydock-logo-mark",width:e,height:e,viewBox:"0 0 64 64",fill:"currentColor",role:"img","aria-label":"drydock logo",style:{flex:"none",verticalAlign:"-0.15em"},children:[(0,c.jsx)("g",{transform:"translate(9.5,14) scale(1.85)",children:(0,c.jsx)("path",{d:"M23.748 4.651c-.254-.124-.364.113-.512.233-.051.04-.094.09-.137.137-.372.397-.806.657-1.373.626-.829-.046-1.537.214-2.163.848-.133-.782-.575-1.248-1.247-1.548-.352-.155-.708-.311-.955-.65-.172-.24-.219-.509-.305-.774-.055-.16-.11-.323-.293-.35-.2-.031-.278.136-.356.276-.313.572-.434 1.202-.422 1.84.027 1.436.633 2.58 1.838 3.393.137.094.172.187.129.323-.082.28-.18.553-.266.833-.055.179-.137.218-.328.14a5.5 5.5 0 0 1-1.737-1.179c-.857-.828-1.631-1.743-2.597-2.46a12 12 0 0 0-.689-.47c-.985-.957.13-1.743.387-1.836.27-.098.094-.433-.778-.428-.872.003-1.67.295-2.687.685a3 3 0 0 1-.465.136 9.6 9.6 0 0 0-2.883-.101c-1.885.21-3.39 1.1-4.497 2.622C.082 8.776-.231 10.854.152 13.02c.403 2.284 1.568 4.175 3.36 5.653 1.857 1.533 3.997 2.284 6.438 2.14 1.482-.085 3.132-.284 4.994-1.86.47.234.962.328 1.78.398.629.058 1.235-.031 1.705-.129.735-.155.684-.836.418-.961-2.155-1.004-1.682-.595-2.112-.926 1.095-1.295 2.768-3.598 3.284-6.733.05-.346.115-.834.108-1.114-.004-.171.035-.238.23-.257a4.2 4.2 0 0 0 1.545-.475c1.397-.763 1.96-2.016 2.093-3.517.02-.23-.004-.467-.247-.588M11.58 18.168c-2.088-1.642-3.101-2.183-3.52-2.16-.39.024-.32.472-.234.763.09.288.207.487.371.74.114.167.192.416-.113.603-.673.416-1.842-.14-1.897-.168-1.361-.801-2.5-1.86-3.301-3.306-.775-1.393-1.225-2.888-1.299-4.482-.02-.385.094-.522.477-.592a4.7 4.7 0 0 1 1.53-.038c2.131.311 3.946 1.264 5.467 2.774.868.86 1.525 1.887 2.202 2.89.72 1.066 1.494 2.082 2.48 2.915.348.291.626.513.892.677-.802.09-2.14.109-3.055-.615zm1.001-6.44a.306.306 0 0 1 .415-.287.3.3 0 0 1 .113.074.3.3 0 0 1 .086.214c0 .17-.136.307-.308.307a.303.303 0 0 1-.306-.307m3.11 1.596c-.2.081-.4.151-.591.16a1.25 1.25 0 0 1-.798-.254c-.274-.23-.47-.358-.551-.758a1.7 1.7 0 0 1 .015-.588c.07-.327-.007-.537-.238-.727-.188-.156-.426-.199-.689-.199a.6.6 0 0 1-.254-.078.253.253 0 0 1-.114-.358 1 1 0 0 1 .192-.21c.356-.202.767-.136 1.146.016.352.144.618.408 1.001.782.392.451.462.576.685.915.176.264.336.536.446.848.066.194-.02.353-.25.45"})}),(0,c.jsxs)("g",{children:[(0,c.jsx)("rect",{x:"19",y:"16.5",width:"6.2",height:"5.5",rx:"0.5"}),(0,c.jsx)("rect",{x:"26.4",y:"16.5",width:"6.2",height:"5.5",rx:"0.5"}),(0,c.jsx)("rect",{x:"19",y:"9.8",width:"6.2",height:"5.5",rx:"0.5"})]})]})}function Lk(e){let t=e&&e.size||18;return(0,c.jsxs)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,c.jsx)("rect",{x:"3.5",y:"3.5",width:"7",height:"7",rx:"1.6"}),(0,c.jsx)("rect",{x:"13.5",y:"3.5",width:"7",height:"7",rx:"1.6"}),(0,c.jsx)("rect",{x:"3.5",y:"13.5",width:"7",height:"7",rx:"1.6"}),(0,c.jsx)("rect",{x:"13.5",y:"13.5",width:"7",height:"7",rx:"1.6"})]})}var Fg={"@deepseek-ai/dsh-experimental-agent-team-profile":{name:"Agent Team \u7EC4\u5408\u5305",note:"\u591A\u667A\u80FD\u4F53\u56E2\u961F\u534F\u4F5C\uFF1A\u6210\u5458\u3001\u4EFB\u52A1\u770B\u677F\u3001\u6D88\u606F",glyph:"\u{1F465}"},"@deepseek-ai/dsh-experimental-voice-input-bundle":{name:"\u8BED\u97F3\u8F93\u5165",note:"\u672C\u5730\u8BED\u97F3\u8F6C\u5199\uFF0C\u8F93\u5165\u6846\u9EA6\u514B\u98CE\u5165\u53E3",glyph:"\u{1F399}"},"@deepseek-ai/dsh-experimental-auto-review":{name:"\u81EA\u52A8\u5BA1\u9605",note:"\u9AD8\u98CE\u9669\u64CD\u4F5C\u5148\u81EA\u52A8\u5BA1\u9605\u518D\u6267\u884C",glyph:"\u{1F6E1}"}};function ds(e){if(e&&typeof e=="object"&&"ok"in e){if(e.ok===!0)return e.value;let t=e.error??{};throw new Error(`${t.code??"remote"}: ${t.message??"\u8C03\u7528\u5931\u8D25"}`)}return e}function sh({officialApi:e,itemsSource:t,renderSlot:n,t:r}){let[o,i]=N({status:"loading"}),[s,a]=N(null),[l,u]=N(null),[p,m]=N(null),[g,d]=N(0),h=Hg((t??sp).subscribe,(t??sp).getSnapshot,(t??sp).getSnapshot);Ie(()=>{let S=!0;return!e||typeof e.listBundles!="function"?(i({status:"unavailable"}),()=>{S=!1}):(i({status:"loading"}),Promise.all([e.listBundles().then(ds),typeof e.listVersionExemptions=="function"?e.listVersionExemptions().then(ds).catch(()=>({exemptions:{}})):Promise.resolve({exemptions:{}})]).then(([M,H])=>{S&&i({status:"ready",bundles:Array.isArray(M)?M:[],exemptions:H&&H.exemptions?H.exemptions:{}})},M=>{S&&i({status:"error",message:M instanceof Error?M.message:String(M)})}),()=>{S=!1})},[e,g]);let y=o.status==="ready"?o.bundles.filter(S=>S.optional===!0||Fg[S.name]!==void 0):[],w=async(S,M)=>{if(s===null){a(S.name),u(null);try{await e.setBundleEnabled(S.name,M).then(ds),u({severity:"status",message:`${S.name}\uFF1A\u5DF2${M?"\u542F\u7528":"\u505C\u7528"}\uFF08\u5237\u65B0\u9875\u9762\u540E\u751F\u6548\uFF09\u3002`}),d(H=>H+1)}catch(H){u({severity:"error",message:`${S.name}\uFF1A${H instanceof Error?H.message:String(H)}`})}finally{a(null)}}},_=async(S,M)=>{if(s===null){a(S);try{await e.setVersionExemption(S,M,!1,!0).then(ds),u({severity:"status",message:`${S}\uFF1A\u5DF2\u64A4\u9500 ${M} \u7684\u8C41\u514D\u3002`}),d(H=>H+1)}catch(H){u({severity:"error",message:String(H instanceof Error?H.message:H)})}finally{a(null)}}},v={display:"flex",alignItems:"center",gap:12,border:"1px solid var(--dsw-alias-border-l2)",background:"var(--dsw-alias-bg-layer-1)",borderRadius:10,padding:"12px 14px"},$={width:38,height:38,flex:"0 0 auto",borderRadius:9,background:"var(--dsw-alias-bg-layer-3)",display:"grid",placeItems:"center",fontSize:17},z=S=>({border:`1px solid ${S??"var(--dsw-alias-border-l2)"}`,color:S??"var(--dsw-alias-label-tertiary)",borderRadius:999,padding:"1px 7px",fontSize:11,whiteSpace:"nowrap"}),R=Object.entries(o.exemptions??{});return o.status==="unavailable"?(0,c.jsx)("p",{style:{margin:0,fontSize:13,color:"var(--dsw-alias-label-tertiary)"},children:r("officialUnavailable")}):o.status==="loading"?(0,c.jsx)("p",{style:{margin:0,fontSize:13,color:"var(--dsw-alias-label-tertiary)"},children:r("loading")}):o.status==="error"?(0,c.jsxs)("div",{role:"alert",style:{display:"flex",gap:10,alignItems:"center",fontSize:13,color:"var(--dsw-alias-state-error-primary)"},children:[(0,c.jsx)("span",{children:o.message}),(0,c.jsx)("button",{type:"button",onClick:()=>d(S=>S+1),style:j,children:r("retry")})]}):(0,c.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[(0,c.jsx)("p",{style:{margin:0,fontSize:12.5,color:"var(--dsw-alias-label-tertiary)"},children:r("officialIntro")}),l?(0,c.jsx)("p",{role:l.severity==="error"?"alert":"status",style:{margin:0,fontSize:12,color:l.severity==="error"?"var(--dsw-alias-state-error-primary)":"var(--dsw-alias-label-tertiary)"},children:l.message}):null,(0,c.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:8,fontSize:13,fontWeight:600},children:[r("officialTitle"),(0,c.jsxs)("span",{style:{color:"var(--dsw-alias-label-tertiary)",fontWeight:400,fontSize:12},children:["(",y.length,")"]})]}),y.length===0?(0,c.jsx)("p",{style:{margin:0,fontSize:13,color:"var(--dsw-alias-label-tertiary)"},children:r("officialEmpty")}):(0,c.jsx)("ul",{style:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column",gap:8},children:y.map(S=>{let M=Fg[S.name]??{name:S.name,note:S.description??"",glyph:"\u{1F4E6}"},H=s===S.name;return(0,c.jsxs)("li",{style:{display:"block"},children:[(0,c.jsxs)("div",{style:v,children:[(0,c.jsx)("div",{style:$,children:M.glyph}),(0,c.jsxs)("div",{style:{minWidth:0,flex:"1 1 auto"},children:[(0,c.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:7,flexWrap:"wrap"},children:[(0,c.jsx)("span",{style:{fontSize:14,fontWeight:600},children:M.name}),S.version?(0,c.jsxs)("span",{style:{fontSize:11.5,color:"var(--dsw-alias-label-tertiary)"},children:["v",S.version]}):null,(0,c.jsx)("span",{style:z(),children:r("officialOptional")}),(0,c.jsx)("span",{style:z(S.enabled?"var(--dsw-alias-state-success-primary, #22c55e)":"var(--dsw-alias-state-warning-primary, #f59e0b)"),children:S.enabled?r("officialEnabled"):r("officialNotEnabled")}),S.installed?(0,c.jsx)("span",{style:z(),children:r("officialInstalled")}):null,S.error?(0,c.jsx)("span",{style:z("var(--dsw-alias-state-error-primary)"),children:String(S.error.code??"\u9519\u8BEF")}):null]}),(0,c.jsx)("div",{style:{fontSize:12.5,color:"var(--dsw-alias-label-tertiary)",marginTop:3},children:M.note||S.name}),(0,c.jsx)("div",{style:{fontSize:11,color:"var(--dsw-alias-label-tertiary)",marginTop:2,fontFamily:"var(--ds-font-family-code)"},children:S.name})]}),(0,c.jsx)("div",{style:{marginLeft:"auto",display:"flex",alignItems:"center",gap:8,flex:"0 0 auto"},children:S.enabled?(0,c.jsx)("button",{type:"button",disabled:s!==null,onClick:()=>w(S,!1),style:{...j,...s!==null?{opacity:.6,cursor:"default"}:null},children:r("officialDisable")}):(0,c.jsx)("button",{type:"button",disabled:s!==null,onClick:()=>w(S,!0),style:{...j,background:"var(--dsw-alias-state-business-primary, #4f8cff)",borderColor:"transparent",color:"#fff",fontWeight:600,...s!==null?{opacity:.6,cursor:"default"}:null},children:r(H?"officialInstalling":"officialInstall")})})]}),S.installed?null:(0,c.jsx)("div",{style:{marginLeft:50,marginTop:4,fontSize:11.5,color:"var(--dsw-alias-label-tertiary)"},children:r("installHint")})]},S.name)})}),h.length>0?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:8,fontSize:13,fontWeight:600,marginTop:6},children:[r("officialItems"),(0,c.jsxs)("span",{style:{color:"var(--dsw-alias-label-tertiary)",fontWeight:400,fontSize:12},children:["(",h.length,")"]})]}),(0,c.jsx)("ul",{style:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column",gap:8},children:h.map(S=>{let M=p===S.id,H=typeof n=="function";return(0,c.jsxs)("li",{style:{display:"block"},children:[(0,c.jsxs)("div",{style:v,children:[(0,c.jsx)("div",{style:$,children:"\u{1F9E9}"}),(0,c.jsxs)("div",{style:{minWidth:0,flex:"1 1 auto"},children:[(0,c.jsx)("div",{style:{fontSize:14,fontWeight:600},children:S.label}),(0,c.jsx)("div",{style:{fontSize:11,color:"var(--dsw-alias-label-tertiary)",fontFamily:"var(--ds-font-family-code)"},children:S.id}),H?(0,c.jsx)("div",{style:{marginTop:3,fontSize:12,lineHeight:"18px",color:"var(--dsw-alias-label-secondary)"},children:n("plugins.item",{view:"summary"},{only:S.id})}):(0,c.jsx)("div",{style:{marginTop:3,fontSize:11.5,color:"var(--dsw-alias-label-tertiary)"},children:r("configMainPageHint")})]}),H?(0,c.jsx)("button",{type:"button",onClick:()=>m(M?null:S.id),style:j,children:r(M?"officialClose":"officialOpen")}):null]}),M&&H?(0,c.jsx)("div",{style:{marginTop:8,marginLeft:50,border:"1px solid var(--dsw-alias-border-l2)",borderRadius:10,padding:"12px 14px",background:"var(--dsw-alias-bg-layer-1)"},children:n("plugins.item",{view:"page"},{only:S.id})}):null]},S.id)})})]}):null,(0,c.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:8,fontSize:13,fontWeight:600,marginTop:6},children:[r("exemptions"),(0,c.jsxs)("span",{style:{color:"var(--dsw-alias-label-tertiary)",fontWeight:400,fontSize:12},children:["(",R.length,")"]})]}),R.length===0?(0,c.jsx)("p",{style:{margin:0,fontSize:12.5,color:"var(--dsw-alias-label-tertiary)"},children:r("exemptionsEmpty")}):(0,c.jsx)("ul",{style:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column",gap:6},children:R.flatMap(([S,M])=>(Array.isArray(M)?M:[]).map(H=>(0,c.jsxs)("li",{style:{display:"flex",alignItems:"center",gap:8,fontSize:12.5,color:"var(--dsw-alias-label-secondary, var(--dsw-alias-label-tertiary))"},children:[(0,c.jsx)("code",{style:{fontFamily:"var(--ds-font-family-code)"},children:S}),(0,c.jsx)("span",{style:{color:"var(--dsw-alias-label-tertiary)"},children:"\u2190"}),(0,c.jsx)("code",{style:{fontFamily:"var(--ds-font-family-code)"},children:H}),(0,c.jsx)("button",{type:"button",disabled:s!==null,onClick:()=>_(S,H),style:{...j,marginLeft:"auto"},children:r("exemptionRevoke")})]},`${S}@${H}`)))})]})}function Bg(e){let t=e.t,[n,r]=N("official"),[o,i]=N("history"),[s,a]=N("sources"),[l,u]=N(null),[p,m]=N(null);Ie(()=>{if(n!=="market"&&n!=="maintenance")return;let _=!0;return e.list().then(v=>{_&&u(v)},()=>{}),()=>{_=!1}},[n,e.list]);let g=[{id:"official",label:t("tabOfficial")},{id:"list",label:t("tabAll")},{id:"market",label:t("tabMarket")},{id:"ops",label:t("tabOps")},{id:"maintenance",label:t("tabMaintenance")}],d=_=>({padding:"7px 11px",fontSize:13,font:"inherit",cursor:"pointer",background:"transparent",border:"none",borderBottom:`2px solid ${_?"var(--dsw-alias-state-business-primary, #4f8cff)":"transparent"}`,color:_?"var(--dsw-alias-label-primary)":"var(--dsw-alias-label-tertiary)",fontWeight:_?600:400}),h=(_,v,$)=>(0,c.jsx)("div",{style:{display:"flex",gap:6,marginBottom:12,flexWrap:"wrap"},children:_.map(z=>(0,c.jsx)("button",{type:"button",onClick:()=>$(z.id),style:{...j,fontWeight:v===z.id?600:400,color:v===z.id?"var(--dsw-alias-state-business-primary, #4f8cff)":"var(--dsw-alias-label-primary)",borderColor:v===z.id?"var(--dsw-alias-state-business-primary, #4f8cff)":"var(--dsw-alias-border-l2)"},children:z.label},z.id))}),y=async _=>{let v=Array.isArray(_)&&_.some($=>$&&$.authoritative===!0&&$.official!==!0);if(!(v&&!window.confirm(t("sourcesAuthoritativeConfirm")))){m("sources");try{let $=await e.setSources(_,v?{confirm:!0}:null);u($)}finally{m(null)}}},w=l!==null?l.entries:[];return(0,c.jsx)("section",{"data-plugin-panel":"drydock",style:{boxSizing:"border-box",height:"100%",overflowY:"auto",overflowX:"hidden",padding:"22px 26px 44px",color:"var(--dsw-alias-label-primary)"},children:(0,c.jsxs)("div",{style:{maxWidth:960,margin:"0 auto",display:"flex",flexDirection:"column",gap:14},children:[(0,c.jsxs)("header",{"data-window-drag":"true",children:[(0,c.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,flexWrap:"wrap"},children:[(0,c.jsxs)("h1",{style:{margin:0,fontSize:20,fontWeight:600},children:[(0,c.jsx)(ih,{size:20})," ",t("title")]}),(0,c.jsx)("span",{style:{fontSize:11,fontWeight:600,padding:"2px 9px",borderRadius:999,background:"color-mix(in srgb, var(--dsw-alias-state-business-primary, #4f8cff) 14%, transparent)",color:"var(--dsw-alias-state-business-primary, #4f8cff)"},children:t("managerBadge")})]}),(0,c.jsx)("p",{style:{margin:"4px 0 0",fontSize:12.5,color:"var(--dsw-alias-label-tertiary)"},children:t("pageSubtitle")})]}),(0,c.jsx)("nav",{style:{display:"flex",gap:4,borderBottom:"1px solid var(--dsw-alias-border-l2)",flexWrap:"wrap"},children:g.map(_=>(0,c.jsx)("button",{type:"button",onClick:()=>r(_.id),style:d(n===_.id),children:_.label},_.id))}),n==="official"?(0,c.jsx)(Jt,{children:(0,c.jsx)(sh,{officialApi:e.officialApi,itemsSource:e.officialItemsSource,renderSlot:e.renderSlot,t})}):null,n==="list"?(0,c.jsx)(Jt,{children:(0,c.jsx)(qg,{...e,embedded:!0})}):null,n==="market"?(0,c.jsx)(Jt,{children:(0,c.jsx)(rh,{marketCatalog:e.marketCatalog,marketInstall:e.marketInstall,busy:p!==null,t,entries:w})}):null,n==="ops"?(0,c.jsxs)(Jt,{children:[h([{id:"history",label:t("history")},{id:"scenarios",label:t("scenarios")}],o,i),o==="history"?(0,c.jsx)(Qg,{operationHistory:e.operationHistory,undoOperation:e.undoOperation,onSnapshot:u,t}):(0,c.jsx)(eh,{scenarioList:e.scenarioList,scenarioSave:e.scenarioSave,scenarioUpdate:e.scenarioUpdate,scenarioDelete:e.scenarioDelete,scenarioApply:e.scenarioApply,onSnapshot:u,t})]}):null,n==="maintenance"?(0,c.jsxs)(Jt,{children:[h([{id:"sources",label:t("sources")},{id:"rescue",label:t("rescue")}],s,a),s==="sources"?(0,c.jsx)(oh,{sources:l!==null?l.sources:[],save:y,busy:p!==null,t}):(0,c.jsx)(Yg,{diagnose:e.diagnose,quarantine:e.quarantine,repairHarness:e.repairHarness,restartHarness:e.restartHarness,uninstallPackages:e.uninstallPackages,uninstallPreview:e.uninstallPreview,getRescueConfig:e.getRescueConfig,setRescueConfig:e.setRescueConfig,getDownloadConfig:e.getDownloadConfig,checkDownloads:e.checkDownloads,verifyProfile:e.verifyProfile,fixProfile:e.fixProfile,managed:w.filter(_=>_.origin==="user"),t})]}):null]})})}var jk={tab:"\u63D2\u4EF6\u7BA1\u7406",tabOfficial:"\u5B98\u65B9\u5185\u7F6E\uFF08\u53EF\u9009\uFF09",tabAll:"\u5168\u90E8\u63D2\u4EF6",tabUpdate:"\u53EF\u66F4\u65B0",tabMarket:"\u63D2\u4EF6\u5E02\u573A",tabOps:"\u64CD\u4F5C\u4E0E\u573A\u666F",tabMaintenance:"\u7EF4\u62A4",onlyUpdatable:"\u4EC5\u663E\u793A\u53EF\u66F4\u65B0",pageSubtitle:"\u5DF2\u63A5\u7BA1\u5185\u7F6E\u63D2\u4EF6\u9875 \xB7 \u4FA7\u8FB9\u680F\u300C\u63D2\u4EF6\u7BA1\u7406\u300D",officialTitle:"\u5B98\u65B9\u5185\u7F6E\u53EF\u9009\u63D2\u4EF6",officialIntro:"\u5F15\u64CE\u81EA\u5E26\u3001\u9ED8\u8BA4\u672A\u542F\u7528\u7684\u80FD\u529B\u5305\uFF1B\u542F\u7528\u540E\u5373\u53EF\u4F7F\u7528\uFF0C\u90E8\u5206\u63D2\u4EF6\u8FD8\u81EA\u5E26\u914D\u7F6E\u9875\u3002",officialEmpty:"\u6CA1\u6709\u53D1\u73B0\u5B98\u65B9\u53EF\u9009\u63D2\u4EF6\u3002",officialUnavailable:"\u5F15\u64CE\u672A\u63D0\u4F9B\u5B98\u65B9\u63D2\u4EF6\u6E05\u5355\u63A5\u53E3\uFF08pluginManager remote \u4E0D\u53EF\u7528\uFF09\u3002",officialInstall:"\u542F\u7528",officialInstalling:"\u542F\u7528\u4E2D\u2026",officialDisable:"\u505C\u7528",officialInstalled:"\u5DF2\u5B89\u88C5",officialNotInstalled:"\u672A\u5B89\u88C5",officialEnabled:"\u5DF2\u542F\u7528",officialNotEnabled:"\u672A\u542F\u7528",officialOptional:"\u53EF\u9009",officialItems:"\u81EA\u5E26\u914D\u7F6E\u9875\u7684\u5B98\u65B9\u63D2\u4EF6",officialOpen:"\u6253\u5F00\u914D\u7F6E\u9875",officialClose:"\u6536\u8D77",exemptions:"\u7248\u672C\u8C41\u514D",exemptionsEmpty:"\u6682\u65E0\u7248\u672C\u8C41\u514D\u8BB0\u5F55\u3002",exemptionRevoke:"\u64A4\u9500",installHint:"\u300C\u542F\u7528\u300D\u4F1A\u901A\u8FC7 pnpm \u5B89\u88C5\u8BE5\u7EC4\u5408\u5305\uFF0C\u53EF\u80FD\u9700\u8981\u4E0B\u8F7D\u4F9D\u8D56\u3002",title:"\u5F15\u64CE\u4E0E\u63D2\u4EF6\u7BA1\u7406\u53F0",profile:"\u5F53\u524D\u914D\u7F6E",search:"\u641C\u7D22\u63D2\u4EF6\u540D\u79F0/\u7B80\u4ECB/\u5305\u540D",refresh:"\u68C0\u67E5\u66F4\u65B0\u5E76\u5237\u65B0\u72B6\u6001",refreshDone:"\u68C0\u67E5\u66F4\u65B0\u5B8C\u6210",refreshAborted:"\u7F51\u7EDC\u8F83\u6162\uFF1A\u68C0\u67E5\u66F4\u65B0\u5DF2\u5728\u603B\u9884\u7B97\u5185\u4E2D\u6B62",refreshAbortedHint:"\uFF0C\u7ED3\u679C\u53EF\u80FD\u4E0D\u5B8C\u6574\uFF08\u5931\u8D25\u4E0D\u4F1A\u88AB\u7F13\u5B58\uFF09\uFF0C\u7F51\u7EDC\u6062\u590D\u540E\u53EF\u76F4\u63A5\u91CD\u8BD5\u3002",loading:"\u6B63\u5728\u8BFB\u53D6\u63D2\u4EF6\u2026",error:"\u6682\u65F6\u65E0\u6CD5\u8BFB\u53D6\u63D2\u4EF6\u3002",retry:"\u91CD\u8BD5",empty:"\u6682\u65E0\u53EF\u663E\u793A\u7684\u63D2\u4EF6\u3002",emptySearch:"\u6CA1\u6709\u5339\u914D\u7684\u63D2\u4EF6\u3002",legendNecessity:"\u5FC5\u8981\u7A0B\u5EA6",legendStatus:"\u542F\u7528\u72B6\u6001",legendOrigin:"\u6765\u6E90",originLegend:"\u6765\u6E90",originAll:"\u5168\u90E8",originBuiltin:"\u67B6\u6784\u81EA\u5E26",originUser:"\u7528\u6237\u5B89\u88C5",originUserHint:"\u7528\u6237/agent \u5B89\u88C5\uFF1Adsh plugin add \u6216\u63D2\u4EF6\u5E02\u573A\u5B89\u88C5",configEntry:"\u914D\u7F6E",configEntryHint:"\u6253\u5F00\u8BE5\u63D2\u4EF6\u7684\u81EA\u5E26\u914D\u7F6E\u9762\u677F\uFF08\u7531\u63D2\u4EF6\u81EA\u8EAB\u63D0\u4F9B\uFF09",configBundleEntry:"\u63D2\u4EF6\u914D\u7F6E",configMainPageHint:"\u8BF7\u5728\u4FA7\u8FB9\u680F\u300C\u63D2\u4EF6\u7BA1\u7406\u300D\u9875\u4E2D\u6253\u5F00\u8BE5\u914D\u7F6E\u9875\u3002",necessityCore:"\u6838\u5FC3\u7EC4\u4EF6\uFF08\u5F15\u64CE\u5FC5\u9700\uFF0C\u4E0D\u5141\u8BB8\u7981\u7528\uFF09",badgeCore:"\u6838\u5FC3",necessityBuiltin:"\u5F15\u64CE\u5185\u7F6E\u7EC4\u4EF6",badgeBuiltin:"\u5185\u7F6E",necessityUser:"\u7528\u6237\u63D2\u4EF6",badgeUser:"\u7528\u6237",recommendedTag:"\u63A8\u8350",recommendedTagHint:"\u63A8\u8350\u52A0\u88C5\uFF1A\u7BA1\u7406\u5668\u5EFA\u8BAE\u5B89\u88C5\u7684\u7B2C\u4E09\u65B9\u589E\u5F3A\u63D2\u4EF6",managerBadge:"\u7BA1\u7406\u5668",marketDetail:"\u5E02\u573A\u8BE6\u60C5",marketDetailHint:"\u5728\u63D2\u4EF6\u5E02\u573A\uFF08ADP \u7CBE\u9009\u76EE\u5F55\uFF09\u4E2D\u67E5\u770B\u8BE5\u63D2\u4EF6",statusError:"\u9519\u8BEF/\u9700\u68C0\u67E5",statusUpdate:"\u9700\u66F4\u65B0",statusDisabled:"\u672A\u542F\u7528",statusEnabled:"\u542F\u7528",enableEntry:"\u542F\u7528",disableEntry:"\u505C\u7528",versionUnknown:"\u7248\u672C\u672A\u77E5",versionNetworkError:"\u7F51\u7EDC\u4E0D\u53EF\u8FBE\uFF0C\u53EF\u91CD\u8BD5",versionNotFound:"\u66F4\u65B0\u6E90\u6CA1\u6709\u6B64\u63D2\u4EF6/\u65E0\u66F4\u65B0",versionBackoff:"\u66F4\u65B0\u6E90\u9650\u6D41\u51B7\u5374\u4E2D\uFF0C\u7A0D\u540E\u81EA\u52A8\u91CD\u8BD5",update:"\u66F4\u65B0",updateInternal:"\u5185\u7F6E",updateInternalHint:"\u4F7F\u7528\u7BA1\u7406\u5668\u5185\u7F6E\u4E0B\u8F7D\u5668\uFF08HTTP/P2P/aria2\uFF09\uFF0C\u4E0D\u8D70\u6D4F\u89C8\u5668\u4E0B\u8F7D",updateAll:"\u68C0\u67E5\u66F4\u65B0",upToDate:"\u5DF2\u662F\u6700\u65B0\u7248\u672C",notManaged:"\u968F\u5B89\u88C5\u66F4\u65B0",updateAvailable:"\u53EF\u66F4\u65B0",selfUpdateTitle:"\u7BA1\u7406\u5668\u81EA\u8EAB",selfUpdateUpToDate:"\u5DF2\u662F\u6700\u65B0\uFF08\u5F53\u524D {v}\uFF09",selfUpdateCheck:"\u68C0\u67E5\u81EA\u8EAB\u66F4\u65B0",selfUpdateChecking:"\u68C0\u67E5\u4E2D\u2026\uFF08\u4E0B\u8F7D\u5E76\u6821\u9A8C\uFF09",selfUpdateNow:"\u73B0\u5728\u5347\u7EA7",selfUpdateLater:"\u7A0D\u540E",selfUpdateRunning:"\u6B63\u5728\u5347\u7EA7\uFF1A\u5F15\u64CE\u4F1A\u77ED\u6682\u91CD\u542F\uFF0C\u5B8C\u6210\u540E\u5237\u65B0\u672C\u9875",selfUpdateDesktopOnly:"\u684C\u9762\u5F62\u6001\u4E0D\u81EA\u52A8\u5B89\u88C5\uFF08profile \u7531\u5B98\u65B9\u5E94\u7528\u72EC\u5360\uFF09\uFF1A\u8BF7\u6309\u63D0\u793A\u7528\u684C\u9762\u7248\u81EA\u5E26 CLI \u5B89\u88C5",showMoreRows:"\u663E\u793A\u66F4\u591A\uFF08\u5269\u4F59 {n}\uFF09",expandAll:"\u5168\u90E8\u5C55\u5F00",collapseAll:"\u5168\u90E8\u6536\u8D77",sources:"\u66F4\u65B0\u6E90",sourcesTitle:"\u66F4\u65B0\u6E90\u914D\u7F6E",sourcesHint:"\u7248\u672C\u68C0\u67E5\u4E0E\u66F4\u65B0\u4ECE\u542F\u7528\u7684\u6E90\u83B7\u53D6\uFF1B\u5B98\u65B9 npm \u6E90\u3001npmmirror \u4E0E GitHub \u5B98\u65B9\u4ED3\u5E93\u5DF2\u9884\u586B\u3002\u81EA\u5B9A\u4E49\u6E90\u9ED8\u8BA4\u53EA\u4F5C\u515C\u5E95\uFF08degraded\uFF09\uFF0C\u4E0D\u4E0E\u5B98\u65B9\u6E90\u6DF7\u6BD4\u7248\u672C\uFF1B\u8981\u8BA9\u5B83\u53C2\u4E0E\u6743\u5A01\u88C1\u51B3\u9700\u663E\u5F0F\u52FE\u9009\u300C\u6743\u5A01\u300D\u3002http:// \u6E90\u9ED8\u8BA4\u6807\u6CE8\u300C\u660E\u6587\xB7\u4EC5\u515C\u5E95\u300D\uFF0C\u5347\u6743\u5A01\u8FD8\u987B\u540C\u65F6\u52FE\u9009\u300C\u5141\u8BB8\u660E\u6587\u300D\u3002GitHub \u6E90\u9002\u7528\u4E8E\u4ED3\u5E93\u6839 package.json \u7684 name \u5339\u914D\u5305\u540D\u3001\u5E76\u4EE5 GitHub Releases \u53D1\u7248\u7684\u63D2\u4EF6\u3002",sourcesSaved:"\u66F4\u65B0\u6E90\u5DF2\u4FDD\u5B58\uFF0C\u6B63\u5728\u91CD\u65B0\u68C0\u67E5\u7248\u672C\u2026",sourcesAuthoritativeConfirm:"\u5C06\u628A\u975E\u5185\u7F6E\u6E90\u5347\u4E3A\u300C\u6743\u5A01\u300D\uFF1A\u7248\u672C\u88C1\u51B3\u4E0E\u5B89\u88C5\u6765\u6E90\u90FD\u4EE5\u5B83\u4E3A\u51C6\u3002\u786E\u8BA4\u53EA\u5BF9\u53EF\u4FE1\u7684\u5185\u7F51/\u79BB\u7EBF\u955C\u50CF\u5F00\u542F\uFF1F",resetSources:"\u6062\u590D\u9ED8\u8BA4\u6E90",authoritative:"\u6743\u5A01",authoritativeHint:"\u628A\u8BE5\u6E90\u5347\u4E3A\u6743\u5A01\u5C42\uFF1A\u7248\u672C\u88C1\u51B3\u4E0E\u5B89\u88C5\u4EE5\u5B83\u4E3A\u51C6\uFF08\u5B98\u65B9\u6E90\u4E0D\u53EF\u7528\u65F6\u4ECD\u53EF\u7528\uFF09\u3002\u53EA\u5BF9\u53EF\u4FE1\u7684\u5185\u7F51\u955C\u50CF/\u79BB\u7EBF\u6E90\u5F00\u542F\u3002",allowInsecure:"\u5141\u8BB8\u660E\u6587",allowInsecureHint:"\u8BE5\u6E90\u662F http:// \u660E\u6587\u4F20\u8F93\uFF0C\u9ED8\u8BA4\u53EA\u4F5C\u515C\u5E95\uFF1B\u5347\u4E3A\u6743\u5A01\u5FC5\u987B\u540C\u65F6\u663E\u5F0F\u786E\u8BA4\u6B64\u9879\u3002",plaintextFallback:"\u660E\u6587\xB7\u4EC5\u515C\u5E95",plaintextAuthoritative:"\u660E\u6587\xB7\u6743\u5A01",plaintextFallbackHint:"\u660E\u6587 http:// \u6E90\uFF1A\u5185\u5BB9\u53EF\u5728\u4F20\u8F93\u4E2D\u88AB\u7BE1\u6539\uFF0C\u9ED8\u8BA4\u53EA\u4F5C fallback \u515C\u5E95\uFF0C\u4E0D\u53C2\u4E0E\u6743\u5A01\u7248\u672C\u88C1\u51B3\u3002",addSource:"\u6DFB\u52A0",remove:"\u5220\u9664",sourceName:"\u6E90\u540D\u79F0",sourceUrl:"\u6E90\u5730\u5740 (https://\u2026)",saveSources:"\u4FDD\u5B58\u66F4\u65B0\u6E90",official:"\u5B98\u65B9",enabled:"\u542F\u7528",noSources:"\u6CA1\u6709\u542F\u7528\u7684\u66F4\u65B0\u6E90\uFF0C\u7248\u672C\u68C0\u67E5\u4E0D\u53EF\u7528\u3002",resetToggles:"\u91CD\u7F6E\u5F00\u5173",resetConfirm:"\u786E\u5B9A\u8FD8\u539F\u6240\u6709\u7531\u7BA1\u7406\u5668\u4FEE\u6539\u7684\u63D2\u4EF6\u5F00\u5173\u72B6\u6001\uFF1F\uFF08\u4EC5\u6E05\u9664\u7BA1\u7406\u5668\u5199\u5165\u7684\u884C\uFF0C\u4E0D\u5F71\u54CD\u7528\u6237\u81EA\u5B9A\u4E49\u914D\u7F6E\uFF09",resetDone:"\u5DF2\u8FD8\u539F\u6240\u6709\u5F00\u5173\u72B6\u6001\u3002",archived:"\u67B6\u6784\u4FDD\u7559",rescue:"\u6551\u63F4",rescueTitle:"\u6551\u63F4\u4E2D\u5FC3",rescueHint:"\u8BCA\u65AD\u52A0\u8F7D\u5931\u8D25\u7684\u63D2\u4EF6\u5E76\u9694\u79BB/\u5378\u8F7D\uFF1B\u4E00\u952E\u4FEE\u590D\u4F1A\u91CD\u7F6E\u5F00\u5173\u3001\u9694\u79BB\u95EE\u9898\u63D2\u4EF6\u3001\u6E05\u7A7A\u7F13\u5B58\u3002\u72EC\u7ACB\u6551\u63F4\u9875 /rescue \u5728\u8BBE\u7F6E\u9875\u4E0D\u53EF\u7528\u65F6\u4ECD\u53EF\u8BBF\u95EE\uFF08\u53F3\u4E0B\u89D2 \u{1F6DF} \u6309\u94AE\uFF09\u3002",rescueDiagnose:"\u8FD0\u884C\u8BCA\u65AD",rescueModHealth:"\u{1FA7A} mod \u4F53\u68C0",rescueModHealthHint:"mod \u4F53\u68C0\uFF08preflight \u53EA\u8BFB\u6821\u9A8C + \u5F15\u64CE\u65E5\u5FD7\u9519\u8BEF\u805A\u5408\uFF09\u7531\u542F\u52A8\u5668\u515C\u5E95\u9875\u63D0\u4F9B\uFF0C\u70B9\u51FB\u300Cmod \u4F53\u68C0\u300D\u5728\u542F\u52A8\u5668\u515C\u5E95\u9875\u67E5\u770B\uFF1B\u6551\u63F4\u8BCA\u65AD\u4E0E\u672C\u9762\u677F\u5171\u7528\u6551\u63F4\u7403\u5165\u53E3\u3002",rescueClean:"\u2713 \u672A\u53D1\u73B0\u52A0\u8F7D\u5931\u8D25\u6216\u8FD0\u884C\u671F\u9519\u8BEF\u3002",rescueDisable:"\u7981\u7528\u6B64\u63D2\u4EF6",rescueUninstall:"\u5378\u8F7D",rescueProtected:"\u6551\u63F4\u4FDD\u62A4\u6761\u76EE",rescueRepair:"\u4E00\u952E\u4FEE\u590D\u5F15\u64CE",rescueRepairConfirm:"\u786E\u8BA4\u6267\u884C\u4FEE\u590D\uFF1F\u5C06\u91CD\u7F6E\u7BA1\u7406\u5668\u5F00\u5173\u3001\u9694\u79BB\u5168\u90E8\u5931\u8D25\u63D2\u4EF6\u5E76\u6E05\u7A7A\u7F13\u5B58\u3002",rescueRepairDone:"\u2713 \u4FEE\u590D\u5B8C\u6210",rescueRestartHint:"\u91CD\u542F\u547D\u4EE4\uFF1A",rescueRestart:"\u91CD\u542F\u5F15\u64CE",rescueRestartConfirm:"\u786E\u8BA4\u91CD\u542F dsh web \u5F15\u64CE\uFF1F\u5F53\u524D\u9875\u9762\u5C06\u65AD\u8FDE\uFF0C\u7EA6 3-5 \u79D2\u540E\u6062\u590D\uFF08\u8BF7\u5237\u65B0\u9875\u9762\uFF09\u3002",rescueAuto:"\u5931\u8D25\u63D2\u4EF6\u81EA\u52A8\u9694\u79BB",rescueAutoSaved:"\u81EA\u52A8\u9694\u79BB\u8BBE\u7F6E\u5DF2\u4FDD\u5B58\u3002",rescueUninstallList:"\u53EF\u5378\u8F7D\u7684 profile \u4F9D\u8D56\uFF1A",rescueUninstallConfirm:"\u786E\u8BA4\u5378\u8F7D",sourceOverrideHint:"\u6765\u6E90\u6807\u7B7E\uFF08\u81EA\u52A8\u5224\u5B9A\uFF0C\u53EF\u624B\u52A8\u8986\u76D6\u5E76\u6301\u4E45\u5316\uFF09",sourceAuto:"\u81EA\u52A8",sourceNpm:"npm",sourceGithub:"GitHub",sourceLocal:"\u672C\u5730",sourceBuiltin:"\u5185\u7F6E",uninstallTitle:"\u5378\u8F7D\u5F71\u54CD\u9884\u89C8",uninstallRowHint:"\u5378\u8F7D\u8BE5\u63D2\u4EF6",uninstallPreviewLoading:"\u6B63\u5728\u5206\u6790\u5F71\u54CD\u8303\u56F4\u2026",uninstallPreviewFail:"\u5F71\u54CD\u9884\u89C8\u5931\u8D25",uninstallPreviewHint:"\u5C06\u6267\u884C\u4E8B\u52A1\u5316\u5378\u8F7D\uFF1A\u5907\u4EFD\u914D\u7F6E \u2192 \u5220\u9664\u76EE\u6807\u5305\u4E0E\u8865\u4E01\u884C \u2192 \u6821\u9A8C \u2192 \u5F02\u5E38\u81EA\u52A8\u56DE\u6EDA\u3002\u8BF7\u786E\u8BA4\u5F71\u54CD\u8303\u56F4\uFF1A",uninstallAffectedEntries:"\u5C06\u79FB\u9664\u7684\u63D2\u4EF6\u6761\u76EE",uninstallNoEntries:"\u8BE5\u5305\u6CA1\u6709\u6CE8\u518C\u63D2\u4EF6\u6761\u76EE\uFF08\u4EC5\u79FB\u9664\u4F9D\u8D56\uFF09\u3002",uninstallBundleRow:"\u8BE5\u5305\u5728 bundles \u6E05\u5355\u4E2D\uFF08\u5C06\u79FB\u9664\u542F\u52A8\u58F0\u660E\uFF09\u3002",uninstallPatchRows:"\u5C06\u6E05\u7406\u7684\u7BA1\u7406\u5668\u5F00\u5173\u884C",uninstallDependents:"\u4EE5\u4E0B\u5DF2\u5B89\u88C5\u63D2\u4EF6\u4F9D\u8D56\u8BE5\u5305\uFF0C\u5378\u8F7D\u4F1A\u9020\u6210\u4F9D\u8D56\u65AD\u88C2",uninstallCascade:"\u7EA7\u8054\u5378\u8F7D\u4F9D\u8D56\u63D2\u4EF6",uninstallVerdictLine:"\u672C\u6B21\u5378\u8F7D",uninstallVerdictSafe:"\u5B89\u5168",uninstallVerdictCaution:"\u9700\u6CE8\u610F",uninstallVerdictRisky:"\u6709\u98CE\u9669",uninstallCheckTitle:"\u5378\u8F7D\u524D\u4F53\u68C0",uninstallCheckHint:"\u4E09\u7C7B\u53EA\u8BFB\u68C0\u67E5\uFF1A\u4F9D\u8D56\u65AD\u88C2 / patch \u6B8B\u7559 / \u91CD\u590D service\xB7\u7AEF\u53E3\uFF08\u4E0D\u4F1A\u6539\u52A8\u4EFB\u4F55 profile \u6587\u4EF6\uFF09",uninstallCheckHigh:"\u9AD8\u98CE\u9669",uninstallCheckWarning:"\u63D0\u793A",uninstallCheckInfo:"\u4FE1\u606F",uninstallCheckEmpty:"\u6CA1\u6709\u9700\u8981\u63D0\u793A\u7684\u4F53\u68C0\u9879\u3002",uninstallSelfHint:"\u8FD9\u662F\u7BA1\u7406\u5668\u81EA\u8EAB\uFF1A\u5378\u8F7D\u524D\u4F1A\u5148\u6267\u884C bin/open-boot.mjs --uninstall \u6E05\u7406\u5F00\u673A\u81EA\u542F\uFF08\u505C\u672C profile \u5B88\u62A4 \u2192 \u5220 DSHWeb* \u81EA\u542F\u503C \u2192 \u5220 .vbs \u2192 \u6E05 pid\uFF09\u3002\u5931\u8D25\u6216\u8D85\u65F6\u4E0D\u963B\u65AD\u5378\u8F7D\uFF0C\u7ED3\u679C\u4F1A\u5199\u8FDB\u5378\u8F7D\u62A5\u544A\u4E0E\u64CD\u4F5C\u5386\u53F2\u3002",uninstallSelfReport:"\u7BA1\u7406\u5668\u81EA\u8EAB\u5DF2\u5378\u8F7D\uFF1A\u91CD\u542F\u5F15\u64CE\u540E\u672C\u9875\u9762\u6D88\u5931\uFF1B\u5982\u8981\u88C5\u56DE\uFF0C\u7528 dsh plugin --profile <name> add dsh-drydock\u3002",uninstallAutostartTitle:"\u5F00\u673A\u81EA\u542F\u6E05\u7406",uninstallAutostartCleaned:"\u5DF2\u5B8C\u6210",uninstallAutostartSkipped:"\u5DF2\u8DF3\u8FC7\uFF08\u5305\u5185\u6CA1\u6709 --uninstall\uFF0C\u65E7\u7248\u672C\uFF09",uninstallAutostartFailed:"\u672A\u6210\u529F\uFF08\u4E0D\u5F71\u54CD\u5378\u8F7D\uFF09",uninstallAutostartTimeout:"\u8D85\u65F6\uFF08\u4E0D\u5F71\u54CD\u5378\u8F7D\uFF09",uninstallConfirm:"\u786E\u8BA4\u5378\u8F7D",uninstalling:"\u5378\u8F7D\u4E2D\u2026",uninstallStatusremoved:"\u5DF2\u5378\u8F7D",uninstallStatusrolledback:"\u5DF2\u56DE\u6EDA",uninstallStatusfailed:"\u5931\u8D25","uninstallStatusnot-managed":"\u65E0\u6CD5\u5378\u8F7D",uninstallVerifyOk:"\u5378\u8F7D\u540E\u81EA\u68C0\u901A\u8FC7\uFF0C\u91CD\u542F profile \u540E\u751F\u6548\u3002",uninstallReportRows:"\u6E05\u7406\u7684\u5F00\u5173\u884C",uninstallReportCascade:"\u7EA7\u8054\u5378\u8F7D",uninstallResiduals:"\u6B8B\u7559\u76EE\u5F55\uFF08\u4E0B\u6B21\u542F\u52A8\u81EA\u52A8\u6E05\u7406\uFF09",uninstallNotManaged:"\u8BE5\u5305\u4E0D\u662F\u672C profile \u7684\u4F9D\u8D56\uFF0C\u65E0\u6CD5\u5378\u8F7D\u3002",uninstallLocalBlocked:"\u672C\u5730\u5305\u8BF7\u7528 dsh plugin --profile <name> remove \u5378\u8F7D\u3002",done:"\u5B8C\u6210",cancel:"\u53D6\u6D88",history:"\u5386\u53F2",historyTitle:"\u64CD\u4F5C\u5386\u53F2",historyHint:"\u6700\u8FD1 20 \u6B21\u64CD\u4F5C\uFF08\u5378\u8F7D/\u5F00\u5173/\u573A\u666F/\u91CD\u7F6E\uFF09\uFF0C\u53EF\u4E00\u952E\u64A4\u9500",historyEmpty:"\u6682\u65E0\u64CD\u4F5C\u8BB0\u5F55\u3002",historyUndo:"\u64A4\u9500",historyUndone:"\u5DF2\u64A4\u9500",scenarios:"\u573A\u666F",scenarioTitle:"\u573A\u666F\u65B9\u6848",scenarioHint:"\u4FDD\u5B58\u5F53\u524D\u63D2\u4EF6\u542F\u505C\u7EC4\u5408\uFF0C\u4E00\u952E\u5207\u6362\uFF08\u5E94\u7528\u524D\u5C55\u793A\u53D8\u66F4\u9884\u89C8\uFF1B\u53D7\u4FDD\u62A4\u6761\u76EE\u81EA\u52A8\u8DF3\u8FC7\uFF09",scenarioName:"\u573A\u666F\u540D\u79F0\uFF08\u5982\uFF1A\u529E\u516C / \u5199\u4F5C / \u6F14\u793A\uFF09",scenarioSave:"\u4FDD\u5B58\u5F53\u524D\u72B6\u6001",scenarioSaved:"\u573A\u666F\u5DF2\u4FDD\u5B58\u3002",scenarioEmpty:"\u6682\u65E0\u573A\u666F\u3002\u8C03\u6574\u63D2\u4EF6\u5F00\u5173\u540E\u70B9\u300C\u4FDD\u5B58\u5F53\u524D\u72B6\u6001\u300D\u521B\u5EFA\u3002",scenarioApply:"\u5E94\u7528",scenarioApplyConfirm:"\u786E\u8BA4\u5207\u6362\uFF1F",scenarioApplying:"\u5207\u6362\u4E2D\u2026",scenarioCalculating:"\u6B63\u5728\u8BA1\u7B97\u53D8\u66F4\u2026",scenarioPreviewTitle:"\u5207\u6362\u9884\u89C8\uFF08\u8BE5\u573A\u666F\u4F1A\u53D8\u66F4\u4EE5\u4E0B\u6761\u76EE\uFF09\uFF1A",scenarioCounts:"\u542F/\u505C",scenarioUpdate:"\u66F4\u65B0",scenarioUpdateHint:"\u7528\u5F53\u524D\u72B6\u6001\u8986\u76D6\u6B64\u573A\u666F",scenarioDelete:"\u5220\u9664",scenarioDeleteConfirm:"\u786E\u8BA4\u5220\u9664\u573A\u666F",scenarioApplied:"\u573A\u666F\u5DF2\u5E94\u7528",restartHint:"\u5982\u8FD0\u884C\u671F\u672A\u6536\u655B\uFF0C\u91CD\u542F profile \u540E\u751F\u6548\u3002",market:"\u5E02\u573A",marketTitle:"\u63D2\u4EF6\u5E02\u573A\uFF08ADP \u7CBE\u9009\u76EE\u5F55\uFF09",marketSearch:"\u641C\u7D22\u63D2\u4EF6\uFF08\u540D\u79F0/\u4ED3\u5E93/\u63CF\u8FF0\uFF09\u2026",marketHint:"\u76EE\u5F55\u6765\u81EA awesome-dsh-plugin \u7CBE\u9009\u6536\u5F55\uFF1B\u5E26 npm \u5305\u540D\u7684\u4F18\u5148\u8D70 npm registry \u76F4\u88C5\uFF08\u9884\u6784\u5EFA\u4EA7\u7269\uFF09\uFF0CGitHub \u4ED3\u5E93\u8D70\u5185\u7F6E\u4E0B\u8F7D\u5668\u3002\u88C5\u5B8C\u5728\u7BA1\u7406\u5217\u8868\u53EF\u89C1\uFF0C\u91CD\u542F\u540E\u751F\u6548\u3002",marketLoading:"\u52A0\u8F7D\u76EE\u5F55\u4E2D\u2026",marketLoadingSlow:"\uFF08\u5F31\u7F51\u6700\u591A\u7B49 45 \u79D2\uFF1B\u5DF2\u4E0D\u518D\u53D7\u66F4\u65B0/\u5378\u8F7D\u7B49\u957F\u4EFB\u52A1\u6392\u961F\u5F71\u54CD\uFF09",marketEmpty:"\u6CA1\u6709\u5339\u914D\u7684\u63D2\u4EF6\u3002",marketMore:"\u52A0\u8F7D\u66F4\u591A",marketInstall:"\u5B89\u88C5",marketConfirmInstall:"\u786E\u8BA4\u5B89\u88C5\uFF1F",marketInstalling:"\u5B89\u88C5\u4E2D\u2026",marketInstalledBadge:"\u5DF2\u5B89\u88C5",marketLoadFail:"\u76EE\u5F55\u52A0\u8F7D\u5931\u8D25",marketRetry:"\u91CD\u8BD5",marketRefresh:"\u5237\u65B0\u76EE\u5F55",marketAll:"\u5168\u90E8",marketSort:"\u6392\u5E8F",marketSortStars:"\u6309\u661F\u6807",marketSortAdded:"\u6309\u6536\u5F55\u65F6\u95F4",marketPlugins:"\u4E2A\u63D2\u4EF6",marketUpdated:"\u6536\u5F55",marketSourceLive:"\u5728\u7EBF\u76EE\u5F55",marketSourceCache:"\u7F13\u5B58",marketSourceFallback:"GitHub \u515C\u5E95",marketSourceError:"\u76EE\u5F55\u4E0D\u53EF\u7528",marketSourceErrorHint:"\u7F51\u7EDC\u4E0D\u53EF\u8FBE\uFF0C\u53EF\u91CD\u8BD5\uFF1A\u76EE\u5F55\u8BF7\u6C42\u5168\u90E8\u5931\u8D25\uFF08\u65AD\u7F51/\u4EE3\u7406/\u9650\u6D41\u90FD\u53EF\u80FD\uFF09\uFF0C\u70B9\u51FB\u91CD\u8BD5\u91CD\u65B0\u52A0\u8F7D\u3002",verifyTitle:"\u542F\u52A8\u524D\u81EA\u68C0",verifyRun:"\u8FD0\u884C\u68C0\u67E5",verifyOk:"\u2713 profile \u914D\u7F6E\u6B63\u5E38\uFF0C\u5F15\u64CE\u53EF\u4EE5\u6B63\u5E38\u542F\u52A8\u3002",verifyBad:"\u26A0 \u53D1\u73B0\u95EE\u9898\uFF08\u5F15\u64CE\u53EF\u80FD\u65E0\u6CD5\u542F\u52A8\uFF09\uFF1A",verifyHint:"\u635F\u574F\u7684 bundle\uFF08\u5305\u672A\u5B89\u88C5/\u672A\u58F0\u660E dsh.bundle\uFF09\u6216\u65E0\u6CD5\u89E3\u6790\u7684 cordis.patch.yml \u4F1A\u8BA9\u5F15\u64CE\u5728\u542F\u52A8\u9636\u6BB5\u5931\u8D25\u2014\u2014\u8FD9\u662F\u6551\u63F4\u6D41\u7A0B\u7684\u9996\u8981\u4FEE\u590D\u76EE\u6807\uFF1B\u53CC\u51FB\u684C\u9762\u5FEB\u6377\u65B9\u5F0F\u542F\u52A8\u65F6\u4E5F\u4F1A\u81EA\u52A8\u6267\u884C\u540C\u6837\u7684\u68C0\u67E5\u3002",fixProfile:"\u4FEE\u590D\u5F15\u64CE\u914D\u7F6E",fixProfileConfirm:"\u786E\u8BA4\u6267\u884C\uFF1F\u5C06\u5907\u4EFD\u5E76\u9694\u79BB\u635F\u574F\u7684 bundle\u3001\u8FD8\u539F\u635F\u574F\u7684\u8865\u4E01\u6587\u4EF6\u3002",dlTitle:"\u4E0B\u8F7D\u76EE\u5F55\uFF08\u81EA\u52A8\u5B89\u88C5\uFF09",dlCheck:"\u68C0\u67E5\u4E0B\u8F7D",dlDir:"\u4E0B\u8F7D\u76EE\u5F55",dlHint:"\u7528\u6D4F\u89C8\u5668 / NDM / aria2 \u7B49\u4EFB\u610F\u65B9\u5F0F\u628A\u63D2\u4EF6\u5305\uFF08.tgz\uFF09\u4E0B\u8F7D\u5230\u8BE5\u76EE\u5F55\uFF0C\u70B9\u51FB\u300C\u68C0\u67E5\u4E0B\u8F7D\u300D\u6216\u91CD\u542F\u540E\u81EA\u52A8\u5B89\u88C5\u3002NDM \u6269\u5C55\u53EF\u76F4\u63A5\u6355\u83B7\u4E0B\u8F7D\u5230\u6B64\u76EE\u5F55\u3002",dlInstalled:"\u5DF2\u5B89\u88C5\uFF1A",dlFailed:"\u5931\u8D25\uFF1A",dlEmpty:"\u76EE\u5F55\u4E2D\u6CA1\u6709\u5F85\u5B89\u88C5\u7684\u65B0\u63D2\u4EF6\u5305\u3002"},Mk={tab:"Plugin manager",tabOfficial:"Official (optional)",tabAll:"All plugins",tabUpdate:"Updates",tabMarket:"Market",tabOps:"Operations",tabMaintenance:"Maintenance",onlyUpdatable:"Updates only",pageSubtitle:"Takes over the built-in Plugins page \xB7 sidebar entry",officialTitle:"Official optional plugins",officialIntro:"Capability bundles shipped with the engine but off by default. Some register their own configuration page.",officialEmpty:"No official optional plugins found.",officialUnavailable:"The engine's official plugin inventory is unavailable (pluginManager remote missing).",officialInstall:"Enable",officialInstalling:"Enabling\u2026",officialDisable:"Disable",officialInstalled:"Installed",officialNotInstalled:"Not installed",officialEnabled:"Enabled",officialNotEnabled:"Off",officialOptional:"Optional",officialItems:"Official plugins with their own page",officialOpen:"Open page",officialClose:"Collapse",exemptions:"Version exemptions",exemptionsEmpty:"No version exemptions.",exemptionRevoke:"Revoke",installHint:"Enabling installs this bundle through pnpm and may download packages.",title:"Engine & Plugin Console",profile:"Active profile",search:"Search by name, description or package",refresh:"Check updates and refresh",refreshDone:"Update check complete",refreshAborted:"Slow network: update check stopped at its total budget",refreshAbortedHint:", results may be partial (failures are not cached); retry once the network recovers.",loading:"Reading plugins\u2026",error:"Plugins are temporarily unavailable.",retry:"Retry",empty:"No plugins are available.",emptySearch:"No matching plugins.",legendNecessity:"Necessity",legendStatus:"Status",legendOrigin:"Origin",originLegend:"Origin",originAll:"All",originBuiltin:"Built-in",originUser:"User-installed",originUserHint:"Installed by you or an agent via `dsh plugin add` or the plugin market",configEntry:"Config",configEntryHint:"Open this plugin's own config panel (provided by the plugin itself)",configBundleEntry:"Plugin config",configMainPageHint:"Open this config page from the sidebar Plugin manager entry.",necessityCore:"Core components (engine-required \u2014 cannot be disabled)",badgeCore:"Core",necessityBuiltin:"Engine built-ins",badgeBuiltin:"Built-in",necessityUser:"User plugins",badgeUser:"User",recommendedTag:"Recommended",recommendedTagHint:"Recommended add-on: a third-party enhancement plugin suggested by the manager",managerBadge:"Manager",marketDetail:"Market",marketDetailHint:"View this plugin in the curated market (ADP)",statusError:"Error/Check",statusUpdate:"Update",statusDisabled:"Disabled",statusEnabled:"Enabled",enableEntry:"Enable",disableEntry:"Disable",versionUnknown:"version unknown",versionNetworkError:"network unreachable, retryable",versionNotFound:"not on the update source / no update",versionBackoff:"source rate-limited, retrying automatically",update:"Update",updateInternal:"Built-in",updateInternalHint:"Use the manager's built-in downloader (HTTP/P2P/aria2) instead of the browser",updateAll:"Check updates",upToDate:"Already up to date",notManaged:"ships with install",updateAvailable:"updates",selfUpdateTitle:"Drydock itself",selfUpdateUpToDate:"Up to date ({v})",selfUpdateCheck:"Check self-update",selfUpdateChecking:"Checking\u2026 (download + verify)",selfUpdateNow:"Update now",selfUpdateLater:"Later",selfUpdateRunning:"Updating: the engine will restart briefly \u2014 reload this page afterwards",selfUpdateDesktopOnly:"Not auto-installed on desktop (the app owns the profile): install with the bundled CLI as prompted",showMoreRows:"Show more ({n} remaining)",expandAll:"Expand all",collapseAll:"Collapse all",sources:"Sources",sourcesTitle:"Update sources",sourcesHint:"Version checks and updates use the enabled sources; the official npm source, npmmirror and the GitHub official repo are pre-filled. A custom source only acts as a fallback (degraded) by default \u2014 it does not compete with the official source unless you explicitly mark it authoritative. http:// sources are labelled plaintext\xB7fallback-only; making one authoritative also requires the explicit allow-plaintext confirmation. A GitHub source applies to packages whose repo-root package.json name matches and which release via GitHub Releases.",sourcesSaved:"Sources saved; re-checking versions\u2026",sourcesAuthoritativeConfirm:"This will promote a non-built-in source to authoritative: version resolution and installs will follow it. Enable only for a trusted internal mirror / offline registry?",resetSources:"Reset to defaults",authoritative:"authoritative",authoritativeHint:"Trust this source as authoritative: version resolution and installs use it (still usable when the official source is unreachable). Enable only for a trusted internal mirror / offline registry.",allowInsecure:"allow plaintext",allowInsecureHint:"This source uses plaintext http:// and is fallback-only by default; making it authoritative requires this explicit confirmation.",plaintextFallback:"plaintext \xB7 fallback only",plaintextAuthoritative:"plaintext \xB7 authoritative",plaintextFallbackHint:"Plaintext http:// source: content can be modified in transit; it is fallback-only and never participates in authoritative version resolution by default.",addSource:"Add",remove:"Remove",sourceName:"Name",sourceUrl:"URL (https://\u2026)",saveSources:"Save sources",official:"official",enabled:"enabled",noSources:"No enabled sources; version checks unavailable.",resetToggles:"Reset toggles",resetConfirm:"Reset every plugin toggle changed by this manager? (Only manager-owned rows are cleared; your own config is untouched.)",resetDone:"All toggles have been reset.",archived:"archived",rescue:"Rescue",rescueTitle:"Rescue center",rescueHint:"Diagnose failing plugins and quarantine/uninstall them; one-click repair resets toggles, quarantines failing plugins and clears caches. The standalone rescue page /rescue works even when the settings page is broken (\u{1F6DF} button, bottom right).",rescueDiagnose:"Diagnose",rescueModHealth:"Mod health check",rescueModHealthHint:"Mod health (preflight read-only check + engine log error aggregation) is served by the launcher fallback page; open it from the launcher page.",rescueClean:"\u2713 No failing plugins found.",rescueDisable:"Disable",rescueUninstall:"Uninstall",rescueProtected:"protected",rescueRepair:"Repair harness",rescueRepairConfirm:"Run repair? This resets manager toggles, quarantines every failing plugin and clears caches.",rescueRepairDone:"\u2713 Repair done",rescueRestartHint:"Restart command:",rescueRestart:"Restart engine",rescueRestartConfirm:"Restart the dsh web engine? This page will disconnect and return in ~3-5s (refresh then).",rescueAuto:"Auto-quarantine failing plugins",rescueAutoSaved:"Auto-quarantine setting saved.",rescueUninstallList:"Uninstallable profile dependencies:",rescueUninstallConfirm:"Uninstall",sourceOverrideHint:"Source label (auto-detected; can be overridden and persisted)",sourceAuto:"auto",sourceNpm:"npm",sourceGithub:"GitHub",sourceLocal:"local",sourceBuiltin:"built-in",uninstallTitle:"Uninstall impact preview",uninstallRowHint:"Uninstall this plugin",uninstallPreviewLoading:"Analyzing impact\u2026",uninstallPreviewFail:"Preview failed",uninstallPreviewHint:"Transactional uninstall: backup configs \u2192 remove the package and patch rows \u2192 verify \u2192 automatic rollback on failure. Review the impact:",uninstallAffectedEntries:"Plugin entries to be removed",uninstallNoEntries:"This package registers no plugin entries (dependency only).",uninstallBundleRow:"It is listed in the profile bundles (boot declaration will be removed).",uninstallPatchRows:"Manager patch rows to be cleaned",uninstallDependents:"These installed plugins depend on this package; uninstalling will break them",uninstallCascade:"Cascade-uninstall dependents",uninstallVerdictLine:"This uninstall",uninstallVerdictSafe:"safe",uninstallVerdictCaution:"needs attention",uninstallVerdictRisky:"risky",uninstallCheckTitle:"Pre-uninstall check",uninstallCheckHint:"Three read-only checks: broken dependencies / patch leftovers / duplicate services\xB7ports (no profile file is modified)",uninstallCheckHigh:"high risk",uninstallCheckWarning:"note",uninstallCheckInfo:"info",uninstallCheckEmpty:"No findings to report.",uninstallSelfHint:"This is the manager itself: before removal it runs bin/open-boot.mjs --uninstall to clear autostart (stops this profile's daemon \u2192 deletes DSHWeb* Run values \u2192 deletes .vbs shims \u2192 clears the pid file). Failure or timeout never blocks the uninstall, and the outcome is written to the report and operation history.",uninstallSelfReport:"The manager itself was removed: this page disappears after an engine restart; reinstall with dsh plugin --profile <name> add dsh-drydock.",uninstallAutostartTitle:"Autostart cleanup",uninstallAutostartCleaned:"done",uninstallAutostartSkipped:"skipped (no --uninstall in this package \u2014 older version)",uninstallAutostartFailed:"did not succeed (uninstall unaffected)",uninstallAutostartTimeout:"timed out (uninstall unaffected)",uninstallConfirm:"Confirm uninstall",uninstalling:"Uninstalling\u2026",uninstallStatusremoved:"Removed",uninstallStatusrolledback:"Rolled back",uninstallStatusfailed:"Failed","uninstallStatusnot-managed":"Not managed",uninstallVerifyOk:"Post-uninstall health check passed; it takes effect after a profile restart.",uninstallReportRows:"Patch rows cleaned",uninstallReportCascade:"Cascade removed",uninstallResiduals:"Residual directories (auto-cleaned at next start)",uninstallNotManaged:"This package is not a dependency of this profile; it cannot be uninstalled.",uninstallLocalBlocked:"Local package \u2014 use `dsh plugin --profile <name> remove`.",done:"Done",cancel:"Cancel",history:"History",historyTitle:"Operation history",historyHint:"Last 20 operations (uninstall/toggle/scenario/reset), one-click undo",historyEmpty:"No operations yet.",historyUndo:"Undo",historyUndone:"undone",scenarios:"Scenarios",scenarioTitle:"Scenarios",scenarioHint:"Save the current plugin state as a named scenario and switch with one click (change preview before applying; protected entries are skipped)",scenarioName:"Scenario name (e.g. office / writing / demo)",scenarioSave:"Save current state",scenarioSaved:"Scenario saved.",scenarioEmpty:'No scenarios. Toggle plugins, then click "Save current state".',scenarioApply:"Apply",scenarioApplyConfirm:"Confirm switch?",scenarioApplying:"Switching\u2026",scenarioCalculating:"Calculating changes\u2026",scenarioPreviewTitle:"Preview (this scenario changes):",scenarioCounts:"on/off",scenarioUpdate:"Update",scenarioUpdateHint:"Overwrite this scenario with the current state",scenarioDelete:"Delete",scenarioDeleteConfirm:"Delete scenario",scenarioApplied:"Scenario applied",restartHint:"If runtime state does not converge, restart the profile.",market:"Market",marketTitle:"Plugin market (ADP curated catalog)",marketSearch:"Search plugins (name/repo/description)\u2026",marketHint:"Catalog from awesome-dsh-plugin; entries with an npm name install from the npm registry (prebuilt), GitHub repos use the built-in downloader. Installed plugins appear in the management list after restart.",marketLoading:"Loading catalog\u2026",marketLoadingSlow:"(up to 45s on a slow network; no longer queued behind long operations)",marketEmpty:"No matching plugins.",marketMore:"Load more",marketInstall:"Install",marketConfirmInstall:"Confirm install?",marketInstalling:"Installing\u2026",marketInstalledBadge:"Installed",marketLoadFail:"Failed to load catalog",marketRetry:"Retry",marketRefresh:"Refresh catalog",marketAll:"All",marketSort:"Sort",marketSortStars:"By stars",marketSortAdded:"By added date",marketPlugins:"plugins",marketUpdated:"Added",marketSourceLive:"live catalog",marketSourceCache:"cached",marketSourceFallback:"GitHub fallback",marketSourceError:"catalog unavailable",marketSourceErrorHint:"Network unreachable, retryable: all catalog requests failed (offline/proxy/rate limit). Click Retry to reload.",verifyTitle:"Pre-boot check",verifyRun:"Run check",verifyOk:"\u2713 Profile configuration is healthy; the engine can boot.",verifyBad:"\u26A0 Issues found (the engine may fail to boot):",verifyHint:"Broken bundles (uninstalled / no dsh.bundle) or an unparsable cordis.patch.yml fail the engine during boot \u2014 the primary rescue target. The desktop shortcut runs the same check on double-click.",fixProfile:"Fix engine config",fixProfileConfirm:"Run fix? Broken bundles will be backed up and removed from the profile; a corrupt patch file will be restored.",dlTitle:"Download folder (auto-install)",dlCheck:"Check folder",dlDir:"Download folder",dlHint:'Download plugin packages (.tgz) into this folder with any tool (browser / NDM / aria2), then click "Check folder" or restart \u2014 they are installed automatically. The NDM extension can capture downloads there.',dlInstalled:"Installed:",dlFailed:"Failed:",dlEmpty:"No new packages waiting in the download folder."},Uk=["slots","locale","remote"];async function Vk(e){let t=(await Promise.resolve().then(()=>(Rg(),Tg))).TYPERT_REMOTE,n=await e.remote.$mount(t),r=e.locale.register(Yr,{zh:jk,en:Mk}),o=e.inject(["remote.pluginManagerPro"],s=>{let a=s.locale.bind(Yr),l=y=>{if(y.ok)return y.value;throw new Error(`${y.error.code}: ${y.error.message}`)},u=(y,w,_=3e4)=>Promise.race([y,new Promise((v,$)=>setTimeout(()=>$(new Error(`${w}\uFF1A\u64CD\u4F5C\u8D85\u65F6\uFF08${Math.round(_/1e3)} \u79D2\uFF09`)),_))]),p={list:async()=>l(await u(s.remote.pluginManagerPro.list(),"\u8BFB\u53D6\u63D2\u4EF6\u5217\u8868")),refresh:async()=>l(await u(s.remote.pluginManagerPro.refresh(),"\u68C0\u67E5\u66F4\u65B0",12e4)),setEnabled:async(y,w)=>l(await u(s.remote.pluginManagerPro.setEnabled(y,w),"\u5207\u6362\u63D2\u4EF6\u72B6\u6001")),update:async y=>l(await u(s.remote.pluginManagerPro.update(y),"\u66F4\u65B0\u63D2\u4EF6")),setSources:async(y,w)=>l(await u(s.remote.pluginManagerPro.setSources(y,w??null),"\u4FDD\u5B58\u66F4\u65B0\u6E90")),resetToggles:async()=>l(await u(s.remote.pluginManagerPro.resetToggles(),"\u91CD\u7F6E\u5F00\u5173")),diagnose:async()=>l(await u(s.remote.pluginManagerPro.diagnose(),"\u8BCA\u65AD")),quarantine:async y=>l(await u(s.remote.pluginManagerPro.quarantine(y),"\u9694\u79BB\u63D2\u4EF6")),repairHarness:async()=>l(await u(s.remote.pluginManagerPro.repairHarness(),"\u4FEE\u590D\u5F15\u64CE")),restartHarness:async()=>l(await u(s.remote.pluginManagerPro.restartHarness(),"\u91CD\u542F\u5F15\u64CE")),uninstallPackages:async(y,w)=>l(await u(s.remote.pluginManagerPro.uninstallPackages(y,w??{cascade:!1}),"\u5378\u8F7D\u63D2\u4EF6",3e5)),uninstallPreview:async y=>l(await u(s.remote.pluginManagerPro.uninstallPreview(y),"\u5378\u8F7D\u5F71\u54CD\u9884\u89C8",6e4)),operationHistory:async()=>l(await u(s.remote.pluginManagerPro.operationHistory(),"\u8BFB\u53D6\u64CD\u4F5C\u5386\u53F2")),undoOperation:async y=>l(await u(s.remote.pluginManagerPro.undoOperation(y),"\u64A4\u9500\u64CD\u4F5C",3e5)),setSourceOverride:async(y,w)=>l(await u(s.remote.pluginManagerPro.setSourceOverride(y,w),"\u4FDD\u5B58\u6765\u6E90\u6807\u7B7E")),scenarioList:async()=>l(await u(s.remote.pluginManagerPro.scenarioList(),"\u8BFB\u53D6\u573A\u666F\u65B9\u6848")),scenarioSave:async y=>l(await u(s.remote.pluginManagerPro.scenarioSave(y),"\u4FDD\u5B58\u573A\u666F")),scenarioUpdate:async y=>l(await u(s.remote.pluginManagerPro.scenarioUpdate(y),"\u66F4\u65B0\u573A\u666F")),scenarioDelete:async y=>l(await u(s.remote.pluginManagerPro.scenarioDelete(y),"\u5220\u9664\u573A\u666F")),scenarioApply:async(y,w)=>l(await u(s.remote.pluginManagerPro.scenarioApply(y,w),"\u5E94\u7528\u573A\u666F")),getRescueConfig:async()=>l(await u(s.remote.pluginManagerPro.getRescueConfig(),"\u8BFB\u53D6\u6551\u63F4\u914D\u7F6E")),setRescueConfig:async y=>l(await u(s.remote.pluginManagerPro.setRescueConfig(y),"\u4FDD\u5B58\u6551\u63F4\u914D\u7F6E")),getDownloadConfig:async()=>l(await u(s.remote.pluginManagerPro.getDownloadConfig(),"\u8BFB\u53D6\u4E0B\u8F7D\u76EE\u5F55")),checkDownloads:async()=>l(await u(s.remote.pluginManagerPro.checkDownloads(),"\u68C0\u67E5\u4E0B\u8F7D\u76EE\u5F55")),resolveDownloadUrl:async y=>l(await u(s.remote.pluginManagerPro.resolveDownloadUrl(y),"\u89E3\u6790\u4E0B\u8F7D\u94FE\u63A5")),verifyProfile:async()=>l(await u(s.remote.pluginManagerPro.verifyProfile(),"\u542F\u52A8\u524D\u81EA\u68C0")),fixProfile:async()=>l(await u(s.remote.pluginManagerPro.fixProfile(),"\u4FEE\u590D\u5F15\u64CE\u914D\u7F6E")),updateBrowser:async y=>l(await u(s.remote.pluginManagerPro.updateBrowser(y),"\u89E3\u6790\u4E0B\u8F7D\u94FE\u63A5")),marketCatalog:async()=>l(await u(s.remote.pluginManagerPro.marketCatalog(),"\u52A0\u8F7D\u63D2\u4EF6\u5E02\u573A",45e3)),marketInstall:async(y,w)=>l(await u(s.remote.pluginManagerPro.marketInstall(y,w),"\u5B89\u88C5\u63D2\u4EF6",24e4)),selfUpdateStatus:async()=>l(await u(s.remote.pluginManagerPro.selfUpdateStatus(),"\u8BFB\u53D6\u81EA\u66F4\u65B0\u72B6\u6001",45e3)),selfUpdatePrepare:async()=>l(await u(s.remote.pluginManagerPro.selfUpdatePrepare(),"\u68C0\u67E5\u7BA1\u7406\u5668\u66F4\u65B0",3e5)),selfUpdateDecide:async y=>l(await u(s.remote.pluginManagerPro.selfUpdateDecide(y),"\u6267\u884C\u66F4\u65B0\u51B3\u7B56",12e4))},m=(()=>{let y="",w={rows:[],bundles:[]},_=()=>{let v=$=>{let z=[];for(let R of s.slots.entriesOfSlot($)??[]){let S=R?.options?.key;typeof S=="string"&&S!==""&&z.push(S)}return z.sort()};return{rows:v("plugins.row.config"),bundles:v("plugins.bundle.config")}};return{getSnapshot:()=>{let v=`${s.slots.getVersion("plugins.row.config")}:${s.slots.getVersion("plugins.bundle.config")}`;return v!==y&&(y=v,w=_()),w},subscribe:v=>{let $=s.slots.subscribe("plugins.row.config",v),z=s.slots.subscribe("plugins.bundle.config",v);return()=>{$(),z()}}}})(),g={api:null};e.inject(["remote.pluginManager"],y=>{let w=y.remote.pluginManager;w!==void 0&&(g.api={listBundles:()=>w.listBundles(),setBundleEnabled:(_,v)=>w.setBundleEnabled(_,v),listVersionExemptions:()=>w.listVersionExemptions(),setVersionExemption:(_,v,$,z)=>w.setVersionExemption(_,v,$,z)})});let d=(()=>{let y="",w=[],_=()=>{try{return(s.slots.entriesOfSlot("plugins.item")??[]).map(v=>{let $=v?.options?.id??"",z=$;try{let R=v?.options?.label;typeof R=="function"&&(z=String(R()??$))}catch{}return{id:$,label:z}}).filter(v=>v.id!=="")}catch{return[]}};return{getSnapshot:()=>{let v=`${s.slots.getVersion("plugins.item")}:${s.locale.getSnapshot().revision}`;return v!==y&&(y=v,w=_()),w},subscribe:v=>{let $=s.slots.subscribe("plugins.item",v),z=s.locale.subscribe(v);return()=>{$(),z()}}}})(),h=()=>({...p,t:a,officialApi:g.api,officialItemsSource:d,configSurfaces:m});s.slots.inject("settings.plugins.tab",()=>s.slots.register({name:"settings.plugins.tab",id:"pluginManagerPro",order:60,label:()=>a("tab"),locale:Yr,inject:h},Bg)),s.slots.inject("sidebar.panellist",()=>s.slots.register({name:"sidebar.panellist",id:"plugins",order:0,label:()=>a("tab"),locale:Yr},Lk)),s.slots.inject("main",function*(){yield s.slots.register({name:"main",key:"plugins",locale:Yr,inject:h,children:{"plugins.item":{kind:"list",scope:"root"},"plugins.bundle.activation":{kind:"keyed",scope:"root"},"plugins.bundle.config":{kind:"keyed",scope:"root"},"plugins.row.config":{kind:"keyed",scope:"root"},"plugins.detail.actions":{kind:"list",scope:"root"},"plugins.detail.badge":{kind:"list",scope:"root"},"plugins.detail.section":{kind:"list",scope:"root"}}},Bg)}),e.inject(["layout"],y=>{let w=typeof y.get=="function"?y.get("layout"):y.layout;w===void 0||typeof w.selectPanel!="function"||y.effect(()=>y.reflect.provide("pluginNavigation",{openBundle:()=>{try{w.selectPanel("plugins")}catch{}}}))})}),i=null;if(typeof document<"u"&&document.body!==null){i=document.createElement("button"),i.textContent="\u{1F6DF}",i.title="DSH \u6551\u63F4\u4E2D\u5FC3\uFF08\u53EF\u62D6\u52A8\u6362\u4F4D\uFF1B\u5355\u51FB\u6253\u5F00\u3002\u8BBE\u7F6E\u9875\u4E0D\u53EF\u7528\u65F6\u7684\u6551\u63F4\u5165\u53E3\uFF09",i.setAttribute("aria-label","DSH \u6551\u63F4\u4E2D\u5FC3"),i.style.cssText="position:fixed;right:14px;bottom:14px;width:40px;height:40px;border-radius:50%;border:1px solid #d64541;background:#d64541;color:#fff;font-size:18px;cursor:pointer;z-index:2147483000;box-shadow:0 2px 10px rgba(0,0,0,.45);display:grid;place-items:center;touch-action:none;user-select:none;";try{let d=JSON.parse(localStorage.getItem("dsh-rescue-ball")||"null");d&&Number.isFinite(d.left)&&Number.isFinite(d.top)&&d.left>=0&&d.top>=0&&d.left<window.innerWidth&&d.top<window.innerHeight&&(i.style.left=`${Math.round(d.left)}px`,i.style.top=`${Math.round(d.top)}px`,i.style.right="auto",i.style.bottom="auto")}catch{}let s=!1,a=!1,l=0,u=0,p=0,m=0;i.addEventListener("pointerdown",d=>{if(d.button!==0)return;s=!0,a=!1,l=d.clientX,u=d.clientY;let h=i.getBoundingClientRect();p=h.left,m=h.top;try{i.setPointerCapture(d.pointerId)}catch{}}),i.addEventListener("pointermove",d=>{if(!s)return;let h=d.clientX-l,y=d.clientY-u;if(!a&&Math.abs(h)+Math.abs(y)<=4)return;a=!0;let w=i.offsetWidth,_=i.offsetHeight,v=Math.min(Math.max(0,p+h),Math.max(0,window.innerWidth-w)),$=Math.min(Math.max(0,m+y),Math.max(0,window.innerHeight-_));i.style.left=`${Math.round(v)}px`,i.style.top=`${Math.round($)}px`,i.style.right="auto",i.style.bottom="auto"});let g=d=>{if(s){s=!1;try{i.releasePointerCapture(d.pointerId)}catch{}if(a)try{localStorage.setItem("dsh-rescue-ball",JSON.stringify({left:parseFloat(i.style.left)||0,top:parseFloat(i.style.top)||0}))}catch{}}};i.addEventListener("pointerup",g),i.addEventListener("pointercancel",g),i.addEventListener("click",()=>{if(a){a=!1;return}window.open("/rescue","_blank")}),document.body.appendChild(i)}return async()=>{i!==null&&i.parentNode!==null&&i.parentNode.removeChild(i),await o.dispose(),r(),await n()}}
76
73
  return module.exports;
77
74
  }
78
75
  });