@womp/mcp-ui 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +11 -2
- package/dist/print/index.html +223 -0
- package/package.json +4 -3
- package/src/print/index.html +149 -0
- package/src/print/main.ts +108 -0
package/dist/index.js
CHANGED
|
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
8
8
|
exports.APP_MIME_TYPE = "text/html;profile=mcp-app";
|
|
9
9
|
|
|
10
10
|
/** Version-stamped so a host's per-connector resource cache cannot serve a stale card. */
|
|
11
|
-
exports.IMAGE_APP_URI = "ui://womp/image-0.1.
|
|
11
|
+
exports.IMAGE_APP_URI = "ui://womp/image-0.1.3.html";
|
|
12
12
|
|
|
13
13
|
/** Goes in the resource's `_meta.ui.csp`. */
|
|
14
14
|
exports.IMAGE_APP_CSP = {"resourceDomains":["https://media.womp.com"]};
|
|
@@ -17,10 +17,19 @@ exports.IMAGE_APP_CSP = {"resourceDomains":["https://media.womp.com"]};
|
|
|
17
17
|
exports.IMAGE_APP_HTML = "<!doctype html>\n<html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\" />\n <title>Womp generation</title>\n <style>\n /* Every var() carries a fallback on purpose: host style variables arrive\n over the bridge (onhostcontextchanged), NOT as CSS custom properties on\n this document, so there is nothing to read until the handshake lands.\n The card has to look right in that window too.\n\n Names come from McpUiStyleVariableKeySchema — that is the whole set a\n host may send, so anything outside it will never resolve. */\n :root {\n color-scheme: light dark;\n }\n body {\n margin: 0;\n font-family: var(--font-sans, system-ui, -apple-system, \"Segoe UI\", sans-serif);\n color: var(--color-text-primary, #e8e8e8);\n }\n\n .card {\n position: relative;\n /* The host hands us the full message width, which turns a generated\n image into a wall. swan-frontend's generation tile is compact and\n left-aligned; this matches it. The iframe stays full width — only the\n card is capped — and auto-resize reports the shorter height, so the\n surrounding chat closes up too. */\n max-width: 360px;\n border-radius: var(--border-radius-lg, 14px);\n overflow: hidden;\n background: var(--color-background-secondary, #1b1b1d);\n border: 1px solid var(--color-border-primary, rgba(255, 255, 255, 0.08));\n }\n\n .hero {\n display: block;\n width: 100%;\n height: auto;\n /* Guard against a tall portrait generation dominating the transcript.\n Cropping is acceptable here because Expand and Open full size both\n reach the uncropped original. */\n max-height: 360px;\n object-fit: cover;\n }\n .skeleton {\n height: 240px;\n background: var(--color-background-tertiary, #2a2a2e);\n }\n /* Only animates while a generation is in flight, so a settled card does\n not look busy. */\n .skeleton.pulsing {\n background: linear-gradient(90deg, #2a2a2e, #37373d, #2a2a2e);\n background-size: 200% 100%;\n animation: sweep 1.4s ease-in-out infinite;\n }\n @keyframes sweep {\n 0% { background-position: 200% 0; }\n 100% { background-position: -200% 0; }\n }\n @media (prefers-reduced-motion: reduce) {\n .skeleton.pulsing { animation: none; }\n }\n\n .actions {\n position: absolute;\n bottom: 10px;\n left: 50%;\n transform: translateX(-50%);\n display: flex;\n gap: 2px;\n padding: 3px;\n border-radius: var(--border-radius-full, 999px);\n background: rgba(0, 0, 0, 0.55);\n backdrop-filter: blur(8px);\n box-shadow: var(--shadow-md, 0 4px 16px rgba(0, 0, 0, 0.3));\n /* Revealed on hover on pointer devices; always visible on touch, where\n there is no hover to reveal them with. */\n opacity: 0;\n transition: opacity 120ms ease;\n }\n .card:hover .actions,\n .card:focus-within .actions {\n opacity: 1;\n }\n @media (hover: none) {\n .actions { opacity: 1; }\n }\n .actions[hidden] { display: none; }\n\n .btn {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n border: 0;\n cursor: pointer;\n color: #fff;\n background: transparent;\n font: inherit;\n font-size: var(--font-text-xs-size, 12px);\n padding: 6px 10px;\n border-radius: var(--border-radius-full, 999px);\n }\n .btn:hover { background: rgba(255, 255, 255, 0.14); }\n .btn:focus-visible { outline: 2px solid var(--color-ring-primary, #7aa2ff); outline-offset: 1px; }\n .btn svg { width: 14px; height: 14px; display: block; }\n .btn[hidden] { display: none; }\n\n /* Fullscreen: the host has given us the whole viewport, so drop the\n inline width cap and let the image use it. Without this the card stays\n a 360px thumbnail in the corner and Expand looks broken. */\n :root[data-display-mode=\"fullscreen\"] body {\n display: flex;\n align-items: center;\n justify-content: center;\n min-height: 100vh;\n }\n :root[data-display-mode=\"fullscreen\"] .card {\n max-width: min(96vw, 1100px);\n border: 0;\n background: transparent;\n }\n :root[data-display-mode=\"fullscreen\"] .hero {\n max-height: 88vh;\n object-fit: contain;\n }\n /* Nothing to reveal on hover when the image fills the screen. */\n :root[data-display-mode=\"fullscreen\"] .actions { opacity: 1; }\n\n .status:empty,\n .meta:empty { display: none; }\n .status,\n .meta {\n font-size: var(--font-text-xs-size, 11px);\n color: var(--color-text-secondary, rgba(232, 232, 232, 0.6));\n padding: 8px 12px;\n }\n /* When both are shown the pair reads as one block, so the meta line drops\n its bottom padding rather than double-spacing them. */\n .meta:has(+ .status:not(:empty)) {\n padding-bottom: 0;\n }\n </style>\n <script type=\"module\" crossorigin>var e=Object.defineProperty,t=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(e){throw n=[e],e}},n=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),r=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r},i=(e=>typeof require<`u`?require:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof require<`u`?require:e)[t]}):e)(function(e){if(typeof require<`u`)return require.apply(this,arguments);throw Error('Calling `require` for \"'+e+\"\\\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.\")});(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel=\"modulepreload\"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();function a(e,t,n){function r(n,r){var i;Object.defineProperty(n,\"_zod\",{value:n._zod??{},enumerable:!1}),(i=n._zod).traits??(i.traits=new Set),n._zod.traits.add(e),t(n,r);for(let e in o.prototype)e in n||Object.defineProperty(n,e,{value:o.prototype[e].bind(n)});n._zod.constr=o,n._zod.def=r}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,\"name\",{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,\"init\",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,\"name\",{value:e}),o}function o(e){return e&&Object.assign(u,e),u}var s,c,l,u,d=t((()=>{s=Object.freeze({status:`aborted`}),c=Symbol(`zod_brand`),l=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},u={}})),f=r({BIGINT_FORMAT_RANGES:()=>ze,Class:()=>Be,NUMBER_FORMAT_RANGES:()=>Re,aborted:()=>De,allowsEval:()=>Pe,assert:()=>re,assertEqual:()=>p,assertIs:()=>te,assertNever:()=>ne,assertNotEqual:()=>ee,assignProp:()=>ue,cached:()=>oe,captureStackTrace:()=>Ne,cleanEnum:()=>Me,cleanRegex:()=>ce,clone:()=>g,createTransparentProxy:()=>ye,defineLazy:()=>h,esc:()=>me,escapeRegex:()=>ve,extend:()=>Ce,finalizeIssue:()=>b,floatSafeRemainder:()=>le,getElementAtPath:()=>de,getEnumValues:()=>ie,getLengthableOrigin:()=>Ae,getParsedType:()=>Fe,getSizableOrigin:()=>ke,isObject:()=>he,isPlainObject:()=>ge,issue:()=>je,joinValues:()=>m,jsonStringifyReplacer:()=>ae,merge:()=>we,normalizeParams:()=>_,nullish:()=>se,numKeys:()=>_e,omit:()=>Se,optionalKeys:()=>be,partial:()=>Te,pick:()=>xe,prefixIssues:()=>y,primitiveTypes:()=>Le,promiseAllObject:()=>fe,propertyKeyTypes:()=>Ie,randomString:()=>pe,required:()=>Ee,stringifyPrimitive:()=>v,unwrapMessage:()=>Oe});function p(e){return e}function ee(e){return e}function te(e){}function ne(e){throw Error()}function re(e){}function ie(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function m(e,t=`|`){return e.map(e=>v(e)).join(t)}function ae(e,t){return typeof t==`bigint`?t.toString():t}function oe(e){return{get value(){{let t=e();return Object.defineProperty(this,\"value\",{value:t}),t}}}}function se(e){return e==null}function ce(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function le(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=(t.toString().split(`.`)[1]||``).length,i=n>r?n:r;return Number.parseInt(e.toFixed(i).replace(`.`,``))%Number.parseInt(t.toFixed(i).replace(`.`,``))/10**i}function h(e,t,n){Object.defineProperty(e,t,{get(){{let r=n();return e[t]=r,r}},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function ue(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function de(e,t){return t?t.reduce((e,t)=>e?.[t],e):e}function fe(e){let t=Object.keys(e),n=t.map(t=>e[t]);return Promise.all(n).then(e=>{let n={};for(let r=0;r<t.length;r++)n[t[r]]=e[r];return n})}function pe(e=10){let t=``;for(let n=0;n<e;n++)t+=`abcdefghijklmnopqrstuvwxyz`[Math.floor(Math.random()*26)];return t}function me(e){return JSON.stringify(e)}function he(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function ge(e){if(he(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return he(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function _e(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}function ve(e){return e.replace(/[.*+?^${}()|[\\]\\\\]/g,`\\\\$&`)}function g(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function _(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error(\"Cannot specify both `message` and `error` params\");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function ye(e){let t;return new Proxy({},{get(n,r,i){return t??=e(),Reflect.get(t,r,i)},set(n,r,i,a){return t??=e(),Reflect.set(t,r,i,a)},has(n,r){return t??=e(),Reflect.has(t,r)},deleteProperty(n,r){return t??=e(),Reflect.deleteProperty(t,r)},ownKeys(n){return t??=e(),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,r){return t??=e(),Reflect.getOwnPropertyDescriptor(t,r)},defineProperty(n,r,i){return t??=e(),Reflect.defineProperty(t,r,i)}})}function v(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`\"${e}\"`:`${e}`}function be(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}function xe(e,t){let n={},r=e._zod.def;for(let e in t){if(!(e in r.shape))throw Error(`Unrecognized key: \"${e}\"`);t[e]&&(n[e]=r.shape[e])}return g(e,{...e._zod.def,shape:n,checks:[]})}function Se(e,t){let n={...e._zod.def.shape},r=e._zod.def;for(let e in t){if(!(e in r.shape))throw Error(`Unrecognized key: \"${e}\"`);t[e]&&delete n[e]}return g(e,{...e._zod.def,shape:n,checks:[]})}function Ce(e,t){if(!ge(t))throw Error(`Invalid input to extend: expected a plain object`);return g(e,{...e._zod.def,get shape(){let n={...e._zod.def.shape,...t};return ue(this,`shape`,n),n},checks:[]})}function we(e,t){return g(e,{...e._zod.def,get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return ue(this,`shape`,n),n},catchall:t._zod.def.catchall,checks:[]})}function Te(e,t,n){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: \"${t}\"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return g(t,{...t._zod.def,shape:i,checks:[]})}function Ee(e,t,n){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: \"${t}\"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return g(t,{...t._zod.def,shape:i,checks:[]})}function De(e,t=0){for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function y(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Oe(e){return typeof e==`string`?e:e?.message}function b(e,t,n){let r={...e,path:e.path??[]};return e.message||(r.message=Oe(e.inst?._zod.def?.error?.(e))??Oe(t?.error?.(e))??Oe(n.customError?.(e))??Oe(n.localeError?.(e))??`Invalid input`),delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function ke(e){return e instanceof Set?`set`:e instanceof Map?`map`:e instanceof File?`file`:`unknown`}function Ae(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function je(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function Me(e){return Object.entries(e).filter(([e,t])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}var Ne,Pe,Fe,Ie,Le,Re,ze,Be,x=t((()=>{Ne=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{},Pe=oe(()=>{if(typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}}),Fe=e=>{let t=typeof e;switch(t){case`undefined`:return`undefined`;case`string`:return`string`;case`number`:return Number.isNaN(e)?`nan`:`number`;case`boolean`:return`boolean`;case`function`:return`function`;case`bigint`:return`bigint`;case`symbol`:return`symbol`;case`object`:return Array.isArray(e)?`array`:e===null?`null`:e.then&&typeof e.then==`function`&&e.catch&&typeof e.catch==`function`?`promise`:typeof Map<`u`&&e instanceof Map?`map`:typeof Set<`u`&&e instanceof Set?`set`:typeof Date<`u`&&e instanceof Date?`date`:typeof File<`u`&&e instanceof File?`file`:`object`;default:throw Error(`Unknown data type: ${t}`)}},Ie=new Set([`string`,`number`,`symbol`]),Le=new Set([`string`,`number`,`bigint`,`boolean`,`symbol`,`undefined`]),Re={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},ze={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]},Be=class{constructor(...e){}}}));function Ve(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function He(e,t){let n=t||function(e){return e.message},r={_errors:[]},i=e=>{for(let t of e.issues)if(t.code===`invalid_union`&&t.errors.length)t.errors.map(e=>i({issues:e}));else if(t.code===`invalid_key`)i({issues:t.issues});else if(t.code===`invalid_element`)i({issues:t.issues});else if(t.path.length===0)r._errors.push(n(t));else{let e=r,i=0;for(;i<t.path.length;){let r=t.path[i];i===t.path.length-1?(e[r]=e[r]||{_errors:[]},e[r]._errors.push(n(t))):e[r]=e[r]||{_errors:[]},e=e[r],i++}}};return i(e),r}function Ue(e,t){let n=t||function(e){return e.message},r={errors:[]},i=(e,t=[])=>{var a,o;for(let s of e.issues)if(s.code===`invalid_union`&&s.errors.length)s.errors.map(e=>i({issues:e},s.path));else if(s.code===`invalid_key`)i({issues:s.issues},s.path);else if(s.code===`invalid_element`)i({issues:s.issues},s.path);else{let e=[...t,...s.path];if(e.length===0){r.errors.push(n(s));continue}let i=r,c=0;for(;c<e.length;){let t=e[c],r=c===e.length-1;typeof t==`string`?(i.properties??(i.properties={}),(a=i.properties)[t]??(a[t]={errors:[]}),i=i.properties[t]):(i.items??(i.items=[]),(o=i.items)[t]??(o[t]={errors:[]}),i=i.items[t]),r&&i.errors.push(n(s)),c++}}};return i(e),r}function We(e){let t=[];for(let n of e)typeof n==`number`?t.push(`[${n}]`):typeof n==`symbol`?t.push(`[${JSON.stringify(String(n))}]`):/[^\\w$]/.test(n)?t.push(`[${JSON.stringify(n)}]`):(t.length&&t.push(`.`),t.push(n));return t.join(``)}function Ge(e){let t=[],n=[...e.issues].sort((e,t)=>e.path.length-t.path.length);for(let e of n)t.push(`✖ ${e.message}`),e.path?.length&&t.push(` → at ${We(e.path)}`);return t.join(`\n`)}var Ke,qe,Je,Ye=t((()=>{d(),x(),Ke=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,\"_zod\",{value:e._zod,enumerable:!1}),Object.defineProperty(e,\"issues\",{value:t,enumerable:!1}),Object.defineProperty(e,\"message\",{get(){return JSON.stringify(t,ae,2)},enumerable:!0}),Object.defineProperty(e,\"toString\",{value:()=>e.message,enumerable:!1})},qe=a(`$ZodError`,Ke),Je=a(`$ZodError`,Ke,{Parent:Error})})),Xe,Ze,Qe,$e,et,tt,nt,rt,it=t((()=>{d(),Ye(),x(),Xe=e=>(t,n,r,i)=>{let a=r?Object.assign(r,{async:!1}):{async:!1},s=t._zod.run({value:n,issues:[]},a);if(s instanceof Promise)throw new l;if(s.issues.length){let t=new((i?.Err)??e)(s.issues.map(e=>b(e,a,o())));throw Ne(t,i?.callee),t}return s.value},Ze=Xe(Je),Qe=e=>async(t,n,r,i)=>{let a=r?Object.assign(r,{async:!0}):{async:!0},s=t._zod.run({value:n,issues:[]},a);if(s instanceof Promise&&(s=await s),s.issues.length){let t=new((i?.Err)??e)(s.issues.map(e=>b(e,a,o())));throw Ne(t,i?.callee),t}return s.value},$e=Qe(Je),et=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new l;return a.issues.length?{success:!1,error:new(e??qe)(a.issues.map(e=>b(e,i,o())))}:{success:!0,data:a.value}},tt=et(Je),nt=e=>async(t,n,r)=>{let i=r?Object.assign(r,{async:!0}):{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>b(e,i,o())))}:{success:!0,data:a.value}},rt=nt(Je)})),at=r({_emoji:()=>Ot,base64:()=>Nt,base64url:()=>Pt,bigint:()=>Vt,boolean:()=>Wt,browserEmail:()=>Dt,cidrv4:()=>jt,cidrv6:()=>Mt,cuid:()=>ut,cuid2:()=>dt,date:()=>zt,datetime:()=>lt,domain:()=>It,duration:()=>gt,e164:()=>Lt,email:()=>Ct,emoji:()=>ot,extendedDuration:()=>_t,guid:()=>vt,hostname:()=>Ft,html5Email:()=>wt,integer:()=>Ht,ipv4:()=>kt,ipv6:()=>At,ksuid:()=>mt,lowercase:()=>qt,nanoid:()=>ht,null:()=>Gt,number:()=>Ut,rfc5322Email:()=>Tt,string:()=>Bt,time:()=>ct,ulid:()=>ft,undefined:()=>Kt,unicodeEmail:()=>Et,uppercase:()=>Jt,uuid:()=>yt,uuid4:()=>bt,uuid6:()=>xt,uuid7:()=>St,xid:()=>pt});function ot(){return new RegExp(Ot,`u`)}function st(e){let t=`(?:[01]\\\\d|2[0-3]):[0-5]\\\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\\\d`:`${t}:[0-5]\\\\d\\\\.\\\\d{${e.precision}}`:`${t}(?::[0-5]\\\\d(?:\\\\.\\\\d+)?)?`}function ct(e){return RegExp(`^${st(e)}$`)}function lt(e){let t=st({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-]\\\\d{2}:\\\\d{2})`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${Rt}T(?:${r})$`)}var ut,dt,ft,pt,mt,ht,gt,_t,vt,yt,bt,xt,St,Ct,wt,Tt,Et,Dt,Ot,kt,At,jt,Mt,Nt,Pt,Ft,It,Lt,Rt,zt,Bt,Vt,Ht,Ut,Wt,Gt,Kt,qt,Jt,Yt=t((()=>{ut=/^[cC][^\\s-]{8,}$/,dt=/^[0-9a-z]+$/,ft=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,pt=/^[0-9a-vA-V]{20}$/,mt=/^[A-Za-z0-9]{27}$/,ht=/^[a-zA-Z0-9_-]{21}$/,gt=/^P(?:(\\d+W)|(?!.*W)(?=\\d|T\\d)(\\d+Y)?(\\d+M)?(\\d+D)?(T(?=\\d)(\\d+H)?(\\d+M)?(\\d+([.,]\\d+)?S)?)?)$/,_t=/^[-+]?P(?!$)(?:(?:[-+]?\\d+Y)|(?:[-+]?\\d+[.,]\\d+Y$))?(?:(?:[-+]?\\d+M)|(?:[-+]?\\d+[.,]\\d+M$))?(?:(?:[-+]?\\d+W)|(?:[-+]?\\d+[.,]\\d+W$))?(?:(?:[-+]?\\d+D)|(?:[-+]?\\d+[.,]\\d+D$))?(?:T(?=[\\d+-])(?:(?:[-+]?\\d+H)|(?:[-+]?\\d+[.,]\\d+H$))?(?:(?:[-+]?\\d+M)|(?:[-+]?\\d+[.,]\\d+M$))?(?:[-+]?\\d+(?:[.,]\\d+)?S)?)??$/,vt=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,yt=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/,bt=yt(4),xt=yt(6),St=yt(7),Ct=/^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$/,wt=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Tt=/^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/,Et=/^[^\\s@\"]{1,64}@[^\\s@]{1,255}$/u,Dt=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Ot=`^(\\\\p{Extended_Pictographic}|\\\\p{Emoji_Component})+$`,kt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,At=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,jt=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\/([0-9]|[1-2][0-9]|3[0-2])$/,Mt=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Nt=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Pt=/^[A-Za-z0-9_-]*$/,Ft=/^([a-zA-Z0-9-]+\\.)*[a-zA-Z0-9-]+$/,It=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\\.)+[a-zA-Z]{2,}$/,Lt=/^\\+(?:[0-9]){6,14}[0-9]$/,Rt=`(?:(?:\\\\d\\\\d[2468][048]|\\\\d\\\\d[13579][26]|\\\\d\\\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\\\d|30)|(?:02)-(?:0[1-9]|1\\\\d|2[0-8])))`,zt=RegExp(`^${Rt}$`),Bt=e=>{let t=e?`[\\\\s\\\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\\\s\\\\S]*`;return RegExp(`^${t}$`)},Vt=/^\\d+n?$/,Ht=/^\\d+$/,Ut=/^-?\\d+(?:\\.\\d+)?/i,Wt=/true|false/i,Gt=/null/i,Kt=/undefined/i,qt=/^[^A-Z]*$/,Jt=/^[^a-z]*$/}));function Xt(e,t,n){e.issues.length&&t.issues.push(...y(n,e.issues))}var S,Zt,Qt,$t,en,tn,nn,rn,an,on,sn,cn,ln,un,dn,fn,pn,mn,hn,gn,_n,vn,yn,bn=t((()=>{d(),Yt(),x(),S=a(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Zt={number:`number`,bigint:`bigint`,object:`date`},Qt=a(`$ZodCheckLessThan`,(e,t)=>{S.init(e,t);let n=Zt[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),$t=a(`$ZodCheckGreaterThan`,(e,t)=>{S.init(e,t);let n=Zt[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),en=a(`$ZodCheckMultipleOf`,(e,t)=>{S.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):le(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),tn=a(`$ZodCheckNumberFormat`,(e,t)=>{S.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=Re[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=Ht)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inst:e})}}),nn=a(`$ZodCheckBigIntFormat`,(e,t)=>{S.init(e,t);let[n,r]=ze[t.format];e._zod.onattach.push(e=>{let i=e._zod.bag;i.format=t.format,i.minimum=n,i.maximum=r}),e._zod.check=i=>{let a=i.value;a<n&&i.issues.push({origin:`bigint`,input:a,code:`too_small`,minimum:n,inclusive:!0,inst:e,continue:!t.abort}),a>r&&i.issues.push({origin:`bigint`,input:a,code:`too_big`,maximum:r,inst:e})}}),rn=a(`$ZodCheckMaxSize`,(e,t)=>{var n;S.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!se(t)&&t.size!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;r.size<=t.maximum||n.issues.push({origin:ke(r),code:`too_big`,maximum:t.maximum,input:r,inst:e,continue:!t.abort})}}),an=a(`$ZodCheckMinSize`,(e,t)=>{var n;S.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!se(t)&&t.size!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;r.size>=t.minimum||n.issues.push({origin:ke(r),code:`too_small`,minimum:t.minimum,input:r,inst:e,continue:!t.abort})}}),on=a(`$ZodCheckSizeEquals`,(e,t)=>{var n;S.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!se(t)&&t.size!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.size,n.maximum=t.size,n.size=t.size}),e._zod.check=n=>{let r=n.value,i=r.size;if(i===t.size)return;let a=i>t.size;n.issues.push({origin:ke(r),...a?{code:`too_big`,maximum:t.size}:{code:`too_small`,minimum:t.size},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),sn=a(`$ZodCheckMaxLength`,(e,t)=>{var n;S.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!se(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=Ae(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),cn=a(`$ZodCheckMinLength`,(e,t)=>{var n;S.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!se(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=Ae(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),ln=a(`$ZodCheckLengthEquals`,(e,t)=>{var n;S.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!se(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=Ae(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),un=a(`$ZodCheckStringFormat`,(e,t)=>{var n,r;S.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),dn=a(`$ZodCheckRegex`,(e,t)=>{un.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),fn=a(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=qt,un.init(e,t)}),pn=a(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=Jt,un.init(e,t)}),mn=a(`$ZodCheckIncludes`,(e,t)=>{S.init(e,t);let n=ve(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),hn=a(`$ZodCheckStartsWith`,(e,t)=>{S.init(e,t);let n=RegExp(`^${ve(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),gn=a(`$ZodCheckEndsWith`,(e,t)=>{S.init(e,t);let n=RegExp(`.*${ve(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),_n=a(`$ZodCheckProperty`,(e,t)=>{S.init(e,t),e._zod.check=e=>{let n=t.schema._zod.run({value:e.value[t.property],issues:[]},{});if(n instanceof Promise)return n.then(n=>Xt(n,e,t.property));Xt(n,e,t.property)}}),vn=a(`$ZodCheckMimeType`,(e,t)=>{S.init(e,t);let n=new Set(t.mime);e._zod.onattach.push(e=>{e._zod.bag.mime=t.mime}),e._zod.check=r=>{n.has(r.value.type)||r.issues.push({code:`invalid_value`,values:t.mime,input:r.value.type,inst:e})}}),yn=a(`$ZodCheckOverwrite`,(e,t)=>{S.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}})})),xn,Sn=t((()=>{xn=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`\n`).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(`\n`))}}})),Cn,wn=t((()=>{Cn={major:4,minor:0,patch:0}}));function Tn(e){if(e===``)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}function En(e){if(!Pt.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return Tn(t.padEnd(Math.ceil(t.length/4)*4,`=`))}function Dn(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}function On(e,t,n){e.issues.length&&t.issues.push(...y(n,e.issues)),t.value[n]=e.value}function kn(e,t,n){e.issues.length&&t.issues.push(...y(n,e.issues)),t.value[n]=e.value}function An(e,t,n,r){e.issues.length?r[n]===void 0?n in r?t.value[n]=void 0:t.value[n]=e.value:t.issues.push(...y(n,e.issues)):e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function jn(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;return t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>b(e,r,o())))}),t}function Mn(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(ge(e)&&ge(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=Mn(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=Mn(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Nn(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),De(e))return e;let r=Mn(t.value,n.value);if(!r.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return e.value=r.data,e}function Pn(e,t,n){e.issues.length&&t.issues.push(...y(n,e.issues)),t.value[n]=e.value}function Fn(e,t,n,r,i,a,s){e.issues.length&&(Ie.has(typeof r)?n.issues.push(...y(r,e.issues)):n.issues.push({origin:`map`,code:`invalid_key`,input:i,inst:a,issues:e.issues.map(e=>b(e,s,o()))})),t.issues.length&&(Ie.has(typeof r)?n.issues.push(...y(r,t.issues)):n.issues.push({origin:`map`,code:`invalid_element`,input:i,inst:a,key:r,issues:t.issues.map(e=>b(e,s,o()))})),n.value.set(e.value,t.value)}function In(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}function Ln(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}function Rn(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}function zn(e,t,n){return De(e)?e:t.out._zod.run({value:e.value,issues:e.issues},n)}function Bn(e){return e.value=Object.freeze(e.value),e}function Vn(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(je(e))}}var C,Hn,w,Un,Wn,Gn,Kn,qn,Jn,Yn,Xn,Zn,Qn,$n,er,tr,nr,rr,ir,ar,or,sr,cr,lr,ur,dr,fr,pr,mr,hr,gr,_r,vr,yr,br,xr,Sr,Cr,wr,Tr,Er,Dr,Or,kr,Ar,jr,Mr,Nr,Pr,Fr,Ir,Lr,Rr,zr,Br,Vr,Hr,Ur,Wr,Gr,Kr,qr,Jr,Yr,Xr,Zr,Qr,$r=t((()=>{bn(),d(),Sn(),it(),Yt(),x(),wn(),C=a(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Cn;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=De(e),i;for(let a of t){if(a._zod.def.when){if(!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new l;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=De(e,t))});else{if(e.issues.length===t)continue;r||=De(e,t)}}return i?i.then(()=>e):e};e._zod.run=(n,i)=>{let a=e._zod.parse(n,i);if(a instanceof Promise){if(i.async===!1)throw new l;return a.then(e=>t(e,r,i))}return t(a,r,i)}}e[`~standard`]={validate:t=>{try{let n=tt(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return rt(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}}),Hn=a(`$ZodString`,(e,t)=>{C.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Bt(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),w=a(`$ZodStringFormat`,(e,t)=>{un.init(e,t),Hn.init(e,t)}),Un=a(`$ZodGUID`,(e,t)=>{t.pattern??=vt,w.init(e,t)}),Wn=a(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: \"${t.version}\"`);t.pattern??=yt(e)}else t.pattern??=yt();w.init(e,t)}),Gn=a(`$ZodEmail`,(e,t)=>{t.pattern??=Ct,w.init(e,t)}),Kn=a(`$ZodURL`,(e,t)=>{w.init(e,t),e._zod.check=n=>{try{let r=n.value,i=new URL(r),a=i.href;t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:Ft.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),n.value=!r.endsWith(`/`)&&a.endsWith(`/`)?a.slice(0,-1):a;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),qn=a(`$ZodEmoji`,(e,t)=>{t.pattern??=ot(),w.init(e,t)}),Jn=a(`$ZodNanoID`,(e,t)=>{t.pattern??=ht,w.init(e,t)}),Yn=a(`$ZodCUID`,(e,t)=>{t.pattern??=ut,w.init(e,t)}),Xn=a(`$ZodCUID2`,(e,t)=>{t.pattern??=dt,w.init(e,t)}),Zn=a(`$ZodULID`,(e,t)=>{t.pattern??=ft,w.init(e,t)}),Qn=a(`$ZodXID`,(e,t)=>{t.pattern??=pt,w.init(e,t)}),$n=a(`$ZodKSUID`,(e,t)=>{t.pattern??=mt,w.init(e,t)}),er=a(`$ZodISODateTime`,(e,t)=>{t.pattern??=lt(t),w.init(e,t)}),tr=a(`$ZodISODate`,(e,t)=>{t.pattern??=zt,w.init(e,t)}),nr=a(`$ZodISOTime`,(e,t)=>{t.pattern??=ct(t),w.init(e,t)}),rr=a(`$ZodISODuration`,(e,t)=>{t.pattern??=gt,w.init(e,t)}),ir=a(`$ZodIPv4`,(e,t)=>{t.pattern??=kt,w.init(e,t),e._zod.onattach.push(e=>{let t=e._zod.bag;t.format=`ipv4`})}),ar=a(`$ZodIPv6`,(e,t)=>{t.pattern??=At,w.init(e,t),e._zod.onattach.push(e=>{let t=e._zod.bag;t.format=`ipv6`}),e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),or=a(`$ZodCIDRv4`,(e,t)=>{t.pattern??=jt,w.init(e,t)}),sr=a(`$ZodCIDRv6`,(e,t)=>{t.pattern??=Mt,w.init(e,t),e._zod.check=n=>{let[r,i]=n.value.split(`/`);try{if(!i)throw Error();let e=Number(i);if(`${e}`!==i||e<0||e>128)throw Error();new URL(`http://[${r}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}}),cr=a(`$ZodBase64`,(e,t)=>{t.pattern??=Nt,w.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding=`base64`}),e._zod.check=n=>{Tn(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),lr=a(`$ZodBase64URL`,(e,t)=>{t.pattern??=Pt,w.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding=`base64url`}),e._zod.check=n=>{En(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),ur=a(`$ZodE164`,(e,t)=>{t.pattern??=Lt,w.init(e,t)}),dr=a(`$ZodJWT`,(e,t)=>{w.init(e,t),e._zod.check=n=>{Dn(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),fr=a(`$ZodCustomStringFormat`,(e,t)=>{w.init(e,t),e._zod.check=n=>{t.fn(n.value)||n.issues.push({code:`invalid_format`,format:t.format,input:n.value,inst:e,continue:!t.abort})}}),pr=a(`$ZodNumber`,(e,t)=>{C.init(e,t),e._zod.pattern=e._zod.bag.pattern??Ut,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),mr=a(`$ZodNumber`,(e,t)=>{tn.init(e,t),pr.init(e,t)}),hr=a(`$ZodBoolean`,(e,t)=>{C.init(e,t),e._zod.pattern=Wt,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),gr=a(`$ZodBigInt`,(e,t)=>{C.init(e,t),e._zod.pattern=Vt,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=BigInt(n.value)}catch{}return typeof n.value==`bigint`||n.issues.push({expected:`bigint`,code:`invalid_type`,input:n.value,inst:e}),n}}),_r=a(`$ZodBigInt`,(e,t)=>{nn.init(e,t),gr.init(e,t)}),vr=a(`$ZodSymbol`,(e,t)=>{C.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return typeof r==`symbol`||t.issues.push({expected:`symbol`,code:`invalid_type`,input:r,inst:e}),t}}),yr=a(`$ZodUndefined`,(e,t)=>{C.init(e,t),e._zod.pattern=Kt,e._zod.values=new Set([void 0]),e._zod.optin=`optional`,e._zod.optout=`optional`,e._zod.parse=(t,n)=>{let r=t.value;return r===void 0||t.issues.push({expected:`undefined`,code:`invalid_type`,input:r,inst:e}),t}}),br=a(`$ZodNull`,(e,t)=>{C.init(e,t),e._zod.pattern=Gt,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return r===null||t.issues.push({expected:`null`,code:`invalid_type`,input:r,inst:e}),t}}),xr=a(`$ZodAny`,(e,t)=>{C.init(e,t),e._zod.parse=e=>e}),Sr=a(`$ZodUnknown`,(e,t)=>{C.init(e,t),e._zod.parse=e=>e}),Cr=a(`$ZodNever`,(e,t)=>{C.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)}),wr=a(`$ZodVoid`,(e,t)=>{C.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return r===void 0||t.issues.push({expected:`void`,code:`invalid_type`,input:r,inst:e}),t}}),Tr=a(`$ZodDate`,(e,t)=>{C.init(e,t),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=new Date(n.value)}catch{}let i=n.value,a=i instanceof Date;return a&&!Number.isNaN(i.getTime())||n.issues.push({expected:`date`,code:`invalid_type`,input:i,...a?{received:`Invalid Date`}:{},inst:e}),n}}),Er=a(`$ZodArray`,(e,t)=>{C.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>On(t,n,e))):On(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}}),Dr=a(`$ZodObject`,(e,t)=>{C.init(e,t);let n=oe(()=>{let e=Object.keys(t.shape);for(let n of e)if(!(t.shape[n]instanceof C))throw Error(`Invalid element at key \"${n}\": expected a Zod schema`);let n=be(t.shape);return{shape:t.shape,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(n)}});h(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=e=>{let t=new xn([`shape`,`payload`,`ctx`]),r=n.value,i=e=>{let t=me(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of r.keys)a[e]=`key_${o++}`;t.write(`const newResult = {}`);for(let e of r.keys)if(r.optionalKeys.has(e)){let n=a[e];t.write(`const ${n} = ${i(e)};`);let r=me(e);t.write(`\n if (${n}.issues.length) {\n if (input[${r}] === undefined) {\n if (${r} in input) {\n newResult[${r}] = undefined;\n }\n } else {\n payload.issues = payload.issues.concat(\n ${n}.issues.map((iss) => ({\n ...iss,\n path: iss.path ? [${r}, ...iss.path] : [${r}],\n }))\n );\n }\n } else if (${n}.value === undefined) {\n if (${r} in input) newResult[${r}] = undefined;\n } else {\n newResult[${r}] = ${n}.value;\n }\n `)}else{let n=a[e];t.write(`const ${n} = ${i(e)};`),t.write(`\n if (${n}.issues.length) payload.issues = payload.issues.concat(${n}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${me(e)}, ...iss.path] : [${me(e)}]\n })));`),t.write(`newResult[${me(e)}] = ${n}.value`)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},i,a=he,o=!u.jitless,s=o&&Pe.value,c=t.catchall,l;e._zod.parse=(u,d)=>{l??=n.value;let f=u.value;if(!a(f))return u.issues.push({expected:`object`,code:`invalid_type`,input:f,inst:e}),u;let p=[];if(o&&s&&d?.async===!1&&d.jitless!==!0)i||=r(t.shape),u=i(u,d);else{u.value={};let e=l.shape;for(let t of l.keys){let n=e[t],r=n._zod.run({value:f[t],issues:[]},d),i=n._zod.optin===`optional`&&n._zod.optout===`optional`;r instanceof Promise?p.push(r.then(e=>i?An(e,u,t,f):kn(e,u,t))):i?An(r,u,t,f):kn(r,u,t)}}if(!c)return p.length?Promise.all(p).then(()=>u):u;let ee=[],te=l.keySet,ne=c._zod,re=ne.def.type;for(let e of Object.keys(f)){if(te.has(e))continue;if(re===`never`){ee.push(e);continue}let t=ne.run({value:f[e],issues:[]},d);t instanceof Promise?p.push(t.then(t=>kn(t,u,e))):kn(t,u,e)}return ee.length&&u.issues.push({code:`unrecognized_keys`,keys:ee,input:f,inst:e}),p.length?Promise.all(p).then(()=>u):u}}),Or=a(`$ZodUnion`,(e,t)=>{C.init(e,t),h(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),h(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),h(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),h(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>ce(e.source)).join(`|`)})$`)}}),e._zod.parse=(n,r)=>{let i=!1,a=[];for(let e of t.options){let t=e._zod.run({value:n.value,issues:[]},r);if(t instanceof Promise)a.push(t),i=!0;else{if(t.issues.length===0)return t;a.push(t)}}return i?Promise.all(a).then(t=>jn(t,n,e,r)):jn(a,n,e,r)}}),kr=a(`$ZodDiscriminatedUnion`,(e,t)=>{Or.init(e,t);let n=e._zod.parse;h(e._zod,`propValues`,()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||Object.keys(r).length===0)throw Error(`Invalid discriminated union option at index \"${t.options.indexOf(n)}\"`);for(let[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(let r of n)e[t].add(r)}}return e});let r=oe(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues[t.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index \"${t.options.indexOf(r)}\"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value \"${String(t)}\"`);n.set(t,r)}}return n});e._zod.parse=(i,a)=>{let o=i.value;if(!he(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=r.value.get(o?.[t.discriminator]);return s?s._zod.run(i,a):t.unionFallback?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,input:o,path:[t.discriminator],inst:e}),i)}}),Ar=a(`$ZodIntersection`,(e,t)=>{C.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>Nn(e,t,n)):Nn(e,i,a)}}),jr=a(`$ZodTuple`,(e,t)=>{C.init(e,t);let n=t.items,r=n.length-[...n].reverse().findIndex(e=>e._zod.optin!==`optional`);e._zod.parse=(i,a)=>{let o=i.value;if(!Array.isArray(o))return i.issues.push({input:o,inst:e,expected:`tuple`,code:`invalid_type`}),i;i.value=[];let s=[];if(!t.rest){let t=o.length>n.length,a=o.length<r-1;if(t||a)return i.issues.push({input:o,inst:e,origin:`array`,...t?{code:`too_big`,maximum:n.length}:{code:`too_small`,minimum:n.length}}),i}let c=-1;for(let e of n){if(c++,c>=o.length&&c>=r)continue;let t=e._zod.run({value:o[c],issues:[]},a);t instanceof Promise?s.push(t.then(e=>Pn(e,i,c))):Pn(t,i,c)}if(t.rest){let e=o.slice(n.length);for(let n of e){c++;let e=t.rest._zod.run({value:n,issues:[]},a);e instanceof Promise?s.push(e.then(e=>Pn(e,i,c))):Pn(e,i,c)}}return s.length?Promise.all(s).then(()=>i):i}}),Mr=a(`$ZodRecord`,(e,t)=>{C.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!ge(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[];if(t.keyType._zod.values){let o=t.keyType._zod.values;n.value={};for(let e of o)if(typeof e==`string`||typeof e==`number`||typeof e==`symbol`){let o=t.valueType._zod.run({value:i[e],issues:[]},r);o instanceof Promise?a.push(o.then(t=>{t.issues.length&&n.issues.push(...y(e,t.issues)),n.value[e]=t.value})):(o.issues.length&&n.issues.push(...y(e,o.issues)),n.value[e]=o.value)}let s;for(let e in i)o.has(e)||(s??=[],s.push(e));s&&s.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:s})}else{n.value={};for(let s of Reflect.ownKeys(i)){if(s===`__proto__`)continue;let c=t.keyType._zod.run({value:s,issues:[]},r);if(c instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(c.issues.length){n.issues.push({origin:`record`,code:`invalid_key`,issues:c.issues.map(e=>b(e,r,o())),input:s,path:[s],inst:e}),n.value[c.value]=c.value;continue}let l=t.valueType._zod.run({value:i[s],issues:[]},r);l instanceof Promise?a.push(l.then(e=>{e.issues.length&&n.issues.push(...y(s,e.issues)),n.value[c.value]=e.value})):(l.issues.length&&n.issues.push(...y(s,l.issues)),n.value[c.value]=l.value)}}return a.length?Promise.all(a).then(()=>n):n}}),Nr=a(`$ZodMap`,(e,t)=>{C.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!(i instanceof Map))return n.issues.push({expected:`map`,code:`invalid_type`,input:i,inst:e}),n;let a=[];n.value=new Map;for(let[o,s]of i){let c=t.keyType._zod.run({value:o,issues:[]},r),l=t.valueType._zod.run({value:s,issues:[]},r);c instanceof Promise||l instanceof Promise?a.push(Promise.all([c,l]).then(([t,a])=>{Fn(t,a,n,o,i,e,r)})):Fn(c,l,n,o,i,e,r)}return a.length?Promise.all(a).then(()=>n):n}}),Pr=a(`$ZodSet`,(e,t)=>{C.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!(i instanceof Set))return n.issues.push({input:i,inst:e,expected:`set`,code:`invalid_type`}),n;let a=[];n.value=new Set;for(let e of i){let i=t.valueType._zod.run({value:e,issues:[]},r);i instanceof Promise?a.push(i.then(e=>In(e,n))):In(i,n)}return a.length?Promise.all(a).then(()=>n):n}}),Fr=a(`$ZodEnum`,(e,t)=>{C.init(e,t);let n=ie(t.entries);e._zod.values=new Set(n),e._zod.pattern=RegExp(`^(${n.filter(e=>Ie.has(typeof e)).map(e=>typeof e==`string`?ve(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,r)=>{let i=t.value;return e._zod.values.has(i)||t.issues.push({code:`invalid_value`,values:n,input:i,inst:e}),t}}),Ir=a(`$ZodLiteral`,(e,t)=>{C.init(e,t),e._zod.values=new Set(t.values),e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?ve(e):e?e.toString():String(e)).join(`|`)})$`),e._zod.parse=(n,r)=>{let i=n.value;return e._zod.values.has(i)||n.issues.push({code:`invalid_value`,values:t.values,input:i,inst:e}),n}}),Lr=a(`$ZodFile`,(e,t)=>{C.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return r instanceof File||t.issues.push({expected:`file`,code:`invalid_type`,input:r,inst:e}),t}}),Rr=a(`$ZodTransform`,(e,t)=>{C.init(e,t),e._zod.parse=(e,n)=>{let r=t.transform(e.value,e);if(n.async)return(r instanceof Promise?r:Promise.resolve(r)).then(t=>(e.value=t,e));if(r instanceof Promise)throw new l;return e.value=r,e}}),zr=a(`$ZodOptional`,(e,t)=>{C.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,h(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),h(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${ce(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>t.innerType._zod.optin===`optional`?t.innerType._zod.run(e,n):e.value===void 0?e:t.innerType._zod.run(e,n)}),Br=a(`$ZodNullable`,(e,t)=>{C.init(e,t),h(e._zod,`optin`,()=>t.innerType._zod.optin),h(e._zod,`optout`,()=>t.innerType._zod.optout),h(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${ce(e.source)}|null)$`):void 0}),h(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Vr=a(`$ZodDefault`,(e,t)=>{C.init(e,t),e._zod.optin=`optional`,h(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Ln(e,t)):Ln(r,t)}}),Hr=a(`$ZodPrefault`,(e,t)=>{C.init(e,t),e._zod.optin=`optional`,h(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),Ur=a(`$ZodNonOptional`,(e,t)=>{C.init(e,t),h(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>Rn(t,e)):Rn(i,e)}}),Wr=a(`$ZodSuccess`,(e,t)=>{C.init(e,t),e._zod.parse=(e,n)=>{let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>(e.value=t.issues.length===0,e)):(e.value=r.issues.length===0,e)}}),Gr=a(`$ZodCatch`,(e,t)=>{C.init(e,t),e._zod.optin=`optional`,h(e._zod,`optout`,()=>t.innerType._zod.optout),h(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>b(e,n,o()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>b(e,n,o()))},input:e.value}),e.issues=[]),e)}}),Kr=a(`$ZodNaN`,(e,t)=>{C.init(e,t),e._zod.parse=(t,n)=>((typeof t.value!=`number`||!Number.isNaN(t.value))&&t.issues.push({input:t.value,inst:e,expected:`nan`,code:`invalid_type`}),t)}),qr=a(`$ZodPipe`,(e,t)=>{C.init(e,t),h(e._zod,`values`,()=>t.in._zod.values),h(e._zod,`optin`,()=>t.in._zod.optin),h(e._zod,`optout`,()=>t.out._zod.optout),e._zod.parse=(e,n)=>{let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>zn(e,t,n)):zn(r,t,n)}}),Jr=a(`$ZodReadonly`,(e,t)=>{C.init(e,t),h(e._zod,`propValues`,()=>t.innerType._zod.propValues),h(e._zod,`values`,()=>t.innerType._zod.values),h(e._zod,`optin`,()=>t.innerType._zod.optin),h(e._zod,`optout`,()=>t.innerType._zod.optout),e._zod.parse=(e,n)=>{let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Bn):Bn(r)}}),Yr=a(`$ZodTemplateLiteral`,(e,t)=>{C.init(e,t);let n=[];for(let e of t.parts)if(e instanceof C){if(!e._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...e._zod.traits].shift()}`);let t=e._zod.pattern instanceof RegExp?e._zod.pattern.source:e._zod.pattern;if(!t)throw Error(`Invalid template literal part: ${e._zod.traits}`);let r=+!!t.startsWith(`^`),i=t.endsWith(`$`)?t.length-1:t.length;n.push(t.slice(r,i))}else if(e===null||Le.has(typeof e))n.push(ve(`${e}`));else throw Error(`Invalid template literal part: ${e}`);e._zod.pattern=RegExp(`^${n.join(``)}$`),e._zod.parse=(t,n)=>typeof t.value==`string`?(e._zod.pattern.lastIndex=0,e._zod.pattern.test(t.value)||t.issues.push({input:t.value,inst:e,code:`invalid_format`,format:`template_literal`,pattern:e._zod.pattern.source}),t):(t.issues.push({input:t.value,inst:e,expected:`template_literal`,code:`invalid_type`}),t)}),Xr=a(`$ZodPromise`,(e,t)=>{C.init(e,t),e._zod.parse=(e,n)=>Promise.resolve(e.value).then(e=>t.innerType._zod.run({value:e,issues:[]},n))}),Zr=a(`$ZodLazy`,(e,t)=>{C.init(e,t),h(e._zod,`innerType`,()=>t.getter()),h(e._zod,`pattern`,()=>e._zod.innerType._zod.pattern),h(e._zod,`propValues`,()=>e._zod.innerType._zod.propValues),h(e._zod,`optin`,()=>e._zod.innerType._zod.optin),h(e._zod,`optout`,()=>e._zod.innerType._zod.optout),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),Qr=a(`$ZodCustom`,(e,t)=>{S.init(e,t),C.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>Vn(t,n,r,e));Vn(i,n,r,e)}})}));function ei(){return{localeError:ti()}}var ti,ni=t((()=>{x(),ti=()=>{let e={string:{unit:`حرف`,verb:`أن يحوي`},file:{unit:`بايت`,verb:`أن يحوي`},array:{unit:`عنصر`,verb:`أن يحوي`},set:{unit:`عنصر`,verb:`أن يحوي`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`number`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`مدخل`,email:`بريد إلكتروني`,url:`رابط`,emoji:`إيموجي`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`تاريخ ووقت بمعيار ISO`,date:`تاريخ بمعيار ISO`,time:`وقت بمعيار ISO`,duration:`مدة بمعيار ISO`,ipv4:`عنوان IPv4`,ipv6:`عنوان IPv6`,cidrv4:`مدى عناوين بصيغة IPv4`,cidrv6:`مدى عناوين بصيغة IPv6`,base64:`نَص بترميز base64-encoded`,base64url:`نَص بترميز base64url-encoded`,json_string:`نَص على هيئة JSON`,e164:`رقم هاتف بمعيار E.164`,jwt:`JWT`,template_literal:`مدخل`};return e=>{switch(e.code){case`invalid_type`:return`مدخلات غير مقبولة: يفترض إدخال ${e.expected}، ولكن تم إدخال ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`مدخلات غير مقبولة: يفترض إدخال ${v(e.values[0])}`:`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${m(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?` أكبر من اللازم: يفترض أن تكون ${e.origin??`القيمة`} ${n} ${e.maximum.toString()} ${r.unit??`عنصر`}`:`أكبر من اللازم: يفترض أن تكون ${e.origin??`القيمة`} ${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`أصغر من اللازم: يفترض لـ ${e.origin} أن يكون ${n} ${e.minimum.toString()} ${r.unit}`:`أصغر من اللازم: يفترض لـ ${e.origin} أن يكون ${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`نَص غير مقبول: يجب أن يبدأ بـ \"${e.prefix}\"`:t.format===`ends_with`?`نَص غير مقبول: يجب أن ينتهي بـ \"${t.suffix}\"`:t.format===`includes`?`نَص غير مقبول: يجب أن يتضمَّن \"${t.includes}\"`:t.format===`regex`?`نَص غير مقبول: يجب أن يطابق النمط ${t.pattern}`:`${r[t.format]??e.format} غير مقبول`}case`not_multiple_of`:return`رقم غير مقبول: يجب أن يكون من مضاعفات ${e.divisor}`;case`unrecognized_keys`:return`معرف${e.keys.length>1?`ات`:``} غريب${e.keys.length>1?`ة`:``}: ${m(e.keys,`، `)}`;case`invalid_key`:return`معرف غير مقبول في ${e.origin}`;case`invalid_union`:return`مدخل غير مقبول`;case`invalid_element`:return`مدخل غير مقبول في ${e.origin}`;default:return`مدخل غير مقبول`}}}}));function ri(){return{localeError:ii()}}var ii,ai=t((()=>{x(),ii=()=>{let e={string:{unit:`simvol`,verb:`olmalıdır`},file:{unit:`bayt`,verb:`olmalıdır`},array:{unit:`element`,verb:`olmalıdır`},set:{unit:`element`,verb:`olmalıdır`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`number`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,jwt:`JWT`,template_literal:`input`};return e=>{switch(e.code){case`invalid_type`:return`Yanlış dəyər: gözlənilən ${e.expected}, daxil olan ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Yanlış dəyər: gözlənilən ${v(e.values[0])}`:`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${m(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Çox böyük: gözlənilən ${e.origin??`dəyər`} ${n}${e.maximum.toString()} ${r.unit??`element`}`:`Çox böyük: gözlənilən ${e.origin??`dəyər`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Çox kiçik: gözlənilən ${e.origin} ${n}${e.minimum.toString()} ${r.unit}`:`Çox kiçik: gözlənilən ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Yanlış mətn: \"${t.prefix}\" ilə başlamalıdır`:t.format===`ends_with`?`Yanlış mətn: \"${t.suffix}\" ilə bitməlidir`:t.format===`includes`?`Yanlış mətn: \"${t.includes}\" daxil olmalıdır`:t.format===`regex`?`Yanlış mətn: ${t.pattern} şablonuna uyğun olmalıdır`:`Yanlış ${r[t.format]??e.format}`}case`not_multiple_of`:return`Yanlış ədəd: ${e.divisor} ilə bölünə bilən olmalıdır`;case`unrecognized_keys`:return`Tanınmayan açar${e.keys.length>1?`lar`:``}: ${m(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} daxilində yanlış açar`;case`invalid_union`:return`Yanlış dəyər`;case`invalid_element`:return`${e.origin} daxilində yanlış dəyər`;default:return`Yanlış dəyər`}}}}));function oi(e,t,n,r){let i=Math.abs(e),a=i%10,o=i%100;return o>=11&&o<=19?r:a===1?t:a>=2&&a<=4?n:r}function si(){return{localeError:ci()}}var ci,li=t((()=>{x(),ci=()=>{let e={string:{unit:{one:`сімвал`,few:`сімвалы`,many:`сімвалаў`},verb:`мець`},array:{unit:{one:`элемент`,few:`элементы`,many:`элементаў`},verb:`мець`},set:{unit:{one:`элемент`,few:`элементы`,many:`элементаў`},verb:`мець`},file:{unit:{one:`байт`,few:`байты`,many:`байтаў`},verb:`мець`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`лік`;case`object`:if(Array.isArray(e))return`масіў`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`увод`,email:`email адрас`,url:`URL`,emoji:`эмодзі`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO дата і час`,date:`ISO дата`,time:`ISO час`,duration:`ISO працягласць`,ipv4:`IPv4 адрас`,ipv6:`IPv6 адрас`,cidrv4:`IPv4 дыяпазон`,cidrv6:`IPv6 дыяпазон`,base64:`радок у фармаце base64`,base64url:`радок у фармаце base64url`,json_string:`JSON радок`,e164:`нумар E.164`,jwt:`JWT`,template_literal:`увод`};return e=>{switch(e.code){case`invalid_type`:return`Няправільны ўвод: чакаўся ${e.expected}, атрымана ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Няправільны ўвод: чакалася ${v(e.values[0])}`:`Няправільны варыянт: чакаўся адзін з ${m(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);if(r){let t=oi(Number(e.maximum),r.unit.one,r.unit.few,r.unit.many);return`Занадта вялікі: чакалася, што ${e.origin??`значэнне`} павінна ${r.verb} ${n}${e.maximum.toString()} ${t}`}return`Занадта вялікі: чакалася, што ${e.origin??`значэнне`} павінна быць ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);if(r){let t=oi(Number(e.minimum),r.unit.one,r.unit.few,r.unit.many);return`Занадта малы: чакалася, што ${e.origin} павінна ${r.verb} ${n}${e.minimum.toString()} ${t}`}return`Занадта малы: чакалася, што ${e.origin} павінна быць ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Няправільны радок: павінен пачынацца з \"${t.prefix}\"`:t.format===`ends_with`?`Няправільны радок: павінен заканчвацца на \"${t.suffix}\"`:t.format===`includes`?`Няправільны радок: павінен змяшчаць \"${t.includes}\"`:t.format===`regex`?`Няправільны радок: павінен адпавядаць шаблону ${t.pattern}`:`Няправільны ${r[t.format]??e.format}`}case`not_multiple_of`:return`Няправільны лік: павінен быць кратным ${e.divisor}`;case`unrecognized_keys`:return`Нераспазнаны ${e.keys.length>1?`ключы`:`ключ`}: ${m(e.keys,`, `)}`;case`invalid_key`:return`Няправільны ключ у ${e.origin}`;case`invalid_union`:return`Няправільны ўвод`;case`invalid_element`:return`Няправільнае значэнне ў ${e.origin}`;default:return`Няправільны ўвод`}}}}));function ui(){return{localeError:di()}}var di,fi=t((()=>{x(),di=()=>{let e={string:{unit:`caràcters`,verb:`contenir`},file:{unit:`bytes`,verb:`contenir`},array:{unit:`elements`,verb:`contenir`},set:{unit:`elements`,verb:`contenir`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`number`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`entrada`,email:`adreça electrònica`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`data i hora ISO`,date:`data ISO`,time:`hora ISO`,duration:`durada ISO`,ipv4:`adreça IPv4`,ipv6:`adreça IPv6`,cidrv4:`rang IPv4`,cidrv6:`rang IPv6`,base64:`cadena codificada en base64`,base64url:`cadena codificada en base64url`,json_string:`cadena JSON`,e164:`número E.164`,jwt:`JWT`,template_literal:`entrada`};return e=>{switch(e.code){case`invalid_type`:return`Tipus invàlid: s'esperava ${e.expected}, s'ha rebut ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Valor invàlid: s'esperava ${v(e.values[0])}`:`Opció invàlida: s'esperava una de ${m(e.values,` o `)}`;case`too_big`:{let n=e.inclusive?`com a màxim`:`menys de`,r=t(e.origin);return r?`Massa gran: s'esperava que ${e.origin??`el valor`} contingués ${n} ${e.maximum.toString()} ${r.unit??`elements`}`:`Massa gran: s'esperava que ${e.origin??`el valor`} fos ${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`com a mínim`:`més de`,r=t(e.origin);return r?`Massa petit: s'esperava que ${e.origin} contingués ${n} ${e.minimum.toString()} ${r.unit}`:`Massa petit: s'esperava que ${e.origin} fos ${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Format invàlid: ha de començar amb \"${t.prefix}\"`:t.format===`ends_with`?`Format invàlid: ha d'acabar amb \"${t.suffix}\"`:t.format===`includes`?`Format invàlid: ha d'incloure \"${t.includes}\"`:t.format===`regex`?`Format invàlid: ha de coincidir amb el patró ${t.pattern}`:`Format invàlid per a ${r[t.format]??e.format}`}case`not_multiple_of`:return`Número invàlid: ha de ser múltiple de ${e.divisor}`;case`unrecognized_keys`:return`Clau${e.keys.length>1?`s`:``} no reconeguda${e.keys.length>1?`s`:``}: ${m(e.keys,`, `)}`;case`invalid_key`:return`Clau invàlida a ${e.origin}`;case`invalid_union`:return`Entrada invàlida`;case`invalid_element`:return`Element invàlid a ${e.origin}`;default:return`Entrada invàlida`}}}}));function pi(){return{localeError:mi()}}var mi,hi=t((()=>{x(),mi=()=>{let e={string:{unit:`znaků`,verb:`mít`},file:{unit:`bajtů`,verb:`mít`},array:{unit:`prvků`,verb:`mít`},set:{unit:`prvků`,verb:`mít`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`číslo`;case`string`:return`řetězec`;case`boolean`:return`boolean`;case`bigint`:return`bigint`;case`function`:return`funkce`;case`symbol`:return`symbol`;case`undefined`:return`undefined`;case`object`:if(Array.isArray(e))return`pole`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`regulární výraz`,email:`e-mailová adresa`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`datum a čas ve formátu ISO`,date:`datum ve formátu ISO`,time:`čas ve formátu ISO`,duration:`doba trvání ISO`,ipv4:`IPv4 adresa`,ipv6:`IPv6 adresa`,cidrv4:`rozsah IPv4`,cidrv6:`rozsah IPv6`,base64:`řetězec zakódovaný ve formátu base64`,base64url:`řetězec zakódovaný ve formátu base64url`,json_string:`řetězec ve formátu JSON`,e164:`číslo E.164`,jwt:`JWT`,template_literal:`vstup`};return e=>{switch(e.code){case`invalid_type`:return`Neplatný vstup: očekáváno ${e.expected}, obdrženo ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Neplatný vstup: očekáváno ${v(e.values[0])}`:`Neplatná možnost: očekávána jedna z hodnot ${m(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Hodnota je příliš velká: ${e.origin??`hodnota`} musí mít ${n}${e.maximum.toString()} ${r.unit??`prvků`}`:`Hodnota je příliš velká: ${e.origin??`hodnota`} musí být ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Hodnota je příliš malá: ${e.origin??`hodnota`} musí mít ${n}${e.minimum.toString()} ${r.unit??`prvků`}`:`Hodnota je příliš malá: ${e.origin??`hodnota`} musí být ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Neplatný řetězec: musí začínat na \"${t.prefix}\"`:t.format===`ends_with`?`Neplatný řetězec: musí končit na \"${t.suffix}\"`:t.format===`includes`?`Neplatný řetězec: musí obsahovat \"${t.includes}\"`:t.format===`regex`?`Neplatný řetězec: musí odpovídat vzoru ${t.pattern}`:`Neplatný formát ${r[t.format]??e.format}`}case`not_multiple_of`:return`Neplatné číslo: musí být násobkem ${e.divisor}`;case`unrecognized_keys`:return`Neznámé klíče: ${m(e.keys,`, `)}`;case`invalid_key`:return`Neplatný klíč v ${e.origin}`;case`invalid_union`:return`Neplatný vstup`;case`invalid_element`:return`Neplatná hodnota v ${e.origin}`;default:return`Neplatný vstup`}}}}));function gi(){return{localeError:_i()}}var _i,vi=t((()=>{x(),_i=()=>{let e={string:{unit:`Zeichen`,verb:`zu haben`},file:{unit:`Bytes`,verb:`zu haben`},array:{unit:`Elemente`,verb:`zu haben`},set:{unit:`Elemente`,verb:`zu haben`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`Zahl`;case`object`:if(Array.isArray(e))return`Array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`Eingabe`,email:`E-Mail-Adresse`,url:`URL`,emoji:`Emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO-Datum und -Uhrzeit`,date:`ISO-Datum`,time:`ISO-Uhrzeit`,duration:`ISO-Dauer`,ipv4:`IPv4-Adresse`,ipv6:`IPv6-Adresse`,cidrv4:`IPv4-Bereich`,cidrv6:`IPv6-Bereich`,base64:`Base64-codierter String`,base64url:`Base64-URL-codierter String`,json_string:`JSON-String`,e164:`E.164-Nummer`,jwt:`JWT`,template_literal:`Eingabe`};return e=>{switch(e.code){case`invalid_type`:return`Ungültige Eingabe: erwartet ${e.expected}, erhalten ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Ungültige Eingabe: erwartet ${v(e.values[0])}`:`Ungültige Option: erwartet eine von ${m(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Zu groß: erwartet, dass ${e.origin??`Wert`} ${n}${e.maximum.toString()} ${r.unit??`Elemente`} hat`:`Zu groß: erwartet, dass ${e.origin??`Wert`} ${n}${e.maximum.toString()} ist`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Zu klein: erwartet, dass ${e.origin} ${n}${e.minimum.toString()} ${r.unit} hat`:`Zu klein: erwartet, dass ${e.origin} ${n}${e.minimum.toString()} ist`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ungültiger String: muss mit \"${t.prefix}\" beginnen`:t.format===`ends_with`?`Ungültiger String: muss mit \"${t.suffix}\" enden`:t.format===`includes`?`Ungültiger String: muss \"${t.includes}\" enthalten`:t.format===`regex`?`Ungültiger String: muss dem Muster ${t.pattern} entsprechen`:`Ungültig: ${r[t.format]??e.format}`}case`not_multiple_of`:return`Ungültige Zahl: muss ein Vielfaches von ${e.divisor} sein`;case`unrecognized_keys`:return`${e.keys.length>1?`Unbekannte Schlüssel`:`Unbekannter Schlüssel`}: ${m(e.keys,`, `)}`;case`invalid_key`:return`Ungültiger Schlüssel in ${e.origin}`;case`invalid_union`:return`Ungültige Eingabe`;case`invalid_element`:return`Ungültiger Wert in ${e.origin}`;default:return`Ungültige Eingabe`}}}}));function yi(){return{localeError:xi()}}var bi,xi,Si=t((()=>{x(),bi=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`number`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},xi=()=>{let e={string:{unit:`characters`,verb:`to have`},file:{unit:`bytes`,verb:`to have`},array:{unit:`items`,verb:`to have`},set:{unit:`items`,verb:`to have`}};function t(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,jwt:`JWT`,template_literal:`input`};return e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${e.expected}, received ${bi(e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${v(e.values[0])}`:`Invalid option: expected one of ${m(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with \"${t.prefix}\"`:t.format===`ends_with`?`Invalid string: must end with \"${t.suffix}\"`:t.format===`includes`?`Invalid string: must include \"${t.includes}\"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${m(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}}}));function Ci(){return{localeError:Ti()}}var wi,Ti,Ei=t((()=>{x(),wi=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`nombro`;case`object`:if(Array.isArray(e))return`tabelo`;if(e===null)return`senvalora`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},Ti=()=>{let e={string:{unit:`karaktrojn`,verb:`havi`},file:{unit:`bajtojn`,verb:`havi`},array:{unit:`elementojn`,verb:`havi`},set:{unit:`elementojn`,verb:`havi`}};function t(t){return e[t]??null}let n={regex:`enigo`,email:`retadreso`,url:`URL`,emoji:`emoĝio`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO-datotempo`,date:`ISO-dato`,time:`ISO-tempo`,duration:`ISO-daŭro`,ipv4:`IPv4-adreso`,ipv6:`IPv6-adreso`,cidrv4:`IPv4-rango`,cidrv6:`IPv6-rango`,base64:`64-ume kodita karaktraro`,base64url:`URL-64-ume kodita karaktraro`,json_string:`JSON-karaktraro`,e164:`E.164-nombro`,jwt:`JWT`,template_literal:`enigo`};return e=>{switch(e.code){case`invalid_type`:return`Nevalida enigo: atendiĝis ${e.expected}, riceviĝis ${wi(e.input)}`;case`invalid_value`:return e.values.length===1?`Nevalida enigo: atendiĝis ${v(e.values[0])}`:`Nevalida opcio: atendiĝis unu el ${m(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Tro granda: atendiĝis ke ${e.origin??`valoro`} havu ${n}${e.maximum.toString()} ${r.unit??`elementojn`}`:`Tro granda: atendiĝis ke ${e.origin??`valoro`} havu ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Tro malgranda: atendiĝis ke ${e.origin} havu ${n}${e.minimum.toString()} ${r.unit}`:`Tro malgranda: atendiĝis ke ${e.origin} estu ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Nevalida karaktraro: devas komenciĝi per \"${t.prefix}\"`:t.format===`ends_with`?`Nevalida karaktraro: devas finiĝi per \"${t.suffix}\"`:t.format===`includes`?`Nevalida karaktraro: devas inkluzivi \"${t.includes}\"`:t.format===`regex`?`Nevalida karaktraro: devas kongrui kun la modelo ${t.pattern}`:`Nevalida ${n[t.format]??e.format}`}case`not_multiple_of`:return`Nevalida nombro: devas esti oblo de ${e.divisor}`;case`unrecognized_keys`:return`Nekonata${e.keys.length>1?`j`:``} ŝlosilo${e.keys.length>1?`j`:``}: ${m(e.keys,`, `)}`;case`invalid_key`:return`Nevalida ŝlosilo en ${e.origin}`;case`invalid_union`:return`Nevalida enigo`;case`invalid_element`:return`Nevalida valoro en ${e.origin}`;default:return`Nevalida enigo`}}}}));function Di(){return{localeError:Oi()}}var Oi,ki=t((()=>{x(),Oi=()=>{let e={string:{unit:`caracteres`,verb:`tener`},file:{unit:`bytes`,verb:`tener`},array:{unit:`elementos`,verb:`tener`},set:{unit:`elementos`,verb:`tener`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`número`;case`object`:if(Array.isArray(e))return`arreglo`;if(e===null)return`nulo`;if(Object.getPrototypeOf(e)!==Object.prototype)return e.constructor.name}return t},r={regex:`entrada`,email:`dirección de correo electrónico`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`fecha y hora ISO`,date:`fecha ISO`,time:`hora ISO`,duration:`duración ISO`,ipv4:`dirección IPv4`,ipv6:`dirección IPv6`,cidrv4:`rango IPv4`,cidrv6:`rango IPv6`,base64:`cadena codificada en base64`,base64url:`URL codificada en base64`,json_string:`cadena JSON`,e164:`número E.164`,jwt:`JWT`,template_literal:`entrada`};return e=>{switch(e.code){case`invalid_type`:return`Entrada inválida: se esperaba ${e.expected}, recibido ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Entrada inválida: se esperaba ${v(e.values[0])}`:`Opción inválida: se esperaba una de ${m(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Demasiado grande: se esperaba que ${e.origin??`valor`} tuviera ${n}${e.maximum.toString()} ${r.unit??`elementos`}`:`Demasiado grande: se esperaba que ${e.origin??`valor`} fuera ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Demasiado pequeño: se esperaba que ${e.origin} tuviera ${n}${e.minimum.toString()} ${r.unit}`:`Demasiado pequeño: se esperaba que ${e.origin} fuera ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Cadena inválida: debe comenzar con \"${t.prefix}\"`:t.format===`ends_with`?`Cadena inválida: debe terminar en \"${t.suffix}\"`:t.format===`includes`?`Cadena inválida: debe incluir \"${t.includes}\"`:t.format===`regex`?`Cadena inválida: debe coincidir con el patrón ${t.pattern}`:`Inválido ${r[t.format]??e.format}`}case`not_multiple_of`:return`Número inválido: debe ser múltiplo de ${e.divisor}`;case`unrecognized_keys`:return`Llave${e.keys.length>1?`s`:``} desconocida${e.keys.length>1?`s`:``}: ${m(e.keys,`, `)}`;case`invalid_key`:return`Llave inválida en ${e.origin}`;case`invalid_union`:return`Entrada inválida`;case`invalid_element`:return`Valor inválido en ${e.origin}`;default:return`Entrada inválida`}}}}));function Ai(){return{localeError:ji()}}var ji,Mi=t((()=>{x(),ji=()=>{let e={string:{unit:`کاراکتر`,verb:`داشته باشد`},file:{unit:`بایت`,verb:`داشته باشد`},array:{unit:`آیتم`,verb:`داشته باشد`},set:{unit:`آیتم`,verb:`داشته باشد`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`عدد`;case`object`:if(Array.isArray(e))return`آرایه`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`ورودی`,email:`آدرس ایمیل`,url:`URL`,emoji:`ایموجی`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`تاریخ و زمان ایزو`,date:`تاریخ ایزو`,time:`زمان ایزو`,duration:`مدت زمان ایزو`,ipv4:`IPv4 آدرس`,ipv6:`IPv6 آدرس`,cidrv4:`IPv4 دامنه`,cidrv6:`IPv6 دامنه`,base64:`base64-encoded رشته`,base64url:`base64url-encoded رشته`,json_string:`JSON رشته`,e164:`E.164 عدد`,jwt:`JWT`,template_literal:`ورودی`};return e=>{switch(e.code){case`invalid_type`:return`ورودی نامعتبر: میبایست ${e.expected} میبود، ${n(e.input)} دریافت شد`;case`invalid_value`:return e.values.length===1?`ورودی نامعتبر: میبایست ${v(e.values[0])} میبود`:`گزینه نامعتبر: میبایست یکی از ${m(e.values,`|`)} میبود`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`خیلی بزرگ: ${e.origin??`مقدار`} باید ${n}${e.maximum.toString()} ${r.unit??`عنصر`} باشد`:`خیلی بزرگ: ${e.origin??`مقدار`} باید ${n}${e.maximum.toString()} باشد`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`خیلی کوچک: ${e.origin} باید ${n}${e.minimum.toString()} ${r.unit} باشد`:`خیلی کوچک: ${e.origin} باید ${n}${e.minimum.toString()} باشد`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`رشته نامعتبر: باید با \"${t.prefix}\" شروع شود`:t.format===`ends_with`?`رشته نامعتبر: باید با \"${t.suffix}\" تمام شود`:t.format===`includes`?`رشته نامعتبر: باید شامل \"${t.includes}\" باشد`:t.format===`regex`?`رشته نامعتبر: باید با الگوی ${t.pattern} مطابقت داشته باشد`:`${r[t.format]??e.format} نامعتبر`}case`not_multiple_of`:return`عدد نامعتبر: باید مضرب ${e.divisor} باشد`;case`unrecognized_keys`:return`کلید${e.keys.length>1?`های`:``} ناشناس: ${m(e.keys,`, `)}`;case`invalid_key`:return`کلید ناشناس در ${e.origin}`;case`invalid_union`:return`ورودی نامعتبر`;case`invalid_element`:return`مقدار نامعتبر در ${e.origin}`;default:return`ورودی نامعتبر`}}}}));function Ni(){return{localeError:Pi()}}var Pi,Fi=t((()=>{x(),Pi=()=>{let e={string:{unit:`merkkiä`,subject:`merkkijonon`},file:{unit:`tavua`,subject:`tiedoston`},array:{unit:`alkiota`,subject:`listan`},set:{unit:`alkiota`,subject:`joukon`},number:{unit:``,subject:`luvun`},bigint:{unit:``,subject:`suuren kokonaisluvun`},int:{unit:``,subject:`kokonaisluvun`},date:{unit:``,subject:`päivämäärän`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`number`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`säännöllinen lauseke`,email:`sähköpostiosoite`,url:`URL-osoite`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO-aikaleima`,date:`ISO-päivämäärä`,time:`ISO-aika`,duration:`ISO-kesto`,ipv4:`IPv4-osoite`,ipv6:`IPv6-osoite`,cidrv4:`IPv4-alue`,cidrv6:`IPv6-alue`,base64:`base64-koodattu merkkijono`,base64url:`base64url-koodattu merkkijono`,json_string:`JSON-merkkijono`,e164:`E.164-luku`,jwt:`JWT`,template_literal:`templaattimerkkijono`};return e=>{switch(e.code){case`invalid_type`:return`Virheellinen tyyppi: odotettiin ${e.expected}, oli ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Virheellinen syöte: täytyy olla ${v(e.values[0])}`:`Virheellinen valinta: täytyy olla yksi seuraavista: ${m(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Liian suuri: ${r.subject} täytyy olla ${n}${e.maximum.toString()} ${r.unit}`.trim():`Liian suuri: arvon täytyy olla ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Liian pieni: ${r.subject} täytyy olla ${n}${e.minimum.toString()} ${r.unit}`.trim():`Liian pieni: arvon täytyy olla ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Virheellinen syöte: täytyy alkaa \"${t.prefix}\"`:t.format===`ends_with`?`Virheellinen syöte: täytyy loppua \"${t.suffix}\"`:t.format===`includes`?`Virheellinen syöte: täytyy sisältää \"${t.includes}\"`:t.format===`regex`?`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${t.pattern}`:`Virheellinen ${r[t.format]??e.format}`}case`not_multiple_of`:return`Virheellinen luku: täytyy olla luvun ${e.divisor} monikerta`;case`unrecognized_keys`:return`${e.keys.length>1?`Tuntemattomat avaimet`:`Tuntematon avain`}: ${m(e.keys,`, `)}`;case`invalid_key`:return`Virheellinen avain tietueessa`;case`invalid_union`:return`Virheellinen unioni`;case`invalid_element`:return`Virheellinen arvo joukossa`;default:return`Virheellinen syöte`}}}}));function Ii(){return{localeError:Li()}}var Li,Ri=t((()=>{x(),Li=()=>{let e={string:{unit:`caractères`,verb:`avoir`},file:{unit:`octets`,verb:`avoir`},array:{unit:`éléments`,verb:`avoir`},set:{unit:`éléments`,verb:`avoir`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`nombre`;case`object`:if(Array.isArray(e))return`tableau`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`entrée`,email:`adresse e-mail`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`date et heure ISO`,date:`date ISO`,time:`heure ISO`,duration:`durée ISO`,ipv4:`adresse IPv4`,ipv6:`adresse IPv6`,cidrv4:`plage IPv4`,cidrv6:`plage IPv6`,base64:`chaîne encodée en base64`,base64url:`chaîne encodée en base64url`,json_string:`chaîne JSON`,e164:`numéro E.164`,jwt:`JWT`,template_literal:`entrée`};return e=>{switch(e.code){case`invalid_type`:return`Entrée invalide : ${e.expected} attendu, ${n(e.input)} reçu`;case`invalid_value`:return e.values.length===1?`Entrée invalide : ${v(e.values[0])} attendu`:`Option invalide : une valeur parmi ${m(e.values,`|`)} attendue`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Trop grand : ${e.origin??`valeur`} doit ${r.verb} ${n}${e.maximum.toString()} ${r.unit??`élément(s)`}`:`Trop grand : ${e.origin??`valeur`} doit être ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Trop petit : ${e.origin} doit ${r.verb} ${n}${e.minimum.toString()} ${r.unit}`:`Trop petit : ${e.origin} doit être ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Chaîne invalide : doit commencer par \"${t.prefix}\"`:t.format===`ends_with`?`Chaîne invalide : doit se terminer par \"${t.suffix}\"`:t.format===`includes`?`Chaîne invalide : doit inclure \"${t.includes}\"`:t.format===`regex`?`Chaîne invalide : doit correspondre au modèle ${t.pattern}`:`${r[t.format]??e.format} invalide`}case`not_multiple_of`:return`Nombre invalide : doit être un multiple de ${e.divisor}`;case`unrecognized_keys`:return`Clé${e.keys.length>1?`s`:``} non reconnue${e.keys.length>1?`s`:``} : ${m(e.keys,`, `)}`;case`invalid_key`:return`Clé invalide dans ${e.origin}`;case`invalid_union`:return`Entrée invalide`;case`invalid_element`:return`Valeur invalide dans ${e.origin}`;default:return`Entrée invalide`}}}}));function zi(){return{localeError:Bi()}}var Bi,Vi=t((()=>{x(),Bi=()=>{let e={string:{unit:`caractères`,verb:`avoir`},file:{unit:`octets`,verb:`avoir`},array:{unit:`éléments`,verb:`avoir`},set:{unit:`éléments`,verb:`avoir`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`number`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`entrée`,email:`adresse courriel`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`date-heure ISO`,date:`date ISO`,time:`heure ISO`,duration:`durée ISO`,ipv4:`adresse IPv4`,ipv6:`adresse IPv6`,cidrv4:`plage IPv4`,cidrv6:`plage IPv6`,base64:`chaîne encodée en base64`,base64url:`chaîne encodée en base64url`,json_string:`chaîne JSON`,e164:`numéro E.164`,jwt:`JWT`,template_literal:`entrée`};return e=>{switch(e.code){case`invalid_type`:return`Entrée invalide : attendu ${e.expected}, reçu ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Entrée invalide : attendu ${v(e.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${m(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`≤`:`<`,r=t(e.origin);return r?`Trop grand : attendu que ${e.origin??`la valeur`} ait ${n}${e.maximum.toString()} ${r.unit}`:`Trop grand : attendu que ${e.origin??`la valeur`} soit ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`≥`:`>`,r=t(e.origin);return r?`Trop petit : attendu que ${e.origin} ait ${n}${e.minimum.toString()} ${r.unit}`:`Trop petit : attendu que ${e.origin} soit ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Chaîne invalide : doit commencer par \"${t.prefix}\"`:t.format===`ends_with`?`Chaîne invalide : doit se terminer par \"${t.suffix}\"`:t.format===`includes`?`Chaîne invalide : doit inclure \"${t.includes}\"`:t.format===`regex`?`Chaîne invalide : doit correspondre au motif ${t.pattern}`:`${r[t.format]??e.format} invalide`}case`not_multiple_of`:return`Nombre invalide : doit être un multiple de ${e.divisor}`;case`unrecognized_keys`:return`Clé${e.keys.length>1?`s`:``} non reconnue${e.keys.length>1?`s`:``} : ${m(e.keys,`, `)}`;case`invalid_key`:return`Clé invalide dans ${e.origin}`;case`invalid_union`:return`Entrée invalide`;case`invalid_element`:return`Valeur invalide dans ${e.origin}`;default:return`Entrée invalide`}}}}));function Hi(){return{localeError:Ui()}}var Ui,Wi=t((()=>{x(),Ui=()=>{let e={string:{unit:`אותיות`,verb:`לכלול`},file:{unit:`בייטים`,verb:`לכלול`},array:{unit:`פריטים`,verb:`לכלול`},set:{unit:`פריטים`,verb:`לכלול`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`number`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`קלט`,email:`כתובת אימייל`,url:`כתובת רשת`,emoji:`אימוג'י`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`תאריך וזמן ISO`,date:`תאריך ISO`,time:`זמן ISO`,duration:`משך זמן ISO`,ipv4:`כתובת IPv4`,ipv6:`כתובת IPv6`,cidrv4:`טווח IPv4`,cidrv6:`טווח IPv6`,base64:`מחרוזת בבסיס 64`,base64url:`מחרוזת בבסיס 64 לכתובות רשת`,json_string:`מחרוזת JSON`,e164:`מספר E.164`,jwt:`JWT`,template_literal:`קלט`};return e=>{switch(e.code){case`invalid_type`:return`קלט לא תקין: צריך ${e.expected}, התקבל ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`קלט לא תקין: צריך ${v(e.values[0])}`:`קלט לא תקין: צריך אחת מהאפשרויות ${m(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`גדול מדי: ${e.origin??`value`} צריך להיות ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`גדול מדי: ${e.origin??`value`} צריך להיות ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`קטן מדי: ${e.origin} צריך להיות ${n}${e.minimum.toString()} ${r.unit}`:`קטן מדי: ${e.origin} צריך להיות ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`מחרוזת לא תקינה: חייבת להתחיל ב\"${t.prefix}\"`:t.format===`ends_with`?`מחרוזת לא תקינה: חייבת להסתיים ב \"${t.suffix}\"`:t.format===`includes`?`מחרוזת לא תקינה: חייבת לכלול \"${t.includes}\"`:t.format===`regex`?`מחרוזת לא תקינה: חייבת להתאים לתבנית ${t.pattern}`:`${r[t.format]??e.format} לא תקין`}case`not_multiple_of`:return`מספר לא תקין: חייב להיות מכפלה של ${e.divisor}`;case`unrecognized_keys`:return`מפתח${e.keys.length>1?`ות`:``} לא מזוה${e.keys.length>1?`ים`:`ה`}: ${m(e.keys,`, `)}`;case`invalid_key`:return`מפתח לא תקין ב${e.origin}`;case`invalid_union`:return`קלט לא תקין`;case`invalid_element`:return`ערך לא תקין ב${e.origin}`;default:return`קלט לא תקין`}}}}));function Gi(){return{localeError:Ki()}}var Ki,qi=t((()=>{x(),Ki=()=>{let e={string:{unit:`karakter`,verb:`legyen`},file:{unit:`byte`,verb:`legyen`},array:{unit:`elem`,verb:`legyen`},set:{unit:`elem`,verb:`legyen`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`szám`;case`object`:if(Array.isArray(e))return`tömb`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`bemenet`,email:`email cím`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO időbélyeg`,date:`ISO dátum`,time:`ISO idő`,duration:`ISO időintervallum`,ipv4:`IPv4 cím`,ipv6:`IPv6 cím`,cidrv4:`IPv4 tartomány`,cidrv6:`IPv6 tartomány`,base64:`base64-kódolt string`,base64url:`base64url-kódolt string`,json_string:`JSON string`,e164:`E.164 szám`,jwt:`JWT`,template_literal:`bemenet`};return e=>{switch(e.code){case`invalid_type`:return`Érvénytelen bemenet: a várt érték ${e.expected}, a kapott érték ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Érvénytelen bemenet: a várt érték ${v(e.values[0])}`:`Érvénytelen opció: valamelyik érték várt ${m(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Túl nagy: ${e.origin??`érték`} mérete túl nagy ${n}${e.maximum.toString()} ${r.unit??`elem`}`:`Túl nagy: a bemeneti érték ${e.origin??`érték`} túl nagy: ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Túl kicsi: a bemeneti érték ${e.origin} mérete túl kicsi ${n}${e.minimum.toString()} ${r.unit}`:`Túl kicsi: a bemeneti érték ${e.origin} túl kicsi ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Érvénytelen string: \"${t.prefix}\" értékkel kell kezdődnie`:t.format===`ends_with`?`Érvénytelen string: \"${t.suffix}\" értékkel kell végződnie`:t.format===`includes`?`Érvénytelen string: \"${t.includes}\" értéket kell tartalmaznia`:t.format===`regex`?`Érvénytelen string: ${t.pattern} mintának kell megfelelnie`:`Érvénytelen ${r[t.format]??e.format}`}case`not_multiple_of`:return`Érvénytelen szám: ${e.divisor} többszörösének kell lennie`;case`unrecognized_keys`:return`Ismeretlen kulcs${e.keys.length>1?`s`:``}: ${m(e.keys,`, `)}`;case`invalid_key`:return`Érvénytelen kulcs ${e.origin}`;case`invalid_union`:return`Érvénytelen bemenet`;case`invalid_element`:return`Érvénytelen érték: ${e.origin}`;default:return`Érvénytelen bemenet`}}}}));function Ji(){return{localeError:Yi()}}var Yi,Xi=t((()=>{x(),Yi=()=>{let e={string:{unit:`karakter`,verb:`memiliki`},file:{unit:`byte`,verb:`memiliki`},array:{unit:`item`,verb:`memiliki`},set:{unit:`item`,verb:`memiliki`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`number`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`input`,email:`alamat email`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`tanggal dan waktu format ISO`,date:`tanggal format ISO`,time:`jam format ISO`,duration:`durasi format ISO`,ipv4:`alamat IPv4`,ipv6:`alamat IPv6`,cidrv4:`rentang alamat IPv4`,cidrv6:`rentang alamat IPv6`,base64:`string dengan enkode base64`,base64url:`string dengan enkode base64url`,json_string:`string JSON`,e164:`angka E.164`,jwt:`JWT`,template_literal:`input`};return e=>{switch(e.code){case`invalid_type`:return`Input tidak valid: diharapkan ${e.expected}, diterima ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Input tidak valid: diharapkan ${v(e.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${m(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Terlalu besar: diharapkan ${e.origin??`value`} memiliki ${n}${e.maximum.toString()} ${r.unit??`elemen`}`:`Terlalu besar: diharapkan ${e.origin??`value`} menjadi ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Terlalu kecil: diharapkan ${e.origin} memiliki ${n}${e.minimum.toString()} ${r.unit}`:`Terlalu kecil: diharapkan ${e.origin} menjadi ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`String tidak valid: harus dimulai dengan \"${t.prefix}\"`:t.format===`ends_with`?`String tidak valid: harus berakhir dengan \"${t.suffix}\"`:t.format===`includes`?`String tidak valid: harus menyertakan \"${t.includes}\"`:t.format===`regex`?`String tidak valid: harus sesuai pola ${t.pattern}`:`${r[t.format]??e.format} tidak valid`}case`not_multiple_of`:return`Angka tidak valid: harus kelipatan dari ${e.divisor}`;case`unrecognized_keys`:return`Kunci tidak dikenali ${e.keys.length>1?`s`:``}: ${m(e.keys,`, `)}`;case`invalid_key`:return`Kunci tidak valid di ${e.origin}`;case`invalid_union`:return`Input tidak valid`;case`invalid_element`:return`Nilai tidak valid di ${e.origin}`;default:return`Input tidak valid`}}}}));function Zi(){return{localeError:Qi()}}var Qi,$i=t((()=>{x(),Qi=()=>{let e={string:{unit:`caratteri`,verb:`avere`},file:{unit:`byte`,verb:`avere`},array:{unit:`elementi`,verb:`avere`},set:{unit:`elementi`,verb:`avere`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`numero`;case`object`:if(Array.isArray(e))return`vettore`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`input`,email:`indirizzo email`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`data e ora ISO`,date:`data ISO`,time:`ora ISO`,duration:`durata ISO`,ipv4:`indirizzo IPv4`,ipv6:`indirizzo IPv6`,cidrv4:`intervallo IPv4`,cidrv6:`intervallo IPv6`,base64:`stringa codificata in base64`,base64url:`URL codificata in base64`,json_string:`stringa JSON`,e164:`numero E.164`,jwt:`JWT`,template_literal:`input`};return e=>{switch(e.code){case`invalid_type`:return`Input non valido: atteso ${e.expected}, ricevuto ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Input non valido: atteso ${v(e.values[0])}`:`Opzione non valida: atteso uno tra ${m(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Troppo grande: ${e.origin??`valore`} deve avere ${n}${e.maximum.toString()} ${r.unit??`elementi`}`:`Troppo grande: ${e.origin??`valore`} deve essere ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Troppo piccolo: ${e.origin} deve avere ${n}${e.minimum.toString()} ${r.unit}`:`Troppo piccolo: ${e.origin} deve essere ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Stringa non valida: deve iniziare con \"${t.prefix}\"`:t.format===`ends_with`?`Stringa non valida: deve terminare con \"${t.suffix}\"`:t.format===`includes`?`Stringa non valida: deve includere \"${t.includes}\"`:t.format===`regex`?`Stringa non valida: deve corrispondere al pattern ${t.pattern}`:`Invalid ${r[t.format]??e.format}`}case`not_multiple_of`:return`Numero non valido: deve essere un multiplo di ${e.divisor}`;case`unrecognized_keys`:return`Chiav${e.keys.length>1?`i`:`e`} non riconosciut${e.keys.length>1?`e`:`a`}: ${m(e.keys,`, `)}`;case`invalid_key`:return`Chiave non valida in ${e.origin}`;case`invalid_union`:return`Input non valido`;case`invalid_element`:return`Valore non valido in ${e.origin}`;default:return`Input non valido`}}}}));function ea(){return{localeError:ta()}}var ta,na=t((()=>{x(),ta=()=>{let e={string:{unit:`文字`,verb:`である`},file:{unit:`バイト`,verb:`である`},array:{unit:`要素`,verb:`である`},set:{unit:`要素`,verb:`である`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`数値`;case`object`:if(Array.isArray(e))return`配列`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`入力値`,email:`メールアドレス`,url:`URL`,emoji:`絵文字`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO日時`,date:`ISO日付`,time:`ISO時刻`,duration:`ISO期間`,ipv4:`IPv4アドレス`,ipv6:`IPv6アドレス`,cidrv4:`IPv4範囲`,cidrv6:`IPv6範囲`,base64:`base64エンコード文字列`,base64url:`base64urlエンコード文字列`,json_string:`JSON文字列`,e164:`E.164番号`,jwt:`JWT`,template_literal:`入力値`};return e=>{switch(e.code){case`invalid_type`:return`無効な入力: ${e.expected}が期待されましたが、${n(e.input)}が入力されました`;case`invalid_value`:return e.values.length===1?`無効な入力: ${v(e.values[0])}が期待されました`:`無効な選択: ${m(e.values,`、`)}のいずれかである必要があります`;case`too_big`:{let n=e.inclusive?`以下である`:`より小さい`,r=t(e.origin);return r?`大きすぎる値: ${e.origin??`値`}は${e.maximum.toString()}${r.unit??`要素`}${n}必要があります`:`大きすぎる値: ${e.origin??`値`}は${e.maximum.toString()}${n}必要があります`}case`too_small`:{let n=e.inclusive?`以上である`:`より大きい`,r=t(e.origin);return r?`小さすぎる値: ${e.origin}は${e.minimum.toString()}${r.unit}${n}必要があります`:`小さすぎる値: ${e.origin}は${e.minimum.toString()}${n}必要があります`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`無効な文字列: \"${t.prefix}\"で始まる必要があります`:t.format===`ends_with`?`無効な文字列: \"${t.suffix}\"で終わる必要があります`:t.format===`includes`?`無効な文字列: \"${t.includes}\"を含む必要があります`:t.format===`regex`?`無効な文字列: パターン${t.pattern}に一致する必要があります`:`無効な${r[t.format]??e.format}`}case`not_multiple_of`:return`無効な数値: ${e.divisor}の倍数である必要があります`;case`unrecognized_keys`:return`認識されていないキー${e.keys.length>1?`群`:``}: ${m(e.keys,`、`)}`;case`invalid_key`:return`${e.origin}内の無効なキー`;case`invalid_union`:return`無効な入力`;case`invalid_element`:return`${e.origin}内の無効な値`;default:return`無効な入力`}}}}));function ra(){return{localeError:ia()}}var ia,aa=t((()=>{x(),ia=()=>{let e={string:{unit:`តួអក្សរ`,verb:`គួរមាន`},file:{unit:`បៃ`,verb:`គួរមាន`},array:{unit:`ធាតុ`,verb:`គួរមាន`},set:{unit:`ធាតុ`,verb:`គួរមាន`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`មិនមែនជាលេខ (NaN)`:`លេខ`;case`object`:if(Array.isArray(e))return`អារេ (Array)`;if(e===null)return`គ្មានតម្លៃ (null)`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`ទិន្នន័យបញ្ចូល`,email:`អាសយដ្ឋានអ៊ីមែល`,url:`URL`,emoji:`សញ្ញាអារម្មណ៍`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`កាលបរិច្ឆេទ និងម៉ោង ISO`,date:`កាលបរិច្ឆេទ ISO`,time:`ម៉ោង ISO`,duration:`រយៈពេល ISO`,ipv4:`អាសយដ្ឋាន IPv4`,ipv6:`អាសយដ្ឋាន IPv6`,cidrv4:`ដែនអាសយដ្ឋាន IPv4`,cidrv6:`ដែនអាសយដ្ឋាន IPv6`,base64:`ខ្សែអក្សរអ៊ិកូដ base64`,base64url:`ខ្សែអក្សរអ៊ិកូដ base64url`,json_string:`ខ្សែអក្សរ JSON`,e164:`លេខ E.164`,jwt:`JWT`,template_literal:`ទិន្នន័យបញ្ចូល`};return e=>{switch(e.code){case`invalid_type`:return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${e.expected} ប៉ុន្តែទទួលបាន ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${v(e.values[0])}`:`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${m(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`ធំពេក៖ ត្រូវការ ${e.origin??`តម្លៃ`} ${n} ${e.maximum.toString()} ${r.unit??`ធាតុ`}`:`ធំពេក៖ ត្រូវការ ${e.origin??`តម្លៃ`} ${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`តូចពេក៖ ត្រូវការ ${e.origin} ${n} ${e.minimum.toString()} ${r.unit}`:`តូចពេក៖ ត្រូវការ ${e.origin} ${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ \"${t.prefix}\"`:t.format===`ends_with`?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ \"${t.suffix}\"`:t.format===`includes`?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន \"${t.includes}\"`:t.format===`regex`?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${t.pattern}`:`មិនត្រឹមត្រូវ៖ ${r[t.format]??e.format}`}case`not_multiple_of`:return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${e.divisor}`;case`unrecognized_keys`:return`រកឃើញសោមិនស្គាល់៖ ${m(e.keys,`, `)}`;case`invalid_key`:return`សោមិនត្រឹមត្រូវនៅក្នុង ${e.origin}`;case`invalid_union`:return`ទិន្នន័យមិនត្រឹមត្រូវ`;case`invalid_element`:return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${e.origin}`;default:return`ទិន្នន័យមិនត្រឹមត្រូវ`}}}}));function oa(){return{localeError:sa()}}var sa,ca=t((()=>{x(),sa=()=>{let e={string:{unit:`문자`,verb:`to have`},file:{unit:`바이트`,verb:`to have`},array:{unit:`개`,verb:`to have`},set:{unit:`개`,verb:`to have`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`number`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`입력`,email:`이메일 주소`,url:`URL`,emoji:`이모지`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO 날짜시간`,date:`ISO 날짜`,time:`ISO 시간`,duration:`ISO 기간`,ipv4:`IPv4 주소`,ipv6:`IPv6 주소`,cidrv4:`IPv4 범위`,cidrv6:`IPv6 범위`,base64:`base64 인코딩 문자열`,base64url:`base64url 인코딩 문자열`,json_string:`JSON 문자열`,e164:`E.164 번호`,jwt:`JWT`,template_literal:`입력`};return e=>{switch(e.code){case`invalid_type`:return`잘못된 입력: 예상 타입은 ${e.expected}, 받은 타입은 ${n(e.input)}입니다`;case`invalid_value`:return e.values.length===1?`잘못된 입력: 값은 ${v(e.values[0])} 이어야 합니다`:`잘못된 옵션: ${m(e.values,`또는 `)} 중 하나여야 합니다`;case`too_big`:{let n=e.inclusive?`이하`:`미만`,r=n===`미만`?`이어야 합니다`:`여야 합니다`,i=t(e.origin),a=i?.unit??`요소`;return i?`${e.origin??`값`}이 너무 큽니다: ${e.maximum.toString()}${a} ${n}${r}`:`${e.origin??`값`}이 너무 큽니다: ${e.maximum.toString()} ${n}${r}`}case`too_small`:{let n=e.inclusive?`이상`:`초과`,r=n===`이상`?`이어야 합니다`:`여야 합니다`,i=t(e.origin),a=i?.unit??`요소`;return i?`${e.origin??`값`}이 너무 작습니다: ${e.minimum.toString()}${a} ${n}${r}`:`${e.origin??`값`}이 너무 작습니다: ${e.minimum.toString()} ${n}${r}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`잘못된 문자열: \"${t.prefix}\"(으)로 시작해야 합니다`:t.format===`ends_with`?`잘못된 문자열: \"${t.suffix}\"(으)로 끝나야 합니다`:t.format===`includes`?`잘못된 문자열: \"${t.includes}\"을(를) 포함해야 합니다`:t.format===`regex`?`잘못된 문자열: 정규식 ${t.pattern} 패턴과 일치해야 합니다`:`잘못된 ${r[t.format]??e.format}`}case`not_multiple_of`:return`잘못된 숫자: ${e.divisor}의 배수여야 합니다`;case`unrecognized_keys`:return`인식할 수 없는 키: ${m(e.keys,`, `)}`;case`invalid_key`:return`잘못된 키: ${e.origin}`;case`invalid_union`:return`잘못된 입력`;case`invalid_element`:return`잘못된 값: ${e.origin}`;default:return`잘못된 입력`}}}}));function la(){return{localeError:ua()}}var ua,da=t((()=>{x(),ua=()=>{let e={string:{unit:`знаци`,verb:`да имаат`},file:{unit:`бајти`,verb:`да имаат`},array:{unit:`ставки`,verb:`да имаат`},set:{unit:`ставки`,verb:`да имаат`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`број`;case`object`:if(Array.isArray(e))return`низа`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`внес`,email:`адреса на е-пошта`,url:`URL`,emoji:`емоџи`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO датум и време`,date:`ISO датум`,time:`ISO време`,duration:`ISO времетраење`,ipv4:`IPv4 адреса`,ipv6:`IPv6 адреса`,cidrv4:`IPv4 опсег`,cidrv6:`IPv6 опсег`,base64:`base64-енкодирана низа`,base64url:`base64url-енкодирана низа`,json_string:`JSON низа`,e164:`E.164 број`,jwt:`JWT`,template_literal:`внес`};return e=>{switch(e.code){case`invalid_type`:return`Грешен внес: се очекува ${e.expected}, примено ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${v(e.values[0])}`:`Грешана опција: се очекува една ${m(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Премногу голем: се очекува ${e.origin??`вредноста`} да има ${n}${e.maximum.toString()} ${r.unit??`елементи`}`:`Премногу голем: се очекува ${e.origin??`вредноста`} да биде ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Премногу мал: се очекува ${e.origin} да има ${n}${e.minimum.toString()} ${r.unit}`:`Премногу мал: се очекува ${e.origin} да биде ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Неважечка низа: мора да започнува со \"${t.prefix}\"`:t.format===`ends_with`?`Неважечка низа: мора да завршува со \"${t.suffix}\"`:t.format===`includes`?`Неважечка низа: мора да вклучува \"${t.includes}\"`:t.format===`regex`?`Неважечка низа: мора да одгоара на патернот ${t.pattern}`:`Invalid ${r[t.format]??e.format}`}case`not_multiple_of`:return`Грешен број: мора да биде делив со ${e.divisor}`;case`unrecognized_keys`:return`${e.keys.length>1?`Непрепознаени клучеви`:`Непрепознаен клуч`}: ${m(e.keys,`, `)}`;case`invalid_key`:return`Грешен клуч во ${e.origin}`;case`invalid_union`:return`Грешен внес`;case`invalid_element`:return`Грешна вредност во ${e.origin}`;default:return`Грешен внес`}}}}));function fa(){return{localeError:pa()}}var pa,ma=t((()=>{x(),pa=()=>{let e={string:{unit:`aksara`,verb:`mempunyai`},file:{unit:`bait`,verb:`mempunyai`},array:{unit:`elemen`,verb:`mempunyai`},set:{unit:`elemen`,verb:`mempunyai`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`nombor`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`input`,email:`alamat e-mel`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`tarikh masa ISO`,date:`tarikh ISO`,time:`masa ISO`,duration:`tempoh ISO`,ipv4:`alamat IPv4`,ipv6:`alamat IPv6`,cidrv4:`julat IPv4`,cidrv6:`julat IPv6`,base64:`string dikodkan base64`,base64url:`string dikodkan base64url`,json_string:`string JSON`,e164:`nombor E.164`,jwt:`JWT`,template_literal:`input`};return e=>{switch(e.code){case`invalid_type`:return`Input tidak sah: dijangka ${e.expected}, diterima ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Input tidak sah: dijangka ${v(e.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${m(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Terlalu besar: dijangka ${e.origin??`nilai`} ${r.verb} ${n}${e.maximum.toString()} ${r.unit??`elemen`}`:`Terlalu besar: dijangka ${e.origin??`nilai`} adalah ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Terlalu kecil: dijangka ${e.origin} ${r.verb} ${n}${e.minimum.toString()} ${r.unit}`:`Terlalu kecil: dijangka ${e.origin} adalah ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`String tidak sah: mesti bermula dengan \"${t.prefix}\"`:t.format===`ends_with`?`String tidak sah: mesti berakhir dengan \"${t.suffix}\"`:t.format===`includes`?`String tidak sah: mesti mengandungi \"${t.includes}\"`:t.format===`regex`?`String tidak sah: mesti sepadan dengan corak ${t.pattern}`:`${r[t.format]??e.format} tidak sah`}case`not_multiple_of`:return`Nombor tidak sah: perlu gandaan ${e.divisor}`;case`unrecognized_keys`:return`Kunci tidak dikenali: ${m(e.keys,`, `)}`;case`invalid_key`:return`Kunci tidak sah dalam ${e.origin}`;case`invalid_union`:return`Input tidak sah`;case`invalid_element`:return`Nilai tidak sah dalam ${e.origin}`;default:return`Input tidak sah`}}}}));function ha(){return{localeError:ga()}}var ga,_a=t((()=>{x(),ga=()=>{let e={string:{unit:`tekens`},file:{unit:`bytes`},array:{unit:`elementen`},set:{unit:`elementen`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`getal`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`invoer`,email:`emailadres`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datum en tijd`,date:`ISO datum`,time:`ISO tijd`,duration:`ISO duur`,ipv4:`IPv4-adres`,ipv6:`IPv6-adres`,cidrv4:`IPv4-bereik`,cidrv6:`IPv6-bereik`,base64:`base64-gecodeerde tekst`,base64url:`base64 URL-gecodeerde tekst`,json_string:`JSON string`,e164:`E.164-nummer`,jwt:`JWT`,template_literal:`invoer`};return e=>{switch(e.code){case`invalid_type`:return`Ongeldige invoer: verwacht ${e.expected}, ontving ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Ongeldige invoer: verwacht ${v(e.values[0])}`:`Ongeldige optie: verwacht één van ${m(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Te lang: verwacht dat ${e.origin??`waarde`} ${n}${e.maximum.toString()} ${r.unit??`elementen`} bevat`:`Te lang: verwacht dat ${e.origin??`waarde`} ${n}${e.maximum.toString()} is`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Te kort: verwacht dat ${e.origin} ${n}${e.minimum.toString()} ${r.unit} bevat`:`Te kort: verwacht dat ${e.origin} ${n}${e.minimum.toString()} is`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ongeldige tekst: moet met \"${t.prefix}\" beginnen`:t.format===`ends_with`?`Ongeldige tekst: moet op \"${t.suffix}\" eindigen`:t.format===`includes`?`Ongeldige tekst: moet \"${t.includes}\" bevatten`:t.format===`regex`?`Ongeldige tekst: moet overeenkomen met patroon ${t.pattern}`:`Ongeldig: ${r[t.format]??e.format}`}case`not_multiple_of`:return`Ongeldig getal: moet een veelvoud van ${e.divisor} zijn`;case`unrecognized_keys`:return`Onbekende key${e.keys.length>1?`s`:``}: ${m(e.keys,`, `)}`;case`invalid_key`:return`Ongeldige key in ${e.origin}`;case`invalid_union`:return`Ongeldige invoer`;case`invalid_element`:return`Ongeldige waarde in ${e.origin}`;default:return`Ongeldige invoer`}}}}));function va(){return{localeError:ya()}}var ya,ba=t((()=>{x(),ya=()=>{let e={string:{unit:`tegn`,verb:`å ha`},file:{unit:`bytes`,verb:`å ha`},array:{unit:`elementer`,verb:`å inneholde`},set:{unit:`elementer`,verb:`å inneholde`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`tall`;case`object`:if(Array.isArray(e))return`liste`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`input`,email:`e-postadresse`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO dato- og klokkeslett`,date:`ISO-dato`,time:`ISO-klokkeslett`,duration:`ISO-varighet`,ipv4:`IPv4-område`,ipv6:`IPv6-område`,cidrv4:`IPv4-spekter`,cidrv6:`IPv6-spekter`,base64:`base64-enkodet streng`,base64url:`base64url-enkodet streng`,json_string:`JSON-streng`,e164:`E.164-nummer`,jwt:`JWT`,template_literal:`input`};return e=>{switch(e.code){case`invalid_type`:return`Ugyldig input: forventet ${e.expected}, fikk ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Ugyldig verdi: forventet ${v(e.values[0])}`:`Ugyldig valg: forventet en av ${m(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`For stor(t): forventet ${e.origin??`value`} til å ha ${n}${e.maximum.toString()} ${r.unit??`elementer`}`:`For stor(t): forventet ${e.origin??`value`} til å ha ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`For lite(n): forventet ${e.origin} til å ha ${n}${e.minimum.toString()} ${r.unit}`:`For lite(n): forventet ${e.origin} til å ha ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ugyldig streng: må starte med \"${t.prefix}\"`:t.format===`ends_with`?`Ugyldig streng: må ende med \"${t.suffix}\"`:t.format===`includes`?`Ugyldig streng: må inneholde \"${t.includes}\"`:t.format===`regex`?`Ugyldig streng: må matche mønsteret ${t.pattern}`:`Ugyldig ${r[t.format]??e.format}`}case`not_multiple_of`:return`Ugyldig tall: må være et multiplum av ${e.divisor}`;case`unrecognized_keys`:return`${e.keys.length>1?`Ukjente nøkler`:`Ukjent nøkkel`}: ${m(e.keys,`, `)}`;case`invalid_key`:return`Ugyldig nøkkel i ${e.origin}`;case`invalid_union`:return`Ugyldig input`;case`invalid_element`:return`Ugyldig verdi i ${e.origin}`;default:return`Ugyldig input`}}}}));function xa(){return{localeError:Sa()}}var Sa,Ca=t((()=>{x(),Sa=()=>{let e={string:{unit:`harf`,verb:`olmalıdır`},file:{unit:`bayt`,verb:`olmalıdır`},array:{unit:`unsur`,verb:`olmalıdır`},set:{unit:`unsur`,verb:`olmalıdır`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`numara`;case`object`:if(Array.isArray(e))return`saf`;if(e===null)return`gayb`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`giren`,email:`epostagâh`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO hengâmı`,date:`ISO tarihi`,time:`ISO zamanı`,duration:`ISO müddeti`,ipv4:`IPv4 nişânı`,ipv6:`IPv6 nişânı`,cidrv4:`IPv4 menzili`,cidrv6:`IPv6 menzili`,base64:`base64-şifreli metin`,base64url:`base64url-şifreli metin`,json_string:`JSON metin`,e164:`E.164 sayısı`,jwt:`JWT`,template_literal:`giren`};return e=>{switch(e.code){case`invalid_type`:return`Fâsit giren: umulan ${e.expected}, alınan ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Fâsit giren: umulan ${v(e.values[0])}`:`Fâsit tercih: mûteberler ${m(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Fazla büyük: ${e.origin??`value`}, ${n}${e.maximum.toString()} ${r.unit??`elements`} sahip olmalıydı.`:`Fazla büyük: ${e.origin??`value`}, ${n}${e.maximum.toString()} olmalıydı.`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Fazla küçük: ${e.origin}, ${n}${e.minimum.toString()} ${r.unit} sahip olmalıydı.`:`Fazla küçük: ${e.origin}, ${n}${e.minimum.toString()} olmalıydı.`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Fâsit metin: \"${t.prefix}\" ile başlamalı.`:t.format===`ends_with`?`Fâsit metin: \"${t.suffix}\" ile bitmeli.`:t.format===`includes`?`Fâsit metin: \"${t.includes}\" ihtivâ etmeli.`:t.format===`regex`?`Fâsit metin: ${t.pattern} nakşına uymalı.`:`Fâsit ${r[t.format]??e.format}`}case`not_multiple_of`:return`Fâsit sayı: ${e.divisor} katı olmalıydı.`;case`unrecognized_keys`:return`Tanınmayan anahtar ${e.keys.length>1?`s`:``}: ${m(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} için tanınmayan anahtar var.`;case`invalid_union`:return`Giren tanınamadı.`;case`invalid_element`:return`${e.origin} için tanınmayan kıymet var.`;default:return`Kıymet tanınamadı.`}}}}));function wa(){return{localeError:Ta()}}var Ta,Ea=t((()=>{x(),Ta=()=>{let e={string:{unit:`توکي`,verb:`ولري`},file:{unit:`بایټس`,verb:`ولري`},array:{unit:`توکي`,verb:`ولري`},set:{unit:`توکي`,verb:`ولري`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`عدد`;case`object`:if(Array.isArray(e))return`ارې`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`ورودي`,email:`بریښنالیک`,url:`یو آر ال`,emoji:`ایموجي`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`نیټه او وخت`,date:`نېټه`,time:`وخت`,duration:`موده`,ipv4:`د IPv4 پته`,ipv6:`د IPv6 پته`,cidrv4:`د IPv4 ساحه`,cidrv6:`د IPv6 ساحه`,base64:`base64-encoded متن`,base64url:`base64url-encoded متن`,json_string:`JSON متن`,e164:`د E.164 شمېره`,jwt:`JWT`,template_literal:`ورودي`};return e=>{switch(e.code){case`invalid_type`:return`ناسم ورودي: باید ${e.expected} وای, مګر ${n(e.input)} ترلاسه شو`;case`invalid_value`:return e.values.length===1?`ناسم ورودي: باید ${v(e.values[0])} وای`:`ناسم انتخاب: باید یو له ${m(e.values,`|`)} څخه وای`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`ډیر لوی: ${e.origin??`ارزښت`} باید ${n}${e.maximum.toString()} ${r.unit??`عنصرونه`} ولري`:`ډیر لوی: ${e.origin??`ارزښت`} باید ${n}${e.maximum.toString()} وي`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`ډیر کوچنی: ${e.origin} باید ${n}${e.minimum.toString()} ${r.unit} ولري`:`ډیر کوچنی: ${e.origin} باید ${n}${e.minimum.toString()} وي`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`ناسم متن: باید د \"${t.prefix}\" سره پیل شي`:t.format===`ends_with`?`ناسم متن: باید د \"${t.suffix}\" سره پای ته ورسيږي`:t.format===`includes`?`ناسم متن: باید \"${t.includes}\" ولري`:t.format===`regex`?`ناسم متن: باید د ${t.pattern} سره مطابقت ولري`:`${r[t.format]??e.format} ناسم دی`}case`not_multiple_of`:return`ناسم عدد: باید د ${e.divisor} مضرب وي`;case`unrecognized_keys`:return`ناسم ${e.keys.length>1?`کلیډونه`:`کلیډ`}: ${m(e.keys,`, `)}`;case`invalid_key`:return`ناسم کلیډ په ${e.origin} کې`;case`invalid_union`:return`ناسمه ورودي`;case`invalid_element`:return`ناسم عنصر په ${e.origin} کې`;default:return`ناسمه ورودي`}}}}));function Da(){return{localeError:Oa()}}var Oa,ka=t((()=>{x(),Oa=()=>{let e={string:{unit:`znaków`,verb:`mieć`},file:{unit:`bajtów`,verb:`mieć`},array:{unit:`elementów`,verb:`mieć`},set:{unit:`elementów`,verb:`mieć`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`liczba`;case`object`:if(Array.isArray(e))return`tablica`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`wyrażenie`,email:`adres email`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`data i godzina w formacie ISO`,date:`data w formacie ISO`,time:`godzina w formacie ISO`,duration:`czas trwania ISO`,ipv4:`adres IPv4`,ipv6:`adres IPv6`,cidrv4:`zakres IPv4`,cidrv6:`zakres IPv6`,base64:`ciąg znaków zakodowany w formacie base64`,base64url:`ciąg znaków zakodowany w formacie base64url`,json_string:`ciąg znaków w formacie JSON`,e164:`liczba E.164`,jwt:`JWT`,template_literal:`wejście`};return e=>{switch(e.code){case`invalid_type`:return`Nieprawidłowe dane wejściowe: oczekiwano ${e.expected}, otrzymano ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Nieprawidłowe dane wejściowe: oczekiwano ${v(e.values[0])}`:`Nieprawidłowa opcja: oczekiwano jednej z wartości ${m(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Za duża wartość: oczekiwano, że ${e.origin??`wartość`} będzie mieć ${n}${e.maximum.toString()} ${r.unit??`elementów`}`:`Zbyt duż(y/a/e): oczekiwano, że ${e.origin??`wartość`} będzie wynosić ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Za mała wartość: oczekiwano, że ${e.origin??`wartość`} będzie mieć ${n}${e.minimum.toString()} ${r.unit??`elementów`}`:`Zbyt mał(y/a/e): oczekiwano, że ${e.origin??`wartość`} będzie wynosić ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Nieprawidłowy ciąg znaków: musi zaczynać się od \"${t.prefix}\"`:t.format===`ends_with`?`Nieprawidłowy ciąg znaków: musi kończyć się na \"${t.suffix}\"`:t.format===`includes`?`Nieprawidłowy ciąg znaków: musi zawierać \"${t.includes}\"`:t.format===`regex`?`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${t.pattern}`:`Nieprawidłow(y/a/e) ${r[t.format]??e.format}`}case`not_multiple_of`:return`Nieprawidłowa liczba: musi być wielokrotnością ${e.divisor}`;case`unrecognized_keys`:return`Nierozpoznane klucze${e.keys.length>1?`s`:``}: ${m(e.keys,`, `)}`;case`invalid_key`:return`Nieprawidłowy klucz w ${e.origin}`;case`invalid_union`:return`Nieprawidłowe dane wejściowe`;case`invalid_element`:return`Nieprawidłowa wartość w ${e.origin}`;default:return`Nieprawidłowe dane wejściowe`}}}}));function Aa(){return{localeError:ja()}}var ja,Ma=t((()=>{x(),ja=()=>{let e={string:{unit:`caracteres`,verb:`ter`},file:{unit:`bytes`,verb:`ter`},array:{unit:`itens`,verb:`ter`},set:{unit:`itens`,verb:`ter`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`número`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`nulo`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`padrão`,email:`endereço de e-mail`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`data e hora ISO`,date:`data ISO`,time:`hora ISO`,duration:`duração ISO`,ipv4:`endereço IPv4`,ipv6:`endereço IPv6`,cidrv4:`faixa de IPv4`,cidrv6:`faixa de IPv6`,base64:`texto codificado em base64`,base64url:`URL codificada em base64`,json_string:`texto JSON`,e164:`número E.164`,jwt:`JWT`,template_literal:`entrada`};return e=>{switch(e.code){case`invalid_type`:return`Tipo inválido: esperado ${e.expected}, recebido ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Entrada inválida: esperado ${v(e.values[0])}`:`Opção inválida: esperada uma das ${m(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Muito grande: esperado que ${e.origin??`valor`} tivesse ${n}${e.maximum.toString()} ${r.unit??`elementos`}`:`Muito grande: esperado que ${e.origin??`valor`} fosse ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Muito pequeno: esperado que ${e.origin} tivesse ${n}${e.minimum.toString()} ${r.unit}`:`Muito pequeno: esperado que ${e.origin} fosse ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Texto inválido: deve começar com \"${t.prefix}\"`:t.format===`ends_with`?`Texto inválido: deve terminar com \"${t.suffix}\"`:t.format===`includes`?`Texto inválido: deve incluir \"${t.includes}\"`:t.format===`regex`?`Texto inválido: deve corresponder ao padrão ${t.pattern}`:`${r[t.format]??e.format} inválido`}case`not_multiple_of`:return`Número inválido: deve ser múltiplo de ${e.divisor}`;case`unrecognized_keys`:return`Chave${e.keys.length>1?`s`:``} desconhecida${e.keys.length>1?`s`:``}: ${m(e.keys,`, `)}`;case`invalid_key`:return`Chave inválida em ${e.origin}`;case`invalid_union`:return`Entrada inválida`;case`invalid_element`:return`Valor inválido em ${e.origin}`;default:return`Campo inválido`}}}}));function Na(e,t,n,r){let i=Math.abs(e),a=i%10,o=i%100;return o>=11&&o<=19?r:a===1?t:a>=2&&a<=4?n:r}function Pa(){return{localeError:Fa()}}var Fa,Ia=t((()=>{x(),Fa=()=>{let e={string:{unit:{one:`символ`,few:`символа`,many:`символов`},verb:`иметь`},file:{unit:{one:`байт`,few:`байта`,many:`байт`},verb:`иметь`},array:{unit:{one:`элемент`,few:`элемента`,many:`элементов`},verb:`иметь`},set:{unit:{one:`элемент`,few:`элемента`,many:`элементов`},verb:`иметь`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`число`;case`object`:if(Array.isArray(e))return`массив`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`ввод`,email:`email адрес`,url:`URL`,emoji:`эмодзи`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO дата и время`,date:`ISO дата`,time:`ISO время`,duration:`ISO длительность`,ipv4:`IPv4 адрес`,ipv6:`IPv6 адрес`,cidrv4:`IPv4 диапазон`,cidrv6:`IPv6 диапазон`,base64:`строка в формате base64`,base64url:`строка в формате base64url`,json_string:`JSON строка`,e164:`номер E.164`,jwt:`JWT`,template_literal:`ввод`};return e=>{switch(e.code){case`invalid_type`:return`Неверный ввод: ожидалось ${e.expected}, получено ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Неверный ввод: ожидалось ${v(e.values[0])}`:`Неверный вариант: ожидалось одно из ${m(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);if(r){let t=Na(Number(e.maximum),r.unit.one,r.unit.few,r.unit.many);return`Слишком большое значение: ожидалось, что ${e.origin??`значение`} будет иметь ${n}${e.maximum.toString()} ${t}`}return`Слишком большое значение: ожидалось, что ${e.origin??`значение`} будет ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);if(r){let t=Na(Number(e.minimum),r.unit.one,r.unit.few,r.unit.many);return`Слишком маленькое значение: ожидалось, что ${e.origin} будет иметь ${n}${e.minimum.toString()} ${t}`}return`Слишком маленькое значение: ожидалось, что ${e.origin} будет ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Неверная строка: должна начинаться с \"${t.prefix}\"`:t.format===`ends_with`?`Неверная строка: должна заканчиваться на \"${t.suffix}\"`:t.format===`includes`?`Неверная строка: должна содержать \"${t.includes}\"`:t.format===`regex`?`Неверная строка: должна соответствовать шаблону ${t.pattern}`:`Неверный ${r[t.format]??e.format}`}case`not_multiple_of`:return`Неверное число: должно быть кратным ${e.divisor}`;case`unrecognized_keys`:return`Нераспознанн${e.keys.length>1?`ые`:`ый`} ключ${e.keys.length>1?`и`:``}: ${m(e.keys,`, `)}`;case`invalid_key`:return`Неверный ключ в ${e.origin}`;case`invalid_union`:return`Неверные входные данные`;case`invalid_element`:return`Неверное значение в ${e.origin}`;default:return`Неверные входные данные`}}}}));function La(){return{localeError:Ra()}}var Ra,za=t((()=>{x(),Ra=()=>{let e={string:{unit:`znakov`,verb:`imeti`},file:{unit:`bajtov`,verb:`imeti`},array:{unit:`elementov`,verb:`imeti`},set:{unit:`elementov`,verb:`imeti`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`število`;case`object`:if(Array.isArray(e))return`tabela`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`vnos`,email:`e-poštni naslov`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datum in čas`,date:`ISO datum`,time:`ISO čas`,duration:`ISO trajanje`,ipv4:`IPv4 naslov`,ipv6:`IPv6 naslov`,cidrv4:`obseg IPv4`,cidrv6:`obseg IPv6`,base64:`base64 kodiran niz`,base64url:`base64url kodiran niz`,json_string:`JSON niz`,e164:`E.164 številka`,jwt:`JWT`,template_literal:`vnos`};return e=>{switch(e.code){case`invalid_type`:return`Neveljaven vnos: pričakovano ${e.expected}, prejeto ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Neveljaven vnos: pričakovano ${v(e.values[0])}`:`Neveljavna možnost: pričakovano eno izmed ${m(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Preveliko: pričakovano, da bo ${e.origin??`vrednost`} imelo ${n}${e.maximum.toString()} ${r.unit??`elementov`}`:`Preveliko: pričakovano, da bo ${e.origin??`vrednost`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Premajhno: pričakovano, da bo ${e.origin} imelo ${n}${e.minimum.toString()} ${r.unit}`:`Premajhno: pričakovano, da bo ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Neveljaven niz: mora se začeti z \"${t.prefix}\"`:t.format===`ends_with`?`Neveljaven niz: mora se končati z \"${t.suffix}\"`:t.format===`includes`?`Neveljaven niz: mora vsebovati \"${t.includes}\"`:t.format===`regex`?`Neveljaven niz: mora ustrezati vzorcu ${t.pattern}`:`Neveljaven ${r[t.format]??e.format}`}case`not_multiple_of`:return`Neveljavno število: mora biti večkratnik ${e.divisor}`;case`unrecognized_keys`:return`Neprepoznan${e.keys.length>1?`i ključi`:` ključ`}: ${m(e.keys,`, `)}`;case`invalid_key`:return`Neveljaven ključ v ${e.origin}`;case`invalid_union`:return`Neveljaven vnos`;case`invalid_element`:return`Neveljavna vrednost v ${e.origin}`;default:return`Neveljaven vnos`}}}}));function Ba(){return{localeError:Va()}}var Va,Ha=t((()=>{x(),Va=()=>{let e={string:{unit:`tecken`,verb:`att ha`},file:{unit:`bytes`,verb:`att ha`},array:{unit:`objekt`,verb:`att innehålla`},set:{unit:`objekt`,verb:`att innehålla`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`antal`;case`object`:if(Array.isArray(e))return`lista`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`reguljärt uttryck`,email:`e-postadress`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO-datum och tid`,date:`ISO-datum`,time:`ISO-tid`,duration:`ISO-varaktighet`,ipv4:`IPv4-intervall`,ipv6:`IPv6-intervall`,cidrv4:`IPv4-spektrum`,cidrv6:`IPv6-spektrum`,base64:`base64-kodad sträng`,base64url:`base64url-kodad sträng`,json_string:`JSON-sträng`,e164:`E.164-nummer`,jwt:`JWT`,template_literal:`mall-literal`};return e=>{switch(e.code){case`invalid_type`:return`Ogiltig inmatning: förväntat ${e.expected}, fick ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Ogiltig inmatning: förväntat ${v(e.values[0])}`:`Ogiltigt val: förväntade en av ${m(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`För stor(t): förväntade ${e.origin??`värdet`} att ha ${n}${e.maximum.toString()} ${r.unit??`element`}`:`För stor(t): förväntat ${e.origin??`värdet`} att ha ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`För lite(t): förväntade ${e.origin??`värdet`} att ha ${n}${e.minimum.toString()} ${r.unit}`:`För lite(t): förväntade ${e.origin??`värdet`} att ha ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ogiltig sträng: måste börja med \"${t.prefix}\"`:t.format===`ends_with`?`Ogiltig sträng: måste sluta med \"${t.suffix}\"`:t.format===`includes`?`Ogiltig sträng: måste innehålla \"${t.includes}\"`:t.format===`regex`?`Ogiltig sträng: måste matcha mönstret \"${t.pattern}\"`:`Ogiltig(t) ${r[t.format]??e.format}`}case`not_multiple_of`:return`Ogiltigt tal: måste vara en multipel av ${e.divisor}`;case`unrecognized_keys`:return`${e.keys.length>1?`Okända nycklar`:`Okänd nyckel`}: ${m(e.keys,`, `)}`;case`invalid_key`:return`Ogiltig nyckel i ${e.origin??`värdet`}`;case`invalid_union`:return`Ogiltig input`;case`invalid_element`:return`Ogiltigt värde i ${e.origin??`värdet`}`;default:return`Ogiltig input`}}}}));function Ua(){return{localeError:Wa()}}var Wa,Ga=t((()=>{x(),Wa=()=>{let e={string:{unit:`எழுத்துக்கள்`,verb:`கொண்டிருக்க வேண்டும்`},file:{unit:`பைட்டுகள்`,verb:`கொண்டிருக்க வேண்டும்`},array:{unit:`உறுப்புகள்`,verb:`கொண்டிருக்க வேண்டும்`},set:{unit:`உறுப்புகள்`,verb:`கொண்டிருக்க வேண்டும்`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`எண் அல்லாதது`:`எண்`;case`object`:if(Array.isArray(e))return`அணி`;if(e===null)return`வெறுமை`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`உள்ளீடு`,email:`மின்னஞ்சல் முகவரி`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO தேதி நேரம்`,date:`ISO தேதி`,time:`ISO நேரம்`,duration:`ISO கால அளவு`,ipv4:`IPv4 முகவரி`,ipv6:`IPv6 முகவரி`,cidrv4:`IPv4 வரம்பு`,cidrv6:`IPv6 வரம்பு`,base64:`base64-encoded சரம்`,base64url:`base64url-encoded சரம்`,json_string:`JSON சரம்`,e164:`E.164 எண்`,jwt:`JWT`,template_literal:`input`};return e=>{switch(e.code){case`invalid_type`:return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${e.expected}, பெறப்பட்டது ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${v(e.values[0])}`:`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${m(e.values,`|`)} இல் ஒன்று`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${e.origin??`மதிப்பு`} ${n}${e.maximum.toString()} ${r.unit??`உறுப்புகள்`} ஆக இருக்க வேண்டும்`:`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${e.origin??`மதிப்பு`} ${n}${e.maximum.toString()} ஆக இருக்க வேண்டும்`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${e.origin} ${n}${e.minimum.toString()} ${r.unit} ஆக இருக்க வேண்டும்`:`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${e.origin} ${n}${e.minimum.toString()} ஆக இருக்க வேண்டும்`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`தவறான சரம்: \"${t.prefix}\" இல் தொடங்க வேண்டும்`:t.format===`ends_with`?`தவறான சரம்: \"${t.suffix}\" இல் முடிவடைய வேண்டும்`:t.format===`includes`?`தவறான சரம்: \"${t.includes}\" ஐ உள்ளடக்க வேண்டும்`:t.format===`regex`?`தவறான சரம்: ${t.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`:`தவறான ${r[t.format]??e.format}`}case`not_multiple_of`:return`தவறான எண்: ${e.divisor} இன் பலமாக இருக்க வேண்டும்`;case`unrecognized_keys`:return`அடையாளம் தெரியாத விசை${e.keys.length>1?`கள்`:``}: ${m(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} இல் தவறான விசை`;case`invalid_union`:return`தவறான உள்ளீடு`;case`invalid_element`:return`${e.origin} இல் தவறான மதிப்பு`;default:return`தவறான உள்ளீடு`}}}}));function Ka(){return{localeError:qa()}}var qa,Ja=t((()=>{x(),qa=()=>{let e={string:{unit:`ตัวอักษร`,verb:`ควรมี`},file:{unit:`ไบต์`,verb:`ควรมี`},array:{unit:`รายการ`,verb:`ควรมี`},set:{unit:`รายการ`,verb:`ควรมี`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`ไม่ใช่ตัวเลข (NaN)`:`ตัวเลข`;case`object`:if(Array.isArray(e))return`อาร์เรย์ (Array)`;if(e===null)return`ไม่มีค่า (null)`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`ข้อมูลที่ป้อน`,email:`ที่อยู่อีเมล`,url:`URL`,emoji:`อิโมจิ`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`วันที่เวลาแบบ ISO`,date:`วันที่แบบ ISO`,time:`เวลาแบบ ISO`,duration:`ช่วงเวลาแบบ ISO`,ipv4:`ที่อยู่ IPv4`,ipv6:`ที่อยู่ IPv6`,cidrv4:`ช่วง IP แบบ IPv4`,cidrv6:`ช่วง IP แบบ IPv6`,base64:`ข้อความแบบ Base64`,base64url:`ข้อความแบบ Base64 สำหรับ URL`,json_string:`ข้อความแบบ JSON`,e164:`เบอร์โทรศัพท์ระหว่างประเทศ (E.164)`,jwt:`โทเคน JWT`,template_literal:`ข้อมูลที่ป้อน`};return e=>{switch(e.code){case`invalid_type`:return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${e.expected} แต่ได้รับ ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`ค่าไม่ถูกต้อง: ควรเป็น ${v(e.values[0])}`:`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${m(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`ไม่เกิน`:`น้อยกว่า`,r=t(e.origin);return r?`เกินกำหนด: ${e.origin??`ค่า`} ควรมี${n} ${e.maximum.toString()} ${r.unit??`รายการ`}`:`เกินกำหนด: ${e.origin??`ค่า`} ควรมี${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`อย่างน้อย`:`มากกว่า`,r=t(e.origin);return r?`น้อยกว่ากำหนด: ${e.origin} ควรมี${n} ${e.minimum.toString()} ${r.unit}`:`น้อยกว่ากำหนด: ${e.origin} ควรมี${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย \"${t.prefix}\"`:t.format===`ends_with`?`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย \"${t.suffix}\"`:t.format===`includes`?`รูปแบบไม่ถูกต้อง: ข้อความต้องมี \"${t.includes}\" อยู่ในข้อความ`:t.format===`regex`?`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${t.pattern}`:`รูปแบบไม่ถูกต้อง: ${r[t.format]??e.format}`}case`not_multiple_of`:return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${e.divisor} ได้ลงตัว`;case`unrecognized_keys`:return`พบคีย์ที่ไม่รู้จัก: ${m(e.keys,`, `)}`;case`invalid_key`:return`คีย์ไม่ถูกต้องใน ${e.origin}`;case`invalid_union`:return`ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้`;case`invalid_element`:return`ข้อมูลไม่ถูกต้องใน ${e.origin}`;default:return`ข้อมูลไม่ถูกต้อง`}}}}));function Ya(){return{localeError:Za()}}var Xa,Za,Qa=t((()=>{x(),Xa=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`number`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},Za=()=>{let e={string:{unit:`karakter`,verb:`olmalı`},file:{unit:`bayt`,verb:`olmalı`},array:{unit:`öğe`,verb:`olmalı`},set:{unit:`öğe`,verb:`olmalı`}};function t(t){return e[t]??null}let n={regex:`girdi`,email:`e-posta adresi`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO tarih ve saat`,date:`ISO tarih`,time:`ISO saat`,duration:`ISO süre`,ipv4:`IPv4 adresi`,ipv6:`IPv6 adresi`,cidrv4:`IPv4 aralığı`,cidrv6:`IPv6 aralığı`,base64:`base64 ile şifrelenmiş metin`,base64url:`base64url ile şifrelenmiş metin`,json_string:`JSON dizesi`,e164:`E.164 sayısı`,jwt:`JWT`,template_literal:`Şablon dizesi`};return e=>{switch(e.code){case`invalid_type`:return`Geçersiz değer: beklenen ${e.expected}, alınan ${Xa(e.input)}`;case`invalid_value`:return e.values.length===1?`Geçersiz değer: beklenen ${v(e.values[0])}`:`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${m(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Çok büyük: beklenen ${e.origin??`değer`} ${n}${e.maximum.toString()} ${r.unit??`öğe`}`:`Çok büyük: beklenen ${e.origin??`değer`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Çok küçük: beklenen ${e.origin} ${n}${e.minimum.toString()} ${r.unit}`:`Çok küçük: beklenen ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Geçersiz metin: \"${t.prefix}\" ile başlamalı`:t.format===`ends_with`?`Geçersiz metin: \"${t.suffix}\" ile bitmeli`:t.format===`includes`?`Geçersiz metin: \"${t.includes}\" içermeli`:t.format===`regex`?`Geçersiz metin: ${t.pattern} desenine uymalı`:`Geçersiz ${n[t.format]??e.format}`}case`not_multiple_of`:return`Geçersiz sayı: ${e.divisor} ile tam bölünebilmeli`;case`unrecognized_keys`:return`Tanınmayan anahtar${e.keys.length>1?`lar`:``}: ${m(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} içinde geçersiz anahtar`;case`invalid_union`:return`Geçersiz değer`;case`invalid_element`:return`${e.origin} içinde geçersiz değer`;default:return`Geçersiz değer`}}}}));function $a(){return{localeError:eo()}}var eo,to=t((()=>{x(),eo=()=>{let e={string:{unit:`символів`,verb:`матиме`},file:{unit:`байтів`,verb:`матиме`},array:{unit:`елементів`,verb:`матиме`},set:{unit:`елементів`,verb:`матиме`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`число`;case`object`:if(Array.isArray(e))return`масив`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`вхідні дані`,email:`адреса електронної пошти`,url:`URL`,emoji:`емодзі`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`дата та час ISO`,date:`дата ISO`,time:`час ISO`,duration:`тривалість ISO`,ipv4:`адреса IPv4`,ipv6:`адреса IPv6`,cidrv4:`діапазон IPv4`,cidrv6:`діапазон IPv6`,base64:`рядок у кодуванні base64`,base64url:`рядок у кодуванні base64url`,json_string:`рядок JSON`,e164:`номер E.164`,jwt:`JWT`,template_literal:`вхідні дані`};return e=>{switch(e.code){case`invalid_type`:return`Неправильні вхідні дані: очікується ${e.expected}, отримано ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Неправильні вхідні дані: очікується ${v(e.values[0])}`:`Неправильна опція: очікується одне з ${m(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Занадто велике: очікується, що ${e.origin??`значення`} ${r.verb} ${n}${e.maximum.toString()} ${r.unit??`елементів`}`:`Занадто велике: очікується, що ${e.origin??`значення`} буде ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Занадто мале: очікується, що ${e.origin} ${r.verb} ${n}${e.minimum.toString()} ${r.unit}`:`Занадто мале: очікується, що ${e.origin} буде ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Неправильний рядок: повинен починатися з \"${t.prefix}\"`:t.format===`ends_with`?`Неправильний рядок: повинен закінчуватися на \"${t.suffix}\"`:t.format===`includes`?`Неправильний рядок: повинен містити \"${t.includes}\"`:t.format===`regex`?`Неправильний рядок: повинен відповідати шаблону ${t.pattern}`:`Неправильний ${r[t.format]??e.format}`}case`not_multiple_of`:return`Неправильне число: повинно бути кратним ${e.divisor}`;case`unrecognized_keys`:return`Нерозпізнаний ключ${e.keys.length>1?`і`:``}: ${m(e.keys,`, `)}`;case`invalid_key`:return`Неправильний ключ у ${e.origin}`;case`invalid_union`:return`Неправильні вхідні дані`;case`invalid_element`:return`Неправильне значення у ${e.origin}`;default:return`Неправильні вхідні дані`}}}}));function no(){return{localeError:ro()}}var ro,io=t((()=>{x(),ro=()=>{let e={string:{unit:`حروف`,verb:`ہونا`},file:{unit:`بائٹس`,verb:`ہونا`},array:{unit:`آئٹمز`,verb:`ہونا`},set:{unit:`آئٹمز`,verb:`ہونا`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`نمبر`;case`object`:if(Array.isArray(e))return`آرے`;if(e===null)return`نل`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`ان پٹ`,email:`ای میل ایڈریس`,url:`یو آر ایل`,emoji:`ایموجی`,uuid:`یو یو آئی ڈی`,uuidv4:`یو یو آئی ڈی وی 4`,uuidv6:`یو یو آئی ڈی وی 6`,nanoid:`نینو آئی ڈی`,guid:`جی یو آئی ڈی`,cuid:`سی یو آئی ڈی`,cuid2:`سی یو آئی ڈی 2`,ulid:`یو ایل آئی ڈی`,xid:`ایکس آئی ڈی`,ksuid:`کے ایس یو آئی ڈی`,datetime:`آئی ایس او ڈیٹ ٹائم`,date:`آئی ایس او تاریخ`,time:`آئی ایس او وقت`,duration:`آئی ایس او مدت`,ipv4:`آئی پی وی 4 ایڈریس`,ipv6:`آئی پی وی 6 ایڈریس`,cidrv4:`آئی پی وی 4 رینج`,cidrv6:`آئی پی وی 6 رینج`,base64:`بیس 64 ان کوڈڈ سٹرنگ`,base64url:`بیس 64 یو آر ایل ان کوڈڈ سٹرنگ`,json_string:`جے ایس او این سٹرنگ`,e164:`ای 164 نمبر`,jwt:`جے ڈبلیو ٹی`,template_literal:`ان پٹ`};return e=>{switch(e.code){case`invalid_type`:return`غلط ان پٹ: ${e.expected} متوقع تھا، ${n(e.input)} موصول ہوا`;case`invalid_value`:return e.values.length===1?`غلط ان پٹ: ${v(e.values[0])} متوقع تھا`:`غلط آپشن: ${m(e.values,`|`)} میں سے ایک متوقع تھا`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`بہت بڑا: ${e.origin??`ویلیو`} کے ${n}${e.maximum.toString()} ${r.unit??`عناصر`} ہونے متوقع تھے`:`بہت بڑا: ${e.origin??`ویلیو`} کا ${n}${e.maximum.toString()} ہونا متوقع تھا`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`بہت چھوٹا: ${e.origin} کے ${n}${e.minimum.toString()} ${r.unit} ہونے متوقع تھے`:`بہت چھوٹا: ${e.origin} کا ${n}${e.minimum.toString()} ہونا متوقع تھا`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`غلط سٹرنگ: \"${t.prefix}\" سے شروع ہونا چاہیے`:t.format===`ends_with`?`غلط سٹرنگ: \"${t.suffix}\" پر ختم ہونا چاہیے`:t.format===`includes`?`غلط سٹرنگ: \"${t.includes}\" شامل ہونا چاہیے`:t.format===`regex`?`غلط سٹرنگ: پیٹرن ${t.pattern} سے میچ ہونا چاہیے`:`غلط ${r[t.format]??e.format}`}case`not_multiple_of`:return`غلط نمبر: ${e.divisor} کا مضاعف ہونا چاہیے`;case`unrecognized_keys`:return`غیر تسلیم شدہ کی${e.keys.length>1?`ز`:``}: ${m(e.keys,`، `)}`;case`invalid_key`:return`${e.origin} میں غلط کی`;case`invalid_union`:return`غلط ان پٹ`;case`invalid_element`:return`${e.origin} میں غلط ویلیو`;default:return`غلط ان پٹ`}}}}));function ao(){return{localeError:oo()}}var oo,so=t((()=>{x(),oo=()=>{let e={string:{unit:`ký tự`,verb:`có`},file:{unit:`byte`,verb:`có`},array:{unit:`phần tử`,verb:`có`},set:{unit:`phần tử`,verb:`có`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`số`;case`object`:if(Array.isArray(e))return`mảng`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`đầu vào`,email:`địa chỉ email`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ngày giờ ISO`,date:`ngày ISO`,time:`giờ ISO`,duration:`khoảng thời gian ISO`,ipv4:`địa chỉ IPv4`,ipv6:`địa chỉ IPv6`,cidrv4:`dải IPv4`,cidrv6:`dải IPv6`,base64:`chuỗi mã hóa base64`,base64url:`chuỗi mã hóa base64url`,json_string:`chuỗi JSON`,e164:`số E.164`,jwt:`JWT`,template_literal:`đầu vào`};return e=>{switch(e.code){case`invalid_type`:return`Đầu vào không hợp lệ: mong đợi ${e.expected}, nhận được ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Đầu vào không hợp lệ: mong đợi ${v(e.values[0])}`:`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${m(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Quá lớn: mong đợi ${e.origin??`giá trị`} ${r.verb} ${n}${e.maximum.toString()} ${r.unit??`phần tử`}`:`Quá lớn: mong đợi ${e.origin??`giá trị`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Quá nhỏ: mong đợi ${e.origin} ${r.verb} ${n}${e.minimum.toString()} ${r.unit}`:`Quá nhỏ: mong đợi ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Chuỗi không hợp lệ: phải bắt đầu bằng \"${t.prefix}\"`:t.format===`ends_with`?`Chuỗi không hợp lệ: phải kết thúc bằng \"${t.suffix}\"`:t.format===`includes`?`Chuỗi không hợp lệ: phải bao gồm \"${t.includes}\"`:t.format===`regex`?`Chuỗi không hợp lệ: phải khớp với mẫu ${t.pattern}`:`${r[t.format]??e.format} không hợp lệ`}case`not_multiple_of`:return`Số không hợp lệ: phải là bội số của ${e.divisor}`;case`unrecognized_keys`:return`Khóa không được nhận dạng: ${m(e.keys,`, `)}`;case`invalid_key`:return`Khóa không hợp lệ trong ${e.origin}`;case`invalid_union`:return`Đầu vào không hợp lệ`;case`invalid_element`:return`Giá trị không hợp lệ trong ${e.origin}`;default:return`Đầu vào không hợp lệ`}}}}));function co(){return{localeError:lo()}}var lo,uo=t((()=>{x(),lo=()=>{let e={string:{unit:`字符`,verb:`包含`},file:{unit:`字节`,verb:`包含`},array:{unit:`项`,verb:`包含`},set:{unit:`项`,verb:`包含`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`非数字(NaN)`:`数字`;case`object`:if(Array.isArray(e))return`数组`;if(e===null)return`空值(null)`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`输入`,email:`电子邮件`,url:`URL`,emoji:`表情符号`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO日期时间`,date:`ISO日期`,time:`ISO时间`,duration:`ISO时长`,ipv4:`IPv4地址`,ipv6:`IPv6地址`,cidrv4:`IPv4网段`,cidrv6:`IPv6网段`,base64:`base64编码字符串`,base64url:`base64url编码字符串`,json_string:`JSON字符串`,e164:`E.164号码`,jwt:`JWT`,template_literal:`输入`};return e=>{switch(e.code){case`invalid_type`:return`无效输入:期望 ${e.expected},实际接收 ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`无效输入:期望 ${v(e.values[0])}`:`无效选项:期望以下之一 ${m(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`数值过大:期望 ${e.origin??`值`} ${n}${e.maximum.toString()} ${r.unit??`个元素`}`:`数值过大:期望 ${e.origin??`值`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`数值过小:期望 ${e.origin} ${n}${e.minimum.toString()} ${r.unit}`:`数值过小:期望 ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`无效字符串:必须以 \"${t.prefix}\" 开头`:t.format===`ends_with`?`无效字符串:必须以 \"${t.suffix}\" 结尾`:t.format===`includes`?`无效字符串:必须包含 \"${t.includes}\"`:t.format===`regex`?`无效字符串:必须满足正则表达式 ${t.pattern}`:`无效${r[t.format]??e.format}`}case`not_multiple_of`:return`无效数字:必须是 ${e.divisor} 的倍数`;case`unrecognized_keys`:return`出现未知的键(key): ${m(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} 中的键(key)无效`;case`invalid_union`:return`无效输入`;case`invalid_element`:return`${e.origin} 中包含无效值(value)`;default:return`无效输入`}}}}));function fo(){return{localeError:po()}}var po,mo=t((()=>{x(),po=()=>{let e={string:{unit:`字元`,verb:`擁有`},file:{unit:`位元組`,verb:`擁有`},array:{unit:`項目`,verb:`擁有`},set:{unit:`項目`,verb:`擁有`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`number`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`輸入`,email:`郵件地址`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO 日期時間`,date:`ISO 日期`,time:`ISO 時間`,duration:`ISO 期間`,ipv4:`IPv4 位址`,ipv6:`IPv6 位址`,cidrv4:`IPv4 範圍`,cidrv6:`IPv6 範圍`,base64:`base64 編碼字串`,base64url:`base64url 編碼字串`,json_string:`JSON 字串`,e164:`E.164 數值`,jwt:`JWT`,template_literal:`輸入`};return e=>{switch(e.code){case`invalid_type`:return`無效的輸入值:預期為 ${e.expected},但收到 ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`無效的輸入值:預期為 ${v(e.values[0])}`:`無效的選項:預期為以下其中之一 ${m(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`數值過大:預期 ${e.origin??`值`} 應為 ${n}${e.maximum.toString()} ${r.unit??`個元素`}`:`數值過大:預期 ${e.origin??`值`} 應為 ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`數值過小:預期 ${e.origin} 應為 ${n}${e.minimum.toString()} ${r.unit}`:`數值過小:預期 ${e.origin} 應為 ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`無效的字串:必須以 \"${t.prefix}\" 開頭`:t.format===`ends_with`?`無效的字串:必須以 \"${t.suffix}\" 結尾`:t.format===`includes`?`無效的字串:必須包含 \"${t.includes}\"`:t.format===`regex`?`無效的字串:必須符合格式 ${t.pattern}`:`無效的 ${r[t.format]??e.format}`}case`not_multiple_of`:return`無效的數字:必須為 ${e.divisor} 的倍數`;case`unrecognized_keys`:return`無法識別的鍵值${e.keys.length>1?`們`:``}:${m(e.keys,`、`)}`;case`invalid_key`:return`${e.origin} 中有無效的鍵值`;case`invalid_union`:return`無效的輸入值`;case`invalid_element`:return`${e.origin} 中有無效的值`;default:return`無效的輸入值`}}}})),ho=r({ar:()=>ei,az:()=>ri,be:()=>si,ca:()=>ui,cs:()=>pi,de:()=>gi,en:()=>yi,eo:()=>Ci,es:()=>Di,fa:()=>Ai,fi:()=>Ni,fr:()=>Ii,frCA:()=>zi,he:()=>Hi,hu:()=>Gi,id:()=>Ji,it:()=>Zi,ja:()=>ea,kh:()=>ra,ko:()=>oa,mk:()=>la,ms:()=>fa,nl:()=>ha,no:()=>va,ota:()=>xa,pl:()=>Da,ps:()=>wa,pt:()=>Aa,ru:()=>Pa,sl:()=>La,sv:()=>Ba,ta:()=>Ua,th:()=>Ka,tr:()=>Ya,ua:()=>$a,ur:()=>no,vi:()=>ao,zhCN:()=>co,zhTW:()=>fo}),go=t((()=>{ni(),ai(),li(),fi(),hi(),vi(),Si(),Ei(),ki(),Mi(),Fi(),Ri(),Vi(),Wi(),qi(),Xi(),$i(),na(),aa(),ca(),da(),ma(),_a(),ba(),Ca(),Ea(),ka(),Ma(),Ia(),za(),Ha(),Ga(),Ja(),Qa(),to(),io(),so(),uo(),mo()}));function _o(){return new bo}var vo,yo,bo,T,xo=t((()=>{vo=Symbol(`ZodOutput`),yo=Symbol(`ZodInput`),bo=class{constructor(){this._map=new Map,this._idmap=new Map}add(e,...t){let n=t[0];if(this._map.set(e,n),n&&typeof n==`object`&&`id`in n){if(this._idmap.has(n.id))throw Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,e)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};return delete n.id,{...n,...this._map.get(e)}}return this._map.get(e)}has(e){return this._map.has(e)}},T=_o()}));function So(e,t){return new e({type:`string`,..._(t)})}function Co(e,t){return new e({type:`string`,coerce:!0,..._(t)})}function wo(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,..._(t)})}function To(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,..._(t)})}function Eo(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,..._(t)})}function Do(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,..._(t)})}function Oo(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,..._(t)})}function ko(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,..._(t)})}function Ao(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,..._(t)})}function jo(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,..._(t)})}function Mo(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,..._(t)})}function No(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,..._(t)})}function Po(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,..._(t)})}function Fo(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,..._(t)})}function Io(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,..._(t)})}function Lo(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,..._(t)})}function Ro(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,..._(t)})}function zo(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,..._(t)})}function Bo(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,..._(t)})}function Vo(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,..._(t)})}function Ho(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,..._(t)})}function Uo(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,..._(t)})}function Wo(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,..._(t)})}function Go(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,..._(t)})}function Ko(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,..._(t)})}function qo(e,t){return new e({type:`string`,format:`date`,check:`string_format`,..._(t)})}function Jo(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,..._(t)})}function Yo(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,..._(t)})}function Xo(e,t){return new e({type:`number`,checks:[],..._(t)})}function Zo(e,t){return new e({type:`number`,coerce:!0,checks:[],..._(t)})}function Qo(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,..._(t)})}function $o(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`float32`,..._(t)})}function es(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`float64`,..._(t)})}function ts(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`int32`,..._(t)})}function ns(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`uint32`,..._(t)})}function rs(e,t){return new e({type:`boolean`,..._(t)})}function is(e,t){return new e({type:`boolean`,coerce:!0,..._(t)})}function as(e,t){return new e({type:`bigint`,..._(t)})}function os(e,t){return new e({type:`bigint`,coerce:!0,..._(t)})}function ss(e,t){return new e({type:`bigint`,check:`bigint_format`,abort:!1,format:`int64`,..._(t)})}function cs(e,t){return new e({type:`bigint`,check:`bigint_format`,abort:!1,format:`uint64`,..._(t)})}function ls(e,t){return new e({type:`symbol`,..._(t)})}function us(e,t){return new e({type:`undefined`,..._(t)})}function ds(e,t){return new e({type:`null`,..._(t)})}function fs(e){return new e({type:`any`})}function ps(e){return new e({type:`unknown`})}function ms(e,t){return new e({type:`never`,..._(t)})}function hs(e,t){return new e({type:`void`,..._(t)})}function gs(e,t){return new e({type:`date`,..._(t)})}function _s(e,t){return new e({type:`date`,coerce:!0,..._(t)})}function vs(e,t){return new e({type:`nan`,..._(t)})}function ys(e,t){return new Qt({check:`less_than`,..._(t),value:e,inclusive:!1})}function E(e,t){return new Qt({check:`less_than`,..._(t),value:e,inclusive:!0})}function bs(e,t){return new $t({check:`greater_than`,..._(t),value:e,inclusive:!1})}function D(e,t){return new $t({check:`greater_than`,..._(t),value:e,inclusive:!0})}function xs(e){return bs(0,e)}function Ss(e){return ys(0,e)}function Cs(e){return E(0,e)}function ws(e){return D(0,e)}function Ts(e,t){return new en({check:`multiple_of`,..._(t),value:e})}function Es(e,t){return new rn({check:`max_size`,..._(t),maximum:e})}function Ds(e,t){return new an({check:`min_size`,..._(t),minimum:e})}function Os(e,t){return new on({check:`size_equals`,..._(t),size:e})}function ks(e,t){return new sn({check:`max_length`,..._(t),maximum:e})}function As(e,t){return new cn({check:`min_length`,..._(t),minimum:e})}function js(e,t){return new ln({check:`length_equals`,..._(t),length:e})}function Ms(e,t){return new dn({check:`string_format`,format:`regex`,..._(t),pattern:e})}function Ns(e){return new fn({check:`string_format`,format:`lowercase`,..._(e)})}function Ps(e){return new pn({check:`string_format`,format:`uppercase`,..._(e)})}function Fs(e,t){return new mn({check:`string_format`,format:`includes`,..._(t),includes:e})}function Is(e,t){return new hn({check:`string_format`,format:`starts_with`,..._(t),prefix:e})}function Ls(e,t){return new gn({check:`string_format`,format:`ends_with`,..._(t),suffix:e})}function Rs(e,t,n){return new _n({check:`property`,property:e,schema:t,..._(n)})}function zs(e,t){return new vn({check:`mime_type`,mime:e,..._(t)})}function Bs(e){return new yn({check:`overwrite`,tx:e})}function Vs(e){return Bs(t=>t.normalize(e))}function Hs(){return Bs(e=>e.trim())}function Us(){return Bs(e=>e.toLowerCase())}function Ws(){return Bs(e=>e.toUpperCase())}function Gs(e,t,n){return new e({type:`array`,element:t,..._(n)})}function Ks(e,t,n){return new e({type:`union`,options:t,..._(n)})}function qs(e,t,n,r){return new e({type:`union`,options:n,discriminator:t,..._(r)})}function Js(e,t,n){return new e({type:`intersection`,left:t,right:n})}function Ys(e,t,n,r){let i=n instanceof C;return new e({type:`tuple`,items:t,rest:i?n:null,..._(i?r:n)})}function Xs(e,t,n,r){return new e({type:`record`,keyType:t,valueType:n,..._(r)})}function Zs(e,t,n,r){return new e({type:`map`,keyType:t,valueType:n,..._(r)})}function Qs(e,t,n){return new e({type:`set`,valueType:t,..._(n)})}function $s(e,t,n){return new e({type:`enum`,entries:Array.isArray(t)?Object.fromEntries(t.map(e=>[e,e])):t,..._(n)})}function ec(e,t,n){return new e({type:`enum`,entries:t,..._(n)})}function tc(e,t,n){return new e({type:`literal`,values:Array.isArray(t)?t:[t],..._(n)})}function nc(e,t){return new e({type:`file`,..._(t)})}function rc(e,t){return new e({type:`transform`,transform:t})}function ic(e,t){return new e({type:`optional`,innerType:t})}function ac(e,t){return new e({type:`nullable`,innerType:t})}function oc(e,t,n){return new e({type:`default`,innerType:t,get defaultValue(){return typeof n==`function`?n():n}})}function sc(e,t,n){return new e({type:`nonoptional`,innerType:t,..._(n)})}function cc(e,t){return new e({type:`success`,innerType:t})}function lc(e,t,n){return new e({type:`catch`,innerType:t,catchValue:typeof n==`function`?n:()=>n})}function uc(e,t,n){return new e({type:`pipe`,in:t,out:n})}function dc(e,t){return new e({type:`readonly`,innerType:t})}function fc(e,t,n){return new e({type:`template_literal`,parts:t,..._(n)})}function pc(e,t){return new e({type:`lazy`,getter:t})}function mc(e,t){return new e({type:`promise`,innerType:t})}function hc(e,t,n){let r=_(n);return r.abort??=!0,new e({type:`custom`,check:`custom`,fn:t,...r})}function gc(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,..._(n)})}function _c(e,t){let n=_(t),r=n.truthy??[`true`,`1`,`yes`,`on`,`y`,`enabled`],i=n.falsy??[`false`,`0`,`no`,`off`,`n`,`disabled`];n.case!==`sensitive`&&(r=r.map(e=>typeof e==`string`?e.toLowerCase():e),i=i.map(e=>typeof e==`string`?e.toLowerCase():e));let a=new Set(r),o=new Set(i),s=e.Pipe??qr,c=e.Boolean??hr,l=e.String??Hn,u=new(e.Transform??Rr)({type:`transform`,transform:(e,t)=>{let r=e;return n.case!==`sensitive`&&(r=r.toLowerCase()),a.has(r)?!0:!o.has(r)&&(t.issues.push({code:`invalid_value`,expected:`stringbool`,values:[...a,...o],input:t.value,inst:u}),{})},error:n.error});return new s({type:`pipe`,in:new s({type:`pipe`,in:new l({type:`string`,error:n.error}),out:u,error:n.error}),out:new c({type:`boolean`,error:n.error}),error:n.error})}function vc(e,t,n,r={}){let i=_(r),a={..._(r),check:`string_format`,type:`string`,format:t,fn:typeof n==`function`?n:e=>n.test(e),...i};return n instanceof RegExp&&(a.pattern=n),new e(a)}var yc,bc=t((()=>{bn(),$r(),x(),yc={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6}}));function xc(e){return new Sc({type:`function`,input:Array.isArray(e?.input)?Ys(jr,e?.input):e?.input??Gs(Er,ps(Sr)),output:e?.output??ps(Sr)})}var Sc,Cc=t((()=>{bc(),it(),$r(),Sc=class{constructor(e){this._def=e,this.def=e}implement(e){if(typeof e!=`function`)throw Error(`implement() must be called with a function`);let t=((...n)=>{let r=this._def.input?Ze(this._def.input,n,void 0,{callee:t}):n;if(!Array.isArray(r))throw Error(`Invalid arguments schema: not an array or tuple schema.`);let i=e(...r);return this._def.output?Ze(this._def.output,i,void 0,{callee:t}):i});return t}implementAsync(e){if(typeof e!=`function`)throw Error(`implement() must be called with a function`);let t=(async(...n)=>{let r=this._def.input?await $e(this._def.input,n,void 0,{callee:t}):n;if(!Array.isArray(r))throw Error(`Invalid arguments schema: not an array or tuple schema.`);let i=await e(...r);return this._def.output?$e(this._def.output,i,void 0,{callee:t}):i});return t}input(...e){let t=this.constructor;return Array.isArray(e[0])?new t({type:`function`,input:new jr({type:`tuple`,items:e[0],rest:e[1]}),output:this._def.output}):new t({type:`function`,input:e[0],output:this._def.output})}output(e){let t=this.constructor;return new t({type:`function`,input:this._def.input,output:e})}}}));function wc(e,t){if(e instanceof bo){let n=new Tc(t),r={};for(let t of e._idmap.entries()){let[e,r]=t;n.process(r)}let i={},a={registry:e,uri:t?.uri,defs:r};for(let r of e._idmap.entries()){let[e,o]=r;i[e]=n.emit(o,{...t,external:a})}return Object.keys(r).length>0&&(i.__shared={[n.target===`draft-2020-12`?`$defs`:`definitions`]:r}),{schemas:i}}let n=new Tc(t);return n.process(e),n.emit(e,t)}function O(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;switch(r.type){case`string`:case`number`:case`bigint`:case`boolean`:case`date`:case`symbol`:case`undefined`:case`null`:case`any`:case`unknown`:case`never`:case`void`:case`literal`:case`enum`:case`nan`:case`file`:case`template_literal`:return!1;case`array`:return O(r.element,n);case`object`:for(let e in r.shape)if(O(r.shape[e],n))return!0;return!1;case`union`:for(let e of r.options)if(O(e,n))return!0;return!1;case`intersection`:return O(r.left,n)||O(r.right,n);case`tuple`:for(let e of r.items)if(O(e,n))return!0;return!!(r.rest&&O(r.rest,n));case`record`:return O(r.keyType,n)||O(r.valueType,n);case`map`:return O(r.keyType,n)||O(r.valueType,n);case`set`:return O(r.valueType,n);case`promise`:case`optional`:case`nonoptional`:case`nullable`:case`readonly`:return O(r.innerType,n);case`lazy`:return O(r.getter(),n);case`default`:return O(r.innerType,n);case`prefault`:return O(r.innerType,n);case`custom`:return!1;case`transform`:return!0;case`pipe`:return O(r.in,n)||O(r.out,n);case`success`:return!1;case`catch`:return!1}throw Error(`Unknown schema type: ${r.type}`)}var Tc,Ec=t((()=>{xo(),x(),Tc=class{constructor(e){this.counter=0,this.metadataRegistry=e?.metadata??T,this.target=e?.target??`draft-2020-12`,this.unrepresentable=e?.unrepresentable??`throw`,this.override=e?.override??(()=>{}),this.io=e?.io??`output`,this.seen=new Map}process(e,t={path:[],schemaPath:[]}){var n;let r=e._zod.def,i={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},a=this.seen.get(e);if(a)return a.count++,t.schemaPath.includes(e)&&(a.cycle=t.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:t.path};this.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let n={...t,schemaPath:[...t.schemaPath,e],path:t.path},a=e._zod.parent;if(a)o.ref=a,this.process(a,n),this.seen.get(a).isParent=!0;else{let t=o.schema;switch(r.type){case`string`:{let n=t;n.type=`string`;let{minimum:r,maximum:a,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof r==`number`&&(n.minLength=r),typeof a==`number`&&(n.maxLength=a),s&&(n.format=i[s]??s,n.format===``&&delete n.format),l&&(n.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?n.pattern=e[0].source:e.length>1&&(o.schema.allOf=[...e.map(e=>({...this.target===`draft-7`?{type:`string`}:{},pattern:e.source}))])}break}case`number`:{let n=t,{minimum:r,maximum:i,format:a,multipleOf:o,exclusiveMaximum:s,exclusiveMinimum:c}=e._zod.bag;n.type=typeof a==`string`&&a.includes(`int`)?`integer`:`number`,typeof c==`number`&&(n.exclusiveMinimum=c),typeof r==`number`&&(n.minimum=r,typeof c==`number`&&(c>=r?delete n.minimum:delete n.exclusiveMinimum)),typeof s==`number`&&(n.exclusiveMaximum=s),typeof i==`number`&&(n.maximum=i,typeof s==`number`&&(s<=i?delete n.maximum:delete n.exclusiveMaximum)),typeof o==`number`&&(n.multipleOf=o);break}case`boolean`:{let e=t;e.type=`boolean`;break}case`bigint`:if(this.unrepresentable===`throw`)throw Error(`BigInt cannot be represented in JSON Schema`);break;case`symbol`:if(this.unrepresentable===`throw`)throw Error(`Symbols cannot be represented in JSON Schema`);break;case`null`:t.type=`null`;break;case`any`:break;case`unknown`:break;case`undefined`:if(this.unrepresentable===`throw`)throw Error(`Undefined cannot be represented in JSON Schema`);break;case`void`:if(this.unrepresentable===`throw`)throw Error(`Void cannot be represented in JSON Schema`);break;case`never`:t.not={};break;case`date`:if(this.unrepresentable===`throw`)throw Error(`Date cannot be represented in JSON Schema`);break;case`array`:{let i=t,{minimum:a,maximum:o}=e._zod.bag;typeof a==`number`&&(i.minItems=a),typeof o==`number`&&(i.maxItems=o),i.type=`array`,i.items=this.process(r.element,{...n,path:[...n.path,`items`]});break}case`object`:{let e=t;e.type=`object`,e.properties={};let i=r.shape;for(let t in i)e.properties[t]=this.process(i[t],{...n,path:[...n.path,`properties`,t]});let a=new Set(Object.keys(i)),o=new Set([...a].filter(e=>{let t=r.shape[e]._zod;return this.io===`input`?t.optin===void 0:t.optout===void 0}));o.size>0&&(e.required=Array.from(o)),r.catchall?._zod.def.type===`never`?e.additionalProperties=!1:r.catchall?r.catchall&&(e.additionalProperties=this.process(r.catchall,{...n,path:[...n.path,`additionalProperties`]})):this.io===`output`&&(e.additionalProperties=!1);break}case`union`:{let e=t;e.anyOf=r.options.map((e,t)=>this.process(e,{...n,path:[...n.path,`anyOf`,t]}));break}case`intersection`:{let e=t,i=this.process(r.left,{...n,path:[...n.path,`allOf`,0]}),a=this.process(r.right,{...n,path:[...n.path,`allOf`,1]}),o=e=>`allOf`in e&&Object.keys(e).length===1;e.allOf=[...o(i)?i.allOf:[i],...o(a)?a.allOf:[a]];break}case`tuple`:{let i=t;i.type=`array`;let a=r.items.map((e,t)=>this.process(e,{...n,path:[...n.path,`prefixItems`,t]}));if(this.target===`draft-2020-12`?i.prefixItems=a:i.items=a,r.rest){let e=this.process(r.rest,{...n,path:[...n.path,`items`]});this.target===`draft-2020-12`?i.items=e:i.additionalItems=e}r.rest&&(i.items=this.process(r.rest,{...n,path:[...n.path,`items`]}));let{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s);break}case`record`:{let e=t;e.type=`object`,e.propertyNames=this.process(r.keyType,{...n,path:[...n.path,`propertyNames`]}),e.additionalProperties=this.process(r.valueType,{...n,path:[...n.path,`additionalProperties`]});break}case`map`:if(this.unrepresentable===`throw`)throw Error(`Map cannot be represented in JSON Schema`);break;case`set`:if(this.unrepresentable===`throw`)throw Error(`Set cannot be represented in JSON Schema`);break;case`enum`:{let e=t,n=ie(r.entries);n.every(e=>typeof e==`number`)&&(e.type=`number`),n.every(e=>typeof e==`string`)&&(e.type=`string`),e.enum=n;break}case`literal`:{let e=t,n=[];for(let e of r.values)if(e===void 0){if(this.unrepresentable===`throw`)throw Error(\"Literal `undefined` cannot be represented in JSON Schema\")}else if(typeof e==`bigint`){if(this.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);n.push(Number(e))}else n.push(e);if(n.length!==0){if(n.length===1){let t=n[0];e.type=t===null?`null`:typeof t,e.const=t}else n.every(e=>typeof e==`number`)&&(e.type=`number`),n.every(e=>typeof e==`string`)&&(e.type=`string`),n.every(e=>typeof e==`boolean`)&&(e.type=`string`),n.every(e=>e===null)&&(e.type=`null`),e.enum=n}break}case`file`:{let n=t,r={type:`string`,format:`binary`,contentEncoding:`binary`},{minimum:i,maximum:a,mime:o}=e._zod.bag;i!==void 0&&(r.minLength=i),a!==void 0&&(r.maxLength=a),o?o.length===1?(r.contentMediaType=o[0],Object.assign(n,r)):n.anyOf=o.map(e=>({...r,contentMediaType:e})):Object.assign(n,r);break}case`transform`:if(this.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`);break;case`nullable`:t.anyOf=[this.process(r.innerType,n),{type:`null`}];break;case`nonoptional`:this.process(r.innerType,n),o.ref=r.innerType;break;case`success`:{let e=t;e.type=`boolean`;break}case`default`:this.process(r.innerType,n),o.ref=r.innerType,t.default=JSON.parse(JSON.stringify(r.defaultValue));break;case`prefault`:this.process(r.innerType,n),o.ref=r.innerType,this.io===`input`&&(t._prefault=JSON.parse(JSON.stringify(r.defaultValue)));break;case`catch`:{this.process(r.innerType,n),o.ref=r.innerType;let e;try{e=r.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}t.default=e;break}case`nan`:if(this.unrepresentable===`throw`)throw Error(`NaN cannot be represented in JSON Schema`);break;case`template_literal`:{let n=t,r=e._zod.pattern;if(!r)throw Error(`Pattern not found in template literal`);n.type=`string`,n.pattern=r.source;break}case`pipe`:{let e=this.io===`input`?r.in._zod.def.type===`transform`?r.out:r.in:r.out;this.process(e,n),o.ref=e;break}case`readonly`:this.process(r.innerType,n),o.ref=r.innerType,t.readOnly=!0;break;case`promise`:this.process(r.innerType,n),o.ref=r.innerType;break;case`optional`:this.process(r.innerType,n),o.ref=r.innerType;break;case`lazy`:{let t=e._zod.innerType;this.process(t,n),o.ref=t;break}case`custom`:if(this.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)}}}let c=this.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),this.io===`input`&&O(e)&&(delete o.schema.examples,delete o.schema.default),this.io===`input`&&o.schema._prefault&&((n=o.schema).default??(n.default=o.schema._prefault)),delete o.schema._prefault,this.seen.get(e).schema}emit(e,t){let n={cycles:t?.cycles??`ref`,reused:t?.reused??`inline`,external:t?.external??void 0},r=this.seen.get(e);if(!r)throw Error(`Unprocessed schema. This is a bug in Zod.`);let i=e=>{let t=this.target===`draft-2020-12`?`$defs`:`definitions`;if(n.external){let r=n.external.registry.get(e[0])?.id,i=n.external.uri??(e=>e);if(r)return{ref:i(r)};let a=e[1].defId??e[1].schema.id??`schema${this.counter++}`;return e[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${t}/${a}`}}if(e[1]===r)return{ref:`#`};let i=`#/${t}/`,a=e[1].schema.id??`__schema${this.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(n.cycles===`throw`)for(let e of this.seen.entries()){let t=e[1];if(t.cycle)throw Error(`Cycle detected: #/${t.cycle?.join(`/`)}/<root>\n\nSet the \\`cycles\\` parameter to \\`\"ref\"\\` to resolve cyclical schemas with defs.`)}for(let t of this.seen.entries()){let r=t[1];if(e===t[0]){a(t);continue}if(n.external){let r=n.external.registry.get(t[0])?.id;if(e!==t[0]&&r){a(t);continue}}if(this.metadataRegistry.get(t[0])?.id){a(t);continue}if(r.cycle){a(t);continue}if(r.count>1&&n.reused===`ref`){a(t);continue}}let o=(e,t)=>{let n=this.seen.get(e),r=n.def??n.schema,i={...r};if(n.ref===null)return;let a=n.ref;if(n.ref=null,a){o(a,t);let e=this.seen.get(a).schema;e.$ref&&t.target===`draft-7`?(r.allOf=r.allOf??[],r.allOf.push(e)):(Object.assign(r,e),Object.assign(r,i))}n.isParent||this.override({zodSchema:e,jsonSchema:r,path:n.path??[]})};for(let e of[...this.seen.entries()].reverse())o(e[0],{target:this.target});let s={};if(this.target===`draft-2020-12`?s.$schema=`https://json-schema.org/draft/2020-12/schema`:this.target===`draft-7`?s.$schema=`http://json-schema.org/draft-07/schema#`:console.warn(`Invalid target: ${this.target}`),n.external?.uri){let t=n.external.registry.get(e)?.id;if(!t)throw Error(\"Schema is missing an `id` property\");s.$id=n.external.uri(t)}Object.assign(s,r.def);let c=n.external?.defs??{};for(let e of this.seen.entries()){let t=e[1];t.def&&t.defId&&(c[t.defId]=t.def)}n.external||Object.keys(c).length>0&&(this.target===`draft-2020-12`?s.$defs=c:s.definitions=c);try{return JSON.parse(JSON.stringify(s))}catch{throw Error(`Error converting schema to JSON.`)}}}})),Dc=r({}),Oc=t((()=>{})),kc=r({$ZodAny:()=>xr,$ZodArray:()=>Er,$ZodAsyncError:()=>l,$ZodBase64:()=>cr,$ZodBase64URL:()=>lr,$ZodBigInt:()=>gr,$ZodBigIntFormat:()=>_r,$ZodBoolean:()=>hr,$ZodCIDRv4:()=>or,$ZodCIDRv6:()=>sr,$ZodCUID:()=>Yn,$ZodCUID2:()=>Xn,$ZodCatch:()=>Gr,$ZodCheck:()=>S,$ZodCheckBigIntFormat:()=>nn,$ZodCheckEndsWith:()=>gn,$ZodCheckGreaterThan:()=>$t,$ZodCheckIncludes:()=>mn,$ZodCheckLengthEquals:()=>ln,$ZodCheckLessThan:()=>Qt,$ZodCheckLowerCase:()=>fn,$ZodCheckMaxLength:()=>sn,$ZodCheckMaxSize:()=>rn,$ZodCheckMimeType:()=>vn,$ZodCheckMinLength:()=>cn,$ZodCheckMinSize:()=>an,$ZodCheckMultipleOf:()=>en,$ZodCheckNumberFormat:()=>tn,$ZodCheckOverwrite:()=>yn,$ZodCheckProperty:()=>_n,$ZodCheckRegex:()=>dn,$ZodCheckSizeEquals:()=>on,$ZodCheckStartsWith:()=>hn,$ZodCheckStringFormat:()=>un,$ZodCheckUpperCase:()=>pn,$ZodCustom:()=>Qr,$ZodCustomStringFormat:()=>fr,$ZodDate:()=>Tr,$ZodDefault:()=>Vr,$ZodDiscriminatedUnion:()=>kr,$ZodE164:()=>ur,$ZodEmail:()=>Gn,$ZodEmoji:()=>qn,$ZodEnum:()=>Fr,$ZodError:()=>qe,$ZodFile:()=>Lr,$ZodFunction:()=>Sc,$ZodGUID:()=>Un,$ZodIPv4:()=>ir,$ZodIPv6:()=>ar,$ZodISODate:()=>tr,$ZodISODateTime:()=>er,$ZodISODuration:()=>rr,$ZodISOTime:()=>nr,$ZodIntersection:()=>Ar,$ZodJWT:()=>dr,$ZodKSUID:()=>$n,$ZodLazy:()=>Zr,$ZodLiteral:()=>Ir,$ZodMap:()=>Nr,$ZodNaN:()=>Kr,$ZodNanoID:()=>Jn,$ZodNever:()=>Cr,$ZodNonOptional:()=>Ur,$ZodNull:()=>br,$ZodNullable:()=>Br,$ZodNumber:()=>pr,$ZodNumberFormat:()=>mr,$ZodObject:()=>Dr,$ZodOptional:()=>zr,$ZodPipe:()=>qr,$ZodPrefault:()=>Hr,$ZodPromise:()=>Xr,$ZodReadonly:()=>Jr,$ZodRealError:()=>Je,$ZodRecord:()=>Mr,$ZodRegistry:()=>bo,$ZodSet:()=>Pr,$ZodString:()=>Hn,$ZodStringFormat:()=>w,$ZodSuccess:()=>Wr,$ZodSymbol:()=>vr,$ZodTemplateLiteral:()=>Yr,$ZodTransform:()=>Rr,$ZodTuple:()=>jr,$ZodType:()=>C,$ZodULID:()=>Zn,$ZodURL:()=>Kn,$ZodUUID:()=>Wn,$ZodUndefined:()=>yr,$ZodUnion:()=>Or,$ZodUnknown:()=>Sr,$ZodVoid:()=>wr,$ZodXID:()=>Qn,$brand:()=>c,$constructor:()=>a,$input:()=>yo,$output:()=>vo,Doc:()=>xn,JSONSchema:()=>Dc,JSONSchemaGenerator:()=>Tc,NEVER:()=>s,TimePrecision:()=>yc,_any:()=>fs,_array:()=>Gs,_base64:()=>Ho,_base64url:()=>Uo,_bigint:()=>as,_boolean:()=>rs,_catch:()=>lc,_cidrv4:()=>Bo,_cidrv6:()=>Vo,_coercedBigint:()=>os,_coercedBoolean:()=>is,_coercedDate:()=>_s,_coercedNumber:()=>Zo,_coercedString:()=>Co,_cuid:()=>No,_cuid2:()=>Po,_custom:()=>hc,_date:()=>gs,_default:()=>oc,_discriminatedUnion:()=>qs,_e164:()=>Wo,_email:()=>wo,_emoji:()=>jo,_endsWith:()=>Ls,_enum:()=>$s,_file:()=>nc,_float32:()=>$o,_float64:()=>es,_gt:()=>bs,_gte:()=>D,_guid:()=>To,_includes:()=>Fs,_int:()=>Qo,_int32:()=>ts,_int64:()=>ss,_intersection:()=>Js,_ipv4:()=>Ro,_ipv6:()=>zo,_isoDate:()=>qo,_isoDateTime:()=>Ko,_isoDuration:()=>Yo,_isoTime:()=>Jo,_jwt:()=>Go,_ksuid:()=>Lo,_lazy:()=>pc,_length:()=>js,_literal:()=>tc,_lowercase:()=>Ns,_lt:()=>ys,_lte:()=>E,_map:()=>Zs,_max:()=>E,_maxLength:()=>ks,_maxSize:()=>Es,_mime:()=>zs,_min:()=>D,_minLength:()=>As,_minSize:()=>Ds,_multipleOf:()=>Ts,_nan:()=>vs,_nanoid:()=>Mo,_nativeEnum:()=>ec,_negative:()=>Ss,_never:()=>ms,_nonnegative:()=>ws,_nonoptional:()=>sc,_nonpositive:()=>Cs,_normalize:()=>Vs,_null:()=>ds,_nullable:()=>ac,_number:()=>Xo,_optional:()=>ic,_overwrite:()=>Bs,_parse:()=>Xe,_parseAsync:()=>Qe,_pipe:()=>uc,_positive:()=>xs,_promise:()=>mc,_property:()=>Rs,_readonly:()=>dc,_record:()=>Xs,_refine:()=>gc,_regex:()=>Ms,_safeParse:()=>et,_safeParseAsync:()=>nt,_set:()=>Qs,_size:()=>Os,_startsWith:()=>Is,_string:()=>So,_stringFormat:()=>vc,_stringbool:()=>_c,_success:()=>cc,_symbol:()=>ls,_templateLiteral:()=>fc,_toLowerCase:()=>Us,_toUpperCase:()=>Ws,_transform:()=>rc,_trim:()=>Hs,_tuple:()=>Ys,_uint32:()=>ns,_uint64:()=>cs,_ulid:()=>Fo,_undefined:()=>us,_union:()=>Ks,_unknown:()=>ps,_uppercase:()=>Ps,_url:()=>Ao,_uuid:()=>Eo,_uuidv4:()=>Do,_uuidv6:()=>Oo,_uuidv7:()=>ko,_void:()=>hs,_xid:()=>Io,clone:()=>g,config:()=>o,flattenError:()=>Ve,formatError:()=>He,function:()=>xc,globalConfig:()=>u,globalRegistry:()=>T,isValidBase64:()=>Tn,isValidBase64URL:()=>En,isValidJWT:()=>Dn,locales:()=>ho,parse:()=>Ze,parseAsync:()=>$e,prettifyError:()=>Ge,regexes:()=>at,registry:()=>_o,safeParse:()=>tt,safeParseAsync:()=>rt,toDotPath:()=>We,toJSONSchema:()=>wc,treeifyError:()=>Ue,util:()=>f,version:()=>Cn}),k=t((()=>{d(),it(),Ye(),$r(),bn(),wn(),x(),Yt(),go(),xo(),Sn(),Cc(),bc(),Ec(),Oc()})),Ac=t((()=>{k()})),jc=t((()=>{})),Mc=t((()=>{k()})),Nc=t((()=>{k(),Ac(),jc(),Mc(),go(),jc()})),Pc=t((()=>{Nc()})),Fc=t((()=>{Pc()}));function Ic(e){return!!e._zod}function Lc(e,t){return Ic(e)?tt(e,t):e.safeParse(t)}function Rc(e){if(!e)return;let t;if(t=Ic(e)?e._zod?.def?.shape:e.shape,t){if(typeof t==`function`)try{return t()}catch{return}return t}}function zc(e){if(Ic(e)){let t=e._zod?.def;if(t){if(t.value!==void 0)return t.value;if(Array.isArray(t.values)&&t.values.length>0)return t.values[0]}}let t=e._def;if(t){if(t.value!==void 0)return t.value;if(Array.isArray(t.values)&&t.values.length>0)return t.values[0]}let n=e.value;if(n!==void 0)return n}var Bc=t((()=>{Fc()})),Vc=t((()=>{k()})),Hc=r({ZodISODate:()=>Jc,ZodISODateTime:()=>qc,ZodISODuration:()=>Xc,ZodISOTime:()=>Yc,date:()=>Wc,datetime:()=>Uc,duration:()=>Kc,time:()=>Gc});function Uc(e){return Ko(qc,e)}function Wc(e){return qo(Jc,e)}function Gc(e){return Jo(Yc,e)}function Kc(e){return Yo(Xc,e)}var qc,Jc,Yc,Xc,Zc=t((()=>{k(),Ad(),qc=a(`ZodISODateTime`,(e,t)=>{er.init(e,t),U.init(e,t)}),Jc=a(`ZodISODate`,(e,t)=>{tr.init(e,t),U.init(e,t)}),Yc=a(`ZodISOTime`,(e,t)=>{nr.init(e,t),U.init(e,t)}),Xc=a(`ZodISODuration`,(e,t)=>{rr.init(e,t),U.init(e,t)})})),Qc,$c,el,tl=t((()=>{k(),Qc=(e,t)=>{qe.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>He(e,t)},flatten:{value:t=>Ve(e,t)},addIssue:{value:t=>e.issues.push(t)},addIssues:{value:t=>e.issues.push(...t)},isEmpty:{get(){return e.issues.length===0}}})},$c=a(`ZodError`,Qc),el=a(`ZodError`,Qc,{Parent:Error})})),nl,rl,il,al,ol=t((()=>{k(),tl(),nl=Xe(el),rl=Qe(el),il=et(el),al=nt(el)}));function A(e){return So(Cu,e)}function sl(e){return wo(wu,e)}function cl(e){return To(Tu,e)}function ll(e){return Eo(W,e)}function ul(e){return Do(W,e)}function dl(e){return Oo(W,e)}function fl(e){return ko(W,e)}function pl(e){return Ao(Eu,e)}function ml(e){return jo(Du,e)}function hl(e){return Mo(Ou,e)}function gl(e){return No(ku,e)}function _l(e){return Po(Au,e)}function vl(e){return Fo(ju,e)}function yl(e){return Io(Mu,e)}function bl(e){return Lo(Nu,e)}function xl(e){return Ro(Pu,e)}function Sl(e){return zo(Fu,e)}function Cl(e){return Bo(Iu,e)}function wl(e){return Vo(Lu,e)}function Tl(e){return Ho(Ru,e)}function El(e){return Uo(zu,e)}function Dl(e){return Wo(Bu,e)}function Ol(e){return Go(Vu,e)}function kl(e,t,n={}){return vc(Hu,e,t,n)}function j(e){return Xo(Uu,e)}function Al(e){return Qo(Wu,e)}function jl(e){return $o(Wu,e)}function Ml(e){return es(Wu,e)}function Nl(e){return ts(Wu,e)}function Pl(e){return ns(Wu,e)}function M(e){return rs(Gu,e)}function Fl(e){return as(Ku,e)}function Il(e){return ss(qu,e)}function Ll(e){return cs(qu,e)}function Rl(e){return ls(Ju,e)}function zl(e){return us(Yu,e)}function Bl(e){return ds(Xu,e)}function Vl(){return fs(Zu)}function N(){return ps(Qu)}function Hl(e){return ms($u,e)}function Ul(e){return hs(ed,e)}function Wl(e){return gs(td,e)}function P(e,t){return Gs(nd,e,t)}function Gl(e){let t=e._zod.def.shape;return B(Object.keys(t))}function F(e,t){let n={type:`object`,get shape(){return ue(this,`shape`,{...e}),this.shape},..._(t)};return new rd(n)}function Kl(e,t){return new rd({type:`object`,get shape(){return ue(this,`shape`,{...e}),this.shape},catchall:Hl(),..._(t)})}function I(e,t){return new rd({type:`object`,get shape(){return ue(this,`shape`,{...e}),this.shape},catchall:N(),..._(t)})}function L(e,t){return new id({type:`union`,options:e,..._(t)})}function ql(e,t,n){return new ad({type:`union`,options:t,discriminator:e,..._(n)})}function Jl(e,t){return new od({type:`intersection`,left:e,right:t})}function Yl(e,t,n){let r=t instanceof C;return new sd({type:`tuple`,items:e,rest:r?t:null,..._(r?n:t)})}function R(e,t,n){return new cd({type:`record`,keyType:e,valueType:t,..._(n)})}function Xl(e,t,n){return new cd({type:`record`,keyType:L([e,Hl()]),valueType:t,..._(n)})}function Zl(e,t,n){return new ld({type:`map`,keyType:e,valueType:t,..._(n)})}function Ql(e,t){return new ud({type:`set`,valueType:e,..._(t)})}function z(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new dd({type:`enum`,entries:n,..._(t)})}function $l(e,t){return new dd({type:`enum`,entries:e,..._(t)})}function B(e,t){return new fd({type:`literal`,values:Array.isArray(e)?e:[e],..._(t)})}function eu(e){return nc(pd,e)}function tu(e){return new md({type:`transform`,transform:e})}function V(e){return new hd({type:`optional`,innerType:e})}function nu(e){return new gd({type:`nullable`,innerType:e})}function ru(e){return V(nu(e))}function iu(e,t){return new _d({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():t}})}function au(e,t){return new vd({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():t}})}function ou(e,t){return new yd({type:`nonoptional`,innerType:e,..._(t)})}function su(e){return new bd({type:`success`,innerType:e})}function cu(e,t){return new xd({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}function lu(e){return vs(Sd,e)}function uu(e,t){return new Cd({type:`pipe`,in:e,out:t})}function du(e){return new wd({type:`readonly`,innerType:e})}function fu(e,t){return new Td({type:`template_literal`,parts:e,..._(t)})}function pu(e){return new Ed({type:`lazy`,getter:e})}function mu(e){return new Dd({type:`promise`,innerType:e})}function hu(e){let t=new S({check:`custom`});return t._zod.check=e,t}function gu(e,t){return hc(Od,e??(()=>!0),t)}function _u(e,t={}){return gc(Od,e,t)}function vu(e){let t=hu(n=>(n.addIssue=e=>{if(typeof e==`string`)n.issues.push(je(e,n.value,t._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=n.value,r.inst??=t,r.continue??=!t._zod.def.abort,n.issues.push(je(r))}},e(n.value,n)));return t}function yu(e,t={error:`Input not instance of ${e.name}`}){let n=new Od({type:`custom`,check:`custom`,fn:t=>t instanceof e,abort:!0,..._(t)});return n._zod.bag.Class=e,n}function bu(e){let t=pu(()=>L([A(e),j(),M(),Bl(),P(t),R(A(),t)]));return t}function xu(e,t){return uu(tu(e),t)}var H,Su,Cu,U,wu,Tu,W,Eu,Du,Ou,ku,Au,ju,Mu,Nu,Pu,Fu,Iu,Lu,Ru,zu,Bu,Vu,Hu,Uu,Wu,Gu,Ku,qu,Ju,Yu,Xu,Zu,Qu,$u,ed,td,nd,rd,id,ad,od,sd,cd,ld,ud,dd,fd,pd,md,hd,gd,_d,vd,yd,bd,xd,Sd,Cd,wd,Td,Ed,Dd,Od,kd,Ad=t((()=>{k(),Vc(),Zc(),ol(),H=a(`ZodType`,(e,t)=>(C.init(e,t),e.def=t,Object.defineProperty(e,\"_def\",{value:t}),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),e.clone=(t,n)=>g(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.parse=(t,n)=>nl(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>il(e,t,n),e.parseAsync=async(t,n)=>rl(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>al(e,t,n),e.spa=e.safeParseAsync,e.refine=(t,n)=>e.check(_u(t,n)),e.superRefine=t=>e.check(vu(t)),e.overwrite=t=>e.check(Bs(t)),e.optional=()=>V(e),e.nullable=()=>nu(e),e.nullish=()=>V(nu(e)),e.nonoptional=t=>ou(e,t),e.array=()=>P(e),e.or=t=>L([e,t]),e.and=t=>Jl(e,t),e.transform=t=>uu(e,tu(t)),e.default=t=>iu(e,t),e.prefault=t=>au(e,t),e.catch=t=>cu(e,t),e.pipe=t=>uu(e,t),e.readonly=()=>du(e),e.describe=t=>{let n=e.clone();return T.add(n,{description:t}),n},Object.defineProperty(e,\"description\",{get(){return T.get(e)?.description},configurable:!0}),e.meta=(...t)=>{if(t.length===0)return T.get(e);let n=e.clone();return T.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),Su=a(`_ZodString`,(e,t)=>{Hn.init(e,t),H.init(e,t);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(Ms(...t)),e.includes=(...t)=>e.check(Fs(...t)),e.startsWith=(...t)=>e.check(Is(...t)),e.endsWith=(...t)=>e.check(Ls(...t)),e.min=(...t)=>e.check(As(...t)),e.max=(...t)=>e.check(ks(...t)),e.length=(...t)=>e.check(js(...t)),e.nonempty=(...t)=>e.check(As(1,...t)),e.lowercase=t=>e.check(Ns(t)),e.uppercase=t=>e.check(Ps(t)),e.trim=()=>e.check(Hs()),e.normalize=(...t)=>e.check(Vs(...t)),e.toLowerCase=()=>e.check(Us()),e.toUpperCase=()=>e.check(Ws())}),Cu=a(`ZodString`,(e,t)=>{Hn.init(e,t),Su.init(e,t),e.email=t=>e.check(wo(wu,t)),e.url=t=>e.check(Ao(Eu,t)),e.jwt=t=>e.check(Go(Vu,t)),e.emoji=t=>e.check(jo(Du,t)),e.guid=t=>e.check(To(Tu,t)),e.uuid=t=>e.check(Eo(W,t)),e.uuidv4=t=>e.check(Do(W,t)),e.uuidv6=t=>e.check(Oo(W,t)),e.uuidv7=t=>e.check(ko(W,t)),e.nanoid=t=>e.check(Mo(Ou,t)),e.guid=t=>e.check(To(Tu,t)),e.cuid=t=>e.check(No(ku,t)),e.cuid2=t=>e.check(Po(Au,t)),e.ulid=t=>e.check(Fo(ju,t)),e.base64=t=>e.check(Ho(Ru,t)),e.base64url=t=>e.check(Uo(zu,t)),e.xid=t=>e.check(Io(Mu,t)),e.ksuid=t=>e.check(Lo(Nu,t)),e.ipv4=t=>e.check(Ro(Pu,t)),e.ipv6=t=>e.check(zo(Fu,t)),e.cidrv4=t=>e.check(Bo(Iu,t)),e.cidrv6=t=>e.check(Vo(Lu,t)),e.e164=t=>e.check(Wo(Bu,t)),e.datetime=t=>e.check(Uc(t)),e.date=t=>e.check(Wc(t)),e.time=t=>e.check(Gc(t)),e.duration=t=>e.check(Kc(t))}),U=a(`ZodStringFormat`,(e,t)=>{w.init(e,t),Su.init(e,t)}),wu=a(`ZodEmail`,(e,t)=>{Gn.init(e,t),U.init(e,t)}),Tu=a(`ZodGUID`,(e,t)=>{Un.init(e,t),U.init(e,t)}),W=a(`ZodUUID`,(e,t)=>{Wn.init(e,t),U.init(e,t)}),Eu=a(`ZodURL`,(e,t)=>{Kn.init(e,t),U.init(e,t)}),Du=a(`ZodEmoji`,(e,t)=>{qn.init(e,t),U.init(e,t)}),Ou=a(`ZodNanoID`,(e,t)=>{Jn.init(e,t),U.init(e,t)}),ku=a(`ZodCUID`,(e,t)=>{Yn.init(e,t),U.init(e,t)}),Au=a(`ZodCUID2`,(e,t)=>{Xn.init(e,t),U.init(e,t)}),ju=a(`ZodULID`,(e,t)=>{Zn.init(e,t),U.init(e,t)}),Mu=a(`ZodXID`,(e,t)=>{Qn.init(e,t),U.init(e,t)}),Nu=a(`ZodKSUID`,(e,t)=>{$n.init(e,t),U.init(e,t)}),Pu=a(`ZodIPv4`,(e,t)=>{ir.init(e,t),U.init(e,t)}),Fu=a(`ZodIPv6`,(e,t)=>{ar.init(e,t),U.init(e,t)}),Iu=a(`ZodCIDRv4`,(e,t)=>{or.init(e,t),U.init(e,t)}),Lu=a(`ZodCIDRv6`,(e,t)=>{sr.init(e,t),U.init(e,t)}),Ru=a(`ZodBase64`,(e,t)=>{cr.init(e,t),U.init(e,t)}),zu=a(`ZodBase64URL`,(e,t)=>{lr.init(e,t),U.init(e,t)}),Bu=a(`ZodE164`,(e,t)=>{ur.init(e,t),U.init(e,t)}),Vu=a(`ZodJWT`,(e,t)=>{dr.init(e,t),U.init(e,t)}),Hu=a(`ZodCustomStringFormat`,(e,t)=>{fr.init(e,t),U.init(e,t)}),Uu=a(`ZodNumber`,(e,t)=>{pr.init(e,t),H.init(e,t),e.gt=(t,n)=>e.check(bs(t,n)),e.gte=(t,n)=>e.check(D(t,n)),e.min=(t,n)=>e.check(D(t,n)),e.lt=(t,n)=>e.check(ys(t,n)),e.lte=(t,n)=>e.check(E(t,n)),e.max=(t,n)=>e.check(E(t,n)),e.int=t=>e.check(Al(t)),e.safe=t=>e.check(Al(t)),e.positive=t=>e.check(bs(0,t)),e.nonnegative=t=>e.check(D(0,t)),e.negative=t=>e.check(ys(0,t)),e.nonpositive=t=>e.check(E(0,t)),e.multipleOf=(t,n)=>e.check(Ts(t,n)),e.step=(t,n)=>e.check(Ts(t,n)),e.finite=()=>e;let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null}),Wu=a(`ZodNumberFormat`,(e,t)=>{mr.init(e,t),Uu.init(e,t)}),Gu=a(`ZodBoolean`,(e,t)=>{hr.init(e,t),H.init(e,t)}),Ku=a(`ZodBigInt`,(e,t)=>{gr.init(e,t),H.init(e,t),e.gte=(t,n)=>e.check(D(t,n)),e.min=(t,n)=>e.check(D(t,n)),e.gt=(t,n)=>e.check(bs(t,n)),e.gte=(t,n)=>e.check(D(t,n)),e.min=(t,n)=>e.check(D(t,n)),e.lt=(t,n)=>e.check(ys(t,n)),e.lte=(t,n)=>e.check(E(t,n)),e.max=(t,n)=>e.check(E(t,n)),e.positive=t=>e.check(bs(BigInt(0),t)),e.negative=t=>e.check(ys(BigInt(0),t)),e.nonpositive=t=>e.check(E(BigInt(0),t)),e.nonnegative=t=>e.check(D(BigInt(0),t)),e.multipleOf=(t,n)=>e.check(Ts(t,n));let n=e._zod.bag;e.minValue=n.minimum??null,e.maxValue=n.maximum??null,e.format=n.format??null}),qu=a(`ZodBigIntFormat`,(e,t)=>{_r.init(e,t),Ku.init(e,t)}),Ju=a(`ZodSymbol`,(e,t)=>{vr.init(e,t),H.init(e,t)}),Yu=a(`ZodUndefined`,(e,t)=>{yr.init(e,t),H.init(e,t)}),Xu=a(`ZodNull`,(e,t)=>{br.init(e,t),H.init(e,t)}),Zu=a(`ZodAny`,(e,t)=>{xr.init(e,t),H.init(e,t)}),Qu=a(`ZodUnknown`,(e,t)=>{Sr.init(e,t),H.init(e,t)}),$u=a(`ZodNever`,(e,t)=>{Cr.init(e,t),H.init(e,t)}),ed=a(`ZodVoid`,(e,t)=>{wr.init(e,t),H.init(e,t)}),td=a(`ZodDate`,(e,t)=>{Tr.init(e,t),H.init(e,t),e.min=(t,n)=>e.check(D(t,n)),e.max=(t,n)=>e.check(E(t,n));let n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null}),nd=a(`ZodArray`,(e,t)=>{Er.init(e,t),H.init(e,t),e.element=t.element,e.min=(t,n)=>e.check(As(t,n)),e.nonempty=t=>e.check(As(1,t)),e.max=(t,n)=>e.check(ks(t,n)),e.length=(t,n)=>e.check(js(t,n)),e.unwrap=()=>e.element}),rd=a(`ZodObject`,(e,t)=>{Dr.init(e,t),H.init(e,t),h(e,`shape`,()=>t.shape),e.keyof=()=>z(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:N()}),e.loose=()=>e.clone({...e._zod.def,catchall:N()}),e.strict=()=>e.clone({...e._zod.def,catchall:Hl()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>Ce(e,t),e.merge=t=>we(e,t),e.pick=t=>xe(e,t),e.omit=t=>Se(e,t),e.partial=(...t)=>Te(hd,e,t[0]),e.required=(...t)=>Ee(yd,e,t[0])}),id=a(`ZodUnion`,(e,t)=>{Or.init(e,t),H.init(e,t),e.options=t.options}),ad=a(`ZodDiscriminatedUnion`,(e,t)=>{id.init(e,t),kr.init(e,t)}),od=a(`ZodIntersection`,(e,t)=>{Ar.init(e,t),H.init(e,t)}),sd=a(`ZodTuple`,(e,t)=>{jr.init(e,t),H.init(e,t),e.rest=t=>e.clone({...e._zod.def,rest:t})}),cd=a(`ZodRecord`,(e,t)=>{Mr.init(e,t),H.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType}),ld=a(`ZodMap`,(e,t)=>{Nr.init(e,t),H.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType}),ud=a(`ZodSet`,(e,t)=>{Pr.init(e,t),H.init(e,t),e.min=(...t)=>e.check(Ds(...t)),e.nonempty=t=>e.check(Ds(1,t)),e.max=(...t)=>e.check(Es(...t)),e.size=(...t)=>e.check(Os(...t))}),dd=a(`ZodEnum`,(e,t)=>{Fr.init(e,t),H.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new dd({...t,checks:[],..._(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new dd({...t,checks:[],..._(r),entries:i})}}),fd=a(`ZodLiteral`,(e,t)=>{Ir.init(e,t),H.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,\"value\",{get(){if(t.values.length>1)throw Error(\"This schema contains multiple valid literal values. Use `.values` instead.\");return t.values[0]}})}),pd=a(`ZodFile`,(e,t)=>{Lr.init(e,t),H.init(e,t),e.min=(t,n)=>e.check(Ds(t,n)),e.max=(t,n)=>e.check(Es(t,n)),e.mime=(t,n)=>e.check(zs(Array.isArray(t)?t:[t],n))}),md=a(`ZodTransform`,(e,t)=>{Rr.init(e,t),H.init(e,t),e._zod.parse=(n,r)=>{n.addIssue=r=>{if(typeof r==`string`)n.issues.push(je(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,t.continue??=!0,n.issues.push(je(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}}),hd=a(`ZodOptional`,(e,t)=>{zr.init(e,t),H.init(e,t),e.unwrap=()=>e._zod.def.innerType}),gd=a(`ZodNullable`,(e,t)=>{Br.init(e,t),H.init(e,t),e.unwrap=()=>e._zod.def.innerType}),_d=a(`ZodDefault`,(e,t)=>{Vr.init(e,t),H.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap}),vd=a(`ZodPrefault`,(e,t)=>{Hr.init(e,t),H.init(e,t),e.unwrap=()=>e._zod.def.innerType}),yd=a(`ZodNonOptional`,(e,t)=>{Ur.init(e,t),H.init(e,t),e.unwrap=()=>e._zod.def.innerType}),bd=a(`ZodSuccess`,(e,t)=>{Wr.init(e,t),H.init(e,t),e.unwrap=()=>e._zod.def.innerType}),xd=a(`ZodCatch`,(e,t)=>{Gr.init(e,t),H.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap}),Sd=a(`ZodNaN`,(e,t)=>{Kr.init(e,t),H.init(e,t)}),Cd=a(`ZodPipe`,(e,t)=>{qr.init(e,t),H.init(e,t),e.in=t.in,e.out=t.out}),wd=a(`ZodReadonly`,(e,t)=>{Jr.init(e,t),H.init(e,t)}),Td=a(`ZodTemplateLiteral`,(e,t)=>{Yr.init(e,t),H.init(e,t)}),Ed=a(`ZodLazy`,(e,t)=>{Zr.init(e,t),H.init(e,t),e.unwrap=()=>e._zod.def.getter()}),Dd=a(`ZodPromise`,(e,t)=>{Xr.init(e,t),H.init(e,t),e.unwrap=()=>e._zod.def.innerType}),Od=a(`ZodCustom`,(e,t)=>{Qr.init(e,t),H.init(e,t)}),kd=(...e)=>_c({Pipe:Cd,Boolean:Gu,String:Cu,Transform:md},...e)}));function jd(e){o({customError:e})}function Md(){return o().customError}var Nd,Pd=t((()=>{k(),Nd={invalid_type:`invalid_type`,too_big:`too_big`,too_small:`too_small`,invalid_format:`invalid_format`,not_multiple_of:`not_multiple_of`,unrecognized_keys:`unrecognized_keys`,invalid_union:`invalid_union`,invalid_key:`invalid_key`,invalid_element:`invalid_element`,invalid_value:`invalid_value`,custom:`custom`}})),Fd=r({bigint:()=>zd,boolean:()=>Rd,date:()=>Bd,number:()=>Ld,string:()=>Id});function Id(e){return Co(Cu,e)}function Ld(e){return Zo(Uu,e)}function Rd(e){return is(Gu,e)}function zd(e){return os(Ku,e)}function Bd(e){return _s(td,e)}var Vd=t((()=>{k(),Ad()})),Hd=r({$brand:()=>c,$input:()=>yo,$output:()=>vo,NEVER:()=>s,TimePrecision:()=>yc,ZodAny:()=>Zu,ZodArray:()=>nd,ZodBase64:()=>Ru,ZodBase64URL:()=>zu,ZodBigInt:()=>Ku,ZodBigIntFormat:()=>qu,ZodBoolean:()=>Gu,ZodCIDRv4:()=>Iu,ZodCIDRv6:()=>Lu,ZodCUID:()=>ku,ZodCUID2:()=>Au,ZodCatch:()=>xd,ZodCustom:()=>Od,ZodCustomStringFormat:()=>Hu,ZodDate:()=>td,ZodDefault:()=>_d,ZodDiscriminatedUnion:()=>ad,ZodE164:()=>Bu,ZodEmail:()=>wu,ZodEmoji:()=>Du,ZodEnum:()=>dd,ZodError:()=>$c,ZodFile:()=>pd,ZodGUID:()=>Tu,ZodIPv4:()=>Pu,ZodIPv6:()=>Fu,ZodISODate:()=>Jc,ZodISODateTime:()=>qc,ZodISODuration:()=>Xc,ZodISOTime:()=>Yc,ZodIntersection:()=>od,ZodIssueCode:()=>Nd,ZodJWT:()=>Vu,ZodKSUID:()=>Nu,ZodLazy:()=>Ed,ZodLiteral:()=>fd,ZodMap:()=>ld,ZodNaN:()=>Sd,ZodNanoID:()=>Ou,ZodNever:()=>$u,ZodNonOptional:()=>yd,ZodNull:()=>Xu,ZodNullable:()=>gd,ZodNumber:()=>Uu,ZodNumberFormat:()=>Wu,ZodObject:()=>rd,ZodOptional:()=>hd,ZodPipe:()=>Cd,ZodPrefault:()=>vd,ZodPromise:()=>Dd,ZodReadonly:()=>wd,ZodRealError:()=>el,ZodRecord:()=>cd,ZodSet:()=>ud,ZodString:()=>Cu,ZodStringFormat:()=>U,ZodSuccess:()=>bd,ZodSymbol:()=>Ju,ZodTemplateLiteral:()=>Td,ZodTransform:()=>md,ZodTuple:()=>sd,ZodType:()=>H,ZodULID:()=>ju,ZodURL:()=>Eu,ZodUUID:()=>W,ZodUndefined:()=>Yu,ZodUnion:()=>id,ZodUnknown:()=>Qu,ZodVoid:()=>ed,ZodXID:()=>Mu,_ZodString:()=>Su,_default:()=>iu,any:()=>Vl,array:()=>P,base64:()=>Tl,base64url:()=>El,bigint:()=>Fl,boolean:()=>M,catch:()=>cu,check:()=>hu,cidrv4:()=>Cl,cidrv6:()=>wl,clone:()=>g,coerce:()=>Fd,config:()=>o,core:()=>kc,cuid:()=>gl,cuid2:()=>_l,custom:()=>gu,date:()=>Wl,discriminatedUnion:()=>ql,e164:()=>Dl,email:()=>sl,emoji:()=>ml,endsWith:()=>Ls,enum:()=>z,file:()=>eu,flattenError:()=>Ve,float32:()=>jl,float64:()=>Ml,formatError:()=>He,function:()=>xc,getErrorMap:()=>Md,globalRegistry:()=>T,gt:()=>bs,gte:()=>D,guid:()=>cl,includes:()=>Fs,instanceof:()=>yu,int:()=>Al,int32:()=>Nl,int64:()=>Il,intersection:()=>Jl,ipv4:()=>xl,ipv6:()=>Sl,iso:()=>Hc,json:()=>bu,jwt:()=>Ol,keyof:()=>Gl,ksuid:()=>bl,lazy:()=>pu,length:()=>js,literal:()=>B,locales:()=>ho,looseObject:()=>I,lowercase:()=>Ns,lt:()=>ys,lte:()=>E,map:()=>Zl,maxLength:()=>ks,maxSize:()=>Es,mime:()=>zs,minLength:()=>As,minSize:()=>Ds,multipleOf:()=>Ts,nan:()=>lu,nanoid:()=>hl,nativeEnum:()=>$l,negative:()=>Ss,never:()=>Hl,nonnegative:()=>ws,nonoptional:()=>ou,nonpositive:()=>Cs,normalize:()=>Vs,null:()=>Bl,nullable:()=>nu,nullish:()=>ru,number:()=>j,object:()=>F,optional:()=>V,overwrite:()=>Bs,parse:()=>nl,parseAsync:()=>rl,partialRecord:()=>Xl,pipe:()=>uu,positive:()=>xs,prefault:()=>au,preprocess:()=>xu,prettifyError:()=>Ge,promise:()=>mu,property:()=>Rs,readonly:()=>du,record:()=>R,refine:()=>_u,regex:()=>Ms,regexes:()=>at,registry:()=>_o,safeParse:()=>il,safeParseAsync:()=>al,set:()=>Ql,setErrorMap:()=>jd,size:()=>Os,startsWith:()=>Is,strictObject:()=>Kl,string:()=>A,stringFormat:()=>kl,stringbool:()=>kd,success:()=>su,superRefine:()=>vu,symbol:()=>Rl,templateLiteral:()=>fu,toJSONSchema:()=>wc,toLowerCase:()=>Us,toUpperCase:()=>Ws,transform:()=>tu,treeifyError:()=>Ue,trim:()=>Hs,tuple:()=>Yl,uint32:()=>Pl,uint64:()=>Ll,ulid:()=>vl,undefined:()=>zl,union:()=>L,unknown:()=>N,uppercase:()=>Ps,url:()=>pl,uuid:()=>ll,uuidv4:()=>ul,uuidv6:()=>dl,uuidv7:()=>fl,void:()=>Ul,xid:()=>yl}),Ud=t((()=>{k(),Ad(),Vc(),tl(),ol(),Pd(),Si(),go(),Zc(),Vd(),o(yi())})),Wd,Gd=t((()=>{Ud(),Ud(),Wd=Hd})),Kd=r({$brand:()=>c,$input:()=>yo,$output:()=>vo,NEVER:()=>s,TimePrecision:()=>yc,ZodAny:()=>Zu,ZodArray:()=>nd,ZodBase64:()=>Ru,ZodBase64URL:()=>zu,ZodBigInt:()=>Ku,ZodBigIntFormat:()=>qu,ZodBoolean:()=>Gu,ZodCIDRv4:()=>Iu,ZodCIDRv6:()=>Lu,ZodCUID:()=>ku,ZodCUID2:()=>Au,ZodCatch:()=>xd,ZodCustom:()=>Od,ZodCustomStringFormat:()=>Hu,ZodDate:()=>td,ZodDefault:()=>_d,ZodDiscriminatedUnion:()=>ad,ZodE164:()=>Bu,ZodEmail:()=>wu,ZodEmoji:()=>Du,ZodEnum:()=>dd,ZodError:()=>$c,ZodFile:()=>pd,ZodGUID:()=>Tu,ZodIPv4:()=>Pu,ZodIPv6:()=>Fu,ZodISODate:()=>Jc,ZodISODateTime:()=>qc,ZodISODuration:()=>Xc,ZodISOTime:()=>Yc,ZodIntersection:()=>od,ZodIssueCode:()=>Nd,ZodJWT:()=>Vu,ZodKSUID:()=>Nu,ZodLazy:()=>Ed,ZodLiteral:()=>fd,ZodMap:()=>ld,ZodNaN:()=>Sd,ZodNanoID:()=>Ou,ZodNever:()=>$u,ZodNonOptional:()=>yd,ZodNull:()=>Xu,ZodNullable:()=>gd,ZodNumber:()=>Uu,ZodNumberFormat:()=>Wu,ZodObject:()=>rd,ZodOptional:()=>hd,ZodPipe:()=>Cd,ZodPrefault:()=>vd,ZodPromise:()=>Dd,ZodReadonly:()=>wd,ZodRealError:()=>el,ZodRecord:()=>cd,ZodSet:()=>ud,ZodString:()=>Cu,ZodStringFormat:()=>U,ZodSuccess:()=>bd,ZodSymbol:()=>Ju,ZodTemplateLiteral:()=>Td,ZodTransform:()=>md,ZodTuple:()=>sd,ZodType:()=>H,ZodULID:()=>ju,ZodURL:()=>Eu,ZodUUID:()=>W,ZodUndefined:()=>Yu,ZodUnion:()=>id,ZodUnknown:()=>Qu,ZodVoid:()=>ed,ZodXID:()=>Mu,_ZodString:()=>Su,_default:()=>iu,any:()=>Vl,array:()=>P,base64:()=>Tl,base64url:()=>El,bigint:()=>Fl,boolean:()=>M,catch:()=>cu,check:()=>hu,cidrv4:()=>Cl,cidrv6:()=>wl,clone:()=>g,coerce:()=>Fd,config:()=>o,core:()=>kc,cuid:()=>gl,cuid2:()=>_l,custom:()=>gu,date:()=>Wl,default:()=>qd,discriminatedUnion:()=>ql,e164:()=>Dl,email:()=>sl,emoji:()=>ml,endsWith:()=>Ls,enum:()=>z,file:()=>eu,flattenError:()=>Ve,float32:()=>jl,float64:()=>Ml,formatError:()=>He,function:()=>xc,getErrorMap:()=>Md,globalRegistry:()=>T,gt:()=>bs,gte:()=>D,guid:()=>cl,includes:()=>Fs,instanceof:()=>yu,int:()=>Al,int32:()=>Nl,int64:()=>Il,intersection:()=>Jl,ipv4:()=>xl,ipv6:()=>Sl,iso:()=>Hc,json:()=>bu,jwt:()=>Ol,keyof:()=>Gl,ksuid:()=>bl,lazy:()=>pu,length:()=>js,literal:()=>B,locales:()=>ho,looseObject:()=>I,lowercase:()=>Ns,lt:()=>ys,lte:()=>E,map:()=>Zl,maxLength:()=>ks,maxSize:()=>Es,mime:()=>zs,minLength:()=>As,minSize:()=>Ds,multipleOf:()=>Ts,nan:()=>lu,nanoid:()=>hl,nativeEnum:()=>$l,negative:()=>Ss,never:()=>Hl,nonnegative:()=>ws,nonoptional:()=>ou,nonpositive:()=>Cs,normalize:()=>Vs,null:()=>Bl,nullable:()=>nu,nullish:()=>ru,number:()=>j,object:()=>F,optional:()=>V,overwrite:()=>Bs,parse:()=>nl,parseAsync:()=>rl,partialRecord:()=>Xl,pipe:()=>uu,positive:()=>xs,prefault:()=>au,preprocess:()=>xu,prettifyError:()=>Ge,promise:()=>mu,property:()=>Rs,readonly:()=>du,record:()=>R,refine:()=>_u,regex:()=>Ms,regexes:()=>at,registry:()=>_o,safeParse:()=>il,safeParseAsync:()=>al,set:()=>Ql,setErrorMap:()=>jd,size:()=>Os,startsWith:()=>Is,strictObject:()=>Kl,string:()=>A,stringFormat:()=>kl,stringbool:()=>kd,success:()=>su,superRefine:()=>vu,symbol:()=>Rl,templateLiteral:()=>fu,toJSONSchema:()=>wc,toLowerCase:()=>Us,toUpperCase:()=>Ws,transform:()=>tu,treeifyError:()=>Ue,trim:()=>Hs,tuple:()=>Yl,uint32:()=>Pl,uint64:()=>Ll,ulid:()=>vl,undefined:()=>zl,union:()=>L,unknown:()=>N,uppercase:()=>Ps,url:()=>pl,uuid:()=>ll,uuidv4:()=>ul,uuidv6:()=>dl,uuidv7:()=>fl,void:()=>Ul,xid:()=>yl,z:()=>Hd}),qd,Jd=t((()=>{Gd(),Gd(),qd=Wd})),Yd,G,Xd,Zd,Qd,$d,ef,K,tf,nf,q,J,Y,X,rf,af,of,sf,cf,lf,uf,Z,df,ff,pf,mf,hf,gf,_f,vf,yf,bf,xf,Sf,Cf,wf,Tf,Ef,Df,Of,kf,Af,jf,Mf,Nf,Pf,Ff,If,Lf,Rf,zf,Bf,Vf,Hf,Uf,Wf,Gf,Kf,qf,Jf,Yf,Xf,Zf,Qf,$f,ep,tp,np,rp,ip,ap,op,sp,cp,lp,up,dp,fp,pp,mp,hp,gp,_p,vp,yp,bp,xp,Sp,Cp,wp,Tp,Ep,Dp,Op,kp,Ap,jp,Mp,Np,Pp,Fp,Ip,Lp,Rp,zp,Bp,Vp,Hp,Up,Wp,Gp,Kp,qp,Jp,Yp,Xp,Zp,Qp,$p,em,tm,nm,rm,im,am,om,sm,cm,lm,um,dm,fm,pm,mm,hm,gm,_m,vm,ym,bm,xm,Sm,Cm,wm,Tm,Em,Dm,Om,km,Am,jm,Mm,Nm,Q,Pm,Fm=t((()=>{Jd(),Yd=`io.modelcontextprotocol/related-task`,G=gu(e=>e!==null&&(typeof e==`object`||typeof e==`function`)),Xd=L([A(),j().int()]),Zd=A(),I({ttl:j().optional(),pollInterval:j().optional()}),Qd=F({ttl:j().optional()}),$d=F({taskId:A()}),ef=I({progressToken:Xd.optional(),[Yd]:$d.optional()}),K=F({_meta:ef.optional()}),tf=K.extend({task:Qd.optional()}),nf=e=>tf.safeParse(e).success,q=F({method:A(),params:K.loose().optional()}),J=F({_meta:ef.optional()}),Y=F({method:A(),params:J.loose().optional()}),X=I({_meta:ef.optional()}),rf=L([A(),j().int()]),af=F({jsonrpc:B(`2.0`),id:rf,...q.shape}).strict(),of=e=>af.safeParse(e).success,sf=F({jsonrpc:B(`2.0`),...Y.shape}).strict(),cf=e=>sf.safeParse(e).success,lf=F({jsonrpc:B(`2.0`),id:rf,result:X}).strict(),uf=e=>lf.safeParse(e).success,(function(e){e[e.ConnectionClosed=-32e3]=`ConnectionClosed`,e[e.RequestTimeout=-32001]=`RequestTimeout`,e[e.ParseError=-32700]=`ParseError`,e[e.InvalidRequest=-32600]=`InvalidRequest`,e[e.MethodNotFound=-32601]=`MethodNotFound`,e[e.InvalidParams=-32602]=`InvalidParams`,e[e.InternalError=-32603]=`InternalError`,e[e.UrlElicitationRequired=-32042]=`UrlElicitationRequired`})(Z||={}),df=F({jsonrpc:B(`2.0`),id:rf.optional(),error:F({code:j().int(),message:A(),data:N().optional()})}).strict(),ff=e=>df.safeParse(e).success,pf=L([af,sf,lf,df]),L([lf,df]),mf=X.strict(),hf=J.extend({requestId:rf.optional(),reason:A().optional()}),gf=Y.extend({method:B(`notifications/cancelled`),params:hf}),_f=F({src:A(),mimeType:A().optional(),sizes:P(A()).optional(),theme:z([`light`,`dark`]).optional()}),vf=F({icons:P(_f).optional()}),yf=F({name:A(),title:A().optional()}),bf=yf.extend({...yf.shape,...vf.shape,version:A(),websiteUrl:A().optional(),description:A().optional()}),xf=Jl(F({applyDefaults:M().optional()}),R(A(),N())),Sf=xu(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,Jl(F({form:xf.optional(),url:G.optional()}),R(A(),N()).optional())),Cf=I({list:G.optional(),cancel:G.optional(),requests:I({sampling:I({createMessage:G.optional()}).optional(),elicitation:I({create:G.optional()}).optional()}).optional()}),wf=I({list:G.optional(),cancel:G.optional(),requests:I({tools:I({call:G.optional()}).optional()}).optional()}),Tf=F({experimental:R(A(),G).optional(),sampling:F({context:G.optional(),tools:G.optional()}).optional(),elicitation:Sf.optional(),roots:F({listChanged:M().optional()}).optional(),tasks:Cf.optional(),extensions:R(A(),G).optional()}),Ef=K.extend({protocolVersion:A(),capabilities:Tf,clientInfo:bf}),Df=q.extend({method:B(`initialize`),params:Ef}),Of=F({experimental:R(A(),G).optional(),logging:G.optional(),completions:G.optional(),prompts:F({listChanged:M().optional()}).optional(),resources:F({subscribe:M().optional(),listChanged:M().optional()}).optional(),tools:F({listChanged:M().optional()}).optional(),tasks:wf.optional(),extensions:R(A(),G).optional()}),kf=X.extend({protocolVersion:A(),capabilities:Of,serverInfo:bf,instructions:A().optional()}),Af=Y.extend({method:B(`notifications/initialized`),params:J.optional()}),jf=q.extend({method:B(`ping`),params:K.optional()}),Mf=F({progress:j(),total:V(j()),message:V(A())}),Nf=F({...J.shape,...Mf.shape,progressToken:Xd}),Pf=Y.extend({method:B(`notifications/progress`),params:Nf}),Ff=K.extend({cursor:Zd.optional()}),If=q.extend({params:Ff.optional()}),Lf=X.extend({nextCursor:Zd.optional()}),Rf=z([`working`,`input_required`,`completed`,`failed`,`cancelled`]),zf=F({taskId:A(),status:Rf,ttl:L([j(),Bl()]),createdAt:A(),lastUpdatedAt:A(),pollInterval:V(j()),statusMessage:V(A())}),Bf=X.extend({task:zf}),Vf=J.merge(zf),Hf=Y.extend({method:B(`notifications/tasks/status`),params:Vf}),Uf=q.extend({method:B(`tasks/get`),params:K.extend({taskId:A()})}),Wf=X.merge(zf),Gf=q.extend({method:B(`tasks/result`),params:K.extend({taskId:A()})}),X.loose(),Kf=If.extend({method:B(`tasks/list`)}),qf=Lf.extend({tasks:P(zf)}),Jf=q.extend({method:B(`tasks/cancel`),params:K.extend({taskId:A()})}),Yf=X.merge(zf),Xf=F({uri:A(),mimeType:V(A()),_meta:R(A(),N()).optional()}),Zf=Xf.extend({text:A()}),Qf=A().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),$f=Xf.extend({blob:Qf}),ep=z([`user`,`assistant`]),tp=F({audience:P(ep).optional(),priority:j().min(0).max(1).optional(),lastModified:Uc({offset:!0}).optional()}),np=F({...yf.shape,...vf.shape,uri:A(),description:V(A()),mimeType:V(A()),size:V(j()),annotations:tp.optional(),_meta:V(I({}))}),rp=F({...yf.shape,...vf.shape,uriTemplate:A(),description:V(A()),mimeType:V(A()),annotations:tp.optional(),_meta:V(I({}))}),ip=If.extend({method:B(`resources/list`)}),ap=Lf.extend({resources:P(np)}),op=If.extend({method:B(`resources/templates/list`)}),sp=Lf.extend({resourceTemplates:P(rp)}),cp=K.extend({uri:A()}),lp=cp,up=q.extend({method:B(`resources/read`),params:lp}),dp=X.extend({contents:P(L([Zf,$f]))}),fp=Y.extend({method:B(`notifications/resources/list_changed`),params:J.optional()}),pp=cp,mp=q.extend({method:B(`resources/subscribe`),params:pp}),hp=cp,gp=q.extend({method:B(`resources/unsubscribe`),params:hp}),_p=J.extend({uri:A()}),vp=Y.extend({method:B(`notifications/resources/updated`),params:_p}),yp=F({name:A(),description:V(A()),required:V(M())}),bp=F({...yf.shape,...vf.shape,description:V(A()),arguments:V(P(yp)),_meta:V(I({}))}),xp=If.extend({method:B(`prompts/list`)}),Sp=Lf.extend({prompts:P(bp)}),Cp=K.extend({name:A(),arguments:R(A(),A()).optional()}),wp=q.extend({method:B(`prompts/get`),params:Cp}),Tp=F({type:B(`text`),text:A(),annotations:tp.optional(),_meta:R(A(),N()).optional()}),Ep=F({type:B(`image`),data:Qf,mimeType:A(),annotations:tp.optional(),_meta:R(A(),N()).optional()}),Dp=F({type:B(`audio`),data:Qf,mimeType:A(),annotations:tp.optional(),_meta:R(A(),N()).optional()}),Op=F({type:B(`tool_use`),name:A(),id:A(),input:R(A(),N()),_meta:R(A(),N()).optional()}),kp=F({type:B(`resource`),resource:L([Zf,$f]),annotations:tp.optional(),_meta:R(A(),N()).optional()}),Ap=np.extend({type:B(`resource_link`)}),jp=L([Tp,Ep,Dp,Ap,kp]),Mp=F({role:ep,content:jp}),Np=X.extend({description:A().optional(),messages:P(Mp)}),Pp=Y.extend({method:B(`notifications/prompts/list_changed`),params:J.optional()}),Fp=F({title:A().optional(),readOnlyHint:M().optional(),destructiveHint:M().optional(),idempotentHint:M().optional(),openWorldHint:M().optional()}),Ip=F({taskSupport:z([`required`,`optional`,`forbidden`]).optional()}),Lp=F({...yf.shape,...vf.shape,description:A().optional(),inputSchema:F({type:B(`object`),properties:R(A(),G).optional(),required:P(A()).optional()}).catchall(N()),outputSchema:F({type:B(`object`),properties:R(A(),G).optional(),required:P(A()).optional()}).catchall(N()).optional(),annotations:Fp.optional(),execution:Ip.optional(),_meta:R(A(),N()).optional()}),Rp=If.extend({method:B(`tools/list`)}),zp=Lf.extend({tools:P(Lp)}),Bp=X.extend({content:P(jp).default([]),structuredContent:R(A(),N()).optional(),isError:M().optional()}),Bp.or(X.extend({toolResult:N()})),Vp=tf.extend({name:A(),arguments:R(A(),N()).optional()}),Hp=q.extend({method:B(`tools/call`),params:Vp}),Up=Y.extend({method:B(`notifications/tools/list_changed`),params:J.optional()}),F({autoRefresh:M().default(!0),debounceMs:j().int().nonnegative().default(300)}),Wp=z([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),Gp=K.extend({level:Wp}),Kp=q.extend({method:B(`logging/setLevel`),params:Gp}),qp=J.extend({level:Wp,logger:A().optional(),data:N()}),Jp=Y.extend({method:B(`notifications/message`),params:qp}),Yp=F({name:A().optional()}),Xp=F({hints:P(Yp).optional(),costPriority:j().min(0).max(1).optional(),speedPriority:j().min(0).max(1).optional(),intelligencePriority:j().min(0).max(1).optional()}),Zp=F({mode:z([`auto`,`required`,`none`]).optional()}),Qp=F({type:B(`tool_result`),toolUseId:A().describe(`The unique identifier for the corresponding tool call.`),content:P(jp).default([]),structuredContent:F({}).loose().optional(),isError:M().optional(),_meta:R(A(),N()).optional()}),$p=ql(`type`,[Tp,Ep,Dp]),em=ql(`type`,[Tp,Ep,Dp,Op,Qp]),tm=F({role:ep,content:L([em,P(em)]),_meta:R(A(),N()).optional()}),nm=tf.extend({messages:P(tm),modelPreferences:Xp.optional(),systemPrompt:A().optional(),includeContext:z([`none`,`thisServer`,`allServers`]).optional(),temperature:j().optional(),maxTokens:j().int(),stopSequences:P(A()).optional(),metadata:G.optional(),tools:P(Lp).optional(),toolChoice:Zp.optional()}),rm=q.extend({method:B(`sampling/createMessage`),params:nm}),im=X.extend({model:A(),stopReason:V(z([`endTurn`,`stopSequence`,`maxTokens`]).or(A())),role:ep,content:$p}),am=X.extend({model:A(),stopReason:V(z([`endTurn`,`stopSequence`,`maxTokens`,`toolUse`]).or(A())),role:ep,content:L([em,P(em)])}),om=F({type:B(`boolean`),title:A().optional(),description:A().optional(),default:M().optional()}),sm=F({type:B(`string`),title:A().optional(),description:A().optional(),minLength:j().optional(),maxLength:j().optional(),format:z([`email`,`uri`,`date`,`date-time`]).optional(),default:A().optional()}),cm=F({type:z([`number`,`integer`]),title:A().optional(),description:A().optional(),minimum:j().optional(),maximum:j().optional(),default:j().optional()}),lm=F({type:B(`string`),title:A().optional(),description:A().optional(),enum:P(A()),default:A().optional()}),um=F({type:B(`string`),title:A().optional(),description:A().optional(),oneOf:P(F({const:A(),title:A()})),default:A().optional()}),dm=F({type:B(`string`),title:A().optional(),description:A().optional(),enum:P(A()),enumNames:P(A()).optional(),default:A().optional()}),fm=L([lm,um]),pm=F({type:B(`array`),title:A().optional(),description:A().optional(),minItems:j().optional(),maxItems:j().optional(),items:F({type:B(`string`),enum:P(A())}),default:P(A()).optional()}),mm=F({type:B(`array`),title:A().optional(),description:A().optional(),minItems:j().optional(),maxItems:j().optional(),items:F({anyOf:P(F({const:A(),title:A()}))}),default:P(A()).optional()}),hm=L([pm,mm]),gm=L([dm,fm,hm]),_m=L([gm,om,sm,cm]),vm=tf.extend({mode:B(`form`).optional(),message:A(),requestedSchema:F({type:B(`object`),properties:R(A(),_m),required:P(A()).optional()})}),ym=tf.extend({mode:B(`url`),message:A(),elicitationId:A(),url:A().url()}),bm=L([vm,ym]),xm=q.extend({method:B(`elicitation/create`),params:bm}),Sm=J.extend({elicitationId:A()}),Cm=Y.extend({method:B(`notifications/elicitation/complete`),params:Sm}),wm=X.extend({action:z([`accept`,`decline`,`cancel`]),content:xu(e=>e===null?void 0:e,R(A(),L([A(),j(),M(),P(A())])).optional())}),Tm=F({type:B(`ref/resource`),uri:A()}),Em=F({type:B(`ref/prompt`),name:A()}),Dm=K.extend({ref:L([Em,Tm]),argument:F({name:A(),value:A()}),context:F({arguments:R(A(),A()).optional()}).optional()}),Om=q.extend({method:B(`completion/complete`),params:Dm}),km=X.extend({completion:I({values:P(A()).max(100),total:V(j().int()),hasMore:V(M())})}),Am=F({uri:A().startsWith(`file://`),name:A().optional(),_meta:R(A(),N()).optional()}),jm=q.extend({method:B(`roots/list`),params:K.optional()}),Mm=X.extend({roots:P(Am)}),Nm=Y.extend({method:B(`notifications/roots/list_changed`),params:J.optional()}),L([jf,Df,Om,Kp,wp,xp,ip,op,up,mp,gp,Hp,Rp,Uf,Gf,Kf,Jf]),L([gf,Pf,Af,Nm,Hf]),L([mf,im,am,wm,Mm,Wf,qf,Bf]),L([jf,rm,xm,jm,Uf,Gf,Kf,Jf]),L([gf,Pf,Jp,vp,fp,Up,Pp,Hf,Cm]),L([mf,kf,km,Np,Sp,ap,sp,dp,Bp,zp,Wf,qf,Bf]),Q=class e extends Error{constructor(e,t,n){super(`MCP error ${e}: ${t}`),this.code=e,this.data=n,this.name=`McpError`}static fromError(t,n,r){if(t===Z.UrlElicitationRequired&&r){let e=r;if(e.elicitations)return new Pm(e.elicitations,n)}return new e(t,n,r)}},Pm=class extends Q{constructor(e,t=`URL elicitation${e.length>1?`s`:``} required`){super(Z.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}}}));function Im(e){return e===`completed`||e===`failed`||e===`cancelled`}var Lm=t((()=>{})),Rm=t((()=>{})),zm=t((()=>{})),Bm=t((()=>{})),Vm=t((()=>{})),Hm=t((()=>{})),Um=t((()=>{})),Wm=t((()=>{})),Gm=t((()=>{})),Km=t((()=>{})),qm=t((()=>{})),Jm=t((()=>{})),Ym=t((()=>{})),Xm=t((()=>{})),Zm=t((()=>{})),Qm=t((()=>{})),$m=t((()=>{})),eh=t((()=>{})),th=t((()=>{})),nh=t((()=>{})),rh=t((()=>{})),ih=t((()=>{})),ah=t((()=>{})),oh=t((()=>{})),sh=t((()=>{})),ch=t((()=>{})),lh=t((()=>{})),uh=t((()=>{})),dh=t((()=>{})),fh=t((()=>{})),ph=t((()=>{})),mh=t((()=>{})),hh=t((()=>{})),gh=t((()=>{})),_h=t((()=>{})),vh=t((()=>{})),yh=t((()=>{})),bh=t((()=>{})),xh=t((()=>{})),Sh=t((()=>{Rm(),zm(),Bm(),Vm(),yh(),bh(),Hm(),Um(),Wm(),Gm(),Km(),qm(),Jm(),Ym(),Xm(),Zm(),Qm(),$m(),nh(),rh(),ih(),ah(),sh(),ch(),lh(),uh(),dh(),fh(),_h(),th(),ph(),eh(),mh(),hh(),oh(),gh(),vh(),xh()}));function Ch(e){let t=Rc(e)?.method;if(!t)throw Error(`Schema is missing a method literal`);let n=zc(t);if(typeof n!=`string`)throw Error(`Schema method literal must be a string`);return n}function wh(e,t){let n=Lc(e,t);if(!n.success)throw n.error;return n.data}var Th=t((()=>{Bc(),Sh()}));function Eh(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Dh(e,t){let n={...e};for(let e in t){let r=e,i=t[r];if(i===void 0)continue;let a=n[r];n[r]=Eh(a)&&Eh(i)?{...a,...i}:i}return n}var Oh,kh=t((()=>{Bc(),Fm(),Lm(),Th(),Oh=class{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(gf,e=>{this._oncancel(e)}),this.setNotificationHandler(Pf,e=>{this._onprogress(e)}),this.setRequestHandler(jf,e=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(Uf,async(e,t)=>{let n=await this._taskStore.getTask(e.params.taskId,t.sessionId);if(!n)throw new Q(Z.InvalidParams,`Failed to retrieve task: Task not found`);return{...n}}),this.setRequestHandler(Gf,async(e,t)=>{let n=async()=>{let r=e.params.taskId;if(this._taskMessageQueue){let e;for(;e=await this._taskMessageQueue.dequeue(r,t.sessionId);){if(e.type===`response`||e.type===`error`){let t=e.message,n=t.id,r=this._requestResolvers.get(n);if(r){if(this._requestResolvers.delete(n),e.type===`response`)r(t);else{let e=t;r(new Q(e.error.code,e.error.message,e.error.data))}}else{let t=e.type===`response`?`Response`:`Error`;this._onerror(Error(`${t} handler missing for request ${n}`))}continue}await this._transport?.send(e.message,{relatedRequestId:t.requestId})}}let i=await this._taskStore.getTask(r,t.sessionId);if(!i)throw new Q(Z.InvalidParams,`Task not found: ${r}`);if(!Im(i.status))return await this._waitForTaskUpdate(r,t.signal),await n();if(Im(i.status)){let e=await this._taskStore.getTaskResult(r,t.sessionId);return this._clearTaskQueue(r),{...e,_meta:{...e._meta,[Yd]:{taskId:r}}}}return await n()};return await n()}),this.setRequestHandler(Kf,async(e,t)=>{try{let{tasks:n,nextCursor:r}=await this._taskStore.listTasks(e.params?.cursor,t.sessionId);return{tasks:n,nextCursor:r,_meta:{}}}catch(e){throw new Q(Z.InvalidParams,`Failed to list tasks: ${e instanceof Error?e.message:String(e)}`)}}),this.setRequestHandler(Jf,async(e,t)=>{try{let n=await this._taskStore.getTask(e.params.taskId,t.sessionId);if(!n)throw new Q(Z.InvalidParams,`Task not found: ${e.params.taskId}`);if(Im(n.status))throw new Q(Z.InvalidParams,`Cannot cancel task in terminal status: ${n.status}`);await this._taskStore.updateTaskStatus(e.params.taskId,`cancelled`,`Client cancelled task execution.`,t.sessionId),this._clearTaskQueue(e.params.taskId);let r=await this._taskStore.getTask(e.params.taskId,t.sessionId);if(!r)throw new Q(Z.InvalidParams,`Task not found after cancellation: ${e.params.taskId}`);return{_meta:{},...r}}catch(e){throw e instanceof Q?e:new Q(Z.InvalidRequest,`Failed to cancel task: ${e instanceof Error?e.message:String(e)}`)}}))}async _oncancel(e){e.params.requestId&&this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,n,r,i=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,t),startTime:Date.now(),timeout:t,maxTotalTimeout:n,resetTimeoutOnProgress:i,onTimeout:r})}_resetTimeout(e){let t=this._timeoutInfo.get(e);if(!t)return!1;let n=Date.now()-t.startTime;if(t.maxTotalTimeout&&n>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),Q.fromError(Z.RequestTimeout,`Maximum total timeout exceeded`,{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:n});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){let t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw Error(`Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.`);this._transport=e;let t=this.transport?.onclose;this._transport.onclose=()=>{t?.(),this._onclose()};let n=this.transport?.onerror;this._transport.onerror=e=>{n?.(e),this._onerror(e)};let r=this._transport?.onmessage;this._transport.onmessage=(e,t)=>{r?.(e,t),uf(e)||ff(e)?this._onresponse(e):of(e)?this._onrequest(e,t):cf(e)?this._onnotification(e):this._onerror(Error(`Unknown message type: ${JSON.stringify(e)}`))},await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let e of this._timeoutInfo.values())clearTimeout(e.timeoutId);this._timeoutInfo.clear();for(let e of this._requestHandlerAbortControllers.values())e.abort();this._requestHandlerAbortControllers.clear();let t=Q.fromError(Z.ConnectionClosed,`Connection closed`);this._transport=void 0,this.onclose?.();for(let n of e.values())n(t)}_onerror(e){this.onerror?.(e)}_onnotification(e){let t=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;t!==void 0&&Promise.resolve().then(()=>t(e)).catch(e=>this._onerror(Error(`Uncaught error in notification handler: ${e}`)))}_onrequest(e,t){let n=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,r=this._transport,i=e.params?._meta?.[Yd]?.taskId;if(n===void 0){let t={jsonrpc:`2.0`,id:e.id,error:{code:Z.MethodNotFound,message:`Method not found`}};i&&this._taskMessageQueue?this._enqueueTaskMessage(i,{type:`error`,message:t,timestamp:Date.now()},r?.sessionId).catch(e=>this._onerror(Error(`Failed to enqueue error response: ${e}`))):r?.send(t).catch(e=>this._onerror(Error(`Failed to send an error response: ${e}`)));return}let a=new AbortController;this._requestHandlerAbortControllers.set(e.id,a);let o=nf(e.params)?e.params.task:void 0,s=this._taskStore?this.requestTaskStore(e,r?.sessionId):void 0,c={signal:a.signal,sessionId:r?.sessionId,_meta:e.params?._meta,sendNotification:async t=>{if(a.signal.aborted)return;let n={relatedRequestId:e.id};i&&(n.relatedTask={taskId:i}),await this.notification(t,n)},sendRequest:async(t,n,r)=>{if(a.signal.aborted)throw new Q(Z.ConnectionClosed,`Request was cancelled`);let o={...r,relatedRequestId:e.id};i&&!o.relatedTask&&(o.relatedTask={taskId:i});let c=o.relatedTask?.taskId??i;return c&&s&&await s.updateTaskStatus(c,`input_required`),await this.request(t,n,o)},authInfo:t?.authInfo,requestId:e.id,requestInfo:t?.requestInfo,taskId:i,taskStore:s,taskRequestedTtl:o?.ttl,closeSSEStream:t?.closeSSEStream,closeStandaloneSSEStream:t?.closeStandaloneSSEStream};Promise.resolve().then(()=>{o&&this.assertTaskHandlerCapability(e.method)}).then(()=>n(e,c)).then(async t=>{if(a.signal.aborted)return;let n={result:t,jsonrpc:`2.0`,id:e.id};i&&this._taskMessageQueue?await this._enqueueTaskMessage(i,{type:`response`,message:n,timestamp:Date.now()},r?.sessionId):await r?.send(n)},async t=>{if(a.signal.aborted)return;let n={jsonrpc:`2.0`,id:e.id,error:{code:Number.isSafeInteger(t.code)?t.code:Z.InternalError,message:t.message??`Internal error`,...t.data!==void 0&&{data:t.data}}};i&&this._taskMessageQueue?await this._enqueueTaskMessage(i,{type:`error`,message:n,timestamp:Date.now()},r?.sessionId):await r?.send(n)}).catch(e=>this._onerror(Error(`Failed to send response: ${e}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===a&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){let{progressToken:t,...n}=e.params,r=Number(t),i=this._progressHandlers.get(r);if(!i){this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let a=this._responseHandlers.get(r),o=this._timeoutInfo.get(r);if(o&&a&&o.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(e){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),a(e);return}i(n)}_onresponse(e){let t=Number(e.id),n=this._requestResolvers.get(t);if(n){this._requestResolvers.delete(t),uf(e)?n(e):n(new Q(e.error.code,e.error.message,e.error.data));return}let r=this._responseHandlers.get(t);if(r===void 0){this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t);let i=!1;if(uf(e)&&e.result&&typeof e.result==`object`){let n=e.result;if(n.task&&typeof n.task==`object`){let e=n.task;typeof e.taskId==`string`&&(i=!0,this._taskProgressTokens.set(e.taskId,t))}}i||this._progressHandlers.delete(t),uf(e)?r(e):r(Q.fromError(e.error.code,e.error.message,e.error.data))}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,t,n){let{task:r}=n??{};if(!r){try{yield{type:`result`,result:await this.request(e,t,n)}}catch(e){yield{type:`error`,error:e instanceof Q?e:new Q(Z.InternalError,String(e))}}return}let i;try{let r=await this.request(e,Bf,n);if(r.task)i=r.task.taskId,yield{type:`taskCreated`,task:r.task};else throw new Q(Z.InternalError,`Task creation did not return a task`);for(;;){let e=await this.getTask({taskId:i},n);if(yield{type:`taskStatus`,task:e},Im(e.status)){e.status===`completed`?yield{type:`result`,result:await this.getTaskResult({taskId:i},t,n)}:e.status===`failed`?yield{type:`error`,error:new Q(Z.InternalError,`Task ${i} failed`)}:e.status===`cancelled`&&(yield{type:`error`,error:new Q(Z.InternalError,`Task ${i} was cancelled`)});return}if(e.status===`input_required`){yield{type:`result`,result:await this.getTaskResult({taskId:i},t,n)};return}let r=e.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(e=>setTimeout(e,r)),n?.signal?.throwIfAborted()}}catch(e){yield{type:`error`,error:e instanceof Q?e:new Q(Z.InternalError,String(e))}}}request(e,t,n){let{relatedRequestId:r,resumptionToken:i,onresumptiontoken:a,task:o,relatedTask:s}=n??{};return new Promise((c,l)=>{let u=e=>{l(e)};if(!this._transport){u(Error(`Not connected`));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),o&&this.assertTaskCapability(e.method)}catch(e){u(e);return}n?.signal?.throwIfAborted();let d=this._requestMessageId++,f={...e,jsonrpc:`2.0`,id:d};n?.onprogress&&(this._progressHandlers.set(d,n.onprogress),f.params={...e.params,_meta:{...e.params?._meta||{},progressToken:d}}),o&&(f.params={...f.params,task:o}),s&&(f.params={...f.params,_meta:{...f.params?._meta||{},[Yd]:s}});let p=e=>{this._responseHandlers.delete(d),this._progressHandlers.delete(d),this._cleanupTimeout(d),this._transport?.send({jsonrpc:`2.0`,method:`notifications/cancelled`,params:{requestId:d,reason:String(e)}},{relatedRequestId:r,resumptionToken:i,onresumptiontoken:a}).catch(e=>this._onerror(Error(`Failed to send cancellation: ${e}`))),l(e instanceof Q?e:new Q(Z.RequestTimeout,String(e)))};this._responseHandlers.set(d,e=>{if(!n?.signal?.aborted){if(e instanceof Error)return l(e);try{let n=Lc(t,e.result);n.success?c(n.data):l(n.error)}catch(e){l(e)}}}),n?.signal?.addEventListener(`abort`,()=>{p(n?.signal?.reason)});let ee=n?.timeout??6e4;this._setupTimeout(d,ee,n?.maxTotalTimeout,()=>p(Q.fromError(Z.RequestTimeout,`Request timed out`,{timeout:ee})),n?.resetTimeoutOnProgress??!1);let te=s?.taskId;te?(this._requestResolvers.set(d,e=>{let t=this._responseHandlers.get(d);t?t(e):this._onerror(Error(`Response handler missing for side-channeled request ${d}`))}),this._enqueueTaskMessage(te,{type:`request`,message:f,timestamp:Date.now()}).catch(e=>{this._cleanupTimeout(d),l(e)})):this._transport.send(f,{relatedRequestId:r,resumptionToken:i,onresumptiontoken:a}).catch(e=>{this._cleanupTimeout(d),l(e)})})}async getTask(e,t){return this.request({method:`tasks/get`,params:e},Wf,t)}async getTaskResult(e,t,n){return this.request({method:`tasks/result`,params:e},t,n)}async listTasks(e,t){return this.request({method:`tasks/list`,params:e},qf,t)}async cancelTask(e,t){return this.request({method:`tasks/cancel`,params:e},Yf,t)}async notification(e,t){if(!this._transport)throw Error(`Not connected`);this.assertNotificationCapability(e.method);let n=t?.relatedTask?.taskId;if(n){let r={...e,jsonrpc:`2.0`,params:{...e.params,_meta:{...e.params?._meta||{},[Yd]:t.relatedTask}}};await this._enqueueTaskMessage(n,{type:`notification`,message:r,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!t?.relatedRequestId&&!t?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let n={...e,jsonrpc:`2.0`};t?.relatedTask&&(n={...n,params:{...n.params,_meta:{...n.params?._meta||{},[Yd]:t.relatedTask}}}),this._transport?.send(n,t).catch(e=>this._onerror(e))});return}let r={...e,jsonrpc:`2.0`};t?.relatedTask&&(r={...r,params:{...r.params,_meta:{...r.params?._meta||{},[Yd]:t.relatedTask}}}),await this._transport.send(r,t)}setRequestHandler(e,t){let n=Ch(e);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(n,r)=>{let i=wh(e,n);return Promise.resolve(t(i,r))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t){let n=Ch(e);this._notificationHandlers.set(n,n=>{let r=wh(e,n);return Promise.resolve(t(r))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){let t=this._taskProgressTokens.get(e);t!==void 0&&(this._progressHandlers.delete(t),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,t,n){if(!this._taskStore||!this._taskMessageQueue)throw Error(`Cannot enqueue task message: taskStore and taskMessageQueue are not configured`);let r=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,t,n,r)}async _clearTaskQueue(e,t){if(this._taskMessageQueue){let n=await this._taskMessageQueue.dequeueAll(e,t);for(let t of n)if(t.type===`request`&&of(t.message)){let n=t.message.id,r=this._requestResolvers.get(n);r?(r(new Q(Z.InternalError,`Task cancelled or completed`)),this._requestResolvers.delete(n)):this._onerror(Error(`Resolver missing for request ${n} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,t){let n=this._options?.defaultTaskPollInterval??1e3;try{let t=await this._taskStore?.getTask(e);t?.pollInterval&&(n=t.pollInterval)}catch{}return new Promise((e,r)=>{if(t.aborted){r(new Q(Z.InvalidRequest,`Request cancelled`));return}let i=setTimeout(e,n);t.addEventListener(`abort`,()=>{clearTimeout(i),r(new Q(Z.InvalidRequest,`Request cancelled`))},{once:!0})})}requestTaskStore(e,t){let n=this._taskStore;if(!n)throw Error(`No task store configured`);return{createTask:async r=>{if(!e)throw Error(`No request provided`);return await n.createTask(r,e.id,{method:e.method,params:e.params},t)},getTask:async e=>{let r=await n.getTask(e,t);if(!r)throw new Q(Z.InvalidParams,`Failed to retrieve task: Task not found`);return r},storeTaskResult:async(e,r,i)=>{await n.storeTaskResult(e,r,i,t);let a=await n.getTask(e,t);if(a){let t=Hf.parse({method:`notifications/tasks/status`,params:a});await this.notification(t),Im(a.status)&&this._cleanupTaskProgressHandler(e)}},getTaskResult:e=>n.getTaskResult(e,t),updateTaskStatus:async(e,r,i)=>{let a=await n.getTask(e,t);if(!a)throw new Q(Z.InvalidParams,`Task \"${e}\" not found - it may have been cleaned up`);if(Im(a.status))throw new Q(Z.InvalidParams,`Cannot update task \"${e}\" from terminal status \"${a.status}\" to \"${r}\". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await n.updateTaskStatus(e,r,i,t);let o=await n.getTask(e,t);if(o){let t=Hf.parse({method:`notifications/tasks/status`,params:o});await this.notification(t),Im(o.status)&&this._cleanupTaskProgressHandler(e)}},listTasks:e=>n.listTasks(e,t)}}}})),Ah,jh,Mh,Nh,Ph=t((()=>{Ah=`modulepreload`,jh=function(e,t){return new URL(e,t).href},Mh={},Nh=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=jh(t,n),t=s(t),t in Mh)return;Mh[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:Ah,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})}}));async function Fh(e,t){let n=e[`~standard`];if(n.jsonSchema)return n.jsonSchema[t](fg);if(n.vendor===`zod`){let{z:n}=await Nh(async()=>{let{z:e}=await Promise.resolve().then(()=>(Jd(),Kd));return{z:e}},void 0,import.meta.url);return n.toJSONSchema(e,{io:t})}throw Error(`Schema (vendor: ${n.vendor}) does not implement Standard JSON Schema (~standard.jsonSchema). Use a library that does (zod v4, ArkType, Valibot) or wrap your schema accordingly.`)}async function Ih(e,t,n=``){let r=await e[`~standard`].validate(t);if(r.issues){let e=r.issues.map(e=>{let t=e.path?.map(e=>typeof e==`object`?e.key:e).join(`.`);return t?`${t}: ${e.message}`:e.message}).join(`; `);throw Error(n+e)}return r.value}function Lh(e){let t=document.documentElement;t.setAttribute(`data-theme`,e),t.style.colorScheme=e}function Rh(e,t=document.documentElement){for(let[n,r]of Object.entries(e))r!==void 0&&t.style.setProperty(n,r)}var zh,Bh,Vh,Hh,Uh,Wh,Gh,Kh,qh,Jh,Yh,Xh,Zh,Qh,$h,eg,tg,ng,rg,ig,ag,og,sg,cg,lg,ug,dg,fg,pg,mg=t((()=>{kh(),Fm(),Jd(),Ph(),(e=>typeof i<`u`?i:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof i<`u`?i:e)[t]}):e)(function(e){if(typeof i<`u`)return i.apply(this,arguments);throw Error(`Dynamic require of \"`+e+`\" is not supported`)}),zh=class extends Oh{_registeredMethods=new Set;_eventSlots=new Map;onEventDispatch(e,t){}_ensureEventSlot(e){let t=this._eventSlots.get(e);if(!t){let n=this.eventSchemas[e];if(!n)throw Error(`Unknown event: ${String(e)}`);t={listeners:[]},this._eventSlots.set(e,t);let r=n.shape.method.value;this._registeredMethods.add(r);let i=t;super.setNotificationHandler(n,t=>{let n=t.params;this.onEventDispatch(e,n),i.onHandler?.(n);for(let e of[...i.listeners])e(n)})}return t}setEventHandler(e,t){let n=this._ensureEventSlot(e);n.onHandler&&t&&console.warn(`[MCP Apps] on${String(e)} handler replaced. Use addEventListener(\"${String(e)}\", …) to add multiple listeners without replacing.`),n.onHandler=t}getEventHandler(e){return this._eventSlots.get(e)?.onHandler}addEventListener(e,t){this._ensureEventSlot(e).listeners.push(t)}removeEventListener(e,t){let n=this._eventSlots.get(e);if(!n)return;let r=n.listeners.indexOf(t);r!==-1&&n.listeners.splice(r,1)}setRequestHandler=(e,t)=>{this._assertMethodNotRegistered(e,`setRequestHandler`),super.setRequestHandler(e,t)};setNotificationHandler=(e,t)=>{this._assertMethodNotRegistered(e,`setNotificationHandler`),super.setNotificationHandler(e,t)};warnIfRequestHandlerReplaced(e,t,n){t&&n&&console.warn(`[MCP Apps] ${e} handler replaced. Previous handler will no longer be called.`)}replaceRequestHandler=(e,t)=>{let n=e.shape.method.value;this._registeredMethods.add(n),super.setRequestHandler(e,t)};_assertMethodNotRegistered(e,t){let n=e.shape.method.value;if(this._registeredMethods.has(n))throw Error(`Handler for \"${n}\" already registered (via ${t}). Use addEventListener() to attach multiple listeners, or the on* setter for replace semantics.`);this._registeredMethods.add(n)}},Bh=`2026-01-26`,Vh=class{eventTarget;eventSource;messageListener;constructor(e=window.parent,t){this.eventTarget=e,this.eventSource=t,this.messageListener=e=>{if(t&&e.source!==this.eventSource){console.debug(`Ignoring message from unknown source`,e);return}let n=pf.safeParse(e.data);n.success?(console.debug(`Parsed message`,n.data),this.onmessage?.(n.data)):e.data?.jsonrpc===`2.0`?(console.error(`Failed to parse message`,n.error.message,e),this.onerror?.(Error(`Invalid JSON-RPC message received: `+n.error.message))):console.debug(`Ignoring non-JSON-RPC message`,n.error.message,e)}}async start(){window.addEventListener(`message`,this.messageListener)}async send(e,t){e.method!==`ui/notifications/tool-input-partial`&&console.debug(`Sending message`,e),this.eventTarget.postMessage(e,`*`)}async close(){window.removeEventListener(`message`,this.messageListener),this.onclose?.()}onclose;onerror;onmessage;sessionId;setProtocolVersion},Hh=L([B(`light`),B(`dark`)]).describe(`Color theme preference for the host environment.`),Uh=L([B(`inline`),B(`fullscreen`),B(`pip`)]).describe(`Display mode for UI presentation.`),Wh=L([B(`--color-background-primary`),B(`--color-background-secondary`),B(`--color-background-tertiary`),B(`--color-background-inverse`),B(`--color-background-ghost`),B(`--color-background-info`),B(`--color-background-danger`),B(`--color-background-success`),B(`--color-background-warning`),B(`--color-background-disabled`),B(`--color-text-primary`),B(`--color-text-secondary`),B(`--color-text-tertiary`),B(`--color-text-inverse`),B(`--color-text-ghost`),B(`--color-text-info`),B(`--color-text-danger`),B(`--color-text-success`),B(`--color-text-warning`),B(`--color-text-disabled`),B(`--color-border-primary`),B(`--color-border-secondary`),B(`--color-border-tertiary`),B(`--color-border-inverse`),B(`--color-border-ghost`),B(`--color-border-info`),B(`--color-border-danger`),B(`--color-border-success`),B(`--color-border-warning`),B(`--color-border-disabled`),B(`--color-ring-primary`),B(`--color-ring-secondary`),B(`--color-ring-inverse`),B(`--color-ring-info`),B(`--color-ring-danger`),B(`--color-ring-success`),B(`--color-ring-warning`),B(`--font-sans`),B(`--font-mono`),B(`--font-weight-normal`),B(`--font-weight-medium`),B(`--font-weight-semibold`),B(`--font-weight-bold`),B(`--font-text-xs-size`),B(`--font-text-sm-size`),B(`--font-text-md-size`),B(`--font-text-lg-size`),B(`--font-heading-xs-size`),B(`--font-heading-sm-size`),B(`--font-heading-md-size`),B(`--font-heading-lg-size`),B(`--font-heading-xl-size`),B(`--font-heading-2xl-size`),B(`--font-heading-3xl-size`),B(`--font-text-xs-line-height`),B(`--font-text-sm-line-height`),B(`--font-text-md-line-height`),B(`--font-text-lg-line-height`),B(`--font-heading-xs-line-height`),B(`--font-heading-sm-line-height`),B(`--font-heading-md-line-height`),B(`--font-heading-lg-line-height`),B(`--font-heading-xl-line-height`),B(`--font-heading-2xl-line-height`),B(`--font-heading-3xl-line-height`),B(`--border-radius-xs`),B(`--border-radius-sm`),B(`--border-radius-md`),B(`--border-radius-lg`),B(`--border-radius-xl`),B(`--border-radius-full`),B(`--border-width-regular`),B(`--shadow-hairline`),B(`--shadow-sm`),B(`--shadow-md`),B(`--shadow-lg`)]).describe(`CSS variable keys available to MCP apps for theming.`),Gh=R(Wh.describe(`Style variables for theming MCP apps.\n\nIndividual style keys are optional - hosts may provide any subset of these values.\nValues are strings containing CSS values (colors, sizes, font stacks, etc.).\n\nNote: This type uses \\`Record<K, string | undefined>\\` rather than \\`Partial<Record<K, string>>\\`\nfor compatibility with Zod schema generation. Both are functionally equivalent for validation.`),L([A(),zl()]).describe(`Style variables for theming MCP apps.\n\nIndividual style keys are optional - hosts may provide any subset of these values.\nValues are strings containing CSS values (colors, sizes, font stacks, etc.).\n\nNote: This type uses \\`Record<K, string | undefined>\\` rather than \\`Partial<Record<K, string>>\\`\nfor compatibility with Zod schema generation. Both are functionally equivalent for validation.`)).describe(`Style variables for theming MCP apps.\n\nIndividual style keys are optional - hosts may provide any subset of these values.\nValues are strings containing CSS values (colors, sizes, font stacks, etc.).\n\nNote: This type uses \\`Record<K, string | undefined>\\` rather than \\`Partial<Record<K, string>>\\`\nfor compatibility with Zod schema generation. Both are functionally equivalent for validation.`),F({method:B(`ui/open-link`),params:F({url:A().describe(`URL to open in the host's browser`)})}),Kh=F({isError:M().optional().describe(`True if the host failed to open the URL (e.g., due to security policy).`)}).passthrough(),qh=F({isError:M().optional().describe(`True if the download failed (e.g., user cancelled or host denied).`)}).passthrough(),Jh=F({isError:M().optional().describe(`True if the host rejected or failed to deliver the message.`)}).passthrough(),F({method:B(`ui/notifications/sandbox-proxy-ready`),params:F({})}),Yh=F({connectDomains:P(A()).optional().describe(`Origins for network requests (fetch/XHR/WebSocket).\n\n- Maps to CSP \\`connect-src\\` directive\n- Empty or omitted → no network connections (secure default)`),resourceDomains:P(A()).optional().describe(\"Origins for static resources (images, scripts, stylesheets, fonts, media).\\n\\n- Maps to CSP `img-src`, `script-src`, `style-src`, `font-src`, `media-src` directives\\n- Wildcard subdomains supported: `https://*.example.com`\\n- Empty or omitted → no network resources (secure default)\"),frameDomains:P(A()).optional().describe(\"Origins for nested iframes.\\n\\n- Maps to CSP `frame-src` directive\\n- Empty or omitted → no nested iframes allowed (`frame-src 'none'`)\"),baseUriDomains:P(A()).optional().describe(\"Allowed base URIs for the document.\\n\\n- Maps to CSP `base-uri` directive\\n- Empty or omitted → only same origin allowed (`base-uri 'self'`)\")}),Xh=F({camera:F({}).optional().describe(`Request camera access.\n\nMaps to Permission Policy \\`camera\\` feature.`),microphone:F({}).optional().describe(`Request microphone access.\n\nMaps to Permission Policy \\`microphone\\` feature.`),geolocation:F({}).optional().describe(`Request geolocation access.\n\nMaps to Permission Policy \\`geolocation\\` feature.`),clipboardWrite:F({}).optional().describe(`Request clipboard write access.\n\nMaps to Permission Policy \\`clipboard-write\\` feature.`)}),F({method:B(`ui/notifications/size-changed`),params:F({width:j().optional().describe(`New width in pixels.`),height:j().optional().describe(`New height in pixels.`)})}),Zh=F({method:B(`ui/notifications/tool-input`),params:F({arguments:R(A(),N().describe(`Complete tool call arguments as key-value pairs.`)).optional().describe(`Complete tool call arguments as key-value pairs.`)})}),Qh=F({method:B(`ui/notifications/tool-input-partial`),params:F({arguments:R(A(),N().describe(`Partial tool call arguments (incomplete, may change).`)).optional().describe(`Partial tool call arguments (incomplete, may change).`)})}),$h=F({method:B(`ui/notifications/tool-cancelled`),params:F({reason:A().optional().describe(`Optional reason for the cancellation (e.g., \"user action\", \"timeout\").`)})}),eg=F({fonts:A().optional()}),tg=F({variables:Gh.optional().describe(`CSS variables for theming the app.`),css:eg.optional().describe(`CSS blocks that apps can inject.`)}),ng=F({method:B(`ui/resource-teardown`),params:F({})}),R(A(),N()),rg=F({text:F({}).optional().describe(`Host supports text content blocks.`),image:F({}).optional().describe(`Host supports image content blocks.`),audio:F({}).optional().describe(`Host supports audio content blocks.`),resource:F({}).optional().describe(`Host supports resource content blocks.`),resourceLink:F({}).optional().describe(`Host supports resource link content blocks.`),structuredContent:F({}).optional().describe(`Host supports structured content.`)}),F({method:B(`ui/notifications/request-teardown`),params:F({}).optional()}),ig=F({experimental:R(A(),R(A(),Vl()).describe(`Experimental features keyed by identifier.`)).optional().describe(`Experimental features keyed by identifier.`),openLinks:F({}).optional().describe(`Host supports opening external URLs.`),downloadFile:F({}).optional().describe(`Host supports file downloads via ui/download-file.`),serverTools:F({listChanged:M().optional().describe(`Host supports tools/list_changed notifications.`)}).optional().describe(`Host can proxy tool calls to the MCP server.`),serverResources:F({listChanged:M().optional().describe(`Host supports resources/list_changed notifications.`)}).optional().describe(`Host can proxy resource reads to the MCP server.`),logging:F({}).optional().describe(`Host accepts log messages.`),sandbox:F({permissions:Xh.optional().describe(`Permissions granted by the host (camera, microphone, geolocation).`),csp:Yh.optional().describe(`CSP domains approved by the host.`)}).optional().describe(`Sandbox configuration applied by the host.`),updateModelContext:rg.optional().describe(`Host accepts context updates (ui/update-model-context) to be included in the model's context for future turns.`),message:rg.optional().describe(`Host supports receiving content messages (ui/message) from the view.`),sampling:F({tools:F({}).optional().describe(\"Host supports tool use via `tools` and `toolChoice` parameters.\")}).optional().describe(\"Host supports LLM sampling (sampling/createMessage) from the view.\\nMirrors the MCP `ClientCapabilities.sampling` shape so hosts can pass it through.\")}),ag=F({experimental:R(A(),R(A(),Vl()).describe(`Experimental features keyed by identifier.`)).optional().describe(`Experimental features keyed by identifier.`),tools:F({listChanged:M().optional().describe(`App supports tools/list_changed notifications.`)}).optional().describe(`App exposes MCP-style tools that the host can call.`),availableDisplayModes:P(Uh).optional().describe(`Display modes the app supports.`)}),F({method:B(`ui/notifications/initialized`),params:F({}).optional()}),F({csp:Yh.optional().describe(`Content Security Policy configuration for UI resources.`),permissions:Xh.optional().describe(`Sandbox permissions requested by the UI resource.`),domain:A().optional().describe(`Dedicated origin for view sandbox.\n\nUseful when views need stable, dedicated origins for OAuth callbacks, CORS policies, or API key allowlists.\n\n**Host-dependent:** The format and validation rules for this field are determined by each host. Servers MUST consult host-specific documentation for the expected domain format. Common patterns include:\n- Hash-based subdomains (e.g., \\`{hash}.claudemcpcontent.com\\`)\n- URL-derived subdomains (e.g., \\`www-example-com.oaiusercontent.com\\`)\n\nIf omitted, host uses default sandbox origin (typically per-conversation).`),prefersBorder:M().optional().describe(`Visual boundary preference - true if view prefers a visible border.\n\nBoolean requesting whether a visible border and background is provided by the host. Specifying an explicit value for this is recommended because hosts' defaults may vary.\n\n- \\`true\\`: request visible border + background\n- \\`false\\`: request no visible border + background\n- omitted: host decides border`)}),F({method:B(`ui/request-display-mode`),params:F({mode:Uh.describe(`The display mode being requested.`)})}),og=F({mode:Uh.describe(`The display mode that was actually set. May differ from requested if not supported.`)}).passthrough(),sg=L([B(`model`),B(`app`)]).describe(`Tool visibility scope - who can access the tool.`),F({resourceUri:A().optional(),visibility:P(sg).optional().describe(`Who can access this tool. Default: [\"model\", \"app\"]\n- \"model\": Tool visible to and callable by the agent\n- \"app\": Tool callable by the app from this server only`),csp:Hl().optional(),permissions:Hl().optional()}),F({mimeTypes:P(A()).optional().describe('Array of supported MIME types for UI resources.\\nMust include `\"text/html;profile=mcp-app\"` for MCP Apps support.')}),F({method:B(`ui/download-file`),params:F({contents:P(L([kp,Ap])).describe(`Resource contents to download — embedded (inline data) or linked (host fetches). Uses standard MCP resource types.`)})}),F({method:B(`ui/message`),params:F({role:B(`user`).describe(`Message role, currently only \"user\" is supported.`),content:P(jp).describe(`Message content blocks (text, image, etc.).`)})}),F({method:B(`ui/notifications/sandbox-resource-ready`),params:F({html:A().describe(`HTML content to load into the inner iframe.`),sandbox:A().optional().describe(`Optional override for the inner iframe's sandbox attribute.`),csp:Yh.optional().describe(`CSP configuration from resource metadata.`),permissions:Xh.optional().describe(`Sandbox permissions from resource metadata.`)})}),cg=F({method:B(`ui/notifications/tool-result`),params:Bp.describe(`Standard MCP tool execution result.`)}),lg=F({toolInfo:F({id:rf.optional().describe(`JSON-RPC id of the tools/call request.`),tool:Lp.describe(`Tool definition including name, inputSchema, etc.`)}).optional().describe(`Metadata of the tool call that instantiated this App.`),theme:Hh.optional().describe(`Current color theme preference.`),styles:tg.optional().describe(`Style configuration for theming the app.`),displayMode:Uh.optional().describe(`How the UI is currently displayed.`),availableDisplayModes:P(Uh).optional().describe(`Display modes the host supports.`),containerDimensions:L([F({height:j().describe(`Fixed container height in pixels.`)}),F({maxHeight:L([j(),zl()]).optional().describe(`Maximum container height in pixels.`)})]).and(L([F({width:j().describe(`Fixed container width in pixels.`)}),F({maxWidth:L([j(),zl()]).optional().describe(`Maximum container width in pixels.`)})])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other\ncontainer holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:A().optional().describe(`User's language and region preference in BCP 47 format.`),timeZone:A().optional().describe(`User's timezone in IANA format.`),userAgent:A().optional().describe(`Host application identifier.`),platform:L([B(`web`),B(`desktop`),B(`mobile`)]).optional().describe(`Platform type for responsive design decisions.`),deviceCapabilities:F({touch:M().optional().describe(`Whether the device supports touch input.`),hover:M().optional().describe(`Whether the device supports hover interactions.`)}).optional().describe(`Device input capabilities.`),safeAreaInsets:F({top:j().describe(`Top safe area inset in pixels.`),right:j().describe(`Right safe area inset in pixels.`),bottom:j().describe(`Bottom safe area inset in pixels.`),left:j().describe(`Left safe area inset in pixels.`)}).optional().describe(`Mobile safe area boundaries in pixels.`)}).passthrough(),ug=F({method:B(`ui/notifications/host-context-changed`),params:lg.describe(`Partial context update containing only changed fields.`)}),F({method:B(`ui/update-model-context`),params:F({content:P(jp).optional().describe(`Context content blocks (text, image, etc.).`),structuredContent:R(A(),N().describe(`Structured content for machine-readable context data.`)).optional().describe(`Structured content for machine-readable context data.`)})}),F({method:B(`ui/initialize`),params:F({appInfo:bf.describe(`App identification (name and version).`),appCapabilities:ag.describe(`Features and capabilities this app provides.`),protocolVersion:A().describe(`Protocol version this app supports.`)})}),dg=F({protocolVersion:A().describe(`Negotiated protocol version string (e.g., \"2025-11-21\").`),hostInfo:bf.describe(`Host application identification and version.`),hostCapabilities:ig.describe(`Features and capabilities provided by the host.`),hostContext:lg.describe(`Rich context about the host environment.`)}).passthrough(),fg={target:`draft-2020-12`},pg=class e extends zh{_appInfo;_capabilities;options;_hostCapabilities;_hostInfo;_hostContext;_registeredTools={};_initializedSent=!1;_assertInitialized(e){if(this._initializedSent)return;let t=`[ext-apps] App.${e}() called before connect() completed the ui/initialize handshake. Await app.connect() before calling this method, or move data loading to an ontoolresult handler.`;if(this.options?.strict)throw Error(t);console.warn(`${t}. This will throw in a future release.`)}eventSchemas={toolinput:Zh,toolinputpartial:Qh,toolresult:cg,toolcancelled:$h,hostcontextchanged:ug};static ONE_SHOT_EVENTS=new Set([`toolinput`,`toolinputpartial`,`toolresult`,`toolcancelled`]);_everHadListener=new Set;_assertHandlerTiming(t){if(!e.ONE_SHOT_EVENTS.has(t)||this._everHadListener.has(t)||(this._everHadListener.add(t),!this._initializedSent))return;let n=`[ext-apps] \"${String(t)}\" handler registered after connect() completed the ui/initialize handshake. The host may have already sent this notification. Register handlers before calling app.connect().`;if(this.options?.strict)throw Error(n);console.warn(n)}setEventHandler(e,t){t&&this._assertHandlerTiming(e),super.setEventHandler(e,t)}addEventListener(e,t){this._assertHandlerTiming(e),super.addEventListener(e,t)}onEventDispatch(e,t){e===`hostcontextchanged`&&(this._hostContext={...this._hostContext,...t})}constructor(e,t={},n={autoResize:!0}){super(n),this._appInfo=e,this._capabilities=t,this.options=n,n.allowUnsafeEval||o({jitless:!0}),this.setRequestHandler(jf,e=>(console.log(`Received ping:`,e.params),{})),this.setEventHandler(`hostcontextchanged`,void 0)}registerCapabilities(e){if(this.transport)throw Error(`Cannot register capabilities after transport is established`);this._capabilities=Dh(this._capabilities,e)}registerTool(e,t,n){if(this._registeredTools[e])throw Error(`Tool ${e} is already registered`);let r=this,i=()=>{r._initializedSent&&r._capabilities.tools?.listChanged&&r.sendToolListChanged()},a=t.inputSchema!==void 0,o={title:t.title,description:t.description,inputSchema:t.inputSchema,outputSchema:t.outputSchema,annotations:t.annotations,_meta:t._meta,enabled:!0,enable(){this.enabled=!0,i()},disable(){this.enabled=!1,i()},update(e){Object.assign(this,e),i()},remove(){r._registeredTools[e]===o&&(delete r._registeredTools[e],i())},handler:async(t,r)=>{if(!o.enabled)throw Error(`Tool ${e} is disabled`);let i;if(a){let a=o.inputSchema;i=await n(a?await Ih(a,t??{},`Invalid input for tool ${e}: `):t??{},r)}else i=await n(r);return o.outputSchema&&!i.isError&&(i.structuredContent=await Ih(o.outputSchema,i.structuredContent,`Invalid output for tool ${e}: `)),i}};return this._registeredTools[e]=o,!this._capabilities.tools&&!this.transport&&this.registerCapabilities({tools:{listChanged:!0}}),this.ensureToolHandlersInitialized(),i(),o}_toolHandlersInitialized=!1;ensureToolHandlersInitialized(){this._toolHandlersInitialized||(this._toolHandlersInitialized=!0,this.oncalltool=async(e,t)=>{let n=this._registeredTools[e.name];if(!n)throw Error(`Tool ${e.name} not found`);return n.handler(e.arguments,t)},this.onlisttools=async(e,t)=>({tools:await Promise.all(Object.entries(this._registeredTools).filter(([e,t])=>t.enabled).map(async([e,t])=>{let n={name:e,title:t.title,description:t.description,inputSchema:t.inputSchema?await Fh(t.inputSchema,`input`):{type:`object`,properties:{}}};return t.outputSchema&&(n.outputSchema=await Fh(t.outputSchema,`output`)),t.annotations&&(n.annotations=t.annotations),t._meta&&(n._meta=t._meta),n}))}))}async sendToolListChanged(e={}){this._assertInitialized(`sendToolListChanged`),await this.notification({method:`notifications/tools/list_changed`,params:e})}getHostCapabilities(){return this._hostCapabilities}getHostVersion(){return this._hostInfo}getHostContext(){return this._hostContext}get ontoolinput(){return this.getEventHandler(`toolinput`)}set ontoolinput(e){this.setEventHandler(`toolinput`,e)}get ontoolinputpartial(){return this.getEventHandler(`toolinputpartial`)}set ontoolinputpartial(e){this.setEventHandler(`toolinputpartial`,e)}get ontoolresult(){return this.getEventHandler(`toolresult`)}set ontoolresult(e){this.setEventHandler(`toolresult`,e)}get ontoolcancelled(){return this.getEventHandler(`toolcancelled`)}set ontoolcancelled(e){this.setEventHandler(`toolcancelled`,e)}get onhostcontextchanged(){return this.getEventHandler(`hostcontextchanged`)}set onhostcontextchanged(e){this.setEventHandler(`hostcontextchanged`,e)}_onteardown;get onteardown(){return this._onteardown}set onteardown(e){this.warnIfRequestHandlerReplaced(`onteardown`,this._onteardown,e),this._onteardown=e,this.replaceRequestHandler(ng,(e,t)=>{if(!this._onteardown)throw Error(`No onteardown handler set`);return this._onteardown(e.params,t)})}_oncalltool;get oncalltool(){return this._oncalltool}set oncalltool(e){this.warnIfRequestHandlerReplaced(`oncalltool`,this._oncalltool,e),this._oncalltool=e,this.replaceRequestHandler(Hp,(e,t)=>{if(!this._oncalltool)throw Error(`No oncalltool handler set`);return this._oncalltool(e.params,t)})}_onlisttools;get onlisttools(){return this._onlisttools}set onlisttools(e){this.warnIfRequestHandlerReplaced(`onlisttools`,this._onlisttools,e),this._onlisttools=e,this.replaceRequestHandler(Rp,(e,t)=>{if(!this._onlisttools)throw Error(`No onlisttools handler set`);return this._onlisttools(e.params,t)})}assertCapabilityForMethod(e){if(e===`sampling/createMessage`&&!this._hostCapabilities?.sampling)throw Error(`Host does not support sampling (required for ${e})`)}assertRequestHandlerCapability(e){switch(e){case`tools/call`:case`tools/list`:if(!this._capabilities.tools)throw Error(`Client does not support tool capability (required for ${e})`);return;case`ping`:case`ui/resource-teardown`:return;default:throw Error(`No handler for method ${e} registered`)}}assertNotificationCapability(e){}assertTaskCapability(e){throw Error(`Tasks are not supported in MCP Apps`)}assertTaskHandlerCapability(e){throw Error(`Task handlers are not supported in MCP Apps`)}async callServerTool(e,t){if(this._assertInitialized(`callServerTool`),typeof e==`string`)throw Error(`callServerTool() expects an object as its first argument, but received a string (\"${e}\"). Did you mean: callServerTool({ name: \"${e}\", arguments: { ... } })?`);return await this.request({method:`tools/call`,params:e},Bp,{onprogress:()=>{},resetTimeoutOnProgress:!0,...t})}async readServerResource(e,t){return this._assertInitialized(`readServerResource`),await this.request({method:`resources/read`,params:e},dp,t)}async listServerResources(e,t){return this._assertInitialized(`listServerResources`),await this.request({method:`resources/list`,params:e},ap,t)}async createSamplingMessage(e,t){this._assertInitialized(`createSamplingMessage`);let n=e.tools?am:im;return await this.request({method:`sampling/createMessage`,params:e},n,t)}sendMessage(e,t){return this._assertInitialized(`sendMessage`),this.request({method:`ui/message`,params:e},Jh,t)}sendLog(e){return this.notification({method:`notifications/message`,params:e})}updateModelContext(e,t){return this._assertInitialized(`updateModelContext`),this.request({method:`ui/update-model-context`,params:e},mf,t)}openLink(e,t){return this._assertInitialized(`openLink`),this.request({method:`ui/open-link`,params:e},Kh,t)}sendOpenLink=this.openLink;downloadFile(e,t){return this._assertInitialized(`downloadFile`),this.request({method:`ui/download-file`,params:e},qh,t)}requestTeardown(e={}){return this.notification({method:`ui/notifications/request-teardown`,params:e})}requestDisplayMode(e,t){return this._assertInitialized(`requestDisplayMode`),this.request({method:`ui/request-display-mode`,params:e},og,t)}sendSizeChanged(e){return this.notification({method:`ui/notifications/size-changed`,params:e})}setupSizeChangedNotifications(){let e=!1,t=0,n=0,r=()=>{e||(e=!0,requestAnimationFrame(()=>{e=!1;let r=document.documentElement,i=r.style.height;r.style.height=`max-content`;let a=Math.ceil(r.getBoundingClientRect().height);r.style.height=i;let o=Math.ceil(window.innerWidth);(o!==t||a!==n)&&(t=o,n=a,this.sendSizeChanged({width:o,height:a}))}))};r();let i=new ResizeObserver(r);return i.observe(document.documentElement),i.observe(document.body),()=>i.disconnect()}async connect(e=new Vh(window.parent,window.parent),t){if(this.transport)throw Error(`App is already connected. Call close() before connecting again.`);this._initializedSent=!1,await super.connect(e);try{let e=await this.request({method:`ui/initialize`,params:{appCapabilities:this._capabilities,appInfo:this._appInfo,protocolVersion:Bh}},dg,t);if(e===void 0)throw Error(`Server sent invalid initialize result: ${e}`);this._hostCapabilities=e.hostCapabilities,this._hostInfo=e.hostInfo,this._hostContext=e.hostContext,await this.notification({method:`ui/notifications/initialized`}),this._initializedSent=!0,this.options?.autoResize&&this.setupSizeChangedNotifications()}catch(e){throw this.close(),e}}}}));function hg(e){let t=[];return typeof e.durationSeconds==`number`&&t.push(`${e.durationSeconds.toFixed(2)}s`),e.model&&t.push(e.model),t.join(` · `)}function gg(e,t){let n,r=0,i,a=()=>{n!==void 0&&(clearTimeout(n),n=void 0)},o=new pg({name:e,version:`0.0.1`},{}),s=async e=>{let t=await o.request({method:`tools/call`,params:{name:`get_generation`,arguments:{operationId:e}}},Bp);if(!t.isError)return t.structuredContent},c=(e,o)=>{n=window.setTimeout(async()=>{if(Date.now()-r>xg){t.onTimeout?.();return}try{let n=await s(e);if(n?.status===`complete`){a(),i=n,t.onResult(n);return}}catch{}c(e,Math.min(o*1.5,bg))},o)},l=e=>{e&&(a(),i=e,t.onResult(e),e.status===`running`&&e.operationId!==void 0&&(r=Date.now(),c(e.operationId,yg)))};return o.ontoolinput=()=>t.onResult({status:`running`}),o.ontoolresult=e=>l(e?.structuredContent),o.onhostcontextchanged=e=>{if(e?.theme&&Lh(e.theme),e?.styles?.variables&&Rh(e.styles.variables),e?.displayMode&&(document.documentElement.dataset.displayMode=e.displayMode),e?.safeAreaInsets){let{top:t=0,right:n=0,bottom:r=0,left:i=0}=e.safeAreaInsets;document.body.style.padding=`${t}px ${n}px ${r}px ${i}px`}},o.onteardown=async()=>(a(),{}),o.connect(new Vh(window.parent,window.parent)).catch(()=>{}),{app:o,current:()=>i}}function _g(e,t){return e.openLink({url:t})}function vg(e){let t=document.documentElement.dataset.displayMode===`fullscreen`;return e.requestDisplayMode({mode:t?`inline`:`fullscreen`}).then(e=>{e?.mode&&(document.documentElement.dataset.displayMode=e.mode)})}var $,yg,bg,xg,Sg=t((()=>{mg(),Fm(),$=e=>document.getElementById(e),yg=2e3,bg=1e4,xg=36e4}));n((()=>{Sg();var e=e=>{$(`status`).textContent=e},t=e=>{$(`meta`).textContent=e};function n(e,t,n){let r=$(e);r.hidden=!t,n&&(r.title=n)}var r=gg(`Womp image`,{onTimeout:()=>e(`Still running — ask me to check on it.`),onResult:r=>{if(r.status===`running`){$(`skeleton`).classList.add(`pulsing`),$(`actions`).hidden=!0,t(``),e(`Generating…`);return}$(`skeleton`).classList.remove(`pulsing`);let i=r.previewUrl||r.imageUrl;if(i){let t=$(`hero`);t.onload=()=>{$(`skeleton`).style.display=`none`,t.style.display=`block`},t.onerror=()=>e(`Preview unavailable — the file link still works.`),t.src=i}let a=!!r.glbUrl;t(hg(r));let o=r.glbUrl||r.imageUrl;n(`download`,!!o,a?`Download GLB`:`Open full size`),n(`expand`,!!i),$(`actions`).hidden=!o&&!i,e(``)}});$(`download`).addEventListener(`click`,()=>{let t=r.current()?.glbUrl||r.current()?.imageUrl;t&&_g(r.app,t).catch(()=>e(`Could not open the link.`))}),$(`expand`).addEventListener(`click`,()=>{vg(r.app).catch(()=>e(`This host does not support fullscreen.`))})}))();</script>\n </head>\n <body>\n <div class=\"card\" id=\"card\">\n <img id=\"hero\" class=\"hero\" alt=\"\" style=\"display: none\" />\n <div id=\"skeleton\" class=\"skeleton\"></div>\n\n <div class=\"actions\" id=\"actions\" hidden>\n <button class=\"btn\" id=\"download\" title=\"Open full size\" hidden>\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\">\n <path d=\"M12 3v12m0 0 4-4m-4 4-4-4M4 21h16\" />\n </svg>\n </button>\n <button class=\"btn\" id=\"expand\" title=\"Expand\" hidden>\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\">\n <path d=\"M4 10V4h6M20 14v6h-6M20 10V4h-6M4 14v6h6\" />\n </svg>\n </button>\n </div>\n\n <!-- Two lines, not one: `meta` is what produced the result, `status` is\n when something went wrong. Sharing an element meant a preview error\n erased the model name, or the reverse, depending on which landed\n last. Both collapse when empty. -->\n <div class=\"meta\" id=\"meta\"></div>\n <div class=\"status\" id=\"status\">Connecting…</div>\n </div>\n </body>\n</html>\n";
|
|
18
18
|
|
|
19
19
|
/** Version-stamped so a host's per-connector resource cache cannot serve a stale card. */
|
|
20
|
-
exports.MESH_APP_URI = "ui://womp/mesh-0.1.
|
|
20
|
+
exports.MESH_APP_URI = "ui://womp/mesh-0.1.3.html";
|
|
21
21
|
|
|
22
22
|
/** Goes in the resource's `_meta.ui.csp`. */
|
|
23
23
|
exports.MESH_APP_CSP = {"resourceDomains":["https://media.womp.com"],"connectDomains":["https://media.womp.com"]};
|
|
24
24
|
|
|
25
25
|
/** The complete, self-contained mesh card. */
|
|
26
26
|
exports.MESH_APP_HTML = "<!doctype html>\n<html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\" />\n <title>Womp 3D mesh</title>\n <style>\n /* Every var() carries a fallback on purpose: host style variables arrive\n over the bridge (onhostcontextchanged), NOT as CSS custom properties on\n this document, so there is nothing to read until the handshake lands.\n The card has to look right in that window too.\n\n Names come from McpUiStyleVariableKeySchema — that is the whole set a\n host may send, so anything outside it will never resolve. */\n :root {\n color-scheme: light dark;\n }\n body {\n margin: 0;\n font-family: var(--font-sans, system-ui, -apple-system, \"Segoe UI\", sans-serif);\n color: var(--color-text-primary, #e8e8e8);\n }\n\n .card {\n position: relative;\n /* The host hands us the full message width, which turns a generated\n image into a wall. swan-frontend's generation tile is compact and\n left-aligned; this matches it. The iframe stays full width — only the\n card is capped — and auto-resize reports the shorter height, so the\n surrounding chat closes up too. */\n max-width: 360px;\n border-radius: var(--border-radius-lg, 14px);\n overflow: hidden;\n background: var(--color-background-secondary, #1b1b1d);\n border: 1px solid var(--color-border-primary, rgba(255, 255, 255, 0.08));\n }\n\n .hero {\n display: block;\n width: 100%;\n height: auto;\n /* Guard against a tall portrait generation dominating the transcript.\n Cropping is acceptable here because Expand and Open full size both\n reach the uncropped original. */\n max-height: 360px;\n object-fit: cover;\n }\n /* The canvas needs an explicit box: a WebGL canvas has no intrinsic size,\n so without this it collapses to zero height and auto-resize reports a\n card with nothing in it. */\n .viewer {\n width: 100%;\n height: 320px;\n touch-action: none; /* let OrbitControls have the gestures */\n }\n .viewer canvas { display: block; width: 100%; height: 100%; }\n :root[data-display-mode=\"fullscreen\"] .viewer { height: 82vh; }\n .viewer[hidden] { display: none; }\n .skeleton {\n height: 320px;\n background: var(--color-background-tertiary, #2a2a2e);\n }\n /* Only animates while a generation is in flight, so a settled card does\n not look busy. */\n .skeleton.pulsing {\n background: linear-gradient(90deg, #2a2a2e, #37373d, #2a2a2e);\n background-size: 200% 100%;\n animation: sweep 1.4s ease-in-out infinite;\n }\n @keyframes sweep {\n 0% { background-position: 200% 0; }\n 100% { background-position: -200% 0; }\n }\n @media (prefers-reduced-motion: reduce) {\n .skeleton.pulsing { animation: none; }\n }\n\n .actions {\n position: absolute;\n bottom: 10px;\n left: 50%;\n transform: translateX(-50%);\n display: flex;\n gap: 2px;\n padding: 3px;\n border-radius: var(--border-radius-full, 999px);\n background: rgba(0, 0, 0, 0.55);\n backdrop-filter: blur(8px);\n box-shadow: var(--shadow-md, 0 4px 16px rgba(0, 0, 0, 0.3));\n /* Revealed on hover on pointer devices; always visible on touch, where\n there is no hover to reveal them with. */\n opacity: 0;\n transition: opacity 120ms ease;\n }\n .card:hover .actions,\n .card:focus-within .actions {\n opacity: 1;\n }\n @media (hover: none) {\n .actions { opacity: 1; }\n }\n .actions[hidden] { display: none; }\n\n .btn {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n border: 0;\n cursor: pointer;\n color: #fff;\n background: transparent;\n font: inherit;\n font-size: var(--font-text-xs-size, 12px);\n padding: 6px 10px;\n border-radius: var(--border-radius-full, 999px);\n }\n .btn:hover { background: rgba(255, 255, 255, 0.14); }\n .btn:focus-visible { outline: 2px solid var(--color-ring-primary, #7aa2ff); outline-offset: 1px; }\n .btn svg { width: 14px; height: 14px; display: block; }\n .btn[hidden] { display: none; }\n\n /* Fullscreen: the host has given us the whole viewport, so drop the\n inline width cap and let the image use it. Without this the card stays\n a 360px thumbnail in the corner and Expand looks broken. */\n :root[data-display-mode=\"fullscreen\"] body {\n display: flex;\n align-items: center;\n justify-content: center;\n min-height: 100vh;\n }\n :root[data-display-mode=\"fullscreen\"] .card {\n max-width: min(96vw, 1100px);\n border: 0;\n background: transparent;\n }\n :root[data-display-mode=\"fullscreen\"] .hero {\n max-height: 88vh;\n object-fit: contain;\n }\n /* Nothing to reveal on hover when the image fills the screen. */\n :root[data-display-mode=\"fullscreen\"] .actions { opacity: 1; }\n\n .status:empty,\n .meta:empty { display: none; }\n .status,\n .meta {\n font-size: var(--font-text-xs-size, 11px);\n color: var(--color-text-secondary, rgba(232, 232, 232, 0.6));\n padding: 8px 12px;\n }\n /* When both are shown the pair reads as one block, so the meta line drops\n its bottom padding rather than double-spacing them. */\n .meta:has(+ .status:not(:empty)) {\n padding-bottom: 0;\n }\n </style>\n <script type=\"module\" crossorigin>var e=Object.defineProperty,t=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(e){throw n=[e],e}},n=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),r=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r},i=(e=>typeof require<`u`?require:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof require<`u`?require:e)[t]}):e)(function(e){if(typeof require<`u`)return require.apply(this,arguments);throw Error('Calling `require` for \"'+e+\"\\\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.\")});(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel=\"modulepreload\"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();function a(e){for(let t=e.length-1;t>=0;--t)if(e[t]>=65535)return!0;return!1}function o(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function s(e){return document.createElementNS(`http://www.w3.org/1999/xhtml`,e)}function c(){let e=s(`canvas`);return e.style.display=`block`,e}function l(...e){let t=`THREE.`+e.shift();on?on(`log`,t,...e):console.log(t,...e)}function u(e){let t=e[0];if(typeof t==`string`&&t.startsWith(`TSL:`)){let t=e[1];t&&t.isStackTrace?e[0]+=` `+t.getLocation():e[1]=`Stack trace not available. Enable \"THREE.Node.captureStackTrace\" to capture stack traces.`}return e}function d(...e){e=u(e);let t=`THREE.`+e.shift();if(on)on(`warn`,t,...e);else{let n=e[0];n&&n.isStackTrace?console.warn(n.getError(t)):console.warn(t,...e)}}function f(...e){e=u(e);let t=`THREE.`+e.shift();if(on)on(`error`,t,...e);else{let n=e[0];n&&n.isStackTrace?console.error(n.getError(t)):console.error(t,...e)}}function p(...e){let t=e.join(` `);t in an||(an[t]=!0,d(...e))}function m(e,t,n){return new Promise(function(r,i){function a(){switch(e.clientWaitSync(t,e.SYNC_FLUSH_COMMANDS_BIT,0)){case e.WAIT_FAILED:i();break;case e.TIMEOUT_EXPIRED:setTimeout(a,n);break;default:r()}}setTimeout(a,n)})}function h(){let e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,n=Math.random()*4294967295|0,r=Math.random()*4294967295|0;return(ln[e&255]+ln[e>>8&255]+ln[e>>16&255]+ln[e>>24&255]+`-`+ln[t&255]+ln[t>>8&255]+`-`+ln[t>>16&15|64]+ln[t>>24&255]+`-`+ln[n&63|128]+ln[n>>8&255]+`-`+ln[n>>16&255]+ln[n>>24&255]+ln[r&255]+ln[r>>8&255]+ln[r>>16&255]+ln[r>>24&255]).toLowerCase()}function g(e,t,n){return Math.max(t,Math.min(n,e))}function _(e,t){return(e%t+t)%t}function v(e,t,n,r,i){return r+(e-t)*(i-r)/(n-t)}function y(e,t,n){return e===t?0:(n-e)/(t-e)}function b(e,t,n){return(1-n)*e+n*t}function x(e,t,n,r){return b(e,t,1-Math.exp(-n*r))}function S(e,t=1){return t-Math.abs(_(e,t*2)-t)}function C(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t),e*e*(3-2*e))}function w(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t),e*e*e*(e*(e*6-15)+10))}function T(e,t){return e+Math.floor(Math.random()*(t-e+1))}function E(e,t){return e+Math.random()*(t-e)}function D(e){return e*(.5-Math.random())}function O(e){e!==void 0&&(un=e);let t=un+=1831565813;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}function ee(e){return e*dn}function k(e){return e*fn}function te(e){return!(e&e-1)&&e!==0}function ne(e){return 2**Math.ceil(Math.log(e)/Math.LN2)}function re(e){return 2**Math.floor(Math.log(e)/Math.LN2)}function ie(e,t,n,r,i){let a=Math.cos,o=Math.sin,s=a(n/2),c=o(n/2),l=a((t+r)/2),u=o((t+r)/2),f=a((t-r)/2),p=o((t-r)/2),m=a((r-t)/2),h=o((r-t)/2);switch(i){case`XYX`:e.set(s*u,c*f,c*p,s*l);break;case`YZY`:e.set(c*p,s*u,c*f,s*l);break;case`ZXZ`:e.set(c*f,c*p,s*u,s*l);break;case`XZX`:e.set(s*u,c*h,c*m,s*l);break;case`YXY`:e.set(c*m,s*u,c*h,s*l);break;case`ZYZ`:e.set(c*h,c*m,s*u,s*l);break;default:d(`MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: `+i)}}function ae(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return e/4294967295;case Uint16Array:return e/65535;case Uint8Array:return e/255;case Int32Array:return Math.max(e/2147483647,-1);case Int16Array:return Math.max(e/32767,-1);case Int8Array:return Math.max(e/127,-1);default:throw Error(`THREE.MathUtils: Invalid component type.`)}}function A(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return Math.round(e*4294967295);case Uint16Array:return Math.round(e*65535);case Uint8Array:return Math.round(e*255);case Int32Array:return Math.round(e*2147483647);case Int16Array:return Math.round(e*32767);case Int8Array:return Math.round(e*127);default:throw Error(`THREE.MathUtils: Invalid component type.`)}}function oe(){let e={enabled:!0,workingColorSpace:Qt,spaces:{},convert:function(e,t,n){return this.enabled===!1||t===n||!t||!n?e:(this.spaces[t].transfer===`srgb`&&(e.r=j(e.r),e.g=j(e.g),e.b=j(e.b)),this.spaces[t].primaries!==this.spaces[n].primaries&&(e.applyMatrix3(this.spaces[t].toXYZ),e.applyMatrix3(this.spaces[n].fromXYZ)),this.spaces[n].transfer===`srgb`&&(e.r=se(e.r),e.g=se(e.g),e.b=se(e.b)),e)},workingToColorSpace:function(e,t){return this.convert(e,this.workingColorSpace,t)},colorSpaceToWorking:function(e,t){return this.convert(e,t,this.workingColorSpace)},getPrimaries:function(e){return this.spaces[e].primaries},getTransfer:function(e){return e===``?$t:this.spaces[e].transfer},getToneMappingMode:function(e){return this.spaces[e].outputColorSpaceConfig.toneMappingMode||`standard`},getLuminanceCoefficients:function(e,t=this.workingColorSpace){return e.fromArray(this.spaces[t].luminanceCoefficients)},define:function(e){Object.assign(this.spaces,e)},_getMatrix:function(e,t,n){return e.copy(this.spaces[t].toXYZ).multiply(this.spaces[n].fromXYZ)},_getDrawingBufferColorSpace:function(e){return this.spaces[e].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(e=this.workingColorSpace){return this.spaces[e].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(t,n){return p(`ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace().`),e.workingToColorSpace(t,n)},toWorkingColorSpace:function(t,n){return p(`ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking().`),e.colorSpaceToWorking(t,n)}},t=[.64,.33,.3,.6,.15,.06],n=[.2126,.7152,.0722],r=[.3127,.329];return e.define({[Qt]:{primaries:t,whitePoint:r,transfer:$t,toXYZ:vn,fromXYZ:yn,luminanceCoefficients:n,workingColorSpaceConfig:{unpackColorSpace:Zt},outputColorSpaceConfig:{drawingBufferColorSpace:Zt}},[Zt]:{primaries:t,whitePoint:r,transfer:en,toXYZ:vn,fromXYZ:yn,luminanceCoefficients:n,outputColorSpaceConfig:{drawingBufferColorSpace:Zt}}}),e}function j(e){return e<.04045?e*.0773993808:(e*.9478672986+.0521327014)**2.4}function se(e){return e<.0031308?e*12.92:1.055*e**.41666-.055}function ce(e){return typeof HTMLImageElement<`u`&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement||typeof ImageBitmap<`u`&&e instanceof ImageBitmap?Sn.getDataURL(e):e.data?{data:Array.from(e.data),width:e.width,height:e.height,type:e.data.constructor.name}:(d(`Texture: Unable to serialize Texture.`),{})}function le(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*6*(2/3-n):e}function ue(e,t,n,r,i){for(let a=0,o=e.length-3;a<=o;a+=3){Hr.fromArray(e,a);let o=i.x*Math.abs(Hr.x)+i.y*Math.abs(Hr.y)+i.z*Math.abs(Hr.z),s=t.dot(Hr),c=n.dot(Hr),l=r.dot(Hr);if(Math.max(-Math.max(s,c,l),Math.min(s,c,l))>o)return!1}return!0}function de(e,t,n,r,i,a,o,s){let c;if(c=t.side===1?r.intersectTriangle(o,a,i,!0,s):r.intersectTriangle(i,a,o,t.side===0,s),c===null)return null;Mi.copy(s),Mi.applyMatrix4(e.matrixWorld);let l=n.ray.origin.distanceTo(Mi);return l<n.near||l>n.far?null:{distance:l,point:Mi.clone(),object:e}}function fe(e,t,n,r,i,a,o,s,c,l){e.getVertexPosition(s,Ei),e.getVertexPosition(c,Di),e.getVertexPosition(l,Oi);let u=de(e,t,n,r,Ei,Di,Oi,ji);if(u){let e=new L;Or.getBarycoord(ji,Ei,Di,Oi,e),i&&(u.uv=Or.getInterpolatedAttribute(i,s,c,l,e,new I)),a&&(u.uv1=Or.getInterpolatedAttribute(a,s,c,l,e,new I)),o&&(u.normal=Or.getInterpolatedAttribute(o,s,c,l,e,new L),u.normal.dot(r.direction)>0&&u.normal.multiplyScalar(-1));let t={a:s,b:c,c:l,normal:new L,materialIndex:0};Or.getNormal(Ei,Di,Oi,t.normal),u.face=t,u.barycoord=e}return u}function pe(e,t,n,r,i,a,o){let s=e.geometry.attributes.position;if(pa.fromBufferAttribute(s,i),ma.fromBufferAttribute(s,a),n.distanceSqToSegment(pa,ma,va,ya)>r)return;va.applyMatrix4(e.matrixWorld);let c=t.ray.origin.distanceTo(va);if(!(c<t.near||c>t.far))return{distance:c,point:ya.clone().applyMatrix4(e.matrixWorld),index:o,face:null,faceIndex:null,barycoord:null,object:e}}function me(e,t,n,r,i,a,o){let s=Da.distanceSqToPoint(e);if(s<n){let n=new L;Da.closestPointToPoint(e,n),n.applyMatrix4(r);let c=i.ray.origin.distanceTo(n);if(c<i.near||c>i.far)return;a.push({distance:c,distanceToRay:Math.sqrt(s),point:n,index:t,face:null,faceIndex:null,barycoord:null,object:o})}}function he(e){let t={};for(let n in e){t[n]={};for(let r in e[n]){let i=e[n][r];if(_e(i))i.isRenderTargetTexture?(d(`UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms().`),t[n][r]=null):t[n][r]=i.clone();else if(Array.isArray(i)){if(_e(i[0])){let e=[];for(let t=0,n=i.length;t<n;t++)e[t]=i[t].clone();t[n][r]=e}else t[n][r]=i.slice()}else t[n][r]=i}}return t}function ge(e){let t={};for(let n=0;n<e.length;n++){let r=he(e[n]);for(let e in r)t[e]=r[e]}return t}function _e(e){return e&&(e.isColor||e.isMatrix3||e.isMatrix4||e.isVector2||e.isVector3||e.isVector4||e.isTexture||e.isQuaternion)}function ve(e){let t=[];for(let n=0;n<e.length;n++)t.push(e[n].clone());return t}function ye(e){let t=e.getRenderTarget();return t===null?e.outputColorSpace:t.isXRRenderTarget===!0?t.texture.colorSpace:bn.workingColorSpace}function be(e,t){return!e||e.constructor===t?e:typeof t.BYTES_PER_ELEMENT==`number`?new t(e):Array.prototype.slice.call(e)}function xe(e){function t(t,n){return e[t]-e[n]}let n=e.length,r=Array(n);for(let e=0;e!==n;++e)r[e]=e;return r.sort(t),r}function Se(e,t,n){let r=e.length,i=new e.constructor(r);for(let a=0,o=0;o!==r;++a){let r=n[a]*t;for(let n=0;n!==t;++n)i[o++]=e[r+n]}return i}function Ce(e,t,n,r){let i=1,a=e[0];for(;a!==void 0&&a[r]===void 0;)a=e[i++];if(a===void 0)return;let o=a[r];if(o!==void 0){if(Array.isArray(o))do o=a[r],o!==void 0&&(t.push(a.time),n.push(...o)),a=e[i++];while(a!==void 0);else if(o.toArray!==void 0)do o=a[r],o!==void 0&&(t.push(a.time),o.toArray(n,n.length)),a=e[i++];while(a!==void 0);else do o=a[r],o!==void 0&&(t.push(a.time),n.push(o)),a=e[i++];while(a!==void 0)}}function we(e){switch(e.toLowerCase()){case`scalar`:case`double`:case`float`:case`number`:case`integer`:return eo;case`vector`:case`vector2`:case`vector3`:case`vector4`:return io;case`color`:return $a;case`quaternion`:return no;case`bool`:case`boolean`:return Qa;case`string`:return ro}throw Error(`THREE.KeyframeTrack: Unsupported typeName: `+e)}function Te(e){if(e.type===void 0)throw Error(`THREE.KeyframeTrack: track type undefined, can not parse`);let t=we(e.type);if(e.times===void 0){let t=[],n=[];Ce(e.keys,t,n,`value`),e.times=t,e.values=n}return t.parse===void 0?new t(e.name,e.times,e.values,e.interpolation):t.parse(e)}function Ee(e){try{let t=e.slice(e.indexOf(`:`)+1);return new URL(t).protocol===`blob:`}catch{return!1}}function De(e,t,n,r){let i=Oe(r);switch(n){case Xe:return e*t;case tt:return e*t/i.components*i.byteLength;case nt:return e*t/i.components*i.byteLength;case rt:return e*t*2/i.components*i.byteLength;case it:return e*t*2/i.components*i.byteLength;case Ze:return e*t*3/i.components*i.byteLength;case Qe:return e*t*4/i.components*i.byteLength;case at:return e*t*4/i.components*i.byteLength;case ot:case st:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*8;case ct:case lt:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*16;case dt:case pt:return Math.max(e,16)*Math.max(t,8)/4;case ut:case ft:return Math.max(e,8)*Math.max(t,8)/2;case mt:case ht:case _t:case vt:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*8;case gt:case yt:case bt:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*16;case xt:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*16;case St:return Math.floor((e+4)/5)*Math.floor((t+3)/4)*16;case Ct:return Math.floor((e+4)/5)*Math.floor((t+4)/5)*16;case wt:return Math.floor((e+5)/6)*Math.floor((t+4)/5)*16;case Tt:return Math.floor((e+5)/6)*Math.floor((t+5)/6)*16;case Et:return Math.floor((e+7)/8)*Math.floor((t+4)/5)*16;case Dt:return Math.floor((e+7)/8)*Math.floor((t+5)/6)*16;case Ot:return Math.floor((e+7)/8)*Math.floor((t+7)/8)*16;case kt:return Math.floor((e+9)/10)*Math.floor((t+4)/5)*16;case At:return Math.floor((e+9)/10)*Math.floor((t+5)/6)*16;case jt:return Math.floor((e+9)/10)*Math.floor((t+7)/8)*16;case Mt:return Math.floor((e+9)/10)*Math.floor((t+9)/10)*16;case Nt:return Math.floor((e+11)/12)*Math.floor((t+9)/10)*16;case Pt:return Math.floor((e+11)/12)*Math.floor((t+11)/12)*16;case Ft:case It:case Lt:return Math.ceil(e/4)*Math.ceil(t/4)*16;case Rt:case zt:return Math.ceil(e/4)*Math.ceil(t/4)*8;case Bt:case Vt:return Math.ceil(e/4)*Math.ceil(t/4)*16}throw Error(`Unable to determine texture byte length for ${n} format.`)}function Oe(e){switch(e){case Le:case Re:return{byteLength:1,components:1};case Be:case ze:case We:return{byteLength:2,components:1};case Ge:case Ke:return{byteLength:2,components:4};case He:case Ve:case Ue:return{byteLength:4,components:1};case Je:case Ye:return{byteLength:4,components:3}}throw Error(`THREE.TextureUtils: Unknown texture type ${e}.`)}var ke,Ae,M,je,Me,Ne,N,Pe,P,F,Fe,Ie,Le,Re,ze,Be,Ve,He,Ue,We,Ge,Ke,qe,Je,Ye,Xe,Ze,Qe,$e,et,tt,nt,rt,it,at,ot,st,ct,lt,ut,dt,ft,pt,mt,ht,gt,_t,vt,yt,bt,xt,St,Ct,wt,Tt,Et,Dt,Ot,kt,At,jt,Mt,Nt,Pt,Ft,It,Lt,Rt,zt,Bt,Vt,Ht,Ut,Wt,Gt,Kt,qt,Jt,Yt,Xt,Zt,Qt,$t,en,tn,nn,rn,an,on,sn,cn,ln,un,dn,fn,pn,I,mn,L,hn,gn,R,_n,vn,yn,bn,xn,Sn,Cn,wn,Tn,En,Dn,On,kn,An,jn,Mn,Nn,Pn,Fn,In,Ln,Rn,zn,Bn,Vn,Hn,Un,Wn,Gn,Kn,qn,Jn,Yn,Xn,Zn,Qn,$n,er,tr,nr,rr,ir,ar,or,sr,cr,lr,ur,dr,fr,z,pr,mr,hr,gr,_r,vr,yr,br,xr,Sr,Cr,wr,Tr,Er,Dr,Or,kr,Ar,jr,Mr,Nr,Pr,Fr,Ir,Lr,Rr,zr,Br,Vr,Hr,Ur,Wr,Gr,Kr,qr,Jr,Yr,Xr,Zr,Qr,$r,ei,ti,ni,ri,ii,ai,oi,si,ci,li,ui,di,fi,pi,mi,hi,gi,_i,vi,yi,bi,xi,Si,Ci,wi,Ti,Ei,Di,Oi,ki,Ai,ji,Mi,Ni,Pi,Fi,Ii,Li,Ri,zi,Bi,Vi,Hi,Ui,Wi,Gi,Ki,qi,Ji,Yi,Xi,Zi,Qi,$i,ea,ta,na,ra,ia,aa,oa,sa,ca,la,ua,da,fa,pa,ma,ha,ga,_a,va,ya,ba,xa,Sa,Ca,wa,Ta,Ea,Da,Oa,ka,Aa,ja,Ma,Na,Pa,Fa,Ia,La,Ra,za,Ba,Va,Ha,Ua,Wa,Ga,Ka,qa,Ja,Ya,Xa,Za,Qa,$a,eo,to,no,ro,io,ao,oo,so,co,lo,uo,fo,po,mo,ho,go,_o,vo,yo,bo,xo,So,Co,wo,To,Eo,Do,Oo,ko,Ao,jo,Mo,No,Po,Fo,Io,Lo,Ro,zo,Bo,Vo,Ho,Uo,Wo,Go,Ko,qo,Jo,Yo,Xo,Zo,Qo,$o,es,ts,ns,rs,is,as=t((()=>{ke={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},Ae={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},M=`attached`,je=1e3,Me=1001,Ne=1002,N=1003,Pe=1004,P=1005,F=1006,Fe=1007,Ie=1008,Le=1009,Re=1010,ze=1011,Be=1012,Ve=1013,He=1014,Ue=1015,We=1016,Ge=1017,Ke=1018,qe=1020,Je=35902,Ye=35899,Xe=1021,Ze=1022,Qe=1023,$e=1026,et=1027,tt=1028,nt=1029,rt=1030,it=1031,at=1033,ot=33776,st=33777,ct=33778,lt=33779,ut=35840,dt=35841,ft=35842,pt=35843,mt=36196,ht=37492,gt=37496,_t=37488,vt=37489,yt=37490,bt=37491,xt=37808,St=37809,Ct=37810,wt=37811,Tt=37812,Et=37813,Dt=37814,Ot=37815,kt=37816,At=37817,jt=37818,Mt=37819,Nt=37820,Pt=37821,Ft=36492,It=36494,Lt=36495,Rt=36283,zt=36284,Bt=36285,Vt=36286,Ht=2300,Ut=2301,Wt=2302,Gt=2303,Kt=2400,qt=2401,Jt=2402,Yt=2500,Xt=3200,Zt=`srgb`,Qt=`srgb-linear`,$t=`linear`,en=`srgb`,tn=7680,nn=35044,rn=2e3,an={},on=null,sn={0:1,2:6,4:7,3:5,1:0,6:2,7:4,5:3},cn=class{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});let n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){let n=this._listeners;return n!==void 0&&n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){let n=this._listeners;if(n===void 0)return;let r=n[e];if(r!==void 0){let e=r.indexOf(t);e!==-1&&r.splice(e,1)}}dispatchEvent(e){let t=this._listeners;if(t===void 0)return;let n=t[e.type];if(n!==void 0){e.target=this;let t=n.slice(0);for(let n=0,r=t.length;n<r;n++)t[n].call(this,e);e.target=null}}},ln=`00.01.02.03.04.05.06.07.08.09.0a.0b.0c.0d.0e.0f.10.11.12.13.14.15.16.17.18.19.1a.1b.1c.1d.1e.1f.20.21.22.23.24.25.26.27.28.29.2a.2b.2c.2d.2e.2f.30.31.32.33.34.35.36.37.38.39.3a.3b.3c.3d.3e.3f.40.41.42.43.44.45.46.47.48.49.4a.4b.4c.4d.4e.4f.50.51.52.53.54.55.56.57.58.59.5a.5b.5c.5d.5e.5f.60.61.62.63.64.65.66.67.68.69.6a.6b.6c.6d.6e.6f.70.71.72.73.74.75.76.77.78.79.7a.7b.7c.7d.7e.7f.80.81.82.83.84.85.86.87.88.89.8a.8b.8c.8d.8e.8f.90.91.92.93.94.95.96.97.98.99.9a.9b.9c.9d.9e.9f.a0.a1.a2.a3.a4.a5.a6.a7.a8.a9.aa.ab.ac.ad.ae.af.b0.b1.b2.b3.b4.b5.b6.b7.b8.b9.ba.bb.bc.bd.be.bf.c0.c1.c2.c3.c4.c5.c6.c7.c8.c9.ca.cb.cc.cd.ce.cf.d0.d1.d2.d3.d4.d5.d6.d7.d8.d9.da.db.dc.dd.de.df.e0.e1.e2.e3.e4.e5.e6.e7.e8.e9.ea.eb.ec.ed.ee.ef.f0.f1.f2.f3.f4.f5.f6.f7.f8.f9.fa.fb.fc.fd.fe.ff`.split(`.`),un=1234567,dn=Math.PI/180,fn=180/Math.PI,pn={DEG2RAD:dn,RAD2DEG:fn,generateUUID:h,clamp:g,euclideanModulo:_,mapLinear:v,inverseLerp:y,lerp:b,damp:x,pingpong:S,smoothstep:C,smootherstep:w,randInt:T,randFloat:E,randFloatSpread:D,seededRandom:O,degToRad:ee,radToDeg:k,isPowerOfTwo:te,ceilPowerOfTwo:ne,floorPowerOfTwo:re,setQuaternionFromProperEuler:ie,normalize:A,denormalize:ae},I=class e{static{e.prototype.isVector2=!0}constructor(e=0,t=0){this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw Error(`THREE.Vector2: index is out of range: `+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw Error(`THREE.Vector2: index is out of range: `+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){let t=this.x,n=this.y,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6],this.y=r[1]*t+r[4]*n+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=g(this.x,e.x,t.x),this.y=g(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=g(this.x,e,t),this.y=g(this.y,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(g(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let n=this.dot(e)/t;return Math.acos(g(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){let n=Math.cos(t),r=Math.sin(t),i=this.x-e.x,a=this.y-e.y;return this.x=i*n-a*r+e.x,this.y=i*r+a*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}},mn=class{constructor(e=0,t=0,n=0,r=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=r}static slerpFlat(e,t,n,r,i,a,o){let s=n[r+0],c=n[r+1],l=n[r+2],u=n[r+3],d=i[a+0],f=i[a+1],p=i[a+2],m=i[a+3];if(u!==m||s!==d||c!==f||l!==p){let e=s*d+c*f+l*p+u*m;e<0&&(d=-d,f=-f,p=-p,m=-m,e=-e);let t=1-o;if(e<.9995){let n=Math.acos(e),r=Math.sin(n);t=Math.sin(t*n)/r,o=Math.sin(o*n)/r,s=s*t+d*o,c=c*t+f*o,l=l*t+p*o,u=u*t+m*o}else{s=s*t+d*o,c=c*t+f*o,l=l*t+p*o,u=u*t+m*o;let e=1/Math.sqrt(s*s+c*c+l*l+u*u);s*=e,c*=e,l*=e,u*=e}}e[t]=s,e[t+1]=c,e[t+2]=l,e[t+3]=u}static multiplyQuaternionsFlat(e,t,n,r,i,a){let o=n[r],s=n[r+1],c=n[r+2],l=n[r+3],u=i[a],d=i[a+1],f=i[a+2],p=i[a+3];return e[t]=o*p+l*u+s*f-c*d,e[t+1]=s*p+l*d+c*u-o*f,e[t+2]=c*p+l*f+o*d-s*u,e[t+3]=l*p-o*u-s*d-c*f,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){let n=e._x,r=e._y,i=e._z,a=e._order,o=Math.cos,s=Math.sin,c=o(n/2),l=o(r/2),u=o(i/2),f=s(n/2),p=s(r/2),m=s(i/2);switch(a){case`XYZ`:this._x=f*l*u+c*p*m,this._y=c*p*u-f*l*m,this._z=c*l*m+f*p*u,this._w=c*l*u-f*p*m;break;case`YXZ`:this._x=f*l*u+c*p*m,this._y=c*p*u-f*l*m,this._z=c*l*m-f*p*u,this._w=c*l*u+f*p*m;break;case`ZXY`:this._x=f*l*u-c*p*m,this._y=c*p*u+f*l*m,this._z=c*l*m+f*p*u,this._w=c*l*u-f*p*m;break;case`ZYX`:this._x=f*l*u-c*p*m,this._y=c*p*u+f*l*m,this._z=c*l*m-f*p*u,this._w=c*l*u+f*p*m;break;case`YZX`:this._x=f*l*u+c*p*m,this._y=c*p*u+f*l*m,this._z=c*l*m-f*p*u,this._w=c*l*u-f*p*m;break;case`XZY`:this._x=f*l*u-c*p*m,this._y=c*p*u-f*l*m,this._z=c*l*m+f*p*u,this._w=c*l*u+f*p*m;break;default:d(`Quaternion: .setFromEuler() encountered an unknown order: `+a)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){let n=t/2,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){let t=e.elements,n=t[0],r=t[4],i=t[8],a=t[1],o=t[5],s=t[9],c=t[2],l=t[6],u=t[10],d=n+o+u;if(d>0){let e=.5/Math.sqrt(d+1);this._w=.25/e,this._x=(l-s)*e,this._y=(i-c)*e,this._z=(a-r)*e}else if(n>o&&n>u){let e=2*Math.sqrt(1+n-o-u);this._w=(l-s)/e,this._x=.25*e,this._y=(r+a)/e,this._z=(i+c)/e}else if(o>u){let e=2*Math.sqrt(1+o-n-u);this._w=(i-c)/e,this._x=(r+a)/e,this._y=.25*e,this._z=(s+l)/e}else{let e=2*Math.sqrt(1+u-n-o);this._w=(a-r)/e,this._x=(i+c)/e,this._y=(s+l)/e,this._z=.25*e}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<1e-8?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(g(this.dot(e),-1,1)))}rotateTowards(e,t){let n=this.angleTo(e);if(n===0)return this;let r=Math.min(1,t/n);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x*=e,this._y*=e,this._z*=e,this._w*=e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){let n=e._x,r=e._y,i=e._z,a=e._w,o=t._x,s=t._y,c=t._z,l=t._w;return this._x=n*l+a*o+r*c-i*s,this._y=r*l+a*s+i*o-n*c,this._z=i*l+a*c+n*s-r*o,this._w=a*l-n*o-r*s-i*c,this._onChangeCallback(),this}slerp(e,t){let n=e._x,r=e._y,i=e._z,a=e._w,o=this.dot(e);o<0&&(n=-n,r=-r,i=-i,a=-a,o=-o);let s=1-t;if(o<.9995){let e=Math.acos(o),c=Math.sin(e);s=Math.sin(s*e)/c,t=Math.sin(t*e)/c,this._x=this._x*s+n*t,this._y=this._y*s+r*t,this._z=this._z*s+i*t,this._w=this._w*s+a*t,this._onChangeCallback()}else this._x=this._x*s+n*t,this._y=this._y*s+r*t,this._z=this._z*s+i*t,this._w=this._w*s+a*t,this.normalize();return this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){let e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),n=Math.random(),r=Math.sqrt(1-n),i=Math.sqrt(n);return this.set(r*Math.sin(e),r*Math.cos(e),i*Math.sin(t),i*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}},L=class e{static{e.prototype.isVector3=!0}constructor(e=0,t=0,n=0){this.x=e,this.y=t,this.z=n}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw Error(`THREE.Vector3: index is out of range: `+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw Error(`THREE.Vector3: index is out of range: `+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(gn.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(gn.setFromAxisAngle(e,t))}applyMatrix3(e){let t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6]*r,this.y=i[1]*t+i[4]*n+i[7]*r,this.z=i[2]*t+i[5]*n+i[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){let t=this.x,n=this.y,r=this.z,i=e.elements,a=1/(i[3]*t+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*t+i[4]*n+i[8]*r+i[12])*a,this.y=(i[1]*t+i[5]*n+i[9]*r+i[13])*a,this.z=(i[2]*t+i[6]*n+i[10]*r+i[14])*a,this}applyQuaternion(e){let t=this.x,n=this.y,r=this.z,i=e.x,a=e.y,o=e.z,s=e.w,c=2*(a*r-o*n),l=2*(o*t-i*r),u=2*(i*n-a*t);return this.x=t+s*c+a*u-o*l,this.y=n+s*l+o*c-i*u,this.z=r+s*u+i*l-a*c,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){let t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[4]*n+i[8]*r,this.y=i[1]*t+i[5]*n+i[9]*r,this.z=i[2]*t+i[6]*n+i[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=g(this.x,e.x,t.x),this.y=g(this.y,e.y,t.y),this.z=g(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=g(this.x,e,t),this.y=g(this.y,e,t),this.z=g(this.z,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(g(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){let n=e.x,r=e.y,i=e.z,a=t.x,o=t.y,s=t.z;return this.x=r*s-i*o,this.y=i*a-n*s,this.z=n*o-r*a,this}projectOnVector(e){let t=e.lengthSq();if(t===0)return this.set(0,0,0);let n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return hn.copy(this).projectOnVector(e),this.sub(hn)}reflect(e){return this.sub(hn.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let n=this.dot(e)/t;return Math.acos(g(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){let r=Math.sin(t)*e;return this.x=r*Math.sin(n),this.y=Math.cos(t)*e,this.z=r*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){let t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=r,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){let e=Math.random()*Math.PI*2,t=Math.random()*2-1,n=Math.sqrt(1-t*t);return this.x=n*Math.cos(e),this.y=t,this.z=n*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}},hn=new L,gn=new mn,R=class e{static{e.prototype.isMatrix3=!0}constructor(e,t,n,r,i,a,o,s,c){this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,n,r,i,a,o,s,c)}set(e,t,n,r,i,a,o,s,c){let l=this.elements;return l[0]=e,l[1]=r,l[2]=o,l[3]=t,l[4]=i,l[5]=s,l[6]=n,l[7]=a,l[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){let t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[3],s=n[6],c=n[1],l=n[4],u=n[7],d=n[2],f=n[5],p=n[8],m=r[0],h=r[3],g=r[6],_=r[1],v=r[4],y=r[7],b=r[2],x=r[5],S=r[8];return i[0]=a*m+o*_+s*b,i[3]=a*h+o*v+s*x,i[6]=a*g+o*y+s*S,i[1]=c*m+l*_+u*b,i[4]=c*h+l*v+u*x,i[7]=c*g+l*y+u*S,i[2]=d*m+f*_+p*b,i[5]=d*h+f*v+p*x,i[8]=d*g+f*y+p*S,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],l=e[8];return t*a*l-t*o*c-n*i*l+n*o*s+r*i*c-r*a*s}invert(){let e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],l=e[8],u=l*a-o*c,d=o*s-l*i,f=c*i-a*s,p=t*u+n*d+r*f;if(p===0)return this.set(0,0,0,0,0,0,0,0,0);let m=1/p;return e[0]=u*m,e[1]=(r*c-l*n)*m,e[2]=(o*n-r*a)*m,e[3]=d*m,e[4]=(l*t-r*s)*m,e[5]=(r*i-o*t)*m,e[6]=f*m,e[7]=(n*s-c*t)*m,e[8]=(a*t-n*i)*m,this}transpose(){let e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){let t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,r,i,a,o){let s=Math.cos(i),c=Math.sin(i);return this.set(n*s,n*c,-n*(s*a+c*o)+a+e,-r*c,r*s,-r*(-c*a+s*o)+o+t,0,0,1),this}scale(e,t){return p(`Matrix3: .scale() is deprecated. Use .makeScale() instead.`),this.premultiply(_n.makeScale(e,t)),this}rotate(e){return p(`Matrix3: .rotate() is deprecated. Use .makeRotation() instead.`),this.premultiply(_n.makeRotation(-e)),this}translate(e,t){return p(`Matrix3: .translate() is deprecated. Use .makeTranslation() instead.`),this.premultiply(_n.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,n,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){let t=this.elements,n=e.elements;for(let e=0;e<9;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}},_n=new R,vn=new R().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),yn=new R().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715),bn=oe(),Sn=class{static getDataURL(e,t=`image/png`){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>`u`)return e.src;let n;if(e instanceof HTMLCanvasElement)n=e;else{xn===void 0&&(xn=s(`canvas`)),xn.width=e.width,xn.height=e.height;let t=xn.getContext(`2d`);e instanceof ImageData?t.putImageData(e,0,0):t.drawImage(e,0,0,e.width,e.height),n=xn}return n.toDataURL(t)}static sRGBToLinear(e){if(typeof HTMLImageElement<`u`&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement||typeof ImageBitmap<`u`&&e instanceof ImageBitmap){let t=s(`canvas`);t.width=e.width,t.height=e.height;let n=t.getContext(`2d`);n.drawImage(e,0,0,e.width,e.height);let r=n.getImageData(0,0,e.width,e.height),i=r.data;for(let e=0;e<i.length;e++)i[e]=j(i[e]/255)*255;return n.putImageData(r,0,0),t}if(e.data){let t=e.data.slice(0);for(let e=0;e<t.length;e++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[e]=Math.floor(j(t[e]/255)*255):t[e]=j(t[e]);return{data:t,width:e.width,height:e.height}}return d(`ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied.`),e}},Cn=0,wn=class{constructor(e=null){this.isSource=!0,Object.defineProperty(this,\"id\",{value:Cn++}),this.uuid=h(),this.data=e,this.dataReady=!0,this.version=0}getSize(e){let t=this.data;return typeof HTMLVideoElement<`u`&&t instanceof HTMLVideoElement?e.set(t.videoWidth,t.videoHeight,0):typeof VideoFrame<`u`&&t instanceof VideoFrame?e.set(t.displayWidth,t.displayHeight,0):t===null?e.set(0,0,0):e.set(t.width,t.height,t.depth||0),e}set needsUpdate(e){e===!0&&this.version++}toJSON(e){let t=e===void 0||typeof e==`string`;if(!t&&e.images[this.uuid]!==void 0)return e.images[this.uuid];let n={uuid:this.uuid,url:``},r=this.data;if(r!==null){let e;if(Array.isArray(r)){e=[];for(let t=0,n=r.length;t<n;t++)r[t].isDataTexture?e.push(ce(r[t].image)):e.push(ce(r[t]))}else e=ce(r);n.url=e}return t||(e.images[this.uuid]=n),n}},Tn=0,En=new L,Dn=class e extends cn{constructor(t=e.DEFAULT_IMAGE,n=e.DEFAULT_MAPPING,r=Me,i=Me,a=F,o=Ie,s=Qe,c=Le,l=e.DEFAULT_ANISOTROPY,u=``){super(),this.isTexture=!0,Object.defineProperty(this,\"id\",{value:Tn++}),this.uuid=h(),this.name=``,this.source=new wn(t),this.mipmaps=[],this.mapping=n,this.channel=0,this.wrapS=r,this.wrapT=i,this.magFilter=a,this.minFilter=o,this.anisotropy=l,this.format=s,this.internalFormat=null,this.type=c,this.offset=new I(0,0),this.repeat=new I(1,1),this.center=new I(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new R,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=u,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!(t&&t.depth&&t.depth>1),this.pmremVersion=0,this.normalized=!1}get width(){return this.source.getSize(En).x}get height(){return this.source.getSize(En).y}get depth(){return this.source.getSize(En).z}get image(){return this.source.data}set image(e){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.normalized=e.normalized,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(let t in e){let n=e[t];if(n===void 0){d(`Texture.setValues(): parameter '${t}' has value of undefined.`);continue}let r=this[t];if(r===void 0){d(`Texture.setValues(): property '${t}' does not exist.`);continue}r&&n&&r.isVector2&&n.isVector2||r&&n&&r.isVector3&&n.isVector3||r&&n&&r.isMatrix3&&n.isMatrix3?r.copy(n):this[t]=n}}toJSON(e){let t=e===void 0||typeof e==`string`;if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];let n={metadata:{version:4.7,type:`Texture`,generator:`Texture.toJSON`},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,normalized:this.normalized,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:`dispose`})}transformUv(e){if(this.mapping!==300)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case je:e.x-=Math.floor(e.x);break;case Me:e.x=e.x<0?0:1;break;case Ne:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x-=Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case je:e.y-=Math.floor(e.y);break;case Me:e.y=e.y<0?0:1;break;case Ne:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y-=Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}},Dn.DEFAULT_IMAGE=null,Dn.DEFAULT_MAPPING=300,Dn.DEFAULT_ANISOTROPY=1,On=class e{static{e.prototype.isVector4=!0}constructor(e=0,t=0,n=0,r=1){this.x=e,this.y=t,this.z=n,this.w=r}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,r){return this.x=e,this.y=t,this.z=n,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw Error(`THREE.Vector4: index is out of range: `+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw Error(`THREE.Vector4: index is out of range: `+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w===void 0?1:e.w,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){let t=this.x,n=this.y,r=this.z,i=this.w,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*r+a[12]*i,this.y=a[1]*t+a[5]*n+a[9]*r+a[13]*i,this.z=a[2]*t+a[6]*n+a[10]*r+a[14]*i,this.w=a[3]*t+a[7]*n+a[11]*r+a[15]*i,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);let t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,r,i,a=.01,o=.1,s=e.elements,c=s[0],l=s[4],u=s[8],d=s[1],f=s[5],p=s[9],m=s[2],h=s[6],g=s[10];if(Math.abs(l-d)<a&&Math.abs(u-m)<a&&Math.abs(p-h)<a){if(Math.abs(l+d)<o&&Math.abs(u+m)<o&&Math.abs(p+h)<o&&Math.abs(c+f+g-3)<o)return this.set(1,0,0,0),this;t=Math.PI;let e=(c+1)/2,s=(f+1)/2,_=(g+1)/2,v=(l+d)/4,y=(u+m)/4,b=(p+h)/4;return e>s&&e>_?e<a?(n=0,r=.707106781,i=.707106781):(n=Math.sqrt(e),r=v/n,i=y/n):s>_?s<a?(n=.707106781,r=0,i=.707106781):(r=Math.sqrt(s),n=v/r,i=b/r):_<a?(n=.707106781,r=.707106781,i=0):(i=Math.sqrt(_),n=y/i,r=b/i),this.set(n,r,i,t),this}let _=Math.sqrt((h-p)*(h-p)+(u-m)*(u-m)+(d-l)*(d-l));return Math.abs(_)<.001&&(_=1),this.x=(h-p)/_,this.y=(u-m)/_,this.z=(d-l)/_,this.w=Math.acos((c+f+g-1)/2),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=g(this.x,e.x,t.x),this.y=g(this.y,e.y,t.y),this.z=g(this.z,e.z,t.z),this.w=g(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=g(this.x,e,t),this.y=g(this.y,e,t),this.z=g(this.z,e,t),this.w=g(this.w,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(g(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}},kn=class extends cn{constructor(e=1,t=1,n={}){super(),n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:F,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1,useArrayDepthTexture:!1},n),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=n.depth,this.scissor=new On(0,0,e,t),this.scissorTest=!1,this.viewport=new On(0,0,e,t),this.textures=[];let r={width:e,height:t,depth:n.depth},i=new Dn(r),a=n.count;for(let e=0;e<a;e++)this.textures[e]=i.clone(),this.textures[e].isRenderTargetTexture=!0,this.textures[e].renderTarget=this;this._setTextureOptions(n),this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.resolveDepthBuffer=n.resolveDepthBuffer,this.resolveStencilBuffer=n.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=n.depthTexture,this.samples=n.samples,this.multiview=n.multiview,this.useArrayDepthTexture=n.useArrayDepthTexture}_setTextureOptions(e={}){let t={minFilter:F,generateMipmaps:!1,flipY:!1,internalFormat:null};e.mapping!==void 0&&(t.mapping=e.mapping),e.wrapS!==void 0&&(t.wrapS=e.wrapS),e.wrapT!==void 0&&(t.wrapT=e.wrapT),e.wrapR!==void 0&&(t.wrapR=e.wrapR),e.magFilter!==void 0&&(t.magFilter=e.magFilter),e.minFilter!==void 0&&(t.minFilter=e.minFilter),e.format!==void 0&&(t.format=e.format),e.type!==void 0&&(t.type=e.type),e.anisotropy!==void 0&&(t.anisotropy=e.anisotropy),e.colorSpace!==void 0&&(t.colorSpace=e.colorSpace),e.flipY!==void 0&&(t.flipY=e.flipY),e.generateMipmaps!==void 0&&(t.generateMipmaps=e.generateMipmaps),e.internalFormat!==void 0&&(t.internalFormat=e.internalFormat);for(let e=0;e<this.textures.length;e++)this.textures[e].setValues(t)}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}set depthTexture(e){this._depthTexture!==null&&(this._depthTexture.renderTarget=null),e!==null&&(e.renderTarget=this),this._depthTexture=e}get depthTexture(){return this._depthTexture}setSize(e,t,n=1){if(this.width!==e||this.height!==t||this.depth!==n){this.width=e,this.height=t,this.depth=n;for(let r=0,i=this.textures.length;r<i;r++)this.textures[r].image.width=e,this.textures[r].image.height=t,this.textures[r].image.depth=n,this.textures[r].isData3DTexture!==!0&&(this.textures[r].isArrayTexture=this.textures[r].image.depth>1);this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let t=0,n=e.textures.length;t<n;t++){this.textures[t]=e.textures[t].clone(),this.textures[t].isRenderTargetTexture=!0,this.textures[t].renderTarget=this;let n=Object.assign({},e.textures[t].image);this.textures[t].source=new wn(n)}return this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.resolveDepthBuffer=e.resolveDepthBuffer,this.resolveStencilBuffer=e.resolveStencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this.multiview=e.multiview,this.useArrayDepthTexture=e.useArrayDepthTexture,this}dispose(){this.dispatchEvent({type:`dispose`})}},An=class extends kn{constructor(e=1,t=1,n={}){super(e,t,n),this.isWebGLRenderTarget=!0}},jn=class extends Dn{constructor(e=null,t=1,n=1,r=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:n,depth:r},this.magFilter=N,this.minFilter=N,this.wrapR=Me,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}},Mn=class extends Dn{constructor(e=null,t=1,n=1,r=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:n,depth:r},this.magFilter=N,this.minFilter=N,this.wrapR=Me,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}},Nn=class e{static{e.prototype.isMatrix4=!0}constructor(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h)}set(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){let g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=r,g[1]=i,g[5]=a,g[9]=o,g[13]=s,g[2]=c,g[6]=l,g[10]=u,g[14]=d,g[3]=f,g[7]=p,g[11]=m,g[15]=h,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new e().fromArray(this.elements)}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){let t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){let t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return this.determinantAffine()===0?(e.set(1,0,0),t.set(0,1,0),n.set(0,0,1),this):(e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this)}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){if(e.determinantAffine()===0)return this.identity();let t=this.elements,n=e.elements,r=1/Pn.setFromMatrixColumn(e,0).length(),i=1/Pn.setFromMatrixColumn(e,1).length(),a=1/Pn.setFromMatrixColumn(e,2).length();return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=0,t[4]=n[4]*i,t[5]=n[5]*i,t[6]=n[6]*i,t[7]=0,t[8]=n[8]*a,t[9]=n[9]*a,t[10]=n[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){let t=this.elements,n=e.x,r=e.y,i=e.z,a=Math.cos(n),o=Math.sin(n),s=Math.cos(r),c=Math.sin(r),l=Math.cos(i),u=Math.sin(i);if(e.order===`XYZ`){let e=a*l,n=a*u,r=o*l,i=o*u;t[0]=s*l,t[4]=-s*u,t[8]=c,t[1]=n+r*c,t[5]=e-i*c,t[9]=-o*s,t[2]=i-e*c,t[6]=r+n*c,t[10]=a*s}else if(e.order===`YXZ`){let e=s*l,n=s*u,r=c*l,i=c*u;t[0]=e+i*o,t[4]=r*o-n,t[8]=a*c,t[1]=a*u,t[5]=a*l,t[9]=-o,t[2]=n*o-r,t[6]=i+e*o,t[10]=a*s}else if(e.order===`ZXY`){let e=s*l,n=s*u,r=c*l,i=c*u;t[0]=e-i*o,t[4]=-a*u,t[8]=r+n*o,t[1]=n+r*o,t[5]=a*l,t[9]=i-e*o,t[2]=-a*c,t[6]=o,t[10]=a*s}else if(e.order===`ZYX`){let e=a*l,n=a*u,r=o*l,i=o*u;t[0]=s*l,t[4]=r*c-n,t[8]=e*c+i,t[1]=s*u,t[5]=i*c+e,t[9]=n*c-r,t[2]=-c,t[6]=o*s,t[10]=a*s}else if(e.order===`YZX`){let e=a*s,n=a*c,r=o*s,i=o*c;t[0]=s*l,t[4]=i-e*u,t[8]=r*u+n,t[1]=u,t[5]=a*l,t[9]=-o*l,t[2]=-c*l,t[6]=n*u+r,t[10]=e-i*u}else if(e.order===`XZY`){let e=a*s,n=a*c,r=o*s,i=o*c;t[0]=s*l,t[4]=-u,t[8]=c*l,t[1]=e*u+i,t[5]=a*l,t[9]=n*u-r,t[2]=r*u-n,t[6]=o*l,t[10]=i*u+e}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(In,e,Ln)}lookAt(e,t,n){let r=this.elements;return Bn.subVectors(e,t),Bn.lengthSq()===0&&(Bn.z=1),Bn.normalize(),Rn.crossVectors(n,Bn),Rn.lengthSq()===0&&(Math.abs(n.z)===1?Bn.x+=1e-4:Bn.z+=1e-4,Bn.normalize(),Rn.crossVectors(n,Bn)),Rn.normalize(),zn.crossVectors(Bn,Rn),r[0]=Rn.x,r[4]=zn.x,r[8]=Bn.x,r[1]=Rn.y,r[5]=zn.y,r[9]=Bn.y,r[2]=Rn.z,r[6]=zn.z,r[10]=Bn.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[4],s=n[8],c=n[12],l=n[1],u=n[5],d=n[9],f=n[13],p=n[2],m=n[6],h=n[10],g=n[14],_=n[3],v=n[7],y=n[11],b=n[15],x=r[0],S=r[4],C=r[8],w=r[12],T=r[1],E=r[5],D=r[9],O=r[13],ee=r[2],k=r[6],te=r[10],ne=r[14],re=r[3],ie=r[7],ae=r[11],A=r[15];return i[0]=a*x+o*T+s*ee+c*re,i[4]=a*S+o*E+s*k+c*ie,i[8]=a*C+o*D+s*te+c*ae,i[12]=a*w+o*O+s*ne+c*A,i[1]=l*x+u*T+d*ee+f*re,i[5]=l*S+u*E+d*k+f*ie,i[9]=l*C+u*D+d*te+f*ae,i[13]=l*w+u*O+d*ne+f*A,i[2]=p*x+m*T+h*ee+g*re,i[6]=p*S+m*E+h*k+g*ie,i[10]=p*C+m*D+h*te+g*ae,i[14]=p*w+m*O+h*ne+g*A,i[3]=_*x+v*T+y*ee+b*re,i[7]=_*S+v*E+y*k+b*ie,i[11]=_*C+v*D+y*te+b*ae,i[15]=_*w+v*O+y*ne+b*A,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[4],r=e[8],i=e[12],a=e[1],o=e[5],s=e[9],c=e[13],l=e[2],u=e[6],d=e[10],f=e[14],p=e[3],m=e[7],h=e[11],g=e[15],_=s*f-c*d,v=o*f-c*u,y=o*d-s*u,b=a*f-c*l,x=a*d-s*l,S=a*u-o*l;return t*(m*_-h*v+g*y)-n*(p*_-h*b+g*x)+r*(p*v-m*b+g*S)-i*(p*y-m*x+h*S)}determinantAffine(){let e=this.elements,t=e[0],n=e[4],r=e[8],i=e[1],a=e[5],o=e[9],s=e[2],c=e[6],l=e[10];return t*(a*l-o*c)-n*(i*l-o*s)+r*(i*c-a*s)}transpose(){let e=this.elements,t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){let r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=n),this}invert(){let e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],l=e[8],u=e[9],d=e[10],f=e[11],p=e[12],m=e[13],h=e[14],g=e[15],_=t*o-n*a,v=t*s-r*a,y=t*c-i*a,b=n*s-r*o,x=n*c-i*o,S=r*c-i*s,C=l*m-u*p,w=l*h-d*p,T=l*g-f*p,E=u*h-d*m,D=u*g-f*m,O=d*g-f*h,ee=_*O-v*D+y*E+b*T-x*w+S*C;if(ee===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let k=1/ee;return e[0]=(o*O-s*D+c*E)*k,e[1]=(r*D-n*O-i*E)*k,e[2]=(m*S-h*x+g*b)*k,e[3]=(d*x-u*S-f*b)*k,e[4]=(s*T-a*O-c*w)*k,e[5]=(t*O-r*T+i*w)*k,e[6]=(h*y-p*S-g*v)*k,e[7]=(l*S-d*y+f*v)*k,e[8]=(a*D-o*T+c*C)*k,e[9]=(n*T-t*D-i*C)*k,e[10]=(p*x-m*y+g*_)*k,e[11]=(u*y-l*x-f*_)*k,e[12]=(o*w-a*E-s*C)*k,e[13]=(t*E-n*w+r*C)*k,e[14]=(m*v-p*b-h*_)*k,e[15]=(l*b-u*v+d*_)*k,this}scale(e){let t=this.elements,n=e.x,r=e.y,i=e.z;return t[0]*=n,t[4]*=r,t[8]*=i,t[1]*=n,t[5]*=r,t[9]*=i,t[2]*=n,t[6]*=r,t[10]*=i,t[3]*=n,t[7]*=r,t[11]*=i,this}getMaxScaleOnAxis(){let e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,r))}makeTranslation(e,t,n){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){let t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){let n=Math.cos(t),r=Math.sin(t),i=1-n,a=e.x,o=e.y,s=e.z,c=i*a,l=i*o;return this.set(c*a+n,c*o-r*s,c*s+r*o,0,c*o+r*s,l*o+n,l*s-r*a,0,c*s-r*o,l*s+r*a,i*s*s+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,r,i,a){return this.set(1,n,i,0,e,1,a,0,t,r,1,0,0,0,0,1),this}compose(e,t,n){let r=this.elements,i=t._x,a=t._y,o=t._z,s=t._w,c=i+i,l=a+a,u=o+o,d=i*c,f=i*l,p=i*u,m=a*l,h=a*u,g=o*u,_=s*c,v=s*l,y=s*u,b=n.x,x=n.y,S=n.z;return r[0]=(1-(m+g))*b,r[1]=(f+y)*b,r[2]=(p-v)*b,r[3]=0,r[4]=(f-y)*x,r[5]=(1-(d+g))*x,r[6]=(h+_)*x,r[7]=0,r[8]=(p+v)*S,r[9]=(h-_)*S,r[10]=(1-(d+m))*S,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,n){let r=this.elements;e.x=r[12],e.y=r[13],e.z=r[14];let i=this.determinantAffine();if(i===0)return n.set(1,1,1),t.identity(),this;let a=Pn.set(r[0],r[1],r[2]).length(),o=Pn.set(r[4],r[5],r[6]).length(),s=Pn.set(r[8],r[9],r[10]).length();i<0&&(a=-a),Fn.copy(this);let c=1/a,l=1/o,u=1/s;return Fn.elements[0]*=c,Fn.elements[1]*=c,Fn.elements[2]*=c,Fn.elements[4]*=l,Fn.elements[5]*=l,Fn.elements[6]*=l,Fn.elements[8]*=u,Fn.elements[9]*=u,Fn.elements[10]*=u,t.setFromRotationMatrix(Fn),n.x=a,n.y=o,n.z=s,this}makePerspective(e,t,n,r,i,a,o=rn,s=!1){let c=this.elements,l=2*i/(t-e),u=2*i/(n-r),d=(t+e)/(t-e),f=(n+r)/(n-r),p,m;if(s)p=i/(a-i),m=a*i/(a-i);else if(o===2e3)p=-(a+i)/(a-i),m=-2*a*i/(a-i);else if(o===2001)p=-a/(a-i),m=-a*i/(a-i);else throw Error(`THREE.Matrix4.makePerspective(): Invalid coordinate system: `+o);return c[0]=l,c[4]=0,c[8]=d,c[12]=0,c[1]=0,c[5]=u,c[9]=f,c[13]=0,c[2]=0,c[6]=0,c[10]=p,c[14]=m,c[3]=0,c[7]=0,c[11]=-1,c[15]=0,this}makeOrthographic(e,t,n,r,i,a,o=rn,s=!1){let c=this.elements,l=2/(t-e),u=2/(n-r),d=-(t+e)/(t-e),f=-(n+r)/(n-r),p,m;if(s)p=1/(a-i),m=a/(a-i);else if(o===2e3)p=-2/(a-i),m=-(a+i)/(a-i);else if(o===2001)p=-1/(a-i),m=-i/(a-i);else throw Error(`THREE.Matrix4.makeOrthographic(): Invalid coordinate system: `+o);return c[0]=l,c[4]=0,c[8]=0,c[12]=d,c[1]=0,c[5]=u,c[9]=0,c[13]=f,c[2]=0,c[6]=0,c[10]=p,c[14]=m,c[3]=0,c[7]=0,c[11]=0,c[15]=1,this}equals(e){let t=this.elements,n=e.elements;for(let e=0;e<16;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}},Pn=new L,Fn=new Nn,In=new L(0,0,0),Ln=new L(1,1,1),Rn=new L,zn=new L,Bn=new L,Vn=new Nn,Hn=new mn,Un=class e{constructor(t=0,n=0,r=0,i=e.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=n,this._z=r,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,r=this._order){return this._x=e,this._y=t,this._z=n,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){let r=e.elements,i=r[0],a=r[4],o=r[8],s=r[1],c=r[5],l=r[9],u=r[2],f=r[6],p=r[10];switch(t){case`XYZ`:this._y=Math.asin(g(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-l,p),this._z=Math.atan2(-a,i)):(this._x=Math.atan2(f,c),this._z=0);break;case`YXZ`:this._x=Math.asin(-g(l,-1,1)),Math.abs(l)<.9999999?(this._y=Math.atan2(o,p),this._z=Math.atan2(s,c)):(this._y=Math.atan2(-u,i),this._z=0);break;case`ZXY`:this._x=Math.asin(g(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(-u,p),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(s,i));break;case`ZYX`:this._y=Math.asin(-g(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(f,p),this._z=Math.atan2(s,i)):(this._x=0,this._z=Math.atan2(-a,c));break;case`YZX`:this._z=Math.asin(g(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-l,c),this._y=Math.atan2(-u,i)):(this._x=0,this._y=Math.atan2(o,p));break;case`XZY`:this._z=Math.asin(-g(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(f,c),this._y=Math.atan2(o,i)):(this._x=Math.atan2(-l,p),this._y=0);break;default:d(`Euler: .setFromRotationMatrix() encountered an unknown order: `+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return Vn.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Vn,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return Hn.setFromEuler(this),this.setFromQuaternion(Hn,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}},Un.DEFAULT_ORDER=`XYZ`,Wn=class{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!==0}isEnabled(e){return!!(this.mask&(1<<e|0))}},Gn=0,Kn=new L,qn=new mn,Jn=new Nn,Yn=new L,Xn=new L,Zn=new L,Qn=new mn,$n=new L(1,0,0),er=new L(0,1,0),tr=new L(0,0,1),nr={type:`added`},rr={type:`removed`},ir={type:`childadded`,child:null},ar={type:`childremoved`,child:null},or=class e extends cn{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,\"id\",{value:Gn++}),this.uuid=h(),this.name=``,this.type=`Object3D`,this.parent=null,this.children=[],this.up=e.DEFAULT_UP.clone();let t=new L,n=new Un,r=new mn,i=new L(1,1,1);function a(){r.setFromEuler(n,!1)}function o(){n.setFromQuaternion(r,void 0,!1)}n._onChange(a),r._onChange(o),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:n},quaternion:{configurable:!0,enumerable:!0,value:r},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new Nn},normalMatrix:{value:new R}}),this.matrix=new Nn,this.matrixWorld=new Nn,this.matrixAutoUpdate=e.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=e.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new Wn,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.customDepthMaterial=void 0,this.customDistanceMaterial=void 0,this.static=!1,this.userData={},this.pivot=null}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return qn.setFromAxisAngle(e,t),this.quaternion.multiply(qn),this}rotateOnWorldAxis(e,t){return qn.setFromAxisAngle(e,t),this.quaternion.premultiply(qn),this}rotateX(e){return this.rotateOnAxis($n,e)}rotateY(e){return this.rotateOnAxis(er,e)}rotateZ(e){return this.rotateOnAxis(tr,e)}translateOnAxis(e,t){return Kn.copy(e).applyQuaternion(this.quaternion),this.position.add(Kn.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis($n,e)}translateY(e){return this.translateOnAxis(er,e)}translateZ(e){return this.translateOnAxis(tr,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(Jn.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?Yn.copy(e):Yn.set(e,t,n);let r=this.parent;this.updateWorldMatrix(!0,!1),Xn.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Jn.lookAt(Xn,Yn,this.up):Jn.lookAt(Yn,Xn,this.up),this.quaternion.setFromRotationMatrix(Jn),r&&(Jn.extractRotation(r.matrixWorld),qn.setFromRotationMatrix(Jn),this.quaternion.premultiply(qn.invert()))}add(e){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return e===this?(f(`Object3D.add: object can't be added as a child of itself.`,e),this):(e&&e.isObject3D?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(nr),ir.child=e,this.dispatchEvent(ir),ir.child=null):f(`Object3D.add: object not an instance of THREE.Object3D.`,e),this)}remove(e){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.remove(arguments[e]);return this}let t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(rr),ar.child=e,this.dispatchEvent(ar),ar.child=null),this}removeFromParent(){let e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),Jn.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),Jn.multiply(e.parent.matrixWorld)),e.applyMatrix4(Jn),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(nr),ir.child=e,this.dispatchEvent(ir),ir.child=null,this}getObjectById(e){return this.getObjectByProperty(`id`,e)}getObjectByName(e){return this.getObjectByProperty(`name`,e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let n=0,r=this.children.length;n<r;n++){let r=this.children[n].getObjectByProperty(e,t);if(r!==void 0)return r}}getObjectsByProperty(e,t,n=[]){this[e]===t&&n.push(this);let r=this.children;for(let i=0,a=r.length;i<a;i++)r[i].getObjectsByProperty(e,t,n);return n}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Xn,e,Zn),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Xn,Qn,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);let t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);let t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);let t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].traverseVisible(e)}traverseAncestors(e){let t=this.parent;t!==null&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale);let e=this.pivot;if(e!==null){let t=e.x,n=e.y,r=e.z,i=this.matrix.elements;i[12]+=t-i[0]*t-i[4]*n-i[8]*r,i[13]+=n-i[1]*t-i[5]*n-i[9]*r,i[14]+=r-i[2]*t-i[6]*n-i[10]*r}this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);let t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].updateMatrixWorld(e)}updateWorldMatrix(e,t,n=!1){let r=this.parent;if(e===!0&&r!==null&&r.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||n)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,n=!0),t===!0){let e=this.children;for(let t=0,r=e.length;t<r;t++)e[t].updateWorldMatrix(!1,!0,n)}}toJSON(e){let t=e===void 0||typeof e==`string`,n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.7,type:`Object`,generator:`Object3D.toJSON`});let r={};r.uuid=this.uuid,r.type=this.type,this.name!==``&&(r.name=this.name),this.castShadow===!0&&(r.castShadow=!0),this.receiveShadow===!0&&(r.receiveShadow=!0),this.visible===!1&&(r.visible=!1),this.frustumCulled===!1&&(r.frustumCulled=!1),this.renderOrder!==0&&(r.renderOrder=this.renderOrder),this.static!==!1&&(r.static=this.static),Object.keys(this.userData).length>0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),this.pivot!==null&&(r.pivot=this.pivot.toArray()),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.morphTargetDictionary!==void 0&&(r.morphTargetDictionary=Object.assign({},this.morphTargetDictionary)),this.morphTargetInfluences!==void 0&&(r.morphTargetInfluences=this.morphTargetInfluences.slice()),this.isInstancedMesh&&(r.type=`InstancedMesh`,r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type=`BatchedMesh`,r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.geometryInfo=this._geometryInfo.map(e=>({...e,boundingBox:e.boundingBox?e.boundingBox.toJSON():void 0,boundingSphere:e.boundingSphere?e.boundingSphere.toJSON():void 0})),r.instanceInfo=this._instanceInfo.map(e=>({...e})),r.availableInstanceIds=this._availableInstanceIds.slice(),r.availableGeometryIds=this._availableGeometryIds.slice(),r.nextIndexStart=this._nextIndexStart,r.nextVertexStart=this._nextVertexStart,r.geometryCount=this._geometryCount,r.maxInstanceCount=this._maxInstanceCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.matricesTexture=this._matricesTexture.toJSON(e),r.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(r.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(r.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(r.boundingBox=this.boundingBox.toJSON()));function i(t,n){return t[n.uuid]===void 0&&(t[n.uuid]=n.toJSON(e)),n.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=i(e.geometries,this.geometry);let t=this.geometry.parameters;if(t!==void 0&&t.shapes!==void 0){let n=t.shapes;if(Array.isArray(n))for(let t=0,r=n.length;t<r;t++){let r=n[t];i(e.shapes,r)}else i(e.shapes,n)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(i(e.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),this.material!==void 0){if(Array.isArray(this.material)){let t=[];for(let n=0,r=this.material.length;n<r;n++)t.push(i(e.materials,this.material[n]));r.material=t}else r.material=i(e.materials,this.material)}if(this.children.length>0){r.children=[];for(let t=0;t<this.children.length;t++)r.children.push(this.children[t].toJSON(e).object)}if(this.animations.length>0){r.animations=[];for(let t=0;t<this.animations.length;t++){let n=this.animations[t];r.animations.push(i(e.animations,n))}}if(t){let t=a(e.geometries),r=a(e.materials),i=a(e.textures),o=a(e.images),s=a(e.shapes),c=a(e.skeletons),l=a(e.animations),u=a(e.nodes);t.length>0&&(n.geometries=t),r.length>0&&(n.materials=r),i.length>0&&(n.textures=i),o.length>0&&(n.images=o),s.length>0&&(n.shapes=s),c.length>0&&(n.skeletons=c),l.length>0&&(n.animations=l),u.length>0&&(n.nodes=u)}return n.object=r,n;function a(e){let t=[];for(let n in e){let r=e[n];delete r.metadata,t.push(r)}return t}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.pivot=e.pivot===null?null:e.pivot.clone(),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.static=e.static,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let t=0;t<e.children.length;t++){let n=e.children[t];this.add(n.clone())}return this}},or.DEFAULT_UP=new L(0,1,0),or.DEFAULT_MATRIX_AUTO_UPDATE=!0,or.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0,sr=class extends or{constructor(){super(),this.isGroup=!0,this.type=`Group`}},cr={type:`move`},lr=class{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new sr,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new sr,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new L,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new L),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new sr,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new L,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new L,this._grip.eventsEnabled=!1),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){let t=this._hand;if(t)for(let n of e.hand.values())this._getHandJoint(t,n)}return this.dispatchEvent({type:`connected`,data:e}),this}disconnect(e){return this.dispatchEvent({type:`disconnected`,data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,n){let r=null,i=null,a=null,o=this._targetRay,s=this._grip,c=this._hand;if(e&&t.session.visibilityState!==`visible-blurred`){if(c&&e.hand){a=!0;for(let r of e.hand.values()){let e=t.getJointPose(r,n),i=this._getHandJoint(c,r);e!==null&&(i.matrix.fromArray(e.transform.matrix),i.matrix.decompose(i.position,i.rotation,i.scale),i.matrixWorldNeedsUpdate=!0,i.jointRadius=e.radius),i.visible=e!==null}let r=c.joints[`index-finger-tip`],i=c.joints[`thumb-tip`],o=r.position.distanceTo(i.position);c.inputState.pinching&&o>.025?(c.inputState.pinching=!1,this.dispatchEvent({type:`pinchend`,handedness:e.handedness,target:this})):!c.inputState.pinching&&o<=.015&&(c.inputState.pinching=!0,this.dispatchEvent({type:`pinchstart`,handedness:e.handedness,target:this}))}else s!==null&&e.gripSpace&&(i=t.getPose(e.gripSpace,n),i!==null&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),s.matrixWorldNeedsUpdate=!0,i.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(i.linearVelocity)):s.hasLinearVelocity=!1,i.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(i.angularVelocity)):s.hasAngularVelocity=!1,s.eventsEnabled&&s.dispatchEvent({type:`gripUpdated`,data:e,target:this})));o!==null&&(r=t.getPose(e.targetRaySpace,n),r===null&&i!==null&&(r=i),r!==null&&(o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,r.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(r.linearVelocity)):o.hasLinearVelocity=!1,r.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(r.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(cr)))}return o!==null&&(o.visible=r!==null),s!==null&&(s.visible=i!==null),c!==null&&(c.visible=a!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){let n=new sr;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}},ur={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},dr={h:0,s:0,l:0},fr={h:0,s:0,l:0},z=class{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,n)}set(e,t,n){if(t===void 0&&n===void 0){let t=e;t&&t.isColor?this.copy(t):typeof t==`number`?this.setHex(t):typeof t==`string`&&this.setStyle(t)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Zt){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,bn.colorSpaceToWorking(this,t),this}setRGB(e,t,n,r=bn.workingColorSpace){return this.r=e,this.g=t,this.b=n,bn.colorSpaceToWorking(this,r),this}setHSL(e,t,n,r=bn.workingColorSpace){if(e=_(e,1),t=g(t,0,1),n=g(n,0,1),t===0)this.r=this.g=this.b=n;else{let r=n<=.5?n*(1+t):n+t-n*t,i=2*n-r;this.r=le(i,r,e+1/3),this.g=le(i,r,e),this.b=le(i,r,e-1/3)}return bn.colorSpaceToWorking(this,r),this}setStyle(e,t=Zt){function n(t){t!==void 0&&parseFloat(t)<1&&d(`Color: Alpha component of `+e+` will be ignored.`)}let r;if(r=/^(\\w+)\\(([^\\)]*)\\)/.exec(e)){let i,a=r[1],o=r[2];switch(a){case`rgb`:case`rgba`:if(i=/^\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*(?:,\\s*(\\d*\\.?\\d+)\\s*)?$/.exec(o))return n(i[4]),this.setRGB(Math.min(255,parseInt(i[1],10))/255,Math.min(255,parseInt(i[2],10))/255,Math.min(255,parseInt(i[3],10))/255,t);if(i=/^\\s*(\\d+)\\%\\s*,\\s*(\\d+)\\%\\s*,\\s*(\\d+)\\%\\s*(?:,\\s*(\\d*\\.?\\d+)\\s*)?$/.exec(o))return n(i[4]),this.setRGB(Math.min(100,parseInt(i[1],10))/100,Math.min(100,parseInt(i[2],10))/100,Math.min(100,parseInt(i[3],10))/100,t);break;case`hsl`:case`hsla`:if(i=/^\\s*(\\d*\\.?\\d+)\\s*,\\s*(\\d*\\.?\\d+)\\%\\s*,\\s*(\\d*\\.?\\d+)\\%\\s*(?:,\\s*(\\d*\\.?\\d+)\\s*)?$/.exec(o))return n(i[4]),this.setHSL(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,t);break;default:d(`Color: Unknown color model `+e)}}else if(r=/^\\#([A-Fa-f\\d]+)$/.exec(e)){let n=r[1],i=n.length;if(i===3)return this.setRGB(parseInt(n.charAt(0),16)/15,parseInt(n.charAt(1),16)/15,parseInt(n.charAt(2),16)/15,t);if(i===6)return this.setHex(parseInt(n,16),t);d(`Color: Invalid hex color `+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=Zt){let n=ur[e.toLowerCase()];return n===void 0?d(`Color: Unknown color `+e):this.setHex(n,t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=j(e.r),this.g=j(e.g),this.b=j(e.b),this}copyLinearToSRGB(e){return this.r=se(e.r),this.g=se(e.g),this.b=se(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Zt){return bn.workingToColorSpace(pr.copy(this),e),Math.round(g(pr.r*255,0,255))*65536+Math.round(g(pr.g*255,0,255))*256+Math.round(g(pr.b*255,0,255))}getHexString(e=Zt){return(`000000`+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=bn.workingColorSpace){bn.workingToColorSpace(pr.copy(this),t);let n=pr.r,r=pr.g,i=pr.b,a=Math.max(n,r,i),o=Math.min(n,r,i),s,c,l=(o+a)/2;if(o===a)s=0,c=0;else{let e=a-o;switch(c=l<=.5?e/(a+o):e/(2-a-o),a){case n:s=(r-i)/e+(r<i?6:0);break;case r:s=(i-n)/e+2;break;case i:s=(n-r)/e+4}s/=6}return e.h=s,e.s=c,e.l=l,e}getRGB(e,t=bn.workingColorSpace){return bn.workingToColorSpace(pr.copy(this),t),e.r=pr.r,e.g=pr.g,e.b=pr.b,e}getStyle(e=Zt){bn.workingToColorSpace(pr.copy(this),e);let t=pr.r,n=pr.g,r=pr.b;return e===`srgb`?`rgb(${Math.round(t*255)},${Math.round(n*255)},${Math.round(r*255)})`:`color(${e} ${t.toFixed(3)} ${n.toFixed(3)} ${r.toFixed(3)})`}offsetHSL(e,t,n){return this.getHSL(dr),this.setHSL(dr.h+e,dr.s+t,dr.l+n)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,n){return this.r=e.r+(t.r-e.r)*n,this.g=e.g+(t.g-e.g)*n,this.b=e.b+(t.b-e.b)*n,this}lerpHSL(e,t){this.getHSL(dr),e.getHSL(fr);let n=b(dr.h,fr.h,t),r=b(dr.s,fr.s,t),i=b(dr.l,fr.l,t);return this.setHSL(n,r,i),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){let t=this.r,n=this.g,r=this.b,i=e.elements;return this.r=i[0]*t+i[3]*n+i[6]*r,this.g=i[1]*t+i[4]*n+i[7]*r,this.b=i[2]*t+i[5]*n+i[8]*r,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}},pr=new z,z.NAMES=ur,mr=class extends or{constructor(){super(),this.isScene=!0,this.type=`Scene`,this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new Un,this.environmentIntensity=1,this.environmentRotation=new Un,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<`u`&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent(`observe`,{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){let t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}},hr=new L,gr=new L,_r=new L,vr=new L,yr=new L,br=new L,xr=new L,Sr=new L,Cr=new L,wr=new L,Tr=new On,Er=new On,Dr=new On,Or=class e{constructor(e=new L,t=new L,n=new L){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,r){r.subVectors(n,t),hr.subVectors(e,t),r.cross(hr);let i=r.lengthSq();return i>0?r.multiplyScalar(1/Math.sqrt(i)):r.set(0,0,0)}static getBarycoord(e,t,n,r,i){hr.subVectors(r,t),gr.subVectors(n,t),_r.subVectors(e,t);let a=hr.dot(hr),o=hr.dot(gr),s=hr.dot(_r),c=gr.dot(gr),l=gr.dot(_r),u=a*c-o*o;if(u===0)return i.set(0,0,0),null;let d=1/u,f=(c*s-o*l)*d,p=(a*l-o*s)*d;return i.set(1-f-p,p,f)}static containsPoint(e,t,n,r){return this.getBarycoord(e,t,n,r,vr)!==null&&vr.x>=0&&vr.y>=0&&vr.x+vr.y<=1}static getInterpolation(e,t,n,r,i,a,o,s){return this.getBarycoord(e,t,n,r,vr)===null?(s.x=0,s.y=0,`z`in s&&(s.z=0),`w`in s&&(s.w=0),null):(s.setScalar(0),s.addScaledVector(i,vr.x),s.addScaledVector(a,vr.y),s.addScaledVector(o,vr.z),s)}static getInterpolatedAttribute(e,t,n,r,i,a){return Tr.setScalar(0),Er.setScalar(0),Dr.setScalar(0),Tr.fromBufferAttribute(e,t),Er.fromBufferAttribute(e,n),Dr.fromBufferAttribute(e,r),a.setScalar(0),a.addScaledVector(Tr,i.x),a.addScaledVector(Er,i.y),a.addScaledVector(Dr,i.z),a}static isFrontFacing(e,t,n,r){return hr.subVectors(n,t),gr.subVectors(e,t),hr.cross(gr).dot(r)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,r){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,t,n,r){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,r),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return hr.subVectors(this.c,this.b),gr.subVectors(this.a,this.b),hr.cross(gr).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return e.getNormal(this.a,this.b,this.c,t)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,n){return e.getBarycoord(t,this.a,this.b,this.c,n)}getInterpolation(t,n,r,i,a){return e.getInterpolation(t,this.a,this.b,this.c,n,r,i,a)}containsPoint(t){return e.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return e.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){let n=this.a,r=this.b,i=this.c,a,o;yr.subVectors(r,n),br.subVectors(i,n),Sr.subVectors(e,n);let s=yr.dot(Sr),c=br.dot(Sr);if(s<=0&&c<=0)return t.copy(n);Cr.subVectors(e,r);let l=yr.dot(Cr),u=br.dot(Cr);if(l>=0&&u<=l)return t.copy(r);let d=s*u-l*c;if(d<=0&&s>=0&&l<=0)return a=s/(s-l),t.copy(n).addScaledVector(yr,a);wr.subVectors(e,i);let f=yr.dot(wr),p=br.dot(wr);if(p>=0&&f<=p)return t.copy(i);let m=f*c-s*p;if(m<=0&&c>=0&&p<=0)return o=c/(c-p),t.copy(n).addScaledVector(br,o);let h=l*p-f*u;if(h<=0&&u-l>=0&&f-p>=0)return xr.subVectors(i,r),o=(u-l)/(u-l+(f-p)),t.copy(r).addScaledVector(xr,o);let g=1/(h+m+d);return a=m*g,o=d*g,t.copy(n).addScaledVector(yr,a).addScaledVector(br,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}},kr=class{constructor(e=new L(1/0,1/0,1/0),t=new L(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t+=3)this.expandByPoint(jr.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,n=e.count;t<n;t++)this.expandByPoint(jr.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){let n=jr.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){e.updateWorldMatrix(!1,!1);let n=e.geometry;if(n!==void 0){let r=n.getAttribute(`position`);if(t===!0&&r!==void 0&&e.isInstancedMesh!==!0)for(let t=0,n=r.count;t<n;t++)e.isMesh===!0?e.getVertexPosition(t,jr):jr.fromBufferAttribute(r,t),jr.applyMatrix4(e.matrixWorld),this.expandByPoint(jr);else e.boundingBox===void 0?(n.boundingBox===null&&n.computeBoundingBox(),Mr.copy(n.boundingBox)):(e.boundingBox===null&&e.computeBoundingBox(),Mr.copy(e.boundingBox)),Mr.applyMatrix4(e.matrixWorld),this.union(Mr)}let r=e.children;for(let e=0,n=r.length;e<n;e++)this.expandByObject(r[e],t);return this}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,jr),jr.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(zr),Br.subVectors(this.max,zr),Nr.subVectors(e.a,zr),Pr.subVectors(e.b,zr),Fr.subVectors(e.c,zr),Ir.subVectors(Pr,Nr),Lr.subVectors(Fr,Pr),Rr.subVectors(Nr,Fr);let t=[0,-Ir.z,Ir.y,0,-Lr.z,Lr.y,0,-Rr.z,Rr.y,Ir.z,0,-Ir.x,Lr.z,0,-Lr.x,Rr.z,0,-Rr.x,-Ir.y,Ir.x,0,-Lr.y,Lr.x,0,-Rr.y,Rr.x,0];return!ue(t,Nr,Pr,Fr,Br)||(t=[1,0,0,0,1,0,0,0,1],!ue(t,Nr,Pr,Fr,Br))?!1:(Vr.crossVectors(Ir,Lr),t=[Vr.x,Vr.y,Vr.z],ue(t,Nr,Pr,Fr,Br))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,jr).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(jr).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(Ar[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Ar[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Ar[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Ar[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Ar[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Ar[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Ar[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Ar[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Ar),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}},Ar=[new L,new L,new L,new L,new L,new L,new L,new L],jr=new L,Mr=new kr,Nr=new L,Pr=new L,Fr=new L,Ir=new L,Lr=new L,Rr=new L,zr=new L,Br=new L,Vr=new L,Hr=new L,Ur=new L,Wr=new I,Gr=0,Kr=class extends cn{constructor(e,t,n=!1){if(super(),Array.isArray(e))throw TypeError(`THREE.BufferAttribute: array should be a Typed Array.`);this.isBufferAttribute=!0,Object.defineProperty(this,\"id\",{value:Gr++}),this.name=``,this.array=e,this.itemSize=t,this.count=e===void 0?0:e.length/t,this.normalized=n,this.usage=nn,this.updateRanges=[],this.gpuType=Ue,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let r=0,i=this.itemSize;r<i;r++)this.array[e+r]=t.array[n+r];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,n=this.count;t<n;t++)Wr.fromBufferAttribute(this,t),Wr.applyMatrix3(e),this.setXY(t,Wr.x,Wr.y);else if(this.itemSize===3)for(let t=0,n=this.count;t<n;t++)Ur.fromBufferAttribute(this,t),Ur.applyMatrix3(e),this.setXYZ(t,Ur.x,Ur.y,Ur.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)Ur.fromBufferAttribute(this,t),Ur.applyMatrix4(e),this.setXYZ(t,Ur.x,Ur.y,Ur.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)Ur.fromBufferAttribute(this,t),Ur.applyNormalMatrix(e),this.setXYZ(t,Ur.x,Ur.y,Ur.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)Ur.fromBufferAttribute(this,t),Ur.transformDirection(e),this.setXYZ(t,Ur.x,Ur.y,Ur.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let n=this.array[e*this.itemSize+t];return this.normalized&&(n=ae(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=A(n,this.array)),this.array[e*this.itemSize+t]=n,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=ae(t,this.array)),t}setX(e,t){return this.normalized&&(t=A(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=ae(t,this.array)),t}setY(e,t){return this.normalized&&(t=A(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=ae(t,this.array)),t}setZ(e,t){return this.normalized&&(t=A(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=ae(t,this.array)),t}setW(e,t){return this.normalized&&(t=A(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=A(t,this.array),n=A(n,this.array)),this.array[e+0]=t,this.array[e+1]=n,this}setXYZ(e,t,n,r){return e*=this.itemSize,this.normalized&&(t=A(t,this.array),n=A(n,this.array),r=A(r,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this}setXYZW(e,t,n,r,i){return e*=this.itemSize,this.normalized&&(t=A(t,this.array),n=A(n,this.array),r=A(r,this.array),i=A(i,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this.array[e+3]=i,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){let e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==``&&(e.name=this.name),this.usage!==35044&&(e.usage=this.usage),e}dispose(){this.dispatchEvent({type:`dispose`})}},qr=class extends Kr{constructor(e,t,n){super(new Uint16Array(e),t,n)}},Jr=class extends Kr{constructor(e,t,n){super(new Uint32Array(e),t,n)}},Yr=class extends Kr{constructor(e,t,n){super(new Float32Array(e),t,n)}},Xr=new kr,Zr=new L,Qr=new L,$r=class{constructor(e=new L,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){let n=this.center;t===void 0?Xr.setFromPoints(e).getCenter(n):n.copy(t);let r=0;for(let t=0,i=e.length;t<i;t++)r=Math.max(r,n.distanceToSquared(e[t]));return this.radius=Math.sqrt(r),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){let t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){let n=this.center.distanceToSquared(e);return t.copy(e),n>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius*=e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;Zr.subVectors(e,this.center);let t=Zr.lengthSq();if(t>this.radius*this.radius){let e=Math.sqrt(t),n=(e-this.radius)*.5;this.center.addScaledVector(Zr,n/e),this.radius+=n}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(Qr.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Zr.copy(e.center).add(Qr)),this.expandByPoint(Zr.copy(e.center).sub(Qr))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(e){return this.radius=e.radius,this.center.fromArray(e.center),this}},ei=0,ti=new Nn,ni=new or,ri=new L,ii=new kr,ai=new kr,oi=new L,si=class e extends cn{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,\"id\",{value:ei++}),this.uuid=h(),this.name=``,this.type=`BufferGeometry`,this.index=null,this.indirect=null,this.indirectOffset=0,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={},this._transformed=!1}getIndex(){return this.index}setIndex(e){return this.index=Array.isArray(e)?new(a(e)?Jr:qr)(e,1):e,this}setIndirect(e,t=0){return this.indirect=e,this.indirectOffset=t,this}getIndirect(){return this.indirect}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,t,n=0){this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){let t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);let n=this.attributes.normal;if(n!==void 0){let t=new R().getNormalMatrix(e);n.applyNormalMatrix(t),n.needsUpdate=!0}let r=this.attributes.tangent;return r!==void 0&&(r.transformDirection(e),r.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this._transformed=!0,this}applyQuaternion(e){return ti.makeRotationFromQuaternion(e),this.applyMatrix4(ti),this}rotateX(e){return ti.makeRotationX(e),this.applyMatrix4(ti),this}rotateY(e){return ti.makeRotationY(e),this.applyMatrix4(ti),this}rotateZ(e){return ti.makeRotationZ(e),this.applyMatrix4(ti),this}translate(e,t,n){return ti.makeTranslation(e,t,n),this.applyMatrix4(ti),this}scale(e,t,n){return ti.makeScale(e,t,n),this.applyMatrix4(ti),this}lookAt(e){return ni.lookAt(e),ni.updateMatrix(),this.applyMatrix4(ni.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(ri).negate(),this.translate(ri.x,ri.y,ri.z),this}setFromPoints(e){let t=this.getAttribute(`position`);if(t===void 0){let t=[];for(let n=0,r=e.length;n<r;n++){let r=e[n];t.push(r.x,r.y,r.z||0)}this.setAttribute(`position`,new Yr(t,3))}else{let n=Math.min(e.length,t.count);for(let r=0;r<n;r++){let n=e[r];t.setXYZ(r,n.x,n.y,n.z||0)}e.length>t.count&&d(`BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry.`),t.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new kr);let e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){f(`BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.`,this),this.boundingBox.set(new L(-1/0,-1/0,-1/0),new L(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let e=0,n=t.length;e<n;e++){let n=t[e];ii.setFromBufferAttribute(n),this.morphTargetsRelative?(oi.addVectors(this.boundingBox.min,ii.min),this.boundingBox.expandByPoint(oi),oi.addVectors(this.boundingBox.max,ii.max),this.boundingBox.expandByPoint(oi)):(this.boundingBox.expandByPoint(ii.min),this.boundingBox.expandByPoint(ii.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&f(`BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The \"position\" attribute is likely to have NaN values.`,this)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new $r);let e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){f(`BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.`,this),this.boundingSphere.set(new L,1/0);return}if(e){let n=this.boundingSphere.center;if(ii.setFromBufferAttribute(e),t)for(let e=0,n=t.length;e<n;e++){let n=t[e];ai.setFromBufferAttribute(n),this.morphTargetsRelative?(oi.addVectors(ii.min,ai.min),ii.expandByPoint(oi),oi.addVectors(ii.max,ai.max),ii.expandByPoint(oi)):(ii.expandByPoint(ai.min),ii.expandByPoint(ai.max))}ii.getCenter(n);let r=0;for(let t=0,i=e.count;t<i;t++)oi.fromBufferAttribute(e,t),r=Math.max(r,n.distanceToSquared(oi));if(t)for(let i=0,a=t.length;i<a;i++){let a=t[i],o=this.morphTargetsRelative;for(let t=0,i=a.count;t<i;t++)oi.fromBufferAttribute(a,t),o&&(ri.fromBufferAttribute(e,t),oi.add(ri)),r=Math.max(r,n.distanceToSquared(oi))}this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&f(`BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The \"position\" attribute is likely to have NaN values.`,this)}}computeTangents(){let e=this.index,t=this.attributes;if(e===null||t.position===void 0||t.normal===void 0||t.uv===void 0){f(`BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)`);return}let n=t.position,r=t.normal,i=t.uv,a=this.getAttribute(`tangent`);(a===void 0||a.count!==n.count)&&(a=new Kr(new Float32Array(4*n.count),4),this.setAttribute(`tangent`,a));let o=[],s=[];for(let e=0;e<n.count;e++)o[e]=new L,s[e]=new L;let c=new L,l=new L,u=new L,d=new I,p=new I,m=new I,h=new L,g=new L;function _(e,t,r){c.fromBufferAttribute(n,e),l.fromBufferAttribute(n,t),u.fromBufferAttribute(n,r),d.fromBufferAttribute(i,e),p.fromBufferAttribute(i,t),m.fromBufferAttribute(i,r),l.sub(c),u.sub(c),p.sub(d),m.sub(d);let a=1/(p.x*m.y-m.x*p.y);isFinite(a)&&(h.copy(l).multiplyScalar(m.y).addScaledVector(u,-p.y).multiplyScalar(a),g.copy(u).multiplyScalar(p.x).addScaledVector(l,-m.x).multiplyScalar(a),o[e].add(h),o[t].add(h),o[r].add(h),s[e].add(g),s[t].add(g),s[r].add(g))}let v=this.groups;v.length===0&&(v=[{start:0,count:e.count}]);for(let t=0,n=v.length;t<n;++t){let n=v[t],r=n.start,i=n.count;for(let t=r,n=r+i;t<n;t+=3)_(e.getX(t+0),e.getX(t+1),e.getX(t+2))}let y=new L,b=new L,x=new L,S=new L;function C(e){x.fromBufferAttribute(r,e),S.copy(x);let t=o[e];y.copy(t),y.sub(x.multiplyScalar(x.dot(t))).normalize(),b.crossVectors(S,t);let n=b.dot(s[e])<0?-1:1;a.setXYZW(e,y.x,y.y,y.z,n)}for(let t=0,n=v.length;t<n;++t){let n=v[t],r=n.start,i=n.count;for(let t=r,n=r+i;t<n;t+=3)C(e.getX(t+0)),C(e.getX(t+1)),C(e.getX(t+2))}this._transformed=!0}computeVertexNormals(){let e=this.index,t=this.getAttribute(`position`);if(t!==void 0){let n=this.getAttribute(`normal`);if(n===void 0||n.count!==t.count)n=new Kr(new Float32Array(t.count*3),3),this.setAttribute(`normal`,n);else for(let e=0,t=n.count;e<t;e++)n.setXYZ(e,0,0,0);let r=new L,i=new L,a=new L,o=new L,s=new L,c=new L,l=new L,u=new L;if(e)for(let d=0,f=e.count;d<f;d+=3){let f=e.getX(d+0),p=e.getX(d+1),m=e.getX(d+2);r.fromBufferAttribute(t,f),i.fromBufferAttribute(t,p),a.fromBufferAttribute(t,m),l.subVectors(a,i),u.subVectors(r,i),l.cross(u),o.fromBufferAttribute(n,f),s.fromBufferAttribute(n,p),c.fromBufferAttribute(n,m),o.add(l),s.add(l),c.add(l),n.setXYZ(f,o.x,o.y,o.z),n.setXYZ(p,s.x,s.y,s.z),n.setXYZ(m,c.x,c.y,c.z)}else for(let e=0,o=t.count;e<o;e+=3)r.fromBufferAttribute(t,e+0),i.fromBufferAttribute(t,e+1),a.fromBufferAttribute(t,e+2),l.subVectors(a,i),u.subVectors(r,i),l.cross(u),n.setXYZ(e+0,l.x,l.y,l.z),n.setXYZ(e+1,l.x,l.y,l.z),n.setXYZ(e+2,l.x,l.y,l.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){let e=this.attributes.normal;for(let t=0,n=e.count;t<n;t++)oi.fromBufferAttribute(e,t),oi.normalize(),e.setXYZ(t,oi.x,oi.y,oi.z)}toNonIndexed(){function t(e,t){let n=e.array,r=e.itemSize,i=e.normalized,a=new n.constructor(t.length*r),o=0,s=0;for(let i=0,c=t.length;i<c;i++){o=e.isInterleavedBufferAttribute?t[i]*e.data.stride+e.offset:t[i]*r;for(let e=0;e<r;e++)a[s++]=n[o++]}return new Kr(a,r,i)}if(this.index===null)return d(`BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed.`),this;let n=new e,r=this.index.array,i=this.attributes;for(let e in i){let a=i[e],o=t(a,r);n.setAttribute(e,o)}let a=this.morphAttributes;for(let e in a){let i=[],o=a[e];for(let e=0,n=o.length;e<n;e++){let n=o[e],a=t(n,r);i.push(a)}n.morphAttributes[e]=i}n.morphTargetsRelative=this.morphTargetsRelative;let o=this.groups;for(let e=0,t=o.length;e<t;e++){let t=o[e];n.addGroup(t.start,t.count,t.materialIndex)}return n}toJSON(){let e={metadata:{version:4.7,type:`BufferGeometry`,generator:`BufferGeometry.toJSON`}};if(e.uuid=this.uuid,e.type=this.parameters!==void 0&&this._transformed===!0?`BufferGeometry`:this.type,this.name!==``&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),this.parameters!==void 0&&this._transformed!==!0){let t=this.parameters;for(let n in t)t[n]!==void 0&&(e[n]=t[n]);return e}e.data={attributes:{}};let t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});let n=this.attributes;for(let t in n){let r=n[t];e.data.attributes[t]=r.toJSON(e.data)}let r={},i=!1;for(let t in this.morphAttributes){let n=this.morphAttributes[t],a=[];for(let t=0,r=n.length;t<r;t++){let r=n[t];a.push(r.toJSON(e.data))}a.length>0&&(r[t]=a,i=!0)}i&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);let a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));let o=this.boundingSphere;return o!==null&&(e.data.boundingSphere=o.toJSON()),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let t={};this.name=e.name;let n=e.index;n!==null&&this.setIndex(n.clone());let r=e.attributes;for(let e in r){let n=r[e];this.setAttribute(e,n.clone(t))}let i=e.morphAttributes;for(let e in i){let n=[],r=i[e];for(let e=0,i=r.length;e<i;e++)n.push(r[e].clone(t));this.morphAttributes[e]=n}this.morphTargetsRelative=e.morphTargetsRelative;let a=e.groups;for(let e=0,t=a.length;e<t;e++){let t=a[e];this.addGroup(t.start,t.count,t.materialIndex)}let o=e.boundingBox;o!==null&&(this.boundingBox=o.clone());let s=e.boundingSphere;return s!==null&&(this.boundingSphere=s.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this._transformed=e._transformed,this}dispose(){this.dispatchEvent({type:`dispose`})}},ci=class{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e===void 0?0:e.length/t,this.usage=nn,this.updateRanges=[],this.version=0,this.uuid=h()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let r=0,i=this.stride;r<i;r++)this.array[e+r]=t.array[n+r];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=h()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);let t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),n=new this.constructor(t,this.stride);return n.setUsage(this.usage),n}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=h()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}},li=new L,ui=class e{constructor(e,t,n,r=!1){this.isInterleavedBufferAttribute=!0,this.name=``,this.data=e,this.itemSize=t,this.offset=n,this.normalized=r}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,n=this.data.count;t<n;t++)li.fromBufferAttribute(this,t),li.applyMatrix4(e),this.setXYZ(t,li.x,li.y,li.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)li.fromBufferAttribute(this,t),li.applyNormalMatrix(e),this.setXYZ(t,li.x,li.y,li.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)li.fromBufferAttribute(this,t),li.transformDirection(e),this.setXYZ(t,li.x,li.y,li.z);return this}getComponent(e,t){let n=this.array[e*this.data.stride+this.offset+t];return this.normalized&&(n=ae(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=A(n,this.array)),this.data.array[e*this.data.stride+this.offset+t]=n,this}setX(e,t){return this.normalized&&(t=A(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=A(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=A(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=A(t,this.array)),this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){let t=this.data.array[e*this.data.stride+this.offset];return this.normalized&&(t=ae(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=ae(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=ae(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=ae(t,this.array)),t}setXY(e,t,n){return e=e*this.data.stride+this.offset,this.normalized&&(t=A(t,this.array),n=A(n,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this}setXYZ(e,t,n,r){return e=e*this.data.stride+this.offset,this.normalized&&(t=A(t,this.array),n=A(n,this.array),r=A(r,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=r,this}setXYZW(e,t,n,r,i){return e=e*this.data.stride+this.offset,this.normalized&&(t=A(t,this.array),n=A(n,this.array),r=A(r,this.array),i=A(i,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=r,this.data.array[e+3]=i,this}clone(t){if(t===void 0){l(`InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.`);let e=[];for(let t=0;t<this.count;t++){let n=t*this.data.stride+this.offset;for(let t=0;t<this.itemSize;t++)e.push(this.data.array[n+t])}return new Kr(new this.array.constructor(e),this.itemSize,this.normalized)}return t.interleavedBuffers===void 0&&(t.interleavedBuffers={}),t.interleavedBuffers[this.data.uuid]===void 0&&(t.interleavedBuffers[this.data.uuid]=this.data.clone(t)),new e(t.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(e===void 0){l(`InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.`);let e=[];for(let t=0;t<this.count;t++){let n=t*this.data.stride+this.offset;for(let t=0;t<this.itemSize;t++)e.push(this.data.array[n+t])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:e,normalized:this.normalized}}return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}},di=0,fi=class extends cn{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,\"id\",{value:di++}),this.uuid=h(),this.name=``,this.type=`Material`,this.blending=1,this.side=0,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=204,this.blendDst=205,this.blendEquation=100,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new z(0,0,0),this.blendAlpha=0,this.depthFunc=3,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=tn,this.stencilZFail=tn,this.stencilZPass=tn,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.allowOverride=!0,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(let t in e){let n=e[t];if(n===void 0){d(`Material: parameter '${t}' has value of undefined.`);continue}let r=this[t];if(r===void 0){d(`Material: '${t}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(n):r&&r.isVector2&&n&&n.isVector2||r&&r.isEuler&&n&&n.isEuler||r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[t]=n}}toJSON(e){let t=e===void 0||typeof e==`string`;t&&(e={textures:{},images:{}});let n={metadata:{version:4.7,type:`Material`,generator:`Material.toJSON`}};n.uuid=this.uuid,n.type=this.type,this.name!==``&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen!==void 0&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(n.sheenColorMap=this.sheenColorMap.toJSON(e).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(n.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(e).uuid),this.dispersion!==void 0&&(n.dispersion=this.dispersion),this.iridescence!==void 0&&(n.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(n.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(n.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapRotation!==void 0&&(n.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(n.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==1&&(n.blending=this.blending),this.side!==0&&(n.side=this.side),this.vertexColors===!0&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=!0),this.blendSrc!==204&&(n.blendSrc=this.blendSrc),this.blendDst!==205&&(n.blendDst=this.blendDst),this.blendEquation!==100&&(n.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(n.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(n.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(n.blendAlpha=this.blendAlpha),this.depthFunc!==3&&(n.depthFunc=this.depthFunc),this.depthTest===!1&&(n.depthTest=this.depthTest),this.depthWrite===!1&&(n.depthWrite=this.depthWrite),this.colorWrite===!1&&(n.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(n.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==519&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==7680&&(n.stencilFail=this.stencilFail),this.stencilZFail!==7680&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==7680&&(n.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(n.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaHash===!0&&(n.alphaHash=!0),this.alphaToCoverage===!0&&(n.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=!0),this.forceSinglePass===!0&&(n.forceSinglePass=!0),this.allowOverride===!1&&(n.allowOverride=!1),this.wireframe===!0&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!==`round`&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!==`round`&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=!0),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),this.fog===!1&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData);function r(e){let t=[];for(let n in e){let r=e[n];delete r.metadata,t.push(r)}return t}if(t){let t=r(e.textures),i=r(e.images);t.length>0&&(n.textures=t),i.length>0&&(n.images=i)}return n}fromJSON(e,t){if(e.uuid!==void 0&&(this.uuid=e.uuid),e.name!==void 0&&(this.name=e.name),e.color!==void 0&&this.color!==void 0&&this.color.setHex(e.color),e.roughness!==void 0&&(this.roughness=e.roughness),e.metalness!==void 0&&(this.metalness=e.metalness),e.sheen!==void 0&&(this.sheen=e.sheen),e.sheenColor!==void 0&&(this.sheenColor=new z().setHex(e.sheenColor)),e.sheenRoughness!==void 0&&(this.sheenRoughness=e.sheenRoughness),e.emissive!==void 0&&this.emissive!==void 0&&this.emissive.setHex(e.emissive),e.specular!==void 0&&this.specular!==void 0&&this.specular.setHex(e.specular),e.specularIntensity!==void 0&&(this.specularIntensity=e.specularIntensity),e.specularColor!==void 0&&this.specularColor!==void 0&&this.specularColor.setHex(e.specularColor),e.shininess!==void 0&&(this.shininess=e.shininess),e.clearcoat!==void 0&&(this.clearcoat=e.clearcoat),e.clearcoatRoughness!==void 0&&(this.clearcoatRoughness=e.clearcoatRoughness),e.dispersion!==void 0&&(this.dispersion=e.dispersion),e.iridescence!==void 0&&(this.iridescence=e.iridescence),e.iridescenceIOR!==void 0&&(this.iridescenceIOR=e.iridescenceIOR),e.iridescenceThicknessRange!==void 0&&(this.iridescenceThicknessRange=e.iridescenceThicknessRange),e.transmission!==void 0&&(this.transmission=e.transmission),e.thickness!==void 0&&(this.thickness=e.thickness),e.attenuationDistance!==void 0&&(this.attenuationDistance=e.attenuationDistance),e.attenuationColor!==void 0&&this.attenuationColor!==void 0&&this.attenuationColor.setHex(e.attenuationColor),e.anisotropy!==void 0&&(this.anisotropy=e.anisotropy),e.anisotropyRotation!==void 0&&(this.anisotropyRotation=e.anisotropyRotation),e.fog!==void 0&&(this.fog=e.fog),e.flatShading!==void 0&&(this.flatShading=e.flatShading),e.blending!==void 0&&(this.blending=e.blending),e.combine!==void 0&&(this.combine=e.combine),e.side!==void 0&&(this.side=e.side),e.shadowSide!==void 0&&(this.shadowSide=e.shadowSide),e.opacity!==void 0&&(this.opacity=e.opacity),e.transparent!==void 0&&(this.transparent=e.transparent),e.alphaTest!==void 0&&(this.alphaTest=e.alphaTest),e.alphaHash!==void 0&&(this.alphaHash=e.alphaHash),e.depthFunc!==void 0&&(this.depthFunc=e.depthFunc),e.depthTest!==void 0&&(this.depthTest=e.depthTest),e.depthWrite!==void 0&&(this.depthWrite=e.depthWrite),e.colorWrite!==void 0&&(this.colorWrite=e.colorWrite),e.blendSrc!==void 0&&(this.blendSrc=e.blendSrc),e.blendDst!==void 0&&(this.blendDst=e.blendDst),e.blendEquation!==void 0&&(this.blendEquation=e.blendEquation),e.blendSrcAlpha!==void 0&&(this.blendSrcAlpha=e.blendSrcAlpha),e.blendDstAlpha!==void 0&&(this.blendDstAlpha=e.blendDstAlpha),e.blendEquationAlpha!==void 0&&(this.blendEquationAlpha=e.blendEquationAlpha),e.blendColor!==void 0&&this.blendColor!==void 0&&this.blendColor.setHex(e.blendColor),e.blendAlpha!==void 0&&(this.blendAlpha=e.blendAlpha),e.stencilWriteMask!==void 0&&(this.stencilWriteMask=e.stencilWriteMask),e.stencilFunc!==void 0&&(this.stencilFunc=e.stencilFunc),e.stencilRef!==void 0&&(this.stencilRef=e.stencilRef),e.stencilFuncMask!==void 0&&(this.stencilFuncMask=e.stencilFuncMask),e.stencilFail!==void 0&&(this.stencilFail=e.stencilFail),e.stencilZFail!==void 0&&(this.stencilZFail=e.stencilZFail),e.stencilZPass!==void 0&&(this.stencilZPass=e.stencilZPass),e.stencilWrite!==void 0&&(this.stencilWrite=e.stencilWrite),e.wireframe!==void 0&&(this.wireframe=e.wireframe),e.wireframeLinewidth!==void 0&&(this.wireframeLinewidth=e.wireframeLinewidth),e.wireframeLinecap!==void 0&&(this.wireframeLinecap=e.wireframeLinecap),e.wireframeLinejoin!==void 0&&(this.wireframeLinejoin=e.wireframeLinejoin),e.rotation!==void 0&&(this.rotation=e.rotation),e.linewidth!==void 0&&(this.linewidth=e.linewidth),e.dashSize!==void 0&&(this.dashSize=e.dashSize),e.gapSize!==void 0&&(this.gapSize=e.gapSize),e.scale!==void 0&&(this.scale=e.scale),e.polygonOffset!==void 0&&(this.polygonOffset=e.polygonOffset),e.polygonOffsetFactor!==void 0&&(this.polygonOffsetFactor=e.polygonOffsetFactor),e.polygonOffsetUnits!==void 0&&(this.polygonOffsetUnits=e.polygonOffsetUnits),e.dithering!==void 0&&(this.dithering=e.dithering),e.alphaToCoverage!==void 0&&(this.alphaToCoverage=e.alphaToCoverage),e.premultipliedAlpha!==void 0&&(this.premultipliedAlpha=e.premultipliedAlpha),e.forceSinglePass!==void 0&&(this.forceSinglePass=e.forceSinglePass),e.allowOverride!==void 0&&(this.allowOverride=e.allowOverride),e.visible!==void 0&&(this.visible=e.visible),e.toneMapped!==void 0&&(this.toneMapped=e.toneMapped),e.userData!==void 0&&(this.userData=e.userData),e.vertexColors!==void 0&&(this.vertexColors=typeof e.vertexColors==`number`?e.vertexColors>0:e.vertexColors),e.size!==void 0&&(this.size=e.size),e.sizeAttenuation!==void 0&&(this.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(this.map=t[e.map]||null),e.matcap!==void 0&&(this.matcap=t[e.matcap]||null),e.alphaMap!==void 0&&(this.alphaMap=t[e.alphaMap]||null),e.bumpMap!==void 0&&(this.bumpMap=t[e.bumpMap]||null),e.bumpScale!==void 0&&(this.bumpScale=e.bumpScale),e.normalMap!==void 0&&(this.normalMap=t[e.normalMap]||null),e.normalMapType!==void 0&&(this.normalMapType=e.normalMapType),e.normalScale!==void 0){let t=e.normalScale;Array.isArray(t)===!1&&(t=[t,t]),this.normalScale=new I().fromArray(t)}return e.displacementMap!==void 0&&(this.displacementMap=t[e.displacementMap]||null),e.displacementScale!==void 0&&(this.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(this.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(this.roughnessMap=t[e.roughnessMap]||null),e.metalnessMap!==void 0&&(this.metalnessMap=t[e.metalnessMap]||null),e.emissiveMap!==void 0&&(this.emissiveMap=t[e.emissiveMap]||null),e.emissiveIntensity!==void 0&&(this.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(this.specularMap=t[e.specularMap]||null),e.specularIntensityMap!==void 0&&(this.specularIntensityMap=t[e.specularIntensityMap]||null),e.specularColorMap!==void 0&&(this.specularColorMap=t[e.specularColorMap]||null),e.envMap!==void 0&&(this.envMap=t[e.envMap]||null),e.envMapRotation!==void 0&&this.envMapRotation.fromArray(e.envMapRotation),e.envMapIntensity!==void 0&&(this.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(this.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(this.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(this.lightMap=t[e.lightMap]||null),e.lightMapIntensity!==void 0&&(this.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(this.aoMap=t[e.aoMap]||null),e.aoMapIntensity!==void 0&&(this.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(this.gradientMap=t[e.gradientMap]||null),e.clearcoatMap!==void 0&&(this.clearcoatMap=t[e.clearcoatMap]||null),e.clearcoatRoughnessMap!==void 0&&(this.clearcoatRoughnessMap=t[e.clearcoatRoughnessMap]||null),e.clearcoatNormalMap!==void 0&&(this.clearcoatNormalMap=t[e.clearcoatNormalMap]||null),e.clearcoatNormalScale!==void 0&&(this.clearcoatNormalScale=new I().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(this.iridescenceMap=t[e.iridescenceMap]||null),e.iridescenceThicknessMap!==void 0&&(this.iridescenceThicknessMap=t[e.iridescenceThicknessMap]||null),e.transmissionMap!==void 0&&(this.transmissionMap=t[e.transmissionMap]||null),e.thicknessMap!==void 0&&(this.thicknessMap=t[e.thicknessMap]||null),e.anisotropyMap!==void 0&&(this.anisotropyMap=t[e.anisotropyMap]||null),e.sheenColorMap!==void 0&&(this.sheenColorMap=t[e.sheenColorMap]||null),e.sheenRoughnessMap!==void 0&&(this.sheenRoughnessMap=t[e.sheenRoughnessMap]||null),this}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;let t=e.clippingPlanes,n=null;if(t!==null){let e=t.length;n=Array(e);for(let r=0;r!==e;++r)n[r]=t[r].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.allowOverride=e.allowOverride,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:`dispose`})}set needsUpdate(e){e===!0&&this.version++}},pi=new L,mi=new L,hi=new L,gi=new L,_i=new L,vi=new L,yi=new L,bi=class{constructor(e=new L,t=new L(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,pi)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);let n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){let t=pi.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(pi.copy(this.origin).addScaledVector(this.direction,t),pi.distanceToSquared(e))}distanceSqToSegment(e,t,n,r){mi.copy(e).add(t).multiplyScalar(.5),hi.copy(t).sub(e).normalize(),gi.copy(this.origin).sub(mi);let i=e.distanceTo(t)*.5,a=-this.direction.dot(hi),o=gi.dot(this.direction),s=-gi.dot(hi),c=gi.lengthSq(),l=Math.abs(1-a*a),u,d,f,p;if(l>0){if(u=a*s-o,d=a*o-s,p=i*l,u>=0){if(d>=-p){if(d<=p){let e=1/l;u*=e,d*=e,f=u*(u+a*d+2*o)+d*(a*u+d+2*s)+c}else d=i,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*s)+c}else d=-i,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*s)+c}else d<=-p?(u=Math.max(0,-(-a*i+o)),d=u>0?-i:Math.min(Math.max(-i,-s),i),f=-u*u+d*(d+2*s)+c):d<=p?(u=0,d=Math.min(Math.max(-i,-s),i),f=d*(d+2*s)+c):(u=Math.max(0,-(a*i+o)),d=u>0?i:Math.min(Math.max(-i,-s),i),f=-u*u+d*(d+2*s)+c)}else d=a>0?-i:i,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*s)+c;return n&&n.copy(this.origin).addScaledVector(this.direction,u),r&&r.copy(mi).addScaledVector(hi,d),f}intersectSphere(e,t){pi.subVectors(e.center,this.origin);let n=pi.dot(this.direction),r=pi.dot(pi)-n*n,i=e.radius*e.radius;if(r>i)return null;let a=Math.sqrt(i-r),o=n-a,s=n+a;return s<0?null:o<0?this.at(s,t):this.at(o,t)}intersectsSphere(e){return e.radius<0?!1:this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){let t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;let n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){let n=this.distanceToPlane(e);return n===null?null:this.at(n,t)}intersectsPlane(e){let t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,r,i,a,o,s,c=1/this.direction.x,l=1/this.direction.y,u=1/this.direction.z,d=this.origin;return c>=0?(n=(e.min.x-d.x)*c,r=(e.max.x-d.x)*c):(n=(e.max.x-d.x)*c,r=(e.min.x-d.x)*c),l>=0?(i=(e.min.y-d.y)*l,a=(e.max.y-d.y)*l):(i=(e.max.y-d.y)*l,a=(e.min.y-d.y)*l),n>a||i>r||((i>n||isNaN(n))&&(n=i),(a<r||isNaN(r))&&(r=a),u>=0?(o=(e.min.z-d.z)*u,s=(e.max.z-d.z)*u):(o=(e.max.z-d.z)*u,s=(e.min.z-d.z)*u),n>s||o>r)||((o>n||n!==n)&&(n=o),(s<r||r!==r)&&(r=s),r<0)?null:this.at(n>=0?n:r,t)}intersectsBox(e){return this.intersectBox(e,pi)!==null}intersectTriangle(e,t,n,r,i){_i.subVectors(t,e),vi.subVectors(n,e),yi.crossVectors(_i,vi);let a=this.direction.dot(yi),o;if(a>0){if(r)return null;o=1}else if(a<0)o=-1,a=-a;else return null;gi.subVectors(this.origin,e);let s=o*this.direction.dot(vi.crossVectors(gi,vi));if(s<0)return null;let c=o*this.direction.dot(_i.cross(gi));if(c<0||s+c>a)return null;let l=-o*gi.dot(yi);return l<0?null:this.at(l/a,i)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}},xi=class extends fi{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type=`MeshBasicMaterial`,this.color=new z(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Un,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap=`round`,this.wireframeLinejoin=`round`,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}},Si=new Nn,Ci=new bi,wi=new $r,Ti=new L,Ei=new L,Di=new L,Oi=new L,ki=new L,Ai=new L,ji=new L,Mi=new L,Ni=class extends or{constructor(e=new si,t=new xi){super(),this.isMesh=!0,this.type=`Mesh`,this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.count=1,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){let e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){let n=e[t[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e<t;e++){let t=n[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}getVertexPosition(e,t){let n=this.geometry,r=n.attributes.position,i=n.morphAttributes.position,a=n.morphTargetsRelative;t.fromBufferAttribute(r,e);let o=this.morphTargetInfluences;if(i&&o){Ai.set(0,0,0);for(let n=0,r=i.length;n<r;n++){let r=o[n],s=i[n];r!==0&&(ki.fromBufferAttribute(s,e),a?Ai.addScaledVector(ki,r):Ai.addScaledVector(ki.sub(t),r))}t.add(Ai)}return t}raycast(e,t){let n=this.geometry,r=this.material,i=this.matrixWorld;r!==void 0&&(n.boundingSphere===null&&n.computeBoundingSphere(),wi.copy(n.boundingSphere),wi.applyMatrix4(i),Ci.copy(e.ray).recast(e.near),!(wi.containsPoint(Ci.origin)===!1&&(Ci.intersectSphere(wi,Ti)===null||Ci.origin.distanceToSquared(Ti)>(e.far-e.near)**2))&&(Si.copy(i).invert(),Ci.copy(e.ray).applyMatrix4(Si),(n.boundingBox===null||Ci.intersectsBox(n.boundingBox)!==!1)&&this._computeIntersections(e,t,Ci)))}_computeIntersections(e,t,n){let r,i=this.geometry,a=this.material,o=i.index,s=i.attributes.position,c=i.attributes.uv,l=i.attributes.uv1,u=i.attributes.normal,d=i.groups,f=i.drawRange;if(o!==null){if(Array.isArray(a))for(let i=0,s=d.length;i<s;i++){let s=d[i],p=a[s.materialIndex],m=Math.max(s.start,f.start),h=Math.min(o.count,Math.min(s.start+s.count,f.start+f.count));for(let i=m,a=h;i<a;i+=3){let a=o.getX(i),d=o.getX(i+1),f=o.getX(i+2);r=fe(this,p,e,n,c,l,u,a,d,f),r&&(r.faceIndex=Math.floor(i/3),r.face.materialIndex=s.materialIndex,t.push(r))}}else{let i=Math.max(0,f.start),s=Math.min(o.count,f.start+f.count);for(let d=i,f=s;d<f;d+=3){let i=o.getX(d),s=o.getX(d+1),f=o.getX(d+2);r=fe(this,a,e,n,c,l,u,i,s,f),r&&(r.faceIndex=Math.floor(d/3),t.push(r))}}}else if(s!==void 0){if(Array.isArray(a))for(let i=0,o=d.length;i<o;i++){let o=d[i],p=a[o.materialIndex],m=Math.max(o.start,f.start),h=Math.min(s.count,Math.min(o.start+o.count,f.start+f.count));for(let i=m,a=h;i<a;i+=3){let a=i,s=i+1,d=i+2;r=fe(this,p,e,n,c,l,u,a,s,d),r&&(r.faceIndex=Math.floor(i/3),r.face.materialIndex=o.materialIndex,t.push(r))}}else{let i=Math.max(0,f.start),o=Math.min(s.count,f.start+f.count);for(let s=i,d=o;s<d;s+=3){let i=s,o=s+1,d=s+2;r=fe(this,a,e,n,c,l,u,i,o,d),r&&(r.faceIndex=Math.floor(s/3),t.push(r))}}}}},Pi=new On,Fi=new On,Ii=new On,Li=new On,Ri=new Nn,zi=new L,Bi=new $r,Vi=new Nn,Hi=new bi,Ui=class extends Ni{constructor(e,t){super(e,t),this.isSkinnedMesh=!0,this.type=`SkinnedMesh`,this.bindMode=M,this.bindMatrix=new Nn,this.bindMatrixInverse=new Nn,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){let e=this.geometry;this.boundingBox===null&&(this.boundingBox=new kr),this.boundingBox.makeEmpty();let t=e.getAttribute(`position`);for(let e=0;e<t.count;e++)this.getVertexPosition(e,zi),this.boundingBox.expandByPoint(zi)}computeBoundingSphere(){let e=this.geometry;this.boundingSphere===null&&(this.boundingSphere=new $r),this.boundingSphere.makeEmpty();let t=e.getAttribute(`position`);for(let e=0;e<t.count;e++)this.getVertexPosition(e,zi),this.boundingSphere.expandByPoint(zi)}copy(e,t){return super.copy(e,t),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}raycast(e,t){let n=this.material,r=this.matrixWorld;n!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),Bi.copy(this.boundingSphere),Bi.applyMatrix4(r),e.ray.intersectsSphere(Bi)!==!1&&(Vi.copy(r).invert(),Hi.copy(e.ray).applyMatrix4(Vi),(this.boundingBox===null||Hi.intersectsBox(this.boundingBox)!==!1)&&this._computeIntersections(e,t,Hi)))}getVertexPosition(e,t){return super.getVertexPosition(e,t),this.applyBoneTransform(e,t),t}bind(e,t){this.skeleton=e,t===void 0&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){let e=new On,t=this.geometry.attributes.skinWeight;for(let n=0,r=t.count;n<r;n++){e.fromBufferAttribute(t,n);let r=1/e.manhattanLength();r===1/0?e.set(1,0,0,0):e.multiplyScalar(r),t.setXYZW(n,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.bindMode===`attached`?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode===`detached`?this.bindMatrixInverse.copy(this.bindMatrix).invert():d(`SkinnedMesh: Unrecognized bindMode: `+this.bindMode)}applyBoneTransform(e,t){let n=this.skeleton,r=this.geometry;Fi.fromBufferAttribute(r.attributes.skinIndex,e),Ii.fromBufferAttribute(r.attributes.skinWeight,e),t.isVector4?(Pi.copy(t),t.set(0,0,0,0)):(Pi.set(...t,1),t.set(0,0,0)),Pi.applyMatrix4(this.bindMatrix);for(let e=0;e<4;e++){let r=Ii.getComponent(e);if(r!==0){let i=Fi.getComponent(e);Ri.multiplyMatrices(n.bones[i].matrixWorld,n.boneInverses[i]),t.addScaledVector(Li.copy(Pi).applyMatrix4(Ri),r)}}return t.isVector4&&(t.w=Pi.w),t.applyMatrix4(this.bindMatrixInverse)}},Wi=class extends or{constructor(){super(),this.isBone=!0,this.type=`Bone`}},Gi=class extends Dn{constructor(e=null,t=1,n=1,r,i,a,o,s,c=N,l=N,u,d){super(null,a,o,s,c,l,r,i,u,d),this.isDataTexture=!0,this.image={data:e,width:t,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}},Ki=new Nn,qi=new Nn,Ji=class e{constructor(e=[],t=[]){this.uuid=h(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.boneTexture=null,this.init()}init(){let e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(e.length*16),t.length===0)this.calculateInverses();else if(e.length!==t.length){d(`Skeleton: Number of inverse bone matrices does not match amount of bones.`),this.boneInverses=[];for(let e=0,t=this.bones.length;e<t;e++)this.boneInverses.push(new Nn)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){let t=new Nn;this.bones[e]&&t.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(t)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){let t=this.bones[e];t&&t.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){let t=this.bones[e];t&&(t.parent&&t.parent.isBone?(t.matrix.copy(t.parent.matrixWorld).invert(),t.matrix.multiply(t.matrixWorld)):t.matrix.copy(t.matrixWorld),t.matrix.decompose(t.position,t.quaternion,t.scale))}}update(){let e=this.bones,t=this.boneInverses,n=this.boneMatrices,r=this.boneTexture;for(let r=0,i=e.length;r<i;r++){let i=e[r]?e[r].matrixWorld:qi;Ki.multiplyMatrices(i,t[r]),Ki.toArray(n,r*16)}r!==null&&(r.needsUpdate=!0)}clone(){return new e(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(this.bones.length*4);e=Math.ceil(e/4)*4,e=Math.max(e,4);let t=new Float32Array(e*e*4);t.set(this.boneMatrices);let n=new Gi(t,e,e,Qe,Ue);return n.needsUpdate=!0,this.boneMatrices=t,this.boneTexture=n,this}getBoneByName(e){for(let t=0,n=this.bones.length;t<n;t++){let n=this.bones[t];if(n.name===e)return n}}dispose(){this.boneTexture!==null&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;for(let n=0,r=e.bones.length;n<r;n++){let r=e.bones[n],i=t[r];i===void 0&&(d(`Skeleton: No bone found with UUID:`,r),i=new Wi),this.bones.push(i),this.boneInverses.push(new Nn().fromArray(e.boneInverses[n]))}return this.init(),this}toJSON(){let e={metadata:{version:4.7,type:`Skeleton`,generator:`Skeleton.toJSON`},bones:[],boneInverses:[]};e.uuid=this.uuid;let t=this.bones,n=this.boneInverses;for(let r=0,i=t.length;r<i;r++){let i=t[r];e.bones.push(i.uuid);let a=n[r];e.boneInverses.push(a.toArray())}return e}},Yi=class extends Kr{constructor(e,t,n,r=1){super(e,t,n),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=r}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){let e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}},Xi=new Nn,Zi=new Nn,Qi=[],$i=new kr,ea=new Nn,ta=new Ni,na=new $r,ra=class extends Ni{constructor(e,t,n){super(e,t),this.isInstancedMesh=!0,this.instanceMatrix=new Yi(new Float32Array(n*16),16),this.instanceColor=null,this.morphTexture=null,this.count=n,this.boundingBox=null,this.boundingSphere=null;for(let e=0;e<n;e++)this.setMatrixAt(e,ea)}computeBoundingBox(){let e=this.geometry,t=this.count;this.boundingBox===null&&(this.boundingBox=new kr),e.boundingBox===null&&e.computeBoundingBox(),this.boundingBox.makeEmpty();for(let n=0;n<t;n++)this.getMatrixAt(n,Xi),$i.copy(e.boundingBox).applyMatrix4(Xi),this.boundingBox.union($i)}computeBoundingSphere(){let e=this.geometry,t=this.count;this.boundingSphere===null&&(this.boundingSphere=new $r),e.boundingSphere===null&&e.computeBoundingSphere(),this.boundingSphere.makeEmpty();for(let n=0;n<t;n++)this.getMatrixAt(n,Xi),na.copy(e.boundingSphere).applyMatrix4(Xi),this.boundingSphere.union(na)}copy(e,t){return super.copy(e,t),this.instanceMatrix.copy(e.instanceMatrix),e.morphTexture!==null&&(this.morphTexture=e.morphTexture.clone()),e.instanceColor!==null&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}getColorAt(e,t){return this.instanceColor===null?t.setRGB(1,1,1):t.fromArray(this.instanceColor.array,e*3)}getMatrixAt(e,t){return t.fromArray(this.instanceMatrix.array,e*16)}getMorphAt(e,t){let n=t.morphTargetInfluences,r=this.morphTexture.source.data.data,i=e*(n.length+1)+1;for(let e=0;e<n.length;e++)n[e]=r[i+e]}raycast(e,t){let n=this.matrixWorld,r=this.count;if(ta.geometry=this.geometry,ta.material=this.material,ta.material!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),na.copy(this.boundingSphere),na.applyMatrix4(n),e.ray.intersectsSphere(na)!==!1))for(let i=0;i<r;i++){this.getMatrixAt(i,Xi),Zi.multiplyMatrices(n,Xi),ta.matrixWorld=Zi,ta.raycast(e,Qi);for(let e=0,n=Qi.length;e<n;e++){let n=Qi[e];n.instanceId=i,n.object=this,t.push(n)}Qi.length=0}}setColorAt(e,t){return this.instanceColor===null&&(this.instanceColor=new Yi(new Float32Array(this.instanceMatrix.count*3).fill(1),3)),t.toArray(this.instanceColor.array,e*3),this}setMatrixAt(e,t){return t.toArray(this.instanceMatrix.array,e*16),this}setMorphAt(e,t){let n=t.morphTargetInfluences,r=n.length+1;this.morphTexture===null&&(this.morphTexture=new Gi(new Float32Array(r*this.count),r,this.count,tt,Ue));let i=this.morphTexture.source.data.data,a=0;for(let e=0;e<n.length;e++)a+=n[e];let o=this.geometry.morphTargetsRelative?1:1-a,s=r*e;return i[s]=o,i.set(n,s+1),this}updateMorphTargets(){}dispose(){this.dispatchEvent({type:`dispose`}),this.morphTexture!==null&&(this.morphTexture.dispose(),this.morphTexture=null)}},ia=new L,aa=new L,oa=new R,sa=class{constructor(e=new L(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,n,r){return this.normal.set(e,t,n),this.constant=r,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){let r=ia.subVectors(n,t).cross(aa.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){let e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t,n=!0){let r=e.delta(ia),i=this.normal.dot(r);if(i===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;let a=-(e.start.dot(this.normal)+this.constant)/i;return n===!0&&(a<0||a>1)?null:t.copy(e.start).addScaledVector(r,a)}intersectsLine(e){let t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){let n=t||oa.getNormalMatrix(e),r=this.coplanarPoint(ia).applyMatrix4(e),i=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(i),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}},ca=new $r,la=new I(.5,.5),ua=new L,da=class{constructor(e=new sa,t=new sa,n=new sa,r=new sa,i=new sa,a=new sa){this.planes=[e,t,n,r,i,a]}set(e,t,n,r,i,a){let o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(n),o[3].copy(r),o[4].copy(i),o[5].copy(a),this}copy(e){let t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e,t=rn,n=!1){let r=this.planes,i=e.elements,a=i[0],o=i[1],s=i[2],c=i[3],l=i[4],u=i[5],d=i[6],f=i[7],p=i[8],m=i[9],h=i[10],g=i[11],_=i[12],v=i[13],y=i[14],b=i[15];if(r[0].setComponents(c-a,f-l,g-p,b-_).normalize(),r[1].setComponents(c+a,f+l,g+p,b+_).normalize(),r[2].setComponents(c+o,f+u,g+m,b+v).normalize(),r[3].setComponents(c-o,f-u,g-m,b-v).normalize(),n)r[4].setComponents(s,d,h,y).normalize(),r[5].setComponents(c-s,f-d,g-h,b-y).normalize();else if(r[4].setComponents(c-s,f-d,g-h,b-y).normalize(),t===2e3)r[5].setComponents(c+s,f+d,g+h,b+y).normalize();else if(t===2001)r[5].setComponents(s,d,h,y).normalize();else throw Error(`THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: `+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),ca.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{let t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),ca.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(ca)}intersectsSprite(e){ca.center.set(0,0,0);let t=la.distanceTo(e.center);return ca.radius=.7071067811865476+t,ca.applyMatrix4(e.matrixWorld),this.intersectsSphere(ca)}intersectsSphere(e){let t=this.planes,n=e.center,r=-e.radius;for(let e=0;e<6;e++)if(t[e].distanceToPoint(n)<r)return!1;return!0}intersectsBox(e){let t=this.planes;for(let n=0;n<6;n++){let r=t[n];if(ua.x=r.normal.x>0?e.max.x:e.min.x,ua.y=r.normal.y>0?e.max.y:e.min.y,ua.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(ua)<0)return!1}return!0}containsPoint(e){let t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}},fa=class extends fi{constructor(e){super(),this.isLineBasicMaterial=!0,this.type=`LineBasicMaterial`,this.color=new z(16777215),this.map=null,this.linewidth=1,this.linecap=`round`,this.linejoin=`round`,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}},pa=new L,ma=new L,ha=new Nn,ga=new bi,_a=new $r,va=new L,ya=new L,ba=class extends or{constructor(e=new si,t=new fa){super(),this.isLine=!0,this.type=`Line`,this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}computeLineDistances(){let e=this.geometry;if(e.index===null){let t=e.attributes.position,n=[0];for(let e=1,r=t.count;e<r;e++)pa.fromBufferAttribute(t,e-1),ma.fromBufferAttribute(t,e),n[e]=n[e-1],n[e]+=pa.distanceTo(ma);e.setAttribute(`lineDistance`,new Yr(n,1))}else d(`Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.`);return this}raycast(e,t){let n=this.geometry,r=this.matrixWorld,i=e.params.Line.threshold,a=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),_a.copy(n.boundingSphere),_a.applyMatrix4(r),_a.radius+=i,e.ray.intersectsSphere(_a)===!1)return;ha.copy(r).invert(),ga.copy(e.ray).applyMatrix4(ha);let o=i/((this.scale.x+this.scale.y+this.scale.z)/3),s=o*o,c=this.isLineSegments?2:1,l=n.index,u=n.attributes.position;if(l!==null){let n=Math.max(0,a.start),r=Math.min(l.count,a.start+a.count);for(let i=n,a=r-1;i<a;i+=c){let n=l.getX(i),r=l.getX(i+1),a=pe(this,e,ga,s,n,r,i);a&&t.push(a)}if(this.isLineLoop){let i=l.getX(r-1),a=l.getX(n),o=pe(this,e,ga,s,i,a,r-1);o&&t.push(o)}}else{let n=Math.max(0,a.start),r=Math.min(u.count,a.start+a.count);for(let i=n,a=r-1;i<a;i+=c){let n=pe(this,e,ga,s,i,i+1,i);n&&t.push(n)}if(this.isLineLoop){let i=pe(this,e,ga,s,r-1,n,r-1);i&&t.push(i)}}}updateMorphTargets(){let e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){let n=e[t[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e<t;e++){let t=n[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}},xa=new L,Sa=new L,Ca=class extends ba{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type=`LineSegments`}computeLineDistances(){let e=this.geometry;if(e.index===null){let t=e.attributes.position,n=[];for(let e=0,r=t.count;e<r;e+=2)xa.fromBufferAttribute(t,e),Sa.fromBufferAttribute(t,e+1),n[e]=e===0?0:n[e-1],n[e+1]=n[e]+xa.distanceTo(Sa);e.setAttribute(`lineDistance`,new Yr(n,1))}else d(`LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.`);return this}},wa=class extends ba{constructor(e,t){super(e,t),this.isLineLoop=!0,this.type=`LineLoop`}},Ta=class extends fi{constructor(e){super(),this.isPointsMaterial=!0,this.type=`PointsMaterial`,this.color=new z(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}},Ea=new Nn,Da=new bi,Oa=new $r,ka=new L,Aa=class extends or{constructor(e=new si,t=new Ta){super(),this.isPoints=!0,this.type=`Points`,this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}raycast(e,t){let n=this.geometry,r=this.matrixWorld,i=e.params.Points.threshold,a=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),Oa.copy(n.boundingSphere),Oa.applyMatrix4(r),Oa.radius+=i,e.ray.intersectsSphere(Oa)===!1)return;Ea.copy(r).invert(),Da.copy(e.ray).applyMatrix4(Ea);let o=i/((this.scale.x+this.scale.y+this.scale.z)/3),s=o*o,c=n.index,l=n.attributes.position;if(c!==null){let n=Math.max(0,a.start),i=Math.min(c.count,a.start+a.count);for(let a=n,o=i;a<o;a++){let n=c.getX(a);ka.fromBufferAttribute(l,n),me(ka,n,s,r,e,t,this)}}else{let n=Math.max(0,a.start),i=Math.min(l.count,a.start+a.count);for(let a=n,o=i;a<o;a++)ka.fromBufferAttribute(l,a),me(ka,a,s,r,e,t,this)}}updateMorphTargets(){let e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){let n=e[t[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e<t;e++){let t=n[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}},ja=class extends Dn{constructor(e=[],t=301,n,r,i,a,o,s,c,l){super(e,t,n,r,i,a,o,s,c,l),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}},Ma=class extends Dn{constructor(e,t,n=He,r,i,a,o=N,s=N,c,l=$e,u=1){if(l!==1026&&l!==1027)throw Error(`THREE.DepthTexture: format must be either THREE.DepthFormat or THREE.DepthStencilFormat`);super({width:e,height:t,depth:u},r,i,a,o,s,l,n,c),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new wn(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){let t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}},Na=class extends Ma{constructor(e,t=He,n=301,r,i,a=N,o=N,s,c=$e){let l={width:e,height:e,depth:1},u=[l,l,l,l,l,l];super(e,e,t,n,r,i,a,o,s,c),this.image=u,this.isCubeDepthTexture=!0,this.isCubeTexture=!0}get images(){return this.image}set images(e){this.image=e}},Pa=class extends Dn{constructor(e=null){super(),this.sourceTexture=e,this.isExternalTexture=!0}copy(e){return super.copy(e),this.sourceTexture=e.sourceTexture,this}},Fa=class e extends si{constructor(e=1,t=1,n=1,r=1,i=1,a=1){super(),this.type=`BoxGeometry`,this.parameters={width:e,height:t,depth:n,widthSegments:r,heightSegments:i,depthSegments:a};let o=this;r=Math.floor(r),i=Math.floor(i),a=Math.floor(a);let s=[],c=[],l=[],u=[],d=0,f=0;p(`z`,`y`,`x`,-1,-1,n,t,e,a,i,0),p(`z`,`y`,`x`,1,-1,n,t,-e,a,i,1),p(`x`,`z`,`y`,1,1,e,n,t,r,a,2),p(`x`,`z`,`y`,1,-1,e,n,-t,r,a,3),p(`x`,`y`,`z`,1,-1,e,t,n,r,i,4),p(`x`,`y`,`z`,-1,-1,e,t,-n,r,i,5),this.setIndex(s),this.setAttribute(`position`,new Yr(c,3)),this.setAttribute(`normal`,new Yr(l,3)),this.setAttribute(`uv`,new Yr(u,2));function p(e,t,n,r,i,a,p,m,h,g,_){let v=a/h,y=p/g,b=a/2,x=p/2,S=m/2,C=h+1,w=g+1,T=0,E=0,D=new L;for(let a=0;a<w;a++){let o=a*y-x;for(let s=0;s<C;s++)D[e]=(s*v-b)*r,D[t]=o*i,D[n]=S,c.push(D.x,D.y,D.z),D[e]=0,D[t]=0,D[n]=m>0?1:-1,l.push(D.x,D.y,D.z),u.push(s/h),u.push(1-a/g),T+=1}for(let e=0;e<g;e++)for(let t=0;t<h;t++){let n=d+t+C*e,r=d+t+C*(e+1),i=d+(t+1)+C*(e+1),a=d+(t+1)+C*e;s.push(n,r,a),s.push(r,i,a),E+=6}o.addGroup(f,E,_),f+=E,d+=T}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(t){return new e(t.width,t.height,t.depth,t.widthSegments,t.heightSegments,t.depthSegments)}},Ia=class e extends si{constructor(e=1,t=1,n=1,r=1){super(),this.type=`PlaneGeometry`,this.parameters={width:e,height:t,widthSegments:n,heightSegments:r};let i=e/2,a=t/2,o=Math.floor(n),s=Math.floor(r),c=o+1,l=s+1,u=e/o,d=t/s,f=[],p=[],m=[],h=[];for(let e=0;e<l;e++){let t=e*d-a;for(let n=0;n<c;n++){let r=n*u-i;p.push(r,-t,0),m.push(0,0,1),h.push(n/o),h.push(1-e/s)}}for(let e=0;e<s;e++)for(let t=0;t<o;t++){let n=t+c*e,r=t+c*(e+1),i=t+1+c*(e+1),a=t+1+c*e;f.push(n,r,a),f.push(r,i,a)}this.setIndex(f),this.setAttribute(`position`,new Yr(p,3)),this.setAttribute(`normal`,new Yr(m,3)),this.setAttribute(`uv`,new Yr(h,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(t){return new e(t.width,t.height,t.widthSegments,t.heightSegments)}},La={clone:he,merge:ge},Ra=`void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}`,za=`void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}`,Ba=class extends fi{constructor(e){super(),this.isShaderMaterial=!0,this.type=`ShaderMaterial`,this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=Ra,this.fragmentShader=za,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,e!==void 0&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=he(e.uniforms),this.uniformsGroups=ve(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this.defaultAttributeValues=Object.assign({},e.defaultAttributeValues),this.index0AttributeName=e.index0AttributeName,this.uniformsNeedUpdate=e.uniformsNeedUpdate,this}toJSON(e){let t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(let n in this.uniforms){let r=this.uniforms[n].value;r&&r.isTexture?t.uniforms[n]={type:`t`,value:r.toJSON(e).uuid}:r&&r.isColor?t.uniforms[n]={type:`c`,value:r.getHex()}:r&&r.isVector2?t.uniforms[n]={type:`v2`,value:r.toArray()}:r&&r.isVector3?t.uniforms[n]={type:`v3`,value:r.toArray()}:r&&r.isVector4?t.uniforms[n]={type:`v4`,value:r.toArray()}:r&&r.isMatrix3?t.uniforms[n]={type:`m3`,value:r.toArray()}:r&&r.isMatrix4?t.uniforms[n]={type:`m4`,value:r.toArray()}:t.uniforms[n]={value:r}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;let n={};for(let e in this.extensions)this.extensions[e]===!0&&(n[e]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}fromJSON(e,t){if(super.fromJSON(e,t),e.uniforms!==void 0)for(let n in e.uniforms){let r=e.uniforms[n];switch(this.uniforms[n]={},r.type){case`t`:this.uniforms[n].value=t[r.value]||null;break;case`c`:this.uniforms[n].value=new z().setHex(r.value);break;case`v2`:this.uniforms[n].value=new I().fromArray(r.value);break;case`v3`:this.uniforms[n].value=new L().fromArray(r.value);break;case`v4`:this.uniforms[n].value=new On().fromArray(r.value);break;case`m3`:this.uniforms[n].value=new R().fromArray(r.value);break;case`m4`:this.uniforms[n].value=new Nn().fromArray(r.value);break;default:this.uniforms[n].value=r.value}}if(e.defines!==void 0&&(this.defines=e.defines),e.vertexShader!==void 0&&(this.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(this.fragmentShader=e.fragmentShader),e.glslVersion!==void 0&&(this.glslVersion=e.glslVersion),e.extensions!==void 0)for(let t in e.extensions)this.extensions[t]=e.extensions[t];return e.lights!==void 0&&(this.lights=e.lights),e.clipping!==void 0&&(this.clipping=e.clipping),this}},Va=class extends Ba{constructor(e){super(e),this.isRawShaderMaterial=!0,this.type=`RawShaderMaterial`}},Ha=class extends fi{constructor(e){super(),this.isMeshStandardMaterial=!0,this.type=`MeshStandardMaterial`,this.defines={STANDARD:``},this.color=new z(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new z(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new I(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Un,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap=`round`,this.wireframeLinejoin=`round`,this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:``},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}},Ua=class extends Ha{constructor(e){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:``,PHYSICAL:``},this.type=`MeshPhysicalMaterial`,this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new I(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,\"reflectivity\",{get:function(){return g(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(e){this.ior=(1+.4*e)/(1-.4*e)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new z(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new z(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new z(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._dispersion=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(e)}get anisotropy(){return this._anisotropy}set anisotropy(e){this._anisotropy>0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:``,PHYSICAL:``},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}},Wa=class extends fi{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type=`MeshDepthMaterial`,this.depthPacking=Xt,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}},Ga=class extends fi{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type=`MeshDistanceMaterial`,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}},Ka=class{constructor(e,t,n,r){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=r===void 0?new t.constructor(n):r,this.sampleValues=t,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(e){let t=this.parameterPositions,n=this._cachedIndex,r=t[n],i=t[n-1];validate_interval:{seek:{let a;linear_scan:{forward_scan:if(!(e<r)){for(let a=n+2;;){if(r===void 0){if(e<i)break forward_scan;return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}if(n===a)break;if(i=r,r=t[++n],e<r)break seek}a=t.length;break linear_scan}if(!(e>=i)){let o=t[1];e<o&&(n=2,i=o);for(let a=n-2;;){if(i===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(n===a)break;if(r=i,i=t[--n-1],e>=i)break seek}a=n,n=0;break linear_scan}break validate_interval}for(;n<a;){let r=n+a>>>1;e<t[r]?a=r:n=r+1}if(r=t[n],i=t[n-1],i===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(r===void 0)return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}this._cachedIndex=n,this.intervalChanged_(n,i,r)}return this.interpolate_(n,i,e,r)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){let t=this.resultBuffer,n=this.sampleValues,r=this.valueSize,i=e*r;for(let e=0;e!==r;++e)t[e]=n[i+e];return t}interpolate_(){throw Error(`THREE.Interpolant: Call to abstract method.`)}intervalChanged_(){}},qa=class extends Ka{constructor(e,t,n,r){super(e,t,n,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:Kt,endingEnd:Kt}}intervalChanged_(e,t,n){let r=this.parameterPositions,i=e-2,a=e+1,o=r[i],s=r[a];if(o===void 0)switch(this.getSettings_().endingStart){case qt:i=e,o=2*t-n;break;case Jt:i=r.length-2,o=t+r[i]-r[i+1];break;default:i=e,o=n}if(s===void 0)switch(this.getSettings_().endingEnd){case qt:a=e,s=2*n-t;break;case Jt:a=1,s=n+r[1]-r[0];break;default:a=e-1,s=t}let c=(n-t)*.5,l=this.valueSize;this._weightPrev=c/(t-o),this._weightNext=c/(s-n),this._offsetPrev=i*l,this._offsetNext=a*l}interpolate_(e,t,n,r){let i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,c=s-o,l=this._offsetPrev,u=this._offsetNext,d=this._weightPrev,f=this._weightNext,p=(n-t)/(r-t),m=p*p,h=m*p,g=-d*h+2*d*m-d*p,_=(1+d)*h+(-1.5-2*d)*m+(-.5+d)*p+1,v=(-1-f)*h+(1.5+f)*m+.5*p,y=f*h-f*m;for(let e=0;e!==o;++e)i[e]=g*a[l+e]+_*a[c+e]+v*a[s+e]+y*a[u+e];return i}},Ja=class extends Ka{constructor(e,t,n,r){super(e,t,n,r)}interpolate_(e,t,n,r){let i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,c=s-o,l=(n-t)/(r-t),u=1-l;for(let e=0;e!==o;++e)i[e]=a[c+e]*u+a[s+e]*l;return i}},Ya=class extends Ka{constructor(e,t,n,r){super(e,t,n,r)}interpolate_(e){return this.copySampleValue_(e-1)}},Xa=class extends Ka{interpolate_(e,t,n,r){let i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,c=s-o,l=this.inTangents,u=this.outTangents;if(!l||!u){let e=(n-t)/(r-t),l=1-e;for(let t=0;t!==o;++t)i[t]=a[c+t]*l+a[s+t]*e;return i}let d=o*2,f=e-1;for(let p=0;p!==o;++p){let o=a[c+p],m=a[s+p],h=f*d+p*2,g=u[h],_=u[h+1],v=e*d+p*2,y=l[v],b=l[v+1],x=(n-t)/(r-t),S,C,w,T,E;for(let e=0;e<8;e++){S=x*x,C=S*x,w=1-x,T=w*w,E=T*w;let e=E*t+3*T*x*g+3*w*S*y+C*r-n;if(Math.abs(e)<1e-10)break;let i=3*T*(g-t)+6*w*x*(y-g)+3*S*(r-y);if(Math.abs(i)<1e-10)break;x-=e/i,x=Math.max(0,Math.min(1,x))}i[p]=E*o+3*T*x*_+3*w*S*b+C*m}return i}},Za=class{constructor(e,t,n,r){if(e===void 0)throw Error(`THREE.KeyframeTrack: track name is undefined`);if(t===void 0||t.length===0)throw Error(`THREE.KeyframeTrack: no keyframes in track named `+e);this.name=e,this.times=be(t,this.TimeBufferType),this.values=be(n,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation)}static toJSON(e){let t=e.constructor,n;if(t.toJSON!==this.toJSON)n=t.toJSON(e);else{n={name:e.name,times:be(e.times,Array),values:be(e.values,Array)};let t=e.getInterpolation();t!==e.DefaultInterpolation&&(n.interpolation=t)}return n.type=e.ValueTypeName,n}InterpolantFactoryMethodDiscrete(e){return new Ya(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new Ja(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new qa(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodBezier(e){let t=new Xa(this.times,this.values,this.getValueSize(),e);return this.settings&&(t.inTangents=this.settings.inTangents,t.outTangents=this.settings.outTangents),t}setInterpolation(e){let t;switch(e){case Ht:t=this.InterpolantFactoryMethodDiscrete;break;case Ut:t=this.InterpolantFactoryMethodLinear;break;case Wt:t=this.InterpolantFactoryMethodSmooth;break;case Gt:t=this.InterpolantFactoryMethodBezier}if(t===void 0){let t=`unsupported interpolation for `+this.ValueTypeName+` keyframe track named `+this.name;if(this.createInterpolant===void 0){if(e!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw Error(t)}return d(`KeyframeTrack:`,t),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return Ht;case this.InterpolantFactoryMethodLinear:return Ut;case this.InterpolantFactoryMethodSmooth:return Wt;case this.InterpolantFactoryMethodBezier:return Gt}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){let t=this.times;for(let n=0,r=t.length;n!==r;++n)t[n]+=e}return this}scale(e){if(e!==1){let t=this.times;for(let n=0,r=t.length;n!==r;++n)t[n]*=e}return this}trim(e,t){let n=this.times,r=n.length,i=0,a=r-1;for(;i!==r&&n[i]<e;)++i;for(;a!==-1&&n[a]>t;)--a;if(++a,i!==0||a!==r){i>=a&&(a=Math.max(a,1),i=a-1);let e=this.getValueSize();this.times=n.slice(i,a),this.values=this.values.slice(i*e,a*e)}return this}validate(){let e=!0,t=this.getValueSize();t-Math.floor(t)!==0&&(f(`KeyframeTrack: Invalid value size in track.`,this),e=!1);let n=this.times,r=this.values,i=n.length;i===0&&(f(`KeyframeTrack: Track is empty.`,this),e=!1);let a=null;for(let t=0;t!==i;t++){let r=n[t];if(typeof r==`number`&&isNaN(r)){f(`KeyframeTrack: Time is not a valid number.`,this,t,r),e=!1;break}if(a!==null&&a>r){f(`KeyframeTrack: Out of order keys.`,this,t,r,a),e=!1;break}a=r}if(r!==void 0&&o(r))for(let t=0,n=r.length;t!==n;++t){let n=r[t];if(isNaN(n)){f(`KeyframeTrack: Value is not a valid number.`,this,t,n),e=!1;break}}return e}optimize(){let e=this.times.slice(),t=this.values.slice(),n=this.getValueSize(),r=this.getInterpolation()===Wt,i=e.length-1,a=1;for(let o=1;o<i;++o){let i=!1,s=e[o];if(s!==e[o+1]&&(o!==1||s!==e[0])){if(r)i=!0;else{let e=o*n,r=e-n,a=e+n;for(let o=0;o!==n;++o){let n=t[e+o];if(n!==t[r+o]||n!==t[a+o]){i=!0;break}}}}if(i){if(o!==a){e[a]=e[o];let r=o*n,i=a*n;for(let e=0;e!==n;++e)t[i+e]=t[r+e]}++a}}if(i>0){e[a]=e[i];for(let e=i*n,r=a*n,o=0;o!==n;++o)t[r+o]=t[e+o];++a}return a===e.length?(this.times=e,this.values=t):(this.times=e.slice(0,a),this.values=t.slice(0,a*n)),this}clone(){let e=this.times.slice(),t=this.values.slice(),n=this.constructor,r=new n(this.name,e,t);return r.createInterpolant=this.createInterpolant,r}},Za.prototype.ValueTypeName=``,Za.prototype.TimeBufferType=Float32Array,Za.prototype.ValueBufferType=Float32Array,Za.prototype.DefaultInterpolation=Ut,Qa=class extends Za{constructor(e,t,n){super(e,t,n)}},Qa.prototype.ValueTypeName=`bool`,Qa.prototype.ValueBufferType=Array,Qa.prototype.DefaultInterpolation=Ht,Qa.prototype.InterpolantFactoryMethodLinear=void 0,Qa.prototype.InterpolantFactoryMethodSmooth=void 0,$a=class extends Za{constructor(e,t,n,r){super(e,t,n,r)}},$a.prototype.ValueTypeName=`color`,eo=class extends Za{constructor(e,t,n,r){super(e,t,n,r)}},eo.prototype.ValueTypeName=`number`,to=class extends Ka{constructor(e,t,n,r){super(e,t,n,r)}interpolate_(e,t,n,r){let i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=(n-t)/(r-t),c=e*o;for(let e=c+o;c!==e;c+=4)mn.slerpFlat(i,0,a,c-o,a,c,s);return i}},no=class extends Za{constructor(e,t,n,r){super(e,t,n,r)}InterpolantFactoryMethodLinear(e){return new to(this.times,this.values,this.getValueSize(),e)}},no.prototype.ValueTypeName=`quaternion`,no.prototype.InterpolantFactoryMethodSmooth=void 0,ro=class extends Za{constructor(e,t,n){super(e,t,n)}},ro.prototype.ValueTypeName=`string`,ro.prototype.ValueBufferType=Array,ro.prototype.DefaultInterpolation=Ht,ro.prototype.InterpolantFactoryMethodLinear=void 0,ro.prototype.InterpolantFactoryMethodSmooth=void 0,io=class extends Za{constructor(e,t,n,r){super(e,t,n,r)}},io.prototype.ValueTypeName=`vector`,ao=class{constructor(e=``,t=-1,n=[],r=Yt){this.name=e,this.tracks=n,this.duration=t,this.blendMode=r,this.uuid=h(),this.userData={},this.duration<0&&this.resetDuration()}static parse(e){let t=[],n=e.tracks,r=1/(e.fps||1);for(let e=0,i=n.length;e!==i;++e)t.push(Te(n[e]).scale(r));let i=new this(e.name,e.duration,t,e.blendMode);return i.uuid=e.uuid,i.userData=JSON.parse(e.userData||`{}`),i}static toJSON(e){let t=[],n=e.tracks,r={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode,userData:JSON.stringify(e.userData)};for(let e=0,r=n.length;e!==r;++e)t.push(Za.toJSON(n[e]));return r}static CreateFromMorphTargetSequence(e,t,n,r){let i=t.length,a=[];for(let e=0;e<i;e++){let o=[],s=[];o.push((e+i-1)%i,e,(e+1)%i),s.push(0,1,0);let c=xe(o);o=Se(o,1,c),s=Se(s,1,c),!r&&o[0]===0&&(o.push(i),s.push(s[0])),a.push(new eo(`.morphTargetInfluences[`+t[e].name+`]`,o,s).scale(1/n))}return new this(e,-1,a)}static findByName(e,t){let n=e;if(!Array.isArray(e)){let t=e;n=t.geometry&&t.geometry.animations||t.animations}for(let e=0;e<n.length;e++)if(n[e].name===t)return n[e];return null}static CreateClipsFromMorphTargetSequences(e,t,n){let r={},i=/^([\\w-]*?)([\\d]+)$/;for(let t=0,n=e.length;t<n;t++){let n=e[t],a=n.name.match(i);if(a&&a.length>1){let e=a[1],t=r[e];t||(r[e]=t=[]),t.push(n)}}let a=[];for(let e in r)a.push(this.CreateFromMorphTargetSequence(e,r[e],t,n));return a}resetDuration(){let e=this.tracks,t=0;for(let n=0,r=e.length;n!==r;++n){let e=this.tracks[n];t=Math.max(t,e.times[e.times.length-1])}return this.duration=t,this}trim(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}validate(){let e=!0;for(let t=0;t<this.tracks.length;t++)e&&=this.tracks[t].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){let e=[];for(let t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());let t=new this.constructor(this.name,this.duration,e,this.blendMode);return t.userData=JSON.parse(JSON.stringify(this.userData)),t}toJSON(){return this.constructor.toJSON(this)}},oo={enabled:!1,files:{},add:function(e,t){this.enabled!==!1&&(Ee(e)||(this.files[e]=t))},get:function(e){if(this.enabled!==!1&&!Ee(e))return this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}},so=class{constructor(e,t,n){let r=this,i=!1,a=0,o=0,s,c=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this._abortController=null,this.itemStart=function(e){o++,i===!1&&r.onStart!==void 0&&r.onStart(e,a,o),i=!0},this.itemEnd=function(e){a++,r.onProgress!==void 0&&r.onProgress(e,a,o),a===o&&(i=!1,r.onLoad!==void 0&&r.onLoad())},this.itemError=function(e){r.onError!==void 0&&r.onError(e)},this.resolveURL=function(e){return e=e.normalize(`NFC`),s?s(e):e},this.setURLModifier=function(e){return s=e,this},this.addHandler=function(e,t){return c.push(e,t),this},this.removeHandler=function(e){let t=c.indexOf(e);return t!==-1&&c.splice(t,2),this},this.getHandler=function(e){for(let t=0,n=c.length;t<n;t+=2){let n=c[t],r=c[t+1];if(n.global&&(n.lastIndex=0),n.test(e))return r}return null},this.abort=function(){return this.abortController.abort(),this._abortController=null,this}}get abortController(){return this._abortController||=new AbortController,this._abortController}},co=new so,lo=class{constructor(e){this.manager=e===void 0?co:e,this.crossOrigin=`anonymous`,this.withCredentials=!1,this.path=``,this.resourcePath=``,this.requestHeader={},typeof __THREE_DEVTOOLS__<`u`&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent(`observe`,{detail:this}))}load(){}loadAsync(e,t){let n=this;return new Promise(function(r,i){n.load(e,r,t,i)})}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}abort(){return this}},lo.DEFAULT_MATERIAL_NAME=`__DEFAULT`,uo={},fo=class extends Error{constructor(e,t){super(e),this.response=t}},po=class extends lo{constructor(e){super(e),this.mimeType=``,this.responseType=``,this._abortController=new AbortController}load(e,t,n,r){e===void 0&&(e=``),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);let i=oo.get(`file:${e}`);if(i!==void 0){this.manager.itemStart(e),setTimeout(()=>{t&&t(i),this.manager.itemEnd(e)},0);return}if(uo[e]!==void 0){uo[e].push({onLoad:t,onProgress:n,onError:r});return}uo[e]=[],uo[e].push({onLoad:t,onProgress:n,onError:r});let a=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?`include`:`same-origin`,signal:typeof AbortSignal.any==`function`?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal}),o=this.mimeType,s=this.responseType;fetch(a).then(t=>{if(t.status===200||t.status===0){if(t.status===0&&d(`FileLoader: HTTP Status 0 received.`),typeof ReadableStream>`u`||t.body===void 0||t.body.getReader===void 0)return t;let n=uo[e],r=t.body.getReader(),i=t.headers.get(`X-File-Size`)||t.headers.get(`Content-Length`),a=i?parseInt(i):0,o=a!==0,s=0,c=new ReadableStream({start(e){t();function t(){r.read().then(({done:r,value:i})=>{if(r)e.close();else{s+=i.byteLength;let r=new ProgressEvent(`progress`,{lengthComputable:o,loaded:s,total:a});for(let e=0,t=n.length;e<t;e++){let t=n[e];t.onProgress&&t.onProgress(r)}e.enqueue(i),t()}},t=>{e.error(t)})}}});return new Response(c)}throw new fo(`fetch for \"${t.url}\" responded with ${t.status}: ${t.statusText}`,t)}).then(e=>{switch(s){case`arraybuffer`:return e.arrayBuffer();case`blob`:return e.blob();case`document`:return e.text().then(e=>new DOMParser().parseFromString(e,o));case`json`:return e.json();default:if(o===``)return e.text();{let t=/charset=\"?([^;\"\\s]*)\"?/i.exec(o),n=t&&t[1]?t[1].toLowerCase():void 0,r=new TextDecoder(n);return e.arrayBuffer().then(e=>r.decode(e))}}}).then(t=>{oo.add(`file:${e}`,t);let n=uo[e];delete uo[e];for(let e=0,r=n.length;e<r;e++){let r=n[e];r.onLoad&&r.onLoad(t)}}).catch(t=>{let n=uo[e];if(n===void 0)throw this.manager.itemError(e),t;delete uo[e];for(let e=0,r=n.length;e<r;e++){let r=n[e];r.onError&&r.onError(t)}this.manager.itemError(e)}).finally(()=>{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}},mo=new WeakMap,ho=class extends lo{constructor(e){super(e)}load(e,t,n,r){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);let i=this,a=oo.get(`image:${e}`);if(a!==void 0){if(a.complete===!0)i.manager.itemStart(e),setTimeout(function(){t&&t(a),i.manager.itemEnd(e)},0);else{let e=mo.get(a);e===void 0&&(e=[],mo.set(a,e)),e.push({onLoad:t,onError:r})}return a}let o=s(`img`);function c(){u(),t&&t(this);let n=mo.get(this)||[];for(let e=0;e<n.length;e++){let t=n[e];t.onLoad&&t.onLoad(this)}mo.delete(this),i.manager.itemEnd(e)}function l(t){u(),r&&r(t),oo.remove(`image:${e}`);let n=mo.get(this)||[];for(let e=0;e<n.length;e++){let r=n[e];r.onError&&r.onError(t)}mo.delete(this),i.manager.itemError(e),i.manager.itemEnd(e)}function u(){o.removeEventListener(`load`,c,!1),o.removeEventListener(`error`,l,!1)}return o.addEventListener(`load`,c,!1),o.addEventListener(`error`,l,!1),e.slice(0,5)!==`data:`&&this.crossOrigin!==void 0&&(o.crossOrigin=this.crossOrigin),oo.add(`image:${e}`,o),i.manager.itemStart(e),o.src=e,o}},go=class extends lo{constructor(e){super(e)}load(e,t,n,r){let i=new Dn,a=new ho(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(e,function(e){i.image=e,i.needsUpdate=!0,t!==void 0&&t(i)},n,r),i}},_o=class extends or{constructor(e,t=1){super(),this.isLight=!0,this.type=`Light`,this.color=new z(e),this.intensity=t}dispose(){this.dispatchEvent({type:`dispose`})}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){let t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,t}},vo=new Nn,yo=new L,bo=new L,xo=class{constructor(e){this.camera=e,this.intensity=1,this.bias=0,this.biasNode=null,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new I(512,512),this.mapType=Le,this.map=null,this.mapPass=null,this.matrix=new Nn,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new da,this._frameExtents=new I(1,1),this._viewportCount=1,this._viewports=[new On(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){let t=this.camera,n=this.matrix;yo.setFromMatrixPosition(e.matrixWorld),t.position.copy(yo),bo.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(bo),t.updateMatrixWorld(),vo.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(vo,t.coordinateSystem,t.reversedDepth),t.coordinateSystem===2001||t.reversedDepth?n.set(.5,0,0,.5,0,.5,0,.5,0,0,1,0,0,0,0,1):n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(vo)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.intensity=e.intensity,this.bias=e.bias,this.radius=e.radius,this.autoUpdate=e.autoUpdate,this.needsUpdate=e.needsUpdate,this.normalBias=e.normalBias,this.blurSamples=e.blurSamples,this.mapSize.copy(e.mapSize),this.biasNode=e.biasNode,this}clone(){return new this.constructor().copy(this)}toJSON(){let e={};return this.intensity!==1&&(e.intensity=this.intensity),this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}},So=new L,Co=new mn,wo=new L,To=class extends or{constructor(){super(),this.isCamera=!0,this.type=`Camera`,this.matrixWorldInverse=new Nn,this.projectionMatrix=new Nn,this.projectionMatrixInverse=new Nn,this.coordinateSystem=rn,this._reversedDepth=!1}get reversedDepth(){return this._reversedDepth}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorld.decompose(So,Co,wo),wo.x===1&&wo.y===1&&wo.z===1?this.matrixWorldInverse.copy(this.matrixWorld).invert():this.matrixWorldInverse.compose(So,Co,wo.set(1,1,1)).invert()}updateWorldMatrix(e,t,n=!1){super.updateWorldMatrix(e,t,n),this.matrixWorld.decompose(So,Co,wo),wo.x===1&&wo.y===1&&wo.z===1?this.matrixWorldInverse.copy(this.matrixWorld).invert():this.matrixWorldInverse.compose(So,Co,wo.set(1,1,1)).invert()}clone(){return new this.constructor().copy(this)}},Eo=new L,Do=new I,Oo=new I,ko=class extends To{constructor(e=50,t=1,n=.1,r=2e3){super(),this.isPerspectiveCamera=!0,this.type=`PerspectiveCamera`,this.fov=e,this.zoom=1,this.near=n,this.far=r,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){let t=.5*this.getFilmHeight()/e;this.fov=fn*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){let e=Math.tan(dn*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return fn*2*Math.atan(Math.tan(dn*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,n){Eo.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(Eo.x,Eo.y).multiplyScalar(-e/Eo.z),Eo.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(Eo.x,Eo.y).multiplyScalar(-e/Eo.z)}getViewSize(e,t){return this.getViewBounds(e,Do,Oo),t.subVectors(Oo,Do)}setViewOffset(e,t,n,r,i,a){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=this.near,t=e*Math.tan(dn*.5*this.fov)/this.zoom,n=2*t,r=this.aspect*n,i=-.5*r,a=this.view;if(this.view!==null&&this.view.enabled){let e=a.fullWidth,o=a.fullHeight;i+=a.offsetX*r/e,t-=a.offsetY*n/o,r*=a.width/e,n*=a.height/o}let o=this.filmOffset;o!==0&&(i+=e*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+r,t,t-n,e,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}},Ao=class extends xo{constructor(){super(new ko(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1,this.aspect=1}updateMatrices(e){let t=this.camera,n=fn*2*e.angle*this.focus,r=this.mapSize.width/this.mapSize.height*this.aspect,i=e.distance||t.far;(n!==t.fov||r!==t.aspect||i!==t.far)&&(t.fov=n,t.aspect=r,t.far=i,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}},jo=class extends _o{constructor(e,t,n=0,r=Math.PI/3,i=0,a=2){super(e,t),this.isSpotLight=!0,this.type=`SpotLight`,this.position.copy(or.DEFAULT_UP),this.updateMatrix(),this.target=new or,this.distance=n,this.angle=r,this.penumbra=i,this.decay=a,this.map=null,this.shadow=new Ao}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){super.dispose(),this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.map=e.map,this.shadow=e.shadow.clone(),this}toJSON(e){let t=super.toJSON(e);return t.object.distance=this.distance,t.object.angle=this.angle,t.object.decay=this.decay,t.object.penumbra=this.penumbra,t.object.target=this.target.uuid,this.map&&this.map.isTexture&&(t.object.map=this.map.toJSON(e).uuid),t.object.shadow=this.shadow.toJSON(),t}},Mo=class extends xo{constructor(){super(new ko(90,1,.5,500)),this.isPointLightShadow=!0}},No=class extends _o{constructor(e,t,n=0,r=2){super(e,t),this.isPointLight=!0,this.type=`PointLight`,this.distance=n,this.decay=r,this.shadow=new Mo}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){super.dispose(),this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}toJSON(e){let t=super.toJSON(e);return t.object.distance=this.distance,t.object.decay=this.decay,t.object.shadow=this.shadow.toJSON(),t}},Po=class extends To{constructor(e=-1,t=1,n=1,r=-1,i=.1,a=2e3){super(),this.isOrthographicCamera=!0,this.type=`OrthographicCamera`,this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=r,this.near=i,this.far=a,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,n,r,i,a){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,r=(this.top+this.bottom)/2,i=n-e,a=n+e,o=r+t,s=r-t;if(this.view!==null&&this.view.enabled){let e=(this.right-this.left)/this.view.fullWidth/this.zoom,t=(this.top-this.bottom)/this.view.fullHeight/this.zoom;i+=e*this.view.offsetX,a=i+e*this.view.width,o-=t*this.view.offsetY,s=o-t*this.view.height}this.projectionMatrix.makeOrthographic(i,a,o,s,this.near,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}},Fo=class extends xo{constructor(){super(new Po(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}},Io=class extends _o{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type=`DirectionalLight`,this.position.copy(or.DEFAULT_UP),this.updateMatrix(),this.target=new or,this.shadow=new Fo}dispose(){super.dispose(),this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}toJSON(e){let t=super.toJSON(e);return t.object.shadow=this.shadow.toJSON(),t.object.target=this.target.uuid,t}},Lo=class extends _o{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type=`AmbientLight`}},Ro=class{static extractUrlBase(e){let t=e.lastIndexOf(`/`);return t===-1?`./`:e.slice(0,t+1)}static resolveURL(e,t){return typeof e!=`string`||e===``?``:(/^https?:\\/\\//i.test(t)&&/^\\//.test(e)&&(t=t.replace(/(^https?:\\/\\/[^\\/]+).*/i,`$1`)),/^(https?:)?\\/\\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}},zo=new WeakMap,Bo=class extends lo{constructor(e){super(e),this.isImageBitmapLoader=!0,typeof createImageBitmap>`u`&&d(`ImageBitmapLoader: createImageBitmap() not supported.`),typeof fetch>`u`&&d(`ImageBitmapLoader: fetch() not supported.`),this.options={premultiplyAlpha:`none`},this._abortController=new AbortController}setOptions(e){return this.options=e,this}load(e,t,n,r){e===void 0&&(e=``),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);let i=this,a=oo.get(`image-bitmap:${e}`);if(a!==void 0){if(i.manager.itemStart(e),a.then){a.then(n=>{zo.has(a)===!0?(r&&r(zo.get(a)),i.manager.itemError(e),i.manager.itemEnd(e)):(t&&t(n),i.manager.itemEnd(e))});return}setTimeout(function(){t&&t(a),i.manager.itemEnd(e)},0);return}let o={};o.credentials=this.crossOrigin===`anonymous`?`same-origin`:`include`,o.headers=this.requestHeader,o.signal=typeof AbortSignal.any==`function`?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal;let s=fetch(e,o).then(function(e){return e.blob()}).then(function(e){return createImageBitmap(e,Object.assign(i.options,{colorSpaceConversion:`none`}))}).then(function(n){oo.add(`image-bitmap:${e}`,n),t&&t(n),i.manager.itemEnd(e)}).catch(function(t){r&&r(t),zo.set(s,t),oo.remove(`image-bitmap:${e}`),i.manager.itemError(e),i.manager.itemEnd(e)});oo.add(`image-bitmap:${e}`,s),i.manager.itemStart(e)}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}},Vo=-90,Ho=1,Uo=class extends or{constructor(e,t,n){super(),this.type=`CubeCamera`,this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;let r=new ko(Vo,Ho,e,t);r.layers=this.layers,this.add(r);let i=new ko(Vo,Ho,e,t);i.layers=this.layers,this.add(i);let a=new ko(Vo,Ho,e,t);a.layers=this.layers,this.add(a);let o=new ko(Vo,Ho,e,t);o.layers=this.layers,this.add(o);let s=new ko(Vo,Ho,e,t);s.layers=this.layers,this.add(s);let c=new ko(Vo,Ho,e,t);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){let e=this.coordinateSystem,t=this.children.concat(),[n,r,i,a,o,s]=t;for(let e of t)this.remove(e);if(e===2e3)n.up.set(0,1,0),n.lookAt(1,0,0),r.up.set(0,1,0),r.lookAt(-1,0,0),i.up.set(0,0,-1),i.lookAt(0,1,0),a.up.set(0,0,1),a.lookAt(0,-1,0),o.up.set(0,1,0),o.lookAt(0,0,1),s.up.set(0,1,0),s.lookAt(0,0,-1);else if(e===2001)n.up.set(0,-1,0),n.lookAt(-1,0,0),r.up.set(0,-1,0),r.lookAt(1,0,0),i.up.set(0,0,1),i.lookAt(0,1,0),a.up.set(0,0,-1),a.lookAt(0,-1,0),o.up.set(0,-1,0),o.lookAt(0,0,1),s.up.set(0,-1,0),s.lookAt(0,0,-1);else throw Error(`THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: `+e);for(let e of t)this.add(e),e.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();let{renderTarget:n,activeMipmapLevel:r}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());let[i,a,o,s,c,l]=this.children,u=e.getRenderTarget(),d=e.getActiveCubeFace(),f=e.getActiveMipmapLevel(),p=e.xr.enabled;e.xr.enabled=!1;let m=n.texture.generateMipmaps;n.texture.generateMipmaps=!1;let h=!1;h=e.isWebGLRenderer===!0?e.state.buffers.depth.getReversed():e.reversedDepthBuffer,e.setRenderTarget(n,0,r),h&&e.autoClear===!1&&e.clearDepth(),e.render(t,i),e.setRenderTarget(n,1,r),h&&e.autoClear===!1&&e.clearDepth(),e.render(t,a),e.setRenderTarget(n,2,r),h&&e.autoClear===!1&&e.clearDepth(),e.render(t,o),e.setRenderTarget(n,3,r),h&&e.autoClear===!1&&e.clearDepth(),e.render(t,s),e.setRenderTarget(n,4,r),h&&e.autoClear===!1&&e.clearDepth(),e.render(t,c),n.texture.generateMipmaps=m,e.setRenderTarget(n,5,r),h&&e.autoClear===!1&&e.clearDepth(),e.render(t,l),e.setRenderTarget(u,d,f),e.xr.enabled=p,n.texture.needsPMREMUpdate=!0}},Wo=class extends ko{constructor(e=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=e}},Go=`\\\\[\\\\]\\\\.:\\\\/`,Ko=RegExp(`[\\\\[\\\\]\\\\.:\\\\/]`,`g`),qo=`[^\\\\[\\\\]\\\\.:\\\\/]`,Jo=`[^`+Go.replace(`\\\\.`,``)+`]`,Yo=`((?:WC+[\\\\/:])*)`.replace(`WC`,qo),Xo=`(WCOD+)?`.replace(`WCOD`,Jo),Zo=`(?:\\\\.(WC+)(?:\\\\[(.+)\\\\])?)?`.replace(`WC`,qo),Qo=`\\\\.(WC+)(?:\\\\[(.+)\\\\])?`.replace(`WC`,qo),$o=RegExp(`^`+Yo+Xo+Zo+Qo+`$`),es=[`material`,`materials`,`bones`,`map`],ts=class{constructor(e,t,n){let r=n||ns.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}getValue(e,t){this.bind();let n=this._targetGroup.nCachedObjects_,r=this._bindings[n];r!==void 0&&r.getValue(e,t)}setValue(e,t){let n=this._bindings;for(let r=this._targetGroup.nCachedObjects_,i=n.length;r!==i;++r)n[r].setValue(e,t)}bind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}},ns=class e{constructor(t,n,r){this.path=n,this.parsedPath=r||e.parseTrackName(n),this.node=e.findNode(t,this.parsedPath.nodeName),this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(t,n,r){return t&&t.isAnimationObjectGroup?new e.Composite(t,n,r):new e(t,n,r)}static sanitizeNodeName(e){return e.replace(/\\s/g,`_`).replace(Ko,``)}static parseTrackName(e){let t=$o.exec(e);if(t===null)throw Error(`THREE.PropertyBinding: Cannot parse trackName: `+e);let n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},r=n.nodeName&&n.nodeName.lastIndexOf(`.`);if(r!==void 0&&r!==-1){let e=n.nodeName.substring(r+1);es.indexOf(e)!==-1&&(n.nodeName=n.nodeName.substring(0,r),n.objectName=e)}if(n.propertyName===null||n.propertyName.length===0)throw Error(`THREE.PropertyBinding: can not parse propertyName from trackName: `+e);return n}static findNode(e,t){if(t===void 0||t===``||t===`.`||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){let n=e.skeleton.getBoneByName(t);if(n!==void 0)return n}if(e.children){let n=function(e){for(let r=0;r<e.length;r++){let i=e[r];if(i.name===t||i.uuid===t)return i;let a=n(i.children);if(a)return a}return null},r=n(e.children);if(r)return r}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.targetObject[this.propertyName]}_getValue_array(e,t){let n=this.resolvedProperty;for(let r=0,i=n.length;r!==i;++r)e[t++]=n[r]}_getValue_arrayElement(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,t){this.resolvedProperty.toArray(e,t)}_setValue_direct(e,t){this.targetObject[this.propertyName]=e[t]}_setValue_direct_setNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,t){let n=this.resolvedProperty;for(let r=0,i=n.length;r!==i;++r)n[r]=e[t++]}_setValue_array_setNeedsUpdate(e,t){let n=this.resolvedProperty;for(let r=0,i=n.length;r!==i;++r)n[r]=e[t++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,t){let n=this.resolvedProperty;for(let r=0,i=n.length;r!==i;++r)n[r]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}_setValue_arrayElement_setNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,t){this.resolvedProperty.fromArray(e,t)}_setValue_fromArray_setNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,t){this.bind(),this.getValue(e,t)}_setValue_unbound(e,t){this.bind(),this.setValue(e,t)}bind(){let t=this.node,n=this.parsedPath,r=n.objectName,i=n.propertyName,a=n.propertyIndex;if(t||(t=e.findNode(this.rootNode,n.nodeName),this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!t){d(`PropertyBinding: No target node found for track: `+this.path+`.`);return}if(r){let e=n.objectIndex;switch(r){case`materials`:if(!t.material){f(`PropertyBinding: Can not bind to material as node does not have a material.`,this);return}if(!t.material.materials){f(`PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.`,this);return}t=t.material.materials;break;case`bones`:if(!t.skeleton){f(`PropertyBinding: Can not bind to bones as node does not have a skeleton.`,this);return}t=t.skeleton.bones;for(let n=0;n<t.length;n++)if(t[n].name===e){e=n;break}break;case`map`:if(`map`in t){t=t.map;break}if(!t.material){f(`PropertyBinding: Can not bind to material as node does not have a material.`,this);return}if(!t.material.map){f(`PropertyBinding: Can not bind to material.map as node.material does not have a map.`,this);return}t=t.material.map;break;default:if(t[r]===void 0){f(`PropertyBinding: Can not bind to objectName of node undefined.`,this);return}t=t[r]}if(e!==void 0){if(t[e]===void 0){f(`PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.`,this,t);return}t=t[e]}}let o=t[i];if(o===void 0){let e=n.nodeName;f(`PropertyBinding: Trying to update property for track: `+e+`.`+i+` but it wasn't found.`,t);return}let s=this.Versioning.None;this.targetObject=t,t.isMaterial===!0?s=this.Versioning.NeedsUpdate:t.isObject3D===!0&&(s=this.Versioning.MatrixWorldNeedsUpdate);let c=this.BindingType.Direct;if(a!==void 0){if(i===`morphTargetInfluences`){if(!t.geometry){f(`PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.`,this);return}if(!t.geometry.morphAttributes){f(`PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.`,this);return}t.morphTargetDictionary[a]!==void 0&&(a=t.morphTargetDictionary[a])}c=this.BindingType.ArrayElement,this.resolvedProperty=o,this.propertyIndex=a}else o.fromArray!==void 0&&o.toArray!==void 0?(c=this.BindingType.HasFromToArray,this.resolvedProperty=o):Array.isArray(o)?(c=this.BindingType.EntireArray,this.resolvedProperty=o):this.propertyName=i;this.getValue=this.GetterByBindingType[c],this.setValue=this.SetterByBindingTypeAndVersioning[c][s]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}},ns.Composite=ts,ns.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},ns.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},ns.prototype.GetterByBindingType=[ns.prototype._getValue_direct,ns.prototype._getValue_array,ns.prototype._getValue_arrayElement,ns.prototype._getValue_toArray],ns.prototype.SetterByBindingTypeAndVersioning=[[ns.prototype._setValue_direct,ns.prototype._setValue_direct_setNeedsUpdate,ns.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[ns.prototype._setValue_array,ns.prototype._setValue_array_setNeedsUpdate,ns.prototype._setValue_array_setMatrixWorldNeedsUpdate],[ns.prototype._setValue_arrayElement,ns.prototype._setValue_arrayElement_setNeedsUpdate,ns.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[ns.prototype._setValue_fromArray,ns.prototype._setValue_fromArray_setNeedsUpdate,ns.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]],rs=class{constructor(e=1,t=0,n=0){this.radius=e,this.phi=t,this.theta=n}set(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){let e=1e-6;return this.phi=g(this.phi,e,Math.PI-e),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,n){return this.radius=Math.sqrt(e*e+t*t+n*n),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,n),this.phi=Math.acos(g(t/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}},class e{static{e.prototype.isMatrix2=!0}constructor(e,t,n,r){this.elements=[1,0,0,1],e!==void 0&&this.set(e,t,n,r)}identity(){return this.set(1,0,0,1),this}fromArray(e,t=0){for(let n=0;n<4;n++)this.elements[n]=e[n+t];return this}set(e,t,n,r){let i=this.elements;return i[0]=e,i[2]=t,i[1]=n,i[3]=r,this}},is=class extends cn{constructor(e,t=null){super(),this.object=e,this.domElement=t,this.enabled=!0,this.state=-1,this.keys={},this.mouseButtons={LEFT:null,MIDDLE:null,RIGHT:null},this.touches={ONE:null,TWO:null}}connect(e){if(e===void 0){d(`Controls: connect() now requires an element.`);return}this.domElement!==null&&this.disconnect(),this.domElement=e}disconnect(){}dispose(){}update(){}},typeof __THREE_DEVTOOLS__<`u`&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent(`register`,{detail:{revision:`185`}})),typeof window<`u`&&(window.__THREE__?d(`WARNING: Multiple instances of Three.js being imported.`):window.__THREE__=`185`)}));function os(){let e=null,t=!1,n=null,r=null;function i(t,a){n(t,a),r=e.requestAnimationFrame(i)}return{start:function(){t!==!0&&n!==null&&e!==null&&(r=e.requestAnimationFrame(i),t=!0)},stop:function(){e!==null&&e.cancelAnimationFrame(r),t=!1},setAnimationLoop:function(e){n=e},setContext:function(t){e=t}}}function ss(e){let t=new WeakMap;function n(t,n){let r=t.array,i=t.usage,a=r.byteLength,o=e.createBuffer();e.bindBuffer(n,o),e.bufferData(n,r,i),t.onUploadCallback();let s;if(r instanceof Float32Array)s=e.FLOAT;else if(typeof Float16Array<`u`&&r instanceof Float16Array)s=e.HALF_FLOAT;else if(r instanceof Uint16Array)s=t.isFloat16BufferAttribute?e.HALF_FLOAT:e.UNSIGNED_SHORT;else if(r instanceof Int16Array)s=e.SHORT;else if(r instanceof Uint32Array)s=e.UNSIGNED_INT;else if(r instanceof Int32Array)s=e.INT;else if(r instanceof Int8Array)s=e.BYTE;else if(r instanceof Uint8Array)s=e.UNSIGNED_BYTE;else if(r instanceof Uint8ClampedArray)s=e.UNSIGNED_BYTE;else throw Error(`THREE.WebGLAttributes: Unsupported buffer data format: `+r);return{buffer:o,type:s,bytesPerElement:r.BYTES_PER_ELEMENT,version:t.version,size:a}}function r(t,n,r){let i=n.array,a=n.updateRanges;if(e.bindBuffer(r,t),a.length===0)e.bufferSubData(r,0,i);else{a.sort((e,t)=>e.start-t.start);let t=0;for(let e=1;e<a.length;e++){let n=a[t],r=a[e];r.start<=n.start+n.count+1?n.count=Math.max(n.count,r.start+r.count-n.start):(++t,a[t]=r)}a.length=t+1;for(let t=0,n=a.length;t<n;t++){let n=a[t];e.bufferSubData(r,n.start*i.BYTES_PER_ELEMENT,i,n.start,n.count)}n.clearUpdateRanges()}n.onUploadCallback()}function i(e){return e.isInterleavedBufferAttribute&&(e=e.data),t.get(e)}function a(n){n.isInterleavedBufferAttribute&&(n=n.data);let r=t.get(n);r&&(e.deleteBuffer(r.buffer),t.delete(n))}function o(e,i){if(e.isInterleavedBufferAttribute&&(e=e.data),e.isGLBufferAttribute){let n=t.get(e);(!n||n.version<e.version)&&t.set(e,{buffer:e.buffer,type:e.type,bytesPerElement:e.elementSize,version:e.version});return}let a=t.get(e);if(a===void 0)t.set(e,n(e,i));else if(a.version<e.version){if(a.size!==e.array.byteLength)throw Error(`THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.`);r(a.buffer,e,i),a.version=e.version}}return{get:i,remove:a,update:o}}function cs(e,t,n,r,i,a){let o=new z(0),s=i===!0?0:1,c,l,u=null,d=0,f=null;function p(e){let n=e.isScene===!0?e.background:null;if(n&&n.isTexture){let r=e.backgroundBlurriness>0;n=t.get(n,r)}return n}function m(t){let r=!1,i=p(t);i===null?g(o,s):i&&i.isColor&&(g(i,1),r=!0);let c=e.xr.getEnvironmentBlendMode();c===`additive`?n.buffers.color.setClear(0,0,0,1,a):c===`alpha-blend`&&n.buffers.color.setClear(0,0,0,0,a),(e.autoClear||r)&&(n.buffers.depth.setTest(!0),n.buffers.depth.setMask(!0),n.buffers.color.setMask(!0),e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil))}function h(t,n){let i=p(n);i&&(i.isCubeTexture||i.mapping===306)?(l===void 0&&(l=new Ni(new Fa(1,1,1),new Ba({name:`BackgroundCubeMaterial`,uniforms:he(dl.backgroundCube.uniforms),vertexShader:dl.backgroundCube.vertexShader,fragmentShader:dl.backgroundCube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),l.geometry.deleteAttribute(`normal`),l.geometry.deleteAttribute(`uv`),l.onBeforeRender=function(e,t,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(l.material,\"envMap\",{get:function(){return this.uniforms.envMap.value}}),r.update(l)),l.material.uniforms.envMap.value=i,l.material.uniforms.backgroundBlurriness.value=n.backgroundBlurriness,l.material.uniforms.backgroundIntensity.value=n.backgroundIntensity,l.material.uniforms.backgroundRotation.value.setFromMatrix4(pl.makeRotationFromEuler(n.backgroundRotation)).transpose(),i.isCubeTexture&&i.isRenderTargetTexture===!1&&l.material.uniforms.backgroundRotation.value.premultiply(ml),l.material.toneMapped=bn.getTransfer(i.colorSpace)!==en,(u!==i||d!==i.version||f!==e.toneMapping)&&(l.material.needsUpdate=!0,u=i,d=i.version,f=e.toneMapping),l.layers.enableAll(),t.unshift(l,l.geometry,l.material,0,0,null)):i&&i.isTexture&&(c===void 0&&(c=new Ni(new Ia(2,2),new Ba({name:`BackgroundMaterial`,uniforms:he(dl.background.uniforms),vertexShader:dl.background.vertexShader,fragmentShader:dl.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),c.geometry.deleteAttribute(`normal`),Object.defineProperty(c.material,\"map\",{get:function(){return this.uniforms.t2D.value}}),r.update(c)),c.material.uniforms.t2D.value=i,c.material.uniforms.backgroundIntensity.value=n.backgroundIntensity,c.material.toneMapped=bn.getTransfer(i.colorSpace)!==en,i.matrixAutoUpdate===!0&&i.updateMatrix(),c.material.uniforms.uvTransform.value.copy(i.matrix),(u!==i||d!==i.version||f!==e.toneMapping)&&(c.material.needsUpdate=!0,u=i,d=i.version,f=e.toneMapping),c.layers.enableAll(),t.unshift(c,c.geometry,c.material,0,0,null))}function g(t,r){t.getRGB(fl,ye(e)),n.buffers.color.setClear(fl.r,fl.g,fl.b,r,a)}function _(){l!==void 0&&(l.geometry.dispose(),l.material.dispose(),l=void 0),c!==void 0&&(c.geometry.dispose(),c.material.dispose(),c=void 0)}return{getClearColor:function(){return o},setClearColor:function(e,t=1){o.set(e),s=t,g(o,s)},getClearAlpha:function(){return s},setClearAlpha:function(e){s=e,g(o,s)},render:m,addToRenderList:h,dispose:_}}function ls(e,t){let n=e.getParameter(e.MAX_VERTEX_ATTRIBS),r={},i=f(null),a=i,o=!1;function s(n,r,i,s,c){let u=!1,f=d(n,s,i,r);a!==f&&(a=f,l(a.object)),u=p(n,s,i,c),u&&m(n,s,i,c),c!==null&&t.update(c,e.ELEMENT_ARRAY_BUFFER),(u||o)&&(o=!1,b(n,r,i,s),c!==null&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t.get(c).buffer))}function c(){return e.createVertexArray()}function l(t){return e.bindVertexArray(t)}function u(t){return e.deleteVertexArray(t)}function d(e,t,n,i){let a=i.wireframe===!0,o=r[t.id];o===void 0&&(o={},r[t.id]=o);let s=e.isInstancedMesh===!0?e.id:0,l=o[s];l===void 0&&(l={},o[s]=l);let u=l[n.id];u===void 0&&(u={},l[n.id]=u);let d=u[a];return d===void 0&&(d=f(c()),u[a]=d),d}function f(e){let t=[],r=[],i=[];for(let e=0;e<n;e++)t[e]=0,r[e]=0,i[e]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:t,enabledAttributes:r,attributeDivisors:i,object:e,attributes:{},index:null}}function p(e,t,n,r){let i=a.attributes,o=t.attributes,s=0,c=n.getAttributes();for(let t in c)if(c[t].location>=0){let n=i[t],r=o[t];if(r===void 0&&(t===`instanceMatrix`&&e.instanceMatrix&&(r=e.instanceMatrix),t===`instanceColor`&&e.instanceColor&&(r=e.instanceColor)),n===void 0||n.attribute!==r||r&&n.data!==r.data)return!0;s++}return a.attributesNum!==s||a.index!==r}function m(e,t,n,r){let i={},o=t.attributes,s=0,c=n.getAttributes();for(let t in c)if(c[t].location>=0){let n=o[t];n===void 0&&(t===`instanceMatrix`&&e.instanceMatrix&&(n=e.instanceMatrix),t===`instanceColor`&&e.instanceColor&&(n=e.instanceColor));let r={};r.attribute=n,n&&n.data&&(r.data=n.data),i[t]=r,s++}a.attributes=i,a.attributesNum=s,a.index=r}function h(){let e=a.newAttributes;for(let t=0,n=e.length;t<n;t++)e[t]=0}function g(e){_(e,0)}function _(t,n){let r=a.newAttributes,i=a.enabledAttributes,o=a.attributeDivisors;r[t]=1,i[t]===0&&(e.enableVertexAttribArray(t),i[t]=1),o[t]!==n&&(e.vertexAttribDivisor(t,n),o[t]=n)}function v(){let t=a.newAttributes,n=a.enabledAttributes;for(let r=0,i=n.length;r<i;r++)n[r]!==t[r]&&(e.disableVertexAttribArray(r),n[r]=0)}function y(t,n,r,i,a,o,s){s===!0?e.vertexAttribIPointer(t,n,r,a,o):e.vertexAttribPointer(t,n,r,i,a,o)}function b(n,r,i,a){h();let o=a.attributes,s=i.getAttributes(),c=r.defaultAttributeValues;for(let r in s){let i=s[r];if(i.location>=0){let s=o[r];if(s===void 0&&(r===`instanceMatrix`&&n.instanceMatrix&&(s=n.instanceMatrix),r===`instanceColor`&&n.instanceColor&&(s=n.instanceColor)),s!==void 0){let r=s.normalized,o=s.itemSize,c=t.get(s);if(c===void 0)continue;let l=c.buffer,u=c.type,d=c.bytesPerElement,f=u===e.INT||u===e.UNSIGNED_INT||s.gpuType===1013;if(s.isInterleavedBufferAttribute){let t=s.data,c=t.stride,p=s.offset;if(t.isInstancedInterleavedBuffer){for(let e=0;e<i.locationSize;e++)_(i.location+e,t.meshPerAttribute);n.isInstancedMesh!==!0&&a._maxInstanceCount===void 0&&(a._maxInstanceCount=t.meshPerAttribute*t.count)}else for(let e=0;e<i.locationSize;e++)g(i.location+e);e.bindBuffer(e.ARRAY_BUFFER,l);for(let e=0;e<i.locationSize;e++)y(i.location+e,o/i.locationSize,u,r,c*d,(p+o/i.locationSize*e)*d,f)}else{if(s.isInstancedBufferAttribute){for(let e=0;e<i.locationSize;e++)_(i.location+e,s.meshPerAttribute);n.isInstancedMesh!==!0&&a._maxInstanceCount===void 0&&(a._maxInstanceCount=s.meshPerAttribute*s.count)}else for(let e=0;e<i.locationSize;e++)g(i.location+e);e.bindBuffer(e.ARRAY_BUFFER,l);for(let e=0;e<i.locationSize;e++)y(i.location+e,o/i.locationSize,u,r,o*d,o/i.locationSize*e*d,f)}}else if(c!==void 0){let t=c[r];if(t!==void 0)switch(t.length){case 2:e.vertexAttrib2fv(i.location,t);break;case 3:e.vertexAttrib3fv(i.location,t);break;case 4:e.vertexAttrib4fv(i.location,t);break;default:e.vertexAttrib1fv(i.location,t)}}}}v()}function x(){T();for(let e in r){let t=r[e];for(let e in t){let n=t[e];for(let e in n){let t=n[e];for(let e in t)u(t[e].object),delete t[e];delete n[e]}}delete r[e]}}function S(e){if(r[e.id]===void 0)return;let t=r[e.id];for(let e in t){let n=t[e];for(let e in n){let t=n[e];for(let e in t)u(t[e].object),delete t[e];delete n[e]}}delete r[e.id]}function C(e){for(let t in r){let n=r[t];for(let t in n){let r=n[t];if(r[e.id]===void 0)continue;let i=r[e.id];for(let e in i)u(i[e].object),delete i[e];delete r[e.id]}}}function w(e){for(let t in r){let n=r[t],i=e.isInstancedMesh===!0?e.id:0,a=n[i];if(a!==void 0){for(let e in a){let t=a[e];for(let e in t)u(t[e].object),delete t[e];delete a[e]}delete n[i],Object.keys(n).length===0&&delete r[t]}}}function T(){E(),o=!0,a!==i&&(a=i,l(a.object))}function E(){i.geometry=null,i.program=null,i.wireframe=!1}return{setup:s,reset:T,resetDefaultState:E,dispose:x,releaseStatesOfGeometry:S,releaseStatesOfObject:w,releaseStatesOfProgram:C,initAttributes:h,enableAttribute:g,disableUnusedAttributes:v}}function us(e,t,n){let r;function i(e){r=e}function a(t,i){e.drawArrays(r,t,i),n.update(i,r,1)}function o(t,i,a){a!==0&&(e.drawArraysInstanced(r,t,i,a),n.update(i,r,a))}function s(e,i,a){if(a===0)return;t.get(`WEBGL_multi_draw`).multiDrawArraysWEBGL(r,e,0,i,0,a);let o=0;for(let e=0;e<a;e++)o+=i[e];n.update(o,r,1)}this.setMode=i,this.render=a,this.renderInstances=o,this.renderMultiDraw=s}function ds(e,t,n,r){let i;function a(){if(i!==void 0)return i;if(t.has(`EXT_texture_filter_anisotropic`)===!0){let n=t.get(`EXT_texture_filter_anisotropic`);i=e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i}function o(t){return t===1023||r.convert(t)===e.getParameter(e.IMPLEMENTATION_COLOR_READ_FORMAT)}function s(n){let i=n===1016&&(t.has(`EXT_color_buffer_half_float`)||t.has(`EXT_color_buffer_float`));return!(n!==1009&&r.convert(n)!==e.getParameter(e.IMPLEMENTATION_COLOR_READ_TYPE)&&n!==1015&&!i)}function c(t){if(t===`highp`){if(e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision>0)return`highp`;t=`mediump`}return t===`mediump`&&e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).precision>0?`mediump`:`lowp`}let l=n.precision===void 0?`highp`:n.precision,u=c(l);u!==l&&(d(`WebGLRenderer:`,l,`not supported, using`,u,`instead.`),l=u);let f=n.logarithmicDepthBuffer===!0,p=n.reversedDepthBuffer===!0&&t.has(`EXT_clip_control`);n.reversedDepthBuffer===!0&&p===!1&&d(`WebGLRenderer: Unable to use reversed depth buffer due to missing EXT_clip_control extension. Fallback to default depth buffer.`);let m=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),h=e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),g=e.getParameter(e.MAX_TEXTURE_SIZE),_=e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),v=e.getParameter(e.MAX_VERTEX_ATTRIBS),y=e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),b=e.getParameter(e.MAX_VARYING_VECTORS),x=e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),S=e.getParameter(e.MAX_SAMPLES),C=e.getParameter(e.SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:a,getMaxPrecision:c,textureFormatReadable:o,textureTypeReadable:s,precision:l,logarithmicDepthBuffer:f,reversedDepthBuffer:p,maxTextures:m,maxVertexTextures:h,maxTextureSize:g,maxCubemapSize:_,maxAttributes:v,maxVertexUniforms:y,maxVaryings:b,maxFragmentUniforms:x,maxSamples:S,samples:C}}function fs(e){let t=this,n=null,r=0,i=!1,a=!1,o=new sa,s=new R,c={value:null,needsUpdate:!1};this.uniform=c,this.numPlanes=0,this.numIntersection=0,this.init=function(e,t){let n=e.length!==0||t||r!==0||i;return i=t,r=e.length,n},this.beginShadows=function(){a=!0,u(null)},this.endShadows=function(){a=!1},this.setGlobalState=function(e,t){n=u(e,t,0)},this.setState=function(t,o,s){let d=t.clippingPlanes,f=t.clipIntersection,p=t.clipShadows,m=e.get(t);if(!i||d===null||d.length===0||a&&!p)a?u(null):l();else{let e=a?0:r,t=e*4,i=m.clippingState||null;c.value=i,i=u(d,o,t,s);for(let e=0;e!==t;++e)i[e]=n[e];m.clippingState=i,this.numIntersection=f?this.numPlanes:0,this.numPlanes+=e}};function l(){c.value!==n&&(c.value=n,c.needsUpdate=r>0),t.numPlanes=r,t.numIntersection=0}function u(e,n,r,i){let a=e===null?0:e.length,l=null;if(a!==0){if(l=c.value,i!==!0||l===null){let t=r+a*4,i=n.matrixWorldInverse;s.getNormalMatrix(i),(l===null||l.length<t)&&(l=new Float32Array(t));for(let t=0,n=r;t!==a;++t,n+=4)o.copy(e[t]).applyMatrix4(i,s),o.normal.toArray(l,n),l[n+3]=o.constant}c.value=l,c.needsUpdate=!0}return t.numPlanes=a,t.numIntersection=0,l}}function ps(e){let t=[],n=[],r=[],i=e,a=e-hl+1+gl.length;for(let o=0;o<a;o++){let a=2**i;t.push(a);let s=1/a;o>e-hl?s=gl[o-e+hl-1]:o===0&&(s=0),n.push(s);let c=1/(a-2),l=-c,u=1+c,d=[l,l,u,l,u,u,l,l,u,u,l,u],f=new Float32Array(108),p=new Float32Array(72),m=new Float32Array(36);for(let e=0;e<6;e++){let t=e%3*2/3-1,n=e>2?0:-1,r=[t,n,0,t+2/3,n,0,t+2/3,n+1,0,t,n,0,t+2/3,n+1,0,t,n+1,0];f.set(r,18*e),p.set(d,12*e);let i=[e,e,e,e,e,e];m.set(i,6*e)}let h=new si;h.setAttribute(`position`,new Kr(f,3)),h.setAttribute(`uv`,new Kr(p,2)),h.setAttribute(`faceIndex`,new Kr(m,1)),r.push(new Ni(h,null)),i>hl&&i--}return{lodMeshes:r,sizeLods:t,sigmas:n}}function ms(e,t,n){let r=new An(e,t,n);return r.texture.mapping=306,r.texture.name=`PMREM.cubeUv`,r.scissorTest=!0,r}function hs(e,t,n,r,i){e.viewport.set(t,n,r,i),e.scissor.set(t,n,r,i)}function gs(e,t,n){return new Ba({name:`PMREMGGXConvolution`,defines:{GGX_SAMPLES:vl,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${e}.0`},uniforms:{envMap:{value:null},roughness:{value:0},mipInt:{value:0}},vertexShader:bs(),fragmentShader:`\n\n\t\t\tprecision highp float;\n\t\t\tprecision highp int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform float roughness;\n\t\t\tuniform float mipInt;\n\n\t\t\t#define ENVMAP_TYPE_CUBE_UV\n\t\t\t#include <cube_uv_reflection_fragment>\n\n\t\t\t#define PI 3.14159265359\n\n\t\t\t// Van der Corput radical inverse\n\t\t\tfloat radicalInverse_VdC(uint bits) {\n\t\t\t\tbits = (bits << 16u) | (bits >> 16u);\n\t\t\t\tbits = ((bits & 0x55555555u) << 1u) | ((bits & 0xAAAAAAAAu) >> 1u);\n\t\t\t\tbits = ((bits & 0x33333333u) << 2u) | ((bits & 0xCCCCCCCCu) >> 2u);\n\t\t\t\tbits = ((bits & 0x0F0F0F0Fu) << 4u) | ((bits & 0xF0F0F0F0u) >> 4u);\n\t\t\t\tbits = ((bits & 0x00FF00FFu) << 8u) | ((bits & 0xFF00FF00u) >> 8u);\n\t\t\t\treturn float(bits) * 2.3283064365386963e-10; // / 0x100000000\n\t\t\t}\n\n\t\t\t// Hammersley sequence\n\t\t\tvec2 hammersley(uint i, uint N) {\n\t\t\t\treturn vec2(float(i) / float(N), radicalInverse_VdC(i));\n\t\t\t}\n\n\t\t\t// GGX VNDF importance sampling (Eric Heitz 2018)\n\t\t\t// \"Sampling the GGX Distribution of Visible Normals\"\n\t\t\t// https://jcgt.org/published/0007/04/01/\n\t\t\tvec3 importanceSampleGGX_VNDF(vec2 Xi, vec3 V, float roughness) {\n\t\t\t\tfloat alpha = roughness * roughness;\n\n\t\t\t\t// Section 4.1: Orthonormal basis\n\t\t\t\tvec3 T1 = vec3(1.0, 0.0, 0.0);\n\t\t\t\tvec3 T2 = cross(V, T1);\n\n\t\t\t\t// Section 4.2: Parameterization of projected area\n\t\t\t\tfloat r = sqrt(Xi.x);\n\t\t\t\tfloat phi = 2.0 * PI * Xi.y;\n\t\t\t\tfloat t1 = r * cos(phi);\n\t\t\t\tfloat t2 = r * sin(phi);\n\t\t\t\tfloat s = 0.5 * (1.0 + V.z);\n\t\t\t\tt2 = (1.0 - s) * sqrt(1.0 - t1 * t1) + s * t2;\n\n\t\t\t\t// Section 4.3: Reprojection onto hemisphere\n\t\t\t\tvec3 Nh = t1 * T1 + t2 * T2 + sqrt(max(0.0, 1.0 - t1 * t1 - t2 * t2)) * V;\n\n\t\t\t\t// Section 3.4: Transform back to ellipsoid configuration\n\t\t\t\treturn normalize(vec3(alpha * Nh.x, alpha * Nh.y, max(0.0, Nh.z)));\n\t\t\t}\n\n\t\t\tvoid main() {\n\t\t\t\tvec3 N = normalize(vOutputDirection);\n\t\t\t\tvec3 V = N; // Assume view direction equals normal for pre-filtering\n\n\t\t\t\tvec3 prefilteredColor = vec3(0.0);\n\t\t\t\tfloat totalWeight = 0.0;\n\n\t\t\t\t// For very low roughness, just sample the environment directly\n\t\t\t\tif (roughness < 0.001) {\n\t\t\t\t\tgl_FragColor = vec4(bilinearCubeUV(envMap, N, mipInt), 1.0);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Tangent space basis for VNDF sampling\n\t\t\t\tvec3 up = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0);\n\t\t\t\tvec3 tangent = normalize(cross(up, N));\n\t\t\t\tvec3 bitangent = cross(N, tangent);\n\n\t\t\t\tfor(uint i = 0u; i < uint(GGX_SAMPLES); i++) {\n\t\t\t\t\tvec2 Xi = hammersley(i, uint(GGX_SAMPLES));\n\n\t\t\t\t\t// For PMREM, V = N, so in tangent space V is always (0, 0, 1)\n\t\t\t\t\tvec3 H_tangent = importanceSampleGGX_VNDF(Xi, vec3(0.0, 0.0, 1.0), roughness);\n\n\t\t\t\t\t// Transform H back to world space\n\t\t\t\t\tvec3 H = normalize(tangent * H_tangent.x + bitangent * H_tangent.y + N * H_tangent.z);\n\t\t\t\t\tvec3 L = normalize(2.0 * dot(V, H) * H - V);\n\n\t\t\t\t\tfloat NdotL = max(dot(N, L), 0.0);\n\n\t\t\t\t\tif(NdotL > 0.0) {\n\t\t\t\t\t\t// Sample environment at fixed mip level\n\t\t\t\t\t\t// VNDF importance sampling handles the distribution filtering\n\t\t\t\t\t\tvec3 sampleColor = bilinearCubeUV(envMap, L, mipInt);\n\n\t\t\t\t\t\t// Weight by NdotL for the split-sum approximation\n\t\t\t\t\t\t// VNDF PDF naturally accounts for the visible microfacet distribution\n\t\t\t\t\t\tprefilteredColor += sampleColor * NdotL;\n\t\t\t\t\t\ttotalWeight += NdotL;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (totalWeight > 0.0) {\n\t\t\t\t\tprefilteredColor = prefilteredColor / totalWeight;\n\t\t\t\t}\n\n\t\t\t\tgl_FragColor = vec4(prefilteredColor, 1.0);\n\t\t\t}\n\t\t`,blending:0,depthTest:!1,depthWrite:!1})}function _s(e,t,n){let r=new Float32Array(_l),i=new L(0,1,0);return new Ba({name:`SphericalGaussianBlur`,defines:{n:_l,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${e}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:r},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:bs(),fragmentShader:`\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform int samples;\n\t\t\tuniform float weights[ n ];\n\t\t\tuniform bool latitudinal;\n\t\t\tuniform float dTheta;\n\t\t\tuniform float mipInt;\n\t\t\tuniform vec3 poleAxis;\n\n\t\t\t#define ENVMAP_TYPE_CUBE_UV\n\t\t\t#include <cube_uv_reflection_fragment>\n\n\t\t\tvec3 getSample( float theta, vec3 axis ) {\n\n\t\t\t\tfloat cosTheta = cos( theta );\n\t\t\t\t// Rodrigues' axis-angle rotation\n\t\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross( axis, vOutputDirection ) * sin( theta )\n\t\t\t\t\t+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\n\n\t\t\t\treturn bilinearCubeUV( envMap, sampleDirection, mipInt );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\n\n\t\t\t\tif ( all( equal( axis, vec3( 0.0 ) ) ) ) {\n\n\t\t\t\t\taxis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\n\n\t\t\t\t}\n\n\t\t\t\taxis = normalize( axis );\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\n\n\t\t\t\tfor ( int i = 1; i < n; i++ ) {\n\n\t\t\t\t\tif ( i >= samples ) {\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfloat theta = dTheta * float( i );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t`,blending:0,depthTest:!1,depthWrite:!1})}function vs(){return new Ba({name:`EquirectangularToCubeUV`,uniforms:{envMap:{value:null}},vertexShader:bs(),fragmentShader:`\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\n\t\t\t#include <common>\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tgl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );\n\n\t\t\t}\n\t\t`,blending:0,depthTest:!1,depthWrite:!1})}function ys(){return new Ba({name:`CubemapToCubeUV`,uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:bs(),fragmentShader:`\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tuniform float flipEnvMap;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform samplerCube envMap;\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );\n\n\t\t\t}\n\t\t`,blending:0,depthTest:!1,depthWrite:!1})}function bs(){return`\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t`}function xs(e){let t=new WeakMap,n=new WeakMap,r=null;function i(e,t=!1){return e==null?null:t?o(e):a(e)}function a(n){if(n&&n.isTexture){let r=n.mapping;if(r===303||r===304){if(t.has(n)){let e=t.get(n).texture;return s(e,n.mapping)}{let r=n.image;if(r&&r.height>0){let i=new Dl(r.height);return i.fromEquirectangularTexture(e,n),t.set(n,i),n.addEventListener(`dispose`,l),s(i.texture,n.mapping)}return null}}}return n}function o(t){if(t&&t.isTexture){let i=t.mapping,a=i===303||i===304,o=i===301||i===302;if(a||o){let i=n.get(t),s=i===void 0?0:i.texture.pmremVersion;if(t.isRenderTargetTexture&&t.pmremVersion!==s)return r===null&&(r=new El(e)),i=a?r.fromEquirectangular(t,i):r.fromCubemap(t,i),i.texture.pmremVersion=t.pmremVersion,n.set(t,i),i.texture;if(i!==void 0)return i.texture;{let s=t.image;return a&&s&&s.height>0||o&&s&&c(s)?(r===null&&(r=new El(e)),i=a?r.fromEquirectangular(t):r.fromCubemap(t),i.texture.pmremVersion=t.pmremVersion,n.set(t,i),t.addEventListener(`dispose`,u),i.texture):null}}}return t}function s(e,t){return t===303?e.mapping=301:t===304&&(e.mapping=302),e}function c(e){let t=0;for(let n=0;n<6;n++)e[n]!==void 0&&t++;return t===6}function l(e){let n=e.target;n.removeEventListener(`dispose`,l);let r=t.get(n);r!==void 0&&(t.delete(n),r.dispose())}function u(e){let t=e.target;t.removeEventListener(`dispose`,u);let r=n.get(t);r!==void 0&&(n.delete(t),r.dispose())}function d(){t=new WeakMap,n=new WeakMap,r!==null&&(r.dispose(),r=null)}return{get:i,dispose:d}}function Ss(e){let t={};function n(n){if(t[n]!==void 0)return t[n];let r=e.getExtension(n);return t[n]=r,r}return{has:function(e){return n(e)!==null},init:function(){n(`EXT_color_buffer_float`),n(`WEBGL_clip_cull_distance`),n(`OES_texture_float_linear`),n(`EXT_color_buffer_half_float`),n(`WEBGL_multisampled_render_to_texture`),n(`WEBGL_render_shared_exponent`)},get:function(e){let t=n(e);return t===null&&p(`WebGLRenderer: `+e+` extension not supported.`),t}}}function Cs(e,t,n,r){let i={},a=new WeakMap;function o(e){let s=e.target;s.index!==null&&t.remove(s.index);for(let e in s.attributes)t.remove(s.attributes[e]);s.removeEventListener(`dispose`,o),delete i[s.id];let c=a.get(s);c&&(t.remove(c),a.delete(s)),r.releaseStatesOfGeometry(s),s.isInstancedBufferGeometry===!0&&delete s._maxInstanceCount,n.memory.geometries--}function s(e,t){return i[t.id]===!0?t:(t.addEventListener(`dispose`,o),i[t.id]=!0,n.memory.geometries++,t)}function c(n){let r=n.attributes;for(let n in r)t.update(r[n],e.ARRAY_BUFFER)}function l(e){let n=[],r=e.index,i=e.attributes.position,o=0;if(i===void 0)return;if(r!==null){let e=r.array;o=r.version;for(let t=0,r=e.length;t<r;t+=3){let r=e[t+0],i=e[t+1],a=e[t+2];n.push(r,i,i,a,a,r)}}else{let e=i.array;o=i.version;for(let t=0,r=e.length/3-1;t<r;t+=3){let e=t+0,r=t+1,i=t+2;n.push(e,r,r,i,i,e)}}let s=new(i.count>=65535?Jr:qr)(n,1);s.version=o;let c=a.get(e);c&&t.remove(c),a.set(e,s)}function u(e){let t=a.get(e);if(t){let n=e.index;n!==null&&t.version<n.version&&l(e)}else l(e);return a.get(e)}return{get:s,update:c,getWireframeAttribute:u}}function ws(e,t,n){let r;function i(e){r=e}let a,o;function s(e){a=e.type,o=e.bytesPerElement}function c(t,i){e.drawElements(r,i,a,t*o),n.update(i,r,1)}function l(t,i,s){s!==0&&(e.drawElementsInstanced(r,i,a,t*o,s),n.update(i,r,s))}function u(e,i,o){if(o===0)return;t.get(`WEBGL_multi_draw`).multiDrawElementsWEBGL(r,i,0,a,e,0,o);let s=0;for(let e=0;e<o;e++)s+=i[e];n.update(s,r,1)}this.setMode=i,this.setIndex=s,this.render=c,this.renderInstances=l,this.renderMultiDraw=u}function Ts(e){let t={geometries:0,textures:0},n={frame:0,calls:0,triangles:0,points:0,lines:0};function r(t,r,i){switch(n.calls++,r){case e.TRIANGLES:n.triangles+=t/3*i;break;case e.LINES:n.lines+=t/2*i;break;case e.LINE_STRIP:n.lines+=i*(t-1);break;case e.LINE_LOOP:n.lines+=i*t;break;case e.POINTS:n.points+=i*t;break;default:f(`WebGLInfo: Unknown draw mode:`,r)}}function i(){n.calls=0,n.triangles=0,n.points=0,n.lines=0}return{memory:t,render:n,programs:null,autoReset:!0,reset:i,update:r}}function Es(e,t,n){let r=new WeakMap,i=new On;function a(a,o,s){let c=a.morphTargetInfluences,l=o.morphAttributes.position||o.morphAttributes.normal||o.morphAttributes.color,u=l===void 0?0:l.length,d=r.get(o);if(d===void 0||d.count!==u){d!==void 0&&d.texture.dispose();let e=o.morphAttributes.position!==void 0,n=o.morphAttributes.normal!==void 0,a=o.morphAttributes.color!==void 0,s=o.morphAttributes.position||[],c=o.morphAttributes.normal||[],l=o.morphAttributes.color||[],f=0;e===!0&&(f=1),n===!0&&(f=2),a===!0&&(f=3);let p=o.attributes.position.count*f,m=1;p>t.maxTextureSize&&(m=Math.ceil(p/t.maxTextureSize),p=t.maxTextureSize);let h=new Float32Array(p*m*4*u),g=new jn(h,p,m,u);g.type=Ue,g.needsUpdate=!0;let _=f*4;for(let t=0;t<u;t++){let r=s[t],o=c[t],u=l[t],d=p*m*4*t;for(let t=0;t<r.count;t++){let s=t*_;e===!0&&(i.fromBufferAttribute(r,t),h[d+s+0]=i.x,h[d+s+1]=i.y,h[d+s+2]=i.z,h[d+s+3]=0),n===!0&&(i.fromBufferAttribute(o,t),h[d+s+4]=i.x,h[d+s+5]=i.y,h[d+s+6]=i.z,h[d+s+7]=0),a===!0&&(i.fromBufferAttribute(u,t),h[d+s+8]=i.x,h[d+s+9]=i.y,h[d+s+10]=i.z,h[d+s+11]=u.itemSize===4?i.w:1)}}d={count:u,texture:g,size:new I(p,m)},r.set(o,d);function v(){g.dispose(),r.delete(o),o.removeEventListener(`dispose`,v)}o.addEventListener(`dispose`,v)}if(a.isInstancedMesh===!0&&a.morphTexture!==null)s.getUniforms().setValue(e,`morphTexture`,a.morphTexture,n);else{let t=0;for(let e=0;e<c.length;e++)t+=c[e];let n=o.morphTargetsRelative?1:1-t;s.getUniforms().setValue(e,`morphTargetBaseInfluence`,n),s.getUniforms().setValue(e,`morphTargetInfluences`,c)}s.getUniforms().setValue(e,`morphTargetsTexture`,d.texture,n),s.getUniforms().setValue(e,`morphTargetsTextureSize`,d.size)}return{update:a}}function Ds(e,t,n,r,i){let a=new WeakMap;function o(r){let o=i.render.frame,s=r.geometry,l=t.get(r,s);if(a.get(l)!==o&&(t.update(l),a.set(l,o)),r.isInstancedMesh&&(r.hasEventListener(`dispose`,c)===!1&&r.addEventListener(`dispose`,c),a.get(r)!==o&&(n.update(r.instanceMatrix,e.ARRAY_BUFFER),r.instanceColor!==null&&n.update(r.instanceColor,e.ARRAY_BUFFER),a.set(r,o))),r.isSkinnedMesh){let e=r.skeleton;a.get(e)!==o&&(e.update(),a.set(e,o))}return l}function s(){a=new WeakMap}function c(e){let t=e.target;t.removeEventListener(`dispose`,c),r.releaseStatesOfObject(t),n.remove(t.instanceMatrix),t.instanceColor!==null&&n.remove(t.instanceColor)}return{update:o,dispose:s}}function Os(e,t,n,r,i,a){let o=new An(t,n,{type:e,depthBuffer:i,stencilBuffer:a,samples:r?4:0,depthTexture:i?new Ma(t,n):void 0}),s=new An(t,n,{type:We,depthBuffer:!1,stencilBuffer:!1}),c=new si;c.setAttribute(`position`,new Yr([-1,3,0,-1,-1,0,3,-1,0],3)),c.setAttribute(`uv`,new Yr([0,2,0,0,2,0],2));let l=new Va({uniforms:{tDiffuse:{value:null}},vertexShader:`\n\t\t\tprecision highp float;\n\n\t\t\tuniform mat4 modelViewMatrix;\n\t\t\tuniform mat4 projectionMatrix;\n\n\t\t\tattribute vec3 position;\n\t\t\tattribute vec2 uv;\n\n\t\t\tvarying vec2 vUv;\n\n\t\t\tvoid main() {\n\t\t\t\tvUv = uv;\n\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t}`,fragmentShader:`\n\t\t\tprecision highp float;\n\n\t\t\tuniform sampler2D tDiffuse;\n\n\t\t\tvarying vec2 vUv;\n\n\t\t\t#include <tonemapping_pars_fragment>\n\t\t\t#include <colorspace_pars_fragment>\n\n\t\t\tvoid main() {\n\t\t\t\tgl_FragColor = texture2D( tDiffuse, vUv );\n\n\t\t\t\t#ifdef LINEAR_TONE_MAPPING\n\t\t\t\t\tgl_FragColor.rgb = LinearToneMapping( gl_FragColor.rgb );\n\t\t\t\t#elif defined( REINHARD_TONE_MAPPING )\n\t\t\t\t\tgl_FragColor.rgb = ReinhardToneMapping( gl_FragColor.rgb );\n\t\t\t\t#elif defined( CINEON_TONE_MAPPING )\n\t\t\t\t\tgl_FragColor.rgb = CineonToneMapping( gl_FragColor.rgb );\n\t\t\t\t#elif defined( ACES_FILMIC_TONE_MAPPING )\n\t\t\t\t\tgl_FragColor.rgb = ACESFilmicToneMapping( gl_FragColor.rgb );\n\t\t\t\t#elif defined( AGX_TONE_MAPPING )\n\t\t\t\t\tgl_FragColor.rgb = AgXToneMapping( gl_FragColor.rgb );\n\t\t\t\t#elif defined( NEUTRAL_TONE_MAPPING )\n\t\t\t\t\tgl_FragColor.rgb = NeutralToneMapping( gl_FragColor.rgb );\n\t\t\t\t#elif defined( CUSTOM_TONE_MAPPING )\n\t\t\t\t\tgl_FragColor.rgb = CustomToneMapping( gl_FragColor.rgb );\n\t\t\t\t#endif\n\n\t\t\t\t#ifdef SRGB_TRANSFER\n\t\t\t\t\tgl_FragColor = sRGBTransferOETF( gl_FragColor );\n\t\t\t\t#endif\n\t\t\t}`,depthTest:!1,depthWrite:!1}),u=new Ni(c,l),d=new Po(-1,1,1,-1,0,1),f=null,p=null,m=!1,h,g=null,_=[],v=!1;this.setSize=function(e,t){o.setSize(e,t),s.setSize(e,t);for(let n=0;n<_.length;n++){let r=_[n];r.setSize&&r.setSize(e,t)}},this.setEffects=function(e){_=e,v=_.length>0&&_[0].isRenderPass===!0;let t=o.width,n=o.height;for(let e=0;e<_.length;e++){let r=_[e];r.setSize&&r.setSize(t,n)}},this.begin=function(e,t){if(m||e.toneMapping===0&&_.length===0)return!1;if(g=t,t!==null){let e=t.width,n=t.height;(o.width!==e||o.height!==n)&&this.setSize(e,n)}return v===!1&&e.setRenderTarget(o),h=e.toneMapping,e.toneMapping=0,!0},this.hasRenderPass=function(){return v},this.end=function(e,t){e.toneMapping=h,m=!0;let n=o,r=s;for(let i=0;i<_.length;i++){let a=_[i];if(a.enabled!==!1&&(a.render(e,r,n,t),a.needsSwap!==!1)){let e=n;n=r,r=e}}if(f!==e.outputColorSpace||p!==e.toneMapping){f=e.outputColorSpace,p=e.toneMapping,l.defines={},bn.getTransfer(f)===`srgb`&&(l.defines.SRGB_TRANSFER=``);let t=Ol[p];t&&(l.defines[t]=``),l.needsUpdate=!0}l.uniforms.tDiffuse.value=n.texture,e.setRenderTarget(g),e.render(u,d),g=null,m=!1},this.isCompositing=function(){return m},this.dispose=function(){o.depthTexture&&o.depthTexture.dispose(),o.dispose(),s.dispose(),c.dispose(),l.dispose()}}function ks(e,t,n){let r=e[0];if(r<=0||r>0)return e;let i=t*n,a=Pl[i];if(a===void 0&&(a=new Float32Array(i),Pl[i]=a),t!==0){r.toArray(a,0);for(let r=1,i=0;r!==t;++r)i+=n,e[r].toArray(a,i)}return a}function As(e,t){if(e.length!==t.length)return!1;for(let n=0,r=e.length;n<r;n++)if(e[n]!==t[n])return!1;return!0}function js(e,t){for(let n=0,r=t.length;n<r;n++)e[n]=t[n]}function Ms(e,t){let n=Fl[t];n===void 0&&(n=new Int32Array(t),Fl[t]=n);for(let r=0;r!==t;++r)n[r]=e.allocateTextureUnit();return n}function Ns(e,t){let n=this.cache;n[0]!==t&&(e.uniform1f(this.addr,t),n[0]=t)}function Ps(e,t){let n=this.cache;if(t.x!==void 0)(n[0]!==t.x||n[1]!==t.y)&&(e.uniform2f(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y);else{if(As(n,t))return;e.uniform2fv(this.addr,t),js(n,t)}}function Fs(e,t){let n=this.cache;if(t.x!==void 0)(n[0]!==t.x||n[1]!==t.y||n[2]!==t.z)&&(e.uniform3f(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z);else if(t.r!==void 0)(n[0]!==t.r||n[1]!==t.g||n[2]!==t.b)&&(e.uniform3f(this.addr,t.r,t.g,t.b),n[0]=t.r,n[1]=t.g,n[2]=t.b);else{if(As(n,t))return;e.uniform3fv(this.addr,t),js(n,t)}}function Is(e,t){let n=this.cache;if(t.x!==void 0)(n[0]!==t.x||n[1]!==t.y||n[2]!==t.z||n[3]!==t.w)&&(e.uniform4f(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w);else{if(As(n,t))return;e.uniform4fv(this.addr,t),js(n,t)}}function Ls(e,t){let n=this.cache,r=t.elements;if(r===void 0){if(As(n,t))return;e.uniformMatrix2fv(this.addr,!1,t),js(n,t)}else{if(As(n,r))return;Rl.set(r),e.uniformMatrix2fv(this.addr,!1,Rl),js(n,r)}}function Rs(e,t){let n=this.cache,r=t.elements;if(r===void 0){if(As(n,t))return;e.uniformMatrix3fv(this.addr,!1,t),js(n,t)}else{if(As(n,r))return;Ll.set(r),e.uniformMatrix3fv(this.addr,!1,Ll),js(n,r)}}function zs(e,t){let n=this.cache,r=t.elements;if(r===void 0){if(As(n,t))return;e.uniformMatrix4fv(this.addr,!1,t),js(n,t)}else{if(As(n,r))return;Il.set(r),e.uniformMatrix4fv(this.addr,!1,Il),js(n,r)}}function Bs(e,t){let n=this.cache;n[0]!==t&&(e.uniform1i(this.addr,t),n[0]=t)}function Vs(e,t){let n=this.cache;if(t.x!==void 0)(n[0]!==t.x||n[1]!==t.y)&&(e.uniform2i(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y);else{if(As(n,t))return;e.uniform2iv(this.addr,t),js(n,t)}}function Hs(e,t){let n=this.cache;if(t.x!==void 0)(n[0]!==t.x||n[1]!==t.y||n[2]!==t.z)&&(e.uniform3i(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z);else{if(As(n,t))return;e.uniform3iv(this.addr,t),js(n,t)}}function Us(e,t){let n=this.cache;if(t.x!==void 0)(n[0]!==t.x||n[1]!==t.y||n[2]!==t.z||n[3]!==t.w)&&(e.uniform4i(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w);else{if(As(n,t))return;e.uniform4iv(this.addr,t),js(n,t)}}function Ws(e,t){let n=this.cache;n[0]!==t&&(e.uniform1ui(this.addr,t),n[0]=t)}function Gs(e,t){let n=this.cache;if(t.x!==void 0)(n[0]!==t.x||n[1]!==t.y)&&(e.uniform2ui(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y);else{if(As(n,t))return;e.uniform2uiv(this.addr,t),js(n,t)}}function Ks(e,t){let n=this.cache;if(t.x!==void 0)(n[0]!==t.x||n[1]!==t.y||n[2]!==t.z)&&(e.uniform3ui(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z);else{if(As(n,t))return;e.uniform3uiv(this.addr,t),js(n,t)}}function qs(e,t){let n=this.cache;if(t.x!==void 0)(n[0]!==t.x||n[1]!==t.y||n[2]!==t.z||n[3]!==t.w)&&(e.uniform4ui(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w);else{if(As(n,t))return;e.uniform4uiv(this.addr,t),js(n,t)}}function Js(e,t,n){let r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i);let a;this.type===e.SAMPLER_2D_SHADOW?(Al.compareFunction=n.isReversedDepthBuffer()?518:515,a=Al):a=kl,n.setTexture2D(t||a,i)}function Ys(e,t,n){let r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTexture3D(t||Ml,i)}function Xs(e,t,n){let r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTextureCube(t||Nl,i)}function Zs(e,t,n){let r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTexture2DArray(t||jl,i)}function Qs(e){switch(e){case 5126:return Ns;case 35664:return Ps;case 35665:return Fs;case 35666:return Is;case 35674:return Ls;case 35675:return Rs;case 35676:return zs;case 5124:case 35670:return Bs;case 35667:case 35671:return Vs;case 35668:case 35672:return Hs;case 35669:case 35673:return Us;case 5125:return Ws;case 36294:return Gs;case 36295:return Ks;case 36296:return qs;case 35678:case 36198:case 36298:case 36306:case 35682:return Js;case 35679:case 36299:case 36307:return Ys;case 35680:case 36300:case 36308:case 36293:return Xs;case 36289:case 36303:case 36311:case 36292:return Zs}}function $s(e,t){e.uniform1fv(this.addr,t)}function ec(e,t){let n=ks(t,this.size,2);e.uniform2fv(this.addr,n)}function tc(e,t){let n=ks(t,this.size,3);e.uniform3fv(this.addr,n)}function nc(e,t){let n=ks(t,this.size,4);e.uniform4fv(this.addr,n)}function rc(e,t){let n=ks(t,this.size,4);e.uniformMatrix2fv(this.addr,!1,n)}function ic(e,t){let n=ks(t,this.size,9);e.uniformMatrix3fv(this.addr,!1,n)}function ac(e,t){let n=ks(t,this.size,16);e.uniformMatrix4fv(this.addr,!1,n)}function oc(e,t){e.uniform1iv(this.addr,t)}function sc(e,t){e.uniform2iv(this.addr,t)}function cc(e,t){e.uniform3iv(this.addr,t)}function lc(e,t){e.uniform4iv(this.addr,t)}function uc(e,t){e.uniform1uiv(this.addr,t)}function dc(e,t){e.uniform2uiv(this.addr,t)}function fc(e,t){e.uniform3uiv(this.addr,t)}function pc(e,t){e.uniform4uiv(this.addr,t)}function mc(e,t,n){let r=this.cache,i=t.length,a=Ms(n,i);As(r,a)||(e.uniform1iv(this.addr,a),js(r,a));let o;o=this.type===e.SAMPLER_2D_SHADOW?Al:kl;for(let e=0;e!==i;++e)n.setTexture2D(t[e]||o,a[e])}function hc(e,t,n){let r=this.cache,i=t.length,a=Ms(n,i);As(r,a)||(e.uniform1iv(this.addr,a),js(r,a));for(let e=0;e!==i;++e)n.setTexture3D(t[e]||Ml,a[e])}function gc(e,t,n){let r=this.cache,i=t.length,a=Ms(n,i);As(r,a)||(e.uniform1iv(this.addr,a),js(r,a));for(let e=0;e!==i;++e)n.setTextureCube(t[e]||Nl,a[e])}function _c(e,t,n){let r=this.cache,i=t.length,a=Ms(n,i);As(r,a)||(e.uniform1iv(this.addr,a),js(r,a));for(let e=0;e!==i;++e)n.setTexture2DArray(t[e]||jl,a[e])}function vc(e){switch(e){case 5126:return $s;case 35664:return ec;case 35665:return tc;case 35666:return nc;case 35674:return rc;case 35675:return ic;case 35676:return ac;case 5124:case 35670:return oc;case 35667:case 35671:return sc;case 35668:case 35672:return cc;case 35669:case 35673:return lc;case 5125:return uc;case 36294:return dc;case 36295:return fc;case 36296:return pc;case 35678:case 36198:case 36298:case 36306:case 35682:return mc;case 35679:case 36299:case 36307:return hc;case 35680:case 36300:case 36308:case 36293:return gc;case 36289:case 36303:case 36311:case 36292:return _c}}function yc(e,t){e.seq.push(t),e.map[t.id]=t}function bc(e,t,n){let r=e.name,i=r.length;for(Hl.lastIndex=0;;){let a=Hl.exec(r),o=Hl.lastIndex,s=a[1],c=a[2]===`]`,l=a[3];if(c&&(s|=0),l===void 0||l===`[`&&o+2===i){yc(n,l===void 0?new zl(s,e,t):new Bl(s,e,t));break}{let e=n.map[s];e===void 0&&(e=new Vl(s),yc(n,e)),n=e}}}function xc(e,t,n){let r=e.createShader(t);return e.shaderSource(r,n),e.compileShader(r),r}function Sc(e,t){let n=e.split(`\n`),r=[],i=Math.max(t-6,0),a=Math.min(t+6,n.length);for(let e=i;e<a;e++){let i=e+1;r.push(`${i===t?`>`:` `} ${i}: ${n[e]}`)}return r.join(`\n`)}function Cc(e){bn._getMatrix(Kl,bn.workingColorSpace,e);let t=`mat3( ${Kl.elements.map(e=>e.toFixed(4))} )`;switch(bn.getTransfer(e)){case $t:return[t,`LinearTransferOETF`];case en:return[t,`sRGBTransferOETF`];default:return d(`WebGLProgram: Unsupported color space: `,e),[t,`LinearTransferOETF`]}}function wc(e,t,n){let r=e.getShaderParameter(t,e.COMPILE_STATUS),i=(e.getShaderInfoLog(t)||``).trim();if(r&&i===``)return``;let a=/ERROR: 0:(\\d+)/.exec(i);if(a){let r=parseInt(a[1]);return n.toUpperCase()+`\n\n`+i+`\n\n`+Sc(e.getShaderSource(t),r)}return i}function Tc(e,t){let n=Cc(t);return[`vec4 ${e}( vec4 value ) {`,`\treturn ${n[1]}( vec4( value.rgb * ${n[0]}, value.a ) );`,`}`].join(`\n`)}function Ec(e,t){let n=ql[t];return n===void 0?(d(`WebGLProgram: Unsupported toneMapping:`,t),`vec3 `+e+`( vec3 color ) { return LinearToneMapping( color ); }`):`vec3 `+e+`( vec3 color ) { return `+n+`ToneMapping( color ); }`}function Dc(){return bn.getLuminanceCoefficients(Jl),[`float luminance( const in vec3 rgb ) {`,`\tconst vec3 weights = vec3( ${Jl.x.toFixed(4)}, ${Jl.y.toFixed(4)}, ${Jl.z.toFixed(4)} );`,`\treturn dot( weights, rgb );`,`}`].join(`\n`)}function Oc(e){return[e.extensionClipCullDistance?`#extension GL_ANGLE_clip_cull_distance : require`:``,e.extensionMultiDraw?`#extension GL_ANGLE_multi_draw : require`:``].filter(jc).join(`\n`)}function kc(e){let t=[];for(let n in e){let r=e[n];r!==!1&&t.push(`#define `+n+` `+r)}return t.join(`\n`)}function Ac(e,t){let n={},r=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES);for(let i=0;i<r;i++){let r=e.getActiveAttrib(t,i),a=r.name,o=1;r.type===e.FLOAT_MAT2&&(o=2),r.type===e.FLOAT_MAT3&&(o=3),r.type===e.FLOAT_MAT4&&(o=4),n[a]={type:r.type,location:e.getAttribLocation(t,a),locationSize:o}}return n}function jc(e){return e!==``}function Mc(e,t){let n=t.numSpotLightShadows+t.numSpotLightMaps-t.numSpotLightShadowsWithMaps;return e.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_LIGHTS/g,t.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,t.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,n).replace(/NUM_RECT_AREA_LIGHTS/g,t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,t.numPointLights).replace(/NUM_HEMI_LIGHTS/g,t.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,t.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,t.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,t.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,t.numPointLightShadows)}function Nc(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}function Pc(e){return e.replace(Yl,Fc)}function Fc(e,t){let n=B[t];if(n===void 0){let e=Xl.get(t);if(e!==void 0)n=B[e],d(`WebGLRenderer: Shader chunk \"%s\" has been deprecated. Use \"%s\" instead.`,t,e);else throw Error(`THREE.WebGLProgram: Can not resolve #include <`+t+`>`)}return Pc(n)}function Ic(e){return e.replace(Zl,Lc)}function Lc(e,t,n,r){let i=``;for(let e=parseInt(t);e<parseInt(n);e++)i+=r.replace(/\\[\\s*i\\s*\\]/g,`[ `+e+` ]`).replace(/UNROLLED_LOOP_INDEX/g,e);return i}function Rc(e){let t=`precision ${e.precision} float;\n\tprecision ${e.precision} int;\n\tprecision ${e.precision} sampler2D;\n\tprecision ${e.precision} samplerCube;\n\tprecision ${e.precision} sampler3D;\n\tprecision ${e.precision} sampler2DArray;\n\tprecision ${e.precision} sampler2DShadow;\n\tprecision ${e.precision} samplerCubeShadow;\n\tprecision ${e.precision} sampler2DArrayShadow;\n\tprecision ${e.precision} isampler2D;\n\tprecision ${e.precision} isampler3D;\n\tprecision ${e.precision} isamplerCube;\n\tprecision ${e.precision} isampler2DArray;\n\tprecision ${e.precision} usampler2D;\n\tprecision ${e.precision} usampler3D;\n\tprecision ${e.precision} usamplerCube;\n\tprecision ${e.precision} usampler2DArray;\n\t`;return e.precision===`highp`?t+=`\n#define HIGH_PRECISION`:e.precision===`mediump`?t+=`\n#define MEDIUM_PRECISION`:e.precision===`lowp`&&(t+=`\n#define LOW_PRECISION`),t}function zc(e){return Ql[e.shadowMapType]||`SHADOWMAP_TYPE_BASIC`}function Bc(e){return e.envMap===!1?`ENVMAP_TYPE_CUBE`:$l[e.envMapMode]||`ENVMAP_TYPE_CUBE`}function Vc(e){return e.envMap===!1?`ENVMAP_MODE_REFLECTION`:eu[e.envMapMode]||`ENVMAP_MODE_REFLECTION`}function Hc(e){return e.envMap===!1?`ENVMAP_BLENDING_NONE`:tu[e.combine]||`ENVMAP_BLENDING_NONE`}function Uc(e){let t=e.envMapCubeUVHeight;if(t===null)return null;let n=Math.log2(t)-2,r=1/t;return{texelWidth:1/(3*Math.max(2**n,112)),texelHeight:r,maxMip:n}}function Wc(e,t,n,r){let i=e.getContext(),a=n.defines,o=n.vertexShader,s=n.fragmentShader,c=zc(n),l=Bc(n),u=Vc(n),p=Hc(n),m=Uc(n),h=Oc(n),g=kc(a),_=i.createProgram(),v,y,b=n.glslVersion?`#version `+n.glslVersion+`\n`:``;n.isRawShaderMaterial?(v=[`#define SHADER_TYPE `+n.shaderType,`#define SHADER_NAME `+n.shaderName,g].filter(jc).join(`\n`),v.length>0&&(v+=`\n`),y=[`#define SHADER_TYPE `+n.shaderType,`#define SHADER_NAME `+n.shaderName,g].filter(jc).join(`\n`),y.length>0&&(y+=`\n`)):(v=[Rc(n),`#define SHADER_TYPE `+n.shaderType,`#define SHADER_NAME `+n.shaderName,g,n.extensionClipCullDistance?`#define USE_CLIP_DISTANCE`:``,n.batching?`#define USE_BATCHING`:``,n.batchingColor?`#define USE_BATCHING_COLOR`:``,n.instancing?`#define USE_INSTANCING`:``,n.instancingColor?`#define USE_INSTANCING_COLOR`:``,n.instancingMorph?`#define USE_INSTANCING_MORPH`:``,n.useFog&&n.fog?`#define USE_FOG`:``,n.useFog&&n.fogExp2?`#define FOG_EXP2`:``,n.map?`#define USE_MAP`:``,n.envMap?`#define USE_ENVMAP`:``,n.envMap?`#define `+u:``,n.lightMap?`#define USE_LIGHTMAP`:``,n.aoMap?`#define USE_AOMAP`:``,n.bumpMap?`#define USE_BUMPMAP`:``,n.normalMap?`#define USE_NORMALMAP`:``,n.normalMapObjectSpace?`#define USE_NORMALMAP_OBJECTSPACE`:``,n.normalMapTangentSpace?`#define USE_NORMALMAP_TANGENTSPACE`:``,n.displacementMap?`#define USE_DISPLACEMENTMAP`:``,n.emissiveMap?`#define USE_EMISSIVEMAP`:``,n.anisotropy?`#define USE_ANISOTROPY`:``,n.anisotropyMap?`#define USE_ANISOTROPYMAP`:``,n.clearcoatMap?`#define USE_CLEARCOATMAP`:``,n.clearcoatRoughnessMap?`#define USE_CLEARCOAT_ROUGHNESSMAP`:``,n.clearcoatNormalMap?`#define USE_CLEARCOAT_NORMALMAP`:``,n.iridescenceMap?`#define USE_IRIDESCENCEMAP`:``,n.iridescenceThicknessMap?`#define USE_IRIDESCENCE_THICKNESSMAP`:``,n.specularMap?`#define USE_SPECULARMAP`:``,n.specularColorMap?`#define USE_SPECULAR_COLORMAP`:``,n.specularIntensityMap?`#define USE_SPECULAR_INTENSITYMAP`:``,n.roughnessMap?`#define USE_ROUGHNESSMAP`:``,n.metalnessMap?`#define USE_METALNESSMAP`:``,n.alphaMap?`#define USE_ALPHAMAP`:``,n.alphaHash?`#define USE_ALPHAHASH`:``,n.transmission?`#define USE_TRANSMISSION`:``,n.transmissionMap?`#define USE_TRANSMISSIONMAP`:``,n.thicknessMap?`#define USE_THICKNESSMAP`:``,n.sheenColorMap?`#define USE_SHEEN_COLORMAP`:``,n.sheenRoughnessMap?`#define USE_SHEEN_ROUGHNESSMAP`:``,n.mapUv?`#define MAP_UV `+n.mapUv:``,n.alphaMapUv?`#define ALPHAMAP_UV `+n.alphaMapUv:``,n.lightMapUv?`#define LIGHTMAP_UV `+n.lightMapUv:``,n.aoMapUv?`#define AOMAP_UV `+n.aoMapUv:``,n.emissiveMapUv?`#define EMISSIVEMAP_UV `+n.emissiveMapUv:``,n.bumpMapUv?`#define BUMPMAP_UV `+n.bumpMapUv:``,n.normalMapUv?`#define NORMALMAP_UV `+n.normalMapUv:``,n.displacementMapUv?`#define DISPLACEMENTMAP_UV `+n.displacementMapUv:``,n.metalnessMapUv?`#define METALNESSMAP_UV `+n.metalnessMapUv:``,n.roughnessMapUv?`#define ROUGHNESSMAP_UV `+n.roughnessMapUv:``,n.anisotropyMapUv?`#define ANISOTROPYMAP_UV `+n.anisotropyMapUv:``,n.clearcoatMapUv?`#define CLEARCOATMAP_UV `+n.clearcoatMapUv:``,n.clearcoatNormalMapUv?`#define CLEARCOAT_NORMALMAP_UV `+n.clearcoatNormalMapUv:``,n.clearcoatRoughnessMapUv?`#define CLEARCOAT_ROUGHNESSMAP_UV `+n.clearcoatRoughnessMapUv:``,n.iridescenceMapUv?`#define IRIDESCENCEMAP_UV `+n.iridescenceMapUv:``,n.iridescenceThicknessMapUv?`#define IRIDESCENCE_THICKNESSMAP_UV `+n.iridescenceThicknessMapUv:``,n.sheenColorMapUv?`#define SHEEN_COLORMAP_UV `+n.sheenColorMapUv:``,n.sheenRoughnessMapUv?`#define SHEEN_ROUGHNESSMAP_UV `+n.sheenRoughnessMapUv:``,n.specularMapUv?`#define SPECULARMAP_UV `+n.specularMapUv:``,n.specularColorMapUv?`#define SPECULAR_COLORMAP_UV `+n.specularColorMapUv:``,n.specularIntensityMapUv?`#define SPECULAR_INTENSITYMAP_UV `+n.specularIntensityMapUv:``,n.transmissionMapUv?`#define TRANSMISSIONMAP_UV `+n.transmissionMapUv:``,n.thicknessMapUv?`#define THICKNESSMAP_UV `+n.thicknessMapUv:``,n.vertexTangents&&n.flatShading===!1?`#define USE_TANGENT`:``,n.vertexNormals?`#define HAS_NORMAL`:``,n.vertexColors?`#define USE_COLOR`:``,n.vertexAlphas?`#define USE_COLOR_ALPHA`:``,n.vertexUv1s?`#define USE_UV1`:``,n.vertexUv2s?`#define USE_UV2`:``,n.vertexUv3s?`#define USE_UV3`:``,n.pointsUvs?`#define USE_POINTS_UV`:``,n.flatShading?`#define FLAT_SHADED`:``,n.skinning?`#define USE_SKINNING`:``,n.morphTargets?`#define USE_MORPHTARGETS`:``,n.morphNormals&&n.flatShading===!1?`#define USE_MORPHNORMALS`:``,n.morphColors?`#define USE_MORPHCOLORS`:``,n.morphTargetsCount>0?`#define MORPHTARGETS_TEXTURE_STRIDE `+n.morphTextureStride:``,n.morphTargetsCount>0?`#define MORPHTARGETS_COUNT `+n.morphTargetsCount:``,n.doubleSided?`#define DOUBLE_SIDED`:``,n.flipSided?`#define FLIP_SIDED`:``,n.shadowMapEnabled?`#define USE_SHADOWMAP`:``,n.shadowMapEnabled?`#define `+c:``,n.sizeAttenuation?`#define USE_SIZEATTENUATION`:``,n.numLightProbes>0?`#define USE_LIGHT_PROBES`:``,n.logarithmicDepthBuffer?`#define USE_LOGARITHMIC_DEPTH_BUFFER`:``,n.reversedDepthBuffer?`#define USE_REVERSED_DEPTH_BUFFER`:``,`uniform mat4 modelMatrix;`,`uniform mat4 modelViewMatrix;`,`uniform mat4 projectionMatrix;`,`uniform mat4 viewMatrix;`,`uniform mat3 normalMatrix;`,`uniform vec3 cameraPosition;`,`uniform bool isOrthographic;`,`#ifdef USE_INSTANCING`,`\tattribute mat4 instanceMatrix;`,`#endif`,`#ifdef USE_INSTANCING_COLOR`,`\tattribute vec3 instanceColor;`,`#endif`,`#ifdef USE_INSTANCING_MORPH`,`\tuniform sampler2D morphTexture;`,`#endif`,`attribute vec3 position;`,`attribute vec3 normal;`,`attribute vec2 uv;`,`#ifdef USE_UV1`,`\tattribute vec2 uv1;`,`#endif`,`#ifdef USE_UV2`,`\tattribute vec2 uv2;`,`#endif`,`#ifdef USE_UV3`,`\tattribute vec2 uv3;`,`#endif`,`#ifdef USE_TANGENT`,`\tattribute vec4 tangent;`,`#endif`,`#if defined( USE_COLOR_ALPHA )`,`\tattribute vec4 color;`,`#elif defined( USE_COLOR )`,`\tattribute vec3 color;`,`#endif`,`#ifdef USE_SKINNING`,`\tattribute vec4 skinIndex;`,`\tattribute vec4 skinWeight;`,`#endif`,`\n`].filter(jc).join(`\n`),y=[Rc(n),`#define SHADER_TYPE `+n.shaderType,`#define SHADER_NAME `+n.shaderName,g,n.useFog&&n.fog?`#define USE_FOG`:``,n.useFog&&n.fogExp2?`#define FOG_EXP2`:``,n.alphaToCoverage?`#define ALPHA_TO_COVERAGE`:``,n.map?`#define USE_MAP`:``,n.matcap?`#define USE_MATCAP`:``,n.envMap?`#define USE_ENVMAP`:``,n.envMap?`#define `+l:``,n.envMap?`#define `+u:``,n.envMap?`#define `+p:``,m?`#define CUBEUV_TEXEL_WIDTH `+m.texelWidth:``,m?`#define CUBEUV_TEXEL_HEIGHT `+m.texelHeight:``,m?`#define CUBEUV_MAX_MIP `+m.maxMip+`.0`:``,n.lightMap?`#define USE_LIGHTMAP`:``,n.aoMap?`#define USE_AOMAP`:``,n.bumpMap?`#define USE_BUMPMAP`:``,n.normalMap?`#define USE_NORMALMAP`:``,n.normalMapObjectSpace?`#define USE_NORMALMAP_OBJECTSPACE`:``,n.normalMapTangentSpace?`#define USE_NORMALMAP_TANGENTSPACE`:``,n.packedNormalMap?`#define USE_PACKED_NORMALMAP`:``,n.emissiveMap?`#define USE_EMISSIVEMAP`:``,n.anisotropy?`#define USE_ANISOTROPY`:``,n.anisotropyMap?`#define USE_ANISOTROPYMAP`:``,n.clearcoat?`#define USE_CLEARCOAT`:``,n.clearcoatMap?`#define USE_CLEARCOATMAP`:``,n.clearcoatRoughnessMap?`#define USE_CLEARCOAT_ROUGHNESSMAP`:``,n.clearcoatNormalMap?`#define USE_CLEARCOAT_NORMALMAP`:``,n.dispersion?`#define USE_DISPERSION`:``,n.iridescence?`#define USE_IRIDESCENCE`:``,n.iridescenceMap?`#define USE_IRIDESCENCEMAP`:``,n.iridescenceThicknessMap?`#define USE_IRIDESCENCE_THICKNESSMAP`:``,n.specularMap?`#define USE_SPECULARMAP`:``,n.specularColorMap?`#define USE_SPECULAR_COLORMAP`:``,n.specularIntensityMap?`#define USE_SPECULAR_INTENSITYMAP`:``,n.roughnessMap?`#define USE_ROUGHNESSMAP`:``,n.metalnessMap?`#define USE_METALNESSMAP`:``,n.alphaMap?`#define USE_ALPHAMAP`:``,n.alphaTest?`#define USE_ALPHATEST`:``,n.alphaHash?`#define USE_ALPHAHASH`:``,n.sheen?`#define USE_SHEEN`:``,n.sheenColorMap?`#define USE_SHEEN_COLORMAP`:``,n.sheenRoughnessMap?`#define USE_SHEEN_ROUGHNESSMAP`:``,n.transmission?`#define USE_TRANSMISSION`:``,n.transmissionMap?`#define USE_TRANSMISSIONMAP`:``,n.thicknessMap?`#define USE_THICKNESSMAP`:``,n.vertexTangents&&n.flatShading===!1?`#define USE_TANGENT`:``,n.vertexColors||n.instancingColor?`#define USE_COLOR`:``,n.vertexAlphas||n.batchingColor?`#define USE_COLOR_ALPHA`:``,n.vertexUv1s?`#define USE_UV1`:``,n.vertexUv2s?`#define USE_UV2`:``,n.vertexUv3s?`#define USE_UV3`:``,n.pointsUvs?`#define USE_POINTS_UV`:``,n.gradientMap?`#define USE_GRADIENTMAP`:``,n.flatShading?`#define FLAT_SHADED`:``,n.doubleSided?`#define DOUBLE_SIDED`:``,n.flipSided?`#define FLIP_SIDED`:``,n.shadowMapEnabled?`#define USE_SHADOWMAP`:``,n.shadowMapEnabled?`#define `+c:``,n.premultipliedAlpha?`#define PREMULTIPLIED_ALPHA`:``,n.numLightProbes>0?`#define USE_LIGHT_PROBES`:``,n.numLightProbeGrids>0?`#define USE_LIGHT_PROBES_GRID`:``,n.decodeVideoTexture?`#define DECODE_VIDEO_TEXTURE`:``,n.decodeVideoTextureEmissive?`#define DECODE_VIDEO_TEXTURE_EMISSIVE`:``,n.logarithmicDepthBuffer?`#define USE_LOGARITHMIC_DEPTH_BUFFER`:``,n.reversedDepthBuffer?`#define USE_REVERSED_DEPTH_BUFFER`:``,`uniform mat4 viewMatrix;`,`uniform vec3 cameraPosition;`,`uniform bool isOrthographic;`,n.toneMapping===0?``:`#define TONE_MAPPING`,n.toneMapping===0?``:B.tonemapping_pars_fragment,n.toneMapping===0?``:Ec(`toneMapping`,n.toneMapping),n.dithering?`#define DITHERING`:``,n.opaque?`#define OPAQUE`:``,B.colorspace_pars_fragment,Tc(`linearToOutputTexel`,n.outputColorSpace),Dc(),n.useDepthPacking?`#define DEPTH_PACKING `+n.depthPacking:``,`\n`].filter(jc).join(`\n`)),o=Pc(o),o=Mc(o,n),o=Nc(o,n),s=Pc(s),s=Mc(s,n),s=Nc(s,n),o=Ic(o),s=Ic(s),n.isRawShaderMaterial!==!0&&(b=`#version 300 es\n`,v=[h,`#define attribute in`,`#define varying out`,`#define texture2D texture`].join(`\n`)+`\n`+v,y=[`#define varying in`,n.glslVersion===`300 es`?``:`layout(location = 0) out highp vec4 pc_fragColor;`,n.glslVersion===`300 es`?``:`#define gl_FragColor pc_fragColor`,`#define gl_FragDepthEXT gl_FragDepth`,`#define texture2D texture`,`#define textureCube texture`,`#define texture2DProj textureProj`,`#define texture2DLodEXT textureLod`,`#define texture2DProjLodEXT textureProjLod`,`#define textureCubeLodEXT textureLod`,`#define texture2DGradEXT textureGrad`,`#define texture2DProjGradEXT textureProjGrad`,`#define textureCubeGradEXT textureGrad`].join(`\n`)+`\n`+y);let x=b+v+o,S=b+y+s,C=xc(i,i.VERTEX_SHADER,x),w=xc(i,i.FRAGMENT_SHADER,S);i.attachShader(_,C),i.attachShader(_,w),n.index0AttributeName===void 0?n.hasPositionAttribute===!0&&i.bindAttribLocation(_,0,`position`):i.bindAttribLocation(_,0,n.index0AttributeName),i.linkProgram(_);function T(t){if(e.debug.checkShaderErrors){let n=i.getProgramInfoLog(_)||``,r=i.getShaderInfoLog(C)||``,a=i.getShaderInfoLog(w)||``,o=n.trim(),s=r.trim(),c=a.trim(),l=!0,u=!0;if(i.getProgramParameter(_,i.LINK_STATUS)===!1){if(l=!1,typeof e.debug.onShaderError==`function`)e.debug.onShaderError(i,_,C,w);else{let e=wc(i,C,`vertex`),n=wc(i,w,`fragment`);f(`WebGLProgram: Shader Error `+i.getError()+` - VALIDATE_STATUS `+i.getProgramParameter(_,i.VALIDATE_STATUS)+`\n\nMaterial Name: `+t.name+`\nMaterial Type: `+t.type+`\n\nProgram Info Log: `+o+`\n`+e+`\n`+n)}}else o===``?(s===``||c===``)&&(u=!1):d(`WebGLProgram: Program Info Log:`,o);u&&(t.diagnostics={runnable:l,programLog:o,vertexShader:{log:s,prefix:v},fragmentShader:{log:c,prefix:y}})}i.deleteShader(C),i.deleteShader(w),E=new Ul(i,_),D=Ac(i,_)}let E;this.getUniforms=function(){return E===void 0&&T(this),E};let D;this.getAttributes=function(){return D===void 0&&T(this),D};let O=n.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return O===!1&&(O=i.getProgramParameter(_,Wl)),O},this.destroy=function(){r.releaseStatesOfProgram(this),i.deleteProgram(_),this.program=void 0},this.type=n.shaderType,this.name=n.shaderName,this.id=Gl++,this.cacheKey=t,this.usedTimes=1,this.program=_,this.vertexShader=C,this.fragmentShader=w,this}function Gc(e){return e===1030||e===37490||e===36285}function Kc(e,t,n,r,i,a){let o=new Wn,s=new ru,c=new Set,l=[],u=new Map,f=r.logarithmicDepthBuffer,p=r.precision,m={MeshDepthMaterial:`depth`,MeshDistanceMaterial:`distance`,MeshNormalMaterial:`normal`,MeshBasicMaterial:`basic`,MeshLambertMaterial:`lambert`,MeshPhongMaterial:`phong`,MeshToonMaterial:`toon`,MeshStandardMaterial:`physical`,MeshPhysicalMaterial:`physical`,MeshMatcapMaterial:`matcap`,LineBasicMaterial:`basic`,LineDashedMaterial:`dashed`,PointsMaterial:`points`,ShadowMaterial:`shadow`,SpriteMaterial:`sprite`};function h(e){return c.add(e),e===0?`uv`:`uv${e}`}function g(i,o,l,u,g,_){let v=u.fog,y=g.geometry,b=i.isMeshStandardMaterial||i.isMeshLambertMaterial||i.isMeshPhongMaterial?u.environment:null,x=i.isMeshStandardMaterial||i.isMeshLambertMaterial&&!i.envMap||i.isMeshPhongMaterial&&!i.envMap,S=t.get(i.envMap||b,x),C=S&&S.mapping===306?S.image.height:null,w=m[i.type];i.precision!==null&&(p=r.getMaxPrecision(i.precision),p!==i.precision&&d(`WebGLProgram.getParameters:`,i.precision,`not supported, using`,p,`instead.`));let T=y.morphAttributes.position||y.morphAttributes.normal||y.morphAttributes.color,E=T===void 0?0:T.length,D=0;y.morphAttributes.position!==void 0&&(D=1),y.morphAttributes.normal!==void 0&&(D=2),y.morphAttributes.color!==void 0&&(D=3);let O,ee,k,te;if(w){let e=dl[w];O=e.vertexShader,ee=e.fragmentShader}else{O=i.vertexShader,ee=i.fragmentShader;let e=s.getVertexShaderStage(i),t=s.getFragmentShaderStage(i);s.update(i,e,t),k=e.id,te=t.id}let ne=e.getRenderTarget(),re=e.state.buffers.depth.getReversed(),ie=g.isInstancedMesh===!0,ae=g.isBatchedMesh===!0,A=!!i.map,oe=!!i.matcap,j=!!S,se=!!i.aoMap,ce=!!i.lightMap,le=!!i.bumpMap&&i.wireframe===!1,ue=!!i.normalMap,de=!!i.displacementMap,fe=!!i.emissiveMap,pe=!!i.metalnessMap,me=!!i.roughnessMap,he=i.anisotropy>0,ge=i.clearcoat>0,_e=i.dispersion>0,ve=i.iridescence>0,ye=i.sheen>0,be=i.transmission>0,xe=he&&!!i.anisotropyMap,Se=ge&&!!i.clearcoatMap,Ce=ge&&!!i.clearcoatNormalMap,we=ge&&!!i.clearcoatRoughnessMap,Te=ve&&!!i.iridescenceMap,Ee=ve&&!!i.iridescenceThicknessMap,De=ye&&!!i.sheenColorMap,Oe=ye&&!!i.sheenRoughnessMap,ke=!!i.specularMap,Ae=!!i.specularColorMap,M=!!i.specularIntensityMap,je=be&&!!i.transmissionMap,Me=be&&!!i.thicknessMap,Ne=!!i.gradientMap,N=!!i.alphaMap,Pe=i.alphaTest>0,P=!!i.alphaHash,F=!!i.extensions,Fe=0;i.toneMapped&&(ne===null||ne.isXRRenderTarget===!0)&&(Fe=e.toneMapping);let Ie={shaderID:w,shaderType:i.type,shaderName:i.name,vertexShader:O,fragmentShader:ee,defines:i.defines,customVertexShaderID:k,customFragmentShaderID:te,isRawShaderMaterial:i.isRawShaderMaterial===!0,glslVersion:i.glslVersion,precision:p,batching:ae,batchingColor:ae&&g._colorsTexture!==null,instancing:ie,instancingColor:ie&&g.instanceColor!==null,instancingMorph:ie&&g.morphTexture!==null,outputColorSpace:ne===null?e.outputColorSpace:ne.isXRRenderTarget===!0?ne.texture.colorSpace:bn.workingColorSpace,alphaToCoverage:!!i.alphaToCoverage,map:A,matcap:oe,envMap:j,envMapMode:j&&S.mapping,envMapCubeUVHeight:C,aoMap:se,lightMap:ce,bumpMap:le,normalMap:ue,displacementMap:de,emissiveMap:fe,normalMapObjectSpace:ue&&i.normalMapType===1,normalMapTangentSpace:ue&&i.normalMapType===0,packedNormalMap:ue&&i.normalMapType===0&&Gc(i.normalMap.format),metalnessMap:pe,roughnessMap:me,anisotropy:he,anisotropyMap:xe,clearcoat:ge,clearcoatMap:Se,clearcoatNormalMap:Ce,clearcoatRoughnessMap:we,dispersion:_e,iridescence:ve,iridescenceMap:Te,iridescenceThicknessMap:Ee,sheen:ye,sheenColorMap:De,sheenRoughnessMap:Oe,specularMap:ke,specularColorMap:Ae,specularIntensityMap:M,transmission:be,transmissionMap:je,thicknessMap:Me,gradientMap:Ne,opaque:i.transparent===!1&&i.blending===1&&i.alphaToCoverage===!1,alphaMap:N,alphaTest:Pe,alphaHash:P,combine:i.combine,mapUv:A&&h(i.map.channel),aoMapUv:se&&h(i.aoMap.channel),lightMapUv:ce&&h(i.lightMap.channel),bumpMapUv:le&&h(i.bumpMap.channel),normalMapUv:ue&&h(i.normalMap.channel),displacementMapUv:de&&h(i.displacementMap.channel),emissiveMapUv:fe&&h(i.emissiveMap.channel),metalnessMapUv:pe&&h(i.metalnessMap.channel),roughnessMapUv:me&&h(i.roughnessMap.channel),anisotropyMapUv:xe&&h(i.anisotropyMap.channel),clearcoatMapUv:Se&&h(i.clearcoatMap.channel),clearcoatNormalMapUv:Ce&&h(i.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:we&&h(i.clearcoatRoughnessMap.channel),iridescenceMapUv:Te&&h(i.iridescenceMap.channel),iridescenceThicknessMapUv:Ee&&h(i.iridescenceThicknessMap.channel),sheenColorMapUv:De&&h(i.sheenColorMap.channel),sheenRoughnessMapUv:Oe&&h(i.sheenRoughnessMap.channel),specularMapUv:ke&&h(i.specularMap.channel),specularColorMapUv:Ae&&h(i.specularColorMap.channel),specularIntensityMapUv:M&&h(i.specularIntensityMap.channel),transmissionMapUv:je&&h(i.transmissionMap.channel),thicknessMapUv:Me&&h(i.thicknessMap.channel),alphaMapUv:N&&h(i.alphaMap.channel),vertexTangents:!!y.attributes.tangent&&(ue||he),vertexNormals:!!y.attributes.normal,vertexColors:i.vertexColors,vertexAlphas:i.vertexColors===!0&&!!y.attributes.color&&y.attributes.color.itemSize===4,pointsUvs:g.isPoints===!0&&!!y.attributes.uv&&(A||N),fog:!!v,useFog:i.fog===!0,fogExp2:!!v&&v.isFogExp2,flatShading:i.wireframe===!1&&(i.flatShading===!0||y.attributes.normal===void 0&&ue===!1&&(i.isMeshLambertMaterial||i.isMeshPhongMaterial||i.isMeshStandardMaterial||i.isMeshPhysicalMaterial)),sizeAttenuation:i.sizeAttenuation===!0,logarithmicDepthBuffer:f,reversedDepthBuffer:re,skinning:g.isSkinnedMesh===!0,hasPositionAttribute:y.attributes.position!==void 0,morphTargets:y.morphAttributes.position!==void 0,morphNormals:y.morphAttributes.normal!==void 0,morphColors:y.morphAttributes.color!==void 0,morphTargetsCount:E,morphTextureStride:D,numDirLights:o.directional.length,numPointLights:o.point.length,numSpotLights:o.spot.length,numSpotLightMaps:o.spotLightMap.length,numRectAreaLights:o.rectArea.length,numHemiLights:o.hemi.length,numDirLightShadows:o.directionalShadowMap.length,numPointLightShadows:o.pointShadowMap.length,numSpotLightShadows:o.spotShadowMap.length,numSpotLightShadowsWithMaps:o.numSpotLightShadowsWithMaps,numLightProbes:o.numLightProbes,numLightProbeGrids:_.length,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:i.dithering,shadowMapEnabled:e.shadowMap.enabled&&l.length>0,shadowMapType:e.shadowMap.type,toneMapping:Fe,decodeVideoTexture:A&&i.map.isVideoTexture===!0&&bn.getTransfer(i.map.colorSpace)===`srgb`,decodeVideoTextureEmissive:fe&&i.emissiveMap.isVideoTexture===!0&&bn.getTransfer(i.emissiveMap.colorSpace)===`srgb`,premultipliedAlpha:i.premultipliedAlpha,doubleSided:i.side===2,flipSided:i.side===1,useDepthPacking:i.depthPacking>=0,depthPacking:i.depthPacking||0,index0AttributeName:i.index0AttributeName,extensionClipCullDistance:F&&i.extensions.clipCullDistance===!0&&n.has(`WEBGL_clip_cull_distance`),extensionMultiDraw:(F&&i.extensions.multiDraw===!0||ae)&&n.has(`WEBGL_multi_draw`),rendererExtensionParallelShaderCompile:n.has(`KHR_parallel_shader_compile`),customProgramCacheKey:i.customProgramCacheKey()};return Ie.vertexUv1s=c.has(1),Ie.vertexUv2s=c.has(2),Ie.vertexUv3s=c.has(3),c.clear(),Ie}function _(t){let n=[];if(t.shaderID?n.push(t.shaderID):(n.push(t.customVertexShaderID),n.push(t.customFragmentShaderID)),t.defines!==void 0)for(let e in t.defines)n.push(e),n.push(t.defines[e]);return t.isRawShaderMaterial===!1&&(v(n,t),y(n,t),n.push(e.outputColorSpace)),n.push(t.customProgramCacheKey),n.join()}function v(e,t){e.push(t.precision),e.push(t.outputColorSpace),e.push(t.envMapMode),e.push(t.envMapCubeUVHeight),e.push(t.mapUv),e.push(t.alphaMapUv),e.push(t.lightMapUv),e.push(t.aoMapUv),e.push(t.bumpMapUv),e.push(t.normalMapUv),e.push(t.displacementMapUv),e.push(t.emissiveMapUv),e.push(t.metalnessMapUv),e.push(t.roughnessMapUv),e.push(t.anisotropyMapUv),e.push(t.clearcoatMapUv),e.push(t.clearcoatNormalMapUv),e.push(t.clearcoatRoughnessMapUv),e.push(t.iridescenceMapUv),e.push(t.iridescenceThicknessMapUv),e.push(t.sheenColorMapUv),e.push(t.sheenRoughnessMapUv),e.push(t.specularMapUv),e.push(t.specularColorMapUv),e.push(t.specularIntensityMapUv),e.push(t.transmissionMapUv),e.push(t.thicknessMapUv),e.push(t.combine),e.push(t.fogExp2),e.push(t.sizeAttenuation),e.push(t.morphTargetsCount),e.push(t.morphAttributeCount),e.push(t.numDirLights),e.push(t.numPointLights),e.push(t.numSpotLights),e.push(t.numSpotLightMaps),e.push(t.numHemiLights),e.push(t.numRectAreaLights),e.push(t.numDirLightShadows),e.push(t.numPointLightShadows),e.push(t.numSpotLightShadows),e.push(t.numSpotLightShadowsWithMaps),e.push(t.numLightProbes),e.push(t.shadowMapType),e.push(t.toneMapping),e.push(t.numClippingPlanes),e.push(t.numClipIntersection),e.push(t.depthPacking)}function y(e,t){o.disableAll(),t.instancing&&o.enable(0),t.instancingColor&&o.enable(1),t.instancingMorph&&o.enable(2),t.matcap&&o.enable(3),t.envMap&&o.enable(4),t.normalMapObjectSpace&&o.enable(5),t.normalMapTangentSpace&&o.enable(6),t.clearcoat&&o.enable(7),t.iridescence&&o.enable(8),t.alphaTest&&o.enable(9),t.vertexColors&&o.enable(10),t.vertexAlphas&&o.enable(11),t.vertexUv1s&&o.enable(12),t.vertexUv2s&&o.enable(13),t.vertexUv3s&&o.enable(14),t.vertexTangents&&o.enable(15),t.anisotropy&&o.enable(16),t.alphaHash&&o.enable(17),t.batching&&o.enable(18),t.dispersion&&o.enable(19),t.batchingColor&&o.enable(20),t.gradientMap&&o.enable(21),t.packedNormalMap&&o.enable(22),t.vertexNormals&&o.enable(23),e.push(o.mask),o.disableAll(),t.fog&&o.enable(0),t.useFog&&o.enable(1),t.flatShading&&o.enable(2),t.logarithmicDepthBuffer&&o.enable(3),t.reversedDepthBuffer&&o.enable(4),t.skinning&&o.enable(5),t.morphTargets&&o.enable(6),t.morphNormals&&o.enable(7),t.morphColors&&o.enable(8),t.premultipliedAlpha&&o.enable(9),t.shadowMapEnabled&&o.enable(10),t.doubleSided&&o.enable(11),t.flipSided&&o.enable(12),t.useDepthPacking&&o.enable(13),t.dithering&&o.enable(14),t.transmission&&o.enable(15),t.sheen&&o.enable(16),t.opaque&&o.enable(17),t.pointsUvs&&o.enable(18),t.decodeVideoTexture&&o.enable(19),t.decodeVideoTextureEmissive&&o.enable(20),t.alphaToCoverage&&o.enable(21),t.numLightProbeGrids>0&&o.enable(22),t.hasPositionAttribute&&o.enable(23),e.push(o.mask)}function b(e){let t=m[e.type],n;if(t){let e=dl[t];n=La.clone(e.uniforms)}else n=e.uniforms;return n}function x(t,n){let r=u.get(n);return r===void 0?(r=new Wc(e,n,t,i),l.push(r),u.set(n,r)):++r.usedTimes,r}function S(e){if(--e.usedTimes===0){let t=l.indexOf(e);l[t]=l[l.length-1],l.pop(),u.delete(e.cacheKey),e.destroy()}}function C(e){s.remove(e)}function w(){s.dispose()}return{getParameters:g,getProgramCacheKey:_,getUniforms:b,acquireProgram:x,releaseProgram:S,releaseShaderCache:C,programs:l,dispose:w}}function qc(){let e=new WeakMap;function t(t){return e.has(t)}function n(t){let n=e.get(t);return n===void 0&&(n={},e.set(t,n)),n}function r(t){e.delete(t)}function i(t,n,r){e.get(t)[n]=r}function a(){e=new WeakMap}return{has:t,get:n,remove:r,update:i,dispose:a}}function Jc(e,t){return e.groupOrder===t.groupOrder?e.renderOrder===t.renderOrder?e.material.id===t.material.id?e.materialVariant===t.materialVariant?e.z===t.z?e.id-t.id:e.z-t.z:e.materialVariant-t.materialVariant:e.material.id-t.material.id:e.renderOrder-t.renderOrder:e.groupOrder-t.groupOrder}function Yc(e,t){return e.groupOrder===t.groupOrder?e.renderOrder===t.renderOrder?e.z===t.z?e.id-t.id:t.z-e.z:e.renderOrder-t.renderOrder:e.groupOrder-t.groupOrder}function Xc(){let e=[],t=0,n=[],r=[],i=[];function a(){t=0,n.length=0,r.length=0,i.length=0}function o(e){let t=0;return e.isInstancedMesh&&(t+=2),e.isSkinnedMesh&&(t+=1),t}function s(n,r,i,a,s,c){let l=e[t];return l===void 0?(l={id:n.id,object:n,geometry:r,material:i,materialVariant:o(n),groupOrder:a,renderOrder:n.renderOrder,z:s,group:c},e[t]=l):(l.id=n.id,l.object=n,l.geometry=r,l.material=i,l.materialVariant=o(n),l.groupOrder=a,l.renderOrder=n.renderOrder,l.z=s,l.group=c),t++,l}function c(e,t,a,o,c,l){let u=s(e,t,a,o,c,l);a.transmission>0?r.push(u):a.transparent===!0?i.push(u):n.push(u)}function l(e,t,a,o,c,l){let u=s(e,t,a,o,c,l);a.transmission>0?r.unshift(u):a.transparent===!0?i.unshift(u):n.unshift(u)}function u(e,t,a){n.length>1&&n.sort(e||Jc),r.length>1&&r.sort(t||Yc),i.length>1&&i.sort(t||Yc),a&&(n.reverse(),r.reverse(),i.reverse())}function d(){for(let n=t,r=e.length;n<r;n++){let t=e[n];if(t.id===null)break;t.id=null,t.object=null,t.geometry=null,t.material=null,t.group=null}}return{opaque:n,transmissive:r,transparent:i,init:a,push:c,unshift:l,finish:d,sort:u}}function Zc(){let e=new WeakMap;function t(t,n){let r=e.get(t),i;return r===void 0?(i=new Xc,e.set(t,[i])):n>=r.length?(i=new Xc,r.push(i)):i=r[n],i}function n(){e=new WeakMap}return{get:t,dispose:n}}function Qc(){let e={};return{get:function(t){if(e[t.id]!==void 0)return e[t.id];let n;switch(t.type){case`DirectionalLight`:n={direction:new L,color:new z};break;case`SpotLight`:n={position:new L,direction:new L,color:new z,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case`PointLight`:n={position:new L,color:new z,distance:0,decay:0};break;case`HemisphereLight`:n={direction:new L,skyColor:new z,groundColor:new z};break;case`RectAreaLight`:n={color:new z,position:new L,halfWidth:new L,halfHeight:new L}}return e[t.id]=n,n}}}function $c(){let e={};return{get:function(t){if(e[t.id]!==void 0)return e[t.id];let n;switch(t.type){case`DirectionalLight`:n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new I};break;case`SpotLight`:n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new I};break;case`PointLight`:n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new I,shadowCameraNear:1,shadowCameraFar:1e3}}return e[t.id]=n,n}}}function el(e,t){return(t.castShadow?2:0)-(e.castShadow?2:0)+ +!!t.map-!!e.map}function tl(e){let t=new Qc,n=$c(),r={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let e=0;e<9;e++)r.probe.push(new L);let i=new L,a=new Nn,o=new Nn;function s(i){let a=0,o=0,s=0;for(let e=0;e<9;e++)r.probe[e].set(0,0,0);let c=0,l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0,_=0,v=0;i.sort(el);for(let e=0,y=i.length;e<y;e++){let y=i[e],b=y.color,x=y.intensity,S=y.distance,C=null;if(y.shadow&&y.shadow.map&&(C=y.shadow.map.texture.format===1030?y.shadow.map.texture:y.shadow.map.depthTexture||y.shadow.map.texture),y.isAmbientLight)a+=b.r*x,o+=b.g*x,s+=b.b*x;else if(y.isLightProbe){for(let e=0;e<9;e++)r.probe[e].addScaledVector(y.sh.coefficients[e],x);v++}else if(y.isDirectionalLight){let e=t.get(y);if(e.color.copy(y.color).multiplyScalar(y.intensity),y.castShadow){let e=y.shadow,t=n.get(y);t.shadowIntensity=e.intensity,t.shadowBias=e.bias,t.shadowNormalBias=e.normalBias,t.shadowRadius=e.radius,t.shadowMapSize=e.mapSize,r.directionalShadow[c]=t,r.directionalShadowMap[c]=C,r.directionalShadowMatrix[c]=y.shadow.matrix,p++}r.directional[c]=e,c++}else if(y.isSpotLight){let e=t.get(y);e.position.setFromMatrixPosition(y.matrixWorld),e.color.copy(b).multiplyScalar(x),e.distance=S,e.coneCos=Math.cos(y.angle),e.penumbraCos=Math.cos(y.angle*(1-y.penumbra)),e.decay=y.decay,r.spot[u]=e;let i=y.shadow;if(y.map&&(r.spotLightMap[g]=y.map,g++,i.updateMatrices(y),y.castShadow&&_++),r.spotLightMatrix[u]=i.matrix,y.castShadow){let e=n.get(y);e.shadowIntensity=i.intensity,e.shadowBias=i.bias,e.shadowNormalBias=i.normalBias,e.shadowRadius=i.radius,e.shadowMapSize=i.mapSize,r.spotShadow[u]=e,r.spotShadowMap[u]=C,h++}u++}else if(y.isRectAreaLight){let e=t.get(y);e.color.copy(b).multiplyScalar(x),e.halfWidth.set(y.width*.5,0,0),e.halfHeight.set(0,y.height*.5,0),r.rectArea[d]=e,d++}else if(y.isPointLight){let e=t.get(y);if(e.color.copy(y.color).multiplyScalar(y.intensity),e.distance=y.distance,e.decay=y.decay,y.castShadow){let e=y.shadow,t=n.get(y);t.shadowIntensity=e.intensity,t.shadowBias=e.bias,t.shadowNormalBias=e.normalBias,t.shadowRadius=e.radius,t.shadowMapSize=e.mapSize,t.shadowCameraNear=e.camera.near,t.shadowCameraFar=e.camera.far,r.pointShadow[l]=t,r.pointShadowMap[l]=C,r.pointShadowMatrix[l]=y.shadow.matrix,m++}r.point[l]=e,l++}else if(y.isHemisphereLight){let e=t.get(y);e.skyColor.copy(y.color).multiplyScalar(x),e.groundColor.copy(y.groundColor).multiplyScalar(x),r.hemi[f]=e,f++}}d>0&&(e.has(`OES_texture_float_linear`)===!0?(r.rectAreaLTC1=V.LTC_FLOAT_1,r.rectAreaLTC2=V.LTC_FLOAT_2):(r.rectAreaLTC1=V.LTC_HALF_1,r.rectAreaLTC2=V.LTC_HALF_2)),r.ambient[0]=a,r.ambient[1]=o,r.ambient[2]=s;let y=r.hash;(y.directionalLength!==c||y.pointLength!==l||y.spotLength!==u||y.rectAreaLength!==d||y.hemiLength!==f||y.numDirectionalShadows!==p||y.numPointShadows!==m||y.numSpotShadows!==h||y.numSpotMaps!==g||y.numLightProbes!==v)&&(r.directional.length=c,r.spot.length=u,r.rectArea.length=d,r.point.length=l,r.hemi.length=f,r.directionalShadow.length=p,r.directionalShadowMap.length=p,r.pointShadow.length=m,r.pointShadowMap.length=m,r.spotShadow.length=h,r.spotShadowMap.length=h,r.directionalShadowMatrix.length=p,r.pointShadowMatrix.length=m,r.spotLightMatrix.length=h+g-_,r.spotLightMap.length=g,r.numSpotLightShadowsWithMaps=_,r.numLightProbes=v,y.directionalLength=c,y.pointLength=l,y.spotLength=u,y.rectAreaLength=d,y.hemiLength=f,y.numDirectionalShadows=p,y.numPointShadows=m,y.numSpotShadows=h,y.numSpotMaps=g,y.numLightProbes=v,r.version=au++)}function c(e,t){let n=0,s=0,c=0,l=0,u=0,d=t.matrixWorldInverse;for(let t=0,f=e.length;t<f;t++){let f=e[t];if(f.isDirectionalLight){let e=r.directional[n];e.direction.setFromMatrixPosition(f.matrixWorld),i.setFromMatrixPosition(f.target.matrixWorld),e.direction.sub(i),e.direction.transformDirection(d),n++}else if(f.isSpotLight){let e=r.spot[c];e.position.setFromMatrixPosition(f.matrixWorld),e.position.applyMatrix4(d),e.direction.setFromMatrixPosition(f.matrixWorld),i.setFromMatrixPosition(f.target.matrixWorld),e.direction.sub(i),e.direction.transformDirection(d),c++}else if(f.isRectAreaLight){let e=r.rectArea[l];e.position.setFromMatrixPosition(f.matrixWorld),e.position.applyMatrix4(d),o.identity(),a.copy(f.matrixWorld),a.premultiply(d),o.extractRotation(a),e.halfWidth.set(f.width*.5,0,0),e.halfHeight.set(0,f.height*.5,0),e.halfWidth.applyMatrix4(o),e.halfHeight.applyMatrix4(o),l++}else if(f.isPointLight){let e=r.point[s];e.position.setFromMatrixPosition(f.matrixWorld),e.position.applyMatrix4(d),s++}else if(f.isHemisphereLight){let e=r.hemi[u];e.direction.setFromMatrixPosition(f.matrixWorld),e.direction.transformDirection(d),u++}}}return{setup:s,setupView:c,state:r}}function nl(e){let t=new tl(e),n=[],r=[],i=[];function a(e){d.camera=e,n.length=0,r.length=0,i.length=0}function o(e){n.push(e)}function s(e){r.push(e)}function c(e){i.push(e)}function l(){t.setup(n)}function u(e){t.setupView(n,e)}let d={lightsArray:n,shadowsArray:r,lightProbeGridArray:i,camera:null,lights:t,transmissionRenderTarget:{},textureUnits:0};return{init:a,state:d,setupLights:l,setupLightsView:u,pushLight:o,pushShadow:s,pushLightProbeGrid:c}}function rl(e){let t=new WeakMap;function n(n,r=0){let i=t.get(n),a;return i===void 0?(a=new nl(e),t.set(n,[a])):r>=i.length?(a=new nl(e),i.push(a)):a=i[r],a}function r(){t=new WeakMap}return{get:n,dispose:r}}function il(e,t,n){let r=new da,i=new I,a=new I,o=new On,s=new Wa,c=new Ga,l={},u=n.maxTextureSize,f={0:1,1:0,2:2},p=new Ba({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new I},radius:{value:4}},vertexShader:ou,fragmentShader:su}),m=p.clone();m.defines.HORIZONTAL_PASS=1;let h=new si;h.setAttribute(`position`,new Kr(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let g=new Ni(h,p),_=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=1;let v=this.type;this.render=function(t,n,s){if(_.enabled===!1||_.autoUpdate===!1&&_.needsUpdate===!1||t.length===0)return;this.type===2&&(d(`WebGLShadowMap: PCFSoftShadowMap has been deprecated. Using PCFShadowMap instead.`),this.type=1);let c=e.getRenderTarget(),l=e.getActiveCubeFace(),f=e.getActiveMipmapLevel(),p=e.state;p.setBlending(0),p.buffers.depth.getReversed()===!0?p.buffers.color.setClear(0,0,0,0):p.buffers.color.setClear(1,1,1,1),p.buffers.depth.setTest(!0),p.setScissorTest(!1);let m=v!==this.type;m&&n.traverse(function(e){e.material&&(Array.isArray(e.material)?e.material.forEach(e=>e.needsUpdate=!0):e.material.needsUpdate=!0)});for(let c=0,l=t.length;c<l;c++){let l=t[c],f=l.shadow;if(f===void 0){d(`WebGLShadowMap:`,l,`has no shadow.`);continue}if(f.autoUpdate===!1&&f.needsUpdate===!1)continue;i.copy(f.mapSize);let h=f.getFrameExtents();i.multiply(h),a.copy(f.mapSize),(i.x>u||i.y>u)&&(i.x>u&&(a.x=Math.floor(u/h.x),i.x=a.x*h.x,f.mapSize.x=a.x),i.y>u&&(a.y=Math.floor(u/h.y),i.y=a.y*h.y,f.mapSize.y=a.y));let g=e.state.buffers.depth.getReversed();if(f.camera._reversedDepth=g,f.map===null||m===!0){if(f.map!==null&&(f.map.depthTexture!==null&&(f.map.depthTexture.dispose(),f.map.depthTexture=null),f.map.dispose()),this.type===3){if(l.isPointLight){d(`WebGLShadowMap: VSM shadow maps are not supported for PointLights. Use PCF or BasicShadowMap instead.`);continue}f.map=new An(i.x,i.y,{format:rt,type:We,minFilter:F,magFilter:F,generateMipmaps:!1}),f.map.texture.name=l.name+`.shadowMap`,f.map.depthTexture=new Ma(i.x,i.y,Ue),f.map.depthTexture.name=l.name+`.shadowMapDepth`,f.map.depthTexture.format=$e,f.map.depthTexture.compareFunction=null,f.map.depthTexture.minFilter=N,f.map.depthTexture.magFilter=N}else l.isPointLight?(f.map=new Dl(i.x),f.map.depthTexture=new Na(i.x,He)):(f.map=new An(i.x,i.y),f.map.depthTexture=new Ma(i.x,i.y,He)),f.map.depthTexture.name=l.name+`.shadowMap`,f.map.depthTexture.format=$e,this.type===1?(f.map.depthTexture.compareFunction=g?518:515,f.map.depthTexture.minFilter=F,f.map.depthTexture.magFilter=F):(f.map.depthTexture.compareFunction=null,f.map.depthTexture.minFilter=N,f.map.depthTexture.magFilter=N);f.camera.updateProjectionMatrix()}let _=f.map.isWebGLCubeRenderTarget?6:1;for(let t=0;t<_;t++){if(f.map.isWebGLCubeRenderTarget)e.setRenderTarget(f.map,t),e.clear();else{t===0&&(e.setRenderTarget(f.map),e.clear());let n=f.getViewport(t);o.set(a.x*n.x,a.y*n.y,a.x*n.z,a.y*n.w),p.viewport(o)}if(l.isPointLight){let e=f.camera,n=f.matrix,r=l.distance||e.far;r!==e.far&&(e.far=r,e.updateProjectionMatrix()),du.setFromMatrixPosition(l.matrixWorld),e.position.copy(du),fu.copy(e.position),fu.add(cu[t]),e.up.copy(lu[t]),e.lookAt(fu),e.updateMatrixWorld(),n.makeTranslation(-du.x,-du.y,-du.z),uu.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),f._frustum.setFromProjectionMatrix(uu,e.coordinateSystem,e.reversedDepth)}else f.updateMatrices(l);r=f.getFrustum(),x(n,s,f.camera,l,this.type)}f.isPointLightShadow!==!0&&this.type===3&&y(f,s),f.needsUpdate=!1}v=this.type,_.needsUpdate=!1,e.setRenderTarget(c,l,f)};function y(n,r){let a=t.update(g);p.defines.VSM_SAMPLES!==n.blurSamples&&(p.defines.VSM_SAMPLES=n.blurSamples,m.defines.VSM_SAMPLES=n.blurSamples,p.needsUpdate=!0,m.needsUpdate=!0),n.mapPass===null&&(n.mapPass=new An(i.x,i.y,{format:rt,type:We})),p.uniforms.shadow_pass.value=n.map.depthTexture,p.uniforms.resolution.value=n.mapSize,p.uniforms.radius.value=n.radius,e.setRenderTarget(n.mapPass),e.clear(),e.renderBufferDirect(r,null,a,p,g,null),m.uniforms.shadow_pass.value=n.mapPass.texture,m.uniforms.resolution.value=n.mapSize,m.uniforms.radius.value=n.radius,e.setRenderTarget(n.map),e.clear(),e.renderBufferDirect(r,null,a,m,g,null)}function b(t,n,r,i){let a=null,o=r.isPointLight===!0?t.customDistanceMaterial:t.customDepthMaterial;if(o!==void 0)a=o;else if(a=r.isPointLight===!0?c:s,e.localClippingEnabled&&n.clipShadows===!0&&Array.isArray(n.clippingPlanes)&&n.clippingPlanes.length!==0||n.displacementMap&&n.displacementScale!==0||n.alphaMap&&n.alphaTest>0||n.map&&n.alphaTest>0||n.alphaToCoverage===!0){let e=a.uuid,t=n.uuid,r=l[e];r===void 0&&(r={},l[e]=r);let i=r[t];i===void 0&&(i=a.clone(),r[t]=i,n.addEventListener(`dispose`,S)),a=i}if(a.visible=n.visible,a.wireframe=n.wireframe,i===3?a.side=n.shadowSide===null?n.side:n.shadowSide:a.side=n.shadowSide===null?f[n.side]:n.shadowSide,a.alphaMap=n.alphaMap,a.alphaTest=n.alphaToCoverage===!0?.5:n.alphaTest,a.map=n.map,a.clipShadows=n.clipShadows,a.clippingPlanes=n.clippingPlanes,a.clipIntersection=n.clipIntersection,a.displacementMap=n.displacementMap,a.displacementScale=n.displacementScale,a.displacementBias=n.displacementBias,a.wireframeLinewidth=n.wireframeLinewidth,a.linewidth=n.linewidth,r.isPointLight===!0&&a.isMeshDistanceMaterial===!0){let t=e.properties.get(a);t.light=r}return a}function x(n,i,a,o,s){if(n.visible===!1)return;if(n.layers.test(i.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&s===3)&&(!n.frustumCulled||r.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(a.matrixWorldInverse,n.matrixWorld);let r=t.update(n),c=n.material;if(Array.isArray(c)){let t=r.groups;for(let l=0,u=t.length;l<u;l++){let u=t[l],d=c[u.materialIndex];if(d&&d.visible){let t=b(n,d,o,s);n.onBeforeShadow(e,n,i,a,r,t,u),e.renderBufferDirect(a,null,r,t,n,u),n.onAfterShadow(e,n,i,a,r,t,u)}}}else if(c.visible){let t=b(n,c,o,s);n.onBeforeShadow(e,n,i,a,r,t,null),e.renderBufferDirect(a,null,r,t,n,null),n.onAfterShadow(e,n,i,a,r,t,null)}}let c=n.children;for(let e=0,t=c.length;e<t;e++)x(c[e],i,a,o,s)}function S(e){e.target.removeEventListener(`dispose`,S);for(let t in l){let n=l[t],r=e.target.uuid;r in n&&(n[r].dispose(),delete n[r])}}}function al(e,t){function n(){let t=!1,n=new On,r=null,i=new On(0,0,0,0);return{setMask:function(n){r!==n&&!t&&(e.colorMask(n,n,n,n),r=n)},setLocked:function(e){t=e},setClear:function(t,r,a,o,s){s===!0&&(t*=o,r*=o,a*=o),n.set(t,r,a,o),i.equals(n)===!1&&(e.clearColor(t,r,a,o),i.copy(n))},reset:function(){t=!1,r=null,i.set(-1,0,0,0)}}}function r(){let n=!1,r=!1,i=null,a=null,o=null;return{setReversed:function(e){if(r!==e){let n=t.get(`EXT_clip_control`);e?n.clipControlEXT(n.LOWER_LEFT_EXT,n.ZERO_TO_ONE_EXT):n.clipControlEXT(n.LOWER_LEFT_EXT,n.NEGATIVE_ONE_TO_ONE_EXT),r=e;let i=o;o=null,this.setClear(i)}},getReversed:function(){return r},setTest:function(t){t?pe(e.DEPTH_TEST):me(e.DEPTH_TEST)},setMask:function(t){i!==t&&!n&&(e.depthMask(t),i=t)},setFunc:function(t){if(r&&(t=sn[t]),a!==t){switch(t){case 0:e.depthFunc(e.NEVER);break;case 1:e.depthFunc(e.ALWAYS);break;case 2:e.depthFunc(e.LESS);break;case 3:e.depthFunc(e.LEQUAL);break;case 4:e.depthFunc(e.EQUAL);break;case 5:e.depthFunc(e.GEQUAL);break;case 6:e.depthFunc(e.GREATER);break;case 7:e.depthFunc(e.NOTEQUAL);break;default:e.depthFunc(e.LEQUAL)}a=t}},setLocked:function(e){n=e},setClear:function(t){o!==t&&(o=t,r&&(t=1-t),e.clearDepth(t))},reset:function(){n=!1,i=null,a=null,o=null,r=!1}}}function i(){let t=!1,n=null,r=null,i=null,a=null,o=null,s=null,c=null,l=null;return{setTest:function(n){t||(n?pe(e.STENCIL_TEST):me(e.STENCIL_TEST))},setMask:function(r){n!==r&&!t&&(e.stencilMask(r),n=r)},setFunc:function(t,n,o){(r!==t||i!==n||a!==o)&&(e.stencilFunc(t,n,o),r=t,i=n,a=o)},setOp:function(t,n,r){(o!==t||s!==n||c!==r)&&(e.stencilOp(t,n,r),o=t,s=n,c=r)},setLocked:function(e){t=e},setClear:function(t){l!==t&&(e.clearStencil(t),l=t)},reset:function(){t=!1,n=null,r=null,i=null,a=null,o=null,s=null,c=null,l=null}}}let a=new n,o=new r,s=new i,c=new WeakMap,l=new WeakMap,u={},d={},p={},m=new WeakMap,h=[],g=null,_=!1,v=null,y=null,b=null,x=null,S=null,C=null,w=null,T=new z(0,0,0),E=0,D=!1,O=null,ee=null,k=null,te=null,ne=null,re=e.getParameter(e.MAX_COMBINED_TEXTURE_IMAGE_UNITS),ie=!1,ae=0,A=e.getParameter(e.VERSION);A.indexOf(`WebGL`)===-1?A.indexOf(`OpenGL ES`)!==-1&&(ae=parseFloat(/^OpenGL ES (\\d)/.exec(A)[1]),ie=ae>=2):(ae=parseFloat(/^WebGL (\\d)/.exec(A)[1]),ie=ae>=1);let oe=null,j={},se=e.getParameter(e.SCISSOR_BOX),ce=e.getParameter(e.VIEWPORT),le=new On().fromArray(se),ue=new On().fromArray(ce);function de(t,n,r,i){let a=new Uint8Array(4),o=e.createTexture();e.bindTexture(t,o),e.texParameteri(t,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(t,e.TEXTURE_MAG_FILTER,e.NEAREST);for(let o=0;o<r;o++)t===e.TEXTURE_3D||t===e.TEXTURE_2D_ARRAY?e.texImage3D(n,0,e.RGBA,1,1,i,0,e.RGBA,e.UNSIGNED_BYTE,a):e.texImage2D(n+o,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,a);return o}let fe={};fe[e.TEXTURE_2D]=de(e.TEXTURE_2D,e.TEXTURE_2D,1),fe[e.TEXTURE_CUBE_MAP]=de(e.TEXTURE_CUBE_MAP,e.TEXTURE_CUBE_MAP_POSITIVE_X,6),fe[e.TEXTURE_2D_ARRAY]=de(e.TEXTURE_2D_ARRAY,e.TEXTURE_2D_ARRAY,1,1),fe[e.TEXTURE_3D]=de(e.TEXTURE_3D,e.TEXTURE_3D,1,1),a.setClear(0,0,0,1),o.setClear(1),s.setClear(0),pe(e.DEPTH_TEST),o.setFunc(3),Se(!1),Ce(1),pe(e.CULL_FACE),be(0);function pe(t){u[t]!==!0&&(e.enable(t),u[t]=!0)}function me(t){u[t]!==!1&&(e.disable(t),u[t]=!1)}function he(t,n){return p[t]!==n&&(e.bindFramebuffer(t,n),p[t]=n,t===e.DRAW_FRAMEBUFFER&&(p[e.FRAMEBUFFER]=n),t===e.FRAMEBUFFER&&(p[e.DRAW_FRAMEBUFFER]=n),!0)}function ge(t,n){let r=h,i=!1;if(t){r=m.get(n),r===void 0&&(r=[],m.set(n,r));let a=t.textures;if(r.length!==a.length||r[0]!==e.COLOR_ATTACHMENT0){for(let t=0,n=a.length;t<n;t++)r[t]=e.COLOR_ATTACHMENT0+t;r.length=a.length,i=!0}}else r[0]!==e.BACK&&(r[0]=e.BACK,i=!0);i&&e.drawBuffers(r)}function _e(t){return g!==t&&(e.useProgram(t),g=t,!0)}let ve={100:e.FUNC_ADD,101:e.FUNC_SUBTRACT,102:e.FUNC_REVERSE_SUBTRACT};ve[103]=e.MIN,ve[104]=e.MAX;let ye={200:e.ZERO,201:e.ONE,202:e.SRC_COLOR,204:e.SRC_ALPHA,210:e.SRC_ALPHA_SATURATE,208:e.DST_COLOR,206:e.DST_ALPHA,203:e.ONE_MINUS_SRC_COLOR,205:e.ONE_MINUS_SRC_ALPHA,209:e.ONE_MINUS_DST_COLOR,207:e.ONE_MINUS_DST_ALPHA,211:e.CONSTANT_COLOR,212:e.ONE_MINUS_CONSTANT_COLOR,213:e.CONSTANT_ALPHA,214:e.ONE_MINUS_CONSTANT_ALPHA};function be(t,n,r,i,a,o,s,c,l,u){if(t===0){_===!0&&(me(e.BLEND),_=!1);return}if(_===!1&&(pe(e.BLEND),_=!0),t!==5){if(t!==v||u!==D){if((y!==100||S!==100)&&(e.blendEquation(e.FUNC_ADD),y=100,S=100),u)switch(t){case 1:e.blendFuncSeparate(e.ONE,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA);break;case 2:e.blendFunc(e.ONE,e.ONE);break;case 3:e.blendFuncSeparate(e.ZERO,e.ONE_MINUS_SRC_COLOR,e.ZERO,e.ONE);break;case 4:e.blendFuncSeparate(e.DST_COLOR,e.ONE_MINUS_SRC_ALPHA,e.ZERO,e.ONE);break;default:f(`WebGLState: Invalid blending: `,t)}else switch(t){case 1:e.blendFuncSeparate(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA);break;case 2:e.blendFuncSeparate(e.SRC_ALPHA,e.ONE,e.ONE,e.ONE);break;case 3:f(`WebGLState: SubtractiveBlending requires material.premultipliedAlpha = true`);break;case 4:f(`WebGLState: MultiplyBlending requires material.premultipliedAlpha = true`);break;default:f(`WebGLState: Invalid blending: `,t)}b=null,x=null,C=null,w=null,T.set(0,0,0),E=0,v=t,D=u}return}a||=n,o||=r,s||=i,(n!==y||a!==S)&&(e.blendEquationSeparate(ve[n],ve[a]),y=n,S=a),(r!==b||i!==x||o!==C||s!==w)&&(e.blendFuncSeparate(ye[r],ye[i],ye[o],ye[s]),b=r,x=i,C=o,w=s),(c.equals(T)===!1||l!==E)&&(e.blendColor(c.r,c.g,c.b,l),T.copy(c),E=l),v=t,D=!1}function xe(t,n){t.side===2?me(e.CULL_FACE):pe(e.CULL_FACE);let r=t.side===1;n&&(r=!r),Se(r),t.blending===1&&t.transparent===!1?be(0):be(t.blending,t.blendEquation,t.blendSrc,t.blendDst,t.blendEquationAlpha,t.blendSrcAlpha,t.blendDstAlpha,t.blendColor,t.blendAlpha,t.premultipliedAlpha),o.setFunc(t.depthFunc),o.setTest(t.depthTest),o.setMask(t.depthWrite),a.setMask(t.colorWrite);let i=t.stencilWrite;s.setTest(i),i&&(s.setMask(t.stencilWriteMask),s.setFunc(t.stencilFunc,t.stencilRef,t.stencilFuncMask),s.setOp(t.stencilFail,t.stencilZFail,t.stencilZPass)),Te(t.polygonOffset,t.polygonOffsetFactor,t.polygonOffsetUnits),t.alphaToCoverage===!0?pe(e.SAMPLE_ALPHA_TO_COVERAGE):me(e.SAMPLE_ALPHA_TO_COVERAGE)}function Se(t){O!==t&&(t?e.frontFace(e.CW):e.frontFace(e.CCW),O=t)}function Ce(t){t===0?me(e.CULL_FACE):(pe(e.CULL_FACE),t!==ee&&(t===1?e.cullFace(e.BACK):t===2?e.cullFace(e.FRONT):e.cullFace(e.FRONT_AND_BACK))),ee=t}function we(t){t!==k&&(ie&&e.lineWidth(t),k=t)}function Te(t,n,r){t?(pe(e.POLYGON_OFFSET_FILL),(te!==n||ne!==r)&&(te=n,ne=r,o.getReversed()&&(n=-n),e.polygonOffset(n,r))):me(e.POLYGON_OFFSET_FILL)}function Ee(t){t?pe(e.SCISSOR_TEST):me(e.SCISSOR_TEST)}function De(t){t===void 0&&(t=e.TEXTURE0+re-1),oe!==t&&(e.activeTexture(t),oe=t)}function Oe(t,n,r){r===void 0&&(r=oe===null?e.TEXTURE0+re-1:oe);let i=j[r];i===void 0&&(i={type:void 0,texture:void 0},j[r]=i),(i.type!==t||i.texture!==n)&&(oe!==r&&(e.activeTexture(r),oe=r),e.bindTexture(t,n||fe[t]),i.type=t,i.texture=n)}function ke(){let t=j[oe];t!==void 0&&t.type!==void 0&&(e.bindTexture(t.type,null),t.type=void 0,t.texture=void 0)}function Ae(){try{e.compressedTexImage2D(...arguments)}catch(e){f(`WebGLState:`,e)}}function M(){try{e.compressedTexImage3D(...arguments)}catch(e){f(`WebGLState:`,e)}}function je(){try{e.texSubImage2D(...arguments)}catch(e){f(`WebGLState:`,e)}}function Me(){try{e.texSubImage3D(...arguments)}catch(e){f(`WebGLState:`,e)}}function Ne(){try{e.compressedTexSubImage2D(...arguments)}catch(e){f(`WebGLState:`,e)}}function N(){try{e.compressedTexSubImage3D(...arguments)}catch(e){f(`WebGLState:`,e)}}function Pe(){try{e.texStorage2D(...arguments)}catch(e){f(`WebGLState:`,e)}}function P(){try{e.texStorage3D(...arguments)}catch(e){f(`WebGLState:`,e)}}function F(){try{e.texImage2D(...arguments)}catch(e){f(`WebGLState:`,e)}}function Fe(){try{e.texImage3D(...arguments)}catch(e){f(`WebGLState:`,e)}}function Ie(t){return d[t]===void 0?e.getParameter(t):d[t]}function Le(t,n){d[t]!==n&&(e.pixelStorei(t,n),d[t]=n)}function Re(t){le.equals(t)===!1&&(e.scissor(t.x,t.y,t.z,t.w),le.copy(t))}function ze(t){ue.equals(t)===!1&&(e.viewport(t.x,t.y,t.z,t.w),ue.copy(t))}function Be(t,n){let r=l.get(n);r===void 0&&(r=new WeakMap,l.set(n,r));let i=r.get(t);i===void 0&&(i=e.getUniformBlockIndex(n,t.name),r.set(t,i))}function Ve(t,n){let r=l.get(n).get(t);c.get(n)!==r&&(e.uniformBlockBinding(n,r,t.__bindingPointIndex),c.set(n,r))}function He(){e.disable(e.BLEND),e.disable(e.CULL_FACE),e.disable(e.DEPTH_TEST),e.disable(e.POLYGON_OFFSET_FILL),e.disable(e.SCISSOR_TEST),e.disable(e.STENCIL_TEST),e.disable(e.SAMPLE_ALPHA_TO_COVERAGE),e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ONE,e.ZERO),e.blendFuncSeparate(e.ONE,e.ZERO,e.ONE,e.ZERO),e.blendColor(0,0,0,0),e.colorMask(!0,!0,!0,!0),e.clearColor(0,0,0,0),e.depthMask(!0),e.depthFunc(e.LESS),o.setReversed(!1),e.clearDepth(1),e.stencilMask(4294967295),e.stencilFunc(e.ALWAYS,0,4294967295),e.stencilOp(e.KEEP,e.KEEP,e.KEEP),e.clearStencil(0),e.cullFace(e.BACK),e.frontFace(e.CCW),e.polygonOffset(0,0),e.activeTexture(e.TEXTURE0),e.bindFramebuffer(e.FRAMEBUFFER,null),e.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),e.bindFramebuffer(e.READ_FRAMEBUFFER,null),e.useProgram(null),e.lineWidth(1),e.scissor(0,0,e.canvas.width,e.canvas.height),e.viewport(0,0,e.canvas.width,e.canvas.height),e.pixelStorei(e.PACK_ALIGNMENT,4),e.pixelStorei(e.UNPACK_ALIGNMENT,4),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!1),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,e.BROWSER_DEFAULT_WEBGL),e.pixelStorei(e.PACK_ROW_LENGTH,0),e.pixelStorei(e.PACK_SKIP_PIXELS,0),e.pixelStorei(e.PACK_SKIP_ROWS,0),e.pixelStorei(e.UNPACK_ROW_LENGTH,0),e.pixelStorei(e.UNPACK_IMAGE_HEIGHT,0),e.pixelStorei(e.UNPACK_SKIP_PIXELS,0),e.pixelStorei(e.UNPACK_SKIP_ROWS,0),e.pixelStorei(e.UNPACK_SKIP_IMAGES,0),u={},d={},oe=null,j={},p={},m=new WeakMap,h=[],g=null,_=!1,v=null,y=null,b=null,x=null,S=null,C=null,w=null,T=new z(0,0,0),E=0,D=!1,O=null,ee=null,k=null,te=null,ne=null,le.set(0,0,e.canvas.width,e.canvas.height),ue.set(0,0,e.canvas.width,e.canvas.height),a.reset(),o.reset(),s.reset()}return{buffers:{color:a,depth:o,stencil:s},enable:pe,disable:me,bindFramebuffer:he,drawBuffers:ge,useProgram:_e,setBlending:be,setMaterial:xe,setFlipSided:Se,setCullFace:Ce,setLineWidth:we,setPolygonOffset:Te,setScissorTest:Ee,activeTexture:De,bindTexture:Oe,unbindTexture:ke,compressedTexImage2D:Ae,compressedTexImage3D:M,texImage2D:F,texImage3D:Fe,pixelStorei:Le,getParameter:Ie,updateUBOMapping:Be,uniformBlockBinding:Ve,texStorage2D:Pe,texStorage3D:P,texSubImage2D:je,texSubImage3D:Me,compressedTexSubImage2D:Ne,compressedTexSubImage3D:N,scissor:Re,viewport:ze,reset:He}}function ol(e,t,n,r,i,a,o){let c=t.has(`WEBGL_multisampled_render_to_texture`)?t.get(`WEBGL_multisampled_render_to_texture`):null,l=typeof navigator>`u`?!1:/OculusBrowser/g.test(navigator.userAgent),u=new I,p=new WeakMap,m=new Set,h,g=new WeakMap,_=!1;try{_=typeof OffscreenCanvas<`u`&&new OffscreenCanvas(1,1).getContext(`2d`)!==null}catch{}function v(e,t){return _?new OffscreenCanvas(e,t):s(`canvas`)}function y(e,t,n){let r=1,i=Re(e);if((i.width>n||i.height>n)&&(r=n/Math.max(i.width,i.height)),r<1){if(typeof HTMLImageElement<`u`&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement||typeof ImageBitmap<`u`&&e instanceof ImageBitmap||typeof VideoFrame<`u`&&e instanceof VideoFrame){let n=Math.floor(r*i.width),a=Math.floor(r*i.height);h===void 0&&(h=v(n,a));let o=t?v(n,a):h;return o.width=n,o.height=a,o.getContext(`2d`).drawImage(e,0,0,n,a),d(`WebGLRenderer: Texture has been resized from (`+i.width+`x`+i.height+`) to (`+n+`x`+a+`).`),o}return`data`in e&&d(`WebGLRenderer: Image in DataTexture is too big (`+i.width+`x`+i.height+`).`),e}return e}function b(e){return e.generateMipmaps}function x(t){e.generateMipmap(t)}function S(t){return t.isWebGLCubeRenderTarget?e.TEXTURE_CUBE_MAP:t.isWebGL3DRenderTarget?e.TEXTURE_3D:t.isWebGLArrayRenderTarget||t.isCompressedArrayTexture?e.TEXTURE_2D_ARRAY:e.TEXTURE_2D}function C(n,r,i,a,o,s=!1){if(n!==null){if(e[n]!==void 0)return e[n];d(`WebGLRenderer: Attempt to use non-existing WebGL internal format '`+n+`'`)}let c;a&&(c=t.get(`EXT_texture_norm16`),c||d(`WebGLRenderer: Unable to use normalized textures without EXT_texture_norm16 extension`));let l=r;if(r===e.RED&&(i===e.FLOAT&&(l=e.R32F),i===e.HALF_FLOAT&&(l=e.R16F),i===e.UNSIGNED_BYTE&&(l=e.R8),i===e.UNSIGNED_SHORT&&c&&(l=c.R16_EXT),i===e.SHORT&&c&&(l=c.R16_SNORM_EXT)),r===e.RED_INTEGER&&(i===e.UNSIGNED_BYTE&&(l=e.R8UI),i===e.UNSIGNED_SHORT&&(l=e.R16UI),i===e.UNSIGNED_INT&&(l=e.R32UI),i===e.BYTE&&(l=e.R8I),i===e.SHORT&&(l=e.R16I),i===e.INT&&(l=e.R32I)),r===e.RG&&(i===e.FLOAT&&(l=e.RG32F),i===e.HALF_FLOAT&&(l=e.RG16F),i===e.UNSIGNED_BYTE&&(l=e.RG8),i===e.UNSIGNED_SHORT&&c&&(l=c.RG16_EXT),i===e.SHORT&&c&&(l=c.RG16_SNORM_EXT)),r===e.RG_INTEGER&&(i===e.UNSIGNED_BYTE&&(l=e.RG8UI),i===e.UNSIGNED_SHORT&&(l=e.RG16UI),i===e.UNSIGNED_INT&&(l=e.RG32UI),i===e.BYTE&&(l=e.RG8I),i===e.SHORT&&(l=e.RG16I),i===e.INT&&(l=e.RG32I)),r===e.RGB_INTEGER&&(i===e.UNSIGNED_BYTE&&(l=e.RGB8UI),i===e.UNSIGNED_SHORT&&(l=e.RGB16UI),i===e.UNSIGNED_INT&&(l=e.RGB32UI),i===e.BYTE&&(l=e.RGB8I),i===e.SHORT&&(l=e.RGB16I),i===e.INT&&(l=e.RGB32I)),r===e.RGBA_INTEGER&&(i===e.UNSIGNED_BYTE&&(l=e.RGBA8UI),i===e.UNSIGNED_SHORT&&(l=e.RGBA16UI),i===e.UNSIGNED_INT&&(l=e.RGBA32UI),i===e.BYTE&&(l=e.RGBA8I),i===e.SHORT&&(l=e.RGBA16I),i===e.INT&&(l=e.RGBA32I)),r===e.RGB&&(i===e.UNSIGNED_SHORT&&c&&(l=c.RGB16_EXT),i===e.SHORT&&c&&(l=c.RGB16_SNORM_EXT),i===e.UNSIGNED_INT_5_9_9_9_REV&&(l=e.RGB9_E5),i===e.UNSIGNED_INT_10F_11F_11F_REV&&(l=e.R11F_G11F_B10F)),r===e.RGBA){let t=s?$t:bn.getTransfer(o);i===e.FLOAT&&(l=e.RGBA32F),i===e.HALF_FLOAT&&(l=e.RGBA16F),i===e.UNSIGNED_BYTE&&(l=t===`srgb`?e.SRGB8_ALPHA8:e.RGBA8),i===e.UNSIGNED_SHORT&&c&&(l=c.RGBA16_EXT),i===e.SHORT&&c&&(l=c.RGBA16_SNORM_EXT),i===e.UNSIGNED_SHORT_4_4_4_4&&(l=e.RGBA4),i===e.UNSIGNED_SHORT_5_5_5_1&&(l=e.RGB5_A1)}return(l===e.R16F||l===e.R32F||l===e.RG16F||l===e.RG32F||l===e.RGBA16F||l===e.RGBA32F)&&t.get(`EXT_color_buffer_float`),l}function w(t,n){let r;return t?n===null||n===1014||n===1020?r=e.DEPTH24_STENCIL8:n===1015?r=e.DEPTH32F_STENCIL8:n===1012&&(r=e.DEPTH24_STENCIL8,d(`DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.`)):n===null||n===1014||n===1020?r=e.DEPTH_COMPONENT24:n===1015?r=e.DEPTH_COMPONENT32F:n===1012&&(r=e.DEPTH_COMPONENT16),r}function T(e,t){return b(e)===!0||e.isFramebufferTexture&&e.minFilter!==1003&&e.minFilter!==1006?Math.log2(Math.max(t.width,t.height))+1:e.mipmaps!==void 0&&e.mipmaps.length>0?e.mipmaps.length:e.isCompressedTexture&&Array.isArray(e.image)?t.mipmaps.length:1}function E(e){let t=e.target;t.removeEventListener(`dispose`,E),O(t),t.isVideoTexture&&p.delete(t),t.isHTMLTexture&&m.delete(t)}function D(e){let t=e.target;t.removeEventListener(`dispose`,D),k(t)}function O(e){let t=r.get(e);if(t.__webglInit===void 0)return;let n=e.source,i=g.get(n);if(i){let r=i[t.__cacheKey];r.usedTimes--,r.usedTimes===0&&ee(e),Object.keys(i).length===0&&g.delete(n)}r.remove(e)}function ee(t){let n=r.get(t);e.deleteTexture(n.__webglTexture);let i=t.source,a=g.get(i);delete a[n.__cacheKey],o.memory.textures--}function k(t){let n=r.get(t);if(t.depthTexture&&(t.depthTexture.dispose(),r.remove(t.depthTexture)),t.isWebGLCubeRenderTarget)for(let t=0;t<6;t++){if(Array.isArray(n.__webglFramebuffer[t]))for(let r=0;r<n.__webglFramebuffer[t].length;r++)e.deleteFramebuffer(n.__webglFramebuffer[t][r]);else e.deleteFramebuffer(n.__webglFramebuffer[t]);n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer[t])}else{if(Array.isArray(n.__webglFramebuffer))for(let t=0;t<n.__webglFramebuffer.length;t++)e.deleteFramebuffer(n.__webglFramebuffer[t]);else e.deleteFramebuffer(n.__webglFramebuffer);if(n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer),n.__webglMultisampledFramebuffer&&e.deleteFramebuffer(n.__webglMultisampledFramebuffer),n.__webglColorRenderbuffer)for(let t=0;t<n.__webglColorRenderbuffer.length;t++)n.__webglColorRenderbuffer[t]&&e.deleteRenderbuffer(n.__webglColorRenderbuffer[t]);n.__webglDepthRenderbuffer&&e.deleteRenderbuffer(n.__webglDepthRenderbuffer)}let i=t.textures;for(let t=0,n=i.length;t<n;t++){let n=r.get(i[t]);n.__webglTexture&&(e.deleteTexture(n.__webglTexture),o.memory.textures--),r.remove(i[t])}r.remove(t)}let te=0;function ne(){te=0}function re(){return te}function ie(e){te=e}function ae(){let e=te;return e>=i.maxTextures&&d(`WebGLTextures: Trying to use `+e+` texture units while this GPU supports only `+i.maxTextures),te+=1,e}function A(e){let t=[];return t.push(e.wrapS),t.push(e.wrapT),t.push(e.wrapR||0),t.push(e.magFilter),t.push(e.minFilter),t.push(e.anisotropy),t.push(e.internalFormat),t.push(e.format),t.push(e.type),t.push(e.generateMipmaps),t.push(e.premultiplyAlpha),t.push(e.flipY),t.push(e.unpackAlignment),t.push(e.colorSpace),t.join()}function oe(t,i){let a=r.get(t);if(t.isVideoTexture&&M(t),t.isRenderTargetTexture===!1&&t.isExternalTexture!==!0&&t.version>0&&a.__version!==t.version){let e=t.image;if(e===null)d(`WebGLRenderer: Texture marked for update but no image data found.`);else if(e.complete===!1)d(`WebGLRenderer: Texture marked for update but image is incomplete`);else{ge(a,t,i);return}}else t.isExternalTexture&&(a.__webglTexture=t.sourceTexture?t.sourceTexture:null);n.bindTexture(e.TEXTURE_2D,a.__webglTexture,e.TEXTURE0+i)}function j(t,i){let a=r.get(t);if(t.isRenderTargetTexture===!1&&t.version>0&&a.__version!==t.version){ge(a,t,i);return}t.isExternalTexture&&(a.__webglTexture=t.sourceTexture?t.sourceTexture:null),n.bindTexture(e.TEXTURE_2D_ARRAY,a.__webglTexture,e.TEXTURE0+i)}function se(t,i){let a=r.get(t);if(t.isRenderTargetTexture===!1&&t.version>0&&a.__version!==t.version){ge(a,t,i);return}n.bindTexture(e.TEXTURE_3D,a.__webglTexture,e.TEXTURE0+i)}function ce(t,i){let a=r.get(t);if(t.isCubeDepthTexture!==!0&&t.version>0&&a.__version!==t.version){_e(a,t,i);return}n.bindTexture(e.TEXTURE_CUBE_MAP,a.__webglTexture,e.TEXTURE0+i)}let le={[je]:e.REPEAT,[Me]:e.CLAMP_TO_EDGE,[Ne]:e.MIRRORED_REPEAT},ue={[N]:e.NEAREST,[Pe]:e.NEAREST_MIPMAP_NEAREST,[P]:e.NEAREST_MIPMAP_LINEAR,[F]:e.LINEAR,[Fe]:e.LINEAR_MIPMAP_NEAREST,[Ie]:e.LINEAR_MIPMAP_LINEAR},de={512:e.NEVER,519:e.ALWAYS,513:e.LESS,515:e.LEQUAL,514:e.EQUAL,518:e.GEQUAL,516:e.GREATER,517:e.NOTEQUAL};function fe(n,a){if(a.type===1015&&t.has(`OES_texture_float_linear`)===!1&&(a.magFilter===1006||a.magFilter===1007||a.magFilter===1005||a.magFilter===1008||a.minFilter===1006||a.minFilter===1007||a.minFilter===1005||a.minFilter===1008)&&d(`WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device.`),e.texParameteri(n,e.TEXTURE_WRAP_S,le[a.wrapS]),e.texParameteri(n,e.TEXTURE_WRAP_T,le[a.wrapT]),(n===e.TEXTURE_3D||n===e.TEXTURE_2D_ARRAY)&&e.texParameteri(n,e.TEXTURE_WRAP_R,le[a.wrapR]),e.texParameteri(n,e.TEXTURE_MAG_FILTER,ue[a.magFilter]),e.texParameteri(n,e.TEXTURE_MIN_FILTER,ue[a.minFilter]),a.compareFunction&&(e.texParameteri(n,e.TEXTURE_COMPARE_MODE,e.COMPARE_REF_TO_TEXTURE),e.texParameteri(n,e.TEXTURE_COMPARE_FUNC,de[a.compareFunction])),t.has(`EXT_texture_filter_anisotropic`)===!0){if(a.magFilter===1003||a.minFilter!==1005&&a.minFilter!==1008||a.type===1015&&t.has(`OES_texture_float_linear`)===!1)return;if(a.anisotropy>1||r.get(a).__currentAnisotropy){let o=t.get(`EXT_texture_filter_anisotropic`);e.texParameterf(n,o.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(a.anisotropy,i.getMaxAnisotropy())),r.get(a).__currentAnisotropy=a.anisotropy}}}function pe(t,n){let r=!1;t.__webglInit===void 0&&(t.__webglInit=!0,n.addEventListener(`dispose`,E));let i=n.source,a=g.get(i);a===void 0&&(a={},g.set(i,a));let s=A(n);if(s!==t.__cacheKey){a[s]===void 0&&(a[s]={texture:e.createTexture(),usedTimes:0},o.memory.textures++,r=!0),a[s].usedTimes++;let i=a[t.__cacheKey];i!==void 0&&(a[t.__cacheKey].usedTimes--,i.usedTimes===0&&ee(n)),t.__cacheKey=s,t.__webglTexture=a[s].texture}return r}function me(e,t,n){return Math.floor(Math.floor(e/n)/t)}function he(t,r,i,a){let o=t.updateRanges;if(o.length===0)n.texSubImage2D(e.TEXTURE_2D,0,0,0,r.width,r.height,i,a,r.data);else{o.sort((e,t)=>e.start-t.start);let s=0;for(let e=1;e<o.length;e++){let t=o[s],n=o[e],i=t.start+t.count,a=me(n.start,r.width,4),c=me(t.start,r.width,4);n.start<=i+1&&a===c&&me(n.start+n.count-1,r.width,4)===a?t.count=Math.max(t.count,n.start+n.count-t.start):(++s,o[s]=n)}o.length=s+1;let c=n.getParameter(e.UNPACK_ROW_LENGTH),l=n.getParameter(e.UNPACK_SKIP_PIXELS),u=n.getParameter(e.UNPACK_SKIP_ROWS);n.pixelStorei(e.UNPACK_ROW_LENGTH,r.width);for(let t=0,s=o.length;t<s;t++){let s=o[t],c=Math.floor(s.start/4),l=Math.ceil(s.count/4),u=c%r.width,d=Math.floor(c/r.width),f=l;n.pixelStorei(e.UNPACK_SKIP_PIXELS,u),n.pixelStorei(e.UNPACK_SKIP_ROWS,d),n.texSubImage2D(e.TEXTURE_2D,0,u,d,f,1,i,a,r.data)}t.clearUpdateRanges(),n.pixelStorei(e.UNPACK_ROW_LENGTH,c),n.pixelStorei(e.UNPACK_SKIP_PIXELS,l),n.pixelStorei(e.UNPACK_SKIP_ROWS,u)}}function ge(t,o,s){let c=e.TEXTURE_2D;(o.isDataArrayTexture||o.isCompressedArrayTexture)&&(c=e.TEXTURE_2D_ARRAY),o.isData3DTexture&&(c=e.TEXTURE_3D);let l=pe(t,o),u=o.source;n.bindTexture(c,t.__webglTexture,e.TEXTURE0+s);let f=r.get(u);if(u.version!==f.__version||l===!0){if(n.activeTexture(e.TEXTURE0+s),!(typeof ImageBitmap<`u`&&o.image instanceof ImageBitmap)){let t=bn.getPrimaries(bn.workingColorSpace),r=o.colorSpace===``?null:bn.getPrimaries(o.colorSpace),i=o.colorSpace===``||t===r?e.NONE:e.BROWSER_DEFAULT_WEBGL;n.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,o.flipY),n.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,o.premultiplyAlpha),n.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,i)}n.pixelStorei(e.UNPACK_ALIGNMENT,o.unpackAlignment);let t=y(o.image,!1,i.maxTextureSize);t=Le(o,t);let r=a.convert(o.format,o.colorSpace),p=a.convert(o.type),h=C(o.internalFormat,r,p,o.normalized,o.colorSpace,o.isVideoTexture);fe(c,o);let g,_=o.mipmaps,v=o.isVideoTexture!==!0,S=f.__version===void 0||l===!0,E=u.dataReady,D=T(o,t);if(o.isDepthTexture)h=w(o.format===et,o.type),S&&(v?n.texStorage2D(e.TEXTURE_2D,1,h,t.width,t.height):n.texImage2D(e.TEXTURE_2D,0,h,t.width,t.height,0,r,p,null));else if(o.isDataTexture){if(_.length>0){v&&S&&n.texStorage2D(e.TEXTURE_2D,D,h,_[0].width,_[0].height);for(let t=0,i=_.length;t<i;t++)g=_[t],v?E&&n.texSubImage2D(e.TEXTURE_2D,t,0,0,g.width,g.height,r,p,g.data):n.texImage2D(e.TEXTURE_2D,t,h,g.width,g.height,0,r,p,g.data);o.generateMipmaps=!1}else v?(S&&n.texStorage2D(e.TEXTURE_2D,D,h,t.width,t.height),E&&he(o,t,r,p)):n.texImage2D(e.TEXTURE_2D,0,h,t.width,t.height,0,r,p,t.data)}else if(o.isCompressedTexture){if(o.isCompressedArrayTexture){v&&S&&n.texStorage3D(e.TEXTURE_2D_ARRAY,D,h,_[0].width,_[0].height,t.depth);for(let i=0,a=_.length;i<a;i++)if(g=_[i],o.format!==1023){if(r!==null){if(v){if(E){if(o.layerUpdates.size>0){let t=De(g.width,g.height,o.format,o.type);for(let a of o.layerUpdates){let o=g.data.subarray(a*t/g.data.BYTES_PER_ELEMENT,(a+1)*t/g.data.BYTES_PER_ELEMENT);n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,i,0,0,a,g.width,g.height,1,r,o)}o.clearLayerUpdates()}else n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,i,0,0,0,g.width,g.height,t.depth,r,g.data)}}else n.compressedTexImage3D(e.TEXTURE_2D_ARRAY,i,h,g.width,g.height,t.depth,0,g.data,0,0)}else d(`WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()`)}else v?E&&n.texSubImage3D(e.TEXTURE_2D_ARRAY,i,0,0,0,g.width,g.height,t.depth,r,p,g.data):n.texImage3D(e.TEXTURE_2D_ARRAY,i,h,g.width,g.height,t.depth,0,r,p,g.data)}else{v&&S&&n.texStorage2D(e.TEXTURE_2D,D,h,_[0].width,_[0].height);for(let t=0,i=_.length;t<i;t++)g=_[t],o.format===1023?v?E&&n.texSubImage2D(e.TEXTURE_2D,t,0,0,g.width,g.height,r,p,g.data):n.texImage2D(e.TEXTURE_2D,t,h,g.width,g.height,0,r,p,g.data):r===null?d(`WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()`):v?E&&n.compressedTexSubImage2D(e.TEXTURE_2D,t,0,0,g.width,g.height,r,g.data):n.compressedTexImage2D(e.TEXTURE_2D,t,h,g.width,g.height,0,g.data)}}else if(o.isDataArrayTexture){if(v){if(S&&n.texStorage3D(e.TEXTURE_2D_ARRAY,D,h,t.width,t.height,t.depth),E){if(o.layerUpdates.size>0){let i=De(t.width,t.height,o.format,o.type);for(let a of o.layerUpdates){let o=t.data.subarray(a*i/t.data.BYTES_PER_ELEMENT,(a+1)*i/t.data.BYTES_PER_ELEMENT);n.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,a,t.width,t.height,1,r,p,o)}o.clearLayerUpdates()}else n.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,0,t.width,t.height,t.depth,r,p,t.data)}}else n.texImage3D(e.TEXTURE_2D_ARRAY,0,h,t.width,t.height,t.depth,0,r,p,t.data)}else if(o.isData3DTexture)v?(S&&n.texStorage3D(e.TEXTURE_3D,D,h,t.width,t.height,t.depth),E&&n.texSubImage3D(e.TEXTURE_3D,0,0,0,0,t.width,t.height,t.depth,r,p,t.data)):n.texImage3D(e.TEXTURE_3D,0,h,t.width,t.height,t.depth,0,r,p,t.data);else if(o.isFramebufferTexture){if(S){if(v)n.texStorage2D(e.TEXTURE_2D,D,h,t.width,t.height);else{let i=t.width,a=t.height;for(let t=0;t<D;t++)n.texImage2D(e.TEXTURE_2D,t,h,i,a,0,r,p,null),i>>=1,a>>=1}}}else if(o.isHTMLTexture){if(`texElementImage2D`in e){let n=e.canvas;if(n.hasAttribute(`layoutsubtree`)||n.setAttribute(`layoutsubtree`,`true`),t.parentNode!==n){n.appendChild(t),m.add(o),n.onpaint=e=>{let t=e.changedElements;for(let e of m)t.includes(e.image)&&(e.needsUpdate=!0)},n.requestPaint();return}if(e.texElementImage2D.length===3)e.texElementImage2D(e.TEXTURE_2D,e.RGBA8,t);else{let n=e.RGBA,r=e.RGBA,i=e.UNSIGNED_BYTE;e.texElementImage2D(e.TEXTURE_2D,0,n,r,i,t)}e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE)}}else if(_.length>0){if(v&&S){let t=Re(_[0]);n.texStorage2D(e.TEXTURE_2D,D,h,t.width,t.height)}for(let t=0,i=_.length;t<i;t++)g=_[t],v?E&&n.texSubImage2D(e.TEXTURE_2D,t,0,0,r,p,g):n.texImage2D(e.TEXTURE_2D,t,h,r,p,g);o.generateMipmaps=!1}else if(v){if(S){let r=Re(t);n.texStorage2D(e.TEXTURE_2D,D,h,r.width,r.height)}E&&n.texSubImage2D(e.TEXTURE_2D,0,0,0,r,p,t)}else n.texImage2D(e.TEXTURE_2D,0,h,r,p,t);b(o)&&x(c),f.__version=u.version,o.onUpdate&&o.onUpdate(o)}t.__version=o.version}function _e(t,o,s){if(o.image.length!==6)return;let c=pe(t,o),l=o.source;n.bindTexture(e.TEXTURE_CUBE_MAP,t.__webglTexture,e.TEXTURE0+s);let u=r.get(l);if(l.version!==u.__version||c===!0){n.activeTexture(e.TEXTURE0+s);let t=bn.getPrimaries(bn.workingColorSpace),r=o.colorSpace===``?null:bn.getPrimaries(o.colorSpace),f=o.colorSpace===``||t===r?e.NONE:e.BROWSER_DEFAULT_WEBGL;n.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,o.flipY),n.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,o.premultiplyAlpha),n.pixelStorei(e.UNPACK_ALIGNMENT,o.unpackAlignment),n.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,f);let p=o.isCompressedTexture||o.image[0].isCompressedTexture,m=o.image[0]&&o.image[0].isDataTexture,h=[];for(let e=0;e<6;e++)!p&&!m?h[e]=y(o.image[e],!0,i.maxCubemapSize):h[e]=m?o.image[e].image:o.image[e],h[e]=Le(o,h[e]);let g=h[0],_=a.convert(o.format,o.colorSpace),v=a.convert(o.type),S=C(o.internalFormat,_,v,o.normalized,o.colorSpace),w=o.isVideoTexture!==!0,E=u.__version===void 0||c===!0,D=l.dataReady,O=T(o,g);fe(e.TEXTURE_CUBE_MAP,o);let ee;if(p){w&&E&&n.texStorage2D(e.TEXTURE_CUBE_MAP,O,S,g.width,g.height);for(let t=0;t<6;t++){ee=h[t].mipmaps;for(let r=0;r<ee.length;r++){let i=ee[r];o.format===1023?w?D&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r,0,0,i.width,i.height,_,v,i.data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r,S,i.width,i.height,0,_,v,i.data):_===null?d(`WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()`):w?D&&n.compressedTexSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r,0,0,i.width,i.height,_,i.data):n.compressedTexImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r,S,i.width,i.height,0,i.data)}}}else{if(ee=o.mipmaps,w&&E){ee.length>0&&O++;let t=Re(h[0]);n.texStorage2D(e.TEXTURE_CUBE_MAP,O,S,t.width,t.height)}for(let t=0;t<6;t++)if(m){w?D&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,0,0,h[t].width,h[t].height,_,v,h[t].data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,S,h[t].width,h[t].height,0,_,v,h[t].data);for(let r=0;r<ee.length;r++){let i=ee[r].image[t].image;w?D&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r+1,0,0,i.width,i.height,_,v,i.data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r+1,S,i.width,i.height,0,_,v,i.data)}}else{w?D&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,0,0,_,v,h[t]):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,S,_,v,h[t]);for(let r=0;r<ee.length;r++){let i=ee[r];w?D&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r+1,0,0,_,v,i.image[t]):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r+1,S,_,v,i.image[t])}}}b(o)&&x(e.TEXTURE_CUBE_MAP),u.__version=l.version,o.onUpdate&&o.onUpdate(o)}t.__version=o.version}function ve(t,i,o,s,l,u){let d=a.convert(o.format,o.colorSpace),f=a.convert(o.type),p=C(o.internalFormat,d,f,o.normalized,o.colorSpace),m=r.get(i),h=r.get(o);if(h.__renderTarget=i,!m.__hasExternalTextures){let t=Math.max(1,i.width>>u),r=Math.max(1,i.height>>u);l===e.TEXTURE_3D||l===e.TEXTURE_2D_ARRAY?n.texImage3D(l,u,p,t,r,i.depth,0,d,f,null):n.texImage2D(l,u,p,t,r,0,d,f,null)}n.bindFramebuffer(e.FRAMEBUFFER,t),Ae(i)?c.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,s,l,h.__webglTexture,0,ke(i)):(l===e.TEXTURE_2D||l>=e.TEXTURE_CUBE_MAP_POSITIVE_X&&l<=e.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&e.framebufferTexture2D(e.FRAMEBUFFER,s,l,h.__webglTexture,u),n.bindFramebuffer(e.FRAMEBUFFER,null)}function ye(t,n,r){if(e.bindRenderbuffer(e.RENDERBUFFER,t),n.depthBuffer){let i=n.depthTexture,a=i&&i.isDepthTexture?i.type:null,o=w(n.stencilBuffer,a),s=n.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT;Ae(n)?c.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,ke(n),o,n.width,n.height):r?e.renderbufferStorageMultisample(e.RENDERBUFFER,ke(n),o,n.width,n.height):e.renderbufferStorage(e.RENDERBUFFER,o,n.width,n.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,s,e.RENDERBUFFER,t)}else{let t=n.textures;for(let i=0;i<t.length;i++){let o=t[i],s=a.convert(o.format,o.colorSpace),l=a.convert(o.type),u=C(o.internalFormat,s,l,o.normalized,o.colorSpace);Ae(n)?c.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,ke(n),u,n.width,n.height):r?e.renderbufferStorageMultisample(e.RENDERBUFFER,ke(n),u,n.width,n.height):e.renderbufferStorage(e.RENDERBUFFER,u,n.width,n.height)}}e.bindRenderbuffer(e.RENDERBUFFER,null)}function be(t,i,o){let s=i.isWebGLCubeRenderTarget===!0;if(n.bindFramebuffer(e.FRAMEBUFFER,t),!(i.depthTexture&&i.depthTexture.isDepthTexture))throw Error(`THREE.WebGLTextures: renderTarget.depthTexture must be an instance of THREE.DepthTexture.`);let l=r.get(i.depthTexture);if(l.__renderTarget=i,(!l.__webglTexture||i.depthTexture.image.width!==i.width||i.depthTexture.image.height!==i.height)&&(i.depthTexture.image.width=i.width,i.depthTexture.image.height=i.height,i.depthTexture.needsUpdate=!0),s){if(l.__webglInit===void 0&&(l.__webglInit=!0,i.depthTexture.addEventListener(`dispose`,E)),l.__webglTexture===void 0){l.__webglTexture=e.createTexture(),n.bindTexture(e.TEXTURE_CUBE_MAP,l.__webglTexture),fe(e.TEXTURE_CUBE_MAP,i.depthTexture);let t=a.convert(i.depthTexture.format),r=a.convert(i.depthTexture.type),o;i.depthTexture.format===1026?o=e.DEPTH_COMPONENT24:i.depthTexture.format===1027&&(o=e.DEPTH24_STENCIL8);for(let n=0;n<6;n++)e.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+n,0,o,i.width,i.height,0,t,r,null)}}else oe(i.depthTexture,0);let u=l.__webglTexture,d=ke(i),f=s?e.TEXTURE_CUBE_MAP_POSITIVE_X+o:e.TEXTURE_2D,p=i.depthTexture.format===1027?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT;if(i.depthTexture.format===1026)Ae(i)?c.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,p,f,u,0,d):e.framebufferTexture2D(e.FRAMEBUFFER,p,f,u,0);else if(i.depthTexture.format===1027)Ae(i)?c.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,p,f,u,0,d):e.framebufferTexture2D(e.FRAMEBUFFER,p,f,u,0);else throw Error(`THREE.WebGLTextures: Unknown depthTexture format.`)}function xe(t){let i=r.get(t),a=t.isWebGLCubeRenderTarget===!0;if(i.__boundDepthTexture!==t.depthTexture){let e=t.depthTexture;if(i.__depthDisposeCallback&&i.__depthDisposeCallback(),e){let t=()=>{delete i.__boundDepthTexture,delete i.__depthDisposeCallback,e.removeEventListener(`dispose`,t)};e.addEventListener(`dispose`,t),i.__depthDisposeCallback=t}i.__boundDepthTexture=e}if(t.depthTexture&&!i.__autoAllocateDepthBuffer){if(a)for(let e=0;e<6;e++)be(i.__webglFramebuffer[e],t,e);else{let e=t.texture.mipmaps;e&&e.length>0?be(i.__webglFramebuffer[0],t,0):be(i.__webglFramebuffer,t,0)}}else if(a){i.__webglDepthbuffer=[];for(let r=0;r<6;r++)if(n.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer[r]),i.__webglDepthbuffer[r]===void 0)i.__webglDepthbuffer[r]=e.createRenderbuffer(),ye(i.__webglDepthbuffer[r],t,!1);else{let n=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,a=i.__webglDepthbuffer[r];e.bindRenderbuffer(e.RENDERBUFFER,a),e.framebufferRenderbuffer(e.FRAMEBUFFER,n,e.RENDERBUFFER,a)}}else{let r=t.texture.mipmaps;if(r&&r.length>0?n.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer[0]):n.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer),i.__webglDepthbuffer===void 0)i.__webglDepthbuffer=e.createRenderbuffer(),ye(i.__webglDepthbuffer,t,!1);else{let n=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,r=i.__webglDepthbuffer;e.bindRenderbuffer(e.RENDERBUFFER,r),e.framebufferRenderbuffer(e.FRAMEBUFFER,n,e.RENDERBUFFER,r)}}n.bindFramebuffer(e.FRAMEBUFFER,null)}function Se(t,n,i){let a=r.get(t);n!==void 0&&ve(a.__webglFramebuffer,t,t.texture,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,0),i!==void 0&&xe(t)}function Ce(t){let i=t.texture,s=r.get(t),c=r.get(i);t.addEventListener(`dispose`,D);let l=t.textures,u=t.isWebGLCubeRenderTarget===!0,d=l.length>1;if(d||(c.__webglTexture===void 0&&(c.__webglTexture=e.createTexture()),c.__version=i.version,o.memory.textures++),u){s.__webglFramebuffer=[];for(let t=0;t<6;t++)if(i.mipmaps&&i.mipmaps.length>0){s.__webglFramebuffer[t]=[];for(let n=0;n<i.mipmaps.length;n++)s.__webglFramebuffer[t][n]=e.createFramebuffer()}else s.__webglFramebuffer[t]=e.createFramebuffer()}else{if(i.mipmaps&&i.mipmaps.length>0){s.__webglFramebuffer=[];for(let t=0;t<i.mipmaps.length;t++)s.__webglFramebuffer[t]=e.createFramebuffer()}else s.__webglFramebuffer=e.createFramebuffer();if(d)for(let t=0,n=l.length;t<n;t++){let n=r.get(l[t]);n.__webglTexture===void 0&&(n.__webglTexture=e.createTexture(),o.memory.textures++)}if(t.samples>0&&Ae(t)===!1){s.__webglMultisampledFramebuffer=e.createFramebuffer(),s.__webglColorRenderbuffer=[],n.bindFramebuffer(e.FRAMEBUFFER,s.__webglMultisampledFramebuffer);for(let n=0;n<l.length;n++){let r=l[n];s.__webglColorRenderbuffer[n]=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,s.__webglColorRenderbuffer[n]);let i=a.convert(r.format,r.colorSpace),o=a.convert(r.type),c=C(r.internalFormat,i,o,r.normalized,r.colorSpace,t.isXRRenderTarget===!0),u=ke(t);e.renderbufferStorageMultisample(e.RENDERBUFFER,u,c,t.width,t.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+n,e.RENDERBUFFER,s.__webglColorRenderbuffer[n])}e.bindRenderbuffer(e.RENDERBUFFER,null),t.depthBuffer&&(s.__webglDepthRenderbuffer=e.createRenderbuffer(),ye(s.__webglDepthRenderbuffer,t,!0)),n.bindFramebuffer(e.FRAMEBUFFER,null)}}if(u){n.bindTexture(e.TEXTURE_CUBE_MAP,c.__webglTexture),fe(e.TEXTURE_CUBE_MAP,i);for(let n=0;n<6;n++)if(i.mipmaps&&i.mipmaps.length>0)for(let r=0;r<i.mipmaps.length;r++)ve(s.__webglFramebuffer[n][r],t,i,e.COLOR_ATTACHMENT0,e.TEXTURE_CUBE_MAP_POSITIVE_X+n,r);else ve(s.__webglFramebuffer[n],t,i,e.COLOR_ATTACHMENT0,e.TEXTURE_CUBE_MAP_POSITIVE_X+n,0);b(i)&&x(e.TEXTURE_CUBE_MAP),n.unbindTexture()}else if(d){for(let i=0,a=l.length;i<a;i++){let a=l[i],o=r.get(a),c=e.TEXTURE_2D;(t.isWebGL3DRenderTarget||t.isWebGLArrayRenderTarget)&&(c=t.isWebGL3DRenderTarget?e.TEXTURE_3D:e.TEXTURE_2D_ARRAY),n.bindTexture(c,o.__webglTexture),fe(c,a),ve(s.__webglFramebuffer,t,a,e.COLOR_ATTACHMENT0+i,c,0),b(a)&&x(c)}n.unbindTexture()}else{let r=e.TEXTURE_2D;if((t.isWebGL3DRenderTarget||t.isWebGLArrayRenderTarget)&&(r=t.isWebGL3DRenderTarget?e.TEXTURE_3D:e.TEXTURE_2D_ARRAY),n.bindTexture(r,c.__webglTexture),fe(r,i),i.mipmaps&&i.mipmaps.length>0)for(let n=0;n<i.mipmaps.length;n++)ve(s.__webglFramebuffer[n],t,i,e.COLOR_ATTACHMENT0,r,n);else ve(s.__webglFramebuffer,t,i,e.COLOR_ATTACHMENT0,r,0);b(i)&&x(r),n.unbindTexture()}t.depthBuffer&&xe(t)}function we(e){let t=e.textures;for(let i=0,a=t.length;i<a;i++){let a=t[i];if(b(a)){let t=S(e),i=r.get(a).__webglTexture;n.bindTexture(t,i),x(t),n.unbindTexture()}}}let Te=[],Ee=[];function Oe(t){if(t.samples>0){if(Ae(t)===!1){let i=t.textures,a=t.width,o=t.height,s=e.COLOR_BUFFER_BIT,c=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,u=r.get(t),d=i.length>1;if(d)for(let t=0;t<i.length;t++)n.bindFramebuffer(e.FRAMEBUFFER,u.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.RENDERBUFFER,null),n.bindFramebuffer(e.FRAMEBUFFER,u.__webglFramebuffer),e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.TEXTURE_2D,null,0);n.bindFramebuffer(e.READ_FRAMEBUFFER,u.__webglMultisampledFramebuffer);let f=t.texture.mipmaps;f&&f.length>0?n.bindFramebuffer(e.DRAW_FRAMEBUFFER,u.__webglFramebuffer[0]):n.bindFramebuffer(e.DRAW_FRAMEBUFFER,u.__webglFramebuffer);for(let n=0;n<i.length;n++){if(t.resolveDepthBuffer&&(t.depthBuffer&&(s|=e.DEPTH_BUFFER_BIT),t.stencilBuffer&&t.resolveStencilBuffer&&(s|=e.STENCIL_BUFFER_BIT)),d){e.framebufferRenderbuffer(e.READ_FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.RENDERBUFFER,u.__webglColorRenderbuffer[n]);let t=r.get(i[n]).__webglTexture;e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0)}e.blitFramebuffer(0,0,a,o,0,0,a,o,s,e.NEAREST),l===!0&&(Te.length=0,Ee.length=0,Te.push(e.COLOR_ATTACHMENT0+n),t.depthBuffer&&t.resolveDepthBuffer===!1&&(Te.push(c),Ee.push(c),e.invalidateFramebuffer(e.DRAW_FRAMEBUFFER,Ee)),e.invalidateFramebuffer(e.READ_FRAMEBUFFER,Te))}if(n.bindFramebuffer(e.READ_FRAMEBUFFER,null),n.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),d)for(let t=0;t<i.length;t++){n.bindFramebuffer(e.FRAMEBUFFER,u.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.RENDERBUFFER,u.__webglColorRenderbuffer[t]);let a=r.get(i[t]).__webglTexture;n.bindFramebuffer(e.FRAMEBUFFER,u.__webglFramebuffer),e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.TEXTURE_2D,a,0)}n.bindFramebuffer(e.DRAW_FRAMEBUFFER,u.__webglMultisampledFramebuffer)}else if(t.depthBuffer&&t.resolveDepthBuffer===!1&&l){let n=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT;e.invalidateFramebuffer(e.DRAW_FRAMEBUFFER,[n])}}}function ke(e){return Math.min(i.maxSamples,e.samples)}function Ae(e){let n=r.get(e);return e.samples>0&&t.has(`WEBGL_multisampled_render_to_texture`)===!0&&n.__useRenderToTexture!==!1}function M(e){let t=o.render.frame;p.get(e)!==t&&(p.set(e,t),e.update())}function Le(e,t){let n=e.colorSpace,r=e.format,i=e.type;return e.isCompressedTexture===!0||e.isVideoTexture===!0||n!==`srgb-linear`&&n!==``&&(bn.getTransfer(n)===`srgb`?(r!==1023||i!==1009)&&d(`WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType.`):f(`WebGLTextures: Unsupported texture color space:`,n)),t}function Re(e){return typeof HTMLImageElement<`u`&&e instanceof HTMLImageElement?(u.width=e.naturalWidth||e.width,u.height=e.naturalHeight||e.height):typeof VideoFrame<`u`&&e instanceof VideoFrame?(u.width=e.displayWidth,u.height=e.displayHeight):(u.width=e.width,u.height=e.height),u}this.allocateTextureUnit=ae,this.resetTextureUnits=ne,this.getTextureUnits=re,this.setTextureUnits=ie,this.setTexture2D=oe,this.setTexture2DArray=j,this.setTexture3D=se,this.setTextureCube=ce,this.rebindTextures=Se,this.setupRenderTarget=Ce,this.updateRenderTargetMipmap=we,this.updateMultisampleRenderTarget=Oe,this.setupDepthRenderbuffer=xe,this.setupFrameBufferTexture=ve,this.useMultisampledRTT=Ae,this.isReversedDepthBuffer=function(){return n.buffers.depth.getReversed()}}function sl(e,t){function n(n,r=``){let i,a=bn.getTransfer(r);if(n===1009)return e.UNSIGNED_BYTE;if(n===1017)return e.UNSIGNED_SHORT_4_4_4_4;if(n===1018)return e.UNSIGNED_SHORT_5_5_5_1;if(n===35902)return e.UNSIGNED_INT_5_9_9_9_REV;if(n===35899)return e.UNSIGNED_INT_10F_11F_11F_REV;if(n===1010)return e.BYTE;if(n===1011)return e.SHORT;if(n===1012)return e.UNSIGNED_SHORT;if(n===1013)return e.INT;if(n===1014)return e.UNSIGNED_INT;if(n===1015)return e.FLOAT;if(n===1016)return e.HALF_FLOAT;if(n===1021)return e.ALPHA;if(n===1022)return e.RGB;if(n===1023)return e.RGBA;if(n===1026)return e.DEPTH_COMPONENT;if(n===1027)return e.DEPTH_STENCIL;if(n===1028)return e.RED;if(n===1029)return e.RED_INTEGER;if(n===1030)return e.RG;if(n===1031)return e.RG_INTEGER;if(n===1033)return e.RGBA_INTEGER;if(n===33776||n===33777||n===33778||n===33779){if(a===`srgb`){if(i=t.get(`WEBGL_compressed_texture_s3tc_srgb`),i!==null){if(n===33776)return i.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===33777)return i.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===33778)return i.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===33779)return i.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null}else if(i=t.get(`WEBGL_compressed_texture_s3tc`),i!==null){if(n===33776)return i.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===33777)return i.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===33778)return i.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===33779)return i.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null}if(n===35840||n===35841||n===35842||n===35843){if(i=t.get(`WEBGL_compressed_texture_pvrtc`),i!==null){if(n===35840)return i.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===35841)return i.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===35842)return i.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===35843)return i.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null}if(n===36196||n===37492||n===37496||n===37488||n===37489||n===37490||n===37491){if(i=t.get(`WEBGL_compressed_texture_etc`),i!==null){if(n===36196||n===37492)return a===`srgb`?i.COMPRESSED_SRGB8_ETC2:i.COMPRESSED_RGB8_ETC2;if(n===37496)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:i.COMPRESSED_RGBA8_ETC2_EAC;if(n===37488)return i.COMPRESSED_R11_EAC;if(n===37489)return i.COMPRESSED_SIGNED_R11_EAC;if(n===37490)return i.COMPRESSED_RG11_EAC;if(n===37491)return i.COMPRESSED_SIGNED_RG11_EAC}else return null}if(n===37808||n===37809||n===37810||n===37811||n===37812||n===37813||n===37814||n===37815||n===37816||n===37817||n===37818||n===37819||n===37820||n===37821){if(i=t.get(`WEBGL_compressed_texture_astc`),i!==null){if(n===37808)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:i.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===37809)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:i.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===37810)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:i.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===37811)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:i.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===37812)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:i.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===37813)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:i.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===37814)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:i.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===37815)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:i.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===37816)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:i.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===37817)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:i.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===37818)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:i.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===37819)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:i.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===37820)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:i.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===37821)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:i.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null}if(n===36492||n===36494||n===36495){if(i=t.get(`EXT_texture_compression_bptc`),i!==null){if(n===36492)return a===`srgb`?i.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:i.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===36494)return i.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===36495)return i.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null}if(n===36283||n===36284||n===36285||n===36286){if(i=t.get(`EXT_texture_compression_rgtc`),i!==null){if(n===36283)return i.COMPRESSED_RED_RGTC1_EXT;if(n===36284)return i.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===36285)return i.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===36286)return i.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null}return n===1020?e.UNSIGNED_INT_24_8:e[n]===void 0?null:e[n]}return{convert:n}}function cl(e,t){function n(e,t){e.matrixAutoUpdate===!0&&e.updateMatrix(),t.value.copy(e.matrix)}function r(t,n){n.color.getRGB(t.fogColor.value,ye(e)),n.isFog?(t.fogNear.value=n.near,t.fogFar.value=n.far):n.isFogExp2&&(t.fogDensity.value=n.density)}function i(e,t,n,r,i){t.isNodeMaterial?t.uniformsNeedUpdate=!1:t.isMeshBasicMaterial?a(e,t):t.isMeshLambertMaterial?(a(e,t),t.envMap&&(e.envMapIntensity.value=t.envMapIntensity)):t.isMeshToonMaterial?(a(e,t),d(e,t)):t.isMeshPhongMaterial?(a(e,t),u(e,t),t.envMap&&(e.envMapIntensity.value=t.envMapIntensity)):t.isMeshStandardMaterial?(a(e,t),f(e,t),t.isMeshPhysicalMaterial&&p(e,t,i)):t.isMeshMatcapMaterial?(a(e,t),m(e,t)):t.isMeshDepthMaterial?a(e,t):t.isMeshDistanceMaterial?(a(e,t),h(e,t)):t.isMeshNormalMaterial?a(e,t):t.isLineBasicMaterial?(o(e,t),t.isLineDashedMaterial&&s(e,t)):t.isPointsMaterial?c(e,t,n,r):t.isSpriteMaterial?l(e,t):t.isShadowMaterial?(e.color.value.copy(t.color),e.opacity.value=t.opacity):t.isShaderMaterial&&(t.uniformsNeedUpdate=!1)}function a(e,r){e.opacity.value=r.opacity,r.color&&e.diffuse.value.copy(r.color),r.emissive&&e.emissive.value.copy(r.emissive).multiplyScalar(r.emissiveIntensity),r.map&&(e.map.value=r.map,n(r.map,e.mapTransform)),r.alphaMap&&(e.alphaMap.value=r.alphaMap,n(r.alphaMap,e.alphaMapTransform)),r.bumpMap&&(e.bumpMap.value=r.bumpMap,n(r.bumpMap,e.bumpMapTransform),e.bumpScale.value=r.bumpScale,r.side===1&&(e.bumpScale.value*=-1)),r.normalMap&&(e.normalMap.value=r.normalMap,n(r.normalMap,e.normalMapTransform),e.normalScale.value.copy(r.normalScale),r.side===1&&e.normalScale.value.negate()),r.displacementMap&&(e.displacementMap.value=r.displacementMap,n(r.displacementMap,e.displacementMapTransform),e.displacementScale.value=r.displacementScale,e.displacementBias.value=r.displacementBias),r.emissiveMap&&(e.emissiveMap.value=r.emissiveMap,n(r.emissiveMap,e.emissiveMapTransform)),r.specularMap&&(e.specularMap.value=r.specularMap,n(r.specularMap,e.specularMapTransform)),r.alphaTest>0&&(e.alphaTest.value=r.alphaTest);let i=t.get(r),a=i.envMap,o=i.envMapRotation;a&&(e.envMap.value=a,e.envMapRotation.value.setFromMatrix4(_u.makeRotationFromEuler(o)).transpose(),a.isCubeTexture&&a.isRenderTargetTexture===!1&&e.envMapRotation.value.premultiply(vu),e.reflectivity.value=r.reflectivity,e.ior.value=r.ior,e.refractionRatio.value=r.refractionRatio),r.lightMap&&(e.lightMap.value=r.lightMap,e.lightMapIntensity.value=r.lightMapIntensity,n(r.lightMap,e.lightMapTransform)),r.aoMap&&(e.aoMap.value=r.aoMap,e.aoMapIntensity.value=r.aoMapIntensity,n(r.aoMap,e.aoMapTransform))}function o(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,t.map&&(e.map.value=t.map,n(t.map,e.mapTransform))}function s(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}function c(e,t,r,i){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.size.value=t.size*r,e.scale.value=i*.5,t.map&&(e.map.value=t.map,n(t.map,e.uvTransform)),t.alphaMap&&(e.alphaMap.value=t.alphaMap,n(t.alphaMap,e.alphaMapTransform)),t.alphaTest>0&&(e.alphaTest.value=t.alphaTest)}function l(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.rotation.value=t.rotation,t.map&&(e.map.value=t.map,n(t.map,e.mapTransform)),t.alphaMap&&(e.alphaMap.value=t.alphaMap,n(t.alphaMap,e.alphaMapTransform)),t.alphaTest>0&&(e.alphaTest.value=t.alphaTest)}function u(e,t){e.specular.value.copy(t.specular),e.shininess.value=Math.max(t.shininess,1e-4)}function d(e,t){t.gradientMap&&(e.gradientMap.value=t.gradientMap)}function f(e,t){e.metalness.value=t.metalness,t.metalnessMap&&(e.metalnessMap.value=t.metalnessMap,n(t.metalnessMap,e.metalnessMapTransform)),e.roughness.value=t.roughness,t.roughnessMap&&(e.roughnessMap.value=t.roughnessMap,n(t.roughnessMap,e.roughnessMapTransform)),t.envMap&&(e.envMapIntensity.value=t.envMapIntensity)}function p(e,t,r){e.ior.value=t.ior,t.sheen>0&&(e.sheenColor.value.copy(t.sheenColor).multiplyScalar(t.sheen),e.sheenRoughness.value=t.sheenRoughness,t.sheenColorMap&&(e.sheenColorMap.value=t.sheenColorMap,n(t.sheenColorMap,e.sheenColorMapTransform)),t.sheenRoughnessMap&&(e.sheenRoughnessMap.value=t.sheenRoughnessMap,n(t.sheenRoughnessMap,e.sheenRoughnessMapTransform))),t.clearcoat>0&&(e.clearcoat.value=t.clearcoat,e.clearcoatRoughness.value=t.clearcoatRoughness,t.clearcoatMap&&(e.clearcoatMap.value=t.clearcoatMap,n(t.clearcoatMap,e.clearcoatMapTransform)),t.clearcoatRoughnessMap&&(e.clearcoatRoughnessMap.value=t.clearcoatRoughnessMap,n(t.clearcoatRoughnessMap,e.clearcoatRoughnessMapTransform)),t.clearcoatNormalMap&&(e.clearcoatNormalMap.value=t.clearcoatNormalMap,n(t.clearcoatNormalMap,e.clearcoatNormalMapTransform),e.clearcoatNormalScale.value.copy(t.clearcoatNormalScale),t.side===1&&e.clearcoatNormalScale.value.negate())),t.dispersion>0&&(e.dispersion.value=t.dispersion),t.iridescence>0&&(e.iridescence.value=t.iridescence,e.iridescenceIOR.value=t.iridescenceIOR,e.iridescenceThicknessMinimum.value=t.iridescenceThicknessRange[0],e.iridescenceThicknessMaximum.value=t.iridescenceThicknessRange[1],t.iridescenceMap&&(e.iridescenceMap.value=t.iridescenceMap,n(t.iridescenceMap,e.iridescenceMapTransform)),t.iridescenceThicknessMap&&(e.iridescenceThicknessMap.value=t.iridescenceThicknessMap,n(t.iridescenceThicknessMap,e.iridescenceThicknessMapTransform))),t.transmission>0&&(e.transmission.value=t.transmission,e.transmissionSamplerMap.value=r.texture,e.transmissionSamplerSize.value.set(r.width,r.height),t.transmissionMap&&(e.transmissionMap.value=t.transmissionMap,n(t.transmissionMap,e.transmissionMapTransform)),e.thickness.value=t.thickness,t.thicknessMap&&(e.thicknessMap.value=t.thicknessMap,n(t.thicknessMap,e.thicknessMapTransform)),e.attenuationDistance.value=t.attenuationDistance,e.attenuationColor.value.copy(t.attenuationColor)),t.anisotropy>0&&(e.anisotropyVector.value.set(t.anisotropy*Math.cos(t.anisotropyRotation),t.anisotropy*Math.sin(t.anisotropyRotation)),t.anisotropyMap&&(e.anisotropyMap.value=t.anisotropyMap,n(t.anisotropyMap,e.anisotropyMapTransform))),e.specularIntensity.value=t.specularIntensity,e.specularColor.value.copy(t.specularColor),t.specularColorMap&&(e.specularColorMap.value=t.specularColorMap,n(t.specularColorMap,e.specularColorMapTransform)),t.specularIntensityMap&&(e.specularIntensityMap.value=t.specularIntensityMap,n(t.specularIntensityMap,e.specularIntensityMapTransform))}function m(e,t){t.matcap&&(e.matcap.value=t.matcap)}function h(e,n){let r=t.get(n).light;e.referencePosition.value.setFromMatrixPosition(r.matrixWorld),e.nearDistance.value=r.shadow.camera.near,e.farDistance.value=r.shadow.camera.far}return{refreshFogUniforms:r,refreshMaterialUniforms:i}}function ll(e,t,n,r){let i={},a={},o=[],s=e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS);function c(e,t){let n=t.program;r.uniformBlockBinding(e,n)}function l(e,n){let o=i[e.id];o===void 0&&(v(e),o=u(e),i[e.id]=o,e.addEventListener(`dispose`,b));let s=n.program;r.updateUBOMapping(e,s);let c=t.render.frame;a[e.id]!==c&&(m(e),a[e.id]=c)}function u(t){let n=p();t.__bindingPointIndex=n;let r=e.createBuffer(),i=t.__size,a=t.usage;return e.bindBuffer(e.UNIFORM_BUFFER,r),e.bufferData(e.UNIFORM_BUFFER,i,a),e.bindBuffer(e.UNIFORM_BUFFER,null),e.bindBufferBase(e.UNIFORM_BUFFER,n,r),r}function p(){for(let e=0;e<s;e++)if(o.indexOf(e)===-1)return o.push(e),e;return f(`WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached.`),0}function m(t){let n=i[t.id],r=t.uniforms,a=t.__cache;e.bindBuffer(e.UNIFORM_BUFFER,n);for(let e=0,t=r.length;e<t;e++){let t=r[e];if(Array.isArray(t))for(let n=0,r=t.length;n<r;n++)h(t[n],e,n,a);else h(t,e,0,a)}e.bindBuffer(e.UNIFORM_BUFFER,null)}function h(t,n,r,i){if(_(t,n,r,i)===!0){let n=t.__offset,r=t.value;if(Array.isArray(r)){let e=0;for(let n=0;n<r.length;n++){let i=r[n],a=y(i);g(i,t.__data,e),typeof i!=`number`&&typeof i!=`boolean`&&!i.isMatrix3&&!ArrayBuffer.isView(i)&&(e+=a.storage/Float32Array.BYTES_PER_ELEMENT)}}else g(r,t.__data,0);e.bufferSubData(e.UNIFORM_BUFFER,n,t.__data)}}function g(e,t,n){typeof e==`number`||typeof e==`boolean`?t[0]=e:e.isMatrix3?(t[0]=e.elements[0],t[1]=e.elements[1],t[2]=e.elements[2],t[3]=0,t[4]=e.elements[3],t[5]=e.elements[4],t[6]=e.elements[5],t[7]=0,t[8]=e.elements[6],t[9]=e.elements[7],t[10]=e.elements[8],t[11]=0):ArrayBuffer.isView(e)?t.set(new e.constructor(e.buffer,e.byteOffset,t.length)):e.toArray(t,n)}function _(e,t,n,r){let i=e.value,a=t+`_`+n;if(r[a]===void 0)return r[a]=typeof i==`number`||typeof i==`boolean`?i:ArrayBuffer.isView(i)?i.slice():i.clone(),!0;{let e=r[a];if(typeof i==`number`||typeof i==`boolean`){if(e!==i)return r[a]=i,!0}else if(ArrayBuffer.isView(i))return!0;else if(e.equals(i)===!1)return e.copy(i),!0}return!1}function v(e){let t=e.uniforms,n=0;for(let e=0,r=t.length;e<r;e++){let r=Array.isArray(t[e])?t[e]:[t[e]];for(let e=0,t=r.length;e<t;e++){let t=r[e],i=Array.isArray(t.value)?t.value:[t.value];for(let e=0,r=i.length;e<r;e++){let r=i[e],a=y(r),o=n%16,s=o%a.boundary,c=o+s;n+=s,c!==0&&16-c<a.storage&&(n+=16-c),t.__data=new Float32Array(a.storage/Float32Array.BYTES_PER_ELEMENT),t.__offset=n,n+=a.storage}}}let r=n%16;return r>0&&(n+=16-r),e.__size=n,e.__cache={},this}function y(e){let t={boundary:0,storage:0};return typeof e==`number`||typeof e==`boolean`?(t.boundary=4,t.storage=4):e.isVector2?(t.boundary=8,t.storage=8):e.isVector3||e.isColor?(t.boundary=16,t.storage=12):e.isVector4?(t.boundary=16,t.storage=16):e.isMatrix3?(t.boundary=48,t.storage=48):e.isMatrix4?(t.boundary=64,t.storage=64):e.isTexture?d(`WebGLRenderer: Texture samplers can not be part of an uniforms group.`):ArrayBuffer.isView(e)?(t.boundary=16,t.storage=e.byteLength):d(`WebGLRenderer: Unsupported uniform value type.`,e),t}function b(t){let n=t.target;n.removeEventListener(`dispose`,b);let r=o.indexOf(n.__bindingPointIndex);o.splice(r,1),e.deleteBuffer(i[n.id]),delete i[n.id],delete a[n.id]}function x(){for(let t in i)e.deleteBuffer(i[t]);o=[],i={},a={}}return{bind:c,update:l,dispose:x}}function ul(){return bu===null&&(bu=new Gi(yu,16,16,rt,We),bu.name=`DFG_LUT`,bu.minFilter=F,bu.magFilter=F,bu.wrapS=Me,bu.wrapT=Me,bu.generateMipmaps=!1,bu.needsUpdate=!0),bu}var B,V,dl,fl,pl,ml,hl,gl,_l,vl,yl,bl,xl,Sl,Cl,wl,Tl,El,Dl,Ol,kl,Al,jl,Ml,Nl,Pl,Fl,Il,Ll,Rl,zl,Bl,Vl,Hl,Ul,Wl,Gl,Kl,ql,Jl,Yl,Xl,Zl,Ql,$l,eu,tu,nu,ru,iu,au,ou,su,cu,lu,uu,du,fu,pu,mu,hu,gu,_u,vu,yu,bu,xu,Su=t((()=>{as(),B={alphahash_fragment:`#ifdef USE_ALPHAHASH\n\tif ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;\n#endif`,alphahash_pars_fragment:`#ifdef USE_ALPHAHASH\n\tconst float ALPHA_HASH_SCALE = 0.05;\n\tfloat hash2D( vec2 value ) {\n\t\treturn fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );\n\t}\n\tfloat hash3D( vec3 value ) {\n\t\treturn hash2D( vec2( hash2D( value.xy ), value.z ) );\n\t}\n\tfloat getAlphaHashThreshold( vec3 position ) {\n\t\tfloat maxDeriv = max(\n\t\t\tlength( dFdx( position.xyz ) ),\n\t\t\tlength( dFdy( position.xyz ) )\n\t\t);\n\t\tfloat pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );\n\t\tvec2 pixScales = vec2(\n\t\t\texp2( floor( log2( pixScale ) ) ),\n\t\t\texp2( ceil( log2( pixScale ) ) )\n\t\t);\n\t\tvec2 alpha = vec2(\n\t\t\thash3D( floor( pixScales.x * position.xyz ) ),\n\t\t\thash3D( floor( pixScales.y * position.xyz ) )\n\t\t);\n\t\tfloat lerpFactor = fract( log2( pixScale ) );\n\t\tfloat x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;\n\t\tfloat a = min( lerpFactor, 1.0 - lerpFactor );\n\t\tvec3 cases = vec3(\n\t\t\tx * x / ( 2.0 * a * ( 1.0 - a ) ),\n\t\t\t( x - 0.5 * a ) / ( 1.0 - a ),\n\t\t\t1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )\n\t\t);\n\t\tfloat threshold = ( x < ( 1.0 - a ) )\n\t\t\t? ( ( x < a ) ? cases.x : cases.y )\n\t\t\t: cases.z;\n\t\treturn clamp( threshold , 1.0e-6, 1.0 );\n\t}\n#endif`,alphamap_fragment:`#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;\n#endif`,alphamap_pars_fragment:`#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif`,alphatest_fragment:`#ifdef USE_ALPHATEST\n\t#ifdef ALPHA_TO_COVERAGE\n\tdiffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );\n\tif ( diffuseColor.a == 0.0 ) discard;\n\t#else\n\tif ( diffuseColor.a < alphaTest ) discard;\n\t#endif\n#endif`,alphatest_pars_fragment:`#ifdef USE_ALPHATEST\n\tuniform float alphaTest;\n#endif`,aomap_fragment:`#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_CLEARCOAT ) \n\t\tclearcoatSpecularIndirect *= ambientOcclusion;\n\t#endif\n\t#if defined( USE_SHEEN ) \n\t\tsheenSpecularIndirect *= ambientOcclusion;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometryNormal, geometryViewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n\t#endif\n#endif`,aomap_pars_fragment:`#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif`,batching_pars_vertex:`#ifdef USE_BATCHING\n\t#if ! defined( GL_ANGLE_multi_draw )\n\t#define gl_DrawID _gl_DrawID\n\tuniform int _gl_DrawID;\n\t#endif\n\tuniform highp sampler2D batchingTexture;\n\tuniform highp usampler2D batchingIdTexture;\n\tmat4 getBatchingMatrix( const in float i ) {\n\t\tint size = textureSize( batchingTexture, 0 ).x;\n\t\tint j = int( i ) * 4;\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\tvec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 );\n\t\tvec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 );\n\t\tvec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 );\n\t\tvec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 );\n\t\treturn mat4( v1, v2, v3, v4 );\n\t}\n\tfloat getIndirectIndex( const in int i ) {\n\t\tint size = textureSize( batchingIdTexture, 0 ).x;\n\t\tint x = i % size;\n\t\tint y = i / size;\n\t\treturn float( texelFetch( batchingIdTexture, ivec2( x, y ), 0 ).r );\n\t}\n#endif\n#ifdef USE_BATCHING_COLOR\n\tuniform sampler2D batchingColorTexture;\n\tvec4 getBatchingColor( const in float i ) {\n\t\tint size = textureSize( batchingColorTexture, 0 ).x;\n\t\tint j = int( i );\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\treturn texelFetch( batchingColorTexture, ivec2( x, y ), 0 );\n\t}\n#endif`,batching_vertex:`#ifdef USE_BATCHING\n\tmat4 batchingMatrix = getBatchingMatrix( getIndirectIndex( gl_DrawID ) );\n#endif`,begin_vertex:`vec3 transformed = vec3( position );\n#ifdef USE_ALPHAHASH\n\tvPosition = vec3( position );\n#endif`,beginnormal_vertex:`vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif`,bsdfs:`float G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, 1.0, dotVH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n} // validated`,iridescence_fragment:`#ifdef USE_IRIDESCENCE\n\tconst mat3 XYZ_TO_REC709 = mat3(\n\t\t 3.2404542, -0.9692660, 0.0556434,\n\t\t-1.5371385, 1.8760108, -0.2040259,\n\t\t-0.4985314, 0.0415560, 1.0572252\n\t);\n\tvec3 Fresnel0ToIor( vec3 fresnel0 ) {\n\t\tvec3 sqrtF0 = sqrt( fresnel0 );\n\t\treturn ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );\n\t}\n\tvec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );\n\t}\n\tfloat IorToFresnel0( float transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));\n\t}\n\tvec3 evalSensitivity( float OPD, vec3 shift ) {\n\t\tfloat phase = 2.0 * PI * OPD * 1.0e-9;\n\t\tvec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );\n\t\tvec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );\n\t\tvec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );\n\t\tvec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );\n\t\txyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );\n\t\txyz /= 1.0685e-7;\n\t\tvec3 rgb = XYZ_TO_REC709 * xyz;\n\t\treturn rgb;\n\t}\n\tvec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {\n\t\tvec3 I;\n\t\tfloat iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );\n\t\tfloat sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );\n\t\tfloat cosTheta2Sq = 1.0 - sinTheta2Sq;\n\t\tif ( cosTheta2Sq < 0.0 ) {\n\t\t\treturn vec3( 1.0 );\n\t\t}\n\t\tfloat cosTheta2 = sqrt( cosTheta2Sq );\n\t\tfloat R0 = IorToFresnel0( iridescenceIOR, outsideIOR );\n\t\tfloat R12 = F_Schlick( R0, 1.0, cosTheta1 );\n\t\tfloat T121 = 1.0 - R12;\n\t\tfloat phi12 = 0.0;\n\t\tif ( iridescenceIOR < outsideIOR ) phi12 = PI;\n\t\tfloat phi21 = PI - phi12;\n\t\tvec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) );\t\tvec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );\n\t\tvec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );\n\t\tvec3 phi23 = vec3( 0.0 );\n\t\tif ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;\n\t\tif ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;\n\t\tif ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;\n\t\tfloat OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;\n\t\tvec3 phi = vec3( phi21 ) + phi23;\n\t\tvec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );\n\t\tvec3 r123 = sqrt( R123 );\n\t\tvec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );\n\t\tvec3 C0 = R12 + Rs;\n\t\tI = C0;\n\t\tvec3 Cm = Rs - T121;\n\t\tfor ( int m = 1; m <= 2; ++ m ) {\n\t\t\tCm *= r123;\n\t\t\tvec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );\n\t\t\tI += Cm * Sm;\n\t\t}\n\t\treturn max( I, vec3( 0.0 ) );\n\t}\n#endif`,bumpmap_pars_fragment:`#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vBumpMapUv );\n\t\tvec2 dSTdy = dFdy( vBumpMapUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n\t\tvec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) );\n\t\tvec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 ) * faceDirection;\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif`,clipping_planes_fragment:`#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#ifdef ALPHA_TO_COVERAGE\n\t\tfloat distanceToPlane, distanceGradient;\n\t\tfloat clipOpacity = 1.0;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tdistanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n\t\t\tdistanceGradient = fwidth( distanceToPlane ) / 2.0;\n\t\t\tclipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n\t\t\tif ( clipOpacity == 0.0 ) discard;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\t\tfloat unionClipOpacity = 1.0;\n\t\t\t#pragma unroll_loop_start\n\t\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\t\tplane = clippingPlanes[ i ];\n\t\t\t\tdistanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n\t\t\t\tdistanceGradient = fwidth( distanceToPlane ) / 2.0;\n\t\t\t\tunionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n\t\t\t}\n\t\t\t#pragma unroll_loop_end\n\t\t\tclipOpacity *= 1.0 - unionClipOpacity;\n\t\t#endif\n\t\tdiffuseColor.a *= clipOpacity;\n\t\tif ( diffuseColor.a == 0.0 ) discard;\n\t#else\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\t\tbool clipped = true;\n\t\t\t#pragma unroll_loop_start\n\t\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\t\tplane = clippingPlanes[ i ];\n\t\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t\t}\n\t\t\t#pragma unroll_loop_end\n\t\t\tif ( clipped ) discard;\n\t\t#endif\n\t#endif\n#endif`,clipping_planes_pars_fragment:`#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif`,clipping_planes_pars_vertex:`#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif`,clipping_planes_vertex:`#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif`,color_fragment:`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA )\n\tdiffuseColor *= vColor;\n#endif`,color_pars_fragment:`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#endif`,color_pars_vertex:`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )\n\tvarying vec4 vColor;\n#endif`,color_vertex:`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )\n\tvColor = vec4( 1.0 );\n#endif\n#ifdef USE_COLOR_ALPHA\n\tvColor *= color;\n#elif defined( USE_COLOR )\n\tvColor.rgb *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.rgb *= instanceColor.rgb;\n#endif\n#ifdef USE_BATCHING_COLOR\n\tvColor *= getBatchingColor( getIndirectIndex( gl_DrawID ) );\n#endif`,common:`#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nvec3 pow2( const in vec3 x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\n#ifdef USE_ALPHAHASH\n\tvarying vec3 vPosition;\n#endif\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\n#define inverseTransformDirection transformDirectionByInverseViewMatrix\nvec3 transformNormalByInverseViewMatrix( in vec3 normal, in mat4 viewMatrix ) {\n\treturn normalize( ( vec4( normal, 0.0 ) * viewMatrix ).xyz );\n}\nvec3 transformDirectionByInverseViewMatrix( in vec3 dir, in mat4 viewMatrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * viewMatrix ).xyz );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}\nvec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n} // validated`,cube_uv_reflection_fragment:`#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\thighp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tuv.x += filterInt * 3.0 * cubeUV_minTileSize;\n\t\tuv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n\t\tuv.x *= CUBEUV_TEXEL_WIDTH;\n\t\tuv.y *= CUBEUV_TEXEL_HEIGHT;\n\t\t#ifdef texture2DGradEXT\n\t\t\treturn texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n\t\t#else\n\t\t\treturn texture2D( envMap, uv ).rgb;\n\t\t#endif\n\t}\n\t#define cubeUV_r0 1.0\n\t#define cubeUV_m0 - 2.0\n\t#define cubeUV_r1 0.8\n\t#define cubeUV_m1 - 1.0\n\t#define cubeUV_r4 0.4\n\t#define cubeUV_m4 2.0\n\t#define cubeUV_r5 0.305\n\t#define cubeUV_m5 3.0\n\t#define cubeUV_r6 0.21\n\t#define cubeUV_m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= cubeUV_r1 ) {\n\t\t\tmip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n\t\t} else if ( roughness >= cubeUV_r4 ) {\n\t\t\tmip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n\t\t} else if ( roughness >= cubeUV_r5 ) {\n\t\t\tmip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n\t\t} else if ( roughness >= cubeUV_r6 ) {\n\t\t\tmip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif`,defaultnormal_vertex:`vec3 transformedNormal = objectNormal;\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = objectTangent;\n#endif\n#ifdef USE_BATCHING\n\tmat3 bm = mat3( batchingMatrix );\n\ttransformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) );\n\ttransformedNormal = bm * transformedNormal;\n\t#ifdef USE_TANGENT\n\t\ttransformedTangent = bm * transformedTangent;\n\t#endif\n#endif\n#ifdef USE_INSTANCING\n\tmat3 im = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) );\n\ttransformedNormal = im * transformedNormal;\n\t#ifdef USE_TANGENT\n\t\ttransformedTangent = im * transformedTangent;\n\t#endif\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\ttransformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz;\n#endif`,displacementmap_pars_vertex:`#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif`,displacementmap_vertex:`#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );\n#endif`,emissivemap_fragment:`#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );\n\t#ifdef DECODE_VIDEO_TEXTURE_EMISSIVE\n\t\temissiveColor = sRGBTransferEOTF( emissiveColor );\n\t#endif\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif`,emissivemap_pars_fragment:`#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif`,colorspace_fragment:`gl_FragColor = linearToOutputTexel( gl_FragColor );`,colorspace_pars_fragment:`vec4 LinearTransferOETF( in vec4 value ) {\n\treturn value;\n}\nvec4 sRGBTransferEOTF( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\nvec4 sRGBTransferOETF( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}`,envmap_fragment:`#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = transformNormalByInverseViewMatrix( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, envMapRotation * reflectVec );\n\t\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t\t#endif\n\t#endif\n#endif`,envmap_common_pars_fragment:`#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform mat3 envMapRotation;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n#endif`,envmap_pars_fragment:`#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif`,envmap_pars_vertex:`#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif`,envmap_physical_pars_fragment:`#ifdef USE_ENVMAP\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 worldNormal = transformNormalByInverseViewMatrix( normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 );\n\t\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 reflectVec = reflect( - viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, pow4( roughness ) ) );\n\t\t\treflectVec = transformDirectionByInverseViewMatrix( reflectVec, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness );\n\t\t\treturn envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\t#ifdef USE_ANISOTROPY\n\t\tvec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {\n\t\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\t\tvec3 bentNormal = cross( bitangent, viewDir );\n\t\t\t\tbentNormal = normalize( cross( bentNormal, bitangent ) );\n\t\t\t\tbentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );\n\t\t\t\treturn getIBLRadiance( viewDir, bentNormal, roughness );\n\t\t\t#else\n\t\t\t\treturn vec3( 0.0 );\n\t\t\t#endif\n\t\t}\n\t#endif\n#endif`,envmap_vertex:`#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = transformNormalByInverseViewMatrix( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif`,fog_vertex:`#ifdef USE_FOG\n\tvFogDepth = - mvPosition.z;\n#endif`,fog_pars_vertex:`#ifdef USE_FOG\n\tvarying float vFogDepth;\n#endif`,fog_fragment:`#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif`,fog_pars_fragment:`#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float vFogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif`,gradientmap_pars_fragment:`#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn vec3( texture2D( gradientMap, coord ).r );\n\t#else\n\t\tvec2 fw = fwidth( coord ) * 0.5;\n\t\treturn mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );\n\t#endif\n}`,lightmap_pars_fragment:`#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif`,lights_lambert_fragment:`LambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;`,lights_lambert_pars_fragment:`varying vec3 vViewPosition;\nstruct LambertMaterial {\n\tvec3 diffuseColor;\n\tfloat specularStrength;\n};\nvoid RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Lambert\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Lambert`,lights_pars_begin:`uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\n#if defined( USE_LIGHT_PROBES )\n\tuniform vec3 lightProbe[ 9 ];\n#endif\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n\tvec3 worldNormal = transformNormalByInverseViewMatrix( normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\treturn irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\tif ( cutoffDistance > 0.0 ) {\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t}\n\treturn distanceFalloff;\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n\treturn smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) {\n\t\tlight.color = directionalLight.color;\n\t\tlight.direction = directionalLight.direction;\n\t\tlight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometryPosition;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tlight.color = pointLight.color;\n\t\tlight.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometryPosition;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat angleCos = dot( light.direction, spotLight.direction );\n\t\tfloat spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\tif ( spotAttenuation > 0.0 ) {\n\t\t\tfloat lightDistance = length( lVector );\n\t\t\tlight.color = spotLight.color * spotAttenuation;\n\t\t\tlight.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t\t} else {\n\t\t\tlight.color = vec3( 0.0 );\n\t\t\tlight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n\t\tfloat dotNL = dot( normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\treturn irradiance;\n\t}\n#endif\n#include <lightprobes_pars_fragment>`,lights_toon_fragment:`ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;`,lights_toon_pars_fragment:`varying vec3 vViewPosition;\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon`,lights_phong_fragment:`BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;`,lights_phong_pars_fragment:`varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong`,lights_physical_fragment:`PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.diffuseContribution = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nmaterial.metalness = metalnessFactor;\nvec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n\tmaterial.ior = ior;\n\t#ifdef USE_SPECULAR\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularColorFactor = specularColor;\n\t\t#ifdef USE_SPECULAR_COLORMAP\n\t\t\tspecularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;\n\t\t#endif\n\t\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;\n\t\t#endif\n\t\tmaterial.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n\t#else\n\t\tfloat specularIntensityFactor = 1.0;\n\t\tvec3 specularColorFactor = vec3( 1.0 );\n\t\tmaterial.specularF90 = 1.0;\n\t#endif\n\tmaterial.specularColor = min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor;\n\tmaterial.specularColorBlended = mix( material.specularColor, diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = vec3( 0.04 );\n\tmaterial.specularColorBlended = mix( material.specularColor, diffuseColor.rgb, metalnessFactor );\n\tmaterial.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\tmaterial.clearcoatF0 = vec3( 0.04 );\n\tmaterial.clearcoatF90 = 1.0;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_DISPERSION\n\tmaterial.dispersion = dispersion;\n#endif\n#ifdef USE_IRIDESCENCE\n\tmaterial.iridescence = iridescence;\n\tmaterial.iridescenceIOR = iridescenceIOR;\n\t#ifdef USE_IRIDESCENCEMAP\n\t\tmaterial.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;\n\t#endif\n\t#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\t\tmaterial.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;\n\t#else\n\t\tmaterial.iridescenceThickness = iridescenceThicknessMaximum;\n\t#endif\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheenColor;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tmaterial.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;\n\t#endif\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.0001, 1.0 );\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\t#ifdef USE_ANISOTROPYMAP\n\t\tmat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );\n\t\tvec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;\n\t\tvec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;\n\t#else\n\t\tvec2 anisotropyV = anisotropyVector;\n\t#endif\n\tmaterial.anisotropy = length( anisotropyV );\n\tif( material.anisotropy == 0.0 ) {\n\t\tanisotropyV = vec2( 1.0, 0.0 );\n\t} else {\n\t\tanisotropyV /= material.anisotropy;\n\t\tmaterial.anisotropy = saturate( material.anisotropy );\n\t}\n\tmaterial.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );\n\tmaterial.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;\n\tmaterial.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;\n#endif`,lights_physical_pars_fragment:`uniform sampler2D dfgLUT;\nstruct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tvec3 diffuseContribution;\n\tvec3 specularColor;\n\tvec3 specularColorBlended;\n\tfloat roughness;\n\tfloat metalness;\n\tfloat specularF90;\n\tfloat dispersion;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat clearcoat;\n\t\tfloat clearcoatRoughness;\n\t\tvec3 clearcoatF0;\n\t\tfloat clearcoatF90;\n\t#endif\n\t#ifdef USE_IRIDESCENCE\n\t\tfloat iridescence;\n\t\tfloat iridescenceIOR;\n\t\tfloat iridescenceThickness;\n\t\tvec3 iridescenceFresnel;\n\t\tvec3 iridescenceF0;\n\t\tvec3 iridescenceFresnelDielectric;\n\t\tvec3 iridescenceFresnelMetallic;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tvec3 sheenColor;\n\t\tfloat sheenRoughness;\n\t#endif\n\t#ifdef IOR\n\t\tfloat ior;\n\t#endif\n\t#ifdef USE_TRANSMISSION\n\t\tfloat transmission;\n\t\tfloat transmissionAlpha;\n\t\tfloat thickness;\n\t\tfloat attenuationDistance;\n\t\tvec3 attenuationColor;\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat anisotropy;\n\t\tfloat alphaT;\n\t\tvec3 anisotropyT;\n\t\tvec3 anisotropyB;\n\t#endif\n};\nvec3 clearcoatSpecularDirect = vec3( 0.0 );\nvec3 clearcoatSpecularIndirect = vec3( 0.0 );\nvec3 sheenSpecularDirect = vec3( 0.0 );\nvec3 sheenSpecularIndirect = vec3(0.0 );\nvec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {\n float x = clamp( 1.0 - dotVH, 0.0, 1.0 );\n float x2 = x * x;\n float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );\n return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\n#ifdef USE_ANISOTROPY\n\tfloat V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) {\n\t\tfloat gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );\n\t\tfloat gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );\n\t\treturn 0.5 / max( gv + gl, EPSILON );\n\t}\n\tfloat D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {\n\t\tfloat a2 = alphaT * alphaB;\n\t\thighp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );\n\t\thighp float v2 = dot( v, v );\n\t\tfloat w2 = a2 / v2;\n\t\treturn RECIPROCAL_PI * a2 * pow2 ( w2 );\n\t}\n#endif\n#ifdef USE_CLEARCOAT\n\tvec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {\n\t\tvec3 f0 = material.clearcoatF0;\n\t\tfloat f90 = material.clearcoatF90;\n\t\tfloat roughness = material.clearcoatRoughness;\n\t\tfloat alpha = pow2( roughness );\n\t\tvec3 halfDir = normalize( lightDir + viewDir );\n\t\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\t\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\t\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\t\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\t\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t\treturn F * ( V * D );\n\t}\n#endif\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\n\tvec3 f0 = material.specularColorBlended;\n\tfloat f90 = material.specularF90;\n\tfloat roughness = material.roughness;\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t#ifdef USE_IRIDESCENCE\n\t\tF = mix( F, material.iridescenceFresnel, material.iridescence );\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat dotTL = dot( material.anisotropyT, lightDir );\n\t\tfloat dotTV = dot( material.anisotropyT, viewDir );\n\t\tfloat dotTH = dot( material.anisotropyT, halfDir );\n\t\tfloat dotBL = dot( material.anisotropyB, lightDir );\n\t\tfloat dotBV = dot( material.anisotropyB, viewDir );\n\t\tfloat dotBH = dot( material.anisotropyB, halfDir );\n\t\tfloat V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );\n\t\tfloat D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );\n\t#else\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t#endif\n\treturn F * ( V * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transpose( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n\tfloat alpha = pow2( roughness );\n\tfloat invAlpha = 1.0 / alpha;\n\tfloat cos2h = dotNH * dotNH;\n\tfloat sin2h = max( 1.0 - cos2h, 0.0078125 );\n\treturn ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n\treturn saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat D = D_Charlie( sheenRoughness, dotNH );\n\tfloat V = V_Neubelt( dotNV, dotNL );\n\treturn sheenColor * ( D * V );\n}\n#endif\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat r2 = roughness * roughness;\n\tfloat rInv = 1.0 / ( roughness + 0.1 );\n\tfloat a = -1.9362 + 1.0678 * roughness + 0.4573 * r2 - 0.8469 * rInv;\n\tfloat b = -0.6014 + 0.5538 * roughness - 0.4670 * r2 - 0.1255 * rInv;\n\tfloat DG = exp( a * dotNV + b );\n\treturn saturate( DG );\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tvec2 fab = texture2D( dfgLUT, vec2( roughness, dotNV ) ).rg;\n\treturn specularColor * fab.x + specularF90 * fab.y;\n}\n#ifdef USE_IRIDESCENCE\nvoid computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#else\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#endif\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tvec2 fab = texture2D( dfgLUT, vec2( roughness, dotNV ) ).rg;\n\t#ifdef USE_IRIDESCENCE\n\t\tvec3 Fr = mix( specularColor, iridescenceF0, iridescence );\n\t#else\n\t\tvec3 Fr = specularColor;\n\t#endif\n\tvec3 FssEss = Fr * fab.x + specularF90 * fab.y;\n\tfloat Ess = fab.x + fab.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\nvec3 BRDF_GGX_Multiscatter( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\n\tvec3 singleScatter = BRDF_GGX( lightDir, viewDir, normal, material );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tvec2 dfgV = texture2D( dfgLUT, vec2( material.roughness, dotNV ) ).rg;\n\tvec2 dfgL = texture2D( dfgLUT, vec2( material.roughness, dotNL ) ).rg;\n\tvec3 FssEss_V = material.specularColorBlended * dfgV.x + material.specularF90 * dfgV.y;\n\tvec3 FssEss_L = material.specularColorBlended * dfgL.x + material.specularF90 * dfgL.y;\n\tfloat Ess_V = dfgV.x + dfgV.y;\n\tfloat Ess_L = dfgL.x + dfgL.y;\n\tfloat Ems_V = 1.0 - Ess_V;\n\tfloat Ems_L = 1.0 - Ess_L;\n\tvec3 Favg = material.specularColorBlended + ( 1.0 - material.specularColorBlended ) * 0.047619;\n\tvec3 Fms = FssEss_V * FssEss_L * Favg / ( 1.0 - Ems_V * Ems_L * Favg + EPSILON );\n\tfloat compensationFactor = Ems_V * Ems_L;\n\tvec3 multiScatter = Fms * compensationFactor;\n\treturn singleScatter + multiScatter;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometryNormal;\n\t\tvec3 viewDir = geometryViewDir;\n\t\tvec3 position = geometryPosition;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.roughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColorBlended * t2.x + ( material.specularF90 - material.specularColorBlended ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseContribution * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t\t#ifdef USE_CLEARCOAT\n\t\t\tvec3 Ncc = geometryClearcoatNormal;\n\t\t\tvec2 uvClearcoat = LTC_Uv( Ncc, viewDir, material.clearcoatRoughness );\n\t\t\tvec4 t1Clearcoat = texture2D( ltc_1, uvClearcoat );\n\t\t\tvec4 t2Clearcoat = texture2D( ltc_2, uvClearcoat );\n\t\t\tmat3 mInvClearcoat = mat3(\n\t\t\t\tvec3( t1Clearcoat.x, 0, t1Clearcoat.y ),\n\t\t\t\tvec3( 0, 1, 0 ),\n\t\t\t\tvec3( t1Clearcoat.z, 0, t1Clearcoat.w )\n\t\t\t);\n\t\t\tvec3 fresnelClearcoat = material.clearcoatF0 * t2Clearcoat.x + ( material.clearcoatF90 - material.clearcoatF0 ) * t2Clearcoat.y;\n\t\t\tclearcoatSpecularDirect += lightColor * fresnelClearcoat * LTC_Evaluate( Ncc, viewDir, position, mInvClearcoat, rectCoords );\n\t\t#endif\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );\n\t#endif\n\t#ifdef USE_SHEEN\n \n \t\tsheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );\n \n \t\tfloat sheenAlbedoV = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );\n \t\tfloat sheenAlbedoL = IBLSheenBRDF( geometryNormal, directLight.direction, material.sheenRoughness );\n \n \t\tfloat sheenEnergyComp = 1.0 - max3( material.sheenColor ) * max( sheenAlbedoV, sheenAlbedoL );\n \n \t\tirradiance *= sheenEnergyComp;\n \n \t#endif\n\treflectedLight.directSpecular += irradiance * BRDF_GGX_Multiscatter( directLight.direction, geometryViewDir, geometryNormal, material );\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseContribution );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 diffuse = irradiance * BRDF_Lambert( material.diffuseContribution );\n\t#ifdef USE_SHEEN\n\t\tfloat sheenAlbedo = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );\n\t\tfloat sheenEnergyComp = 1.0 - max3( material.sheenColor ) * sheenAlbedo;\n\t\tdiffuse *= sheenEnergyComp;\n\t#endif\n\treflectedLight.indirectDiffuse += diffuse;\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ) * RECIPROCAL_PI;\n \t#endif\n\tvec3 singleScatteringDielectric = vec3( 0.0 );\n\tvec3 multiScatteringDielectric = vec3( 0.0 );\n\tvec3 singleScatteringMetallic = vec3( 0.0 );\n\tvec3 multiScatteringMetallic = vec3( 0.0 );\n\t#ifdef USE_IRIDESCENCE\n\t\tcomputeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnelDielectric, material.roughness, singleScatteringDielectric, multiScatteringDielectric );\n\t\tcomputeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.diffuseColor, material.specularF90, material.iridescence, material.iridescenceFresnelMetallic, material.roughness, singleScatteringMetallic, multiScatteringMetallic );\n\t#else\n\t\tcomputeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScatteringDielectric, multiScatteringDielectric );\n\t\tcomputeMultiscattering( geometryNormal, geometryViewDir, material.diffuseColor, material.specularF90, material.roughness, singleScatteringMetallic, multiScatteringMetallic );\n\t#endif\n\tvec3 singleScattering = mix( singleScatteringDielectric, singleScatteringMetallic, material.metalness );\n\tvec3 multiScattering = mix( multiScatteringDielectric, multiScatteringMetallic, material.metalness );\n\tvec3 totalScatteringDielectric = singleScatteringDielectric + multiScatteringDielectric;\n\tvec3 diffuse = material.diffuseContribution * ( 1.0 - totalScatteringDielectric );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\tvec3 indirectSpecular = radiance * singleScattering;\n\tindirectSpecular += multiScattering * cosineWeightedIrradiance;\n\tvec3 indirectDiffuse = diffuse * cosineWeightedIrradiance;\n\t#ifdef USE_SHEEN\n\t\tfloat sheenAlbedo = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );\n\t\tfloat sheenEnergyComp = 1.0 - max3( material.sheenColor ) * sheenAlbedo;\n\t\tindirectSpecular *= sheenEnergyComp;\n\t\tindirectDiffuse *= sheenEnergyComp;\n\t#endif\n\treflectedLight.indirectSpecular += indirectSpecular;\n\treflectedLight.indirectDiffuse += indirectDiffuse;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}`,lights_fragment_begin:`\nvec3 geometryPosition = - vViewPosition;\nvec3 geometryNormal = normal;\nvec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\nvec3 geometryClearcoatNormal = vec3( 0.0 );\n#ifdef USE_CLEARCOAT\n\tgeometryClearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n\tfloat dotNVi = saturate( dot( normal, geometryViewDir ) );\n\tif ( material.iridescenceThickness == 0.0 ) {\n\t\tmaterial.iridescence = 0.0;\n\t} else {\n\t\tmaterial.iridescence = saturate( material.iridescence );\n\t}\n\tif ( material.iridescence > 0.0 ) {\n\t\tmaterial.iridescenceFresnelDielectric = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n\t\tmaterial.iridescenceFresnelMetallic = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.diffuseColor );\n\t\tmaterial.iridescenceFresnel = mix( material.iridescenceFresnelDielectric, material.iridescenceFresnelMetallic, material.metalness );\n\t\tmaterial.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n\t}\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointLightInfo( pointLight, geometryPosition, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) && ( defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_BASIC ) )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tvec4 spotColor;\n\tvec3 spotLightCoord;\n\tbool inSpotLightMap;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotLightInfo( spotLight, geometryPosition, directLight );\n\t\t#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\n\t\t#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\n\t\t#else\n\t\t#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#endif\n\t\t#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\n\t\t\tspotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\n\t\t\tinSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\n\t\t\tspotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\n\t\t\tdirectLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;\n\t\t#endif\n\t\t#undef SPOT_LIGHT_MAP_INDEX\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalLightInfo( directionalLight, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\t#if defined( USE_LIGHT_PROBES )\n\t\tirradiance += getLightProbeIrradiance( lightProbe, geometryNormal );\n\t#endif\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n\t#ifdef USE_LIGHT_PROBES_GRID\n\t\tvec3 probeWorldPos = ( ( vec4( geometryPosition, 1.0 ) - viewMatrix[ 3 ] ) * viewMatrix ).xyz;\n\t\tvec3 probeWorldNormal = transformNormalByInverseViewMatrix( geometryNormal, viewMatrix );\n\t\tirradiance += getLightProbeGridIrradiance( probeWorldPos, probeWorldNormal );\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif`,lights_fragment_maps:`#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\t#if defined( STANDARD ) || defined( LAMBERT ) || defined( PHONG )\n\t\t\tiblIrradiance += getIBLIrradiance( geometryNormal );\n\t\t#endif\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\t#ifdef USE_ANISOTROPY\n\t\tradiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );\n\t#else\n\t\tradiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );\n\t#endif\n#endif`,lights_fragment_end:`#if defined( RE_IndirectDiffuse )\n\t#if defined( LAMBERT ) || defined( PHONG )\n\t\tirradiance += iblIrradiance;\n\t#endif\n\tRE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif`,lightprobes_pars_fragment:`#ifdef USE_LIGHT_PROBES_GRID\nuniform highp sampler3D probesSH;\nuniform vec3 probesMin;\nuniform vec3 probesMax;\nuniform vec3 probesResolution;\nvec3 getLightProbeGridIrradiance( vec3 worldPos, vec3 worldNormal ) {\n\tvec3 res = probesResolution;\n\tvec3 gridRange = probesMax - probesMin;\n\tvec3 resMinusOne = res - 1.0;\n\tvec3 probeSpacing = gridRange / resMinusOne;\n\tvec3 samplePos = worldPos + worldNormal * probeSpacing * 0.5;\n\tvec3 uvw = clamp( ( samplePos - probesMin ) / gridRange, 0.0, 1.0 );\n\tuvw = uvw * resMinusOne / res + 0.5 / res;\n\tfloat nz = res.z;\n\tfloat paddedSlices = nz + 2.0;\n\tfloat atlasDepth = 7.0 * paddedSlices;\n\tfloat uvZBase = uvw.z * nz + 1.0;\n\tvec4 s0 = texture( probesSH, vec3( uvw.xy, ( uvZBase ) / atlasDepth ) );\n\tvec4 s1 = texture( probesSH, vec3( uvw.xy, ( uvZBase + paddedSlices ) / atlasDepth ) );\n\tvec4 s2 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 2.0 * paddedSlices ) / atlasDepth ) );\n\tvec4 s3 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 3.0 * paddedSlices ) / atlasDepth ) );\n\tvec4 s4 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 4.0 * paddedSlices ) / atlasDepth ) );\n\tvec4 s5 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 5.0 * paddedSlices ) / atlasDepth ) );\n\tvec4 s6 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 6.0 * paddedSlices ) / atlasDepth ) );\n\tvec3 c0 = s0.xyz;\n\tvec3 c1 = vec3( s0.w, s1.xy );\n\tvec3 c2 = vec3( s1.zw, s2.x );\n\tvec3 c3 = s2.yzw;\n\tvec3 c4 = s3.xyz;\n\tvec3 c5 = vec3( s3.w, s4.xy );\n\tvec3 c6 = vec3( s4.zw, s5.x );\n\tvec3 c7 = s5.yzw;\n\tvec3 c8 = s6.xyz;\n\tfloat x = worldNormal.x, y = worldNormal.y, z = worldNormal.z;\n\tvec3 result = c0 * 0.886227;\n\tresult += c1 * 2.0 * 0.511664 * y;\n\tresult += c2 * 2.0 * 0.511664 * z;\n\tresult += c3 * 2.0 * 0.511664 * x;\n\tresult += c4 * 2.0 * 0.429043 * x * y;\n\tresult += c5 * 2.0 * 0.429043 * y * z;\n\tresult += c6 * ( 0.743125 * z * z - 0.247708 );\n\tresult += c7 * 2.0 * 0.429043 * x * z;\n\tresult += c8 * 0.429043 * ( x * x - y * y );\n\treturn max( result, vec3( 0.0 ) );\n}\n#endif`,logdepthbuf_fragment:`#if defined( USE_LOGARITHMIC_DEPTH_BUFFER )\n\tgl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif`,logdepthbuf_pars_fragment:`#if defined( USE_LOGARITHMIC_DEPTH_BUFFER )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif`,logdepthbuf_pars_vertex:`#ifdef USE_LOGARITHMIC_DEPTH_BUFFER\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif`,logdepthbuf_vertex:`#ifdef USE_LOGARITHMIC_DEPTH_BUFFER\n\tvFragDepth = 1.0 + gl_Position.w;\n\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n#endif`,map_fragment:`#ifdef USE_MAP\n\tvec4 sampledDiffuseColor = texture2D( map, vMapUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\tsampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor );\n\t#endif\n\tdiffuseColor *= sampledDiffuseColor;\n#endif`,map_pars_fragment:`#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif`,map_particle_fragment:`#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t#if defined( USE_POINTS_UV )\n\t\tvec2 uv = vUv;\n\t#else\n\t\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tdiffuseColor *= texture2D( map, uv );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif`,map_particle_pars_fragment:`#if defined( USE_POINTS_UV )\n\tvarying vec2 vUv;\n#else\n\t#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t\tuniform mat3 uvTransform;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif`,metalnessmap_fragment:`float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif`,metalnessmap_pars_fragment:`#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif`,morphinstance_vertex:`#ifdef USE_INSTANCING_MORPH\n\tfloat morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\tfloat morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\tmorphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;\n\t}\n#endif`,morphcolor_vertex:`#if defined( USE_MORPHCOLORS )\n\tvColor *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t#if defined( USE_COLOR_ALPHA )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\n\t\t#elif defined( USE_COLOR )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];\n\t\t#endif\n\t}\n#endif`,morphnormal_vertex:`#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\tif ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n\t}\n#endif`,morphtarget_pars_vertex:`#ifdef USE_MORPHTARGETS\n\t#ifndef USE_INSTANCING_MORPH\n\t\tuniform float morphTargetBaseInfluence;\n\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t#endif\n\tuniform sampler2DArray morphTargetsTexture;\n\tuniform ivec2 morphTargetsTextureSize;\n\tvec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n\t\tint texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n\t\tint y = texelIndex / morphTargetsTextureSize.x;\n\t\tint x = texelIndex - y * morphTargetsTextureSize.x;\n\t\tivec3 morphUV = ivec3( x, y, morphTargetIndex );\n\t\treturn texelFetch( morphTargetsTexture, morphUV, 0 );\n\t}\n#endif`,morphtarget_vertex:`#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n\t}\n#endif`,normal_fragment_begin:`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = dFdx( vViewPosition );\n\tvec3 fdy = dFdy( vViewPosition );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal *= faceDirection;\n\t#endif\n#endif\n#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn = getTangentFrame( - vViewPosition, normal,\n\t\t#if defined( USE_NORMALMAP )\n\t\t\tvNormalMapUv\n\t\t#elif defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tvClearcoatNormalMapUv\n\t\t#else\n\t\t\tvUv\n\t\t#endif\n\t\t);\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\ttbn[0] *= faceDirection;\n\t\ttbn[1] *= faceDirection;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\ttbn2[0] *= faceDirection;\n\t\ttbn2[1] *= faceDirection;\n\t#endif\n#endif\nvec3 nonPerturbedNormal = normal;`,normal_fragment_maps:`#ifdef USE_NORMALMAP_OBJECTSPACE\n\tnormal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( USE_NORMALMAP_TANGENTSPACE )\n\tvec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\t#if defined( USE_PACKED_NORMALMAP )\n\t\tmapN = vec3( mapN.xy, sqrt( saturate( 1.0 - dot( mapN.xy, mapN.xy ) ) ) );\n\t#endif\n\tmapN.xy *= normalScale;\n\tnormal = normalize( tbn * mapN );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif`,normal_pars_fragment:`#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif`,normal_pars_vertex:`#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif`,normal_vertex:`#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t\t#ifdef FLIP_SIDED\n\t\t\tvBitangent = - vBitangent;\n\t\t#endif\n\t#endif\n#endif`,normalmap_pars_fragment:`#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef USE_NORMALMAP_OBJECTSPACE\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )\n\tmat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( uv.st );\n\t\tvec2 st1 = dFdy( uv.st );\n\t\tvec3 N = surf_norm;\n\t\tvec3 q1perp = cross( q1, N );\n\t\tvec3 q0perp = cross( N, q0 );\n\t\tvec3 T = q1perp * st0.x + q0perp * st1.x;\n\t\tvec3 B = q1perp * st0.y + q0perp * st1.y;\n\t\tfloat det = max( dot( T, T ), dot( B, B ) );\n\t\tfloat scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );\n\t\treturn mat3( T * scale, B * scale, N );\n\t}\n#endif`,clearcoat_normal_fragment_begin:`#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal = nonPerturbedNormal;\n#endif`,clearcoat_normal_fragment_maps:`#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\tclearcoatNormal = normalize( tbn2 * clearcoatMapN );\n#endif`,clearcoat_pars_fragment:`#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif`,iridescence_pars_fragment:`#ifdef USE_IRIDESCENCEMAP\n\tuniform sampler2D iridescenceMap;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform sampler2D iridescenceThicknessMap;\n#endif`,opaque_fragment:`#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );`,packing:`vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.;\nconst float Inv255 = 1. / 255.;\nconst vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 );\nconst vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g );\nconst vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b );\nconst vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a );\nvec4 packDepthToRGBA( const in float v ) {\n\tif( v <= 0.0 )\n\t\treturn vec4( 0., 0., 0., 0. );\n\tif( v >= 1.0 )\n\t\treturn vec4( 1., 1., 1., 1. );\n\tfloat vuf;\n\tfloat af = modf( v * PackFactors.a, vuf );\n\tfloat bf = modf( vuf * ShiftRight8, vuf );\n\tfloat gf = modf( vuf * ShiftRight8, vuf );\n\treturn vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af );\n}\nvec3 packDepthToRGB( const in float v ) {\n\tif( v <= 0.0 )\n\t\treturn vec3( 0., 0., 0. );\n\tif( v >= 1.0 )\n\t\treturn vec3( 1., 1., 1. );\n\tfloat vuf;\n\tfloat bf = modf( v * PackFactors.b, vuf );\n\tfloat gf = modf( vuf * ShiftRight8, vuf );\n\treturn vec3( vuf * Inv255, gf * PackUpscale, bf );\n}\nvec2 packDepthToRG( const in float v ) {\n\tif( v <= 0.0 )\n\t\treturn vec2( 0., 0. );\n\tif( v >= 1.0 )\n\t\treturn vec2( 1., 1. );\n\tfloat vuf;\n\tfloat gf = modf( v * 256., vuf );\n\treturn vec2( vuf * Inv255, gf );\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors4 );\n}\nfloat unpackRGBToDepth( const in vec3 v ) {\n\treturn dot( v, UnpackFactors3 );\n}\nfloat unpackRGToDepth( const in vec2 v ) {\n\treturn v.r * UnpackFactors2.r + v.g * UnpackFactors2.g;\n}\nvec4 pack2HalfToRGBA( const in vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( const in vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\t#ifdef USE_REVERSED_DEPTH_BUFFER\n\t\n\t\treturn depth * ( far - near ) - far;\n\t#else\n\t\treturn depth * ( near - far ) - near;\n\t#endif\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\t\n\t#ifdef USE_REVERSED_DEPTH_BUFFER\n\t\treturn ( near * far ) / ( ( near - far ) * depth - near );\n\t#else\n\t\treturn ( near * far ) / ( ( far - near ) * depth - far );\n\t#endif\n}`,premultiplied_alpha_fragment:`#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif`,project_vertex:`vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_BATCHING\n\tmvPosition = batchingMatrix * mvPosition;\n#endif\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;`,dithering_fragment:`#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif`,dithering_pars_fragment:`#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif`,roughnessmap_fragment:`float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );\n\troughnessFactor *= texelRoughness.g;\n#endif`,roughnessmap_pars_fragment:`#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif`,shadowmap_pars_fragment:`#if NUM_SPOT_LIGHT_COORDS > 0\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#if NUM_SPOT_LIGHT_MAPS > 0\n\tuniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tuniform sampler2DShadow directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\t#else\n\t\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\t#endif\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tuniform sampler2DShadow spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\t#else\n\t\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\t#endif\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tuniform samplerCubeShadow pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\t#elif defined( SHADOWMAP_TYPE_BASIC )\n\t\t\tuniform samplerCube pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\t#endif\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\tfloat interleavedGradientNoise( vec2 position ) {\n\t\t\treturn fract( 52.9829189 * fract( dot( position, vec2( 0.06711056, 0.00583715 ) ) ) );\n\t\t}\n\t\tvec2 vogelDiskSample( int sampleIndex, int samplesCount, float phi ) {\n\t\t\tconst float goldenAngle = 2.399963229728653;\n\t\t\tfloat r = sqrt( ( float( sampleIndex ) + 0.5 ) / float( samplesCount ) );\n\t\t\tfloat theta = float( sampleIndex ) * goldenAngle + phi;\n\t\t\treturn vec2( cos( theta ), sin( theta ) ) * r;\n\t\t}\n\t#endif\n\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\tfloat getShadow( sampler2DShadow shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\t\tfloat shadow = 1.0;\n\t\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\t\tshadowCoord.z += shadowBias;\n\t\t\tbool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n\t\t\tbool frustumTest = inFrustum && shadowCoord.z <= 1.0;\n\t\t\tif ( frustumTest ) {\n\t\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\t\tfloat radius = shadowRadius * texelSize.x;\n\t\t\t\tfloat phi = interleavedGradientNoise( gl_FragCoord.xy ) * PI2;\n\t\t\t\tshadow = (\n\t\t\t\t\ttexture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 0, 5, phi ) * radius, shadowCoord.z ) ) +\n\t\t\t\t\ttexture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 1, 5, phi ) * radius, shadowCoord.z ) ) +\n\t\t\t\t\ttexture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 2, 5, phi ) * radius, shadowCoord.z ) ) +\n\t\t\t\t\ttexture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 3, 5, phi ) * radius, shadowCoord.z ) ) +\n\t\t\t\t\ttexture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 4, 5, phi ) * radius, shadowCoord.z ) )\n\t\t\t\t) * 0.2;\n\t\t\t}\n\t\t\treturn mix( 1.0, shadow, shadowIntensity );\n\t\t}\n\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\t\tfloat shadow = 1.0;\n\t\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\t\t#ifdef USE_REVERSED_DEPTH_BUFFER\n\t\t\t\tshadowCoord.z -= shadowBias;\n\t\t\t#else\n\t\t\t\tshadowCoord.z += shadowBias;\n\t\t\t#endif\n\t\t\tbool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n\t\t\tbool frustumTest = inFrustum && shadowCoord.z <= 1.0;\n\t\t\tif ( frustumTest ) {\n\t\t\t\tvec2 distribution = texture2D( shadowMap, shadowCoord.xy ).rg;\n\t\t\t\tfloat mean = distribution.x;\n\t\t\t\tfloat variance = distribution.y * distribution.y;\n\t\t\t\t#ifdef USE_REVERSED_DEPTH_BUFFER\n\t\t\t\t\tfloat hard_shadow = step( mean, shadowCoord.z );\n\t\t\t\t#else\n\t\t\t\t\tfloat hard_shadow = step( shadowCoord.z, mean );\n\t\t\t\t#endif\n\t\t\t\t\n\t\t\t\tif ( hard_shadow == 1.0 ) {\n\t\t\t\t\tshadow = 1.0;\n\t\t\t\t} else {\n\t\t\t\t\tvariance = max( variance, 0.0000001 );\n\t\t\t\t\tfloat d = shadowCoord.z - mean;\n\t\t\t\t\tfloat p_max = variance / ( variance + d * d );\n\t\t\t\t\tp_max = clamp( ( p_max - 0.3 ) / 0.65, 0.0, 1.0 );\n\t\t\t\t\tshadow = max( hard_shadow, p_max );\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn mix( 1.0, shadow, shadowIntensity );\n\t\t}\n\t#else\n\t\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\t\tfloat shadow = 1.0;\n\t\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\t\t#ifdef USE_REVERSED_DEPTH_BUFFER\n\t\t\t\tshadowCoord.z -= shadowBias;\n\t\t\t#else\n\t\t\t\tshadowCoord.z += shadowBias;\n\t\t\t#endif\n\t\t\tbool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n\t\t\tbool frustumTest = inFrustum && shadowCoord.z <= 1.0;\n\t\t\tif ( frustumTest ) {\n\t\t\t\tfloat depth = texture2D( shadowMap, shadowCoord.xy ).r;\n\t\t\t\t#ifdef USE_REVERSED_DEPTH_BUFFER\n\t\t\t\t\tshadow = step( depth, shadowCoord.z );\n\t\t\t\t#else\n\t\t\t\t\tshadow = step( shadowCoord.z, depth );\n\t\t\t\t#endif\n\t\t\t}\n\t\t\treturn mix( 1.0, shadow, shadowIntensity );\n\t\t}\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t#if defined( SHADOWMAP_TYPE_PCF )\n\tfloat getPointShadow( samplerCubeShadow shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tfloat shadow = 1.0;\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\tvec3 absVec = abs( lightToPosition );\n\t\tfloat viewSpaceZ = max( max( absVec.x, absVec.y ), absVec.z );\n\t\tif ( viewSpaceZ - shadowCameraFar <= 0.0 && viewSpaceZ - shadowCameraNear >= 0.0 ) {\n\t\t\t#ifdef USE_REVERSED_DEPTH_BUFFER\n\t\t\t\tfloat dp = ( shadowCameraNear * ( shadowCameraFar - viewSpaceZ ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) );\n\t\t\t\tdp -= shadowBias;\n\t\t\t#else\n\t\t\t\tfloat dp = ( shadowCameraFar * ( viewSpaceZ - shadowCameraNear ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) );\n\t\t\t\tdp += shadowBias;\n\t\t\t#endif\n\t\t\tfloat texelSize = shadowRadius / shadowMapSize.x;\n\t\t\tvec3 absDir = abs( bd3D );\n\t\t\tvec3 tangent = absDir.x > absDir.z ? vec3( 0.0, 1.0, 0.0 ) : vec3( 1.0, 0.0, 0.0 );\n\t\t\ttangent = normalize( cross( bd3D, tangent ) );\n\t\t\tvec3 bitangent = cross( bd3D, tangent );\n\t\t\tfloat phi = interleavedGradientNoise( gl_FragCoord.xy ) * PI2;\n\t\t\tvec2 sample0 = vogelDiskSample( 0, 5, phi );\n\t\t\tvec2 sample1 = vogelDiskSample( 1, 5, phi );\n\t\t\tvec2 sample2 = vogelDiskSample( 2, 5, phi );\n\t\t\tvec2 sample3 = vogelDiskSample( 3, 5, phi );\n\t\t\tvec2 sample4 = vogelDiskSample( 4, 5, phi );\n\t\t\tshadow = (\n\t\t\t\ttexture( shadowMap, vec4( bd3D + ( tangent * sample0.x + bitangent * sample0.y ) * texelSize, dp ) ) +\n\t\t\t\ttexture( shadowMap, vec4( bd3D + ( tangent * sample1.x + bitangent * sample1.y ) * texelSize, dp ) ) +\n\t\t\t\ttexture( shadowMap, vec4( bd3D + ( tangent * sample2.x + bitangent * sample2.y ) * texelSize, dp ) ) +\n\t\t\t\ttexture( shadowMap, vec4( bd3D + ( tangent * sample3.x + bitangent * sample3.y ) * texelSize, dp ) ) +\n\t\t\t\ttexture( shadowMap, vec4( bd3D + ( tangent * sample4.x + bitangent * sample4.y ) * texelSize, dp ) )\n\t\t\t) * 0.2;\n\t\t}\n\t\treturn mix( 1.0, shadow, shadowIntensity );\n\t}\n\t#elif defined( SHADOWMAP_TYPE_BASIC )\n\tfloat getPointShadow( samplerCube shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tfloat shadow = 1.0;\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tvec3 absVec = abs( lightToPosition );\n\t\tfloat viewSpaceZ = max( max( absVec.x, absVec.y ), absVec.z );\n\t\tif ( viewSpaceZ - shadowCameraFar <= 0.0 && viewSpaceZ - shadowCameraNear >= 0.0 ) {\n\t\t\tfloat dp = ( shadowCameraFar * ( viewSpaceZ - shadowCameraNear ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) );\n\t\t\tdp += shadowBias;\n\t\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t\tfloat depth = textureCube( shadowMap, bd3D ).r;\n\t\t\t#ifdef USE_REVERSED_DEPTH_BUFFER\n\t\t\t\tdepth = 1.0 - depth;\n\t\t\t#endif\n\t\t\tshadow = step( dp, depth );\n\t\t}\n\t\treturn mix( 1.0, shadow, shadowIntensity );\n\t}\n\t#endif\n\t#endif\n#endif`,shadowmap_pars_vertex:`#if NUM_SPOT_LIGHT_COORDS > 0\n\tuniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif`,shadowmap_vertex:`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )\n\t#ifdef HAS_NORMAL\n\t\tvec3 shadowWorldNormal = transformNormalByInverseViewMatrix( transformedNormal, viewMatrix );\n\t#else\n\t\tvec3 shadowWorldNormal = vec3( 0.0 );\n\t#endif\n\tvec4 shadowWorldPosition;\n#endif\n#if defined( USE_SHADOWMAP )\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if NUM_SPOT_LIGHT_COORDS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition;\n\t\t#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t\tshadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;\n\t\t#endif\n\t\tvSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n#endif`,shadowmask_pars_fragment:`float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0 && ( defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_BASIC ) )\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}`,skinbase_vertex:`#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif`,skinning_pars_vertex:`#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\tuniform highp sampler2D boneTexture;\n\tmat4 getBoneMatrix( const in float i ) {\n\t\tint size = textureSize( boneTexture, 0 ).x;\n\t\tint j = int( i ) * 4;\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\tvec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );\n\t\tvec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );\n\t\tvec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );\n\t\tvec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );\n\t\treturn mat4( v1, v2, v3, v4 );\n\t}\n#endif`,skinning_vertex:`#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif`,skinnormal_vertex:`#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif`,specularmap_fragment:`float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif`,specularmap_pars_fragment:`#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif`,tonemapping_fragment:`#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif`,tonemapping_pars_fragment:`#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn saturate( toneMappingExposure * color );\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 CineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nconst mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3(\n\tvec3( 1.6605, - 0.1246, - 0.0182 ),\n\tvec3( - 0.5876, 1.1329, - 0.1006 ),\n\tvec3( - 0.0728, - 0.0083, 1.1187 )\n);\nconst mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3(\n\tvec3( 0.6274, 0.0691, 0.0164 ),\n\tvec3( 0.3293, 0.9195, 0.0880 ),\n\tvec3( 0.0433, 0.0113, 0.8956 )\n);\nvec3 agxDefaultContrastApprox( vec3 x ) {\n\tvec3 x2 = x * x;\n\tvec3 x4 = x2 * x2;\n\treturn + 15.5 * x4 * x2\n\t\t- 40.14 * x4 * x\n\t\t+ 31.96 * x4\n\t\t- 6.868 * x2 * x\n\t\t+ 0.4298 * x2\n\t\t+ 0.1191 * x\n\t\t- 0.00232;\n}\nvec3 AgXToneMapping( vec3 color ) {\n\tconst mat3 AgXInsetMatrix = mat3(\n\t\tvec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ),\n\t\tvec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ),\n\t\tvec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 )\n\t);\n\tconst mat3 AgXOutsetMatrix = mat3(\n\t\tvec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ),\n\t\tvec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ),\n\t\tvec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )\n\t);\n\tconst float AgxMinEv = - 12.47393;\tconst float AgxMaxEv = 4.026069;\n\tcolor *= toneMappingExposure;\n\tcolor = LINEAR_SRGB_TO_LINEAR_REC2020 * color;\n\tcolor = AgXInsetMatrix * color;\n\tcolor = max( color, 1e-10 );\tcolor = log2( color );\n\tcolor = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv );\n\tcolor = clamp( color, 0.0, 1.0 );\n\tcolor = agxDefaultContrastApprox( color );\n\tcolor = AgXOutsetMatrix * color;\n\tcolor = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) );\n\tcolor = LINEAR_REC2020_TO_LINEAR_SRGB * color;\n\tcolor = clamp( color, 0.0, 1.0 );\n\treturn color;\n}\nvec3 NeutralToneMapping( vec3 color ) {\n\tconst float StartCompression = 0.8 - 0.04;\n\tconst float Desaturation = 0.15;\n\tcolor *= toneMappingExposure;\n\tfloat x = min( color.r, min( color.g, color.b ) );\n\tfloat offset = x < 0.08 ? x - 6.25 * x * x : 0.04;\n\tcolor -= offset;\n\tfloat peak = max( color.r, max( color.g, color.b ) );\n\tif ( peak < StartCompression ) return color;\n\tfloat d = 1. - StartCompression;\n\tfloat newPeak = 1. - d * d / ( peak + d - StartCompression );\n\tcolor *= newPeak / peak;\n\tfloat g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. );\n\treturn mix( color, vec3( newPeak ), g );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }`,transmission_fragment:`#ifdef USE_TRANSMISSION\n\tmaterial.transmission = transmission;\n\tmaterial.transmissionAlpha = 1.0;\n\tmaterial.thickness = thickness;\n\tmaterial.attenuationDistance = attenuationDistance;\n\tmaterial.attenuationColor = attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tmaterial.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tmaterial.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = transformNormalByInverseViewMatrix( normal, viewMatrix );\n\tvec4 transmitted = getIBLVolumeRefraction(\n\t\tn, v, material.roughness, material.diffuseContribution, material.specularColorBlended, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness,\n\t\tmaterial.attenuationColor, material.attenuationDistance );\n\tmaterial.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );\n\ttotalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );\n#endif`,transmission_pars_fragment:`#ifdef USE_TRANSMISSION\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform float attenuationDistance;\n\tuniform vec3 attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tuniform sampler2D transmissionMap;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tuniform sampler2D thicknessMap;\n\t#endif\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\tvarying vec3 vWorldPosition;\n\tfloat w0( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );\n\t}\n\tfloat w1( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 );\n\t}\n\tfloat w2( float a ){\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );\n\t}\n\tfloat w3( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * a );\n\t}\n\tfloat g0( float a ) {\n\t\treturn w0( a ) + w1( a );\n\t}\n\tfloat g1( float a ) {\n\t\treturn w2( a ) + w3( a );\n\t}\n\tfloat h0( float a ) {\n\t\treturn - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );\n\t}\n\tfloat h1( float a ) {\n\t\treturn 1.0 + w3( a ) / ( w2( a ) + w3( a ) );\n\t}\n\tvec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {\n\t\tuv = uv * texelSize.zw + 0.5;\n\t\tvec2 iuv = floor( uv );\n\t\tvec2 fuv = fract( uv );\n\t\tfloat g0x = g0( fuv.x );\n\t\tfloat g1x = g1( fuv.x );\n\t\tfloat h0x = h0( fuv.x );\n\t\tfloat h1x = h1( fuv.x );\n\t\tfloat h0y = h0( fuv.y );\n\t\tfloat h1y = h1( fuv.y );\n\t\tvec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\treturn g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +\n\t\t\tg1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );\n\t}\n\tvec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {\n\t\tvec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );\n\t\tvec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );\n\t\tvec2 fLodSizeInv = 1.0 / fLodSize;\n\t\tvec2 cLodSizeInv = 1.0 / cLodSize;\n\t\tvec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );\n\t\tvec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );\n\t\treturn mix( fSample, cSample, fract( lod ) );\n\t}\n\tvec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n\t\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n\t\tvec3 modelScale;\n\t\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n\t\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n\t\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n\t\treturn normalize( refractionVector ) * thickness * modelScale;\n\t}\n\tfloat applyIorToRoughness( const in float roughness, const in float ior ) {\n\t\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n\t}\n\tvec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n\t\tfloat lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\treturn textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );\n\t}\n\tvec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tif ( isinf( attenuationDistance ) ) {\n\t\t\treturn vec3( 1.0 );\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance;\n\t\t}\n\t}\n\tvec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n\t\tconst in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n\t\tconst in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness,\n\t\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tvec4 transmittedLight;\n\t\tvec3 transmittance;\n\t\t#ifdef USE_DISPERSION\n\t\t\tfloat halfSpread = ( ior - 1.0 ) * 0.025 * dispersion;\n\t\t\tvec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread );\n\t\t\tfor ( int i = 0; i < 3; i ++ ) {\n\t\t\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix );\n\t\t\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\t\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\t\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\t\t\trefractionCoords += 1.0;\n\t\t\t\trefractionCoords /= 2.0;\n\t\t\t\tvec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] );\n\t\t\t\ttransmittedLight[ i ] = transmissionSample[ i ];\n\t\t\t\ttransmittedLight.a += transmissionSample.a;\n\t\t\t\ttransmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ];\n\t\t\t}\n\t\t\ttransmittedLight.a /= 3.0;\n\t\t#else\n\t\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\t\trefractionCoords += 1.0;\n\t\t\trefractionCoords /= 2.0;\n\t\t\ttransmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\t\ttransmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\t#endif\n\t\tvec3 attenuatedColor = transmittance * transmittedLight.rgb;\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\tfloat transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );\n\t}\n#endif`,uv_pars_fragment:`#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif`,uv_pars_vertex:`#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tuniform mat3 mapTransform;\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform mat3 alphaMapTransform;\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tuniform mat3 lightMapTransform;\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tuniform mat3 aoMapTransform;\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tuniform mat3 bumpMapTransform;\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tuniform mat3 normalMapTransform;\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tuniform mat3 displacementMapTransform;\n\tvarying vec2 vDisplacementMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tuniform mat3 emissiveMapTransform;\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tuniform mat3 metalnessMapTransform;\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tuniform mat3 roughnessMapTransform;\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tuniform mat3 anisotropyMapTransform;\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tuniform mat3 clearcoatMapTransform;\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform mat3 clearcoatNormalMapTransform;\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform mat3 clearcoatRoughnessMapTransform;\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tuniform mat3 sheenColorMapTransform;\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tuniform mat3 sheenRoughnessMapTransform;\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tuniform mat3 iridescenceMapTransform;\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform mat3 iridescenceThicknessMapTransform;\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tuniform mat3 specularMapTransform;\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tuniform mat3 specularColorMapTransform;\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tuniform mat3 specularIntensityMapTransform;\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif`,uv_vertex:`#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvUv = vec3( uv, 1 ).xy;\n#endif\n#ifdef USE_MAP\n\tvMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ALPHAMAP\n\tvAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_LIGHTMAP\n\tvLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_AOMAP\n\tvAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_BUMPMAP\n\tvBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_NORMALMAP\n\tvNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tvDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_METALNESSMAP\n\tvMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULARMAP\n\tvSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tvTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_THICKNESSMAP\n\tvThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;\n#endif`,worldpos_vertex:`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_BATCHING\n\t\tworldPosition = batchingMatrix * worldPosition;\n\t#endif\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif`,background_vert:`varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}`,background_frag:`uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\ttexColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}`,backgroundCube_vert:`varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}`,backgroundCube_frag:`#ifdef ENVMAP_TYPE_CUBE\n\tuniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n\tuniform sampler2D envMap;\n#endif\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nuniform mat3 backgroundRotation;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, backgroundRotation * vWorldDirection );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness );\n\t#else\n\t\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}`,cube_vert:`varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}`,cube_frag:`uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = texColor;\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}`,depth_vert:`#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_vertex>\n\t#include <skinbase_vertex>\n\t#include <morphinstance_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvHighPrecisionZW = gl_Position.zw;\n}`,depth_frag:`#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <clipping_planes_fragment>\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <logdepthbuf_fragment>\n\t#ifdef USE_REVERSED_DEPTH_BUFFER\n\t\tfloat fragCoordZ = vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ];\n\t#else\n\t\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ] + 0.5;\n\t#endif\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#elif DEPTH_PACKING == 3202\n\t\tgl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 );\n\t#elif DEPTH_PACKING == 3203\n\t\tgl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 );\n\t#endif\n}`,distance_vert:`#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_vertex>\n\t#include <skinbase_vertex>\n\t#include <morphinstance_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}`,distance_frag:`#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <clipping_planes_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = vec4( dist, 0.0, 0.0, 1.0 );\n}`,equirect_vert:`varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}`,equirect_frag:`uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}`,linedashed_vert:`uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}`,linedashed_frag:`uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}`,meshbasic_vert:`#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinbase_vertex>\n\t\t#include <skinnormal_vertex>\n\t\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}`,meshbasic_frag:`uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}`,meshlambert_vert:`#define LAMBERT\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}`,meshlambert_frag:`#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_lambert_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_lambert_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}`,meshmatcap_vert:`#define MATCAP\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\tvViewPosition = - mvPosition.xyz;\n}`,meshmatcap_frag:`#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t#else\n\t\tvec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}`,meshnormal_vert:`#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}`,meshnormal_frag:`#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include <uv_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tgl_FragColor = vec4( normalize( normal ) * 0.5 + 0.5, diffuseColor.a );\n\t#ifdef OPAQUE\n\t\tgl_FragColor.a = 1.0;\n\t#endif\n}`,meshphong_vert:`#define PHONG\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}`,meshphong_frag:`#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}`,meshphysical_vert:`#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition.xyz;\n#endif\n}`,meshphysical_frag:`#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define USE_SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n\tuniform float ior;\n#endif\n#ifdef USE_SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULAR_COLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_DISPERSION\n\tuniform float dispersion;\n#endif\n#ifdef USE_IRIDESCENCE\n\tuniform float iridescence;\n\tuniform float iridescenceIOR;\n\tuniform float iridescenceThicknessMinimum;\n\tuniform float iridescenceThicknessMaximum;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\tuniform vec2 anisotropyVector;\n\t#ifdef USE_ANISOTROPYMAP\n\t\tuniform sampler2D anisotropyMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <iridescence_fragment>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_physical_pars_fragment>\n#include <transmission_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <iridescence_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include <transmission_fragment>\n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\t#ifdef USE_SHEEN\n \n\t\toutgoingLight = outgoingLight + sheenSpecularDirect + sheenSpecularIndirect;\n \n \t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;\n\t#endif\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}`,meshtoon_vert:`#define TOON\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}`,meshtoon_frag:`#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_toon_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}`,points_vert:`uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n#ifdef USE_POINTS_UV\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif\nvoid main() {\n\t#ifdef USE_POINTS_UV\n\t\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\t#endif\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}`,points_frag:`uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}`,shadow_vert:`#include <common>\n#include <batching_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}`,shadow_frag:`uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <logdepthbuf_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}`,sprite_vert:`uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\tvec4 mvPosition = modelViewMatrix[ 3 ];\n\tvec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}`,sprite_frag:`uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n}`},V={common:{diffuse:{value:new z(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new R},alphaMap:{value:null},alphaMapTransform:{value:new R},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new R}},envmap:{envMap:{value:null},envMapRotation:{value:new R},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98},dfgLUT:{value:null}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new R}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new R}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new R},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new R},normalScale:{value:new I(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new R},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new R}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new R}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new R}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new z(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null},probesSH:{value:null},probesMin:{value:new L},probesMax:{value:new L},probesResolution:{value:new L}},points:{diffuse:{value:new z(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new R},alphaTest:{value:0},uvTransform:{value:new R}},sprite:{diffuse:{value:new z(16777215)},opacity:{value:1},center:{value:new I(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new R},alphaMap:{value:null},alphaMapTransform:{value:new R},alphaTest:{value:0}}},dl={basic:{uniforms:ge([V.common,V.specularmap,V.envmap,V.aomap,V.lightmap,V.fog]),vertexShader:B.meshbasic_vert,fragmentShader:B.meshbasic_frag},lambert:{uniforms:ge([V.common,V.specularmap,V.envmap,V.aomap,V.lightmap,V.emissivemap,V.bumpmap,V.normalmap,V.displacementmap,V.fog,V.lights,{emissive:{value:new z(0)},envMapIntensity:{value:1}}]),vertexShader:B.meshlambert_vert,fragmentShader:B.meshlambert_frag},phong:{uniforms:ge([V.common,V.specularmap,V.envmap,V.aomap,V.lightmap,V.emissivemap,V.bumpmap,V.normalmap,V.displacementmap,V.fog,V.lights,{emissive:{value:new z(0)},specular:{value:new z(1118481)},shininess:{value:30},envMapIntensity:{value:1}}]),vertexShader:B.meshphong_vert,fragmentShader:B.meshphong_frag},standard:{uniforms:ge([V.common,V.envmap,V.aomap,V.lightmap,V.emissivemap,V.bumpmap,V.normalmap,V.displacementmap,V.roughnessmap,V.metalnessmap,V.fog,V.lights,{emissive:{value:new z(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:B.meshphysical_vert,fragmentShader:B.meshphysical_frag},toon:{uniforms:ge([V.common,V.aomap,V.lightmap,V.emissivemap,V.bumpmap,V.normalmap,V.displacementmap,V.gradientmap,V.fog,V.lights,{emissive:{value:new z(0)}}]),vertexShader:B.meshtoon_vert,fragmentShader:B.meshtoon_frag},matcap:{uniforms:ge([V.common,V.bumpmap,V.normalmap,V.displacementmap,V.fog,{matcap:{value:null}}]),vertexShader:B.meshmatcap_vert,fragmentShader:B.meshmatcap_frag},points:{uniforms:ge([V.points,V.fog]),vertexShader:B.points_vert,fragmentShader:B.points_frag},dashed:{uniforms:ge([V.common,V.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:B.linedashed_vert,fragmentShader:B.linedashed_frag},depth:{uniforms:ge([V.common,V.displacementmap]),vertexShader:B.depth_vert,fragmentShader:B.depth_frag},normal:{uniforms:ge([V.common,V.bumpmap,V.normalmap,V.displacementmap,{opacity:{value:1}}]),vertexShader:B.meshnormal_vert,fragmentShader:B.meshnormal_frag},sprite:{uniforms:ge([V.sprite,V.fog]),vertexShader:B.sprite_vert,fragmentShader:B.sprite_frag},background:{uniforms:{uvTransform:{value:new R},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:B.background_vert,fragmentShader:B.background_frag},backgroundCube:{uniforms:{envMap:{value:null},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new R}},vertexShader:B.backgroundCube_vert,fragmentShader:B.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:B.cube_vert,fragmentShader:B.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:B.equirect_vert,fragmentShader:B.equirect_frag},distance:{uniforms:ge([V.common,V.displacementmap,{referencePosition:{value:new L},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:B.distance_vert,fragmentShader:B.distance_frag},shadow:{uniforms:ge([V.lights,V.fog,{color:{value:new z(0)},opacity:{value:1}}]),vertexShader:B.shadow_vert,fragmentShader:B.shadow_frag}},dl.physical={uniforms:ge([dl.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new R},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new R},clearcoatNormalScale:{value:new I(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new R},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new R},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new R},sheen:{value:0},sheenColor:{value:new z(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new R},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new R},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new R},transmissionSamplerSize:{value:new I},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new R},attenuationDistance:{value:0},attenuationColor:{value:new z(0)},specularColor:{value:new z(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new R},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new R},anisotropyVector:{value:new I},anisotropyMap:{value:null},anisotropyMapTransform:{value:new R}}]),vertexShader:B.meshphysical_vert,fragmentShader:B.meshphysical_frag},fl={r:0,b:0,g:0},pl=new Nn,ml=new R,ml.set(-1,0,0,0,1,0,0,0,1),hl=4,gl=[.125,.215,.35,.446,.526,.582],_l=20,vl=256,yl=new Po,bl=new z,xl=null,Sl=0,Cl=0,wl=!1,Tl=new L,El=class{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._sizeLods=[],this._sigmas=[],this._lodMeshes=[],this._backgroundBox=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._blurMaterial=null,this._ggxMaterial=null}fromScene(e,t=0,n=.1,r=100,i={}){let{size:a=256,position:o=Tl}=i;xl=this._renderer.getRenderTarget(),Sl=this._renderer.getActiveCubeFace(),Cl=this._renderer.getActiveMipmapLevel(),wl=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(a);let s=this._allocateTargets();return s.depthBuffer=!0,this._sceneToCubeUV(e,n,r,s,o),t>0&&this._blur(s,0,0,t),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=ys(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=vs(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose(),this._backgroundBox!==null&&(this._backgroundBox.geometry.dispose(),this._backgroundBox.material.dispose())}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=2**this._lodMax}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._ggxMaterial!==null&&this._ggxMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodMeshes.length;e++)this._lodMeshes[e].geometry.dispose()}_cleanup(e){this._renderer.setRenderTarget(xl,Sl,Cl),this._renderer.xr.enabled=wl,e.scissorTest=!1,hs(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===301||e.mapping===302?this._setSize(e.image.length===0?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),xl=this._renderer.getRenderTarget(),Sl=this._renderer.getActiveCubeFace(),Cl=this._renderer.getActiveMipmapLevel(),wl=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;let n=t||this._allocateTargets();return this._textureToCubeUV(e,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){let e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,n={magFilter:F,minFilter:F,generateMipmaps:!1,type:We,format:Qe,colorSpace:Qt,depthBuffer:!1},r=ms(e,t,n);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=ms(e,t,n);let{_lodMax:r}=this;({lodMeshes:this._lodMeshes,sizeLods:this._sizeLods,sigmas:this._sigmas}=ps(r)),this._blurMaterial=_s(r,e,t),this._ggxMaterial=gs(r,e,t)}return r}_compileMaterial(e){let t=new Ni(new si,e);this._renderer.compile(t,yl)}_sceneToCubeUV(e,t,n,r,i){let a=new ko(90,1,t,n),o=[1,-1,1,1,1,1],s=[1,1,1,-1,-1,-1],c=this._renderer,l=c.autoClear,u=c.toneMapping;c.getClearColor(bl),c.toneMapping=0,c.autoClear=!1,c.state.buffers.depth.getReversed()&&(c.setRenderTarget(r),c.clearDepth(),c.setRenderTarget(null)),this._backgroundBox===null&&(this._backgroundBox=new Ni(new Fa,new xi({name:`PMREM.Background`,side:1,depthWrite:!1,depthTest:!1})));let d=this._backgroundBox,f=d.material,p=!1,m=e.background;m?m.isColor&&(f.color.copy(m),e.background=null,p=!0):(f.color.copy(bl),p=!0);for(let t=0;t<6;t++){let n=t%3;n===0?(a.up.set(0,o[t],0),a.position.set(i.x,i.y,i.z),a.lookAt(i.x+s[t],i.y,i.z)):n===1?(a.up.set(0,0,o[t]),a.position.set(i.x,i.y,i.z),a.lookAt(i.x,i.y+s[t],i.z)):(a.up.set(0,o[t],0),a.position.set(i.x,i.y,i.z),a.lookAt(i.x,i.y,i.z+s[t]));let l=this._cubeSize;hs(r,n*l,t>2?l:0,l,l),c.setRenderTarget(r),p&&c.render(d,a),c.render(e,a)}c.toneMapping=u,c.autoClear=l,e.background=m}_textureToCubeUV(e,t){let n=this._renderer,r=e.mapping===301||e.mapping===302;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=ys()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=vs());let i=r?this._cubemapMaterial:this._equirectMaterial,a=this._lodMeshes[0];a.material=i;let o=i.uniforms;o.envMap.value=e;let s=this._cubeSize;hs(t,0,0,3*s,2*s),n.setRenderTarget(t),n.render(a,yl)}_applyPMREM(e){let t=this._renderer,n=t.autoClear;t.autoClear=!1;let r=this._lodMeshes.length;for(let t=1;t<r;t++)this._applyGGXFilter(e,t-1,t);t.autoClear=n}_applyGGXFilter(e,t,n){let r=this._renderer,i=this._pingPongRenderTarget,a=this._ggxMaterial,o=this._lodMeshes[n];o.material=a;let s=a.uniforms,c=n/(this._lodMeshes.length-1),l=t/(this._lodMeshes.length-1),u=Math.sqrt(c*c-l*l)*(0+c*1.25),{_lodMax:d}=this,f=this._sizeLods[n],p=3*f*(n>d-hl?n-d+hl:0),m=4*(this._cubeSize-f);s.envMap.value=e.texture,s.roughness.value=u,s.mipInt.value=d-t,hs(i,p,m,3*f,2*f),r.setRenderTarget(i),r.render(o,yl),s.envMap.value=i.texture,s.roughness.value=0,s.mipInt.value=d-n,hs(e,p,m,3*f,2*f),r.setRenderTarget(e),r.render(o,yl)}_blur(e,t,n,r,i){let a=this._pingPongRenderTarget;this._halfBlur(e,a,t,n,r,`latitudinal`,i),this._halfBlur(a,e,n,n,r,`longitudinal`,i)}_halfBlur(e,t,n,r,i,a,o){let s=this._renderer,c=this._blurMaterial;a!==`latitudinal`&&a!==`longitudinal`&&f(`blur direction must be either latitudinal or longitudinal!`);let l=this._lodMeshes[r];l.material=c;let u=c.uniforms,p=this._sizeLods[n]-1,m=isFinite(i)?Math.PI/(2*p):2*Math.PI/39,h=i/m,g=isFinite(i)?1+Math.floor(3*h):_l;g>_l&&d(`sigmaRadians, ${i}, is too large and will clip, as it requested ${g} samples when the maximum is set to ${_l}`);let _=[],v=0;for(let e=0;e<_l;++e){let t=e/h,n=Math.exp(-t*t/2);_.push(n),e===0?v+=n:e<g&&(v+=2*n)}for(let e=0;e<_.length;e++)_[e]=_[e]/v;u.envMap.value=e.texture,u.samples.value=g,u.weights.value=_,u.latitudinal.value=a===`latitudinal`,o&&(u.poleAxis.value=o);let{_lodMax:y}=this;u.dTheta.value=m,u.mipInt.value=y-n;let b=this._sizeLods[r];hs(t,3*b*(r>y-hl?r-y+hl:0),4*(this._cubeSize-b),3*b,2*b),s.setRenderTarget(t),s.render(l,yl)}},Dl=class extends An{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;let n={width:e,height:e,depth:1},r=[n,n,n,n,n,n];this.texture=new ja(r),this._setTextureOptions(t),this.texture.isRenderTargetTexture=!0}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;let n={uniforms:{tEquirect:{value:null}},vertexShader:`\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include <begin_vertex>\n\t\t\t\t\t#include <project_vertex>\n\n\t\t\t\t}\n\t\t\t`,fragmentShader:`\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include <common>\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t`},r=new Fa(5,5,5),i=new Ba({name:`CubemapFromEquirect`,uniforms:he(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:1,blending:0});i.uniforms.tEquirect.value=t;let a=new Ni(r,i),o=t.minFilter;return t.minFilter===1008&&(t.minFilter=F),new Uo(1,10,this).update(e,a),t.minFilter=o,a.geometry.dispose(),a.material.dispose(),this}clear(e,t=!0,n=!0,r=!0){let i=e.getRenderTarget();for(let i=0;i<6;i++)e.setRenderTarget(this,i),e.clear(t,n,r);e.setRenderTarget(i)}},Ol={1:`LINEAR_TONE_MAPPING`,2:`REINHARD_TONE_MAPPING`,3:`CINEON_TONE_MAPPING`,4:`ACES_FILMIC_TONE_MAPPING`,6:`AGX_TONE_MAPPING`,7:`NEUTRAL_TONE_MAPPING`,5:`CUSTOM_TONE_MAPPING`},kl=new Dn,Al=new Ma(1,1),jl=new jn,Ml=new Mn,Nl=new ja,Pl=[],Fl=[],Il=new Float32Array(16),Ll=new Float32Array(9),Rl=new Float32Array(4),zl=class{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.setValue=Qs(t.type)}},Bl=class{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.size=t.size,this.setValue=vc(t.type)}},Vl=class{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,t,n){let r=this.seq;for(let i=0,a=r.length;i!==a;++i){let a=r[i];a.setValue(e,t[a.id],n)}}},Hl=/(\\w+)(\\])?(\\[|\\.)?/g,Ul=class{constructor(e,t){this.seq=[],this.map={};let n=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let r=0;r<n;++r){let n=e.getActiveUniform(t,r);bc(n,e.getUniformLocation(t,n.name),this)}let r=[],i=[];for(let t of this.seq)t.type===e.SAMPLER_2D_SHADOW||t.type===e.SAMPLER_CUBE_SHADOW||t.type===e.SAMPLER_2D_ARRAY_SHADOW?r.push(t):i.push(t);r.length>0&&(this.seq=r.concat(i))}setValue(e,t,n,r){let i=this.map[t];i!==void 0&&i.setValue(e,n,r)}setOptional(e,t,n){let r=t[n];r!==void 0&&this.setValue(e,n,r)}static upload(e,t,n,r){for(let i=0,a=t.length;i!==a;++i){let a=t[i],o=n[a.id];o.needsUpdate!==!1&&a.setValue(e,o.value,r)}}static seqWithValue(e,t){let n=[];for(let r=0,i=e.length;r!==i;++r){let i=e[r];i.id in t&&n.push(i)}return n}},Wl=37297,Gl=0,Kl=new R,ql={1:`Linear`,2:`Reinhard`,3:`Cineon`,4:`ACESFilmic`,6:`AgX`,7:`Neutral`,5:`Custom`},Jl=new L,Yl=/^[ \\t]*#include +<([\\w\\d./]+)>/gm,Xl=new Map,Zl=/#pragma unroll_loop_start\\s+for\\s*\\(\\s*int\\s+i\\s*=\\s*(\\d+)\\s*;\\s*i\\s*<\\s*(\\d+)\\s*;\\s*i\\s*\\+\\+\\s*\\)\\s*{([\\s\\S]+?)}\\s+#pragma unroll_loop_end/g,Ql={1:`SHADOWMAP_TYPE_PCF`,3:`SHADOWMAP_TYPE_VSM`},$l={301:`ENVMAP_TYPE_CUBE`,302:`ENVMAP_TYPE_CUBE`,306:`ENVMAP_TYPE_CUBE_UV`},eu={302:`ENVMAP_MODE_REFRACTION`},tu={0:`ENVMAP_BLENDING_MULTIPLY`,1:`ENVMAP_BLENDING_MIX`,2:`ENVMAP_BLENDING_ADD`},nu=0,ru=class{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e,t,n){let r=this._getShaderCacheForMaterial(e);return r.has(t)===!1&&(r.add(t),t.usedTimes++),r.has(n)===!1&&(r.add(n),n.usedTimes++),this}remove(e){let t=this.materialCache.get(e);for(let e of t)e.usedTimes--,e.usedTimes===0&&this.shaderCache.delete(e.code);return this.materialCache.delete(e),this}getVertexShaderStage(e){return this._getShaderStage(e.vertexShader)}getFragmentShaderStage(e){return this._getShaderStage(e.fragmentShader)}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){let t=this.materialCache,n=t.get(e);return n===void 0&&(n=new Set,t.set(e,n)),n}_getShaderStage(e){let t=this.shaderCache,n=t.get(e);return n===void 0&&(n=new iu(e),t.set(e,n)),n}},iu=class{constructor(e){this.id=nu++,this.code=e,this.usedTimes=0}},au=0,ou=`void main() {\n\tgl_Position = vec4( position, 1.0 );\n}`,su=`uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\nvoid main() {\n\tconst float samples = float( VSM_SAMPLES );\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n\tfloat uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n\tfor ( float i = 0.0; i < samples; i ++ ) {\n\t\tfloat uvOffset = uvStart + i * uvStride;\n\t\t#ifdef HORIZONTAL_PASS\n\t\t\tvec2 distribution = texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ).rg;\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ).r;\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean / samples;\n\tsquared_mean = squared_mean / samples;\n\tfloat std_dev = sqrt( max( 0.0, squared_mean - mean * mean ) );\n\tgl_FragColor = vec4( mean, std_dev, 0.0, 1.0 );\n}`,cu=[new L(1,0,0),new L(-1,0,0),new L(0,1,0),new L(0,-1,0),new L(0,0,1),new L(0,0,-1)],lu=[new L(0,-1,0),new L(0,-1,0),new L(0,0,1),new L(0,0,-1),new L(0,-1,0),new L(0,-1,0)],uu=new Nn,du=new L,fu=new L,pu=`\nvoid main() {\n\n\tgl_Position = vec4( position, 1.0 );\n\n}`,mu=`\nuniform sampler2DArray depthColor;\nuniform float depthWidth;\nuniform float depthHeight;\n\nvoid main() {\n\n\tvec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight );\n\n\tif ( coord.x >= 1.0 ) {\n\n\t\tgl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r;\n\n\t} else {\n\n\t\tgl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r;\n\n\t}\n\n}`,hu=class{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t){if(this.texture===null){let n=new Pa(e.texture);(e.depthNear!==t.depthNear||e.depthFar!==t.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=n}}getMesh(e){if(this.texture!==null&&this.mesh===null){let t=e.cameras[0].viewport,n=new Ba({vertexShader:pu,fragmentShader:mu,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new Ni(new Ia(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}},gu=class extends cn{constructor(e,t){super();let n=this,r=null,i=1,a=null,o=`local-floor`,s=1,c=null,l=null,u=null,f=null,p=null,m=null,h=typeof XRWebGLBinding<`u`,g=new hu,_={},v=t.getContextAttributes(),y=null,b=null,x=[],S=[],C=new I,w=null,T=new ko;T.viewport=new On;let E=new ko;E.viewport=new On;let D=[T,E],O=new Wo,ee=null,k=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(e){let t=x[e];return t===void 0&&(t=new lr,x[e]=t),t.getTargetRaySpace()},this.getControllerGrip=function(e){let t=x[e];return t===void 0&&(t=new lr,x[e]=t),t.getGripSpace()},this.getHand=function(e){let t=x[e];return t===void 0&&(t=new lr,x[e]=t),t.getHandSpace()};function te(e){let t=S.indexOf(e.inputSource);if(t===-1)return;let n=x[t];n!==void 0&&(n.update(e.inputSource,e.frame,c||a),n.dispatchEvent({type:e.type,data:e.inputSource}))}function ne(){r.removeEventListener(`select`,te),r.removeEventListener(`selectstart`,te),r.removeEventListener(`selectend`,te),r.removeEventListener(`squeeze`,te),r.removeEventListener(`squeezestart`,te),r.removeEventListener(`squeezeend`,te),r.removeEventListener(`end`,ne),r.removeEventListener(`inputsourceschange`,re);for(let e=0;e<x.length;e++){let t=S[e];t!==null&&(S[e]=null,x[e].disconnect(t))}ee=null,k=null,g.reset();for(let e in _)delete _[e];e.setRenderTarget(y),p=null,f=null,u=null,r=null,b=null,le.stop(),n.isPresenting=!1,e.setPixelRatio(w),e.setSize(C.width,C.height,!1),n.dispatchEvent({type:`sessionend`})}this.setFramebufferScaleFactor=function(e){i=e,n.isPresenting===!0&&d(`WebXRManager: Cannot change framebuffer scale while presenting.`)},this.setReferenceSpaceType=function(e){o=e,n.isPresenting===!0&&d(`WebXRManager: Cannot change reference space type while presenting.`)},this.getReferenceSpace=function(){return c||a},this.setReferenceSpace=function(e){c=e},this.getBaseLayer=function(){return f===null?p:f},this.getBinding=function(){return u===null&&h&&(u=new XRWebGLBinding(r,t)),u},this.getFrame=function(){return m},this.getSession=function(){return r},this.setSession=async function(l){if(r=l,r!==null){if(y=e.getRenderTarget(),r.addEventListener(`select`,te),r.addEventListener(`selectstart`,te),r.addEventListener(`selectend`,te),r.addEventListener(`squeeze`,te),r.addEventListener(`squeezestart`,te),r.addEventListener(`squeezeend`,te),r.addEventListener(`end`,ne),r.addEventListener(`inputsourceschange`,re),v.xrCompatible!==!0&&await t.makeXRCompatible(),w=e.getPixelRatio(),e.getSize(C),h&&`createProjectionLayer`in XRWebGLBinding.prototype){let n=null,a=null,o=null;v.depth&&(o=v.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,n=v.stencil?et:$e,a=v.stencil?qe:He);let s={colorFormat:t.RGBA8,depthFormat:o,scaleFactor:i};u=this.getBinding(),f=u.createProjectionLayer(s),r.updateRenderState({layers:[f]}),e.setPixelRatio(1),e.setSize(f.textureWidth,f.textureHeight,!1),b=new An(f.textureWidth,f.textureHeight,{format:Qe,type:Le,depthTexture:new Ma(f.textureWidth,f.textureHeight,a,void 0,void 0,void 0,void 0,void 0,void 0,n),stencilBuffer:v.stencil,colorSpace:e.outputColorSpace,samples:v.antialias?4:0,resolveDepthBuffer:f.ignoreDepthValues===!1,resolveStencilBuffer:f.ignoreDepthValues===!1})}else{let n={antialias:v.antialias,alpha:!0,depth:v.depth,stencil:v.stencil,framebufferScaleFactor:i};p=new XRWebGLLayer(r,t,n),r.updateRenderState({baseLayer:p}),e.setPixelRatio(1),e.setSize(p.framebufferWidth,p.framebufferHeight,!1),b=new An(p.framebufferWidth,p.framebufferHeight,{format:Qe,type:Le,colorSpace:e.outputColorSpace,stencilBuffer:v.stencil,resolveDepthBuffer:p.ignoreDepthValues===!1,resolveStencilBuffer:p.ignoreDepthValues===!1})}b.isXRRenderTarget=!0,this.setFoveation(s),c=null,a=await r.requestReferenceSpace(o),le.setContext(r),le.start(),n.isPresenting=!0,n.dispatchEvent({type:`sessionstart`})}},this.getEnvironmentBlendMode=function(){if(r!==null)return r.environmentBlendMode},this.getDepthTexture=function(){return g.getDepthTexture()};function re(e){for(let t=0;t<e.removed.length;t++){let n=e.removed[t],r=S.indexOf(n);r>=0&&(S[r]=null,x[r].disconnect(n))}for(let t=0;t<e.added.length;t++){let n=e.added[t],r=S.indexOf(n);if(r===-1){for(let e=0;e<x.length;e++)if(e>=S.length){S.push(n),r=e;break}else if(S[e]===null){S[e]=n,r=e;break}if(r===-1)break}let i=x[r];i&&i.connect(n)}}let ie=new L,ae=new L;function A(e,t,n){ie.setFromMatrixPosition(t.matrixWorld),ae.setFromMatrixPosition(n.matrixWorld);let r=ie.distanceTo(ae),i=t.projectionMatrix.elements,a=n.projectionMatrix.elements,o=i[14]/(i[10]-1),s=i[14]/(i[10]+1),c=(i[9]+1)/i[5],l=(i[9]-1)/i[5],u=(i[8]-1)/i[0],d=(a[8]+1)/a[0],f=o*u,p=o*d,m=r/(-u+d),h=m*-u;if(t.matrixWorld.decompose(e.position,e.quaternion,e.scale),e.translateX(h),e.translateZ(m),e.matrixWorld.compose(e.position,e.quaternion,e.scale),e.matrixWorldInverse.copy(e.matrixWorld).invert(),i[10]===-1)e.projectionMatrix.copy(t.projectionMatrix),e.projectionMatrixInverse.copy(t.projectionMatrixInverse);else{let t=o+m,n=s+m,i=f-h,a=p+(r-h),u=c*s/n*t,d=l*s/n*t;e.projectionMatrix.makePerspective(i,a,u,d,t,n),e.projectionMatrixInverse.copy(e.projectionMatrix).invert()}}function oe(e,t){t===null?e.matrixWorld.copy(e.matrix):e.matrixWorld.multiplyMatrices(t.matrixWorld,e.matrix),e.matrixWorldInverse.copy(e.matrixWorld).invert()}this.updateCamera=function(e){if(r===null)return;let t=e.near,n=e.far;g.texture!==null&&(g.depthNear>0&&(t=g.depthNear),g.depthFar>0&&(n=g.depthFar)),O.near=E.near=T.near=t,O.far=E.far=T.far=n,(ee!==O.near||k!==O.far)&&(r.updateRenderState({depthNear:O.near,depthFar:O.far}),ee=O.near,k=O.far),O.layers.mask=e.layers.mask|6,T.layers.mask=O.layers.mask&-5,E.layers.mask=O.layers.mask&-3;let i=e.parent,a=O.cameras;oe(O,i);for(let e=0;e<a.length;e++)oe(a[e],i);a.length===2?A(O,T,E):O.projectionMatrix.copy(T.projectionMatrix),j(e,O,i)};function j(e,t,n){n===null?e.matrix.copy(t.matrixWorld):(e.matrix.copy(n.matrixWorld),e.matrix.invert(),e.matrix.multiply(t.matrixWorld)),e.matrix.decompose(e.position,e.quaternion,e.scale),e.updateMatrixWorld(!0),e.projectionMatrix.copy(t.projectionMatrix),e.projectionMatrixInverse.copy(t.projectionMatrixInverse),e.isPerspectiveCamera&&(e.fov=fn*2*Math.atan(1/e.projectionMatrix.elements[5]),e.zoom=1)}this.getCamera=function(){return O},this.getFoveation=function(){if(f!==null||p!==null)return s},this.setFoveation=function(e){s=e,f!==null&&(f.fixedFoveation=e),p!==null&&p.fixedFoveation!==void 0&&(p.fixedFoveation=e)},this.hasDepthSensing=function(){return g.texture!==null},this.getDepthSensingMesh=function(){return g.getMesh(O)},this.getCameraTexture=function(e){return _[e]};let se=null;function ce(t,i){if(l=i.getViewerPose(c||a),m=i,l!==null){let t=l.views;p!==null&&(e.setRenderTargetFramebuffer(b,p.framebuffer),e.setRenderTarget(b));let i=!1;t.length!==O.cameras.length&&(O.cameras.length=0,i=!0);for(let n=0;n<t.length;n++){let r=t[n],a=null;if(p!==null)a=p.getViewport(r);else{let t=u.getViewSubImage(f,r);a=t.viewport,n===0&&(e.setRenderTargetTextures(b,t.colorTexture,t.depthStencilTexture),e.setRenderTarget(b))}let o=D[n];o===void 0&&(o=new ko,o.layers.enable(n),o.viewport=new On,D[n]=o),o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.quaternion,o.scale),o.projectionMatrix.fromArray(r.projectionMatrix),o.projectionMatrixInverse.copy(o.projectionMatrix).invert(),o.viewport.set(a.x,a.y,a.width,a.height),n===0&&(O.matrix.copy(o.matrix),O.matrix.decompose(O.position,O.quaternion,O.scale)),i===!0&&O.cameras.push(o)}let a=r.enabledFeatures;if(a&&a.includes(`depth-sensing`)&&r.depthUsage==`gpu-optimized`&&h){u=n.getBinding();let e=u.getDepthInformation(t[0]);e&&e.isValid&&e.texture&&g.init(e,r.renderState)}if(a&&a.includes(`camera-access`)&&h){e.state.unbindTexture(),u=n.getBinding();for(let e=0;e<t.length;e++){let n=t[e].camera;if(n){let e=_[n];e||(e=new Pa,_[n]=e);let t=u.getCameraImage(n);e.sourceTexture=t}}}}for(let e=0;e<x.length;e++){let t=S[e],n=x[e];t!==null&&n!==void 0&&n.update(t,i,c||a)}se&&se(t,i),i.detectedPlanes&&n.dispatchEvent({type:`planesdetected`,data:i}),m=null}let le=new os;le.setAnimationLoop(ce),this.setAnimationLoop=function(e){se=e},this.dispose=function(){}}},_u=new Nn,vu=new R,vu.set(-1,0,0,0,1,0,0,0,1),yu=new Uint16Array([12469,15057,12620,14925,13266,14620,13807,14376,14323,13990,14545,13625,14713,13328,14840,12882,14931,12528,14996,12233,15039,11829,15066,11525,15080,11295,15085,10976,15082,10705,15073,10495,13880,14564,13898,14542,13977,14430,14158,14124,14393,13732,14556,13410,14702,12996,14814,12596,14891,12291,14937,11834,14957,11489,14958,11194,14943,10803,14921,10506,14893,10278,14858,9960,14484,14039,14487,14025,14499,13941,14524,13740,14574,13468,14654,13106,14743,12678,14818,12344,14867,11893,14889,11509,14893,11180,14881,10751,14852,10428,14812,10128,14765,9754,14712,9466,14764,13480,14764,13475,14766,13440,14766,13347,14769,13070,14786,12713,14816,12387,14844,11957,14860,11549,14868,11215,14855,10751,14825,10403,14782,10044,14729,9651,14666,9352,14599,9029,14967,12835,14966,12831,14963,12804,14954,12723,14936,12564,14917,12347,14900,11958,14886,11569,14878,11247,14859,10765,14828,10401,14784,10011,14727,9600,14660,9289,14586,8893,14508,8533,15111,12234,15110,12234,15104,12216,15092,12156,15067,12010,15028,11776,14981,11500,14942,11205,14902,10752,14861,10393,14812,9991,14752,9570,14682,9252,14603,8808,14519,8445,14431,8145,15209,11449,15208,11451,15202,11451,15190,11438,15163,11384,15117,11274,15055,10979,14994,10648,14932,10343,14871,9936,14803,9532,14729,9218,14645,8742,14556,8381,14461,8020,14365,7603,15273,10603,15272,10607,15267,10619,15256,10631,15231,10614,15182,10535,15118,10389,15042,10167,14963,9787,14883,9447,14800,9115,14710,8665,14615,8318,14514,7911,14411,7507,14279,7198,15314,9675,15313,9683,15309,9712,15298,9759,15277,9797,15229,9773,15166,9668,15084,9487,14995,9274,14898,8910,14800,8539,14697,8234,14590,7790,14479,7409,14367,7067,14178,6621,15337,8619,15337,8631,15333,8677,15325,8769,15305,8871,15264,8940,15202,8909,15119,8775,15022,8565,14916,8328,14804,8009,14688,7614,14569,7287,14448,6888,14321,6483,14088,6171,15350,7402,15350,7419,15347,7480,15340,7613,15322,7804,15287,7973,15229,8057,15148,8012,15046,7846,14933,7611,14810,7357,14682,7069,14552,6656,14421,6316,14251,5948,14007,5528,15356,5942,15356,5977,15353,6119,15348,6294,15332,6551,15302,6824,15249,7044,15171,7122,15070,7050,14949,6861,14818,6611,14679,6349,14538,6067,14398,5651,14189,5311,13935,4958,15359,4123,15359,4153,15356,4296,15353,4646,15338,5160,15311,5508,15263,5829,15188,6042,15088,6094,14966,6001,14826,5796,14678,5543,14527,5287,14377,4985,14133,4586,13869,4257,15360,1563,15360,1642,15358,2076,15354,2636,15341,3350,15317,4019,15273,4429,15203,4732,15105,4911,14981,4932,14836,4818,14679,4621,14517,4386,14359,4156,14083,3795,13808,3437,15360,122,15360,137,15358,285,15355,636,15344,1274,15322,2177,15281,2765,15215,3223,15120,3451,14995,3569,14846,3567,14681,3466,14511,3305,14344,3121,14037,2800,13753,2467,15360,0,15360,1,15359,21,15355,89,15346,253,15325,479,15287,796,15225,1148,15133,1492,15008,1749,14856,1882,14685,1886,14506,1783,14324,1608,13996,1398,13702,1183]),bu=null,xu=class{constructor(e={}){let{canvas:t=c(),context:n=null,depth:r=!0,stencil:i=!1,alpha:a=!1,antialias:o=!1,premultipliedAlpha:s=!0,preserveDrawingBuffer:u=!1,powerPreference:p=`default`,failIfMajorPerformanceCaveat:h=!1,reversedDepthBuffer:g=!1,outputBufferType:_=Le}=e;this.isWebGLRenderer=!0;let v;if(n!==null){if(typeof WebGLRenderingContext<`u`&&n instanceof WebGLRenderingContext)throw Error(`THREE.WebGLRenderer: WebGL 1 is not supported since r163.`);v=n.getContextAttributes().alpha}else v=a;let y=_,b=new Set([at,it,nt]),x=new Set([Le,He,Be,qe,Ge,Ke]),S=new Uint32Array(4),C=new Int32Array(4),w=new L,T=null,E=null,D=[],O=[],ee=null;this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=0,this.toneMappingExposure=1,this.transmissionResolutionScale=1;let k=this,te=!1,ne=null,re=null,ie=null,ae=null;this._outputColorSpace=Zt;let A=0,oe=0,j=null,se=-1,ce=null,le=new On,ue=new On,de=null,fe=new z(0),pe=0,me=t.width,he=t.height,ge=1,_e=null,ve=null,ye=new On(0,0,me,he),be=new On(0,0,me,he),xe=!1,Se=new da,Ce=!1,we=!1,Te=new Nn,Ee=new L,De=new On,Oe={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0},ke=!1;function Ae(){return j===null?ge:1}let M=n;function je(e,n){return t.getContext(e,n)}try{let e={alpha:!0,depth:r,stencil:i,antialias:o,premultipliedAlpha:s,preserveDrawingBuffer:u,powerPreference:p,failIfMajorPerformanceCaveat:h};if(`setAttribute`in t&&t.setAttribute(`data-engine`,`three.js r185`),t.addEventListener(`webglcontextlost`,dt,!1),t.addEventListener(`webglcontextrestored`,ft,!1),t.addEventListener(`webglcontextcreationerror`,pt,!1),M===null){let t=`webgl2`;if(M=je(t,e),M===null)throw je(t)?Error(`THREE.WebGLRenderer: Error creating WebGL context with your selected attributes.`):Error(`THREE.WebGLRenderer: Error creating WebGL context.`)}}catch(e){throw f(`WebGLRenderer: `+e.message),e}let Me,Ne,N,Pe,P,F,Fe,Re,ze,Ve,Ue,Je,Ye,Xe,Ze,Qe,$e,et,tt,rt,ot,st,ct;function lt(){Me=new Ss(M),Me.init(),ot=new sl(M,Me),Ne=new ds(M,Me,e,ot),N=new al(M,Me),Ne.reversedDepthBuffer&&g&&N.buffers.depth.setReversed(!0),re=M.createFramebuffer(),ie=M.createFramebuffer(),ae=M.createFramebuffer(),Pe=new Ts(M),P=new qc,F=new ol(M,Me,N,P,Ne,ot,Pe),Fe=new xs(k),Re=new ss(M),st=new ls(M,Re),ze=new Cs(M,Re,Pe,st),Ve=new Ds(M,ze,Re,st,Pe),et=new Es(M,Ne,F),Ze=new fs(P),Ue=new Kc(k,Fe,Me,Ne,st,Ze),Je=new cl(k,P),Ye=new Zc,Xe=new rl(Me),$e=new cs(k,Fe,N,Ve,v,s),Qe=new il(k,Ve,Ne),ct=new ll(M,Pe,Ne,N),tt=new us(M,Me,Pe),rt=new ws(M,Me,Pe),Pe.programs=Ue.programs,k.capabilities=Ne,k.extensions=Me,k.properties=P,k.renderLists=Ye,k.shadowMap=Qe,k.state=N,k.info=Pe}lt(),y!==1009&&(ee=new Os(y,t.width,t.height,o,r,i));let ut=new gu(k,M);this.xr=ut,this.getContext=function(){return M},this.getContextAttributes=function(){return M.getContextAttributes()},this.forceContextLoss=function(){let e=Me.get(`WEBGL_lose_context`);e&&e.loseContext()},this.forceContextRestore=function(){let e=Me.get(`WEBGL_lose_context`);e&&e.restoreContext()},this.getPixelRatio=function(){return ge},this.setPixelRatio=function(e){e!==void 0&&(ge=e,this.setSize(me,he,!1))},this.getSize=function(e){return e.set(me,he)},this.setSize=function(e,n,r=!0){if(ut.isPresenting){d(`WebGLRenderer: Can't change size while VR device is presenting.`);return}me=e,he=n,t.width=Math.floor(e*ge),t.height=Math.floor(n*ge),r===!0&&(t.style.width=e+`px`,t.style.height=n+`px`),ee!==null&&ee.setSize(t.width,t.height),this.setViewport(0,0,e,n)},this.getDrawingBufferSize=function(e){return e.set(me*ge,he*ge).floor()},this.setDrawingBufferSize=function(e,n,r){me=e,he=n,ge=r,t.width=Math.floor(e*r),t.height=Math.floor(n*r),this.setViewport(0,0,e,n)},this.setEffects=function(e){if(y===1009){f(`WebGLRenderer: setEffects() requires outputBufferType set to HalfFloatType or FloatType.`);return}if(e){for(let t=0;t<e.length;t++)if(e[t].isOutputPass===!0){d(`WebGLRenderer: OutputPass is not needed in setEffects(). Tone mapping and color space conversion are applied automatically.`);break}}ee.setEffects(e||[])},this.getCurrentViewport=function(e){return e.copy(le)},this.getViewport=function(e){return e.copy(ye)},this.setViewport=function(e,t,n,r){e.isVector4?ye.set(e.x,e.y,e.z,e.w):ye.set(e,t,n,r),N.viewport(le.copy(ye).multiplyScalar(ge).round())},this.getScissor=function(e){return e.copy(be)},this.setScissor=function(e,t,n,r){e.isVector4?be.set(e.x,e.y,e.z,e.w):be.set(e,t,n,r),N.scissor(ue.copy(be).multiplyScalar(ge).round())},this.getScissorTest=function(){return xe},this.setScissorTest=function(e){N.setScissorTest(xe=e)},this.setOpaqueSort=function(e){_e=e},this.setTransparentSort=function(e){ve=e},this.getClearColor=function(e){return e.copy($e.getClearColor())},this.setClearColor=function(){$e.setClearColor(...arguments)},this.getClearAlpha=function(){return $e.getClearAlpha()},this.setClearAlpha=function(){$e.setClearAlpha(...arguments)},this.clear=function(e=!0,t=!0,n=!0){let r=0;if(e){let e=!1;if(j!==null){let t=j.texture.format;e=b.has(t)}if(e){let e=j.texture.type,t=x.has(e),n=$e.getClearColor(),r=$e.getClearAlpha(),i=n.r,a=n.g,o=n.b;t?(S[0]=i,S[1]=a,S[2]=o,S[3]=r,M.clearBufferuiv(M.COLOR,0,S)):(C[0]=i,C[1]=a,C[2]=o,C[3]=r,M.clearBufferiv(M.COLOR,0,C))}else r|=M.COLOR_BUFFER_BIT}t&&(r|=M.DEPTH_BUFFER_BIT,this.state.buffers.depth.setMask(!0)),n&&(r|=M.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),r!==0&&M.clear(r)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.setNodesHandler=function(e){e.setRenderer(this),ne=e},this.dispose=function(){t.removeEventListener(`webglcontextlost`,dt,!1),t.removeEventListener(`webglcontextrestored`,ft,!1),t.removeEventListener(`webglcontextcreationerror`,pt,!1),$e.dispose(),Ye.dispose(),Xe.dispose(),P.dispose(),Fe.dispose(),Ve.dispose(),st.dispose(),ct.dispose(),Ue.dispose(),ut.dispose(),ut.removeEventListener(`sessionstart`,bt),ut.removeEventListener(`sessionend`,xt),St.stop()};function dt(e){e.preventDefault(),l(`WebGLRenderer: Context Lost.`),te=!0}function ft(){l(`WebGLRenderer: Context Restored.`),te=!1;let e=Pe.autoReset,t=Qe.enabled,n=Qe.autoUpdate,r=Qe.needsUpdate,i=Qe.type;lt(),Pe.autoReset=e,Qe.enabled=t,Qe.autoUpdate=n,Qe.needsUpdate=r,Qe.type=i}function pt(e){f(`WebGLRenderer: A WebGL context could not be created. Reason: `,e.statusMessage)}function mt(e){let t=e.target;t.removeEventListener(`dispose`,mt),ht(t)}function ht(e){gt(e),P.remove(e)}function gt(e){let t=P.get(e).programs;t!==void 0&&(t.forEach(function(e){Ue.releaseProgram(e)}),e.isShaderMaterial&&Ue.releaseShaderCache(e))}this.renderBufferDirect=function(e,t,n,r,i,a){t===null&&(t=Oe);let o=i.isMesh&&i.matrixWorld.determinantAffine()<0,s=Mt(e,t,n,r,i);N.setMaterial(r,o);let c=n.index,l=1;if(r.wireframe===!0){if(c=ze.getWireframeAttribute(n),c===void 0)return;l=2}let u=n.drawRange,d=n.attributes.position,f=u.start*l,p=(u.start+u.count)*l;a!==null&&(f=Math.max(f,a.start*l),p=Math.min(p,(a.start+a.count)*l)),c===null?d!=null&&(f=Math.max(f,0),p=Math.min(p,d.count)):(f=Math.max(f,0),p=Math.min(p,c.count));let m=p-f;if(m<0||m===1/0)return;st.setup(i,r,s,n,c);let h,g=tt;if(c!==null&&(h=Re.get(c),g=rt,g.setIndex(h)),i.isMesh)r.wireframe===!0?(N.setLineWidth(r.wireframeLinewidth*Ae()),g.setMode(M.LINES)):g.setMode(M.TRIANGLES);else if(i.isLine){let e=r.linewidth;e===void 0&&(e=1),N.setLineWidth(e*Ae()),i.isLineSegments?g.setMode(M.LINES):i.isLineLoop?g.setMode(M.LINE_LOOP):g.setMode(M.LINE_STRIP)}else i.isPoints?g.setMode(M.POINTS):i.isSprite&&g.setMode(M.TRIANGLES);if(i.isBatchedMesh){if(Me.get(`WEBGL_multi_draw`))g.renderMultiDraw(i._multiDrawStarts,i._multiDrawCounts,i._multiDrawCount);else{let e=i._multiDrawStarts,t=i._multiDrawCounts,n=i._multiDrawCount,a=c?Re.get(c).bytesPerElement:1,o=P.get(r).currentProgram.getUniforms();for(let r=0;r<n;r++)o.setValue(M,`_gl_DrawID`,r),g.render(e[r]/a,t[r])}}else if(i.isInstancedMesh)g.renderInstances(f,m,i.count);else if(n.isInstancedBufferGeometry){let e=n._maxInstanceCount===void 0?1/0:n._maxInstanceCount,t=Math.min(n.instanceCount,e);g.renderInstances(f,m,t)}else g.render(f,m)};function _t(e,t,n){e.transparent===!0&&e.side===2&&e.forceSinglePass===!1?(e.side=1,e.needsUpdate=!0,Ot(e,t,n),e.side=0,e.needsUpdate=!0,Ot(e,t,n),e.side=2):Ot(e,t,n)}this.compile=function(e,t,n=null){n===null&&(n=e),E=Xe.get(n),E.init(t),O.push(E),n.traverseVisible(function(e){e.isLight&&e.layers.test(t.layers)&&(E.pushLight(e),e.castShadow&&E.pushShadow(e))}),e!==n&&e.traverseVisible(function(e){e.isLight&&e.layers.test(t.layers)&&(E.pushLight(e),e.castShadow&&E.pushShadow(e))}),E.setupLights();let r=new Set;return e.traverse(function(e){if(!(e.isMesh||e.isPoints||e.isLine||e.isSprite))return;let t=e.material;if(t){if(Array.isArray(t))for(let i=0;i<t.length;i++){let a=t[i];_t(a,n,e),r.add(a)}else _t(t,n,e),r.add(t)}}),E=O.pop(),r},this.compileAsync=function(e,t,n=null){let r=this.compile(e,t,n);return new Promise(t=>{function n(){if(r.forEach(function(e){P.get(e).currentProgram.isReady()&&r.delete(e)}),r.size===0){t(e);return}setTimeout(n,10)}Me.get(`KHR_parallel_shader_compile`)===null?setTimeout(n,10):n()})};let vt=null;function yt(e){vt&&vt(e)}function bt(){St.stop()}function xt(){St.start()}let St=new os;St.setAnimationLoop(yt),typeof self<`u`&&St.setContext(self),this.setAnimationLoop=function(e){vt=e,ut.setAnimationLoop(e),e===null?St.stop():St.start()},ut.addEventListener(`sessionstart`,bt),ut.addEventListener(`sessionend`,xt),this.render=function(e,t){if(t!==void 0&&t.isCamera!==!0){f(`WebGLRenderer.render: camera is not an instance of THREE.Camera.`);return}if(te===!0)return;ne!==null&&ne.renderStart(e,t);let n=ut.enabled===!0&&ut.isPresenting===!0,r=ee!==null&&(j===null||n)&&ee.begin(k,j);if(e.matrixWorldAutoUpdate===!0&&e.updateMatrixWorld(),t.parent===null&&t.matrixWorldAutoUpdate===!0&&t.updateMatrixWorld(),ut.enabled===!0&&ut.isPresenting===!0&&(ee===null||ee.isCompositing()===!1)&&(ut.cameraAutoUpdate===!0&&ut.updateCamera(t),t=ut.getCamera()),e.isScene===!0&&e.onBeforeRender(k,e,t,j),E=Xe.get(e,O.length),E.init(t),E.state.textureUnits=F.getTextureUnits(),O.push(E),Te.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),Se.setFromProjectionMatrix(Te,rn,t.reversedDepth),we=this.localClippingEnabled,Ce=Ze.init(this.clippingPlanes,we),T=Ye.get(e,D.length),T.init(),D.push(T),ut.enabled===!0&&ut.isPresenting===!0){let e=k.xr.getDepthSensingMesh();e!==null&&Ct(e,t,-1/0,k.sortObjects)}Ct(e,t,0,k.sortObjects),T.finish(),k.sortObjects===!0&&T.sort(_e,ve,t.reversedDepth),ke=ut.enabled===!1||ut.isPresenting===!1||ut.hasDepthSensing()===!1,ke&&$e.addToRenderList(T,e),this.info.render.frame++,this.info.autoReset===!0&&this.info.reset(),Ce===!0&&Ze.beginShadows();let i=E.state.shadowsArray;if(Qe.render(i,e,t),Ce===!0&&Ze.endShadows(),(r&&ee.hasRenderPass())===!1){let n=T.opaque,r=T.transmissive;if(E.setupLights(),t.isArrayCamera){let i=t.cameras;if(r.length>0)for(let t=0,a=i.length;t<a;t++){let a=i[t];Tt(n,r,e,a)}ke&&$e.render(e);for(let t=0,n=i.length;t<n;t++){let n=i[t];wt(T,e,n,n.viewport)}}else r.length>0&&Tt(n,r,e,t),ke&&$e.render(e),wt(T,e,t)}j!==null&&oe===0&&(F.updateMultisampleRenderTarget(j),F.updateRenderTargetMipmap(j)),r&&ee.end(k),e.isScene===!0&&e.onAfterRender(k,e,t),st.resetDefaultState(),se=-1,ce=null,O.pop(),O.length>0?(E=O[O.length-1],F.setTextureUnits(E.state.textureUnits),Ce===!0&&Ze.setGlobalState(k.clippingPlanes,E.state.camera)):E=null,D.pop(),T=D.length>0?D[D.length-1]:null,ne!==null&&ne.renderEnd()};function Ct(e,t,n,r){if(e.visible===!1)return;if(e.layers.test(t.layers)){if(e.isGroup)n=e.renderOrder;else if(e.isLOD)e.autoUpdate===!0&&e.update(t);else if(e.isLightProbeGrid)E.pushLightProbeGrid(e);else if(e.isLight)E.pushLight(e),e.castShadow&&E.pushShadow(e);else if(e.isSprite){if(!e.frustumCulled||Se.intersectsSprite(e)){r&&De.setFromMatrixPosition(e.matrixWorld).applyMatrix4(Te);let t=Ve.update(e),i=e.material;i.visible&&T.push(e,t,i,n,De.z,null)}}else if((e.isMesh||e.isLine||e.isPoints)&&(!e.frustumCulled||Se.intersectsObject(e))){let t=Ve.update(e),i=e.material;if(r&&(e.boundingSphere===void 0?(t.boundingSphere===null&&t.computeBoundingSphere(),De.copy(t.boundingSphere.center)):(e.boundingSphere===null&&e.computeBoundingSphere(),De.copy(e.boundingSphere.center)),De.applyMatrix4(e.matrixWorld).applyMatrix4(Te)),Array.isArray(i)){let r=t.groups;for(let a=0,o=r.length;a<o;a++){let o=r[a],s=i[o.materialIndex];s&&s.visible&&T.push(e,t,s,n,De.z,o)}}else i.visible&&T.push(e,t,i,n,De.z,null)}}let i=e.children;for(let e=0,a=i.length;e<a;e++)Ct(i[e],t,n,r)}function wt(e,t,n,r){let{opaque:i,transmissive:a,transparent:o}=e;E.setupLightsView(n),Ce===!0&&Ze.setGlobalState(k.clippingPlanes,n),r&&N.viewport(le.copy(r)),i.length>0&&Et(i,t,n),a.length>0&&Et(a,t,n),o.length>0&&Et(o,t,n),N.buffers.depth.setTest(!0),N.buffers.depth.setMask(!0),N.buffers.color.setMask(!0),N.setPolygonOffset(!1)}function Tt(e,t,n,r){if((n.isScene===!0?n.overrideMaterial:null)!==null)return;if(E.state.transmissionRenderTarget[r.id]===void 0){let e=Me.has(`EXT_color_buffer_half_float`)||Me.has(`EXT_color_buffer_float`);E.state.transmissionRenderTarget[r.id]=new An(1,1,{generateMipmaps:!0,type:e?We:Le,minFilter:Ie,samples:Math.max(4,Ne.samples),stencilBuffer:i,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:bn.workingColorSpace})}let a=E.state.transmissionRenderTarget[r.id],o=r.viewport||le;a.setSize(o.z*k.transmissionResolutionScale,o.w*k.transmissionResolutionScale);let s=k.getRenderTarget(),c=k.getActiveCubeFace(),l=k.getActiveMipmapLevel();k.setRenderTarget(a),k.getClearColor(fe),pe=k.getClearAlpha(),pe<1&&k.setClearColor(16777215,.5),k.clear(),ke&&$e.render(n);let u=k.toneMapping;k.toneMapping=0;let d=r.viewport;if(r.viewport!==void 0&&(r.viewport=void 0),E.setupLightsView(r),Ce===!0&&Ze.setGlobalState(k.clippingPlanes,r),Et(e,n,r),F.updateMultisampleRenderTarget(a),F.updateRenderTargetMipmap(a),Me.has(`WEBGL_multisampled_render_to_texture`)===!1){let e=!1;for(let i=0,a=t.length;i<a;i++){let{object:a,geometry:o,material:s,group:c}=t[i];if(s.side===2&&a.layers.test(r.layers)){let t=s.side;s.side=1,s.needsUpdate=!0,Dt(a,n,r,o,s,c),s.side=t,s.needsUpdate=!0,e=!0}}e===!0&&(F.updateMultisampleRenderTarget(a),F.updateRenderTargetMipmap(a))}k.setRenderTarget(s,c,l),k.setClearColor(fe,pe),d!==void 0&&(r.viewport=d),k.toneMapping=u}function Et(e,t,n){let r=t.isScene===!0?t.overrideMaterial:null;for(let i=0,a=e.length;i<a;i++){let a=e[i],{object:o,geometry:s,group:c}=a,l=a.material;l.allowOverride===!0&&r!==null&&(l=r),o.layers.test(n.layers)&&Dt(o,t,n,s,l,c)}}function Dt(e,t,n,r,i,a){e.onBeforeRender(k,t,n,r,i,a),e.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,e.matrixWorld),e.normalMatrix.getNormalMatrix(e.modelViewMatrix),i.onBeforeRender(k,t,n,r,e,a),i.transparent===!0&&i.side===2&&i.forceSinglePass===!1?(i.side=1,i.needsUpdate=!0,k.renderBufferDirect(n,t,r,i,e,a),i.side=0,i.needsUpdate=!0,k.renderBufferDirect(n,t,r,i,e,a),i.side=2):k.renderBufferDirect(n,t,r,i,e,a),e.onAfterRender(k,t,n,r,i,a)}function Ot(e,t,n){t.isScene!==!0&&(t=Oe);let r=P.get(e),i=E.state.lights,a=E.state.shadowsArray,o=i.state.version,s=Ue.getParameters(e,i.state,a,t,n,E.state.lightProbeGridArray),c=Ue.getProgramCacheKey(s),l=r.programs;r.environment=e.isMeshStandardMaterial||e.isMeshLambertMaterial||e.isMeshPhongMaterial?t.environment:null,r.fog=t.fog;let u=e.isMeshStandardMaterial||e.isMeshLambertMaterial&&!e.envMap||e.isMeshPhongMaterial&&!e.envMap;r.envMap=Fe.get(e.envMap||r.environment,u),r.envMapRotation=r.environment!==null&&e.envMap===null?t.environmentRotation:e.envMapRotation,l===void 0&&(e.addEventListener(`dispose`,mt),l=new Map,r.programs=l);let d=l.get(c);if(d!==void 0){if(r.currentProgram===d&&r.lightsStateVersion===o)return At(e,s),d}else s.uniforms=Ue.getUniforms(e),ne!==null&&e.isNodeMaterial&&ne.build(e,n,s),e.onBeforeCompile(s,k),d=Ue.acquireProgram(s,c),l.set(c,d),r.uniforms=s.uniforms;let f=r.uniforms;return(!e.isShaderMaterial&&!e.isRawShaderMaterial||e.clipping===!0)&&(f.clippingPlanes=Ze.uniform),At(e,s),r.needsLights=Pt(e),r.lightsStateVersion=o,r.needsLights&&(f.ambientLightColor.value=i.state.ambient,f.lightProbe.value=i.state.probe,f.directionalLights.value=i.state.directional,f.directionalLightShadows.value=i.state.directionalShadow,f.spotLights.value=i.state.spot,f.spotLightShadows.value=i.state.spotShadow,f.rectAreaLights.value=i.state.rectArea,f.ltc_1.value=i.state.rectAreaLTC1,f.ltc_2.value=i.state.rectAreaLTC2,f.pointLights.value=i.state.point,f.pointLightShadows.value=i.state.pointShadow,f.hemisphereLights.value=i.state.hemi,f.directionalShadowMatrix.value=i.state.directionalShadowMatrix,f.spotLightMatrix.value=i.state.spotLightMatrix,f.spotLightMap.value=i.state.spotLightMap,f.pointShadowMatrix.value=i.state.pointShadowMatrix),r.lightProbeGrid=E.state.lightProbeGridArray.length>0,r.currentProgram=d,r.uniformsList=null,d}function kt(e){if(e.uniformsList===null){let t=e.currentProgram.getUniforms();e.uniformsList=Ul.seqWithValue(t.seq,e.uniforms)}return e.uniformsList}function At(e,t){let n=P.get(e);n.outputColorSpace=t.outputColorSpace,n.batching=t.batching,n.batchingColor=t.batchingColor,n.instancing=t.instancing,n.instancingColor=t.instancingColor,n.instancingMorph=t.instancingMorph,n.skinning=t.skinning,n.morphTargets=t.morphTargets,n.morphNormals=t.morphNormals,n.morphColors=t.morphColors,n.morphTargetsCount=t.morphTargetsCount,n.numClippingPlanes=t.numClippingPlanes,n.numIntersection=t.numClipIntersection,n.vertexAlphas=t.vertexAlphas,n.vertexTangents=t.vertexTangents,n.toneMapping=t.toneMapping}function jt(e,t){if(e.length===0)return null;if(e.length===1)return e[0].texture===null?null:e[0];w.setFromMatrixPosition(t.matrixWorld);for(let t=0,n=e.length;t<n;t++){let n=e[t];if(n.texture!==null&&n.boundingBox.containsPoint(w))return n}return null}function Mt(e,t,n,r,i){t.isScene!==!0&&(t=Oe),F.resetTextureUnits();let a=t.fog,o=r.isMeshStandardMaterial||r.isMeshLambertMaterial||r.isMeshPhongMaterial?t.environment:null,s=j===null?k.outputColorSpace:j.isXRRenderTarget===!0?j.texture.colorSpace:bn.workingColorSpace,c=r.isMeshStandardMaterial||r.isMeshLambertMaterial&&!r.envMap||r.isMeshPhongMaterial&&!r.envMap,l=Fe.get(r.envMap||o,c),u=r.vertexColors===!0&&!!n.attributes.color&&n.attributes.color.itemSize===4,d=!!n.attributes.tangent&&(!!r.normalMap||r.anisotropy>0),f=!!n.morphAttributes.position,p=!!n.morphAttributes.normal,m=!!n.morphAttributes.color,h=0;r.toneMapped&&(j===null||j.isXRRenderTarget===!0)&&(h=k.toneMapping);let g=n.morphAttributes.position||n.morphAttributes.normal||n.morphAttributes.color,_=g===void 0?0:g.length,v=P.get(r),y=E.state.lights;if(Ce===!0&&(we===!0||e!==ce)){let t=e===ce&&r.id===se;Ze.setState(r,e,t)}let b=!1;r.version===v.__version?v.needsLights&&v.lightsStateVersion!==y.state.version?b=!0:v.outputColorSpace===s?i.isBatchedMesh&&v.batching===!1||!i.isBatchedMesh&&v.batching===!0||i.isBatchedMesh&&v.batchingColor===!0&&i.colorTexture===null||i.isBatchedMesh&&v.batchingColor===!1&&i.colorTexture!==null||i.isInstancedMesh&&v.instancing===!1||!i.isInstancedMesh&&v.instancing===!0||i.isSkinnedMesh&&v.skinning===!1||!i.isSkinnedMesh&&v.skinning===!0||i.isInstancedMesh&&v.instancingColor===!0&&i.instanceColor===null||i.isInstancedMesh&&v.instancingColor===!1&&i.instanceColor!==null||i.isInstancedMesh&&v.instancingMorph===!0&&i.morphTexture===null||i.isInstancedMesh&&v.instancingMorph===!1&&i.morphTexture!==null?b=!0:v.envMap===l?r.fog===!0&&v.fog!==a||v.numClippingPlanes!==void 0&&(v.numClippingPlanes!==Ze.numPlanes||v.numIntersection!==Ze.numIntersection)?b=!0:v.vertexAlphas===u&&v.vertexTangents===d&&v.morphTargets===f&&v.morphNormals===p&&v.morphColors===m&&v.toneMapping===h&&v.morphTargetsCount===_?!!v.lightProbeGrid!=E.state.lightProbeGridArray.length>0&&(b=!0):b=!0:b=!0:b=!0:(b=!0,v.__version=r.version);let x=v.currentProgram;b===!0&&(x=Ot(r,t,i),ne&&r.isNodeMaterial&&ne.onUpdateProgram(r,x,v));let S=!1,C=!1,w=!1,T=x.getUniforms(),D=v.uniforms;if(N.useProgram(x.program)&&(S=!0,C=!0,w=!0),r.id!==se&&(se=r.id,C=!0),v.needsLights){let e=jt(E.state.lightProbeGridArray,i);v.lightProbeGrid!==e&&(v.lightProbeGrid=e,C=!0)}if(S||ce!==e){N.buffers.depth.getReversed()&&e.reversedDepth!==!0&&(e._reversedDepth=!0,e.updateProjectionMatrix()),T.setValue(M,`projectionMatrix`,e.projectionMatrix),T.setValue(M,`viewMatrix`,e.matrixWorldInverse);let t=T.map.cameraPosition;t!==void 0&&t.setValue(M,Ee.setFromMatrixPosition(e.matrixWorld)),Ne.logarithmicDepthBuffer&&T.setValue(M,`logDepthBufFC`,2/(Math.log(e.far+1)/Math.LN2)),(r.isMeshPhongMaterial||r.isMeshToonMaterial||r.isMeshLambertMaterial||r.isMeshBasicMaterial||r.isMeshStandardMaterial||r.isShaderMaterial)&&T.setValue(M,`isOrthographic`,e.isOrthographicCamera===!0),ce!==e&&(ce=e,C=!0,w=!0)}if(v.needsLights&&(y.state.directionalShadowMap.length>0&&T.setValue(M,`directionalShadowMap`,y.state.directionalShadowMap,F),y.state.spotShadowMap.length>0&&T.setValue(M,`spotShadowMap`,y.state.spotShadowMap,F),y.state.pointShadowMap.length>0&&T.setValue(M,`pointShadowMap`,y.state.pointShadowMap,F)),i.isSkinnedMesh){T.setOptional(M,i,`bindMatrix`),T.setOptional(M,i,`bindMatrixInverse`);let e=i.skeleton;e&&(e.boneTexture===null&&e.computeBoneTexture(),T.setValue(M,`boneTexture`,e.boneTexture,F))}i.isBatchedMesh&&(T.setOptional(M,i,`batchingTexture`),T.setValue(M,`batchingTexture`,i._matricesTexture,F),T.setOptional(M,i,`batchingIdTexture`),T.setValue(M,`batchingIdTexture`,i._indirectTexture,F),T.setOptional(M,i,`batchingColorTexture`),i._colorsTexture!==null&&T.setValue(M,`batchingColorTexture`,i._colorsTexture,F));let O=n.morphAttributes;if((O.position!==void 0||O.normal!==void 0||O.color!==void 0)&&et.update(i,n,x),(C||v.receiveShadow!==i.receiveShadow)&&(v.receiveShadow=i.receiveShadow,T.setValue(M,`receiveShadow`,i.receiveShadow)),(r.isMeshStandardMaterial||r.isMeshLambertMaterial||r.isMeshPhongMaterial)&&r.envMap===null&&t.environment!==null&&(D.envMapIntensity.value=t.environmentIntensity),D.dfgLUT!==void 0&&(D.dfgLUT.value=ul()),C){if(T.setValue(M,`toneMappingExposure`,k.toneMappingExposure),v.needsLights&&Nt(D,w),a&&r.fog===!0&&Je.refreshFogUniforms(D,a),Je.refreshMaterialUniforms(D,r,ge,he,E.state.transmissionRenderTarget[e.id]),v.needsLights&&v.lightProbeGrid){let e=v.lightProbeGrid;D.probesSH.value=e.texture,D.probesMin.value.copy(e.boundingBox.min),D.probesMax.value.copy(e.boundingBox.max),D.probesResolution.value.copy(e.resolution)}Ul.upload(M,kt(v),D,F)}if(r.isShaderMaterial&&r.uniformsNeedUpdate===!0&&(Ul.upload(M,kt(v),D,F),r.uniformsNeedUpdate=!1),r.isSpriteMaterial&&T.setValue(M,`center`,i.center),T.setValue(M,`modelViewMatrix`,i.modelViewMatrix),T.setValue(M,`normalMatrix`,i.normalMatrix),T.setValue(M,`modelMatrix`,i.matrixWorld),r.uniformsGroups!==void 0){let e=r.uniformsGroups;for(let t=0,n=e.length;t<n;t++){let n=e[t];ct.update(n,x),ct.bind(n,x)}}return x}function Nt(e,t){e.ambientLightColor.needsUpdate=t,e.lightProbe.needsUpdate=t,e.directionalLights.needsUpdate=t,e.directionalLightShadows.needsUpdate=t,e.pointLights.needsUpdate=t,e.pointLightShadows.needsUpdate=t,e.spotLights.needsUpdate=t,e.spotLightShadows.needsUpdate=t,e.rectAreaLights.needsUpdate=t,e.hemisphereLights.needsUpdate=t}function Pt(e){return e.isMeshLambertMaterial||e.isMeshToonMaterial||e.isMeshPhongMaterial||e.isMeshStandardMaterial||e.isShadowMaterial||e.isShaderMaterial&&e.lights===!0}this.getActiveCubeFace=function(){return A},this.getActiveMipmapLevel=function(){return oe},this.getRenderTarget=function(){return j},this.setRenderTargetTextures=function(e,t,n){let r=P.get(e);r.__autoAllocateDepthBuffer=e.resolveDepthBuffer===!1,r.__autoAllocateDepthBuffer===!1&&(r.__useRenderToTexture=!1),P.get(e.texture).__webglTexture=t,P.get(e.depthTexture).__webglTexture=r.__autoAllocateDepthBuffer?void 0:n,r.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(e,t){let n=P.get(e);n.__webglFramebuffer=t,n.__useDefaultFramebuffer=t===void 0},this.setRenderTarget=function(e,t=0,n=0){j=e,A=t,oe=n;let r=null,i=!1,a=!1;if(e){let o=P.get(e);if(o.__useDefaultFramebuffer!==void 0){N.bindFramebuffer(M.FRAMEBUFFER,o.__webglFramebuffer),le.copy(e.viewport),ue.copy(e.scissor),de=e.scissorTest,N.viewport(le),N.scissor(ue),N.setScissorTest(de),se=-1;return}if(o.__webglFramebuffer===void 0)F.setupRenderTarget(e);else if(o.__hasExternalTextures)F.rebindTextures(e,P.get(e.texture).__webglTexture,P.get(e.depthTexture).__webglTexture);else if(e.depthBuffer){let t=e.depthTexture;if(o.__boundDepthTexture!==t){if(t!==null&&P.has(t)&&(e.width!==t.image.width||e.height!==t.image.height))throw Error(`THREE.WebGLRenderer: Attached DepthTexture is initialized to the incorrect size.`);F.setupDepthRenderbuffer(e)}}let s=e.texture;(s.isData3DTexture||s.isDataArrayTexture||s.isCompressedArrayTexture)&&(a=!0);let c=P.get(e).__webglFramebuffer;e.isWebGLCubeRenderTarget?(r=Array.isArray(c[t])?c[t][n]:c[t],i=!0):r=e.samples>0&&F.useMultisampledRTT(e)===!1?P.get(e).__webglMultisampledFramebuffer:Array.isArray(c)?c[n]:c,le.copy(e.viewport),ue.copy(e.scissor),de=e.scissorTest}else le.copy(ye).multiplyScalar(ge).floor(),ue.copy(be).multiplyScalar(ge).floor(),de=xe;if(n!==0&&(r=re),N.bindFramebuffer(M.FRAMEBUFFER,r)&&N.drawBuffers(e,r),N.viewport(le),N.scissor(ue),N.setScissorTest(de),i){let r=P.get(e.texture);M.framebufferTexture2D(M.FRAMEBUFFER,M.COLOR_ATTACHMENT0,M.TEXTURE_CUBE_MAP_POSITIVE_X+t,r.__webglTexture,n)}else if(a){let r=t;for(let t=0;t<e.textures.length;t++){let i=P.get(e.textures[t]);M.framebufferTextureLayer(M.FRAMEBUFFER,M.COLOR_ATTACHMENT0+t,i.__webglTexture,n,r)}}else if(e!==null&&n!==0){let t=P.get(e.texture);M.framebufferTexture2D(M.FRAMEBUFFER,M.COLOR_ATTACHMENT0,M.TEXTURE_2D,t.__webglTexture,n)}se=-1},this.readRenderTargetPixels=function(e,t,n,r,i,a,o,s=0){if(!(e&&e.isWebGLRenderTarget)){f(`WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.`);return}let c=P.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&o!==void 0&&(c=c[o]),c){N.bindFramebuffer(M.FRAMEBUFFER,c);try{let o=e.textures[s],c=o.format,l=o.type;if(e.textures.length>1&&M.readBuffer(M.COLOR_ATTACHMENT0+s),!Ne.textureFormatReadable(c)){f(`WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.`);return}if(!Ne.textureTypeReadable(l)){f(`WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.`);return}t>=0&&t<=e.width-r&&n>=0&&n<=e.height-i&&M.readPixels(t,n,r,i,ot.convert(c),ot.convert(l),a)}finally{let e=j===null?null:P.get(j).__webglFramebuffer;N.bindFramebuffer(M.FRAMEBUFFER,e)}}},this.readRenderTargetPixelsAsync=async function(e,t,n,r,i,a,o,s=0){if(!(e&&e.isWebGLRenderTarget))throw Error(`THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.`);let c=P.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&o!==void 0&&(c=c[o]),c){if(t>=0&&t<=e.width-r&&n>=0&&n<=e.height-i){N.bindFramebuffer(M.FRAMEBUFFER,c);let o=e.textures[s],l=o.format,u=o.type;if(e.textures.length>1&&M.readBuffer(M.COLOR_ATTACHMENT0+s),!Ne.textureFormatReadable(l))throw Error(`THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.`);if(!Ne.textureTypeReadable(u))throw Error(`THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.`);let d=M.createBuffer();M.bindBuffer(M.PIXEL_PACK_BUFFER,d),M.bufferData(M.PIXEL_PACK_BUFFER,a.byteLength,M.STREAM_READ),M.readPixels(t,n,r,i,ot.convert(l),ot.convert(u),0);let f=j===null?null:P.get(j).__webglFramebuffer;N.bindFramebuffer(M.FRAMEBUFFER,f);let p=M.fenceSync(M.SYNC_GPU_COMMANDS_COMPLETE,0);return M.flush(),await m(M,p,4),M.bindBuffer(M.PIXEL_PACK_BUFFER,d),M.getBufferSubData(M.PIXEL_PACK_BUFFER,0,a),M.deleteBuffer(d),M.deleteSync(p),a}throw Error(`THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.`)}},this.copyFramebufferToTexture=function(e,t=null,n=0){let r=2**-n,i=Math.floor(e.image.width*r),a=Math.floor(e.image.height*r),o=t===null?0:t.x,s=t===null?0:t.y;F.setTexture2D(e,0),M.copyTexSubImage2D(M.TEXTURE_2D,n,0,0,o,s,i,a),N.unbindTexture()},this.copyTextureToTexture=function(e,t,n=null,r=null,i=0,a=0){let o,s,c,l,u,d,f,p,m,h=e.isCompressedTexture?e.mipmaps[a]:e.image;if(n!==null)o=n.max.x-n.min.x,s=n.max.y-n.min.y,c=n.isBox3?n.max.z-n.min.z:1,l=n.min.x,u=n.min.y,d=n.isBox3?n.min.z:0;else{let t=2**-i;o=Math.floor(h.width*t),s=Math.floor(h.height*t),c=e.isDataArrayTexture?h.depth:e.isData3DTexture?Math.floor(h.depth*t):1,l=0,u=0,d=0}r===null?(f=0,p=0,m=0):(f=r.x,p=r.y,m=r.z);let g=ot.convert(t.format),_=ot.convert(t.type),v;t.isData3DTexture?(F.setTexture3D(t,0),v=M.TEXTURE_3D):t.isDataArrayTexture||t.isCompressedArrayTexture?(F.setTexture2DArray(t,0),v=M.TEXTURE_2D_ARRAY):(F.setTexture2D(t,0),v=M.TEXTURE_2D),N.activeTexture(M.TEXTURE0),N.pixelStorei(M.UNPACK_FLIP_Y_WEBGL,t.flipY),N.pixelStorei(M.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.premultiplyAlpha),N.pixelStorei(M.UNPACK_ALIGNMENT,t.unpackAlignment);let y=N.getParameter(M.UNPACK_ROW_LENGTH),b=N.getParameter(M.UNPACK_IMAGE_HEIGHT),x=N.getParameter(M.UNPACK_SKIP_PIXELS),S=N.getParameter(M.UNPACK_SKIP_ROWS),C=N.getParameter(M.UNPACK_SKIP_IMAGES);N.pixelStorei(M.UNPACK_ROW_LENGTH,h.width),N.pixelStorei(M.UNPACK_IMAGE_HEIGHT,h.height),N.pixelStorei(M.UNPACK_SKIP_PIXELS,l),N.pixelStorei(M.UNPACK_SKIP_ROWS,u),N.pixelStorei(M.UNPACK_SKIP_IMAGES,d);let w=e.isDataArrayTexture||e.isData3DTexture,T=t.isDataArrayTexture||t.isData3DTexture;if(e.isDepthTexture){let n=P.get(e),r=P.get(t),h=P.get(n.__renderTarget),g=P.get(r.__renderTarget);N.bindFramebuffer(M.READ_FRAMEBUFFER,h.__webglFramebuffer),N.bindFramebuffer(M.DRAW_FRAMEBUFFER,g.__webglFramebuffer);for(let n=0;n<c;n++)w&&(M.framebufferTextureLayer(M.READ_FRAMEBUFFER,M.COLOR_ATTACHMENT0,P.get(e).__webglTexture,i,d+n),M.framebufferTextureLayer(M.DRAW_FRAMEBUFFER,M.COLOR_ATTACHMENT0,P.get(t).__webglTexture,a,m+n)),M.blitFramebuffer(l,u,o,s,f,p,o,s,M.DEPTH_BUFFER_BIT,M.NEAREST);N.bindFramebuffer(M.READ_FRAMEBUFFER,null),N.bindFramebuffer(M.DRAW_FRAMEBUFFER,null)}else if(i!==0||e.isRenderTargetTexture||P.has(e)){let n=P.get(e),r=P.get(t);N.bindFramebuffer(M.READ_FRAMEBUFFER,ie),N.bindFramebuffer(M.DRAW_FRAMEBUFFER,ae);for(let e=0;e<c;e++)w?M.framebufferTextureLayer(M.READ_FRAMEBUFFER,M.COLOR_ATTACHMENT0,n.__webglTexture,i,d+e):M.framebufferTexture2D(M.READ_FRAMEBUFFER,M.COLOR_ATTACHMENT0,M.TEXTURE_2D,n.__webglTexture,i),T?M.framebufferTextureLayer(M.DRAW_FRAMEBUFFER,M.COLOR_ATTACHMENT0,r.__webglTexture,a,m+e):M.framebufferTexture2D(M.DRAW_FRAMEBUFFER,M.COLOR_ATTACHMENT0,M.TEXTURE_2D,r.__webglTexture,a),i===0?T?M.copyTexSubImage3D(v,a,f,p,m+e,l,u,o,s):M.copyTexSubImage2D(v,a,f,p,l,u,o,s):M.blitFramebuffer(l,u,o,s,f,p,o,s,M.COLOR_BUFFER_BIT,M.NEAREST);N.bindFramebuffer(M.READ_FRAMEBUFFER,null),N.bindFramebuffer(M.DRAW_FRAMEBUFFER,null)}else T?e.isDataTexture||e.isData3DTexture?M.texSubImage3D(v,a,f,p,m,o,s,c,g,_,h.data):t.isCompressedArrayTexture?M.compressedTexSubImage3D(v,a,f,p,m,o,s,c,g,h.data):M.texSubImage3D(v,a,f,p,m,o,s,c,g,_,h):e.isDataTexture?M.texSubImage2D(M.TEXTURE_2D,a,f,p,o,s,g,_,h.data):e.isCompressedTexture?M.compressedTexSubImage2D(M.TEXTURE_2D,a,f,p,h.width,h.height,g,h.data):M.texSubImage2D(M.TEXTURE_2D,a,f,p,o,s,g,_,h);N.pixelStorei(M.UNPACK_ROW_LENGTH,y),N.pixelStorei(M.UNPACK_IMAGE_HEIGHT,b),N.pixelStorei(M.UNPACK_SKIP_PIXELS,x),N.pixelStorei(M.UNPACK_SKIP_ROWS,S),N.pixelStorei(M.UNPACK_SKIP_IMAGES,C),a===0&&t.generateMipmaps&&M.generateMipmap(v),N.unbindTexture()},this.initRenderTarget=function(e){P.get(e).__webglFramebuffer===void 0&&F.setupRenderTarget(e)},this.initTexture=function(e){e.isCubeTexture?F.setTextureCube(e,0):e.isData3DTexture?F.setTexture3D(e,0):e.isDataArrayTexture||e.isCompressedArrayTexture?F.setTexture2DArray(e,0):F.setTexture2D(e,0),N.unbindTexture()},this.resetState=function(){A=0,oe=0,j=null,N.reset(),st.reset()},typeof __THREE_DEVTOOLS__<`u`&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent(`observe`,{detail:this}))}get coordinateSystem(){return rn}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;let t=this.getContext();t.drawingBufferColorSpace=bn._getDrawingBufferColorSpace(e),t.unpackColorSpace=bn._getUnpackColorSpace()}}}));function Cu(e,t){if(t===0)return console.warn(`THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles.`),e;if(t===2||t===1){let n=e.getIndex();if(n===null){let t=[],r=e.getAttribute(`position`);if(r!==void 0){for(let e=0;e<r.count;e++)t.push(e);e.setIndex(t),n=e.getIndex()}else return console.error(`THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible.`),e}let r=n.count-2,i=[];if(t===2)for(let e=1;e<=r;e++)i.push(n.getX(0)),i.push(n.getX(e)),i.push(n.getX(e+1));else for(let e=0;e<r;e++)e%2==0?(i.push(n.getX(e)),i.push(n.getX(e+1)),i.push(n.getX(e+2))):(i.push(n.getX(e+2)),i.push(n.getX(e+1)),i.push(n.getX(e)));i.length/3!==r&&console.error(`THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.`);let a=e.clone();return a.setIndex(i),a.clearGroups(),a}return console.error(`THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:`,t),e}var wu=t((()=>{Su()}));function Tu(e){let t=new Map,n=new Map,r=e.clone();return Eu(e,r,function(e,r){t.set(r,e),n.set(e,r)}),r.traverse(function(e){if(!e.isSkinnedMesh)return;let r=e,i=t.get(e),a=i.skeleton.bones;r.skeleton=i.skeleton.clone(),r.bindMatrix.copy(i.bindMatrix),r.skeleton.bones=a.map(function(e){return n.get(e)}),r.bind(r.skeleton,r.bindMatrix)}),r}function Eu(e,t,n){n(e,t);for(let r=0;r<e.children.length;r++)Eu(e.children[r],t.children[r],n)}var Du=t((()=>{}));function Ou(){let e={};return{get:function(t){return e[t]},add:function(t,n){e[t]=n},remove:function(t){delete e[t]},removeAll:function(){e={}}}}function ku(e,t,n){let r=e.json.materials[t];return r.extensions&&r.extensions[n]?r.extensions[n]:null}function Au(e){return e.DefaultMaterial===void 0&&(e.DefaultMaterial=new Ha({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:0})),e.DefaultMaterial}function ju(e,t,n){for(let r in n.extensions)e[r]===void 0&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[r]=n.extensions[r])}function Mu(e,t){t.extras!==void 0&&(typeof t.extras==`object`?Object.assign(e.userData,t.extras):console.warn(`THREE.GLTFLoader: Ignoring primitive type .extras, `+t.extras))}function Nu(e,t,n){let r=!1,i=!1,a=!1;for(let e=0,n=t.length;e<n;e++){let n=t[e];if(n.POSITION!==void 0&&(r=!0),n.NORMAL!==void 0&&(i=!0),n.COLOR_0!==void 0&&(a=!0),r&&i&&a)break}if(!r&&!i&&!a)return Promise.resolve(e);let o=[],s=[],c=[];for(let l=0,u=t.length;l<u;l++){let u=t[l];if(r){let t=u.POSITION===void 0?e.attributes.position:n.getDependency(`accessor`,u.POSITION);o.push(t)}if(i){let t=u.NORMAL===void 0?e.attributes.normal:n.getDependency(`accessor`,u.NORMAL);s.push(t)}if(a){let t=u.COLOR_0===void 0?e.attributes.color:n.getDependency(`accessor`,u.COLOR_0);c.push(t)}}return Promise.all([Promise.all(o),Promise.all(s),Promise.all(c)]).then(function(t){let n=t[0],o=t[1],s=t[2];return r&&(e.morphAttributes.position=n),i&&(e.morphAttributes.normal=o),a&&(e.morphAttributes.color=s),e.morphTargetsRelative=!0,e})}function Pu(e,t){if(e.updateMorphTargets(),t.weights!==void 0)for(let n=0,r=t.weights.length;n<r;n++)e.morphTargetInfluences[n]=t.weights[n];if(t.extras&&Array.isArray(t.extras.targetNames)){let n=t.extras.targetNames;if(e.morphTargetInfluences.length===n.length){e.morphTargetDictionary={};for(let t=0,r=n.length;t<r;t++)e.morphTargetDictionary[n[t]]=t}else console.warn(`THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.`)}}function Fu(e){let t,n=e.extensions&&e.extensions[Hu.KHR_DRACO_MESH_COMPRESSION];if(t=n?`draco:`+n.bufferView+`:`+n.indices+`:`+Iu(n.attributes):e.indices+`:`+Iu(e.attributes)+`:`+e.mode,e.targets!==void 0)for(let n=0,r=e.targets.length;n<r;n++)t+=`:`+Iu(e.targets[n]);return t}function Iu(e){let t=``,n=Object.keys(e).sort();for(let r=0,i=n.length;r<i;r++)t+=n[r]+`:`+e[n[r]]+`;`;return t}function Lu(e){switch(e){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw Error(`THREE.GLTFLoader: Unsupported normalized accessor component type.`)}}function Ru(e){return e.search(/\\.jpe?g($|\\?)/i)>0||e.search(/^data\\:image\\/jpeg/)===0?`image/jpeg`:e.search(/\\.webp($|\\?)/i)>0||e.search(/^data\\:image\\/webp/)===0?`image/webp`:e.search(/\\.ktx2($|\\?)/i)>0||e.search(/^data\\:image\\/ktx2/)===0?`image/ktx2`:`image/png`}function zu(e,t,n){let r=t.attributes,i=new kr;if(r.POSITION!==void 0){let e=n.json.accessors[r.POSITION],t=e.min,a=e.max;if(t!==void 0&&a!==void 0){if(i.set(new L(t[0],t[1],t[2]),new L(a[0],a[1],a[2])),e.normalized){let t=Lu(vd[e.componentType]);i.min.multiplyScalar(t),i.max.multiplyScalar(t)}}else{console.warn(`THREE.GLTFLoader: Missing min/max properties for accessor POSITION.`);return}}else return;let a=t.targets;if(a!==void 0){let e=new L,t=new L;for(let r=0,i=a.length;r<i;r++){let i=a[r];if(i.POSITION!==void 0){let r=n.json.accessors[i.POSITION],a=r.min,o=r.max;if(a!==void 0&&o!==void 0){if(t.setX(Math.max(Math.abs(a[0]),Math.abs(o[0]))),t.setY(Math.max(Math.abs(a[1]),Math.abs(o[1]))),t.setZ(Math.max(Math.abs(a[2]),Math.abs(o[2]))),r.normalized){let e=Lu(vd[r.componentType]);t.multiplyScalar(e)}e.max(t)}else console.warn(`THREE.GLTFLoader: Missing min/max properties for accessor POSITION.`)}}i.expandByVector(e)}e.boundingBox=i;let o=new $r;i.getCenter(o.center),o.radius=i.min.distanceTo(i.max)/2,e.boundingSphere=o}function Bu(e,t,n){let r=t.attributes,i=[];function a(t,r){return n.getDependency(`accessor`,t).then(function(t){e.setAttribute(r,t)})}for(let t in r){let n=Sd[t]||t.toLowerCase();n in e.attributes||i.push(a(r[t],n))}if(t.indices!==void 0&&!e.index){let r=n.getDependency(`accessor`,t.indices).then(function(t){e.setIndex(t)});i.push(r)}return bn.workingColorSpace!==`srgb-linear`&&`COLOR_0`in r&&console.warn(`THREE.GLTFLoader: Converting vertex colors from \"srgb-linear\" to \"${bn.workingColorSpace}\" not supported.`),Mu(e,t),zu(e,t,n),Promise.all(i).then(function(){return t.targets===void 0?e:Nu(e,t.targets,n)})}var Vu,Hu,Uu,Wu,Gu,Ku,qu,Ju,Yu,Xu,Zu,Qu,$u,ed,td,nd,rd,id,ad,od,sd,cd,ld,ud,dd,fd,pd,md,hd,gd,_d,vd,yd,bd,xd,Sd,Cd,wd,Td,Ed,Dd,Od=t((()=>{Su(),wu(),Du(),Vu=class extends lo{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(e){return new Ku(e)}),this.register(function(e){return new qu(e)}),this.register(function(e){return new nd(e)}),this.register(function(e){return new rd(e)}),this.register(function(e){return new id(e)}),this.register(function(e){return new Yu(e)}),this.register(function(e){return new Xu(e)}),this.register(function(e){return new Zu(e)}),this.register(function(e){return new Qu(e)}),this.register(function(e){return new Gu(e)}),this.register(function(e){return new $u(e)}),this.register(function(e){return new Ju(e)}),this.register(function(e){return new td(e)}),this.register(function(e){return new ed(e)}),this.register(function(e){return new Uu(e)}),this.register(function(e){return new ad(e,Hu.EXT_MESHOPT_COMPRESSION)}),this.register(function(e){return new ad(e,Hu.KHR_MESHOPT_COMPRESSION)}),this.register(function(e){return new od(e)})}load(e,t,n,r){let i=this,a;if(this.resourcePath!==``)a=this.resourcePath;else if(this.path!==``){let t=Ro.extractUrlBase(e);a=Ro.resolveURL(t,this.path)}else a=Ro.extractUrlBase(e);this.manager.itemStart(e);let o=function(t){r?r(t):console.error(t),i.manager.itemError(e),i.manager.itemEnd(e)},s=new po(this.manager);s.setPath(this.path),s.setResponseType(`arraybuffer`),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,function(n){try{i.parse(n,a,function(n){t(n),i.manager.itemEnd(e)},o)}catch(e){o(e)}},n,o)}setDRACOLoader(e){return this.dracoLoader=e,this}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,n,r){let i,a={},o={},s=new TextDecoder;if(typeof e==`string`)i=JSON.parse(e);else if(e instanceof ArrayBuffer){if(s.decode(new Uint8Array(e,0,4))===sd){try{a[Hu.KHR_BINARY_GLTF]=new ud(e)}catch(e){r&&r(e);return}i=JSON.parse(a[Hu.KHR_BINARY_GLTF].content)}else i=JSON.parse(s.decode(e))}else i=e;if(i.asset===void 0||i.asset.version[0]<2){r&&r(Error(`THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported.`));return}let c=new Dd(i,{path:t||this.resourcePath||``,crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});c.fileLoader.setRequestHeader(this.requestHeader);for(let e=0;e<this.pluginCallbacks.length;e++){let t=this.pluginCallbacks[e](c);t.name||console.error(`THREE.GLTFLoader: Invalid plugin found: missing name`),o[t.name]=t,a[t.name]=!0}if(i.extensionsUsed)for(let e=0;e<i.extensionsUsed.length;++e){let t=i.extensionsUsed[e],n=i.extensionsRequired||[];switch(t){case Hu.KHR_MATERIALS_UNLIT:a[t]=new Wu;break;case Hu.KHR_DRACO_MESH_COMPRESSION:a[t]=new dd(i,this.dracoLoader);break;case Hu.KHR_TEXTURE_TRANSFORM:a[t]=new fd;break;case Hu.KHR_MESH_QUANTIZATION:a[t]=new pd;break;default:n.indexOf(t)>=0&&o[t]===void 0&&console.warn(`THREE.GLTFLoader: Unknown extension \"`+t+`\".`)}}c.setExtensions(a),c.setPlugins(o),c.parse(n,r)}parseAsync(e,t){let n=this;return new Promise(function(r,i){n.parse(e,t,r,i)})}},Hu={KHR_BINARY_GLTF:`KHR_binary_glTF`,KHR_DRACO_MESH_COMPRESSION:`KHR_draco_mesh_compression`,KHR_LIGHTS_PUNCTUAL:`KHR_lights_punctual`,KHR_MATERIALS_CLEARCOAT:`KHR_materials_clearcoat`,KHR_MATERIALS_DISPERSION:`KHR_materials_dispersion`,KHR_MATERIALS_IOR:`KHR_materials_ior`,KHR_MATERIALS_SHEEN:`KHR_materials_sheen`,KHR_MATERIALS_SPECULAR:`KHR_materials_specular`,KHR_MATERIALS_TRANSMISSION:`KHR_materials_transmission`,KHR_MATERIALS_IRIDESCENCE:`KHR_materials_iridescence`,KHR_MATERIALS_ANISOTROPY:`KHR_materials_anisotropy`,KHR_MATERIALS_UNLIT:`KHR_materials_unlit`,KHR_MATERIALS_VOLUME:`KHR_materials_volume`,KHR_TEXTURE_BASISU:`KHR_texture_basisu`,KHR_TEXTURE_TRANSFORM:`KHR_texture_transform`,KHR_MESH_QUANTIZATION:`KHR_mesh_quantization`,KHR_MATERIALS_EMISSIVE_STRENGTH:`KHR_materials_emissive_strength`,EXT_MATERIALS_BUMP:`EXT_materials_bump`,EXT_TEXTURE_WEBP:`EXT_texture_webp`,EXT_TEXTURE_AVIF:`EXT_texture_avif`,EXT_MESHOPT_COMPRESSION:`EXT_meshopt_compression`,KHR_MESHOPT_COMPRESSION:`KHR_meshopt_compression`,EXT_MESH_GPU_INSTANCING:`EXT_mesh_gpu_instancing`},Uu=class{constructor(e){this.parser=e,this.name=Hu.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){let e=this.parser,t=this.parser.json.nodes||[];for(let n=0,r=t.length;n<r;n++){let r=t[n];r.extensions&&r.extensions[this.name]&&r.extensions[this.name].light!==void 0&&e._addNodeRef(this.cache,r.extensions[this.name].light)}}_loadLight(e){let t=this.parser,n=`light:`+e,r=t.cache.get(n);if(r)return r;let i=t.json,a=((i.extensions&&i.extensions[this.name]||{}).lights||[])[e],o,s=new z(16777215);a.color!==void 0&&s.setRGB(a.color[0],a.color[1],a.color[2],Qt);let c=a.range===void 0?0:a.range;switch(a.type){case`directional`:o=new Io(s),o.target.position.set(0,0,-1),o.add(o.target);break;case`point`:o=new No(s),o.distance=c;break;case`spot`:o=new jo(s),o.distance=c,a.spot=a.spot||{},a.spot.innerConeAngle=a.spot.innerConeAngle===void 0?0:a.spot.innerConeAngle,a.spot.outerConeAngle=a.spot.outerConeAngle===void 0?Math.PI/4:a.spot.outerConeAngle,o.angle=a.spot.outerConeAngle,o.penumbra=1-a.spot.innerConeAngle/a.spot.outerConeAngle,o.target.position.set(0,0,-1),o.add(o.target);break;default:throw Error(`THREE.GLTFLoader: Unexpected light type: `+a.type)}return o.position.set(0,0,0),Mu(o,a),a.intensity!==void 0&&(o.intensity=a.intensity),o.name=t.createUniqueName(a.name||`light_`+e),r=Promise.resolve(o),t.cache.add(n,r),r}getDependency(e,t){if(e===`light`)return this._loadLight(t)}createNodeAttachment(e){let t=this,n=this.parser,r=n.json.nodes[e],i=(r.extensions&&r.extensions[this.name]||{}).light;return i===void 0?null:this._loadLight(i).then(function(e){return n._getNodeRef(t.cache,i,e)})}},Wu=class{constructor(){this.name=Hu.KHR_MATERIALS_UNLIT}getMaterialType(){return xi}extendParams(e,t,n){let r=[];e.color=new z(1,1,1),e.opacity=1;let i=t.pbrMetallicRoughness;if(i){if(Array.isArray(i.baseColorFactor)){let t=i.baseColorFactor;e.color.setRGB(t[0],t[1],t[2],Qt),e.opacity=t[3]}i.baseColorTexture!==void 0&&r.push(n.assignTexture(e,`map`,i.baseColorTexture,Zt))}return Promise.all(r)}},Gu=class{constructor(e){this.parser=e,this.name=Hu.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,t){let n=ku(this.parser,e,this.name);return n===null||n.emissiveStrength!==void 0&&(t.emissiveIntensity=n.emissiveStrength),Promise.resolve()}},Ku=class{constructor(e){this.parser=e,this.name=Hu.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){return ku(this.parser,e,this.name)===null?null:Ua}extendMaterialParams(e,t){let n=ku(this.parser,e,this.name);if(n===null)return Promise.resolve();let r=[];if(n.clearcoatFactor!==void 0&&(t.clearcoat=n.clearcoatFactor),n.clearcoatTexture!==void 0&&r.push(this.parser.assignTexture(t,`clearcoatMap`,n.clearcoatTexture)),n.clearcoatRoughnessFactor!==void 0&&(t.clearcoatRoughness=n.clearcoatRoughnessFactor),n.clearcoatRoughnessTexture!==void 0&&r.push(this.parser.assignTexture(t,`clearcoatRoughnessMap`,n.clearcoatRoughnessTexture)),n.clearcoatNormalTexture!==void 0&&(r.push(this.parser.assignTexture(t,`clearcoatNormalMap`,n.clearcoatNormalTexture)),n.clearcoatNormalTexture.scale!==void 0)){let e=n.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new I(e,e)}return Promise.all(r)}},qu=class{constructor(e){this.parser=e,this.name=Hu.KHR_MATERIALS_DISPERSION}getMaterialType(e){return ku(this.parser,e,this.name)===null?null:Ua}extendMaterialParams(e,t){let n=ku(this.parser,e,this.name);return n===null||(t.dispersion=n.dispersion===void 0?0:n.dispersion),Promise.resolve()}},Ju=class{constructor(e){this.parser=e,this.name=Hu.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){return ku(this.parser,e,this.name)===null?null:Ua}extendMaterialParams(e,t){let n=ku(this.parser,e,this.name);if(n===null)return Promise.resolve();let r=[];return n.iridescenceFactor!==void 0&&(t.iridescence=n.iridescenceFactor),n.iridescenceTexture!==void 0&&r.push(this.parser.assignTexture(t,`iridescenceMap`,n.iridescenceTexture)),n.iridescenceIor!==void 0&&(t.iridescenceIOR=n.iridescenceIor),t.iridescenceThicknessRange===void 0&&(t.iridescenceThicknessRange=[100,400]),n.iridescenceThicknessMinimum!==void 0&&(t.iridescenceThicknessRange[0]=n.iridescenceThicknessMinimum),n.iridescenceThicknessMaximum!==void 0&&(t.iridescenceThicknessRange[1]=n.iridescenceThicknessMaximum),n.iridescenceThicknessTexture!==void 0&&r.push(this.parser.assignTexture(t,`iridescenceThicknessMap`,n.iridescenceThicknessTexture)),Promise.all(r)}},Yu=class{constructor(e){this.parser=e,this.name=Hu.KHR_MATERIALS_SHEEN}getMaterialType(e){return ku(this.parser,e,this.name)===null?null:Ua}extendMaterialParams(e,t){let n=ku(this.parser,e,this.name);if(n===null)return Promise.resolve();let r=[];if(t.sheenColor=new z(0,0,0),t.sheenRoughness=0,t.sheen=1,n.sheenColorFactor!==void 0){let e=n.sheenColorFactor;t.sheenColor.setRGB(e[0],e[1],e[2],Qt)}return n.sheenRoughnessFactor!==void 0&&(t.sheenRoughness=n.sheenRoughnessFactor),n.sheenColorTexture!==void 0&&r.push(this.parser.assignTexture(t,`sheenColorMap`,n.sheenColorTexture,Zt)),n.sheenRoughnessTexture!==void 0&&r.push(this.parser.assignTexture(t,`sheenRoughnessMap`,n.sheenRoughnessTexture)),Promise.all(r)}},Xu=class{constructor(e){this.parser=e,this.name=Hu.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){return ku(this.parser,e,this.name)===null?null:Ua}extendMaterialParams(e,t){let n=ku(this.parser,e,this.name);if(n===null)return Promise.resolve();let r=[];return n.transmissionFactor!==void 0&&(t.transmission=n.transmissionFactor),n.transmissionTexture!==void 0&&r.push(this.parser.assignTexture(t,`transmissionMap`,n.transmissionTexture)),Promise.all(r)}},Zu=class{constructor(e){this.parser=e,this.name=Hu.KHR_MATERIALS_VOLUME}getMaterialType(e){return ku(this.parser,e,this.name)===null?null:Ua}extendMaterialParams(e,t){let n=ku(this.parser,e,this.name);if(n===null)return Promise.resolve();let r=[];t.thickness=n.thicknessFactor===void 0?0:n.thicknessFactor,n.thicknessTexture!==void 0&&r.push(this.parser.assignTexture(t,`thicknessMap`,n.thicknessTexture)),t.attenuationDistance=n.attenuationDistance||1/0;let i=n.attenuationColor||[1,1,1];return t.attenuationColor=new z().setRGB(i[0],i[1],i[2],Qt),Promise.all(r)}},Qu=class{constructor(e){this.parser=e,this.name=Hu.KHR_MATERIALS_IOR}getMaterialType(e){return ku(this.parser,e,this.name)===null?null:Ua}extendMaterialParams(e,t){let n=ku(this.parser,e,this.name);return n===null?Promise.resolve():(t.ior=n.ior===void 0?1.5:n.ior,t.ior===0&&(t.ior=1e3),Promise.resolve())}},$u=class{constructor(e){this.parser=e,this.name=Hu.KHR_MATERIALS_SPECULAR}getMaterialType(e){return ku(this.parser,e,this.name)===null?null:Ua}extendMaterialParams(e,t){let n=ku(this.parser,e,this.name);if(n===null)return Promise.resolve();let r=[];t.specularIntensity=n.specularFactor===void 0?1:n.specularFactor,n.specularTexture!==void 0&&r.push(this.parser.assignTexture(t,`specularIntensityMap`,n.specularTexture));let i=n.specularColorFactor||[1,1,1];return t.specularColor=new z().setRGB(i[0],i[1],i[2],Qt),n.specularColorTexture!==void 0&&r.push(this.parser.assignTexture(t,`specularColorMap`,n.specularColorTexture,Zt)),Promise.all(r)}},ed=class{constructor(e){this.parser=e,this.name=Hu.EXT_MATERIALS_BUMP}getMaterialType(e){return ku(this.parser,e,this.name)===null?null:Ua}extendMaterialParams(e,t){let n=ku(this.parser,e,this.name);if(n===null)return Promise.resolve();let r=[];return t.bumpScale=n.bumpFactor===void 0?1:n.bumpFactor,n.bumpTexture!==void 0&&r.push(this.parser.assignTexture(t,`bumpMap`,n.bumpTexture)),Promise.all(r)}},td=class{constructor(e){this.parser=e,this.name=Hu.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){return ku(this.parser,e,this.name)===null?null:Ua}extendMaterialParams(e,t){let n=ku(this.parser,e,this.name);if(n===null)return Promise.resolve();let r=[];return n.anisotropyStrength!==void 0&&(t.anisotropy=n.anisotropyStrength),n.anisotropyRotation!==void 0&&(t.anisotropyRotation=n.anisotropyRotation),n.anisotropyTexture!==void 0&&r.push(this.parser.assignTexture(t,`anisotropyMap`,n.anisotropyTexture)),Promise.all(r)}},nd=class{constructor(e){this.parser=e,this.name=Hu.KHR_TEXTURE_BASISU}loadTexture(e){let t=this.parser,n=t.json,r=n.textures[e];if(!r.extensions||!r.extensions[this.name])return null;let i=r.extensions[this.name],a=t.options.ktx2Loader;if(!a){if(n.extensionsRequired&&n.extensionsRequired.indexOf(this.name)>=0)throw Error(`THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures`);return null}return t.loadTextureImage(e,i.source,a)}},rd=class{constructor(e){this.parser=e,this.name=Hu.EXT_TEXTURE_WEBP}loadTexture(e){let t=this.name,n=this.parser,r=n.json,i=r.textures[e];if(!i.extensions||!i.extensions[t])return null;let a=i.extensions[t],o=r.images[a.source],s=n.textureLoader;if(o.uri){let e=n.options.manager.getHandler(o.uri);e!==null&&(s=e)}return n.loadTextureImage(e,a.source,s)}},id=class{constructor(e){this.parser=e,this.name=Hu.EXT_TEXTURE_AVIF}loadTexture(e){let t=this.name,n=this.parser,r=n.json,i=r.textures[e];if(!i.extensions||!i.extensions[t])return null;let a=i.extensions[t],o=r.images[a.source],s=n.textureLoader;if(o.uri){let e=n.options.manager.getHandler(o.uri);e!==null&&(s=e)}return n.loadTextureImage(e,a.source,s)}},ad=class{constructor(e,t){this.name=t,this.parser=e}loadBufferView(e){let t=this.parser.json,n=t.bufferViews[e];if(n.extensions&&n.extensions[this.name]){let e=n.extensions[this.name],r=this.parser.getDependency(`buffer`,e.buffer),i=this.parser.options.meshoptDecoder;if(!i||!i.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw Error(`THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files`);return null}return r.then(function(t){let n=e.byteOffset||0,r=e.byteLength||0,a=e.count,o=e.byteStride,s=new Uint8Array(t,n,r);return i.decodeGltfBufferAsync?i.decodeGltfBufferAsync(a,o,s,e.mode,e.filter).then(function(e){return e.buffer}):i.ready.then(function(){let t=new ArrayBuffer(a*o);return i.decodeGltfBuffer(new Uint8Array(t),a,o,s,e.mode,e.filter),t})})}return null}},od=class{constructor(e){this.name=Hu.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){let t=this.parser.json,n=t.nodes[e];if(!n.extensions||!n.extensions[this.name]||n.mesh===void 0)return null;let r=t.meshes[n.mesh];for(let e of r.primitives)if(e.mode!==_d.TRIANGLES&&e.mode!==_d.TRIANGLE_STRIP&&e.mode!==_d.TRIANGLE_FAN&&e.mode!==void 0)return null;let i=n.extensions[this.name].attributes,a=[],o={};for(let e in i)a.push(this.parser.getDependency(`accessor`,i[e]).then(t=>(o[e]=t,o[e])));return a.length<1?null:(a.push(this.parser.createNodeMesh(e)),Promise.all(a).then(e=>{let t=e.pop(),n=t.isGroup?t.children:[t],r=e[0].count,i=[];for(let e of n){let t=new Nn,n=new L,a=new mn,s=new L(1,1,1),c=new ra(e.geometry,e.material,r);for(let e=0;e<r;e++)o.TRANSLATION&&n.fromBufferAttribute(o.TRANSLATION,e),o.ROTATION&&a.fromBufferAttribute(o.ROTATION,e),o.SCALE&&s.fromBufferAttribute(o.SCALE,e),c.setMatrixAt(e,t.compose(n,a,s));for(let t in o)if(t===`_COLOR_0`){let e=o[t];c.instanceColor=new Yi(e.array,e.itemSize,e.normalized)}else t!==`TRANSLATION`&&t!==`ROTATION`&&t!==`SCALE`&&e.geometry.setAttribute(t,o[t]);or.prototype.copy.call(c,e),this.parser.assignFinalMaterial(c),i.push(c)}return t.isGroup?(t.clear(),t.add(...i),t):i[0]}))}},sd=`glTF`,cd=12,ld={JSON:1313821514,BIN:5130562},ud=class{constructor(e){this.name=Hu.KHR_BINARY_GLTF,this.content=null,this.body=null;let t=new DataView(e,0,cd),n=new TextDecoder;if(this.header={magic:n.decode(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==sd)throw Error(`THREE.GLTFLoader: Unsupported glTF-Binary header.`);if(this.header.version<2)throw Error(`THREE.GLTFLoader: Legacy binary file detected.`);let r=this.header.length-cd,i=new DataView(e,cd),a=0;for(;a<r;){let t=i.getUint32(a,!0);a+=4;let r=i.getUint32(a,!0);if(a+=4,r===ld.JSON){let r=new Uint8Array(e,cd+a,t);this.content=n.decode(r)}else if(r===ld.BIN){let n=cd+a;this.body=e.slice(n,n+t)}a+=t}if(this.content===null)throw Error(`THREE.GLTFLoader: JSON content not found.`)}},dd=class{constructor(e,t){if(!t)throw Error(`THREE.GLTFLoader: No DRACOLoader instance provided.`);this.name=Hu.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){let n=this.json,r=this.dracoLoader,i=e.extensions[this.name].bufferView,a=e.extensions[this.name].attributes,o={},s={},c={};for(let e in a){let t=Sd[e]||e.toLowerCase();o[t]=a[e]}for(let t in e.attributes){let r=Sd[t]||t.toLowerCase();if(a[t]!==void 0){let i=n.accessors[e.attributes[t]];c[r]=vd[i.componentType].name,s[r]=i.normalized===!0}}return t.getDependency(`bufferView`,i).then(function(e){return new Promise(function(t,n){r.decodeDracoFile(e,function(e){for(let t in e.attributes){let n=e.attributes[t],r=s[t];r!==void 0&&(n.normalized=r)}t(e)},o,c,Qt,n)})})}},fd=class{constructor(){this.name=Hu.KHR_TEXTURE_TRANSFORM}extendTexture(e,t){return(t.texCoord===void 0||t.texCoord===e.channel)&&t.offset===void 0&&t.rotation===void 0&&t.scale===void 0?e:(e=e.clone(),t.texCoord!==void 0&&(e.channel=t.texCoord),t.offset!==void 0&&e.offset.fromArray(t.offset),t.rotation!==void 0&&(e.rotation=t.rotation),t.scale!==void 0&&e.repeat.fromArray(t.scale),e.needsUpdate=!0,e)}},pd=class{constructor(){this.name=Hu.KHR_MESH_QUANTIZATION}},md=class extends Ka{constructor(e,t,n,r){super(e,t,n,r)}copySampleValue_(e){let t=this.resultBuffer,n=this.sampleValues,r=this.valueSize,i=e*r*3+r;for(let e=0;e!==r;e++)t[e]=n[i+e];return t}interpolate_(e,t,n,r){let i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=o*2,c=o*3,l=r-t,u=(n-t)/l,d=u*u,f=d*u,p=e*c,m=p-c,h=-2*f+3*d,g=f-d,_=1-h,v=g-d+u;for(let e=0;e!==o;e++){let t=a[m+e+o],n=a[m+e+s]*l,r=a[p+e+o],c=a[p+e]*l;i[e]=_*t+v*n+h*r+g*c}return i}},hd=new mn,gd=class extends md{interpolate_(e,t,n,r){let i=super.interpolate_(e,t,n,r);return hd.fromArray(i).normalize().toArray(i),i}},_d={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123},vd={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},yd={9728:N,9729:F,9984:Pe,9985:Fe,9986:P,9987:Ie},bd={33071:Me,33648:Ne,10497:je},xd={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Sd={POSITION:`position`,NORMAL:`normal`,TANGENT:`tangent`,TEXCOORD_0:`uv`,TEXCOORD_1:`uv1`,TEXCOORD_2:`uv2`,TEXCOORD_3:`uv3`,COLOR_0:`color`,WEIGHTS_0:`skinWeight`,JOINTS_0:`skinIndex`},Cd={scale:`scale`,translation:`position`,rotation:`quaternion`,weights:`morphTargetInfluences`},wd={CUBICSPLINE:void 0,LINEAR:Ut,STEP:Ht},Td={OPAQUE:`OPAQUE`,MASK:`MASK`,BLEND:`BLEND`},Ed=new Nn,Dd=class{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new Ou,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let n=!1,r=-1,i=!1,a=-1;if(typeof navigator<`u`&&navigator.userAgent!==void 0){let e=navigator.userAgent;n=/^((?!chrome|android).)*safari/i.test(e)===!0;let t=e.match(/Version\\/(\\d+)/);r=n&&t?parseInt(t[1],10):-1,i=e.indexOf(`Firefox`)>-1,a=i?e.match(/Firefox\\/([0-9]+)\\./)[1]:-1}this.textureLoader=typeof createImageBitmap>`u`||n&&r<17||i&&a<98?new go(this.options.manager):new Bo(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new po(this.options.manager),this.fileLoader.setResponseType(`arraybuffer`),this.options.crossOrigin===`use-credentials`&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){let n=this,r=this.json,i=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(e){return e._markDefs&&e._markDefs()}),Promise.all(this._invokeAll(function(e){return e.beforeRoot&&e.beforeRoot()})).then(function(){return Promise.all([n.getDependencies(`scene`),n.getDependencies(`animation`),n.getDependencies(`camera`)])}).then(function(t){let a={scene:t[0][r.scene||0],scenes:t[0],animations:t[1],cameras:t[2],asset:r.asset,parser:n,userData:{}};return ju(i,a,r),Mu(a,r),Promise.all(n._invokeAll(function(e){return e.afterRoot&&e.afterRoot(a)})).then(function(){for(let e of a.scenes)e.updateMatrixWorld();e(a)})}).catch(t)}_markDefs(){let e=this.json.nodes||[],t=this.json.skins||[],n=this.json.meshes||[];for(let n=0,r=t.length;n<r;n++){let r=t[n].joints;for(let t=0,n=r.length;t<n;t++)e[r[t]].isBone=!0}for(let t=0,r=e.length;t<r;t++){let r=e[t];r.mesh!==void 0&&(this._addNodeRef(this.meshCache,r.mesh),r.skin!==void 0&&(n[r.mesh].isSkinnedMesh=!0)),r.camera!==void 0&&this._addNodeRef(this.cameraCache,r.camera)}}_addNodeRef(e,t){t!==void 0&&(e.refs[t]===void 0&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}_getNodeRef(e,t,n){if(e.refs[t]<=1)return n;let r=n.clone(),i=(e,t)=>{let n=this.associations.get(e);n!=null&&this.associations.set(t,n);for(let[n,r]of e.children.entries())i(r,t.children[n])};return i(n,r),r.name+=`_instance_`+e.uses[t]++,r}_invokeOne(e){let t=Object.values(this.plugins);t.push(this);for(let n=0;n<t.length;n++){let r=e(t[n]);if(r)return r}return null}_invokeAll(e){let t=Object.values(this.plugins);t.unshift(this);let n=[];for(let r=0;r<t.length;r++){let i=e(t[r]);i&&n.push(i)}return n}getDependency(e,t){let n=e+`:`+t,r=this.cache.get(n);if(!r){switch(e){case`scene`:r=this.loadScene(t);break;case`node`:r=this._invokeOne(function(e){return e.loadNode&&e.loadNode(t)});break;case`mesh`:r=this._invokeOne(function(e){return e.loadMesh&&e.loadMesh(t)});break;case`accessor`:r=this.loadAccessor(t);break;case`bufferView`:r=this._invokeOne(function(e){return e.loadBufferView&&e.loadBufferView(t)});break;case`buffer`:r=this.loadBuffer(t);break;case`material`:r=this._invokeOne(function(e){return e.loadMaterial&&e.loadMaterial(t)});break;case`texture`:r=this._invokeOne(function(e){return e.loadTexture&&e.loadTexture(t)});break;case`skin`:r=this.loadSkin(t);break;case`animation`:r=this._invokeOne(function(e){return e.loadAnimation&&e.loadAnimation(t)});break;case`camera`:r=this.loadCamera(t);break;default:if(r=this._invokeOne(function(n){return n!=this&&n.getDependency&&n.getDependency(e,t)}),!r)throw Error(`Unknown type: `+e)}this.cache.add(n,r)}return r}getDependencies(e){let t=this.cache.get(e);if(!t){let n=this,r=this.json[e+(e===`mesh`?`es`:`s`)]||[];t=Promise.all(r.map(function(t,r){return n.getDependency(e,r)})),this.cache.add(e,t)}return t}loadBuffer(e){let t=this.json.buffers[e],n=this.fileLoader;if(t.type&&t.type!==`arraybuffer`)throw Error(`THREE.GLTFLoader: `+t.type+` buffer type is not supported.`);if(t.uri===void 0&&e===0)return Promise.resolve(this.extensions[Hu.KHR_BINARY_GLTF].body);let r=this.options;return new Promise(function(e,i){n.load(Ro.resolveURL(t.uri,r.path),e,void 0,function(){i(Error(`THREE.GLTFLoader: Failed to load buffer \"`+t.uri+`\".`))})})}loadBufferView(e){let t=this.json.bufferViews[e];return this.getDependency(`buffer`,t.buffer).then(function(e){let n=t.byteLength||0,r=t.byteOffset||0;return e.slice(r,r+n)})}loadAccessor(e){let t=this,n=this.json,r=this.json.accessors[e];if(r.bufferView===void 0&&r.sparse===void 0){let e=xd[r.type],t=vd[r.componentType],n=r.normalized===!0,i=new t(r.count*e);return Promise.resolve(new Kr(i,e,n))}let i=[];return r.bufferView===void 0?i.push(null):i.push(this.getDependency(`bufferView`,r.bufferView)),r.sparse!==void 0&&(i.push(this.getDependency(`bufferView`,r.sparse.indices.bufferView)),i.push(this.getDependency(`bufferView`,r.sparse.values.bufferView))),Promise.all(i).then(function(e){let i=e[0],a=xd[r.type],o=vd[r.componentType],s=o.BYTES_PER_ELEMENT,c=s*a,l=r.byteOffset||0,u=r.bufferView===void 0?void 0:n.bufferViews[r.bufferView].byteStride,d=r.normalized===!0,f,p;if(u&&u!==c){let e=Math.floor(l/u),n=`InterleavedBuffer:`+r.bufferView+`:`+r.componentType+`:`+e+`:`+r.count,c=t.cache.get(n);c||(f=new o(i,e*u,r.count*u/s),c=new ci(f,u/s),t.cache.add(n,c)),p=new ui(c,a,l%u/s,d)}else f=i===null?new o(r.count*a):new o(i,l,r.count*a),p=new Kr(f,a,d);if(r.sparse!==void 0){let t=xd.SCALAR,n=vd[r.sparse.indices.componentType],s=r.sparse.indices.byteOffset||0,c=r.sparse.values.byteOffset||0,l=new n(e[1],s,r.sparse.count*t),u=new o(e[2],c,r.sparse.count*a);i!==null&&(p=new Kr(p.array.slice(),p.itemSize,p.normalized)),p.normalized=!1;for(let e=0,t=l.length;e<t;e++){let t=l[e];if(p.setX(t,u[e*a]),a>=2&&p.setY(t,u[e*a+1]),a>=3&&p.setZ(t,u[e*a+2]),a>=4&&p.setW(t,u[e*a+3]),a>=5)throw Error(`THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.`)}p.normalized=d}return p})}loadTexture(e){let t=this.json,n=this.options,r=t.textures[e].source,i=t.images[r],a=this.textureLoader;if(i.uri){let e=n.manager.getHandler(i.uri);e!==null&&(a=e)}return this.loadTextureImage(e,r,a)}loadTextureImage(e,t,n){let r=this,i=this.json,a=i.textures[e],o=i.images[t],s=(o.uri||o.bufferView)+`:`+a.sampler;if(this.textureCache[s])return this.textureCache[s];let c=this.loadImageSource(t,n).then(function(t){t.flipY=!1,t.name=a.name||o.name||``,t.name===``&&typeof o.uri==`string`&&o.uri.startsWith(`data:image/`)===!1&&(t.name=o.uri);let n=(i.samplers||{})[a.sampler]||{};return t.magFilter=yd[n.magFilter]||1006,t.minFilter=yd[n.minFilter]||1008,t.wrapS=bd[n.wrapS]||1e3,t.wrapT=bd[n.wrapT]||1e3,t.generateMipmaps=!t.isCompressedTexture&&t.minFilter!==1003&&t.minFilter!==1006,r.associations.set(t,{textures:e}),t}).catch(function(){return null});return this.textureCache[s]=c,c}loadImageSource(e,t){let n=this,r=this.json,i=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(e=>e.clone());let a=r.images[e],o=self.URL||self.webkitURL,s=a.uri||``,c=!1;if(a.bufferView!==void 0)s=n.getDependency(`bufferView`,a.bufferView).then(function(e){c=!0;let t=new Blob([e],{type:a.mimeType});return s=o.createObjectURL(t),s});else if(a.uri===void 0)throw Error(`THREE.GLTFLoader: Image `+e+` is missing URI and bufferView`);let l=Promise.resolve(s).then(function(e){return new Promise(function(n,r){let a=n;t.isImageBitmapLoader===!0&&(a=function(e){let t=new Dn(e);t.needsUpdate=!0,n(t)}),t.load(Ro.resolveURL(e,i.path),a,void 0,r)})}).then(function(e){return c===!0&&o.revokeObjectURL(s),Mu(e,a),e.userData.mimeType=a.mimeType||Ru(a.uri),e}).catch(function(e){throw console.error(`THREE.GLTFLoader: Couldn't load texture`,s),e});return this.sourceCache[e]=l,l}assignTexture(e,t,n,r){let i=this;return this.getDependency(`texture`,n.index).then(function(a){if(!a)return null;if(n.texCoord!==void 0&&n.texCoord>0&&(a=a.clone(),a.channel=n.texCoord),i.extensions[Hu.KHR_TEXTURE_TRANSFORM]){let e=n.extensions===void 0?void 0:n.extensions[Hu.KHR_TEXTURE_TRANSFORM];if(e){let t=i.associations.get(a);a=i.extensions[Hu.KHR_TEXTURE_TRANSFORM].extendTexture(a,e),i.associations.set(a,t)}}return r!==void 0&&(a.colorSpace=r),e[t]=a,a})}assignFinalMaterial(e){let t=e.geometry,n=e.material,r=t.attributes.tangent===void 0,i=t.attributes.color!==void 0,a=t.attributes.normal===void 0;if(e.isPoints){let e=`PointsMaterial:`+n.uuid,t=this.cache.get(e);t||(t=new Ta,fi.prototype.copy.call(t,n),t.color.copy(n.color),t.map=n.map,t.sizeAttenuation=!1,this.cache.add(e,t)),n=t}else if(e.isLine){let e=`LineBasicMaterial:`+n.uuid,t=this.cache.get(e);t||(t=new fa,fi.prototype.copy.call(t,n),t.color.copy(n.color),t.map=n.map,this.cache.add(e,t)),n=t}if(r||i||a){let e=`ClonedMaterial:`+n.uuid+`:`;r&&(e+=`derivative-tangents:`),i&&(e+=`vertex-colors:`),a&&(e+=`flat-shading:`);let t=this.cache.get(e);t||(t=n.clone(),i&&(t.vertexColors=!0),a&&(t.flatShading=!0),r&&(t.normalScale&&(t.normalScale.y*=-1),t.clearcoatNormalScale&&(t.clearcoatNormalScale.y*=-1)),this.cache.add(e,t),this.associations.set(t,this.associations.get(n))),n=t}e.material=n}getMaterialType(){return Ha}loadMaterial(e){let t=this,n=this.json,r=this.extensions,i=n.materials[e],a,o={},s=i.extensions||{},c=[];if(s[Hu.KHR_MATERIALS_UNLIT]){let e=r[Hu.KHR_MATERIALS_UNLIT];a=e.getMaterialType(),c.push(e.extendParams(o,i,t))}else{let n=i.pbrMetallicRoughness||{};if(o.color=new z(1,1,1),o.opacity=1,Array.isArray(n.baseColorFactor)){let e=n.baseColorFactor;o.color.setRGB(e[0],e[1],e[2],Qt),o.opacity=e[3]}n.baseColorTexture!==void 0&&c.push(t.assignTexture(o,`map`,n.baseColorTexture,Zt)),o.metalness=n.metallicFactor===void 0?1:n.metallicFactor,o.roughness=n.roughnessFactor===void 0?1:n.roughnessFactor,n.metallicRoughnessTexture!==void 0&&(c.push(t.assignTexture(o,`metalnessMap`,n.metallicRoughnessTexture)),c.push(t.assignTexture(o,`roughnessMap`,n.metallicRoughnessTexture))),a=this._invokeOne(function(t){return t.getMaterialType&&t.getMaterialType(e)}),c.push(Promise.all(this._invokeAll(function(t){return t.extendMaterialParams&&t.extendMaterialParams(e,o)})))}i.doubleSided===!0&&(o.side=2);let l=i.alphaMode||Td.OPAQUE;if(l===Td.BLEND?(o.transparent=!0,o.depthWrite=!1):(o.transparent=!1,l===Td.MASK&&(o.alphaTest=i.alphaCutoff===void 0?.5:i.alphaCutoff)),i.normalTexture!==void 0&&a!==xi&&(c.push(t.assignTexture(o,`normalMap`,i.normalTexture)),o.normalScale=new I(1,1),i.normalTexture.scale!==void 0)){let e=i.normalTexture.scale;o.normalScale.set(e,e)}if(i.occlusionTexture!==void 0&&a!==xi&&(c.push(t.assignTexture(o,`aoMap`,i.occlusionTexture)),i.occlusionTexture.strength!==void 0&&(o.aoMapIntensity=i.occlusionTexture.strength)),i.emissiveFactor!==void 0&&a!==xi){let e=i.emissiveFactor;o.emissive=new z().setRGB(e[0],e[1],e[2],Qt)}return i.emissiveTexture!==void 0&&a!==xi&&c.push(t.assignTexture(o,`emissiveMap`,i.emissiveTexture,Zt)),Promise.all(c).then(function(){let n=new a(o);return i.name&&(n.name=i.name),Mu(n,i),t.associations.set(n,{materials:e}),i.extensions&&ju(r,n,i),n})}createUniqueName(e){let t=ns.sanitizeNodeName(e||``);return t in this.nodeNamesUsed?t+`_`+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){let t=this,n=this.extensions,r=this.primitiveCache;function i(e){return n[Hu.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(e,t).then(function(n){return Bu(n,e,t)})}let a=[];for(let n=0,o=e.length;n<o;n++){let o=e[n],s=Fu(o),c=r[s];if(c)a.push(c.promise);else{let e;e=o.extensions&&o.extensions[Hu.KHR_DRACO_MESH_COMPRESSION]?i(o):Bu(new si,o,t),r[s]={primitive:o,promise:e},a.push(e)}}return Promise.all(a)}loadMesh(e){let t=this,n=this.json,r=this.extensions,i=n.meshes[e],a=i.primitives,o=[];for(let e=0,t=a.length;e<t;e++){let t=a[e].material===void 0?Au(this.cache):this.getDependency(`material`,a[e].material);o.push(t)}return o.push(t.loadGeometries(a)),Promise.all(o).then(function(n){let o=n.slice(0,n.length-1),s=n[n.length-1],c=[];for(let n=0,l=s.length;n<l;n++){let l=s[n],u=a[n],d,f=o[n];if(u.mode===_d.TRIANGLES||u.mode===_d.TRIANGLE_STRIP||u.mode===_d.TRIANGLE_FAN||u.mode===void 0)d=i.isSkinnedMesh===!0?new Ui(l,f):new Ni(l,f),d.isSkinnedMesh===!0&&d.normalizeSkinWeights(),u.mode===_d.TRIANGLE_STRIP?d.geometry=Cu(d.geometry,1):u.mode===_d.TRIANGLE_FAN&&(d.geometry=Cu(d.geometry,2));else if(u.mode===_d.LINES)d=new Ca(l,f);else if(u.mode===_d.LINE_STRIP)d=new ba(l,f);else if(u.mode===_d.LINE_LOOP)d=new wa(l,f);else if(u.mode===_d.POINTS)d=new Aa(l,f);else throw Error(`THREE.GLTFLoader: Primitive mode unsupported: `+u.mode);Object.keys(d.geometry.morphAttributes).length>0&&Pu(d,i),d.name=t.createUniqueName(i.name||`mesh_`+e),Mu(d,i),u.extensions&&ju(r,d,u),t.assignFinalMaterial(d),c.push(d)}for(let n=0,r=c.length;n<r;n++)t.associations.set(c[n],{meshes:e,primitives:n});if(c.length===1)return i.extensions&&ju(r,c[0],i),c[0];let l=new sr;i.extensions&&ju(r,l,i),t.associations.set(l,{meshes:e});for(let e=0,t=c.length;e<t;e++)l.add(c[e]);return l})}loadCamera(e){let t,n=this.json.cameras[e],r=n[n.type];if(!r){console.warn(`THREE.GLTFLoader: Missing camera parameters.`);return}return n.type===`perspective`?t=new ko(pn.radToDeg(r.yfov),r.aspectRatio||1,r.znear||1,r.zfar||2e6):n.type===`orthographic`&&(t=new Po(-r.xmag,r.xmag,r.ymag,-r.ymag,r.znear,r.zfar)),n.name&&(t.name=this.createUniqueName(n.name)),Mu(t,n),Promise.resolve(t)}loadSkin(e){let t=this.json.skins[e],n=[];for(let e=0,r=t.joints.length;e<r;e++)n.push(this._loadNodeShallow(t.joints[e]));return t.inverseBindMatrices===void 0?n.push(null):n.push(this.getDependency(`accessor`,t.inverseBindMatrices)),Promise.all(n).then(function(e){let n=e.pop(),r=e,i=[],a=[];for(let e=0,o=r.length;e<o;e++){let o=r[e];if(o){i.push(o);let t=new Nn;n!==null&&t.fromArray(n.array,e*16),a.push(t)}else console.warn(`THREE.GLTFLoader: Joint \"%s\" could not be found.`,t.joints[e])}return new Ji(i,a)})}loadAnimation(e){let t=this.json,n=this,r=t.animations[e],i=r.name?r.name:`animation_`+e,a=[],o=[],s=[],c=[],l=[];for(let e=0,t=r.channels.length;e<t;e++){let t=r.channels[e],n=r.samplers[t.sampler],i=t.target,u=i.node,d=r.parameters===void 0?n.input:r.parameters[n.input],f=r.parameters===void 0?n.output:r.parameters[n.output];i.node!==void 0&&(a.push(this.getDependency(`node`,u)),o.push(this.getDependency(`accessor`,d)),s.push(this.getDependency(`accessor`,f)),c.push(n),l.push(i))}return Promise.all([Promise.all(a),Promise.all(o),Promise.all(s),Promise.all(c),Promise.all(l)]).then(function(e){let t=e[0],a=e[1],o=e[2],s=e[3],c=e[4],l=[];for(let e=0,r=t.length;e<r;e++){let r=t[e],i=a[e],u=o[e],d=s[e],f=c[e];if(r===void 0)continue;r.updateMatrix&&r.updateMatrix();let p=n._createAnimationTracks(r,i,u,d,f);if(p)for(let e=0;e<p.length;e++)l.push(p[e])}let u=new ao(i,void 0,l);return Mu(u,r),u})}createNodeMesh(e){let t=this.json,n=this,r=t.nodes[e];return r.mesh===void 0?null:n.getDependency(`mesh`,r.mesh).then(function(e){let t=n._getNodeRef(n.meshCache,r.mesh,e);return r.weights!==void 0&&t.traverse(function(e){if(e.isMesh)for(let t=0,n=r.weights.length;t<n;t++)e.morphTargetInfluences[t]=r.weights[t]}),t})}loadNode(e){let t=this.json,n=this,r=t.nodes[e],i=n._loadNodeShallow(e),a=[],o=r.children||[];for(let e=0,t=o.length;e<t;e++)a.push(n.getDependency(`node`,o[e]));let s=r.skin===void 0?Promise.resolve(null):n.getDependency(`skin`,r.skin);return Promise.all([i,Promise.all(a),s]).then(function(e){let t=e[0],n=e[1],r=e[2];r!==null&&t.traverse(function(e){e.isSkinnedMesh&&e.bind(r,Ed)});for(let e=0,r=n.length;e<r;e++)t.add(n[e]);if(t.userData.pivot!==void 0&&n.length>0){let e=t.userData.pivot,r=n[0];t.pivot=new L().fromArray(e),t.position.x-=e[0],t.position.y-=e[1],t.position.z-=e[2],r.position.set(0,0,0),delete t.userData.pivot}return t})}_loadNodeShallow(e){let t=this.json,n=this.extensions,r=this;if(this.nodeCache[e]!==void 0)return this.nodeCache[e];let i=t.nodes[e],a=i.name?r.createUniqueName(i.name):``,o=[],s=r._invokeOne(function(t){return t.createNodeMesh&&t.createNodeMesh(e)});return s&&o.push(s),i.camera!==void 0&&o.push(r.getDependency(`camera`,i.camera).then(function(e){return r._getNodeRef(r.cameraCache,i.camera,e)})),r._invokeAll(function(t){return t.createNodeAttachment&&t.createNodeAttachment(e)}).forEach(function(e){o.push(e)}),this.nodeCache[e]=Promise.all(o).then(function(t){let o;if(o=i.isBone===!0?new Wi:t.length>1?new sr:t.length===1?t[0]:new or,o!==t[0])for(let e=0,n=t.length;e<n;e++)o.add(t[e]);if(i.name&&(o.userData.name=i.name,o.name=a),Mu(o,i),i.extensions&&ju(n,o,i),i.matrix!==void 0){let e=new Nn;e.fromArray(i.matrix),o.applyMatrix4(e)}else i.translation!==void 0&&o.position.fromArray(i.translation),i.rotation!==void 0&&o.quaternion.fromArray(i.rotation),i.scale!==void 0&&o.scale.fromArray(i.scale);if(!r.associations.has(o))r.associations.set(o,{});else if(i.mesh!==void 0&&r.meshCache.refs[i.mesh]>1){let e=r.associations.get(o);r.associations.set(o,{...e})}return r.associations.get(o).nodes=e,o}),this.nodeCache[e]}loadScene(e){let t=this.extensions,n=this.json.scenes[e],r=this,i=new sr;n.name&&(i.name=r.createUniqueName(n.name)),Mu(i,n),n.extensions&&ju(t,i,n);let a=n.nodes||[],o=[];for(let e=0,t=a.length;e<t;e++)o.push(r.getDependency(`node`,a[e]));return Promise.all(o).then(function(e){for(let t=0,n=e.length;t<n;t++){let n=e[t];n.parent===null?i.add(n):i.add(Tu(n))}return r.associations=(e=>{let t=new Map;for(let[e,n]of r.associations)(e instanceof fi||e instanceof Dn)&&t.set(e,n);return e.traverse(e=>{let n=r.associations.get(e);n!=null&&t.set(e,n)}),t})(i),i})}_createAnimationTracks(e,t,n,r,i){let a=[],o=e.name?e.name:e.uuid,s=[];function c(e){e.morphTargetInfluences&&s.push(e.name?e.name:e.uuid)}Cd[i.path]===Cd.weights?(c(e),e.isGroup&&e.children.forEach(c)):s.push(o);let l;switch(Cd[i.path]){case Cd.weights:l=eo;break;case Cd.rotation:l=no;break;case Cd.translation:case Cd.scale:l=io;break;default:switch(n.itemSize){case 1:l=eo;break;default:l=io}}let u=r.interpolation===void 0?Ut:wd[r.interpolation],d=this._getArrayFromAccessor(n);for(let e=0,n=s.length;e<n;e++){let n=new l(s[e]+`.`+Cd[i.path],t.array,d,u);r.interpolation===`CUBICSPLINE`&&this._createCubicSplineTrackInterpolant(n),a.push(n)}return a}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){let e=Lu(t.constructor),n=new Float32Array(t.length);for(let r=0,i=t.length;r<i;r++)n[r]=t[r]*e;t=n}return t}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(e){return new(this instanceof no?gd:md)(this.times,this.values,this.getValueSize()/3,e)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}}));function kd(e){this.enabled!==!1&&(this._pointers.length===0&&(this.domElement.setPointerCapture(e.pointerId),this.domElement.ownerDocument.addEventListener(`pointermove`,this._onPointerMove),this.domElement.ownerDocument.addEventListener(`pointerup`,this._onPointerUp)),!this._isTrackingPointer(e)&&(this._addPointer(e),e.pointerType===`touch`?this._onTouchStart(e):this._onMouseDown(e),this._cursorStyle===`grab`&&(this.domElement.style.cursor=`grabbing`)))}function Ad(e){this.enabled!==!1&&(e.pointerType===`touch`?this._onTouchMove(e):this._onMouseMove(e))}function jd(e){switch(this._removePointer(e),this._pointers.length){case 0:this.domElement.releasePointerCapture(e.pointerId),this.domElement.ownerDocument.removeEventListener(`pointermove`,this._onPointerMove),this.domElement.ownerDocument.removeEventListener(`pointerup`,this._onPointerUp),this.dispatchEvent(Ud),this.state=Yd.NONE,this._cursorStyle===`grab`&&(this.domElement.style.cursor=`grab`);break;case 1:let t=this._pointers[0],n=this._pointerPositions[t];this._onTouchStart({pointerId:t,pageX:n.x,pageY:n.y})}}function Md(e){let t;switch(e.button){case 0:t=this.mouseButtons.LEFT;break;case 1:t=this.mouseButtons.MIDDLE;break;case 2:t=this.mouseButtons.RIGHT;break;default:t=-1}switch(t){case ke.DOLLY:if(this.enableZoom===!1)return;this._handleMouseDownDolly(e),this.state=Yd.DOLLY;break;case ke.ROTATE:if(e.ctrlKey||e.metaKey||e.shiftKey){if(this.enablePan===!1)return;this._handleMouseDownPan(e),this.state=Yd.PAN}else{if(this.enableRotate===!1)return;this._handleMouseDownRotate(e),this.state=Yd.ROTATE}break;case ke.PAN:if(e.ctrlKey||e.metaKey||e.shiftKey){if(this.enableRotate===!1)return;this._handleMouseDownRotate(e),this.state=Yd.ROTATE}else{if(this.enablePan===!1)return;this._handleMouseDownPan(e),this.state=Yd.PAN}break;default:this.state=Yd.NONE}this.state!==Yd.NONE&&this.dispatchEvent(Hd)}function Nd(e){switch(this.state){case Yd.ROTATE:if(this.enableRotate===!1)return;this._handleMouseMoveRotate(e);break;case Yd.DOLLY:if(this.enableZoom===!1)return;this._handleMouseMoveDolly(e);break;case Yd.PAN:if(this.enablePan===!1)return;this._handleMouseMovePan(e)}}function Pd(e){this.enabled!==!1&&this.enableZoom!==!1&&this.state===Yd.NONE&&(e.preventDefault(),this.dispatchEvent(Hd),this._handleMouseWheel(this._customWheelEvent(e)),this.dispatchEvent(Ud))}function Fd(e){this.enabled!==!1&&this._handleKeyDown(e)}function Id(e){switch(this._trackPointer(e),this._pointers.length){case 1:switch(this.touches.ONE){case Ae.ROTATE:if(this.enableRotate===!1)return;this._handleTouchStartRotate(e),this.state=Yd.TOUCH_ROTATE;break;case Ae.PAN:if(this.enablePan===!1)return;this._handleTouchStartPan(e),this.state=Yd.TOUCH_PAN;break;default:this.state=Yd.NONE}break;case 2:switch(this.touches.TWO){case Ae.DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchStartDollyPan(e),this.state=Yd.TOUCH_DOLLY_PAN;break;case Ae.DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchStartDollyRotate(e),this.state=Yd.TOUCH_DOLLY_ROTATE;break;default:this.state=Yd.NONE}break;default:this.state=Yd.NONE}this.state!==Yd.NONE&&this.dispatchEvent(Hd)}function Ld(e){switch(this._trackPointer(e),this.state){case Yd.TOUCH_ROTATE:if(this.enableRotate===!1)return;this._handleTouchMoveRotate(e),this.update();break;case Yd.TOUCH_PAN:if(this.enablePan===!1)return;this._handleTouchMovePan(e),this.update();break;case Yd.TOUCH_DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchMoveDollyPan(e),this.update();break;case Yd.TOUCH_DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchMoveDollyRotate(e),this.update();break;default:this.state=Yd.NONE}}function Rd(e){this.enabled!==!1&&e.preventDefault()}function zd(e){e.key===`Control`&&(this._controlActive=!0,this.domElement.getRootNode().addEventListener(`keyup`,this._interceptControlUp,{passive:!0,capture:!0}))}function Bd(e){e.key===`Control`&&(this._controlActive=!1,this.domElement.getRootNode().removeEventListener(`keyup`,this._interceptControlUp,{passive:!0,capture:!0}))}var Vd,Hd,Ud,Wd,Gd,Kd,qd,Jd,Yd,Xd,Zd,Qd=t((()=>{Su(),Vd={type:`change`},Hd={type:`start`},Ud={type:`end`},Wd=new bi,Gd=new sa,Kd=Math.cos(70*pn.DEG2RAD),qd=new L,Jd=2*Math.PI,Yd={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},Xd=1e-6,Zd=class extends is{constructor(e,t=null){super(e,t),this.state=Yd.NONE,this.target=new L,this.cursor=new L,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.keyRotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:`ArrowLeft`,UP:`ArrowUp`,RIGHT:`ArrowRight`,BOTTOM:`ArrowDown`},this.mouseButtons={LEFT:ke.ROTATE,MIDDLE:ke.DOLLY,RIGHT:ke.PAN},this.touches={ONE:Ae.ROTATE,TWO:Ae.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._cursorStyle=`auto`,this._domElementKeyEvents=null,this._lastPosition=new L,this._lastQuaternion=new mn,this._lastTargetPosition=new L,this._quat=new mn().setFromUnitVectors(e.up,new L(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new rs,this._sphericalDelta=new rs,this._scale=1,this._panOffset=new L,this._rotateStart=new I,this._rotateEnd=new I,this._rotateDelta=new I,this._panStart=new I,this._panEnd=new I,this._panDelta=new I,this._dollyStart=new I,this._dollyEnd=new I,this._dollyDelta=new I,this._dollyDirection=new L,this._mouse=new I,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._onPointerMove=Ad.bind(this),this._onPointerDown=kd.bind(this),this._onPointerUp=jd.bind(this),this._onContextMenu=Rd.bind(this),this._onMouseWheel=Pd.bind(this),this._onKeyDown=Fd.bind(this),this._onTouchStart=Id.bind(this),this._onTouchMove=Ld.bind(this),this._onMouseDown=Md.bind(this),this._onMouseMove=Nd.bind(this),this._interceptControlDown=zd.bind(this),this._interceptControlUp=Bd.bind(this),this.domElement!==null&&this.connect(this.domElement),this.update()}set cursorStyle(e){this._cursorStyle=e,e===`grab`?this.domElement.style.cursor=`grab`:this.domElement.style.cursor=`auto`}get cursorStyle(){return this._cursorStyle}connect(e){super.connect(e),this.domElement.addEventListener(`pointerdown`,this._onPointerDown),this.domElement.addEventListener(`pointercancel`,this._onPointerUp),this.domElement.addEventListener(`contextmenu`,this._onContextMenu),this.domElement.addEventListener(`wheel`,this._onMouseWheel,{passive:!1}),this.domElement.getRootNode().addEventListener(`keydown`,this._interceptControlDown,{passive:!0,capture:!0}),this.domElement.style.touchAction=`none`}disconnect(){this.domElement.removeEventListener(`pointerdown`,this._onPointerDown),this.domElement.ownerDocument.removeEventListener(`pointermove`,this._onPointerMove),this.domElement.ownerDocument.removeEventListener(`pointerup`,this._onPointerUp),this.domElement.removeEventListener(`pointercancel`,this._onPointerUp),this.domElement.removeEventListener(`wheel`,this._onMouseWheel),this.domElement.removeEventListener(`contextmenu`,this._onContextMenu),this.stopListenToKeyEvents(),this.domElement.getRootNode().removeEventListener(`keydown`,this._interceptControlDown,{capture:!0}),this.domElement.style.touchAction=``}dispose(){this.disconnect()}getPolarAngle(){return this._spherical.phi}getAzimuthalAngle(){return this._spherical.theta}getDistance(){return this.object.position.distanceTo(this.target)}listenToKeyEvents(e){e.addEventListener(`keydown`,this._onKeyDown),this._domElementKeyEvents=e}stopListenToKeyEvents(){this._domElementKeyEvents!==null&&(this._domElementKeyEvents.removeEventListener(`keydown`,this._onKeyDown),this._domElementKeyEvents=null)}saveState(){this.target0.copy(this.target),this.position0.copy(this.object.position),this.zoom0=this.object.zoom}reset(){this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(Vd),this.update(),this.state=Yd.NONE}pan(e,t){this._pan(e,t),this.update()}dollyIn(e){this._dollyIn(e),this.update()}dollyOut(e){this._dollyOut(e),this.update()}rotateLeft(e){this._rotateLeft(e),this.update()}rotateUp(e){this._rotateUp(e),this.update()}update(e=null){let t=this.object.position;qd.copy(t).sub(this.target),qd.applyQuaternion(this._quat),this._spherical.setFromVector3(qd),this.autoRotate&&this.state===Yd.NONE&&this._rotateLeft(this._getAutoRotationAngle(e)),this.enableDamping?(this._spherical.theta+=this._sphericalDelta.theta*this.dampingFactor,this._spherical.phi+=this._sphericalDelta.phi*this.dampingFactor):(this._spherical.theta+=this._sphericalDelta.theta,this._spherical.phi+=this._sphericalDelta.phi);let n=this.minAzimuthAngle,r=this.maxAzimuthAngle;isFinite(n)&&isFinite(r)&&(n<-Math.PI?n+=Jd:n>Math.PI&&(n-=Jd),r<-Math.PI?r+=Jd:r>Math.PI&&(r-=Jd),n<=r?this._spherical.theta=Math.max(n,Math.min(r,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(n+r)/2?Math.max(n,this._spherical.theta):Math.min(r,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let i=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{let e=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),i=e!=this._spherical.radius}if(qd.setFromSpherical(this._spherical),qd.applyQuaternion(this._quatInverse),t.copy(this.target).add(qd),this.object.lookAt(this.target),this.enableDamping===!0?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let e=null;if(this.object.isPerspectiveCamera){let t=qd.length();e=this._clampDistance(t*this._scale);let n=t-e;this.object.position.addScaledVector(this._dollyDirection,n),this.object.updateMatrixWorld(),i=!!n}else if(this.object.isOrthographicCamera){let t=new L(this._mouse.x,this._mouse.y,0);t.unproject(this.object);let n=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),i=n!==this.object.zoom;let r=new L(this._mouse.x,this._mouse.y,0);r.unproject(this.object),this.object.position.sub(r).add(t),this.object.updateMatrixWorld(),e=qd.length()}else console.warn(`WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled.`),this.zoomToCursor=!1;e!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(e).add(this.object.position):(Wd.origin.copy(this.object.position),Wd.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(Wd.direction))<Kd?this.object.lookAt(this.target):(Gd.setFromNormalAndCoplanarPoint(this.object.up,this.target),Wd.intersectPlane(Gd,this.target))))}else if(this.object.isOrthographicCamera){let e=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),e!==this.object.zoom&&(this.object.updateProjectionMatrix(),i=!0)}return this._scale=1,this._performCursorZoom=!1,i||this._lastPosition.distanceToSquared(this.object.position)>Xd||8*(1-this._lastQuaternion.dot(this.object.quaternion))>Xd||this._lastTargetPosition.distanceToSquared(this.target)>Xd?(this.dispatchEvent(Vd),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(e){return e===null?Jd/60/60*this.autoRotateSpeed:Jd/60*this.autoRotateSpeed*e}_getZoomScale(e){let t=Math.abs(e*.01);return .95**(this.zoomSpeed*t)}_rotateLeft(e){this._sphericalDelta.theta-=e}_rotateUp(e){this._sphericalDelta.phi-=e}_panLeft(e,t){qd.setFromMatrixColumn(t,0),qd.multiplyScalar(-e),this._panOffset.add(qd)}_panUp(e,t){this.screenSpacePanning===!0?qd.setFromMatrixColumn(t,1):(qd.setFromMatrixColumn(t,0),qd.crossVectors(this.object.up,qd)),qd.multiplyScalar(e),this._panOffset.add(qd)}_pan(e,t){let n=this.domElement;if(this.object.isPerspectiveCamera){let r=this.object.position;qd.copy(r).sub(this.target);let i=qd.length();i*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*e*i/n.clientHeight,this.object.matrix),this._panUp(2*t*i/n.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(e*(this.object.right-this.object.left)/this.object.zoom/n.clientWidth,this.object.matrix),this._panUp(t*(this.object.top-this.object.bottom)/this.object.zoom/n.clientHeight,this.object.matrix)):(console.warn(`WARNING: OrbitControls.js encountered an unknown camera type - pan disabled.`),this.enablePan=!1)}_dollyOut(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=e:(console.warn(`WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.`),this.enableZoom=!1)}_dollyIn(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=e:(console.warn(`WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.`),this.enableZoom=!1)}_updateZoomParameters(e,t){if(!this.zoomToCursor)return;this._performCursorZoom=!0;let n=this.domElement.getBoundingClientRect(),r=e-n.left,i=t-n.top,a=n.width,o=n.height;this._mouse.x=r/a*2-1,this._mouse.y=-(i/o)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(e){return Math.max(this.minDistance,Math.min(this.maxDistance,e))}_handleMouseDownRotate(e){this._rotateStart.set(e.clientX,e.clientY)}_handleMouseDownDolly(e){this._updateZoomParameters(e.clientX,e.clientX),this._dollyStart.set(e.clientX,e.clientY)}_handleMouseDownPan(e){this._panStart.set(e.clientX,e.clientY)}_handleMouseMoveRotate(e){this._rotateEnd.set(e.clientX,e.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);let t=this.domElement;this._rotateLeft(Jd*this._rotateDelta.x/t.clientHeight),this._rotateUp(Jd*this._rotateDelta.y/t.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(e){this._dollyEnd.set(e.clientX,e.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(e){this._panEnd.set(e.clientX,e.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(e){this._updateZoomParameters(e.clientX,e.clientY),e.deltaY<0?this._dollyIn(this._getZoomScale(e.deltaY)):e.deltaY>0&&this._dollyOut(this._getZoomScale(e.deltaY)),this.update()}_handleKeyDown(e){let t=!1;switch(e.code){case this.keys.UP:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(Jd*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,this.keyPanSpeed),t=!0;break;case this.keys.BOTTOM:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(-Jd*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,-this.keyPanSpeed),t=!0;break;case this.keys.LEFT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(Jd*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(this.keyPanSpeed,0),t=!0;break;case this.keys.RIGHT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(-Jd*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),t=!0}t&&(e.preventDefault(),this.update())}_handleTouchStartRotate(e){if(this._pointers.length===1)this._rotateStart.set(e.pageX,e.pageY);else{let t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);this._rotateStart.set(n,r)}}_handleTouchStartPan(e){if(this._pointers.length===1)this._panStart.set(e.pageX,e.pageY);else{let t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);this._panStart.set(n,r)}}_handleTouchStartDolly(e){let t=this._getSecondPointerPosition(e),n=e.pageX-t.x,r=e.pageY-t.y,i=Math.sqrt(n*n+r*r);this._dollyStart.set(0,i)}_handleTouchStartDollyPan(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enablePan&&this._handleTouchStartPan(e)}_handleTouchStartDollyRotate(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enableRotate&&this._handleTouchStartRotate(e)}_handleTouchMoveRotate(e){if(this._pointers.length==1)this._rotateEnd.set(e.pageX,e.pageY);else{let t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);this._rotateEnd.set(n,r)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);let t=this.domElement;this._rotateLeft(Jd*this._rotateDelta.x/t.clientHeight),this._rotateUp(Jd*this._rotateDelta.y/t.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(e){if(this._pointers.length===1)this._panEnd.set(e.pageX,e.pageY);else{let t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);this._panEnd.set(n,r)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(e){let t=this._getSecondPointerPosition(e),n=e.pageX-t.x,r=e.pageY-t.y,i=Math.sqrt(n*n+r*r);this._dollyEnd.set(0,i),this._dollyDelta.set(0,(this._dollyEnd.y/this._dollyStart.y)**+this.zoomSpeed),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);let a=(e.pageX+t.x)*.5,o=(e.pageY+t.y)*.5;this._updateZoomParameters(a,o)}_handleTouchMoveDollyPan(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enablePan&&this._handleTouchMovePan(e)}_handleTouchMoveDollyRotate(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enableRotate&&this._handleTouchMoveRotate(e)}_addPointer(e){this._pointers.push(e.pointerId)}_removePointer(e){delete this._pointerPositions[e.pointerId];for(let t=0;t<this._pointers.length;t++)if(this._pointers[t]==e.pointerId){this._pointers.splice(t,1);return}}_isTrackingPointer(e){for(let t=0;t<this._pointers.length;t++)if(this._pointers[t]==e.pointerId)return!0;return!1}_trackPointer(e){let t=this._pointerPositions[e.pointerId];t===void 0&&(t=new I,this._pointerPositions[e.pointerId]=t),t.set(e.pageX,e.pageY)}_getSecondPointerPosition(e){let t=e.pointerId===this._pointers[0]?this._pointers[1]:this._pointers[0];return this._pointerPositions[t]}_customWheelEvent(e){let t=e.deltaMode,n={clientX:e.clientX,clientY:e.clientY,deltaY:e.deltaY};switch(t){case 1:n.deltaY*=16;break;case 2:n.deltaY*=100}return e.ctrlKey&&!this._controlActive&&(n.deltaY*=10),n}}}));function H(e,t,n){function r(n,r){var i;Object.defineProperty(n,\"_zod\",{value:n._zod??{},enumerable:!1}),(i=n._zod).traits??(i.traits=new Set),n._zod.traits.add(e),t(n,r);for(let e in o.prototype)e in n||Object.defineProperty(n,e,{value:o.prototype[e].bind(n)});n._zod.constr=o,n._zod.def=r}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,\"name\",{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,\"init\",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,\"name\",{value:e}),o}function $d(e){return e&&Object.assign(rf,e),rf}var ef,tf,nf,rf,af=t((()=>{ef=Object.freeze({status:`aborted`}),tf=Symbol(`zod_brand`),nf=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},rf={}})),of=r({BIGINT_FORMAT_RANGES:()=>Zf,Class:()=>Qf,NUMBER_FORMAT_RANGES:()=>Xf,aborted:()=>Lf,allowsEval:()=>Kf,assert:()=>df,assertEqual:()=>sf,assertIs:()=>lf,assertNever:()=>uf,assertNotEqual:()=>cf,assignProp:()=>yf,cached:()=>mf,captureStackTrace:()=>Gf,cleanEnum:()=>Wf,cleanRegex:()=>gf,clone:()=>Of,createTransparentProxy:()=>kf,defineLazy:()=>vf,esc:()=>Cf,escapeRegex:()=>Df,extend:()=>Nf,finalizeIssue:()=>Bf,floatSafeRemainder:()=>_f,getElementAtPath:()=>bf,getEnumValues:()=>ff,getLengthableOrigin:()=>Hf,getParsedType:()=>qf,getSizableOrigin:()=>Vf,isObject:()=>wf,isPlainObject:()=>Tf,issue:()=>Uf,joinValues:()=>U,jsonStringifyReplacer:()=>pf,merge:()=>Pf,normalizeParams:()=>W,nullish:()=>hf,numKeys:()=>Ef,omit:()=>Mf,optionalKeys:()=>Af,partial:()=>Ff,pick:()=>jf,prefixIssues:()=>Rf,primitiveTypes:()=>Yf,promiseAllObject:()=>xf,propertyKeyTypes:()=>Jf,randomString:()=>Sf,required:()=>If,stringifyPrimitive:()=>G,unwrapMessage:()=>zf});function sf(e){return e}function cf(e){return e}function lf(e){}function uf(e){throw Error()}function df(e){}function ff(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function U(e,t=`|`){return e.map(e=>G(e)).join(t)}function pf(e,t){return typeof t==`bigint`?t.toString():t}function mf(e){return{get value(){{let t=e();return Object.defineProperty(this,\"value\",{value:t}),t}}}}function hf(e){return e==null}function gf(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function _f(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=(t.toString().split(`.`)[1]||``).length,i=n>r?n:r;return Number.parseInt(e.toFixed(i).replace(`.`,``))%Number.parseInt(t.toFixed(i).replace(`.`,``))/10**i}function vf(e,t,n){Object.defineProperty(e,t,{get(){{let r=n();return e[t]=r,r}},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function yf(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function bf(e,t){return t?t.reduce((e,t)=>e?.[t],e):e}function xf(e){let t=Object.keys(e),n=t.map(t=>e[t]);return Promise.all(n).then(e=>{let n={};for(let r=0;r<t.length;r++)n[t[r]]=e[r];return n})}function Sf(e=10){let t=``;for(let n=0;n<e;n++)t+=`abcdefghijklmnopqrstuvwxyz`[Math.floor(Math.random()*26)];return t}function Cf(e){return JSON.stringify(e)}function wf(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Tf(e){if(wf(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return wf(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function Ef(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}function Df(e){return e.replace(/[.*+?^${}()|[\\]\\\\]/g,`\\\\$&`)}function Of(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function W(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error(\"Cannot specify both `message` and `error` params\");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function kf(e){let t;return new Proxy({},{get(n,r,i){return t??=e(),Reflect.get(t,r,i)},set(n,r,i,a){return t??=e(),Reflect.set(t,r,i,a)},has(n,r){return t??=e(),Reflect.has(t,r)},deleteProperty(n,r){return t??=e(),Reflect.deleteProperty(t,r)},ownKeys(n){return t??=e(),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,r){return t??=e(),Reflect.getOwnPropertyDescriptor(t,r)},defineProperty(n,r,i){return t??=e(),Reflect.defineProperty(t,r,i)}})}function G(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`\"${e}\"`:`${e}`}function Af(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}function jf(e,t){let n={},r=e._zod.def;for(let e in t){if(!(e in r.shape))throw Error(`Unrecognized key: \"${e}\"`);t[e]&&(n[e]=r.shape[e])}return Of(e,{...e._zod.def,shape:n,checks:[]})}function Mf(e,t){let n={...e._zod.def.shape},r=e._zod.def;for(let e in t){if(!(e in r.shape))throw Error(`Unrecognized key: \"${e}\"`);t[e]&&delete n[e]}return Of(e,{...e._zod.def,shape:n,checks:[]})}function Nf(e,t){if(!Tf(t))throw Error(`Invalid input to extend: expected a plain object`);return Of(e,{...e._zod.def,get shape(){let n={...e._zod.def.shape,...t};return yf(this,`shape`,n),n},checks:[]})}function Pf(e,t){return Of(e,{...e._zod.def,get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return yf(this,`shape`,n),n},catchall:t._zod.def.catchall,checks:[]})}function Ff(e,t,n){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: \"${t}\"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return Of(t,{...t._zod.def,shape:i,checks:[]})}function If(e,t,n){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: \"${t}\"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return Of(t,{...t._zod.def,shape:i,checks:[]})}function Lf(e,t=0){for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Rf(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function zf(e){return typeof e==`string`?e:e?.message}function Bf(e,t,n){let r={...e,path:e.path??[]};return e.message||(r.message=zf(e.inst?._zod.def?.error?.(e))??zf(t?.error?.(e))??zf(n.customError?.(e))??zf(n.localeError?.(e))??`Invalid input`),delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function Vf(e){return e instanceof Set?`set`:e instanceof Map?`map`:e instanceof File?`file`:`unknown`}function Hf(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function Uf(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function Wf(e){return Object.entries(e).filter(([e,t])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}var Gf,Kf,qf,Jf,Yf,Xf,Zf,Qf,K=t((()=>{Gf=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{},Kf=mf(()=>{if(typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}}),qf=e=>{let t=typeof e;switch(t){case`undefined`:return`undefined`;case`string`:return`string`;case`number`:return Number.isNaN(e)?`nan`:`number`;case`boolean`:return`boolean`;case`function`:return`function`;case`bigint`:return`bigint`;case`symbol`:return`symbol`;case`object`:return Array.isArray(e)?`array`:e===null?`null`:e.then&&typeof e.then==`function`&&e.catch&&typeof e.catch==`function`?`promise`:typeof Map<`u`&&e instanceof Map?`map`:typeof Set<`u`&&e instanceof Set?`set`:typeof Date<`u`&&e instanceof Date?`date`:typeof File<`u`&&e instanceof File?`file`:`object`;default:throw Error(`Unknown data type: ${t}`)}},Jf=new Set([`string`,`number`,`symbol`]),Yf=new Set([`string`,`number`,`bigint`,`boolean`,`symbol`,`undefined`]),Xf={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Zf={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]},Qf=class{constructor(...e){}}}));function $f(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function ep(e,t){let n=t||function(e){return e.message},r={_errors:[]},i=e=>{for(let t of e.issues)if(t.code===`invalid_union`&&t.errors.length)t.errors.map(e=>i({issues:e}));else if(t.code===`invalid_key`)i({issues:t.issues});else if(t.code===`invalid_element`)i({issues:t.issues});else if(t.path.length===0)r._errors.push(n(t));else{let e=r,i=0;for(;i<t.path.length;){let r=t.path[i];i===t.path.length-1?(e[r]=e[r]||{_errors:[]},e[r]._errors.push(n(t))):e[r]=e[r]||{_errors:[]},e=e[r],i++}}};return i(e),r}function tp(e,t){let n=t||function(e){return e.message},r={errors:[]},i=(e,t=[])=>{var a,o;for(let s of e.issues)if(s.code===`invalid_union`&&s.errors.length)s.errors.map(e=>i({issues:e},s.path));else if(s.code===`invalid_key`)i({issues:s.issues},s.path);else if(s.code===`invalid_element`)i({issues:s.issues},s.path);else{let e=[...t,...s.path];if(e.length===0){r.errors.push(n(s));continue}let i=r,c=0;for(;c<e.length;){let t=e[c],r=c===e.length-1;typeof t==`string`?(i.properties??(i.properties={}),(a=i.properties)[t]??(a[t]={errors:[]}),i=i.properties[t]):(i.items??(i.items=[]),(o=i.items)[t]??(o[t]={errors:[]}),i=i.items[t]),r&&i.errors.push(n(s)),c++}}};return i(e),r}function np(e){let t=[];for(let n of e)typeof n==`number`?t.push(`[${n}]`):typeof n==`symbol`?t.push(`[${JSON.stringify(String(n))}]`):/[^\\w$]/.test(n)?t.push(`[${JSON.stringify(n)}]`):(t.length&&t.push(`.`),t.push(n));return t.join(``)}function rp(e){let t=[],n=[...e.issues].sort((e,t)=>e.path.length-t.path.length);for(let e of n)t.push(`✖ ${e.message}`),e.path?.length&&t.push(` → at ${np(e.path)}`);return t.join(`\n`)}var ip,ap,op,sp=t((()=>{af(),K(),ip=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,\"_zod\",{value:e._zod,enumerable:!1}),Object.defineProperty(e,\"issues\",{value:t,enumerable:!1}),Object.defineProperty(e,\"message\",{get(){return JSON.stringify(t,pf,2)},enumerable:!0}),Object.defineProperty(e,\"toString\",{value:()=>e.message,enumerable:!1})},ap=H(`$ZodError`,ip),op=H(`$ZodError`,ip,{Parent:Error})})),cp,lp,up,dp,fp,pp,mp,hp,gp=t((()=>{af(),sp(),K(),cp=e=>(t,n,r,i)=>{let a=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new nf;if(o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>Bf(e,a,$d())));throw Gf(t,i?.callee),t}return o.value},lp=cp(op),up=e=>async(t,n,r,i)=>{let a=r?Object.assign(r,{async:!0}):{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>Bf(e,a,$d())));throw Gf(t,i?.callee),t}return o.value},dp=up(op),fp=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new nf;return a.issues.length?{success:!1,error:new(e??ap)(a.issues.map(e=>Bf(e,i,$d())))}:{success:!0,data:a.value}},pp=fp(op),mp=e=>async(t,n,r)=>{let i=r?Object.assign(r,{async:!0}):{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>Bf(e,i,$d())))}:{success:!0,data:a.value}},hp=mp(op)})),_p=r({_emoji:()=>Bp,base64:()=>Gp,base64url:()=>Kp,bigint:()=>$p,boolean:()=>nm,browserEmail:()=>zp,cidrv4:()=>Up,cidrv6:()=>Wp,cuid:()=>Sp,cuid2:()=>Cp,date:()=>Zp,datetime:()=>xp,domain:()=>Jp,duration:()=>Op,e164:()=>Yp,email:()=>Fp,emoji:()=>vp,extendedDuration:()=>kp,guid:()=>Ap,hostname:()=>qp,html5Email:()=>Ip,integer:()=>em,ipv4:()=>Vp,ipv6:()=>Hp,ksuid:()=>Ep,lowercase:()=>am,nanoid:()=>Dp,null:()=>rm,number:()=>tm,rfc5322Email:()=>Lp,string:()=>Qp,time:()=>bp,ulid:()=>wp,undefined:()=>im,unicodeEmail:()=>Rp,uppercase:()=>om,uuid:()=>jp,uuid4:()=>Mp,uuid6:()=>Np,uuid7:()=>Pp,xid:()=>Tp});function vp(){return new RegExp(Bp,`u`)}function yp(e){let t=`(?:[01]\\\\d|2[0-3]):[0-5]\\\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\\\d`:`${t}:[0-5]\\\\d\\\\.\\\\d{${e.precision}}`:`${t}(?::[0-5]\\\\d(?:\\\\.\\\\d+)?)?`}function bp(e){return RegExp(`^${yp(e)}$`)}function xp(e){let t=yp({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-]\\\\d{2}:\\\\d{2})`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${Xp}T(?:${r})$`)}var Sp,Cp,wp,Tp,Ep,Dp,Op,kp,Ap,jp,Mp,Np,Pp,Fp,Ip,Lp,Rp,zp,Bp,Vp,Hp,Up,Wp,Gp,Kp,qp,Jp,Yp,Xp,Zp,Qp,$p,em,tm,nm,rm,im,am,om,sm=t((()=>{Sp=/^[cC][^\\s-]{8,}$/,Cp=/^[0-9a-z]+$/,wp=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Tp=/^[0-9a-vA-V]{20}$/,Ep=/^[A-Za-z0-9]{27}$/,Dp=/^[a-zA-Z0-9_-]{21}$/,Op=/^P(?:(\\d+W)|(?!.*W)(?=\\d|T\\d)(\\d+Y)?(\\d+M)?(\\d+D)?(T(?=\\d)(\\d+H)?(\\d+M)?(\\d+([.,]\\d+)?S)?)?)$/,kp=/^[-+]?P(?!$)(?:(?:[-+]?\\d+Y)|(?:[-+]?\\d+[.,]\\d+Y$))?(?:(?:[-+]?\\d+M)|(?:[-+]?\\d+[.,]\\d+M$))?(?:(?:[-+]?\\d+W)|(?:[-+]?\\d+[.,]\\d+W$))?(?:(?:[-+]?\\d+D)|(?:[-+]?\\d+[.,]\\d+D$))?(?:T(?=[\\d+-])(?:(?:[-+]?\\d+H)|(?:[-+]?\\d+[.,]\\d+H$))?(?:(?:[-+]?\\d+M)|(?:[-+]?\\d+[.,]\\d+M$))?(?:[-+]?\\d+(?:[.,]\\d+)?S)?)??$/,Ap=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,jp=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/,Mp=jp(4),Np=jp(6),Pp=jp(7),Fp=/^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$/,Ip=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Lp=/^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/,Rp=/^[^\\s@\"]{1,64}@[^\\s@]{1,255}$/u,zp=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Bp=`^(\\\\p{Extended_Pictographic}|\\\\p{Emoji_Component})+$`,Vp=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Hp=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,Up=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\/([0-9]|[1-2][0-9]|3[0-2])$/,Wp=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Gp=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Kp=/^[A-Za-z0-9_-]*$/,qp=/^([a-zA-Z0-9-]+\\.)*[a-zA-Z0-9-]+$/,Jp=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\\.)+[a-zA-Z]{2,}$/,Yp=/^\\+(?:[0-9]){6,14}[0-9]$/,Xp=`(?:(?:\\\\d\\\\d[2468][048]|\\\\d\\\\d[13579][26]|\\\\d\\\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\\\d|30)|(?:02)-(?:0[1-9]|1\\\\d|2[0-8])))`,Zp=RegExp(`^${Xp}$`),Qp=e=>{let t=e?`[\\\\s\\\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\\\s\\\\S]*`;return RegExp(`^${t}$`)},$p=/^\\d+n?$/,em=/^\\d+$/,tm=/^-?\\d+(?:\\.\\d+)?/i,nm=/true|false/i,rm=/null/i,im=/undefined/i,am=/^[^A-Z]*$/,om=/^[^a-z]*$/}));function cm(e,t,n){e.issues.length&&t.issues.push(...Rf(n,e.issues))}var lm,um,dm,fm,pm,mm,hm,gm,_m,vm,ym,bm,xm,Sm,Cm,wm,Tm,Em,Dm,Om,km,Am,jm,Mm=t((()=>{af(),sm(),K(),lm=H(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),um={number:`number`,bigint:`bigint`,object:`date`},dm=H(`$ZodCheckLessThan`,(e,t)=>{lm.init(e,t);let n=um[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),fm=H(`$ZodCheckGreaterThan`,(e,t)=>{lm.init(e,t);let n=um[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),pm=H(`$ZodCheckMultipleOf`,(e,t)=>{lm.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):_f(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),mm=H(`$ZodCheckNumberFormat`,(e,t)=>{lm.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=Xf[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=em)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inst:e})}}),hm=H(`$ZodCheckBigIntFormat`,(e,t)=>{lm.init(e,t);let[n,r]=Zf[t.format];e._zod.onattach.push(e=>{let i=e._zod.bag;i.format=t.format,i.minimum=n,i.maximum=r}),e._zod.check=i=>{let a=i.value;a<n&&i.issues.push({origin:`bigint`,input:a,code:`too_small`,minimum:n,inclusive:!0,inst:e,continue:!t.abort}),a>r&&i.issues.push({origin:`bigint`,input:a,code:`too_big`,maximum:r,inst:e})}}),gm=H(`$ZodCheckMaxSize`,(e,t)=>{var n;lm.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!hf(t)&&t.size!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;r.size<=t.maximum||n.issues.push({origin:Vf(r),code:`too_big`,maximum:t.maximum,input:r,inst:e,continue:!t.abort})}}),_m=H(`$ZodCheckMinSize`,(e,t)=>{var n;lm.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!hf(t)&&t.size!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;r.size>=t.minimum||n.issues.push({origin:Vf(r),code:`too_small`,minimum:t.minimum,input:r,inst:e,continue:!t.abort})}}),vm=H(`$ZodCheckSizeEquals`,(e,t)=>{var n;lm.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!hf(t)&&t.size!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.size,n.maximum=t.size,n.size=t.size}),e._zod.check=n=>{let r=n.value,i=r.size;if(i===t.size)return;let a=i>t.size;n.issues.push({origin:Vf(r),...a?{code:`too_big`,maximum:t.size}:{code:`too_small`,minimum:t.size},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),ym=H(`$ZodCheckMaxLength`,(e,t)=>{var n;lm.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!hf(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=Hf(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),bm=H(`$ZodCheckMinLength`,(e,t)=>{var n;lm.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!hf(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=Hf(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),xm=H(`$ZodCheckLengthEquals`,(e,t)=>{var n;lm.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!hf(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=Hf(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Sm=H(`$ZodCheckStringFormat`,(e,t)=>{var n,r;lm.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Cm=H(`$ZodCheckRegex`,(e,t)=>{Sm.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),wm=H(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=am,Sm.init(e,t)}),Tm=H(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=om,Sm.init(e,t)}),Em=H(`$ZodCheckIncludes`,(e,t)=>{lm.init(e,t);let n=Df(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Dm=H(`$ZodCheckStartsWith`,(e,t)=>{lm.init(e,t);let n=RegExp(`^${Df(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Om=H(`$ZodCheckEndsWith`,(e,t)=>{lm.init(e,t);let n=RegExp(`.*${Df(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),km=H(`$ZodCheckProperty`,(e,t)=>{lm.init(e,t),e._zod.check=e=>{let n=t.schema._zod.run({value:e.value[t.property],issues:[]},{});if(n instanceof Promise)return n.then(n=>cm(n,e,t.property));cm(n,e,t.property)}}),Am=H(`$ZodCheckMimeType`,(e,t)=>{lm.init(e,t);let n=new Set(t.mime);e._zod.onattach.push(e=>{e._zod.bag.mime=t.mime}),e._zod.check=r=>{n.has(r.value.type)||r.issues.push({code:`invalid_value`,values:t.mime,input:r.value.type,inst:e})}}),jm=H(`$ZodCheckOverwrite`,(e,t)=>{lm.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}})})),Nm,Pm=t((()=>{Nm=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`\n`).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(`\n`))}}})),Fm,Im=t((()=>{Fm={major:4,minor:0,patch:0}}));function Lm(e){if(e===``)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}function Rm(e){if(!Kp.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return Lm(t.padEnd(Math.ceil(t.length/4)*4,`=`))}function zm(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}function Bm(e,t,n){e.issues.length&&t.issues.push(...Rf(n,e.issues)),t.value[n]=e.value}function Vm(e,t,n){e.issues.length&&t.issues.push(...Rf(n,e.issues)),t.value[n]=e.value}function Hm(e,t,n,r){e.issues.length?r[n]===void 0?n in r?t.value[n]=void 0:t.value[n]=e.value:t.issues.push(...Rf(n,e.issues)):e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function Um(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;return t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>Bf(e,r,$d())))}),t}function Wm(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Tf(e)&&Tf(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=Wm(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=Wm(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Gm(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),Lf(e))return e;let r=Wm(t.value,n.value);if(!r.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return e.value=r.data,e}function Km(e,t,n){e.issues.length&&t.issues.push(...Rf(n,e.issues)),t.value[n]=e.value}function qm(e,t,n,r,i,a,o){e.issues.length&&(Jf.has(typeof r)?n.issues.push(...Rf(r,e.issues)):n.issues.push({origin:`map`,code:`invalid_key`,input:i,inst:a,issues:e.issues.map(e=>Bf(e,o,$d()))})),t.issues.length&&(Jf.has(typeof r)?n.issues.push(...Rf(r,t.issues)):n.issues.push({origin:`map`,code:`invalid_element`,input:i,inst:a,key:r,issues:t.issues.map(e=>Bf(e,o,$d()))})),n.value.set(e.value,t.value)}function Jm(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}function Ym(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}function Xm(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}function Zm(e,t,n){return Lf(e)?e:t.out._zod.run({value:e.value,issues:e.issues},n)}function Qm(e){return e.value=Object.freeze(e.value),e}function $m(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(Uf(e))}}var q,eh,th,nh,rh,ih,ah,oh,sh,ch,lh,uh,dh,fh,ph,mh,hh,gh,_h,vh,yh,bh,xh,Sh,Ch,wh,Th,Eh,Dh,Oh,kh,Ah,jh,Mh,Nh,Ph,Fh,Ih,Lh,Rh,zh,Bh,Vh,Hh,Uh,Wh,Gh,Kh,qh,Jh,Yh,Xh,Zh,Qh,$h,eg,tg,ng,rg,ig,ag,og,sg,cg,lg,ug,dg,fg=t((()=>{Mm(),af(),Pm(),gp(),sm(),K(),Im(),q=H(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Fm;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=Lf(e),i;for(let a of t){if(a._zod.def.when){if(!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new nf;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=Lf(e,t))});else{if(e.issues.length===t)continue;r||=Lf(e,t)}}return i?i.then(()=>e):e};e._zod.run=(n,i)=>{let a=e._zod.parse(n,i);if(a instanceof Promise){if(i.async===!1)throw new nf;return a.then(e=>t(e,r,i))}return t(a,r,i)}}e[`~standard`]={validate:t=>{try{let n=pp(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return hp(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}}),eh=H(`$ZodString`,(e,t)=>{q.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Qp(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),th=H(`$ZodStringFormat`,(e,t)=>{Sm.init(e,t),eh.init(e,t)}),nh=H(`$ZodGUID`,(e,t)=>{t.pattern??=Ap,th.init(e,t)}),rh=H(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: \"${t.version}\"`);t.pattern??=jp(e)}else t.pattern??=jp();th.init(e,t)}),ih=H(`$ZodEmail`,(e,t)=>{t.pattern??=Fp,th.init(e,t)}),ah=H(`$ZodURL`,(e,t)=>{th.init(e,t),e._zod.check=n=>{try{let r=n.value,i=new URL(r),a=i.href;t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:qp.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),n.value=!r.endsWith(`/`)&&a.endsWith(`/`)?a.slice(0,-1):a;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),oh=H(`$ZodEmoji`,(e,t)=>{t.pattern??=vp(),th.init(e,t)}),sh=H(`$ZodNanoID`,(e,t)=>{t.pattern??=Dp,th.init(e,t)}),ch=H(`$ZodCUID`,(e,t)=>{t.pattern??=Sp,th.init(e,t)}),lh=H(`$ZodCUID2`,(e,t)=>{t.pattern??=Cp,th.init(e,t)}),uh=H(`$ZodULID`,(e,t)=>{t.pattern??=wp,th.init(e,t)}),dh=H(`$ZodXID`,(e,t)=>{t.pattern??=Tp,th.init(e,t)}),fh=H(`$ZodKSUID`,(e,t)=>{t.pattern??=Ep,th.init(e,t)}),ph=H(`$ZodISODateTime`,(e,t)=>{t.pattern??=xp(t),th.init(e,t)}),mh=H(`$ZodISODate`,(e,t)=>{t.pattern??=Zp,th.init(e,t)}),hh=H(`$ZodISOTime`,(e,t)=>{t.pattern??=bp(t),th.init(e,t)}),gh=H(`$ZodISODuration`,(e,t)=>{t.pattern??=Op,th.init(e,t)}),_h=H(`$ZodIPv4`,(e,t)=>{t.pattern??=Vp,th.init(e,t),e._zod.onattach.push(e=>{let t=e._zod.bag;t.format=`ipv4`})}),vh=H(`$ZodIPv6`,(e,t)=>{t.pattern??=Hp,th.init(e,t),e._zod.onattach.push(e=>{let t=e._zod.bag;t.format=`ipv6`}),e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),yh=H(`$ZodCIDRv4`,(e,t)=>{t.pattern??=Up,th.init(e,t)}),bh=H(`$ZodCIDRv6`,(e,t)=>{t.pattern??=Wp,th.init(e,t),e._zod.check=n=>{let[r,i]=n.value.split(`/`);try{if(!i)throw Error();let e=Number(i);if(`${e}`!==i||e<0||e>128)throw Error();new URL(`http://[${r}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}}),xh=H(`$ZodBase64`,(e,t)=>{t.pattern??=Gp,th.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding=`base64`}),e._zod.check=n=>{Lm(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),Sh=H(`$ZodBase64URL`,(e,t)=>{t.pattern??=Kp,th.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding=`base64url`}),e._zod.check=n=>{Rm(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),Ch=H(`$ZodE164`,(e,t)=>{t.pattern??=Yp,th.init(e,t)}),wh=H(`$ZodJWT`,(e,t)=>{th.init(e,t),e._zod.check=n=>{zm(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),Th=H(`$ZodCustomStringFormat`,(e,t)=>{th.init(e,t),e._zod.check=n=>{t.fn(n.value)||n.issues.push({code:`invalid_format`,format:t.format,input:n.value,inst:e,continue:!t.abort})}}),Eh=H(`$ZodNumber`,(e,t)=>{q.init(e,t),e._zod.pattern=e._zod.bag.pattern??tm,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),Dh=H(`$ZodNumber`,(e,t)=>{mm.init(e,t),Eh.init(e,t)}),Oh=H(`$ZodBoolean`,(e,t)=>{q.init(e,t),e._zod.pattern=nm,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),kh=H(`$ZodBigInt`,(e,t)=>{q.init(e,t),e._zod.pattern=$p,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=BigInt(n.value)}catch{}return typeof n.value==`bigint`||n.issues.push({expected:`bigint`,code:`invalid_type`,input:n.value,inst:e}),n}}),Ah=H(`$ZodBigInt`,(e,t)=>{hm.init(e,t),kh.init(e,t)}),jh=H(`$ZodSymbol`,(e,t)=>{q.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return typeof r==`symbol`||t.issues.push({expected:`symbol`,code:`invalid_type`,input:r,inst:e}),t}}),Mh=H(`$ZodUndefined`,(e,t)=>{q.init(e,t),e._zod.pattern=im,e._zod.values=new Set([void 0]),e._zod.optin=`optional`,e._zod.optout=`optional`,e._zod.parse=(t,n)=>{let r=t.value;return r===void 0||t.issues.push({expected:`undefined`,code:`invalid_type`,input:r,inst:e}),t}}),Nh=H(`$ZodNull`,(e,t)=>{q.init(e,t),e._zod.pattern=rm,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return r===null||t.issues.push({expected:`null`,code:`invalid_type`,input:r,inst:e}),t}}),Ph=H(`$ZodAny`,(e,t)=>{q.init(e,t),e._zod.parse=e=>e}),Fh=H(`$ZodUnknown`,(e,t)=>{q.init(e,t),e._zod.parse=e=>e}),Ih=H(`$ZodNever`,(e,t)=>{q.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)}),Lh=H(`$ZodVoid`,(e,t)=>{q.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return r===void 0||t.issues.push({expected:`void`,code:`invalid_type`,input:r,inst:e}),t}}),Rh=H(`$ZodDate`,(e,t)=>{q.init(e,t),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=new Date(n.value)}catch{}let i=n.value,a=i instanceof Date;return a&&!Number.isNaN(i.getTime())||n.issues.push({expected:`date`,code:`invalid_type`,input:i,...a?{received:`Invalid Date`}:{},inst:e}),n}}),zh=H(`$ZodArray`,(e,t)=>{q.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>Bm(t,n,e))):Bm(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}}),Bh=H(`$ZodObject`,(e,t)=>{q.init(e,t);let n=mf(()=>{let e=Object.keys(t.shape);for(let n of e)if(!(t.shape[n]instanceof q))throw Error(`Invalid element at key \"${n}\": expected a Zod schema`);let n=Af(t.shape);return{shape:t.shape,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(n)}});vf(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=e=>{let t=new Nm([`shape`,`payload`,`ctx`]),r=n.value,i=e=>{let t=Cf(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of r.keys)a[e]=`key_${o++}`;t.write(`const newResult = {}`);for(let e of r.keys)if(r.optionalKeys.has(e)){let n=a[e];t.write(`const ${n} = ${i(e)};`);let r=Cf(e);t.write(`\n if (${n}.issues.length) {\n if (input[${r}] === undefined) {\n if (${r} in input) {\n newResult[${r}] = undefined;\n }\n } else {\n payload.issues = payload.issues.concat(\n ${n}.issues.map((iss) => ({\n ...iss,\n path: iss.path ? [${r}, ...iss.path] : [${r}],\n }))\n );\n }\n } else if (${n}.value === undefined) {\n if (${r} in input) newResult[${r}] = undefined;\n } else {\n newResult[${r}] = ${n}.value;\n }\n `)}else{let n=a[e];t.write(`const ${n} = ${i(e)};`),t.write(`\n if (${n}.issues.length) payload.issues = payload.issues.concat(${n}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${Cf(e)}, ...iss.path] : [${Cf(e)}]\n })));`),t.write(`newResult[${Cf(e)}] = ${n}.value`)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},i,a=wf,o=!rf.jitless,s=o&&Kf.value,c=t.catchall,l;e._zod.parse=(u,d)=>{l??=n.value;let f=u.value;if(!a(f))return u.issues.push({expected:`object`,code:`invalid_type`,input:f,inst:e}),u;let p=[];if(o&&s&&d?.async===!1&&d.jitless!==!0)i||=r(t.shape),u=i(u,d);else{u.value={};let e=l.shape;for(let t of l.keys){let n=e[t],r=n._zod.run({value:f[t],issues:[]},d),i=n._zod.optin===`optional`&&n._zod.optout===`optional`;r instanceof Promise?p.push(r.then(e=>i?Hm(e,u,t,f):Vm(e,u,t))):i?Hm(r,u,t,f):Vm(r,u,t)}}if(!c)return p.length?Promise.all(p).then(()=>u):u;let m=[],h=l.keySet,g=c._zod,_=g.def.type;for(let e of Object.keys(f)){if(h.has(e))continue;if(_===`never`){m.push(e);continue}let t=g.run({value:f[e],issues:[]},d);t instanceof Promise?p.push(t.then(t=>Vm(t,u,e))):Vm(t,u,e)}return m.length&&u.issues.push({code:`unrecognized_keys`,keys:m,input:f,inst:e}),p.length?Promise.all(p).then(()=>u):u}}),Vh=H(`$ZodUnion`,(e,t)=>{q.init(e,t),vf(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),vf(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),vf(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),vf(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>gf(e.source)).join(`|`)})$`)}}),e._zod.parse=(n,r)=>{let i=!1,a=[];for(let e of t.options){let t=e._zod.run({value:n.value,issues:[]},r);if(t instanceof Promise)a.push(t),i=!0;else{if(t.issues.length===0)return t;a.push(t)}}return i?Promise.all(a).then(t=>Um(t,n,e,r)):Um(a,n,e,r)}}),Hh=H(`$ZodDiscriminatedUnion`,(e,t)=>{Vh.init(e,t);let n=e._zod.parse;vf(e._zod,`propValues`,()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||Object.keys(r).length===0)throw Error(`Invalid discriminated union option at index \"${t.options.indexOf(n)}\"`);for(let[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(let r of n)e[t].add(r)}}return e});let r=mf(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues[t.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index \"${t.options.indexOf(r)}\"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value \"${String(t)}\"`);n.set(t,r)}}return n});e._zod.parse=(i,a)=>{let o=i.value;if(!wf(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=r.value.get(o?.[t.discriminator]);return s?s._zod.run(i,a):t.unionFallback?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,input:o,path:[t.discriminator],inst:e}),i)}}),Uh=H(`$ZodIntersection`,(e,t)=>{q.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>Gm(e,t,n)):Gm(e,i,a)}}),Wh=H(`$ZodTuple`,(e,t)=>{q.init(e,t);let n=t.items,r=n.length-[...n].reverse().findIndex(e=>e._zod.optin!==`optional`);e._zod.parse=(i,a)=>{let o=i.value;if(!Array.isArray(o))return i.issues.push({input:o,inst:e,expected:`tuple`,code:`invalid_type`}),i;i.value=[];let s=[];if(!t.rest){let t=o.length>n.length,a=o.length<r-1;if(t||a)return i.issues.push({input:o,inst:e,origin:`array`,...t?{code:`too_big`,maximum:n.length}:{code:`too_small`,minimum:n.length}}),i}let c=-1;for(let e of n){if(c++,c>=o.length&&c>=r)continue;let t=e._zod.run({value:o[c],issues:[]},a);t instanceof Promise?s.push(t.then(e=>Km(e,i,c))):Km(t,i,c)}if(t.rest){let e=o.slice(n.length);for(let n of e){c++;let e=t.rest._zod.run({value:n,issues:[]},a);e instanceof Promise?s.push(e.then(e=>Km(e,i,c))):Km(e,i,c)}}return s.length?Promise.all(s).then(()=>i):i}}),Gh=H(`$ZodRecord`,(e,t)=>{q.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Tf(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[];if(t.keyType._zod.values){let o=t.keyType._zod.values;n.value={};for(let e of o)if(typeof e==`string`||typeof e==`number`||typeof e==`symbol`){let o=t.valueType._zod.run({value:i[e],issues:[]},r);o instanceof Promise?a.push(o.then(t=>{t.issues.length&&n.issues.push(...Rf(e,t.issues)),n.value[e]=t.value})):(o.issues.length&&n.issues.push(...Rf(e,o.issues)),n.value[e]=o.value)}let s;for(let e in i)o.has(e)||(s??=[],s.push(e));s&&s.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:s})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`)continue;let s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(s.issues.length){n.issues.push({origin:`record`,code:`invalid_key`,issues:s.issues.map(e=>Bf(e,r,$d())),input:o,path:[o],inst:e}),n.value[s.value]=s.value;continue}let c=t.valueType._zod.run({value:i[o],issues:[]},r);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...Rf(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...Rf(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),Kh=H(`$ZodMap`,(e,t)=>{q.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!(i instanceof Map))return n.issues.push({expected:`map`,code:`invalid_type`,input:i,inst:e}),n;let a=[];n.value=new Map;for(let[o,s]of i){let c=t.keyType._zod.run({value:o,issues:[]},r),l=t.valueType._zod.run({value:s,issues:[]},r);c instanceof Promise||l instanceof Promise?a.push(Promise.all([c,l]).then(([t,a])=>{qm(t,a,n,o,i,e,r)})):qm(c,l,n,o,i,e,r)}return a.length?Promise.all(a).then(()=>n):n}}),qh=H(`$ZodSet`,(e,t)=>{q.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!(i instanceof Set))return n.issues.push({input:i,inst:e,expected:`set`,code:`invalid_type`}),n;let a=[];n.value=new Set;for(let e of i){let i=t.valueType._zod.run({value:e,issues:[]},r);i instanceof Promise?a.push(i.then(e=>Jm(e,n))):Jm(i,n)}return a.length?Promise.all(a).then(()=>n):n}}),Jh=H(`$ZodEnum`,(e,t)=>{q.init(e,t);let n=ff(t.entries);e._zod.values=new Set(n),e._zod.pattern=RegExp(`^(${n.filter(e=>Jf.has(typeof e)).map(e=>typeof e==`string`?Df(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,r)=>{let i=t.value;return e._zod.values.has(i)||t.issues.push({code:`invalid_value`,values:n,input:i,inst:e}),t}}),Yh=H(`$ZodLiteral`,(e,t)=>{q.init(e,t),e._zod.values=new Set(t.values),e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?Df(e):e?e.toString():String(e)).join(`|`)})$`),e._zod.parse=(n,r)=>{let i=n.value;return e._zod.values.has(i)||n.issues.push({code:`invalid_value`,values:t.values,input:i,inst:e}),n}}),Xh=H(`$ZodFile`,(e,t)=>{q.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return r instanceof File||t.issues.push({expected:`file`,code:`invalid_type`,input:r,inst:e}),t}}),Zh=H(`$ZodTransform`,(e,t)=>{q.init(e,t),e._zod.parse=(e,n)=>{let r=t.transform(e.value,e);if(n.async)return(r instanceof Promise?r:Promise.resolve(r)).then(t=>(e.value=t,e));if(r instanceof Promise)throw new nf;return e.value=r,e}}),Qh=H(`$ZodOptional`,(e,t)=>{q.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,vf(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),vf(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${gf(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>t.innerType._zod.optin===`optional`?t.innerType._zod.run(e,n):e.value===void 0?e:t.innerType._zod.run(e,n)}),$h=H(`$ZodNullable`,(e,t)=>{q.init(e,t),vf(e._zod,`optin`,()=>t.innerType._zod.optin),vf(e._zod,`optout`,()=>t.innerType._zod.optout),vf(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${gf(e.source)}|null)$`):void 0}),vf(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),eg=H(`$ZodDefault`,(e,t)=>{q.init(e,t),e._zod.optin=`optional`,vf(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Ym(e,t)):Ym(r,t)}}),tg=H(`$ZodPrefault`,(e,t)=>{q.init(e,t),e._zod.optin=`optional`,vf(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),ng=H(`$ZodNonOptional`,(e,t)=>{q.init(e,t),vf(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>Xm(t,e)):Xm(i,e)}}),rg=H(`$ZodSuccess`,(e,t)=>{q.init(e,t),e._zod.parse=(e,n)=>{let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>(e.value=t.issues.length===0,e)):(e.value=r.issues.length===0,e)}}),ig=H(`$ZodCatch`,(e,t)=>{q.init(e,t),e._zod.optin=`optional`,vf(e._zod,`optout`,()=>t.innerType._zod.optout),vf(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>Bf(e,n,$d()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>Bf(e,n,$d()))},input:e.value}),e.issues=[]),e)}}),ag=H(`$ZodNaN`,(e,t)=>{q.init(e,t),e._zod.parse=(t,n)=>((typeof t.value!=`number`||!Number.isNaN(t.value))&&t.issues.push({input:t.value,inst:e,expected:`nan`,code:`invalid_type`}),t)}),og=H(`$ZodPipe`,(e,t)=>{q.init(e,t),vf(e._zod,`values`,()=>t.in._zod.values),vf(e._zod,`optin`,()=>t.in._zod.optin),vf(e._zod,`optout`,()=>t.out._zod.optout),e._zod.parse=(e,n)=>{let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Zm(e,t,n)):Zm(r,t,n)}}),sg=H(`$ZodReadonly`,(e,t)=>{q.init(e,t),vf(e._zod,`propValues`,()=>t.innerType._zod.propValues),vf(e._zod,`values`,()=>t.innerType._zod.values),vf(e._zod,`optin`,()=>t.innerType._zod.optin),vf(e._zod,`optout`,()=>t.innerType._zod.optout),e._zod.parse=(e,n)=>{let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Qm):Qm(r)}}),cg=H(`$ZodTemplateLiteral`,(e,t)=>{q.init(e,t);let n=[];for(let e of t.parts)if(e instanceof q){if(!e._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...e._zod.traits].shift()}`);let t=e._zod.pattern instanceof RegExp?e._zod.pattern.source:e._zod.pattern;if(!t)throw Error(`Invalid template literal part: ${e._zod.traits}`);let r=+!!t.startsWith(`^`),i=t.endsWith(`$`)?t.length-1:t.length;n.push(t.slice(r,i))}else if(e===null||Yf.has(typeof e))n.push(Df(`${e}`));else throw Error(`Invalid template literal part: ${e}`);e._zod.pattern=RegExp(`^${n.join(``)}$`),e._zod.parse=(t,n)=>typeof t.value==`string`?(e._zod.pattern.lastIndex=0,e._zod.pattern.test(t.value)||t.issues.push({input:t.value,inst:e,code:`invalid_format`,format:`template_literal`,pattern:e._zod.pattern.source}),t):(t.issues.push({input:t.value,inst:e,expected:`template_literal`,code:`invalid_type`}),t)}),lg=H(`$ZodPromise`,(e,t)=>{q.init(e,t),e._zod.parse=(e,n)=>Promise.resolve(e.value).then(e=>t.innerType._zod.run({value:e,issues:[]},n))}),ug=H(`$ZodLazy`,(e,t)=>{q.init(e,t),vf(e._zod,`innerType`,()=>t.getter()),vf(e._zod,`pattern`,()=>e._zod.innerType._zod.pattern),vf(e._zod,`propValues`,()=>e._zod.innerType._zod.propValues),vf(e._zod,`optin`,()=>e._zod.innerType._zod.optin),vf(e._zod,`optout`,()=>e._zod.innerType._zod.optout),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),dg=H(`$ZodCustom`,(e,t)=>{lm.init(e,t),q.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>$m(t,n,r,e));$m(i,n,r,e)}})}));function pg(){return{localeError:mg()}}var mg,hg=t((()=>{K(),mg=()=>{let e={string:{unit:`حرف`,verb:`أن يحوي`},file:{unit:`بايت`,verb:`أن يحوي`},array:{unit:`عنصر`,verb:`أن يحوي`},set:{unit:`عنصر`,verb:`أن يحوي`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`number`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`مدخل`,email:`بريد إلكتروني`,url:`رابط`,emoji:`إيموجي`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`تاريخ ووقت بمعيار ISO`,date:`تاريخ بمعيار ISO`,time:`وقت بمعيار ISO`,duration:`مدة بمعيار ISO`,ipv4:`عنوان IPv4`,ipv6:`عنوان IPv6`,cidrv4:`مدى عناوين بصيغة IPv4`,cidrv6:`مدى عناوين بصيغة IPv6`,base64:`نَص بترميز base64-encoded`,base64url:`نَص بترميز base64url-encoded`,json_string:`نَص على هيئة JSON`,e164:`رقم هاتف بمعيار E.164`,jwt:`JWT`,template_literal:`مدخل`};return e=>{switch(e.code){case`invalid_type`:return`مدخلات غير مقبولة: يفترض إدخال ${e.expected}، ولكن تم إدخال ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`مدخلات غير مقبولة: يفترض إدخال ${G(e.values[0])}`:`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${U(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?` أكبر من اللازم: يفترض أن تكون ${e.origin??`القيمة`} ${n} ${e.maximum.toString()} ${r.unit??`عنصر`}`:`أكبر من اللازم: يفترض أن تكون ${e.origin??`القيمة`} ${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`أصغر من اللازم: يفترض لـ ${e.origin} أن يكون ${n} ${e.minimum.toString()} ${r.unit}`:`أصغر من اللازم: يفترض لـ ${e.origin} أن يكون ${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`نَص غير مقبول: يجب أن يبدأ بـ \"${e.prefix}\"`:t.format===`ends_with`?`نَص غير مقبول: يجب أن ينتهي بـ \"${t.suffix}\"`:t.format===`includes`?`نَص غير مقبول: يجب أن يتضمَّن \"${t.includes}\"`:t.format===`regex`?`نَص غير مقبول: يجب أن يطابق النمط ${t.pattern}`:`${r[t.format]??e.format} غير مقبول`}case`not_multiple_of`:return`رقم غير مقبول: يجب أن يكون من مضاعفات ${e.divisor}`;case`unrecognized_keys`:return`معرف${e.keys.length>1?`ات`:``} غريب${e.keys.length>1?`ة`:``}: ${U(e.keys,`، `)}`;case`invalid_key`:return`معرف غير مقبول في ${e.origin}`;case`invalid_union`:return`مدخل غير مقبول`;case`invalid_element`:return`مدخل غير مقبول في ${e.origin}`;default:return`مدخل غير مقبول`}}}}));function gg(){return{localeError:_g()}}var _g,vg=t((()=>{K(),_g=()=>{let e={string:{unit:`simvol`,verb:`olmalıdır`},file:{unit:`bayt`,verb:`olmalıdır`},array:{unit:`element`,verb:`olmalıdır`},set:{unit:`element`,verb:`olmalıdır`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`number`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,jwt:`JWT`,template_literal:`input`};return e=>{switch(e.code){case`invalid_type`:return`Yanlış dəyər: gözlənilən ${e.expected}, daxil olan ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Yanlış dəyər: gözlənilən ${G(e.values[0])}`:`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${U(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Çox böyük: gözlənilən ${e.origin??`dəyər`} ${n}${e.maximum.toString()} ${r.unit??`element`}`:`Çox böyük: gözlənilən ${e.origin??`dəyər`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Çox kiçik: gözlənilən ${e.origin} ${n}${e.minimum.toString()} ${r.unit}`:`Çox kiçik: gözlənilən ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Yanlış mətn: \"${t.prefix}\" ilə başlamalıdır`:t.format===`ends_with`?`Yanlış mətn: \"${t.suffix}\" ilə bitməlidir`:t.format===`includes`?`Yanlış mətn: \"${t.includes}\" daxil olmalıdır`:t.format===`regex`?`Yanlış mətn: ${t.pattern} şablonuna uyğun olmalıdır`:`Yanlış ${r[t.format]??e.format}`}case`not_multiple_of`:return`Yanlış ədəd: ${e.divisor} ilə bölünə bilən olmalıdır`;case`unrecognized_keys`:return`Tanınmayan açar${e.keys.length>1?`lar`:``}: ${U(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} daxilində yanlış açar`;case`invalid_union`:return`Yanlış dəyər`;case`invalid_element`:return`${e.origin} daxilində yanlış dəyər`;default:return`Yanlış dəyər`}}}}));function yg(e,t,n,r){let i=Math.abs(e),a=i%10,o=i%100;return o>=11&&o<=19?r:a===1?t:a>=2&&a<=4?n:r}function bg(){return{localeError:xg()}}var xg,Sg=t((()=>{K(),xg=()=>{let e={string:{unit:{one:`сімвал`,few:`сімвалы`,many:`сімвалаў`},verb:`мець`},array:{unit:{one:`элемент`,few:`элементы`,many:`элементаў`},verb:`мець`},set:{unit:{one:`элемент`,few:`элементы`,many:`элементаў`},verb:`мець`},file:{unit:{one:`байт`,few:`байты`,many:`байтаў`},verb:`мець`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`лік`;case`object`:if(Array.isArray(e))return`масіў`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`увод`,email:`email адрас`,url:`URL`,emoji:`эмодзі`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO дата і час`,date:`ISO дата`,time:`ISO час`,duration:`ISO працягласць`,ipv4:`IPv4 адрас`,ipv6:`IPv6 адрас`,cidrv4:`IPv4 дыяпазон`,cidrv6:`IPv6 дыяпазон`,base64:`радок у фармаце base64`,base64url:`радок у фармаце base64url`,json_string:`JSON радок`,e164:`нумар E.164`,jwt:`JWT`,template_literal:`увод`};return e=>{switch(e.code){case`invalid_type`:return`Няправільны ўвод: чакаўся ${e.expected}, атрымана ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Няправільны ўвод: чакалася ${G(e.values[0])}`:`Няправільны варыянт: чакаўся адзін з ${U(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);if(r){let t=yg(Number(e.maximum),r.unit.one,r.unit.few,r.unit.many);return`Занадта вялікі: чакалася, што ${e.origin??`значэнне`} павінна ${r.verb} ${n}${e.maximum.toString()} ${t}`}return`Занадта вялікі: чакалася, што ${e.origin??`значэнне`} павінна быць ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);if(r){let t=yg(Number(e.minimum),r.unit.one,r.unit.few,r.unit.many);return`Занадта малы: чакалася, што ${e.origin} павінна ${r.verb} ${n}${e.minimum.toString()} ${t}`}return`Занадта малы: чакалася, што ${e.origin} павінна быць ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Няправільны радок: павінен пачынацца з \"${t.prefix}\"`:t.format===`ends_with`?`Няправільны радок: павінен заканчвацца на \"${t.suffix}\"`:t.format===`includes`?`Няправільны радок: павінен змяшчаць \"${t.includes}\"`:t.format===`regex`?`Няправільны радок: павінен адпавядаць шаблону ${t.pattern}`:`Няправільны ${r[t.format]??e.format}`}case`not_multiple_of`:return`Няправільны лік: павінен быць кратным ${e.divisor}`;case`unrecognized_keys`:return`Нераспазнаны ${e.keys.length>1?`ключы`:`ключ`}: ${U(e.keys,`, `)}`;case`invalid_key`:return`Няправільны ключ у ${e.origin}`;case`invalid_union`:return`Няправільны ўвод`;case`invalid_element`:return`Няправільнае значэнне ў ${e.origin}`;default:return`Няправільны ўвод`}}}}));function Cg(){return{localeError:wg()}}var wg,Tg=t((()=>{K(),wg=()=>{let e={string:{unit:`caràcters`,verb:`contenir`},file:{unit:`bytes`,verb:`contenir`},array:{unit:`elements`,verb:`contenir`},set:{unit:`elements`,verb:`contenir`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`number`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`entrada`,email:`adreça electrònica`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`data i hora ISO`,date:`data ISO`,time:`hora ISO`,duration:`durada ISO`,ipv4:`adreça IPv4`,ipv6:`adreça IPv6`,cidrv4:`rang IPv4`,cidrv6:`rang IPv6`,base64:`cadena codificada en base64`,base64url:`cadena codificada en base64url`,json_string:`cadena JSON`,e164:`número E.164`,jwt:`JWT`,template_literal:`entrada`};return e=>{switch(e.code){case`invalid_type`:return`Tipus invàlid: s'esperava ${e.expected}, s'ha rebut ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Valor invàlid: s'esperava ${G(e.values[0])}`:`Opció invàlida: s'esperava una de ${U(e.values,` o `)}`;case`too_big`:{let n=e.inclusive?`com a màxim`:`menys de`,r=t(e.origin);return r?`Massa gran: s'esperava que ${e.origin??`el valor`} contingués ${n} ${e.maximum.toString()} ${r.unit??`elements`}`:`Massa gran: s'esperava que ${e.origin??`el valor`} fos ${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`com a mínim`:`més de`,r=t(e.origin);return r?`Massa petit: s'esperava que ${e.origin} contingués ${n} ${e.minimum.toString()} ${r.unit}`:`Massa petit: s'esperava que ${e.origin} fos ${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Format invàlid: ha de començar amb \"${t.prefix}\"`:t.format===`ends_with`?`Format invàlid: ha d'acabar amb \"${t.suffix}\"`:t.format===`includes`?`Format invàlid: ha d'incloure \"${t.includes}\"`:t.format===`regex`?`Format invàlid: ha de coincidir amb el patró ${t.pattern}`:`Format invàlid per a ${r[t.format]??e.format}`}case`not_multiple_of`:return`Número invàlid: ha de ser múltiple de ${e.divisor}`;case`unrecognized_keys`:return`Clau${e.keys.length>1?`s`:``} no reconeguda${e.keys.length>1?`s`:``}: ${U(e.keys,`, `)}`;case`invalid_key`:return`Clau invàlida a ${e.origin}`;case`invalid_union`:return`Entrada invàlida`;case`invalid_element`:return`Element invàlid a ${e.origin}`;default:return`Entrada invàlida`}}}}));function Eg(){return{localeError:Dg()}}var Dg,Og=t((()=>{K(),Dg=()=>{let e={string:{unit:`znaků`,verb:`mít`},file:{unit:`bajtů`,verb:`mít`},array:{unit:`prvků`,verb:`mít`},set:{unit:`prvků`,verb:`mít`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`číslo`;case`string`:return`řetězec`;case`boolean`:return`boolean`;case`bigint`:return`bigint`;case`function`:return`funkce`;case`symbol`:return`symbol`;case`undefined`:return`undefined`;case`object`:if(Array.isArray(e))return`pole`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`regulární výraz`,email:`e-mailová adresa`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`datum a čas ve formátu ISO`,date:`datum ve formátu ISO`,time:`čas ve formátu ISO`,duration:`doba trvání ISO`,ipv4:`IPv4 adresa`,ipv6:`IPv6 adresa`,cidrv4:`rozsah IPv4`,cidrv6:`rozsah IPv6`,base64:`řetězec zakódovaný ve formátu base64`,base64url:`řetězec zakódovaný ve formátu base64url`,json_string:`řetězec ve formátu JSON`,e164:`číslo E.164`,jwt:`JWT`,template_literal:`vstup`};return e=>{switch(e.code){case`invalid_type`:return`Neplatný vstup: očekáváno ${e.expected}, obdrženo ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Neplatný vstup: očekáváno ${G(e.values[0])}`:`Neplatná možnost: očekávána jedna z hodnot ${U(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Hodnota je příliš velká: ${e.origin??`hodnota`} musí mít ${n}${e.maximum.toString()} ${r.unit??`prvků`}`:`Hodnota je příliš velká: ${e.origin??`hodnota`} musí být ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Hodnota je příliš malá: ${e.origin??`hodnota`} musí mít ${n}${e.minimum.toString()} ${r.unit??`prvků`}`:`Hodnota je příliš malá: ${e.origin??`hodnota`} musí být ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Neplatný řetězec: musí začínat na \"${t.prefix}\"`:t.format===`ends_with`?`Neplatný řetězec: musí končit na \"${t.suffix}\"`:t.format===`includes`?`Neplatný řetězec: musí obsahovat \"${t.includes}\"`:t.format===`regex`?`Neplatný řetězec: musí odpovídat vzoru ${t.pattern}`:`Neplatný formát ${r[t.format]??e.format}`}case`not_multiple_of`:return`Neplatné číslo: musí být násobkem ${e.divisor}`;case`unrecognized_keys`:return`Neznámé klíče: ${U(e.keys,`, `)}`;case`invalid_key`:return`Neplatný klíč v ${e.origin}`;case`invalid_union`:return`Neplatný vstup`;case`invalid_element`:return`Neplatná hodnota v ${e.origin}`;default:return`Neplatný vstup`}}}}));function kg(){return{localeError:Ag()}}var Ag,jg=t((()=>{K(),Ag=()=>{let e={string:{unit:`Zeichen`,verb:`zu haben`},file:{unit:`Bytes`,verb:`zu haben`},array:{unit:`Elemente`,verb:`zu haben`},set:{unit:`Elemente`,verb:`zu haben`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`Zahl`;case`object`:if(Array.isArray(e))return`Array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`Eingabe`,email:`E-Mail-Adresse`,url:`URL`,emoji:`Emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO-Datum und -Uhrzeit`,date:`ISO-Datum`,time:`ISO-Uhrzeit`,duration:`ISO-Dauer`,ipv4:`IPv4-Adresse`,ipv6:`IPv6-Adresse`,cidrv4:`IPv4-Bereich`,cidrv6:`IPv6-Bereich`,base64:`Base64-codierter String`,base64url:`Base64-URL-codierter String`,json_string:`JSON-String`,e164:`E.164-Nummer`,jwt:`JWT`,template_literal:`Eingabe`};return e=>{switch(e.code){case`invalid_type`:return`Ungültige Eingabe: erwartet ${e.expected}, erhalten ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Ungültige Eingabe: erwartet ${G(e.values[0])}`:`Ungültige Option: erwartet eine von ${U(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Zu groß: erwartet, dass ${e.origin??`Wert`} ${n}${e.maximum.toString()} ${r.unit??`Elemente`} hat`:`Zu groß: erwartet, dass ${e.origin??`Wert`} ${n}${e.maximum.toString()} ist`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Zu klein: erwartet, dass ${e.origin} ${n}${e.minimum.toString()} ${r.unit} hat`:`Zu klein: erwartet, dass ${e.origin} ${n}${e.minimum.toString()} ist`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ungültiger String: muss mit \"${t.prefix}\" beginnen`:t.format===`ends_with`?`Ungültiger String: muss mit \"${t.suffix}\" enden`:t.format===`includes`?`Ungültiger String: muss \"${t.includes}\" enthalten`:t.format===`regex`?`Ungültiger String: muss dem Muster ${t.pattern} entsprechen`:`Ungültig: ${r[t.format]??e.format}`}case`not_multiple_of`:return`Ungültige Zahl: muss ein Vielfaches von ${e.divisor} sein`;case`unrecognized_keys`:return`${e.keys.length>1?`Unbekannte Schlüssel`:`Unbekannter Schlüssel`}: ${U(e.keys,`, `)}`;case`invalid_key`:return`Ungültiger Schlüssel in ${e.origin}`;case`invalid_union`:return`Ungültige Eingabe`;case`invalid_element`:return`Ungültiger Wert in ${e.origin}`;default:return`Ungültige Eingabe`}}}}));function Mg(){return{localeError:Pg()}}var Ng,Pg,Fg=t((()=>{K(),Ng=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`number`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},Pg=()=>{let e={string:{unit:`characters`,verb:`to have`},file:{unit:`bytes`,verb:`to have`},array:{unit:`items`,verb:`to have`},set:{unit:`items`,verb:`to have`}};function t(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,jwt:`JWT`,template_literal:`input`};return e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${e.expected}, received ${Ng(e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${G(e.values[0])}`:`Invalid option: expected one of ${U(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with \"${t.prefix}\"`:t.format===`ends_with`?`Invalid string: must end with \"${t.suffix}\"`:t.format===`includes`?`Invalid string: must include \"${t.includes}\"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${U(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}}}));function Ig(){return{localeError:Rg()}}var Lg,Rg,zg=t((()=>{K(),Lg=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`nombro`;case`object`:if(Array.isArray(e))return`tabelo`;if(e===null)return`senvalora`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},Rg=()=>{let e={string:{unit:`karaktrojn`,verb:`havi`},file:{unit:`bajtojn`,verb:`havi`},array:{unit:`elementojn`,verb:`havi`},set:{unit:`elementojn`,verb:`havi`}};function t(t){return e[t]??null}let n={regex:`enigo`,email:`retadreso`,url:`URL`,emoji:`emoĝio`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO-datotempo`,date:`ISO-dato`,time:`ISO-tempo`,duration:`ISO-daŭro`,ipv4:`IPv4-adreso`,ipv6:`IPv6-adreso`,cidrv4:`IPv4-rango`,cidrv6:`IPv6-rango`,base64:`64-ume kodita karaktraro`,base64url:`URL-64-ume kodita karaktraro`,json_string:`JSON-karaktraro`,e164:`E.164-nombro`,jwt:`JWT`,template_literal:`enigo`};return e=>{switch(e.code){case`invalid_type`:return`Nevalida enigo: atendiĝis ${e.expected}, riceviĝis ${Lg(e.input)}`;case`invalid_value`:return e.values.length===1?`Nevalida enigo: atendiĝis ${G(e.values[0])}`:`Nevalida opcio: atendiĝis unu el ${U(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Tro granda: atendiĝis ke ${e.origin??`valoro`} havu ${n}${e.maximum.toString()} ${r.unit??`elementojn`}`:`Tro granda: atendiĝis ke ${e.origin??`valoro`} havu ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Tro malgranda: atendiĝis ke ${e.origin} havu ${n}${e.minimum.toString()} ${r.unit}`:`Tro malgranda: atendiĝis ke ${e.origin} estu ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Nevalida karaktraro: devas komenciĝi per \"${t.prefix}\"`:t.format===`ends_with`?`Nevalida karaktraro: devas finiĝi per \"${t.suffix}\"`:t.format===`includes`?`Nevalida karaktraro: devas inkluzivi \"${t.includes}\"`:t.format===`regex`?`Nevalida karaktraro: devas kongrui kun la modelo ${t.pattern}`:`Nevalida ${n[t.format]??e.format}`}case`not_multiple_of`:return`Nevalida nombro: devas esti oblo de ${e.divisor}`;case`unrecognized_keys`:return`Nekonata${e.keys.length>1?`j`:``} ŝlosilo${e.keys.length>1?`j`:``}: ${U(e.keys,`, `)}`;case`invalid_key`:return`Nevalida ŝlosilo en ${e.origin}`;case`invalid_union`:return`Nevalida enigo`;case`invalid_element`:return`Nevalida valoro en ${e.origin}`;default:return`Nevalida enigo`}}}}));function Bg(){return{localeError:Vg()}}var Vg,Hg=t((()=>{K(),Vg=()=>{let e={string:{unit:`caracteres`,verb:`tener`},file:{unit:`bytes`,verb:`tener`},array:{unit:`elementos`,verb:`tener`},set:{unit:`elementos`,verb:`tener`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`número`;case`object`:if(Array.isArray(e))return`arreglo`;if(e===null)return`nulo`;if(Object.getPrototypeOf(e)!==Object.prototype)return e.constructor.name}return t},r={regex:`entrada`,email:`dirección de correo electrónico`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`fecha y hora ISO`,date:`fecha ISO`,time:`hora ISO`,duration:`duración ISO`,ipv4:`dirección IPv4`,ipv6:`dirección IPv6`,cidrv4:`rango IPv4`,cidrv6:`rango IPv6`,base64:`cadena codificada en base64`,base64url:`URL codificada en base64`,json_string:`cadena JSON`,e164:`número E.164`,jwt:`JWT`,template_literal:`entrada`};return e=>{switch(e.code){case`invalid_type`:return`Entrada inválida: se esperaba ${e.expected}, recibido ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Entrada inválida: se esperaba ${G(e.values[0])}`:`Opción inválida: se esperaba una de ${U(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Demasiado grande: se esperaba que ${e.origin??`valor`} tuviera ${n}${e.maximum.toString()} ${r.unit??`elementos`}`:`Demasiado grande: se esperaba que ${e.origin??`valor`} fuera ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Demasiado pequeño: se esperaba que ${e.origin} tuviera ${n}${e.minimum.toString()} ${r.unit}`:`Demasiado pequeño: se esperaba que ${e.origin} fuera ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Cadena inválida: debe comenzar con \"${t.prefix}\"`:t.format===`ends_with`?`Cadena inválida: debe terminar en \"${t.suffix}\"`:t.format===`includes`?`Cadena inválida: debe incluir \"${t.includes}\"`:t.format===`regex`?`Cadena inválida: debe coincidir con el patrón ${t.pattern}`:`Inválido ${r[t.format]??e.format}`}case`not_multiple_of`:return`Número inválido: debe ser múltiplo de ${e.divisor}`;case`unrecognized_keys`:return`Llave${e.keys.length>1?`s`:``} desconocida${e.keys.length>1?`s`:``}: ${U(e.keys,`, `)}`;case`invalid_key`:return`Llave inválida en ${e.origin}`;case`invalid_union`:return`Entrada inválida`;case`invalid_element`:return`Valor inválido en ${e.origin}`;default:return`Entrada inválida`}}}}));function Ug(){return{localeError:Wg()}}var Wg,Gg=t((()=>{K(),Wg=()=>{let e={string:{unit:`کاراکتر`,verb:`داشته باشد`},file:{unit:`بایت`,verb:`داشته باشد`},array:{unit:`آیتم`,verb:`داشته باشد`},set:{unit:`آیتم`,verb:`داشته باشد`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`عدد`;case`object`:if(Array.isArray(e))return`آرایه`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`ورودی`,email:`آدرس ایمیل`,url:`URL`,emoji:`ایموجی`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`تاریخ و زمان ایزو`,date:`تاریخ ایزو`,time:`زمان ایزو`,duration:`مدت زمان ایزو`,ipv4:`IPv4 آدرس`,ipv6:`IPv6 آدرس`,cidrv4:`IPv4 دامنه`,cidrv6:`IPv6 دامنه`,base64:`base64-encoded رشته`,base64url:`base64url-encoded رشته`,json_string:`JSON رشته`,e164:`E.164 عدد`,jwt:`JWT`,template_literal:`ورودی`};return e=>{switch(e.code){case`invalid_type`:return`ورودی نامعتبر: میبایست ${e.expected} میبود، ${n(e.input)} دریافت شد`;case`invalid_value`:return e.values.length===1?`ورودی نامعتبر: میبایست ${G(e.values[0])} میبود`:`گزینه نامعتبر: میبایست یکی از ${U(e.values,`|`)} میبود`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`خیلی بزرگ: ${e.origin??`مقدار`} باید ${n}${e.maximum.toString()} ${r.unit??`عنصر`} باشد`:`خیلی بزرگ: ${e.origin??`مقدار`} باید ${n}${e.maximum.toString()} باشد`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`خیلی کوچک: ${e.origin} باید ${n}${e.minimum.toString()} ${r.unit} باشد`:`خیلی کوچک: ${e.origin} باید ${n}${e.minimum.toString()} باشد`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`رشته نامعتبر: باید با \"${t.prefix}\" شروع شود`:t.format===`ends_with`?`رشته نامعتبر: باید با \"${t.suffix}\" تمام شود`:t.format===`includes`?`رشته نامعتبر: باید شامل \"${t.includes}\" باشد`:t.format===`regex`?`رشته نامعتبر: باید با الگوی ${t.pattern} مطابقت داشته باشد`:`${r[t.format]??e.format} نامعتبر`}case`not_multiple_of`:return`عدد نامعتبر: باید مضرب ${e.divisor} باشد`;case`unrecognized_keys`:return`کلید${e.keys.length>1?`های`:``} ناشناس: ${U(e.keys,`, `)}`;case`invalid_key`:return`کلید ناشناس در ${e.origin}`;case`invalid_union`:return`ورودی نامعتبر`;case`invalid_element`:return`مقدار نامعتبر در ${e.origin}`;default:return`ورودی نامعتبر`}}}}));function Kg(){return{localeError:qg()}}var qg,Jg=t((()=>{K(),qg=()=>{let e={string:{unit:`merkkiä`,subject:`merkkijonon`},file:{unit:`tavua`,subject:`tiedoston`},array:{unit:`alkiota`,subject:`listan`},set:{unit:`alkiota`,subject:`joukon`},number:{unit:``,subject:`luvun`},bigint:{unit:``,subject:`suuren kokonaisluvun`},int:{unit:``,subject:`kokonaisluvun`},date:{unit:``,subject:`päivämäärän`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`number`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`säännöllinen lauseke`,email:`sähköpostiosoite`,url:`URL-osoite`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO-aikaleima`,date:`ISO-päivämäärä`,time:`ISO-aika`,duration:`ISO-kesto`,ipv4:`IPv4-osoite`,ipv6:`IPv6-osoite`,cidrv4:`IPv4-alue`,cidrv6:`IPv6-alue`,base64:`base64-koodattu merkkijono`,base64url:`base64url-koodattu merkkijono`,json_string:`JSON-merkkijono`,e164:`E.164-luku`,jwt:`JWT`,template_literal:`templaattimerkkijono`};return e=>{switch(e.code){case`invalid_type`:return`Virheellinen tyyppi: odotettiin ${e.expected}, oli ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Virheellinen syöte: täytyy olla ${G(e.values[0])}`:`Virheellinen valinta: täytyy olla yksi seuraavista: ${U(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Liian suuri: ${r.subject} täytyy olla ${n}${e.maximum.toString()} ${r.unit}`.trim():`Liian suuri: arvon täytyy olla ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Liian pieni: ${r.subject} täytyy olla ${n}${e.minimum.toString()} ${r.unit}`.trim():`Liian pieni: arvon täytyy olla ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Virheellinen syöte: täytyy alkaa \"${t.prefix}\"`:t.format===`ends_with`?`Virheellinen syöte: täytyy loppua \"${t.suffix}\"`:t.format===`includes`?`Virheellinen syöte: täytyy sisältää \"${t.includes}\"`:t.format===`regex`?`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${t.pattern}`:`Virheellinen ${r[t.format]??e.format}`}case`not_multiple_of`:return`Virheellinen luku: täytyy olla luvun ${e.divisor} monikerta`;case`unrecognized_keys`:return`${e.keys.length>1?`Tuntemattomat avaimet`:`Tuntematon avain`}: ${U(e.keys,`, `)}`;case`invalid_key`:return`Virheellinen avain tietueessa`;case`invalid_union`:return`Virheellinen unioni`;case`invalid_element`:return`Virheellinen arvo joukossa`;default:return`Virheellinen syöte`}}}}));function Yg(){return{localeError:Xg()}}var Xg,Zg=t((()=>{K(),Xg=()=>{let e={string:{unit:`caractères`,verb:`avoir`},file:{unit:`octets`,verb:`avoir`},array:{unit:`éléments`,verb:`avoir`},set:{unit:`éléments`,verb:`avoir`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`nombre`;case`object`:if(Array.isArray(e))return`tableau`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`entrée`,email:`adresse e-mail`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`date et heure ISO`,date:`date ISO`,time:`heure ISO`,duration:`durée ISO`,ipv4:`adresse IPv4`,ipv6:`adresse IPv6`,cidrv4:`plage IPv4`,cidrv6:`plage IPv6`,base64:`chaîne encodée en base64`,base64url:`chaîne encodée en base64url`,json_string:`chaîne JSON`,e164:`numéro E.164`,jwt:`JWT`,template_literal:`entrée`};return e=>{switch(e.code){case`invalid_type`:return`Entrée invalide : ${e.expected} attendu, ${n(e.input)} reçu`;case`invalid_value`:return e.values.length===1?`Entrée invalide : ${G(e.values[0])} attendu`:`Option invalide : une valeur parmi ${U(e.values,`|`)} attendue`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Trop grand : ${e.origin??`valeur`} doit ${r.verb} ${n}${e.maximum.toString()} ${r.unit??`élément(s)`}`:`Trop grand : ${e.origin??`valeur`} doit être ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Trop petit : ${e.origin} doit ${r.verb} ${n}${e.minimum.toString()} ${r.unit}`:`Trop petit : ${e.origin} doit être ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Chaîne invalide : doit commencer par \"${t.prefix}\"`:t.format===`ends_with`?`Chaîne invalide : doit se terminer par \"${t.suffix}\"`:t.format===`includes`?`Chaîne invalide : doit inclure \"${t.includes}\"`:t.format===`regex`?`Chaîne invalide : doit correspondre au modèle ${t.pattern}`:`${r[t.format]??e.format} invalide`}case`not_multiple_of`:return`Nombre invalide : doit être un multiple de ${e.divisor}`;case`unrecognized_keys`:return`Clé${e.keys.length>1?`s`:``} non reconnue${e.keys.length>1?`s`:``} : ${U(e.keys,`, `)}`;case`invalid_key`:return`Clé invalide dans ${e.origin}`;case`invalid_union`:return`Entrée invalide`;case`invalid_element`:return`Valeur invalide dans ${e.origin}`;default:return`Entrée invalide`}}}}));function Qg(){return{localeError:$g()}}var $g,e_=t((()=>{K(),$g=()=>{let e={string:{unit:`caractères`,verb:`avoir`},file:{unit:`octets`,verb:`avoir`},array:{unit:`éléments`,verb:`avoir`},set:{unit:`éléments`,verb:`avoir`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`number`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`entrée`,email:`adresse courriel`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`date-heure ISO`,date:`date ISO`,time:`heure ISO`,duration:`durée ISO`,ipv4:`adresse IPv4`,ipv6:`adresse IPv6`,cidrv4:`plage IPv4`,cidrv6:`plage IPv6`,base64:`chaîne encodée en base64`,base64url:`chaîne encodée en base64url`,json_string:`chaîne JSON`,e164:`numéro E.164`,jwt:`JWT`,template_literal:`entrée`};return e=>{switch(e.code){case`invalid_type`:return`Entrée invalide : attendu ${e.expected}, reçu ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Entrée invalide : attendu ${G(e.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${U(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`≤`:`<`,r=t(e.origin);return r?`Trop grand : attendu que ${e.origin??`la valeur`} ait ${n}${e.maximum.toString()} ${r.unit}`:`Trop grand : attendu que ${e.origin??`la valeur`} soit ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`≥`:`>`,r=t(e.origin);return r?`Trop petit : attendu que ${e.origin} ait ${n}${e.minimum.toString()} ${r.unit}`:`Trop petit : attendu que ${e.origin} soit ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Chaîne invalide : doit commencer par \"${t.prefix}\"`:t.format===`ends_with`?`Chaîne invalide : doit se terminer par \"${t.suffix}\"`:t.format===`includes`?`Chaîne invalide : doit inclure \"${t.includes}\"`:t.format===`regex`?`Chaîne invalide : doit correspondre au motif ${t.pattern}`:`${r[t.format]??e.format} invalide`}case`not_multiple_of`:return`Nombre invalide : doit être un multiple de ${e.divisor}`;case`unrecognized_keys`:return`Clé${e.keys.length>1?`s`:``} non reconnue${e.keys.length>1?`s`:``} : ${U(e.keys,`, `)}`;case`invalid_key`:return`Clé invalide dans ${e.origin}`;case`invalid_union`:return`Entrée invalide`;case`invalid_element`:return`Valeur invalide dans ${e.origin}`;default:return`Entrée invalide`}}}}));function t_(){return{localeError:n_()}}var n_,r_=t((()=>{K(),n_=()=>{let e={string:{unit:`אותיות`,verb:`לכלול`},file:{unit:`בייטים`,verb:`לכלול`},array:{unit:`פריטים`,verb:`לכלול`},set:{unit:`פריטים`,verb:`לכלול`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`number`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`קלט`,email:`כתובת אימייל`,url:`כתובת רשת`,emoji:`אימוג'י`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`תאריך וזמן ISO`,date:`תאריך ISO`,time:`זמן ISO`,duration:`משך זמן ISO`,ipv4:`כתובת IPv4`,ipv6:`כתובת IPv6`,cidrv4:`טווח IPv4`,cidrv6:`טווח IPv6`,base64:`מחרוזת בבסיס 64`,base64url:`מחרוזת בבסיס 64 לכתובות רשת`,json_string:`מחרוזת JSON`,e164:`מספר E.164`,jwt:`JWT`,template_literal:`קלט`};return e=>{switch(e.code){case`invalid_type`:return`קלט לא תקין: צריך ${e.expected}, התקבל ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`קלט לא תקין: צריך ${G(e.values[0])}`:`קלט לא תקין: צריך אחת מהאפשרויות ${U(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`גדול מדי: ${e.origin??`value`} צריך להיות ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`גדול מדי: ${e.origin??`value`} צריך להיות ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`קטן מדי: ${e.origin} צריך להיות ${n}${e.minimum.toString()} ${r.unit}`:`קטן מדי: ${e.origin} צריך להיות ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`מחרוזת לא תקינה: חייבת להתחיל ב\"${t.prefix}\"`:t.format===`ends_with`?`מחרוזת לא תקינה: חייבת להסתיים ב \"${t.suffix}\"`:t.format===`includes`?`מחרוזת לא תקינה: חייבת לכלול \"${t.includes}\"`:t.format===`regex`?`מחרוזת לא תקינה: חייבת להתאים לתבנית ${t.pattern}`:`${r[t.format]??e.format} לא תקין`}case`not_multiple_of`:return`מספר לא תקין: חייב להיות מכפלה של ${e.divisor}`;case`unrecognized_keys`:return`מפתח${e.keys.length>1?`ות`:``} לא מזוה${e.keys.length>1?`ים`:`ה`}: ${U(e.keys,`, `)}`;case`invalid_key`:return`מפתח לא תקין ב${e.origin}`;case`invalid_union`:return`קלט לא תקין`;case`invalid_element`:return`ערך לא תקין ב${e.origin}`;default:return`קלט לא תקין`}}}}));function i_(){return{localeError:a_()}}var a_,o_=t((()=>{K(),a_=()=>{let e={string:{unit:`karakter`,verb:`legyen`},file:{unit:`byte`,verb:`legyen`},array:{unit:`elem`,verb:`legyen`},set:{unit:`elem`,verb:`legyen`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`szám`;case`object`:if(Array.isArray(e))return`tömb`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`bemenet`,email:`email cím`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO időbélyeg`,date:`ISO dátum`,time:`ISO idő`,duration:`ISO időintervallum`,ipv4:`IPv4 cím`,ipv6:`IPv6 cím`,cidrv4:`IPv4 tartomány`,cidrv6:`IPv6 tartomány`,base64:`base64-kódolt string`,base64url:`base64url-kódolt string`,json_string:`JSON string`,e164:`E.164 szám`,jwt:`JWT`,template_literal:`bemenet`};return e=>{switch(e.code){case`invalid_type`:return`Érvénytelen bemenet: a várt érték ${e.expected}, a kapott érték ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Érvénytelen bemenet: a várt érték ${G(e.values[0])}`:`Érvénytelen opció: valamelyik érték várt ${U(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Túl nagy: ${e.origin??`érték`} mérete túl nagy ${n}${e.maximum.toString()} ${r.unit??`elem`}`:`Túl nagy: a bemeneti érték ${e.origin??`érték`} túl nagy: ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Túl kicsi: a bemeneti érték ${e.origin} mérete túl kicsi ${n}${e.minimum.toString()} ${r.unit}`:`Túl kicsi: a bemeneti érték ${e.origin} túl kicsi ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Érvénytelen string: \"${t.prefix}\" értékkel kell kezdődnie`:t.format===`ends_with`?`Érvénytelen string: \"${t.suffix}\" értékkel kell végződnie`:t.format===`includes`?`Érvénytelen string: \"${t.includes}\" értéket kell tartalmaznia`:t.format===`regex`?`Érvénytelen string: ${t.pattern} mintának kell megfelelnie`:`Érvénytelen ${r[t.format]??e.format}`}case`not_multiple_of`:return`Érvénytelen szám: ${e.divisor} többszörösének kell lennie`;case`unrecognized_keys`:return`Ismeretlen kulcs${e.keys.length>1?`s`:``}: ${U(e.keys,`, `)}`;case`invalid_key`:return`Érvénytelen kulcs ${e.origin}`;case`invalid_union`:return`Érvénytelen bemenet`;case`invalid_element`:return`Érvénytelen érték: ${e.origin}`;default:return`Érvénytelen bemenet`}}}}));function s_(){return{localeError:c_()}}var c_,l_=t((()=>{K(),c_=()=>{let e={string:{unit:`karakter`,verb:`memiliki`},file:{unit:`byte`,verb:`memiliki`},array:{unit:`item`,verb:`memiliki`},set:{unit:`item`,verb:`memiliki`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`number`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`input`,email:`alamat email`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`tanggal dan waktu format ISO`,date:`tanggal format ISO`,time:`jam format ISO`,duration:`durasi format ISO`,ipv4:`alamat IPv4`,ipv6:`alamat IPv6`,cidrv4:`rentang alamat IPv4`,cidrv6:`rentang alamat IPv6`,base64:`string dengan enkode base64`,base64url:`string dengan enkode base64url`,json_string:`string JSON`,e164:`angka E.164`,jwt:`JWT`,template_literal:`input`};return e=>{switch(e.code){case`invalid_type`:return`Input tidak valid: diharapkan ${e.expected}, diterima ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Input tidak valid: diharapkan ${G(e.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${U(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Terlalu besar: diharapkan ${e.origin??`value`} memiliki ${n}${e.maximum.toString()} ${r.unit??`elemen`}`:`Terlalu besar: diharapkan ${e.origin??`value`} menjadi ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Terlalu kecil: diharapkan ${e.origin} memiliki ${n}${e.minimum.toString()} ${r.unit}`:`Terlalu kecil: diharapkan ${e.origin} menjadi ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`String tidak valid: harus dimulai dengan \"${t.prefix}\"`:t.format===`ends_with`?`String tidak valid: harus berakhir dengan \"${t.suffix}\"`:t.format===`includes`?`String tidak valid: harus menyertakan \"${t.includes}\"`:t.format===`regex`?`String tidak valid: harus sesuai pola ${t.pattern}`:`${r[t.format]??e.format} tidak valid`}case`not_multiple_of`:return`Angka tidak valid: harus kelipatan dari ${e.divisor}`;case`unrecognized_keys`:return`Kunci tidak dikenali ${e.keys.length>1?`s`:``}: ${U(e.keys,`, `)}`;case`invalid_key`:return`Kunci tidak valid di ${e.origin}`;case`invalid_union`:return`Input tidak valid`;case`invalid_element`:return`Nilai tidak valid di ${e.origin}`;default:return`Input tidak valid`}}}}));function u_(){return{localeError:d_()}}var d_,f_=t((()=>{K(),d_=()=>{let e={string:{unit:`caratteri`,verb:`avere`},file:{unit:`byte`,verb:`avere`},array:{unit:`elementi`,verb:`avere`},set:{unit:`elementi`,verb:`avere`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`numero`;case`object`:if(Array.isArray(e))return`vettore`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`input`,email:`indirizzo email`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`data e ora ISO`,date:`data ISO`,time:`ora ISO`,duration:`durata ISO`,ipv4:`indirizzo IPv4`,ipv6:`indirizzo IPv6`,cidrv4:`intervallo IPv4`,cidrv6:`intervallo IPv6`,base64:`stringa codificata in base64`,base64url:`URL codificata in base64`,json_string:`stringa JSON`,e164:`numero E.164`,jwt:`JWT`,template_literal:`input`};return e=>{switch(e.code){case`invalid_type`:return`Input non valido: atteso ${e.expected}, ricevuto ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Input non valido: atteso ${G(e.values[0])}`:`Opzione non valida: atteso uno tra ${U(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Troppo grande: ${e.origin??`valore`} deve avere ${n}${e.maximum.toString()} ${r.unit??`elementi`}`:`Troppo grande: ${e.origin??`valore`} deve essere ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Troppo piccolo: ${e.origin} deve avere ${n}${e.minimum.toString()} ${r.unit}`:`Troppo piccolo: ${e.origin} deve essere ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Stringa non valida: deve iniziare con \"${t.prefix}\"`:t.format===`ends_with`?`Stringa non valida: deve terminare con \"${t.suffix}\"`:t.format===`includes`?`Stringa non valida: deve includere \"${t.includes}\"`:t.format===`regex`?`Stringa non valida: deve corrispondere al pattern ${t.pattern}`:`Invalid ${r[t.format]??e.format}`}case`not_multiple_of`:return`Numero non valido: deve essere un multiplo di ${e.divisor}`;case`unrecognized_keys`:return`Chiav${e.keys.length>1?`i`:`e`} non riconosciut${e.keys.length>1?`e`:`a`}: ${U(e.keys,`, `)}`;case`invalid_key`:return`Chiave non valida in ${e.origin}`;case`invalid_union`:return`Input non valido`;case`invalid_element`:return`Valore non valido in ${e.origin}`;default:return`Input non valido`}}}}));function p_(){return{localeError:m_()}}var m_,h_=t((()=>{K(),m_=()=>{let e={string:{unit:`文字`,verb:`である`},file:{unit:`バイト`,verb:`である`},array:{unit:`要素`,verb:`である`},set:{unit:`要素`,verb:`である`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`数値`;case`object`:if(Array.isArray(e))return`配列`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`入力値`,email:`メールアドレス`,url:`URL`,emoji:`絵文字`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO日時`,date:`ISO日付`,time:`ISO時刻`,duration:`ISO期間`,ipv4:`IPv4アドレス`,ipv6:`IPv6アドレス`,cidrv4:`IPv4範囲`,cidrv6:`IPv6範囲`,base64:`base64エンコード文字列`,base64url:`base64urlエンコード文字列`,json_string:`JSON文字列`,e164:`E.164番号`,jwt:`JWT`,template_literal:`入力値`};return e=>{switch(e.code){case`invalid_type`:return`無効な入力: ${e.expected}が期待されましたが、${n(e.input)}が入力されました`;case`invalid_value`:return e.values.length===1?`無効な入力: ${G(e.values[0])}が期待されました`:`無効な選択: ${U(e.values,`、`)}のいずれかである必要があります`;case`too_big`:{let n=e.inclusive?`以下である`:`より小さい`,r=t(e.origin);return r?`大きすぎる値: ${e.origin??`値`}は${e.maximum.toString()}${r.unit??`要素`}${n}必要があります`:`大きすぎる値: ${e.origin??`値`}は${e.maximum.toString()}${n}必要があります`}case`too_small`:{let n=e.inclusive?`以上である`:`より大きい`,r=t(e.origin);return r?`小さすぎる値: ${e.origin}は${e.minimum.toString()}${r.unit}${n}必要があります`:`小さすぎる値: ${e.origin}は${e.minimum.toString()}${n}必要があります`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`無効な文字列: \"${t.prefix}\"で始まる必要があります`:t.format===`ends_with`?`無効な文字列: \"${t.suffix}\"で終わる必要があります`:t.format===`includes`?`無効な文字列: \"${t.includes}\"を含む必要があります`:t.format===`regex`?`無効な文字列: パターン${t.pattern}に一致する必要があります`:`無効な${r[t.format]??e.format}`}case`not_multiple_of`:return`無効な数値: ${e.divisor}の倍数である必要があります`;case`unrecognized_keys`:return`認識されていないキー${e.keys.length>1?`群`:``}: ${U(e.keys,`、`)}`;case`invalid_key`:return`${e.origin}内の無効なキー`;case`invalid_union`:return`無効な入力`;case`invalid_element`:return`${e.origin}内の無効な値`;default:return`無効な入力`}}}}));function g_(){return{localeError:__()}}var __,v_=t((()=>{K(),__=()=>{let e={string:{unit:`តួអក្សរ`,verb:`គួរមាន`},file:{unit:`បៃ`,verb:`គួរមាន`},array:{unit:`ធាតុ`,verb:`គួរមាន`},set:{unit:`ធាតុ`,verb:`គួរមាន`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`មិនមែនជាលេខ (NaN)`:`លេខ`;case`object`:if(Array.isArray(e))return`អារេ (Array)`;if(e===null)return`គ្មានតម្លៃ (null)`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`ទិន្នន័យបញ្ចូល`,email:`អាសយដ្ឋានអ៊ីមែល`,url:`URL`,emoji:`សញ្ញាអារម្មណ៍`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`កាលបរិច្ឆេទ និងម៉ោង ISO`,date:`កាលបរិច្ឆេទ ISO`,time:`ម៉ោង ISO`,duration:`រយៈពេល ISO`,ipv4:`អាសយដ្ឋាន IPv4`,ipv6:`អាសយដ្ឋាន IPv6`,cidrv4:`ដែនអាសយដ្ឋាន IPv4`,cidrv6:`ដែនអាសយដ្ឋាន IPv6`,base64:`ខ្សែអក្សរអ៊ិកូដ base64`,base64url:`ខ្សែអក្សរអ៊ិកូដ base64url`,json_string:`ខ្សែអក្សរ JSON`,e164:`លេខ E.164`,jwt:`JWT`,template_literal:`ទិន្នន័យបញ្ចូល`};return e=>{switch(e.code){case`invalid_type`:return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${e.expected} ប៉ុន្តែទទួលបាន ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${G(e.values[0])}`:`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${U(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`ធំពេក៖ ត្រូវការ ${e.origin??`តម្លៃ`} ${n} ${e.maximum.toString()} ${r.unit??`ធាតុ`}`:`ធំពេក៖ ត្រូវការ ${e.origin??`តម្លៃ`} ${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`តូចពេក៖ ត្រូវការ ${e.origin} ${n} ${e.minimum.toString()} ${r.unit}`:`តូចពេក៖ ត្រូវការ ${e.origin} ${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ \"${t.prefix}\"`:t.format===`ends_with`?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ \"${t.suffix}\"`:t.format===`includes`?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន \"${t.includes}\"`:t.format===`regex`?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${t.pattern}`:`មិនត្រឹមត្រូវ៖ ${r[t.format]??e.format}`}case`not_multiple_of`:return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${e.divisor}`;case`unrecognized_keys`:return`រកឃើញសោមិនស្គាល់៖ ${U(e.keys,`, `)}`;case`invalid_key`:return`សោមិនត្រឹមត្រូវនៅក្នុង ${e.origin}`;case`invalid_union`:return`ទិន្នន័យមិនត្រឹមត្រូវ`;case`invalid_element`:return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${e.origin}`;default:return`ទិន្នន័យមិនត្រឹមត្រូវ`}}}}));function y_(){return{localeError:b_()}}var b_,x_=t((()=>{K(),b_=()=>{let e={string:{unit:`문자`,verb:`to have`},file:{unit:`바이트`,verb:`to have`},array:{unit:`개`,verb:`to have`},set:{unit:`개`,verb:`to have`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`number`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`입력`,email:`이메일 주소`,url:`URL`,emoji:`이모지`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO 날짜시간`,date:`ISO 날짜`,time:`ISO 시간`,duration:`ISO 기간`,ipv4:`IPv4 주소`,ipv6:`IPv6 주소`,cidrv4:`IPv4 범위`,cidrv6:`IPv6 범위`,base64:`base64 인코딩 문자열`,base64url:`base64url 인코딩 문자열`,json_string:`JSON 문자열`,e164:`E.164 번호`,jwt:`JWT`,template_literal:`입력`};return e=>{switch(e.code){case`invalid_type`:return`잘못된 입력: 예상 타입은 ${e.expected}, 받은 타입은 ${n(e.input)}입니다`;case`invalid_value`:return e.values.length===1?`잘못된 입력: 값은 ${G(e.values[0])} 이어야 합니다`:`잘못된 옵션: ${U(e.values,`또는 `)} 중 하나여야 합니다`;case`too_big`:{let n=e.inclusive?`이하`:`미만`,r=n===`미만`?`이어야 합니다`:`여야 합니다`,i=t(e.origin),a=i?.unit??`요소`;return i?`${e.origin??`값`}이 너무 큽니다: ${e.maximum.toString()}${a} ${n}${r}`:`${e.origin??`값`}이 너무 큽니다: ${e.maximum.toString()} ${n}${r}`}case`too_small`:{let n=e.inclusive?`이상`:`초과`,r=n===`이상`?`이어야 합니다`:`여야 합니다`,i=t(e.origin),a=i?.unit??`요소`;return i?`${e.origin??`값`}이 너무 작습니다: ${e.minimum.toString()}${a} ${n}${r}`:`${e.origin??`값`}이 너무 작습니다: ${e.minimum.toString()} ${n}${r}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`잘못된 문자열: \"${t.prefix}\"(으)로 시작해야 합니다`:t.format===`ends_with`?`잘못된 문자열: \"${t.suffix}\"(으)로 끝나야 합니다`:t.format===`includes`?`잘못된 문자열: \"${t.includes}\"을(를) 포함해야 합니다`:t.format===`regex`?`잘못된 문자열: 정규식 ${t.pattern} 패턴과 일치해야 합니다`:`잘못된 ${r[t.format]??e.format}`}case`not_multiple_of`:return`잘못된 숫자: ${e.divisor}의 배수여야 합니다`;case`unrecognized_keys`:return`인식할 수 없는 키: ${U(e.keys,`, `)}`;case`invalid_key`:return`잘못된 키: ${e.origin}`;case`invalid_union`:return`잘못된 입력`;case`invalid_element`:return`잘못된 값: ${e.origin}`;default:return`잘못된 입력`}}}}));function S_(){return{localeError:C_()}}var C_,w_=t((()=>{K(),C_=()=>{let e={string:{unit:`знаци`,verb:`да имаат`},file:{unit:`бајти`,verb:`да имаат`},array:{unit:`ставки`,verb:`да имаат`},set:{unit:`ставки`,verb:`да имаат`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`број`;case`object`:if(Array.isArray(e))return`низа`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`внес`,email:`адреса на е-пошта`,url:`URL`,emoji:`емоџи`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO датум и време`,date:`ISO датум`,time:`ISO време`,duration:`ISO времетраење`,ipv4:`IPv4 адреса`,ipv6:`IPv6 адреса`,cidrv4:`IPv4 опсег`,cidrv6:`IPv6 опсег`,base64:`base64-енкодирана низа`,base64url:`base64url-енкодирана низа`,json_string:`JSON низа`,e164:`E.164 број`,jwt:`JWT`,template_literal:`внес`};return e=>{switch(e.code){case`invalid_type`:return`Грешен внес: се очекува ${e.expected}, примено ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${G(e.values[0])}`:`Грешана опција: се очекува една ${U(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Премногу голем: се очекува ${e.origin??`вредноста`} да има ${n}${e.maximum.toString()} ${r.unit??`елементи`}`:`Премногу голем: се очекува ${e.origin??`вредноста`} да биде ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Премногу мал: се очекува ${e.origin} да има ${n}${e.minimum.toString()} ${r.unit}`:`Премногу мал: се очекува ${e.origin} да биде ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Неважечка низа: мора да започнува со \"${t.prefix}\"`:t.format===`ends_with`?`Неважечка низа: мора да завршува со \"${t.suffix}\"`:t.format===`includes`?`Неважечка низа: мора да вклучува \"${t.includes}\"`:t.format===`regex`?`Неважечка низа: мора да одгоара на патернот ${t.pattern}`:`Invalid ${r[t.format]??e.format}`}case`not_multiple_of`:return`Грешен број: мора да биде делив со ${e.divisor}`;case`unrecognized_keys`:return`${e.keys.length>1?`Непрепознаени клучеви`:`Непрепознаен клуч`}: ${U(e.keys,`, `)}`;case`invalid_key`:return`Грешен клуч во ${e.origin}`;case`invalid_union`:return`Грешен внес`;case`invalid_element`:return`Грешна вредност во ${e.origin}`;default:return`Грешен внес`}}}}));function T_(){return{localeError:E_()}}var E_,D_=t((()=>{K(),E_=()=>{let e={string:{unit:`aksara`,verb:`mempunyai`},file:{unit:`bait`,verb:`mempunyai`},array:{unit:`elemen`,verb:`mempunyai`},set:{unit:`elemen`,verb:`mempunyai`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`nombor`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`input`,email:`alamat e-mel`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`tarikh masa ISO`,date:`tarikh ISO`,time:`masa ISO`,duration:`tempoh ISO`,ipv4:`alamat IPv4`,ipv6:`alamat IPv6`,cidrv4:`julat IPv4`,cidrv6:`julat IPv6`,base64:`string dikodkan base64`,base64url:`string dikodkan base64url`,json_string:`string JSON`,e164:`nombor E.164`,jwt:`JWT`,template_literal:`input`};return e=>{switch(e.code){case`invalid_type`:return`Input tidak sah: dijangka ${e.expected}, diterima ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Input tidak sah: dijangka ${G(e.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${U(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Terlalu besar: dijangka ${e.origin??`nilai`} ${r.verb} ${n}${e.maximum.toString()} ${r.unit??`elemen`}`:`Terlalu besar: dijangka ${e.origin??`nilai`} adalah ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Terlalu kecil: dijangka ${e.origin} ${r.verb} ${n}${e.minimum.toString()} ${r.unit}`:`Terlalu kecil: dijangka ${e.origin} adalah ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`String tidak sah: mesti bermula dengan \"${t.prefix}\"`:t.format===`ends_with`?`String tidak sah: mesti berakhir dengan \"${t.suffix}\"`:t.format===`includes`?`String tidak sah: mesti mengandungi \"${t.includes}\"`:t.format===`regex`?`String tidak sah: mesti sepadan dengan corak ${t.pattern}`:`${r[t.format]??e.format} tidak sah`}case`not_multiple_of`:return`Nombor tidak sah: perlu gandaan ${e.divisor}`;case`unrecognized_keys`:return`Kunci tidak dikenali: ${U(e.keys,`, `)}`;case`invalid_key`:return`Kunci tidak sah dalam ${e.origin}`;case`invalid_union`:return`Input tidak sah`;case`invalid_element`:return`Nilai tidak sah dalam ${e.origin}`;default:return`Input tidak sah`}}}}));function O_(){return{localeError:k_()}}var k_,A_=t((()=>{K(),k_=()=>{let e={string:{unit:`tekens`},file:{unit:`bytes`},array:{unit:`elementen`},set:{unit:`elementen`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`getal`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`invoer`,email:`emailadres`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datum en tijd`,date:`ISO datum`,time:`ISO tijd`,duration:`ISO duur`,ipv4:`IPv4-adres`,ipv6:`IPv6-adres`,cidrv4:`IPv4-bereik`,cidrv6:`IPv6-bereik`,base64:`base64-gecodeerde tekst`,base64url:`base64 URL-gecodeerde tekst`,json_string:`JSON string`,e164:`E.164-nummer`,jwt:`JWT`,template_literal:`invoer`};return e=>{switch(e.code){case`invalid_type`:return`Ongeldige invoer: verwacht ${e.expected}, ontving ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Ongeldige invoer: verwacht ${G(e.values[0])}`:`Ongeldige optie: verwacht één van ${U(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Te lang: verwacht dat ${e.origin??`waarde`} ${n}${e.maximum.toString()} ${r.unit??`elementen`} bevat`:`Te lang: verwacht dat ${e.origin??`waarde`} ${n}${e.maximum.toString()} is`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Te kort: verwacht dat ${e.origin} ${n}${e.minimum.toString()} ${r.unit} bevat`:`Te kort: verwacht dat ${e.origin} ${n}${e.minimum.toString()} is`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ongeldige tekst: moet met \"${t.prefix}\" beginnen`:t.format===`ends_with`?`Ongeldige tekst: moet op \"${t.suffix}\" eindigen`:t.format===`includes`?`Ongeldige tekst: moet \"${t.includes}\" bevatten`:t.format===`regex`?`Ongeldige tekst: moet overeenkomen met patroon ${t.pattern}`:`Ongeldig: ${r[t.format]??e.format}`}case`not_multiple_of`:return`Ongeldig getal: moet een veelvoud van ${e.divisor} zijn`;case`unrecognized_keys`:return`Onbekende key${e.keys.length>1?`s`:``}: ${U(e.keys,`, `)}`;case`invalid_key`:return`Ongeldige key in ${e.origin}`;case`invalid_union`:return`Ongeldige invoer`;case`invalid_element`:return`Ongeldige waarde in ${e.origin}`;default:return`Ongeldige invoer`}}}}));function j_(){return{localeError:M_()}}var M_,N_=t((()=>{K(),M_=()=>{let e={string:{unit:`tegn`,verb:`å ha`},file:{unit:`bytes`,verb:`å ha`},array:{unit:`elementer`,verb:`å inneholde`},set:{unit:`elementer`,verb:`å inneholde`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`tall`;case`object`:if(Array.isArray(e))return`liste`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`input`,email:`e-postadresse`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO dato- og klokkeslett`,date:`ISO-dato`,time:`ISO-klokkeslett`,duration:`ISO-varighet`,ipv4:`IPv4-område`,ipv6:`IPv6-område`,cidrv4:`IPv4-spekter`,cidrv6:`IPv6-spekter`,base64:`base64-enkodet streng`,base64url:`base64url-enkodet streng`,json_string:`JSON-streng`,e164:`E.164-nummer`,jwt:`JWT`,template_literal:`input`};return e=>{switch(e.code){case`invalid_type`:return`Ugyldig input: forventet ${e.expected}, fikk ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Ugyldig verdi: forventet ${G(e.values[0])}`:`Ugyldig valg: forventet en av ${U(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`For stor(t): forventet ${e.origin??`value`} til å ha ${n}${e.maximum.toString()} ${r.unit??`elementer`}`:`For stor(t): forventet ${e.origin??`value`} til å ha ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`For lite(n): forventet ${e.origin} til å ha ${n}${e.minimum.toString()} ${r.unit}`:`For lite(n): forventet ${e.origin} til å ha ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ugyldig streng: må starte med \"${t.prefix}\"`:t.format===`ends_with`?`Ugyldig streng: må ende med \"${t.suffix}\"`:t.format===`includes`?`Ugyldig streng: må inneholde \"${t.includes}\"`:t.format===`regex`?`Ugyldig streng: må matche mønsteret ${t.pattern}`:`Ugyldig ${r[t.format]??e.format}`}case`not_multiple_of`:return`Ugyldig tall: må være et multiplum av ${e.divisor}`;case`unrecognized_keys`:return`${e.keys.length>1?`Ukjente nøkler`:`Ukjent nøkkel`}: ${U(e.keys,`, `)}`;case`invalid_key`:return`Ugyldig nøkkel i ${e.origin}`;case`invalid_union`:return`Ugyldig input`;case`invalid_element`:return`Ugyldig verdi i ${e.origin}`;default:return`Ugyldig input`}}}}));function P_(){return{localeError:F_()}}var F_,I_=t((()=>{K(),F_=()=>{let e={string:{unit:`harf`,verb:`olmalıdır`},file:{unit:`bayt`,verb:`olmalıdır`},array:{unit:`unsur`,verb:`olmalıdır`},set:{unit:`unsur`,verb:`olmalıdır`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`numara`;case`object`:if(Array.isArray(e))return`saf`;if(e===null)return`gayb`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`giren`,email:`epostagâh`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO hengâmı`,date:`ISO tarihi`,time:`ISO zamanı`,duration:`ISO müddeti`,ipv4:`IPv4 nişânı`,ipv6:`IPv6 nişânı`,cidrv4:`IPv4 menzili`,cidrv6:`IPv6 menzili`,base64:`base64-şifreli metin`,base64url:`base64url-şifreli metin`,json_string:`JSON metin`,e164:`E.164 sayısı`,jwt:`JWT`,template_literal:`giren`};return e=>{switch(e.code){case`invalid_type`:return`Fâsit giren: umulan ${e.expected}, alınan ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Fâsit giren: umulan ${G(e.values[0])}`:`Fâsit tercih: mûteberler ${U(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Fazla büyük: ${e.origin??`value`}, ${n}${e.maximum.toString()} ${r.unit??`elements`} sahip olmalıydı.`:`Fazla büyük: ${e.origin??`value`}, ${n}${e.maximum.toString()} olmalıydı.`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Fazla küçük: ${e.origin}, ${n}${e.minimum.toString()} ${r.unit} sahip olmalıydı.`:`Fazla küçük: ${e.origin}, ${n}${e.minimum.toString()} olmalıydı.`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Fâsit metin: \"${t.prefix}\" ile başlamalı.`:t.format===`ends_with`?`Fâsit metin: \"${t.suffix}\" ile bitmeli.`:t.format===`includes`?`Fâsit metin: \"${t.includes}\" ihtivâ etmeli.`:t.format===`regex`?`Fâsit metin: ${t.pattern} nakşına uymalı.`:`Fâsit ${r[t.format]??e.format}`}case`not_multiple_of`:return`Fâsit sayı: ${e.divisor} katı olmalıydı.`;case`unrecognized_keys`:return`Tanınmayan anahtar ${e.keys.length>1?`s`:``}: ${U(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} için tanınmayan anahtar var.`;case`invalid_union`:return`Giren tanınamadı.`;case`invalid_element`:return`${e.origin} için tanınmayan kıymet var.`;default:return`Kıymet tanınamadı.`}}}}));function L_(){return{localeError:R_()}}var R_,z_=t((()=>{K(),R_=()=>{let e={string:{unit:`توکي`,verb:`ولري`},file:{unit:`بایټس`,verb:`ولري`},array:{unit:`توکي`,verb:`ولري`},set:{unit:`توکي`,verb:`ولري`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`عدد`;case`object`:if(Array.isArray(e))return`ارې`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`ورودي`,email:`بریښنالیک`,url:`یو آر ال`,emoji:`ایموجي`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`نیټه او وخت`,date:`نېټه`,time:`وخت`,duration:`موده`,ipv4:`د IPv4 پته`,ipv6:`د IPv6 پته`,cidrv4:`د IPv4 ساحه`,cidrv6:`د IPv6 ساحه`,base64:`base64-encoded متن`,base64url:`base64url-encoded متن`,json_string:`JSON متن`,e164:`د E.164 شمېره`,jwt:`JWT`,template_literal:`ورودي`};return e=>{switch(e.code){case`invalid_type`:return`ناسم ورودي: باید ${e.expected} وای, مګر ${n(e.input)} ترلاسه شو`;case`invalid_value`:return e.values.length===1?`ناسم ورودي: باید ${G(e.values[0])} وای`:`ناسم انتخاب: باید یو له ${U(e.values,`|`)} څخه وای`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`ډیر لوی: ${e.origin??`ارزښت`} باید ${n}${e.maximum.toString()} ${r.unit??`عنصرونه`} ولري`:`ډیر لوی: ${e.origin??`ارزښت`} باید ${n}${e.maximum.toString()} وي`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`ډیر کوچنی: ${e.origin} باید ${n}${e.minimum.toString()} ${r.unit} ولري`:`ډیر کوچنی: ${e.origin} باید ${n}${e.minimum.toString()} وي`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`ناسم متن: باید د \"${t.prefix}\" سره پیل شي`:t.format===`ends_with`?`ناسم متن: باید د \"${t.suffix}\" سره پای ته ورسيږي`:t.format===`includes`?`ناسم متن: باید \"${t.includes}\" ولري`:t.format===`regex`?`ناسم متن: باید د ${t.pattern} سره مطابقت ولري`:`${r[t.format]??e.format} ناسم دی`}case`not_multiple_of`:return`ناسم عدد: باید د ${e.divisor} مضرب وي`;case`unrecognized_keys`:return`ناسم ${e.keys.length>1?`کلیډونه`:`کلیډ`}: ${U(e.keys,`, `)}`;case`invalid_key`:return`ناسم کلیډ په ${e.origin} کې`;case`invalid_union`:return`ناسمه ورودي`;case`invalid_element`:return`ناسم عنصر په ${e.origin} کې`;default:return`ناسمه ورودي`}}}}));function B_(){return{localeError:V_()}}var V_,H_=t((()=>{K(),V_=()=>{let e={string:{unit:`znaków`,verb:`mieć`},file:{unit:`bajtów`,verb:`mieć`},array:{unit:`elementów`,verb:`mieć`},set:{unit:`elementów`,verb:`mieć`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`liczba`;case`object`:if(Array.isArray(e))return`tablica`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`wyrażenie`,email:`adres email`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`data i godzina w formacie ISO`,date:`data w formacie ISO`,time:`godzina w formacie ISO`,duration:`czas trwania ISO`,ipv4:`adres IPv4`,ipv6:`adres IPv6`,cidrv4:`zakres IPv4`,cidrv6:`zakres IPv6`,base64:`ciąg znaków zakodowany w formacie base64`,base64url:`ciąg znaków zakodowany w formacie base64url`,json_string:`ciąg znaków w formacie JSON`,e164:`liczba E.164`,jwt:`JWT`,template_literal:`wejście`};return e=>{switch(e.code){case`invalid_type`:return`Nieprawidłowe dane wejściowe: oczekiwano ${e.expected}, otrzymano ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Nieprawidłowe dane wejściowe: oczekiwano ${G(e.values[0])}`:`Nieprawidłowa opcja: oczekiwano jednej z wartości ${U(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Za duża wartość: oczekiwano, że ${e.origin??`wartość`} będzie mieć ${n}${e.maximum.toString()} ${r.unit??`elementów`}`:`Zbyt duż(y/a/e): oczekiwano, że ${e.origin??`wartość`} będzie wynosić ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Za mała wartość: oczekiwano, że ${e.origin??`wartość`} będzie mieć ${n}${e.minimum.toString()} ${r.unit??`elementów`}`:`Zbyt mał(y/a/e): oczekiwano, że ${e.origin??`wartość`} będzie wynosić ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Nieprawidłowy ciąg znaków: musi zaczynać się od \"${t.prefix}\"`:t.format===`ends_with`?`Nieprawidłowy ciąg znaków: musi kończyć się na \"${t.suffix}\"`:t.format===`includes`?`Nieprawidłowy ciąg znaków: musi zawierać \"${t.includes}\"`:t.format===`regex`?`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${t.pattern}`:`Nieprawidłow(y/a/e) ${r[t.format]??e.format}`}case`not_multiple_of`:return`Nieprawidłowa liczba: musi być wielokrotnością ${e.divisor}`;case`unrecognized_keys`:return`Nierozpoznane klucze${e.keys.length>1?`s`:``}: ${U(e.keys,`, `)}`;case`invalid_key`:return`Nieprawidłowy klucz w ${e.origin}`;case`invalid_union`:return`Nieprawidłowe dane wejściowe`;case`invalid_element`:return`Nieprawidłowa wartość w ${e.origin}`;default:return`Nieprawidłowe dane wejściowe`}}}}));function U_(){return{localeError:W_()}}var W_,G_=t((()=>{K(),W_=()=>{let e={string:{unit:`caracteres`,verb:`ter`},file:{unit:`bytes`,verb:`ter`},array:{unit:`itens`,verb:`ter`},set:{unit:`itens`,verb:`ter`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`número`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`nulo`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`padrão`,email:`endereço de e-mail`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`data e hora ISO`,date:`data ISO`,time:`hora ISO`,duration:`duração ISO`,ipv4:`endereço IPv4`,ipv6:`endereço IPv6`,cidrv4:`faixa de IPv4`,cidrv6:`faixa de IPv6`,base64:`texto codificado em base64`,base64url:`URL codificada em base64`,json_string:`texto JSON`,e164:`número E.164`,jwt:`JWT`,template_literal:`entrada`};return e=>{switch(e.code){case`invalid_type`:return`Tipo inválido: esperado ${e.expected}, recebido ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Entrada inválida: esperado ${G(e.values[0])}`:`Opção inválida: esperada uma das ${U(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Muito grande: esperado que ${e.origin??`valor`} tivesse ${n}${e.maximum.toString()} ${r.unit??`elementos`}`:`Muito grande: esperado que ${e.origin??`valor`} fosse ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Muito pequeno: esperado que ${e.origin} tivesse ${n}${e.minimum.toString()} ${r.unit}`:`Muito pequeno: esperado que ${e.origin} fosse ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Texto inválido: deve começar com \"${t.prefix}\"`:t.format===`ends_with`?`Texto inválido: deve terminar com \"${t.suffix}\"`:t.format===`includes`?`Texto inválido: deve incluir \"${t.includes}\"`:t.format===`regex`?`Texto inválido: deve corresponder ao padrão ${t.pattern}`:`${r[t.format]??e.format} inválido`}case`not_multiple_of`:return`Número inválido: deve ser múltiplo de ${e.divisor}`;case`unrecognized_keys`:return`Chave${e.keys.length>1?`s`:``} desconhecida${e.keys.length>1?`s`:``}: ${U(e.keys,`, `)}`;case`invalid_key`:return`Chave inválida em ${e.origin}`;case`invalid_union`:return`Entrada inválida`;case`invalid_element`:return`Valor inválido em ${e.origin}`;default:return`Campo inválido`}}}}));function K_(e,t,n,r){let i=Math.abs(e),a=i%10,o=i%100;return o>=11&&o<=19?r:a===1?t:a>=2&&a<=4?n:r}function q_(){return{localeError:J_()}}var J_,Y_=t((()=>{K(),J_=()=>{let e={string:{unit:{one:`символ`,few:`символа`,many:`символов`},verb:`иметь`},file:{unit:{one:`байт`,few:`байта`,many:`байт`},verb:`иметь`},array:{unit:{one:`элемент`,few:`элемента`,many:`элементов`},verb:`иметь`},set:{unit:{one:`элемент`,few:`элемента`,many:`элементов`},verb:`иметь`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`число`;case`object`:if(Array.isArray(e))return`массив`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`ввод`,email:`email адрес`,url:`URL`,emoji:`эмодзи`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO дата и время`,date:`ISO дата`,time:`ISO время`,duration:`ISO длительность`,ipv4:`IPv4 адрес`,ipv6:`IPv6 адрес`,cidrv4:`IPv4 диапазон`,cidrv6:`IPv6 диапазон`,base64:`строка в формате base64`,base64url:`строка в формате base64url`,json_string:`JSON строка`,e164:`номер E.164`,jwt:`JWT`,template_literal:`ввод`};return e=>{switch(e.code){case`invalid_type`:return`Неверный ввод: ожидалось ${e.expected}, получено ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Неверный ввод: ожидалось ${G(e.values[0])}`:`Неверный вариант: ожидалось одно из ${U(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);if(r){let t=K_(Number(e.maximum),r.unit.one,r.unit.few,r.unit.many);return`Слишком большое значение: ожидалось, что ${e.origin??`значение`} будет иметь ${n}${e.maximum.toString()} ${t}`}return`Слишком большое значение: ожидалось, что ${e.origin??`значение`} будет ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);if(r){let t=K_(Number(e.minimum),r.unit.one,r.unit.few,r.unit.many);return`Слишком маленькое значение: ожидалось, что ${e.origin} будет иметь ${n}${e.minimum.toString()} ${t}`}return`Слишком маленькое значение: ожидалось, что ${e.origin} будет ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Неверная строка: должна начинаться с \"${t.prefix}\"`:t.format===`ends_with`?`Неверная строка: должна заканчиваться на \"${t.suffix}\"`:t.format===`includes`?`Неверная строка: должна содержать \"${t.includes}\"`:t.format===`regex`?`Неверная строка: должна соответствовать шаблону ${t.pattern}`:`Неверный ${r[t.format]??e.format}`}case`not_multiple_of`:return`Неверное число: должно быть кратным ${e.divisor}`;case`unrecognized_keys`:return`Нераспознанн${e.keys.length>1?`ые`:`ый`} ключ${e.keys.length>1?`и`:``}: ${U(e.keys,`, `)}`;case`invalid_key`:return`Неверный ключ в ${e.origin}`;case`invalid_union`:return`Неверные входные данные`;case`invalid_element`:return`Неверное значение в ${e.origin}`;default:return`Неверные входные данные`}}}}));function X_(){return{localeError:Z_()}}var Z_,Q_=t((()=>{K(),Z_=()=>{let e={string:{unit:`znakov`,verb:`imeti`},file:{unit:`bajtov`,verb:`imeti`},array:{unit:`elementov`,verb:`imeti`},set:{unit:`elementov`,verb:`imeti`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`število`;case`object`:if(Array.isArray(e))return`tabela`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`vnos`,email:`e-poštni naslov`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datum in čas`,date:`ISO datum`,time:`ISO čas`,duration:`ISO trajanje`,ipv4:`IPv4 naslov`,ipv6:`IPv6 naslov`,cidrv4:`obseg IPv4`,cidrv6:`obseg IPv6`,base64:`base64 kodiran niz`,base64url:`base64url kodiran niz`,json_string:`JSON niz`,e164:`E.164 številka`,jwt:`JWT`,template_literal:`vnos`};return e=>{switch(e.code){case`invalid_type`:return`Neveljaven vnos: pričakovano ${e.expected}, prejeto ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Neveljaven vnos: pričakovano ${G(e.values[0])}`:`Neveljavna možnost: pričakovano eno izmed ${U(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Preveliko: pričakovano, da bo ${e.origin??`vrednost`} imelo ${n}${e.maximum.toString()} ${r.unit??`elementov`}`:`Preveliko: pričakovano, da bo ${e.origin??`vrednost`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Premajhno: pričakovano, da bo ${e.origin} imelo ${n}${e.minimum.toString()} ${r.unit}`:`Premajhno: pričakovano, da bo ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Neveljaven niz: mora se začeti z \"${t.prefix}\"`:t.format===`ends_with`?`Neveljaven niz: mora se končati z \"${t.suffix}\"`:t.format===`includes`?`Neveljaven niz: mora vsebovati \"${t.includes}\"`:t.format===`regex`?`Neveljaven niz: mora ustrezati vzorcu ${t.pattern}`:`Neveljaven ${r[t.format]??e.format}`}case`not_multiple_of`:return`Neveljavno število: mora biti večkratnik ${e.divisor}`;case`unrecognized_keys`:return`Neprepoznan${e.keys.length>1?`i ključi`:` ključ`}: ${U(e.keys,`, `)}`;case`invalid_key`:return`Neveljaven ključ v ${e.origin}`;case`invalid_union`:return`Neveljaven vnos`;case`invalid_element`:return`Neveljavna vrednost v ${e.origin}`;default:return`Neveljaven vnos`}}}}));function $_(){return{localeError:ev()}}var ev,tv=t((()=>{K(),ev=()=>{let e={string:{unit:`tecken`,verb:`att ha`},file:{unit:`bytes`,verb:`att ha`},array:{unit:`objekt`,verb:`att innehålla`},set:{unit:`objekt`,verb:`att innehålla`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`antal`;case`object`:if(Array.isArray(e))return`lista`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`reguljärt uttryck`,email:`e-postadress`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO-datum och tid`,date:`ISO-datum`,time:`ISO-tid`,duration:`ISO-varaktighet`,ipv4:`IPv4-intervall`,ipv6:`IPv6-intervall`,cidrv4:`IPv4-spektrum`,cidrv6:`IPv6-spektrum`,base64:`base64-kodad sträng`,base64url:`base64url-kodad sträng`,json_string:`JSON-sträng`,e164:`E.164-nummer`,jwt:`JWT`,template_literal:`mall-literal`};return e=>{switch(e.code){case`invalid_type`:return`Ogiltig inmatning: förväntat ${e.expected}, fick ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Ogiltig inmatning: förväntat ${G(e.values[0])}`:`Ogiltigt val: förväntade en av ${U(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`För stor(t): förväntade ${e.origin??`värdet`} att ha ${n}${e.maximum.toString()} ${r.unit??`element`}`:`För stor(t): förväntat ${e.origin??`värdet`} att ha ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`För lite(t): förväntade ${e.origin??`värdet`} att ha ${n}${e.minimum.toString()} ${r.unit}`:`För lite(t): förväntade ${e.origin??`värdet`} att ha ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ogiltig sträng: måste börja med \"${t.prefix}\"`:t.format===`ends_with`?`Ogiltig sträng: måste sluta med \"${t.suffix}\"`:t.format===`includes`?`Ogiltig sträng: måste innehålla \"${t.includes}\"`:t.format===`regex`?`Ogiltig sträng: måste matcha mönstret \"${t.pattern}\"`:`Ogiltig(t) ${r[t.format]??e.format}`}case`not_multiple_of`:return`Ogiltigt tal: måste vara en multipel av ${e.divisor}`;case`unrecognized_keys`:return`${e.keys.length>1?`Okända nycklar`:`Okänd nyckel`}: ${U(e.keys,`, `)}`;case`invalid_key`:return`Ogiltig nyckel i ${e.origin??`värdet`}`;case`invalid_union`:return`Ogiltig input`;case`invalid_element`:return`Ogiltigt värde i ${e.origin??`värdet`}`;default:return`Ogiltig input`}}}}));function nv(){return{localeError:rv()}}var rv,iv=t((()=>{K(),rv=()=>{let e={string:{unit:`எழுத்துக்கள்`,verb:`கொண்டிருக்க வேண்டும்`},file:{unit:`பைட்டுகள்`,verb:`கொண்டிருக்க வேண்டும்`},array:{unit:`உறுப்புகள்`,verb:`கொண்டிருக்க வேண்டும்`},set:{unit:`உறுப்புகள்`,verb:`கொண்டிருக்க வேண்டும்`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`எண் அல்லாதது`:`எண்`;case`object`:if(Array.isArray(e))return`அணி`;if(e===null)return`வெறுமை`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`உள்ளீடு`,email:`மின்னஞ்சல் முகவரி`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO தேதி நேரம்`,date:`ISO தேதி`,time:`ISO நேரம்`,duration:`ISO கால அளவு`,ipv4:`IPv4 முகவரி`,ipv6:`IPv6 முகவரி`,cidrv4:`IPv4 வரம்பு`,cidrv6:`IPv6 வரம்பு`,base64:`base64-encoded சரம்`,base64url:`base64url-encoded சரம்`,json_string:`JSON சரம்`,e164:`E.164 எண்`,jwt:`JWT`,template_literal:`input`};return e=>{switch(e.code){case`invalid_type`:return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${e.expected}, பெறப்பட்டது ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${G(e.values[0])}`:`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${U(e.values,`|`)} இல் ஒன்று`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${e.origin??`மதிப்பு`} ${n}${e.maximum.toString()} ${r.unit??`உறுப்புகள்`} ஆக இருக்க வேண்டும்`:`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${e.origin??`மதிப்பு`} ${n}${e.maximum.toString()} ஆக இருக்க வேண்டும்`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${e.origin} ${n}${e.minimum.toString()} ${r.unit} ஆக இருக்க வேண்டும்`:`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${e.origin} ${n}${e.minimum.toString()} ஆக இருக்க வேண்டும்`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`தவறான சரம்: \"${t.prefix}\" இல் தொடங்க வேண்டும்`:t.format===`ends_with`?`தவறான சரம்: \"${t.suffix}\" இல் முடிவடைய வேண்டும்`:t.format===`includes`?`தவறான சரம்: \"${t.includes}\" ஐ உள்ளடக்க வேண்டும்`:t.format===`regex`?`தவறான சரம்: ${t.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`:`தவறான ${r[t.format]??e.format}`}case`not_multiple_of`:return`தவறான எண்: ${e.divisor} இன் பலமாக இருக்க வேண்டும்`;case`unrecognized_keys`:return`அடையாளம் தெரியாத விசை${e.keys.length>1?`கள்`:``}: ${U(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} இல் தவறான விசை`;case`invalid_union`:return`தவறான உள்ளீடு`;case`invalid_element`:return`${e.origin} இல் தவறான மதிப்பு`;default:return`தவறான உள்ளீடு`}}}}));function av(){return{localeError:ov()}}var ov,sv=t((()=>{K(),ov=()=>{let e={string:{unit:`ตัวอักษร`,verb:`ควรมี`},file:{unit:`ไบต์`,verb:`ควรมี`},array:{unit:`รายการ`,verb:`ควรมี`},set:{unit:`รายการ`,verb:`ควรมี`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`ไม่ใช่ตัวเลข (NaN)`:`ตัวเลข`;case`object`:if(Array.isArray(e))return`อาร์เรย์ (Array)`;if(e===null)return`ไม่มีค่า (null)`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`ข้อมูลที่ป้อน`,email:`ที่อยู่อีเมล`,url:`URL`,emoji:`อิโมจิ`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`วันที่เวลาแบบ ISO`,date:`วันที่แบบ ISO`,time:`เวลาแบบ ISO`,duration:`ช่วงเวลาแบบ ISO`,ipv4:`ที่อยู่ IPv4`,ipv6:`ที่อยู่ IPv6`,cidrv4:`ช่วง IP แบบ IPv4`,cidrv6:`ช่วง IP แบบ IPv6`,base64:`ข้อความแบบ Base64`,base64url:`ข้อความแบบ Base64 สำหรับ URL`,json_string:`ข้อความแบบ JSON`,e164:`เบอร์โทรศัพท์ระหว่างประเทศ (E.164)`,jwt:`โทเคน JWT`,template_literal:`ข้อมูลที่ป้อน`};return e=>{switch(e.code){case`invalid_type`:return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${e.expected} แต่ได้รับ ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`ค่าไม่ถูกต้อง: ควรเป็น ${G(e.values[0])}`:`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${U(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`ไม่เกิน`:`น้อยกว่า`,r=t(e.origin);return r?`เกินกำหนด: ${e.origin??`ค่า`} ควรมี${n} ${e.maximum.toString()} ${r.unit??`รายการ`}`:`เกินกำหนด: ${e.origin??`ค่า`} ควรมี${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`อย่างน้อย`:`มากกว่า`,r=t(e.origin);return r?`น้อยกว่ากำหนด: ${e.origin} ควรมี${n} ${e.minimum.toString()} ${r.unit}`:`น้อยกว่ากำหนด: ${e.origin} ควรมี${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย \"${t.prefix}\"`:t.format===`ends_with`?`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย \"${t.suffix}\"`:t.format===`includes`?`รูปแบบไม่ถูกต้อง: ข้อความต้องมี \"${t.includes}\" อยู่ในข้อความ`:t.format===`regex`?`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${t.pattern}`:`รูปแบบไม่ถูกต้อง: ${r[t.format]??e.format}`}case`not_multiple_of`:return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${e.divisor} ได้ลงตัว`;case`unrecognized_keys`:return`พบคีย์ที่ไม่รู้จัก: ${U(e.keys,`, `)}`;case`invalid_key`:return`คีย์ไม่ถูกต้องใน ${e.origin}`;case`invalid_union`:return`ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้`;case`invalid_element`:return`ข้อมูลไม่ถูกต้องใน ${e.origin}`;default:return`ข้อมูลไม่ถูกต้อง`}}}}));function cv(){return{localeError:uv()}}var lv,uv,dv=t((()=>{K(),lv=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`number`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},uv=()=>{let e={string:{unit:`karakter`,verb:`olmalı`},file:{unit:`bayt`,verb:`olmalı`},array:{unit:`öğe`,verb:`olmalı`},set:{unit:`öğe`,verb:`olmalı`}};function t(t){return e[t]??null}let n={regex:`girdi`,email:`e-posta adresi`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO tarih ve saat`,date:`ISO tarih`,time:`ISO saat`,duration:`ISO süre`,ipv4:`IPv4 adresi`,ipv6:`IPv6 adresi`,cidrv4:`IPv4 aralığı`,cidrv6:`IPv6 aralığı`,base64:`base64 ile şifrelenmiş metin`,base64url:`base64url ile şifrelenmiş metin`,json_string:`JSON dizesi`,e164:`E.164 sayısı`,jwt:`JWT`,template_literal:`Şablon dizesi`};return e=>{switch(e.code){case`invalid_type`:return`Geçersiz değer: beklenen ${e.expected}, alınan ${lv(e.input)}`;case`invalid_value`:return e.values.length===1?`Geçersiz değer: beklenen ${G(e.values[0])}`:`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${U(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Çok büyük: beklenen ${e.origin??`değer`} ${n}${e.maximum.toString()} ${r.unit??`öğe`}`:`Çok büyük: beklenen ${e.origin??`değer`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Çok küçük: beklenen ${e.origin} ${n}${e.minimum.toString()} ${r.unit}`:`Çok küçük: beklenen ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Geçersiz metin: \"${t.prefix}\" ile başlamalı`:t.format===`ends_with`?`Geçersiz metin: \"${t.suffix}\" ile bitmeli`:t.format===`includes`?`Geçersiz metin: \"${t.includes}\" içermeli`:t.format===`regex`?`Geçersiz metin: ${t.pattern} desenine uymalı`:`Geçersiz ${n[t.format]??e.format}`}case`not_multiple_of`:return`Geçersiz sayı: ${e.divisor} ile tam bölünebilmeli`;case`unrecognized_keys`:return`Tanınmayan anahtar${e.keys.length>1?`lar`:``}: ${U(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} içinde geçersiz anahtar`;case`invalid_union`:return`Geçersiz değer`;case`invalid_element`:return`${e.origin} içinde geçersiz değer`;default:return`Geçersiz değer`}}}}));function fv(){return{localeError:pv()}}var pv,mv=t((()=>{K(),pv=()=>{let e={string:{unit:`символів`,verb:`матиме`},file:{unit:`байтів`,verb:`матиме`},array:{unit:`елементів`,verb:`матиме`},set:{unit:`елементів`,verb:`матиме`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`число`;case`object`:if(Array.isArray(e))return`масив`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`вхідні дані`,email:`адреса електронної пошти`,url:`URL`,emoji:`емодзі`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`дата та час ISO`,date:`дата ISO`,time:`час ISO`,duration:`тривалість ISO`,ipv4:`адреса IPv4`,ipv6:`адреса IPv6`,cidrv4:`діапазон IPv4`,cidrv6:`діапазон IPv6`,base64:`рядок у кодуванні base64`,base64url:`рядок у кодуванні base64url`,json_string:`рядок JSON`,e164:`номер E.164`,jwt:`JWT`,template_literal:`вхідні дані`};return e=>{switch(e.code){case`invalid_type`:return`Неправильні вхідні дані: очікується ${e.expected}, отримано ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Неправильні вхідні дані: очікується ${G(e.values[0])}`:`Неправильна опція: очікується одне з ${U(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Занадто велике: очікується, що ${e.origin??`значення`} ${r.verb} ${n}${e.maximum.toString()} ${r.unit??`елементів`}`:`Занадто велике: очікується, що ${e.origin??`значення`} буде ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Занадто мале: очікується, що ${e.origin} ${r.verb} ${n}${e.minimum.toString()} ${r.unit}`:`Занадто мале: очікується, що ${e.origin} буде ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Неправильний рядок: повинен починатися з \"${t.prefix}\"`:t.format===`ends_with`?`Неправильний рядок: повинен закінчуватися на \"${t.suffix}\"`:t.format===`includes`?`Неправильний рядок: повинен містити \"${t.includes}\"`:t.format===`regex`?`Неправильний рядок: повинен відповідати шаблону ${t.pattern}`:`Неправильний ${r[t.format]??e.format}`}case`not_multiple_of`:return`Неправильне число: повинно бути кратним ${e.divisor}`;case`unrecognized_keys`:return`Нерозпізнаний ключ${e.keys.length>1?`і`:``}: ${U(e.keys,`, `)}`;case`invalid_key`:return`Неправильний ключ у ${e.origin}`;case`invalid_union`:return`Неправильні вхідні дані`;case`invalid_element`:return`Неправильне значення у ${e.origin}`;default:return`Неправильні вхідні дані`}}}}));function hv(){return{localeError:gv()}}var gv,_v=t((()=>{K(),gv=()=>{let e={string:{unit:`حروف`,verb:`ہونا`},file:{unit:`بائٹس`,verb:`ہونا`},array:{unit:`آئٹمز`,verb:`ہونا`},set:{unit:`آئٹمز`,verb:`ہونا`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`نمبر`;case`object`:if(Array.isArray(e))return`آرے`;if(e===null)return`نل`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`ان پٹ`,email:`ای میل ایڈریس`,url:`یو آر ایل`,emoji:`ایموجی`,uuid:`یو یو آئی ڈی`,uuidv4:`یو یو آئی ڈی وی 4`,uuidv6:`یو یو آئی ڈی وی 6`,nanoid:`نینو آئی ڈی`,guid:`جی یو آئی ڈی`,cuid:`سی یو آئی ڈی`,cuid2:`سی یو آئی ڈی 2`,ulid:`یو ایل آئی ڈی`,xid:`ایکس آئی ڈی`,ksuid:`کے ایس یو آئی ڈی`,datetime:`آئی ایس او ڈیٹ ٹائم`,date:`آئی ایس او تاریخ`,time:`آئی ایس او وقت`,duration:`آئی ایس او مدت`,ipv4:`آئی پی وی 4 ایڈریس`,ipv6:`آئی پی وی 6 ایڈریس`,cidrv4:`آئی پی وی 4 رینج`,cidrv6:`آئی پی وی 6 رینج`,base64:`بیس 64 ان کوڈڈ سٹرنگ`,base64url:`بیس 64 یو آر ایل ان کوڈڈ سٹرنگ`,json_string:`جے ایس او این سٹرنگ`,e164:`ای 164 نمبر`,jwt:`جے ڈبلیو ٹی`,template_literal:`ان پٹ`};return e=>{switch(e.code){case`invalid_type`:return`غلط ان پٹ: ${e.expected} متوقع تھا، ${n(e.input)} موصول ہوا`;case`invalid_value`:return e.values.length===1?`غلط ان پٹ: ${G(e.values[0])} متوقع تھا`:`غلط آپشن: ${U(e.values,`|`)} میں سے ایک متوقع تھا`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`بہت بڑا: ${e.origin??`ویلیو`} کے ${n}${e.maximum.toString()} ${r.unit??`عناصر`} ہونے متوقع تھے`:`بہت بڑا: ${e.origin??`ویلیو`} کا ${n}${e.maximum.toString()} ہونا متوقع تھا`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`بہت چھوٹا: ${e.origin} کے ${n}${e.minimum.toString()} ${r.unit} ہونے متوقع تھے`:`بہت چھوٹا: ${e.origin} کا ${n}${e.minimum.toString()} ہونا متوقع تھا`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`غلط سٹرنگ: \"${t.prefix}\" سے شروع ہونا چاہیے`:t.format===`ends_with`?`غلط سٹرنگ: \"${t.suffix}\" پر ختم ہونا چاہیے`:t.format===`includes`?`غلط سٹرنگ: \"${t.includes}\" شامل ہونا چاہیے`:t.format===`regex`?`غلط سٹرنگ: پیٹرن ${t.pattern} سے میچ ہونا چاہیے`:`غلط ${r[t.format]??e.format}`}case`not_multiple_of`:return`غلط نمبر: ${e.divisor} کا مضاعف ہونا چاہیے`;case`unrecognized_keys`:return`غیر تسلیم شدہ کی${e.keys.length>1?`ز`:``}: ${U(e.keys,`، `)}`;case`invalid_key`:return`${e.origin} میں غلط کی`;case`invalid_union`:return`غلط ان پٹ`;case`invalid_element`:return`${e.origin} میں غلط ویلیو`;default:return`غلط ان پٹ`}}}}));function vv(){return{localeError:yv()}}var yv,bv=t((()=>{K(),yv=()=>{let e={string:{unit:`ký tự`,verb:`có`},file:{unit:`byte`,verb:`có`},array:{unit:`phần tử`,verb:`có`},set:{unit:`phần tử`,verb:`có`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`số`;case`object`:if(Array.isArray(e))return`mảng`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`đầu vào`,email:`địa chỉ email`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ngày giờ ISO`,date:`ngày ISO`,time:`giờ ISO`,duration:`khoảng thời gian ISO`,ipv4:`địa chỉ IPv4`,ipv6:`địa chỉ IPv6`,cidrv4:`dải IPv4`,cidrv6:`dải IPv6`,base64:`chuỗi mã hóa base64`,base64url:`chuỗi mã hóa base64url`,json_string:`chuỗi JSON`,e164:`số E.164`,jwt:`JWT`,template_literal:`đầu vào`};return e=>{switch(e.code){case`invalid_type`:return`Đầu vào không hợp lệ: mong đợi ${e.expected}, nhận được ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Đầu vào không hợp lệ: mong đợi ${G(e.values[0])}`:`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${U(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Quá lớn: mong đợi ${e.origin??`giá trị`} ${r.verb} ${n}${e.maximum.toString()} ${r.unit??`phần tử`}`:`Quá lớn: mong đợi ${e.origin??`giá trị`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Quá nhỏ: mong đợi ${e.origin} ${r.verb} ${n}${e.minimum.toString()} ${r.unit}`:`Quá nhỏ: mong đợi ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Chuỗi không hợp lệ: phải bắt đầu bằng \"${t.prefix}\"`:t.format===`ends_with`?`Chuỗi không hợp lệ: phải kết thúc bằng \"${t.suffix}\"`:t.format===`includes`?`Chuỗi không hợp lệ: phải bao gồm \"${t.includes}\"`:t.format===`regex`?`Chuỗi không hợp lệ: phải khớp với mẫu ${t.pattern}`:`${r[t.format]??e.format} không hợp lệ`}case`not_multiple_of`:return`Số không hợp lệ: phải là bội số của ${e.divisor}`;case`unrecognized_keys`:return`Khóa không được nhận dạng: ${U(e.keys,`, `)}`;case`invalid_key`:return`Khóa không hợp lệ trong ${e.origin}`;case`invalid_union`:return`Đầu vào không hợp lệ`;case`invalid_element`:return`Giá trị không hợp lệ trong ${e.origin}`;default:return`Đầu vào không hợp lệ`}}}}));function xv(){return{localeError:Sv()}}var Sv,Cv=t((()=>{K(),Sv=()=>{let e={string:{unit:`字符`,verb:`包含`},file:{unit:`字节`,verb:`包含`},array:{unit:`项`,verb:`包含`},set:{unit:`项`,verb:`包含`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`非数字(NaN)`:`数字`;case`object`:if(Array.isArray(e))return`数组`;if(e===null)return`空值(null)`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`输入`,email:`电子邮件`,url:`URL`,emoji:`表情符号`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO日期时间`,date:`ISO日期`,time:`ISO时间`,duration:`ISO时长`,ipv4:`IPv4地址`,ipv6:`IPv6地址`,cidrv4:`IPv4网段`,cidrv6:`IPv6网段`,base64:`base64编码字符串`,base64url:`base64url编码字符串`,json_string:`JSON字符串`,e164:`E.164号码`,jwt:`JWT`,template_literal:`输入`};return e=>{switch(e.code){case`invalid_type`:return`无效输入:期望 ${e.expected},实际接收 ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`无效输入:期望 ${G(e.values[0])}`:`无效选项:期望以下之一 ${U(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`数值过大:期望 ${e.origin??`值`} ${n}${e.maximum.toString()} ${r.unit??`个元素`}`:`数值过大:期望 ${e.origin??`值`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`数值过小:期望 ${e.origin} ${n}${e.minimum.toString()} ${r.unit}`:`数值过小:期望 ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`无效字符串:必须以 \"${t.prefix}\" 开头`:t.format===`ends_with`?`无效字符串:必须以 \"${t.suffix}\" 结尾`:t.format===`includes`?`无效字符串:必须包含 \"${t.includes}\"`:t.format===`regex`?`无效字符串:必须满足正则表达式 ${t.pattern}`:`无效${r[t.format]??e.format}`}case`not_multiple_of`:return`无效数字:必须是 ${e.divisor} 的倍数`;case`unrecognized_keys`:return`出现未知的键(key): ${U(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} 中的键(key)无效`;case`invalid_union`:return`无效输入`;case`invalid_element`:return`${e.origin} 中包含无效值(value)`;default:return`无效输入`}}}}));function wv(){return{localeError:Tv()}}var Tv,Ev=t((()=>{K(),Tv=()=>{let e={string:{unit:`字元`,verb:`擁有`},file:{unit:`位元組`,verb:`擁有`},array:{unit:`項目`,verb:`擁有`},set:{unit:`項目`,verb:`擁有`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`number`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`輸入`,email:`郵件地址`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO 日期時間`,date:`ISO 日期`,time:`ISO 時間`,duration:`ISO 期間`,ipv4:`IPv4 位址`,ipv6:`IPv6 位址`,cidrv4:`IPv4 範圍`,cidrv6:`IPv6 範圍`,base64:`base64 編碼字串`,base64url:`base64url 編碼字串`,json_string:`JSON 字串`,e164:`E.164 數值`,jwt:`JWT`,template_literal:`輸入`};return e=>{switch(e.code){case`invalid_type`:return`無效的輸入值:預期為 ${e.expected},但收到 ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`無效的輸入值:預期為 ${G(e.values[0])}`:`無效的選項:預期為以下其中之一 ${U(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`數值過大:預期 ${e.origin??`值`} 應為 ${n}${e.maximum.toString()} ${r.unit??`個元素`}`:`數值過大:預期 ${e.origin??`值`} 應為 ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`數值過小:預期 ${e.origin} 應為 ${n}${e.minimum.toString()} ${r.unit}`:`數值過小:預期 ${e.origin} 應為 ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`無效的字串:必須以 \"${t.prefix}\" 開頭`:t.format===`ends_with`?`無效的字串:必須以 \"${t.suffix}\" 結尾`:t.format===`includes`?`無效的字串:必須包含 \"${t.includes}\"`:t.format===`regex`?`無效的字串:必須符合格式 ${t.pattern}`:`無效的 ${r[t.format]??e.format}`}case`not_multiple_of`:return`無效的數字:必須為 ${e.divisor} 的倍數`;case`unrecognized_keys`:return`無法識別的鍵值${e.keys.length>1?`們`:``}:${U(e.keys,`、`)}`;case`invalid_key`:return`${e.origin} 中有無效的鍵值`;case`invalid_union`:return`無效的輸入值`;case`invalid_element`:return`${e.origin} 中有無效的值`;default:return`無效的輸入值`}}}})),Dv=r({ar:()=>pg,az:()=>gg,be:()=>bg,ca:()=>Cg,cs:()=>Eg,de:()=>kg,en:()=>Mg,eo:()=>Ig,es:()=>Bg,fa:()=>Ug,fi:()=>Kg,fr:()=>Yg,frCA:()=>Qg,he:()=>t_,hu:()=>i_,id:()=>s_,it:()=>u_,ja:()=>p_,kh:()=>g_,ko:()=>y_,mk:()=>S_,ms:()=>T_,nl:()=>O_,no:()=>j_,ota:()=>P_,pl:()=>B_,ps:()=>L_,pt:()=>U_,ru:()=>q_,sl:()=>X_,sv:()=>$_,ta:()=>nv,th:()=>av,tr:()=>cv,ua:()=>fv,ur:()=>hv,vi:()=>vv,zhCN:()=>xv,zhTW:()=>wv}),Ov=t((()=>{hg(),vg(),Sg(),Tg(),Og(),jg(),Fg(),zg(),Hg(),Gg(),Jg(),Zg(),e_(),r_(),o_(),l_(),f_(),h_(),v_(),x_(),w_(),D_(),A_(),N_(),I_(),z_(),H_(),G_(),Y_(),Q_(),tv(),iv(),sv(),dv(),mv(),_v(),bv(),Cv(),Ev()}));function kv(){return new Mv}var Av,jv,Mv,Nv,Pv=t((()=>{Av=Symbol(`ZodOutput`),jv=Symbol(`ZodInput`),Mv=class{constructor(){this._map=new Map,this._idmap=new Map}add(e,...t){let n=t[0];if(this._map.set(e,n),n&&typeof n==`object`&&`id`in n){if(this._idmap.has(n.id))throw Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,e)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};return delete n.id,{...n,...this._map.get(e)}}return this._map.get(e)}has(e){return this._map.has(e)}},Nv=kv()}));function Fv(e,t){return new e({type:`string`,...W(t)})}function Iv(e,t){return new e({type:`string`,coerce:!0,...W(t)})}function Lv(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...W(t)})}function Rv(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...W(t)})}function zv(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...W(t)})}function Bv(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...W(t)})}function Vv(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...W(t)})}function Hv(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...W(t)})}function Uv(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...W(t)})}function Wv(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...W(t)})}function Gv(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...W(t)})}function Kv(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...W(t)})}function qv(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...W(t)})}function Jv(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...W(t)})}function Yv(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...W(t)})}function Xv(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...W(t)})}function Zv(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...W(t)})}function Qv(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...W(t)})}function $v(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...W(t)})}function ey(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...W(t)})}function ty(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...W(t)})}function ny(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...W(t)})}function ry(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...W(t)})}function iy(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...W(t)})}function ay(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...W(t)})}function oy(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...W(t)})}function sy(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...W(t)})}function cy(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...W(t)})}function ly(e,t){return new e({type:`number`,checks:[],...W(t)})}function uy(e,t){return new e({type:`number`,coerce:!0,checks:[],...W(t)})}function dy(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...W(t)})}function fy(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`float32`,...W(t)})}function py(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`float64`,...W(t)})}function my(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`int32`,...W(t)})}function hy(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`uint32`,...W(t)})}function gy(e,t){return new e({type:`boolean`,...W(t)})}function _y(e,t){return new e({type:`boolean`,coerce:!0,...W(t)})}function vy(e,t){return new e({type:`bigint`,...W(t)})}function yy(e,t){return new e({type:`bigint`,coerce:!0,...W(t)})}function by(e,t){return new e({type:`bigint`,check:`bigint_format`,abort:!1,format:`int64`,...W(t)})}function xy(e,t){return new e({type:`bigint`,check:`bigint_format`,abort:!1,format:`uint64`,...W(t)})}function Sy(e,t){return new e({type:`symbol`,...W(t)})}function Cy(e,t){return new e({type:`undefined`,...W(t)})}function wy(e,t){return new e({type:`null`,...W(t)})}function Ty(e){return new e({type:`any`})}function Ey(e){return new e({type:`unknown`})}function Dy(e,t){return new e({type:`never`,...W(t)})}function Oy(e,t){return new e({type:`void`,...W(t)})}function ky(e,t){return new e({type:`date`,...W(t)})}function Ay(e,t){return new e({type:`date`,coerce:!0,...W(t)})}function jy(e,t){return new e({type:`nan`,...W(t)})}function My(e,t){return new dm({check:`less_than`,...W(t),value:e,inclusive:!1})}function Ny(e,t){return new dm({check:`less_than`,...W(t),value:e,inclusive:!0})}function Py(e,t){return new fm({check:`greater_than`,...W(t),value:e,inclusive:!1})}function Fy(e,t){return new fm({check:`greater_than`,...W(t),value:e,inclusive:!0})}function Iy(e){return Py(0,e)}function Ly(e){return My(0,e)}function Ry(e){return Ny(0,e)}function zy(e){return Fy(0,e)}function By(e,t){return new pm({check:`multiple_of`,...W(t),value:e})}function Vy(e,t){return new gm({check:`max_size`,...W(t),maximum:e})}function Hy(e,t){return new _m({check:`min_size`,...W(t),minimum:e})}function Uy(e,t){return new vm({check:`size_equals`,...W(t),size:e})}function Wy(e,t){return new ym({check:`max_length`,...W(t),maximum:e})}function Gy(e,t){return new bm({check:`min_length`,...W(t),minimum:e})}function Ky(e,t){return new xm({check:`length_equals`,...W(t),length:e})}function qy(e,t){return new Cm({check:`string_format`,format:`regex`,...W(t),pattern:e})}function Jy(e){return new wm({check:`string_format`,format:`lowercase`,...W(e)})}function Yy(e){return new Tm({check:`string_format`,format:`uppercase`,...W(e)})}function Xy(e,t){return new Em({check:`string_format`,format:`includes`,...W(t),includes:e})}function Zy(e,t){return new Dm({check:`string_format`,format:`starts_with`,...W(t),prefix:e})}function Qy(e,t){return new Om({check:`string_format`,format:`ends_with`,...W(t),suffix:e})}function $y(e,t,n){return new km({check:`property`,property:e,schema:t,...W(n)})}function eb(e,t){return new Am({check:`mime_type`,mime:e,...W(t)})}function tb(e){return new jm({check:`overwrite`,tx:e})}function nb(e){return tb(t=>t.normalize(e))}function rb(){return tb(e=>e.trim())}function ib(){return tb(e=>e.toLowerCase())}function ab(){return tb(e=>e.toUpperCase())}function ob(e,t,n){return new e({type:`array`,element:t,...W(n)})}function sb(e,t,n){return new e({type:`union`,options:t,...W(n)})}function cb(e,t,n,r){return new e({type:`union`,options:n,discriminator:t,...W(r)})}function lb(e,t,n){return new e({type:`intersection`,left:t,right:n})}function ub(e,t,n,r){let i=n instanceof q;return new e({type:`tuple`,items:t,rest:i?n:null,...W(i?r:n)})}function db(e,t,n,r){return new e({type:`record`,keyType:t,valueType:n,...W(r)})}function fb(e,t,n,r){return new e({type:`map`,keyType:t,valueType:n,...W(r)})}function pb(e,t,n){return new e({type:`set`,valueType:t,...W(n)})}function mb(e,t,n){return new e({type:`enum`,entries:Array.isArray(t)?Object.fromEntries(t.map(e=>[e,e])):t,...W(n)})}function hb(e,t,n){return new e({type:`enum`,entries:t,...W(n)})}function gb(e,t,n){return new e({type:`literal`,values:Array.isArray(t)?t:[t],...W(n)})}function _b(e,t){return new e({type:`file`,...W(t)})}function vb(e,t){return new e({type:`transform`,transform:t})}function yb(e,t){return new e({type:`optional`,innerType:t})}function bb(e,t){return new e({type:`nullable`,innerType:t})}function xb(e,t,n){return new e({type:`default`,innerType:t,get defaultValue(){return typeof n==`function`?n():n}})}function Sb(e,t,n){return new e({type:`nonoptional`,innerType:t,...W(n)})}function Cb(e,t){return new e({type:`success`,innerType:t})}function wb(e,t,n){return new e({type:`catch`,innerType:t,catchValue:typeof n==`function`?n:()=>n})}function Tb(e,t,n){return new e({type:`pipe`,in:t,out:n})}function Eb(e,t){return new e({type:`readonly`,innerType:t})}function Db(e,t,n){return new e({type:`template_literal`,parts:t,...W(n)})}function Ob(e,t){return new e({type:`lazy`,getter:t})}function kb(e,t){return new e({type:`promise`,innerType:t})}function Ab(e,t,n){let r=W(n);return r.abort??=!0,new e({type:`custom`,check:`custom`,fn:t,...r})}function jb(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...W(n)})}function Mb(e,t){let n=W(t),r=n.truthy??[`true`,`1`,`yes`,`on`,`y`,`enabled`],i=n.falsy??[`false`,`0`,`no`,`off`,`n`,`disabled`];n.case!==`sensitive`&&(r=r.map(e=>typeof e==`string`?e.toLowerCase():e),i=i.map(e=>typeof e==`string`?e.toLowerCase():e));let a=new Set(r),o=new Set(i),s=e.Pipe??og,c=e.Boolean??Oh,l=e.String??eh,u=new(e.Transform??Zh)({type:`transform`,transform:(e,t)=>{let r=e;return n.case!==`sensitive`&&(r=r.toLowerCase()),a.has(r)?!0:!o.has(r)&&(t.issues.push({code:`invalid_value`,expected:`stringbool`,values:[...a,...o],input:t.value,inst:u}),{})},error:n.error});return new s({type:`pipe`,in:new s({type:`pipe`,in:new l({type:`string`,error:n.error}),out:u,error:n.error}),out:new c({type:`boolean`,error:n.error}),error:n.error})}function Nb(e,t,n,r={}){let i=W(r),a={...W(r),check:`string_format`,type:`string`,format:t,fn:typeof n==`function`?n:e=>n.test(e),...i};return n instanceof RegExp&&(a.pattern=n),new e(a)}var Pb,Fb=t((()=>{Mm(),fg(),K(),Pb={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6}}));function Ib(e){return new Lb({type:`function`,input:Array.isArray(e?.input)?ub(Wh,e?.input):e?.input??ob(zh,Ey(Fh)),output:e?.output??Ey(Fh)})}var Lb,Rb=t((()=>{Fb(),gp(),fg(),Lb=class{constructor(e){this._def=e,this.def=e}implement(e){if(typeof e!=`function`)throw Error(`implement() must be called with a function`);let t=((...n)=>{let r=this._def.input?lp(this._def.input,n,void 0,{callee:t}):n;if(!Array.isArray(r))throw Error(`Invalid arguments schema: not an array or tuple schema.`);let i=e(...r);return this._def.output?lp(this._def.output,i,void 0,{callee:t}):i});return t}implementAsync(e){if(typeof e!=`function`)throw Error(`implement() must be called with a function`);let t=(async(...n)=>{let r=this._def.input?await dp(this._def.input,n,void 0,{callee:t}):n;if(!Array.isArray(r))throw Error(`Invalid arguments schema: not an array or tuple schema.`);let i=await e(...r);return this._def.output?dp(this._def.output,i,void 0,{callee:t}):i});return t}input(...e){let t=this.constructor;return Array.isArray(e[0])?new t({type:`function`,input:new Wh({type:`tuple`,items:e[0],rest:e[1]}),output:this._def.output}):new t({type:`function`,input:e[0],output:this._def.output})}output(e){let t=this.constructor;return new t({type:`function`,input:this._def.input,output:e})}}}));function zb(e,t){if(e instanceof Mv){let n=new Vb(t),r={};for(let t of e._idmap.entries()){let[e,r]=t;n.process(r)}let i={},a={registry:e,uri:t?.uri,defs:r};for(let r of e._idmap.entries()){let[e,o]=r;i[e]=n.emit(o,{...t,external:a})}return Object.keys(r).length>0&&(i.__shared={[n.target===`draft-2020-12`?`$defs`:`definitions`]:r}),{schemas:i}}let n=new Vb(t);return n.process(e),n.emit(e,t)}function Bb(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;switch(r.type){case`string`:case`number`:case`bigint`:case`boolean`:case`date`:case`symbol`:case`undefined`:case`null`:case`any`:case`unknown`:case`never`:case`void`:case`literal`:case`enum`:case`nan`:case`file`:case`template_literal`:return!1;case`array`:return Bb(r.element,n);case`object`:for(let e in r.shape)if(Bb(r.shape[e],n))return!0;return!1;case`union`:for(let e of r.options)if(Bb(e,n))return!0;return!1;case`intersection`:return Bb(r.left,n)||Bb(r.right,n);case`tuple`:for(let e of r.items)if(Bb(e,n))return!0;return!!(r.rest&&Bb(r.rest,n));case`record`:return Bb(r.keyType,n)||Bb(r.valueType,n);case`map`:return Bb(r.keyType,n)||Bb(r.valueType,n);case`set`:return Bb(r.valueType,n);case`promise`:case`optional`:case`nonoptional`:case`nullable`:case`readonly`:return Bb(r.innerType,n);case`lazy`:return Bb(r.getter(),n);case`default`:return Bb(r.innerType,n);case`prefault`:return Bb(r.innerType,n);case`custom`:return!1;case`transform`:return!0;case`pipe`:return Bb(r.in,n)||Bb(r.out,n);case`success`:return!1;case`catch`:return!1}throw Error(`Unknown schema type: ${r.type}`)}var Vb,Hb=t((()=>{Pv(),K(),Vb=class{constructor(e){this.counter=0,this.metadataRegistry=e?.metadata??Nv,this.target=e?.target??`draft-2020-12`,this.unrepresentable=e?.unrepresentable??`throw`,this.override=e?.override??(()=>{}),this.io=e?.io??`output`,this.seen=new Map}process(e,t={path:[],schemaPath:[]}){var n;let r=e._zod.def,i={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},a=this.seen.get(e);if(a)return a.count++,t.schemaPath.includes(e)&&(a.cycle=t.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:t.path};this.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let n={...t,schemaPath:[...t.schemaPath,e],path:t.path},a=e._zod.parent;if(a)o.ref=a,this.process(a,n),this.seen.get(a).isParent=!0;else{let t=o.schema;switch(r.type){case`string`:{let n=t;n.type=`string`;let{minimum:r,maximum:a,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof r==`number`&&(n.minLength=r),typeof a==`number`&&(n.maxLength=a),s&&(n.format=i[s]??s,n.format===``&&delete n.format),l&&(n.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?n.pattern=e[0].source:e.length>1&&(o.schema.allOf=[...e.map(e=>({...this.target===`draft-7`?{type:`string`}:{},pattern:e.source}))])}break}case`number`:{let n=t,{minimum:r,maximum:i,format:a,multipleOf:o,exclusiveMaximum:s,exclusiveMinimum:c}=e._zod.bag;n.type=typeof a==`string`&&a.includes(`int`)?`integer`:`number`,typeof c==`number`&&(n.exclusiveMinimum=c),typeof r==`number`&&(n.minimum=r,typeof c==`number`&&(c>=r?delete n.minimum:delete n.exclusiveMinimum)),typeof s==`number`&&(n.exclusiveMaximum=s),typeof i==`number`&&(n.maximum=i,typeof s==`number`&&(s<=i?delete n.maximum:delete n.exclusiveMaximum)),typeof o==`number`&&(n.multipleOf=o);break}case`boolean`:{let e=t;e.type=`boolean`;break}case`bigint`:if(this.unrepresentable===`throw`)throw Error(`BigInt cannot be represented in JSON Schema`);break;case`symbol`:if(this.unrepresentable===`throw`)throw Error(`Symbols cannot be represented in JSON Schema`);break;case`null`:t.type=`null`;break;case`any`:break;case`unknown`:break;case`undefined`:if(this.unrepresentable===`throw`)throw Error(`Undefined cannot be represented in JSON Schema`);break;case`void`:if(this.unrepresentable===`throw`)throw Error(`Void cannot be represented in JSON Schema`);break;case`never`:t.not={};break;case`date`:if(this.unrepresentable===`throw`)throw Error(`Date cannot be represented in JSON Schema`);break;case`array`:{let i=t,{minimum:a,maximum:o}=e._zod.bag;typeof a==`number`&&(i.minItems=a),typeof o==`number`&&(i.maxItems=o),i.type=`array`,i.items=this.process(r.element,{...n,path:[...n.path,`items`]});break}case`object`:{let e=t;e.type=`object`,e.properties={};let i=r.shape;for(let t in i)e.properties[t]=this.process(i[t],{...n,path:[...n.path,`properties`,t]});let a=new Set(Object.keys(i)),o=new Set([...a].filter(e=>{let t=r.shape[e]._zod;return this.io===`input`?t.optin===void 0:t.optout===void 0}));o.size>0&&(e.required=Array.from(o)),r.catchall?._zod.def.type===`never`?e.additionalProperties=!1:r.catchall?r.catchall&&(e.additionalProperties=this.process(r.catchall,{...n,path:[...n.path,`additionalProperties`]})):this.io===`output`&&(e.additionalProperties=!1);break}case`union`:{let e=t;e.anyOf=r.options.map((e,t)=>this.process(e,{...n,path:[...n.path,`anyOf`,t]}));break}case`intersection`:{let e=t,i=this.process(r.left,{...n,path:[...n.path,`allOf`,0]}),a=this.process(r.right,{...n,path:[...n.path,`allOf`,1]}),o=e=>`allOf`in e&&Object.keys(e).length===1;e.allOf=[...o(i)?i.allOf:[i],...o(a)?a.allOf:[a]];break}case`tuple`:{let i=t;i.type=`array`;let a=r.items.map((e,t)=>this.process(e,{...n,path:[...n.path,`prefixItems`,t]}));if(this.target===`draft-2020-12`?i.prefixItems=a:i.items=a,r.rest){let e=this.process(r.rest,{...n,path:[...n.path,`items`]});this.target===`draft-2020-12`?i.items=e:i.additionalItems=e}r.rest&&(i.items=this.process(r.rest,{...n,path:[...n.path,`items`]}));let{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s);break}case`record`:{let e=t;e.type=`object`,e.propertyNames=this.process(r.keyType,{...n,path:[...n.path,`propertyNames`]}),e.additionalProperties=this.process(r.valueType,{...n,path:[...n.path,`additionalProperties`]});break}case`map`:if(this.unrepresentable===`throw`)throw Error(`Map cannot be represented in JSON Schema`);break;case`set`:if(this.unrepresentable===`throw`)throw Error(`Set cannot be represented in JSON Schema`);break;case`enum`:{let e=t,n=ff(r.entries);n.every(e=>typeof e==`number`)&&(e.type=`number`),n.every(e=>typeof e==`string`)&&(e.type=`string`),e.enum=n;break}case`literal`:{let e=t,n=[];for(let e of r.values)if(e===void 0){if(this.unrepresentable===`throw`)throw Error(\"Literal `undefined` cannot be represented in JSON Schema\")}else if(typeof e==`bigint`){if(this.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);n.push(Number(e))}else n.push(e);if(n.length!==0){if(n.length===1){let t=n[0];e.type=t===null?`null`:typeof t,e.const=t}else n.every(e=>typeof e==`number`)&&(e.type=`number`),n.every(e=>typeof e==`string`)&&(e.type=`string`),n.every(e=>typeof e==`boolean`)&&(e.type=`string`),n.every(e=>e===null)&&(e.type=`null`),e.enum=n}break}case`file`:{let n=t,r={type:`string`,format:`binary`,contentEncoding:`binary`},{minimum:i,maximum:a,mime:o}=e._zod.bag;i!==void 0&&(r.minLength=i),a!==void 0&&(r.maxLength=a),o?o.length===1?(r.contentMediaType=o[0],Object.assign(n,r)):n.anyOf=o.map(e=>({...r,contentMediaType:e})):Object.assign(n,r);break}case`transform`:if(this.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`);break;case`nullable`:t.anyOf=[this.process(r.innerType,n),{type:`null`}];break;case`nonoptional`:this.process(r.innerType,n),o.ref=r.innerType;break;case`success`:{let e=t;e.type=`boolean`;break}case`default`:this.process(r.innerType,n),o.ref=r.innerType,t.default=JSON.parse(JSON.stringify(r.defaultValue));break;case`prefault`:this.process(r.innerType,n),o.ref=r.innerType,this.io===`input`&&(t._prefault=JSON.parse(JSON.stringify(r.defaultValue)));break;case`catch`:{this.process(r.innerType,n),o.ref=r.innerType;let e;try{e=r.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}t.default=e;break}case`nan`:if(this.unrepresentable===`throw`)throw Error(`NaN cannot be represented in JSON Schema`);break;case`template_literal`:{let n=t,r=e._zod.pattern;if(!r)throw Error(`Pattern not found in template literal`);n.type=`string`,n.pattern=r.source;break}case`pipe`:{let e=this.io===`input`?r.in._zod.def.type===`transform`?r.out:r.in:r.out;this.process(e,n),o.ref=e;break}case`readonly`:this.process(r.innerType,n),o.ref=r.innerType,t.readOnly=!0;break;case`promise`:this.process(r.innerType,n),o.ref=r.innerType;break;case`optional`:this.process(r.innerType,n),o.ref=r.innerType;break;case`lazy`:{let t=e._zod.innerType;this.process(t,n),o.ref=t;break}case`custom`:if(this.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)}}}let c=this.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),this.io===`input`&&Bb(e)&&(delete o.schema.examples,delete o.schema.default),this.io===`input`&&o.schema._prefault&&((n=o.schema).default??(n.default=o.schema._prefault)),delete o.schema._prefault,this.seen.get(e).schema}emit(e,t){let n={cycles:t?.cycles??`ref`,reused:t?.reused??`inline`,external:t?.external??void 0},r=this.seen.get(e);if(!r)throw Error(`Unprocessed schema. This is a bug in Zod.`);let i=e=>{let t=this.target===`draft-2020-12`?`$defs`:`definitions`;if(n.external){let r=n.external.registry.get(e[0])?.id,i=n.external.uri??(e=>e);if(r)return{ref:i(r)};let a=e[1].defId??e[1].schema.id??`schema${this.counter++}`;return e[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${t}/${a}`}}if(e[1]===r)return{ref:`#`};let i=`#/${t}/`,a=e[1].schema.id??`__schema${this.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(n.cycles===`throw`)for(let e of this.seen.entries()){let t=e[1];if(t.cycle)throw Error(`Cycle detected: #/${t.cycle?.join(`/`)}/<root>\n\nSet the \\`cycles\\` parameter to \\`\"ref\"\\` to resolve cyclical schemas with defs.`)}for(let t of this.seen.entries()){let r=t[1];if(e===t[0]){a(t);continue}if(n.external){let r=n.external.registry.get(t[0])?.id;if(e!==t[0]&&r){a(t);continue}}if(this.metadataRegistry.get(t[0])?.id){a(t);continue}if(r.cycle){a(t);continue}if(r.count>1&&n.reused===`ref`){a(t);continue}}let o=(e,t)=>{let n=this.seen.get(e),r=n.def??n.schema,i={...r};if(n.ref===null)return;let a=n.ref;if(n.ref=null,a){o(a,t);let e=this.seen.get(a).schema;e.$ref&&t.target===`draft-7`?(r.allOf=r.allOf??[],r.allOf.push(e)):(Object.assign(r,e),Object.assign(r,i))}n.isParent||this.override({zodSchema:e,jsonSchema:r,path:n.path??[]})};for(let e of[...this.seen.entries()].reverse())o(e[0],{target:this.target});let s={};if(this.target===`draft-2020-12`?s.$schema=`https://json-schema.org/draft/2020-12/schema`:this.target===`draft-7`?s.$schema=`http://json-schema.org/draft-07/schema#`:console.warn(`Invalid target: ${this.target}`),n.external?.uri){let t=n.external.registry.get(e)?.id;if(!t)throw Error(\"Schema is missing an `id` property\");s.$id=n.external.uri(t)}Object.assign(s,r.def);let c=n.external?.defs??{};for(let e of this.seen.entries()){let t=e[1];t.def&&t.defId&&(c[t.defId]=t.def)}n.external||Object.keys(c).length>0&&(this.target===`draft-2020-12`?s.$defs=c:s.definitions=c);try{return JSON.parse(JSON.stringify(s))}catch{throw Error(`Error converting schema to JSON.`)}}}})),Ub=r({}),Wb=t((()=>{})),Gb=r({$ZodAny:()=>Ph,$ZodArray:()=>zh,$ZodAsyncError:()=>nf,$ZodBase64:()=>xh,$ZodBase64URL:()=>Sh,$ZodBigInt:()=>kh,$ZodBigIntFormat:()=>Ah,$ZodBoolean:()=>Oh,$ZodCIDRv4:()=>yh,$ZodCIDRv6:()=>bh,$ZodCUID:()=>ch,$ZodCUID2:()=>lh,$ZodCatch:()=>ig,$ZodCheck:()=>lm,$ZodCheckBigIntFormat:()=>hm,$ZodCheckEndsWith:()=>Om,$ZodCheckGreaterThan:()=>fm,$ZodCheckIncludes:()=>Em,$ZodCheckLengthEquals:()=>xm,$ZodCheckLessThan:()=>dm,$ZodCheckLowerCase:()=>wm,$ZodCheckMaxLength:()=>ym,$ZodCheckMaxSize:()=>gm,$ZodCheckMimeType:()=>Am,$ZodCheckMinLength:()=>bm,$ZodCheckMinSize:()=>_m,$ZodCheckMultipleOf:()=>pm,$ZodCheckNumberFormat:()=>mm,$ZodCheckOverwrite:()=>jm,$ZodCheckProperty:()=>km,$ZodCheckRegex:()=>Cm,$ZodCheckSizeEquals:()=>vm,$ZodCheckStartsWith:()=>Dm,$ZodCheckStringFormat:()=>Sm,$ZodCheckUpperCase:()=>Tm,$ZodCustom:()=>dg,$ZodCustomStringFormat:()=>Th,$ZodDate:()=>Rh,$ZodDefault:()=>eg,$ZodDiscriminatedUnion:()=>Hh,$ZodE164:()=>Ch,$ZodEmail:()=>ih,$ZodEmoji:()=>oh,$ZodEnum:()=>Jh,$ZodError:()=>ap,$ZodFile:()=>Xh,$ZodFunction:()=>Lb,$ZodGUID:()=>nh,$ZodIPv4:()=>_h,$ZodIPv6:()=>vh,$ZodISODate:()=>mh,$ZodISODateTime:()=>ph,$ZodISODuration:()=>gh,$ZodISOTime:()=>hh,$ZodIntersection:()=>Uh,$ZodJWT:()=>wh,$ZodKSUID:()=>fh,$ZodLazy:()=>ug,$ZodLiteral:()=>Yh,$ZodMap:()=>Kh,$ZodNaN:()=>ag,$ZodNanoID:()=>sh,$ZodNever:()=>Ih,$ZodNonOptional:()=>ng,$ZodNull:()=>Nh,$ZodNullable:()=>$h,$ZodNumber:()=>Eh,$ZodNumberFormat:()=>Dh,$ZodObject:()=>Bh,$ZodOptional:()=>Qh,$ZodPipe:()=>og,$ZodPrefault:()=>tg,$ZodPromise:()=>lg,$ZodReadonly:()=>sg,$ZodRealError:()=>op,$ZodRecord:()=>Gh,$ZodRegistry:()=>Mv,$ZodSet:()=>qh,$ZodString:()=>eh,$ZodStringFormat:()=>th,$ZodSuccess:()=>rg,$ZodSymbol:()=>jh,$ZodTemplateLiteral:()=>cg,$ZodTransform:()=>Zh,$ZodTuple:()=>Wh,$ZodType:()=>q,$ZodULID:()=>uh,$ZodURL:()=>ah,$ZodUUID:()=>rh,$ZodUndefined:()=>Mh,$ZodUnion:()=>Vh,$ZodUnknown:()=>Fh,$ZodVoid:()=>Lh,$ZodXID:()=>dh,$brand:()=>tf,$constructor:()=>H,$input:()=>jv,$output:()=>Av,Doc:()=>Nm,JSONSchema:()=>Ub,JSONSchemaGenerator:()=>Vb,NEVER:()=>ef,TimePrecision:()=>Pb,_any:()=>Ty,_array:()=>ob,_base64:()=>ty,_base64url:()=>ny,_bigint:()=>vy,_boolean:()=>gy,_catch:()=>wb,_cidrv4:()=>$v,_cidrv6:()=>ey,_coercedBigint:()=>yy,_coercedBoolean:()=>_y,_coercedDate:()=>Ay,_coercedNumber:()=>uy,_coercedString:()=>Iv,_cuid:()=>Kv,_cuid2:()=>qv,_custom:()=>Ab,_date:()=>ky,_default:()=>xb,_discriminatedUnion:()=>cb,_e164:()=>ry,_email:()=>Lv,_emoji:()=>Wv,_endsWith:()=>Qy,_enum:()=>mb,_file:()=>_b,_float32:()=>fy,_float64:()=>py,_gt:()=>Py,_gte:()=>Fy,_guid:()=>Rv,_includes:()=>Xy,_int:()=>dy,_int32:()=>my,_int64:()=>by,_intersection:()=>lb,_ipv4:()=>Zv,_ipv6:()=>Qv,_isoDate:()=>oy,_isoDateTime:()=>ay,_isoDuration:()=>cy,_isoTime:()=>sy,_jwt:()=>iy,_ksuid:()=>Xv,_lazy:()=>Ob,_length:()=>Ky,_literal:()=>gb,_lowercase:()=>Jy,_lt:()=>My,_lte:()=>Ny,_map:()=>fb,_max:()=>Ny,_maxLength:()=>Wy,_maxSize:()=>Vy,_mime:()=>eb,_min:()=>Fy,_minLength:()=>Gy,_minSize:()=>Hy,_multipleOf:()=>By,_nan:()=>jy,_nanoid:()=>Gv,_nativeEnum:()=>hb,_negative:()=>Ly,_never:()=>Dy,_nonnegative:()=>zy,_nonoptional:()=>Sb,_nonpositive:()=>Ry,_normalize:()=>nb,_null:()=>wy,_nullable:()=>bb,_number:()=>ly,_optional:()=>yb,_overwrite:()=>tb,_parse:()=>cp,_parseAsync:()=>up,_pipe:()=>Tb,_positive:()=>Iy,_promise:()=>kb,_property:()=>$y,_readonly:()=>Eb,_record:()=>db,_refine:()=>jb,_regex:()=>qy,_safeParse:()=>fp,_safeParseAsync:()=>mp,_set:()=>pb,_size:()=>Uy,_startsWith:()=>Zy,_string:()=>Fv,_stringFormat:()=>Nb,_stringbool:()=>Mb,_success:()=>Cb,_symbol:()=>Sy,_templateLiteral:()=>Db,_toLowerCase:()=>ib,_toUpperCase:()=>ab,_transform:()=>vb,_trim:()=>rb,_tuple:()=>ub,_uint32:()=>hy,_uint64:()=>xy,_ulid:()=>Jv,_undefined:()=>Cy,_union:()=>sb,_unknown:()=>Ey,_uppercase:()=>Yy,_url:()=>Uv,_uuid:()=>zv,_uuidv4:()=>Bv,_uuidv6:()=>Vv,_uuidv7:()=>Hv,_void:()=>Oy,_xid:()=>Yv,clone:()=>Of,config:()=>$d,flattenError:()=>$f,formatError:()=>ep,function:()=>Ib,globalConfig:()=>rf,globalRegistry:()=>Nv,isValidBase64:()=>Lm,isValidBase64URL:()=>Rm,isValidJWT:()=>zm,locales:()=>Dv,parse:()=>lp,parseAsync:()=>dp,prettifyError:()=>rp,regexes:()=>_p,registry:()=>kv,safeParse:()=>pp,safeParseAsync:()=>hp,toDotPath:()=>np,toJSONSchema:()=>zb,treeifyError:()=>tp,util:()=>of,version:()=>Fm}),Kb=t((()=>{af(),gp(),sp(),fg(),Mm(),Im(),K(),sm(),Ov(),Pv(),Pm(),Rb(),Fb(),Hb(),Wb()})),qb=t((()=>{Kb()})),Jb=t((()=>{})),Yb=t((()=>{Kb()})),Xb=t((()=>{Kb(),qb(),Jb(),Yb(),Ov(),Jb()})),Zb=t((()=>{Xb()})),Qb=t((()=>{Zb()}));function $b(e){return!!e._zod}function ex(e,t){return $b(e)?pp(e,t):e.safeParse(t)}function tx(e){if(!e)return;let t;if(t=$b(e)?e._zod?.def?.shape:e.shape,t){if(typeof t==`function`)try{return t()}catch{return}return t}}function nx(e){if($b(e)){let t=e._zod?.def;if(t){if(t.value!==void 0)return t.value;if(Array.isArray(t.values)&&t.values.length>0)return t.values[0]}}let t=e._def;if(t){if(t.value!==void 0)return t.value;if(Array.isArray(t.values)&&t.values.length>0)return t.values[0]}let n=e.value;if(n!==void 0)return n}var rx=t((()=>{Qb()})),ix=t((()=>{Kb()})),ax=r({ZodISODate:()=>dx,ZodISODateTime:()=>ux,ZodISODuration:()=>px,ZodISOTime:()=>fx,date:()=>sx,datetime:()=>ox,duration:()=>lx,time:()=>cx});function ox(e){return ay(ux,e)}function sx(e){return oy(dx,e)}function cx(e){return sy(fx,e)}function lx(e){return cy(px,e)}var ux,dx,fx,px,mx=t((()=>{Kb(),nw(),ux=H(`ZodISODateTime`,(e,t)=>{ph.init(e,t),JS.init(e,t)}),dx=H(`ZodISODate`,(e,t)=>{mh.init(e,t),JS.init(e,t)}),fx=H(`ZodISOTime`,(e,t)=>{hh.init(e,t),JS.init(e,t)}),px=H(`ZodISODuration`,(e,t)=>{gh.init(e,t),JS.init(e,t)})})),hx,gx,_x,vx=t((()=>{Kb(),hx=(e,t)=>{ap.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>ep(e,t)},flatten:{value:t=>$f(e,t)},addIssue:{value:t=>e.issues.push(t)},addIssues:{value:t=>e.issues.push(...t)},isEmpty:{get(){return e.issues.length===0}}})},gx=H(`ZodError`,hx),_x=H(`ZodError`,hx,{Parent:Error})})),yx,bx,xx,Sx,Cx=t((()=>{Kb(),vx(),yx=cp(_x),bx=up(_x),xx=fp(_x),Sx=mp(_x)}));function J(e){return Fv(qS,e)}function wx(e){return Lv(YS,e)}function Tx(e){return Rv(XS,e)}function Ex(e){return zv(ZS,e)}function Dx(e){return Bv(ZS,e)}function Ox(e){return Vv(ZS,e)}function kx(e){return Hv(ZS,e)}function Ax(e){return Uv(QS,e)}function jx(e){return Wv($S,e)}function Mx(e){return Gv(eC,e)}function Nx(e){return Kv(tC,e)}function Px(e){return qv(nC,e)}function Fx(e){return Jv(rC,e)}function Ix(e){return Yv(iC,e)}function Lx(e){return Xv(aC,e)}function Rx(e){return Zv(oC,e)}function zx(e){return Qv(sC,e)}function Bx(e){return $v(cC,e)}function Vx(e){return ey(lC,e)}function Hx(e){return ty(uC,e)}function Ux(e){return ny(dC,e)}function Wx(e){return ry(fC,e)}function Gx(e){return iy(pC,e)}function Kx(e,t,n={}){return Nb(mC,e,t,n)}function Y(e){return ly(hC,e)}function qx(e){return dy(gC,e)}function Jx(e){return fy(gC,e)}function Yx(e){return py(gC,e)}function Xx(e){return my(gC,e)}function Zx(e){return hy(gC,e)}function Qx(e){return gy(_C,e)}function $x(e){return vy(vC,e)}function eS(e){return by(yC,e)}function tS(e){return xy(yC,e)}function nS(e){return Sy(bC,e)}function rS(e){return Cy(xC,e)}function iS(e){return wy(SC,e)}function aS(){return Ty(CC)}function oS(){return Ey(wC)}function sS(e){return Dy(TC,e)}function cS(e){return Oy(EC,e)}function lS(e){return ky(DC,e)}function X(e,t){return ob(OC,e,t)}function uS(e){let t=e._zod.def.shape;return Q(Object.keys(t))}function Z(e,t){let n={type:`object`,get shape(){return yf(this,`shape`,{...e}),this.shape},...W(t)};return new kC(n)}function dS(e,t){return new kC({type:`object`,get shape(){return yf(this,`shape`,{...e}),this.shape},catchall:sS(),...W(t)})}function fS(e,t){return new kC({type:`object`,get shape(){return yf(this,`shape`,{...e}),this.shape},catchall:oS(),...W(t)})}function pS(e,t){return new AC({type:`union`,options:e,...W(t)})}function mS(e,t,n){return new jC({type:`union`,options:t,discriminator:e,...W(n)})}function hS(e,t){return new MC({type:`intersection`,left:e,right:t})}function gS(e,t,n){let r=t instanceof q;return new NC({type:`tuple`,items:e,rest:r?t:null,...W(r?n:t)})}function _S(e,t,n){return new PC({type:`record`,keyType:e,valueType:t,...W(n)})}function vS(e,t,n){return new PC({type:`record`,keyType:pS([e,sS()]),valueType:t,...W(n)})}function yS(e,t,n){return new FC({type:`map`,keyType:e,valueType:t,...W(n)})}function bS(e,t){return new IC({type:`set`,valueType:e,...W(t)})}function xS(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new LC({type:`enum`,entries:n,...W(t)})}function SS(e,t){return new LC({type:`enum`,entries:e,...W(t)})}function Q(e,t){return new RC({type:`literal`,values:Array.isArray(e)?e:[e],...W(t)})}function CS(e){return _b(zC,e)}function wS(e){return new BC({type:`transform`,transform:e})}function TS(e){return new VC({type:`optional`,innerType:e})}function ES(e){return new HC({type:`nullable`,innerType:e})}function DS(e){return TS(ES(e))}function OS(e,t){return new UC({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():t}})}function kS(e,t){return new WC({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():t}})}function AS(e,t){return new GC({type:`nonoptional`,innerType:e,...W(t)})}function jS(e){return new KC({type:`success`,innerType:e})}function MS(e,t){return new qC({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}function NS(e){return jy(JC,e)}function PS(e,t){return new YC({type:`pipe`,in:e,out:t})}function FS(e){return new XC({type:`readonly`,innerType:e})}function IS(e,t){return new ZC({type:`template_literal`,parts:e,...W(t)})}function LS(e){return new QC({type:`lazy`,getter:e})}function RS(e){return new $C({type:`promise`,innerType:e})}function zS(e){let t=new lm({check:`custom`});return t._zod.check=e,t}function BS(e,t){return Ab(ew,e??(()=>!0),t)}function VS(e,t={}){return jb(ew,e,t)}function HS(e){let t=zS(n=>(n.addIssue=e=>{if(typeof e==`string`)n.issues.push(Uf(e,n.value,t._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=n.value,r.inst??=t,r.continue??=!t._zod.def.abort,n.issues.push(Uf(r))}},e(n.value,n)));return t}function US(e,t={error:`Input not instance of ${e.name}`}){let n=new ew({type:`custom`,check:`custom`,fn:t=>t instanceof e,abort:!0,...W(t)});return n._zod.bag.Class=e,n}function WS(e){let t=LS(()=>pS([J(e),Y(),Qx(),iS(),X(t),_S(J(),t)]));return t}function GS(e,t){return PS(wS(e),t)}var $,KS,qS,JS,YS,XS,ZS,QS,$S,eC,tC,nC,rC,iC,aC,oC,sC,cC,lC,uC,dC,fC,pC,mC,hC,gC,_C,vC,yC,bC,xC,SC,CC,wC,TC,EC,DC,OC,kC,AC,jC,MC,NC,PC,FC,IC,LC,RC,zC,BC,VC,HC,UC,WC,GC,KC,qC,JC,YC,XC,ZC,QC,$C,ew,tw,nw=t((()=>{Kb(),ix(),mx(),Cx(),$=H(`ZodType`,(e,t)=>(q.init(e,t),e.def=t,Object.defineProperty(e,\"_def\",{value:t}),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),e.clone=(t,n)=>Of(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.parse=(t,n)=>yx(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>xx(e,t,n),e.parseAsync=async(t,n)=>bx(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Sx(e,t,n),e.spa=e.safeParseAsync,e.refine=(t,n)=>e.check(VS(t,n)),e.superRefine=t=>e.check(HS(t)),e.overwrite=t=>e.check(tb(t)),e.optional=()=>TS(e),e.nullable=()=>ES(e),e.nullish=()=>TS(ES(e)),e.nonoptional=t=>AS(e,t),e.array=()=>X(e),e.or=t=>pS([e,t]),e.and=t=>hS(e,t),e.transform=t=>PS(e,wS(t)),e.default=t=>OS(e,t),e.prefault=t=>kS(e,t),e.catch=t=>MS(e,t),e.pipe=t=>PS(e,t),e.readonly=()=>FS(e),e.describe=t=>{let n=e.clone();return Nv.add(n,{description:t}),n},Object.defineProperty(e,\"description\",{get(){return Nv.get(e)?.description},configurable:!0}),e.meta=(...t)=>{if(t.length===0)return Nv.get(e);let n=e.clone();return Nv.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),KS=H(`_ZodString`,(e,t)=>{eh.init(e,t),$.init(e,t);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(qy(...t)),e.includes=(...t)=>e.check(Xy(...t)),e.startsWith=(...t)=>e.check(Zy(...t)),e.endsWith=(...t)=>e.check(Qy(...t)),e.min=(...t)=>e.check(Gy(...t)),e.max=(...t)=>e.check(Wy(...t)),e.length=(...t)=>e.check(Ky(...t)),e.nonempty=(...t)=>e.check(Gy(1,...t)),e.lowercase=t=>e.check(Jy(t)),e.uppercase=t=>e.check(Yy(t)),e.trim=()=>e.check(rb()),e.normalize=(...t)=>e.check(nb(...t)),e.toLowerCase=()=>e.check(ib()),e.toUpperCase=()=>e.check(ab())}),qS=H(`ZodString`,(e,t)=>{eh.init(e,t),KS.init(e,t),e.email=t=>e.check(Lv(YS,t)),e.url=t=>e.check(Uv(QS,t)),e.jwt=t=>e.check(iy(pC,t)),e.emoji=t=>e.check(Wv($S,t)),e.guid=t=>e.check(Rv(XS,t)),e.uuid=t=>e.check(zv(ZS,t)),e.uuidv4=t=>e.check(Bv(ZS,t)),e.uuidv6=t=>e.check(Vv(ZS,t)),e.uuidv7=t=>e.check(Hv(ZS,t)),e.nanoid=t=>e.check(Gv(eC,t)),e.guid=t=>e.check(Rv(XS,t)),e.cuid=t=>e.check(Kv(tC,t)),e.cuid2=t=>e.check(qv(nC,t)),e.ulid=t=>e.check(Jv(rC,t)),e.base64=t=>e.check(ty(uC,t)),e.base64url=t=>e.check(ny(dC,t)),e.xid=t=>e.check(Yv(iC,t)),e.ksuid=t=>e.check(Xv(aC,t)),e.ipv4=t=>e.check(Zv(oC,t)),e.ipv6=t=>e.check(Qv(sC,t)),e.cidrv4=t=>e.check($v(cC,t)),e.cidrv6=t=>e.check(ey(lC,t)),e.e164=t=>e.check(ry(fC,t)),e.datetime=t=>e.check(ox(t)),e.date=t=>e.check(sx(t)),e.time=t=>e.check(cx(t)),e.duration=t=>e.check(lx(t))}),JS=H(`ZodStringFormat`,(e,t)=>{th.init(e,t),KS.init(e,t)}),YS=H(`ZodEmail`,(e,t)=>{ih.init(e,t),JS.init(e,t)}),XS=H(`ZodGUID`,(e,t)=>{nh.init(e,t),JS.init(e,t)}),ZS=H(`ZodUUID`,(e,t)=>{rh.init(e,t),JS.init(e,t)}),QS=H(`ZodURL`,(e,t)=>{ah.init(e,t),JS.init(e,t)}),$S=H(`ZodEmoji`,(e,t)=>{oh.init(e,t),JS.init(e,t)}),eC=H(`ZodNanoID`,(e,t)=>{sh.init(e,t),JS.init(e,t)}),tC=H(`ZodCUID`,(e,t)=>{ch.init(e,t),JS.init(e,t)}),nC=H(`ZodCUID2`,(e,t)=>{lh.init(e,t),JS.init(e,t)}),rC=H(`ZodULID`,(e,t)=>{uh.init(e,t),JS.init(e,t)}),iC=H(`ZodXID`,(e,t)=>{dh.init(e,t),JS.init(e,t)}),aC=H(`ZodKSUID`,(e,t)=>{fh.init(e,t),JS.init(e,t)}),oC=H(`ZodIPv4`,(e,t)=>{_h.init(e,t),JS.init(e,t)}),sC=H(`ZodIPv6`,(e,t)=>{vh.init(e,t),JS.init(e,t)}),cC=H(`ZodCIDRv4`,(e,t)=>{yh.init(e,t),JS.init(e,t)}),lC=H(`ZodCIDRv6`,(e,t)=>{bh.init(e,t),JS.init(e,t)}),uC=H(`ZodBase64`,(e,t)=>{xh.init(e,t),JS.init(e,t)}),dC=H(`ZodBase64URL`,(e,t)=>{Sh.init(e,t),JS.init(e,t)}),fC=H(`ZodE164`,(e,t)=>{Ch.init(e,t),JS.init(e,t)}),pC=H(`ZodJWT`,(e,t)=>{wh.init(e,t),JS.init(e,t)}),mC=H(`ZodCustomStringFormat`,(e,t)=>{Th.init(e,t),JS.init(e,t)}),hC=H(`ZodNumber`,(e,t)=>{Eh.init(e,t),$.init(e,t),e.gt=(t,n)=>e.check(Py(t,n)),e.gte=(t,n)=>e.check(Fy(t,n)),e.min=(t,n)=>e.check(Fy(t,n)),e.lt=(t,n)=>e.check(My(t,n)),e.lte=(t,n)=>e.check(Ny(t,n)),e.max=(t,n)=>e.check(Ny(t,n)),e.int=t=>e.check(qx(t)),e.safe=t=>e.check(qx(t)),e.positive=t=>e.check(Py(0,t)),e.nonnegative=t=>e.check(Fy(0,t)),e.negative=t=>e.check(My(0,t)),e.nonpositive=t=>e.check(Ny(0,t)),e.multipleOf=(t,n)=>e.check(By(t,n)),e.step=(t,n)=>e.check(By(t,n)),e.finite=()=>e;let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null}),gC=H(`ZodNumberFormat`,(e,t)=>{Dh.init(e,t),hC.init(e,t)}),_C=H(`ZodBoolean`,(e,t)=>{Oh.init(e,t),$.init(e,t)}),vC=H(`ZodBigInt`,(e,t)=>{kh.init(e,t),$.init(e,t),e.gte=(t,n)=>e.check(Fy(t,n)),e.min=(t,n)=>e.check(Fy(t,n)),e.gt=(t,n)=>e.check(Py(t,n)),e.gte=(t,n)=>e.check(Fy(t,n)),e.min=(t,n)=>e.check(Fy(t,n)),e.lt=(t,n)=>e.check(My(t,n)),e.lte=(t,n)=>e.check(Ny(t,n)),e.max=(t,n)=>e.check(Ny(t,n)),e.positive=t=>e.check(Py(BigInt(0),t)),e.negative=t=>e.check(My(BigInt(0),t)),e.nonpositive=t=>e.check(Ny(BigInt(0),t)),e.nonnegative=t=>e.check(Fy(BigInt(0),t)),e.multipleOf=(t,n)=>e.check(By(t,n));let n=e._zod.bag;e.minValue=n.minimum??null,e.maxValue=n.maximum??null,e.format=n.format??null}),yC=H(`ZodBigIntFormat`,(e,t)=>{Ah.init(e,t),vC.init(e,t)}),bC=H(`ZodSymbol`,(e,t)=>{jh.init(e,t),$.init(e,t)}),xC=H(`ZodUndefined`,(e,t)=>{Mh.init(e,t),$.init(e,t)}),SC=H(`ZodNull`,(e,t)=>{Nh.init(e,t),$.init(e,t)}),CC=H(`ZodAny`,(e,t)=>{Ph.init(e,t),$.init(e,t)}),wC=H(`ZodUnknown`,(e,t)=>{Fh.init(e,t),$.init(e,t)}),TC=H(`ZodNever`,(e,t)=>{Ih.init(e,t),$.init(e,t)}),EC=H(`ZodVoid`,(e,t)=>{Lh.init(e,t),$.init(e,t)}),DC=H(`ZodDate`,(e,t)=>{Rh.init(e,t),$.init(e,t),e.min=(t,n)=>e.check(Fy(t,n)),e.max=(t,n)=>e.check(Ny(t,n));let n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null}),OC=H(`ZodArray`,(e,t)=>{zh.init(e,t),$.init(e,t),e.element=t.element,e.min=(t,n)=>e.check(Gy(t,n)),e.nonempty=t=>e.check(Gy(1,t)),e.max=(t,n)=>e.check(Wy(t,n)),e.length=(t,n)=>e.check(Ky(t,n)),e.unwrap=()=>e.element}),kC=H(`ZodObject`,(e,t)=>{Bh.init(e,t),$.init(e,t),vf(e,`shape`,()=>t.shape),e.keyof=()=>xS(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:oS()}),e.loose=()=>e.clone({...e._zod.def,catchall:oS()}),e.strict=()=>e.clone({...e._zod.def,catchall:sS()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>Nf(e,t),e.merge=t=>Pf(e,t),e.pick=t=>jf(e,t),e.omit=t=>Mf(e,t),e.partial=(...t)=>Ff(VC,e,t[0]),e.required=(...t)=>If(GC,e,t[0])}),AC=H(`ZodUnion`,(e,t)=>{Vh.init(e,t),$.init(e,t),e.options=t.options}),jC=H(`ZodDiscriminatedUnion`,(e,t)=>{AC.init(e,t),Hh.init(e,t)}),MC=H(`ZodIntersection`,(e,t)=>{Uh.init(e,t),$.init(e,t)}),NC=H(`ZodTuple`,(e,t)=>{Wh.init(e,t),$.init(e,t),e.rest=t=>e.clone({...e._zod.def,rest:t})}),PC=H(`ZodRecord`,(e,t)=>{Gh.init(e,t),$.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType}),FC=H(`ZodMap`,(e,t)=>{Kh.init(e,t),$.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType}),IC=H(`ZodSet`,(e,t)=>{qh.init(e,t),$.init(e,t),e.min=(...t)=>e.check(Hy(...t)),e.nonempty=t=>e.check(Hy(1,t)),e.max=(...t)=>e.check(Vy(...t)),e.size=(...t)=>e.check(Uy(...t))}),LC=H(`ZodEnum`,(e,t)=>{Jh.init(e,t),$.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new LC({...t,checks:[],...W(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new LC({...t,checks:[],...W(r),entries:i})}}),RC=H(`ZodLiteral`,(e,t)=>{Yh.init(e,t),$.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,\"value\",{get(){if(t.values.length>1)throw Error(\"This schema contains multiple valid literal values. Use `.values` instead.\");return t.values[0]}})}),zC=H(`ZodFile`,(e,t)=>{Xh.init(e,t),$.init(e,t),e.min=(t,n)=>e.check(Hy(t,n)),e.max=(t,n)=>e.check(Vy(t,n)),e.mime=(t,n)=>e.check(eb(Array.isArray(t)?t:[t],n))}),BC=H(`ZodTransform`,(e,t)=>{Zh.init(e,t),$.init(e,t),e._zod.parse=(n,r)=>{n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Uf(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,t.continue??=!0,n.issues.push(Uf(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}}),VC=H(`ZodOptional`,(e,t)=>{Qh.init(e,t),$.init(e,t),e.unwrap=()=>e._zod.def.innerType}),HC=H(`ZodNullable`,(e,t)=>{$h.init(e,t),$.init(e,t),e.unwrap=()=>e._zod.def.innerType}),UC=H(`ZodDefault`,(e,t)=>{eg.init(e,t),$.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap}),WC=H(`ZodPrefault`,(e,t)=>{tg.init(e,t),$.init(e,t),e.unwrap=()=>e._zod.def.innerType}),GC=H(`ZodNonOptional`,(e,t)=>{ng.init(e,t),$.init(e,t),e.unwrap=()=>e._zod.def.innerType}),KC=H(`ZodSuccess`,(e,t)=>{rg.init(e,t),$.init(e,t),e.unwrap=()=>e._zod.def.innerType}),qC=H(`ZodCatch`,(e,t)=>{ig.init(e,t),$.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap}),JC=H(`ZodNaN`,(e,t)=>{ag.init(e,t),$.init(e,t)}),YC=H(`ZodPipe`,(e,t)=>{og.init(e,t),$.init(e,t),e.in=t.in,e.out=t.out}),XC=H(`ZodReadonly`,(e,t)=>{sg.init(e,t),$.init(e,t)}),ZC=H(`ZodTemplateLiteral`,(e,t)=>{cg.init(e,t),$.init(e,t)}),QC=H(`ZodLazy`,(e,t)=>{ug.init(e,t),$.init(e,t),e.unwrap=()=>e._zod.def.getter()}),$C=H(`ZodPromise`,(e,t)=>{lg.init(e,t),$.init(e,t),e.unwrap=()=>e._zod.def.innerType}),ew=H(`ZodCustom`,(e,t)=>{dg.init(e,t),$.init(e,t)}),tw=(...e)=>Mb({Pipe:YC,Boolean:_C,String:qS,Transform:BC},...e)}));function rw(e){$d({customError:e})}function iw(){return $d().customError}var aw,ow=t((()=>{Kb(),aw={invalid_type:`invalid_type`,too_big:`too_big`,too_small:`too_small`,invalid_format:`invalid_format`,not_multiple_of:`not_multiple_of`,unrecognized_keys:`unrecognized_keys`,invalid_union:`invalid_union`,invalid_key:`invalid_key`,invalid_element:`invalid_element`,invalid_value:`invalid_value`,custom:`custom`}})),sw=r({bigint:()=>dw,boolean:()=>uw,date:()=>fw,number:()=>lw,string:()=>cw});function cw(e){return Iv(qS,e)}function lw(e){return uy(hC,e)}function uw(e){return _y(_C,e)}function dw(e){return yy(vC,e)}function fw(e){return Ay(DC,e)}var pw=t((()=>{Kb(),nw()})),mw=r({$brand:()=>tf,$input:()=>jv,$output:()=>Av,NEVER:()=>ef,TimePrecision:()=>Pb,ZodAny:()=>CC,ZodArray:()=>OC,ZodBase64:()=>uC,ZodBase64URL:()=>dC,ZodBigInt:()=>vC,ZodBigIntFormat:()=>yC,ZodBoolean:()=>_C,ZodCIDRv4:()=>cC,ZodCIDRv6:()=>lC,ZodCUID:()=>tC,ZodCUID2:()=>nC,ZodCatch:()=>qC,ZodCustom:()=>ew,ZodCustomStringFormat:()=>mC,ZodDate:()=>DC,ZodDefault:()=>UC,ZodDiscriminatedUnion:()=>jC,ZodE164:()=>fC,ZodEmail:()=>YS,ZodEmoji:()=>$S,ZodEnum:()=>LC,ZodError:()=>gx,ZodFile:()=>zC,ZodGUID:()=>XS,ZodIPv4:()=>oC,ZodIPv6:()=>sC,ZodISODate:()=>dx,ZodISODateTime:()=>ux,ZodISODuration:()=>px,ZodISOTime:()=>fx,ZodIntersection:()=>MC,ZodIssueCode:()=>aw,ZodJWT:()=>pC,ZodKSUID:()=>aC,ZodLazy:()=>QC,ZodLiteral:()=>RC,ZodMap:()=>FC,ZodNaN:()=>JC,ZodNanoID:()=>eC,ZodNever:()=>TC,ZodNonOptional:()=>GC,ZodNull:()=>SC,ZodNullable:()=>HC,ZodNumber:()=>hC,ZodNumberFormat:()=>gC,ZodObject:()=>kC,ZodOptional:()=>VC,ZodPipe:()=>YC,ZodPrefault:()=>WC,ZodPromise:()=>$C,ZodReadonly:()=>XC,ZodRealError:()=>_x,ZodRecord:()=>PC,ZodSet:()=>IC,ZodString:()=>qS,ZodStringFormat:()=>JS,ZodSuccess:()=>KC,ZodSymbol:()=>bC,ZodTemplateLiteral:()=>ZC,ZodTransform:()=>BC,ZodTuple:()=>NC,ZodType:()=>$,ZodULID:()=>rC,ZodURL:()=>QS,ZodUUID:()=>ZS,ZodUndefined:()=>xC,ZodUnion:()=>AC,ZodUnknown:()=>wC,ZodVoid:()=>EC,ZodXID:()=>iC,_ZodString:()=>KS,_default:()=>OS,any:()=>aS,array:()=>X,base64:()=>Hx,base64url:()=>Ux,bigint:()=>$x,boolean:()=>Qx,catch:()=>MS,check:()=>zS,cidrv4:()=>Bx,cidrv6:()=>Vx,clone:()=>Of,coerce:()=>sw,config:()=>$d,core:()=>Gb,cuid:()=>Nx,cuid2:()=>Px,custom:()=>BS,date:()=>lS,discriminatedUnion:()=>mS,e164:()=>Wx,email:()=>wx,emoji:()=>jx,endsWith:()=>Qy,enum:()=>xS,file:()=>CS,flattenError:()=>$f,float32:()=>Jx,float64:()=>Yx,formatError:()=>ep,function:()=>Ib,getErrorMap:()=>iw,globalRegistry:()=>Nv,gt:()=>Py,gte:()=>Fy,guid:()=>Tx,includes:()=>Xy,instanceof:()=>US,int:()=>qx,int32:()=>Xx,int64:()=>eS,intersection:()=>hS,ipv4:()=>Rx,ipv6:()=>zx,iso:()=>ax,json:()=>WS,jwt:()=>Gx,keyof:()=>uS,ksuid:()=>Lx,lazy:()=>LS,length:()=>Ky,literal:()=>Q,locales:()=>Dv,looseObject:()=>fS,lowercase:()=>Jy,lt:()=>My,lte:()=>Ny,map:()=>yS,maxLength:()=>Wy,maxSize:()=>Vy,mime:()=>eb,minLength:()=>Gy,minSize:()=>Hy,multipleOf:()=>By,nan:()=>NS,nanoid:()=>Mx,nativeEnum:()=>SS,negative:()=>Ly,never:()=>sS,nonnegative:()=>zy,nonoptional:()=>AS,nonpositive:()=>Ry,normalize:()=>nb,null:()=>iS,nullable:()=>ES,nullish:()=>DS,number:()=>Y,object:()=>Z,optional:()=>TS,overwrite:()=>tb,parse:()=>yx,parseAsync:()=>bx,partialRecord:()=>vS,pipe:()=>PS,positive:()=>Iy,prefault:()=>kS,preprocess:()=>GS,prettifyError:()=>rp,promise:()=>RS,property:()=>$y,readonly:()=>FS,record:()=>_S,refine:()=>VS,regex:()=>qy,regexes:()=>_p,registry:()=>kv,safeParse:()=>xx,safeParseAsync:()=>Sx,set:()=>bS,setErrorMap:()=>rw,size:()=>Uy,startsWith:()=>Zy,strictObject:()=>dS,string:()=>J,stringFormat:()=>Kx,stringbool:()=>tw,success:()=>jS,superRefine:()=>HS,symbol:()=>nS,templateLiteral:()=>IS,toJSONSchema:()=>zb,toLowerCase:()=>ib,toUpperCase:()=>ab,transform:()=>wS,treeifyError:()=>tp,trim:()=>rb,tuple:()=>gS,uint32:()=>Zx,uint64:()=>tS,ulid:()=>Fx,undefined:()=>rS,union:()=>pS,unknown:()=>oS,uppercase:()=>Yy,url:()=>Ax,uuid:()=>Ex,uuidv4:()=>Dx,uuidv6:()=>Ox,uuidv7:()=>kx,void:()=>cS,xid:()=>Ix}),hw=t((()=>{Kb(),nw(),ix(),vx(),Cx(),ow(),Fg(),Ov(),mx(),pw(),$d(Mg())})),gw,_w=t((()=>{hw(),hw(),gw=mw})),vw=r({$brand:()=>tf,$input:()=>jv,$output:()=>Av,NEVER:()=>ef,TimePrecision:()=>Pb,ZodAny:()=>CC,ZodArray:()=>OC,ZodBase64:()=>uC,ZodBase64URL:()=>dC,ZodBigInt:()=>vC,ZodBigIntFormat:()=>yC,ZodBoolean:()=>_C,ZodCIDRv4:()=>cC,ZodCIDRv6:()=>lC,ZodCUID:()=>tC,ZodCUID2:()=>nC,ZodCatch:()=>qC,ZodCustom:()=>ew,ZodCustomStringFormat:()=>mC,ZodDate:()=>DC,ZodDefault:()=>UC,ZodDiscriminatedUnion:()=>jC,ZodE164:()=>fC,ZodEmail:()=>YS,ZodEmoji:()=>$S,ZodEnum:()=>LC,ZodError:()=>gx,ZodFile:()=>zC,ZodGUID:()=>XS,ZodIPv4:()=>oC,ZodIPv6:()=>sC,ZodISODate:()=>dx,ZodISODateTime:()=>ux,ZodISODuration:()=>px,ZodISOTime:()=>fx,ZodIntersection:()=>MC,ZodIssueCode:()=>aw,ZodJWT:()=>pC,ZodKSUID:()=>aC,ZodLazy:()=>QC,ZodLiteral:()=>RC,ZodMap:()=>FC,ZodNaN:()=>JC,ZodNanoID:()=>eC,ZodNever:()=>TC,ZodNonOptional:()=>GC,ZodNull:()=>SC,ZodNullable:()=>HC,ZodNumber:()=>hC,ZodNumberFormat:()=>gC,ZodObject:()=>kC,ZodOptional:()=>VC,ZodPipe:()=>YC,ZodPrefault:()=>WC,ZodPromise:()=>$C,ZodReadonly:()=>XC,ZodRealError:()=>_x,ZodRecord:()=>PC,ZodSet:()=>IC,ZodString:()=>qS,ZodStringFormat:()=>JS,ZodSuccess:()=>KC,ZodSymbol:()=>bC,ZodTemplateLiteral:()=>ZC,ZodTransform:()=>BC,ZodTuple:()=>NC,ZodType:()=>$,ZodULID:()=>rC,ZodURL:()=>QS,ZodUUID:()=>ZS,ZodUndefined:()=>xC,ZodUnion:()=>AC,ZodUnknown:()=>wC,ZodVoid:()=>EC,ZodXID:()=>iC,_ZodString:()=>KS,_default:()=>OS,any:()=>aS,array:()=>X,base64:()=>Hx,base64url:()=>Ux,bigint:()=>$x,boolean:()=>Qx,catch:()=>MS,check:()=>zS,cidrv4:()=>Bx,cidrv6:()=>Vx,clone:()=>Of,coerce:()=>sw,config:()=>$d,core:()=>Gb,cuid:()=>Nx,cuid2:()=>Px,custom:()=>BS,date:()=>lS,default:()=>yw,discriminatedUnion:()=>mS,e164:()=>Wx,email:()=>wx,emoji:()=>jx,endsWith:()=>Qy,enum:()=>xS,file:()=>CS,flattenError:()=>$f,float32:()=>Jx,float64:()=>Yx,formatError:()=>ep,function:()=>Ib,getErrorMap:()=>iw,globalRegistry:()=>Nv,gt:()=>Py,gte:()=>Fy,guid:()=>Tx,includes:()=>Xy,instanceof:()=>US,int:()=>qx,int32:()=>Xx,int64:()=>eS,intersection:()=>hS,ipv4:()=>Rx,ipv6:()=>zx,iso:()=>ax,json:()=>WS,jwt:()=>Gx,keyof:()=>uS,ksuid:()=>Lx,lazy:()=>LS,length:()=>Ky,literal:()=>Q,locales:()=>Dv,looseObject:()=>fS,lowercase:()=>Jy,lt:()=>My,lte:()=>Ny,map:()=>yS,maxLength:()=>Wy,maxSize:()=>Vy,mime:()=>eb,minLength:()=>Gy,minSize:()=>Hy,multipleOf:()=>By,nan:()=>NS,nanoid:()=>Mx,nativeEnum:()=>SS,negative:()=>Ly,never:()=>sS,nonnegative:()=>zy,nonoptional:()=>AS,nonpositive:()=>Ry,normalize:()=>nb,null:()=>iS,nullable:()=>ES,nullish:()=>DS,number:()=>Y,object:()=>Z,optional:()=>TS,overwrite:()=>tb,parse:()=>yx,parseAsync:()=>bx,partialRecord:()=>vS,pipe:()=>PS,positive:()=>Iy,prefault:()=>kS,preprocess:()=>GS,prettifyError:()=>rp,promise:()=>RS,property:()=>$y,readonly:()=>FS,record:()=>_S,refine:()=>VS,regex:()=>qy,regexes:()=>_p,registry:()=>kv,safeParse:()=>xx,safeParseAsync:()=>Sx,set:()=>bS,setErrorMap:()=>rw,size:()=>Uy,startsWith:()=>Zy,strictObject:()=>dS,string:()=>J,stringFormat:()=>Kx,stringbool:()=>tw,success:()=>jS,superRefine:()=>HS,symbol:()=>nS,templateLiteral:()=>IS,toJSONSchema:()=>zb,toLowerCase:()=>ib,toUpperCase:()=>ab,transform:()=>wS,treeifyError:()=>tp,trim:()=>rb,tuple:()=>gS,uint32:()=>Zx,uint64:()=>tS,ulid:()=>Fx,undefined:()=>rS,union:()=>pS,unknown:()=>oS,uppercase:()=>Yy,url:()=>Ax,uuid:()=>Ex,uuidv4:()=>Dx,uuidv6:()=>Ox,uuidv7:()=>kx,void:()=>cS,xid:()=>Ix,z:()=>mw}),yw,bw=t((()=>{_w(),_w(),yw=gw})),xw,Sw,Cw,ww,Tw,Ew,Dw,Ow,kw,Aw,jw,Mw,Nw,Pw,Fw,Iw,Lw,Rw,zw,Bw,Vw,Hw,Uw,Ww,Gw,Kw,qw,Jw,Yw,Xw,Zw,Qw,$w,eT,tT,nT,rT,iT,aT,oT,sT,cT,lT,uT,dT,fT,pT,mT,hT,gT,_T,vT,yT,bT,xT,ST,CT,wT,TT,ET,DT,OT,kT,AT,jT,MT,NT,PT,FT,IT,LT,RT,zT,BT,VT,HT,UT,WT,GT,KT,qT,JT,YT,XT,ZT,QT,$T,eE,tE,nE,rE,iE,aE,oE,sE,cE,lE,uE,dE,fE,pE,mE,hE,gE,_E,vE,yE,bE,xE,SE,CE,wE,TE,EE,DE,OE,kE,AE,jE,ME,NE,PE,FE,IE,LE,RE,zE,BE,VE,HE,UE,WE,GE,KE,qE,JE,YE,XE,ZE,QE,$E,eD,tD,nD,rD,iD,aD,oD,sD,cD,lD,uD,dD,fD,pD,mD=t((()=>{bw(),xw=`io.modelcontextprotocol/related-task`,Sw=BS(e=>e!==null&&(typeof e==`object`||typeof e==`function`)),Cw=pS([J(),Y().int()]),ww=J(),fS({ttl:Y().optional(),pollInterval:Y().optional()}),Tw=Z({ttl:Y().optional()}),Ew=Z({taskId:J()}),Dw=fS({progressToken:Cw.optional(),[xw]:Ew.optional()}),Ow=Z({_meta:Dw.optional()}),kw=Ow.extend({task:Tw.optional()}),Aw=e=>kw.safeParse(e).success,jw=Z({method:J(),params:Ow.loose().optional()}),Mw=Z({_meta:Dw.optional()}),Nw=Z({method:J(),params:Mw.loose().optional()}),Pw=fS({_meta:Dw.optional()}),Fw=pS([J(),Y().int()]),Iw=Z({jsonrpc:Q(`2.0`),id:Fw,...jw.shape}).strict(),Lw=e=>Iw.safeParse(e).success,Rw=Z({jsonrpc:Q(`2.0`),...Nw.shape}).strict(),zw=e=>Rw.safeParse(e).success,Bw=Z({jsonrpc:Q(`2.0`),id:Fw,result:Pw}).strict(),Vw=e=>Bw.safeParse(e).success,(function(e){e[e.ConnectionClosed=-32e3]=`ConnectionClosed`,e[e.RequestTimeout=-32001]=`RequestTimeout`,e[e.ParseError=-32700]=`ParseError`,e[e.InvalidRequest=-32600]=`InvalidRequest`,e[e.MethodNotFound=-32601]=`MethodNotFound`,e[e.InvalidParams=-32602]=`InvalidParams`,e[e.InternalError=-32603]=`InternalError`,e[e.UrlElicitationRequired=-32042]=`UrlElicitationRequired`})(Hw||={}),Uw=Z({jsonrpc:Q(`2.0`),id:Fw.optional(),error:Z({code:Y().int(),message:J(),data:oS().optional()})}).strict(),Ww=e=>Uw.safeParse(e).success,Gw=pS([Iw,Rw,Bw,Uw]),pS([Bw,Uw]),Kw=Pw.strict(),qw=Mw.extend({requestId:Fw.optional(),reason:J().optional()}),Jw=Nw.extend({method:Q(`notifications/cancelled`),params:qw}),Yw=Z({src:J(),mimeType:J().optional(),sizes:X(J()).optional(),theme:xS([`light`,`dark`]).optional()}),Xw=Z({icons:X(Yw).optional()}),Zw=Z({name:J(),title:J().optional()}),Qw=Zw.extend({...Zw.shape,...Xw.shape,version:J(),websiteUrl:J().optional(),description:J().optional()}),$w=hS(Z({applyDefaults:Qx().optional()}),_S(J(),oS())),eT=GS(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,hS(Z({form:$w.optional(),url:Sw.optional()}),_S(J(),oS()).optional())),tT=fS({list:Sw.optional(),cancel:Sw.optional(),requests:fS({sampling:fS({createMessage:Sw.optional()}).optional(),elicitation:fS({create:Sw.optional()}).optional()}).optional()}),nT=fS({list:Sw.optional(),cancel:Sw.optional(),requests:fS({tools:fS({call:Sw.optional()}).optional()}).optional()}),rT=Z({experimental:_S(J(),Sw).optional(),sampling:Z({context:Sw.optional(),tools:Sw.optional()}).optional(),elicitation:eT.optional(),roots:Z({listChanged:Qx().optional()}).optional(),tasks:tT.optional(),extensions:_S(J(),Sw).optional()}),iT=Ow.extend({protocolVersion:J(),capabilities:rT,clientInfo:Qw}),aT=jw.extend({method:Q(`initialize`),params:iT}),oT=Z({experimental:_S(J(),Sw).optional(),logging:Sw.optional(),completions:Sw.optional(),prompts:Z({listChanged:Qx().optional()}).optional(),resources:Z({subscribe:Qx().optional(),listChanged:Qx().optional()}).optional(),tools:Z({listChanged:Qx().optional()}).optional(),tasks:nT.optional(),extensions:_S(J(),Sw).optional()}),sT=Pw.extend({protocolVersion:J(),capabilities:oT,serverInfo:Qw,instructions:J().optional()}),cT=Nw.extend({method:Q(`notifications/initialized`),params:Mw.optional()}),lT=jw.extend({method:Q(`ping`),params:Ow.optional()}),uT=Z({progress:Y(),total:TS(Y()),message:TS(J())}),dT=Z({...Mw.shape,...uT.shape,progressToken:Cw}),fT=Nw.extend({method:Q(`notifications/progress`),params:dT}),pT=Ow.extend({cursor:ww.optional()}),mT=jw.extend({params:pT.optional()}),hT=Pw.extend({nextCursor:ww.optional()}),gT=xS([`working`,`input_required`,`completed`,`failed`,`cancelled`]),_T=Z({taskId:J(),status:gT,ttl:pS([Y(),iS()]),createdAt:J(),lastUpdatedAt:J(),pollInterval:TS(Y()),statusMessage:TS(J())}),vT=Pw.extend({task:_T}),yT=Mw.merge(_T),bT=Nw.extend({method:Q(`notifications/tasks/status`),params:yT}),xT=jw.extend({method:Q(`tasks/get`),params:Ow.extend({taskId:J()})}),ST=Pw.merge(_T),CT=jw.extend({method:Q(`tasks/result`),params:Ow.extend({taskId:J()})}),Pw.loose(),wT=mT.extend({method:Q(`tasks/list`)}),TT=hT.extend({tasks:X(_T)}),ET=jw.extend({method:Q(`tasks/cancel`),params:Ow.extend({taskId:J()})}),DT=Pw.merge(_T),OT=Z({uri:J(),mimeType:TS(J()),_meta:_S(J(),oS()).optional()}),kT=OT.extend({text:J()}),AT=J().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),jT=OT.extend({blob:AT}),MT=xS([`user`,`assistant`]),NT=Z({audience:X(MT).optional(),priority:Y().min(0).max(1).optional(),lastModified:ox({offset:!0}).optional()}),PT=Z({...Zw.shape,...Xw.shape,uri:J(),description:TS(J()),mimeType:TS(J()),size:TS(Y()),annotations:NT.optional(),_meta:TS(fS({}))}),FT=Z({...Zw.shape,...Xw.shape,uriTemplate:J(),description:TS(J()),mimeType:TS(J()),annotations:NT.optional(),_meta:TS(fS({}))}),IT=mT.extend({method:Q(`resources/list`)}),LT=hT.extend({resources:X(PT)}),RT=mT.extend({method:Q(`resources/templates/list`)}),zT=hT.extend({resourceTemplates:X(FT)}),BT=Ow.extend({uri:J()}),VT=BT,HT=jw.extend({method:Q(`resources/read`),params:VT}),UT=Pw.extend({contents:X(pS([kT,jT]))}),WT=Nw.extend({method:Q(`notifications/resources/list_changed`),params:Mw.optional()}),GT=BT,KT=jw.extend({method:Q(`resources/subscribe`),params:GT}),qT=BT,JT=jw.extend({method:Q(`resources/unsubscribe`),params:qT}),YT=Mw.extend({uri:J()}),XT=Nw.extend({method:Q(`notifications/resources/updated`),params:YT}),ZT=Z({name:J(),description:TS(J()),required:TS(Qx())}),QT=Z({...Zw.shape,...Xw.shape,description:TS(J()),arguments:TS(X(ZT)),_meta:TS(fS({}))}),$T=mT.extend({method:Q(`prompts/list`)}),eE=hT.extend({prompts:X(QT)}),tE=Ow.extend({name:J(),arguments:_S(J(),J()).optional()}),nE=jw.extend({method:Q(`prompts/get`),params:tE}),rE=Z({type:Q(`text`),text:J(),annotations:NT.optional(),_meta:_S(J(),oS()).optional()}),iE=Z({type:Q(`image`),data:AT,mimeType:J(),annotations:NT.optional(),_meta:_S(J(),oS()).optional()}),aE=Z({type:Q(`audio`),data:AT,mimeType:J(),annotations:NT.optional(),_meta:_S(J(),oS()).optional()}),oE=Z({type:Q(`tool_use`),name:J(),id:J(),input:_S(J(),oS()),_meta:_S(J(),oS()).optional()}),sE=Z({type:Q(`resource`),resource:pS([kT,jT]),annotations:NT.optional(),_meta:_S(J(),oS()).optional()}),cE=PT.extend({type:Q(`resource_link`)}),lE=pS([rE,iE,aE,cE,sE]),uE=Z({role:MT,content:lE}),dE=Pw.extend({description:J().optional(),messages:X(uE)}),fE=Nw.extend({method:Q(`notifications/prompts/list_changed`),params:Mw.optional()}),pE=Z({title:J().optional(),readOnlyHint:Qx().optional(),destructiveHint:Qx().optional(),idempotentHint:Qx().optional(),openWorldHint:Qx().optional()}),mE=Z({taskSupport:xS([`required`,`optional`,`forbidden`]).optional()}),hE=Z({...Zw.shape,...Xw.shape,description:J().optional(),inputSchema:Z({type:Q(`object`),properties:_S(J(),Sw).optional(),required:X(J()).optional()}).catchall(oS()),outputSchema:Z({type:Q(`object`),properties:_S(J(),Sw).optional(),required:X(J()).optional()}).catchall(oS()).optional(),annotations:pE.optional(),execution:mE.optional(),_meta:_S(J(),oS()).optional()}),gE=mT.extend({method:Q(`tools/list`)}),_E=hT.extend({tools:X(hE)}),vE=Pw.extend({content:X(lE).default([]),structuredContent:_S(J(),oS()).optional(),isError:Qx().optional()}),vE.or(Pw.extend({toolResult:oS()})),yE=kw.extend({name:J(),arguments:_S(J(),oS()).optional()}),bE=jw.extend({method:Q(`tools/call`),params:yE}),xE=Nw.extend({method:Q(`notifications/tools/list_changed`),params:Mw.optional()}),Z({autoRefresh:Qx().default(!0),debounceMs:Y().int().nonnegative().default(300)}),SE=xS([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),CE=Ow.extend({level:SE}),wE=jw.extend({method:Q(`logging/setLevel`),params:CE}),TE=Mw.extend({level:SE,logger:J().optional(),data:oS()}),EE=Nw.extend({method:Q(`notifications/message`),params:TE}),DE=Z({name:J().optional()}),OE=Z({hints:X(DE).optional(),costPriority:Y().min(0).max(1).optional(),speedPriority:Y().min(0).max(1).optional(),intelligencePriority:Y().min(0).max(1).optional()}),kE=Z({mode:xS([`auto`,`required`,`none`]).optional()}),AE=Z({type:Q(`tool_result`),toolUseId:J().describe(`The unique identifier for the corresponding tool call.`),content:X(lE).default([]),structuredContent:Z({}).loose().optional(),isError:Qx().optional(),_meta:_S(J(),oS()).optional()}),jE=mS(`type`,[rE,iE,aE]),ME=mS(`type`,[rE,iE,aE,oE,AE]),NE=Z({role:MT,content:pS([ME,X(ME)]),_meta:_S(J(),oS()).optional()}),PE=kw.extend({messages:X(NE),modelPreferences:OE.optional(),systemPrompt:J().optional(),includeContext:xS([`none`,`thisServer`,`allServers`]).optional(),temperature:Y().optional(),maxTokens:Y().int(),stopSequences:X(J()).optional(),metadata:Sw.optional(),tools:X(hE).optional(),toolChoice:kE.optional()}),FE=jw.extend({method:Q(`sampling/createMessage`),params:PE}),IE=Pw.extend({model:J(),stopReason:TS(xS([`endTurn`,`stopSequence`,`maxTokens`]).or(J())),role:MT,content:jE}),LE=Pw.extend({model:J(),stopReason:TS(xS([`endTurn`,`stopSequence`,`maxTokens`,`toolUse`]).or(J())),role:MT,content:pS([ME,X(ME)])}),RE=Z({type:Q(`boolean`),title:J().optional(),description:J().optional(),default:Qx().optional()}),zE=Z({type:Q(`string`),title:J().optional(),description:J().optional(),minLength:Y().optional(),maxLength:Y().optional(),format:xS([`email`,`uri`,`date`,`date-time`]).optional(),default:J().optional()}),BE=Z({type:xS([`number`,`integer`]),title:J().optional(),description:J().optional(),minimum:Y().optional(),maximum:Y().optional(),default:Y().optional()}),VE=Z({type:Q(`string`),title:J().optional(),description:J().optional(),enum:X(J()),default:J().optional()}),HE=Z({type:Q(`string`),title:J().optional(),description:J().optional(),oneOf:X(Z({const:J(),title:J()})),default:J().optional()}),UE=Z({type:Q(`string`),title:J().optional(),description:J().optional(),enum:X(J()),enumNames:X(J()).optional(),default:J().optional()}),WE=pS([VE,HE]),GE=Z({type:Q(`array`),title:J().optional(),description:J().optional(),minItems:Y().optional(),maxItems:Y().optional(),items:Z({type:Q(`string`),enum:X(J())}),default:X(J()).optional()}),KE=Z({type:Q(`array`),title:J().optional(),description:J().optional(),minItems:Y().optional(),maxItems:Y().optional(),items:Z({anyOf:X(Z({const:J(),title:J()}))}),default:X(J()).optional()}),qE=pS([GE,KE]),JE=pS([UE,WE,qE]),YE=pS([JE,RE,zE,BE]),XE=kw.extend({mode:Q(`form`).optional(),message:J(),requestedSchema:Z({type:Q(`object`),properties:_S(J(),YE),required:X(J()).optional()})}),ZE=kw.extend({mode:Q(`url`),message:J(),elicitationId:J(),url:J().url()}),QE=pS([XE,ZE]),$E=jw.extend({method:Q(`elicitation/create`),params:QE}),eD=Mw.extend({elicitationId:J()}),tD=Nw.extend({method:Q(`notifications/elicitation/complete`),params:eD}),nD=Pw.extend({action:xS([`accept`,`decline`,`cancel`]),content:GS(e=>e===null?void 0:e,_S(J(),pS([J(),Y(),Qx(),X(J())])).optional())}),rD=Z({type:Q(`ref/resource`),uri:J()}),iD=Z({type:Q(`ref/prompt`),name:J()}),aD=Ow.extend({ref:pS([iD,rD]),argument:Z({name:J(),value:J()}),context:Z({arguments:_S(J(),J()).optional()}).optional()}),oD=jw.extend({method:Q(`completion/complete`),params:aD}),sD=Pw.extend({completion:fS({values:X(J()).max(100),total:TS(Y().int()),hasMore:TS(Qx())})}),cD=Z({uri:J().startsWith(`file://`),name:J().optional(),_meta:_S(J(),oS()).optional()}),lD=jw.extend({method:Q(`roots/list`),params:Ow.optional()}),uD=Pw.extend({roots:X(cD)}),dD=Nw.extend({method:Q(`notifications/roots/list_changed`),params:Mw.optional()}),pS([lT,aT,oD,wE,nE,$T,IT,RT,HT,KT,JT,bE,gE,xT,CT,wT,ET]),pS([Jw,fT,cT,dD,bT]),pS([Kw,IE,LE,nD,uD,ST,TT,vT]),pS([lT,FE,$E,lD,xT,CT,wT,ET]),pS([Jw,fT,EE,XT,WT,xE,fE,bT,tD]),pS([Kw,sT,sD,dE,eE,LT,zT,UT,vE,_E,ST,TT,vT]),fD=class e extends Error{constructor(e,t,n){super(`MCP error ${e}: ${t}`),this.code=e,this.data=n,this.name=`McpError`}static fromError(t,n,r){if(t===Hw.UrlElicitationRequired&&r){let e=r;if(e.elicitations)return new pD(e.elicitations,n)}return new e(t,n,r)}},pD=class extends fD{constructor(e,t=`URL elicitation${e.length>1?`s`:``} required`){super(Hw.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}}}));function hD(e){return e===`completed`||e===`failed`||e===`cancelled`}var gD=t((()=>{})),_D=t((()=>{})),vD=t((()=>{})),yD=t((()=>{})),bD=t((()=>{})),xD=t((()=>{})),SD=t((()=>{})),CD=t((()=>{})),wD=t((()=>{})),TD=t((()=>{})),ED=t((()=>{})),DD=t((()=>{})),OD=t((()=>{})),kD=t((()=>{})),AD=t((()=>{})),jD=t((()=>{})),MD=t((()=>{})),ND=t((()=>{})),PD=t((()=>{})),FD=t((()=>{})),ID=t((()=>{})),LD=t((()=>{})),RD=t((()=>{})),zD=t((()=>{})),BD=t((()=>{})),VD=t((()=>{})),HD=t((()=>{})),UD=t((()=>{})),WD=t((()=>{})),GD=t((()=>{})),KD=t((()=>{})),qD=t((()=>{})),JD=t((()=>{})),YD=t((()=>{})),XD=t((()=>{})),ZD=t((()=>{})),QD=t((()=>{})),$D=t((()=>{})),eO=t((()=>{})),tO=t((()=>{_D(),vD(),yD(),bD(),QD(),$D(),xD(),SD(),CD(),wD(),TD(),ED(),DD(),OD(),kD(),AD(),jD(),MD(),FD(),ID(),LD(),RD(),BD(),VD(),HD(),UD(),WD(),GD(),XD(),PD(),KD(),ND(),qD(),JD(),zD(),YD(),ZD(),eO()}));function nO(e){let t=tx(e)?.method;if(!t)throw Error(`Schema is missing a method literal`);let n=nx(t);if(typeof n!=`string`)throw Error(`Schema method literal must be a string`);return n}function rO(e,t){let n=ex(e,t);if(!n.success)throw n.error;return n.data}var iO=t((()=>{rx(),tO()}));function aO(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function oO(e,t){let n={...e};for(let e in t){let r=e,i=t[r];if(i===void 0)continue;let a=n[r];n[r]=aO(a)&&aO(i)?{...a,...i}:i}return n}var sO,cO=t((()=>{rx(),mD(),gD(),iO(),sO=class{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(Jw,e=>{this._oncancel(e)}),this.setNotificationHandler(fT,e=>{this._onprogress(e)}),this.setRequestHandler(lT,e=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(xT,async(e,t)=>{let n=await this._taskStore.getTask(e.params.taskId,t.sessionId);if(!n)throw new fD(Hw.InvalidParams,`Failed to retrieve task: Task not found`);return{...n}}),this.setRequestHandler(CT,async(e,t)=>{let n=async()=>{let r=e.params.taskId;if(this._taskMessageQueue){let e;for(;e=await this._taskMessageQueue.dequeue(r,t.sessionId);){if(e.type===`response`||e.type===`error`){let t=e.message,n=t.id,r=this._requestResolvers.get(n);if(r){if(this._requestResolvers.delete(n),e.type===`response`)r(t);else{let e=t;r(new fD(e.error.code,e.error.message,e.error.data))}}else{let t=e.type===`response`?`Response`:`Error`;this._onerror(Error(`${t} handler missing for request ${n}`))}continue}await this._transport?.send(e.message,{relatedRequestId:t.requestId})}}let i=await this._taskStore.getTask(r,t.sessionId);if(!i)throw new fD(Hw.InvalidParams,`Task not found: ${r}`);if(!hD(i.status))return await this._waitForTaskUpdate(r,t.signal),await n();if(hD(i.status)){let e=await this._taskStore.getTaskResult(r,t.sessionId);return this._clearTaskQueue(r),{...e,_meta:{...e._meta,[xw]:{taskId:r}}}}return await n()};return await n()}),this.setRequestHandler(wT,async(e,t)=>{try{let{tasks:n,nextCursor:r}=await this._taskStore.listTasks(e.params?.cursor,t.sessionId);return{tasks:n,nextCursor:r,_meta:{}}}catch(e){throw new fD(Hw.InvalidParams,`Failed to list tasks: ${e instanceof Error?e.message:String(e)}`)}}),this.setRequestHandler(ET,async(e,t)=>{try{let n=await this._taskStore.getTask(e.params.taskId,t.sessionId);if(!n)throw new fD(Hw.InvalidParams,`Task not found: ${e.params.taskId}`);if(hD(n.status))throw new fD(Hw.InvalidParams,`Cannot cancel task in terminal status: ${n.status}`);await this._taskStore.updateTaskStatus(e.params.taskId,`cancelled`,`Client cancelled task execution.`,t.sessionId),this._clearTaskQueue(e.params.taskId);let r=await this._taskStore.getTask(e.params.taskId,t.sessionId);if(!r)throw new fD(Hw.InvalidParams,`Task not found after cancellation: ${e.params.taskId}`);return{_meta:{},...r}}catch(e){throw e instanceof fD?e:new fD(Hw.InvalidRequest,`Failed to cancel task: ${e instanceof Error?e.message:String(e)}`)}}))}async _oncancel(e){e.params.requestId&&this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,n,r,i=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,t),startTime:Date.now(),timeout:t,maxTotalTimeout:n,resetTimeoutOnProgress:i,onTimeout:r})}_resetTimeout(e){let t=this._timeoutInfo.get(e);if(!t)return!1;let n=Date.now()-t.startTime;if(t.maxTotalTimeout&&n>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),fD.fromError(Hw.RequestTimeout,`Maximum total timeout exceeded`,{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:n});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){let t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw Error(`Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.`);this._transport=e;let t=this.transport?.onclose;this._transport.onclose=()=>{t?.(),this._onclose()};let n=this.transport?.onerror;this._transport.onerror=e=>{n?.(e),this._onerror(e)};let r=this._transport?.onmessage;this._transport.onmessage=(e,t)=>{r?.(e,t),Vw(e)||Ww(e)?this._onresponse(e):Lw(e)?this._onrequest(e,t):zw(e)?this._onnotification(e):this._onerror(Error(`Unknown message type: ${JSON.stringify(e)}`))},await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let e of this._timeoutInfo.values())clearTimeout(e.timeoutId);this._timeoutInfo.clear();for(let e of this._requestHandlerAbortControllers.values())e.abort();this._requestHandlerAbortControllers.clear();let t=fD.fromError(Hw.ConnectionClosed,`Connection closed`);this._transport=void 0,this.onclose?.();for(let n of e.values())n(t)}_onerror(e){this.onerror?.(e)}_onnotification(e){let t=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;t!==void 0&&Promise.resolve().then(()=>t(e)).catch(e=>this._onerror(Error(`Uncaught error in notification handler: ${e}`)))}_onrequest(e,t){let n=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,r=this._transport,i=e.params?._meta?.[xw]?.taskId;if(n===void 0){let t={jsonrpc:`2.0`,id:e.id,error:{code:Hw.MethodNotFound,message:`Method not found`}};i&&this._taskMessageQueue?this._enqueueTaskMessage(i,{type:`error`,message:t,timestamp:Date.now()},r?.sessionId).catch(e=>this._onerror(Error(`Failed to enqueue error response: ${e}`))):r?.send(t).catch(e=>this._onerror(Error(`Failed to send an error response: ${e}`)));return}let a=new AbortController;this._requestHandlerAbortControllers.set(e.id,a);let o=Aw(e.params)?e.params.task:void 0,s=this._taskStore?this.requestTaskStore(e,r?.sessionId):void 0,c={signal:a.signal,sessionId:r?.sessionId,_meta:e.params?._meta,sendNotification:async t=>{if(a.signal.aborted)return;let n={relatedRequestId:e.id};i&&(n.relatedTask={taskId:i}),await this.notification(t,n)},sendRequest:async(t,n,r)=>{if(a.signal.aborted)throw new fD(Hw.ConnectionClosed,`Request was cancelled`);let o={...r,relatedRequestId:e.id};i&&!o.relatedTask&&(o.relatedTask={taskId:i});let c=o.relatedTask?.taskId??i;return c&&s&&await s.updateTaskStatus(c,`input_required`),await this.request(t,n,o)},authInfo:t?.authInfo,requestId:e.id,requestInfo:t?.requestInfo,taskId:i,taskStore:s,taskRequestedTtl:o?.ttl,closeSSEStream:t?.closeSSEStream,closeStandaloneSSEStream:t?.closeStandaloneSSEStream};Promise.resolve().then(()=>{o&&this.assertTaskHandlerCapability(e.method)}).then(()=>n(e,c)).then(async t=>{if(a.signal.aborted)return;let n={result:t,jsonrpc:`2.0`,id:e.id};i&&this._taskMessageQueue?await this._enqueueTaskMessage(i,{type:`response`,message:n,timestamp:Date.now()},r?.sessionId):await r?.send(n)},async t=>{if(a.signal.aborted)return;let n={jsonrpc:`2.0`,id:e.id,error:{code:Number.isSafeInteger(t.code)?t.code:Hw.InternalError,message:t.message??`Internal error`,...t.data!==void 0&&{data:t.data}}};i&&this._taskMessageQueue?await this._enqueueTaskMessage(i,{type:`error`,message:n,timestamp:Date.now()},r?.sessionId):await r?.send(n)}).catch(e=>this._onerror(Error(`Failed to send response: ${e}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===a&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){let{progressToken:t,...n}=e.params,r=Number(t),i=this._progressHandlers.get(r);if(!i){this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let a=this._responseHandlers.get(r),o=this._timeoutInfo.get(r);if(o&&a&&o.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(e){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),a(e);return}i(n)}_onresponse(e){let t=Number(e.id),n=this._requestResolvers.get(t);if(n){this._requestResolvers.delete(t),Vw(e)?n(e):n(new fD(e.error.code,e.error.message,e.error.data));return}let r=this._responseHandlers.get(t);if(r===void 0){this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t);let i=!1;if(Vw(e)&&e.result&&typeof e.result==`object`){let n=e.result;if(n.task&&typeof n.task==`object`){let e=n.task;typeof e.taskId==`string`&&(i=!0,this._taskProgressTokens.set(e.taskId,t))}}i||this._progressHandlers.delete(t),Vw(e)?r(e):r(fD.fromError(e.error.code,e.error.message,e.error.data))}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,t,n){let{task:r}=n??{};if(!r){try{yield{type:`result`,result:await this.request(e,t,n)}}catch(e){yield{type:`error`,error:e instanceof fD?e:new fD(Hw.InternalError,String(e))}}return}let i;try{let r=await this.request(e,vT,n);if(r.task)i=r.task.taskId,yield{type:`taskCreated`,task:r.task};else throw new fD(Hw.InternalError,`Task creation did not return a task`);for(;;){let e=await this.getTask({taskId:i},n);if(yield{type:`taskStatus`,task:e},hD(e.status)){e.status===`completed`?yield{type:`result`,result:await this.getTaskResult({taskId:i},t,n)}:e.status===`failed`?yield{type:`error`,error:new fD(Hw.InternalError,`Task ${i} failed`)}:e.status===`cancelled`&&(yield{type:`error`,error:new fD(Hw.InternalError,`Task ${i} was cancelled`)});return}if(e.status===`input_required`){yield{type:`result`,result:await this.getTaskResult({taskId:i},t,n)};return}let r=e.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(e=>setTimeout(e,r)),n?.signal?.throwIfAborted()}}catch(e){yield{type:`error`,error:e instanceof fD?e:new fD(Hw.InternalError,String(e))}}}request(e,t,n){let{relatedRequestId:r,resumptionToken:i,onresumptiontoken:a,task:o,relatedTask:s}=n??{};return new Promise((c,l)=>{let u=e=>{l(e)};if(!this._transport){u(Error(`Not connected`));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),o&&this.assertTaskCapability(e.method)}catch(e){u(e);return}n?.signal?.throwIfAborted();let d=this._requestMessageId++,f={...e,jsonrpc:`2.0`,id:d};n?.onprogress&&(this._progressHandlers.set(d,n.onprogress),f.params={...e.params,_meta:{...e.params?._meta||{},progressToken:d}}),o&&(f.params={...f.params,task:o}),s&&(f.params={...f.params,_meta:{...f.params?._meta||{},[xw]:s}});let p=e=>{this._responseHandlers.delete(d),this._progressHandlers.delete(d),this._cleanupTimeout(d),this._transport?.send({jsonrpc:`2.0`,method:`notifications/cancelled`,params:{requestId:d,reason:String(e)}},{relatedRequestId:r,resumptionToken:i,onresumptiontoken:a}).catch(e=>this._onerror(Error(`Failed to send cancellation: ${e}`))),l(e instanceof fD?e:new fD(Hw.RequestTimeout,String(e)))};this._responseHandlers.set(d,e=>{if(!n?.signal?.aborted){if(e instanceof Error)return l(e);try{let n=ex(t,e.result);n.success?c(n.data):l(n.error)}catch(e){l(e)}}}),n?.signal?.addEventListener(`abort`,()=>{p(n?.signal?.reason)});let m=n?.timeout??6e4;this._setupTimeout(d,m,n?.maxTotalTimeout,()=>p(fD.fromError(Hw.RequestTimeout,`Request timed out`,{timeout:m})),n?.resetTimeoutOnProgress??!1);let h=s?.taskId;h?(this._requestResolvers.set(d,e=>{let t=this._responseHandlers.get(d);t?t(e):this._onerror(Error(`Response handler missing for side-channeled request ${d}`))}),this._enqueueTaskMessage(h,{type:`request`,message:f,timestamp:Date.now()}).catch(e=>{this._cleanupTimeout(d),l(e)})):this._transport.send(f,{relatedRequestId:r,resumptionToken:i,onresumptiontoken:a}).catch(e=>{this._cleanupTimeout(d),l(e)})})}async getTask(e,t){return this.request({method:`tasks/get`,params:e},ST,t)}async getTaskResult(e,t,n){return this.request({method:`tasks/result`,params:e},t,n)}async listTasks(e,t){return this.request({method:`tasks/list`,params:e},TT,t)}async cancelTask(e,t){return this.request({method:`tasks/cancel`,params:e},DT,t)}async notification(e,t){if(!this._transport)throw Error(`Not connected`);this.assertNotificationCapability(e.method);let n=t?.relatedTask?.taskId;if(n){let r={...e,jsonrpc:`2.0`,params:{...e.params,_meta:{...e.params?._meta||{},[xw]:t.relatedTask}}};await this._enqueueTaskMessage(n,{type:`notification`,message:r,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!t?.relatedRequestId&&!t?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let n={...e,jsonrpc:`2.0`};t?.relatedTask&&(n={...n,params:{...n.params,_meta:{...n.params?._meta||{},[xw]:t.relatedTask}}}),this._transport?.send(n,t).catch(e=>this._onerror(e))});return}let r={...e,jsonrpc:`2.0`};t?.relatedTask&&(r={...r,params:{...r.params,_meta:{...r.params?._meta||{},[xw]:t.relatedTask}}}),await this._transport.send(r,t)}setRequestHandler(e,t){let n=nO(e);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(n,r)=>{let i=rO(e,n);return Promise.resolve(t(i,r))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t){let n=nO(e);this._notificationHandlers.set(n,n=>{let r=rO(e,n);return Promise.resolve(t(r))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){let t=this._taskProgressTokens.get(e);t!==void 0&&(this._progressHandlers.delete(t),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,t,n){if(!this._taskStore||!this._taskMessageQueue)throw Error(`Cannot enqueue task message: taskStore and taskMessageQueue are not configured`);let r=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,t,n,r)}async _clearTaskQueue(e,t){if(this._taskMessageQueue){let n=await this._taskMessageQueue.dequeueAll(e,t);for(let t of n)if(t.type===`request`&&Lw(t.message)){let n=t.message.id,r=this._requestResolvers.get(n);r?(r(new fD(Hw.InternalError,`Task cancelled or completed`)),this._requestResolvers.delete(n)):this._onerror(Error(`Resolver missing for request ${n} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,t){let n=this._options?.defaultTaskPollInterval??1e3;try{let t=await this._taskStore?.getTask(e);t?.pollInterval&&(n=t.pollInterval)}catch{}return new Promise((e,r)=>{if(t.aborted){r(new fD(Hw.InvalidRequest,`Request cancelled`));return}let i=setTimeout(e,n);t.addEventListener(`abort`,()=>{clearTimeout(i),r(new fD(Hw.InvalidRequest,`Request cancelled`))},{once:!0})})}requestTaskStore(e,t){let n=this._taskStore;if(!n)throw Error(`No task store configured`);return{createTask:async r=>{if(!e)throw Error(`No request provided`);return await n.createTask(r,e.id,{method:e.method,params:e.params},t)},getTask:async e=>{let r=await n.getTask(e,t);if(!r)throw new fD(Hw.InvalidParams,`Failed to retrieve task: Task not found`);return r},storeTaskResult:async(e,r,i)=>{await n.storeTaskResult(e,r,i,t);let a=await n.getTask(e,t);if(a){let t=bT.parse({method:`notifications/tasks/status`,params:a});await this.notification(t),hD(a.status)&&this._cleanupTaskProgressHandler(e)}},getTaskResult:e=>n.getTaskResult(e,t),updateTaskStatus:async(e,r,i)=>{let a=await n.getTask(e,t);if(!a)throw new fD(Hw.InvalidParams,`Task \"${e}\" not found - it may have been cleaned up`);if(hD(a.status))throw new fD(Hw.InvalidParams,`Cannot update task \"${e}\" from terminal status \"${a.status}\" to \"${r}\". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await n.updateTaskStatus(e,r,i,t);let o=await n.getTask(e,t);if(o){let t=bT.parse({method:`notifications/tasks/status`,params:o});await this.notification(t),hD(o.status)&&this._cleanupTaskProgressHandler(e)}},listTasks:e=>n.listTasks(e,t)}}}})),lO,uO,dO,fO,pO=t((()=>{lO=`modulepreload`,uO=function(e,t){return new URL(e,t).href},dO={},fO=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=uO(t,n),t=s(t),t in dO)return;dO[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:lO,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})}}));async function mO(e,t){let n=e[`~standard`];if(n.jsonSchema)return n.jsonSchema[t](GO);if(n.vendor===`zod`){let{z:n}=await fO(async()=>{let{z:e}=await Promise.resolve().then(()=>(bw(),vw));return{z:e}},void 0,import.meta.url);return n.toJSONSchema(e,{io:t})}throw Error(`Schema (vendor: ${n.vendor}) does not implement Standard JSON Schema (~standard.jsonSchema). Use a library that does (zod v4, ArkType, Valibot) or wrap your schema accordingly.`)}async function hO(e,t,n=``){let r=await e[`~standard`].validate(t);if(r.issues){let e=r.issues.map(e=>{let t=e.path?.map(e=>typeof e==`object`?e.key:e).join(`.`);return t?`${t}: ${e.message}`:e.message}).join(`; `);throw Error(n+e)}return r.value}function gO(e){let t=document.documentElement;t.setAttribute(`data-theme`,e),t.style.colorScheme=e}function _O(e,t=document.documentElement){for(let[n,r]of Object.entries(e))r!==void 0&&t.style.setProperty(n,r)}var vO,yO,bO,xO,SO,CO,wO,TO,EO,DO,OO,kO,AO,jO,MO,NO,PO,FO,IO,LO,RO,zO,BO,VO,HO,UO,WO,GO,KO,qO=t((()=>{cO(),mD(),bw(),pO(),(e=>typeof i<`u`?i:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof i<`u`?i:e)[t]}):e)(function(e){if(typeof i<`u`)return i.apply(this,arguments);throw Error(`Dynamic require of \"`+e+`\" is not supported`)}),vO=class extends sO{_registeredMethods=new Set;_eventSlots=new Map;onEventDispatch(e,t){}_ensureEventSlot(e){let t=this._eventSlots.get(e);if(!t){let n=this.eventSchemas[e];if(!n)throw Error(`Unknown event: ${String(e)}`);t={listeners:[]},this._eventSlots.set(e,t);let r=n.shape.method.value;this._registeredMethods.add(r);let i=t;super.setNotificationHandler(n,t=>{let n=t.params;this.onEventDispatch(e,n),i.onHandler?.(n);for(let e of[...i.listeners])e(n)})}return t}setEventHandler(e,t){let n=this._ensureEventSlot(e);n.onHandler&&t&&console.warn(`[MCP Apps] on${String(e)} handler replaced. Use addEventListener(\"${String(e)}\", …) to add multiple listeners without replacing.`),n.onHandler=t}getEventHandler(e){return this._eventSlots.get(e)?.onHandler}addEventListener(e,t){this._ensureEventSlot(e).listeners.push(t)}removeEventListener(e,t){let n=this._eventSlots.get(e);if(!n)return;let r=n.listeners.indexOf(t);r!==-1&&n.listeners.splice(r,1)}setRequestHandler=(e,t)=>{this._assertMethodNotRegistered(e,`setRequestHandler`),super.setRequestHandler(e,t)};setNotificationHandler=(e,t)=>{this._assertMethodNotRegistered(e,`setNotificationHandler`),super.setNotificationHandler(e,t)};warnIfRequestHandlerReplaced(e,t,n){t&&n&&console.warn(`[MCP Apps] ${e} handler replaced. Previous handler will no longer be called.`)}replaceRequestHandler=(e,t)=>{let n=e.shape.method.value;this._registeredMethods.add(n),super.setRequestHandler(e,t)};_assertMethodNotRegistered(e,t){let n=e.shape.method.value;if(this._registeredMethods.has(n))throw Error(`Handler for \"${n}\" already registered (via ${t}). Use addEventListener() to attach multiple listeners, or the on* setter for replace semantics.`);this._registeredMethods.add(n)}},yO=`2026-01-26`,bO=class{eventTarget;eventSource;messageListener;constructor(e=window.parent,t){this.eventTarget=e,this.eventSource=t,this.messageListener=e=>{if(t&&e.source!==this.eventSource){console.debug(`Ignoring message from unknown source`,e);return}let n=Gw.safeParse(e.data);n.success?(console.debug(`Parsed message`,n.data),this.onmessage?.(n.data)):e.data?.jsonrpc===`2.0`?(console.error(`Failed to parse message`,n.error.message,e),this.onerror?.(Error(`Invalid JSON-RPC message received: `+n.error.message))):console.debug(`Ignoring non-JSON-RPC message`,n.error.message,e)}}async start(){window.addEventListener(`message`,this.messageListener)}async send(e,t){e.method!==`ui/notifications/tool-input-partial`&&console.debug(`Sending message`,e),this.eventTarget.postMessage(e,`*`)}async close(){window.removeEventListener(`message`,this.messageListener),this.onclose?.()}onclose;onerror;onmessage;sessionId;setProtocolVersion},xO=pS([Q(`light`),Q(`dark`)]).describe(`Color theme preference for the host environment.`),SO=pS([Q(`inline`),Q(`fullscreen`),Q(`pip`)]).describe(`Display mode for UI presentation.`),CO=pS([Q(`--color-background-primary`),Q(`--color-background-secondary`),Q(`--color-background-tertiary`),Q(`--color-background-inverse`),Q(`--color-background-ghost`),Q(`--color-background-info`),Q(`--color-background-danger`),Q(`--color-background-success`),Q(`--color-background-warning`),Q(`--color-background-disabled`),Q(`--color-text-primary`),Q(`--color-text-secondary`),Q(`--color-text-tertiary`),Q(`--color-text-inverse`),Q(`--color-text-ghost`),Q(`--color-text-info`),Q(`--color-text-danger`),Q(`--color-text-success`),Q(`--color-text-warning`),Q(`--color-text-disabled`),Q(`--color-border-primary`),Q(`--color-border-secondary`),Q(`--color-border-tertiary`),Q(`--color-border-inverse`),Q(`--color-border-ghost`),Q(`--color-border-info`),Q(`--color-border-danger`),Q(`--color-border-success`),Q(`--color-border-warning`),Q(`--color-border-disabled`),Q(`--color-ring-primary`),Q(`--color-ring-secondary`),Q(`--color-ring-inverse`),Q(`--color-ring-info`),Q(`--color-ring-danger`),Q(`--color-ring-success`),Q(`--color-ring-warning`),Q(`--font-sans`),Q(`--font-mono`),Q(`--font-weight-normal`),Q(`--font-weight-medium`),Q(`--font-weight-semibold`),Q(`--font-weight-bold`),Q(`--font-text-xs-size`),Q(`--font-text-sm-size`),Q(`--font-text-md-size`),Q(`--font-text-lg-size`),Q(`--font-heading-xs-size`),Q(`--font-heading-sm-size`),Q(`--font-heading-md-size`),Q(`--font-heading-lg-size`),Q(`--font-heading-xl-size`),Q(`--font-heading-2xl-size`),Q(`--font-heading-3xl-size`),Q(`--font-text-xs-line-height`),Q(`--font-text-sm-line-height`),Q(`--font-text-md-line-height`),Q(`--font-text-lg-line-height`),Q(`--font-heading-xs-line-height`),Q(`--font-heading-sm-line-height`),Q(`--font-heading-md-line-height`),Q(`--font-heading-lg-line-height`),Q(`--font-heading-xl-line-height`),Q(`--font-heading-2xl-line-height`),Q(`--font-heading-3xl-line-height`),Q(`--border-radius-xs`),Q(`--border-radius-sm`),Q(`--border-radius-md`),Q(`--border-radius-lg`),Q(`--border-radius-xl`),Q(`--border-radius-full`),Q(`--border-width-regular`),Q(`--shadow-hairline`),Q(`--shadow-sm`),Q(`--shadow-md`),Q(`--shadow-lg`)]).describe(`CSS variable keys available to MCP apps for theming.`),wO=_S(CO.describe(`Style variables for theming MCP apps.\n\nIndividual style keys are optional - hosts may provide any subset of these values.\nValues are strings containing CSS values (colors, sizes, font stacks, etc.).\n\nNote: This type uses \\`Record<K, string | undefined>\\` rather than \\`Partial<Record<K, string>>\\`\nfor compatibility with Zod schema generation. Both are functionally equivalent for validation.`),pS([J(),rS()]).describe(`Style variables for theming MCP apps.\n\nIndividual style keys are optional - hosts may provide any subset of these values.\nValues are strings containing CSS values (colors, sizes, font stacks, etc.).\n\nNote: This type uses \\`Record<K, string | undefined>\\` rather than \\`Partial<Record<K, string>>\\`\nfor compatibility with Zod schema generation. Both are functionally equivalent for validation.`)).describe(`Style variables for theming MCP apps.\n\nIndividual style keys are optional - hosts may provide any subset of these values.\nValues are strings containing CSS values (colors, sizes, font stacks, etc.).\n\nNote: This type uses \\`Record<K, string | undefined>\\` rather than \\`Partial<Record<K, string>>\\`\nfor compatibility with Zod schema generation. Both are functionally equivalent for validation.`),Z({method:Q(`ui/open-link`),params:Z({url:J().describe(`URL to open in the host's browser`)})}),TO=Z({isError:Qx().optional().describe(`True if the host failed to open the URL (e.g., due to security policy).`)}).passthrough(),EO=Z({isError:Qx().optional().describe(`True if the download failed (e.g., user cancelled or host denied).`)}).passthrough(),DO=Z({isError:Qx().optional().describe(`True if the host rejected or failed to deliver the message.`)}).passthrough(),Z({method:Q(`ui/notifications/sandbox-proxy-ready`),params:Z({})}),OO=Z({connectDomains:X(J()).optional().describe(`Origins for network requests (fetch/XHR/WebSocket).\n\n- Maps to CSP \\`connect-src\\` directive\n- Empty or omitted → no network connections (secure default)`),resourceDomains:X(J()).optional().describe(\"Origins for static resources (images, scripts, stylesheets, fonts, media).\\n\\n- Maps to CSP `img-src`, `script-src`, `style-src`, `font-src`, `media-src` directives\\n- Wildcard subdomains supported: `https://*.example.com`\\n- Empty or omitted → no network resources (secure default)\"),frameDomains:X(J()).optional().describe(\"Origins for nested iframes.\\n\\n- Maps to CSP `frame-src` directive\\n- Empty or omitted → no nested iframes allowed (`frame-src 'none'`)\"),baseUriDomains:X(J()).optional().describe(\"Allowed base URIs for the document.\\n\\n- Maps to CSP `base-uri` directive\\n- Empty or omitted → only same origin allowed (`base-uri 'self'`)\")}),kO=Z({camera:Z({}).optional().describe(`Request camera access.\n\nMaps to Permission Policy \\`camera\\` feature.`),microphone:Z({}).optional().describe(`Request microphone access.\n\nMaps to Permission Policy \\`microphone\\` feature.`),geolocation:Z({}).optional().describe(`Request geolocation access.\n\nMaps to Permission Policy \\`geolocation\\` feature.`),clipboardWrite:Z({}).optional().describe(`Request clipboard write access.\n\nMaps to Permission Policy \\`clipboard-write\\` feature.`)}),Z({method:Q(`ui/notifications/size-changed`),params:Z({width:Y().optional().describe(`New width in pixels.`),height:Y().optional().describe(`New height in pixels.`)})}),AO=Z({method:Q(`ui/notifications/tool-input`),params:Z({arguments:_S(J(),oS().describe(`Complete tool call arguments as key-value pairs.`)).optional().describe(`Complete tool call arguments as key-value pairs.`)})}),jO=Z({method:Q(`ui/notifications/tool-input-partial`),params:Z({arguments:_S(J(),oS().describe(`Partial tool call arguments (incomplete, may change).`)).optional().describe(`Partial tool call arguments (incomplete, may change).`)})}),MO=Z({method:Q(`ui/notifications/tool-cancelled`),params:Z({reason:J().optional().describe(`Optional reason for the cancellation (e.g., \"user action\", \"timeout\").`)})}),NO=Z({fonts:J().optional()}),PO=Z({variables:wO.optional().describe(`CSS variables for theming the app.`),css:NO.optional().describe(`CSS blocks that apps can inject.`)}),FO=Z({method:Q(`ui/resource-teardown`),params:Z({})}),_S(J(),oS()),IO=Z({text:Z({}).optional().describe(`Host supports text content blocks.`),image:Z({}).optional().describe(`Host supports image content blocks.`),audio:Z({}).optional().describe(`Host supports audio content blocks.`),resource:Z({}).optional().describe(`Host supports resource content blocks.`),resourceLink:Z({}).optional().describe(`Host supports resource link content blocks.`),structuredContent:Z({}).optional().describe(`Host supports structured content.`)}),Z({method:Q(`ui/notifications/request-teardown`),params:Z({}).optional()}),LO=Z({experimental:_S(J(),_S(J(),aS()).describe(`Experimental features keyed by identifier.`)).optional().describe(`Experimental features keyed by identifier.`),openLinks:Z({}).optional().describe(`Host supports opening external URLs.`),downloadFile:Z({}).optional().describe(`Host supports file downloads via ui/download-file.`),serverTools:Z({listChanged:Qx().optional().describe(`Host supports tools/list_changed notifications.`)}).optional().describe(`Host can proxy tool calls to the MCP server.`),serverResources:Z({listChanged:Qx().optional().describe(`Host supports resources/list_changed notifications.`)}).optional().describe(`Host can proxy resource reads to the MCP server.`),logging:Z({}).optional().describe(`Host accepts log messages.`),sandbox:Z({permissions:kO.optional().describe(`Permissions granted by the host (camera, microphone, geolocation).`),csp:OO.optional().describe(`CSP domains approved by the host.`)}).optional().describe(`Sandbox configuration applied by the host.`),updateModelContext:IO.optional().describe(`Host accepts context updates (ui/update-model-context) to be included in the model's context for future turns.`),message:IO.optional().describe(`Host supports receiving content messages (ui/message) from the view.`),sampling:Z({tools:Z({}).optional().describe(\"Host supports tool use via `tools` and `toolChoice` parameters.\")}).optional().describe(\"Host supports LLM sampling (sampling/createMessage) from the view.\\nMirrors the MCP `ClientCapabilities.sampling` shape so hosts can pass it through.\")}),RO=Z({experimental:_S(J(),_S(J(),aS()).describe(`Experimental features keyed by identifier.`)).optional().describe(`Experimental features keyed by identifier.`),tools:Z({listChanged:Qx().optional().describe(`App supports tools/list_changed notifications.`)}).optional().describe(`App exposes MCP-style tools that the host can call.`),availableDisplayModes:X(SO).optional().describe(`Display modes the app supports.`)}),Z({method:Q(`ui/notifications/initialized`),params:Z({}).optional()}),Z({csp:OO.optional().describe(`Content Security Policy configuration for UI resources.`),permissions:kO.optional().describe(`Sandbox permissions requested by the UI resource.`),domain:J().optional().describe(`Dedicated origin for view sandbox.\n\nUseful when views need stable, dedicated origins for OAuth callbacks, CORS policies, or API key allowlists.\n\n**Host-dependent:** The format and validation rules for this field are determined by each host. Servers MUST consult host-specific documentation for the expected domain format. Common patterns include:\n- Hash-based subdomains (e.g., \\`{hash}.claudemcpcontent.com\\`)\n- URL-derived subdomains (e.g., \\`www-example-com.oaiusercontent.com\\`)\n\nIf omitted, host uses default sandbox origin (typically per-conversation).`),prefersBorder:Qx().optional().describe(`Visual boundary preference - true if view prefers a visible border.\n\nBoolean requesting whether a visible border and background is provided by the host. Specifying an explicit value for this is recommended because hosts' defaults may vary.\n\n- \\`true\\`: request visible border + background\n- \\`false\\`: request no visible border + background\n- omitted: host decides border`)}),Z({method:Q(`ui/request-display-mode`),params:Z({mode:SO.describe(`The display mode being requested.`)})}),zO=Z({mode:SO.describe(`The display mode that was actually set. May differ from requested if not supported.`)}).passthrough(),BO=pS([Q(`model`),Q(`app`)]).describe(`Tool visibility scope - who can access the tool.`),Z({resourceUri:J().optional(),visibility:X(BO).optional().describe(`Who can access this tool. Default: [\"model\", \"app\"]\n- \"model\": Tool visible to and callable by the agent\n- \"app\": Tool callable by the app from this server only`),csp:sS().optional(),permissions:sS().optional()}),Z({mimeTypes:X(J()).optional().describe('Array of supported MIME types for UI resources.\\nMust include `\"text/html;profile=mcp-app\"` for MCP Apps support.')}),Z({method:Q(`ui/download-file`),params:Z({contents:X(pS([sE,cE])).describe(`Resource contents to download — embedded (inline data) or linked (host fetches). Uses standard MCP resource types.`)})}),Z({method:Q(`ui/message`),params:Z({role:Q(`user`).describe(`Message role, currently only \"user\" is supported.`),content:X(lE).describe(`Message content blocks (text, image, etc.).`)})}),Z({method:Q(`ui/notifications/sandbox-resource-ready`),params:Z({html:J().describe(`HTML content to load into the inner iframe.`),sandbox:J().optional().describe(`Optional override for the inner iframe's sandbox attribute.`),csp:OO.optional().describe(`CSP configuration from resource metadata.`),permissions:kO.optional().describe(`Sandbox permissions from resource metadata.`)})}),VO=Z({method:Q(`ui/notifications/tool-result`),params:vE.describe(`Standard MCP tool execution result.`)}),HO=Z({toolInfo:Z({id:Fw.optional().describe(`JSON-RPC id of the tools/call request.`),tool:hE.describe(`Tool definition including name, inputSchema, etc.`)}).optional().describe(`Metadata of the tool call that instantiated this App.`),theme:xO.optional().describe(`Current color theme preference.`),styles:PO.optional().describe(`Style configuration for theming the app.`),displayMode:SO.optional().describe(`How the UI is currently displayed.`),availableDisplayModes:X(SO).optional().describe(`Display modes the host supports.`),containerDimensions:pS([Z({height:Y().describe(`Fixed container height in pixels.`)}),Z({maxHeight:pS([Y(),rS()]).optional().describe(`Maximum container height in pixels.`)})]).and(pS([Z({width:Y().describe(`Fixed container width in pixels.`)}),Z({maxWidth:pS([Y(),rS()]).optional().describe(`Maximum container width in pixels.`)})])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other\ncontainer holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:J().optional().describe(`User's language and region preference in BCP 47 format.`),timeZone:J().optional().describe(`User's timezone in IANA format.`),userAgent:J().optional().describe(`Host application identifier.`),platform:pS([Q(`web`),Q(`desktop`),Q(`mobile`)]).optional().describe(`Platform type for responsive design decisions.`),deviceCapabilities:Z({touch:Qx().optional().describe(`Whether the device supports touch input.`),hover:Qx().optional().describe(`Whether the device supports hover interactions.`)}).optional().describe(`Device input capabilities.`),safeAreaInsets:Z({top:Y().describe(`Top safe area inset in pixels.`),right:Y().describe(`Right safe area inset in pixels.`),bottom:Y().describe(`Bottom safe area inset in pixels.`),left:Y().describe(`Left safe area inset in pixels.`)}).optional().describe(`Mobile safe area boundaries in pixels.`)}).passthrough(),UO=Z({method:Q(`ui/notifications/host-context-changed`),params:HO.describe(`Partial context update containing only changed fields.`)}),Z({method:Q(`ui/update-model-context`),params:Z({content:X(lE).optional().describe(`Context content blocks (text, image, etc.).`),structuredContent:_S(J(),oS().describe(`Structured content for machine-readable context data.`)).optional().describe(`Structured content for machine-readable context data.`)})}),Z({method:Q(`ui/initialize`),params:Z({appInfo:Qw.describe(`App identification (name and version).`),appCapabilities:RO.describe(`Features and capabilities this app provides.`),protocolVersion:J().describe(`Protocol version this app supports.`)})}),WO=Z({protocolVersion:J().describe(`Negotiated protocol version string (e.g., \"2025-11-21\").`),hostInfo:Qw.describe(`Host application identification and version.`),hostCapabilities:LO.describe(`Features and capabilities provided by the host.`),hostContext:HO.describe(`Rich context about the host environment.`)}).passthrough(),GO={target:`draft-2020-12`},KO=class e extends vO{_appInfo;_capabilities;options;_hostCapabilities;_hostInfo;_hostContext;_registeredTools={};_initializedSent=!1;_assertInitialized(e){if(this._initializedSent)return;let t=`[ext-apps] App.${e}() called before connect() completed the ui/initialize handshake. Await app.connect() before calling this method, or move data loading to an ontoolresult handler.`;if(this.options?.strict)throw Error(t);console.warn(`${t}. This will throw in a future release.`)}eventSchemas={toolinput:AO,toolinputpartial:jO,toolresult:VO,toolcancelled:MO,hostcontextchanged:UO};static ONE_SHOT_EVENTS=new Set([`toolinput`,`toolinputpartial`,`toolresult`,`toolcancelled`]);_everHadListener=new Set;_assertHandlerTiming(t){if(!e.ONE_SHOT_EVENTS.has(t)||this._everHadListener.has(t)||(this._everHadListener.add(t),!this._initializedSent))return;let n=`[ext-apps] \"${String(t)}\" handler registered after connect() completed the ui/initialize handshake. The host may have already sent this notification. Register handlers before calling app.connect().`;if(this.options?.strict)throw Error(n);console.warn(n)}setEventHandler(e,t){t&&this._assertHandlerTiming(e),super.setEventHandler(e,t)}addEventListener(e,t){this._assertHandlerTiming(e),super.addEventListener(e,t)}onEventDispatch(e,t){e===`hostcontextchanged`&&(this._hostContext={...this._hostContext,...t})}constructor(e,t={},n={autoResize:!0}){super(n),this._appInfo=e,this._capabilities=t,this.options=n,n.allowUnsafeEval||$d({jitless:!0}),this.setRequestHandler(lT,e=>(console.log(`Received ping:`,e.params),{})),this.setEventHandler(`hostcontextchanged`,void 0)}registerCapabilities(e){if(this.transport)throw Error(`Cannot register capabilities after transport is established`);this._capabilities=oO(this._capabilities,e)}registerTool(e,t,n){if(this._registeredTools[e])throw Error(`Tool ${e} is already registered`);let r=this,i=()=>{r._initializedSent&&r._capabilities.tools?.listChanged&&r.sendToolListChanged()},a=t.inputSchema!==void 0,o={title:t.title,description:t.description,inputSchema:t.inputSchema,outputSchema:t.outputSchema,annotations:t.annotations,_meta:t._meta,enabled:!0,enable(){this.enabled=!0,i()},disable(){this.enabled=!1,i()},update(e){Object.assign(this,e),i()},remove(){r._registeredTools[e]===o&&(delete r._registeredTools[e],i())},handler:async(t,r)=>{if(!o.enabled)throw Error(`Tool ${e} is disabled`);let i;if(a){let a=o.inputSchema;i=await n(a?await hO(a,t??{},`Invalid input for tool ${e}: `):t??{},r)}else i=await n(r);return o.outputSchema&&!i.isError&&(i.structuredContent=await hO(o.outputSchema,i.structuredContent,`Invalid output for tool ${e}: `)),i}};return this._registeredTools[e]=o,!this._capabilities.tools&&!this.transport&&this.registerCapabilities({tools:{listChanged:!0}}),this.ensureToolHandlersInitialized(),i(),o}_toolHandlersInitialized=!1;ensureToolHandlersInitialized(){this._toolHandlersInitialized||(this._toolHandlersInitialized=!0,this.oncalltool=async(e,t)=>{let n=this._registeredTools[e.name];if(!n)throw Error(`Tool ${e.name} not found`);return n.handler(e.arguments,t)},this.onlisttools=async(e,t)=>({tools:await Promise.all(Object.entries(this._registeredTools).filter(([e,t])=>t.enabled).map(async([e,t])=>{let n={name:e,title:t.title,description:t.description,inputSchema:t.inputSchema?await mO(t.inputSchema,`input`):{type:`object`,properties:{}}};return t.outputSchema&&(n.outputSchema=await mO(t.outputSchema,`output`)),t.annotations&&(n.annotations=t.annotations),t._meta&&(n._meta=t._meta),n}))}))}async sendToolListChanged(e={}){this._assertInitialized(`sendToolListChanged`),await this.notification({method:`notifications/tools/list_changed`,params:e})}getHostCapabilities(){return this._hostCapabilities}getHostVersion(){return this._hostInfo}getHostContext(){return this._hostContext}get ontoolinput(){return this.getEventHandler(`toolinput`)}set ontoolinput(e){this.setEventHandler(`toolinput`,e)}get ontoolinputpartial(){return this.getEventHandler(`toolinputpartial`)}set ontoolinputpartial(e){this.setEventHandler(`toolinputpartial`,e)}get ontoolresult(){return this.getEventHandler(`toolresult`)}set ontoolresult(e){this.setEventHandler(`toolresult`,e)}get ontoolcancelled(){return this.getEventHandler(`toolcancelled`)}set ontoolcancelled(e){this.setEventHandler(`toolcancelled`,e)}get onhostcontextchanged(){return this.getEventHandler(`hostcontextchanged`)}set onhostcontextchanged(e){this.setEventHandler(`hostcontextchanged`,e)}_onteardown;get onteardown(){return this._onteardown}set onteardown(e){this.warnIfRequestHandlerReplaced(`onteardown`,this._onteardown,e),this._onteardown=e,this.replaceRequestHandler(FO,(e,t)=>{if(!this._onteardown)throw Error(`No onteardown handler set`);return this._onteardown(e.params,t)})}_oncalltool;get oncalltool(){return this._oncalltool}set oncalltool(e){this.warnIfRequestHandlerReplaced(`oncalltool`,this._oncalltool,e),this._oncalltool=e,this.replaceRequestHandler(bE,(e,t)=>{if(!this._oncalltool)throw Error(`No oncalltool handler set`);return this._oncalltool(e.params,t)})}_onlisttools;get onlisttools(){return this._onlisttools}set onlisttools(e){this.warnIfRequestHandlerReplaced(`onlisttools`,this._onlisttools,e),this._onlisttools=e,this.replaceRequestHandler(gE,(e,t)=>{if(!this._onlisttools)throw Error(`No onlisttools handler set`);return this._onlisttools(e.params,t)})}assertCapabilityForMethod(e){if(e===`sampling/createMessage`&&!this._hostCapabilities?.sampling)throw Error(`Host does not support sampling (required for ${e})`)}assertRequestHandlerCapability(e){switch(e){case`tools/call`:case`tools/list`:if(!this._capabilities.tools)throw Error(`Client does not support tool capability (required for ${e})`);return;case`ping`:case`ui/resource-teardown`:return;default:throw Error(`No handler for method ${e} registered`)}}assertNotificationCapability(e){}assertTaskCapability(e){throw Error(`Tasks are not supported in MCP Apps`)}assertTaskHandlerCapability(e){throw Error(`Task handlers are not supported in MCP Apps`)}async callServerTool(e,t){if(this._assertInitialized(`callServerTool`),typeof e==`string`)throw Error(`callServerTool() expects an object as its first argument, but received a string (\"${e}\"). Did you mean: callServerTool({ name: \"${e}\", arguments: { ... } })?`);return await this.request({method:`tools/call`,params:e},vE,{onprogress:()=>{},resetTimeoutOnProgress:!0,...t})}async readServerResource(e,t){return this._assertInitialized(`readServerResource`),await this.request({method:`resources/read`,params:e},UT,t)}async listServerResources(e,t){return this._assertInitialized(`listServerResources`),await this.request({method:`resources/list`,params:e},LT,t)}async createSamplingMessage(e,t){this._assertInitialized(`createSamplingMessage`);let n=e.tools?LE:IE;return await this.request({method:`sampling/createMessage`,params:e},n,t)}sendMessage(e,t){return this._assertInitialized(`sendMessage`),this.request({method:`ui/message`,params:e},DO,t)}sendLog(e){return this.notification({method:`notifications/message`,params:e})}updateModelContext(e,t){return this._assertInitialized(`updateModelContext`),this.request({method:`ui/update-model-context`,params:e},Kw,t)}openLink(e,t){return this._assertInitialized(`openLink`),this.request({method:`ui/open-link`,params:e},TO,t)}sendOpenLink=this.openLink;downloadFile(e,t){return this._assertInitialized(`downloadFile`),this.request({method:`ui/download-file`,params:e},EO,t)}requestTeardown(e={}){return this.notification({method:`ui/notifications/request-teardown`,params:e})}requestDisplayMode(e,t){return this._assertInitialized(`requestDisplayMode`),this.request({method:`ui/request-display-mode`,params:e},zO,t)}sendSizeChanged(e){return this.notification({method:`ui/notifications/size-changed`,params:e})}setupSizeChangedNotifications(){let e=!1,t=0,n=0,r=()=>{e||(e=!0,requestAnimationFrame(()=>{e=!1;let r=document.documentElement,i=r.style.height;r.style.height=`max-content`;let a=Math.ceil(r.getBoundingClientRect().height);r.style.height=i;let o=Math.ceil(window.innerWidth);(o!==t||a!==n)&&(t=o,n=a,this.sendSizeChanged({width:o,height:a}))}))};r();let i=new ResizeObserver(r);return i.observe(document.documentElement),i.observe(document.body),()=>i.disconnect()}async connect(e=new bO(window.parent,window.parent),t){if(this.transport)throw Error(`App is already connected. Call close() before connecting again.`);this._initializedSent=!1,await super.connect(e);try{let e=await this.request({method:`ui/initialize`,params:{appCapabilities:this._capabilities,appInfo:this._appInfo,protocolVersion:yO}},WO,t);if(e===void 0)throw Error(`Server sent invalid initialize result: ${e}`);this._hostCapabilities=e.hostCapabilities,this._hostInfo=e.hostInfo,this._hostContext=e.hostContext,await this.notification({method:`ui/notifications/initialized`}),this._initializedSent=!0,this.options?.autoResize&&this.setupSizeChangedNotifications()}catch(e){throw this.close(),e}}}}));function JO(e){let t=[];return typeof e.durationSeconds==`number`&&t.push(`${e.durationSeconds.toFixed(2)}s`),e.model&&t.push(e.model),t.join(` · `)}function YO(e,t){let n,r=0,i,a=()=>{n!==void 0&&(clearTimeout(n),n=void 0)},o=new KO({name:e,version:`0.0.1`},{}),s=async e=>{let t=await o.request({method:`tools/call`,params:{name:`get_generation`,arguments:{operationId:e}}},vE);if(!t.isError)return t.structuredContent},c=(e,o)=>{n=window.setTimeout(async()=>{if(Date.now()-r>tk){t.onTimeout?.();return}try{let n=await s(e);if(n?.status===`complete`){a(),i=n,t.onResult(n);return}}catch{}c(e,Math.min(o*1.5,ek))},o)},l=e=>{e&&(a(),i=e,t.onResult(e),e.status===`running`&&e.operationId!==void 0&&(r=Date.now(),c(e.operationId,$O)))};return o.ontoolinput=()=>t.onResult({status:`running`}),o.ontoolresult=e=>l(e?.structuredContent),o.onhostcontextchanged=e=>{if(e?.theme&&gO(e.theme),e?.styles?.variables&&_O(e.styles.variables),e?.displayMode&&(document.documentElement.dataset.displayMode=e.displayMode),e?.safeAreaInsets){let{top:t=0,right:n=0,bottom:r=0,left:i=0}=e.safeAreaInsets;document.body.style.padding=`${t}px ${n}px ${r}px ${i}px`}},o.onteardown=async()=>(a(),{}),o.connect(new bO(window.parent,window.parent)).catch(()=>{}),{app:o,current:()=>i}}function XO(e,t){return e.openLink({url:t})}function ZO(e){let t=document.documentElement.dataset.displayMode===`fullscreen`;return e.requestDisplayMode({mode:t?`inline`:`fullscreen`}).then(e=>{e?.mode&&(document.documentElement.dataset.displayMode=e.mode)})}var QO,$O,ek,tk,nk=t((()=>{qO(),mD(),QO=e=>document.getElementById(e),$O=2e3,ek=1e4,tk=36e4}));n((()=>{Su(),Od(),Qd(),nk();var e=e=>{QO(`meta`).textContent=e},t=e=>{QO(`status`).textContent=e},n,r,i=!1;function a(e,t,n){let r=n/(2*Math.tan(e.fov*Math.PI/360));e.position.set(t.x+r*.7,t.y+r*.5,t.z+r*.9),e.near=Math.max(r/100,.01),e.far=r*20,e.updateProjectionMatrix(),e.lookAt(t)}var o=.005;async function s(e){let s=QO(`viewer`),c=new mr;c.background=null;let l=new ko(45,1,.01,1e3);n=new xu({antialias:!0,alpha:!0}),n.setPixelRatio(Math.min(window.devicePixelRatio,2)),n.outputColorSpace=Zt,n.toneMapping=4,s.appendChild(n.domElement),c.add(new Lo(16777215,1.1));let u=new Io(16777215,2.2);u.position.set(3,5,4),c.add(u);let d=new Io(10075135,.8);d.position.set(-4,2,-3),c.add(d),r=new Zd(l,n.domElement),r.enableDamping=!0,r.enablePan=!1;let f=!1;r.addEventListener(`start`,()=>{f=!0}),r.addEventListener(`end`,()=>{f=!1});let p=()=>{let e=s.clientWidth||360,t=s.clientHeight||360;n.setSize(e,t,!1),l.aspect=e/t,l.updateProjectionMatrix()};new ResizeObserver(p).observe(s),p(),t(`Loading model…`);let m=await new Vu().loadAsync(e,e=>{e.total&&t(`Loading model… ${Math.round(e.loaded/e.total*100)}%`)}),h=new kr().setFromObject(m.scene),g=h.getCenter(new L),_=h.getSize(new L).length();m.scene.position.sub(g);let v=new sr;v.add(m.scene),c.add(v),r.target.set(0,0,0),a(l,new L(0,0,0),_),r.update();let y=()=>{i||(f||(v.rotation.y+=o),r.update(),n.render(c,l),requestAnimationFrame(y))};y(),s.hidden=!1,QO(`skeleton`).style.display=`none`,t(``)}var c=YO(`Womp mesh`,{onTimeout:()=>t(`Still running — ask me to check on it.`),onResult:n=>{if(n.status===`running`){QO(`skeleton`).classList.add(`pulsing`),QO(`actions`).hidden=!0,e(``),t(`Generating…`);return}if(QO(`skeleton`).classList.remove(`pulsing`),e(JO(n)),n.glbUrl){QO(`actions`).hidden=!1,QO(`download`).hidden=!1,QO(`expand`).hidden=!1,s(n.glbUrl).catch(e=>{QO(`viewer`).hidden=!0,t(`Could not load the 3D view — `+(e?.message??e)),l(n.previewUrl||n.imageUrl)});return}QO(`actions`).hidden=!1,QO(`download`).hidden=!n.imageUrl,QO(`expand`).hidden=!n.imageUrl,l(n.imageUrl)}});function l(e){if(!e)return;let t=QO(`hero`);t.onload=()=>{QO(`skeleton`).style.display=`none`,t.style.display=`block`},t.src=e}QO(`download`).addEventListener(`click`,()=>{let e=c.current()?.glbUrl||c.current()?.imageUrl;e&&XO(c.app,e).catch(()=>t(`Could not open the link.`))}),QO(`expand`).addEventListener(`click`,()=>{ZO(c.app).catch(()=>t(`This host does not support fullscreen.`))}),window.addEventListener(`pagehide`,()=>{i=!0,r?.dispose(),n?.dispose()})}))();</script>\n </head>\n <body>\n <div class=\"card\" id=\"card\">\n <div id=\"viewer\" class=\"viewer\" hidden></div>\n <img id=\"hero\" class=\"hero\" alt=\"\" style=\"display: none\" />\n <div id=\"skeleton\" class=\"skeleton\"></div>\n\n <div class=\"actions\" id=\"actions\" hidden>\n <button class=\"btn\" id=\"download\" title=\"Open full size\" hidden>\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\">\n <path d=\"M12 3v12m0 0 4-4m-4 4-4-4M4 21h16\" />\n </svg>\n </button>\n <button class=\"btn\" id=\"expand\" title=\"Expand\" hidden>\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\">\n <path d=\"M4 10V4h6M20 14v6h-6M20 10V4h-6M4 14v6h6\" />\n </svg>\n </button>\n </div>\n\n <!-- Two lines, not one: `meta` is what produced the result, `status` is\n when something went wrong. Sharing an element meant a preview error\n erased the model name, or the reverse, depending on which landed\n last. Both collapse when empty. -->\n <div class=\"meta\" id=\"meta\"></div>\n <div class=\"status\" id=\"status\">Connecting…</div>\n </div>\n </body>\n</html>\n";
|
|
27
|
+
|
|
28
|
+
/** Version-stamped so a host's per-connector resource cache cannot serve a stale card. */
|
|
29
|
+
exports.PRINT_APP_URI = "ui://womp/print-0.1.3.html";
|
|
30
|
+
|
|
31
|
+
/** Goes in the resource's `_meta.ui.csp`. */
|
|
32
|
+
exports.PRINT_APP_CSP = {};
|
|
33
|
+
|
|
34
|
+
/** The complete, self-contained print card. */
|
|
35
|
+
exports.PRINT_APP_HTML = "<!doctype html>\n<html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\" />\n <title>Womp 3D print</title>\n <style>\n /* Same var()-with-fallback discipline as the other cards: host style\n variables arrive over the bridge after the handshake, not as CSS\n custom properties, so the card must look right without them. */\n :root {\n color-scheme: light dark;\n }\n body {\n margin: 0;\n font-family: var(--font-sans, system-ui, -apple-system, \"Segoe UI\", sans-serif);\n color: var(--color-text-primary, #e8e8e8);\n }\n\n .card {\n max-width: 360px;\n border-radius: var(--border-radius-lg, 14px);\n overflow: hidden;\n background: var(--color-background-secondary, #1b1b1d);\n border: 1px solid var(--color-border-primary, rgba(255, 255, 255, 0.08));\n padding: 14px;\n box-sizing: border-box;\n }\n\n .head {\n display: flex;\n align-items: baseline;\n justify-content: space-between;\n gap: 8px;\n }\n .title {\n font-size: var(--font-text-sm-size, 13px);\n font-weight: 600;\n }\n .material {\n font-size: var(--font-text-xs-size, 11px);\n color: var(--color-text-secondary, rgba(232, 232, 232, 0.6));\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .size {\n margin-top: 4px;\n font-size: var(--font-text-xs-size, 11px);\n color: var(--color-text-secondary, rgba(232, 232, 232, 0.6));\n }\n .size:empty { display: none; }\n\n .price {\n margin-top: 10px;\n display: flex;\n align-items: baseline;\n gap: 8px;\n }\n .price:empty { display: none; }\n .amount {\n font-size: 24px;\n font-weight: 700;\n letter-spacing: -0.02em;\n }\n .was {\n font-size: var(--font-text-xs-size, 12px);\n color: var(--color-text-secondary, rgba(232, 232, 232, 0.6));\n text-decoration: line-through;\n }\n .per {\n font-size: var(--font-text-xs-size, 11px);\n color: var(--color-text-secondary, rgba(232, 232, 232, 0.6));\n }\n\n .rows {\n margin-top: 6px;\n font-size: var(--font-text-xs-size, 11px);\n color: var(--color-text-secondary, rgba(232, 232, 232, 0.6));\n display: grid;\n gap: 2px;\n }\n .rows:empty { display: none; }\n\n .cta {\n margin-top: 12px;\n display: flex;\n width: 100%;\n align-items: center;\n justify-content: center;\n gap: 6px;\n border: 0;\n cursor: pointer;\n font: inherit;\n font-size: var(--font-text-sm-size, 13px);\n font-weight: 600;\n padding: 9px 12px;\n border-radius: var(--border-radius-full, 999px);\n color: #fff;\n background: var(--color-background-accent, #5867dd);\n }\n .cta:hover { filter: brightness(1.1); }\n .cta:focus-visible { outline: 2px solid var(--color-ring-primary, #7aa2ff); outline-offset: 1px; }\n .cta[hidden] { display: none; }\n .cta svg { width: 14px; height: 14px; display: block; }\n\n /* The disclaimer only after there is a price to disclaim. */\n .note {\n margin-top: 8px;\n font-size: 10px;\n color: var(--color-text-secondary, rgba(232, 232, 232, 0.5));\n }\n .note[hidden] { display: none; }\n\n .status {\n margin-top: 8px;\n font-size: var(--font-text-xs-size, 11px);\n color: var(--color-text-secondary, rgba(232, 232, 232, 0.6));\n }\n .status:empty { display: none; }\n\n /* Skeleton shimmer while the engine measures. */\n .measuring .price,\n .measuring .rows { opacity: 0.35; }\n </style>\n <script type=\"module\" crossorigin>var e=Object.defineProperty,t=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(e){throw n=[e],e}},n=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),r=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r},i=(e=>typeof require<`u`?require:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof require<`u`?require:e)[t]}):e)(function(e){if(typeof require<`u`)return require.apply(this,arguments);throw Error('Calling `require` for \"'+e+\"\\\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.\")});(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel=\"modulepreload\"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();function a(e,t,n){function r(n,r){var i;Object.defineProperty(n,\"_zod\",{value:n._zod??{},enumerable:!1}),(i=n._zod).traits??(i.traits=new Set),n._zod.traits.add(e),t(n,r);for(let e in o.prototype)e in n||Object.defineProperty(n,e,{value:o.prototype[e].bind(n)});n._zod.constr=o,n._zod.def=r}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,\"name\",{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,\"init\",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,\"name\",{value:e}),o}function o(e){return e&&Object.assign(u,e),u}var s,c,l,u,d=t((()=>{s=Object.freeze({status:`aborted`}),c=Symbol(`zod_brand`),l=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},u={}})),f=r({BIGINT_FORMAT_RANGES:()=>ze,Class:()=>Be,NUMBER_FORMAT_RANGES:()=>Re,aborted:()=>De,allowsEval:()=>Pe,assert:()=>re,assertEqual:()=>p,assertIs:()=>te,assertNever:()=>ne,assertNotEqual:()=>ee,assignProp:()=>ue,cached:()=>oe,captureStackTrace:()=>Ne,cleanEnum:()=>Me,cleanRegex:()=>ce,clone:()=>g,createTransparentProxy:()=>ye,defineLazy:()=>h,esc:()=>me,escapeRegex:()=>ve,extend:()=>Ce,finalizeIssue:()=>b,floatSafeRemainder:()=>le,getElementAtPath:()=>de,getEnumValues:()=>ie,getLengthableOrigin:()=>Ae,getParsedType:()=>Fe,getSizableOrigin:()=>ke,isObject:()=>he,isPlainObject:()=>ge,issue:()=>je,joinValues:()=>m,jsonStringifyReplacer:()=>ae,merge:()=>we,normalizeParams:()=>_,nullish:()=>se,numKeys:()=>_e,omit:()=>Se,optionalKeys:()=>be,partial:()=>Te,pick:()=>xe,prefixIssues:()=>y,primitiveTypes:()=>Le,promiseAllObject:()=>fe,propertyKeyTypes:()=>Ie,randomString:()=>pe,required:()=>Ee,stringifyPrimitive:()=>v,unwrapMessage:()=>Oe});function p(e){return e}function ee(e){return e}function te(e){}function ne(e){throw Error()}function re(e){}function ie(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function m(e,t=`|`){return e.map(e=>v(e)).join(t)}function ae(e,t){return typeof t==`bigint`?t.toString():t}function oe(e){return{get value(){{let t=e();return Object.defineProperty(this,\"value\",{value:t}),t}}}}function se(e){return e==null}function ce(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function le(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=(t.toString().split(`.`)[1]||``).length,i=n>r?n:r;return Number.parseInt(e.toFixed(i).replace(`.`,``))%Number.parseInt(t.toFixed(i).replace(`.`,``))/10**i}function h(e,t,n){Object.defineProperty(e,t,{get(){{let r=n();return e[t]=r,r}},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function ue(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function de(e,t){return t?t.reduce((e,t)=>e?.[t],e):e}function fe(e){let t=Object.keys(e),n=t.map(t=>e[t]);return Promise.all(n).then(e=>{let n={};for(let r=0;r<t.length;r++)n[t[r]]=e[r];return n})}function pe(e=10){let t=``;for(let n=0;n<e;n++)t+=`abcdefghijklmnopqrstuvwxyz`[Math.floor(Math.random()*26)];return t}function me(e){return JSON.stringify(e)}function he(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function ge(e){if(he(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return he(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function _e(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}function ve(e){return e.replace(/[.*+?^${}()|[\\]\\\\]/g,`\\\\$&`)}function g(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function _(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error(\"Cannot specify both `message` and `error` params\");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function ye(e){let t;return new Proxy({},{get(n,r,i){return t??=e(),Reflect.get(t,r,i)},set(n,r,i,a){return t??=e(),Reflect.set(t,r,i,a)},has(n,r){return t??=e(),Reflect.has(t,r)},deleteProperty(n,r){return t??=e(),Reflect.deleteProperty(t,r)},ownKeys(n){return t??=e(),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,r){return t??=e(),Reflect.getOwnPropertyDescriptor(t,r)},defineProperty(n,r,i){return t??=e(),Reflect.defineProperty(t,r,i)}})}function v(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`\"${e}\"`:`${e}`}function be(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}function xe(e,t){let n={},r=e._zod.def;for(let e in t){if(!(e in r.shape))throw Error(`Unrecognized key: \"${e}\"`);t[e]&&(n[e]=r.shape[e])}return g(e,{...e._zod.def,shape:n,checks:[]})}function Se(e,t){let n={...e._zod.def.shape},r=e._zod.def;for(let e in t){if(!(e in r.shape))throw Error(`Unrecognized key: \"${e}\"`);t[e]&&delete n[e]}return g(e,{...e._zod.def,shape:n,checks:[]})}function Ce(e,t){if(!ge(t))throw Error(`Invalid input to extend: expected a plain object`);return g(e,{...e._zod.def,get shape(){let n={...e._zod.def.shape,...t};return ue(this,`shape`,n),n},checks:[]})}function we(e,t){return g(e,{...e._zod.def,get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return ue(this,`shape`,n),n},catchall:t._zod.def.catchall,checks:[]})}function Te(e,t,n){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: \"${t}\"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return g(t,{...t._zod.def,shape:i,checks:[]})}function Ee(e,t,n){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: \"${t}\"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return g(t,{...t._zod.def,shape:i,checks:[]})}function De(e,t=0){for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function y(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Oe(e){return typeof e==`string`?e:e?.message}function b(e,t,n){let r={...e,path:e.path??[]};return e.message||(r.message=Oe(e.inst?._zod.def?.error?.(e))??Oe(t?.error?.(e))??Oe(n.customError?.(e))??Oe(n.localeError?.(e))??`Invalid input`),delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function ke(e){return e instanceof Set?`set`:e instanceof Map?`map`:e instanceof File?`file`:`unknown`}function Ae(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function je(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function Me(e){return Object.entries(e).filter(([e,t])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}var Ne,Pe,Fe,Ie,Le,Re,ze,Be,x=t((()=>{Ne=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{},Pe=oe(()=>{if(typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}}),Fe=e=>{let t=typeof e;switch(t){case`undefined`:return`undefined`;case`string`:return`string`;case`number`:return Number.isNaN(e)?`nan`:`number`;case`boolean`:return`boolean`;case`function`:return`function`;case`bigint`:return`bigint`;case`symbol`:return`symbol`;case`object`:return Array.isArray(e)?`array`:e===null?`null`:e.then&&typeof e.then==`function`&&e.catch&&typeof e.catch==`function`?`promise`:typeof Map<`u`&&e instanceof Map?`map`:typeof Set<`u`&&e instanceof Set?`set`:typeof Date<`u`&&e instanceof Date?`date`:typeof File<`u`&&e instanceof File?`file`:`object`;default:throw Error(`Unknown data type: ${t}`)}},Ie=new Set([`string`,`number`,`symbol`]),Le=new Set([`string`,`number`,`bigint`,`boolean`,`symbol`,`undefined`]),Re={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},ze={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]},Be=class{constructor(...e){}}}));function Ve(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function He(e,t){let n=t||function(e){return e.message},r={_errors:[]},i=e=>{for(let t of e.issues)if(t.code===`invalid_union`&&t.errors.length)t.errors.map(e=>i({issues:e}));else if(t.code===`invalid_key`)i({issues:t.issues});else if(t.code===`invalid_element`)i({issues:t.issues});else if(t.path.length===0)r._errors.push(n(t));else{let e=r,i=0;for(;i<t.path.length;){let r=t.path[i];i===t.path.length-1?(e[r]=e[r]||{_errors:[]},e[r]._errors.push(n(t))):e[r]=e[r]||{_errors:[]},e=e[r],i++}}};return i(e),r}function Ue(e,t){let n=t||function(e){return e.message},r={errors:[]},i=(e,t=[])=>{var a,o;for(let s of e.issues)if(s.code===`invalid_union`&&s.errors.length)s.errors.map(e=>i({issues:e},s.path));else if(s.code===`invalid_key`)i({issues:s.issues},s.path);else if(s.code===`invalid_element`)i({issues:s.issues},s.path);else{let e=[...t,...s.path];if(e.length===0){r.errors.push(n(s));continue}let i=r,c=0;for(;c<e.length;){let t=e[c],r=c===e.length-1;typeof t==`string`?(i.properties??(i.properties={}),(a=i.properties)[t]??(a[t]={errors:[]}),i=i.properties[t]):(i.items??(i.items=[]),(o=i.items)[t]??(o[t]={errors:[]}),i=i.items[t]),r&&i.errors.push(n(s)),c++}}};return i(e),r}function We(e){let t=[];for(let n of e)typeof n==`number`?t.push(`[${n}]`):typeof n==`symbol`?t.push(`[${JSON.stringify(String(n))}]`):/[^\\w$]/.test(n)?t.push(`[${JSON.stringify(n)}]`):(t.length&&t.push(`.`),t.push(n));return t.join(``)}function Ge(e){let t=[],n=[...e.issues].sort((e,t)=>e.path.length-t.path.length);for(let e of n)t.push(`✖ ${e.message}`),e.path?.length&&t.push(` → at ${We(e.path)}`);return t.join(`\n`)}var Ke,qe,Je,Ye=t((()=>{d(),x(),Ke=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,\"_zod\",{value:e._zod,enumerable:!1}),Object.defineProperty(e,\"issues\",{value:t,enumerable:!1}),Object.defineProperty(e,\"message\",{get(){return JSON.stringify(t,ae,2)},enumerable:!0}),Object.defineProperty(e,\"toString\",{value:()=>e.message,enumerable:!1})},qe=a(`$ZodError`,Ke),Je=a(`$ZodError`,Ke,{Parent:Error})})),Xe,Ze,Qe,$e,et,tt,nt,rt,it=t((()=>{d(),Ye(),x(),Xe=e=>(t,n,r,i)=>{let a=r?Object.assign(r,{async:!1}):{async:!1},s=t._zod.run({value:n,issues:[]},a);if(s instanceof Promise)throw new l;if(s.issues.length){let t=new((i?.Err)??e)(s.issues.map(e=>b(e,a,o())));throw Ne(t,i?.callee),t}return s.value},Ze=Xe(Je),Qe=e=>async(t,n,r,i)=>{let a=r?Object.assign(r,{async:!0}):{async:!0},s=t._zod.run({value:n,issues:[]},a);if(s instanceof Promise&&(s=await s),s.issues.length){let t=new((i?.Err)??e)(s.issues.map(e=>b(e,a,o())));throw Ne(t,i?.callee),t}return s.value},$e=Qe(Je),et=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new l;return a.issues.length?{success:!1,error:new(e??qe)(a.issues.map(e=>b(e,i,o())))}:{success:!0,data:a.value}},tt=et(Je),nt=e=>async(t,n,r)=>{let i=r?Object.assign(r,{async:!0}):{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>b(e,i,o())))}:{success:!0,data:a.value}},rt=nt(Je)})),at=r({_emoji:()=>Ot,base64:()=>Nt,base64url:()=>Pt,bigint:()=>Vt,boolean:()=>Wt,browserEmail:()=>Dt,cidrv4:()=>jt,cidrv6:()=>Mt,cuid:()=>ut,cuid2:()=>dt,date:()=>zt,datetime:()=>lt,domain:()=>It,duration:()=>gt,e164:()=>Lt,email:()=>Ct,emoji:()=>ot,extendedDuration:()=>_t,guid:()=>vt,hostname:()=>Ft,html5Email:()=>wt,integer:()=>Ht,ipv4:()=>kt,ipv6:()=>At,ksuid:()=>mt,lowercase:()=>qt,nanoid:()=>ht,null:()=>Gt,number:()=>Ut,rfc5322Email:()=>Tt,string:()=>Bt,time:()=>ct,ulid:()=>ft,undefined:()=>Kt,unicodeEmail:()=>Et,uppercase:()=>Jt,uuid:()=>yt,uuid4:()=>bt,uuid6:()=>xt,uuid7:()=>St,xid:()=>pt});function ot(){return new RegExp(Ot,`u`)}function st(e){let t=`(?:[01]\\\\d|2[0-3]):[0-5]\\\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\\\d`:`${t}:[0-5]\\\\d\\\\.\\\\d{${e.precision}}`:`${t}(?::[0-5]\\\\d(?:\\\\.\\\\d+)?)?`}function ct(e){return RegExp(`^${st(e)}$`)}function lt(e){let t=st({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-]\\\\d{2}:\\\\d{2})`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${Rt}T(?:${r})$`)}var ut,dt,ft,pt,mt,ht,gt,_t,vt,yt,bt,xt,St,Ct,wt,Tt,Et,Dt,Ot,kt,At,jt,Mt,Nt,Pt,Ft,It,Lt,Rt,zt,Bt,Vt,Ht,Ut,Wt,Gt,Kt,qt,Jt,Yt=t((()=>{ut=/^[cC][^\\s-]{8,}$/,dt=/^[0-9a-z]+$/,ft=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,pt=/^[0-9a-vA-V]{20}$/,mt=/^[A-Za-z0-9]{27}$/,ht=/^[a-zA-Z0-9_-]{21}$/,gt=/^P(?:(\\d+W)|(?!.*W)(?=\\d|T\\d)(\\d+Y)?(\\d+M)?(\\d+D)?(T(?=\\d)(\\d+H)?(\\d+M)?(\\d+([.,]\\d+)?S)?)?)$/,_t=/^[-+]?P(?!$)(?:(?:[-+]?\\d+Y)|(?:[-+]?\\d+[.,]\\d+Y$))?(?:(?:[-+]?\\d+M)|(?:[-+]?\\d+[.,]\\d+M$))?(?:(?:[-+]?\\d+W)|(?:[-+]?\\d+[.,]\\d+W$))?(?:(?:[-+]?\\d+D)|(?:[-+]?\\d+[.,]\\d+D$))?(?:T(?=[\\d+-])(?:(?:[-+]?\\d+H)|(?:[-+]?\\d+[.,]\\d+H$))?(?:(?:[-+]?\\d+M)|(?:[-+]?\\d+[.,]\\d+M$))?(?:[-+]?\\d+(?:[.,]\\d+)?S)?)??$/,vt=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,yt=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/,bt=yt(4),xt=yt(6),St=yt(7),Ct=/^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$/,wt=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Tt=/^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/,Et=/^[^\\s@\"]{1,64}@[^\\s@]{1,255}$/u,Dt=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Ot=`^(\\\\p{Extended_Pictographic}|\\\\p{Emoji_Component})+$`,kt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,At=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,jt=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\/([0-9]|[1-2][0-9]|3[0-2])$/,Mt=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Nt=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Pt=/^[A-Za-z0-9_-]*$/,Ft=/^([a-zA-Z0-9-]+\\.)*[a-zA-Z0-9-]+$/,It=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\\.)+[a-zA-Z]{2,}$/,Lt=/^\\+(?:[0-9]){6,14}[0-9]$/,Rt=`(?:(?:\\\\d\\\\d[2468][048]|\\\\d\\\\d[13579][26]|\\\\d\\\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\\\d|30)|(?:02)-(?:0[1-9]|1\\\\d|2[0-8])))`,zt=RegExp(`^${Rt}$`),Bt=e=>{let t=e?`[\\\\s\\\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\\\s\\\\S]*`;return RegExp(`^${t}$`)},Vt=/^\\d+n?$/,Ht=/^\\d+$/,Ut=/^-?\\d+(?:\\.\\d+)?/i,Wt=/true|false/i,Gt=/null/i,Kt=/undefined/i,qt=/^[^A-Z]*$/,Jt=/^[^a-z]*$/}));function Xt(e,t,n){e.issues.length&&t.issues.push(...y(n,e.issues))}var S,Zt,Qt,$t,en,tn,nn,rn,an,on,sn,cn,ln,un,dn,fn,pn,mn,hn,gn,_n,vn,yn,bn=t((()=>{d(),Yt(),x(),S=a(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Zt={number:`number`,bigint:`bigint`,object:`date`},Qt=a(`$ZodCheckLessThan`,(e,t)=>{S.init(e,t);let n=Zt[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),$t=a(`$ZodCheckGreaterThan`,(e,t)=>{S.init(e,t);let n=Zt[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),en=a(`$ZodCheckMultipleOf`,(e,t)=>{S.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):le(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),tn=a(`$ZodCheckNumberFormat`,(e,t)=>{S.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=Re[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=Ht)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inst:e})}}),nn=a(`$ZodCheckBigIntFormat`,(e,t)=>{S.init(e,t);let[n,r]=ze[t.format];e._zod.onattach.push(e=>{let i=e._zod.bag;i.format=t.format,i.minimum=n,i.maximum=r}),e._zod.check=i=>{let a=i.value;a<n&&i.issues.push({origin:`bigint`,input:a,code:`too_small`,minimum:n,inclusive:!0,inst:e,continue:!t.abort}),a>r&&i.issues.push({origin:`bigint`,input:a,code:`too_big`,maximum:r,inst:e})}}),rn=a(`$ZodCheckMaxSize`,(e,t)=>{var n;S.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!se(t)&&t.size!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;r.size<=t.maximum||n.issues.push({origin:ke(r),code:`too_big`,maximum:t.maximum,input:r,inst:e,continue:!t.abort})}}),an=a(`$ZodCheckMinSize`,(e,t)=>{var n;S.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!se(t)&&t.size!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;r.size>=t.minimum||n.issues.push({origin:ke(r),code:`too_small`,minimum:t.minimum,input:r,inst:e,continue:!t.abort})}}),on=a(`$ZodCheckSizeEquals`,(e,t)=>{var n;S.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!se(t)&&t.size!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.size,n.maximum=t.size,n.size=t.size}),e._zod.check=n=>{let r=n.value,i=r.size;if(i===t.size)return;let a=i>t.size;n.issues.push({origin:ke(r),...a?{code:`too_big`,maximum:t.size}:{code:`too_small`,minimum:t.size},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),sn=a(`$ZodCheckMaxLength`,(e,t)=>{var n;S.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!se(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=Ae(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),cn=a(`$ZodCheckMinLength`,(e,t)=>{var n;S.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!se(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=Ae(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),ln=a(`$ZodCheckLengthEquals`,(e,t)=>{var n;S.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!se(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=Ae(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),un=a(`$ZodCheckStringFormat`,(e,t)=>{var n,r;S.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),dn=a(`$ZodCheckRegex`,(e,t)=>{un.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),fn=a(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=qt,un.init(e,t)}),pn=a(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=Jt,un.init(e,t)}),mn=a(`$ZodCheckIncludes`,(e,t)=>{S.init(e,t);let n=ve(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),hn=a(`$ZodCheckStartsWith`,(e,t)=>{S.init(e,t);let n=RegExp(`^${ve(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),gn=a(`$ZodCheckEndsWith`,(e,t)=>{S.init(e,t);let n=RegExp(`.*${ve(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),_n=a(`$ZodCheckProperty`,(e,t)=>{S.init(e,t),e._zod.check=e=>{let n=t.schema._zod.run({value:e.value[t.property],issues:[]},{});if(n instanceof Promise)return n.then(n=>Xt(n,e,t.property));Xt(n,e,t.property)}}),vn=a(`$ZodCheckMimeType`,(e,t)=>{S.init(e,t);let n=new Set(t.mime);e._zod.onattach.push(e=>{e._zod.bag.mime=t.mime}),e._zod.check=r=>{n.has(r.value.type)||r.issues.push({code:`invalid_value`,values:t.mime,input:r.value.type,inst:e})}}),yn=a(`$ZodCheckOverwrite`,(e,t)=>{S.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}})})),xn,Sn=t((()=>{xn=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`\n`).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(`\n`))}}})),Cn,wn=t((()=>{Cn={major:4,minor:0,patch:0}}));function Tn(e){if(e===``)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}function En(e){if(!Pt.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return Tn(t.padEnd(Math.ceil(t.length/4)*4,`=`))}function Dn(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}function On(e,t,n){e.issues.length&&t.issues.push(...y(n,e.issues)),t.value[n]=e.value}function kn(e,t,n){e.issues.length&&t.issues.push(...y(n,e.issues)),t.value[n]=e.value}function An(e,t,n,r){e.issues.length?r[n]===void 0?n in r?t.value[n]=void 0:t.value[n]=e.value:t.issues.push(...y(n,e.issues)):e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function jn(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;return t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>b(e,r,o())))}),t}function Mn(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(ge(e)&&ge(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=Mn(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=Mn(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Nn(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),De(e))return e;let r=Mn(t.value,n.value);if(!r.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return e.value=r.data,e}function Pn(e,t,n){e.issues.length&&t.issues.push(...y(n,e.issues)),t.value[n]=e.value}function Fn(e,t,n,r,i,a,s){e.issues.length&&(Ie.has(typeof r)?n.issues.push(...y(r,e.issues)):n.issues.push({origin:`map`,code:`invalid_key`,input:i,inst:a,issues:e.issues.map(e=>b(e,s,o()))})),t.issues.length&&(Ie.has(typeof r)?n.issues.push(...y(r,t.issues)):n.issues.push({origin:`map`,code:`invalid_element`,input:i,inst:a,key:r,issues:t.issues.map(e=>b(e,s,o()))})),n.value.set(e.value,t.value)}function In(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}function Ln(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}function Rn(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}function zn(e,t,n){return De(e)?e:t.out._zod.run({value:e.value,issues:e.issues},n)}function Bn(e){return e.value=Object.freeze(e.value),e}function Vn(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(je(e))}}var C,Hn,w,Un,Wn,Gn,Kn,qn,Jn,Yn,Xn,Zn,Qn,$n,er,tr,nr,rr,ir,ar,or,sr,cr,lr,ur,dr,fr,pr,mr,hr,gr,_r,vr,yr,br,xr,Sr,Cr,wr,Tr,Er,Dr,Or,kr,Ar,jr,Mr,Nr,Pr,Fr,Ir,Lr,Rr,zr,Br,Vr,Hr,Ur,Wr,Gr,Kr,qr,Jr,Yr,Xr,Zr,Qr,$r=t((()=>{bn(),d(),Sn(),it(),Yt(),x(),wn(),C=a(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Cn;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=De(e),i;for(let a of t){if(a._zod.def.when){if(!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new l;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=De(e,t))});else{if(e.issues.length===t)continue;r||=De(e,t)}}return i?i.then(()=>e):e};e._zod.run=(n,i)=>{let a=e._zod.parse(n,i);if(a instanceof Promise){if(i.async===!1)throw new l;return a.then(e=>t(e,r,i))}return t(a,r,i)}}e[`~standard`]={validate:t=>{try{let n=tt(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return rt(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}}),Hn=a(`$ZodString`,(e,t)=>{C.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Bt(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),w=a(`$ZodStringFormat`,(e,t)=>{un.init(e,t),Hn.init(e,t)}),Un=a(`$ZodGUID`,(e,t)=>{t.pattern??=vt,w.init(e,t)}),Wn=a(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: \"${t.version}\"`);t.pattern??=yt(e)}else t.pattern??=yt();w.init(e,t)}),Gn=a(`$ZodEmail`,(e,t)=>{t.pattern??=Ct,w.init(e,t)}),Kn=a(`$ZodURL`,(e,t)=>{w.init(e,t),e._zod.check=n=>{try{let r=n.value,i=new URL(r),a=i.href;t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:Ft.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),n.value=!r.endsWith(`/`)&&a.endsWith(`/`)?a.slice(0,-1):a;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),qn=a(`$ZodEmoji`,(e,t)=>{t.pattern??=ot(),w.init(e,t)}),Jn=a(`$ZodNanoID`,(e,t)=>{t.pattern??=ht,w.init(e,t)}),Yn=a(`$ZodCUID`,(e,t)=>{t.pattern??=ut,w.init(e,t)}),Xn=a(`$ZodCUID2`,(e,t)=>{t.pattern??=dt,w.init(e,t)}),Zn=a(`$ZodULID`,(e,t)=>{t.pattern??=ft,w.init(e,t)}),Qn=a(`$ZodXID`,(e,t)=>{t.pattern??=pt,w.init(e,t)}),$n=a(`$ZodKSUID`,(e,t)=>{t.pattern??=mt,w.init(e,t)}),er=a(`$ZodISODateTime`,(e,t)=>{t.pattern??=lt(t),w.init(e,t)}),tr=a(`$ZodISODate`,(e,t)=>{t.pattern??=zt,w.init(e,t)}),nr=a(`$ZodISOTime`,(e,t)=>{t.pattern??=ct(t),w.init(e,t)}),rr=a(`$ZodISODuration`,(e,t)=>{t.pattern??=gt,w.init(e,t)}),ir=a(`$ZodIPv4`,(e,t)=>{t.pattern??=kt,w.init(e,t),e._zod.onattach.push(e=>{let t=e._zod.bag;t.format=`ipv4`})}),ar=a(`$ZodIPv6`,(e,t)=>{t.pattern??=At,w.init(e,t),e._zod.onattach.push(e=>{let t=e._zod.bag;t.format=`ipv6`}),e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),or=a(`$ZodCIDRv4`,(e,t)=>{t.pattern??=jt,w.init(e,t)}),sr=a(`$ZodCIDRv6`,(e,t)=>{t.pattern??=Mt,w.init(e,t),e._zod.check=n=>{let[r,i]=n.value.split(`/`);try{if(!i)throw Error();let e=Number(i);if(`${e}`!==i||e<0||e>128)throw Error();new URL(`http://[${r}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}}),cr=a(`$ZodBase64`,(e,t)=>{t.pattern??=Nt,w.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding=`base64`}),e._zod.check=n=>{Tn(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),lr=a(`$ZodBase64URL`,(e,t)=>{t.pattern??=Pt,w.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding=`base64url`}),e._zod.check=n=>{En(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),ur=a(`$ZodE164`,(e,t)=>{t.pattern??=Lt,w.init(e,t)}),dr=a(`$ZodJWT`,(e,t)=>{w.init(e,t),e._zod.check=n=>{Dn(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),fr=a(`$ZodCustomStringFormat`,(e,t)=>{w.init(e,t),e._zod.check=n=>{t.fn(n.value)||n.issues.push({code:`invalid_format`,format:t.format,input:n.value,inst:e,continue:!t.abort})}}),pr=a(`$ZodNumber`,(e,t)=>{C.init(e,t),e._zod.pattern=e._zod.bag.pattern??Ut,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),mr=a(`$ZodNumber`,(e,t)=>{tn.init(e,t),pr.init(e,t)}),hr=a(`$ZodBoolean`,(e,t)=>{C.init(e,t),e._zod.pattern=Wt,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),gr=a(`$ZodBigInt`,(e,t)=>{C.init(e,t),e._zod.pattern=Vt,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=BigInt(n.value)}catch{}return typeof n.value==`bigint`||n.issues.push({expected:`bigint`,code:`invalid_type`,input:n.value,inst:e}),n}}),_r=a(`$ZodBigInt`,(e,t)=>{nn.init(e,t),gr.init(e,t)}),vr=a(`$ZodSymbol`,(e,t)=>{C.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return typeof r==`symbol`||t.issues.push({expected:`symbol`,code:`invalid_type`,input:r,inst:e}),t}}),yr=a(`$ZodUndefined`,(e,t)=>{C.init(e,t),e._zod.pattern=Kt,e._zod.values=new Set([void 0]),e._zod.optin=`optional`,e._zod.optout=`optional`,e._zod.parse=(t,n)=>{let r=t.value;return r===void 0||t.issues.push({expected:`undefined`,code:`invalid_type`,input:r,inst:e}),t}}),br=a(`$ZodNull`,(e,t)=>{C.init(e,t),e._zod.pattern=Gt,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return r===null||t.issues.push({expected:`null`,code:`invalid_type`,input:r,inst:e}),t}}),xr=a(`$ZodAny`,(e,t)=>{C.init(e,t),e._zod.parse=e=>e}),Sr=a(`$ZodUnknown`,(e,t)=>{C.init(e,t),e._zod.parse=e=>e}),Cr=a(`$ZodNever`,(e,t)=>{C.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)}),wr=a(`$ZodVoid`,(e,t)=>{C.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return r===void 0||t.issues.push({expected:`void`,code:`invalid_type`,input:r,inst:e}),t}}),Tr=a(`$ZodDate`,(e,t)=>{C.init(e,t),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=new Date(n.value)}catch{}let i=n.value,a=i instanceof Date;return a&&!Number.isNaN(i.getTime())||n.issues.push({expected:`date`,code:`invalid_type`,input:i,...a?{received:`Invalid Date`}:{},inst:e}),n}}),Er=a(`$ZodArray`,(e,t)=>{C.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>On(t,n,e))):On(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}}),Dr=a(`$ZodObject`,(e,t)=>{C.init(e,t);let n=oe(()=>{let e=Object.keys(t.shape);for(let n of e)if(!(t.shape[n]instanceof C))throw Error(`Invalid element at key \"${n}\": expected a Zod schema`);let n=be(t.shape);return{shape:t.shape,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(n)}});h(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=e=>{let t=new xn([`shape`,`payload`,`ctx`]),r=n.value,i=e=>{let t=me(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of r.keys)a[e]=`key_${o++}`;t.write(`const newResult = {}`);for(let e of r.keys)if(r.optionalKeys.has(e)){let n=a[e];t.write(`const ${n} = ${i(e)};`);let r=me(e);t.write(`\n if (${n}.issues.length) {\n if (input[${r}] === undefined) {\n if (${r} in input) {\n newResult[${r}] = undefined;\n }\n } else {\n payload.issues = payload.issues.concat(\n ${n}.issues.map((iss) => ({\n ...iss,\n path: iss.path ? [${r}, ...iss.path] : [${r}],\n }))\n );\n }\n } else if (${n}.value === undefined) {\n if (${r} in input) newResult[${r}] = undefined;\n } else {\n newResult[${r}] = ${n}.value;\n }\n `)}else{let n=a[e];t.write(`const ${n} = ${i(e)};`),t.write(`\n if (${n}.issues.length) payload.issues = payload.issues.concat(${n}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${me(e)}, ...iss.path] : [${me(e)}]\n })));`),t.write(`newResult[${me(e)}] = ${n}.value`)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},i,a=he,o=!u.jitless,s=o&&Pe.value,c=t.catchall,l;e._zod.parse=(u,d)=>{l??=n.value;let f=u.value;if(!a(f))return u.issues.push({expected:`object`,code:`invalid_type`,input:f,inst:e}),u;let p=[];if(o&&s&&d?.async===!1&&d.jitless!==!0)i||=r(t.shape),u=i(u,d);else{u.value={};let e=l.shape;for(let t of l.keys){let n=e[t],r=n._zod.run({value:f[t],issues:[]},d),i=n._zod.optin===`optional`&&n._zod.optout===`optional`;r instanceof Promise?p.push(r.then(e=>i?An(e,u,t,f):kn(e,u,t))):i?An(r,u,t,f):kn(r,u,t)}}if(!c)return p.length?Promise.all(p).then(()=>u):u;let ee=[],te=l.keySet,ne=c._zod,re=ne.def.type;for(let e of Object.keys(f)){if(te.has(e))continue;if(re===`never`){ee.push(e);continue}let t=ne.run({value:f[e],issues:[]},d);t instanceof Promise?p.push(t.then(t=>kn(t,u,e))):kn(t,u,e)}return ee.length&&u.issues.push({code:`unrecognized_keys`,keys:ee,input:f,inst:e}),p.length?Promise.all(p).then(()=>u):u}}),Or=a(`$ZodUnion`,(e,t)=>{C.init(e,t),h(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),h(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),h(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),h(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>ce(e.source)).join(`|`)})$`)}}),e._zod.parse=(n,r)=>{let i=!1,a=[];for(let e of t.options){let t=e._zod.run({value:n.value,issues:[]},r);if(t instanceof Promise)a.push(t),i=!0;else{if(t.issues.length===0)return t;a.push(t)}}return i?Promise.all(a).then(t=>jn(t,n,e,r)):jn(a,n,e,r)}}),kr=a(`$ZodDiscriminatedUnion`,(e,t)=>{Or.init(e,t);let n=e._zod.parse;h(e._zod,`propValues`,()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||Object.keys(r).length===0)throw Error(`Invalid discriminated union option at index \"${t.options.indexOf(n)}\"`);for(let[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(let r of n)e[t].add(r)}}return e});let r=oe(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues[t.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index \"${t.options.indexOf(r)}\"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value \"${String(t)}\"`);n.set(t,r)}}return n});e._zod.parse=(i,a)=>{let o=i.value;if(!he(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=r.value.get(o?.[t.discriminator]);return s?s._zod.run(i,a):t.unionFallback?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,input:o,path:[t.discriminator],inst:e}),i)}}),Ar=a(`$ZodIntersection`,(e,t)=>{C.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>Nn(e,t,n)):Nn(e,i,a)}}),jr=a(`$ZodTuple`,(e,t)=>{C.init(e,t);let n=t.items,r=n.length-[...n].reverse().findIndex(e=>e._zod.optin!==`optional`);e._zod.parse=(i,a)=>{let o=i.value;if(!Array.isArray(o))return i.issues.push({input:o,inst:e,expected:`tuple`,code:`invalid_type`}),i;i.value=[];let s=[];if(!t.rest){let t=o.length>n.length,a=o.length<r-1;if(t||a)return i.issues.push({input:o,inst:e,origin:`array`,...t?{code:`too_big`,maximum:n.length}:{code:`too_small`,minimum:n.length}}),i}let c=-1;for(let e of n){if(c++,c>=o.length&&c>=r)continue;let t=e._zod.run({value:o[c],issues:[]},a);t instanceof Promise?s.push(t.then(e=>Pn(e,i,c))):Pn(t,i,c)}if(t.rest){let e=o.slice(n.length);for(let n of e){c++;let e=t.rest._zod.run({value:n,issues:[]},a);e instanceof Promise?s.push(e.then(e=>Pn(e,i,c))):Pn(e,i,c)}}return s.length?Promise.all(s).then(()=>i):i}}),Mr=a(`$ZodRecord`,(e,t)=>{C.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!ge(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[];if(t.keyType._zod.values){let o=t.keyType._zod.values;n.value={};for(let e of o)if(typeof e==`string`||typeof e==`number`||typeof e==`symbol`){let o=t.valueType._zod.run({value:i[e],issues:[]},r);o instanceof Promise?a.push(o.then(t=>{t.issues.length&&n.issues.push(...y(e,t.issues)),n.value[e]=t.value})):(o.issues.length&&n.issues.push(...y(e,o.issues)),n.value[e]=o.value)}let s;for(let e in i)o.has(e)||(s??=[],s.push(e));s&&s.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:s})}else{n.value={};for(let s of Reflect.ownKeys(i)){if(s===`__proto__`)continue;let c=t.keyType._zod.run({value:s,issues:[]},r);if(c instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(c.issues.length){n.issues.push({origin:`record`,code:`invalid_key`,issues:c.issues.map(e=>b(e,r,o())),input:s,path:[s],inst:e}),n.value[c.value]=c.value;continue}let l=t.valueType._zod.run({value:i[s],issues:[]},r);l instanceof Promise?a.push(l.then(e=>{e.issues.length&&n.issues.push(...y(s,e.issues)),n.value[c.value]=e.value})):(l.issues.length&&n.issues.push(...y(s,l.issues)),n.value[c.value]=l.value)}}return a.length?Promise.all(a).then(()=>n):n}}),Nr=a(`$ZodMap`,(e,t)=>{C.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!(i instanceof Map))return n.issues.push({expected:`map`,code:`invalid_type`,input:i,inst:e}),n;let a=[];n.value=new Map;for(let[o,s]of i){let c=t.keyType._zod.run({value:o,issues:[]},r),l=t.valueType._zod.run({value:s,issues:[]},r);c instanceof Promise||l instanceof Promise?a.push(Promise.all([c,l]).then(([t,a])=>{Fn(t,a,n,o,i,e,r)})):Fn(c,l,n,o,i,e,r)}return a.length?Promise.all(a).then(()=>n):n}}),Pr=a(`$ZodSet`,(e,t)=>{C.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!(i instanceof Set))return n.issues.push({input:i,inst:e,expected:`set`,code:`invalid_type`}),n;let a=[];n.value=new Set;for(let e of i){let i=t.valueType._zod.run({value:e,issues:[]},r);i instanceof Promise?a.push(i.then(e=>In(e,n))):In(i,n)}return a.length?Promise.all(a).then(()=>n):n}}),Fr=a(`$ZodEnum`,(e,t)=>{C.init(e,t);let n=ie(t.entries);e._zod.values=new Set(n),e._zod.pattern=RegExp(`^(${n.filter(e=>Ie.has(typeof e)).map(e=>typeof e==`string`?ve(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,r)=>{let i=t.value;return e._zod.values.has(i)||t.issues.push({code:`invalid_value`,values:n,input:i,inst:e}),t}}),Ir=a(`$ZodLiteral`,(e,t)=>{C.init(e,t),e._zod.values=new Set(t.values),e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?ve(e):e?e.toString():String(e)).join(`|`)})$`),e._zod.parse=(n,r)=>{let i=n.value;return e._zod.values.has(i)||n.issues.push({code:`invalid_value`,values:t.values,input:i,inst:e}),n}}),Lr=a(`$ZodFile`,(e,t)=>{C.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return r instanceof File||t.issues.push({expected:`file`,code:`invalid_type`,input:r,inst:e}),t}}),Rr=a(`$ZodTransform`,(e,t)=>{C.init(e,t),e._zod.parse=(e,n)=>{let r=t.transform(e.value,e);if(n.async)return(r instanceof Promise?r:Promise.resolve(r)).then(t=>(e.value=t,e));if(r instanceof Promise)throw new l;return e.value=r,e}}),zr=a(`$ZodOptional`,(e,t)=>{C.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,h(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),h(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${ce(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>t.innerType._zod.optin===`optional`?t.innerType._zod.run(e,n):e.value===void 0?e:t.innerType._zod.run(e,n)}),Br=a(`$ZodNullable`,(e,t)=>{C.init(e,t),h(e._zod,`optin`,()=>t.innerType._zod.optin),h(e._zod,`optout`,()=>t.innerType._zod.optout),h(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${ce(e.source)}|null)$`):void 0}),h(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Vr=a(`$ZodDefault`,(e,t)=>{C.init(e,t),e._zod.optin=`optional`,h(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Ln(e,t)):Ln(r,t)}}),Hr=a(`$ZodPrefault`,(e,t)=>{C.init(e,t),e._zod.optin=`optional`,h(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),Ur=a(`$ZodNonOptional`,(e,t)=>{C.init(e,t),h(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>Rn(t,e)):Rn(i,e)}}),Wr=a(`$ZodSuccess`,(e,t)=>{C.init(e,t),e._zod.parse=(e,n)=>{let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>(e.value=t.issues.length===0,e)):(e.value=r.issues.length===0,e)}}),Gr=a(`$ZodCatch`,(e,t)=>{C.init(e,t),e._zod.optin=`optional`,h(e._zod,`optout`,()=>t.innerType._zod.optout),h(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>b(e,n,o()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>b(e,n,o()))},input:e.value}),e.issues=[]),e)}}),Kr=a(`$ZodNaN`,(e,t)=>{C.init(e,t),e._zod.parse=(t,n)=>((typeof t.value!=`number`||!Number.isNaN(t.value))&&t.issues.push({input:t.value,inst:e,expected:`nan`,code:`invalid_type`}),t)}),qr=a(`$ZodPipe`,(e,t)=>{C.init(e,t),h(e._zod,`values`,()=>t.in._zod.values),h(e._zod,`optin`,()=>t.in._zod.optin),h(e._zod,`optout`,()=>t.out._zod.optout),e._zod.parse=(e,n)=>{let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>zn(e,t,n)):zn(r,t,n)}}),Jr=a(`$ZodReadonly`,(e,t)=>{C.init(e,t),h(e._zod,`propValues`,()=>t.innerType._zod.propValues),h(e._zod,`values`,()=>t.innerType._zod.values),h(e._zod,`optin`,()=>t.innerType._zod.optin),h(e._zod,`optout`,()=>t.innerType._zod.optout),e._zod.parse=(e,n)=>{let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Bn):Bn(r)}}),Yr=a(`$ZodTemplateLiteral`,(e,t)=>{C.init(e,t);let n=[];for(let e of t.parts)if(e instanceof C){if(!e._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...e._zod.traits].shift()}`);let t=e._zod.pattern instanceof RegExp?e._zod.pattern.source:e._zod.pattern;if(!t)throw Error(`Invalid template literal part: ${e._zod.traits}`);let r=+!!t.startsWith(`^`),i=t.endsWith(`$`)?t.length-1:t.length;n.push(t.slice(r,i))}else if(e===null||Le.has(typeof e))n.push(ve(`${e}`));else throw Error(`Invalid template literal part: ${e}`);e._zod.pattern=RegExp(`^${n.join(``)}$`),e._zod.parse=(t,n)=>typeof t.value==`string`?(e._zod.pattern.lastIndex=0,e._zod.pattern.test(t.value)||t.issues.push({input:t.value,inst:e,code:`invalid_format`,format:`template_literal`,pattern:e._zod.pattern.source}),t):(t.issues.push({input:t.value,inst:e,expected:`template_literal`,code:`invalid_type`}),t)}),Xr=a(`$ZodPromise`,(e,t)=>{C.init(e,t),e._zod.parse=(e,n)=>Promise.resolve(e.value).then(e=>t.innerType._zod.run({value:e,issues:[]},n))}),Zr=a(`$ZodLazy`,(e,t)=>{C.init(e,t),h(e._zod,`innerType`,()=>t.getter()),h(e._zod,`pattern`,()=>e._zod.innerType._zod.pattern),h(e._zod,`propValues`,()=>e._zod.innerType._zod.propValues),h(e._zod,`optin`,()=>e._zod.innerType._zod.optin),h(e._zod,`optout`,()=>e._zod.innerType._zod.optout),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),Qr=a(`$ZodCustom`,(e,t)=>{S.init(e,t),C.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>Vn(t,n,r,e));Vn(i,n,r,e)}})}));function ei(){return{localeError:ti()}}var ti,ni=t((()=>{x(),ti=()=>{let e={string:{unit:`حرف`,verb:`أن يحوي`},file:{unit:`بايت`,verb:`أن يحوي`},array:{unit:`عنصر`,verb:`أن يحوي`},set:{unit:`عنصر`,verb:`أن يحوي`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`number`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`مدخل`,email:`بريد إلكتروني`,url:`رابط`,emoji:`إيموجي`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`تاريخ ووقت بمعيار ISO`,date:`تاريخ بمعيار ISO`,time:`وقت بمعيار ISO`,duration:`مدة بمعيار ISO`,ipv4:`عنوان IPv4`,ipv6:`عنوان IPv6`,cidrv4:`مدى عناوين بصيغة IPv4`,cidrv6:`مدى عناوين بصيغة IPv6`,base64:`نَص بترميز base64-encoded`,base64url:`نَص بترميز base64url-encoded`,json_string:`نَص على هيئة JSON`,e164:`رقم هاتف بمعيار E.164`,jwt:`JWT`,template_literal:`مدخل`};return e=>{switch(e.code){case`invalid_type`:return`مدخلات غير مقبولة: يفترض إدخال ${e.expected}، ولكن تم إدخال ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`مدخلات غير مقبولة: يفترض إدخال ${v(e.values[0])}`:`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${m(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?` أكبر من اللازم: يفترض أن تكون ${e.origin??`القيمة`} ${n} ${e.maximum.toString()} ${r.unit??`عنصر`}`:`أكبر من اللازم: يفترض أن تكون ${e.origin??`القيمة`} ${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`أصغر من اللازم: يفترض لـ ${e.origin} أن يكون ${n} ${e.minimum.toString()} ${r.unit}`:`أصغر من اللازم: يفترض لـ ${e.origin} أن يكون ${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`نَص غير مقبول: يجب أن يبدأ بـ \"${e.prefix}\"`:t.format===`ends_with`?`نَص غير مقبول: يجب أن ينتهي بـ \"${t.suffix}\"`:t.format===`includes`?`نَص غير مقبول: يجب أن يتضمَّن \"${t.includes}\"`:t.format===`regex`?`نَص غير مقبول: يجب أن يطابق النمط ${t.pattern}`:`${r[t.format]??e.format} غير مقبول`}case`not_multiple_of`:return`رقم غير مقبول: يجب أن يكون من مضاعفات ${e.divisor}`;case`unrecognized_keys`:return`معرف${e.keys.length>1?`ات`:``} غريب${e.keys.length>1?`ة`:``}: ${m(e.keys,`، `)}`;case`invalid_key`:return`معرف غير مقبول في ${e.origin}`;case`invalid_union`:return`مدخل غير مقبول`;case`invalid_element`:return`مدخل غير مقبول في ${e.origin}`;default:return`مدخل غير مقبول`}}}}));function ri(){return{localeError:ii()}}var ii,ai=t((()=>{x(),ii=()=>{let e={string:{unit:`simvol`,verb:`olmalıdır`},file:{unit:`bayt`,verb:`olmalıdır`},array:{unit:`element`,verb:`olmalıdır`},set:{unit:`element`,verb:`olmalıdır`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`number`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,jwt:`JWT`,template_literal:`input`};return e=>{switch(e.code){case`invalid_type`:return`Yanlış dəyər: gözlənilən ${e.expected}, daxil olan ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Yanlış dəyər: gözlənilən ${v(e.values[0])}`:`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${m(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Çox böyük: gözlənilən ${e.origin??`dəyər`} ${n}${e.maximum.toString()} ${r.unit??`element`}`:`Çox böyük: gözlənilən ${e.origin??`dəyər`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Çox kiçik: gözlənilən ${e.origin} ${n}${e.minimum.toString()} ${r.unit}`:`Çox kiçik: gözlənilən ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Yanlış mətn: \"${t.prefix}\" ilə başlamalıdır`:t.format===`ends_with`?`Yanlış mətn: \"${t.suffix}\" ilə bitməlidir`:t.format===`includes`?`Yanlış mətn: \"${t.includes}\" daxil olmalıdır`:t.format===`regex`?`Yanlış mətn: ${t.pattern} şablonuna uyğun olmalıdır`:`Yanlış ${r[t.format]??e.format}`}case`not_multiple_of`:return`Yanlış ədəd: ${e.divisor} ilə bölünə bilən olmalıdır`;case`unrecognized_keys`:return`Tanınmayan açar${e.keys.length>1?`lar`:``}: ${m(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} daxilində yanlış açar`;case`invalid_union`:return`Yanlış dəyər`;case`invalid_element`:return`${e.origin} daxilində yanlış dəyər`;default:return`Yanlış dəyər`}}}}));function oi(e,t,n,r){let i=Math.abs(e),a=i%10,o=i%100;return o>=11&&o<=19?r:a===1?t:a>=2&&a<=4?n:r}function si(){return{localeError:ci()}}var ci,li=t((()=>{x(),ci=()=>{let e={string:{unit:{one:`сімвал`,few:`сімвалы`,many:`сімвалаў`},verb:`мець`},array:{unit:{one:`элемент`,few:`элементы`,many:`элементаў`},verb:`мець`},set:{unit:{one:`элемент`,few:`элементы`,many:`элементаў`},verb:`мець`},file:{unit:{one:`байт`,few:`байты`,many:`байтаў`},verb:`мець`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`лік`;case`object`:if(Array.isArray(e))return`масіў`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`увод`,email:`email адрас`,url:`URL`,emoji:`эмодзі`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO дата і час`,date:`ISO дата`,time:`ISO час`,duration:`ISO працягласць`,ipv4:`IPv4 адрас`,ipv6:`IPv6 адрас`,cidrv4:`IPv4 дыяпазон`,cidrv6:`IPv6 дыяпазон`,base64:`радок у фармаце base64`,base64url:`радок у фармаце base64url`,json_string:`JSON радок`,e164:`нумар E.164`,jwt:`JWT`,template_literal:`увод`};return e=>{switch(e.code){case`invalid_type`:return`Няправільны ўвод: чакаўся ${e.expected}, атрымана ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Няправільны ўвод: чакалася ${v(e.values[0])}`:`Няправільны варыянт: чакаўся адзін з ${m(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);if(r){let t=oi(Number(e.maximum),r.unit.one,r.unit.few,r.unit.many);return`Занадта вялікі: чакалася, што ${e.origin??`значэнне`} павінна ${r.verb} ${n}${e.maximum.toString()} ${t}`}return`Занадта вялікі: чакалася, што ${e.origin??`значэнне`} павінна быць ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);if(r){let t=oi(Number(e.minimum),r.unit.one,r.unit.few,r.unit.many);return`Занадта малы: чакалася, што ${e.origin} павінна ${r.verb} ${n}${e.minimum.toString()} ${t}`}return`Занадта малы: чакалася, што ${e.origin} павінна быць ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Няправільны радок: павінен пачынацца з \"${t.prefix}\"`:t.format===`ends_with`?`Няправільны радок: павінен заканчвацца на \"${t.suffix}\"`:t.format===`includes`?`Няправільны радок: павінен змяшчаць \"${t.includes}\"`:t.format===`regex`?`Няправільны радок: павінен адпавядаць шаблону ${t.pattern}`:`Няправільны ${r[t.format]??e.format}`}case`not_multiple_of`:return`Няправільны лік: павінен быць кратным ${e.divisor}`;case`unrecognized_keys`:return`Нераспазнаны ${e.keys.length>1?`ключы`:`ключ`}: ${m(e.keys,`, `)}`;case`invalid_key`:return`Няправільны ключ у ${e.origin}`;case`invalid_union`:return`Няправільны ўвод`;case`invalid_element`:return`Няправільнае значэнне ў ${e.origin}`;default:return`Няправільны ўвод`}}}}));function ui(){return{localeError:di()}}var di,fi=t((()=>{x(),di=()=>{let e={string:{unit:`caràcters`,verb:`contenir`},file:{unit:`bytes`,verb:`contenir`},array:{unit:`elements`,verb:`contenir`},set:{unit:`elements`,verb:`contenir`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`number`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`entrada`,email:`adreça electrònica`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`data i hora ISO`,date:`data ISO`,time:`hora ISO`,duration:`durada ISO`,ipv4:`adreça IPv4`,ipv6:`adreça IPv6`,cidrv4:`rang IPv4`,cidrv6:`rang IPv6`,base64:`cadena codificada en base64`,base64url:`cadena codificada en base64url`,json_string:`cadena JSON`,e164:`número E.164`,jwt:`JWT`,template_literal:`entrada`};return e=>{switch(e.code){case`invalid_type`:return`Tipus invàlid: s'esperava ${e.expected}, s'ha rebut ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Valor invàlid: s'esperava ${v(e.values[0])}`:`Opció invàlida: s'esperava una de ${m(e.values,` o `)}`;case`too_big`:{let n=e.inclusive?`com a màxim`:`menys de`,r=t(e.origin);return r?`Massa gran: s'esperava que ${e.origin??`el valor`} contingués ${n} ${e.maximum.toString()} ${r.unit??`elements`}`:`Massa gran: s'esperava que ${e.origin??`el valor`} fos ${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`com a mínim`:`més de`,r=t(e.origin);return r?`Massa petit: s'esperava que ${e.origin} contingués ${n} ${e.minimum.toString()} ${r.unit}`:`Massa petit: s'esperava que ${e.origin} fos ${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Format invàlid: ha de començar amb \"${t.prefix}\"`:t.format===`ends_with`?`Format invàlid: ha d'acabar amb \"${t.suffix}\"`:t.format===`includes`?`Format invàlid: ha d'incloure \"${t.includes}\"`:t.format===`regex`?`Format invàlid: ha de coincidir amb el patró ${t.pattern}`:`Format invàlid per a ${r[t.format]??e.format}`}case`not_multiple_of`:return`Número invàlid: ha de ser múltiple de ${e.divisor}`;case`unrecognized_keys`:return`Clau${e.keys.length>1?`s`:``} no reconeguda${e.keys.length>1?`s`:``}: ${m(e.keys,`, `)}`;case`invalid_key`:return`Clau invàlida a ${e.origin}`;case`invalid_union`:return`Entrada invàlida`;case`invalid_element`:return`Element invàlid a ${e.origin}`;default:return`Entrada invàlida`}}}}));function pi(){return{localeError:mi()}}var mi,hi=t((()=>{x(),mi=()=>{let e={string:{unit:`znaků`,verb:`mít`},file:{unit:`bajtů`,verb:`mít`},array:{unit:`prvků`,verb:`mít`},set:{unit:`prvků`,verb:`mít`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`číslo`;case`string`:return`řetězec`;case`boolean`:return`boolean`;case`bigint`:return`bigint`;case`function`:return`funkce`;case`symbol`:return`symbol`;case`undefined`:return`undefined`;case`object`:if(Array.isArray(e))return`pole`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`regulární výraz`,email:`e-mailová adresa`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`datum a čas ve formátu ISO`,date:`datum ve formátu ISO`,time:`čas ve formátu ISO`,duration:`doba trvání ISO`,ipv4:`IPv4 adresa`,ipv6:`IPv6 adresa`,cidrv4:`rozsah IPv4`,cidrv6:`rozsah IPv6`,base64:`řetězec zakódovaný ve formátu base64`,base64url:`řetězec zakódovaný ve formátu base64url`,json_string:`řetězec ve formátu JSON`,e164:`číslo E.164`,jwt:`JWT`,template_literal:`vstup`};return e=>{switch(e.code){case`invalid_type`:return`Neplatný vstup: očekáváno ${e.expected}, obdrženo ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Neplatný vstup: očekáváno ${v(e.values[0])}`:`Neplatná možnost: očekávána jedna z hodnot ${m(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Hodnota je příliš velká: ${e.origin??`hodnota`} musí mít ${n}${e.maximum.toString()} ${r.unit??`prvků`}`:`Hodnota je příliš velká: ${e.origin??`hodnota`} musí být ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Hodnota je příliš malá: ${e.origin??`hodnota`} musí mít ${n}${e.minimum.toString()} ${r.unit??`prvků`}`:`Hodnota je příliš malá: ${e.origin??`hodnota`} musí být ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Neplatný řetězec: musí začínat na \"${t.prefix}\"`:t.format===`ends_with`?`Neplatný řetězec: musí končit na \"${t.suffix}\"`:t.format===`includes`?`Neplatný řetězec: musí obsahovat \"${t.includes}\"`:t.format===`regex`?`Neplatný řetězec: musí odpovídat vzoru ${t.pattern}`:`Neplatný formát ${r[t.format]??e.format}`}case`not_multiple_of`:return`Neplatné číslo: musí být násobkem ${e.divisor}`;case`unrecognized_keys`:return`Neznámé klíče: ${m(e.keys,`, `)}`;case`invalid_key`:return`Neplatný klíč v ${e.origin}`;case`invalid_union`:return`Neplatný vstup`;case`invalid_element`:return`Neplatná hodnota v ${e.origin}`;default:return`Neplatný vstup`}}}}));function gi(){return{localeError:_i()}}var _i,vi=t((()=>{x(),_i=()=>{let e={string:{unit:`Zeichen`,verb:`zu haben`},file:{unit:`Bytes`,verb:`zu haben`},array:{unit:`Elemente`,verb:`zu haben`},set:{unit:`Elemente`,verb:`zu haben`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`Zahl`;case`object`:if(Array.isArray(e))return`Array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`Eingabe`,email:`E-Mail-Adresse`,url:`URL`,emoji:`Emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO-Datum und -Uhrzeit`,date:`ISO-Datum`,time:`ISO-Uhrzeit`,duration:`ISO-Dauer`,ipv4:`IPv4-Adresse`,ipv6:`IPv6-Adresse`,cidrv4:`IPv4-Bereich`,cidrv6:`IPv6-Bereich`,base64:`Base64-codierter String`,base64url:`Base64-URL-codierter String`,json_string:`JSON-String`,e164:`E.164-Nummer`,jwt:`JWT`,template_literal:`Eingabe`};return e=>{switch(e.code){case`invalid_type`:return`Ungültige Eingabe: erwartet ${e.expected}, erhalten ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Ungültige Eingabe: erwartet ${v(e.values[0])}`:`Ungültige Option: erwartet eine von ${m(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Zu groß: erwartet, dass ${e.origin??`Wert`} ${n}${e.maximum.toString()} ${r.unit??`Elemente`} hat`:`Zu groß: erwartet, dass ${e.origin??`Wert`} ${n}${e.maximum.toString()} ist`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Zu klein: erwartet, dass ${e.origin} ${n}${e.minimum.toString()} ${r.unit} hat`:`Zu klein: erwartet, dass ${e.origin} ${n}${e.minimum.toString()} ist`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ungültiger String: muss mit \"${t.prefix}\" beginnen`:t.format===`ends_with`?`Ungültiger String: muss mit \"${t.suffix}\" enden`:t.format===`includes`?`Ungültiger String: muss \"${t.includes}\" enthalten`:t.format===`regex`?`Ungültiger String: muss dem Muster ${t.pattern} entsprechen`:`Ungültig: ${r[t.format]??e.format}`}case`not_multiple_of`:return`Ungültige Zahl: muss ein Vielfaches von ${e.divisor} sein`;case`unrecognized_keys`:return`${e.keys.length>1?`Unbekannte Schlüssel`:`Unbekannter Schlüssel`}: ${m(e.keys,`, `)}`;case`invalid_key`:return`Ungültiger Schlüssel in ${e.origin}`;case`invalid_union`:return`Ungültige Eingabe`;case`invalid_element`:return`Ungültiger Wert in ${e.origin}`;default:return`Ungültige Eingabe`}}}}));function yi(){return{localeError:xi()}}var bi,xi,Si=t((()=>{x(),bi=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`number`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},xi=()=>{let e={string:{unit:`characters`,verb:`to have`},file:{unit:`bytes`,verb:`to have`},array:{unit:`items`,verb:`to have`},set:{unit:`items`,verb:`to have`}};function t(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,jwt:`JWT`,template_literal:`input`};return e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${e.expected}, received ${bi(e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${v(e.values[0])}`:`Invalid option: expected one of ${m(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with \"${t.prefix}\"`:t.format===`ends_with`?`Invalid string: must end with \"${t.suffix}\"`:t.format===`includes`?`Invalid string: must include \"${t.includes}\"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${m(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}}}));function Ci(){return{localeError:Ti()}}var wi,Ti,Ei=t((()=>{x(),wi=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`nombro`;case`object`:if(Array.isArray(e))return`tabelo`;if(e===null)return`senvalora`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},Ti=()=>{let e={string:{unit:`karaktrojn`,verb:`havi`},file:{unit:`bajtojn`,verb:`havi`},array:{unit:`elementojn`,verb:`havi`},set:{unit:`elementojn`,verb:`havi`}};function t(t){return e[t]??null}let n={regex:`enigo`,email:`retadreso`,url:`URL`,emoji:`emoĝio`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO-datotempo`,date:`ISO-dato`,time:`ISO-tempo`,duration:`ISO-daŭro`,ipv4:`IPv4-adreso`,ipv6:`IPv6-adreso`,cidrv4:`IPv4-rango`,cidrv6:`IPv6-rango`,base64:`64-ume kodita karaktraro`,base64url:`URL-64-ume kodita karaktraro`,json_string:`JSON-karaktraro`,e164:`E.164-nombro`,jwt:`JWT`,template_literal:`enigo`};return e=>{switch(e.code){case`invalid_type`:return`Nevalida enigo: atendiĝis ${e.expected}, riceviĝis ${wi(e.input)}`;case`invalid_value`:return e.values.length===1?`Nevalida enigo: atendiĝis ${v(e.values[0])}`:`Nevalida opcio: atendiĝis unu el ${m(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Tro granda: atendiĝis ke ${e.origin??`valoro`} havu ${n}${e.maximum.toString()} ${r.unit??`elementojn`}`:`Tro granda: atendiĝis ke ${e.origin??`valoro`} havu ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Tro malgranda: atendiĝis ke ${e.origin} havu ${n}${e.minimum.toString()} ${r.unit}`:`Tro malgranda: atendiĝis ke ${e.origin} estu ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Nevalida karaktraro: devas komenciĝi per \"${t.prefix}\"`:t.format===`ends_with`?`Nevalida karaktraro: devas finiĝi per \"${t.suffix}\"`:t.format===`includes`?`Nevalida karaktraro: devas inkluzivi \"${t.includes}\"`:t.format===`regex`?`Nevalida karaktraro: devas kongrui kun la modelo ${t.pattern}`:`Nevalida ${n[t.format]??e.format}`}case`not_multiple_of`:return`Nevalida nombro: devas esti oblo de ${e.divisor}`;case`unrecognized_keys`:return`Nekonata${e.keys.length>1?`j`:``} ŝlosilo${e.keys.length>1?`j`:``}: ${m(e.keys,`, `)}`;case`invalid_key`:return`Nevalida ŝlosilo en ${e.origin}`;case`invalid_union`:return`Nevalida enigo`;case`invalid_element`:return`Nevalida valoro en ${e.origin}`;default:return`Nevalida enigo`}}}}));function Di(){return{localeError:Oi()}}var Oi,ki=t((()=>{x(),Oi=()=>{let e={string:{unit:`caracteres`,verb:`tener`},file:{unit:`bytes`,verb:`tener`},array:{unit:`elementos`,verb:`tener`},set:{unit:`elementos`,verb:`tener`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`número`;case`object`:if(Array.isArray(e))return`arreglo`;if(e===null)return`nulo`;if(Object.getPrototypeOf(e)!==Object.prototype)return e.constructor.name}return t},r={regex:`entrada`,email:`dirección de correo electrónico`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`fecha y hora ISO`,date:`fecha ISO`,time:`hora ISO`,duration:`duración ISO`,ipv4:`dirección IPv4`,ipv6:`dirección IPv6`,cidrv4:`rango IPv4`,cidrv6:`rango IPv6`,base64:`cadena codificada en base64`,base64url:`URL codificada en base64`,json_string:`cadena JSON`,e164:`número E.164`,jwt:`JWT`,template_literal:`entrada`};return e=>{switch(e.code){case`invalid_type`:return`Entrada inválida: se esperaba ${e.expected}, recibido ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Entrada inválida: se esperaba ${v(e.values[0])}`:`Opción inválida: se esperaba una de ${m(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Demasiado grande: se esperaba que ${e.origin??`valor`} tuviera ${n}${e.maximum.toString()} ${r.unit??`elementos`}`:`Demasiado grande: se esperaba que ${e.origin??`valor`} fuera ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Demasiado pequeño: se esperaba que ${e.origin} tuviera ${n}${e.minimum.toString()} ${r.unit}`:`Demasiado pequeño: se esperaba que ${e.origin} fuera ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Cadena inválida: debe comenzar con \"${t.prefix}\"`:t.format===`ends_with`?`Cadena inválida: debe terminar en \"${t.suffix}\"`:t.format===`includes`?`Cadena inválida: debe incluir \"${t.includes}\"`:t.format===`regex`?`Cadena inválida: debe coincidir con el patrón ${t.pattern}`:`Inválido ${r[t.format]??e.format}`}case`not_multiple_of`:return`Número inválido: debe ser múltiplo de ${e.divisor}`;case`unrecognized_keys`:return`Llave${e.keys.length>1?`s`:``} desconocida${e.keys.length>1?`s`:``}: ${m(e.keys,`, `)}`;case`invalid_key`:return`Llave inválida en ${e.origin}`;case`invalid_union`:return`Entrada inválida`;case`invalid_element`:return`Valor inválido en ${e.origin}`;default:return`Entrada inválida`}}}}));function Ai(){return{localeError:ji()}}var ji,Mi=t((()=>{x(),ji=()=>{let e={string:{unit:`کاراکتر`,verb:`داشته باشد`},file:{unit:`بایت`,verb:`داشته باشد`},array:{unit:`آیتم`,verb:`داشته باشد`},set:{unit:`آیتم`,verb:`داشته باشد`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`عدد`;case`object`:if(Array.isArray(e))return`آرایه`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`ورودی`,email:`آدرس ایمیل`,url:`URL`,emoji:`ایموجی`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`تاریخ و زمان ایزو`,date:`تاریخ ایزو`,time:`زمان ایزو`,duration:`مدت زمان ایزو`,ipv4:`IPv4 آدرس`,ipv6:`IPv6 آدرس`,cidrv4:`IPv4 دامنه`,cidrv6:`IPv6 دامنه`,base64:`base64-encoded رشته`,base64url:`base64url-encoded رشته`,json_string:`JSON رشته`,e164:`E.164 عدد`,jwt:`JWT`,template_literal:`ورودی`};return e=>{switch(e.code){case`invalid_type`:return`ورودی نامعتبر: میبایست ${e.expected} میبود، ${n(e.input)} دریافت شد`;case`invalid_value`:return e.values.length===1?`ورودی نامعتبر: میبایست ${v(e.values[0])} میبود`:`گزینه نامعتبر: میبایست یکی از ${m(e.values,`|`)} میبود`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`خیلی بزرگ: ${e.origin??`مقدار`} باید ${n}${e.maximum.toString()} ${r.unit??`عنصر`} باشد`:`خیلی بزرگ: ${e.origin??`مقدار`} باید ${n}${e.maximum.toString()} باشد`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`خیلی کوچک: ${e.origin} باید ${n}${e.minimum.toString()} ${r.unit} باشد`:`خیلی کوچک: ${e.origin} باید ${n}${e.minimum.toString()} باشد`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`رشته نامعتبر: باید با \"${t.prefix}\" شروع شود`:t.format===`ends_with`?`رشته نامعتبر: باید با \"${t.suffix}\" تمام شود`:t.format===`includes`?`رشته نامعتبر: باید شامل \"${t.includes}\" باشد`:t.format===`regex`?`رشته نامعتبر: باید با الگوی ${t.pattern} مطابقت داشته باشد`:`${r[t.format]??e.format} نامعتبر`}case`not_multiple_of`:return`عدد نامعتبر: باید مضرب ${e.divisor} باشد`;case`unrecognized_keys`:return`کلید${e.keys.length>1?`های`:``} ناشناس: ${m(e.keys,`, `)}`;case`invalid_key`:return`کلید ناشناس در ${e.origin}`;case`invalid_union`:return`ورودی نامعتبر`;case`invalid_element`:return`مقدار نامعتبر در ${e.origin}`;default:return`ورودی نامعتبر`}}}}));function Ni(){return{localeError:Pi()}}var Pi,Fi=t((()=>{x(),Pi=()=>{let e={string:{unit:`merkkiä`,subject:`merkkijonon`},file:{unit:`tavua`,subject:`tiedoston`},array:{unit:`alkiota`,subject:`listan`},set:{unit:`alkiota`,subject:`joukon`},number:{unit:``,subject:`luvun`},bigint:{unit:``,subject:`suuren kokonaisluvun`},int:{unit:``,subject:`kokonaisluvun`},date:{unit:``,subject:`päivämäärän`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`number`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`säännöllinen lauseke`,email:`sähköpostiosoite`,url:`URL-osoite`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO-aikaleima`,date:`ISO-päivämäärä`,time:`ISO-aika`,duration:`ISO-kesto`,ipv4:`IPv4-osoite`,ipv6:`IPv6-osoite`,cidrv4:`IPv4-alue`,cidrv6:`IPv6-alue`,base64:`base64-koodattu merkkijono`,base64url:`base64url-koodattu merkkijono`,json_string:`JSON-merkkijono`,e164:`E.164-luku`,jwt:`JWT`,template_literal:`templaattimerkkijono`};return e=>{switch(e.code){case`invalid_type`:return`Virheellinen tyyppi: odotettiin ${e.expected}, oli ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Virheellinen syöte: täytyy olla ${v(e.values[0])}`:`Virheellinen valinta: täytyy olla yksi seuraavista: ${m(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Liian suuri: ${r.subject} täytyy olla ${n}${e.maximum.toString()} ${r.unit}`.trim():`Liian suuri: arvon täytyy olla ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Liian pieni: ${r.subject} täytyy olla ${n}${e.minimum.toString()} ${r.unit}`.trim():`Liian pieni: arvon täytyy olla ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Virheellinen syöte: täytyy alkaa \"${t.prefix}\"`:t.format===`ends_with`?`Virheellinen syöte: täytyy loppua \"${t.suffix}\"`:t.format===`includes`?`Virheellinen syöte: täytyy sisältää \"${t.includes}\"`:t.format===`regex`?`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${t.pattern}`:`Virheellinen ${r[t.format]??e.format}`}case`not_multiple_of`:return`Virheellinen luku: täytyy olla luvun ${e.divisor} monikerta`;case`unrecognized_keys`:return`${e.keys.length>1?`Tuntemattomat avaimet`:`Tuntematon avain`}: ${m(e.keys,`, `)}`;case`invalid_key`:return`Virheellinen avain tietueessa`;case`invalid_union`:return`Virheellinen unioni`;case`invalid_element`:return`Virheellinen arvo joukossa`;default:return`Virheellinen syöte`}}}}));function Ii(){return{localeError:Li()}}var Li,Ri=t((()=>{x(),Li=()=>{let e={string:{unit:`caractères`,verb:`avoir`},file:{unit:`octets`,verb:`avoir`},array:{unit:`éléments`,verb:`avoir`},set:{unit:`éléments`,verb:`avoir`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`nombre`;case`object`:if(Array.isArray(e))return`tableau`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`entrée`,email:`adresse e-mail`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`date et heure ISO`,date:`date ISO`,time:`heure ISO`,duration:`durée ISO`,ipv4:`adresse IPv4`,ipv6:`adresse IPv6`,cidrv4:`plage IPv4`,cidrv6:`plage IPv6`,base64:`chaîne encodée en base64`,base64url:`chaîne encodée en base64url`,json_string:`chaîne JSON`,e164:`numéro E.164`,jwt:`JWT`,template_literal:`entrée`};return e=>{switch(e.code){case`invalid_type`:return`Entrée invalide : ${e.expected} attendu, ${n(e.input)} reçu`;case`invalid_value`:return e.values.length===1?`Entrée invalide : ${v(e.values[0])} attendu`:`Option invalide : une valeur parmi ${m(e.values,`|`)} attendue`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Trop grand : ${e.origin??`valeur`} doit ${r.verb} ${n}${e.maximum.toString()} ${r.unit??`élément(s)`}`:`Trop grand : ${e.origin??`valeur`} doit être ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Trop petit : ${e.origin} doit ${r.verb} ${n}${e.minimum.toString()} ${r.unit}`:`Trop petit : ${e.origin} doit être ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Chaîne invalide : doit commencer par \"${t.prefix}\"`:t.format===`ends_with`?`Chaîne invalide : doit se terminer par \"${t.suffix}\"`:t.format===`includes`?`Chaîne invalide : doit inclure \"${t.includes}\"`:t.format===`regex`?`Chaîne invalide : doit correspondre au modèle ${t.pattern}`:`${r[t.format]??e.format} invalide`}case`not_multiple_of`:return`Nombre invalide : doit être un multiple de ${e.divisor}`;case`unrecognized_keys`:return`Clé${e.keys.length>1?`s`:``} non reconnue${e.keys.length>1?`s`:``} : ${m(e.keys,`, `)}`;case`invalid_key`:return`Clé invalide dans ${e.origin}`;case`invalid_union`:return`Entrée invalide`;case`invalid_element`:return`Valeur invalide dans ${e.origin}`;default:return`Entrée invalide`}}}}));function zi(){return{localeError:Bi()}}var Bi,Vi=t((()=>{x(),Bi=()=>{let e={string:{unit:`caractères`,verb:`avoir`},file:{unit:`octets`,verb:`avoir`},array:{unit:`éléments`,verb:`avoir`},set:{unit:`éléments`,verb:`avoir`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`number`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`entrée`,email:`adresse courriel`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`date-heure ISO`,date:`date ISO`,time:`heure ISO`,duration:`durée ISO`,ipv4:`adresse IPv4`,ipv6:`adresse IPv6`,cidrv4:`plage IPv4`,cidrv6:`plage IPv6`,base64:`chaîne encodée en base64`,base64url:`chaîne encodée en base64url`,json_string:`chaîne JSON`,e164:`numéro E.164`,jwt:`JWT`,template_literal:`entrée`};return e=>{switch(e.code){case`invalid_type`:return`Entrée invalide : attendu ${e.expected}, reçu ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Entrée invalide : attendu ${v(e.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${m(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`≤`:`<`,r=t(e.origin);return r?`Trop grand : attendu que ${e.origin??`la valeur`} ait ${n}${e.maximum.toString()} ${r.unit}`:`Trop grand : attendu que ${e.origin??`la valeur`} soit ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`≥`:`>`,r=t(e.origin);return r?`Trop petit : attendu que ${e.origin} ait ${n}${e.minimum.toString()} ${r.unit}`:`Trop petit : attendu que ${e.origin} soit ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Chaîne invalide : doit commencer par \"${t.prefix}\"`:t.format===`ends_with`?`Chaîne invalide : doit se terminer par \"${t.suffix}\"`:t.format===`includes`?`Chaîne invalide : doit inclure \"${t.includes}\"`:t.format===`regex`?`Chaîne invalide : doit correspondre au motif ${t.pattern}`:`${r[t.format]??e.format} invalide`}case`not_multiple_of`:return`Nombre invalide : doit être un multiple de ${e.divisor}`;case`unrecognized_keys`:return`Clé${e.keys.length>1?`s`:``} non reconnue${e.keys.length>1?`s`:``} : ${m(e.keys,`, `)}`;case`invalid_key`:return`Clé invalide dans ${e.origin}`;case`invalid_union`:return`Entrée invalide`;case`invalid_element`:return`Valeur invalide dans ${e.origin}`;default:return`Entrée invalide`}}}}));function Hi(){return{localeError:Ui()}}var Ui,Wi=t((()=>{x(),Ui=()=>{let e={string:{unit:`אותיות`,verb:`לכלול`},file:{unit:`בייטים`,verb:`לכלול`},array:{unit:`פריטים`,verb:`לכלול`},set:{unit:`פריטים`,verb:`לכלול`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`number`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`קלט`,email:`כתובת אימייל`,url:`כתובת רשת`,emoji:`אימוג'י`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`תאריך וזמן ISO`,date:`תאריך ISO`,time:`זמן ISO`,duration:`משך זמן ISO`,ipv4:`כתובת IPv4`,ipv6:`כתובת IPv6`,cidrv4:`טווח IPv4`,cidrv6:`טווח IPv6`,base64:`מחרוזת בבסיס 64`,base64url:`מחרוזת בבסיס 64 לכתובות רשת`,json_string:`מחרוזת JSON`,e164:`מספר E.164`,jwt:`JWT`,template_literal:`קלט`};return e=>{switch(e.code){case`invalid_type`:return`קלט לא תקין: צריך ${e.expected}, התקבל ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`קלט לא תקין: צריך ${v(e.values[0])}`:`קלט לא תקין: צריך אחת מהאפשרויות ${m(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`גדול מדי: ${e.origin??`value`} צריך להיות ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`גדול מדי: ${e.origin??`value`} צריך להיות ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`קטן מדי: ${e.origin} צריך להיות ${n}${e.minimum.toString()} ${r.unit}`:`קטן מדי: ${e.origin} צריך להיות ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`מחרוזת לא תקינה: חייבת להתחיל ב\"${t.prefix}\"`:t.format===`ends_with`?`מחרוזת לא תקינה: חייבת להסתיים ב \"${t.suffix}\"`:t.format===`includes`?`מחרוזת לא תקינה: חייבת לכלול \"${t.includes}\"`:t.format===`regex`?`מחרוזת לא תקינה: חייבת להתאים לתבנית ${t.pattern}`:`${r[t.format]??e.format} לא תקין`}case`not_multiple_of`:return`מספר לא תקין: חייב להיות מכפלה של ${e.divisor}`;case`unrecognized_keys`:return`מפתח${e.keys.length>1?`ות`:``} לא מזוה${e.keys.length>1?`ים`:`ה`}: ${m(e.keys,`, `)}`;case`invalid_key`:return`מפתח לא תקין ב${e.origin}`;case`invalid_union`:return`קלט לא תקין`;case`invalid_element`:return`ערך לא תקין ב${e.origin}`;default:return`קלט לא תקין`}}}}));function Gi(){return{localeError:Ki()}}var Ki,qi=t((()=>{x(),Ki=()=>{let e={string:{unit:`karakter`,verb:`legyen`},file:{unit:`byte`,verb:`legyen`},array:{unit:`elem`,verb:`legyen`},set:{unit:`elem`,verb:`legyen`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`szám`;case`object`:if(Array.isArray(e))return`tömb`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`bemenet`,email:`email cím`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO időbélyeg`,date:`ISO dátum`,time:`ISO idő`,duration:`ISO időintervallum`,ipv4:`IPv4 cím`,ipv6:`IPv6 cím`,cidrv4:`IPv4 tartomány`,cidrv6:`IPv6 tartomány`,base64:`base64-kódolt string`,base64url:`base64url-kódolt string`,json_string:`JSON string`,e164:`E.164 szám`,jwt:`JWT`,template_literal:`bemenet`};return e=>{switch(e.code){case`invalid_type`:return`Érvénytelen bemenet: a várt érték ${e.expected}, a kapott érték ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Érvénytelen bemenet: a várt érték ${v(e.values[0])}`:`Érvénytelen opció: valamelyik érték várt ${m(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Túl nagy: ${e.origin??`érték`} mérete túl nagy ${n}${e.maximum.toString()} ${r.unit??`elem`}`:`Túl nagy: a bemeneti érték ${e.origin??`érték`} túl nagy: ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Túl kicsi: a bemeneti érték ${e.origin} mérete túl kicsi ${n}${e.minimum.toString()} ${r.unit}`:`Túl kicsi: a bemeneti érték ${e.origin} túl kicsi ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Érvénytelen string: \"${t.prefix}\" értékkel kell kezdődnie`:t.format===`ends_with`?`Érvénytelen string: \"${t.suffix}\" értékkel kell végződnie`:t.format===`includes`?`Érvénytelen string: \"${t.includes}\" értéket kell tartalmaznia`:t.format===`regex`?`Érvénytelen string: ${t.pattern} mintának kell megfelelnie`:`Érvénytelen ${r[t.format]??e.format}`}case`not_multiple_of`:return`Érvénytelen szám: ${e.divisor} többszörösének kell lennie`;case`unrecognized_keys`:return`Ismeretlen kulcs${e.keys.length>1?`s`:``}: ${m(e.keys,`, `)}`;case`invalid_key`:return`Érvénytelen kulcs ${e.origin}`;case`invalid_union`:return`Érvénytelen bemenet`;case`invalid_element`:return`Érvénytelen érték: ${e.origin}`;default:return`Érvénytelen bemenet`}}}}));function Ji(){return{localeError:Yi()}}var Yi,Xi=t((()=>{x(),Yi=()=>{let e={string:{unit:`karakter`,verb:`memiliki`},file:{unit:`byte`,verb:`memiliki`},array:{unit:`item`,verb:`memiliki`},set:{unit:`item`,verb:`memiliki`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`number`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`input`,email:`alamat email`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`tanggal dan waktu format ISO`,date:`tanggal format ISO`,time:`jam format ISO`,duration:`durasi format ISO`,ipv4:`alamat IPv4`,ipv6:`alamat IPv6`,cidrv4:`rentang alamat IPv4`,cidrv6:`rentang alamat IPv6`,base64:`string dengan enkode base64`,base64url:`string dengan enkode base64url`,json_string:`string JSON`,e164:`angka E.164`,jwt:`JWT`,template_literal:`input`};return e=>{switch(e.code){case`invalid_type`:return`Input tidak valid: diharapkan ${e.expected}, diterima ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Input tidak valid: diharapkan ${v(e.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${m(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Terlalu besar: diharapkan ${e.origin??`value`} memiliki ${n}${e.maximum.toString()} ${r.unit??`elemen`}`:`Terlalu besar: diharapkan ${e.origin??`value`} menjadi ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Terlalu kecil: diharapkan ${e.origin} memiliki ${n}${e.minimum.toString()} ${r.unit}`:`Terlalu kecil: diharapkan ${e.origin} menjadi ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`String tidak valid: harus dimulai dengan \"${t.prefix}\"`:t.format===`ends_with`?`String tidak valid: harus berakhir dengan \"${t.suffix}\"`:t.format===`includes`?`String tidak valid: harus menyertakan \"${t.includes}\"`:t.format===`regex`?`String tidak valid: harus sesuai pola ${t.pattern}`:`${r[t.format]??e.format} tidak valid`}case`not_multiple_of`:return`Angka tidak valid: harus kelipatan dari ${e.divisor}`;case`unrecognized_keys`:return`Kunci tidak dikenali ${e.keys.length>1?`s`:``}: ${m(e.keys,`, `)}`;case`invalid_key`:return`Kunci tidak valid di ${e.origin}`;case`invalid_union`:return`Input tidak valid`;case`invalid_element`:return`Nilai tidak valid di ${e.origin}`;default:return`Input tidak valid`}}}}));function Zi(){return{localeError:Qi()}}var Qi,$i=t((()=>{x(),Qi=()=>{let e={string:{unit:`caratteri`,verb:`avere`},file:{unit:`byte`,verb:`avere`},array:{unit:`elementi`,verb:`avere`},set:{unit:`elementi`,verb:`avere`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`numero`;case`object`:if(Array.isArray(e))return`vettore`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`input`,email:`indirizzo email`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`data e ora ISO`,date:`data ISO`,time:`ora ISO`,duration:`durata ISO`,ipv4:`indirizzo IPv4`,ipv6:`indirizzo IPv6`,cidrv4:`intervallo IPv4`,cidrv6:`intervallo IPv6`,base64:`stringa codificata in base64`,base64url:`URL codificata in base64`,json_string:`stringa JSON`,e164:`numero E.164`,jwt:`JWT`,template_literal:`input`};return e=>{switch(e.code){case`invalid_type`:return`Input non valido: atteso ${e.expected}, ricevuto ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Input non valido: atteso ${v(e.values[0])}`:`Opzione non valida: atteso uno tra ${m(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Troppo grande: ${e.origin??`valore`} deve avere ${n}${e.maximum.toString()} ${r.unit??`elementi`}`:`Troppo grande: ${e.origin??`valore`} deve essere ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Troppo piccolo: ${e.origin} deve avere ${n}${e.minimum.toString()} ${r.unit}`:`Troppo piccolo: ${e.origin} deve essere ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Stringa non valida: deve iniziare con \"${t.prefix}\"`:t.format===`ends_with`?`Stringa non valida: deve terminare con \"${t.suffix}\"`:t.format===`includes`?`Stringa non valida: deve includere \"${t.includes}\"`:t.format===`regex`?`Stringa non valida: deve corrispondere al pattern ${t.pattern}`:`Invalid ${r[t.format]??e.format}`}case`not_multiple_of`:return`Numero non valido: deve essere un multiplo di ${e.divisor}`;case`unrecognized_keys`:return`Chiav${e.keys.length>1?`i`:`e`} non riconosciut${e.keys.length>1?`e`:`a`}: ${m(e.keys,`, `)}`;case`invalid_key`:return`Chiave non valida in ${e.origin}`;case`invalid_union`:return`Input non valido`;case`invalid_element`:return`Valore non valido in ${e.origin}`;default:return`Input non valido`}}}}));function ea(){return{localeError:ta()}}var ta,na=t((()=>{x(),ta=()=>{let e={string:{unit:`文字`,verb:`である`},file:{unit:`バイト`,verb:`である`},array:{unit:`要素`,verb:`である`},set:{unit:`要素`,verb:`である`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`数値`;case`object`:if(Array.isArray(e))return`配列`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`入力値`,email:`メールアドレス`,url:`URL`,emoji:`絵文字`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO日時`,date:`ISO日付`,time:`ISO時刻`,duration:`ISO期間`,ipv4:`IPv4アドレス`,ipv6:`IPv6アドレス`,cidrv4:`IPv4範囲`,cidrv6:`IPv6範囲`,base64:`base64エンコード文字列`,base64url:`base64urlエンコード文字列`,json_string:`JSON文字列`,e164:`E.164番号`,jwt:`JWT`,template_literal:`入力値`};return e=>{switch(e.code){case`invalid_type`:return`無効な入力: ${e.expected}が期待されましたが、${n(e.input)}が入力されました`;case`invalid_value`:return e.values.length===1?`無効な入力: ${v(e.values[0])}が期待されました`:`無効な選択: ${m(e.values,`、`)}のいずれかである必要があります`;case`too_big`:{let n=e.inclusive?`以下である`:`より小さい`,r=t(e.origin);return r?`大きすぎる値: ${e.origin??`値`}は${e.maximum.toString()}${r.unit??`要素`}${n}必要があります`:`大きすぎる値: ${e.origin??`値`}は${e.maximum.toString()}${n}必要があります`}case`too_small`:{let n=e.inclusive?`以上である`:`より大きい`,r=t(e.origin);return r?`小さすぎる値: ${e.origin}は${e.minimum.toString()}${r.unit}${n}必要があります`:`小さすぎる値: ${e.origin}は${e.minimum.toString()}${n}必要があります`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`無効な文字列: \"${t.prefix}\"で始まる必要があります`:t.format===`ends_with`?`無効な文字列: \"${t.suffix}\"で終わる必要があります`:t.format===`includes`?`無効な文字列: \"${t.includes}\"を含む必要があります`:t.format===`regex`?`無効な文字列: パターン${t.pattern}に一致する必要があります`:`無効な${r[t.format]??e.format}`}case`not_multiple_of`:return`無効な数値: ${e.divisor}の倍数である必要があります`;case`unrecognized_keys`:return`認識されていないキー${e.keys.length>1?`群`:``}: ${m(e.keys,`、`)}`;case`invalid_key`:return`${e.origin}内の無効なキー`;case`invalid_union`:return`無効な入力`;case`invalid_element`:return`${e.origin}内の無効な値`;default:return`無効な入力`}}}}));function ra(){return{localeError:ia()}}var ia,aa=t((()=>{x(),ia=()=>{let e={string:{unit:`តួអក្សរ`,verb:`គួរមាន`},file:{unit:`បៃ`,verb:`គួរមាន`},array:{unit:`ធាតុ`,verb:`គួរមាន`},set:{unit:`ធាតុ`,verb:`គួរមាន`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`មិនមែនជាលេខ (NaN)`:`លេខ`;case`object`:if(Array.isArray(e))return`អារេ (Array)`;if(e===null)return`គ្មានតម្លៃ (null)`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`ទិន្នន័យបញ្ចូល`,email:`អាសយដ្ឋានអ៊ីមែល`,url:`URL`,emoji:`សញ្ញាអារម្មណ៍`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`កាលបរិច្ឆេទ និងម៉ោង ISO`,date:`កាលបរិច្ឆេទ ISO`,time:`ម៉ោង ISO`,duration:`រយៈពេល ISO`,ipv4:`អាសយដ្ឋាន IPv4`,ipv6:`អាសយដ្ឋាន IPv6`,cidrv4:`ដែនអាសយដ្ឋាន IPv4`,cidrv6:`ដែនអាសយដ្ឋាន IPv6`,base64:`ខ្សែអក្សរអ៊ិកូដ base64`,base64url:`ខ្សែអក្សរអ៊ិកូដ base64url`,json_string:`ខ្សែអក្សរ JSON`,e164:`លេខ E.164`,jwt:`JWT`,template_literal:`ទិន្នន័យបញ្ចូល`};return e=>{switch(e.code){case`invalid_type`:return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${e.expected} ប៉ុន្តែទទួលបាន ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${v(e.values[0])}`:`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${m(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`ធំពេក៖ ត្រូវការ ${e.origin??`តម្លៃ`} ${n} ${e.maximum.toString()} ${r.unit??`ធាតុ`}`:`ធំពេក៖ ត្រូវការ ${e.origin??`តម្លៃ`} ${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`តូចពេក៖ ត្រូវការ ${e.origin} ${n} ${e.minimum.toString()} ${r.unit}`:`តូចពេក៖ ត្រូវការ ${e.origin} ${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ \"${t.prefix}\"`:t.format===`ends_with`?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ \"${t.suffix}\"`:t.format===`includes`?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន \"${t.includes}\"`:t.format===`regex`?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${t.pattern}`:`មិនត្រឹមត្រូវ៖ ${r[t.format]??e.format}`}case`not_multiple_of`:return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${e.divisor}`;case`unrecognized_keys`:return`រកឃើញសោមិនស្គាល់៖ ${m(e.keys,`, `)}`;case`invalid_key`:return`សោមិនត្រឹមត្រូវនៅក្នុង ${e.origin}`;case`invalid_union`:return`ទិន្នន័យមិនត្រឹមត្រូវ`;case`invalid_element`:return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${e.origin}`;default:return`ទិន្នន័យមិនត្រឹមត្រូវ`}}}}));function oa(){return{localeError:sa()}}var sa,ca=t((()=>{x(),sa=()=>{let e={string:{unit:`문자`,verb:`to have`},file:{unit:`바이트`,verb:`to have`},array:{unit:`개`,verb:`to have`},set:{unit:`개`,verb:`to have`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`number`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`입력`,email:`이메일 주소`,url:`URL`,emoji:`이모지`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO 날짜시간`,date:`ISO 날짜`,time:`ISO 시간`,duration:`ISO 기간`,ipv4:`IPv4 주소`,ipv6:`IPv6 주소`,cidrv4:`IPv4 범위`,cidrv6:`IPv6 범위`,base64:`base64 인코딩 문자열`,base64url:`base64url 인코딩 문자열`,json_string:`JSON 문자열`,e164:`E.164 번호`,jwt:`JWT`,template_literal:`입력`};return e=>{switch(e.code){case`invalid_type`:return`잘못된 입력: 예상 타입은 ${e.expected}, 받은 타입은 ${n(e.input)}입니다`;case`invalid_value`:return e.values.length===1?`잘못된 입력: 값은 ${v(e.values[0])} 이어야 합니다`:`잘못된 옵션: ${m(e.values,`또는 `)} 중 하나여야 합니다`;case`too_big`:{let n=e.inclusive?`이하`:`미만`,r=n===`미만`?`이어야 합니다`:`여야 합니다`,i=t(e.origin),a=i?.unit??`요소`;return i?`${e.origin??`값`}이 너무 큽니다: ${e.maximum.toString()}${a} ${n}${r}`:`${e.origin??`값`}이 너무 큽니다: ${e.maximum.toString()} ${n}${r}`}case`too_small`:{let n=e.inclusive?`이상`:`초과`,r=n===`이상`?`이어야 합니다`:`여야 합니다`,i=t(e.origin),a=i?.unit??`요소`;return i?`${e.origin??`값`}이 너무 작습니다: ${e.minimum.toString()}${a} ${n}${r}`:`${e.origin??`값`}이 너무 작습니다: ${e.minimum.toString()} ${n}${r}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`잘못된 문자열: \"${t.prefix}\"(으)로 시작해야 합니다`:t.format===`ends_with`?`잘못된 문자열: \"${t.suffix}\"(으)로 끝나야 합니다`:t.format===`includes`?`잘못된 문자열: \"${t.includes}\"을(를) 포함해야 합니다`:t.format===`regex`?`잘못된 문자열: 정규식 ${t.pattern} 패턴과 일치해야 합니다`:`잘못된 ${r[t.format]??e.format}`}case`not_multiple_of`:return`잘못된 숫자: ${e.divisor}의 배수여야 합니다`;case`unrecognized_keys`:return`인식할 수 없는 키: ${m(e.keys,`, `)}`;case`invalid_key`:return`잘못된 키: ${e.origin}`;case`invalid_union`:return`잘못된 입력`;case`invalid_element`:return`잘못된 값: ${e.origin}`;default:return`잘못된 입력`}}}}));function la(){return{localeError:ua()}}var ua,da=t((()=>{x(),ua=()=>{let e={string:{unit:`знаци`,verb:`да имаат`},file:{unit:`бајти`,verb:`да имаат`},array:{unit:`ставки`,verb:`да имаат`},set:{unit:`ставки`,verb:`да имаат`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`број`;case`object`:if(Array.isArray(e))return`низа`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`внес`,email:`адреса на е-пошта`,url:`URL`,emoji:`емоџи`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO датум и време`,date:`ISO датум`,time:`ISO време`,duration:`ISO времетраење`,ipv4:`IPv4 адреса`,ipv6:`IPv6 адреса`,cidrv4:`IPv4 опсег`,cidrv6:`IPv6 опсег`,base64:`base64-енкодирана низа`,base64url:`base64url-енкодирана низа`,json_string:`JSON низа`,e164:`E.164 број`,jwt:`JWT`,template_literal:`внес`};return e=>{switch(e.code){case`invalid_type`:return`Грешен внес: се очекува ${e.expected}, примено ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${v(e.values[0])}`:`Грешана опција: се очекува една ${m(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Премногу голем: се очекува ${e.origin??`вредноста`} да има ${n}${e.maximum.toString()} ${r.unit??`елементи`}`:`Премногу голем: се очекува ${e.origin??`вредноста`} да биде ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Премногу мал: се очекува ${e.origin} да има ${n}${e.minimum.toString()} ${r.unit}`:`Премногу мал: се очекува ${e.origin} да биде ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Неважечка низа: мора да започнува со \"${t.prefix}\"`:t.format===`ends_with`?`Неважечка низа: мора да завршува со \"${t.suffix}\"`:t.format===`includes`?`Неважечка низа: мора да вклучува \"${t.includes}\"`:t.format===`regex`?`Неважечка низа: мора да одгоара на патернот ${t.pattern}`:`Invalid ${r[t.format]??e.format}`}case`not_multiple_of`:return`Грешен број: мора да биде делив со ${e.divisor}`;case`unrecognized_keys`:return`${e.keys.length>1?`Непрепознаени клучеви`:`Непрепознаен клуч`}: ${m(e.keys,`, `)}`;case`invalid_key`:return`Грешен клуч во ${e.origin}`;case`invalid_union`:return`Грешен внес`;case`invalid_element`:return`Грешна вредност во ${e.origin}`;default:return`Грешен внес`}}}}));function fa(){return{localeError:pa()}}var pa,ma=t((()=>{x(),pa=()=>{let e={string:{unit:`aksara`,verb:`mempunyai`},file:{unit:`bait`,verb:`mempunyai`},array:{unit:`elemen`,verb:`mempunyai`},set:{unit:`elemen`,verb:`mempunyai`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`nombor`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`input`,email:`alamat e-mel`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`tarikh masa ISO`,date:`tarikh ISO`,time:`masa ISO`,duration:`tempoh ISO`,ipv4:`alamat IPv4`,ipv6:`alamat IPv6`,cidrv4:`julat IPv4`,cidrv6:`julat IPv6`,base64:`string dikodkan base64`,base64url:`string dikodkan base64url`,json_string:`string JSON`,e164:`nombor E.164`,jwt:`JWT`,template_literal:`input`};return e=>{switch(e.code){case`invalid_type`:return`Input tidak sah: dijangka ${e.expected}, diterima ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Input tidak sah: dijangka ${v(e.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${m(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Terlalu besar: dijangka ${e.origin??`nilai`} ${r.verb} ${n}${e.maximum.toString()} ${r.unit??`elemen`}`:`Terlalu besar: dijangka ${e.origin??`nilai`} adalah ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Terlalu kecil: dijangka ${e.origin} ${r.verb} ${n}${e.minimum.toString()} ${r.unit}`:`Terlalu kecil: dijangka ${e.origin} adalah ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`String tidak sah: mesti bermula dengan \"${t.prefix}\"`:t.format===`ends_with`?`String tidak sah: mesti berakhir dengan \"${t.suffix}\"`:t.format===`includes`?`String tidak sah: mesti mengandungi \"${t.includes}\"`:t.format===`regex`?`String tidak sah: mesti sepadan dengan corak ${t.pattern}`:`${r[t.format]??e.format} tidak sah`}case`not_multiple_of`:return`Nombor tidak sah: perlu gandaan ${e.divisor}`;case`unrecognized_keys`:return`Kunci tidak dikenali: ${m(e.keys,`, `)}`;case`invalid_key`:return`Kunci tidak sah dalam ${e.origin}`;case`invalid_union`:return`Input tidak sah`;case`invalid_element`:return`Nilai tidak sah dalam ${e.origin}`;default:return`Input tidak sah`}}}}));function ha(){return{localeError:ga()}}var ga,_a=t((()=>{x(),ga=()=>{let e={string:{unit:`tekens`},file:{unit:`bytes`},array:{unit:`elementen`},set:{unit:`elementen`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`getal`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`invoer`,email:`emailadres`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datum en tijd`,date:`ISO datum`,time:`ISO tijd`,duration:`ISO duur`,ipv4:`IPv4-adres`,ipv6:`IPv6-adres`,cidrv4:`IPv4-bereik`,cidrv6:`IPv6-bereik`,base64:`base64-gecodeerde tekst`,base64url:`base64 URL-gecodeerde tekst`,json_string:`JSON string`,e164:`E.164-nummer`,jwt:`JWT`,template_literal:`invoer`};return e=>{switch(e.code){case`invalid_type`:return`Ongeldige invoer: verwacht ${e.expected}, ontving ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Ongeldige invoer: verwacht ${v(e.values[0])}`:`Ongeldige optie: verwacht één van ${m(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Te lang: verwacht dat ${e.origin??`waarde`} ${n}${e.maximum.toString()} ${r.unit??`elementen`} bevat`:`Te lang: verwacht dat ${e.origin??`waarde`} ${n}${e.maximum.toString()} is`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Te kort: verwacht dat ${e.origin} ${n}${e.minimum.toString()} ${r.unit} bevat`:`Te kort: verwacht dat ${e.origin} ${n}${e.minimum.toString()} is`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ongeldige tekst: moet met \"${t.prefix}\" beginnen`:t.format===`ends_with`?`Ongeldige tekst: moet op \"${t.suffix}\" eindigen`:t.format===`includes`?`Ongeldige tekst: moet \"${t.includes}\" bevatten`:t.format===`regex`?`Ongeldige tekst: moet overeenkomen met patroon ${t.pattern}`:`Ongeldig: ${r[t.format]??e.format}`}case`not_multiple_of`:return`Ongeldig getal: moet een veelvoud van ${e.divisor} zijn`;case`unrecognized_keys`:return`Onbekende key${e.keys.length>1?`s`:``}: ${m(e.keys,`, `)}`;case`invalid_key`:return`Ongeldige key in ${e.origin}`;case`invalid_union`:return`Ongeldige invoer`;case`invalid_element`:return`Ongeldige waarde in ${e.origin}`;default:return`Ongeldige invoer`}}}}));function va(){return{localeError:ya()}}var ya,ba=t((()=>{x(),ya=()=>{let e={string:{unit:`tegn`,verb:`å ha`},file:{unit:`bytes`,verb:`å ha`},array:{unit:`elementer`,verb:`å inneholde`},set:{unit:`elementer`,verb:`å inneholde`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`tall`;case`object`:if(Array.isArray(e))return`liste`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`input`,email:`e-postadresse`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO dato- og klokkeslett`,date:`ISO-dato`,time:`ISO-klokkeslett`,duration:`ISO-varighet`,ipv4:`IPv4-område`,ipv6:`IPv6-område`,cidrv4:`IPv4-spekter`,cidrv6:`IPv6-spekter`,base64:`base64-enkodet streng`,base64url:`base64url-enkodet streng`,json_string:`JSON-streng`,e164:`E.164-nummer`,jwt:`JWT`,template_literal:`input`};return e=>{switch(e.code){case`invalid_type`:return`Ugyldig input: forventet ${e.expected}, fikk ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Ugyldig verdi: forventet ${v(e.values[0])}`:`Ugyldig valg: forventet en av ${m(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`For stor(t): forventet ${e.origin??`value`} til å ha ${n}${e.maximum.toString()} ${r.unit??`elementer`}`:`For stor(t): forventet ${e.origin??`value`} til å ha ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`For lite(n): forventet ${e.origin} til å ha ${n}${e.minimum.toString()} ${r.unit}`:`For lite(n): forventet ${e.origin} til å ha ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ugyldig streng: må starte med \"${t.prefix}\"`:t.format===`ends_with`?`Ugyldig streng: må ende med \"${t.suffix}\"`:t.format===`includes`?`Ugyldig streng: må inneholde \"${t.includes}\"`:t.format===`regex`?`Ugyldig streng: må matche mønsteret ${t.pattern}`:`Ugyldig ${r[t.format]??e.format}`}case`not_multiple_of`:return`Ugyldig tall: må være et multiplum av ${e.divisor}`;case`unrecognized_keys`:return`${e.keys.length>1?`Ukjente nøkler`:`Ukjent nøkkel`}: ${m(e.keys,`, `)}`;case`invalid_key`:return`Ugyldig nøkkel i ${e.origin}`;case`invalid_union`:return`Ugyldig input`;case`invalid_element`:return`Ugyldig verdi i ${e.origin}`;default:return`Ugyldig input`}}}}));function xa(){return{localeError:Sa()}}var Sa,Ca=t((()=>{x(),Sa=()=>{let e={string:{unit:`harf`,verb:`olmalıdır`},file:{unit:`bayt`,verb:`olmalıdır`},array:{unit:`unsur`,verb:`olmalıdır`},set:{unit:`unsur`,verb:`olmalıdır`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`numara`;case`object`:if(Array.isArray(e))return`saf`;if(e===null)return`gayb`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`giren`,email:`epostagâh`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO hengâmı`,date:`ISO tarihi`,time:`ISO zamanı`,duration:`ISO müddeti`,ipv4:`IPv4 nişânı`,ipv6:`IPv6 nişânı`,cidrv4:`IPv4 menzili`,cidrv6:`IPv6 menzili`,base64:`base64-şifreli metin`,base64url:`base64url-şifreli metin`,json_string:`JSON metin`,e164:`E.164 sayısı`,jwt:`JWT`,template_literal:`giren`};return e=>{switch(e.code){case`invalid_type`:return`Fâsit giren: umulan ${e.expected}, alınan ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Fâsit giren: umulan ${v(e.values[0])}`:`Fâsit tercih: mûteberler ${m(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Fazla büyük: ${e.origin??`value`}, ${n}${e.maximum.toString()} ${r.unit??`elements`} sahip olmalıydı.`:`Fazla büyük: ${e.origin??`value`}, ${n}${e.maximum.toString()} olmalıydı.`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Fazla küçük: ${e.origin}, ${n}${e.minimum.toString()} ${r.unit} sahip olmalıydı.`:`Fazla küçük: ${e.origin}, ${n}${e.minimum.toString()} olmalıydı.`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Fâsit metin: \"${t.prefix}\" ile başlamalı.`:t.format===`ends_with`?`Fâsit metin: \"${t.suffix}\" ile bitmeli.`:t.format===`includes`?`Fâsit metin: \"${t.includes}\" ihtivâ etmeli.`:t.format===`regex`?`Fâsit metin: ${t.pattern} nakşına uymalı.`:`Fâsit ${r[t.format]??e.format}`}case`not_multiple_of`:return`Fâsit sayı: ${e.divisor} katı olmalıydı.`;case`unrecognized_keys`:return`Tanınmayan anahtar ${e.keys.length>1?`s`:``}: ${m(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} için tanınmayan anahtar var.`;case`invalid_union`:return`Giren tanınamadı.`;case`invalid_element`:return`${e.origin} için tanınmayan kıymet var.`;default:return`Kıymet tanınamadı.`}}}}));function wa(){return{localeError:Ta()}}var Ta,Ea=t((()=>{x(),Ta=()=>{let e={string:{unit:`توکي`,verb:`ولري`},file:{unit:`بایټس`,verb:`ولري`},array:{unit:`توکي`,verb:`ولري`},set:{unit:`توکي`,verb:`ولري`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`عدد`;case`object`:if(Array.isArray(e))return`ارې`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`ورودي`,email:`بریښنالیک`,url:`یو آر ال`,emoji:`ایموجي`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`نیټه او وخت`,date:`نېټه`,time:`وخت`,duration:`موده`,ipv4:`د IPv4 پته`,ipv6:`د IPv6 پته`,cidrv4:`د IPv4 ساحه`,cidrv6:`د IPv6 ساحه`,base64:`base64-encoded متن`,base64url:`base64url-encoded متن`,json_string:`JSON متن`,e164:`د E.164 شمېره`,jwt:`JWT`,template_literal:`ورودي`};return e=>{switch(e.code){case`invalid_type`:return`ناسم ورودي: باید ${e.expected} وای, مګر ${n(e.input)} ترلاسه شو`;case`invalid_value`:return e.values.length===1?`ناسم ورودي: باید ${v(e.values[0])} وای`:`ناسم انتخاب: باید یو له ${m(e.values,`|`)} څخه وای`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`ډیر لوی: ${e.origin??`ارزښت`} باید ${n}${e.maximum.toString()} ${r.unit??`عنصرونه`} ولري`:`ډیر لوی: ${e.origin??`ارزښت`} باید ${n}${e.maximum.toString()} وي`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`ډیر کوچنی: ${e.origin} باید ${n}${e.minimum.toString()} ${r.unit} ولري`:`ډیر کوچنی: ${e.origin} باید ${n}${e.minimum.toString()} وي`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`ناسم متن: باید د \"${t.prefix}\" سره پیل شي`:t.format===`ends_with`?`ناسم متن: باید د \"${t.suffix}\" سره پای ته ورسيږي`:t.format===`includes`?`ناسم متن: باید \"${t.includes}\" ولري`:t.format===`regex`?`ناسم متن: باید د ${t.pattern} سره مطابقت ولري`:`${r[t.format]??e.format} ناسم دی`}case`not_multiple_of`:return`ناسم عدد: باید د ${e.divisor} مضرب وي`;case`unrecognized_keys`:return`ناسم ${e.keys.length>1?`کلیډونه`:`کلیډ`}: ${m(e.keys,`, `)}`;case`invalid_key`:return`ناسم کلیډ په ${e.origin} کې`;case`invalid_union`:return`ناسمه ورودي`;case`invalid_element`:return`ناسم عنصر په ${e.origin} کې`;default:return`ناسمه ورودي`}}}}));function Da(){return{localeError:Oa()}}var Oa,ka=t((()=>{x(),Oa=()=>{let e={string:{unit:`znaków`,verb:`mieć`},file:{unit:`bajtów`,verb:`mieć`},array:{unit:`elementów`,verb:`mieć`},set:{unit:`elementów`,verb:`mieć`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`liczba`;case`object`:if(Array.isArray(e))return`tablica`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`wyrażenie`,email:`adres email`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`data i godzina w formacie ISO`,date:`data w formacie ISO`,time:`godzina w formacie ISO`,duration:`czas trwania ISO`,ipv4:`adres IPv4`,ipv6:`adres IPv6`,cidrv4:`zakres IPv4`,cidrv6:`zakres IPv6`,base64:`ciąg znaków zakodowany w formacie base64`,base64url:`ciąg znaków zakodowany w formacie base64url`,json_string:`ciąg znaków w formacie JSON`,e164:`liczba E.164`,jwt:`JWT`,template_literal:`wejście`};return e=>{switch(e.code){case`invalid_type`:return`Nieprawidłowe dane wejściowe: oczekiwano ${e.expected}, otrzymano ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Nieprawidłowe dane wejściowe: oczekiwano ${v(e.values[0])}`:`Nieprawidłowa opcja: oczekiwano jednej z wartości ${m(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Za duża wartość: oczekiwano, że ${e.origin??`wartość`} będzie mieć ${n}${e.maximum.toString()} ${r.unit??`elementów`}`:`Zbyt duż(y/a/e): oczekiwano, że ${e.origin??`wartość`} będzie wynosić ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Za mała wartość: oczekiwano, że ${e.origin??`wartość`} będzie mieć ${n}${e.minimum.toString()} ${r.unit??`elementów`}`:`Zbyt mał(y/a/e): oczekiwano, że ${e.origin??`wartość`} będzie wynosić ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Nieprawidłowy ciąg znaków: musi zaczynać się od \"${t.prefix}\"`:t.format===`ends_with`?`Nieprawidłowy ciąg znaków: musi kończyć się na \"${t.suffix}\"`:t.format===`includes`?`Nieprawidłowy ciąg znaków: musi zawierać \"${t.includes}\"`:t.format===`regex`?`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${t.pattern}`:`Nieprawidłow(y/a/e) ${r[t.format]??e.format}`}case`not_multiple_of`:return`Nieprawidłowa liczba: musi być wielokrotnością ${e.divisor}`;case`unrecognized_keys`:return`Nierozpoznane klucze${e.keys.length>1?`s`:``}: ${m(e.keys,`, `)}`;case`invalid_key`:return`Nieprawidłowy klucz w ${e.origin}`;case`invalid_union`:return`Nieprawidłowe dane wejściowe`;case`invalid_element`:return`Nieprawidłowa wartość w ${e.origin}`;default:return`Nieprawidłowe dane wejściowe`}}}}));function Aa(){return{localeError:ja()}}var ja,Ma=t((()=>{x(),ja=()=>{let e={string:{unit:`caracteres`,verb:`ter`},file:{unit:`bytes`,verb:`ter`},array:{unit:`itens`,verb:`ter`},set:{unit:`itens`,verb:`ter`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`número`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`nulo`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`padrão`,email:`endereço de e-mail`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`data e hora ISO`,date:`data ISO`,time:`hora ISO`,duration:`duração ISO`,ipv4:`endereço IPv4`,ipv6:`endereço IPv6`,cidrv4:`faixa de IPv4`,cidrv6:`faixa de IPv6`,base64:`texto codificado em base64`,base64url:`URL codificada em base64`,json_string:`texto JSON`,e164:`número E.164`,jwt:`JWT`,template_literal:`entrada`};return e=>{switch(e.code){case`invalid_type`:return`Tipo inválido: esperado ${e.expected}, recebido ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Entrada inválida: esperado ${v(e.values[0])}`:`Opção inválida: esperada uma das ${m(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Muito grande: esperado que ${e.origin??`valor`} tivesse ${n}${e.maximum.toString()} ${r.unit??`elementos`}`:`Muito grande: esperado que ${e.origin??`valor`} fosse ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Muito pequeno: esperado que ${e.origin} tivesse ${n}${e.minimum.toString()} ${r.unit}`:`Muito pequeno: esperado que ${e.origin} fosse ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Texto inválido: deve começar com \"${t.prefix}\"`:t.format===`ends_with`?`Texto inválido: deve terminar com \"${t.suffix}\"`:t.format===`includes`?`Texto inválido: deve incluir \"${t.includes}\"`:t.format===`regex`?`Texto inválido: deve corresponder ao padrão ${t.pattern}`:`${r[t.format]??e.format} inválido`}case`not_multiple_of`:return`Número inválido: deve ser múltiplo de ${e.divisor}`;case`unrecognized_keys`:return`Chave${e.keys.length>1?`s`:``} desconhecida${e.keys.length>1?`s`:``}: ${m(e.keys,`, `)}`;case`invalid_key`:return`Chave inválida em ${e.origin}`;case`invalid_union`:return`Entrada inválida`;case`invalid_element`:return`Valor inválido em ${e.origin}`;default:return`Campo inválido`}}}}));function Na(e,t,n,r){let i=Math.abs(e),a=i%10,o=i%100;return o>=11&&o<=19?r:a===1?t:a>=2&&a<=4?n:r}function Pa(){return{localeError:Fa()}}var Fa,Ia=t((()=>{x(),Fa=()=>{let e={string:{unit:{one:`символ`,few:`символа`,many:`символов`},verb:`иметь`},file:{unit:{one:`байт`,few:`байта`,many:`байт`},verb:`иметь`},array:{unit:{one:`элемент`,few:`элемента`,many:`элементов`},verb:`иметь`},set:{unit:{one:`элемент`,few:`элемента`,many:`элементов`},verb:`иметь`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`число`;case`object`:if(Array.isArray(e))return`массив`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`ввод`,email:`email адрес`,url:`URL`,emoji:`эмодзи`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO дата и время`,date:`ISO дата`,time:`ISO время`,duration:`ISO длительность`,ipv4:`IPv4 адрес`,ipv6:`IPv6 адрес`,cidrv4:`IPv4 диапазон`,cidrv6:`IPv6 диапазон`,base64:`строка в формате base64`,base64url:`строка в формате base64url`,json_string:`JSON строка`,e164:`номер E.164`,jwt:`JWT`,template_literal:`ввод`};return e=>{switch(e.code){case`invalid_type`:return`Неверный ввод: ожидалось ${e.expected}, получено ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Неверный ввод: ожидалось ${v(e.values[0])}`:`Неверный вариант: ожидалось одно из ${m(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);if(r){let t=Na(Number(e.maximum),r.unit.one,r.unit.few,r.unit.many);return`Слишком большое значение: ожидалось, что ${e.origin??`значение`} будет иметь ${n}${e.maximum.toString()} ${t}`}return`Слишком большое значение: ожидалось, что ${e.origin??`значение`} будет ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);if(r){let t=Na(Number(e.minimum),r.unit.one,r.unit.few,r.unit.many);return`Слишком маленькое значение: ожидалось, что ${e.origin} будет иметь ${n}${e.minimum.toString()} ${t}`}return`Слишком маленькое значение: ожидалось, что ${e.origin} будет ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Неверная строка: должна начинаться с \"${t.prefix}\"`:t.format===`ends_with`?`Неверная строка: должна заканчиваться на \"${t.suffix}\"`:t.format===`includes`?`Неверная строка: должна содержать \"${t.includes}\"`:t.format===`regex`?`Неверная строка: должна соответствовать шаблону ${t.pattern}`:`Неверный ${r[t.format]??e.format}`}case`not_multiple_of`:return`Неверное число: должно быть кратным ${e.divisor}`;case`unrecognized_keys`:return`Нераспознанн${e.keys.length>1?`ые`:`ый`} ключ${e.keys.length>1?`и`:``}: ${m(e.keys,`, `)}`;case`invalid_key`:return`Неверный ключ в ${e.origin}`;case`invalid_union`:return`Неверные входные данные`;case`invalid_element`:return`Неверное значение в ${e.origin}`;default:return`Неверные входные данные`}}}}));function La(){return{localeError:Ra()}}var Ra,za=t((()=>{x(),Ra=()=>{let e={string:{unit:`znakov`,verb:`imeti`},file:{unit:`bajtov`,verb:`imeti`},array:{unit:`elementov`,verb:`imeti`},set:{unit:`elementov`,verb:`imeti`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`število`;case`object`:if(Array.isArray(e))return`tabela`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`vnos`,email:`e-poštni naslov`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datum in čas`,date:`ISO datum`,time:`ISO čas`,duration:`ISO trajanje`,ipv4:`IPv4 naslov`,ipv6:`IPv6 naslov`,cidrv4:`obseg IPv4`,cidrv6:`obseg IPv6`,base64:`base64 kodiran niz`,base64url:`base64url kodiran niz`,json_string:`JSON niz`,e164:`E.164 številka`,jwt:`JWT`,template_literal:`vnos`};return e=>{switch(e.code){case`invalid_type`:return`Neveljaven vnos: pričakovano ${e.expected}, prejeto ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Neveljaven vnos: pričakovano ${v(e.values[0])}`:`Neveljavna možnost: pričakovano eno izmed ${m(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Preveliko: pričakovano, da bo ${e.origin??`vrednost`} imelo ${n}${e.maximum.toString()} ${r.unit??`elementov`}`:`Preveliko: pričakovano, da bo ${e.origin??`vrednost`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Premajhno: pričakovano, da bo ${e.origin} imelo ${n}${e.minimum.toString()} ${r.unit}`:`Premajhno: pričakovano, da bo ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Neveljaven niz: mora se začeti z \"${t.prefix}\"`:t.format===`ends_with`?`Neveljaven niz: mora se končati z \"${t.suffix}\"`:t.format===`includes`?`Neveljaven niz: mora vsebovati \"${t.includes}\"`:t.format===`regex`?`Neveljaven niz: mora ustrezati vzorcu ${t.pattern}`:`Neveljaven ${r[t.format]??e.format}`}case`not_multiple_of`:return`Neveljavno število: mora biti večkratnik ${e.divisor}`;case`unrecognized_keys`:return`Neprepoznan${e.keys.length>1?`i ključi`:` ključ`}: ${m(e.keys,`, `)}`;case`invalid_key`:return`Neveljaven ključ v ${e.origin}`;case`invalid_union`:return`Neveljaven vnos`;case`invalid_element`:return`Neveljavna vrednost v ${e.origin}`;default:return`Neveljaven vnos`}}}}));function Ba(){return{localeError:Va()}}var Va,Ha=t((()=>{x(),Va=()=>{let e={string:{unit:`tecken`,verb:`att ha`},file:{unit:`bytes`,verb:`att ha`},array:{unit:`objekt`,verb:`att innehålla`},set:{unit:`objekt`,verb:`att innehålla`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`antal`;case`object`:if(Array.isArray(e))return`lista`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`reguljärt uttryck`,email:`e-postadress`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO-datum och tid`,date:`ISO-datum`,time:`ISO-tid`,duration:`ISO-varaktighet`,ipv4:`IPv4-intervall`,ipv6:`IPv6-intervall`,cidrv4:`IPv4-spektrum`,cidrv6:`IPv6-spektrum`,base64:`base64-kodad sträng`,base64url:`base64url-kodad sträng`,json_string:`JSON-sträng`,e164:`E.164-nummer`,jwt:`JWT`,template_literal:`mall-literal`};return e=>{switch(e.code){case`invalid_type`:return`Ogiltig inmatning: förväntat ${e.expected}, fick ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Ogiltig inmatning: förväntat ${v(e.values[0])}`:`Ogiltigt val: förväntade en av ${m(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`För stor(t): förväntade ${e.origin??`värdet`} att ha ${n}${e.maximum.toString()} ${r.unit??`element`}`:`För stor(t): förväntat ${e.origin??`värdet`} att ha ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`För lite(t): förväntade ${e.origin??`värdet`} att ha ${n}${e.minimum.toString()} ${r.unit}`:`För lite(t): förväntade ${e.origin??`värdet`} att ha ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ogiltig sträng: måste börja med \"${t.prefix}\"`:t.format===`ends_with`?`Ogiltig sträng: måste sluta med \"${t.suffix}\"`:t.format===`includes`?`Ogiltig sträng: måste innehålla \"${t.includes}\"`:t.format===`regex`?`Ogiltig sträng: måste matcha mönstret \"${t.pattern}\"`:`Ogiltig(t) ${r[t.format]??e.format}`}case`not_multiple_of`:return`Ogiltigt tal: måste vara en multipel av ${e.divisor}`;case`unrecognized_keys`:return`${e.keys.length>1?`Okända nycklar`:`Okänd nyckel`}: ${m(e.keys,`, `)}`;case`invalid_key`:return`Ogiltig nyckel i ${e.origin??`värdet`}`;case`invalid_union`:return`Ogiltig input`;case`invalid_element`:return`Ogiltigt värde i ${e.origin??`värdet`}`;default:return`Ogiltig input`}}}}));function Ua(){return{localeError:Wa()}}var Wa,Ga=t((()=>{x(),Wa=()=>{let e={string:{unit:`எழுத்துக்கள்`,verb:`கொண்டிருக்க வேண்டும்`},file:{unit:`பைட்டுகள்`,verb:`கொண்டிருக்க வேண்டும்`},array:{unit:`உறுப்புகள்`,verb:`கொண்டிருக்க வேண்டும்`},set:{unit:`உறுப்புகள்`,verb:`கொண்டிருக்க வேண்டும்`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`எண் அல்லாதது`:`எண்`;case`object`:if(Array.isArray(e))return`அணி`;if(e===null)return`வெறுமை`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`உள்ளீடு`,email:`மின்னஞ்சல் முகவரி`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO தேதி நேரம்`,date:`ISO தேதி`,time:`ISO நேரம்`,duration:`ISO கால அளவு`,ipv4:`IPv4 முகவரி`,ipv6:`IPv6 முகவரி`,cidrv4:`IPv4 வரம்பு`,cidrv6:`IPv6 வரம்பு`,base64:`base64-encoded சரம்`,base64url:`base64url-encoded சரம்`,json_string:`JSON சரம்`,e164:`E.164 எண்`,jwt:`JWT`,template_literal:`input`};return e=>{switch(e.code){case`invalid_type`:return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${e.expected}, பெறப்பட்டது ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${v(e.values[0])}`:`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${m(e.values,`|`)} இல் ஒன்று`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${e.origin??`மதிப்பு`} ${n}${e.maximum.toString()} ${r.unit??`உறுப்புகள்`} ஆக இருக்க வேண்டும்`:`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${e.origin??`மதிப்பு`} ${n}${e.maximum.toString()} ஆக இருக்க வேண்டும்`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${e.origin} ${n}${e.minimum.toString()} ${r.unit} ஆக இருக்க வேண்டும்`:`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${e.origin} ${n}${e.minimum.toString()} ஆக இருக்க வேண்டும்`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`தவறான சரம்: \"${t.prefix}\" இல் தொடங்க வேண்டும்`:t.format===`ends_with`?`தவறான சரம்: \"${t.suffix}\" இல் முடிவடைய வேண்டும்`:t.format===`includes`?`தவறான சரம்: \"${t.includes}\" ஐ உள்ளடக்க வேண்டும்`:t.format===`regex`?`தவறான சரம்: ${t.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`:`தவறான ${r[t.format]??e.format}`}case`not_multiple_of`:return`தவறான எண்: ${e.divisor} இன் பலமாக இருக்க வேண்டும்`;case`unrecognized_keys`:return`அடையாளம் தெரியாத விசை${e.keys.length>1?`கள்`:``}: ${m(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} இல் தவறான விசை`;case`invalid_union`:return`தவறான உள்ளீடு`;case`invalid_element`:return`${e.origin} இல் தவறான மதிப்பு`;default:return`தவறான உள்ளீடு`}}}}));function Ka(){return{localeError:qa()}}var qa,Ja=t((()=>{x(),qa=()=>{let e={string:{unit:`ตัวอักษร`,verb:`ควรมี`},file:{unit:`ไบต์`,verb:`ควรมี`},array:{unit:`รายการ`,verb:`ควรมี`},set:{unit:`รายการ`,verb:`ควรมี`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`ไม่ใช่ตัวเลข (NaN)`:`ตัวเลข`;case`object`:if(Array.isArray(e))return`อาร์เรย์ (Array)`;if(e===null)return`ไม่มีค่า (null)`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`ข้อมูลที่ป้อน`,email:`ที่อยู่อีเมล`,url:`URL`,emoji:`อิโมจิ`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`วันที่เวลาแบบ ISO`,date:`วันที่แบบ ISO`,time:`เวลาแบบ ISO`,duration:`ช่วงเวลาแบบ ISO`,ipv4:`ที่อยู่ IPv4`,ipv6:`ที่อยู่ IPv6`,cidrv4:`ช่วง IP แบบ IPv4`,cidrv6:`ช่วง IP แบบ IPv6`,base64:`ข้อความแบบ Base64`,base64url:`ข้อความแบบ Base64 สำหรับ URL`,json_string:`ข้อความแบบ JSON`,e164:`เบอร์โทรศัพท์ระหว่างประเทศ (E.164)`,jwt:`โทเคน JWT`,template_literal:`ข้อมูลที่ป้อน`};return e=>{switch(e.code){case`invalid_type`:return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${e.expected} แต่ได้รับ ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`ค่าไม่ถูกต้อง: ควรเป็น ${v(e.values[0])}`:`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${m(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`ไม่เกิน`:`น้อยกว่า`,r=t(e.origin);return r?`เกินกำหนด: ${e.origin??`ค่า`} ควรมี${n} ${e.maximum.toString()} ${r.unit??`รายการ`}`:`เกินกำหนด: ${e.origin??`ค่า`} ควรมี${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`อย่างน้อย`:`มากกว่า`,r=t(e.origin);return r?`น้อยกว่ากำหนด: ${e.origin} ควรมี${n} ${e.minimum.toString()} ${r.unit}`:`น้อยกว่ากำหนด: ${e.origin} ควรมี${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย \"${t.prefix}\"`:t.format===`ends_with`?`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย \"${t.suffix}\"`:t.format===`includes`?`รูปแบบไม่ถูกต้อง: ข้อความต้องมี \"${t.includes}\" อยู่ในข้อความ`:t.format===`regex`?`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${t.pattern}`:`รูปแบบไม่ถูกต้อง: ${r[t.format]??e.format}`}case`not_multiple_of`:return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${e.divisor} ได้ลงตัว`;case`unrecognized_keys`:return`พบคีย์ที่ไม่รู้จัก: ${m(e.keys,`, `)}`;case`invalid_key`:return`คีย์ไม่ถูกต้องใน ${e.origin}`;case`invalid_union`:return`ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้`;case`invalid_element`:return`ข้อมูลไม่ถูกต้องใน ${e.origin}`;default:return`ข้อมูลไม่ถูกต้อง`}}}}));function Ya(){return{localeError:Za()}}var Xa,Za,Qa=t((()=>{x(),Xa=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`number`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},Za=()=>{let e={string:{unit:`karakter`,verb:`olmalı`},file:{unit:`bayt`,verb:`olmalı`},array:{unit:`öğe`,verb:`olmalı`},set:{unit:`öğe`,verb:`olmalı`}};function t(t){return e[t]??null}let n={regex:`girdi`,email:`e-posta adresi`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO tarih ve saat`,date:`ISO tarih`,time:`ISO saat`,duration:`ISO süre`,ipv4:`IPv4 adresi`,ipv6:`IPv6 adresi`,cidrv4:`IPv4 aralığı`,cidrv6:`IPv6 aralığı`,base64:`base64 ile şifrelenmiş metin`,base64url:`base64url ile şifrelenmiş metin`,json_string:`JSON dizesi`,e164:`E.164 sayısı`,jwt:`JWT`,template_literal:`Şablon dizesi`};return e=>{switch(e.code){case`invalid_type`:return`Geçersiz değer: beklenen ${e.expected}, alınan ${Xa(e.input)}`;case`invalid_value`:return e.values.length===1?`Geçersiz değer: beklenen ${v(e.values[0])}`:`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${m(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Çok büyük: beklenen ${e.origin??`değer`} ${n}${e.maximum.toString()} ${r.unit??`öğe`}`:`Çok büyük: beklenen ${e.origin??`değer`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Çok küçük: beklenen ${e.origin} ${n}${e.minimum.toString()} ${r.unit}`:`Çok küçük: beklenen ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Geçersiz metin: \"${t.prefix}\" ile başlamalı`:t.format===`ends_with`?`Geçersiz metin: \"${t.suffix}\" ile bitmeli`:t.format===`includes`?`Geçersiz metin: \"${t.includes}\" içermeli`:t.format===`regex`?`Geçersiz metin: ${t.pattern} desenine uymalı`:`Geçersiz ${n[t.format]??e.format}`}case`not_multiple_of`:return`Geçersiz sayı: ${e.divisor} ile tam bölünebilmeli`;case`unrecognized_keys`:return`Tanınmayan anahtar${e.keys.length>1?`lar`:``}: ${m(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} içinde geçersiz anahtar`;case`invalid_union`:return`Geçersiz değer`;case`invalid_element`:return`${e.origin} içinde geçersiz değer`;default:return`Geçersiz değer`}}}}));function $a(){return{localeError:eo()}}var eo,to=t((()=>{x(),eo=()=>{let e={string:{unit:`символів`,verb:`матиме`},file:{unit:`байтів`,verb:`матиме`},array:{unit:`елементів`,verb:`матиме`},set:{unit:`елементів`,verb:`матиме`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`число`;case`object`:if(Array.isArray(e))return`масив`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`вхідні дані`,email:`адреса електронної пошти`,url:`URL`,emoji:`емодзі`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`дата та час ISO`,date:`дата ISO`,time:`час ISO`,duration:`тривалість ISO`,ipv4:`адреса IPv4`,ipv6:`адреса IPv6`,cidrv4:`діапазон IPv4`,cidrv6:`діапазон IPv6`,base64:`рядок у кодуванні base64`,base64url:`рядок у кодуванні base64url`,json_string:`рядок JSON`,e164:`номер E.164`,jwt:`JWT`,template_literal:`вхідні дані`};return e=>{switch(e.code){case`invalid_type`:return`Неправильні вхідні дані: очікується ${e.expected}, отримано ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Неправильні вхідні дані: очікується ${v(e.values[0])}`:`Неправильна опція: очікується одне з ${m(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Занадто велике: очікується, що ${e.origin??`значення`} ${r.verb} ${n}${e.maximum.toString()} ${r.unit??`елементів`}`:`Занадто велике: очікується, що ${e.origin??`значення`} буде ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Занадто мале: очікується, що ${e.origin} ${r.verb} ${n}${e.minimum.toString()} ${r.unit}`:`Занадто мале: очікується, що ${e.origin} буде ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Неправильний рядок: повинен починатися з \"${t.prefix}\"`:t.format===`ends_with`?`Неправильний рядок: повинен закінчуватися на \"${t.suffix}\"`:t.format===`includes`?`Неправильний рядок: повинен містити \"${t.includes}\"`:t.format===`regex`?`Неправильний рядок: повинен відповідати шаблону ${t.pattern}`:`Неправильний ${r[t.format]??e.format}`}case`not_multiple_of`:return`Неправильне число: повинно бути кратним ${e.divisor}`;case`unrecognized_keys`:return`Нерозпізнаний ключ${e.keys.length>1?`і`:``}: ${m(e.keys,`, `)}`;case`invalid_key`:return`Неправильний ключ у ${e.origin}`;case`invalid_union`:return`Неправильні вхідні дані`;case`invalid_element`:return`Неправильне значення у ${e.origin}`;default:return`Неправильні вхідні дані`}}}}));function no(){return{localeError:ro()}}var ro,io=t((()=>{x(),ro=()=>{let e={string:{unit:`حروف`,verb:`ہونا`},file:{unit:`بائٹس`,verb:`ہونا`},array:{unit:`آئٹمز`,verb:`ہونا`},set:{unit:`آئٹمز`,verb:`ہونا`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`نمبر`;case`object`:if(Array.isArray(e))return`آرے`;if(e===null)return`نل`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`ان پٹ`,email:`ای میل ایڈریس`,url:`یو آر ایل`,emoji:`ایموجی`,uuid:`یو یو آئی ڈی`,uuidv4:`یو یو آئی ڈی وی 4`,uuidv6:`یو یو آئی ڈی وی 6`,nanoid:`نینو آئی ڈی`,guid:`جی یو آئی ڈی`,cuid:`سی یو آئی ڈی`,cuid2:`سی یو آئی ڈی 2`,ulid:`یو ایل آئی ڈی`,xid:`ایکس آئی ڈی`,ksuid:`کے ایس یو آئی ڈی`,datetime:`آئی ایس او ڈیٹ ٹائم`,date:`آئی ایس او تاریخ`,time:`آئی ایس او وقت`,duration:`آئی ایس او مدت`,ipv4:`آئی پی وی 4 ایڈریس`,ipv6:`آئی پی وی 6 ایڈریس`,cidrv4:`آئی پی وی 4 رینج`,cidrv6:`آئی پی وی 6 رینج`,base64:`بیس 64 ان کوڈڈ سٹرنگ`,base64url:`بیس 64 یو آر ایل ان کوڈڈ سٹرنگ`,json_string:`جے ایس او این سٹرنگ`,e164:`ای 164 نمبر`,jwt:`جے ڈبلیو ٹی`,template_literal:`ان پٹ`};return e=>{switch(e.code){case`invalid_type`:return`غلط ان پٹ: ${e.expected} متوقع تھا، ${n(e.input)} موصول ہوا`;case`invalid_value`:return e.values.length===1?`غلط ان پٹ: ${v(e.values[0])} متوقع تھا`:`غلط آپشن: ${m(e.values,`|`)} میں سے ایک متوقع تھا`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`بہت بڑا: ${e.origin??`ویلیو`} کے ${n}${e.maximum.toString()} ${r.unit??`عناصر`} ہونے متوقع تھے`:`بہت بڑا: ${e.origin??`ویلیو`} کا ${n}${e.maximum.toString()} ہونا متوقع تھا`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`بہت چھوٹا: ${e.origin} کے ${n}${e.minimum.toString()} ${r.unit} ہونے متوقع تھے`:`بہت چھوٹا: ${e.origin} کا ${n}${e.minimum.toString()} ہونا متوقع تھا`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`غلط سٹرنگ: \"${t.prefix}\" سے شروع ہونا چاہیے`:t.format===`ends_with`?`غلط سٹرنگ: \"${t.suffix}\" پر ختم ہونا چاہیے`:t.format===`includes`?`غلط سٹرنگ: \"${t.includes}\" شامل ہونا چاہیے`:t.format===`regex`?`غلط سٹرنگ: پیٹرن ${t.pattern} سے میچ ہونا چاہیے`:`غلط ${r[t.format]??e.format}`}case`not_multiple_of`:return`غلط نمبر: ${e.divisor} کا مضاعف ہونا چاہیے`;case`unrecognized_keys`:return`غیر تسلیم شدہ کی${e.keys.length>1?`ز`:``}: ${m(e.keys,`، `)}`;case`invalid_key`:return`${e.origin} میں غلط کی`;case`invalid_union`:return`غلط ان پٹ`;case`invalid_element`:return`${e.origin} میں غلط ویلیو`;default:return`غلط ان پٹ`}}}}));function ao(){return{localeError:oo()}}var oo,so=t((()=>{x(),oo=()=>{let e={string:{unit:`ký tự`,verb:`có`},file:{unit:`byte`,verb:`có`},array:{unit:`phần tử`,verb:`có`},set:{unit:`phần tử`,verb:`có`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`số`;case`object`:if(Array.isArray(e))return`mảng`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`đầu vào`,email:`địa chỉ email`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ngày giờ ISO`,date:`ngày ISO`,time:`giờ ISO`,duration:`khoảng thời gian ISO`,ipv4:`địa chỉ IPv4`,ipv6:`địa chỉ IPv6`,cidrv4:`dải IPv4`,cidrv6:`dải IPv6`,base64:`chuỗi mã hóa base64`,base64url:`chuỗi mã hóa base64url`,json_string:`chuỗi JSON`,e164:`số E.164`,jwt:`JWT`,template_literal:`đầu vào`};return e=>{switch(e.code){case`invalid_type`:return`Đầu vào không hợp lệ: mong đợi ${e.expected}, nhận được ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Đầu vào không hợp lệ: mong đợi ${v(e.values[0])}`:`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${m(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Quá lớn: mong đợi ${e.origin??`giá trị`} ${r.verb} ${n}${e.maximum.toString()} ${r.unit??`phần tử`}`:`Quá lớn: mong đợi ${e.origin??`giá trị`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Quá nhỏ: mong đợi ${e.origin} ${r.verb} ${n}${e.minimum.toString()} ${r.unit}`:`Quá nhỏ: mong đợi ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Chuỗi không hợp lệ: phải bắt đầu bằng \"${t.prefix}\"`:t.format===`ends_with`?`Chuỗi không hợp lệ: phải kết thúc bằng \"${t.suffix}\"`:t.format===`includes`?`Chuỗi không hợp lệ: phải bao gồm \"${t.includes}\"`:t.format===`regex`?`Chuỗi không hợp lệ: phải khớp với mẫu ${t.pattern}`:`${r[t.format]??e.format} không hợp lệ`}case`not_multiple_of`:return`Số không hợp lệ: phải là bội số của ${e.divisor}`;case`unrecognized_keys`:return`Khóa không được nhận dạng: ${m(e.keys,`, `)}`;case`invalid_key`:return`Khóa không hợp lệ trong ${e.origin}`;case`invalid_union`:return`Đầu vào không hợp lệ`;case`invalid_element`:return`Giá trị không hợp lệ trong ${e.origin}`;default:return`Đầu vào không hợp lệ`}}}}));function co(){return{localeError:lo()}}var lo,uo=t((()=>{x(),lo=()=>{let e={string:{unit:`字符`,verb:`包含`},file:{unit:`字节`,verb:`包含`},array:{unit:`项`,verb:`包含`},set:{unit:`项`,verb:`包含`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`非数字(NaN)`:`数字`;case`object`:if(Array.isArray(e))return`数组`;if(e===null)return`空值(null)`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`输入`,email:`电子邮件`,url:`URL`,emoji:`表情符号`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO日期时间`,date:`ISO日期`,time:`ISO时间`,duration:`ISO时长`,ipv4:`IPv4地址`,ipv6:`IPv6地址`,cidrv4:`IPv4网段`,cidrv6:`IPv6网段`,base64:`base64编码字符串`,base64url:`base64url编码字符串`,json_string:`JSON字符串`,e164:`E.164号码`,jwt:`JWT`,template_literal:`输入`};return e=>{switch(e.code){case`invalid_type`:return`无效输入:期望 ${e.expected},实际接收 ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`无效输入:期望 ${v(e.values[0])}`:`无效选项:期望以下之一 ${m(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`数值过大:期望 ${e.origin??`值`} ${n}${e.maximum.toString()} ${r.unit??`个元素`}`:`数值过大:期望 ${e.origin??`值`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`数值过小:期望 ${e.origin} ${n}${e.minimum.toString()} ${r.unit}`:`数值过小:期望 ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`无效字符串:必须以 \"${t.prefix}\" 开头`:t.format===`ends_with`?`无效字符串:必须以 \"${t.suffix}\" 结尾`:t.format===`includes`?`无效字符串:必须包含 \"${t.includes}\"`:t.format===`regex`?`无效字符串:必须满足正则表达式 ${t.pattern}`:`无效${r[t.format]??e.format}`}case`not_multiple_of`:return`无效数字:必须是 ${e.divisor} 的倍数`;case`unrecognized_keys`:return`出现未知的键(key): ${m(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} 中的键(key)无效`;case`invalid_union`:return`无效输入`;case`invalid_element`:return`${e.origin} 中包含无效值(value)`;default:return`无效输入`}}}}));function fo(){return{localeError:po()}}var po,mo=t((()=>{x(),po=()=>{let e={string:{unit:`字元`,verb:`擁有`},file:{unit:`位元組`,verb:`擁有`},array:{unit:`項目`,verb:`擁有`},set:{unit:`項目`,verb:`擁有`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`number`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`輸入`,email:`郵件地址`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO 日期時間`,date:`ISO 日期`,time:`ISO 時間`,duration:`ISO 期間`,ipv4:`IPv4 位址`,ipv6:`IPv6 位址`,cidrv4:`IPv4 範圍`,cidrv6:`IPv6 範圍`,base64:`base64 編碼字串`,base64url:`base64url 編碼字串`,json_string:`JSON 字串`,e164:`E.164 數值`,jwt:`JWT`,template_literal:`輸入`};return e=>{switch(e.code){case`invalid_type`:return`無效的輸入值:預期為 ${e.expected},但收到 ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`無效的輸入值:預期為 ${v(e.values[0])}`:`無效的選項:預期為以下其中之一 ${m(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`數值過大:預期 ${e.origin??`值`} 應為 ${n}${e.maximum.toString()} ${r.unit??`個元素`}`:`數值過大:預期 ${e.origin??`值`} 應為 ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`數值過小:預期 ${e.origin} 應為 ${n}${e.minimum.toString()} ${r.unit}`:`數值過小:預期 ${e.origin} 應為 ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`無效的字串:必須以 \"${t.prefix}\" 開頭`:t.format===`ends_with`?`無效的字串:必須以 \"${t.suffix}\" 結尾`:t.format===`includes`?`無效的字串:必須包含 \"${t.includes}\"`:t.format===`regex`?`無效的字串:必須符合格式 ${t.pattern}`:`無效的 ${r[t.format]??e.format}`}case`not_multiple_of`:return`無效的數字:必須為 ${e.divisor} 的倍數`;case`unrecognized_keys`:return`無法識別的鍵值${e.keys.length>1?`們`:``}:${m(e.keys,`、`)}`;case`invalid_key`:return`${e.origin} 中有無效的鍵值`;case`invalid_union`:return`無效的輸入值`;case`invalid_element`:return`${e.origin} 中有無效的值`;default:return`無效的輸入值`}}}})),ho=r({ar:()=>ei,az:()=>ri,be:()=>si,ca:()=>ui,cs:()=>pi,de:()=>gi,en:()=>yi,eo:()=>Ci,es:()=>Di,fa:()=>Ai,fi:()=>Ni,fr:()=>Ii,frCA:()=>zi,he:()=>Hi,hu:()=>Gi,id:()=>Ji,it:()=>Zi,ja:()=>ea,kh:()=>ra,ko:()=>oa,mk:()=>la,ms:()=>fa,nl:()=>ha,no:()=>va,ota:()=>xa,pl:()=>Da,ps:()=>wa,pt:()=>Aa,ru:()=>Pa,sl:()=>La,sv:()=>Ba,ta:()=>Ua,th:()=>Ka,tr:()=>Ya,ua:()=>$a,ur:()=>no,vi:()=>ao,zhCN:()=>co,zhTW:()=>fo}),go=t((()=>{ni(),ai(),li(),fi(),hi(),vi(),Si(),Ei(),ki(),Mi(),Fi(),Ri(),Vi(),Wi(),qi(),Xi(),$i(),na(),aa(),ca(),da(),ma(),_a(),ba(),Ca(),Ea(),ka(),Ma(),Ia(),za(),Ha(),Ga(),Ja(),Qa(),to(),io(),so(),uo(),mo()}));function _o(){return new bo}var vo,yo,bo,T,xo=t((()=>{vo=Symbol(`ZodOutput`),yo=Symbol(`ZodInput`),bo=class{constructor(){this._map=new Map,this._idmap=new Map}add(e,...t){let n=t[0];if(this._map.set(e,n),n&&typeof n==`object`&&`id`in n){if(this._idmap.has(n.id))throw Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,e)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};return delete n.id,{...n,...this._map.get(e)}}return this._map.get(e)}has(e){return this._map.has(e)}},T=_o()}));function So(e,t){return new e({type:`string`,..._(t)})}function Co(e,t){return new e({type:`string`,coerce:!0,..._(t)})}function wo(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,..._(t)})}function To(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,..._(t)})}function Eo(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,..._(t)})}function Do(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,..._(t)})}function Oo(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,..._(t)})}function ko(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,..._(t)})}function Ao(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,..._(t)})}function jo(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,..._(t)})}function Mo(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,..._(t)})}function No(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,..._(t)})}function Po(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,..._(t)})}function Fo(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,..._(t)})}function Io(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,..._(t)})}function Lo(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,..._(t)})}function Ro(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,..._(t)})}function zo(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,..._(t)})}function Bo(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,..._(t)})}function Vo(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,..._(t)})}function Ho(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,..._(t)})}function Uo(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,..._(t)})}function Wo(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,..._(t)})}function Go(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,..._(t)})}function Ko(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,..._(t)})}function qo(e,t){return new e({type:`string`,format:`date`,check:`string_format`,..._(t)})}function Jo(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,..._(t)})}function Yo(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,..._(t)})}function Xo(e,t){return new e({type:`number`,checks:[],..._(t)})}function Zo(e,t){return new e({type:`number`,coerce:!0,checks:[],..._(t)})}function Qo(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,..._(t)})}function $o(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`float32`,..._(t)})}function es(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`float64`,..._(t)})}function ts(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`int32`,..._(t)})}function ns(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`uint32`,..._(t)})}function rs(e,t){return new e({type:`boolean`,..._(t)})}function is(e,t){return new e({type:`boolean`,coerce:!0,..._(t)})}function as(e,t){return new e({type:`bigint`,..._(t)})}function os(e,t){return new e({type:`bigint`,coerce:!0,..._(t)})}function ss(e,t){return new e({type:`bigint`,check:`bigint_format`,abort:!1,format:`int64`,..._(t)})}function cs(e,t){return new e({type:`bigint`,check:`bigint_format`,abort:!1,format:`uint64`,..._(t)})}function ls(e,t){return new e({type:`symbol`,..._(t)})}function us(e,t){return new e({type:`undefined`,..._(t)})}function ds(e,t){return new e({type:`null`,..._(t)})}function fs(e){return new e({type:`any`})}function ps(e){return new e({type:`unknown`})}function ms(e,t){return new e({type:`never`,..._(t)})}function hs(e,t){return new e({type:`void`,..._(t)})}function gs(e,t){return new e({type:`date`,..._(t)})}function _s(e,t){return new e({type:`date`,coerce:!0,..._(t)})}function vs(e,t){return new e({type:`nan`,..._(t)})}function ys(e,t){return new Qt({check:`less_than`,..._(t),value:e,inclusive:!1})}function E(e,t){return new Qt({check:`less_than`,..._(t),value:e,inclusive:!0})}function bs(e,t){return new $t({check:`greater_than`,..._(t),value:e,inclusive:!1})}function D(e,t){return new $t({check:`greater_than`,..._(t),value:e,inclusive:!0})}function xs(e){return bs(0,e)}function Ss(e){return ys(0,e)}function Cs(e){return E(0,e)}function ws(e){return D(0,e)}function Ts(e,t){return new en({check:`multiple_of`,..._(t),value:e})}function Es(e,t){return new rn({check:`max_size`,..._(t),maximum:e})}function Ds(e,t){return new an({check:`min_size`,..._(t),minimum:e})}function Os(e,t){return new on({check:`size_equals`,..._(t),size:e})}function ks(e,t){return new sn({check:`max_length`,..._(t),maximum:e})}function As(e,t){return new cn({check:`min_length`,..._(t),minimum:e})}function js(e,t){return new ln({check:`length_equals`,..._(t),length:e})}function Ms(e,t){return new dn({check:`string_format`,format:`regex`,..._(t),pattern:e})}function Ns(e){return new fn({check:`string_format`,format:`lowercase`,..._(e)})}function Ps(e){return new pn({check:`string_format`,format:`uppercase`,..._(e)})}function Fs(e,t){return new mn({check:`string_format`,format:`includes`,..._(t),includes:e})}function Is(e,t){return new hn({check:`string_format`,format:`starts_with`,..._(t),prefix:e})}function Ls(e,t){return new gn({check:`string_format`,format:`ends_with`,..._(t),suffix:e})}function Rs(e,t,n){return new _n({check:`property`,property:e,schema:t,..._(n)})}function zs(e,t){return new vn({check:`mime_type`,mime:e,..._(t)})}function Bs(e){return new yn({check:`overwrite`,tx:e})}function Vs(e){return Bs(t=>t.normalize(e))}function Hs(){return Bs(e=>e.trim())}function Us(){return Bs(e=>e.toLowerCase())}function Ws(){return Bs(e=>e.toUpperCase())}function Gs(e,t,n){return new e({type:`array`,element:t,..._(n)})}function Ks(e,t,n){return new e({type:`union`,options:t,..._(n)})}function qs(e,t,n,r){return new e({type:`union`,options:n,discriminator:t,..._(r)})}function Js(e,t,n){return new e({type:`intersection`,left:t,right:n})}function Ys(e,t,n,r){let i=n instanceof C;return new e({type:`tuple`,items:t,rest:i?n:null,..._(i?r:n)})}function Xs(e,t,n,r){return new e({type:`record`,keyType:t,valueType:n,..._(r)})}function Zs(e,t,n,r){return new e({type:`map`,keyType:t,valueType:n,..._(r)})}function Qs(e,t,n){return new e({type:`set`,valueType:t,..._(n)})}function $s(e,t,n){return new e({type:`enum`,entries:Array.isArray(t)?Object.fromEntries(t.map(e=>[e,e])):t,..._(n)})}function ec(e,t,n){return new e({type:`enum`,entries:t,..._(n)})}function tc(e,t,n){return new e({type:`literal`,values:Array.isArray(t)?t:[t],..._(n)})}function nc(e,t){return new e({type:`file`,..._(t)})}function rc(e,t){return new e({type:`transform`,transform:t})}function ic(e,t){return new e({type:`optional`,innerType:t})}function ac(e,t){return new e({type:`nullable`,innerType:t})}function oc(e,t,n){return new e({type:`default`,innerType:t,get defaultValue(){return typeof n==`function`?n():n}})}function sc(e,t,n){return new e({type:`nonoptional`,innerType:t,..._(n)})}function cc(e,t){return new e({type:`success`,innerType:t})}function lc(e,t,n){return new e({type:`catch`,innerType:t,catchValue:typeof n==`function`?n:()=>n})}function uc(e,t,n){return new e({type:`pipe`,in:t,out:n})}function dc(e,t){return new e({type:`readonly`,innerType:t})}function fc(e,t,n){return new e({type:`template_literal`,parts:t,..._(n)})}function pc(e,t){return new e({type:`lazy`,getter:t})}function mc(e,t){return new e({type:`promise`,innerType:t})}function hc(e,t,n){let r=_(n);return r.abort??=!0,new e({type:`custom`,check:`custom`,fn:t,...r})}function gc(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,..._(n)})}function _c(e,t){let n=_(t),r=n.truthy??[`true`,`1`,`yes`,`on`,`y`,`enabled`],i=n.falsy??[`false`,`0`,`no`,`off`,`n`,`disabled`];n.case!==`sensitive`&&(r=r.map(e=>typeof e==`string`?e.toLowerCase():e),i=i.map(e=>typeof e==`string`?e.toLowerCase():e));let a=new Set(r),o=new Set(i),s=e.Pipe??qr,c=e.Boolean??hr,l=e.String??Hn,u=new(e.Transform??Rr)({type:`transform`,transform:(e,t)=>{let r=e;return n.case!==`sensitive`&&(r=r.toLowerCase()),a.has(r)?!0:!o.has(r)&&(t.issues.push({code:`invalid_value`,expected:`stringbool`,values:[...a,...o],input:t.value,inst:u}),{})},error:n.error});return new s({type:`pipe`,in:new s({type:`pipe`,in:new l({type:`string`,error:n.error}),out:u,error:n.error}),out:new c({type:`boolean`,error:n.error}),error:n.error})}function vc(e,t,n,r={}){let i=_(r),a={..._(r),check:`string_format`,type:`string`,format:t,fn:typeof n==`function`?n:e=>n.test(e),...i};return n instanceof RegExp&&(a.pattern=n),new e(a)}var yc,bc=t((()=>{bn(),$r(),x(),yc={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6}}));function xc(e){return new Sc({type:`function`,input:Array.isArray(e?.input)?Ys(jr,e?.input):e?.input??Gs(Er,ps(Sr)),output:e?.output??ps(Sr)})}var Sc,Cc=t((()=>{bc(),it(),$r(),Sc=class{constructor(e){this._def=e,this.def=e}implement(e){if(typeof e!=`function`)throw Error(`implement() must be called with a function`);let t=((...n)=>{let r=this._def.input?Ze(this._def.input,n,void 0,{callee:t}):n;if(!Array.isArray(r))throw Error(`Invalid arguments schema: not an array or tuple schema.`);let i=e(...r);return this._def.output?Ze(this._def.output,i,void 0,{callee:t}):i});return t}implementAsync(e){if(typeof e!=`function`)throw Error(`implement() must be called with a function`);let t=(async(...n)=>{let r=this._def.input?await $e(this._def.input,n,void 0,{callee:t}):n;if(!Array.isArray(r))throw Error(`Invalid arguments schema: not an array or tuple schema.`);let i=await e(...r);return this._def.output?$e(this._def.output,i,void 0,{callee:t}):i});return t}input(...e){let t=this.constructor;return Array.isArray(e[0])?new t({type:`function`,input:new jr({type:`tuple`,items:e[0],rest:e[1]}),output:this._def.output}):new t({type:`function`,input:e[0],output:this._def.output})}output(e){let t=this.constructor;return new t({type:`function`,input:this._def.input,output:e})}}}));function wc(e,t){if(e instanceof bo){let n=new Tc(t),r={};for(let t of e._idmap.entries()){let[e,r]=t;n.process(r)}let i={},a={registry:e,uri:t?.uri,defs:r};for(let r of e._idmap.entries()){let[e,o]=r;i[e]=n.emit(o,{...t,external:a})}return Object.keys(r).length>0&&(i.__shared={[n.target===`draft-2020-12`?`$defs`:`definitions`]:r}),{schemas:i}}let n=new Tc(t);return n.process(e),n.emit(e,t)}function O(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;switch(r.type){case`string`:case`number`:case`bigint`:case`boolean`:case`date`:case`symbol`:case`undefined`:case`null`:case`any`:case`unknown`:case`never`:case`void`:case`literal`:case`enum`:case`nan`:case`file`:case`template_literal`:return!1;case`array`:return O(r.element,n);case`object`:for(let e in r.shape)if(O(r.shape[e],n))return!0;return!1;case`union`:for(let e of r.options)if(O(e,n))return!0;return!1;case`intersection`:return O(r.left,n)||O(r.right,n);case`tuple`:for(let e of r.items)if(O(e,n))return!0;return!!(r.rest&&O(r.rest,n));case`record`:return O(r.keyType,n)||O(r.valueType,n);case`map`:return O(r.keyType,n)||O(r.valueType,n);case`set`:return O(r.valueType,n);case`promise`:case`optional`:case`nonoptional`:case`nullable`:case`readonly`:return O(r.innerType,n);case`lazy`:return O(r.getter(),n);case`default`:return O(r.innerType,n);case`prefault`:return O(r.innerType,n);case`custom`:return!1;case`transform`:return!0;case`pipe`:return O(r.in,n)||O(r.out,n);case`success`:return!1;case`catch`:return!1}throw Error(`Unknown schema type: ${r.type}`)}var Tc,Ec=t((()=>{xo(),x(),Tc=class{constructor(e){this.counter=0,this.metadataRegistry=e?.metadata??T,this.target=e?.target??`draft-2020-12`,this.unrepresentable=e?.unrepresentable??`throw`,this.override=e?.override??(()=>{}),this.io=e?.io??`output`,this.seen=new Map}process(e,t={path:[],schemaPath:[]}){var n;let r=e._zod.def,i={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},a=this.seen.get(e);if(a)return a.count++,t.schemaPath.includes(e)&&(a.cycle=t.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:t.path};this.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let n={...t,schemaPath:[...t.schemaPath,e],path:t.path},a=e._zod.parent;if(a)o.ref=a,this.process(a,n),this.seen.get(a).isParent=!0;else{let t=o.schema;switch(r.type){case`string`:{let n=t;n.type=`string`;let{minimum:r,maximum:a,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof r==`number`&&(n.minLength=r),typeof a==`number`&&(n.maxLength=a),s&&(n.format=i[s]??s,n.format===``&&delete n.format),l&&(n.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?n.pattern=e[0].source:e.length>1&&(o.schema.allOf=[...e.map(e=>({...this.target===`draft-7`?{type:`string`}:{},pattern:e.source}))])}break}case`number`:{let n=t,{minimum:r,maximum:i,format:a,multipleOf:o,exclusiveMaximum:s,exclusiveMinimum:c}=e._zod.bag;n.type=typeof a==`string`&&a.includes(`int`)?`integer`:`number`,typeof c==`number`&&(n.exclusiveMinimum=c),typeof r==`number`&&(n.minimum=r,typeof c==`number`&&(c>=r?delete n.minimum:delete n.exclusiveMinimum)),typeof s==`number`&&(n.exclusiveMaximum=s),typeof i==`number`&&(n.maximum=i,typeof s==`number`&&(s<=i?delete n.maximum:delete n.exclusiveMaximum)),typeof o==`number`&&(n.multipleOf=o);break}case`boolean`:{let e=t;e.type=`boolean`;break}case`bigint`:if(this.unrepresentable===`throw`)throw Error(`BigInt cannot be represented in JSON Schema`);break;case`symbol`:if(this.unrepresentable===`throw`)throw Error(`Symbols cannot be represented in JSON Schema`);break;case`null`:t.type=`null`;break;case`any`:break;case`unknown`:break;case`undefined`:if(this.unrepresentable===`throw`)throw Error(`Undefined cannot be represented in JSON Schema`);break;case`void`:if(this.unrepresentable===`throw`)throw Error(`Void cannot be represented in JSON Schema`);break;case`never`:t.not={};break;case`date`:if(this.unrepresentable===`throw`)throw Error(`Date cannot be represented in JSON Schema`);break;case`array`:{let i=t,{minimum:a,maximum:o}=e._zod.bag;typeof a==`number`&&(i.minItems=a),typeof o==`number`&&(i.maxItems=o),i.type=`array`,i.items=this.process(r.element,{...n,path:[...n.path,`items`]});break}case`object`:{let e=t;e.type=`object`,e.properties={};let i=r.shape;for(let t in i)e.properties[t]=this.process(i[t],{...n,path:[...n.path,`properties`,t]});let a=new Set(Object.keys(i)),o=new Set([...a].filter(e=>{let t=r.shape[e]._zod;return this.io===`input`?t.optin===void 0:t.optout===void 0}));o.size>0&&(e.required=Array.from(o)),r.catchall?._zod.def.type===`never`?e.additionalProperties=!1:r.catchall?r.catchall&&(e.additionalProperties=this.process(r.catchall,{...n,path:[...n.path,`additionalProperties`]})):this.io===`output`&&(e.additionalProperties=!1);break}case`union`:{let e=t;e.anyOf=r.options.map((e,t)=>this.process(e,{...n,path:[...n.path,`anyOf`,t]}));break}case`intersection`:{let e=t,i=this.process(r.left,{...n,path:[...n.path,`allOf`,0]}),a=this.process(r.right,{...n,path:[...n.path,`allOf`,1]}),o=e=>`allOf`in e&&Object.keys(e).length===1;e.allOf=[...o(i)?i.allOf:[i],...o(a)?a.allOf:[a]];break}case`tuple`:{let i=t;i.type=`array`;let a=r.items.map((e,t)=>this.process(e,{...n,path:[...n.path,`prefixItems`,t]}));if(this.target===`draft-2020-12`?i.prefixItems=a:i.items=a,r.rest){let e=this.process(r.rest,{...n,path:[...n.path,`items`]});this.target===`draft-2020-12`?i.items=e:i.additionalItems=e}r.rest&&(i.items=this.process(r.rest,{...n,path:[...n.path,`items`]}));let{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s);break}case`record`:{let e=t;e.type=`object`,e.propertyNames=this.process(r.keyType,{...n,path:[...n.path,`propertyNames`]}),e.additionalProperties=this.process(r.valueType,{...n,path:[...n.path,`additionalProperties`]});break}case`map`:if(this.unrepresentable===`throw`)throw Error(`Map cannot be represented in JSON Schema`);break;case`set`:if(this.unrepresentable===`throw`)throw Error(`Set cannot be represented in JSON Schema`);break;case`enum`:{let e=t,n=ie(r.entries);n.every(e=>typeof e==`number`)&&(e.type=`number`),n.every(e=>typeof e==`string`)&&(e.type=`string`),e.enum=n;break}case`literal`:{let e=t,n=[];for(let e of r.values)if(e===void 0){if(this.unrepresentable===`throw`)throw Error(\"Literal `undefined` cannot be represented in JSON Schema\")}else if(typeof e==`bigint`){if(this.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);n.push(Number(e))}else n.push(e);if(n.length!==0){if(n.length===1){let t=n[0];e.type=t===null?`null`:typeof t,e.const=t}else n.every(e=>typeof e==`number`)&&(e.type=`number`),n.every(e=>typeof e==`string`)&&(e.type=`string`),n.every(e=>typeof e==`boolean`)&&(e.type=`string`),n.every(e=>e===null)&&(e.type=`null`),e.enum=n}break}case`file`:{let n=t,r={type:`string`,format:`binary`,contentEncoding:`binary`},{minimum:i,maximum:a,mime:o}=e._zod.bag;i!==void 0&&(r.minLength=i),a!==void 0&&(r.maxLength=a),o?o.length===1?(r.contentMediaType=o[0],Object.assign(n,r)):n.anyOf=o.map(e=>({...r,contentMediaType:e})):Object.assign(n,r);break}case`transform`:if(this.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`);break;case`nullable`:t.anyOf=[this.process(r.innerType,n),{type:`null`}];break;case`nonoptional`:this.process(r.innerType,n),o.ref=r.innerType;break;case`success`:{let e=t;e.type=`boolean`;break}case`default`:this.process(r.innerType,n),o.ref=r.innerType,t.default=JSON.parse(JSON.stringify(r.defaultValue));break;case`prefault`:this.process(r.innerType,n),o.ref=r.innerType,this.io===`input`&&(t._prefault=JSON.parse(JSON.stringify(r.defaultValue)));break;case`catch`:{this.process(r.innerType,n),o.ref=r.innerType;let e;try{e=r.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}t.default=e;break}case`nan`:if(this.unrepresentable===`throw`)throw Error(`NaN cannot be represented in JSON Schema`);break;case`template_literal`:{let n=t,r=e._zod.pattern;if(!r)throw Error(`Pattern not found in template literal`);n.type=`string`,n.pattern=r.source;break}case`pipe`:{let e=this.io===`input`?r.in._zod.def.type===`transform`?r.out:r.in:r.out;this.process(e,n),o.ref=e;break}case`readonly`:this.process(r.innerType,n),o.ref=r.innerType,t.readOnly=!0;break;case`promise`:this.process(r.innerType,n),o.ref=r.innerType;break;case`optional`:this.process(r.innerType,n),o.ref=r.innerType;break;case`lazy`:{let t=e._zod.innerType;this.process(t,n),o.ref=t;break}case`custom`:if(this.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)}}}let c=this.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),this.io===`input`&&O(e)&&(delete o.schema.examples,delete o.schema.default),this.io===`input`&&o.schema._prefault&&((n=o.schema).default??(n.default=o.schema._prefault)),delete o.schema._prefault,this.seen.get(e).schema}emit(e,t){let n={cycles:t?.cycles??`ref`,reused:t?.reused??`inline`,external:t?.external??void 0},r=this.seen.get(e);if(!r)throw Error(`Unprocessed schema. This is a bug in Zod.`);let i=e=>{let t=this.target===`draft-2020-12`?`$defs`:`definitions`;if(n.external){let r=n.external.registry.get(e[0])?.id,i=n.external.uri??(e=>e);if(r)return{ref:i(r)};let a=e[1].defId??e[1].schema.id??`schema${this.counter++}`;return e[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${t}/${a}`}}if(e[1]===r)return{ref:`#`};let i=`#/${t}/`,a=e[1].schema.id??`__schema${this.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(n.cycles===`throw`)for(let e of this.seen.entries()){let t=e[1];if(t.cycle)throw Error(`Cycle detected: #/${t.cycle?.join(`/`)}/<root>\n\nSet the \\`cycles\\` parameter to \\`\"ref\"\\` to resolve cyclical schemas with defs.`)}for(let t of this.seen.entries()){let r=t[1];if(e===t[0]){a(t);continue}if(n.external){let r=n.external.registry.get(t[0])?.id;if(e!==t[0]&&r){a(t);continue}}if(this.metadataRegistry.get(t[0])?.id){a(t);continue}if(r.cycle){a(t);continue}if(r.count>1&&n.reused===`ref`){a(t);continue}}let o=(e,t)=>{let n=this.seen.get(e),r=n.def??n.schema,i={...r};if(n.ref===null)return;let a=n.ref;if(n.ref=null,a){o(a,t);let e=this.seen.get(a).schema;e.$ref&&t.target===`draft-7`?(r.allOf=r.allOf??[],r.allOf.push(e)):(Object.assign(r,e),Object.assign(r,i))}n.isParent||this.override({zodSchema:e,jsonSchema:r,path:n.path??[]})};for(let e of[...this.seen.entries()].reverse())o(e[0],{target:this.target});let s={};if(this.target===`draft-2020-12`?s.$schema=`https://json-schema.org/draft/2020-12/schema`:this.target===`draft-7`?s.$schema=`http://json-schema.org/draft-07/schema#`:console.warn(`Invalid target: ${this.target}`),n.external?.uri){let t=n.external.registry.get(e)?.id;if(!t)throw Error(\"Schema is missing an `id` property\");s.$id=n.external.uri(t)}Object.assign(s,r.def);let c=n.external?.defs??{};for(let e of this.seen.entries()){let t=e[1];t.def&&t.defId&&(c[t.defId]=t.def)}n.external||Object.keys(c).length>0&&(this.target===`draft-2020-12`?s.$defs=c:s.definitions=c);try{return JSON.parse(JSON.stringify(s))}catch{throw Error(`Error converting schema to JSON.`)}}}})),Dc=r({}),Oc=t((()=>{})),kc=r({$ZodAny:()=>xr,$ZodArray:()=>Er,$ZodAsyncError:()=>l,$ZodBase64:()=>cr,$ZodBase64URL:()=>lr,$ZodBigInt:()=>gr,$ZodBigIntFormat:()=>_r,$ZodBoolean:()=>hr,$ZodCIDRv4:()=>or,$ZodCIDRv6:()=>sr,$ZodCUID:()=>Yn,$ZodCUID2:()=>Xn,$ZodCatch:()=>Gr,$ZodCheck:()=>S,$ZodCheckBigIntFormat:()=>nn,$ZodCheckEndsWith:()=>gn,$ZodCheckGreaterThan:()=>$t,$ZodCheckIncludes:()=>mn,$ZodCheckLengthEquals:()=>ln,$ZodCheckLessThan:()=>Qt,$ZodCheckLowerCase:()=>fn,$ZodCheckMaxLength:()=>sn,$ZodCheckMaxSize:()=>rn,$ZodCheckMimeType:()=>vn,$ZodCheckMinLength:()=>cn,$ZodCheckMinSize:()=>an,$ZodCheckMultipleOf:()=>en,$ZodCheckNumberFormat:()=>tn,$ZodCheckOverwrite:()=>yn,$ZodCheckProperty:()=>_n,$ZodCheckRegex:()=>dn,$ZodCheckSizeEquals:()=>on,$ZodCheckStartsWith:()=>hn,$ZodCheckStringFormat:()=>un,$ZodCheckUpperCase:()=>pn,$ZodCustom:()=>Qr,$ZodCustomStringFormat:()=>fr,$ZodDate:()=>Tr,$ZodDefault:()=>Vr,$ZodDiscriminatedUnion:()=>kr,$ZodE164:()=>ur,$ZodEmail:()=>Gn,$ZodEmoji:()=>qn,$ZodEnum:()=>Fr,$ZodError:()=>qe,$ZodFile:()=>Lr,$ZodFunction:()=>Sc,$ZodGUID:()=>Un,$ZodIPv4:()=>ir,$ZodIPv6:()=>ar,$ZodISODate:()=>tr,$ZodISODateTime:()=>er,$ZodISODuration:()=>rr,$ZodISOTime:()=>nr,$ZodIntersection:()=>Ar,$ZodJWT:()=>dr,$ZodKSUID:()=>$n,$ZodLazy:()=>Zr,$ZodLiteral:()=>Ir,$ZodMap:()=>Nr,$ZodNaN:()=>Kr,$ZodNanoID:()=>Jn,$ZodNever:()=>Cr,$ZodNonOptional:()=>Ur,$ZodNull:()=>br,$ZodNullable:()=>Br,$ZodNumber:()=>pr,$ZodNumberFormat:()=>mr,$ZodObject:()=>Dr,$ZodOptional:()=>zr,$ZodPipe:()=>qr,$ZodPrefault:()=>Hr,$ZodPromise:()=>Xr,$ZodReadonly:()=>Jr,$ZodRealError:()=>Je,$ZodRecord:()=>Mr,$ZodRegistry:()=>bo,$ZodSet:()=>Pr,$ZodString:()=>Hn,$ZodStringFormat:()=>w,$ZodSuccess:()=>Wr,$ZodSymbol:()=>vr,$ZodTemplateLiteral:()=>Yr,$ZodTransform:()=>Rr,$ZodTuple:()=>jr,$ZodType:()=>C,$ZodULID:()=>Zn,$ZodURL:()=>Kn,$ZodUUID:()=>Wn,$ZodUndefined:()=>yr,$ZodUnion:()=>Or,$ZodUnknown:()=>Sr,$ZodVoid:()=>wr,$ZodXID:()=>Qn,$brand:()=>c,$constructor:()=>a,$input:()=>yo,$output:()=>vo,Doc:()=>xn,JSONSchema:()=>Dc,JSONSchemaGenerator:()=>Tc,NEVER:()=>s,TimePrecision:()=>yc,_any:()=>fs,_array:()=>Gs,_base64:()=>Ho,_base64url:()=>Uo,_bigint:()=>as,_boolean:()=>rs,_catch:()=>lc,_cidrv4:()=>Bo,_cidrv6:()=>Vo,_coercedBigint:()=>os,_coercedBoolean:()=>is,_coercedDate:()=>_s,_coercedNumber:()=>Zo,_coercedString:()=>Co,_cuid:()=>No,_cuid2:()=>Po,_custom:()=>hc,_date:()=>gs,_default:()=>oc,_discriminatedUnion:()=>qs,_e164:()=>Wo,_email:()=>wo,_emoji:()=>jo,_endsWith:()=>Ls,_enum:()=>$s,_file:()=>nc,_float32:()=>$o,_float64:()=>es,_gt:()=>bs,_gte:()=>D,_guid:()=>To,_includes:()=>Fs,_int:()=>Qo,_int32:()=>ts,_int64:()=>ss,_intersection:()=>Js,_ipv4:()=>Ro,_ipv6:()=>zo,_isoDate:()=>qo,_isoDateTime:()=>Ko,_isoDuration:()=>Yo,_isoTime:()=>Jo,_jwt:()=>Go,_ksuid:()=>Lo,_lazy:()=>pc,_length:()=>js,_literal:()=>tc,_lowercase:()=>Ns,_lt:()=>ys,_lte:()=>E,_map:()=>Zs,_max:()=>E,_maxLength:()=>ks,_maxSize:()=>Es,_mime:()=>zs,_min:()=>D,_minLength:()=>As,_minSize:()=>Ds,_multipleOf:()=>Ts,_nan:()=>vs,_nanoid:()=>Mo,_nativeEnum:()=>ec,_negative:()=>Ss,_never:()=>ms,_nonnegative:()=>ws,_nonoptional:()=>sc,_nonpositive:()=>Cs,_normalize:()=>Vs,_null:()=>ds,_nullable:()=>ac,_number:()=>Xo,_optional:()=>ic,_overwrite:()=>Bs,_parse:()=>Xe,_parseAsync:()=>Qe,_pipe:()=>uc,_positive:()=>xs,_promise:()=>mc,_property:()=>Rs,_readonly:()=>dc,_record:()=>Xs,_refine:()=>gc,_regex:()=>Ms,_safeParse:()=>et,_safeParseAsync:()=>nt,_set:()=>Qs,_size:()=>Os,_startsWith:()=>Is,_string:()=>So,_stringFormat:()=>vc,_stringbool:()=>_c,_success:()=>cc,_symbol:()=>ls,_templateLiteral:()=>fc,_toLowerCase:()=>Us,_toUpperCase:()=>Ws,_transform:()=>rc,_trim:()=>Hs,_tuple:()=>Ys,_uint32:()=>ns,_uint64:()=>cs,_ulid:()=>Fo,_undefined:()=>us,_union:()=>Ks,_unknown:()=>ps,_uppercase:()=>Ps,_url:()=>Ao,_uuid:()=>Eo,_uuidv4:()=>Do,_uuidv6:()=>Oo,_uuidv7:()=>ko,_void:()=>hs,_xid:()=>Io,clone:()=>g,config:()=>o,flattenError:()=>Ve,formatError:()=>He,function:()=>xc,globalConfig:()=>u,globalRegistry:()=>T,isValidBase64:()=>Tn,isValidBase64URL:()=>En,isValidJWT:()=>Dn,locales:()=>ho,parse:()=>Ze,parseAsync:()=>$e,prettifyError:()=>Ge,regexes:()=>at,registry:()=>_o,safeParse:()=>tt,safeParseAsync:()=>rt,toDotPath:()=>We,toJSONSchema:()=>wc,treeifyError:()=>Ue,util:()=>f,version:()=>Cn}),k=t((()=>{d(),it(),Ye(),$r(),bn(),wn(),x(),Yt(),go(),xo(),Sn(),Cc(),bc(),Ec(),Oc()})),Ac=t((()=>{k()})),jc=t((()=>{})),Mc=t((()=>{k()})),Nc=t((()=>{k(),Ac(),jc(),Mc(),go(),jc()})),Pc=t((()=>{Nc()})),Fc=t((()=>{Pc()}));function Ic(e){return!!e._zod}function Lc(e,t){return Ic(e)?tt(e,t):e.safeParse(t)}function Rc(e){if(!e)return;let t;if(t=Ic(e)?e._zod?.def?.shape:e.shape,t){if(typeof t==`function`)try{return t()}catch{return}return t}}function zc(e){if(Ic(e)){let t=e._zod?.def;if(t){if(t.value!==void 0)return t.value;if(Array.isArray(t.values)&&t.values.length>0)return t.values[0]}}let t=e._def;if(t){if(t.value!==void 0)return t.value;if(Array.isArray(t.values)&&t.values.length>0)return t.values[0]}let n=e.value;if(n!==void 0)return n}var Bc=t((()=>{Fc()})),Vc=t((()=>{k()})),Hc=r({ZodISODate:()=>Jc,ZodISODateTime:()=>qc,ZodISODuration:()=>Xc,ZodISOTime:()=>Yc,date:()=>Wc,datetime:()=>Uc,duration:()=>Kc,time:()=>Gc});function Uc(e){return Ko(qc,e)}function Wc(e){return qo(Jc,e)}function Gc(e){return Jo(Yc,e)}function Kc(e){return Yo(Xc,e)}var qc,Jc,Yc,Xc,Zc=t((()=>{k(),Ad(),qc=a(`ZodISODateTime`,(e,t)=>{er.init(e,t),U.init(e,t)}),Jc=a(`ZodISODate`,(e,t)=>{tr.init(e,t),U.init(e,t)}),Yc=a(`ZodISOTime`,(e,t)=>{nr.init(e,t),U.init(e,t)}),Xc=a(`ZodISODuration`,(e,t)=>{rr.init(e,t),U.init(e,t)})})),Qc,$c,el,tl=t((()=>{k(),Qc=(e,t)=>{qe.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>He(e,t)},flatten:{value:t=>Ve(e,t)},addIssue:{value:t=>e.issues.push(t)},addIssues:{value:t=>e.issues.push(...t)},isEmpty:{get(){return e.issues.length===0}}})},$c=a(`ZodError`,Qc),el=a(`ZodError`,Qc,{Parent:Error})})),nl,rl,il,al,ol=t((()=>{k(),tl(),nl=Xe(el),rl=Qe(el),il=et(el),al=nt(el)}));function A(e){return So(Cu,e)}function sl(e){return wo(wu,e)}function cl(e){return To(Tu,e)}function ll(e){return Eo(W,e)}function ul(e){return Do(W,e)}function dl(e){return Oo(W,e)}function fl(e){return ko(W,e)}function pl(e){return Ao(Eu,e)}function ml(e){return jo(Du,e)}function hl(e){return Mo(Ou,e)}function gl(e){return No(ku,e)}function _l(e){return Po(Au,e)}function vl(e){return Fo(ju,e)}function yl(e){return Io(Mu,e)}function bl(e){return Lo(Nu,e)}function xl(e){return Ro(Pu,e)}function Sl(e){return zo(Fu,e)}function Cl(e){return Bo(Iu,e)}function wl(e){return Vo(Lu,e)}function Tl(e){return Ho(Ru,e)}function El(e){return Uo(zu,e)}function Dl(e){return Wo(Bu,e)}function Ol(e){return Go(Vu,e)}function kl(e,t,n={}){return vc(Hu,e,t,n)}function j(e){return Xo(Uu,e)}function Al(e){return Qo(Wu,e)}function jl(e){return $o(Wu,e)}function Ml(e){return es(Wu,e)}function Nl(e){return ts(Wu,e)}function Pl(e){return ns(Wu,e)}function M(e){return rs(Gu,e)}function Fl(e){return as(Ku,e)}function Il(e){return ss(qu,e)}function Ll(e){return cs(qu,e)}function Rl(e){return ls(Ju,e)}function zl(e){return us(Yu,e)}function Bl(e){return ds(Xu,e)}function Vl(){return fs(Zu)}function N(){return ps(Qu)}function Hl(e){return ms($u,e)}function Ul(e){return hs(ed,e)}function Wl(e){return gs(td,e)}function P(e,t){return Gs(nd,e,t)}function Gl(e){let t=e._zod.def.shape;return B(Object.keys(t))}function F(e,t){let n={type:`object`,get shape(){return ue(this,`shape`,{...e}),this.shape},..._(t)};return new rd(n)}function Kl(e,t){return new rd({type:`object`,get shape(){return ue(this,`shape`,{...e}),this.shape},catchall:Hl(),..._(t)})}function I(e,t){return new rd({type:`object`,get shape(){return ue(this,`shape`,{...e}),this.shape},catchall:N(),..._(t)})}function L(e,t){return new id({type:`union`,options:e,..._(t)})}function ql(e,t,n){return new ad({type:`union`,options:t,discriminator:e,..._(n)})}function Jl(e,t){return new od({type:`intersection`,left:e,right:t})}function Yl(e,t,n){let r=t instanceof C;return new sd({type:`tuple`,items:e,rest:r?t:null,..._(r?n:t)})}function R(e,t,n){return new cd({type:`record`,keyType:e,valueType:t,..._(n)})}function Xl(e,t,n){return new cd({type:`record`,keyType:L([e,Hl()]),valueType:t,..._(n)})}function Zl(e,t,n){return new ld({type:`map`,keyType:e,valueType:t,..._(n)})}function Ql(e,t){return new ud({type:`set`,valueType:e,..._(t)})}function z(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new dd({type:`enum`,entries:n,..._(t)})}function $l(e,t){return new dd({type:`enum`,entries:e,..._(t)})}function B(e,t){return new fd({type:`literal`,values:Array.isArray(e)?e:[e],..._(t)})}function eu(e){return nc(pd,e)}function tu(e){return new md({type:`transform`,transform:e})}function V(e){return new hd({type:`optional`,innerType:e})}function nu(e){return new gd({type:`nullable`,innerType:e})}function ru(e){return V(nu(e))}function iu(e,t){return new _d({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():t}})}function au(e,t){return new vd({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():t}})}function ou(e,t){return new yd({type:`nonoptional`,innerType:e,..._(t)})}function su(e){return new bd({type:`success`,innerType:e})}function cu(e,t){return new xd({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}function lu(e){return vs(Sd,e)}function uu(e,t){return new Cd({type:`pipe`,in:e,out:t})}function du(e){return new wd({type:`readonly`,innerType:e})}function fu(e,t){return new Td({type:`template_literal`,parts:e,..._(t)})}function pu(e){return new Ed({type:`lazy`,getter:e})}function mu(e){return new Dd({type:`promise`,innerType:e})}function hu(e){let t=new S({check:`custom`});return t._zod.check=e,t}function gu(e,t){return hc(Od,e??(()=>!0),t)}function _u(e,t={}){return gc(Od,e,t)}function vu(e){let t=hu(n=>(n.addIssue=e=>{if(typeof e==`string`)n.issues.push(je(e,n.value,t._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=n.value,r.inst??=t,r.continue??=!t._zod.def.abort,n.issues.push(je(r))}},e(n.value,n)));return t}function yu(e,t={error:`Input not instance of ${e.name}`}){let n=new Od({type:`custom`,check:`custom`,fn:t=>t instanceof e,abort:!0,..._(t)});return n._zod.bag.Class=e,n}function bu(e){let t=pu(()=>L([A(e),j(),M(),Bl(),P(t),R(A(),t)]));return t}function xu(e,t){return uu(tu(e),t)}var H,Su,Cu,U,wu,Tu,W,Eu,Du,Ou,ku,Au,ju,Mu,Nu,Pu,Fu,Iu,Lu,Ru,zu,Bu,Vu,Hu,Uu,Wu,Gu,Ku,qu,Ju,Yu,Xu,Zu,Qu,$u,ed,td,nd,rd,id,ad,od,sd,cd,ld,ud,dd,fd,pd,md,hd,gd,_d,vd,yd,bd,xd,Sd,Cd,wd,Td,Ed,Dd,Od,kd,Ad=t((()=>{k(),Vc(),Zc(),ol(),H=a(`ZodType`,(e,t)=>(C.init(e,t),e.def=t,Object.defineProperty(e,\"_def\",{value:t}),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),e.clone=(t,n)=>g(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.parse=(t,n)=>nl(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>il(e,t,n),e.parseAsync=async(t,n)=>rl(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>al(e,t,n),e.spa=e.safeParseAsync,e.refine=(t,n)=>e.check(_u(t,n)),e.superRefine=t=>e.check(vu(t)),e.overwrite=t=>e.check(Bs(t)),e.optional=()=>V(e),e.nullable=()=>nu(e),e.nullish=()=>V(nu(e)),e.nonoptional=t=>ou(e,t),e.array=()=>P(e),e.or=t=>L([e,t]),e.and=t=>Jl(e,t),e.transform=t=>uu(e,tu(t)),e.default=t=>iu(e,t),e.prefault=t=>au(e,t),e.catch=t=>cu(e,t),e.pipe=t=>uu(e,t),e.readonly=()=>du(e),e.describe=t=>{let n=e.clone();return T.add(n,{description:t}),n},Object.defineProperty(e,\"description\",{get(){return T.get(e)?.description},configurable:!0}),e.meta=(...t)=>{if(t.length===0)return T.get(e);let n=e.clone();return T.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),Su=a(`_ZodString`,(e,t)=>{Hn.init(e,t),H.init(e,t);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(Ms(...t)),e.includes=(...t)=>e.check(Fs(...t)),e.startsWith=(...t)=>e.check(Is(...t)),e.endsWith=(...t)=>e.check(Ls(...t)),e.min=(...t)=>e.check(As(...t)),e.max=(...t)=>e.check(ks(...t)),e.length=(...t)=>e.check(js(...t)),e.nonempty=(...t)=>e.check(As(1,...t)),e.lowercase=t=>e.check(Ns(t)),e.uppercase=t=>e.check(Ps(t)),e.trim=()=>e.check(Hs()),e.normalize=(...t)=>e.check(Vs(...t)),e.toLowerCase=()=>e.check(Us()),e.toUpperCase=()=>e.check(Ws())}),Cu=a(`ZodString`,(e,t)=>{Hn.init(e,t),Su.init(e,t),e.email=t=>e.check(wo(wu,t)),e.url=t=>e.check(Ao(Eu,t)),e.jwt=t=>e.check(Go(Vu,t)),e.emoji=t=>e.check(jo(Du,t)),e.guid=t=>e.check(To(Tu,t)),e.uuid=t=>e.check(Eo(W,t)),e.uuidv4=t=>e.check(Do(W,t)),e.uuidv6=t=>e.check(Oo(W,t)),e.uuidv7=t=>e.check(ko(W,t)),e.nanoid=t=>e.check(Mo(Ou,t)),e.guid=t=>e.check(To(Tu,t)),e.cuid=t=>e.check(No(ku,t)),e.cuid2=t=>e.check(Po(Au,t)),e.ulid=t=>e.check(Fo(ju,t)),e.base64=t=>e.check(Ho(Ru,t)),e.base64url=t=>e.check(Uo(zu,t)),e.xid=t=>e.check(Io(Mu,t)),e.ksuid=t=>e.check(Lo(Nu,t)),e.ipv4=t=>e.check(Ro(Pu,t)),e.ipv6=t=>e.check(zo(Fu,t)),e.cidrv4=t=>e.check(Bo(Iu,t)),e.cidrv6=t=>e.check(Vo(Lu,t)),e.e164=t=>e.check(Wo(Bu,t)),e.datetime=t=>e.check(Uc(t)),e.date=t=>e.check(Wc(t)),e.time=t=>e.check(Gc(t)),e.duration=t=>e.check(Kc(t))}),U=a(`ZodStringFormat`,(e,t)=>{w.init(e,t),Su.init(e,t)}),wu=a(`ZodEmail`,(e,t)=>{Gn.init(e,t),U.init(e,t)}),Tu=a(`ZodGUID`,(e,t)=>{Un.init(e,t),U.init(e,t)}),W=a(`ZodUUID`,(e,t)=>{Wn.init(e,t),U.init(e,t)}),Eu=a(`ZodURL`,(e,t)=>{Kn.init(e,t),U.init(e,t)}),Du=a(`ZodEmoji`,(e,t)=>{qn.init(e,t),U.init(e,t)}),Ou=a(`ZodNanoID`,(e,t)=>{Jn.init(e,t),U.init(e,t)}),ku=a(`ZodCUID`,(e,t)=>{Yn.init(e,t),U.init(e,t)}),Au=a(`ZodCUID2`,(e,t)=>{Xn.init(e,t),U.init(e,t)}),ju=a(`ZodULID`,(e,t)=>{Zn.init(e,t),U.init(e,t)}),Mu=a(`ZodXID`,(e,t)=>{Qn.init(e,t),U.init(e,t)}),Nu=a(`ZodKSUID`,(e,t)=>{$n.init(e,t),U.init(e,t)}),Pu=a(`ZodIPv4`,(e,t)=>{ir.init(e,t),U.init(e,t)}),Fu=a(`ZodIPv6`,(e,t)=>{ar.init(e,t),U.init(e,t)}),Iu=a(`ZodCIDRv4`,(e,t)=>{or.init(e,t),U.init(e,t)}),Lu=a(`ZodCIDRv6`,(e,t)=>{sr.init(e,t),U.init(e,t)}),Ru=a(`ZodBase64`,(e,t)=>{cr.init(e,t),U.init(e,t)}),zu=a(`ZodBase64URL`,(e,t)=>{lr.init(e,t),U.init(e,t)}),Bu=a(`ZodE164`,(e,t)=>{ur.init(e,t),U.init(e,t)}),Vu=a(`ZodJWT`,(e,t)=>{dr.init(e,t),U.init(e,t)}),Hu=a(`ZodCustomStringFormat`,(e,t)=>{fr.init(e,t),U.init(e,t)}),Uu=a(`ZodNumber`,(e,t)=>{pr.init(e,t),H.init(e,t),e.gt=(t,n)=>e.check(bs(t,n)),e.gte=(t,n)=>e.check(D(t,n)),e.min=(t,n)=>e.check(D(t,n)),e.lt=(t,n)=>e.check(ys(t,n)),e.lte=(t,n)=>e.check(E(t,n)),e.max=(t,n)=>e.check(E(t,n)),e.int=t=>e.check(Al(t)),e.safe=t=>e.check(Al(t)),e.positive=t=>e.check(bs(0,t)),e.nonnegative=t=>e.check(D(0,t)),e.negative=t=>e.check(ys(0,t)),e.nonpositive=t=>e.check(E(0,t)),e.multipleOf=(t,n)=>e.check(Ts(t,n)),e.step=(t,n)=>e.check(Ts(t,n)),e.finite=()=>e;let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null}),Wu=a(`ZodNumberFormat`,(e,t)=>{mr.init(e,t),Uu.init(e,t)}),Gu=a(`ZodBoolean`,(e,t)=>{hr.init(e,t),H.init(e,t)}),Ku=a(`ZodBigInt`,(e,t)=>{gr.init(e,t),H.init(e,t),e.gte=(t,n)=>e.check(D(t,n)),e.min=(t,n)=>e.check(D(t,n)),e.gt=(t,n)=>e.check(bs(t,n)),e.gte=(t,n)=>e.check(D(t,n)),e.min=(t,n)=>e.check(D(t,n)),e.lt=(t,n)=>e.check(ys(t,n)),e.lte=(t,n)=>e.check(E(t,n)),e.max=(t,n)=>e.check(E(t,n)),e.positive=t=>e.check(bs(BigInt(0),t)),e.negative=t=>e.check(ys(BigInt(0),t)),e.nonpositive=t=>e.check(E(BigInt(0),t)),e.nonnegative=t=>e.check(D(BigInt(0),t)),e.multipleOf=(t,n)=>e.check(Ts(t,n));let n=e._zod.bag;e.minValue=n.minimum??null,e.maxValue=n.maximum??null,e.format=n.format??null}),qu=a(`ZodBigIntFormat`,(e,t)=>{_r.init(e,t),Ku.init(e,t)}),Ju=a(`ZodSymbol`,(e,t)=>{vr.init(e,t),H.init(e,t)}),Yu=a(`ZodUndefined`,(e,t)=>{yr.init(e,t),H.init(e,t)}),Xu=a(`ZodNull`,(e,t)=>{br.init(e,t),H.init(e,t)}),Zu=a(`ZodAny`,(e,t)=>{xr.init(e,t),H.init(e,t)}),Qu=a(`ZodUnknown`,(e,t)=>{Sr.init(e,t),H.init(e,t)}),$u=a(`ZodNever`,(e,t)=>{Cr.init(e,t),H.init(e,t)}),ed=a(`ZodVoid`,(e,t)=>{wr.init(e,t),H.init(e,t)}),td=a(`ZodDate`,(e,t)=>{Tr.init(e,t),H.init(e,t),e.min=(t,n)=>e.check(D(t,n)),e.max=(t,n)=>e.check(E(t,n));let n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null}),nd=a(`ZodArray`,(e,t)=>{Er.init(e,t),H.init(e,t),e.element=t.element,e.min=(t,n)=>e.check(As(t,n)),e.nonempty=t=>e.check(As(1,t)),e.max=(t,n)=>e.check(ks(t,n)),e.length=(t,n)=>e.check(js(t,n)),e.unwrap=()=>e.element}),rd=a(`ZodObject`,(e,t)=>{Dr.init(e,t),H.init(e,t),h(e,`shape`,()=>t.shape),e.keyof=()=>z(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:N()}),e.loose=()=>e.clone({...e._zod.def,catchall:N()}),e.strict=()=>e.clone({...e._zod.def,catchall:Hl()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>Ce(e,t),e.merge=t=>we(e,t),e.pick=t=>xe(e,t),e.omit=t=>Se(e,t),e.partial=(...t)=>Te(hd,e,t[0]),e.required=(...t)=>Ee(yd,e,t[0])}),id=a(`ZodUnion`,(e,t)=>{Or.init(e,t),H.init(e,t),e.options=t.options}),ad=a(`ZodDiscriminatedUnion`,(e,t)=>{id.init(e,t),kr.init(e,t)}),od=a(`ZodIntersection`,(e,t)=>{Ar.init(e,t),H.init(e,t)}),sd=a(`ZodTuple`,(e,t)=>{jr.init(e,t),H.init(e,t),e.rest=t=>e.clone({...e._zod.def,rest:t})}),cd=a(`ZodRecord`,(e,t)=>{Mr.init(e,t),H.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType}),ld=a(`ZodMap`,(e,t)=>{Nr.init(e,t),H.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType}),ud=a(`ZodSet`,(e,t)=>{Pr.init(e,t),H.init(e,t),e.min=(...t)=>e.check(Ds(...t)),e.nonempty=t=>e.check(Ds(1,t)),e.max=(...t)=>e.check(Es(...t)),e.size=(...t)=>e.check(Os(...t))}),dd=a(`ZodEnum`,(e,t)=>{Fr.init(e,t),H.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new dd({...t,checks:[],..._(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new dd({...t,checks:[],..._(r),entries:i})}}),fd=a(`ZodLiteral`,(e,t)=>{Ir.init(e,t),H.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,\"value\",{get(){if(t.values.length>1)throw Error(\"This schema contains multiple valid literal values. Use `.values` instead.\");return t.values[0]}})}),pd=a(`ZodFile`,(e,t)=>{Lr.init(e,t),H.init(e,t),e.min=(t,n)=>e.check(Ds(t,n)),e.max=(t,n)=>e.check(Es(t,n)),e.mime=(t,n)=>e.check(zs(Array.isArray(t)?t:[t],n))}),md=a(`ZodTransform`,(e,t)=>{Rr.init(e,t),H.init(e,t),e._zod.parse=(n,r)=>{n.addIssue=r=>{if(typeof r==`string`)n.issues.push(je(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,t.continue??=!0,n.issues.push(je(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}}),hd=a(`ZodOptional`,(e,t)=>{zr.init(e,t),H.init(e,t),e.unwrap=()=>e._zod.def.innerType}),gd=a(`ZodNullable`,(e,t)=>{Br.init(e,t),H.init(e,t),e.unwrap=()=>e._zod.def.innerType}),_d=a(`ZodDefault`,(e,t)=>{Vr.init(e,t),H.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap}),vd=a(`ZodPrefault`,(e,t)=>{Hr.init(e,t),H.init(e,t),e.unwrap=()=>e._zod.def.innerType}),yd=a(`ZodNonOptional`,(e,t)=>{Ur.init(e,t),H.init(e,t),e.unwrap=()=>e._zod.def.innerType}),bd=a(`ZodSuccess`,(e,t)=>{Wr.init(e,t),H.init(e,t),e.unwrap=()=>e._zod.def.innerType}),xd=a(`ZodCatch`,(e,t)=>{Gr.init(e,t),H.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap}),Sd=a(`ZodNaN`,(e,t)=>{Kr.init(e,t),H.init(e,t)}),Cd=a(`ZodPipe`,(e,t)=>{qr.init(e,t),H.init(e,t),e.in=t.in,e.out=t.out}),wd=a(`ZodReadonly`,(e,t)=>{Jr.init(e,t),H.init(e,t)}),Td=a(`ZodTemplateLiteral`,(e,t)=>{Yr.init(e,t),H.init(e,t)}),Ed=a(`ZodLazy`,(e,t)=>{Zr.init(e,t),H.init(e,t),e.unwrap=()=>e._zod.def.getter()}),Dd=a(`ZodPromise`,(e,t)=>{Xr.init(e,t),H.init(e,t),e.unwrap=()=>e._zod.def.innerType}),Od=a(`ZodCustom`,(e,t)=>{Qr.init(e,t),H.init(e,t)}),kd=(...e)=>_c({Pipe:Cd,Boolean:Gu,String:Cu,Transform:md},...e)}));function jd(e){o({customError:e})}function Md(){return o().customError}var Nd,Pd=t((()=>{k(),Nd={invalid_type:`invalid_type`,too_big:`too_big`,too_small:`too_small`,invalid_format:`invalid_format`,not_multiple_of:`not_multiple_of`,unrecognized_keys:`unrecognized_keys`,invalid_union:`invalid_union`,invalid_key:`invalid_key`,invalid_element:`invalid_element`,invalid_value:`invalid_value`,custom:`custom`}})),Fd=r({bigint:()=>zd,boolean:()=>Rd,date:()=>Bd,number:()=>Ld,string:()=>Id});function Id(e){return Co(Cu,e)}function Ld(e){return Zo(Uu,e)}function Rd(e){return is(Gu,e)}function zd(e){return os(Ku,e)}function Bd(e){return _s(td,e)}var Vd=t((()=>{k(),Ad()})),Hd=r({$brand:()=>c,$input:()=>yo,$output:()=>vo,NEVER:()=>s,TimePrecision:()=>yc,ZodAny:()=>Zu,ZodArray:()=>nd,ZodBase64:()=>Ru,ZodBase64URL:()=>zu,ZodBigInt:()=>Ku,ZodBigIntFormat:()=>qu,ZodBoolean:()=>Gu,ZodCIDRv4:()=>Iu,ZodCIDRv6:()=>Lu,ZodCUID:()=>ku,ZodCUID2:()=>Au,ZodCatch:()=>xd,ZodCustom:()=>Od,ZodCustomStringFormat:()=>Hu,ZodDate:()=>td,ZodDefault:()=>_d,ZodDiscriminatedUnion:()=>ad,ZodE164:()=>Bu,ZodEmail:()=>wu,ZodEmoji:()=>Du,ZodEnum:()=>dd,ZodError:()=>$c,ZodFile:()=>pd,ZodGUID:()=>Tu,ZodIPv4:()=>Pu,ZodIPv6:()=>Fu,ZodISODate:()=>Jc,ZodISODateTime:()=>qc,ZodISODuration:()=>Xc,ZodISOTime:()=>Yc,ZodIntersection:()=>od,ZodIssueCode:()=>Nd,ZodJWT:()=>Vu,ZodKSUID:()=>Nu,ZodLazy:()=>Ed,ZodLiteral:()=>fd,ZodMap:()=>ld,ZodNaN:()=>Sd,ZodNanoID:()=>Ou,ZodNever:()=>$u,ZodNonOptional:()=>yd,ZodNull:()=>Xu,ZodNullable:()=>gd,ZodNumber:()=>Uu,ZodNumberFormat:()=>Wu,ZodObject:()=>rd,ZodOptional:()=>hd,ZodPipe:()=>Cd,ZodPrefault:()=>vd,ZodPromise:()=>Dd,ZodReadonly:()=>wd,ZodRealError:()=>el,ZodRecord:()=>cd,ZodSet:()=>ud,ZodString:()=>Cu,ZodStringFormat:()=>U,ZodSuccess:()=>bd,ZodSymbol:()=>Ju,ZodTemplateLiteral:()=>Td,ZodTransform:()=>md,ZodTuple:()=>sd,ZodType:()=>H,ZodULID:()=>ju,ZodURL:()=>Eu,ZodUUID:()=>W,ZodUndefined:()=>Yu,ZodUnion:()=>id,ZodUnknown:()=>Qu,ZodVoid:()=>ed,ZodXID:()=>Mu,_ZodString:()=>Su,_default:()=>iu,any:()=>Vl,array:()=>P,base64:()=>Tl,base64url:()=>El,bigint:()=>Fl,boolean:()=>M,catch:()=>cu,check:()=>hu,cidrv4:()=>Cl,cidrv6:()=>wl,clone:()=>g,coerce:()=>Fd,config:()=>o,core:()=>kc,cuid:()=>gl,cuid2:()=>_l,custom:()=>gu,date:()=>Wl,discriminatedUnion:()=>ql,e164:()=>Dl,email:()=>sl,emoji:()=>ml,endsWith:()=>Ls,enum:()=>z,file:()=>eu,flattenError:()=>Ve,float32:()=>jl,float64:()=>Ml,formatError:()=>He,function:()=>xc,getErrorMap:()=>Md,globalRegistry:()=>T,gt:()=>bs,gte:()=>D,guid:()=>cl,includes:()=>Fs,instanceof:()=>yu,int:()=>Al,int32:()=>Nl,int64:()=>Il,intersection:()=>Jl,ipv4:()=>xl,ipv6:()=>Sl,iso:()=>Hc,json:()=>bu,jwt:()=>Ol,keyof:()=>Gl,ksuid:()=>bl,lazy:()=>pu,length:()=>js,literal:()=>B,locales:()=>ho,looseObject:()=>I,lowercase:()=>Ns,lt:()=>ys,lte:()=>E,map:()=>Zl,maxLength:()=>ks,maxSize:()=>Es,mime:()=>zs,minLength:()=>As,minSize:()=>Ds,multipleOf:()=>Ts,nan:()=>lu,nanoid:()=>hl,nativeEnum:()=>$l,negative:()=>Ss,never:()=>Hl,nonnegative:()=>ws,nonoptional:()=>ou,nonpositive:()=>Cs,normalize:()=>Vs,null:()=>Bl,nullable:()=>nu,nullish:()=>ru,number:()=>j,object:()=>F,optional:()=>V,overwrite:()=>Bs,parse:()=>nl,parseAsync:()=>rl,partialRecord:()=>Xl,pipe:()=>uu,positive:()=>xs,prefault:()=>au,preprocess:()=>xu,prettifyError:()=>Ge,promise:()=>mu,property:()=>Rs,readonly:()=>du,record:()=>R,refine:()=>_u,regex:()=>Ms,regexes:()=>at,registry:()=>_o,safeParse:()=>il,safeParseAsync:()=>al,set:()=>Ql,setErrorMap:()=>jd,size:()=>Os,startsWith:()=>Is,strictObject:()=>Kl,string:()=>A,stringFormat:()=>kl,stringbool:()=>kd,success:()=>su,superRefine:()=>vu,symbol:()=>Rl,templateLiteral:()=>fu,toJSONSchema:()=>wc,toLowerCase:()=>Us,toUpperCase:()=>Ws,transform:()=>tu,treeifyError:()=>Ue,trim:()=>Hs,tuple:()=>Yl,uint32:()=>Pl,uint64:()=>Ll,ulid:()=>vl,undefined:()=>zl,union:()=>L,unknown:()=>N,uppercase:()=>Ps,url:()=>pl,uuid:()=>ll,uuidv4:()=>ul,uuidv6:()=>dl,uuidv7:()=>fl,void:()=>Ul,xid:()=>yl}),Ud=t((()=>{k(),Ad(),Vc(),tl(),ol(),Pd(),Si(),go(),Zc(),Vd(),o(yi())})),Wd,Gd=t((()=>{Ud(),Ud(),Wd=Hd})),Kd=r({$brand:()=>c,$input:()=>yo,$output:()=>vo,NEVER:()=>s,TimePrecision:()=>yc,ZodAny:()=>Zu,ZodArray:()=>nd,ZodBase64:()=>Ru,ZodBase64URL:()=>zu,ZodBigInt:()=>Ku,ZodBigIntFormat:()=>qu,ZodBoolean:()=>Gu,ZodCIDRv4:()=>Iu,ZodCIDRv6:()=>Lu,ZodCUID:()=>ku,ZodCUID2:()=>Au,ZodCatch:()=>xd,ZodCustom:()=>Od,ZodCustomStringFormat:()=>Hu,ZodDate:()=>td,ZodDefault:()=>_d,ZodDiscriminatedUnion:()=>ad,ZodE164:()=>Bu,ZodEmail:()=>wu,ZodEmoji:()=>Du,ZodEnum:()=>dd,ZodError:()=>$c,ZodFile:()=>pd,ZodGUID:()=>Tu,ZodIPv4:()=>Pu,ZodIPv6:()=>Fu,ZodISODate:()=>Jc,ZodISODateTime:()=>qc,ZodISODuration:()=>Xc,ZodISOTime:()=>Yc,ZodIntersection:()=>od,ZodIssueCode:()=>Nd,ZodJWT:()=>Vu,ZodKSUID:()=>Nu,ZodLazy:()=>Ed,ZodLiteral:()=>fd,ZodMap:()=>ld,ZodNaN:()=>Sd,ZodNanoID:()=>Ou,ZodNever:()=>$u,ZodNonOptional:()=>yd,ZodNull:()=>Xu,ZodNullable:()=>gd,ZodNumber:()=>Uu,ZodNumberFormat:()=>Wu,ZodObject:()=>rd,ZodOptional:()=>hd,ZodPipe:()=>Cd,ZodPrefault:()=>vd,ZodPromise:()=>Dd,ZodReadonly:()=>wd,ZodRealError:()=>el,ZodRecord:()=>cd,ZodSet:()=>ud,ZodString:()=>Cu,ZodStringFormat:()=>U,ZodSuccess:()=>bd,ZodSymbol:()=>Ju,ZodTemplateLiteral:()=>Td,ZodTransform:()=>md,ZodTuple:()=>sd,ZodType:()=>H,ZodULID:()=>ju,ZodURL:()=>Eu,ZodUUID:()=>W,ZodUndefined:()=>Yu,ZodUnion:()=>id,ZodUnknown:()=>Qu,ZodVoid:()=>ed,ZodXID:()=>Mu,_ZodString:()=>Su,_default:()=>iu,any:()=>Vl,array:()=>P,base64:()=>Tl,base64url:()=>El,bigint:()=>Fl,boolean:()=>M,catch:()=>cu,check:()=>hu,cidrv4:()=>Cl,cidrv6:()=>wl,clone:()=>g,coerce:()=>Fd,config:()=>o,core:()=>kc,cuid:()=>gl,cuid2:()=>_l,custom:()=>gu,date:()=>Wl,default:()=>qd,discriminatedUnion:()=>ql,e164:()=>Dl,email:()=>sl,emoji:()=>ml,endsWith:()=>Ls,enum:()=>z,file:()=>eu,flattenError:()=>Ve,float32:()=>jl,float64:()=>Ml,formatError:()=>He,function:()=>xc,getErrorMap:()=>Md,globalRegistry:()=>T,gt:()=>bs,gte:()=>D,guid:()=>cl,includes:()=>Fs,instanceof:()=>yu,int:()=>Al,int32:()=>Nl,int64:()=>Il,intersection:()=>Jl,ipv4:()=>xl,ipv6:()=>Sl,iso:()=>Hc,json:()=>bu,jwt:()=>Ol,keyof:()=>Gl,ksuid:()=>bl,lazy:()=>pu,length:()=>js,literal:()=>B,locales:()=>ho,looseObject:()=>I,lowercase:()=>Ns,lt:()=>ys,lte:()=>E,map:()=>Zl,maxLength:()=>ks,maxSize:()=>Es,mime:()=>zs,minLength:()=>As,minSize:()=>Ds,multipleOf:()=>Ts,nan:()=>lu,nanoid:()=>hl,nativeEnum:()=>$l,negative:()=>Ss,never:()=>Hl,nonnegative:()=>ws,nonoptional:()=>ou,nonpositive:()=>Cs,normalize:()=>Vs,null:()=>Bl,nullable:()=>nu,nullish:()=>ru,number:()=>j,object:()=>F,optional:()=>V,overwrite:()=>Bs,parse:()=>nl,parseAsync:()=>rl,partialRecord:()=>Xl,pipe:()=>uu,positive:()=>xs,prefault:()=>au,preprocess:()=>xu,prettifyError:()=>Ge,promise:()=>mu,property:()=>Rs,readonly:()=>du,record:()=>R,refine:()=>_u,regex:()=>Ms,regexes:()=>at,registry:()=>_o,safeParse:()=>il,safeParseAsync:()=>al,set:()=>Ql,setErrorMap:()=>jd,size:()=>Os,startsWith:()=>Is,strictObject:()=>Kl,string:()=>A,stringFormat:()=>kl,stringbool:()=>kd,success:()=>su,superRefine:()=>vu,symbol:()=>Rl,templateLiteral:()=>fu,toJSONSchema:()=>wc,toLowerCase:()=>Us,toUpperCase:()=>Ws,transform:()=>tu,treeifyError:()=>Ue,trim:()=>Hs,tuple:()=>Yl,uint32:()=>Pl,uint64:()=>Ll,ulid:()=>vl,undefined:()=>zl,union:()=>L,unknown:()=>N,uppercase:()=>Ps,url:()=>pl,uuid:()=>ll,uuidv4:()=>ul,uuidv6:()=>dl,uuidv7:()=>fl,void:()=>Ul,xid:()=>yl,z:()=>Hd}),qd,Jd=t((()=>{Gd(),Gd(),qd=Wd})),Yd,G,Xd,Zd,Qd,$d,ef,K,tf,nf,q,J,Y,X,rf,af,of,sf,cf,lf,uf,Z,df,ff,pf,mf,hf,gf,_f,vf,yf,bf,xf,Sf,Cf,wf,Tf,Ef,Df,Of,kf,Af,jf,Mf,Nf,Pf,Ff,If,Lf,Rf,zf,Bf,Vf,Hf,Uf,Wf,Gf,Kf,qf,Jf,Yf,Xf,Zf,Qf,$f,ep,tp,np,rp,ip,ap,op,sp,cp,lp,up,dp,fp,pp,mp,hp,gp,_p,vp,yp,bp,xp,Sp,Cp,wp,Tp,Ep,Dp,Op,kp,Ap,jp,Mp,Np,Pp,Fp,Ip,Lp,Rp,zp,Bp,Vp,Hp,Up,Wp,Gp,Kp,qp,Jp,Yp,Xp,Zp,Qp,$p,em,tm,nm,rm,im,am,om,sm,cm,lm,um,dm,fm,pm,mm,hm,gm,_m,vm,ym,bm,xm,Sm,Cm,wm,Tm,Em,Dm,Om,km,Am,jm,Mm,Nm,Q,Pm,Fm=t((()=>{Jd(),Yd=`io.modelcontextprotocol/related-task`,G=gu(e=>e!==null&&(typeof e==`object`||typeof e==`function`)),Xd=L([A(),j().int()]),Zd=A(),I({ttl:j().optional(),pollInterval:j().optional()}),Qd=F({ttl:j().optional()}),$d=F({taskId:A()}),ef=I({progressToken:Xd.optional(),[Yd]:$d.optional()}),K=F({_meta:ef.optional()}),tf=K.extend({task:Qd.optional()}),nf=e=>tf.safeParse(e).success,q=F({method:A(),params:K.loose().optional()}),J=F({_meta:ef.optional()}),Y=F({method:A(),params:J.loose().optional()}),X=I({_meta:ef.optional()}),rf=L([A(),j().int()]),af=F({jsonrpc:B(`2.0`),id:rf,...q.shape}).strict(),of=e=>af.safeParse(e).success,sf=F({jsonrpc:B(`2.0`),...Y.shape}).strict(),cf=e=>sf.safeParse(e).success,lf=F({jsonrpc:B(`2.0`),id:rf,result:X}).strict(),uf=e=>lf.safeParse(e).success,(function(e){e[e.ConnectionClosed=-32e3]=`ConnectionClosed`,e[e.RequestTimeout=-32001]=`RequestTimeout`,e[e.ParseError=-32700]=`ParseError`,e[e.InvalidRequest=-32600]=`InvalidRequest`,e[e.MethodNotFound=-32601]=`MethodNotFound`,e[e.InvalidParams=-32602]=`InvalidParams`,e[e.InternalError=-32603]=`InternalError`,e[e.UrlElicitationRequired=-32042]=`UrlElicitationRequired`})(Z||={}),df=F({jsonrpc:B(`2.0`),id:rf.optional(),error:F({code:j().int(),message:A(),data:N().optional()})}).strict(),ff=e=>df.safeParse(e).success,pf=L([af,sf,lf,df]),L([lf,df]),mf=X.strict(),hf=J.extend({requestId:rf.optional(),reason:A().optional()}),gf=Y.extend({method:B(`notifications/cancelled`),params:hf}),_f=F({src:A(),mimeType:A().optional(),sizes:P(A()).optional(),theme:z([`light`,`dark`]).optional()}),vf=F({icons:P(_f).optional()}),yf=F({name:A(),title:A().optional()}),bf=yf.extend({...yf.shape,...vf.shape,version:A(),websiteUrl:A().optional(),description:A().optional()}),xf=Jl(F({applyDefaults:M().optional()}),R(A(),N())),Sf=xu(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,Jl(F({form:xf.optional(),url:G.optional()}),R(A(),N()).optional())),Cf=I({list:G.optional(),cancel:G.optional(),requests:I({sampling:I({createMessage:G.optional()}).optional(),elicitation:I({create:G.optional()}).optional()}).optional()}),wf=I({list:G.optional(),cancel:G.optional(),requests:I({tools:I({call:G.optional()}).optional()}).optional()}),Tf=F({experimental:R(A(),G).optional(),sampling:F({context:G.optional(),tools:G.optional()}).optional(),elicitation:Sf.optional(),roots:F({listChanged:M().optional()}).optional(),tasks:Cf.optional(),extensions:R(A(),G).optional()}),Ef=K.extend({protocolVersion:A(),capabilities:Tf,clientInfo:bf}),Df=q.extend({method:B(`initialize`),params:Ef}),Of=F({experimental:R(A(),G).optional(),logging:G.optional(),completions:G.optional(),prompts:F({listChanged:M().optional()}).optional(),resources:F({subscribe:M().optional(),listChanged:M().optional()}).optional(),tools:F({listChanged:M().optional()}).optional(),tasks:wf.optional(),extensions:R(A(),G).optional()}),kf=X.extend({protocolVersion:A(),capabilities:Of,serverInfo:bf,instructions:A().optional()}),Af=Y.extend({method:B(`notifications/initialized`),params:J.optional()}),jf=q.extend({method:B(`ping`),params:K.optional()}),Mf=F({progress:j(),total:V(j()),message:V(A())}),Nf=F({...J.shape,...Mf.shape,progressToken:Xd}),Pf=Y.extend({method:B(`notifications/progress`),params:Nf}),Ff=K.extend({cursor:Zd.optional()}),If=q.extend({params:Ff.optional()}),Lf=X.extend({nextCursor:Zd.optional()}),Rf=z([`working`,`input_required`,`completed`,`failed`,`cancelled`]),zf=F({taskId:A(),status:Rf,ttl:L([j(),Bl()]),createdAt:A(),lastUpdatedAt:A(),pollInterval:V(j()),statusMessage:V(A())}),Bf=X.extend({task:zf}),Vf=J.merge(zf),Hf=Y.extend({method:B(`notifications/tasks/status`),params:Vf}),Uf=q.extend({method:B(`tasks/get`),params:K.extend({taskId:A()})}),Wf=X.merge(zf),Gf=q.extend({method:B(`tasks/result`),params:K.extend({taskId:A()})}),X.loose(),Kf=If.extend({method:B(`tasks/list`)}),qf=Lf.extend({tasks:P(zf)}),Jf=q.extend({method:B(`tasks/cancel`),params:K.extend({taskId:A()})}),Yf=X.merge(zf),Xf=F({uri:A(),mimeType:V(A()),_meta:R(A(),N()).optional()}),Zf=Xf.extend({text:A()}),Qf=A().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),$f=Xf.extend({blob:Qf}),ep=z([`user`,`assistant`]),tp=F({audience:P(ep).optional(),priority:j().min(0).max(1).optional(),lastModified:Uc({offset:!0}).optional()}),np=F({...yf.shape,...vf.shape,uri:A(),description:V(A()),mimeType:V(A()),size:V(j()),annotations:tp.optional(),_meta:V(I({}))}),rp=F({...yf.shape,...vf.shape,uriTemplate:A(),description:V(A()),mimeType:V(A()),annotations:tp.optional(),_meta:V(I({}))}),ip=If.extend({method:B(`resources/list`)}),ap=Lf.extend({resources:P(np)}),op=If.extend({method:B(`resources/templates/list`)}),sp=Lf.extend({resourceTemplates:P(rp)}),cp=K.extend({uri:A()}),lp=cp,up=q.extend({method:B(`resources/read`),params:lp}),dp=X.extend({contents:P(L([Zf,$f]))}),fp=Y.extend({method:B(`notifications/resources/list_changed`),params:J.optional()}),pp=cp,mp=q.extend({method:B(`resources/subscribe`),params:pp}),hp=cp,gp=q.extend({method:B(`resources/unsubscribe`),params:hp}),_p=J.extend({uri:A()}),vp=Y.extend({method:B(`notifications/resources/updated`),params:_p}),yp=F({name:A(),description:V(A()),required:V(M())}),bp=F({...yf.shape,...vf.shape,description:V(A()),arguments:V(P(yp)),_meta:V(I({}))}),xp=If.extend({method:B(`prompts/list`)}),Sp=Lf.extend({prompts:P(bp)}),Cp=K.extend({name:A(),arguments:R(A(),A()).optional()}),wp=q.extend({method:B(`prompts/get`),params:Cp}),Tp=F({type:B(`text`),text:A(),annotations:tp.optional(),_meta:R(A(),N()).optional()}),Ep=F({type:B(`image`),data:Qf,mimeType:A(),annotations:tp.optional(),_meta:R(A(),N()).optional()}),Dp=F({type:B(`audio`),data:Qf,mimeType:A(),annotations:tp.optional(),_meta:R(A(),N()).optional()}),Op=F({type:B(`tool_use`),name:A(),id:A(),input:R(A(),N()),_meta:R(A(),N()).optional()}),kp=F({type:B(`resource`),resource:L([Zf,$f]),annotations:tp.optional(),_meta:R(A(),N()).optional()}),Ap=np.extend({type:B(`resource_link`)}),jp=L([Tp,Ep,Dp,Ap,kp]),Mp=F({role:ep,content:jp}),Np=X.extend({description:A().optional(),messages:P(Mp)}),Pp=Y.extend({method:B(`notifications/prompts/list_changed`),params:J.optional()}),Fp=F({title:A().optional(),readOnlyHint:M().optional(),destructiveHint:M().optional(),idempotentHint:M().optional(),openWorldHint:M().optional()}),Ip=F({taskSupport:z([`required`,`optional`,`forbidden`]).optional()}),Lp=F({...yf.shape,...vf.shape,description:A().optional(),inputSchema:F({type:B(`object`),properties:R(A(),G).optional(),required:P(A()).optional()}).catchall(N()),outputSchema:F({type:B(`object`),properties:R(A(),G).optional(),required:P(A()).optional()}).catchall(N()).optional(),annotations:Fp.optional(),execution:Ip.optional(),_meta:R(A(),N()).optional()}),Rp=If.extend({method:B(`tools/list`)}),zp=Lf.extend({tools:P(Lp)}),Bp=X.extend({content:P(jp).default([]),structuredContent:R(A(),N()).optional(),isError:M().optional()}),Bp.or(X.extend({toolResult:N()})),Vp=tf.extend({name:A(),arguments:R(A(),N()).optional()}),Hp=q.extend({method:B(`tools/call`),params:Vp}),Up=Y.extend({method:B(`notifications/tools/list_changed`),params:J.optional()}),F({autoRefresh:M().default(!0),debounceMs:j().int().nonnegative().default(300)}),Wp=z([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),Gp=K.extend({level:Wp}),Kp=q.extend({method:B(`logging/setLevel`),params:Gp}),qp=J.extend({level:Wp,logger:A().optional(),data:N()}),Jp=Y.extend({method:B(`notifications/message`),params:qp}),Yp=F({name:A().optional()}),Xp=F({hints:P(Yp).optional(),costPriority:j().min(0).max(1).optional(),speedPriority:j().min(0).max(1).optional(),intelligencePriority:j().min(0).max(1).optional()}),Zp=F({mode:z([`auto`,`required`,`none`]).optional()}),Qp=F({type:B(`tool_result`),toolUseId:A().describe(`The unique identifier for the corresponding tool call.`),content:P(jp).default([]),structuredContent:F({}).loose().optional(),isError:M().optional(),_meta:R(A(),N()).optional()}),$p=ql(`type`,[Tp,Ep,Dp]),em=ql(`type`,[Tp,Ep,Dp,Op,Qp]),tm=F({role:ep,content:L([em,P(em)]),_meta:R(A(),N()).optional()}),nm=tf.extend({messages:P(tm),modelPreferences:Xp.optional(),systemPrompt:A().optional(),includeContext:z([`none`,`thisServer`,`allServers`]).optional(),temperature:j().optional(),maxTokens:j().int(),stopSequences:P(A()).optional(),metadata:G.optional(),tools:P(Lp).optional(),toolChoice:Zp.optional()}),rm=q.extend({method:B(`sampling/createMessage`),params:nm}),im=X.extend({model:A(),stopReason:V(z([`endTurn`,`stopSequence`,`maxTokens`]).or(A())),role:ep,content:$p}),am=X.extend({model:A(),stopReason:V(z([`endTurn`,`stopSequence`,`maxTokens`,`toolUse`]).or(A())),role:ep,content:L([em,P(em)])}),om=F({type:B(`boolean`),title:A().optional(),description:A().optional(),default:M().optional()}),sm=F({type:B(`string`),title:A().optional(),description:A().optional(),minLength:j().optional(),maxLength:j().optional(),format:z([`email`,`uri`,`date`,`date-time`]).optional(),default:A().optional()}),cm=F({type:z([`number`,`integer`]),title:A().optional(),description:A().optional(),minimum:j().optional(),maximum:j().optional(),default:j().optional()}),lm=F({type:B(`string`),title:A().optional(),description:A().optional(),enum:P(A()),default:A().optional()}),um=F({type:B(`string`),title:A().optional(),description:A().optional(),oneOf:P(F({const:A(),title:A()})),default:A().optional()}),dm=F({type:B(`string`),title:A().optional(),description:A().optional(),enum:P(A()),enumNames:P(A()).optional(),default:A().optional()}),fm=L([lm,um]),pm=F({type:B(`array`),title:A().optional(),description:A().optional(),minItems:j().optional(),maxItems:j().optional(),items:F({type:B(`string`),enum:P(A())}),default:P(A()).optional()}),mm=F({type:B(`array`),title:A().optional(),description:A().optional(),minItems:j().optional(),maxItems:j().optional(),items:F({anyOf:P(F({const:A(),title:A()}))}),default:P(A()).optional()}),hm=L([pm,mm]),gm=L([dm,fm,hm]),_m=L([gm,om,sm,cm]),vm=tf.extend({mode:B(`form`).optional(),message:A(),requestedSchema:F({type:B(`object`),properties:R(A(),_m),required:P(A()).optional()})}),ym=tf.extend({mode:B(`url`),message:A(),elicitationId:A(),url:A().url()}),bm=L([vm,ym]),xm=q.extend({method:B(`elicitation/create`),params:bm}),Sm=J.extend({elicitationId:A()}),Cm=Y.extend({method:B(`notifications/elicitation/complete`),params:Sm}),wm=X.extend({action:z([`accept`,`decline`,`cancel`]),content:xu(e=>e===null?void 0:e,R(A(),L([A(),j(),M(),P(A())])).optional())}),Tm=F({type:B(`ref/resource`),uri:A()}),Em=F({type:B(`ref/prompt`),name:A()}),Dm=K.extend({ref:L([Em,Tm]),argument:F({name:A(),value:A()}),context:F({arguments:R(A(),A()).optional()}).optional()}),Om=q.extend({method:B(`completion/complete`),params:Dm}),km=X.extend({completion:I({values:P(A()).max(100),total:V(j().int()),hasMore:V(M())})}),Am=F({uri:A().startsWith(`file://`),name:A().optional(),_meta:R(A(),N()).optional()}),jm=q.extend({method:B(`roots/list`),params:K.optional()}),Mm=X.extend({roots:P(Am)}),Nm=Y.extend({method:B(`notifications/roots/list_changed`),params:J.optional()}),L([jf,Df,Om,Kp,wp,xp,ip,op,up,mp,gp,Hp,Rp,Uf,Gf,Kf,Jf]),L([gf,Pf,Af,Nm,Hf]),L([mf,im,am,wm,Mm,Wf,qf,Bf]),L([jf,rm,xm,jm,Uf,Gf,Kf,Jf]),L([gf,Pf,Jp,vp,fp,Up,Pp,Hf,Cm]),L([mf,kf,km,Np,Sp,ap,sp,dp,Bp,zp,Wf,qf,Bf]),Q=class e extends Error{constructor(e,t,n){super(`MCP error ${e}: ${t}`),this.code=e,this.data=n,this.name=`McpError`}static fromError(t,n,r){if(t===Z.UrlElicitationRequired&&r){let e=r;if(e.elicitations)return new Pm(e.elicitations,n)}return new e(t,n,r)}},Pm=class extends Q{constructor(e,t=`URL elicitation${e.length>1?`s`:``} required`){super(Z.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}}}));function Im(e){return e===`completed`||e===`failed`||e===`cancelled`}var Lm=t((()=>{})),Rm=t((()=>{})),zm=t((()=>{})),Bm=t((()=>{})),Vm=t((()=>{})),Hm=t((()=>{})),Um=t((()=>{})),Wm=t((()=>{})),Gm=t((()=>{})),Km=t((()=>{})),qm=t((()=>{})),Jm=t((()=>{})),Ym=t((()=>{})),Xm=t((()=>{})),Zm=t((()=>{})),Qm=t((()=>{})),$m=t((()=>{})),eh=t((()=>{})),th=t((()=>{})),nh=t((()=>{})),rh=t((()=>{})),ih=t((()=>{})),ah=t((()=>{})),oh=t((()=>{})),sh=t((()=>{})),ch=t((()=>{})),lh=t((()=>{})),uh=t((()=>{})),dh=t((()=>{})),fh=t((()=>{})),ph=t((()=>{})),mh=t((()=>{})),hh=t((()=>{})),gh=t((()=>{})),_h=t((()=>{})),vh=t((()=>{})),yh=t((()=>{})),bh=t((()=>{})),xh=t((()=>{})),Sh=t((()=>{Rm(),zm(),Bm(),Vm(),yh(),bh(),Hm(),Um(),Wm(),Gm(),Km(),qm(),Jm(),Ym(),Xm(),Zm(),Qm(),$m(),nh(),rh(),ih(),ah(),sh(),ch(),lh(),uh(),dh(),fh(),_h(),th(),ph(),eh(),mh(),hh(),oh(),gh(),vh(),xh()}));function Ch(e){let t=Rc(e)?.method;if(!t)throw Error(`Schema is missing a method literal`);let n=zc(t);if(typeof n!=`string`)throw Error(`Schema method literal must be a string`);return n}function wh(e,t){let n=Lc(e,t);if(!n.success)throw n.error;return n.data}var Th=t((()=>{Bc(),Sh()}));function Eh(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Dh(e,t){let n={...e};for(let e in t){let r=e,i=t[r];if(i===void 0)continue;let a=n[r];n[r]=Eh(a)&&Eh(i)?{...a,...i}:i}return n}var Oh,kh=t((()=>{Bc(),Fm(),Lm(),Th(),Oh=class{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(gf,e=>{this._oncancel(e)}),this.setNotificationHandler(Pf,e=>{this._onprogress(e)}),this.setRequestHandler(jf,e=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(Uf,async(e,t)=>{let n=await this._taskStore.getTask(e.params.taskId,t.sessionId);if(!n)throw new Q(Z.InvalidParams,`Failed to retrieve task: Task not found`);return{...n}}),this.setRequestHandler(Gf,async(e,t)=>{let n=async()=>{let r=e.params.taskId;if(this._taskMessageQueue){let e;for(;e=await this._taskMessageQueue.dequeue(r,t.sessionId);){if(e.type===`response`||e.type===`error`){let t=e.message,n=t.id,r=this._requestResolvers.get(n);if(r){if(this._requestResolvers.delete(n),e.type===`response`)r(t);else{let e=t;r(new Q(e.error.code,e.error.message,e.error.data))}}else{let t=e.type===`response`?`Response`:`Error`;this._onerror(Error(`${t} handler missing for request ${n}`))}continue}await this._transport?.send(e.message,{relatedRequestId:t.requestId})}}let i=await this._taskStore.getTask(r,t.sessionId);if(!i)throw new Q(Z.InvalidParams,`Task not found: ${r}`);if(!Im(i.status))return await this._waitForTaskUpdate(r,t.signal),await n();if(Im(i.status)){let e=await this._taskStore.getTaskResult(r,t.sessionId);return this._clearTaskQueue(r),{...e,_meta:{...e._meta,[Yd]:{taskId:r}}}}return await n()};return await n()}),this.setRequestHandler(Kf,async(e,t)=>{try{let{tasks:n,nextCursor:r}=await this._taskStore.listTasks(e.params?.cursor,t.sessionId);return{tasks:n,nextCursor:r,_meta:{}}}catch(e){throw new Q(Z.InvalidParams,`Failed to list tasks: ${e instanceof Error?e.message:String(e)}`)}}),this.setRequestHandler(Jf,async(e,t)=>{try{let n=await this._taskStore.getTask(e.params.taskId,t.sessionId);if(!n)throw new Q(Z.InvalidParams,`Task not found: ${e.params.taskId}`);if(Im(n.status))throw new Q(Z.InvalidParams,`Cannot cancel task in terminal status: ${n.status}`);await this._taskStore.updateTaskStatus(e.params.taskId,`cancelled`,`Client cancelled task execution.`,t.sessionId),this._clearTaskQueue(e.params.taskId);let r=await this._taskStore.getTask(e.params.taskId,t.sessionId);if(!r)throw new Q(Z.InvalidParams,`Task not found after cancellation: ${e.params.taskId}`);return{_meta:{},...r}}catch(e){throw e instanceof Q?e:new Q(Z.InvalidRequest,`Failed to cancel task: ${e instanceof Error?e.message:String(e)}`)}}))}async _oncancel(e){e.params.requestId&&this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,n,r,i=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,t),startTime:Date.now(),timeout:t,maxTotalTimeout:n,resetTimeoutOnProgress:i,onTimeout:r})}_resetTimeout(e){let t=this._timeoutInfo.get(e);if(!t)return!1;let n=Date.now()-t.startTime;if(t.maxTotalTimeout&&n>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),Q.fromError(Z.RequestTimeout,`Maximum total timeout exceeded`,{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:n});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){let t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw Error(`Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.`);this._transport=e;let t=this.transport?.onclose;this._transport.onclose=()=>{t?.(),this._onclose()};let n=this.transport?.onerror;this._transport.onerror=e=>{n?.(e),this._onerror(e)};let r=this._transport?.onmessage;this._transport.onmessage=(e,t)=>{r?.(e,t),uf(e)||ff(e)?this._onresponse(e):of(e)?this._onrequest(e,t):cf(e)?this._onnotification(e):this._onerror(Error(`Unknown message type: ${JSON.stringify(e)}`))},await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let e of this._timeoutInfo.values())clearTimeout(e.timeoutId);this._timeoutInfo.clear();for(let e of this._requestHandlerAbortControllers.values())e.abort();this._requestHandlerAbortControllers.clear();let t=Q.fromError(Z.ConnectionClosed,`Connection closed`);this._transport=void 0,this.onclose?.();for(let n of e.values())n(t)}_onerror(e){this.onerror?.(e)}_onnotification(e){let t=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;t!==void 0&&Promise.resolve().then(()=>t(e)).catch(e=>this._onerror(Error(`Uncaught error in notification handler: ${e}`)))}_onrequest(e,t){let n=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,r=this._transport,i=e.params?._meta?.[Yd]?.taskId;if(n===void 0){let t={jsonrpc:`2.0`,id:e.id,error:{code:Z.MethodNotFound,message:`Method not found`}};i&&this._taskMessageQueue?this._enqueueTaskMessage(i,{type:`error`,message:t,timestamp:Date.now()},r?.sessionId).catch(e=>this._onerror(Error(`Failed to enqueue error response: ${e}`))):r?.send(t).catch(e=>this._onerror(Error(`Failed to send an error response: ${e}`)));return}let a=new AbortController;this._requestHandlerAbortControllers.set(e.id,a);let o=nf(e.params)?e.params.task:void 0,s=this._taskStore?this.requestTaskStore(e,r?.sessionId):void 0,c={signal:a.signal,sessionId:r?.sessionId,_meta:e.params?._meta,sendNotification:async t=>{if(a.signal.aborted)return;let n={relatedRequestId:e.id};i&&(n.relatedTask={taskId:i}),await this.notification(t,n)},sendRequest:async(t,n,r)=>{if(a.signal.aborted)throw new Q(Z.ConnectionClosed,`Request was cancelled`);let o={...r,relatedRequestId:e.id};i&&!o.relatedTask&&(o.relatedTask={taskId:i});let c=o.relatedTask?.taskId??i;return c&&s&&await s.updateTaskStatus(c,`input_required`),await this.request(t,n,o)},authInfo:t?.authInfo,requestId:e.id,requestInfo:t?.requestInfo,taskId:i,taskStore:s,taskRequestedTtl:o?.ttl,closeSSEStream:t?.closeSSEStream,closeStandaloneSSEStream:t?.closeStandaloneSSEStream};Promise.resolve().then(()=>{o&&this.assertTaskHandlerCapability(e.method)}).then(()=>n(e,c)).then(async t=>{if(a.signal.aborted)return;let n={result:t,jsonrpc:`2.0`,id:e.id};i&&this._taskMessageQueue?await this._enqueueTaskMessage(i,{type:`response`,message:n,timestamp:Date.now()},r?.sessionId):await r?.send(n)},async t=>{if(a.signal.aborted)return;let n={jsonrpc:`2.0`,id:e.id,error:{code:Number.isSafeInteger(t.code)?t.code:Z.InternalError,message:t.message??`Internal error`,...t.data!==void 0&&{data:t.data}}};i&&this._taskMessageQueue?await this._enqueueTaskMessage(i,{type:`error`,message:n,timestamp:Date.now()},r?.sessionId):await r?.send(n)}).catch(e=>this._onerror(Error(`Failed to send response: ${e}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===a&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){let{progressToken:t,...n}=e.params,r=Number(t),i=this._progressHandlers.get(r);if(!i){this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let a=this._responseHandlers.get(r),o=this._timeoutInfo.get(r);if(o&&a&&o.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(e){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),a(e);return}i(n)}_onresponse(e){let t=Number(e.id),n=this._requestResolvers.get(t);if(n){this._requestResolvers.delete(t),uf(e)?n(e):n(new Q(e.error.code,e.error.message,e.error.data));return}let r=this._responseHandlers.get(t);if(r===void 0){this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t);let i=!1;if(uf(e)&&e.result&&typeof e.result==`object`){let n=e.result;if(n.task&&typeof n.task==`object`){let e=n.task;typeof e.taskId==`string`&&(i=!0,this._taskProgressTokens.set(e.taskId,t))}}i||this._progressHandlers.delete(t),uf(e)?r(e):r(Q.fromError(e.error.code,e.error.message,e.error.data))}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,t,n){let{task:r}=n??{};if(!r){try{yield{type:`result`,result:await this.request(e,t,n)}}catch(e){yield{type:`error`,error:e instanceof Q?e:new Q(Z.InternalError,String(e))}}return}let i;try{let r=await this.request(e,Bf,n);if(r.task)i=r.task.taskId,yield{type:`taskCreated`,task:r.task};else throw new Q(Z.InternalError,`Task creation did not return a task`);for(;;){let e=await this.getTask({taskId:i},n);if(yield{type:`taskStatus`,task:e},Im(e.status)){e.status===`completed`?yield{type:`result`,result:await this.getTaskResult({taskId:i},t,n)}:e.status===`failed`?yield{type:`error`,error:new Q(Z.InternalError,`Task ${i} failed`)}:e.status===`cancelled`&&(yield{type:`error`,error:new Q(Z.InternalError,`Task ${i} was cancelled`)});return}if(e.status===`input_required`){yield{type:`result`,result:await this.getTaskResult({taskId:i},t,n)};return}let r=e.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(e=>setTimeout(e,r)),n?.signal?.throwIfAborted()}}catch(e){yield{type:`error`,error:e instanceof Q?e:new Q(Z.InternalError,String(e))}}}request(e,t,n){let{relatedRequestId:r,resumptionToken:i,onresumptiontoken:a,task:o,relatedTask:s}=n??{};return new Promise((c,l)=>{let u=e=>{l(e)};if(!this._transport){u(Error(`Not connected`));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),o&&this.assertTaskCapability(e.method)}catch(e){u(e);return}n?.signal?.throwIfAborted();let d=this._requestMessageId++,f={...e,jsonrpc:`2.0`,id:d};n?.onprogress&&(this._progressHandlers.set(d,n.onprogress),f.params={...e.params,_meta:{...e.params?._meta||{},progressToken:d}}),o&&(f.params={...f.params,task:o}),s&&(f.params={...f.params,_meta:{...f.params?._meta||{},[Yd]:s}});let p=e=>{this._responseHandlers.delete(d),this._progressHandlers.delete(d),this._cleanupTimeout(d),this._transport?.send({jsonrpc:`2.0`,method:`notifications/cancelled`,params:{requestId:d,reason:String(e)}},{relatedRequestId:r,resumptionToken:i,onresumptiontoken:a}).catch(e=>this._onerror(Error(`Failed to send cancellation: ${e}`))),l(e instanceof Q?e:new Q(Z.RequestTimeout,String(e)))};this._responseHandlers.set(d,e=>{if(!n?.signal?.aborted){if(e instanceof Error)return l(e);try{let n=Lc(t,e.result);n.success?c(n.data):l(n.error)}catch(e){l(e)}}}),n?.signal?.addEventListener(`abort`,()=>{p(n?.signal?.reason)});let ee=n?.timeout??6e4;this._setupTimeout(d,ee,n?.maxTotalTimeout,()=>p(Q.fromError(Z.RequestTimeout,`Request timed out`,{timeout:ee})),n?.resetTimeoutOnProgress??!1);let te=s?.taskId;te?(this._requestResolvers.set(d,e=>{let t=this._responseHandlers.get(d);t?t(e):this._onerror(Error(`Response handler missing for side-channeled request ${d}`))}),this._enqueueTaskMessage(te,{type:`request`,message:f,timestamp:Date.now()}).catch(e=>{this._cleanupTimeout(d),l(e)})):this._transport.send(f,{relatedRequestId:r,resumptionToken:i,onresumptiontoken:a}).catch(e=>{this._cleanupTimeout(d),l(e)})})}async getTask(e,t){return this.request({method:`tasks/get`,params:e},Wf,t)}async getTaskResult(e,t,n){return this.request({method:`tasks/result`,params:e},t,n)}async listTasks(e,t){return this.request({method:`tasks/list`,params:e},qf,t)}async cancelTask(e,t){return this.request({method:`tasks/cancel`,params:e},Yf,t)}async notification(e,t){if(!this._transport)throw Error(`Not connected`);this.assertNotificationCapability(e.method);let n=t?.relatedTask?.taskId;if(n){let r={...e,jsonrpc:`2.0`,params:{...e.params,_meta:{...e.params?._meta||{},[Yd]:t.relatedTask}}};await this._enqueueTaskMessage(n,{type:`notification`,message:r,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!t?.relatedRequestId&&!t?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let n={...e,jsonrpc:`2.0`};t?.relatedTask&&(n={...n,params:{...n.params,_meta:{...n.params?._meta||{},[Yd]:t.relatedTask}}}),this._transport?.send(n,t).catch(e=>this._onerror(e))});return}let r={...e,jsonrpc:`2.0`};t?.relatedTask&&(r={...r,params:{...r.params,_meta:{...r.params?._meta||{},[Yd]:t.relatedTask}}}),await this._transport.send(r,t)}setRequestHandler(e,t){let n=Ch(e);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(n,r)=>{let i=wh(e,n);return Promise.resolve(t(i,r))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t){let n=Ch(e);this._notificationHandlers.set(n,n=>{let r=wh(e,n);return Promise.resolve(t(r))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){let t=this._taskProgressTokens.get(e);t!==void 0&&(this._progressHandlers.delete(t),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,t,n){if(!this._taskStore||!this._taskMessageQueue)throw Error(`Cannot enqueue task message: taskStore and taskMessageQueue are not configured`);let r=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,t,n,r)}async _clearTaskQueue(e,t){if(this._taskMessageQueue){let n=await this._taskMessageQueue.dequeueAll(e,t);for(let t of n)if(t.type===`request`&&of(t.message)){let n=t.message.id,r=this._requestResolvers.get(n);r?(r(new Q(Z.InternalError,`Task cancelled or completed`)),this._requestResolvers.delete(n)):this._onerror(Error(`Resolver missing for request ${n} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,t){let n=this._options?.defaultTaskPollInterval??1e3;try{let t=await this._taskStore?.getTask(e);t?.pollInterval&&(n=t.pollInterval)}catch{}return new Promise((e,r)=>{if(t.aborted){r(new Q(Z.InvalidRequest,`Request cancelled`));return}let i=setTimeout(e,n);t.addEventListener(`abort`,()=>{clearTimeout(i),r(new Q(Z.InvalidRequest,`Request cancelled`))},{once:!0})})}requestTaskStore(e,t){let n=this._taskStore;if(!n)throw Error(`No task store configured`);return{createTask:async r=>{if(!e)throw Error(`No request provided`);return await n.createTask(r,e.id,{method:e.method,params:e.params},t)},getTask:async e=>{let r=await n.getTask(e,t);if(!r)throw new Q(Z.InvalidParams,`Failed to retrieve task: Task not found`);return r},storeTaskResult:async(e,r,i)=>{await n.storeTaskResult(e,r,i,t);let a=await n.getTask(e,t);if(a){let t=Hf.parse({method:`notifications/tasks/status`,params:a});await this.notification(t),Im(a.status)&&this._cleanupTaskProgressHandler(e)}},getTaskResult:e=>n.getTaskResult(e,t),updateTaskStatus:async(e,r,i)=>{let a=await n.getTask(e,t);if(!a)throw new Q(Z.InvalidParams,`Task \"${e}\" not found - it may have been cleaned up`);if(Im(a.status))throw new Q(Z.InvalidParams,`Cannot update task \"${e}\" from terminal status \"${a.status}\" to \"${r}\". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await n.updateTaskStatus(e,r,i,t);let o=await n.getTask(e,t);if(o){let t=Hf.parse({method:`notifications/tasks/status`,params:o});await this.notification(t),Im(o.status)&&this._cleanupTaskProgressHandler(e)}},listTasks:e=>n.listTasks(e,t)}}}})),Ah,jh,Mh,Nh,Ph=t((()=>{Ah=`modulepreload`,jh=function(e,t){return new URL(e,t).href},Mh={},Nh=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=jh(t,n),t=s(t),t in Mh)return;Mh[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:Ah,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})}}));async function Fh(e,t){let n=e[`~standard`];if(n.jsonSchema)return n.jsonSchema[t](fg);if(n.vendor===`zod`){let{z:n}=await Nh(async()=>{let{z:e}=await Promise.resolve().then(()=>(Jd(),Kd));return{z:e}},void 0,import.meta.url);return n.toJSONSchema(e,{io:t})}throw Error(`Schema (vendor: ${n.vendor}) does not implement Standard JSON Schema (~standard.jsonSchema). Use a library that does (zod v4, ArkType, Valibot) or wrap your schema accordingly.`)}async function Ih(e,t,n=``){let r=await e[`~standard`].validate(t);if(r.issues){let e=r.issues.map(e=>{let t=e.path?.map(e=>typeof e==`object`?e.key:e).join(`.`);return t?`${t}: ${e.message}`:e.message}).join(`; `);throw Error(n+e)}return r.value}function Lh(e){let t=document.documentElement;t.setAttribute(`data-theme`,e),t.style.colorScheme=e}function Rh(e,t=document.documentElement){for(let[n,r]of Object.entries(e))r!==void 0&&t.style.setProperty(n,r)}var zh,Bh,Vh,Hh,Uh,Wh,Gh,Kh,qh,Jh,Yh,Xh,Zh,Qh,$h,eg,tg,ng,rg,ig,ag,og,sg,cg,lg,ug,dg,fg,pg,mg=t((()=>{kh(),Fm(),Jd(),Ph(),(e=>typeof i<`u`?i:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof i<`u`?i:e)[t]}):e)(function(e){if(typeof i<`u`)return i.apply(this,arguments);throw Error(`Dynamic require of \"`+e+`\" is not supported`)}),zh=class extends Oh{_registeredMethods=new Set;_eventSlots=new Map;onEventDispatch(e,t){}_ensureEventSlot(e){let t=this._eventSlots.get(e);if(!t){let n=this.eventSchemas[e];if(!n)throw Error(`Unknown event: ${String(e)}`);t={listeners:[]},this._eventSlots.set(e,t);let r=n.shape.method.value;this._registeredMethods.add(r);let i=t;super.setNotificationHandler(n,t=>{let n=t.params;this.onEventDispatch(e,n),i.onHandler?.(n);for(let e of[...i.listeners])e(n)})}return t}setEventHandler(e,t){let n=this._ensureEventSlot(e);n.onHandler&&t&&console.warn(`[MCP Apps] on${String(e)} handler replaced. Use addEventListener(\"${String(e)}\", …) to add multiple listeners without replacing.`),n.onHandler=t}getEventHandler(e){return this._eventSlots.get(e)?.onHandler}addEventListener(e,t){this._ensureEventSlot(e).listeners.push(t)}removeEventListener(e,t){let n=this._eventSlots.get(e);if(!n)return;let r=n.listeners.indexOf(t);r!==-1&&n.listeners.splice(r,1)}setRequestHandler=(e,t)=>{this._assertMethodNotRegistered(e,`setRequestHandler`),super.setRequestHandler(e,t)};setNotificationHandler=(e,t)=>{this._assertMethodNotRegistered(e,`setNotificationHandler`),super.setNotificationHandler(e,t)};warnIfRequestHandlerReplaced(e,t,n){t&&n&&console.warn(`[MCP Apps] ${e} handler replaced. Previous handler will no longer be called.`)}replaceRequestHandler=(e,t)=>{let n=e.shape.method.value;this._registeredMethods.add(n),super.setRequestHandler(e,t)};_assertMethodNotRegistered(e,t){let n=e.shape.method.value;if(this._registeredMethods.has(n))throw Error(`Handler for \"${n}\" already registered (via ${t}). Use addEventListener() to attach multiple listeners, or the on* setter for replace semantics.`);this._registeredMethods.add(n)}},Bh=`2026-01-26`,Vh=class{eventTarget;eventSource;messageListener;constructor(e=window.parent,t){this.eventTarget=e,this.eventSource=t,this.messageListener=e=>{if(t&&e.source!==this.eventSource){console.debug(`Ignoring message from unknown source`,e);return}let n=pf.safeParse(e.data);n.success?(console.debug(`Parsed message`,n.data),this.onmessage?.(n.data)):e.data?.jsonrpc===`2.0`?(console.error(`Failed to parse message`,n.error.message,e),this.onerror?.(Error(`Invalid JSON-RPC message received: `+n.error.message))):console.debug(`Ignoring non-JSON-RPC message`,n.error.message,e)}}async start(){window.addEventListener(`message`,this.messageListener)}async send(e,t){e.method!==`ui/notifications/tool-input-partial`&&console.debug(`Sending message`,e),this.eventTarget.postMessage(e,`*`)}async close(){window.removeEventListener(`message`,this.messageListener),this.onclose?.()}onclose;onerror;onmessage;sessionId;setProtocolVersion},Hh=L([B(`light`),B(`dark`)]).describe(`Color theme preference for the host environment.`),Uh=L([B(`inline`),B(`fullscreen`),B(`pip`)]).describe(`Display mode for UI presentation.`),Wh=L([B(`--color-background-primary`),B(`--color-background-secondary`),B(`--color-background-tertiary`),B(`--color-background-inverse`),B(`--color-background-ghost`),B(`--color-background-info`),B(`--color-background-danger`),B(`--color-background-success`),B(`--color-background-warning`),B(`--color-background-disabled`),B(`--color-text-primary`),B(`--color-text-secondary`),B(`--color-text-tertiary`),B(`--color-text-inverse`),B(`--color-text-ghost`),B(`--color-text-info`),B(`--color-text-danger`),B(`--color-text-success`),B(`--color-text-warning`),B(`--color-text-disabled`),B(`--color-border-primary`),B(`--color-border-secondary`),B(`--color-border-tertiary`),B(`--color-border-inverse`),B(`--color-border-ghost`),B(`--color-border-info`),B(`--color-border-danger`),B(`--color-border-success`),B(`--color-border-warning`),B(`--color-border-disabled`),B(`--color-ring-primary`),B(`--color-ring-secondary`),B(`--color-ring-inverse`),B(`--color-ring-info`),B(`--color-ring-danger`),B(`--color-ring-success`),B(`--color-ring-warning`),B(`--font-sans`),B(`--font-mono`),B(`--font-weight-normal`),B(`--font-weight-medium`),B(`--font-weight-semibold`),B(`--font-weight-bold`),B(`--font-text-xs-size`),B(`--font-text-sm-size`),B(`--font-text-md-size`),B(`--font-text-lg-size`),B(`--font-heading-xs-size`),B(`--font-heading-sm-size`),B(`--font-heading-md-size`),B(`--font-heading-lg-size`),B(`--font-heading-xl-size`),B(`--font-heading-2xl-size`),B(`--font-heading-3xl-size`),B(`--font-text-xs-line-height`),B(`--font-text-sm-line-height`),B(`--font-text-md-line-height`),B(`--font-text-lg-line-height`),B(`--font-heading-xs-line-height`),B(`--font-heading-sm-line-height`),B(`--font-heading-md-line-height`),B(`--font-heading-lg-line-height`),B(`--font-heading-xl-line-height`),B(`--font-heading-2xl-line-height`),B(`--font-heading-3xl-line-height`),B(`--border-radius-xs`),B(`--border-radius-sm`),B(`--border-radius-md`),B(`--border-radius-lg`),B(`--border-radius-xl`),B(`--border-radius-full`),B(`--border-width-regular`),B(`--shadow-hairline`),B(`--shadow-sm`),B(`--shadow-md`),B(`--shadow-lg`)]).describe(`CSS variable keys available to MCP apps for theming.`),Gh=R(Wh.describe(`Style variables for theming MCP apps.\n\nIndividual style keys are optional - hosts may provide any subset of these values.\nValues are strings containing CSS values (colors, sizes, font stacks, etc.).\n\nNote: This type uses \\`Record<K, string | undefined>\\` rather than \\`Partial<Record<K, string>>\\`\nfor compatibility with Zod schema generation. Both are functionally equivalent for validation.`),L([A(),zl()]).describe(`Style variables for theming MCP apps.\n\nIndividual style keys are optional - hosts may provide any subset of these values.\nValues are strings containing CSS values (colors, sizes, font stacks, etc.).\n\nNote: This type uses \\`Record<K, string | undefined>\\` rather than \\`Partial<Record<K, string>>\\`\nfor compatibility with Zod schema generation. Both are functionally equivalent for validation.`)).describe(`Style variables for theming MCP apps.\n\nIndividual style keys are optional - hosts may provide any subset of these values.\nValues are strings containing CSS values (colors, sizes, font stacks, etc.).\n\nNote: This type uses \\`Record<K, string | undefined>\\` rather than \\`Partial<Record<K, string>>\\`\nfor compatibility with Zod schema generation. Both are functionally equivalent for validation.`),F({method:B(`ui/open-link`),params:F({url:A().describe(`URL to open in the host's browser`)})}),Kh=F({isError:M().optional().describe(`True if the host failed to open the URL (e.g., due to security policy).`)}).passthrough(),qh=F({isError:M().optional().describe(`True if the download failed (e.g., user cancelled or host denied).`)}).passthrough(),Jh=F({isError:M().optional().describe(`True if the host rejected or failed to deliver the message.`)}).passthrough(),F({method:B(`ui/notifications/sandbox-proxy-ready`),params:F({})}),Yh=F({connectDomains:P(A()).optional().describe(`Origins for network requests (fetch/XHR/WebSocket).\n\n- Maps to CSP \\`connect-src\\` directive\n- Empty or omitted → no network connections (secure default)`),resourceDomains:P(A()).optional().describe(\"Origins for static resources (images, scripts, stylesheets, fonts, media).\\n\\n- Maps to CSP `img-src`, `script-src`, `style-src`, `font-src`, `media-src` directives\\n- Wildcard subdomains supported: `https://*.example.com`\\n- Empty or omitted → no network resources (secure default)\"),frameDomains:P(A()).optional().describe(\"Origins for nested iframes.\\n\\n- Maps to CSP `frame-src` directive\\n- Empty or omitted → no nested iframes allowed (`frame-src 'none'`)\"),baseUriDomains:P(A()).optional().describe(\"Allowed base URIs for the document.\\n\\n- Maps to CSP `base-uri` directive\\n- Empty or omitted → only same origin allowed (`base-uri 'self'`)\")}),Xh=F({camera:F({}).optional().describe(`Request camera access.\n\nMaps to Permission Policy \\`camera\\` feature.`),microphone:F({}).optional().describe(`Request microphone access.\n\nMaps to Permission Policy \\`microphone\\` feature.`),geolocation:F({}).optional().describe(`Request geolocation access.\n\nMaps to Permission Policy \\`geolocation\\` feature.`),clipboardWrite:F({}).optional().describe(`Request clipboard write access.\n\nMaps to Permission Policy \\`clipboard-write\\` feature.`)}),F({method:B(`ui/notifications/size-changed`),params:F({width:j().optional().describe(`New width in pixels.`),height:j().optional().describe(`New height in pixels.`)})}),Zh=F({method:B(`ui/notifications/tool-input`),params:F({arguments:R(A(),N().describe(`Complete tool call arguments as key-value pairs.`)).optional().describe(`Complete tool call arguments as key-value pairs.`)})}),Qh=F({method:B(`ui/notifications/tool-input-partial`),params:F({arguments:R(A(),N().describe(`Partial tool call arguments (incomplete, may change).`)).optional().describe(`Partial tool call arguments (incomplete, may change).`)})}),$h=F({method:B(`ui/notifications/tool-cancelled`),params:F({reason:A().optional().describe(`Optional reason for the cancellation (e.g., \"user action\", \"timeout\").`)})}),eg=F({fonts:A().optional()}),tg=F({variables:Gh.optional().describe(`CSS variables for theming the app.`),css:eg.optional().describe(`CSS blocks that apps can inject.`)}),ng=F({method:B(`ui/resource-teardown`),params:F({})}),R(A(),N()),rg=F({text:F({}).optional().describe(`Host supports text content blocks.`),image:F({}).optional().describe(`Host supports image content blocks.`),audio:F({}).optional().describe(`Host supports audio content blocks.`),resource:F({}).optional().describe(`Host supports resource content blocks.`),resourceLink:F({}).optional().describe(`Host supports resource link content blocks.`),structuredContent:F({}).optional().describe(`Host supports structured content.`)}),F({method:B(`ui/notifications/request-teardown`),params:F({}).optional()}),ig=F({experimental:R(A(),R(A(),Vl()).describe(`Experimental features keyed by identifier.`)).optional().describe(`Experimental features keyed by identifier.`),openLinks:F({}).optional().describe(`Host supports opening external URLs.`),downloadFile:F({}).optional().describe(`Host supports file downloads via ui/download-file.`),serverTools:F({listChanged:M().optional().describe(`Host supports tools/list_changed notifications.`)}).optional().describe(`Host can proxy tool calls to the MCP server.`),serverResources:F({listChanged:M().optional().describe(`Host supports resources/list_changed notifications.`)}).optional().describe(`Host can proxy resource reads to the MCP server.`),logging:F({}).optional().describe(`Host accepts log messages.`),sandbox:F({permissions:Xh.optional().describe(`Permissions granted by the host (camera, microphone, geolocation).`),csp:Yh.optional().describe(`CSP domains approved by the host.`)}).optional().describe(`Sandbox configuration applied by the host.`),updateModelContext:rg.optional().describe(`Host accepts context updates (ui/update-model-context) to be included in the model's context for future turns.`),message:rg.optional().describe(`Host supports receiving content messages (ui/message) from the view.`),sampling:F({tools:F({}).optional().describe(\"Host supports tool use via `tools` and `toolChoice` parameters.\")}).optional().describe(\"Host supports LLM sampling (sampling/createMessage) from the view.\\nMirrors the MCP `ClientCapabilities.sampling` shape so hosts can pass it through.\")}),ag=F({experimental:R(A(),R(A(),Vl()).describe(`Experimental features keyed by identifier.`)).optional().describe(`Experimental features keyed by identifier.`),tools:F({listChanged:M().optional().describe(`App supports tools/list_changed notifications.`)}).optional().describe(`App exposes MCP-style tools that the host can call.`),availableDisplayModes:P(Uh).optional().describe(`Display modes the app supports.`)}),F({method:B(`ui/notifications/initialized`),params:F({}).optional()}),F({csp:Yh.optional().describe(`Content Security Policy configuration for UI resources.`),permissions:Xh.optional().describe(`Sandbox permissions requested by the UI resource.`),domain:A().optional().describe(`Dedicated origin for view sandbox.\n\nUseful when views need stable, dedicated origins for OAuth callbacks, CORS policies, or API key allowlists.\n\n**Host-dependent:** The format and validation rules for this field are determined by each host. Servers MUST consult host-specific documentation for the expected domain format. Common patterns include:\n- Hash-based subdomains (e.g., \\`{hash}.claudemcpcontent.com\\`)\n- URL-derived subdomains (e.g., \\`www-example-com.oaiusercontent.com\\`)\n\nIf omitted, host uses default sandbox origin (typically per-conversation).`),prefersBorder:M().optional().describe(`Visual boundary preference - true if view prefers a visible border.\n\nBoolean requesting whether a visible border and background is provided by the host. Specifying an explicit value for this is recommended because hosts' defaults may vary.\n\n- \\`true\\`: request visible border + background\n- \\`false\\`: request no visible border + background\n- omitted: host decides border`)}),F({method:B(`ui/request-display-mode`),params:F({mode:Uh.describe(`The display mode being requested.`)})}),og=F({mode:Uh.describe(`The display mode that was actually set. May differ from requested if not supported.`)}).passthrough(),sg=L([B(`model`),B(`app`)]).describe(`Tool visibility scope - who can access the tool.`),F({resourceUri:A().optional(),visibility:P(sg).optional().describe(`Who can access this tool. Default: [\"model\", \"app\"]\n- \"model\": Tool visible to and callable by the agent\n- \"app\": Tool callable by the app from this server only`),csp:Hl().optional(),permissions:Hl().optional()}),F({mimeTypes:P(A()).optional().describe('Array of supported MIME types for UI resources.\\nMust include `\"text/html;profile=mcp-app\"` for MCP Apps support.')}),F({method:B(`ui/download-file`),params:F({contents:P(L([kp,Ap])).describe(`Resource contents to download — embedded (inline data) or linked (host fetches). Uses standard MCP resource types.`)})}),F({method:B(`ui/message`),params:F({role:B(`user`).describe(`Message role, currently only \"user\" is supported.`),content:P(jp).describe(`Message content blocks (text, image, etc.).`)})}),F({method:B(`ui/notifications/sandbox-resource-ready`),params:F({html:A().describe(`HTML content to load into the inner iframe.`),sandbox:A().optional().describe(`Optional override for the inner iframe's sandbox attribute.`),csp:Yh.optional().describe(`CSP configuration from resource metadata.`),permissions:Xh.optional().describe(`Sandbox permissions from resource metadata.`)})}),cg=F({method:B(`ui/notifications/tool-result`),params:Bp.describe(`Standard MCP tool execution result.`)}),lg=F({toolInfo:F({id:rf.optional().describe(`JSON-RPC id of the tools/call request.`),tool:Lp.describe(`Tool definition including name, inputSchema, etc.`)}).optional().describe(`Metadata of the tool call that instantiated this App.`),theme:Hh.optional().describe(`Current color theme preference.`),styles:tg.optional().describe(`Style configuration for theming the app.`),displayMode:Uh.optional().describe(`How the UI is currently displayed.`),availableDisplayModes:P(Uh).optional().describe(`Display modes the host supports.`),containerDimensions:L([F({height:j().describe(`Fixed container height in pixels.`)}),F({maxHeight:L([j(),zl()]).optional().describe(`Maximum container height in pixels.`)})]).and(L([F({width:j().describe(`Fixed container width in pixels.`)}),F({maxWidth:L([j(),zl()]).optional().describe(`Maximum container width in pixels.`)})])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other\ncontainer holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:A().optional().describe(`User's language and region preference in BCP 47 format.`),timeZone:A().optional().describe(`User's timezone in IANA format.`),userAgent:A().optional().describe(`Host application identifier.`),platform:L([B(`web`),B(`desktop`),B(`mobile`)]).optional().describe(`Platform type for responsive design decisions.`),deviceCapabilities:F({touch:M().optional().describe(`Whether the device supports touch input.`),hover:M().optional().describe(`Whether the device supports hover interactions.`)}).optional().describe(`Device input capabilities.`),safeAreaInsets:F({top:j().describe(`Top safe area inset in pixels.`),right:j().describe(`Right safe area inset in pixels.`),bottom:j().describe(`Bottom safe area inset in pixels.`),left:j().describe(`Left safe area inset in pixels.`)}).optional().describe(`Mobile safe area boundaries in pixels.`)}).passthrough(),ug=F({method:B(`ui/notifications/host-context-changed`),params:lg.describe(`Partial context update containing only changed fields.`)}),F({method:B(`ui/update-model-context`),params:F({content:P(jp).optional().describe(`Context content blocks (text, image, etc.).`),structuredContent:R(A(),N().describe(`Structured content for machine-readable context data.`)).optional().describe(`Structured content for machine-readable context data.`)})}),F({method:B(`ui/initialize`),params:F({appInfo:bf.describe(`App identification (name and version).`),appCapabilities:ag.describe(`Features and capabilities this app provides.`),protocolVersion:A().describe(`Protocol version this app supports.`)})}),dg=F({protocolVersion:A().describe(`Negotiated protocol version string (e.g., \"2025-11-21\").`),hostInfo:bf.describe(`Host application identification and version.`),hostCapabilities:ig.describe(`Features and capabilities provided by the host.`),hostContext:lg.describe(`Rich context about the host environment.`)}).passthrough(),fg={target:`draft-2020-12`},pg=class e extends zh{_appInfo;_capabilities;options;_hostCapabilities;_hostInfo;_hostContext;_registeredTools={};_initializedSent=!1;_assertInitialized(e){if(this._initializedSent)return;let t=`[ext-apps] App.${e}() called before connect() completed the ui/initialize handshake. Await app.connect() before calling this method, or move data loading to an ontoolresult handler.`;if(this.options?.strict)throw Error(t);console.warn(`${t}. This will throw in a future release.`)}eventSchemas={toolinput:Zh,toolinputpartial:Qh,toolresult:cg,toolcancelled:$h,hostcontextchanged:ug};static ONE_SHOT_EVENTS=new Set([`toolinput`,`toolinputpartial`,`toolresult`,`toolcancelled`]);_everHadListener=new Set;_assertHandlerTiming(t){if(!e.ONE_SHOT_EVENTS.has(t)||this._everHadListener.has(t)||(this._everHadListener.add(t),!this._initializedSent))return;let n=`[ext-apps] \"${String(t)}\" handler registered after connect() completed the ui/initialize handshake. The host may have already sent this notification. Register handlers before calling app.connect().`;if(this.options?.strict)throw Error(n);console.warn(n)}setEventHandler(e,t){t&&this._assertHandlerTiming(e),super.setEventHandler(e,t)}addEventListener(e,t){this._assertHandlerTiming(e),super.addEventListener(e,t)}onEventDispatch(e,t){e===`hostcontextchanged`&&(this._hostContext={...this._hostContext,...t})}constructor(e,t={},n={autoResize:!0}){super(n),this._appInfo=e,this._capabilities=t,this.options=n,n.allowUnsafeEval||o({jitless:!0}),this.setRequestHandler(jf,e=>(console.log(`Received ping:`,e.params),{})),this.setEventHandler(`hostcontextchanged`,void 0)}registerCapabilities(e){if(this.transport)throw Error(`Cannot register capabilities after transport is established`);this._capabilities=Dh(this._capabilities,e)}registerTool(e,t,n){if(this._registeredTools[e])throw Error(`Tool ${e} is already registered`);let r=this,i=()=>{r._initializedSent&&r._capabilities.tools?.listChanged&&r.sendToolListChanged()},a=t.inputSchema!==void 0,o={title:t.title,description:t.description,inputSchema:t.inputSchema,outputSchema:t.outputSchema,annotations:t.annotations,_meta:t._meta,enabled:!0,enable(){this.enabled=!0,i()},disable(){this.enabled=!1,i()},update(e){Object.assign(this,e),i()},remove(){r._registeredTools[e]===o&&(delete r._registeredTools[e],i())},handler:async(t,r)=>{if(!o.enabled)throw Error(`Tool ${e} is disabled`);let i;if(a){let a=o.inputSchema;i=await n(a?await Ih(a,t??{},`Invalid input for tool ${e}: `):t??{},r)}else i=await n(r);return o.outputSchema&&!i.isError&&(i.structuredContent=await Ih(o.outputSchema,i.structuredContent,`Invalid output for tool ${e}: `)),i}};return this._registeredTools[e]=o,!this._capabilities.tools&&!this.transport&&this.registerCapabilities({tools:{listChanged:!0}}),this.ensureToolHandlersInitialized(),i(),o}_toolHandlersInitialized=!1;ensureToolHandlersInitialized(){this._toolHandlersInitialized||(this._toolHandlersInitialized=!0,this.oncalltool=async(e,t)=>{let n=this._registeredTools[e.name];if(!n)throw Error(`Tool ${e.name} not found`);return n.handler(e.arguments,t)},this.onlisttools=async(e,t)=>({tools:await Promise.all(Object.entries(this._registeredTools).filter(([e,t])=>t.enabled).map(async([e,t])=>{let n={name:e,title:t.title,description:t.description,inputSchema:t.inputSchema?await Fh(t.inputSchema,`input`):{type:`object`,properties:{}}};return t.outputSchema&&(n.outputSchema=await Fh(t.outputSchema,`output`)),t.annotations&&(n.annotations=t.annotations),t._meta&&(n._meta=t._meta),n}))}))}async sendToolListChanged(e={}){this._assertInitialized(`sendToolListChanged`),await this.notification({method:`notifications/tools/list_changed`,params:e})}getHostCapabilities(){return this._hostCapabilities}getHostVersion(){return this._hostInfo}getHostContext(){return this._hostContext}get ontoolinput(){return this.getEventHandler(`toolinput`)}set ontoolinput(e){this.setEventHandler(`toolinput`,e)}get ontoolinputpartial(){return this.getEventHandler(`toolinputpartial`)}set ontoolinputpartial(e){this.setEventHandler(`toolinputpartial`,e)}get ontoolresult(){return this.getEventHandler(`toolresult`)}set ontoolresult(e){this.setEventHandler(`toolresult`,e)}get ontoolcancelled(){return this.getEventHandler(`toolcancelled`)}set ontoolcancelled(e){this.setEventHandler(`toolcancelled`,e)}get onhostcontextchanged(){return this.getEventHandler(`hostcontextchanged`)}set onhostcontextchanged(e){this.setEventHandler(`hostcontextchanged`,e)}_onteardown;get onteardown(){return this._onteardown}set onteardown(e){this.warnIfRequestHandlerReplaced(`onteardown`,this._onteardown,e),this._onteardown=e,this.replaceRequestHandler(ng,(e,t)=>{if(!this._onteardown)throw Error(`No onteardown handler set`);return this._onteardown(e.params,t)})}_oncalltool;get oncalltool(){return this._oncalltool}set oncalltool(e){this.warnIfRequestHandlerReplaced(`oncalltool`,this._oncalltool,e),this._oncalltool=e,this.replaceRequestHandler(Hp,(e,t)=>{if(!this._oncalltool)throw Error(`No oncalltool handler set`);return this._oncalltool(e.params,t)})}_onlisttools;get onlisttools(){return this._onlisttools}set onlisttools(e){this.warnIfRequestHandlerReplaced(`onlisttools`,this._onlisttools,e),this._onlisttools=e,this.replaceRequestHandler(Rp,(e,t)=>{if(!this._onlisttools)throw Error(`No onlisttools handler set`);return this._onlisttools(e.params,t)})}assertCapabilityForMethod(e){if(e===`sampling/createMessage`&&!this._hostCapabilities?.sampling)throw Error(`Host does not support sampling (required for ${e})`)}assertRequestHandlerCapability(e){switch(e){case`tools/call`:case`tools/list`:if(!this._capabilities.tools)throw Error(`Client does not support tool capability (required for ${e})`);return;case`ping`:case`ui/resource-teardown`:return;default:throw Error(`No handler for method ${e} registered`)}}assertNotificationCapability(e){}assertTaskCapability(e){throw Error(`Tasks are not supported in MCP Apps`)}assertTaskHandlerCapability(e){throw Error(`Task handlers are not supported in MCP Apps`)}async callServerTool(e,t){if(this._assertInitialized(`callServerTool`),typeof e==`string`)throw Error(`callServerTool() expects an object as its first argument, but received a string (\"${e}\"). Did you mean: callServerTool({ name: \"${e}\", arguments: { ... } })?`);return await this.request({method:`tools/call`,params:e},Bp,{onprogress:()=>{},resetTimeoutOnProgress:!0,...t})}async readServerResource(e,t){return this._assertInitialized(`readServerResource`),await this.request({method:`resources/read`,params:e},dp,t)}async listServerResources(e,t){return this._assertInitialized(`listServerResources`),await this.request({method:`resources/list`,params:e},ap,t)}async createSamplingMessage(e,t){this._assertInitialized(`createSamplingMessage`);let n=e.tools?am:im;return await this.request({method:`sampling/createMessage`,params:e},n,t)}sendMessage(e,t){return this._assertInitialized(`sendMessage`),this.request({method:`ui/message`,params:e},Jh,t)}sendLog(e){return this.notification({method:`notifications/message`,params:e})}updateModelContext(e,t){return this._assertInitialized(`updateModelContext`),this.request({method:`ui/update-model-context`,params:e},mf,t)}openLink(e,t){return this._assertInitialized(`openLink`),this.request({method:`ui/open-link`,params:e},Kh,t)}sendOpenLink=this.openLink;downloadFile(e,t){return this._assertInitialized(`downloadFile`),this.request({method:`ui/download-file`,params:e},qh,t)}requestTeardown(e={}){return this.notification({method:`ui/notifications/request-teardown`,params:e})}requestDisplayMode(e,t){return this._assertInitialized(`requestDisplayMode`),this.request({method:`ui/request-display-mode`,params:e},og,t)}sendSizeChanged(e){return this.notification({method:`ui/notifications/size-changed`,params:e})}setupSizeChangedNotifications(){let e=!1,t=0,n=0,r=()=>{e||(e=!0,requestAnimationFrame(()=>{e=!1;let r=document.documentElement,i=r.style.height;r.style.height=`max-content`;let a=Math.ceil(r.getBoundingClientRect().height);r.style.height=i;let o=Math.ceil(window.innerWidth);(o!==t||a!==n)&&(t=o,n=a,this.sendSizeChanged({width:o,height:a}))}))};r();let i=new ResizeObserver(r);return i.observe(document.documentElement),i.observe(document.body),()=>i.disconnect()}async connect(e=new Vh(window.parent,window.parent),t){if(this.transport)throw Error(`App is already connected. Call close() before connecting again.`);this._initializedSent=!1,await super.connect(e);try{let e=await this.request({method:`ui/initialize`,params:{appCapabilities:this._capabilities,appInfo:this._appInfo,protocolVersion:Bh}},dg,t);if(e===void 0)throw Error(`Server sent invalid initialize result: ${e}`);this._hostCapabilities=e.hostCapabilities,this._hostInfo=e.hostInfo,this._hostContext=e.hostContext,await this.notification({method:`ui/notifications/initialized`}),this._initializedSent=!0,this.options?.autoResize&&this.setupSizeChangedNotifications()}catch(e){throw this.close(),e}}}}));function hg(e,t){let n,r=0,i,a=()=>{n!==void 0&&(clearTimeout(n),n=void 0)},o=new pg({name:e,version:`0.0.1`},{}),s=async e=>{let t=await o.request({method:`tools/call`,params:{name:`get_generation`,arguments:{operationId:e}}},Bp);if(!t.isError)return t.structuredContent},c=(e,o)=>{n=window.setTimeout(async()=>{if(Date.now()-r>yg){t.onTimeout?.();return}try{let n=await s(e);if(n?.status===`complete`){a(),i=n,t.onResult(n);return}}catch{}c(e,Math.min(o*1.5,vg))},o)},l=e=>{e&&(a(),i=e,t.onResult(e),e.status===`running`&&e.operationId!==void 0&&(r=Date.now(),c(e.operationId,_g)))};return o.ontoolinput=()=>t.onResult({status:`running`}),o.ontoolresult=e=>l(e?.structuredContent),o.onhostcontextchanged=e=>{if(e?.theme&&Lh(e.theme),e?.styles?.variables&&Rh(e.styles.variables),e?.displayMode&&(document.documentElement.dataset.displayMode=e.displayMode),e?.safeAreaInsets){let{top:t=0,right:n=0,bottom:r=0,left:i=0}=e.safeAreaInsets;document.body.style.padding=`${t}px ${n}px ${r}px ${i}px`}},o.onteardown=async()=>(a(),{}),o.connect(new Vh(window.parent,window.parent)).catch(()=>{}),{app:o,current:()=>i}}function gg(e,t){return e.openLink({url:t})}var $,_g,vg,yg,bg=t((()=>{mg(),Fm(),$=e=>document.getElementById(e),_g=2e3,vg=1e4,yg=36e4}));n((()=>{bg();var e=e=>`$${e.toFixed(2)}`,t=e=>{$(`status`).textContent=e};function n(n){$(`card`).classList.remove(`measuring`),n.material&&($(`material`).textContent=`${n.quantity&&n.quantity>1?`${n.quantity}x `:``}${n.material}`);let r=n.dimensionsCm;r&&($(`size`).textContent=`${r.width.toFixed(1)} x ${r.height.toFixed(1)} x ${r.depth.toFixed(1)} cm`);let i=n.solid;if(i){let r=$(`price`);r.textContent=``;let a=document.createElement(`span`);if(a.className=`amount`,a.textContent=e(i.unitPrice),r.append(a),i.discount>0){let t=document.createElement(`span`);t.className=`was`,t.textContent=e(i.salePrice),r.append(t)}let o=document.createElement(`span`);o.className=`per`,o.textContent=`per unit`,r.append(o);let s=$(`rows`);if(s.textContent=``,n.hollow){let t=document.createElement(`div`);t.textContent=`hollow (Pro): ${e(n.hollow.unitPrice)} per unit${n.callerIsPro?``:` — requires a subscription`}`,s.append(t)}let c=document.createElement(`div`);c.textContent=`~${i.productionDays} production day${i.productionDays===1?``:`s`}`,s.append(c),$(`note`).hidden=!1,t(``)}let a=$(`order`);a.hidden=!n.printUrl}var r=hg(`Womp print`,{onTimeout:()=>t(`Still measuring — ask me to check on it.`),onResult:e=>{let r=e;if(r.status===`running`){$(`card`).classList.add(`measuring`),t(`Measuring mesh…`);return}n(r)}});$(`order`).addEventListener(`click`,()=>{let e=r.current();e?.printUrl&&gg(r.app,e.printUrl)})}))();</script>\n </head>\n <body>\n <div class=\"card\" id=\"card\">\n <div class=\"head\">\n <div class=\"title\">3D print</div>\n <div class=\"material\" id=\"material\"></div>\n </div>\n <div class=\"size\" id=\"size\"></div>\n <div class=\"price\" id=\"price\"></div>\n <div class=\"rows\" id=\"rows\"></div>\n <button class=\"cta\" id=\"order\" hidden>\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\">\n <path d=\"M7 17 17 7M9 7h8v8\" />\n </svg>\n Complete order on womp.com\n </button>\n <div class=\"note\" id=\"note\" hidden>\n Shipping is added at checkout; the final price is confirmed before printing.\n </div>\n <div class=\"status\" id=\"status\">Connecting…</div>\n </div>\n </body>\n</html>\n";
|