@clockworkdog/cogs-client 3.1.1 → 3.1.2

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.
@@ -6432,20 +6432,20 @@ function ei(e) {
6432
6432
  s
6433
6433
  ]), o = (E, y) => y ? E.optional() : E, c = (E) => e({
6434
6434
  type: G("string"),
6435
- default: o(ee(), E.defaultRequired)
6435
+ default: o(ee(), !E.defaultRequired)
6436
6436
  }), u = (E) => e({
6437
6437
  type: G("number"),
6438
6438
  integer: Pe().optional(),
6439
6439
  min: te().optional(),
6440
6440
  max: te().optional(),
6441
- default: o(te(), E.defaultRequired)
6441
+ default: o(te(), !E.defaultRequired)
6442
6442
  }), l = (E) => e({
6443
6443
  type: G("boolean"),
6444
- default: o(Pe(), E.defaultRequired)
6444
+ default: o(Pe(), !E.defaultRequired)
6445
6445
  }), a = (E) => e({
6446
6446
  type: G("option"),
6447
6447
  options: us.optional(),
6448
- default: o(ee(), E.defaultRequired)
6448
+ default: o(ee(), !E.defaultRequired)
6449
6449
  }), f = (E) => de([
6450
6450
  c(E),
6451
6451
  u(E),
@@ -35,4 +35,4 @@
35
35
  newResult[${N}] = ${x}.value;
36
36
  }
37
37
 
38
- `)}p.write("payload.value = newResult;"),p.write("return payload;");const y=p.compile();return(C,x)=>y(h,C,x)};let i;const o=Ge,c=!Wr.jitless,l=c&&zi.value,a=t.catchall;let f;e._zod.parse=(h,p)=>{f??(f=n.value);const $=h.value;return o($)?c&&l&&p?.async===!1&&p.jitless!==!0?(i||(i=s(t.shape)),h=i(h,p),a?dn([],$,h,p,f,e):h):r(h,p):(h.issues.push({expected:"object",code:"invalid_type",input:$,inst:e}),h)}});function pn(e,t,r,n){for(const i of e)if(i.issues.length===0)return t.value=i.value,t;const s=e.filter(i=>!Le(i));return s.length===1?(t.value=s[0].value,s[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(o=>we(o,n,Ee())))}),t)}const Ra=g("$ZodUnion",(e,t)=>{V.init(e,t),W(e._zod,"optin",()=>t.options.some(s=>s._zod.optin==="optional")?"optional":void 0),W(e._zod,"optout",()=>t.options.some(s=>s._zod.optout==="optional")?"optional":void 0),W(e._zod,"values",()=>{if(t.options.every(s=>s._zod.values))return new Set(t.options.flatMap(s=>Array.from(s._zod.values)))}),W(e._zod,"pattern",()=>{if(t.options.every(s=>s._zod.pattern)){const s=t.options.map(i=>i._zod.pattern);return new RegExp(`^(${s.map(i=>Et(i.source)).join("|")})$`)}});const r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(s,i)=>{if(r)return n(s,i);let o=!1;const c=[];for(const u of t.options){const l=u._zod.run({value:s.value,issues:[]},i);if(l instanceof Promise)c.push(l),o=!0;else{if(l.issues.length===0)return l;c.push(l)}}return o?Promise.all(c).then(u=>pn(u,s,e,i)):pn(c,s,e,i)}}),Aa=g("$ZodIntersection",(e,t)=>{V.init(e,t),e._zod.parse=(r,n)=>{const s=r.value,i=t.left._zod.run({value:s,issues:[]},n),o=t.right._zod.run({value:s,issues:[]},n);return i instanceof Promise||o instanceof Promise?Promise.all([i,o]).then(([u,l])=>mn(r,u,l)):mn(r,i,o)}});function $t(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(Ne(e)&&Ne(t)){const r=Object.keys(t),n=Object.keys(e).filter(i=>r.indexOf(i)!==-1),s={...e,...t};for(const i of n){const o=$t(e[i],t[i]);if(!o.valid)return{valid:!1,mergeErrorPath:[i,...o.mergeErrorPath]};s[i]=o.data}return{valid:!0,data:s}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let n=0;n<e.length;n++){const s=e[n],i=t[n],o=$t(s,i);if(!o.valid)return{valid:!1,mergeErrorPath:[n,...o.mergeErrorPath]};r.push(o.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function mn(e,t,r){if(t.issues.length&&e.issues.push(...t.issues),r.issues.length&&e.issues.push(...r.issues),Le(e))return e;const n=$t(t.value,r.value);if(!n.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(n.mergeErrorPath)}`);return e.value=n.data,e}const Ta=g("$ZodTuple",(e,t)=>{V.init(e,t);const r=t.items;e._zod.parse=(n,s)=>{const i=n.value;if(!Array.isArray(i))return n.issues.push({input:i,inst:e,expected:"tuple",code:"invalid_type"}),n;n.value=[];const o=[],c=[...r].reverse().findIndex(a=>a._zod.optin!=="optional"),u=c===-1?0:r.length-c;if(!t.rest){const a=i.length>r.length,f=i.length<u-1;if(a||f)return n.issues.push({...a?{code:"too_big",maximum:r.length}:{code:"too_small",minimum:r.length},input:i,inst:e,origin:"array"}),n}let l=-1;for(const a of r){if(l++,l>=i.length&&l>=u)continue;const f=a._zod.run({value:i[l],issues:[]},s);f instanceof Promise?o.push(f.then(h=>Ye(h,n,l))):Ye(f,n,l)}if(t.rest){const a=i.slice(r.length);for(const f of a){l++;const h=t.rest._zod.run({value:f,issues:[]},s);h instanceof Promise?o.push(h.then(p=>Ye(p,n,l))):Ye(h,n,l)}}return o.length?Promise.all(o).then(()=>n):n}});function Ye(e,t,r){e.issues.length&&t.issues.push(...Oe(r,e.issues)),t.value[r]=e.value}const Oa=g("$ZodRecord",(e,t)=>{V.init(e,t),e._zod.parse=(r,n)=>{const s=r.value;if(!Ne(s))return r.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),r;const i=[],o=t.keyType._zod.values;if(o){r.value={};const c=new Set;for(const l of o)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){c.add(typeof l=="number"?l.toString():l);const a=t.valueType._zod.run({value:s[l],issues:[]},n);a instanceof Promise?i.push(a.then(f=>{f.issues.length&&r.issues.push(...Oe(l,f.issues)),r.value[l]=f.value})):(a.issues.length&&r.issues.push(...Oe(l,a.issues)),r.value[l]=a.value)}let u;for(const l in s)c.has(l)||(u=u??[],u.push(l));u&&u.length>0&&r.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:u})}else{r.value={};for(const c of Reflect.ownKeys(s)){if(c==="__proto__")continue;const 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(u.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map(a=>we(a,n,Ee())),input:c,path:[c],inst:e}),r.value[u.value]=u.value;continue}const l=t.valueType._zod.run({value:s[c],issues:[]},n);l instanceof Promise?i.push(l.then(a=>{a.issues.length&&r.issues.push(...Oe(c,a.issues)),r.value[u.value]=a.value})):(l.issues.length&&r.issues.push(...Oe(c,l.issues)),r.value[u.value]=l.value)}}return i.length?Promise.all(i).then(()=>r):r}}),ka=g("$ZodEnum",(e,t)=>{V.init(e,t);const r=Ci(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(s=>Zi.has(typeof s)).map(s=>typeof s=="string"?Te(s):s.toString()).join("|")})$`),e._zod.parse=(s,i)=>{const o=s.value;return n.has(o)||s.issues.push({code:"invalid_value",values:r,input:o,inst:e}),s}}),Pa=g("$ZodLiteral",(e,t)=>{if(V.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?Te(n):n?Te(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,s)=>{const i=n.value;return r.has(i)||n.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),n}}),Ca=g("$ZodTransform",(e,t)=>{V.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Vr(e.constructor.name);const s=t.transform(r.value,r);if(n.async)return(s instanceof Promise?s:Promise.resolve(s)).then(o=>(r.value=o,r));if(s instanceof Promise)throw new Ce;return r.value=s,r}});function gn(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const Na=g("$ZodOptional",(e,t)=>{V.init(e,t),e._zod.optin="optional",e._zod.optout="optional",W(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),W(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${Et(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){const s=t.innerType._zod.run(r,n);return s instanceof Promise?s.then(i=>gn(i,r.value)):gn(s,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}}),La=g("$ZodNullable",(e,t)=>{V.init(e,t),W(e._zod,"optin",()=>t.innerType._zod.optin),W(e._zod,"optout",()=>t.innerType._zod.optout),W(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${Et(r.source)}|null)$`):void 0}),W(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)}),za=g("$ZodDefault",(e,t)=>{V.init(e,t),e._zod.optin="optional",W(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;const s=t.innerType._zod.run(r,n);return s instanceof Promise?s.then(i=>vn(i,t)):vn(s,t)}});function vn(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Za=g("$ZodPrefault",(e,t)=>{V.init(e,t),e._zod.optin="optional",W(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))}),Da=g("$ZodNonOptional",(e,t)=>{V.init(e,t),W(e._zod,"values",()=>{const r=t.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),e._zod.parse=(r,n)=>{const s=t.innerType._zod.run(r,n);return s instanceof Promise?s.then(i=>_n(i,e)):_n(s,e)}});function _n(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const ja=g("$ZodCatch",(e,t)=>{V.init(e,t),W(e._zod,"optin",()=>t.innerType._zod.optin),W(e._zod,"optout",()=>t.innerType._zod.optout),W(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);const s=t.innerType._zod.run(r,n);return s instanceof Promise?s.then(i=>(r.value=i.value,i.issues.length&&(r.value=t.catchValue({...r,error:{issues:i.issues.map(o=>we(o,n,Ee()))},input:r.value}),r.issues=[]),r)):(r.value=s.value,s.issues.length&&(r.value=t.catchValue({...r,error:{issues:s.issues.map(i=>we(i,n,Ee()))},input:r.value}),r.issues=[]),r)}}),xa=g("$ZodPipe",(e,t)=>{V.init(e,t),W(e._zod,"values",()=>t.in._zod.values),W(e._zod,"optin",()=>t.in._zod.optin),W(e._zod,"optout",()=>t.out._zod.optout),W(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){const i=t.out._zod.run(r,n);return i instanceof Promise?i.then(o=>Je(o,t.in,n)):Je(i,t.in,n)}const s=t.in._zod.run(r,n);return s instanceof Promise?s.then(i=>Je(i,t.out,n)):Je(s,t.out,n)}});function Je(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}const Ma=g("$ZodReadonly",(e,t)=>{V.init(e,t),W(e._zod,"propValues",()=>t.innerType._zod.propValues),W(e._zod,"values",()=>t.innerType._zod.values),W(e._zod,"optin",()=>t.innerType?._zod?.optin),W(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);const s=t.innerType._zod.run(r,n);return s instanceof Promise?s.then(En):En(s)}});function En(e){return e.value=Object.freeze(e.value),e}const Ua=g("$ZodTemplateLiteral",(e,t)=>{V.init(e,t);const r=[];for(const 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()}`);const s=n._zod.pattern instanceof RegExp?n._zod.pattern.source:n._zod.pattern;if(!s)throw new Error(`Invalid template literal part: ${n._zod.traits}`);const i=s.startsWith("^")?1:0,o=s.endsWith("$")?s.length-1:s.length;r.push(s.slice(i,o))}else if(n===null||Di.has(typeof n))r.push(Te(`${n}`));else throw new Error(`Invalid template literal part: ${n}`);e._zod.pattern=new RegExp(`^${r.join("")}$`),e._zod.parse=(n,s)=>typeof n.value!="string"?(n.issues.push({input:n.value,inst:e,expected:"template_literal",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)}),Ba=g("$ZodCustom",(e,t)=>{ie.init(e,t),V.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{const n=r.value,s=t.fn(n);if(s instanceof Promise)return s.then(i=>bn(i,r,n,e));bn(s,r,n,e)}});function bn(e,t,r,n){if(!e){const s={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(s.params=n._zod.def.params),t.issues.push(Me(s))}}var wn;class Fa{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){const n=r[0];if(this._map.set(t,n),n&&typeof n=="object"&&"id"in n){if(this._idmap.has(n.id))throw new Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,t)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const 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){const r=t._zod.parent;if(r){const n={...this.get(r)??{}};delete n.id;const s={...n,...this._map.get(t)};return Object.keys(s).length?s:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function qa(){return new Fa}(wn=globalThis).__zod_globalRegistry??(wn.__zod_globalRegistry=qa());const Qe=globalThis.__zod_globalRegistry;function Ga(e,t){return new e({type:"string",...A(t)})}function Va(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...A(t)})}function Sn(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...A(t)})}function Wa(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...A(t)})}function Ha(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...A(t)})}function Xa(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...A(t)})}function Ka(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...A(t)})}function Ya(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...A(t)})}function Ja(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...A(t)})}function Qa(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...A(t)})}function eu(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...A(t)})}function tu(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...A(t)})}function ru(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...A(t)})}function nu(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...A(t)})}function su(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...A(t)})}function iu(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...A(t)})}function ou(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...A(t)})}function au(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...A(t)})}function uu(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...A(t)})}function cu(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...A(t)})}function lu(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...A(t)})}function fu(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...A(t)})}function hu(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...A(t)})}function du(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...A(t)})}function pu(e,t){return new e({type:"string",format:"date",check:"string_format",...A(t)})}function mu(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...A(t)})}function gu(e,t){return new e({type:"string",format:"duration",check:"string_format",...A(t)})}function vu(e,t){return new e({type:"number",checks:[],...A(t)})}function _u(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...A(t)})}function Eu(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...A(t)})}function bu(e,t){return new e({type:"boolean",...A(t)})}function wu(e,t){return new e({type:"null",...A(t)})}function Su(e){return new e({type:"unknown"})}function Iu(e,t){return new e({type:"never",...A(t)})}function In(e,t){return new an({check:"less_than",...A(t),value:e,inclusive:!1})}function yt(e,t){return new an({check:"less_than",...A(t),value:e,inclusive:!0})}function $n(e,t){return new un({check:"greater_than",...A(t),value:e,inclusive:!1})}function Rt(e,t){return new un({check:"greater_than",...A(t),value:e,inclusive:!0})}function yn(e,t){return new No({check:"multiple_of",...A(t),value:e})}function Rn(e,t){return new zo({check:"max_length",...A(t),maximum:e})}function et(e,t){return new Zo({check:"min_length",...A(t),minimum:e})}function An(e,t){return new Do({check:"length_equals",...A(t),length:e})}function $u(e,t){return new jo({check:"string_format",format:"regex",...A(t),pattern:e})}function yu(e){return new xo({check:"string_format",format:"lowercase",...A(e)})}function Ru(e){return new Mo({check:"string_format",format:"uppercase",...A(e)})}function Au(e,t){return new Uo({check:"string_format",format:"includes",...A(t),includes:e})}function Tu(e,t){return new Bo({check:"string_format",format:"starts_with",...A(t),prefix:e})}function Ou(e,t){return new Fo({check:"string_format",format:"ends_with",...A(t),suffix:e})}function ze(e){return new qo({check:"overwrite",tx:e})}function ku(e){return ze(t=>t.normalize(e))}function Pu(){return ze(e=>e.trim())}function Cu(){return ze(e=>e.toLowerCase())}function Nu(){return ze(e=>e.toUpperCase())}function Lu(){return ze(e=>Li(e))}function zu(e,t,r){return new e({type:"array",element:t,...A(r)})}function Zu(e,t,r){return new e({type:"custom",check:"custom",fn:t,...A(r)})}function Du(e){const t=ju(r=>(r.addIssue=n=>{if(typeof n=="string")r.issues.push(Me(n,r.value,t._zod.def));else{const s=n;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=t),s.continue??(s.continue=!t._zod.def.abort),r.issues.push(Me(s))}},e(r.value,r)));return t}function ju(e,t){const r=new ie({check:"custom",...A(t)});return r._zod.check=e,r}const xu=g("ZodISODateTime",(e,t)=>{sa.init(e,t),Y.init(e,t)});function Mu(e){return du(xu,e)}const Uu=g("ZodISODate",(e,t)=>{ia.init(e,t),Y.init(e,t)});function Bu(e){return pu(Uu,e)}const Fu=g("ZodISOTime",(e,t)=>{oa.init(e,t),Y.init(e,t)});function qu(e){return mu(Fu,e)}const Gu=g("ZodISODuration",(e,t)=>{aa.init(e,t),Y.init(e,t)});function Vu(e){return gu(Gu,e)}const ae=g("ZodError",(e,t)=>{Qr.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>Hi(e,r)},flatten:{value:r=>Wi(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,gt,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,gt,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),Wu=wt(ae),Hu=St(ae),Xu=We(ae),Ku=He(ae),Yu=Yi(ae),Ju=Ji(ae),Qu=Qi(ae),ec=eo(ae),tc=to(ae),rc=ro(ae),nc=no(ae),sc=so(ae),X=g("ZodType",(e,t)=>(V.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone(Ae(t,{checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]})),e.clone=(r,n)=>be(e,r,n),e.brand=()=>e,e.register=(r,n)=>(r.add(e,n),e),e.parse=(r,n)=>Wu(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>Xu(e,r,n),e.parseAsync=async(r,n)=>Hu(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>Ku(e,r,n),e.spa=e.safeParseAsync,e.encode=(r,n)=>Yu(e,r,n),e.decode=(r,n)=>Ju(e,r,n),e.encodeAsync=async(r,n)=>Qu(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)=>sc(e,r,n),e.refine=(r,n)=>e.check(Yc(r,n)),e.superRefine=r=>e.check(Jc(r)),e.overwrite=r=>e.check(ze(r)),e.optional=()=>jn(e),e.nullable=()=>xn(e),e.nullish=()=>jn(xn(e)),e.nonoptional=r=>Fc(e,r),e.array=()=>Se(e),e.or=r=>de([e,r]),e.and=r=>Pc(e,r),e.transform=r=>Un(e,Dc(r)),e.default=r=>Mc(e,r),e.prefault=r=>Bc(e,r),e.catch=r=>Gc(e,r),e.pipe=r=>Un(e,r),e.readonly=()=>Hc(e),e.describe=r=>{const n=e.clone();return Qe.add(n,{description:r}),n},Object.defineProperty(e,"description",{get(){return Qe.get(e)?.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return Qe.get(e);const n=e.clone();return Qe.add(n,r[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),Tn=g("_ZodString",(e,t)=>{It.init(e,t),X.init(e,t);const r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...n)=>e.check($u(...n)),e.includes=(...n)=>e.check(Au(...n)),e.startsWith=(...n)=>e.check(Tu(...n)),e.endsWith=(...n)=>e.check(Ou(...n)),e.min=(...n)=>e.check(et(...n)),e.max=(...n)=>e.check(Rn(...n)),e.length=(...n)=>e.check(An(...n)),e.nonempty=(...n)=>e.check(et(1,...n)),e.lowercase=n=>e.check(yu(n)),e.uppercase=n=>e.check(Ru(n)),e.trim=()=>e.check(Pu()),e.normalize=(...n)=>e.check(ku(...n)),e.toLowerCase=()=>e.check(Cu()),e.toUpperCase=()=>e.check(Nu()),e.slugify=()=>e.check(Lu())}),ic=g("ZodString",(e,t)=>{It.init(e,t),Tn.init(e,t),e.email=r=>e.check(Va(oc,r)),e.url=r=>e.check(Ya(ac,r)),e.jwt=r=>e.check(hu(Sc,r)),e.emoji=r=>e.check(Ja(uc,r)),e.guid=r=>e.check(Sn(On,r)),e.uuid=r=>e.check(Wa(tt,r)),e.uuidv4=r=>e.check(Ha(tt,r)),e.uuidv6=r=>e.check(Xa(tt,r)),e.uuidv7=r=>e.check(Ka(tt,r)),e.nanoid=r=>e.check(Qa(cc,r)),e.guid=r=>e.check(Sn(On,r)),e.cuid=r=>e.check(eu(lc,r)),e.cuid2=r=>e.check(tu(fc,r)),e.ulid=r=>e.check(ru(hc,r)),e.base64=r=>e.check(cu(Ec,r)),e.base64url=r=>e.check(lu(bc,r)),e.xid=r=>e.check(nu(dc,r)),e.ksuid=r=>e.check(su(pc,r)),e.ipv4=r=>e.check(iu(mc,r)),e.ipv6=r=>e.check(ou(gc,r)),e.cidrv4=r=>e.check(au(vc,r)),e.cidrv6=r=>e.check(uu(_c,r)),e.e164=r=>e.check(fu(wc,r)),e.datetime=r=>e.check(Mu(r)),e.date=r=>e.check(Bu(r)),e.time=r=>e.check(qu(r)),e.duration=r=>e.check(Vu(r))});function te(e){return Ga(ic,e)}const Y=g("ZodStringFormat",(e,t)=>{K.init(e,t),Tn.init(e,t)}),oc=g("ZodEmail",(e,t)=>{Xo.init(e,t),Y.init(e,t)}),On=g("ZodGUID",(e,t)=>{Wo.init(e,t),Y.init(e,t)}),tt=g("ZodUUID",(e,t)=>{Ho.init(e,t),Y.init(e,t)}),ac=g("ZodURL",(e,t)=>{Ko.init(e,t),Y.init(e,t)}),uc=g("ZodEmoji",(e,t)=>{Yo.init(e,t),Y.init(e,t)}),cc=g("ZodNanoID",(e,t)=>{Jo.init(e,t),Y.init(e,t)}),lc=g("ZodCUID",(e,t)=>{Qo.init(e,t),Y.init(e,t)}),fc=g("ZodCUID2",(e,t)=>{ea.init(e,t),Y.init(e,t)}),hc=g("ZodULID",(e,t)=>{ta.init(e,t),Y.init(e,t)}),dc=g("ZodXID",(e,t)=>{ra.init(e,t),Y.init(e,t)}),pc=g("ZodKSUID",(e,t)=>{na.init(e,t),Y.init(e,t)}),mc=g("ZodIPv4",(e,t)=>{ua.init(e,t),Y.init(e,t)}),gc=g("ZodIPv6",(e,t)=>{ca.init(e,t),Y.init(e,t)}),vc=g("ZodCIDRv4",(e,t)=>{la.init(e,t),Y.init(e,t)}),_c=g("ZodCIDRv6",(e,t)=>{fa.init(e,t),Y.init(e,t)}),Ec=g("ZodBase64",(e,t)=>{ha.init(e,t),Y.init(e,t)}),bc=g("ZodBase64URL",(e,t)=>{pa.init(e,t),Y.init(e,t)}),wc=g("ZodE164",(e,t)=>{ma.init(e,t),Y.init(e,t)}),Sc=g("ZodJWT",(e,t)=>{va.init(e,t),Y.init(e,t)}),kn=g("ZodNumber",(e,t)=>{ln.init(e,t),X.init(e,t),e.gt=(n,s)=>e.check($n(n,s)),e.gte=(n,s)=>e.check(Rt(n,s)),e.min=(n,s)=>e.check(Rt(n,s)),e.lt=(n,s)=>e.check(In(n,s)),e.lte=(n,s)=>e.check(yt(n,s)),e.max=(n,s)=>e.check(yt(n,s)),e.int=n=>e.check(Cn(n)),e.safe=n=>e.check(Cn(n)),e.positive=n=>e.check($n(0,n)),e.nonnegative=n=>e.check(Rt(0,n)),e.negative=n=>e.check(In(0,n)),e.nonpositive=n=>e.check(yt(0,n)),e.multipleOf=(n,s)=>e.check(yn(n,s)),e.step=(n,s)=>e.check(yn(n,s)),e.finite=()=>e;const 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});function re(e){return vu(kn,e)}const Pn=g("ZodNumberFormat",(e,t)=>{_a.init(e,t),kn.init(e,t)});function Cn(e){return _u(Pn,e)}function ge(e){return Eu(Pn,e)}const Ic=g("ZodBoolean",(e,t)=>{Ea.init(e,t),X.init(e,t)});function Ze(e){return bu(Ic,e)}const $c=g("ZodNull",(e,t)=>{ba.init(e,t),X.init(e,t)});function yc(e){return wu($c,e)}const Rc=g("ZodUnknown",(e,t)=>{wa.init(e,t),X.init(e,t)});function Nn(){return Su(Rc)}const Ac=g("ZodNever",(e,t)=>{Sa.init(e,t),X.init(e,t)});function Ln(e){return Iu(Ac,e)}const Tc=g("ZodArray",(e,t)=>{Ia.init(e,t),X.init(e,t),e.element=t.element,e.min=(r,n)=>e.check(et(r,n)),e.nonempty=r=>e.check(et(1,r)),e.max=(r,n)=>e.check(Rn(r,n)),e.length=(r,n)=>e.check(An(r,n)),e.unwrap=()=>e.element});function Se(e,t){return zu(Tc,e,t)}const zn=g("ZodObject",(e,t)=>{ya.init(e,t),X.init(e,t),W(e,"shape",()=>t.shape),e.keyof=()=>Lc(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Nn()}),e.loose=()=>e.clone({...e._zod.def,catchall:Nn()}),e.strict=()=>e.clone({...e._zod.def,catchall:Ln()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>Bi(e,r),e.safeExtend=r=>Fi(e,r),e.merge=r=>qi(e,r),e.pick=r=>Mi(e,r),e.omit=r=>Ui(e,r),e.partial=(...r)=>Gi(Dn,e,r[0]),e.required=(...r)=>Vi(Mn,e,r[0])});function q(e,t){const r={type:"object",shape:e??{},...A(t)};return new zn(r)}function At(e,t){return new zn({type:"object",shape:e,catchall:Ln(),...A(t)})}const Oc=g("ZodUnion",(e,t)=>{Ra.init(e,t),X.init(e,t),e.options=t.options});function de(e,t){return new Oc({type:"union",options:e,...A(t)})}const kc=g("ZodIntersection",(e,t)=>{Aa.init(e,t),X.init(e,t)});function Pc(e,t){return new kc({type:"intersection",left:e,right:t})}const Cc=g("ZodTuple",(e,t)=>{Ta.init(e,t),X.init(e,t),e.rest=r=>e.clone({...e._zod.def,rest:r})});function pe(e,t,r){const n=t instanceof V,s=n?r:t,i=n?t:null;return new Cc({type:"tuple",items:e,rest:i,...A(s)})}const Nc=g("ZodRecord",(e,t)=>{Oa.init(e,t),X.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function Zn(e,t,r){return new Nc({type:"record",keyType:e,valueType:t,...A(r)})}const Tt=g("ZodEnum",(e,t)=>{ka.init(e,t),X.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const r=new Set(Object.keys(t.entries));e.extract=(n,s)=>{const i={};for(const o of n)if(r.has(o))i[o]=t.entries[o];else throw new Error(`Key ${o} not found in enum`);return new Tt({...t,checks:[],...A(s),entries:i})},e.exclude=(n,s)=>{const i={...t.entries};for(const o of n)if(r.has(o))delete i[o];else throw new Error(`Key ${o} not found in enum`);return new Tt({...t,checks:[],...A(s),entries:i})}});function Lc(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new Tt({type:"enum",entries:r,...A(t)})}const zc=g("ZodLiteral",(e,t)=>{Pa.init(e,t),X.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function G(e,t){return new zc({type:"literal",values:Array.isArray(e)?e:[e],...A(t)})}const Zc=g("ZodTransform",(e,t)=>{Ca.init(e,t),X.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Vr(e.constructor.name);r.addIssue=i=>{if(typeof i=="string")r.issues.push(Me(i,r.value,t));else{const o=i;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=r.value),o.inst??(o.inst=e),r.issues.push(Me(o))}};const s=t.transform(r.value,r);return s instanceof Promise?s.then(i=>(r.value=i,r)):(r.value=s,r)}});function Dc(e){return new Zc({type:"transform",transform:e})}const Dn=g("ZodOptional",(e,t)=>{Na.init(e,t),X.init(e,t),e.unwrap=()=>e._zod.def.innerType});function jn(e){return new Dn({type:"optional",innerType:e})}const jc=g("ZodNullable",(e,t)=>{La.init(e,t),X.init(e,t),e.unwrap=()=>e._zod.def.innerType});function xn(e){return new jc({type:"nullable",innerType:e})}const xc=g("ZodDefault",(e,t)=>{za.init(e,t),X.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Mc(e,t){return new xc({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Yr(t)}})}const Uc=g("ZodPrefault",(e,t)=>{Za.init(e,t),X.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Bc(e,t){return new Uc({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Yr(t)}})}const Mn=g("ZodNonOptional",(e,t)=>{Da.init(e,t),X.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Fc(e,t){return new Mn({type:"nonoptional",innerType:e,...A(t)})}const qc=g("ZodCatch",(e,t)=>{ja.init(e,t),X.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Gc(e,t){return new qc({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const Vc=g("ZodPipe",(e,t)=>{xa.init(e,t),X.init(e,t),e.in=t.in,e.out=t.out});function Un(e,t){return new Vc({type:"pipe",in:e,out:t})}const Wc=g("ZodReadonly",(e,t)=>{Ma.init(e,t),X.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Hc(e){return new Wc({type:"readonly",innerType:e})}const Xc=g("ZodTemplateLiteral",(e,t)=>{Ua.init(e,t),X.init(e,t)});function rt(e,t){return new Xc({type:"template_literal",parts:e,...A(t)})}const Kc=g("ZodCustom",(e,t)=>{Ba.init(e,t),X.init(e,t)});function Yc(e,t={}){return Zu(Kc,e,t)}function Jc(e){return Du(e)}const nt=q({t:re().gte(0),rate:re().gte(0)}),De=q({opacity:re().gte(0).lte(1),zIndex:re().default(0)}),je=q({volume:re().gte(0).lte(1)}),Qc=q({type:G("image"),file:te(),fit:de([G("contain"),G("cover"),G("none")])}),el=q({type:G("audio"),file:te(),audioOutput:te(),enablePlaybackRateAdjustment:Ze()}),tl=q({type:G("video"),file:te(),audioOutput:te(),enablePlaybackRateAdjustment:Ze(),fit:de([G("contain"),G("cover"),G("none")])}),Ot=pe([re(),yc()]),rl=pe([re(),q({set:q({...De.shape}).partial()}).partial()]),nl=pe([re(),q({set:q({...De.shape}).partial(),lerp:q({...De.shape}).partial()}).partial()]),sl=pe([re(),q({set:q({...nt.shape,...je.shape}).partial()}).partial()]),il=pe([re(),q({set:q({...nt.shape,...je.shape}).partial(),lerp:q({...je.shape}).partial()}).partial()]),ol=pe([re(),q({set:q({...nt.shape,...je.shape,...De.shape}).partial()}).partial()]),al=pe([re(),q({set:q({...nt.shape,...je.shape,...De.shape}).partial(),lerp:q({...je.shape,...De.shape}).partial()}).partial()]),ul=q({...Qc.shape,keyframes:pe([nl],de([rl,Ot]))}),cl=q({...el.shape,keyframes:pe([il],de([sl,Ot]))}),ll=q({...tl.shape,keyframes:pe([al],de([ol,Ot]))}),fl=Zn(te(),de([ul,cl,ll])),Bn={opacity:1,zIndex:0},kt={t:0,rate:1,volume:1},Fn={t:0,rate:1,volume:1,opacity:1,zIndex:0},hl=Object.freeze(Object.defineProperty({__proto__:null,MediaSurfaceStateSchema:fl,defaultAudioOptions:kt,defaultImageOptions:Bn,defaultVideoOptions:Fn},Symbol.toStringTag,{value:"Module"}));function st(e,t){if(!e.keyframes.filter(n=>n[1]===null).some(n=>n[0]<=t))switch(e.type){case"image":{if(e.keyframes[0][0]>t)return;const s=e.keyframes.filter(o=>o[1]!==null),i=Pt(s,t);return{...Bn,...i}}case"audio":{const n=e.keyframes.filter(o=>o[1]!==null),s=qn(n,t);if(!s)return;const i=Pt(n,t);return{...kt,...i,...s}}case"video":{const n=e.keyframes.filter(o=>o[1]!==null),s=qn(n,t);if(!s)return;const i=Pt(n,t);return{...Fn,...i,...s}}}}function Pt(e,t){const r={};for(const[s,i]of e)s<=t?(Object.entries(i.lerp??{}).forEach(([o,c])=>{r[o]??={},r[o].before=[s,c]}),Object.entries(i.set??{}).forEach(([o,c])=>{r[o]??={},r[o].before=[s,c]})):Object.entries(i.lerp??{}).forEach(([o,c])=>{r[o]??={},r[o].after===void 0&&(r[o].after=[s,c])});const n={};return Object.entries(r).forEach(([s,{before:i,after:o}])=>{if(o===void 0&&i){n[s]=i[1];return}if(i&&o&&i[0]===o[0]){n[s]=o[1];return}if(i&&typeof i[1]=="number"&&o&&typeof o[1]=="number"){n[s]=i[1]+(t-i[0])*(o[1]-i[1])/(o[0]-i[0]);return}}),n}function qn(e,t){const r=e[0];if(!r||r[0]>t)return;let n=0,{t:s,rate:i}=kt;for(const[l,a]of e){if(l>t)break;const{set:f}=a;if(!f)continue;const{t:h,rate:p}=f;if(h!==void 0){n=l,s=h,p!==void 0&&(i=p);continue}if(p!==void 0){const _=(l-n)*i;n=l,s+=_,i=p}}const c=(t-n)*i,u=s+c;return{rate:i,t:u}}const dl=typeof navigator<"u"&&typeof navigator.standalone<"u",pl="GestureEvent"in window;function it(e,t){return(e%t+t)%t}function ml(e,t,r){return e=it(e,r),t=it(t,r),Math.abs(e-t)<r/2?e-t:e<t?e+r-t:e-(t+r)}const Ct=e=>{try{const{pathname:t}=new URL(e,window.location.href);return t}catch{return}};class Nt{constructor(t,r,n,s,i,o){this.surfaceElement=t,this.clipElement=r,this.constructAssetURL=s,this.getAudioOutput=i,this.mediaPreloader=o,this._state=n}isConnected(t){return!(!this.surfaceElement||!this.clipElement||!this.surfaceElement.contains(this.clipElement)||t&&!this.clipElement.contains(t))}_state;setState(t){this._state=t}timeout;loop=async()=>{clearTimeout(this.timeout),this.isConnected()?(this.update(),this.timeout=setTimeout(this.loop,Kn)):this.destroy()}}function Lt(e,t,r,n,s){let i;const o=n(r.file),c=Ct(o);switch(r.type){case"image":i=e instanceof HTMLImageElement?e:document.createElement("img"),Ct(i.src)!==c&&(i.src=o);break;case"audio":case"video":{if(e!==void 0){const u=Ct(e.src);e.tagName.toLowerCase()===r.type&&u!==void 0&&u===c&&(i=e)}i||(i=s.getElement(r.file,r.type)),i instanceof HTMLVideoElement&&!i.playsInline&&(i.playsInline=!0);break}}return(t.children.length!==1||t.childNodes[0]!==i)&&t.replaceChildren(i),i.style.position="absolute",i.style.width="100%",i.style.height="100%",i}function Gn(e,t,r){const n=String(t.opacity);e.style.opacity!==n&&(e.style.opacity=n);const s=Math.round(t.zIndex??0);parseInt(e.style.zIndex)!==s&&(e.style.zIndex=String(s)),e.style.objectFit!==r&&(e.style.objectFit=r)}function Vn(e,t,r,n){const s=t.volume*n;if(dl)s===0&&!e.muted?e.muted=!0:s>0&&e.muted&&(e.muted=!1);else if(e.muted&&(e.muted=!1),e.volume!==s&&(e.volume=s),e.sinkId!==r)try{e.setSinkId(r).catch(()=>{})}catch{}}const Wn=2e3,gl=1e3,Hn=100,Xn=50,Kn=5,ot=1e3,vl=10,_l=100,El=.3,bl=.1;function wl(e){return Math.sign(e)*Math.pow(Math.abs(e)/ot,El)*bl}function me(e,t){e.playbackRate!==t&&(e.playbackRate=t),e.paused&&e.play().catch(()=>{})}function Yn(e,t,r,n,s,i){const o=i&&!pl;let c=!1;if(e.duration){const h=r.filter(([p])=>p>r[0][0]&&p>n).filter(([,p])=>p?.set?.t!==void 0||p?.set?.rate!==void 0)[0];if(h?.[1]?.set?.t===0){const p=(e.duration*1e3-t.t)/t.rate,$=h[0]-n;c=Math.abs(p-$)<=_l,e.loop!==c&&(e.loop=c)}}const u=e.currentTime*1e3,l=c&&e.duration!==void 0?ml(u,t.t,e.duration*1e3):u-t.t,a=Math.abs(l);switch(!0){case(!o&&s.state==="idle"&&t.rate>0&&a>Wn):{const f=(t.t+t.rate*gl)/1e3;return e.duration!==void 0&&f>e.duration&&!c?{state:"idle"}:(me(e,0),e.currentTime=c?it(f,e.duration*1e3):f,{state:"seeking-ahead"})}case(s.state==="seeking-ahead"&&e.seeking===!0):return{state:"seeking-ahead"};case(s.state==="seeking-ahead"&&e.seeking===!1):return me(e,0),{state:"seeked-ahead"};case(s.state==="seeked-ahead"&&l<-Hn):return me(e,t.rate),console.warn("Failed to seek ahead in time"),{state:"idle"};case(s.state==="seeked-ahead"&&a<=Hn):return me(e,t.rate),{state:"idle"};case(s.state==="seeked-ahead"&&a>Wn*1.5):return console.warn("Failed to seek ahead"),{state:"idle"};case s.state==="seeked-ahead":return{state:"seeked-ahead"};case(o&&s.state==="idle"&&t.rate>0&&a>Xn&&a<=ot):{const f=wl(l),h=Math.max(0,t.rate-f);return me(e,h),{state:"intercepting"}}case(s.state==="intercepting"&&a<=Kn):return me(e,t.rate),{state:"idle"};case(s.state==="intercepting"&&Math.sign(l)===Math.sign(e.playbackRate-t.rate)):return me(e,t.rate),{state:"idle"};case(s.state==="intercepting"&&a<ot*2):return{state:"intercepting"};case s.state==="intercepting":return me(e,t.rate),{state:"idle"};case(o&&s.state==="idle"&&a>ot):{const f=(t.t+t.rate*vl)/1e3;return e.currentTime=c?it(f,e.duration*1e3):f,me(e,t.rate),{state:"seeking"}}case(s.state==="seeking"&&e.seeking):return{state:"seeking"};case(s.state==="seeking"&&!e.seeking):return{state:"idle"};case s.state==="idle":return me(e,t.rate),t.rate===0&&a>Xn&&(e.currentTime=t.t/1e3),{state:"idle"};default:return{state:"idle"}}}class Sl extends Nt{imageElement;update(){const t=st(this._state,Date.now());t?this.imageElement=Lt(this.imageElement,this.clipElement,this._state,this.constructAssetURL,this.mediaPreloader):this.imageElement&&this.destroy(),!(!t||!this.imageElement)&&Gn(this.imageElement,t,this._state.fit)}destroy(){this.imageElement&&(this.imageElement.remove(),this.imageElement.src="",this.imageElement=void 0)}}class Jn extends Nt{syncState={state:"idle"};audioElement;volume=1;update(){const t=Date.now(),r=st(this._state,t);if(r?this.audioElement=Lt(this.audioElement,this.clipElement,this._state,this.constructAssetURL,this.mediaPreloader):this.destroy(),!r||!this.audioElement)return;const n=this.getAudioOutput(this._state.audioOutput);Vn(this.audioElement,r,n,this.volume);const s=Yn(this.audioElement,r,this._state.keyframes,t,this.syncState,this._state.enablePlaybackRateAdjustment);this.syncState=s}destroy(){this.audioElement&&(this.audioElement.pause(),this.audioElement.remove(),this.audioElement.volume=0,this.audioElement.currentTime=0,this.mediaPreloader.releaseElement(this.audioElement)),this.audioElement=void 0}}class Qn extends Nt{syncState={state:"idle"};videoElement;volume=1;update(){const t=Date.now(),r=st(this._state,t);if(r?this.videoElement=Lt(this.videoElement,this.clipElement,this._state,this.constructAssetURL,this.mediaPreloader):this.destroy(),!r||!this.videoElement)return;const n=this.getAudioOutput(this._state.audioOutput);Gn(this.videoElement,r,this._state.fit),Vn(this.videoElement,r,n,this.volume);const s=Yn(this.videoElement,r,this._state.keyframes,t,this.syncState,this._state.enablePlaybackRateAdjustment);this.syncState=s}destroy(){this.videoElement&&(this.videoElement.pause(),this.videoElement.remove(),this.videoElement.volume=0,this.videoElement.currentTime=0,this.mediaPreloader.releaseElement(this.videoElement)),this.videoElement=void 0}}class es{_state;_elements={};_constructAssetURL;constructor(t,r={}){this._constructAssetURL=t,this._state=r}get state(){return{...this._state}}setState(t){this._state=t,this.update()}update(){for(const[t,r]of Object.entries(this._elements)){if(!(t in this._state)){if(r.inUse){console.warn(`Failed to clean up element ${r.element.src}`);continue}r.element.src="",r.element.load(),delete this._elements[t]}r.inUse=r.element.isConnected}for(const[t,r]of Object.entries(this._state)){if(t in this._elements)continue;let n;switch(r.preload===!0?n="auto":r.preload===!1?n="none":n=r.preload,r.type){case"audio":{const s=document.createElement("audio");s.src=this._constructAssetURL(t),s.preload=n,this._elements[t]={element:s,inUse:!1,type:"audio"};break}case"video":{const s=document.createElement("video");s.src=this._constructAssetURL(t),s.preload=n,this._elements[t]={element:s,inUse:!1,type:"video"};break}}}}getElement(t,r){const n=this._elements[t];if(n&&n.inUse===!1)return n.inUse=!0,n.element;{const s=document.createElement(r);return s.src=this._constructAssetURL(t),r==="video"&&(this._elements[t]={element:s,type:r,inUse:!0}),s}}releaseElement(t){if(typeof t=="string"){const r=this._elements[t];r&&(r.inUse=!1)}else Object.values(this._elements).forEach(r=>{r.element===t&&(r.inUse=!1)})}}const Il="data-clip-id";class $l{constructor(t,r,n,s=new es(t)){this.constructAssetUrl=t,this.getAudioOutput=r,this.mediaPreloader=s,this._element=document.createElement("div"),this._element.className="surface-manager",this._element.style.width="100%",this._element.style.height="100%",this._state=n||{},this.update()}_state={};setState(t){this._state=t,this.update()}_volume=1;get volume(){return this._volume}set volume(t){this._volume=t,Object.values(this.resources).forEach(({manager:r})=>{(r instanceof Jn||r instanceof Qn)&&(r.volume=t)})}_element;get element(){return this._element}resources={};update(){Object.entries(this.resources).forEach(([r,{element:n,manager:s}])=>{r in this._state||(delete this.resources[r],n.remove(),s?.destroy())});const t=Object.keys(this._state).toSorted().map(r=>{const n=this.resources[r];if(n)return n.element;{const s=document.createElement("div");return s.setAttribute(Il,r),this.resources[r]={element:s},s}});this._element.replaceChildren(...t),Object.keys(this._state).toSorted().forEach(r=>{const n=this._state[r],s=this.resources[r];if(!s)throw new Error("Failed to create resource");if(s.manager)s.manager.setState(n);else switch(n.type){case"image":s.manager=new Sl(this._element,s.element,n,this.constructAssetUrl,this.getAudioOutput,this.mediaPreloader),s.manager.loop();break;case"audio":{const i=new Jn(this._element,s.element,n,this.constructAssetUrl,this.getAudioOutput,this.mediaPreloader);s.manager=i,i.volume=this._volume,i.loop();break}case"video":{const i=new Qn(this._element,s.element,n,this.constructAssetUrl,this.getAudioOutput,this.mediaPreloader);s.manager=i,i.volume=this._volume,i.loop();break}}})}}function yl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ve={},ue={},_e={},Ue={},ts;function at(){if(ts)return Ue;ts=1,Object.defineProperty(Ue,"__esModule",{value:!0}),Ue.AddressError=void 0;class e extends Error{constructor(r,n){super(r),this.name="AddressError",this.parseMessage=n}}return Ue.AddressError=e,Ue}var rs;function zt(){if(rs)return _e;rs=1,Object.defineProperty(_e,"__esModule",{value:!0}),_e.isInSubnet=t,_e.isCorrect=r,_e.prefixLengthFromMask=n,_e.numberToPaddedHex=s,_e.stringToPaddedHex=i,_e.testBit=o;const e=at();function t(c){return this.subnetMask<c.subnetMask?!1:this.mask(c.subnetMask)===c.mask()}function r(c){return function(){return this.addressMinusSuffix!==this.correctForm()?!1:this.subnetMask===c&&!this.parsedSubnet?!0:this.parsedSubnet===String(this.subnetMask)}}function n(c,u){const l=c.toString(2).padStart(u,"0");if(l.length>u)throw new e.AddressError("Invalid subnet mask.");const a=l.indexOf("0");if(a===-1)return u;if(l.slice(a).includes("1"))throw new e.AddressError("Invalid subnet mask.");return a}function s(c){return c.toString(16).padStart(2,"0")}function i(c){return s(parseInt(c,10))}function o(c,u){const{length:l}=c;if(u>l)return!1;const a=l-u;return c.substring(a,a+1)==="1"}return _e}var ce={},ns;function ss(){return ns||(ns=1,Object.defineProperty(ce,"__esModule",{value:!0}),ce.RE_SUBNET_STRING=ce.RE_ADDRESS=ce.GROUPS=ce.BITS=void 0,ce.BITS=32,ce.GROUPS=4,ce.RE_ADDRESS=/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/g,ce.RE_SUBNET_STRING=/\/\d{1,2}$/),ce}var is;function os(){if(is)return ue;is=1;var e=ue&&ue.__createBinding||(Object.create?function(_,m,E,y){y===void 0&&(y=E);var C=Object.getOwnPropertyDescriptor(m,E);(!C||("get"in C?!m.__esModule:C.writable||C.configurable))&&(C={enumerable:!0,get:function(){return m[E]}}),Object.defineProperty(_,y,C)}:function(_,m,E,y){y===void 0&&(y=E),_[y]=m[E]}),t=ue&&ue.__setModuleDefault||(Object.create?function(_,m){Object.defineProperty(_,"default",{enumerable:!0,value:m})}:function(_,m){_.default=m}),r=ue&&ue.__importStar||function(_){if(_&&_.__esModule)return _;var m={};if(_!=null)for(var E in _)E!=="default"&&Object.prototype.hasOwnProperty.call(_,E)&&e(m,_,E);return t(m,_),m};Object.defineProperty(ue,"__esModule",{value:!0}),ue.Address4=void 0;const n=r(zt()),s=r(ss()),i=at(),o=n.isCorrect(s.BITS);class c{constructor(m){this.groups=s.GROUPS,this.parsedAddress=[],this.parsedSubnet="",this.subnet="/32",this.subnetMask=32,this.v4=!0,this.isCorrect=o,this.isInSubnet=n.isInSubnet,this.address=m;const E=s.RE_SUBNET_STRING.exec(m);if(E){if(this.parsedSubnet=E[0].replace("/",""),this.subnetMask=parseInt(this.parsedSubnet,10),this.subnet=`/${this.subnetMask}`,this.subnetMask<0||this.subnetMask>s.BITS)throw new i.AddressError("Invalid subnet mask.");m=m.replace(s.RE_SUBNET_STRING,"")}this.addressMinusSuffix=m,this.parsedAddress=this.parse(m)}static isValid(m){try{return new c(m),!0}catch{return!1}}parse(m){const E=m.split(".");if(!m.match(s.RE_ADDRESS))throw new i.AddressError("Invalid IPv4 address.");return E}correctForm(){return this.parsedAddress.map(m=>parseInt(m,10)).join(".")}static fromAddressAndMask(m,E){const y=n.prefixLengthFromMask(new c(E).bigInt(),s.BITS);return new c(`${m}/${y}`)}static fromAddressAndWildcardMask(m,E){const y=new c(E).bigInt(),C=(BigInt(1)<<BigInt(s.BITS))-BigInt(1),x=y^C,N=n.prefixLengthFromMask(x,s.BITS);return new c(`${m}/${N}`)}static fromWildcard(m){const E=m.split(".");if(E.length!==s.GROUPS)throw new i.AddressError("Wildcard pattern must have 4 octets");let y=-1;for(let U=0;U<E.length;U++)if(E[U]==="*")y===-1&&(y=U);else if(y!==-1)throw new i.AddressError("Wildcard `*` must only appear in trailing octets (e.g. `192.168.0.*`)");const C=y===-1?0:E.length-y,x=E.map(U=>U==="*"?"0":U),N=s.BITS-C*8;return new c(`${x.join(".")}/${N}`)}static fromHex(m){const E=m.replace(/:/g,"");if(!/^[0-9a-fA-F]{8}$/.test(E))throw new i.AddressError("IPv4 hex must be exactly 8 hex digits");const y=[];for(let C=0;C<8;C+=2)y.push(parseInt(E.slice(C,C+2),16));return new c(y.join("."))}static fromInteger(m){if(!Number.isInteger(m)||m<0||m>4294967295)throw new i.AddressError("IPv4 integer must be in the range 0 to 2**32 - 1");return c.fromHex(m.toString(16).padStart(8,"0"))}static fromArpa(m){const y=m.replace(/(\.in-addr\.arpa)?\.$/,"").split(".").reverse().join(".");return new c(y)}toHex(){return this.parsedAddress.map(m=>n.stringToPaddedHex(m)).join(":")}toArray(){return this.parsedAddress.map(m=>parseInt(m,10))}toGroup6(){const m=[];let E;for(E=0;E<s.GROUPS;E+=2)m.push(`${n.stringToPaddedHex(this.parsedAddress[E])}${n.stringToPaddedHex(this.parsedAddress[E+1])}`);return m.join(":")}bigInt(){return BigInt(`0x${this.parsedAddress.map(m=>n.stringToPaddedHex(m)).join("")}`)}_startAddress(){return BigInt(`0b${this.mask()+"0".repeat(s.BITS-this.subnetMask)}`)}startAddress(){return c.fromBigInt(this._startAddress())}startAddressExclusive(){const m=BigInt("1");return c.fromBigInt(this._startAddress()+m)}_endAddress(){return BigInt(`0b${this.mask()+"1".repeat(s.BITS-this.subnetMask)}`)}endAddress(){return c.fromBigInt(this._endAddress())}endAddressExclusive(){const m=BigInt("1");return c.fromBigInt(this._endAddress()-m)}subnetMaskAddress(){return c.fromBigInt(BigInt(`0b${"1".repeat(this.subnetMask)}${"0".repeat(s.BITS-this.subnetMask)}`))}wildcardMask(){return c.fromBigInt(BigInt(`0b${"0".repeat(this.subnetMask)}${"1".repeat(s.BITS-this.subnetMask)}`))}networkForm(){return`${this.startAddress().correctForm()}/${this.subnetMask}`}static fromBigInt(m){if(m<0n||m>0xffffffffn)throw new i.AddressError("IPv4 BigInt must be in the range 0 to 2**32 - 1");return c.fromHex(m.toString(16).padStart(8,"0"))}static fromByteArray(m){if(m.length!==4)throw new i.AddressError("IPv4 addresses require exactly 4 bytes");for(let E=0;E<m.length;E++)if(!Number.isInteger(m[E])||m[E]<0||m[E]>255)throw new i.AddressError("All bytes must be integers between 0 and 255");return this.fromUnsignedByteArray(m)}static fromUnsignedByteArray(m){if(m.length!==4)throw new i.AddressError("IPv4 addresses require exactly 4 bytes");const E=m.join(".");return new c(E)}mask(m){return m===void 0&&(m=this.subnetMask),this.getBitsBase2(0,m)}getBitsBase2(m,E){return this.binaryZeroPad().slice(m,E)}reverseForm(m){m||(m={});const E=this.correctForm().split(".").reverse().join(".");return m.omitSuffix?E:`${E}.in-addr.arpa.`}isMulticast(){return this.isInSubnet(u)}isPrivate(){return l.some(m=>this.isInSubnet(m))}isLoopback(){return this.isInSubnet(a)}isLinkLocal(){return this.isInSubnet(f)}isUnspecified(){return this.isInSubnet(h)}isBroadcast(){return this.isInSubnet(p)}isCGNAT(){return this.isInSubnet($)}binaryZeroPad(){return this._binaryZeroPad===void 0&&(this._binaryZeroPad=this.bigInt().toString(2).padStart(s.BITS,"0")),this._binaryZeroPad}groupForV6(){const m=this.parsedAddress;return this.address.replace(s.RE_ADDRESS,`<span class="hover-group group-v4 group-6">${m.slice(0,2).join(".")}</span>.<span class="hover-group group-v4 group-7">${m.slice(2,4).join(".")}</span>`)}}ue.Address4=c;const u=new c("224.0.0.0/4"),l=[new c("10.0.0.0/8"),new c("172.16.0.0/12"),new c("192.168.0.0/16")],a=new c("127.0.0.0/8"),f=new c("169.254.0.0/16"),h=new c("0.0.0.0/32"),p=new c("255.255.255.255/32"),$=new c("100.64.0.0/10");return ue}var le={},J={},as;function us(){return as||(as=1,Object.defineProperty(J,"__esModule",{value:!0}),J.RE_URL_WITH_PORT=J.RE_URL=J.RE_ZONE_STRING=J.RE_SUBNET_STRING=J.RE_BAD_ADDRESS=J.RE_BAD_CHARACTERS=J.TYPES=J.SCOPES=J.GROUPS=J.BITS=void 0,J.BITS=128,J.GROUPS=8,J.SCOPES={0:"Reserved",1:"Interface local",2:"Link local",4:"Admin local",5:"Site local",8:"Organization local",14:"Global",15:"Reserved"},J.TYPES={"ff01::1/128":"Multicast (All nodes on this interface)","ff01::2/128":"Multicast (All routers on this interface)","ff02::1/128":"Multicast (All nodes on this link)","ff02::2/128":"Multicast (All routers on this link)","ff05::2/128":"Multicast (All routers in this site)","ff02::5/128":"Multicast (OSPFv3 AllSPF routers)","ff02::6/128":"Multicast (OSPFv3 AllDR routers)","ff02::9/128":"Multicast (RIP routers)","ff02::a/128":"Multicast (EIGRP routers)","ff02::d/128":"Multicast (PIM routers)","ff02::16/128":"Multicast (MLDv2 reports)","ff01::fb/128":"Multicast (mDNSv6)","ff02::fb/128":"Multicast (mDNSv6)","ff05::fb/128":"Multicast (mDNSv6)","ff02::1:2/128":"Multicast (All DHCP servers and relay agents on this link)","ff05::1:2/128":"Multicast (All DHCP servers and relay agents in this site)","ff02::1:3/128":"Multicast (All DHCP servers on this link)","ff05::1:3/128":"Multicast (All DHCP servers in this site)","::/128":"Unspecified","::1/128":"Loopback","ff00::/8":"Multicast","fe80::/10":"Link-local unicast","fc00::/7":"Unique local","2002::/16":"6to4","2001:db8::/32":"Documentation","64:ff9b::/96":"NAT64 (well-known)","64:ff9b:1::/48":"NAT64 (local-use)"},J.RE_BAD_CHARACTERS=/([^0-9a-f:/%])/gi,J.RE_BAD_ADDRESS=/([0-9a-f]{5,}|:{3,}|[^:]:$|^:[^:]|\/$)/gi,J.RE_SUBNET_STRING=/\/\d{1,3}(?=%|$)/,J.RE_ZONE_STRING=/%.*$/,J.RE_URL=/^\[{0,1}([0-9a-f:]+)\]{0,1}/,J.RE_URL_WITH_PORT=/\[([0-9a-f:]+)\]:([0-9]{1,5})/),J}var Ie={},cs;function ls(){if(cs)return Ie;cs=1,Object.defineProperty(Ie,"__esModule",{value:!0}),Ie.escapeHtml=e,Ie.spanAllZeroes=t,Ie.spanAll=r,Ie.spanLeadingZeroes=s,Ie.simpleGroup=i;function e(o){return o.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function t(o){return e(o).replace(/(0+)/g,'<span class="zero">$1</span>')}function r(o,c=0){return o.split("").map((l,a)=>`<span class="digit value-${e(l)} position-${a+c}">${t(l)}</span>`).join("")}function n(o){return e(o).replace(/^(0+)/,'<span class="zero">$1</span>')}function s(o){return o.split(":").map(u=>n(u)).join(":")}function i(o,c=0){return o.split(":").map((l,a)=>/group-v4/.test(l)?l:`<span class="hover-group group-${a+c}">${n(l)}</span>`)}return Ie}var se={},fs;function Rl(){if(fs)return se;fs=1;var e=se&&se.__createBinding||(Object.create?function(u,l,a,f){f===void 0&&(f=a);var h=Object.getOwnPropertyDescriptor(l,a);(!h||("get"in h?!l.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return l[a]}}),Object.defineProperty(u,f,h)}:function(u,l,a,f){f===void 0&&(f=a),u[f]=l[a]}),t=se&&se.__setModuleDefault||(Object.create?function(u,l){Object.defineProperty(u,"default",{enumerable:!0,value:l})}:function(u,l){u.default=l}),r=se&&se.__importStar||function(u){if(u&&u.__esModule)return u;var l={};if(u!=null)for(var a in u)a!=="default"&&Object.prototype.hasOwnProperty.call(u,a)&&e(l,u,a);return t(l,u),l};Object.defineProperty(se,"__esModule",{value:!0}),se.ADDRESS_BOUNDARY=void 0,se.groupPossibilities=s,se.padGroup=i,se.simpleRegularExpression=o,se.possibleElisions=c;const n=r(us());function s(u){return`(${u.join("|")})`}function i(u){return u.length<4?`0{0,${4-u.length}}${u}`:u}se.ADDRESS_BOUNDARY="[^A-Fa-f0-9:]";function o(u){const l=[];u.forEach((f,h)=>{parseInt(f,16)===0&&l.push(h)});const a=l.map(f=>u.map((h,p)=>{if(p===f){const $=p===0||p===n.GROUPS-1?":":"";return s([i(h),$])}return i(h)}).join(":"));return a.push(u.map(i).join(":")),s(a)}function c(u,l,a){const f=l?"":":",h=a?"":":",p=[];!l&&!a&&p.push("::"),l&&a&&p.push(""),(a&&!l||!a&&l)&&p.push(":"),p.push(`${f}(:0{1,4}){1,${u-1}}`),p.push(`(0{1,4}:){1,${u-1}}${h}`),p.push(`(0{1,4}:){${u-1}}0{1,4}`);for(let $=1;$<u-1;$++)for(let _=1;_<u-$;_++)p.push(`(0{1,4}:){${_}}:(0{1,4}:){${u-_-$-1}}0{1,4}`);return s(p)}return se}var hs;function Al(){if(hs)return le;hs=1;var e=le&&le.__createBinding||(Object.create?function(L,d,v,b){b===void 0&&(b=v);var w=Object.getOwnPropertyDescriptor(d,v);(!w||("get"in w?!d.__esModule:w.writable||w.configurable))&&(w={enumerable:!0,get:function(){return d[v]}}),Object.defineProperty(L,b,w)}:function(L,d,v,b){b===void 0&&(b=v),L[b]=d[v]}),t=le&&le.__setModuleDefault||(Object.create?function(L,d){Object.defineProperty(L,"default",{enumerable:!0,value:d})}:function(L,d){L.default=d}),r=le&&le.__importStar||function(L){if(L&&L.__esModule)return L;var d={};if(L!=null)for(var v in L)v!=="default"&&Object.prototype.hasOwnProperty.call(L,v)&&e(d,L,v);return t(d,L),d};Object.defineProperty(le,"__esModule",{value:!0}),le.Address6=void 0;const n=r(zt()),s=r(ss()),i=r(us()),o=r(ls()),c=os(),u=Rl(),l=at(),a=zt(),f=n.isCorrect(i.BITS);function h(L){if(!L)throw new Error("Assertion failed.")}function p(L){const d=/(\d+)(\d{3})/;for(;d.test(L);)L=L.replace(d,"$1,$2");return L}function $(L){return L=L.replace(/^(0{1,})([1-9]+)$/,'<span class="parse-error">$1</span>$2'),L=L.replace(/^(0{1,})(0)$/,'<span class="parse-error">$1</span>$2'),L}function _(L,d){const v=[],b=[];let w;for(w=0;w<L.length;w++)w<d[0]?v.push(L[w]):w>d[1]&&b.push(L[w]);return v.concat(["compact"]).concat(b)}function m(L){return parseInt(L,16).toString(16).padStart(4,"0")}function E(L){return L&255}class y{constructor(d,v){this.addressMinusSuffix="",this.parsedSubnet="",this.subnet="/128",this.subnetMask=128,this.v4=!1,this.zone="",this.isInSubnet=n.isInSubnet,this.isCorrect=f,v===void 0?this.groups=i.GROUPS:this.groups=v,this.address=d;const b=i.RE_SUBNET_STRING.exec(d);if(b){if(this.parsedSubnet=b[0].replace("/",""),this.subnetMask=parseInt(this.parsedSubnet,10),this.subnet=`/${this.subnetMask}`,Number.isNaN(this.subnetMask)||this.subnetMask<0||this.subnetMask>i.BITS)throw new l.AddressError("Invalid subnet mask.");d=d.replace(i.RE_SUBNET_STRING,"")}else if(/\//.test(d))throw new l.AddressError("Invalid subnet mask.");const w=i.RE_ZONE_STRING.exec(d);w&&(this.zone=w[0],d=d.replace(i.RE_ZONE_STRING,"")),this.addressMinusSuffix=d,this.parsedAddress=this.parse(this.addressMinusSuffix)}static isValid(d){try{return new y(d),!0}catch{return!1}}static fromBigInt(d){if(d<0n||d>(1n<<BigInt(i.BITS))-1n)throw new l.AddressError("IPv6 BigInt must be in the range 0 to 2**128 - 1");const v=d.toString(16).padStart(32,"0"),b=[];for(let w=0;w<i.GROUPS;w++)b.push(v.slice(w*4,(w+1)*4));return new y(b.join(":"))}static fromURL(d){let v,b=null,w;if(d.indexOf("[")!==-1&&d.indexOf("]:")!==-1){if(w=i.RE_URL_WITH_PORT.exec(d),w===null)return{error:"failed to parse address with port",address:null,port:null};v=w[1],b=w[2]}else if(d.indexOf("/")!==-1){if(d=d.replace(/^[a-z0-9]+:\/\//,""),w=i.RE_URL.exec(d),w===null)return{error:"failed to parse address from URL",address:null,port:null};v=w[1]}else v=d;return b?(b=parseInt(b,10),(b<0||b>65536)&&(b=null)):b=null,{address:new y(v),port:b}}static fromAddressAndMask(d,v){const b=n.prefixLengthFromMask(new y(v).bigInt(),i.BITS);return new y(`${d}/${b}`)}static fromAddressAndWildcardMask(d,v){const b=new y(v).bigInt(),w=(BigInt(1)<<BigInt(i.BITS))-BigInt(1),k=b^w,D=n.prefixLengthFromMask(k,i.BITS);return new y(`${d}/${D}`)}static fromWildcard(d){if(d.includes("%")||d.includes("/"))throw new l.AddressError("Wildcard pattern must not include a zone or CIDR suffix");const v=d.split("::");if(v.length>2)throw new l.AddressError("Wildcard pattern cannot contain more than one '::'");let b;if(v.length===2){const S=v[0]===""?[]:v[0].split(":"),I=v[1]===""?[]:v[1].split(":"),T=i.GROUPS-S.length-I.length;if(T<1)throw new l.AddressError("Wildcard pattern with '::' has too many groups");b=[...S,...new Array(T).fill("0"),...I]}else b=d.split(":");if(b.length!==i.GROUPS)throw new l.AddressError("Wildcard pattern must have 8 groups");let w=-1;for(let S=0;S<b.length;S++)if(b[S]==="*")w===-1&&(w=S);else if(w!==-1)throw new l.AddressError("Wildcard `*` must only appear in trailing groups (e.g. `2001:db8:*:*:*:*:*:*`)");const k=w===-1?0:b.length-w,D=b.map(S=>S==="*"?"0":S),j=i.BITS-k*16;return new y(`${D.join(":")}/${j}`)}static fromAddress4(d){const v=new c.Address4(d),b=i.BITS-(s.BITS-v.subnetMask);return new y(`::ffff:${v.correctForm()}/${b}`)}static fromArpa(d){let v=d.replace(/(\.ip6\.arpa)?\.$/,"");const b=7;if(v.length!==63)throw new l.AddressError("Invalid 'ip6.arpa' form.");const w=v.split(".").reverse();for(let k=b;k>0;k--){const D=k*4;w.splice(D,0,":")}return v=w.join(""),new y(v)}microsoftTranscription(){return`${this.correctForm().replace(/:/g,"-")}.ipv6-literal.net`}mask(d=this.subnetMask){return this.getBitsBase2(0,d)}possibleSubnets(d=128){const v=i.BITS-this.subnetMask,b=Math.abs(d-i.BITS),w=v-b;return w<0?"0":p((BigInt("2")**BigInt(w)).toString(10))}_startAddress(){return BigInt(`0b${this.mask()+"0".repeat(i.BITS-this.subnetMask)}`)}startAddress(){return y.fromBigInt(this._startAddress())}startAddressExclusive(){const d=BigInt("1");return y.fromBigInt(this._startAddress()+d)}_endAddress(){return BigInt(`0b${this.mask()+"1".repeat(i.BITS-this.subnetMask)}`)}endAddress(){return y.fromBigInt(this._endAddress())}endAddressExclusive(){const d=BigInt("1");return y.fromBigInt(this._endAddress()-d)}subnetMaskAddress(){return y.fromBigInt(BigInt(`0b${"1".repeat(this.subnetMask)}${"0".repeat(i.BITS-this.subnetMask)}`))}wildcardMask(){return y.fromBigInt(BigInt(`0b${"0".repeat(this.subnetMask)}${"1".repeat(i.BITS-this.subnetMask)}`))}networkForm(){return`${this.startAddress().correctForm()}/${this.subnetMask}`}getScope(){const d=this.getType();return d==="Multicast"||d.startsWith("Multicast ")?i.SCOPES[parseInt(this.getBits(12,16).toString(10),10)]||"Unknown":d==="Link-local unicast"||d==="Loopback"?"Link local":d==="Unspecified"?"Unknown":"Global"}getType(){for(let d=0;d<C.length;d++){const v=C[d];if(this.isInSubnet(v[0]))return v[1]}return"Global unicast"}getBits(d,v){return BigInt(`0b${this.getBitsBase2(d,v)}`)}getBitsBase2(d,v){return this.binaryZeroPad().slice(d,v)}getBitsBase16(d,v){const b=v-d;if(b%4!==0)throw new Error("Length of bits to retrieve must be divisible by four");return this.getBits(d,v).toString(16).padStart(b/4,"0")}getBitsPastSubnet(){return this.getBitsBase2(this.subnetMask,i.BITS)}reverseForm(d){d||(d={});const v=Math.floor(this.subnetMask/4),b=this.canonicalForm().replace(/:/g,"").split("").slice(0,v).reverse().join(".");return v>0?d.omitSuffix?b:`${b}.ip6.arpa.`:d.omitSuffix?"":"ip6.arpa."}correctForm(){let d,v=[],b=0;const w=[];for(d=0;d<this.parsedAddress.length;d++){const j=parseInt(this.parsedAddress[d],16);j===0&&b++,j!==0&&b>0&&(b>1&&w.push([d-b,d-1]),b=0)}b>1&&w.push([this.parsedAddress.length-b,this.parsedAddress.length-1]);const k=w.map(j=>j[1]-j[0]+1);if(w.length>0){const j=k.indexOf(Math.max(...k));v=_(this.parsedAddress,w[j])}else v=this.parsedAddress;for(d=0;d<v.length;d++)v[d]!=="compact"&&(v[d]=parseInt(v[d],16).toString(16));let D=v.join(":");return D=D.replace(/^compact$/,"::"),D=D.replace(/(^compact)|(compact$)/,":"),D=D.replace(/compact/,""),D}binaryZeroPad(){return this._binaryZeroPad===void 0&&(this._binaryZeroPad=this.bigInt().toString(2).padStart(i.BITS,"0")),this._binaryZeroPad}parse4in6(d){if(d.indexOf(".")===-1)return d;const v=d.split(":"),w=v.slice(-1)[0].match(s.RE_ADDRESS);if(w){this.parsedAddress4=w[0],this.address4=new c.Address4(this.parsedAddress4);for(let k=0;k<this.address4.groups;k++)if(/^0[0-9]+/.test(this.address4.parsedAddress[k])){const D=this.address4.parsedAddress.map($).join("."),j=v.slice(0,-1).map(o.escapeHtml).join(":"),S=v.length>1?":":"";throw new l.AddressError("IPv4 addresses can't have leading zeroes.",`${j}${S}${D}`)}this.v4=!0,v[v.length-1]=this.address4.toGroup6(),d=v.join(":")}return d}parse(d){d=this.parse4in6(d);const v=d.match(i.RE_BAD_CHARACTERS);if(v)throw new l.AddressError(`Bad character${v.length>1?"s":""} detected in address: ${v.join("")}`,d.replace(i.RE_BAD_CHARACTERS,'<span class="parse-error">$1</span>'));const b=d.match(i.RE_BAD_ADDRESS);if(b)throw new l.AddressError(`Address failed regex: ${b.join("")}`,d.replace(i.RE_BAD_ADDRESS,'<span class="parse-error">$1</span>'));let w=[];const k=d.split("::");if(k.length===2){let D=k[0].split(":"),j=k[1].split(":");D.length===1&&D[0]===""&&(D=[]),j.length===1&&j[0]===""&&(j=[]);const S=this.groups-(D.length+j.length);if(!S)throw new l.AddressError("Error parsing groups");this.elidedGroups=S,this.elisionBegin=D.length,this.elisionEnd=D.length+this.elidedGroups,w=w.concat(D);for(let I=0;I<S;I++)w.push("0");w=w.concat(j)}else if(k.length===1)w=d.split(":"),this.elidedGroups=0;else throw new l.AddressError("Too many :: groups found");if(w=w.map(D=>parseInt(D,16).toString(16)),w.length!==this.groups)throw new l.AddressError("Incorrect number of groups found");return w}canonicalForm(){return this.parsedAddress.map(m).join(":")}decimal(){return this.parsedAddress.map(d=>parseInt(d,16).toString(10).padStart(5,"0")).join(":")}bigInt(){return BigInt(`0x${this.parsedAddress.map(m).join("")}`)}to4(){const d=this.binaryZeroPad().split("");return c.Address4.fromHex(BigInt(`0b${d.slice(96,128).join("")}`).toString(16).padStart(8,"0"))}to4in6(){const d=this.to4(),b=new y(this.parsedAddress.slice(0,6).join(":"),6).correctForm();let w="";return/:$/.test(b)||(w=":"),b+w+d.address}inspectTeredo(){const d=this.getBitsBase16(0,32),b=(this.getBits(80,96)^BigInt("0xffff")).toString(),w=c.Address4.fromHex(this.getBitsBase16(32,64)),k=this.getBits(96,128),D=c.Address4.fromHex((k^BigInt("0xffffffff")).toString(16).padStart(8,"0")),j=this.getBitsBase2(64,80),S=(0,a.testBit)(j,15),I=(0,a.testBit)(j,14),T=(0,a.testBit)(j,8),R=(0,a.testBit)(j,9),Z=BigInt(`0b${j.slice(2,6)+j.slice(8,16)}`).toString(10);return{prefix:`${d.slice(0,4)}:${d.slice(4,8)}`,server4:w.address,client4:D.address,flags:j,coneNat:S,microsoft:{reserved:I,universalLocal:R,groupIndividual:T,nonce:Z},udpPort:b}}inspect6to4(){const d=this.getBitsBase16(0,16),v=c.Address4.fromHex(this.getBitsBase16(16,48));return{prefix:d.slice(0,4),gateway:v.address}}to6to4(){if(!this.is4())return null;const d=["2002",this.getBitsBase16(96,112),this.getBitsBase16(112,128),"","/16"].join(":");return new y(d)}static fromAddress4Nat64(d,v="64:ff9b::/96"){const b=new c.Address4(d),w=new y(v),k=w.subnetMask;if(k!==32&&k!==40&&k!==48&&k!==56&&k!==64&&k!==96)throw new l.AddressError("NAT64 prefix length must be 32, 40, 48, 56, 64, or 96");const D=w.binaryZeroPad(),j=b.binaryZeroPad();let S;if(k===96)S=D.slice(0,96)+j;else{const R=64-k;S=D.slice(0,k)+j.slice(0,R)+"00000000"+j.slice(R)+"0".repeat(56-(32-R))}const I=BigInt(`0b${S}`).toString(16).padStart(32,"0"),T=[];for(let R=0;R<8;R++)T.push(I.slice(R*4,(R+1)*4));return new y(T.join(":"))}toAddress4Nat64(d="64:ff9b::/96"){const v=new y(d),b=v.subnetMask;if(b!==32&&b!==40&&b!==48&&b!==56&&b!==64&&b!==96)throw new l.AddressError("NAT64 prefix length must be 32, 40, 48, 56, 64, or 96");if(!this.isInSubnet(v))return null;const w=this.binaryZeroPad();let k;if(b===96)k=w.slice(96,128);else{const j=64-b;k=w.slice(b,b+j)+w.slice(72,72+(32-j))}const D=[];for(let j=0;j<4;j++)D.push(parseInt(k.slice(j*8,(j+1)*8),2).toString());return new c.Address4(D.join("."))}toByteArray(){const d=this.bigInt().toString(16),b=`${"0".repeat(d.length%2)}${d}`,w=[];for(let k=0,D=b.length;k<D;k+=2)w.push(parseInt(b.substring(k,k+2),16));return w}toUnsignedByteArray(){return this.toByteArray().map(E)}static fromByteArray(d){return this.fromUnsignedByteArray(d.map(E))}static fromUnsignedByteArray(d){const v=BigInt("256");let b=BigInt("0"),w=BigInt("1");for(let k=d.length-1;k>=0;k--)b+=w*BigInt(d[k].toString(10)),w*=v;return y.fromBigInt(b)}isCanonical(){return this.addressMinusSuffix===this.canonicalForm()}isLinkLocal(){return this.getBitsBase2(0,64)==="1111111010000000000000000000000000000000000000000000000000000000"}isMulticast(){const d=this.getType();return d==="Multicast"||d.startsWith("Multicast ")}is4(){return this.v4}isMapped4(){return this.isInSubnet(z)}isTeredo(){return this.isInSubnet(x)}is6to4(){return this.isInSubnet(N)}isLoopback(){return this.getType()==="Loopback"}isULA(){return this.isInSubnet(U)}isUnspecified(){return this.getType()==="Unspecified"}isDocumentation(){return this.isInSubnet(Q)}href(d){return d===void 0?d="":d=`:${d}`,`http://[${this.correctForm()}]${d}/`}link(d){d||(d={}),d.className===void 0&&(d.className=""),d.prefix===void 0&&(d.prefix="/#address="),d.v4===void 0&&(d.v4=!1);let v=this.correctForm;d.v4&&(v=this.to4in6);const b=v.call(this),w=o.escapeHtml(`${d.prefix}${b}`),k=o.escapeHtml(b);if(d.className){const D=o.escapeHtml(d.className);return`<a href="${w}" class="${D}">${k}</a>`}return`<a href="${w}">${k}</a>`}group(){if(this.elidedGroups===0)return o.simpleGroup(this.addressMinusSuffix).join(":");h(typeof this.elidedGroups=="number"),h(typeof this.elisionBegin=="number");const d=[],[v,b]=this.addressMinusSuffix.split("::");v.length?d.push(...o.simpleGroup(v)):d.push("");const w=["hover-group"];for(let k=this.elisionBegin;k<this.elisionBegin+this.elidedGroups;k++)w.push(`group-${k}`);return d.push(`<span class="${w.join(" ")}"></span>`),b.length?d.push(...o.simpleGroup(b,this.elisionEnd)):d.push(""),this.is4()&&(h(this.address4 instanceof c.Address4),d.pop(),d.push(this.address4.groupForV6())),d.join(":")}regularExpressionString(d=!1){let v=[];const b=new y(this.correctForm());if(b.elidedGroups===0)v.push((0,u.simpleRegularExpression)(b.parsedAddress));else if(b.elidedGroups===i.GROUPS)v.push((0,u.possibleElisions)(i.GROUPS));else{const w=b.address.split("::");w[0].length&&v.push((0,u.simpleRegularExpression)(w[0].split(":"))),h(typeof b.elidedGroups=="number"),v.push((0,u.possibleElisions)(b.elidedGroups,w[0].length!==0,w[1].length!==0)),w[1].length&&v.push((0,u.simpleRegularExpression)(w[1].split(":"))),v=[v.join(":")]}return d||(v=["(?=^|",u.ADDRESS_BOUNDARY,"|[^\\w\\:])(",...v,")(?=[^\\w\\:]|",u.ADDRESS_BOUNDARY,"|$)"]),v.join("")}regularExpression(d=!1){return new RegExp(this.regularExpressionString(d),"i")}}le.Address6=y;const C=Object.keys(i.TYPES).map(L=>[new y(L),i.TYPES[L]]),x=new y("2001::/32"),N=new y("2002::/16"),U=new y("fc00::/7"),Q=new y("2001:db8::/32"),z=new y("::ffff:0:0/96");return le}var ds;function Tl(){return ds||(ds=1,function(e){var t=ve&&ve.__createBinding||(Object.create?function(u,l,a,f){f===void 0&&(f=a);var h=Object.getOwnPropertyDescriptor(l,a);(!h||("get"in h?!l.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return l[a]}}),Object.defineProperty(u,f,h)}:function(u,l,a,f){f===void 0&&(f=a),u[f]=l[a]}),r=ve&&ve.__setModuleDefault||(Object.create?function(u,l){Object.defineProperty(u,"default",{enumerable:!0,value:l})}:function(u,l){u.default=l}),n=ve&&ve.__importStar||function(u){if(u&&u.__esModule)return u;var l={};if(u!=null)for(var a in u)a!=="default"&&Object.prototype.hasOwnProperty.call(u,a)&&t(l,u,a);return r(l,u),l};Object.defineProperty(e,"__esModule",{value:!0}),e.v6=e.AddressError=e.Address6=e.Address4=void 0;var s=os();Object.defineProperty(e,"Address4",{enumerable:!0,get:function(){return s.Address4}});var i=Al();Object.defineProperty(e,"Address6",{enumerable:!0,get:function(){return i.Address6}});var o=at();Object.defineProperty(e,"AddressError",{enumerable:!0,get:function(){return o.AddressError}});const c=n(ls());e.v6={helpers:c}}(ve)),ve}var $e=Tl();class ps{host;port;constructor(t){const r=t.lastIndexOf(":"),n=t.slice(0,r),s=t.slice(r+1);if(r===-1||!/^(\d+|\*)$/.test(s))throw new Error(`Invalid host pattern "${t}": a port (or "*") is required`);this.host=n,this.port=s}validate(t,r){return this.matchesHost(t)&&(this.port==="*"||Number(this.port)===r)}matchesHost(t){const r=this.host.toLowerCase();return t=t.toLowerCase(),r==="*"?!0:r==="localhost"?t==="localhost"||kl(t):r==="private"?Ol(t):r.startsWith("*.")?t.endsWith(r.slice(1)):r===t}}function Ol(e){return $e.Address4.isValid(e)&&new $e.Address4(e).isPrivate()}function kl(e){if(e.startsWith("[")&&e.endsWith("]")){const t=e.slice(1,-1);return $e.Address6.isValid(t)&&new $e.Address6(t).isLoopback()}return $e.Address4.isValid(e)&&new $e.Address4(e).isLoopback()||$e.Address6.isValid(e)&&new $e.Address6(e).isLoopback()}const Pl=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var ut={exports:{}},Zt,ms;function Be(){if(ms)return Zt;ms=1;const e="2.0.0",t=256,r=Number.MAX_SAFE_INTEGER||9007199254740991,n=16,s=t-6;return Zt={MAX_LENGTH:t,MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:s,MAX_SAFE_INTEGER:r,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:e,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},Zt}var Dt,gs;function ct(){return gs||(gs=1,Dt=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{}),Dt}var vs;function Fe(){return vs||(vs=1,function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:s}=Be(),i=ct();t=e.exports={};const o=t.re=[],c=t.safeRe=[],u=t.src=[],l=t.safeSrc=[],a=t.t={};let f=0;const h="[a-zA-Z0-9-]",p=[["\\s",1],["\\d",s],[h,n]],$=m=>{for(const[E,y]of p)m=m.split(`${E}*`).join(`${E}{0,${y}}`).split(`${E}+`).join(`${E}{1,${y}}`);return m},_=(m,E,y)=>{const C=$(E),x=f++;i(m,x,E),a[m]=x,u[x]=E,l[x]=C,o[x]=new RegExp(E,y?"g":void 0),c[x]=new RegExp(C,y?"g":void 0)};_("NUMERICIDENTIFIER","0|[1-9]\\d*"),_("NUMERICIDENTIFIERLOOSE","\\d+"),_("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${h}*`),_("MAINVERSION",`(${u[a.NUMERICIDENTIFIER]})\\.(${u[a.NUMERICIDENTIFIER]})\\.(${u[a.NUMERICIDENTIFIER]})`),_("MAINVERSIONLOOSE",`(${u[a.NUMERICIDENTIFIERLOOSE]})\\.(${u[a.NUMERICIDENTIFIERLOOSE]})\\.(${u[a.NUMERICIDENTIFIERLOOSE]})`),_("PRERELEASEIDENTIFIER",`(?:${u[a.NONNUMERICIDENTIFIER]}|${u[a.NUMERICIDENTIFIER]})`),_("PRERELEASEIDENTIFIERLOOSE",`(?:${u[a.NONNUMERICIDENTIFIER]}|${u[a.NUMERICIDENTIFIERLOOSE]})`),_("PRERELEASE",`(?:-(${u[a.PRERELEASEIDENTIFIER]}(?:\\.${u[a.PRERELEASEIDENTIFIER]})*))`),_("PRERELEASELOOSE",`(?:-?(${u[a.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[a.PRERELEASEIDENTIFIERLOOSE]})*))`),_("BUILDIDENTIFIER",`${h}+`),_("BUILD",`(?:\\+(${u[a.BUILDIDENTIFIER]}(?:\\.${u[a.BUILDIDENTIFIER]})*))`),_("FULLPLAIN",`v?${u[a.MAINVERSION]}${u[a.PRERELEASE]}?${u[a.BUILD]}?`),_("FULL",`^${u[a.FULLPLAIN]}$`),_("LOOSEPLAIN",`[v=\\s]*${u[a.MAINVERSIONLOOSE]}${u[a.PRERELEASELOOSE]}?${u[a.BUILD]}?`),_("LOOSE",`^${u[a.LOOSEPLAIN]}$`),_("GTLT","((?:<|>)?=?)"),_("XRANGEIDENTIFIERLOOSE",`${u[a.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),_("XRANGEIDENTIFIER",`${u[a.NUMERICIDENTIFIER]}|x|X|\\*`),_("XRANGEPLAIN",`[v=\\s]*(${u[a.XRANGEIDENTIFIER]})(?:\\.(${u[a.XRANGEIDENTIFIER]})(?:\\.(${u[a.XRANGEIDENTIFIER]})(?:${u[a.PRERELEASE]})?${u[a.BUILD]}?)?)?`),_("XRANGEPLAINLOOSE",`[v=\\s]*(${u[a.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[a.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[a.XRANGEIDENTIFIERLOOSE]})(?:${u[a.PRERELEASELOOSE]})?${u[a.BUILD]}?)?)?`),_("XRANGE",`^${u[a.GTLT]}\\s*${u[a.XRANGEPLAIN]}$`),_("XRANGELOOSE",`^${u[a.GTLT]}\\s*${u[a.XRANGEPLAINLOOSE]}$`),_("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),_("COERCE",`${u[a.COERCEPLAIN]}(?:$|[^\\d])`),_("COERCEFULL",u[a.COERCEPLAIN]+`(?:${u[a.PRERELEASE]})?(?:${u[a.BUILD]})?(?:$|[^\\d])`),_("COERCERTL",u[a.COERCE],!0),_("COERCERTLFULL",u[a.COERCEFULL],!0),_("LONETILDE","(?:~>?)"),_("TILDETRIM",`(\\s*)${u[a.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",_("TILDE",`^${u[a.LONETILDE]}${u[a.XRANGEPLAIN]}$`),_("TILDELOOSE",`^${u[a.LONETILDE]}${u[a.XRANGEPLAINLOOSE]}$`),_("LONECARET","(?:\\^)"),_("CARETTRIM",`(\\s*)${u[a.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",_("CARET",`^${u[a.LONECARET]}${u[a.XRANGEPLAIN]}$`),_("CARETLOOSE",`^${u[a.LONECARET]}${u[a.XRANGEPLAINLOOSE]}$`),_("COMPARATORLOOSE",`^${u[a.GTLT]}\\s*(${u[a.LOOSEPLAIN]})$|^$`),_("COMPARATOR",`^${u[a.GTLT]}\\s*(${u[a.FULLPLAIN]})$|^$`),_("COMPARATORTRIM",`(\\s*)${u[a.GTLT]}\\s*(${u[a.LOOSEPLAIN]}|${u[a.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",_("HYPHENRANGE",`^\\s*(${u[a.XRANGEPLAIN]})\\s+-\\s+(${u[a.XRANGEPLAIN]})\\s*$`),_("HYPHENRANGELOOSE",`^\\s*(${u[a.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[a.XRANGEPLAINLOOSE]})\\s*$`),_("STAR","(<|>)?=?\\s*\\*"),_("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),_("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(ut,ut.exports)),ut.exports}var jt,_s;function xt(){if(_s)return jt;_s=1;const e=Object.freeze({loose:!0}),t=Object.freeze({});return jt=n=>n?typeof n!="object"?e:n:t,jt}var Mt,Es;function bs(){if(Es)return Mt;Es=1;const e=/^[0-9]+$/,t=(n,s)=>{if(typeof n=="number"&&typeof s=="number")return n===s?0:n<s?-1:1;const i=e.test(n),o=e.test(s);return i&&o&&(n=+n,s=+s),n===s?0:i&&!o?-1:o&&!i?1:n<s?-1:1};return Mt={compareIdentifiers:t,rcompareIdentifiers:(n,s)=>t(s,n)},Mt}var Ut,ws;function ne(){if(ws)return Ut;ws=1;const e=ct(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:r}=Be(),{safeRe:n,t:s}=Fe(),i=xt(),{compareIdentifiers:o}=bs(),c=(l,a)=>{const f=a.split(".");if(f.length>l.length)return!1;for(let h=0;h<f.length;h++)if(o(l[h],f[h])!==0)return!1;return!0};class u{constructor(a,f){if(f=i(f),a instanceof u){if(a.loose===!!f.loose&&a.includePrerelease===!!f.includePrerelease)return a;a=a.version}else if(typeof a!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof a}".`);if(a.length>t)throw new TypeError(`version is longer than ${t} characters`);e("SemVer",a,f),this.options=f,this.loose=!!f.loose,this.includePrerelease=!!f.includePrerelease;const h=a.trim().match(f.loose?n[s.LOOSE]:n[s.FULL]);if(!h)throw new TypeError(`Invalid Version: ${a}`);if(this.raw=a,this.major=+h[1],this.minor=+h[2],this.patch=+h[3],this.major>r||this.major<0)throw new TypeError("Invalid major version");if(this.minor>r||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>r||this.patch<0)throw new TypeError("Invalid patch version");h[4]?this.prerelease=h[4].split(".").map(p=>{if(/^[0-9]+$/.test(p)){const $=+p;if($>=0&&$<r)return $}return p}):this.prerelease=[],this.build=h[5]?h[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(a){if(e("SemVer.compare",this.version,this.options,a),!(a instanceof u)){if(typeof a=="string"&&a===this.version)return 0;a=new u(a,this.options)}return a.version===this.version?0:this.compareMain(a)||this.comparePre(a)}compareMain(a){return a instanceof u||(a=new u(a,this.options)),this.major<a.major?-1:this.major>a.major?1:this.minor<a.minor?-1:this.minor>a.minor?1:this.patch<a.patch?-1:this.patch>a.patch?1:0}comparePre(a){if(a instanceof u||(a=new u(a,this.options)),this.prerelease.length&&!a.prerelease.length)return-1;if(!this.prerelease.length&&a.prerelease.length)return 1;if(!this.prerelease.length&&!a.prerelease.length)return 0;let f=0;do{const h=this.prerelease[f],p=a.prerelease[f];if(e("prerelease compare",f,h,p),h===void 0&&p===void 0)return 0;if(p===void 0)return 1;if(h===void 0)return-1;if(h===p)continue;return o(h,p)}while(++f)}compareBuild(a){a instanceof u||(a=new u(a,this.options));let f=0;do{const h=this.build[f],p=a.build[f];if(e("build compare",f,h,p),h===void 0&&p===void 0)return 0;if(p===void 0)return 1;if(h===void 0)return-1;if(h===p)continue;return o(h,p)}while(++f)}inc(a,f,h){if(a.startsWith("pre")){if(!f&&h===!1)throw new Error("invalid increment argument: identifier is empty");if(f){const p=`-${f}`.match(this.options.loose?n[s.PRERELEASELOOSE]:n[s.PRERELEASE]);if(!p||p[1]!==f)throw new Error(`invalid identifier: ${f}`)}}switch(a){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",f,h);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",f,h);break;case"prepatch":this.prerelease.length=0,this.inc("patch",f,h),this.inc("pre",f,h);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",f,h),this.inc("pre",f,h);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const p=Number(h)?1:0;if(this.prerelease.length===0)this.prerelease=[p];else{let $=this.prerelease.length;for(;--$>=0;)typeof this.prerelease[$]=="number"&&(this.prerelease[$]++,$=-2);if($===-1){if(f===this.prerelease.join(".")&&h===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(p)}}if(f){let $=[f,p];if(h===!1&&($=[f]),c(this.prerelease,f)){const _=this.prerelease[f.split(".").length];isNaN(_)&&(this.prerelease=$)}else this.prerelease=$}break}default:throw new Error(`invalid increment argument: ${a}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return Ut=u,Ut}var Bt,Ss;function ke(){if(Ss)return Bt;Ss=1;const e=ne();return Bt=(r,n,s=!1)=>{if(r instanceof e)return r;try{return new e(r,n)}catch(i){if(!s)return null;throw i}},Bt}var Ft,Is;function Cl(){if(Is)return Ft;Is=1;const e=ke();return Ft=(r,n)=>{const s=e(r,n);return s?s.version:null},Ft}var qt,$s;function Nl(){if($s)return qt;$s=1;const e=ke();return qt=(r,n)=>{const s=e(r.trim().replace(/^[=v]+/,""),n);return s?s.version:null},qt}var Gt,ys;function Ll(){if(ys)return Gt;ys=1;const e=ne();return Gt=(r,n,s,i,o)=>{typeof s=="string"&&(o=i,i=s,s=void 0);try{return new e(r instanceof e?r.version:r,s).inc(n,i,o).version}catch{return null}},Gt}var Vt,Rs;function zl(){if(Rs)return Vt;Rs=1;const e=ke();return Vt=(r,n)=>{const s=e(r,null,!0),i=e(n,null,!0),o=s.compare(i);if(o===0)return null;const c=o>0,u=c?s:i,l=c?i:s,a=!!u.prerelease.length;if(!!l.prerelease.length&&!a){if(!l.patch&&!l.minor)return"major";if(l.compareMain(u)===0)return l.minor&&!l.patch?"minor":"patch"}const h=a?"pre":"";return s.major!==i.major?h+"major":s.minor!==i.minor?h+"minor":s.patch!==i.patch?h+"patch":"prerelease"},Vt}var Wt,As;function Zl(){if(As)return Wt;As=1;const e=ne();return Wt=(r,n)=>new e(r,n).major,Wt}var Ht,Ts;function Dl(){if(Ts)return Ht;Ts=1;const e=ne();return Ht=(r,n)=>new e(r,n).minor,Ht}var Xt,Os;function jl(){if(Os)return Xt;Os=1;const e=ne();return Xt=(r,n)=>new e(r,n).patch,Xt}var Kt,ks;function xl(){if(ks)return Kt;ks=1;const e=ke();return Kt=(r,n)=>{const s=e(r,n);return s&&s.prerelease.length?s.prerelease:null},Kt}var Yt,Ps;function fe(){if(Ps)return Yt;Ps=1;const e=ne();return Yt=(r,n,s)=>new e(r,s).compare(new e(n,s)),Yt}var Jt,Cs;function Ml(){if(Cs)return Jt;Cs=1;const e=fe();return Jt=(r,n,s)=>e(n,r,s),Jt}var Qt,Ns;function Ul(){if(Ns)return Qt;Ns=1;const e=fe();return Qt=(r,n)=>e(r,n,!0),Qt}var er,Ls;function tr(){if(Ls)return er;Ls=1;const e=ne();return er=(r,n,s)=>{const i=new e(r,s),o=new e(n,s);return i.compare(o)||i.compareBuild(o)},er}var rr,zs;function Bl(){if(zs)return rr;zs=1;const e=tr();return rr=(r,n)=>r.sort((s,i)=>e(s,i,n)),rr}var nr,Zs;function Fl(){if(Zs)return nr;Zs=1;const e=tr();return nr=(r,n)=>r.sort((s,i)=>e(i,s,n)),nr}var sr,Ds;function lt(){if(Ds)return sr;Ds=1;const e=fe();return sr=(r,n,s)=>e(r,n,s)>0,sr}var ir,js;function or(){if(js)return ir;js=1;const e=fe();return ir=(r,n,s)=>e(r,n,s)<0,ir}var ar,xs;function Ms(){if(xs)return ar;xs=1;const e=fe();return ar=(r,n,s)=>e(r,n,s)===0,ar}var ur,Us;function Bs(){if(Us)return ur;Us=1;const e=fe();return ur=(r,n,s)=>e(r,n,s)!==0,ur}var cr,Fs;function lr(){if(Fs)return cr;Fs=1;const e=fe();return cr=(r,n,s)=>e(r,n,s)>=0,cr}var fr,qs;function hr(){if(qs)return fr;qs=1;const e=fe();return fr=(r,n,s)=>e(r,n,s)<=0,fr}var dr,Gs;function Vs(){if(Gs)return dr;Gs=1;const e=Ms(),t=Bs(),r=lt(),n=lr(),s=or(),i=hr();return dr=(c,u,l,a)=>{switch(u){case"===":return typeof c=="object"&&(c=c.version),typeof l=="object"&&(l=l.version),c===l;case"!==":return typeof c=="object"&&(c=c.version),typeof l=="object"&&(l=l.version),c!==l;case"":case"=":case"==":return e(c,l,a);case"!=":return t(c,l,a);case">":return r(c,l,a);case">=":return n(c,l,a);case"<":return s(c,l,a);case"<=":return i(c,l,a);default:throw new TypeError(`Invalid operator: ${u}`)}},dr}var pr,Ws;function ql(){if(Ws)return pr;Ws=1;const e=ne(),t=ke(),{safeRe:r,t:n}=Fe();return pr=(i,o)=>{if(i instanceof e)return i;if(typeof i=="number"&&(i=String(i)),typeof i!="string")return null;o=o||{};let c=null;if(!o.rtl)c=i.match(o.includePrerelease?r[n.COERCEFULL]:r[n.COERCE]);else{const p=o.includePrerelease?r[n.COERCERTLFULL]:r[n.COERCERTL];let $;for(;($=p.exec(i))&&(!c||c.index+c[0].length!==i.length);)(!c||$.index+$[0].length!==c.index+c[0].length)&&(c=$),p.lastIndex=$.index+$[1].length+$[2].length;p.lastIndex=-1}if(c===null)return null;const u=c[2],l=c[3]||"0",a=c[4]||"0",f=o.includePrerelease&&c[5]?`-${c[5]}`:"",h=o.includePrerelease&&c[6]?`+${c[6]}`:"";return t(`${u}.${l}.${a}${f}${h}`,o)},pr}var mr,Hs;function Gl(){if(Hs)return mr;Hs=1;const e=ke(),t=Be(),r=ne(),n=(c,u,l)=>{if(!t.RELEASE_TYPES.includes(u))return null;const a=s(c,l);return a&&i(a,u)},s=(c,u)=>{const l=c instanceof r?c.version:c;return e(l,u)},i=(c,u)=>{if(o(u))return c.version;switch(c.prerelease=[],u){case"major":c.minor=0,c.patch=0;break;case"minor":c.patch=0;break}return c.format()},o=c=>c.startsWith("pre");return mr=n,mr}var gr,Xs;function Vl(){if(Xs)return gr;Xs=1;class e{constructor(){this.max=1e3,this.map=new Map}get(r){const n=this.map.get(r);if(n!==void 0)return this.map.delete(r),this.map.set(r,n),n}delete(r){return this.map.delete(r)}set(r,n){if(!this.delete(r)&&n!==void 0){if(this.map.size>=this.max){const i=this.map.keys().next().value;this.delete(i)}this.map.set(r,n)}return this}}return gr=e,gr}var vr,Ks;function he(){if(Ks)return vr;Ks=1;const e=/\s+/g;class t{constructor(I,T){if(T=s(T),I instanceof t)return I.loose===!!T.loose&&I.includePrerelease===!!T.includePrerelease?I:new t(I.raw,T);if(I instanceof i)return this.raw=I.value,this.set=[[I]],this.formatted=void 0,this;if(this.options=T,this.loose=!!T.loose,this.includePrerelease=!!T.includePrerelease,this.raw=I.trim().replace(e," "),this.set=this.raw.split("||").map(R=>this.parseRange(R.trim())).filter(R=>R.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const R=this.set[0];if(this.set=this.set.filter(Z=>!E(Z[0])),this.set.length===0)this.set=[R];else if(this.set.length>1){for(const Z of this.set)if(Z.length===1&&y(Z[0])){this.set=[Z];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let I=0;I<this.set.length;I++){I>0&&(this.formatted+="||");const T=this.set[I];for(let R=0;R<T.length;R++)R>0&&(this.formatted+=" "),this.formatted+=T[R].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(I){I=I.replace(m,"");const R=((this.options.includePrerelease&&$)|(this.options.loose&&_))+":"+I,Z=n.get(R);if(Z)return Z;const O=this.options.loose,P=O?u[a.HYPHENRANGELOOSE]:u[a.HYPHENRANGE];I=I.replace(P,D(this.options.includePrerelease)),o("hyphen replace",I),I=I.replace(u[a.COMPARATORTRIM],f),o("comparator trim",I),I=I.replace(u[a.TILDETRIM],h),o("tilde trim",I),I=I.replace(u[a.CARETTRIM],p),o("caret trim",I);let B=I.split(" ").map(ee=>x(ee,this.options)).join(" ").split(/\s+/).map(ee=>k(ee,this.options));O&&(B=B.filter(ee=>(o("loose invalid filter",ee,this.options),!!ee.match(u[a.COMPARATORLOOSE])))),o("range list",B);const M=new Map,F=B.map(ee=>new i(ee,this.options));for(const ee of F){if(E(ee))return[ee];M.set(ee.value,ee)}M.size>1&&M.has("")&&M.delete("");const oe=[...M.values()];return n.set(R,oe),oe}intersects(I,T){if(!(I instanceof t))throw new TypeError("a Range is required");return this.set.some(R=>C(R,T)&&I.set.some(Z=>C(Z,T)&&R.every(O=>Z.every(P=>O.intersects(P,T)))))}test(I){if(!I)return!1;if(typeof I=="string")try{I=new c(I,this.options)}catch{return!1}for(let T=0;T<this.set.length;T++)if(j(this.set[T],I,this.options))return!0;return!1}}vr=t;const r=Vl(),n=new r,s=xt(),i=ft(),o=ct(),c=ne(),{safeRe:u,src:l,t:a,comparatorTrimReplace:f,tildeTrimReplace:h,caretTrimReplace:p}=Fe(),{FLAG_INCLUDE_PRERELEASE:$,FLAG_LOOSE:_}=Be(),m=new RegExp(l[a.BUILD],"g"),E=S=>S.value==="<0.0.0-0",y=S=>S.value==="",C=(S,I)=>{let T=!0;const R=S.slice();let Z=R.pop();for(;T&&R.length;)T=R.every(O=>Z.intersects(O,I)),Z=R.pop();return T},x=(S,I)=>(S=S.replace(u[a.BUILD],""),o("comp",S,I),S=L(S,I),o("caret",S),S=Q(S,I),o("tildes",S),S=v(S,I),o("xrange",S),S=w(S,I),o("stars",S),S),N=S=>!S||S.toLowerCase()==="x"||S==="*",U=(S,I,T)=>N(S)&&!N(I)||N(I)&&T&&!N(T),Q=(S,I)=>S.trim().split(/\s+/).map(T=>z(T,I)).join(" "),z=(S,I)=>{const T=I.loose?u[a.TILDELOOSE]:u[a.TILDE],R=I.includePrerelease?"-0":"";return S.replace(T,(Z,O,P,B,M)=>{o("tilde",S,Z,O,P,B,M);let F;return N(O)?F="":N(P)?F=`>=${O}.0.0${R} <${+O+1}.0.0-0`:N(B)?F=`>=${O}.${P}.0${R} <${O}.${+P+1}.0-0`:M?(o("replaceTilde pr",M),F=`>=${O}.${P}.${B}-${M} <${O}.${+P+1}.0-0`):F=`>=${O}.${P}.${B} <${O}.${+P+1}.0-0`,o("tilde return",F),F})},L=(S,I)=>S.trim().split(/\s+/).map(T=>d(T,I)).join(" "),d=(S,I)=>{o("caret",S,I);const T=I.loose?u[a.CARETLOOSE]:u[a.CARET],R=I.includePrerelease?"-0":"";return S.replace(T,(Z,O,P,B,M)=>{o("caret",S,Z,O,P,B,M);let F;return N(O)?F="":N(P)?F=`>=${O}.0.0${R} <${+O+1}.0.0-0`:N(B)?O==="0"?F=`>=${O}.${P}.0${R} <${O}.${+P+1}.0-0`:F=`>=${O}.${P}.0${R} <${+O+1}.0.0-0`:M?(o("replaceCaret pr",M),O==="0"?P==="0"?F=`>=${O}.${P}.${B}-${M} <${O}.${P}.${+B+1}-0`:F=`>=${O}.${P}.${B}-${M} <${O}.${+P+1}.0-0`:F=`>=${O}.${P}.${B}-${M} <${+O+1}.0.0-0`):(o("no pr"),O==="0"?P==="0"?F=`>=${O}.${P}.${B} <${O}.${P}.${+B+1}-0`:F=`>=${O}.${P}.${B} <${O}.${+P+1}.0-0`:F=`>=${O}.${P}.${B} <${+O+1}.0.0-0`),o("caret return",F),F})},v=(S,I)=>(o("replaceXRanges",S,I),S.split(/\s+/).map(T=>b(T,I)).join(" ")),b=(S,I)=>{S=S.trim();const T=I.loose?u[a.XRANGELOOSE]:u[a.XRANGE];return S.replace(T,(R,Z,O,P,B,M)=>{if(o("xRange",S,R,Z,O,P,B,M),U(O,P,B))return S;const F=N(O),oe=F||N(P),ee=oe||N(B),qe=ee;return Z==="="&&qe&&(Z=""),M=I.includePrerelease?"-0":"",F?Z===">"||Z==="<"?R="<0.0.0-0":R="*":Z&&qe?(oe&&(P=0),B=0,Z===">"?(Z=">=",oe?(O=+O+1,P=0,B=0):(P=+P+1,B=0)):Z==="<="&&(Z="<",oe?O=+O+1:P=+P+1),Z==="<"&&(M="-0"),R=`${Z+O}.${P}.${B}${M}`):oe?R=`>=${O}.0.0${M} <${+O+1}.0.0-0`:ee&&(R=`>=${O}.${P}.0${M} <${O}.${+P+1}.0-0`),o("xRange return",R),R})},w=(S,I)=>(o("replaceStars",S,I),S.trim().replace(u[a.STAR],"")),k=(S,I)=>(o("replaceGTE0",S,I),S.trim().replace(u[I.includePrerelease?a.GTE0PRE:a.GTE0],"")),D=S=>(I,T,R,Z,O,P,B,M,F,oe,ee,qe)=>(N(R)?T="":N(Z)?T=`>=${R}.0.0${S?"-0":""}`:N(O)?T=`>=${R}.${Z}.0${S?"-0":""}`:P?T=`>=${T}`:T=`>=${T}${S?"-0":""}`,N(F)?M="":N(oe)?M=`<${+F+1}.0.0-0`:N(ee)?M=`<${F}.${+oe+1}.0-0`:qe?M=`<=${F}.${oe}.${ee}-${qe}`:S?M=`<${F}.${oe}.${+ee+1}-0`:M=`<=${M}`,`${T} ${M}`.trim()),j=(S,I,T)=>{for(let R=0;R<S.length;R++)if(!S[R].test(I))return!1;if(I.prerelease.length&&!T.includePrerelease){for(let R=0;R<S.length;R++)if(o(S[R].semver),S[R].semver!==i.ANY&&S[R].semver.prerelease.length>0){const Z=S[R].semver;if(Z.major===I.major&&Z.minor===I.minor&&Z.patch===I.patch)return!0}return!1}return!0};return vr}var _r,Ys;function ft(){if(Ys)return _r;Ys=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(a,f){if(f=r(f),a instanceof t){if(a.loose===!!f.loose)return a;a=a.value}a=a.trim().split(/\s+/).join(" "),o("comparator",a,f),this.options=f,this.loose=!!f.loose,this.parse(a),this.semver===e?this.value="":this.value=this.operator+this.semver.version,o("comp",this)}parse(a){const f=this.options.loose?n[s.COMPARATORLOOSE]:n[s.COMPARATOR],h=a.match(f);if(!h)throw new TypeError(`Invalid comparator: ${a}`);this.operator=h[1]!==void 0?h[1]:"",this.operator==="="&&(this.operator=""),h[2]?this.semver=new c(h[2],this.options.loose):this.semver=e}toString(){return this.value}test(a){if(o("Comparator.test",a,this.options.loose),this.semver===e||a===e)return!0;if(typeof a=="string")try{a=new c(a,this.options)}catch{return!1}return i(a,this.operator,this.semver,this.options)}intersects(a,f){if(!(a instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new u(a.value,f).test(this.value):a.operator===""?a.value===""?!0:new u(this.value,f).test(a.semver):(f=r(f),f.includePrerelease&&(this.value==="<0.0.0-0"||a.value==="<0.0.0-0")||!f.includePrerelease&&(this.value.startsWith("<0.0.0")||a.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&a.operator.startsWith(">")||this.operator.startsWith("<")&&a.operator.startsWith("<")||this.semver.version===a.semver.version&&this.operator.includes("=")&&a.operator.includes("=")||i(this.semver,"<",a.semver,f)&&this.operator.startsWith(">")&&a.operator.startsWith("<")||i(this.semver,">",a.semver,f)&&this.operator.startsWith("<")&&a.operator.startsWith(">")))}}_r=t;const r=xt(),{safeRe:n,t:s}=Fe(),i=Vs(),o=ct(),c=ne(),u=he();return _r}var Er,Js;function ht(){if(Js)return Er;Js=1;const e=he();return Er=(r,n,s)=>{try{n=new e(n,s)}catch{return!1}return n.test(r)},Er}var br,Qs;function Wl(){if(Qs)return br;Qs=1;const e=he();return br=(r,n)=>new e(r,n).set.map(s=>s.map(i=>i.value).join(" ").trim().split(" ")),br}var wr,ei;function Hl(){if(ei)return wr;ei=1;const e=ne(),t=he();return wr=(n,s,i)=>{let o=null,c=null,u=null;try{u=new t(s,i)}catch{return null}return n.forEach(l=>{u.test(l)&&(!o||c.compare(l)===-1)&&(o=l,c=new e(o,i))}),o},wr}var Sr,ti;function Xl(){if(ti)return Sr;ti=1;const e=ne(),t=he();return Sr=(n,s,i)=>{let o=null,c=null,u=null;try{u=new t(s,i)}catch{return null}return n.forEach(l=>{u.test(l)&&(!o||c.compare(l)===1)&&(o=l,c=new e(o,i))}),o},Sr}var Ir,ri;function Kl(){if(ri)return Ir;ri=1;const e=ne(),t=he(),r=lt();return Ir=(s,i)=>{s=new t(s,i);let o=new e("0.0.0");if(s.test(o)||(o=new e("0.0.0-0"),s.test(o)))return o;o=null;for(let c=0;c<s.set.length;++c){const u=s.set[c];let l=null;u.forEach(a=>{const f=new e(a.semver.version);switch(a.operator){case">":f.prerelease.length===0?f.patch++:f.prerelease.push(0),f.raw=f.format();case"":case">=":(!l||r(f,l))&&(l=f);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${a.operator}`)}}),l&&(!o||r(o,l))&&(o=l)}return o&&s.test(o)?o:null},Ir}var $r,ni;function Yl(){if(ni)return $r;ni=1;const e=he();return $r=(r,n)=>{try{return new e(r,n).range||"*"}catch{return null}},$r}var yr,si;function Rr(){if(si)return yr;si=1;const e=ne(),t=ft(),{ANY:r}=t,n=he(),s=ht(),i=lt(),o=or(),c=hr(),u=lr();return yr=(a,f,h,p)=>{a=new e(a,p),f=new n(f,p);let $,_,m,E,y;switch(h){case">":$=i,_=c,m=o,E=">",y=">=";break;case"<":$=o,_=u,m=i,E="<",y="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(s(a,f,p))return!1;for(let C=0;C<f.set.length;++C){const x=f.set[C];let N=null,U=null;if(x.forEach(Q=>{Q.semver===r&&(Q=new t(">=0.0.0")),N=N||Q,U=U||Q,$(Q.semver,N.semver,p)?N=Q:m(Q.semver,U.semver,p)&&(U=Q)}),N.operator===E||N.operator===y||(!U.operator||U.operator===E)&&_(a,U.semver))return!1;if(U.operator===y&&m(a,U.semver))return!1}return!0},yr}var Ar,ii;function Jl(){if(ii)return Ar;ii=1;const e=Rr();return Ar=(r,n,s)=>e(r,n,">",s),Ar}var Tr,oi;function Ql(){if(oi)return Tr;oi=1;const e=Rr();return Tr=(r,n,s)=>e(r,n,"<",s),Tr}var Or,ai;function ef(){if(ai)return Or;ai=1;const e=he();return Or=(r,n,s)=>(r=new e(r,s),n=new e(n,s),r.intersects(n,s)),Or}var kr,ui;function tf(){if(ui)return kr;ui=1;const e=ht(),t=fe();return kr=(r,n,s)=>{const i=[];let o=null,c=null;const u=r.sort((h,p)=>t(h,p,s));for(const h of u)e(h,n,s)?(c=h,o||(o=h)):(c&&i.push([o,c]),c=null,o=null);o&&i.push([o,null]);const l=[];for(const[h,p]of i)h===p?l.push(h):!p&&h===u[0]?l.push("*"):p?h===u[0]?l.push(`<=${p}`):l.push(`${h} - ${p}`):l.push(`>=${h}`);const a=l.join(" || "),f=typeof n.raw=="string"?n.raw:String(n);return a.length<f.length?a:n},kr}var Pr,ci;function rf(){if(ci)return Pr;ci=1;const e=he(),t=ft(),{ANY:r}=t,n=ht(),s=fe(),i=(f,h,p={})=>{if(f===h)return!0;f=new e(f,p),h=new e(h,p);let $=!1;e:for(const _ of f.set){for(const m of h.set){const E=u(_,m,p);if($=$||E!==null,E)continue e}if($)return!1}return!0},o=[new t(">=0.0.0-0")],c=[new t(">=0.0.0")],u=(f,h,p)=>{if(f===h)return!0;if(f.length===1&&f[0].semver===r){if(h.length===1&&h[0].semver===r)return!0;p.includePrerelease?f=o:f=c}if(h.length===1&&h[0].semver===r){if(p.includePrerelease)return!0;h=c}const $=new Set;let _,m;for(const z of f)z.operator===">"||z.operator===">="?_=l(_,z,p):z.operator==="<"||z.operator==="<="?m=a(m,z,p):$.add(z.semver);if($.size>1)return null;let E;if(_&&m){if(E=s(_.semver,m.semver,p),E>0)return null;if(E===0&&(_.operator!==">="||m.operator!=="<="))return null}for(const z of $){if(_&&!n(z,String(_),p)||m&&!n(z,String(m),p))return null;for(const L of h)if(!n(z,String(L),p))return!1;return!0}let y,C,x,N,U=m&&!p.includePrerelease&&m.semver.prerelease.length?m.semver:!1,Q=_&&!p.includePrerelease&&_.semver.prerelease.length?_.semver:!1;U&&U.prerelease.length===1&&m.operator==="<"&&U.prerelease[0]===0&&(U=!1);for(const z of h){if(N=N||z.operator===">"||z.operator===">=",x=x||z.operator==="<"||z.operator==="<=",_){if(Q&&z.semver.prerelease&&z.semver.prerelease.length&&z.semver.major===Q.major&&z.semver.minor===Q.minor&&z.semver.patch===Q.patch&&(Q=!1),z.operator===">"||z.operator===">="){if(y=l(_,z,p),y===z&&y!==_)return!1}else if(_.operator===">="&&!z.test(_.semver))return!1}if(m){if(U&&z.semver.prerelease&&z.semver.prerelease.length&&z.semver.major===U.major&&z.semver.minor===U.minor&&z.semver.patch===U.patch&&(U=!1),z.operator==="<"||z.operator==="<="){if(C=a(m,z,p),C===z&&C!==m)return!1}else if(m.operator==="<="&&!z.test(m.semver))return!1}if(!z.operator&&(m||_)&&E!==0)return!1}return!(_&&x&&!m&&E!==0||m&&N&&!_&&E!==0||Q||U)},l=(f,h,p)=>{if(!f)return h;const $=s(f.semver,h.semver,p);return $>0?f:$<0||h.operator===">"&&f.operator===">="?h:f},a=(f,h,p)=>{if(!f)return h;const $=s(f.semver,h.semver,p);return $<0?f:$>0||h.operator==="<"&&f.operator==="<="?h:f};return Pr=i,Pr}var Cr,li;function nf(){if(li)return Cr;li=1;const e=Fe(),t=Be(),r=ne(),n=bs(),s=ke(),i=Cl(),o=Nl(),c=Ll(),u=zl(),l=Zl(),a=Dl(),f=jl(),h=xl(),p=fe(),$=Ml(),_=Ul(),m=tr(),E=Bl(),y=Fl(),C=lt(),x=or(),N=Ms(),U=Bs(),Q=lr(),z=hr(),L=Vs(),d=ql(),v=Gl(),b=ft(),w=he(),k=ht(),D=Wl(),j=Hl(),S=Xl(),I=Kl(),T=Yl(),R=Rr(),Z=Jl(),O=Ql(),P=ef(),B=tf(),M=rf();return Cr={parse:s,valid:i,clean:o,inc:c,diff:u,major:l,minor:a,patch:f,prerelease:h,compare:p,rcompare:$,compareLoose:_,compareBuild:m,sort:E,rsort:y,gt:C,lt:x,eq:N,neq:U,gte:Q,lte:z,cmp:L,coerce:d,truncate:v,Comparator:b,Range:w,satisfies:k,toComparators:D,maxSatisfying:j,minSatisfying:S,minVersion:I,validRange:T,outside:R,gtr:Z,ltr:O,intersects:P,simplifyRange:B,subset:M,SemVer:r,re:e.re,src:e.src,tokens:e.t,SEMVER_SPEC_VERSION:t.SEMVER_SPEC_VERSION,RELEASE_TYPES:t.RELEASE_TYPES,compareIdentifiers:n.compareIdentifiers,rcompareIdentifiers:n.rcompareIdentifiers},Cr}var sf=nf();const Nr=yl(sf),fi=Se(te().min(1)).refine(e=>new Set(e).size===e.length,{message:"Array items must be unique"});function hi(e){const t=e({type:G("string")}),r=e({type:G("number"),integer:G(!0).optional(),min:re().optional(),max:re().optional()}),n=e({type:G("boolean")}),s=e({type:G("option"),options:fi}),i=de([t,r,n,s]),o=(E,y)=>y?E.optional():E,c=E=>e({type:G("string"),default:o(te(),E.defaultRequired)}),u=E=>e({type:G("number"),integer:Ze().optional(),min:re().optional(),max:re().optional(),default:o(re(),E.defaultRequired)}),l=E=>e({type:G("boolean"),default:o(Ze(),E.defaultRequired)}),a=E=>e({type:G("option"),options:fi.optional(),default:o(te(),E.defaultRequired)}),f=E=>de([c(E),u(E),l(E),a(E)]),h=e({name:te().min(1),value:f({defaultRequired:!1})}),p=e({name:te().min(1),value:i.optional()}),$=e({name:te().min(1),value:f({defaultRequired:!0}),writableFromCogs:G(!0).optional(),writableFromClient:G(!0).optional()}),_=E=>{try{return new ps(E),!0}catch{return!1}};return e({version:de([rt([ge()]),rt([ge(),G("."),ge()]),rt([ge(),G("."),ge(),G("."),ge()])]),name:te(),minCogsVersion:rt([ge(),G("."),ge(),G("."),ge()]).optional(),description:te().optional(),icon:te().optional(),indexPath:te().optional(),window:q({width:re().gt(0).int(),height:re().gt(0).int(),visible:Ze().optional()}).optional(),config:Se(h).optional(),events:q({fromCogs:Se(p).optional(),toCogs:Se(p).optional()}).optional(),state:Se($).optional(),media:q({audio:G(!0).optional(),video:G(!0).optional(),images:G(!0).optional()}).optional(),store:q({items:Zn(te(),e({persistValue:Ze().optional()})).optional()}).optional(),permissions:At({network:At({access:Se(e({hosts:Se(te().refine(_,{error:"Invalid network host pattern"})).min(1),caCertificate:te().optional()})).optional()}).optional()}).optional()}).refine(E=>!!(!E.permissions?.network?.access||E.minCogsVersion&&Nr.gte(E.minCogsVersion,"5.11.0")),{path:["permissions","network","access"],message:"minCogsVersion must be at least 5.11.0"})}const of=hi(q),af=hi(At);function uf(e){let t=of;typeof e=="object"&&e.minCogsVersion&&Nr.valid(e.minCogsVersion)&&Nr.gte(e.minCogsVersion,"5.11.0")&&(t=af);const r=t.safeParse(e);return r.success?null:r.error.issues.map(n=>`${n.path.join(".")||"root"}: ${n.message}`)}H.CogsConfigChangedEvent=Ur,H.CogsConnection=ki,H.CogsConnectionCloseEvent=xr,H.CogsConnectionOpenEvent=jr,H.CogsIncomingEvent=Fr,H.CogsMediaConfigChangedEvent=qr,H.CogsMessageEvent=Mr,H.CogsShowPhaseChangedEvent=Gr,H.CogsStateChangedEvent=Br,H.DataStoreItemEvent=pt,H.DataStoreItemsEvent=mt,H.ManifestTypes=Pl,H.MediaPreloader=es,H.MediaSchema=hl,H.NetworkHostPattern=ps,H.SurfaceManager=$l,H.assetUrl=Dr,H.getPluginManifestErrors=uf,H.getStateAtTime=st,H.preloadUrl=wi,Object.defineProperty(H,Symbol.toStringTag,{value:"Module"})});
38
+ `)}p.write("payload.value = newResult;"),p.write("return payload;");const y=p.compile();return(C,x)=>y(h,C,x)};let i;const o=Ge,c=!Wr.jitless,l=c&&zi.value,a=t.catchall;let f;e._zod.parse=(h,p)=>{f??(f=n.value);const $=h.value;return o($)?c&&l&&p?.async===!1&&p.jitless!==!0?(i||(i=s(t.shape)),h=i(h,p),a?dn([],$,h,p,f,e):h):r(h,p):(h.issues.push({expected:"object",code:"invalid_type",input:$,inst:e}),h)}});function pn(e,t,r,n){for(const i of e)if(i.issues.length===0)return t.value=i.value,t;const s=e.filter(i=>!Le(i));return s.length===1?(t.value=s[0].value,s[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(o=>we(o,n,Ee())))}),t)}const Ra=g("$ZodUnion",(e,t)=>{V.init(e,t),W(e._zod,"optin",()=>t.options.some(s=>s._zod.optin==="optional")?"optional":void 0),W(e._zod,"optout",()=>t.options.some(s=>s._zod.optout==="optional")?"optional":void 0),W(e._zod,"values",()=>{if(t.options.every(s=>s._zod.values))return new Set(t.options.flatMap(s=>Array.from(s._zod.values)))}),W(e._zod,"pattern",()=>{if(t.options.every(s=>s._zod.pattern)){const s=t.options.map(i=>i._zod.pattern);return new RegExp(`^(${s.map(i=>Et(i.source)).join("|")})$`)}});const r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(s,i)=>{if(r)return n(s,i);let o=!1;const c=[];for(const u of t.options){const l=u._zod.run({value:s.value,issues:[]},i);if(l instanceof Promise)c.push(l),o=!0;else{if(l.issues.length===0)return l;c.push(l)}}return o?Promise.all(c).then(u=>pn(u,s,e,i)):pn(c,s,e,i)}}),Aa=g("$ZodIntersection",(e,t)=>{V.init(e,t),e._zod.parse=(r,n)=>{const s=r.value,i=t.left._zod.run({value:s,issues:[]},n),o=t.right._zod.run({value:s,issues:[]},n);return i instanceof Promise||o instanceof Promise?Promise.all([i,o]).then(([u,l])=>mn(r,u,l)):mn(r,i,o)}});function $t(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(Ne(e)&&Ne(t)){const r=Object.keys(t),n=Object.keys(e).filter(i=>r.indexOf(i)!==-1),s={...e,...t};for(const i of n){const o=$t(e[i],t[i]);if(!o.valid)return{valid:!1,mergeErrorPath:[i,...o.mergeErrorPath]};s[i]=o.data}return{valid:!0,data:s}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let n=0;n<e.length;n++){const s=e[n],i=t[n],o=$t(s,i);if(!o.valid)return{valid:!1,mergeErrorPath:[n,...o.mergeErrorPath]};r.push(o.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function mn(e,t,r){if(t.issues.length&&e.issues.push(...t.issues),r.issues.length&&e.issues.push(...r.issues),Le(e))return e;const n=$t(t.value,r.value);if(!n.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(n.mergeErrorPath)}`);return e.value=n.data,e}const Ta=g("$ZodTuple",(e,t)=>{V.init(e,t);const r=t.items;e._zod.parse=(n,s)=>{const i=n.value;if(!Array.isArray(i))return n.issues.push({input:i,inst:e,expected:"tuple",code:"invalid_type"}),n;n.value=[];const o=[],c=[...r].reverse().findIndex(a=>a._zod.optin!=="optional"),u=c===-1?0:r.length-c;if(!t.rest){const a=i.length>r.length,f=i.length<u-1;if(a||f)return n.issues.push({...a?{code:"too_big",maximum:r.length}:{code:"too_small",minimum:r.length},input:i,inst:e,origin:"array"}),n}let l=-1;for(const a of r){if(l++,l>=i.length&&l>=u)continue;const f=a._zod.run({value:i[l],issues:[]},s);f instanceof Promise?o.push(f.then(h=>Ye(h,n,l))):Ye(f,n,l)}if(t.rest){const a=i.slice(r.length);for(const f of a){l++;const h=t.rest._zod.run({value:f,issues:[]},s);h instanceof Promise?o.push(h.then(p=>Ye(p,n,l))):Ye(h,n,l)}}return o.length?Promise.all(o).then(()=>n):n}});function Ye(e,t,r){e.issues.length&&t.issues.push(...Oe(r,e.issues)),t.value[r]=e.value}const Oa=g("$ZodRecord",(e,t)=>{V.init(e,t),e._zod.parse=(r,n)=>{const s=r.value;if(!Ne(s))return r.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),r;const i=[],o=t.keyType._zod.values;if(o){r.value={};const c=new Set;for(const l of o)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){c.add(typeof l=="number"?l.toString():l);const a=t.valueType._zod.run({value:s[l],issues:[]},n);a instanceof Promise?i.push(a.then(f=>{f.issues.length&&r.issues.push(...Oe(l,f.issues)),r.value[l]=f.value})):(a.issues.length&&r.issues.push(...Oe(l,a.issues)),r.value[l]=a.value)}let u;for(const l in s)c.has(l)||(u=u??[],u.push(l));u&&u.length>0&&r.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:u})}else{r.value={};for(const c of Reflect.ownKeys(s)){if(c==="__proto__")continue;const 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(u.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map(a=>we(a,n,Ee())),input:c,path:[c],inst:e}),r.value[u.value]=u.value;continue}const l=t.valueType._zod.run({value:s[c],issues:[]},n);l instanceof Promise?i.push(l.then(a=>{a.issues.length&&r.issues.push(...Oe(c,a.issues)),r.value[u.value]=a.value})):(l.issues.length&&r.issues.push(...Oe(c,l.issues)),r.value[u.value]=l.value)}}return i.length?Promise.all(i).then(()=>r):r}}),ka=g("$ZodEnum",(e,t)=>{V.init(e,t);const r=Ci(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(s=>Zi.has(typeof s)).map(s=>typeof s=="string"?Te(s):s.toString()).join("|")})$`),e._zod.parse=(s,i)=>{const o=s.value;return n.has(o)||s.issues.push({code:"invalid_value",values:r,input:o,inst:e}),s}}),Pa=g("$ZodLiteral",(e,t)=>{if(V.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?Te(n):n?Te(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,s)=>{const i=n.value;return r.has(i)||n.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),n}}),Ca=g("$ZodTransform",(e,t)=>{V.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Vr(e.constructor.name);const s=t.transform(r.value,r);if(n.async)return(s instanceof Promise?s:Promise.resolve(s)).then(o=>(r.value=o,r));if(s instanceof Promise)throw new Ce;return r.value=s,r}});function gn(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const Na=g("$ZodOptional",(e,t)=>{V.init(e,t),e._zod.optin="optional",e._zod.optout="optional",W(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),W(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${Et(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){const s=t.innerType._zod.run(r,n);return s instanceof Promise?s.then(i=>gn(i,r.value)):gn(s,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}}),La=g("$ZodNullable",(e,t)=>{V.init(e,t),W(e._zod,"optin",()=>t.innerType._zod.optin),W(e._zod,"optout",()=>t.innerType._zod.optout),W(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${Et(r.source)}|null)$`):void 0}),W(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)}),za=g("$ZodDefault",(e,t)=>{V.init(e,t),e._zod.optin="optional",W(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;const s=t.innerType._zod.run(r,n);return s instanceof Promise?s.then(i=>vn(i,t)):vn(s,t)}});function vn(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Za=g("$ZodPrefault",(e,t)=>{V.init(e,t),e._zod.optin="optional",W(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))}),Da=g("$ZodNonOptional",(e,t)=>{V.init(e,t),W(e._zod,"values",()=>{const r=t.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),e._zod.parse=(r,n)=>{const s=t.innerType._zod.run(r,n);return s instanceof Promise?s.then(i=>_n(i,e)):_n(s,e)}});function _n(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const ja=g("$ZodCatch",(e,t)=>{V.init(e,t),W(e._zod,"optin",()=>t.innerType._zod.optin),W(e._zod,"optout",()=>t.innerType._zod.optout),W(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);const s=t.innerType._zod.run(r,n);return s instanceof Promise?s.then(i=>(r.value=i.value,i.issues.length&&(r.value=t.catchValue({...r,error:{issues:i.issues.map(o=>we(o,n,Ee()))},input:r.value}),r.issues=[]),r)):(r.value=s.value,s.issues.length&&(r.value=t.catchValue({...r,error:{issues:s.issues.map(i=>we(i,n,Ee()))},input:r.value}),r.issues=[]),r)}}),xa=g("$ZodPipe",(e,t)=>{V.init(e,t),W(e._zod,"values",()=>t.in._zod.values),W(e._zod,"optin",()=>t.in._zod.optin),W(e._zod,"optout",()=>t.out._zod.optout),W(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){const i=t.out._zod.run(r,n);return i instanceof Promise?i.then(o=>Je(o,t.in,n)):Je(i,t.in,n)}const s=t.in._zod.run(r,n);return s instanceof Promise?s.then(i=>Je(i,t.out,n)):Je(s,t.out,n)}});function Je(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}const Ma=g("$ZodReadonly",(e,t)=>{V.init(e,t),W(e._zod,"propValues",()=>t.innerType._zod.propValues),W(e._zod,"values",()=>t.innerType._zod.values),W(e._zod,"optin",()=>t.innerType?._zod?.optin),W(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);const s=t.innerType._zod.run(r,n);return s instanceof Promise?s.then(En):En(s)}});function En(e){return e.value=Object.freeze(e.value),e}const Ua=g("$ZodTemplateLiteral",(e,t)=>{V.init(e,t);const r=[];for(const 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()}`);const s=n._zod.pattern instanceof RegExp?n._zod.pattern.source:n._zod.pattern;if(!s)throw new Error(`Invalid template literal part: ${n._zod.traits}`);const i=s.startsWith("^")?1:0,o=s.endsWith("$")?s.length-1:s.length;r.push(s.slice(i,o))}else if(n===null||Di.has(typeof n))r.push(Te(`${n}`));else throw new Error(`Invalid template literal part: ${n}`);e._zod.pattern=new RegExp(`^${r.join("")}$`),e._zod.parse=(n,s)=>typeof n.value!="string"?(n.issues.push({input:n.value,inst:e,expected:"template_literal",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)}),Ba=g("$ZodCustom",(e,t)=>{ie.init(e,t),V.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{const n=r.value,s=t.fn(n);if(s instanceof Promise)return s.then(i=>bn(i,r,n,e));bn(s,r,n,e)}});function bn(e,t,r,n){if(!e){const s={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(s.params=n._zod.def.params),t.issues.push(Me(s))}}var wn;class Fa{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){const n=r[0];if(this._map.set(t,n),n&&typeof n=="object"&&"id"in n){if(this._idmap.has(n.id))throw new Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,t)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const 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){const r=t._zod.parent;if(r){const n={...this.get(r)??{}};delete n.id;const s={...n,...this._map.get(t)};return Object.keys(s).length?s:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function qa(){return new Fa}(wn=globalThis).__zod_globalRegistry??(wn.__zod_globalRegistry=qa());const Qe=globalThis.__zod_globalRegistry;function Ga(e,t){return new e({type:"string",...A(t)})}function Va(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...A(t)})}function Sn(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...A(t)})}function Wa(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...A(t)})}function Ha(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...A(t)})}function Xa(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...A(t)})}function Ka(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...A(t)})}function Ya(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...A(t)})}function Ja(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...A(t)})}function Qa(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...A(t)})}function eu(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...A(t)})}function tu(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...A(t)})}function ru(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...A(t)})}function nu(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...A(t)})}function su(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...A(t)})}function iu(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...A(t)})}function ou(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...A(t)})}function au(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...A(t)})}function uu(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...A(t)})}function cu(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...A(t)})}function lu(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...A(t)})}function fu(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...A(t)})}function hu(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...A(t)})}function du(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...A(t)})}function pu(e,t){return new e({type:"string",format:"date",check:"string_format",...A(t)})}function mu(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...A(t)})}function gu(e,t){return new e({type:"string",format:"duration",check:"string_format",...A(t)})}function vu(e,t){return new e({type:"number",checks:[],...A(t)})}function _u(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...A(t)})}function Eu(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...A(t)})}function bu(e,t){return new e({type:"boolean",...A(t)})}function wu(e,t){return new e({type:"null",...A(t)})}function Su(e){return new e({type:"unknown"})}function Iu(e,t){return new e({type:"never",...A(t)})}function In(e,t){return new an({check:"less_than",...A(t),value:e,inclusive:!1})}function yt(e,t){return new an({check:"less_than",...A(t),value:e,inclusive:!0})}function $n(e,t){return new un({check:"greater_than",...A(t),value:e,inclusive:!1})}function Rt(e,t){return new un({check:"greater_than",...A(t),value:e,inclusive:!0})}function yn(e,t){return new No({check:"multiple_of",...A(t),value:e})}function Rn(e,t){return new zo({check:"max_length",...A(t),maximum:e})}function et(e,t){return new Zo({check:"min_length",...A(t),minimum:e})}function An(e,t){return new Do({check:"length_equals",...A(t),length:e})}function $u(e,t){return new jo({check:"string_format",format:"regex",...A(t),pattern:e})}function yu(e){return new xo({check:"string_format",format:"lowercase",...A(e)})}function Ru(e){return new Mo({check:"string_format",format:"uppercase",...A(e)})}function Au(e,t){return new Uo({check:"string_format",format:"includes",...A(t),includes:e})}function Tu(e,t){return new Bo({check:"string_format",format:"starts_with",...A(t),prefix:e})}function Ou(e,t){return new Fo({check:"string_format",format:"ends_with",...A(t),suffix:e})}function ze(e){return new qo({check:"overwrite",tx:e})}function ku(e){return ze(t=>t.normalize(e))}function Pu(){return ze(e=>e.trim())}function Cu(){return ze(e=>e.toLowerCase())}function Nu(){return ze(e=>e.toUpperCase())}function Lu(){return ze(e=>Li(e))}function zu(e,t,r){return new e({type:"array",element:t,...A(r)})}function Zu(e,t,r){return new e({type:"custom",check:"custom",fn:t,...A(r)})}function Du(e){const t=ju(r=>(r.addIssue=n=>{if(typeof n=="string")r.issues.push(Me(n,r.value,t._zod.def));else{const s=n;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=t),s.continue??(s.continue=!t._zod.def.abort),r.issues.push(Me(s))}},e(r.value,r)));return t}function ju(e,t){const r=new ie({check:"custom",...A(t)});return r._zod.check=e,r}const xu=g("ZodISODateTime",(e,t)=>{sa.init(e,t),Y.init(e,t)});function Mu(e){return du(xu,e)}const Uu=g("ZodISODate",(e,t)=>{ia.init(e,t),Y.init(e,t)});function Bu(e){return pu(Uu,e)}const Fu=g("ZodISOTime",(e,t)=>{oa.init(e,t),Y.init(e,t)});function qu(e){return mu(Fu,e)}const Gu=g("ZodISODuration",(e,t)=>{aa.init(e,t),Y.init(e,t)});function Vu(e){return gu(Gu,e)}const ae=g("ZodError",(e,t)=>{Qr.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>Hi(e,r)},flatten:{value:r=>Wi(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,gt,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,gt,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),Wu=wt(ae),Hu=St(ae),Xu=We(ae),Ku=He(ae),Yu=Yi(ae),Ju=Ji(ae),Qu=Qi(ae),ec=eo(ae),tc=to(ae),rc=ro(ae),nc=no(ae),sc=so(ae),X=g("ZodType",(e,t)=>(V.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone(Ae(t,{checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]})),e.clone=(r,n)=>be(e,r,n),e.brand=()=>e,e.register=(r,n)=>(r.add(e,n),e),e.parse=(r,n)=>Wu(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>Xu(e,r,n),e.parseAsync=async(r,n)=>Hu(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>Ku(e,r,n),e.spa=e.safeParseAsync,e.encode=(r,n)=>Yu(e,r,n),e.decode=(r,n)=>Ju(e,r,n),e.encodeAsync=async(r,n)=>Qu(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)=>sc(e,r,n),e.refine=(r,n)=>e.check(Yc(r,n)),e.superRefine=r=>e.check(Jc(r)),e.overwrite=r=>e.check(ze(r)),e.optional=()=>jn(e),e.nullable=()=>xn(e),e.nullish=()=>jn(xn(e)),e.nonoptional=r=>Fc(e,r),e.array=()=>Se(e),e.or=r=>de([e,r]),e.and=r=>Pc(e,r),e.transform=r=>Un(e,Dc(r)),e.default=r=>Mc(e,r),e.prefault=r=>Bc(e,r),e.catch=r=>Gc(e,r),e.pipe=r=>Un(e,r),e.readonly=()=>Hc(e),e.describe=r=>{const n=e.clone();return Qe.add(n,{description:r}),n},Object.defineProperty(e,"description",{get(){return Qe.get(e)?.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return Qe.get(e);const n=e.clone();return Qe.add(n,r[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),Tn=g("_ZodString",(e,t)=>{It.init(e,t),X.init(e,t);const r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...n)=>e.check($u(...n)),e.includes=(...n)=>e.check(Au(...n)),e.startsWith=(...n)=>e.check(Tu(...n)),e.endsWith=(...n)=>e.check(Ou(...n)),e.min=(...n)=>e.check(et(...n)),e.max=(...n)=>e.check(Rn(...n)),e.length=(...n)=>e.check(An(...n)),e.nonempty=(...n)=>e.check(et(1,...n)),e.lowercase=n=>e.check(yu(n)),e.uppercase=n=>e.check(Ru(n)),e.trim=()=>e.check(Pu()),e.normalize=(...n)=>e.check(ku(...n)),e.toLowerCase=()=>e.check(Cu()),e.toUpperCase=()=>e.check(Nu()),e.slugify=()=>e.check(Lu())}),ic=g("ZodString",(e,t)=>{It.init(e,t),Tn.init(e,t),e.email=r=>e.check(Va(oc,r)),e.url=r=>e.check(Ya(ac,r)),e.jwt=r=>e.check(hu(Sc,r)),e.emoji=r=>e.check(Ja(uc,r)),e.guid=r=>e.check(Sn(On,r)),e.uuid=r=>e.check(Wa(tt,r)),e.uuidv4=r=>e.check(Ha(tt,r)),e.uuidv6=r=>e.check(Xa(tt,r)),e.uuidv7=r=>e.check(Ka(tt,r)),e.nanoid=r=>e.check(Qa(cc,r)),e.guid=r=>e.check(Sn(On,r)),e.cuid=r=>e.check(eu(lc,r)),e.cuid2=r=>e.check(tu(fc,r)),e.ulid=r=>e.check(ru(hc,r)),e.base64=r=>e.check(cu(Ec,r)),e.base64url=r=>e.check(lu(bc,r)),e.xid=r=>e.check(nu(dc,r)),e.ksuid=r=>e.check(su(pc,r)),e.ipv4=r=>e.check(iu(mc,r)),e.ipv6=r=>e.check(ou(gc,r)),e.cidrv4=r=>e.check(au(vc,r)),e.cidrv6=r=>e.check(uu(_c,r)),e.e164=r=>e.check(fu(wc,r)),e.datetime=r=>e.check(Mu(r)),e.date=r=>e.check(Bu(r)),e.time=r=>e.check(qu(r)),e.duration=r=>e.check(Vu(r))});function te(e){return Ga(ic,e)}const Y=g("ZodStringFormat",(e,t)=>{K.init(e,t),Tn.init(e,t)}),oc=g("ZodEmail",(e,t)=>{Xo.init(e,t),Y.init(e,t)}),On=g("ZodGUID",(e,t)=>{Wo.init(e,t),Y.init(e,t)}),tt=g("ZodUUID",(e,t)=>{Ho.init(e,t),Y.init(e,t)}),ac=g("ZodURL",(e,t)=>{Ko.init(e,t),Y.init(e,t)}),uc=g("ZodEmoji",(e,t)=>{Yo.init(e,t),Y.init(e,t)}),cc=g("ZodNanoID",(e,t)=>{Jo.init(e,t),Y.init(e,t)}),lc=g("ZodCUID",(e,t)=>{Qo.init(e,t),Y.init(e,t)}),fc=g("ZodCUID2",(e,t)=>{ea.init(e,t),Y.init(e,t)}),hc=g("ZodULID",(e,t)=>{ta.init(e,t),Y.init(e,t)}),dc=g("ZodXID",(e,t)=>{ra.init(e,t),Y.init(e,t)}),pc=g("ZodKSUID",(e,t)=>{na.init(e,t),Y.init(e,t)}),mc=g("ZodIPv4",(e,t)=>{ua.init(e,t),Y.init(e,t)}),gc=g("ZodIPv6",(e,t)=>{ca.init(e,t),Y.init(e,t)}),vc=g("ZodCIDRv4",(e,t)=>{la.init(e,t),Y.init(e,t)}),_c=g("ZodCIDRv6",(e,t)=>{fa.init(e,t),Y.init(e,t)}),Ec=g("ZodBase64",(e,t)=>{ha.init(e,t),Y.init(e,t)}),bc=g("ZodBase64URL",(e,t)=>{pa.init(e,t),Y.init(e,t)}),wc=g("ZodE164",(e,t)=>{ma.init(e,t),Y.init(e,t)}),Sc=g("ZodJWT",(e,t)=>{va.init(e,t),Y.init(e,t)}),kn=g("ZodNumber",(e,t)=>{ln.init(e,t),X.init(e,t),e.gt=(n,s)=>e.check($n(n,s)),e.gte=(n,s)=>e.check(Rt(n,s)),e.min=(n,s)=>e.check(Rt(n,s)),e.lt=(n,s)=>e.check(In(n,s)),e.lte=(n,s)=>e.check(yt(n,s)),e.max=(n,s)=>e.check(yt(n,s)),e.int=n=>e.check(Cn(n)),e.safe=n=>e.check(Cn(n)),e.positive=n=>e.check($n(0,n)),e.nonnegative=n=>e.check(Rt(0,n)),e.negative=n=>e.check(In(0,n)),e.nonpositive=n=>e.check(yt(0,n)),e.multipleOf=(n,s)=>e.check(yn(n,s)),e.step=(n,s)=>e.check(yn(n,s)),e.finite=()=>e;const 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});function re(e){return vu(kn,e)}const Pn=g("ZodNumberFormat",(e,t)=>{_a.init(e,t),kn.init(e,t)});function Cn(e){return _u(Pn,e)}function ge(e){return Eu(Pn,e)}const Ic=g("ZodBoolean",(e,t)=>{Ea.init(e,t),X.init(e,t)});function Ze(e){return bu(Ic,e)}const $c=g("ZodNull",(e,t)=>{ba.init(e,t),X.init(e,t)});function yc(e){return wu($c,e)}const Rc=g("ZodUnknown",(e,t)=>{wa.init(e,t),X.init(e,t)});function Nn(){return Su(Rc)}const Ac=g("ZodNever",(e,t)=>{Sa.init(e,t),X.init(e,t)});function Ln(e){return Iu(Ac,e)}const Tc=g("ZodArray",(e,t)=>{Ia.init(e,t),X.init(e,t),e.element=t.element,e.min=(r,n)=>e.check(et(r,n)),e.nonempty=r=>e.check(et(1,r)),e.max=(r,n)=>e.check(Rn(r,n)),e.length=(r,n)=>e.check(An(r,n)),e.unwrap=()=>e.element});function Se(e,t){return zu(Tc,e,t)}const zn=g("ZodObject",(e,t)=>{ya.init(e,t),X.init(e,t),W(e,"shape",()=>t.shape),e.keyof=()=>Lc(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Nn()}),e.loose=()=>e.clone({...e._zod.def,catchall:Nn()}),e.strict=()=>e.clone({...e._zod.def,catchall:Ln()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>Bi(e,r),e.safeExtend=r=>Fi(e,r),e.merge=r=>qi(e,r),e.pick=r=>Mi(e,r),e.omit=r=>Ui(e,r),e.partial=(...r)=>Gi(Dn,e,r[0]),e.required=(...r)=>Vi(Mn,e,r[0])});function q(e,t){const r={type:"object",shape:e??{},...A(t)};return new zn(r)}function At(e,t){return new zn({type:"object",shape:e,catchall:Ln(),...A(t)})}const Oc=g("ZodUnion",(e,t)=>{Ra.init(e,t),X.init(e,t),e.options=t.options});function de(e,t){return new Oc({type:"union",options:e,...A(t)})}const kc=g("ZodIntersection",(e,t)=>{Aa.init(e,t),X.init(e,t)});function Pc(e,t){return new kc({type:"intersection",left:e,right:t})}const Cc=g("ZodTuple",(e,t)=>{Ta.init(e,t),X.init(e,t),e.rest=r=>e.clone({...e._zod.def,rest:r})});function pe(e,t,r){const n=t instanceof V,s=n?r:t,i=n?t:null;return new Cc({type:"tuple",items:e,rest:i,...A(s)})}const Nc=g("ZodRecord",(e,t)=>{Oa.init(e,t),X.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function Zn(e,t,r){return new Nc({type:"record",keyType:e,valueType:t,...A(r)})}const Tt=g("ZodEnum",(e,t)=>{ka.init(e,t),X.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const r=new Set(Object.keys(t.entries));e.extract=(n,s)=>{const i={};for(const o of n)if(r.has(o))i[o]=t.entries[o];else throw new Error(`Key ${o} not found in enum`);return new Tt({...t,checks:[],...A(s),entries:i})},e.exclude=(n,s)=>{const i={...t.entries};for(const o of n)if(r.has(o))delete i[o];else throw new Error(`Key ${o} not found in enum`);return new Tt({...t,checks:[],...A(s),entries:i})}});function Lc(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new Tt({type:"enum",entries:r,...A(t)})}const zc=g("ZodLiteral",(e,t)=>{Pa.init(e,t),X.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function G(e,t){return new zc({type:"literal",values:Array.isArray(e)?e:[e],...A(t)})}const Zc=g("ZodTransform",(e,t)=>{Ca.init(e,t),X.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Vr(e.constructor.name);r.addIssue=i=>{if(typeof i=="string")r.issues.push(Me(i,r.value,t));else{const o=i;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=r.value),o.inst??(o.inst=e),r.issues.push(Me(o))}};const s=t.transform(r.value,r);return s instanceof Promise?s.then(i=>(r.value=i,r)):(r.value=s,r)}});function Dc(e){return new Zc({type:"transform",transform:e})}const Dn=g("ZodOptional",(e,t)=>{Na.init(e,t),X.init(e,t),e.unwrap=()=>e._zod.def.innerType});function jn(e){return new Dn({type:"optional",innerType:e})}const jc=g("ZodNullable",(e,t)=>{La.init(e,t),X.init(e,t),e.unwrap=()=>e._zod.def.innerType});function xn(e){return new jc({type:"nullable",innerType:e})}const xc=g("ZodDefault",(e,t)=>{za.init(e,t),X.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Mc(e,t){return new xc({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Yr(t)}})}const Uc=g("ZodPrefault",(e,t)=>{Za.init(e,t),X.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Bc(e,t){return new Uc({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Yr(t)}})}const Mn=g("ZodNonOptional",(e,t)=>{Da.init(e,t),X.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Fc(e,t){return new Mn({type:"nonoptional",innerType:e,...A(t)})}const qc=g("ZodCatch",(e,t)=>{ja.init(e,t),X.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Gc(e,t){return new qc({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const Vc=g("ZodPipe",(e,t)=>{xa.init(e,t),X.init(e,t),e.in=t.in,e.out=t.out});function Un(e,t){return new Vc({type:"pipe",in:e,out:t})}const Wc=g("ZodReadonly",(e,t)=>{Ma.init(e,t),X.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Hc(e){return new Wc({type:"readonly",innerType:e})}const Xc=g("ZodTemplateLiteral",(e,t)=>{Ua.init(e,t),X.init(e,t)});function rt(e,t){return new Xc({type:"template_literal",parts:e,...A(t)})}const Kc=g("ZodCustom",(e,t)=>{Ba.init(e,t),X.init(e,t)});function Yc(e,t={}){return Zu(Kc,e,t)}function Jc(e){return Du(e)}const nt=q({t:re().gte(0),rate:re().gte(0)}),De=q({opacity:re().gte(0).lte(1),zIndex:re().default(0)}),je=q({volume:re().gte(0).lte(1)}),Qc=q({type:G("image"),file:te(),fit:de([G("contain"),G("cover"),G("none")])}),el=q({type:G("audio"),file:te(),audioOutput:te(),enablePlaybackRateAdjustment:Ze()}),tl=q({type:G("video"),file:te(),audioOutput:te(),enablePlaybackRateAdjustment:Ze(),fit:de([G("contain"),G("cover"),G("none")])}),Ot=pe([re(),yc()]),rl=pe([re(),q({set:q({...De.shape}).partial()}).partial()]),nl=pe([re(),q({set:q({...De.shape}).partial(),lerp:q({...De.shape}).partial()}).partial()]),sl=pe([re(),q({set:q({...nt.shape,...je.shape}).partial()}).partial()]),il=pe([re(),q({set:q({...nt.shape,...je.shape}).partial(),lerp:q({...je.shape}).partial()}).partial()]),ol=pe([re(),q({set:q({...nt.shape,...je.shape,...De.shape}).partial()}).partial()]),al=pe([re(),q({set:q({...nt.shape,...je.shape,...De.shape}).partial(),lerp:q({...je.shape,...De.shape}).partial()}).partial()]),ul=q({...Qc.shape,keyframes:pe([nl],de([rl,Ot]))}),cl=q({...el.shape,keyframes:pe([il],de([sl,Ot]))}),ll=q({...tl.shape,keyframes:pe([al],de([ol,Ot]))}),fl=Zn(te(),de([ul,cl,ll])),Bn={opacity:1,zIndex:0},kt={t:0,rate:1,volume:1},Fn={t:0,rate:1,volume:1,opacity:1,zIndex:0},hl=Object.freeze(Object.defineProperty({__proto__:null,MediaSurfaceStateSchema:fl,defaultAudioOptions:kt,defaultImageOptions:Bn,defaultVideoOptions:Fn},Symbol.toStringTag,{value:"Module"}));function st(e,t){if(!e.keyframes.filter(n=>n[1]===null).some(n=>n[0]<=t))switch(e.type){case"image":{if(e.keyframes[0][0]>t)return;const s=e.keyframes.filter(o=>o[1]!==null),i=Pt(s,t);return{...Bn,...i}}case"audio":{const n=e.keyframes.filter(o=>o[1]!==null),s=qn(n,t);if(!s)return;const i=Pt(n,t);return{...kt,...i,...s}}case"video":{const n=e.keyframes.filter(o=>o[1]!==null),s=qn(n,t);if(!s)return;const i=Pt(n,t);return{...Fn,...i,...s}}}}function Pt(e,t){const r={};for(const[s,i]of e)s<=t?(Object.entries(i.lerp??{}).forEach(([o,c])=>{r[o]??={},r[o].before=[s,c]}),Object.entries(i.set??{}).forEach(([o,c])=>{r[o]??={},r[o].before=[s,c]})):Object.entries(i.lerp??{}).forEach(([o,c])=>{r[o]??={},r[o].after===void 0&&(r[o].after=[s,c])});const n={};return Object.entries(r).forEach(([s,{before:i,after:o}])=>{if(o===void 0&&i){n[s]=i[1];return}if(i&&o&&i[0]===o[0]){n[s]=o[1];return}if(i&&typeof i[1]=="number"&&o&&typeof o[1]=="number"){n[s]=i[1]+(t-i[0])*(o[1]-i[1])/(o[0]-i[0]);return}}),n}function qn(e,t){const r=e[0];if(!r||r[0]>t)return;let n=0,{t:s,rate:i}=kt;for(const[l,a]of e){if(l>t)break;const{set:f}=a;if(!f)continue;const{t:h,rate:p}=f;if(h!==void 0){n=l,s=h,p!==void 0&&(i=p);continue}if(p!==void 0){const _=(l-n)*i;n=l,s+=_,i=p}}const c=(t-n)*i,u=s+c;return{rate:i,t:u}}const dl=typeof navigator<"u"&&typeof navigator.standalone<"u",pl="GestureEvent"in window;function it(e,t){return(e%t+t)%t}function ml(e,t,r){return e=it(e,r),t=it(t,r),Math.abs(e-t)<r/2?e-t:e<t?e+r-t:e-(t+r)}const Ct=e=>{try{const{pathname:t}=new URL(e,window.location.href);return t}catch{return}};class Nt{constructor(t,r,n,s,i,o){this.surfaceElement=t,this.clipElement=r,this.constructAssetURL=s,this.getAudioOutput=i,this.mediaPreloader=o,this._state=n}isConnected(t){return!(!this.surfaceElement||!this.clipElement||!this.surfaceElement.contains(this.clipElement)||t&&!this.clipElement.contains(t))}_state;setState(t){this._state=t}timeout;loop=async()=>{clearTimeout(this.timeout),this.isConnected()?(this.update(),this.timeout=setTimeout(this.loop,Kn)):this.destroy()}}function Lt(e,t,r,n,s){let i;const o=n(r.file),c=Ct(o);switch(r.type){case"image":i=e instanceof HTMLImageElement?e:document.createElement("img"),Ct(i.src)!==c&&(i.src=o);break;case"audio":case"video":{if(e!==void 0){const u=Ct(e.src);e.tagName.toLowerCase()===r.type&&u!==void 0&&u===c&&(i=e)}i||(i=s.getElement(r.file,r.type)),i instanceof HTMLVideoElement&&!i.playsInline&&(i.playsInline=!0);break}}return(t.children.length!==1||t.childNodes[0]!==i)&&t.replaceChildren(i),i.style.position="absolute",i.style.width="100%",i.style.height="100%",i}function Gn(e,t,r){const n=String(t.opacity);e.style.opacity!==n&&(e.style.opacity=n);const s=Math.round(t.zIndex??0);parseInt(e.style.zIndex)!==s&&(e.style.zIndex=String(s)),e.style.objectFit!==r&&(e.style.objectFit=r)}function Vn(e,t,r,n){const s=t.volume*n;if(dl)s===0&&!e.muted?e.muted=!0:s>0&&e.muted&&(e.muted=!1);else if(e.muted&&(e.muted=!1),e.volume!==s&&(e.volume=s),e.sinkId!==r)try{e.setSinkId(r).catch(()=>{})}catch{}}const Wn=2e3,gl=1e3,Hn=100,Xn=50,Kn=5,ot=1e3,vl=10,_l=100,El=.3,bl=.1;function wl(e){return Math.sign(e)*Math.pow(Math.abs(e)/ot,El)*bl}function me(e,t){e.playbackRate!==t&&(e.playbackRate=t),e.paused&&e.play().catch(()=>{})}function Yn(e,t,r,n,s,i){const o=i&&!pl;let c=!1;if(e.duration){const h=r.filter(([p])=>p>r[0][0]&&p>n).filter(([,p])=>p?.set?.t!==void 0||p?.set?.rate!==void 0)[0];if(h?.[1]?.set?.t===0){const p=(e.duration*1e3-t.t)/t.rate,$=h[0]-n;c=Math.abs(p-$)<=_l,e.loop!==c&&(e.loop=c)}}const u=e.currentTime*1e3,l=c&&e.duration!==void 0?ml(u,t.t,e.duration*1e3):u-t.t,a=Math.abs(l);switch(!0){case(!o&&s.state==="idle"&&t.rate>0&&a>Wn):{const f=(t.t+t.rate*gl)/1e3;return e.duration!==void 0&&f>e.duration&&!c?{state:"idle"}:(me(e,0),e.currentTime=c?it(f,e.duration*1e3):f,{state:"seeking-ahead"})}case(s.state==="seeking-ahead"&&e.seeking===!0):return{state:"seeking-ahead"};case(s.state==="seeking-ahead"&&e.seeking===!1):return me(e,0),{state:"seeked-ahead"};case(s.state==="seeked-ahead"&&l<-Hn):return me(e,t.rate),console.warn("Failed to seek ahead in time"),{state:"idle"};case(s.state==="seeked-ahead"&&a<=Hn):return me(e,t.rate),{state:"idle"};case(s.state==="seeked-ahead"&&a>Wn*1.5):return console.warn("Failed to seek ahead"),{state:"idle"};case s.state==="seeked-ahead":return{state:"seeked-ahead"};case(o&&s.state==="idle"&&t.rate>0&&a>Xn&&a<=ot):{const f=wl(l),h=Math.max(0,t.rate-f);return me(e,h),{state:"intercepting"}}case(s.state==="intercepting"&&a<=Kn):return me(e,t.rate),{state:"idle"};case(s.state==="intercepting"&&Math.sign(l)===Math.sign(e.playbackRate-t.rate)):return me(e,t.rate),{state:"idle"};case(s.state==="intercepting"&&a<ot*2):return{state:"intercepting"};case s.state==="intercepting":return me(e,t.rate),{state:"idle"};case(o&&s.state==="idle"&&a>ot):{const f=(t.t+t.rate*vl)/1e3;return e.currentTime=c?it(f,e.duration*1e3):f,me(e,t.rate),{state:"seeking"}}case(s.state==="seeking"&&e.seeking):return{state:"seeking"};case(s.state==="seeking"&&!e.seeking):return{state:"idle"};case s.state==="idle":return me(e,t.rate),t.rate===0&&a>Xn&&(e.currentTime=t.t/1e3),{state:"idle"};default:return{state:"idle"}}}class Sl extends Nt{imageElement;update(){const t=st(this._state,Date.now());t?this.imageElement=Lt(this.imageElement,this.clipElement,this._state,this.constructAssetURL,this.mediaPreloader):this.imageElement&&this.destroy(),!(!t||!this.imageElement)&&Gn(this.imageElement,t,this._state.fit)}destroy(){this.imageElement&&(this.imageElement.remove(),this.imageElement.src="",this.imageElement=void 0)}}class Jn extends Nt{syncState={state:"idle"};audioElement;volume=1;update(){const t=Date.now(),r=st(this._state,t);if(r?this.audioElement=Lt(this.audioElement,this.clipElement,this._state,this.constructAssetURL,this.mediaPreloader):this.destroy(),!r||!this.audioElement)return;const n=this.getAudioOutput(this._state.audioOutput);Vn(this.audioElement,r,n,this.volume);const s=Yn(this.audioElement,r,this._state.keyframes,t,this.syncState,this._state.enablePlaybackRateAdjustment);this.syncState=s}destroy(){this.audioElement&&(this.audioElement.pause(),this.audioElement.remove(),this.audioElement.volume=0,this.audioElement.currentTime=0,this.mediaPreloader.releaseElement(this.audioElement)),this.audioElement=void 0}}class Qn extends Nt{syncState={state:"idle"};videoElement;volume=1;update(){const t=Date.now(),r=st(this._state,t);if(r?this.videoElement=Lt(this.videoElement,this.clipElement,this._state,this.constructAssetURL,this.mediaPreloader):this.destroy(),!r||!this.videoElement)return;const n=this.getAudioOutput(this._state.audioOutput);Gn(this.videoElement,r,this._state.fit),Vn(this.videoElement,r,n,this.volume);const s=Yn(this.videoElement,r,this._state.keyframes,t,this.syncState,this._state.enablePlaybackRateAdjustment);this.syncState=s}destroy(){this.videoElement&&(this.videoElement.pause(),this.videoElement.remove(),this.videoElement.volume=0,this.videoElement.currentTime=0,this.mediaPreloader.releaseElement(this.videoElement)),this.videoElement=void 0}}class es{_state;_elements={};_constructAssetURL;constructor(t,r={}){this._constructAssetURL=t,this._state=r}get state(){return{...this._state}}setState(t){this._state=t,this.update()}update(){for(const[t,r]of Object.entries(this._elements)){if(!(t in this._state)){if(r.inUse){console.warn(`Failed to clean up element ${r.element.src}`);continue}r.element.src="",r.element.load(),delete this._elements[t]}r.inUse=r.element.isConnected}for(const[t,r]of Object.entries(this._state)){if(t in this._elements)continue;let n;switch(r.preload===!0?n="auto":r.preload===!1?n="none":n=r.preload,r.type){case"audio":{const s=document.createElement("audio");s.src=this._constructAssetURL(t),s.preload=n,this._elements[t]={element:s,inUse:!1,type:"audio"};break}case"video":{const s=document.createElement("video");s.src=this._constructAssetURL(t),s.preload=n,this._elements[t]={element:s,inUse:!1,type:"video"};break}}}}getElement(t,r){const n=this._elements[t];if(n&&n.inUse===!1)return n.inUse=!0,n.element;{const s=document.createElement(r);return s.src=this._constructAssetURL(t),r==="video"&&(this._elements[t]={element:s,type:r,inUse:!0}),s}}releaseElement(t){if(typeof t=="string"){const r=this._elements[t];r&&(r.inUse=!1)}else Object.values(this._elements).forEach(r=>{r.element===t&&(r.inUse=!1)})}}const Il="data-clip-id";class $l{constructor(t,r,n,s=new es(t)){this.constructAssetUrl=t,this.getAudioOutput=r,this.mediaPreloader=s,this._element=document.createElement("div"),this._element.className="surface-manager",this._element.style.width="100%",this._element.style.height="100%",this._state=n||{},this.update()}_state={};setState(t){this._state=t,this.update()}_volume=1;get volume(){return this._volume}set volume(t){this._volume=t,Object.values(this.resources).forEach(({manager:r})=>{(r instanceof Jn||r instanceof Qn)&&(r.volume=t)})}_element;get element(){return this._element}resources={};update(){Object.entries(this.resources).forEach(([r,{element:n,manager:s}])=>{r in this._state||(delete this.resources[r],n.remove(),s?.destroy())});const t=Object.keys(this._state).toSorted().map(r=>{const n=this.resources[r];if(n)return n.element;{const s=document.createElement("div");return s.setAttribute(Il,r),this.resources[r]={element:s},s}});this._element.replaceChildren(...t),Object.keys(this._state).toSorted().forEach(r=>{const n=this._state[r],s=this.resources[r];if(!s)throw new Error("Failed to create resource");if(s.manager)s.manager.setState(n);else switch(n.type){case"image":s.manager=new Sl(this._element,s.element,n,this.constructAssetUrl,this.getAudioOutput,this.mediaPreloader),s.manager.loop();break;case"audio":{const i=new Jn(this._element,s.element,n,this.constructAssetUrl,this.getAudioOutput,this.mediaPreloader);s.manager=i,i.volume=this._volume,i.loop();break}case"video":{const i=new Qn(this._element,s.element,n,this.constructAssetUrl,this.getAudioOutput,this.mediaPreloader);s.manager=i,i.volume=this._volume,i.loop();break}}})}}function yl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ve={},ue={},_e={},Ue={},ts;function at(){if(ts)return Ue;ts=1,Object.defineProperty(Ue,"__esModule",{value:!0}),Ue.AddressError=void 0;class e extends Error{constructor(r,n){super(r),this.name="AddressError",this.parseMessage=n}}return Ue.AddressError=e,Ue}var rs;function zt(){if(rs)return _e;rs=1,Object.defineProperty(_e,"__esModule",{value:!0}),_e.isInSubnet=t,_e.isCorrect=r,_e.prefixLengthFromMask=n,_e.numberToPaddedHex=s,_e.stringToPaddedHex=i,_e.testBit=o;const e=at();function t(c){return this.subnetMask<c.subnetMask?!1:this.mask(c.subnetMask)===c.mask()}function r(c){return function(){return this.addressMinusSuffix!==this.correctForm()?!1:this.subnetMask===c&&!this.parsedSubnet?!0:this.parsedSubnet===String(this.subnetMask)}}function n(c,u){const l=c.toString(2).padStart(u,"0");if(l.length>u)throw new e.AddressError("Invalid subnet mask.");const a=l.indexOf("0");if(a===-1)return u;if(l.slice(a).includes("1"))throw new e.AddressError("Invalid subnet mask.");return a}function s(c){return c.toString(16).padStart(2,"0")}function i(c){return s(parseInt(c,10))}function o(c,u){const{length:l}=c;if(u>l)return!1;const a=l-u;return c.substring(a,a+1)==="1"}return _e}var ce={},ns;function ss(){return ns||(ns=1,Object.defineProperty(ce,"__esModule",{value:!0}),ce.RE_SUBNET_STRING=ce.RE_ADDRESS=ce.GROUPS=ce.BITS=void 0,ce.BITS=32,ce.GROUPS=4,ce.RE_ADDRESS=/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/g,ce.RE_SUBNET_STRING=/\/\d{1,2}$/),ce}var is;function os(){if(is)return ue;is=1;var e=ue&&ue.__createBinding||(Object.create?function(_,m,E,y){y===void 0&&(y=E);var C=Object.getOwnPropertyDescriptor(m,E);(!C||("get"in C?!m.__esModule:C.writable||C.configurable))&&(C={enumerable:!0,get:function(){return m[E]}}),Object.defineProperty(_,y,C)}:function(_,m,E,y){y===void 0&&(y=E),_[y]=m[E]}),t=ue&&ue.__setModuleDefault||(Object.create?function(_,m){Object.defineProperty(_,"default",{enumerable:!0,value:m})}:function(_,m){_.default=m}),r=ue&&ue.__importStar||function(_){if(_&&_.__esModule)return _;var m={};if(_!=null)for(var E in _)E!=="default"&&Object.prototype.hasOwnProperty.call(_,E)&&e(m,_,E);return t(m,_),m};Object.defineProperty(ue,"__esModule",{value:!0}),ue.Address4=void 0;const n=r(zt()),s=r(ss()),i=at(),o=n.isCorrect(s.BITS);class c{constructor(m){this.groups=s.GROUPS,this.parsedAddress=[],this.parsedSubnet="",this.subnet="/32",this.subnetMask=32,this.v4=!0,this.isCorrect=o,this.isInSubnet=n.isInSubnet,this.address=m;const E=s.RE_SUBNET_STRING.exec(m);if(E){if(this.parsedSubnet=E[0].replace("/",""),this.subnetMask=parseInt(this.parsedSubnet,10),this.subnet=`/${this.subnetMask}`,this.subnetMask<0||this.subnetMask>s.BITS)throw new i.AddressError("Invalid subnet mask.");m=m.replace(s.RE_SUBNET_STRING,"")}this.addressMinusSuffix=m,this.parsedAddress=this.parse(m)}static isValid(m){try{return new c(m),!0}catch{return!1}}parse(m){const E=m.split(".");if(!m.match(s.RE_ADDRESS))throw new i.AddressError("Invalid IPv4 address.");return E}correctForm(){return this.parsedAddress.map(m=>parseInt(m,10)).join(".")}static fromAddressAndMask(m,E){const y=n.prefixLengthFromMask(new c(E).bigInt(),s.BITS);return new c(`${m}/${y}`)}static fromAddressAndWildcardMask(m,E){const y=new c(E).bigInt(),C=(BigInt(1)<<BigInt(s.BITS))-BigInt(1),x=y^C,N=n.prefixLengthFromMask(x,s.BITS);return new c(`${m}/${N}`)}static fromWildcard(m){const E=m.split(".");if(E.length!==s.GROUPS)throw new i.AddressError("Wildcard pattern must have 4 octets");let y=-1;for(let U=0;U<E.length;U++)if(E[U]==="*")y===-1&&(y=U);else if(y!==-1)throw new i.AddressError("Wildcard `*` must only appear in trailing octets (e.g. `192.168.0.*`)");const C=y===-1?0:E.length-y,x=E.map(U=>U==="*"?"0":U),N=s.BITS-C*8;return new c(`${x.join(".")}/${N}`)}static fromHex(m){const E=m.replace(/:/g,"");if(!/^[0-9a-fA-F]{8}$/.test(E))throw new i.AddressError("IPv4 hex must be exactly 8 hex digits");const y=[];for(let C=0;C<8;C+=2)y.push(parseInt(E.slice(C,C+2),16));return new c(y.join("."))}static fromInteger(m){if(!Number.isInteger(m)||m<0||m>4294967295)throw new i.AddressError("IPv4 integer must be in the range 0 to 2**32 - 1");return c.fromHex(m.toString(16).padStart(8,"0"))}static fromArpa(m){const y=m.replace(/(\.in-addr\.arpa)?\.$/,"").split(".").reverse().join(".");return new c(y)}toHex(){return this.parsedAddress.map(m=>n.stringToPaddedHex(m)).join(":")}toArray(){return this.parsedAddress.map(m=>parseInt(m,10))}toGroup6(){const m=[];let E;for(E=0;E<s.GROUPS;E+=2)m.push(`${n.stringToPaddedHex(this.parsedAddress[E])}${n.stringToPaddedHex(this.parsedAddress[E+1])}`);return m.join(":")}bigInt(){return BigInt(`0x${this.parsedAddress.map(m=>n.stringToPaddedHex(m)).join("")}`)}_startAddress(){return BigInt(`0b${this.mask()+"0".repeat(s.BITS-this.subnetMask)}`)}startAddress(){return c.fromBigInt(this._startAddress())}startAddressExclusive(){const m=BigInt("1");return c.fromBigInt(this._startAddress()+m)}_endAddress(){return BigInt(`0b${this.mask()+"1".repeat(s.BITS-this.subnetMask)}`)}endAddress(){return c.fromBigInt(this._endAddress())}endAddressExclusive(){const m=BigInt("1");return c.fromBigInt(this._endAddress()-m)}subnetMaskAddress(){return c.fromBigInt(BigInt(`0b${"1".repeat(this.subnetMask)}${"0".repeat(s.BITS-this.subnetMask)}`))}wildcardMask(){return c.fromBigInt(BigInt(`0b${"0".repeat(this.subnetMask)}${"1".repeat(s.BITS-this.subnetMask)}`))}networkForm(){return`${this.startAddress().correctForm()}/${this.subnetMask}`}static fromBigInt(m){if(m<0n||m>0xffffffffn)throw new i.AddressError("IPv4 BigInt must be in the range 0 to 2**32 - 1");return c.fromHex(m.toString(16).padStart(8,"0"))}static fromByteArray(m){if(m.length!==4)throw new i.AddressError("IPv4 addresses require exactly 4 bytes");for(let E=0;E<m.length;E++)if(!Number.isInteger(m[E])||m[E]<0||m[E]>255)throw new i.AddressError("All bytes must be integers between 0 and 255");return this.fromUnsignedByteArray(m)}static fromUnsignedByteArray(m){if(m.length!==4)throw new i.AddressError("IPv4 addresses require exactly 4 bytes");const E=m.join(".");return new c(E)}mask(m){return m===void 0&&(m=this.subnetMask),this.getBitsBase2(0,m)}getBitsBase2(m,E){return this.binaryZeroPad().slice(m,E)}reverseForm(m){m||(m={});const E=this.correctForm().split(".").reverse().join(".");return m.omitSuffix?E:`${E}.in-addr.arpa.`}isMulticast(){return this.isInSubnet(u)}isPrivate(){return l.some(m=>this.isInSubnet(m))}isLoopback(){return this.isInSubnet(a)}isLinkLocal(){return this.isInSubnet(f)}isUnspecified(){return this.isInSubnet(h)}isBroadcast(){return this.isInSubnet(p)}isCGNAT(){return this.isInSubnet($)}binaryZeroPad(){return this._binaryZeroPad===void 0&&(this._binaryZeroPad=this.bigInt().toString(2).padStart(s.BITS,"0")),this._binaryZeroPad}groupForV6(){const m=this.parsedAddress;return this.address.replace(s.RE_ADDRESS,`<span class="hover-group group-v4 group-6">${m.slice(0,2).join(".")}</span>.<span class="hover-group group-v4 group-7">${m.slice(2,4).join(".")}</span>`)}}ue.Address4=c;const u=new c("224.0.0.0/4"),l=[new c("10.0.0.0/8"),new c("172.16.0.0/12"),new c("192.168.0.0/16")],a=new c("127.0.0.0/8"),f=new c("169.254.0.0/16"),h=new c("0.0.0.0/32"),p=new c("255.255.255.255/32"),$=new c("100.64.0.0/10");return ue}var le={},J={},as;function us(){return as||(as=1,Object.defineProperty(J,"__esModule",{value:!0}),J.RE_URL_WITH_PORT=J.RE_URL=J.RE_ZONE_STRING=J.RE_SUBNET_STRING=J.RE_BAD_ADDRESS=J.RE_BAD_CHARACTERS=J.TYPES=J.SCOPES=J.GROUPS=J.BITS=void 0,J.BITS=128,J.GROUPS=8,J.SCOPES={0:"Reserved",1:"Interface local",2:"Link local",4:"Admin local",5:"Site local",8:"Organization local",14:"Global",15:"Reserved"},J.TYPES={"ff01::1/128":"Multicast (All nodes on this interface)","ff01::2/128":"Multicast (All routers on this interface)","ff02::1/128":"Multicast (All nodes on this link)","ff02::2/128":"Multicast (All routers on this link)","ff05::2/128":"Multicast (All routers in this site)","ff02::5/128":"Multicast (OSPFv3 AllSPF routers)","ff02::6/128":"Multicast (OSPFv3 AllDR routers)","ff02::9/128":"Multicast (RIP routers)","ff02::a/128":"Multicast (EIGRP routers)","ff02::d/128":"Multicast (PIM routers)","ff02::16/128":"Multicast (MLDv2 reports)","ff01::fb/128":"Multicast (mDNSv6)","ff02::fb/128":"Multicast (mDNSv6)","ff05::fb/128":"Multicast (mDNSv6)","ff02::1:2/128":"Multicast (All DHCP servers and relay agents on this link)","ff05::1:2/128":"Multicast (All DHCP servers and relay agents in this site)","ff02::1:3/128":"Multicast (All DHCP servers on this link)","ff05::1:3/128":"Multicast (All DHCP servers in this site)","::/128":"Unspecified","::1/128":"Loopback","ff00::/8":"Multicast","fe80::/10":"Link-local unicast","fc00::/7":"Unique local","2002::/16":"6to4","2001:db8::/32":"Documentation","64:ff9b::/96":"NAT64 (well-known)","64:ff9b:1::/48":"NAT64 (local-use)"},J.RE_BAD_CHARACTERS=/([^0-9a-f:/%])/gi,J.RE_BAD_ADDRESS=/([0-9a-f]{5,}|:{3,}|[^:]:$|^:[^:]|\/$)/gi,J.RE_SUBNET_STRING=/\/\d{1,3}(?=%|$)/,J.RE_ZONE_STRING=/%.*$/,J.RE_URL=/^\[{0,1}([0-9a-f:]+)\]{0,1}/,J.RE_URL_WITH_PORT=/\[([0-9a-f:]+)\]:([0-9]{1,5})/),J}var Ie={},cs;function ls(){if(cs)return Ie;cs=1,Object.defineProperty(Ie,"__esModule",{value:!0}),Ie.escapeHtml=e,Ie.spanAllZeroes=t,Ie.spanAll=r,Ie.spanLeadingZeroes=s,Ie.simpleGroup=i;function e(o){return o.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function t(o){return e(o).replace(/(0+)/g,'<span class="zero">$1</span>')}function r(o,c=0){return o.split("").map((l,a)=>`<span class="digit value-${e(l)} position-${a+c}">${t(l)}</span>`).join("")}function n(o){return e(o).replace(/^(0+)/,'<span class="zero">$1</span>')}function s(o){return o.split(":").map(u=>n(u)).join(":")}function i(o,c=0){return o.split(":").map((l,a)=>/group-v4/.test(l)?l:`<span class="hover-group group-${a+c}">${n(l)}</span>`)}return Ie}var se={},fs;function Rl(){if(fs)return se;fs=1;var e=se&&se.__createBinding||(Object.create?function(u,l,a,f){f===void 0&&(f=a);var h=Object.getOwnPropertyDescriptor(l,a);(!h||("get"in h?!l.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return l[a]}}),Object.defineProperty(u,f,h)}:function(u,l,a,f){f===void 0&&(f=a),u[f]=l[a]}),t=se&&se.__setModuleDefault||(Object.create?function(u,l){Object.defineProperty(u,"default",{enumerable:!0,value:l})}:function(u,l){u.default=l}),r=se&&se.__importStar||function(u){if(u&&u.__esModule)return u;var l={};if(u!=null)for(var a in u)a!=="default"&&Object.prototype.hasOwnProperty.call(u,a)&&e(l,u,a);return t(l,u),l};Object.defineProperty(se,"__esModule",{value:!0}),se.ADDRESS_BOUNDARY=void 0,se.groupPossibilities=s,se.padGroup=i,se.simpleRegularExpression=o,se.possibleElisions=c;const n=r(us());function s(u){return`(${u.join("|")})`}function i(u){return u.length<4?`0{0,${4-u.length}}${u}`:u}se.ADDRESS_BOUNDARY="[^A-Fa-f0-9:]";function o(u){const l=[];u.forEach((f,h)=>{parseInt(f,16)===0&&l.push(h)});const a=l.map(f=>u.map((h,p)=>{if(p===f){const $=p===0||p===n.GROUPS-1?":":"";return s([i(h),$])}return i(h)}).join(":"));return a.push(u.map(i).join(":")),s(a)}function c(u,l,a){const f=l?"":":",h=a?"":":",p=[];!l&&!a&&p.push("::"),l&&a&&p.push(""),(a&&!l||!a&&l)&&p.push(":"),p.push(`${f}(:0{1,4}){1,${u-1}}`),p.push(`(0{1,4}:){1,${u-1}}${h}`),p.push(`(0{1,4}:){${u-1}}0{1,4}`);for(let $=1;$<u-1;$++)for(let _=1;_<u-$;_++)p.push(`(0{1,4}:){${_}}:(0{1,4}:){${u-_-$-1}}0{1,4}`);return s(p)}return se}var hs;function Al(){if(hs)return le;hs=1;var e=le&&le.__createBinding||(Object.create?function(L,d,v,b){b===void 0&&(b=v);var w=Object.getOwnPropertyDescriptor(d,v);(!w||("get"in w?!d.__esModule:w.writable||w.configurable))&&(w={enumerable:!0,get:function(){return d[v]}}),Object.defineProperty(L,b,w)}:function(L,d,v,b){b===void 0&&(b=v),L[b]=d[v]}),t=le&&le.__setModuleDefault||(Object.create?function(L,d){Object.defineProperty(L,"default",{enumerable:!0,value:d})}:function(L,d){L.default=d}),r=le&&le.__importStar||function(L){if(L&&L.__esModule)return L;var d={};if(L!=null)for(var v in L)v!=="default"&&Object.prototype.hasOwnProperty.call(L,v)&&e(d,L,v);return t(d,L),d};Object.defineProperty(le,"__esModule",{value:!0}),le.Address6=void 0;const n=r(zt()),s=r(ss()),i=r(us()),o=r(ls()),c=os(),u=Rl(),l=at(),a=zt(),f=n.isCorrect(i.BITS);function h(L){if(!L)throw new Error("Assertion failed.")}function p(L){const d=/(\d+)(\d{3})/;for(;d.test(L);)L=L.replace(d,"$1,$2");return L}function $(L){return L=L.replace(/^(0{1,})([1-9]+)$/,'<span class="parse-error">$1</span>$2'),L=L.replace(/^(0{1,})(0)$/,'<span class="parse-error">$1</span>$2'),L}function _(L,d){const v=[],b=[];let w;for(w=0;w<L.length;w++)w<d[0]?v.push(L[w]):w>d[1]&&b.push(L[w]);return v.concat(["compact"]).concat(b)}function m(L){return parseInt(L,16).toString(16).padStart(4,"0")}function E(L){return L&255}class y{constructor(d,v){this.addressMinusSuffix="",this.parsedSubnet="",this.subnet="/128",this.subnetMask=128,this.v4=!1,this.zone="",this.isInSubnet=n.isInSubnet,this.isCorrect=f,v===void 0?this.groups=i.GROUPS:this.groups=v,this.address=d;const b=i.RE_SUBNET_STRING.exec(d);if(b){if(this.parsedSubnet=b[0].replace("/",""),this.subnetMask=parseInt(this.parsedSubnet,10),this.subnet=`/${this.subnetMask}`,Number.isNaN(this.subnetMask)||this.subnetMask<0||this.subnetMask>i.BITS)throw new l.AddressError("Invalid subnet mask.");d=d.replace(i.RE_SUBNET_STRING,"")}else if(/\//.test(d))throw new l.AddressError("Invalid subnet mask.");const w=i.RE_ZONE_STRING.exec(d);w&&(this.zone=w[0],d=d.replace(i.RE_ZONE_STRING,"")),this.addressMinusSuffix=d,this.parsedAddress=this.parse(this.addressMinusSuffix)}static isValid(d){try{return new y(d),!0}catch{return!1}}static fromBigInt(d){if(d<0n||d>(1n<<BigInt(i.BITS))-1n)throw new l.AddressError("IPv6 BigInt must be in the range 0 to 2**128 - 1");const v=d.toString(16).padStart(32,"0"),b=[];for(let w=0;w<i.GROUPS;w++)b.push(v.slice(w*4,(w+1)*4));return new y(b.join(":"))}static fromURL(d){let v,b=null,w;if(d.indexOf("[")!==-1&&d.indexOf("]:")!==-1){if(w=i.RE_URL_WITH_PORT.exec(d),w===null)return{error:"failed to parse address with port",address:null,port:null};v=w[1],b=w[2]}else if(d.indexOf("/")!==-1){if(d=d.replace(/^[a-z0-9]+:\/\//,""),w=i.RE_URL.exec(d),w===null)return{error:"failed to parse address from URL",address:null,port:null};v=w[1]}else v=d;return b?(b=parseInt(b,10),(b<0||b>65536)&&(b=null)):b=null,{address:new y(v),port:b}}static fromAddressAndMask(d,v){const b=n.prefixLengthFromMask(new y(v).bigInt(),i.BITS);return new y(`${d}/${b}`)}static fromAddressAndWildcardMask(d,v){const b=new y(v).bigInt(),w=(BigInt(1)<<BigInt(i.BITS))-BigInt(1),k=b^w,D=n.prefixLengthFromMask(k,i.BITS);return new y(`${d}/${D}`)}static fromWildcard(d){if(d.includes("%")||d.includes("/"))throw new l.AddressError("Wildcard pattern must not include a zone or CIDR suffix");const v=d.split("::");if(v.length>2)throw new l.AddressError("Wildcard pattern cannot contain more than one '::'");let b;if(v.length===2){const S=v[0]===""?[]:v[0].split(":"),I=v[1]===""?[]:v[1].split(":"),T=i.GROUPS-S.length-I.length;if(T<1)throw new l.AddressError("Wildcard pattern with '::' has too many groups");b=[...S,...new Array(T).fill("0"),...I]}else b=d.split(":");if(b.length!==i.GROUPS)throw new l.AddressError("Wildcard pattern must have 8 groups");let w=-1;for(let S=0;S<b.length;S++)if(b[S]==="*")w===-1&&(w=S);else if(w!==-1)throw new l.AddressError("Wildcard `*` must only appear in trailing groups (e.g. `2001:db8:*:*:*:*:*:*`)");const k=w===-1?0:b.length-w,D=b.map(S=>S==="*"?"0":S),j=i.BITS-k*16;return new y(`${D.join(":")}/${j}`)}static fromAddress4(d){const v=new c.Address4(d),b=i.BITS-(s.BITS-v.subnetMask);return new y(`::ffff:${v.correctForm()}/${b}`)}static fromArpa(d){let v=d.replace(/(\.ip6\.arpa)?\.$/,"");const b=7;if(v.length!==63)throw new l.AddressError("Invalid 'ip6.arpa' form.");const w=v.split(".").reverse();for(let k=b;k>0;k--){const D=k*4;w.splice(D,0,":")}return v=w.join(""),new y(v)}microsoftTranscription(){return`${this.correctForm().replace(/:/g,"-")}.ipv6-literal.net`}mask(d=this.subnetMask){return this.getBitsBase2(0,d)}possibleSubnets(d=128){const v=i.BITS-this.subnetMask,b=Math.abs(d-i.BITS),w=v-b;return w<0?"0":p((BigInt("2")**BigInt(w)).toString(10))}_startAddress(){return BigInt(`0b${this.mask()+"0".repeat(i.BITS-this.subnetMask)}`)}startAddress(){return y.fromBigInt(this._startAddress())}startAddressExclusive(){const d=BigInt("1");return y.fromBigInt(this._startAddress()+d)}_endAddress(){return BigInt(`0b${this.mask()+"1".repeat(i.BITS-this.subnetMask)}`)}endAddress(){return y.fromBigInt(this._endAddress())}endAddressExclusive(){const d=BigInt("1");return y.fromBigInt(this._endAddress()-d)}subnetMaskAddress(){return y.fromBigInt(BigInt(`0b${"1".repeat(this.subnetMask)}${"0".repeat(i.BITS-this.subnetMask)}`))}wildcardMask(){return y.fromBigInt(BigInt(`0b${"0".repeat(this.subnetMask)}${"1".repeat(i.BITS-this.subnetMask)}`))}networkForm(){return`${this.startAddress().correctForm()}/${this.subnetMask}`}getScope(){const d=this.getType();return d==="Multicast"||d.startsWith("Multicast ")?i.SCOPES[parseInt(this.getBits(12,16).toString(10),10)]||"Unknown":d==="Link-local unicast"||d==="Loopback"?"Link local":d==="Unspecified"?"Unknown":"Global"}getType(){for(let d=0;d<C.length;d++){const v=C[d];if(this.isInSubnet(v[0]))return v[1]}return"Global unicast"}getBits(d,v){return BigInt(`0b${this.getBitsBase2(d,v)}`)}getBitsBase2(d,v){return this.binaryZeroPad().slice(d,v)}getBitsBase16(d,v){const b=v-d;if(b%4!==0)throw new Error("Length of bits to retrieve must be divisible by four");return this.getBits(d,v).toString(16).padStart(b/4,"0")}getBitsPastSubnet(){return this.getBitsBase2(this.subnetMask,i.BITS)}reverseForm(d){d||(d={});const v=Math.floor(this.subnetMask/4),b=this.canonicalForm().replace(/:/g,"").split("").slice(0,v).reverse().join(".");return v>0?d.omitSuffix?b:`${b}.ip6.arpa.`:d.omitSuffix?"":"ip6.arpa."}correctForm(){let d,v=[],b=0;const w=[];for(d=0;d<this.parsedAddress.length;d++){const j=parseInt(this.parsedAddress[d],16);j===0&&b++,j!==0&&b>0&&(b>1&&w.push([d-b,d-1]),b=0)}b>1&&w.push([this.parsedAddress.length-b,this.parsedAddress.length-1]);const k=w.map(j=>j[1]-j[0]+1);if(w.length>0){const j=k.indexOf(Math.max(...k));v=_(this.parsedAddress,w[j])}else v=this.parsedAddress;for(d=0;d<v.length;d++)v[d]!=="compact"&&(v[d]=parseInt(v[d],16).toString(16));let D=v.join(":");return D=D.replace(/^compact$/,"::"),D=D.replace(/(^compact)|(compact$)/,":"),D=D.replace(/compact/,""),D}binaryZeroPad(){return this._binaryZeroPad===void 0&&(this._binaryZeroPad=this.bigInt().toString(2).padStart(i.BITS,"0")),this._binaryZeroPad}parse4in6(d){if(d.indexOf(".")===-1)return d;const v=d.split(":"),w=v.slice(-1)[0].match(s.RE_ADDRESS);if(w){this.parsedAddress4=w[0],this.address4=new c.Address4(this.parsedAddress4);for(let k=0;k<this.address4.groups;k++)if(/^0[0-9]+/.test(this.address4.parsedAddress[k])){const D=this.address4.parsedAddress.map($).join("."),j=v.slice(0,-1).map(o.escapeHtml).join(":"),S=v.length>1?":":"";throw new l.AddressError("IPv4 addresses can't have leading zeroes.",`${j}${S}${D}`)}this.v4=!0,v[v.length-1]=this.address4.toGroup6(),d=v.join(":")}return d}parse(d){d=this.parse4in6(d);const v=d.match(i.RE_BAD_CHARACTERS);if(v)throw new l.AddressError(`Bad character${v.length>1?"s":""} detected in address: ${v.join("")}`,d.replace(i.RE_BAD_CHARACTERS,'<span class="parse-error">$1</span>'));const b=d.match(i.RE_BAD_ADDRESS);if(b)throw new l.AddressError(`Address failed regex: ${b.join("")}`,d.replace(i.RE_BAD_ADDRESS,'<span class="parse-error">$1</span>'));let w=[];const k=d.split("::");if(k.length===2){let D=k[0].split(":"),j=k[1].split(":");D.length===1&&D[0]===""&&(D=[]),j.length===1&&j[0]===""&&(j=[]);const S=this.groups-(D.length+j.length);if(!S)throw new l.AddressError("Error parsing groups");this.elidedGroups=S,this.elisionBegin=D.length,this.elisionEnd=D.length+this.elidedGroups,w=w.concat(D);for(let I=0;I<S;I++)w.push("0");w=w.concat(j)}else if(k.length===1)w=d.split(":"),this.elidedGroups=0;else throw new l.AddressError("Too many :: groups found");if(w=w.map(D=>parseInt(D,16).toString(16)),w.length!==this.groups)throw new l.AddressError("Incorrect number of groups found");return w}canonicalForm(){return this.parsedAddress.map(m).join(":")}decimal(){return this.parsedAddress.map(d=>parseInt(d,16).toString(10).padStart(5,"0")).join(":")}bigInt(){return BigInt(`0x${this.parsedAddress.map(m).join("")}`)}to4(){const d=this.binaryZeroPad().split("");return c.Address4.fromHex(BigInt(`0b${d.slice(96,128).join("")}`).toString(16).padStart(8,"0"))}to4in6(){const d=this.to4(),b=new y(this.parsedAddress.slice(0,6).join(":"),6).correctForm();let w="";return/:$/.test(b)||(w=":"),b+w+d.address}inspectTeredo(){const d=this.getBitsBase16(0,32),b=(this.getBits(80,96)^BigInt("0xffff")).toString(),w=c.Address4.fromHex(this.getBitsBase16(32,64)),k=this.getBits(96,128),D=c.Address4.fromHex((k^BigInt("0xffffffff")).toString(16).padStart(8,"0")),j=this.getBitsBase2(64,80),S=(0,a.testBit)(j,15),I=(0,a.testBit)(j,14),T=(0,a.testBit)(j,8),R=(0,a.testBit)(j,9),Z=BigInt(`0b${j.slice(2,6)+j.slice(8,16)}`).toString(10);return{prefix:`${d.slice(0,4)}:${d.slice(4,8)}`,server4:w.address,client4:D.address,flags:j,coneNat:S,microsoft:{reserved:I,universalLocal:R,groupIndividual:T,nonce:Z},udpPort:b}}inspect6to4(){const d=this.getBitsBase16(0,16),v=c.Address4.fromHex(this.getBitsBase16(16,48));return{prefix:d.slice(0,4),gateway:v.address}}to6to4(){if(!this.is4())return null;const d=["2002",this.getBitsBase16(96,112),this.getBitsBase16(112,128),"","/16"].join(":");return new y(d)}static fromAddress4Nat64(d,v="64:ff9b::/96"){const b=new c.Address4(d),w=new y(v),k=w.subnetMask;if(k!==32&&k!==40&&k!==48&&k!==56&&k!==64&&k!==96)throw new l.AddressError("NAT64 prefix length must be 32, 40, 48, 56, 64, or 96");const D=w.binaryZeroPad(),j=b.binaryZeroPad();let S;if(k===96)S=D.slice(0,96)+j;else{const R=64-k;S=D.slice(0,k)+j.slice(0,R)+"00000000"+j.slice(R)+"0".repeat(56-(32-R))}const I=BigInt(`0b${S}`).toString(16).padStart(32,"0"),T=[];for(let R=0;R<8;R++)T.push(I.slice(R*4,(R+1)*4));return new y(T.join(":"))}toAddress4Nat64(d="64:ff9b::/96"){const v=new y(d),b=v.subnetMask;if(b!==32&&b!==40&&b!==48&&b!==56&&b!==64&&b!==96)throw new l.AddressError("NAT64 prefix length must be 32, 40, 48, 56, 64, or 96");if(!this.isInSubnet(v))return null;const w=this.binaryZeroPad();let k;if(b===96)k=w.slice(96,128);else{const j=64-b;k=w.slice(b,b+j)+w.slice(72,72+(32-j))}const D=[];for(let j=0;j<4;j++)D.push(parseInt(k.slice(j*8,(j+1)*8),2).toString());return new c.Address4(D.join("."))}toByteArray(){const d=this.bigInt().toString(16),b=`${"0".repeat(d.length%2)}${d}`,w=[];for(let k=0,D=b.length;k<D;k+=2)w.push(parseInt(b.substring(k,k+2),16));return w}toUnsignedByteArray(){return this.toByteArray().map(E)}static fromByteArray(d){return this.fromUnsignedByteArray(d.map(E))}static fromUnsignedByteArray(d){const v=BigInt("256");let b=BigInt("0"),w=BigInt("1");for(let k=d.length-1;k>=0;k--)b+=w*BigInt(d[k].toString(10)),w*=v;return y.fromBigInt(b)}isCanonical(){return this.addressMinusSuffix===this.canonicalForm()}isLinkLocal(){return this.getBitsBase2(0,64)==="1111111010000000000000000000000000000000000000000000000000000000"}isMulticast(){const d=this.getType();return d==="Multicast"||d.startsWith("Multicast ")}is4(){return this.v4}isMapped4(){return this.isInSubnet(z)}isTeredo(){return this.isInSubnet(x)}is6to4(){return this.isInSubnet(N)}isLoopback(){return this.getType()==="Loopback"}isULA(){return this.isInSubnet(U)}isUnspecified(){return this.getType()==="Unspecified"}isDocumentation(){return this.isInSubnet(Q)}href(d){return d===void 0?d="":d=`:${d}`,`http://[${this.correctForm()}]${d}/`}link(d){d||(d={}),d.className===void 0&&(d.className=""),d.prefix===void 0&&(d.prefix="/#address="),d.v4===void 0&&(d.v4=!1);let v=this.correctForm;d.v4&&(v=this.to4in6);const b=v.call(this),w=o.escapeHtml(`${d.prefix}${b}`),k=o.escapeHtml(b);if(d.className){const D=o.escapeHtml(d.className);return`<a href="${w}" class="${D}">${k}</a>`}return`<a href="${w}">${k}</a>`}group(){if(this.elidedGroups===0)return o.simpleGroup(this.addressMinusSuffix).join(":");h(typeof this.elidedGroups=="number"),h(typeof this.elisionBegin=="number");const d=[],[v,b]=this.addressMinusSuffix.split("::");v.length?d.push(...o.simpleGroup(v)):d.push("");const w=["hover-group"];for(let k=this.elisionBegin;k<this.elisionBegin+this.elidedGroups;k++)w.push(`group-${k}`);return d.push(`<span class="${w.join(" ")}"></span>`),b.length?d.push(...o.simpleGroup(b,this.elisionEnd)):d.push(""),this.is4()&&(h(this.address4 instanceof c.Address4),d.pop(),d.push(this.address4.groupForV6())),d.join(":")}regularExpressionString(d=!1){let v=[];const b=new y(this.correctForm());if(b.elidedGroups===0)v.push((0,u.simpleRegularExpression)(b.parsedAddress));else if(b.elidedGroups===i.GROUPS)v.push((0,u.possibleElisions)(i.GROUPS));else{const w=b.address.split("::");w[0].length&&v.push((0,u.simpleRegularExpression)(w[0].split(":"))),h(typeof b.elidedGroups=="number"),v.push((0,u.possibleElisions)(b.elidedGroups,w[0].length!==0,w[1].length!==0)),w[1].length&&v.push((0,u.simpleRegularExpression)(w[1].split(":"))),v=[v.join(":")]}return d||(v=["(?=^|",u.ADDRESS_BOUNDARY,"|[^\\w\\:])(",...v,")(?=[^\\w\\:]|",u.ADDRESS_BOUNDARY,"|$)"]),v.join("")}regularExpression(d=!1){return new RegExp(this.regularExpressionString(d),"i")}}le.Address6=y;const C=Object.keys(i.TYPES).map(L=>[new y(L),i.TYPES[L]]),x=new y("2001::/32"),N=new y("2002::/16"),U=new y("fc00::/7"),Q=new y("2001:db8::/32"),z=new y("::ffff:0:0/96");return le}var ds;function Tl(){return ds||(ds=1,function(e){var t=ve&&ve.__createBinding||(Object.create?function(u,l,a,f){f===void 0&&(f=a);var h=Object.getOwnPropertyDescriptor(l,a);(!h||("get"in h?!l.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return l[a]}}),Object.defineProperty(u,f,h)}:function(u,l,a,f){f===void 0&&(f=a),u[f]=l[a]}),r=ve&&ve.__setModuleDefault||(Object.create?function(u,l){Object.defineProperty(u,"default",{enumerable:!0,value:l})}:function(u,l){u.default=l}),n=ve&&ve.__importStar||function(u){if(u&&u.__esModule)return u;var l={};if(u!=null)for(var a in u)a!=="default"&&Object.prototype.hasOwnProperty.call(u,a)&&t(l,u,a);return r(l,u),l};Object.defineProperty(e,"__esModule",{value:!0}),e.v6=e.AddressError=e.Address6=e.Address4=void 0;var s=os();Object.defineProperty(e,"Address4",{enumerable:!0,get:function(){return s.Address4}});var i=Al();Object.defineProperty(e,"Address6",{enumerable:!0,get:function(){return i.Address6}});var o=at();Object.defineProperty(e,"AddressError",{enumerable:!0,get:function(){return o.AddressError}});const c=n(ls());e.v6={helpers:c}}(ve)),ve}var $e=Tl();class ps{host;port;constructor(t){const r=t.lastIndexOf(":"),n=t.slice(0,r),s=t.slice(r+1);if(r===-1||!/^(\d+|\*)$/.test(s))throw new Error(`Invalid host pattern "${t}": a port (or "*") is required`);this.host=n,this.port=s}validate(t,r){return this.matchesHost(t)&&(this.port==="*"||Number(this.port)===r)}matchesHost(t){const r=this.host.toLowerCase();return t=t.toLowerCase(),r==="*"?!0:r==="localhost"?t==="localhost"||kl(t):r==="private"?Ol(t):r.startsWith("*.")?t.endsWith(r.slice(1)):r===t}}function Ol(e){return $e.Address4.isValid(e)&&new $e.Address4(e).isPrivate()}function kl(e){if(e.startsWith("[")&&e.endsWith("]")){const t=e.slice(1,-1);return $e.Address6.isValid(t)&&new $e.Address6(t).isLoopback()}return $e.Address4.isValid(e)&&new $e.Address4(e).isLoopback()||$e.Address6.isValid(e)&&new $e.Address6(e).isLoopback()}const Pl=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var ut={exports:{}},Zt,ms;function Be(){if(ms)return Zt;ms=1;const e="2.0.0",t=256,r=Number.MAX_SAFE_INTEGER||9007199254740991,n=16,s=t-6;return Zt={MAX_LENGTH:t,MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:s,MAX_SAFE_INTEGER:r,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:e,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},Zt}var Dt,gs;function ct(){return gs||(gs=1,Dt=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{}),Dt}var vs;function Fe(){return vs||(vs=1,function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:s}=Be(),i=ct();t=e.exports={};const o=t.re=[],c=t.safeRe=[],u=t.src=[],l=t.safeSrc=[],a=t.t={};let f=0;const h="[a-zA-Z0-9-]",p=[["\\s",1],["\\d",s],[h,n]],$=m=>{for(const[E,y]of p)m=m.split(`${E}*`).join(`${E}{0,${y}}`).split(`${E}+`).join(`${E}{1,${y}}`);return m},_=(m,E,y)=>{const C=$(E),x=f++;i(m,x,E),a[m]=x,u[x]=E,l[x]=C,o[x]=new RegExp(E,y?"g":void 0),c[x]=new RegExp(C,y?"g":void 0)};_("NUMERICIDENTIFIER","0|[1-9]\\d*"),_("NUMERICIDENTIFIERLOOSE","\\d+"),_("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${h}*`),_("MAINVERSION",`(${u[a.NUMERICIDENTIFIER]})\\.(${u[a.NUMERICIDENTIFIER]})\\.(${u[a.NUMERICIDENTIFIER]})`),_("MAINVERSIONLOOSE",`(${u[a.NUMERICIDENTIFIERLOOSE]})\\.(${u[a.NUMERICIDENTIFIERLOOSE]})\\.(${u[a.NUMERICIDENTIFIERLOOSE]})`),_("PRERELEASEIDENTIFIER",`(?:${u[a.NONNUMERICIDENTIFIER]}|${u[a.NUMERICIDENTIFIER]})`),_("PRERELEASEIDENTIFIERLOOSE",`(?:${u[a.NONNUMERICIDENTIFIER]}|${u[a.NUMERICIDENTIFIERLOOSE]})`),_("PRERELEASE",`(?:-(${u[a.PRERELEASEIDENTIFIER]}(?:\\.${u[a.PRERELEASEIDENTIFIER]})*))`),_("PRERELEASELOOSE",`(?:-?(${u[a.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[a.PRERELEASEIDENTIFIERLOOSE]})*))`),_("BUILDIDENTIFIER",`${h}+`),_("BUILD",`(?:\\+(${u[a.BUILDIDENTIFIER]}(?:\\.${u[a.BUILDIDENTIFIER]})*))`),_("FULLPLAIN",`v?${u[a.MAINVERSION]}${u[a.PRERELEASE]}?${u[a.BUILD]}?`),_("FULL",`^${u[a.FULLPLAIN]}$`),_("LOOSEPLAIN",`[v=\\s]*${u[a.MAINVERSIONLOOSE]}${u[a.PRERELEASELOOSE]}?${u[a.BUILD]}?`),_("LOOSE",`^${u[a.LOOSEPLAIN]}$`),_("GTLT","((?:<|>)?=?)"),_("XRANGEIDENTIFIERLOOSE",`${u[a.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),_("XRANGEIDENTIFIER",`${u[a.NUMERICIDENTIFIER]}|x|X|\\*`),_("XRANGEPLAIN",`[v=\\s]*(${u[a.XRANGEIDENTIFIER]})(?:\\.(${u[a.XRANGEIDENTIFIER]})(?:\\.(${u[a.XRANGEIDENTIFIER]})(?:${u[a.PRERELEASE]})?${u[a.BUILD]}?)?)?`),_("XRANGEPLAINLOOSE",`[v=\\s]*(${u[a.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[a.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[a.XRANGEIDENTIFIERLOOSE]})(?:${u[a.PRERELEASELOOSE]})?${u[a.BUILD]}?)?)?`),_("XRANGE",`^${u[a.GTLT]}\\s*${u[a.XRANGEPLAIN]}$`),_("XRANGELOOSE",`^${u[a.GTLT]}\\s*${u[a.XRANGEPLAINLOOSE]}$`),_("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),_("COERCE",`${u[a.COERCEPLAIN]}(?:$|[^\\d])`),_("COERCEFULL",u[a.COERCEPLAIN]+`(?:${u[a.PRERELEASE]})?(?:${u[a.BUILD]})?(?:$|[^\\d])`),_("COERCERTL",u[a.COERCE],!0),_("COERCERTLFULL",u[a.COERCEFULL],!0),_("LONETILDE","(?:~>?)"),_("TILDETRIM",`(\\s*)${u[a.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",_("TILDE",`^${u[a.LONETILDE]}${u[a.XRANGEPLAIN]}$`),_("TILDELOOSE",`^${u[a.LONETILDE]}${u[a.XRANGEPLAINLOOSE]}$`),_("LONECARET","(?:\\^)"),_("CARETTRIM",`(\\s*)${u[a.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",_("CARET",`^${u[a.LONECARET]}${u[a.XRANGEPLAIN]}$`),_("CARETLOOSE",`^${u[a.LONECARET]}${u[a.XRANGEPLAINLOOSE]}$`),_("COMPARATORLOOSE",`^${u[a.GTLT]}\\s*(${u[a.LOOSEPLAIN]})$|^$`),_("COMPARATOR",`^${u[a.GTLT]}\\s*(${u[a.FULLPLAIN]})$|^$`),_("COMPARATORTRIM",`(\\s*)${u[a.GTLT]}\\s*(${u[a.LOOSEPLAIN]}|${u[a.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",_("HYPHENRANGE",`^\\s*(${u[a.XRANGEPLAIN]})\\s+-\\s+(${u[a.XRANGEPLAIN]})\\s*$`),_("HYPHENRANGELOOSE",`^\\s*(${u[a.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[a.XRANGEPLAINLOOSE]})\\s*$`),_("STAR","(<|>)?=?\\s*\\*"),_("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),_("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(ut,ut.exports)),ut.exports}var jt,_s;function xt(){if(_s)return jt;_s=1;const e=Object.freeze({loose:!0}),t=Object.freeze({});return jt=n=>n?typeof n!="object"?e:n:t,jt}var Mt,Es;function bs(){if(Es)return Mt;Es=1;const e=/^[0-9]+$/,t=(n,s)=>{if(typeof n=="number"&&typeof s=="number")return n===s?0:n<s?-1:1;const i=e.test(n),o=e.test(s);return i&&o&&(n=+n,s=+s),n===s?0:i&&!o?-1:o&&!i?1:n<s?-1:1};return Mt={compareIdentifiers:t,rcompareIdentifiers:(n,s)=>t(s,n)},Mt}var Ut,ws;function ne(){if(ws)return Ut;ws=1;const e=ct(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:r}=Be(),{safeRe:n,t:s}=Fe(),i=xt(),{compareIdentifiers:o}=bs(),c=(l,a)=>{const f=a.split(".");if(f.length>l.length)return!1;for(let h=0;h<f.length;h++)if(o(l[h],f[h])!==0)return!1;return!0};class u{constructor(a,f){if(f=i(f),a instanceof u){if(a.loose===!!f.loose&&a.includePrerelease===!!f.includePrerelease)return a;a=a.version}else if(typeof a!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof a}".`);if(a.length>t)throw new TypeError(`version is longer than ${t} characters`);e("SemVer",a,f),this.options=f,this.loose=!!f.loose,this.includePrerelease=!!f.includePrerelease;const h=a.trim().match(f.loose?n[s.LOOSE]:n[s.FULL]);if(!h)throw new TypeError(`Invalid Version: ${a}`);if(this.raw=a,this.major=+h[1],this.minor=+h[2],this.patch=+h[3],this.major>r||this.major<0)throw new TypeError("Invalid major version");if(this.minor>r||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>r||this.patch<0)throw new TypeError("Invalid patch version");h[4]?this.prerelease=h[4].split(".").map(p=>{if(/^[0-9]+$/.test(p)){const $=+p;if($>=0&&$<r)return $}return p}):this.prerelease=[],this.build=h[5]?h[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(a){if(e("SemVer.compare",this.version,this.options,a),!(a instanceof u)){if(typeof a=="string"&&a===this.version)return 0;a=new u(a,this.options)}return a.version===this.version?0:this.compareMain(a)||this.comparePre(a)}compareMain(a){return a instanceof u||(a=new u(a,this.options)),this.major<a.major?-1:this.major>a.major?1:this.minor<a.minor?-1:this.minor>a.minor?1:this.patch<a.patch?-1:this.patch>a.patch?1:0}comparePre(a){if(a instanceof u||(a=new u(a,this.options)),this.prerelease.length&&!a.prerelease.length)return-1;if(!this.prerelease.length&&a.prerelease.length)return 1;if(!this.prerelease.length&&!a.prerelease.length)return 0;let f=0;do{const h=this.prerelease[f],p=a.prerelease[f];if(e("prerelease compare",f,h,p),h===void 0&&p===void 0)return 0;if(p===void 0)return 1;if(h===void 0)return-1;if(h===p)continue;return o(h,p)}while(++f)}compareBuild(a){a instanceof u||(a=new u(a,this.options));let f=0;do{const h=this.build[f],p=a.build[f];if(e("build compare",f,h,p),h===void 0&&p===void 0)return 0;if(p===void 0)return 1;if(h===void 0)return-1;if(h===p)continue;return o(h,p)}while(++f)}inc(a,f,h){if(a.startsWith("pre")){if(!f&&h===!1)throw new Error("invalid increment argument: identifier is empty");if(f){const p=`-${f}`.match(this.options.loose?n[s.PRERELEASELOOSE]:n[s.PRERELEASE]);if(!p||p[1]!==f)throw new Error(`invalid identifier: ${f}`)}}switch(a){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",f,h);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",f,h);break;case"prepatch":this.prerelease.length=0,this.inc("patch",f,h),this.inc("pre",f,h);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",f,h),this.inc("pre",f,h);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const p=Number(h)?1:0;if(this.prerelease.length===0)this.prerelease=[p];else{let $=this.prerelease.length;for(;--$>=0;)typeof this.prerelease[$]=="number"&&(this.prerelease[$]++,$=-2);if($===-1){if(f===this.prerelease.join(".")&&h===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(p)}}if(f){let $=[f,p];if(h===!1&&($=[f]),c(this.prerelease,f)){const _=this.prerelease[f.split(".").length];isNaN(_)&&(this.prerelease=$)}else this.prerelease=$}break}default:throw new Error(`invalid increment argument: ${a}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return Ut=u,Ut}var Bt,Ss;function ke(){if(Ss)return Bt;Ss=1;const e=ne();return Bt=(r,n,s=!1)=>{if(r instanceof e)return r;try{return new e(r,n)}catch(i){if(!s)return null;throw i}},Bt}var Ft,Is;function Cl(){if(Is)return Ft;Is=1;const e=ke();return Ft=(r,n)=>{const s=e(r,n);return s?s.version:null},Ft}var qt,$s;function Nl(){if($s)return qt;$s=1;const e=ke();return qt=(r,n)=>{const s=e(r.trim().replace(/^[=v]+/,""),n);return s?s.version:null},qt}var Gt,ys;function Ll(){if(ys)return Gt;ys=1;const e=ne();return Gt=(r,n,s,i,o)=>{typeof s=="string"&&(o=i,i=s,s=void 0);try{return new e(r instanceof e?r.version:r,s).inc(n,i,o).version}catch{return null}},Gt}var Vt,Rs;function zl(){if(Rs)return Vt;Rs=1;const e=ke();return Vt=(r,n)=>{const s=e(r,null,!0),i=e(n,null,!0),o=s.compare(i);if(o===0)return null;const c=o>0,u=c?s:i,l=c?i:s,a=!!u.prerelease.length;if(!!l.prerelease.length&&!a){if(!l.patch&&!l.minor)return"major";if(l.compareMain(u)===0)return l.minor&&!l.patch?"minor":"patch"}const h=a?"pre":"";return s.major!==i.major?h+"major":s.minor!==i.minor?h+"minor":s.patch!==i.patch?h+"patch":"prerelease"},Vt}var Wt,As;function Zl(){if(As)return Wt;As=1;const e=ne();return Wt=(r,n)=>new e(r,n).major,Wt}var Ht,Ts;function Dl(){if(Ts)return Ht;Ts=1;const e=ne();return Ht=(r,n)=>new e(r,n).minor,Ht}var Xt,Os;function jl(){if(Os)return Xt;Os=1;const e=ne();return Xt=(r,n)=>new e(r,n).patch,Xt}var Kt,ks;function xl(){if(ks)return Kt;ks=1;const e=ke();return Kt=(r,n)=>{const s=e(r,n);return s&&s.prerelease.length?s.prerelease:null},Kt}var Yt,Ps;function fe(){if(Ps)return Yt;Ps=1;const e=ne();return Yt=(r,n,s)=>new e(r,s).compare(new e(n,s)),Yt}var Jt,Cs;function Ml(){if(Cs)return Jt;Cs=1;const e=fe();return Jt=(r,n,s)=>e(n,r,s),Jt}var Qt,Ns;function Ul(){if(Ns)return Qt;Ns=1;const e=fe();return Qt=(r,n)=>e(r,n,!0),Qt}var er,Ls;function tr(){if(Ls)return er;Ls=1;const e=ne();return er=(r,n,s)=>{const i=new e(r,s),o=new e(n,s);return i.compare(o)||i.compareBuild(o)},er}var rr,zs;function Bl(){if(zs)return rr;zs=1;const e=tr();return rr=(r,n)=>r.sort((s,i)=>e(s,i,n)),rr}var nr,Zs;function Fl(){if(Zs)return nr;Zs=1;const e=tr();return nr=(r,n)=>r.sort((s,i)=>e(i,s,n)),nr}var sr,Ds;function lt(){if(Ds)return sr;Ds=1;const e=fe();return sr=(r,n,s)=>e(r,n,s)>0,sr}var ir,js;function or(){if(js)return ir;js=1;const e=fe();return ir=(r,n,s)=>e(r,n,s)<0,ir}var ar,xs;function Ms(){if(xs)return ar;xs=1;const e=fe();return ar=(r,n,s)=>e(r,n,s)===0,ar}var ur,Us;function Bs(){if(Us)return ur;Us=1;const e=fe();return ur=(r,n,s)=>e(r,n,s)!==0,ur}var cr,Fs;function lr(){if(Fs)return cr;Fs=1;const e=fe();return cr=(r,n,s)=>e(r,n,s)>=0,cr}var fr,qs;function hr(){if(qs)return fr;qs=1;const e=fe();return fr=(r,n,s)=>e(r,n,s)<=0,fr}var dr,Gs;function Vs(){if(Gs)return dr;Gs=1;const e=Ms(),t=Bs(),r=lt(),n=lr(),s=or(),i=hr();return dr=(c,u,l,a)=>{switch(u){case"===":return typeof c=="object"&&(c=c.version),typeof l=="object"&&(l=l.version),c===l;case"!==":return typeof c=="object"&&(c=c.version),typeof l=="object"&&(l=l.version),c!==l;case"":case"=":case"==":return e(c,l,a);case"!=":return t(c,l,a);case">":return r(c,l,a);case">=":return n(c,l,a);case"<":return s(c,l,a);case"<=":return i(c,l,a);default:throw new TypeError(`Invalid operator: ${u}`)}},dr}var pr,Ws;function ql(){if(Ws)return pr;Ws=1;const e=ne(),t=ke(),{safeRe:r,t:n}=Fe();return pr=(i,o)=>{if(i instanceof e)return i;if(typeof i=="number"&&(i=String(i)),typeof i!="string")return null;o=o||{};let c=null;if(!o.rtl)c=i.match(o.includePrerelease?r[n.COERCEFULL]:r[n.COERCE]);else{const p=o.includePrerelease?r[n.COERCERTLFULL]:r[n.COERCERTL];let $;for(;($=p.exec(i))&&(!c||c.index+c[0].length!==i.length);)(!c||$.index+$[0].length!==c.index+c[0].length)&&(c=$),p.lastIndex=$.index+$[1].length+$[2].length;p.lastIndex=-1}if(c===null)return null;const u=c[2],l=c[3]||"0",a=c[4]||"0",f=o.includePrerelease&&c[5]?`-${c[5]}`:"",h=o.includePrerelease&&c[6]?`+${c[6]}`:"";return t(`${u}.${l}.${a}${f}${h}`,o)},pr}var mr,Hs;function Gl(){if(Hs)return mr;Hs=1;const e=ke(),t=Be(),r=ne(),n=(c,u,l)=>{if(!t.RELEASE_TYPES.includes(u))return null;const a=s(c,l);return a&&i(a,u)},s=(c,u)=>{const l=c instanceof r?c.version:c;return e(l,u)},i=(c,u)=>{if(o(u))return c.version;switch(c.prerelease=[],u){case"major":c.minor=0,c.patch=0;break;case"minor":c.patch=0;break}return c.format()},o=c=>c.startsWith("pre");return mr=n,mr}var gr,Xs;function Vl(){if(Xs)return gr;Xs=1;class e{constructor(){this.max=1e3,this.map=new Map}get(r){const n=this.map.get(r);if(n!==void 0)return this.map.delete(r),this.map.set(r,n),n}delete(r){return this.map.delete(r)}set(r,n){if(!this.delete(r)&&n!==void 0){if(this.map.size>=this.max){const i=this.map.keys().next().value;this.delete(i)}this.map.set(r,n)}return this}}return gr=e,gr}var vr,Ks;function he(){if(Ks)return vr;Ks=1;const e=/\s+/g;class t{constructor(I,T){if(T=s(T),I instanceof t)return I.loose===!!T.loose&&I.includePrerelease===!!T.includePrerelease?I:new t(I.raw,T);if(I instanceof i)return this.raw=I.value,this.set=[[I]],this.formatted=void 0,this;if(this.options=T,this.loose=!!T.loose,this.includePrerelease=!!T.includePrerelease,this.raw=I.trim().replace(e," "),this.set=this.raw.split("||").map(R=>this.parseRange(R.trim())).filter(R=>R.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const R=this.set[0];if(this.set=this.set.filter(Z=>!E(Z[0])),this.set.length===0)this.set=[R];else if(this.set.length>1){for(const Z of this.set)if(Z.length===1&&y(Z[0])){this.set=[Z];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let I=0;I<this.set.length;I++){I>0&&(this.formatted+="||");const T=this.set[I];for(let R=0;R<T.length;R++)R>0&&(this.formatted+=" "),this.formatted+=T[R].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(I){I=I.replace(m,"");const R=((this.options.includePrerelease&&$)|(this.options.loose&&_))+":"+I,Z=n.get(R);if(Z)return Z;const O=this.options.loose,P=O?u[a.HYPHENRANGELOOSE]:u[a.HYPHENRANGE];I=I.replace(P,D(this.options.includePrerelease)),o("hyphen replace",I),I=I.replace(u[a.COMPARATORTRIM],f),o("comparator trim",I),I=I.replace(u[a.TILDETRIM],h),o("tilde trim",I),I=I.replace(u[a.CARETTRIM],p),o("caret trim",I);let B=I.split(" ").map(ee=>x(ee,this.options)).join(" ").split(/\s+/).map(ee=>k(ee,this.options));O&&(B=B.filter(ee=>(o("loose invalid filter",ee,this.options),!!ee.match(u[a.COMPARATORLOOSE])))),o("range list",B);const M=new Map,F=B.map(ee=>new i(ee,this.options));for(const ee of F){if(E(ee))return[ee];M.set(ee.value,ee)}M.size>1&&M.has("")&&M.delete("");const oe=[...M.values()];return n.set(R,oe),oe}intersects(I,T){if(!(I instanceof t))throw new TypeError("a Range is required");return this.set.some(R=>C(R,T)&&I.set.some(Z=>C(Z,T)&&R.every(O=>Z.every(P=>O.intersects(P,T)))))}test(I){if(!I)return!1;if(typeof I=="string")try{I=new c(I,this.options)}catch{return!1}for(let T=0;T<this.set.length;T++)if(j(this.set[T],I,this.options))return!0;return!1}}vr=t;const r=Vl(),n=new r,s=xt(),i=ft(),o=ct(),c=ne(),{safeRe:u,src:l,t:a,comparatorTrimReplace:f,tildeTrimReplace:h,caretTrimReplace:p}=Fe(),{FLAG_INCLUDE_PRERELEASE:$,FLAG_LOOSE:_}=Be(),m=new RegExp(l[a.BUILD],"g"),E=S=>S.value==="<0.0.0-0",y=S=>S.value==="",C=(S,I)=>{let T=!0;const R=S.slice();let Z=R.pop();for(;T&&R.length;)T=R.every(O=>Z.intersects(O,I)),Z=R.pop();return T},x=(S,I)=>(S=S.replace(u[a.BUILD],""),o("comp",S,I),S=L(S,I),o("caret",S),S=Q(S,I),o("tildes",S),S=v(S,I),o("xrange",S),S=w(S,I),o("stars",S),S),N=S=>!S||S.toLowerCase()==="x"||S==="*",U=(S,I,T)=>N(S)&&!N(I)||N(I)&&T&&!N(T),Q=(S,I)=>S.trim().split(/\s+/).map(T=>z(T,I)).join(" "),z=(S,I)=>{const T=I.loose?u[a.TILDELOOSE]:u[a.TILDE],R=I.includePrerelease?"-0":"";return S.replace(T,(Z,O,P,B,M)=>{o("tilde",S,Z,O,P,B,M);let F;return N(O)?F="":N(P)?F=`>=${O}.0.0${R} <${+O+1}.0.0-0`:N(B)?F=`>=${O}.${P}.0${R} <${O}.${+P+1}.0-0`:M?(o("replaceTilde pr",M),F=`>=${O}.${P}.${B}-${M} <${O}.${+P+1}.0-0`):F=`>=${O}.${P}.${B} <${O}.${+P+1}.0-0`,o("tilde return",F),F})},L=(S,I)=>S.trim().split(/\s+/).map(T=>d(T,I)).join(" "),d=(S,I)=>{o("caret",S,I);const T=I.loose?u[a.CARETLOOSE]:u[a.CARET],R=I.includePrerelease?"-0":"";return S.replace(T,(Z,O,P,B,M)=>{o("caret",S,Z,O,P,B,M);let F;return N(O)?F="":N(P)?F=`>=${O}.0.0${R} <${+O+1}.0.0-0`:N(B)?O==="0"?F=`>=${O}.${P}.0${R} <${O}.${+P+1}.0-0`:F=`>=${O}.${P}.0${R} <${+O+1}.0.0-0`:M?(o("replaceCaret pr",M),O==="0"?P==="0"?F=`>=${O}.${P}.${B}-${M} <${O}.${P}.${+B+1}-0`:F=`>=${O}.${P}.${B}-${M} <${O}.${+P+1}.0-0`:F=`>=${O}.${P}.${B}-${M} <${+O+1}.0.0-0`):(o("no pr"),O==="0"?P==="0"?F=`>=${O}.${P}.${B} <${O}.${P}.${+B+1}-0`:F=`>=${O}.${P}.${B} <${O}.${+P+1}.0-0`:F=`>=${O}.${P}.${B} <${+O+1}.0.0-0`),o("caret return",F),F})},v=(S,I)=>(o("replaceXRanges",S,I),S.split(/\s+/).map(T=>b(T,I)).join(" ")),b=(S,I)=>{S=S.trim();const T=I.loose?u[a.XRANGELOOSE]:u[a.XRANGE];return S.replace(T,(R,Z,O,P,B,M)=>{if(o("xRange",S,R,Z,O,P,B,M),U(O,P,B))return S;const F=N(O),oe=F||N(P),ee=oe||N(B),qe=ee;return Z==="="&&qe&&(Z=""),M=I.includePrerelease?"-0":"",F?Z===">"||Z==="<"?R="<0.0.0-0":R="*":Z&&qe?(oe&&(P=0),B=0,Z===">"?(Z=">=",oe?(O=+O+1,P=0,B=0):(P=+P+1,B=0)):Z==="<="&&(Z="<",oe?O=+O+1:P=+P+1),Z==="<"&&(M="-0"),R=`${Z+O}.${P}.${B}${M}`):oe?R=`>=${O}.0.0${M} <${+O+1}.0.0-0`:ee&&(R=`>=${O}.${P}.0${M} <${O}.${+P+1}.0-0`),o("xRange return",R),R})},w=(S,I)=>(o("replaceStars",S,I),S.trim().replace(u[a.STAR],"")),k=(S,I)=>(o("replaceGTE0",S,I),S.trim().replace(u[I.includePrerelease?a.GTE0PRE:a.GTE0],"")),D=S=>(I,T,R,Z,O,P,B,M,F,oe,ee,qe)=>(N(R)?T="":N(Z)?T=`>=${R}.0.0${S?"-0":""}`:N(O)?T=`>=${R}.${Z}.0${S?"-0":""}`:P?T=`>=${T}`:T=`>=${T}${S?"-0":""}`,N(F)?M="":N(oe)?M=`<${+F+1}.0.0-0`:N(ee)?M=`<${F}.${+oe+1}.0-0`:qe?M=`<=${F}.${oe}.${ee}-${qe}`:S?M=`<${F}.${oe}.${+ee+1}-0`:M=`<=${M}`,`${T} ${M}`.trim()),j=(S,I,T)=>{for(let R=0;R<S.length;R++)if(!S[R].test(I))return!1;if(I.prerelease.length&&!T.includePrerelease){for(let R=0;R<S.length;R++)if(o(S[R].semver),S[R].semver!==i.ANY&&S[R].semver.prerelease.length>0){const Z=S[R].semver;if(Z.major===I.major&&Z.minor===I.minor&&Z.patch===I.patch)return!0}return!1}return!0};return vr}var _r,Ys;function ft(){if(Ys)return _r;Ys=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(a,f){if(f=r(f),a instanceof t){if(a.loose===!!f.loose)return a;a=a.value}a=a.trim().split(/\s+/).join(" "),o("comparator",a,f),this.options=f,this.loose=!!f.loose,this.parse(a),this.semver===e?this.value="":this.value=this.operator+this.semver.version,o("comp",this)}parse(a){const f=this.options.loose?n[s.COMPARATORLOOSE]:n[s.COMPARATOR],h=a.match(f);if(!h)throw new TypeError(`Invalid comparator: ${a}`);this.operator=h[1]!==void 0?h[1]:"",this.operator==="="&&(this.operator=""),h[2]?this.semver=new c(h[2],this.options.loose):this.semver=e}toString(){return this.value}test(a){if(o("Comparator.test",a,this.options.loose),this.semver===e||a===e)return!0;if(typeof a=="string")try{a=new c(a,this.options)}catch{return!1}return i(a,this.operator,this.semver,this.options)}intersects(a,f){if(!(a instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new u(a.value,f).test(this.value):a.operator===""?a.value===""?!0:new u(this.value,f).test(a.semver):(f=r(f),f.includePrerelease&&(this.value==="<0.0.0-0"||a.value==="<0.0.0-0")||!f.includePrerelease&&(this.value.startsWith("<0.0.0")||a.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&a.operator.startsWith(">")||this.operator.startsWith("<")&&a.operator.startsWith("<")||this.semver.version===a.semver.version&&this.operator.includes("=")&&a.operator.includes("=")||i(this.semver,"<",a.semver,f)&&this.operator.startsWith(">")&&a.operator.startsWith("<")||i(this.semver,">",a.semver,f)&&this.operator.startsWith("<")&&a.operator.startsWith(">")))}}_r=t;const r=xt(),{safeRe:n,t:s}=Fe(),i=Vs(),o=ct(),c=ne(),u=he();return _r}var Er,Js;function ht(){if(Js)return Er;Js=1;const e=he();return Er=(r,n,s)=>{try{n=new e(n,s)}catch{return!1}return n.test(r)},Er}var br,Qs;function Wl(){if(Qs)return br;Qs=1;const e=he();return br=(r,n)=>new e(r,n).set.map(s=>s.map(i=>i.value).join(" ").trim().split(" ")),br}var wr,ei;function Hl(){if(ei)return wr;ei=1;const e=ne(),t=he();return wr=(n,s,i)=>{let o=null,c=null,u=null;try{u=new t(s,i)}catch{return null}return n.forEach(l=>{u.test(l)&&(!o||c.compare(l)===-1)&&(o=l,c=new e(o,i))}),o},wr}var Sr,ti;function Xl(){if(ti)return Sr;ti=1;const e=ne(),t=he();return Sr=(n,s,i)=>{let o=null,c=null,u=null;try{u=new t(s,i)}catch{return null}return n.forEach(l=>{u.test(l)&&(!o||c.compare(l)===1)&&(o=l,c=new e(o,i))}),o},Sr}var Ir,ri;function Kl(){if(ri)return Ir;ri=1;const e=ne(),t=he(),r=lt();return Ir=(s,i)=>{s=new t(s,i);let o=new e("0.0.0");if(s.test(o)||(o=new e("0.0.0-0"),s.test(o)))return o;o=null;for(let c=0;c<s.set.length;++c){const u=s.set[c];let l=null;u.forEach(a=>{const f=new e(a.semver.version);switch(a.operator){case">":f.prerelease.length===0?f.patch++:f.prerelease.push(0),f.raw=f.format();case"":case">=":(!l||r(f,l))&&(l=f);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${a.operator}`)}}),l&&(!o||r(o,l))&&(o=l)}return o&&s.test(o)?o:null},Ir}var $r,ni;function Yl(){if(ni)return $r;ni=1;const e=he();return $r=(r,n)=>{try{return new e(r,n).range||"*"}catch{return null}},$r}var yr,si;function Rr(){if(si)return yr;si=1;const e=ne(),t=ft(),{ANY:r}=t,n=he(),s=ht(),i=lt(),o=or(),c=hr(),u=lr();return yr=(a,f,h,p)=>{a=new e(a,p),f=new n(f,p);let $,_,m,E,y;switch(h){case">":$=i,_=c,m=o,E=">",y=">=";break;case"<":$=o,_=u,m=i,E="<",y="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(s(a,f,p))return!1;for(let C=0;C<f.set.length;++C){const x=f.set[C];let N=null,U=null;if(x.forEach(Q=>{Q.semver===r&&(Q=new t(">=0.0.0")),N=N||Q,U=U||Q,$(Q.semver,N.semver,p)?N=Q:m(Q.semver,U.semver,p)&&(U=Q)}),N.operator===E||N.operator===y||(!U.operator||U.operator===E)&&_(a,U.semver))return!1;if(U.operator===y&&m(a,U.semver))return!1}return!0},yr}var Ar,ii;function Jl(){if(ii)return Ar;ii=1;const e=Rr();return Ar=(r,n,s)=>e(r,n,">",s),Ar}var Tr,oi;function Ql(){if(oi)return Tr;oi=1;const e=Rr();return Tr=(r,n,s)=>e(r,n,"<",s),Tr}var Or,ai;function ef(){if(ai)return Or;ai=1;const e=he();return Or=(r,n,s)=>(r=new e(r,s),n=new e(n,s),r.intersects(n,s)),Or}var kr,ui;function tf(){if(ui)return kr;ui=1;const e=ht(),t=fe();return kr=(r,n,s)=>{const i=[];let o=null,c=null;const u=r.sort((h,p)=>t(h,p,s));for(const h of u)e(h,n,s)?(c=h,o||(o=h)):(c&&i.push([o,c]),c=null,o=null);o&&i.push([o,null]);const l=[];for(const[h,p]of i)h===p?l.push(h):!p&&h===u[0]?l.push("*"):p?h===u[0]?l.push(`<=${p}`):l.push(`${h} - ${p}`):l.push(`>=${h}`);const a=l.join(" || "),f=typeof n.raw=="string"?n.raw:String(n);return a.length<f.length?a:n},kr}var Pr,ci;function rf(){if(ci)return Pr;ci=1;const e=he(),t=ft(),{ANY:r}=t,n=ht(),s=fe(),i=(f,h,p={})=>{if(f===h)return!0;f=new e(f,p),h=new e(h,p);let $=!1;e:for(const _ of f.set){for(const m of h.set){const E=u(_,m,p);if($=$||E!==null,E)continue e}if($)return!1}return!0},o=[new t(">=0.0.0-0")],c=[new t(">=0.0.0")],u=(f,h,p)=>{if(f===h)return!0;if(f.length===1&&f[0].semver===r){if(h.length===1&&h[0].semver===r)return!0;p.includePrerelease?f=o:f=c}if(h.length===1&&h[0].semver===r){if(p.includePrerelease)return!0;h=c}const $=new Set;let _,m;for(const z of f)z.operator===">"||z.operator===">="?_=l(_,z,p):z.operator==="<"||z.operator==="<="?m=a(m,z,p):$.add(z.semver);if($.size>1)return null;let E;if(_&&m){if(E=s(_.semver,m.semver,p),E>0)return null;if(E===0&&(_.operator!==">="||m.operator!=="<="))return null}for(const z of $){if(_&&!n(z,String(_),p)||m&&!n(z,String(m),p))return null;for(const L of h)if(!n(z,String(L),p))return!1;return!0}let y,C,x,N,U=m&&!p.includePrerelease&&m.semver.prerelease.length?m.semver:!1,Q=_&&!p.includePrerelease&&_.semver.prerelease.length?_.semver:!1;U&&U.prerelease.length===1&&m.operator==="<"&&U.prerelease[0]===0&&(U=!1);for(const z of h){if(N=N||z.operator===">"||z.operator===">=",x=x||z.operator==="<"||z.operator==="<=",_){if(Q&&z.semver.prerelease&&z.semver.prerelease.length&&z.semver.major===Q.major&&z.semver.minor===Q.minor&&z.semver.patch===Q.patch&&(Q=!1),z.operator===">"||z.operator===">="){if(y=l(_,z,p),y===z&&y!==_)return!1}else if(_.operator===">="&&!z.test(_.semver))return!1}if(m){if(U&&z.semver.prerelease&&z.semver.prerelease.length&&z.semver.major===U.major&&z.semver.minor===U.minor&&z.semver.patch===U.patch&&(U=!1),z.operator==="<"||z.operator==="<="){if(C=a(m,z,p),C===z&&C!==m)return!1}else if(m.operator==="<="&&!z.test(m.semver))return!1}if(!z.operator&&(m||_)&&E!==0)return!1}return!(_&&x&&!m&&E!==0||m&&N&&!_&&E!==0||Q||U)},l=(f,h,p)=>{if(!f)return h;const $=s(f.semver,h.semver,p);return $>0?f:$<0||h.operator===">"&&f.operator===">="?h:f},a=(f,h,p)=>{if(!f)return h;const $=s(f.semver,h.semver,p);return $<0?f:$>0||h.operator==="<"&&f.operator==="<="?h:f};return Pr=i,Pr}var Cr,li;function nf(){if(li)return Cr;li=1;const e=Fe(),t=Be(),r=ne(),n=bs(),s=ke(),i=Cl(),o=Nl(),c=Ll(),u=zl(),l=Zl(),a=Dl(),f=jl(),h=xl(),p=fe(),$=Ml(),_=Ul(),m=tr(),E=Bl(),y=Fl(),C=lt(),x=or(),N=Ms(),U=Bs(),Q=lr(),z=hr(),L=Vs(),d=ql(),v=Gl(),b=ft(),w=he(),k=ht(),D=Wl(),j=Hl(),S=Xl(),I=Kl(),T=Yl(),R=Rr(),Z=Jl(),O=Ql(),P=ef(),B=tf(),M=rf();return Cr={parse:s,valid:i,clean:o,inc:c,diff:u,major:l,minor:a,patch:f,prerelease:h,compare:p,rcompare:$,compareLoose:_,compareBuild:m,sort:E,rsort:y,gt:C,lt:x,eq:N,neq:U,gte:Q,lte:z,cmp:L,coerce:d,truncate:v,Comparator:b,Range:w,satisfies:k,toComparators:D,maxSatisfying:j,minSatisfying:S,minVersion:I,validRange:T,outside:R,gtr:Z,ltr:O,intersects:P,simplifyRange:B,subset:M,SemVer:r,re:e.re,src:e.src,tokens:e.t,SEMVER_SPEC_VERSION:t.SEMVER_SPEC_VERSION,RELEASE_TYPES:t.RELEASE_TYPES,compareIdentifiers:n.compareIdentifiers,rcompareIdentifiers:n.rcompareIdentifiers},Cr}var sf=nf();const Nr=yl(sf),fi=Se(te().min(1)).refine(e=>new Set(e).size===e.length,{message:"Array items must be unique"});function hi(e){const t=e({type:G("string")}),r=e({type:G("number"),integer:G(!0).optional(),min:re().optional(),max:re().optional()}),n=e({type:G("boolean")}),s=e({type:G("option"),options:fi}),i=de([t,r,n,s]),o=(E,y)=>y?E.optional():E,c=E=>e({type:G("string"),default:o(te(),!E.defaultRequired)}),u=E=>e({type:G("number"),integer:Ze().optional(),min:re().optional(),max:re().optional(),default:o(re(),!E.defaultRequired)}),l=E=>e({type:G("boolean"),default:o(Ze(),!E.defaultRequired)}),a=E=>e({type:G("option"),options:fi.optional(),default:o(te(),!E.defaultRequired)}),f=E=>de([c(E),u(E),l(E),a(E)]),h=e({name:te().min(1),value:f({defaultRequired:!1})}),p=e({name:te().min(1),value:i.optional()}),$=e({name:te().min(1),value:f({defaultRequired:!0}),writableFromCogs:G(!0).optional(),writableFromClient:G(!0).optional()}),_=E=>{try{return new ps(E),!0}catch{return!1}};return e({version:de([rt([ge()]),rt([ge(),G("."),ge()]),rt([ge(),G("."),ge(),G("."),ge()])]),name:te(),minCogsVersion:rt([ge(),G("."),ge(),G("."),ge()]).optional(),description:te().optional(),icon:te().optional(),indexPath:te().optional(),window:q({width:re().gt(0).int(),height:re().gt(0).int(),visible:Ze().optional()}).optional(),config:Se(h).optional(),events:q({fromCogs:Se(p).optional(),toCogs:Se(p).optional()}).optional(),state:Se($).optional(),media:q({audio:G(!0).optional(),video:G(!0).optional(),images:G(!0).optional()}).optional(),store:q({items:Zn(te(),e({persistValue:Ze().optional()})).optional()}).optional(),permissions:At({network:At({access:Se(e({hosts:Se(te().refine(_,{error:"Invalid network host pattern"})).min(1),caCertificate:te().optional()})).optional()}).optional()}).optional()}).refine(E=>!!(!E.permissions?.network?.access||E.minCogsVersion&&Nr.gte(E.minCogsVersion,"5.11.0")),{path:["permissions","network","access"],message:"minCogsVersion must be at least 5.11.0"})}const of=hi(q),af=hi(At);function uf(e){let t=of;typeof e=="object"&&e.minCogsVersion&&Nr.valid(e.minCogsVersion)&&Nr.gte(e.minCogsVersion,"5.11.0")&&(t=af);const r=t.safeParse(e);return r.success?null:r.error.issues.map(n=>`${n.path.join(".")||"root"}: ${n.message}`)}H.CogsConfigChangedEvent=Ur,H.CogsConnection=ki,H.CogsConnectionCloseEvent=xr,H.CogsConnectionOpenEvent=jr,H.CogsIncomingEvent=Fr,H.CogsMediaConfigChangedEvent=qr,H.CogsMessageEvent=Mr,H.CogsShowPhaseChangedEvent=Gr,H.CogsStateChangedEvent=Br,H.DataStoreItemEvent=pt,H.DataStoreItemsEvent=mt,H.ManifestTypes=Pl,H.MediaPreloader=es,H.MediaSchema=hl,H.NetworkHostPattern=ps,H.SurfaceManager=$l,H.assetUrl=Dr,H.getPluginManifestErrors=uf,H.getStateAtTime=st,H.preloadUrl=wi,Object.defineProperty(H,Symbol.toStringTag,{value:"Module"})});
@@ -34,23 +34,23 @@ function createManifestSchema(objectSchemaFactory) {
34
34
  };
35
35
  const cogsValueTypeStringWithDefaultSchema = (options) => objectSchemaFactory({
36
36
  type: z.literal('string'),
37
- default: makeOptionalWhen(z.string(), options.defaultRequired),
37
+ default: makeOptionalWhen(z.string(), !options.defaultRequired),
38
38
  });
39
39
  const cogsValueTypeNumberWithDefaultSchema = (options) => objectSchemaFactory({
40
40
  type: z.literal('number'),
41
41
  integer: z.boolean().optional(),
42
42
  min: z.number().optional(),
43
43
  max: z.number().optional(),
44
- default: makeOptionalWhen(z.number(), options.defaultRequired),
44
+ default: makeOptionalWhen(z.number(), !options.defaultRequired),
45
45
  });
46
46
  const cogsValueTypeBooleanWithDefaultSchema = (options) => objectSchemaFactory({
47
47
  type: z.literal('boolean'),
48
- default: makeOptionalWhen(z.boolean(), options.defaultRequired),
48
+ default: makeOptionalWhen(z.boolean(), !options.defaultRequired),
49
49
  });
50
50
  const cogsValueTypeOptionWithDefaultSchema = (options) => objectSchemaFactory({
51
51
  type: z.literal('option'),
52
52
  options: uniqueStringArraySchema.optional(),
53
- default: makeOptionalWhen(z.string(), options.defaultRequired),
53
+ default: makeOptionalWhen(z.string(), !options.defaultRequired),
54
54
  });
55
55
  const pluginCogsValueTypeWithDefaultJsonSchema = (options) => z.union([
56
56
  cogsValueTypeStringWithDefaultSchema(options),
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Connect to COGS to build a custom Media Master",
4
4
  "author": "Clockwork Dog <info@clockwork.dog>",
5
5
  "homepage": "https://github.com/clockwork-dog/cogs-sdk/tree/main/packages/javascript",
6
- "version": "3.1.1",
6
+ "version": "3.1.2",
7
7
  "keywords": [],
8
8
  "license": "MIT",
9
9
  "repository": {
@@ -37,7 +37,7 @@
37
37
  "cy:generate": "cypress run --e2e"
38
38
  },
39
39
  "dependencies": {
40
- "@clockworkdog/timesync": "^3.1.1",
40
+ "@clockworkdog/timesync": "^3.1.2",
41
41
  "ip-address": "^10.2.0",
42
42
  "reconnecting-websocket": "^4.4.0",
43
43
  "semver": "^7.8.5",