PageSourceSearch

https://puzzlepave.com/_next/static/chunks/773.c0c58670018619d4.js

js puzzlepave.com collected 2026-10-04 10:09:16 UTC 890,701 bytes, 91 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[773],{170:(t,r,n)=>{"use strict";function i(t,r){r.beginShape=function(t){this._renderer.beginShape(...arguments)},r.bezierVertex=function(...t){this._renderer.bezierVertex(...t)},r.endShape=function(t,r=1){r<1&&(console.log("\uD83C\uDF38 p5.js says: You can not have less than one instance"),r=1),this._renderer.endShape(t,r)},r.normal=function(t,r,n){return this._assert3d("normal"),this._renderer.normal(...arguments),this},r.vertexProperty=function(t,r){this._renderer.vertexProperty(t,r)}}n.d(r,{A:()=>i}),"undefined"!=typeof p5&&i(p5,p5.prototype)},1818:(t,r,n)=>{"use strict";n.d(r,{Ay:()=>l,FL:()=>o,ie:()=>a});var i=n(39446),s=n(67449);let o={D50:[.3457/.3585,1,.8251046025104602],D65:[.3127/.329,1,1.0890577507598784]};function a(t){return Array.isArray(t)?t:o[t]}function l(t,r,n,u={}){if(t=a(t),r=a(r),!t||!r)throw TypeError(`Missing white point to convert ${!t?"from":""}${!t&&!r?"/":""}${!r?"to":""}`);if(t===r)return n;let h={W1:t,W2:r,XYZ:n,options:u};if(i.A.run("chromatic-adaptation-start",h),h.M||(h.W1===o.D65&&h.W2===o.D50?h.M=[[1.0479297925449969,.022946870601609652,-.05019226628920524],[.02962780877005599,.9904344267538799,-.017073799063418826],[-.009243040646204504,.015055191490298152,.7518742814281371]]:h.W1===o.D50&&h.W2===o.D65&&(h.M=[[.955473421488075,-.02309845494876471,.06325924320057072],[-.0283697093338637,1.0099953980813041,.021041441191917323],[.012314014864481998,-.020507649298898964,1.330365926242124]])),i.A.run("chromatic-adaptation-end",h),h.M)return(0,s.R)(h.XYZ,h.M);throw TypeError("Only Bradford CAT with white points D50 and D65 supported for now.")}},3580:(t,r,n)=>{"use strict";n.d(r,{A:()=>eq});var i,s,o,a,l={};n.r(l),n.d(l,{base64:()=>r3,base64url:()=>r4,bigint:()=>ns,boolean:()=>nl,browserEmail:()=>rK,cidrv4:()=>r2,cidrv6:()=>r5,cuid:()=>rk,cuid2:()=>rM,date:()=>ne,datetime:()=>nn,domain:()=>r6,duration:()=>rz,e164:()=>r9,email:()=>rq,emoji:()=>rJ,extendedDuration:()=>rU,guid:()=>r$,hex:()=>np,hostname:()=>r8,html5Email:()=>rW,idnEmail:()=>rY,integer:()=>no,ipv4:()=>rQ,ipv6:()=>r0,ksuid:()=>rR,lowercase:()=>nc,mac:()=>r1,md5_base64:()=>ny,md5_base64url:()=>nv,md5_hex:()=>ng,nanoid:()=>rP,null:()=>nu,number:()=>na,rfc5322Email:()=>rZ,sha1_base64:()=>nx,sha1_base64url:()=>n_,sha1_hex:()=>nb,sha256_base64:()=>nE,sha256_base64url:()=>nC,sha256_hex:()=>nA,sha384_base64:()=>nw,sha384_base64url:()=>nS,sha384_hex:()=>nD,sha512_base64:()=>nT,sha512_base64url:()=>nN,sha512_hex:()=>nF,string:()=>ni,time:()=>nr,ulid:()=>rB,undefined:()=>nh,unicodeEmail:()=>rX,uppercase:()=>nd,uuid:()=>rj,uuid4:()=>rV,uuid6:()=>rG,uuid7:()=>rH,xid:()=>rL});var u={};n.r(u),n.d(u,{endsWith:()=>on,gt:()=>sX,gte:()=>sY,includes:()=>ot,length:()=>s6,lowercase:()=>s7,lt:()=>sW,lte:()=>sZ,maxLength:()=>s4,maxSize:()=>s2,mime:()=>os,minLength:()=>s8,minSize:()=>s5,multipleOf:()=>s1,negative:()=>sJ,nonnegative:()=>s0,nonpositive:()=>sQ,normalize:()=>oa,overwrite:()=>oo,positive:()=>sK,property:()=>oi,regex:()=>s9,size:()=>s3,slugify:()=>oc,startsWith:()=>or,toLowerCase:()=>ou,toUpperCase:()=>oh,trim:()=>ol,uppercase:()=>oe});var h={};n.r(h),n.d(h,{ZodISODate:()=>oE,ZodISODateTime:()=>o_,ZodISODuration:()=>oS,ZodISOTime:()=>oD,date:()=>oC,datetime:()=>oA,duration:()=>oF,time:()=>ow});var c={};n.r(c),n.d(c,{ZodAny:()=>a0,ZodArray:()=>le,ZodBase64:()=>ax,ZodBase64URL:()=>aA,ZodBigInt:()=>aV,ZodBigIntFormat:()=>aH,ZodBoolean:()=>a$,ZodCIDRv4:()=>ag,ZodCIDRv6:()=>av,ZodCUID:()=>ae,ZodCUID2:()=>ar,ZodCatch:()=>lX,ZodCodec:()=>l1,ZodCustom:()=>un,ZodCustomStringFormat:()=>aF,ZodDate:()=>a9,ZodDefault:()=>l$,ZodDiscriminatedUnion:()=>lc,ZodE164:()=>aC,ZodEmail:()=>oZ,ZodEmoji:()=>o8,ZodEnum:()=>lD,ZodExactOptional:()=>lL,ZodFile:()=>lN,ZodFunction:()=>ut,ZodGUID:()=>oY,ZodIPv4:()=>ah,ZodIPv6:()=>af,ZodIntersection:()=>lp,ZodJWT:()=>aw,ZodKSUID:()=>al,ZodLazy:()=>l6,ZodLiteral:()=>lF,ZodMAC:()=>ad,ZodMap:()=>l_,ZodNaN:()=>lK,ZodNanoID:()=>o9,ZodNever:()=>a3,ZodNonOptional:()=>lH,ZodNull:()=>aJ,ZodNullable:()=>lP,ZodNumber:()=>ak,ZodNumberFormat:()=>aB,ZodObject:()=>ln,ZodOptional:()=>lM,ZodPipe:()=>lQ,ZodPrefault:()=>lV,ZodPromise:()=>l7,ZodReadonly:()=>l5,ZodRecord:()=>ly,ZodSet:()=>lE,ZodString:()=>
1oH,ZodStringFormat:()=>oW,ZodSuccess:()=>lW,ZodSymbol:()=>aZ,ZodTemplateLiteral:()=>l4,ZodTransform:()=>lO,ZodTuple:()=>lm,ZodType:()=>oV,ZodULID:()=>ai,ZodURL:()=>o5,ZodUUID:()=>oJ,ZodUndefined:()=>aY,ZodUnion:()=>la,ZodUnknown:()=>a2,ZodVoid:()=>a8,ZodXID:()=>ao,ZodXor:()=>lu,_ZodString:()=>oG,_default:()=>lj,_function:()=>ur,any:()=>a1,array:()=>lt,base64:()=>a_,base64url:()=>aE,bigint:()=>aG,boolean:()=>aj,catch:()=>lY,check:()=>ui,cidrv4:()=>ay,cidrv6:()=>ab,codec:()=>l2,cuid:()=>at,cuid2:()=>an,custom:()=>us,date:()=>a7,describe:()=>ul,discriminatedUnion:()=>ld,e164:()=>aD,email:()=>oX,emoji:()=>o6,enum:()=>lw,exactOptional:()=>lR,file:()=>lI,float32:()=>aR,float64:()=>aP,function:()=>ur,guid:()=>oK,hash:()=>aO,hex:()=>aI,hostname:()=>aN,httpUrl:()=>o4,instanceof:()=>uh,int:()=>aL,int32:()=>az,int64:()=>aq,intersection:()=>lf,ipv4:()=>ac,ipv6:()=>am,json:()=>ud,jwt:()=>aS,keyof:()=>lr,ksuid:()=>au,lazy:()=>l9,literal:()=>lT,looseObject:()=>lo,looseRecord:()=>lx,mac:()=>ap,map:()=>lA,meta:()=>uu,nan:()=>lJ,nanoid:()=>o7,nativeEnum:()=>lS,never:()=>a4,nonoptional:()=>lq,null:()=>aQ,nullable:()=>lz,nullish:()=>lU,number:()=>aM,object:()=>li,optional:()=>lB,partialRecord:()=>lb,pipe:()=>l0,prefault:()=>lG,preprocess:()=>up,promise:()=>ue,readonly:()=>l3,record:()=>lv,refine:()=>uo,set:()=>lC,strictObject:()=>ls,string:()=>oq,stringFormat:()=>aT,stringbool:()=>uc,success:()=>lZ,superRefine:()=>ua,symbol:()=>aX,templateLiteral:()=>l8,transform:()=>lk,tuple:()=>lg,uint32:()=>aU,uint64:()=>aW,ulid:()=>as,undefined:()=>aK,union:()=>ll,unknown:()=>a5,url:()=>o3,uuid:()=>oQ,uuidv4:()=>o0,uuidv6:()=>o1,uuidv7:()=>o2,void:()=>a6,xid:()=>aa,xor:()=>lh});var d=n(58905),p=n(79690);function f(t,r){r.noLoop=function(){this._loop=!1},r.loop=function(){!this._loop&&(this._loop=!0,this._setupDone&&this._draw())},r.isLooping=function(){return this._loop},r.redraw=async function(t){if(this._inUserDraw||!this._setupDone)return;let r=parseInt(t);(isNaN(r)||r<1)&&(r=1);let n=this._isGlobal?window:this;if("function"==typeof n.draw){void 0===n.setup&&n.scale(n._pixelDensity,n._pixelDensity);for(let t=0;t<r;t++){n.resetMatrix(),(this._accessibleOutputs.grid||this._accessibleOutputs.text)&&this._updateAccsOutput(),this._renderer.isP3D&&this._renderer._update(),this.frameCount=n.frameCount+1,await this._runLifecycleHook("predraw"),this._inUserDraw=!0;try{await n.draw()}finally{this._inUserDraw=!1}await this._runLifecycleHook("postdraw")}await this._renderer.finishDraw?.()}}}function m(t,r,n){let i=[d.j,d.k,d.l,d.m,d.n,d.o];r._frameRate=0,r._lastFrameTime=window.performance.now(),r._targetFrameRate=60;let s=window.print,o=!1;function a(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth||0}function l(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight||0}n.presetup=function(){for(let t of["resize"])window.addEventListener(t,this[`_on${t}`].bind(this),{passive:!1,signal:this._removeSignal})},r.print=function(...t){t.length?console.log(...t):!o&&(s(),window.confirm("You just tried to print the webpage. Do you want to prevent this from running again?")&&(o=!0))},r.frameCount=0,r.deltaTime=0,r.focused=document.hasFocus(),r.cursor=function(t,r,n){let s="auto",o=this._curElement.elt;if(i.includes(t))s=t;else if("string"==typeof t){let i="";"number"==typeof r&&(n="number"==typeof n?n:0,i=`${Math.max(r,0)} ${Math.max(n,0)}`),s="http://"===t.substring(0,7)||"https://"===t.substring(0,8)||/\.(cur|jpg|jpeg|gif|png|CUR|JPG|JPEG|GIF|PNG)$/.test(t)?`url(${t}) ${i}, auto`:t}o.style.cursor=s},r.frameRate=function(t){return"number"!=typeof t||t<0?this._frameRate:(this._targetFrameRate=t,0===t&&(this._frameRate=t),this)},r.getFrameRate=function(){return this.frameRate()},r.setFrameRate=function(t){return this.frameRate(t)},r.getTargetFrameRate=function(){return this._targetFrameRate},r.noCursor=function(){this._curElement.elt.style.cursor="none"},r.webglVersion=d.P,r.displayWidth=screen.width,r.displayHeight=screen.height,r.windowWidth=0,r.windowHeight=0,r._onresize=function(t){let r;this.windowWidth=a(),this.windowHeight=l(),"function"==typeof this._customActions.windowResized&&(void 0===(r=this._customActions.windowResized(t))||r||t.preventDefault())},r._updateWindowSize=function(){this.windowWidth=a(),this.windowHeight=l()}
1,Object.defineProperty(r,"width",{configurable:!0,enumerable:!0,get(){return this._renderer?.width}}),Object.defineProperty(r,"height",{configurable:!0,enumerable:!0,get(){return this._renderer?.height}}),r.fullscreen=function(t){if(void 0===t)return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement;t?function(t){if(!(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled))throw Error("Fullscreen not enabled in this browser.");t.requestFullscreen?t.requestFullscreen():t.mozRequestFullScreen?t.mozRequestFullScreen():t.webkitRequestFullscreen?t.webkitRequestFullscreen():t.msRequestFullscreen&&t.msRequestFullscreen()}(document.documentElement):document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.msExitFullscreen&&document.msExitFullscreen()},r.pixelDensity=function(t){let r;return"number"==typeof t?(t!==this._renderer._pixelDensity&&(this._renderer._pixelDensity=t),r=this,this.resizeCanvas(this.width,this.height,!0)):r=this._renderer._pixelDensity,r},r.displayDensity=()=>window.devicePixelRatio,r.getURL=()=>location.href,r.getURLPath=()=>location.pathname.split("/").filter(t=>""!==t),r.getURLParams=function(){let t,r=/[?&]([^&=]+)(?:[&=])([^&=]+)/gim,n={};for(;null!=(t=r.exec(location.search));)t.index===r.lastIndex&&r.lastIndex++,n[t[1]]=t[2];return n},r.worldToScreen=function(t){return"number"==typeof t&&(t=this.createVector(...arguments)),this._renderer.getWorldToScreenMatrix().multiplyAndNormalizePoint(t)},r.screenToWorld=function(t){"number"==typeof t&&(t=this.createVector(...arguments));let r=this._renderer.getWorldToScreenMatrix();if(2===t.dimensions){let n=r.mat4[14]/r.mat4[15];t=this.createVector(t.x,t.y,n)}return r.invert(r).multiplyAndNormalizePoint(t)}}"undefined"!=typeof p5&&f(p5,p5.prototype),"undefined"!=typeof p5&&m(p5,p5.prototype);var g=n(54617),y=n(28499),v=n(20498),b=n(3694),x=n(45950),_=n(49570),A=n(56247),E="precision highp float;\n\nuniform sampler2D tex0;\nuniform vec2 canvasSize;\nuniform vec2 texelSize;\n\nIN vec2 vTexCoord;\n\nstruct FilterInputs {\n  vec2 texCoord;\n  vec2 canvasSize;\n  vec2 texelSize;\n};\n\nvoid main(void) {\n  FilterInputs inputs;\n  inputs.texCoord = vTexCoord;\n  inputs.canvasSize = canvasSize;\n  inputs.texelSize = texelSize;\n  OUT_COLOR = HOOK_getColor(inputs, tex0);\n  OUT_COLOR.rgb *= outColor.a;\n}\n",C="precision highp int;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\n\nIN vec3 aPosition;\nIN vec2 aTexCoord;\nOUT vec2 vTexCoord;\n\nvoid main() {\n  // transferring texcoords for the frag shader\n  vTexCoord = aTexCoord;\n\n  // copy position with a fourth coordinate for projection (1.0 is normal)\n  vec4 positionVec4 = vec4(aPosition, 1.0
1);\n\n  // project to 3D space\n  gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n}\n",D="#ifdef WEBGL2\n\n#define IN in\n#define OUT out\n\n#ifdef FRAGMENT_SHADER\nout vec4 outColor;\n#define OUT_COLOR outColor\n#endif\n#define TEXTURE texture\n\n#else\n\n#ifdef FRAGMENT_SHADER\n#define IN varying\n#else\n#define IN attribute\n#endif\n#define OUT varying\n#define TEXTURE texture2D\n\n#ifdef FRAGMENT_SHADER\n#define OUT_COLOR gl_FragColor\n#endif\n\n#endif\n\nvec4 getTexture(in sampler2D content, vec2 coord) {\n  vec4 color = TEXTURE(content, coord);\n  if (color.a > 0.) color.rgb /= color.a;\n  return color;\n}\n",w="// Based on https://github.com/stegu/webgl-noise/blob/22434e04d7753f7e949e8d724ab3da2864c17a0f/src/noise3D.glsl\n// MIT licensed, adapted for p5.strands\n\nvec3 mod289(vec3 x) {\n  return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 mod289(vec4 x) {\n  return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 permute(vec4 x) {\n  return mod289(((x*34.0)+10.0)*x);\n}\n\nvec4 taylorInvSqrt(vec4 r)\n{\n  return 1.79284291400159 - 0.85373472095314 * r;\n}\n\nfloat baseNoise(vec3 v)\n{\n  const vec2  C = vec2(1.0/6.0, 1.0/3.0) ;\n  const vec4  D = vec4(0.0, 0.5, 1.0, 2.0);\n\n  // First corner\n  vec3 i  = floor(v + dot(v, C.yyy) );\n  vec3 x0 =   v - i + dot(i, C.xxx) ;\n\n  // Other corners\n  vec3 g = step(x0.yzx, x0.xyz);\n  vec3 l = 1.0 - g;\n  vec3 i1 = min( g.xyz, l.zxy );\n  vec3 i2 = max( g.xyz, l.zxy );\n\n  //   x0 = x0 - 0.0 + 0.0 * C.xxx;\n  //   x1 = x0 - i1  + 1.0 * C.xxx;\n  //   x2 = x0 - i2  + 2.0 * C.xxx;\n  //   x3 = x0 - 1.0 + 3.0 * C.xxx;\n  vec3 x1 = x0 - i1 + C.xxx;\n  vec3 x2 = x0 - i2 + C.yyy; // 2.0*C.x = 1/3 = C.y\n  vec3 x3 = x0 - D.yyy;      // -1.0+3.0*C.x = -0.5 = -D.y\n\n  // Permutations\n  i = mod289(i);\n  vec4 p = permute( permute( permute(\n          i.z + vec4(0.0, i1.z, i2.z, 1.0 ))\n        + i.y + vec4(0.0, i1.y, i2.y, 1.0 ))\n      + i.x + vec4(0.0, i1.x, i2.x, 1.0 ));\n\n  // Gradients: 7x7 points over a square, mapped onto an octahedron.\n  // The ring size 17*17 = 289 is close to a multiple of 49 (49*6 = 294)\n  float n_ = 0.142857142857; // 1.0/7.0\n  vec3  ns = n_ * D.wyz - D.xzx;\n\n  vec4 j = p - 49.0 * floor(p * ns.z * ns.z);  //  mod(p,7*7)\n\n  vec4 x_ = floor(j * ns.z);\n  vec4 y_ = floor(j - 7.0 * x_ );    // mod(j,N)\n\n  vec4 x = x_ *ns.x + ns.yyyy;\n  vec4 y = y_ *ns.x + ns.yyyy;\n  vec4 h = 1.0 - abs(x) - abs(y);\n\n  vec4 b0 = vec4( x.xy, y.xy );\n  vec4 b1 = vec4( x.zw, y.zw );\n\n  //vec4 s0 = vec4(lessThan(b0,0.0))*2.0 - 1.0;\n  //vec4 s1 = vec4(lessThan(b1,0.0))*2.0 - 1.0;\n  vec4 s0 = floor(b0)*2.0 + 1.0;\n  vec4 s1 = floor(b1)*2.0 + 1.0;\n  vec4 sh = -step(h, vec4(0.0));\n\n  vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ;\n  vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ;\n\n  vec3 p0 = vec3(a0.xy,h.x);\n  vec3 p1 = vec3(a0.zw,h.y);\n  vec3 p2 = vec3(a1.xy,h.z);\n  vec3 p3 = vec3(a1.zw,h.w);\n\n  //Normalise gradients\n  vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));\n  p0 *= norm.x;\n  p1 *= norm.y;\n  p2 *= norm.z;\n  p3 *= norm.w;\n\n  // Mix final noise value\n  vec4 m = max(0.5 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0);\n  m = m * m;\n  return 105.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1),\n        dot(p2,x2), dot(p3,x3) ) );\n}\n\nfloat noise(vec3 st, int octaves, float ampFalloff) {\n  float result = 0.0;\n  float amplitude = 1.0;\n  float frequency = 1.0;\n\n  for (int i = 0; i < 8; i++) {\n    if (i >= octaves) break;\n    result += amplitude * baseNoise(st * frequency);\n    frequency *= 2.0;\n    amplitude *= ampFalloff;\n  }\n  return (result + 1.0) * 0.5;\n}\n";let S={OPERATION:"operation",LITERAL:"literal",VARIABLE:"variable",CONSTANT:"constant",STRUCT:"struct",PHI:"phi",STATEMENT:"statement",ASSIGNMENT:"assignment"},F=Object.fromEntries(Object.entries(S).map(([t,r])=>[r,t])),T={[S.OPERATION]:["opCode","dependsOn","dimension","baseType"],[S.LITERAL]:["value","dimension","baseType"],[S.VARIABLE]:["identifier","dimension","baseType"],[S.CONSTANT]:["value","dimension","baseType"],[S.STRUCT]:[""],[S.PHI]:["dependsOn","phiBlocks","dimension","baseType"],[S.STATEMENT]:["statementType"],[S.ASSIGNMENT]:["dependsOn"]},N={DISCARD:"discard",BREAK:"break",EARLY_RETURN:"early_return",EXPRESSION:"expression",EMPTY:"empty"},I={FLOAT:"float",INT:"int",BOOL:"bool",MAT:"mat",DEFER:"defer",ASSIGN_ON_USE:"assign_on_use",SAMPLER2D:"sampler2D",SAMPLER:"sampler"},O={[I.FLOAT]:3,[I.INT]:2,[I.BOOL]:1,[I.MAT]:0,[I.DEFER]:-1,[I.ASSIGN_ON_USE]:-2,[I.SAMPLER2D]:-10,[I.SAMPLER]:-11},k={float1:{fnName:"float",baseType:I.FLOAT,dimension:1,priority:3},float2:{fnName:"vec2",baseType:I.FLOAT,dimension:2,priority:3},float3:{fnName:"vec3",baseType:I.FLOAT,dimension:3,priority:3},float4:{fnName:"vec4",baseType:I.FLOAT,dimension:4,priority:3},int1:{fnName:"int",baseType:I.INT,dimension:1,priority:2},int2:{fnName:"ivec2",baseType:I.INT,dimension:2,priority:2},int3:{fnName:"ivec3",baseType:I.INT,dimension:3,priority:2},int4:{fnName:"ivec4",baseType:I.INT,dimension:4,priority:2},bool1:{fnName:"bool",baseType:I.BOOL,dimension:1,priority:1},bool2:{fnName:"bvec2",baseType:I.BOOL,dimension:2,priority:1},bool3:{fnName:"bvec3",baseType:I.BOOL,dimension:3,priority:1},bool4:{fnName:"bvec4",baseType:I.BOOL,dimension:4,priority:1},mat2:{fnName:"mat2x2",baseType:I.MAT,dimension:2,priority:0},mat3:{fnName:"mat3x3",baseType:I.MAT,dimension:3,priority:0},mat4:{fnName:"mat4x4",baseType:I.MAT,dimension:4,priority:0},defer:{fnName:null,baseType:I.DEFER,dimension:null,priority:-1},assign_on_use:{fnName:null,baseType:I.ASSIGN_ON_USE,dimension:null,priority:-2},sampler2D:{fnName:"sampler2D",baseType:I.SAMPLER2D,dimension:1,priority:-10},sampler:{fnName:"sampler",baseType:I.SAMPLER,dimension:1,priority:-11}},M=function(t){let r=void 0===t.type?t:t.type,n={name:t.name,properties:[],typeName:r.typeName};for(let t of r.properties){let r=t.type.dataType;n.properties.push({name:t.name,dataType:r})}return n};function B(t){return!!(t&&t.properties)}let L={FLOAT:{baseType:I.FLOAT,dimension:null,priority:3},INT:{baseType:I.INT,dimension:null,priority:2},BOOL:{baseType:I.BOOL,dimension:null,priority:1}},R=Object.fromEntries(Object.values(k).filter(t=>null!==t.fnName).map(t=>[t.fnName,t])),P={Binary:{ADD:0,SUBTRACT:1,MULTIPLY:2,DIVIDE:3,MODULO:4,EQUAL:5,NOT_EQUAL:6,GREATER_THAN:7,GREATER_EQUAL:8,LESS_THAN:9,LESS_EQUAL:10,LOGICAL_AND:11,LOGICAL_OR:12,MEMBER_ACCESS:13},Unary:{LOGICAL_NOT:100,NEGATE:101,PLUS:102,SWIZZLE:103},Nary:{FUNCTION_CALL:200,CONSTRUCTOR:201}}
1,z=[{arity:"unary",boolean:!0,name:"not",symbol:"!",opCode:P.Unary.LOGICAL_NOT},{arity:"unary",name:"neg",symbol:"-",opCode:P.Unary.NEGATE},{arity:"unary",name:"plus",symbol:"+",opCode:P.Unary.PLUS},{arity:"binary",name:"add",symbol:"+",opCode:P.Binary.ADD},{arity:"binary",name:"sub",symbol:"-",opCode:P.Binary.SUBTRACT},{arity:"binary",name:"mult",symbol:"*",opCode:P.Binary.MULTIPLY},{arity:"binary",name:"div",symbol:"/",opCode:P.Binary.DIVIDE},{arity:"binary",name:"mod",symbol:"%",opCode:P.Binary.MODULO},{arity:"binary",boolean:!0,name:"equalTo",symbol:"==",opCode:P.Binary.EQUAL},{arity:"binary",boolean:!0,name:"notEqual",symbol:"!=",opCode:P.Binary.NOT_EQUAL},{arity:"binary",boolean:!0,name:"greaterThan",symbol:">",opCode:P.Binary.GREATER_THAN},{arity:"binary",boolean:!0,name:"greaterEqual",symbol:">=",opCode:P.Binary.GREATER_EQUAL},{arity:"binary",boolean:!0,name:"lessThan",symbol:"<",opCode:P.Binary.LESS_THAN},{arity:"binary",boolean:!0,name:"lessEqual",symbol:"<=",opCode:P.Binary.LESS_EQUAL},{arity:"binary",boolean:!0,name:"and",symbol:"&&",opCode:P.Binary.LOGICAL_AND},{arity:"binary",boolean:!0,name:"or",symbol:"||",opCode:P.Binary.LOGICAL_OR}];P.Binary.ADD,P.Binary.SUBTRACT,P.Binary.MULTIPLY,P.Binary.DIVIDE,P.Binary.MODULO,P.Binary.EQUAL,P.Binary.NOT_EQUAL,P.Binary.GREATER_THAN,P.Binary.GREATER_EQUAL,P.Binary.LESS_THAN,P.Binary.LESS_EQUAL,P.Binary.LOGICAL_AND,P.Binary.LOGICAL_OR,(t,r)=>t||r;let U={},$={},j={},V={};for(let{symbol:t,opCode:r,name:n,arity:i,boolean:s}of z)U[r]=t,"unary"===i&&($[t]=n),"binary"===i&&(j[t]=n),s&&(V[r]=!0);let G={GLOBAL:"global",FUNCTION:"function",BRANCH:"branch",IF_COND:"if_cond",IF_BODY:"if_body",ELSE_COND:"else_cond",SCOPE_START:"scope_start",SCOPE_END:"scope_end",FOR:"for",MERGE:"merge",DEFAULT:"default"};function H(t){throw Error(`[p5.strands internal error]: ${t}`)}function q(t,r){throw Error(`[p5.strands ${t}]: ${r}`)}function W(){return{nextID:0,cache:new Map,nodeTypes:[],baseTypes:[],dimensions:[],opCodes:[],values:[],identifiers:[],phiBlocks:[],dependsOn:[],usedBy:[],statementTypes:[],swizzles:[]}}function Z(t={}){let r={nodeType:t.nodeType??null,baseType:t.baseType??null,dimension:t.dimension??null,opCode:t.opCode??null,value:t.value??null,identifier:t.identifier??null,statementType:t.statementType??null,swizzle:t.swizzle??null,dependsOn:Array.isArray(t.dependsOn)?t.dependsOn:[],usedBy:Array.isArray(t.usedBy)?t.usedBy:[],phiBlocks:Array.isArray(t.phiBlocks)?t.phiBlocks:[]};return function(t){let r=t.nodeType,n=T[r];2===n.length&&H(`Required fields for node type '${F[r]}' not defined. Please add them to the utils.js file in p5.strands!`);let i=[];for(let r of n)null===t[r]&&i.push(r);if(t.dependsOn?.some(t=>void 0===t))throw Error("Undefined dependency!");i.length>0&&H(`Missing fields ${i.join(", ")} for a node type '${F[r]}'.`)}(r),r}function X(t,r){return{id:r,nodeType:t.nodeTypes[r],opCode:t.opCodes[r],value:t.values[r],identifier:t.identifiers[r],dependsOn:t.dependsOn[r],usedBy:t.usedBy[r],phiBlocks:t.phiBlocks[r],dimension:t.dimensions[r],baseType:t.baseTypes[r],statementType:t.statementTypes[r],swizzle:t.swizzles[r]}}function Y(t,r){return{baseType:t.baseTypes[r],dimension:t.dimensions[r],priority:O[t.baseTypes[r]]}}function K(t,r,n,i,s=new Set){if(s.has(r))return;s.add(r);let o=X(t,r);if(o.baseType===I.ASSIGN_ON_USE&&(t.baseTypes[r]=n,t.dimensions[r]=i,o.dependsOn&&o.dependsOn.length>0))for(let r of o.dependsOn)X(t,r).baseType===I.ASSIGN_ON_USE&&K(t,r,n,i,s)}function J(t,r){let n=t.nextID++;for(let i of(t.nodeTypes[n]=r.nodeType,t.opCodes[n]=r.opCode,t.values[n]=r.value,t.identifiers[n]=r.identifier,t.dependsOn[n]=r.dependsOn.slice(),t.usedBy[n]=r.usedBy,t.phiBlocks[n]=r.phiBlocks.slice(),t.baseTypes[n]=r.baseType,t.dimensions[n]=r.dimension,t.statementTypes[n]=r.statementType,t.swizzles[n]=r.swizzle,r.dependsOn))Array.isArray(t.usedBy[i])||(t.usedBy[i]=[]),t.usedBy[i].push(n);return n}function Q(){return{blockTypes:[],incomingEdges:[],outgoingEdges:[],blockInstructions:[],nextID:0,blockStack:[],blockOrder:[],blockConditions:{},currentBlock:-1}}function ee(t,r){t.blockStack.push(r),t.blockOrder.push(r),t.currentBlock=r}function et(t){t.blockStack.pop();let r=t.blockStack.length;t.currentBlock=t.blockStack[r-1]}function er(t,r){t.blockStack.push(r),t.currentBlock=r}function en(t,r){let n=t.nextID++;return t.blockTypes[n]=r,t.incomingEdges[n]=[],t.outgoingEdges[n]=[],t.blockInstructions[n]=[],n}function ei(t,r,n){t.outgoingEdges[r].push(n),t.incomingEdges[n].push(r)}function es(t,r,n){void 0===n&&H("undefined nodeID in `recordInBasicBlock()`"),void 0===r&&H("undefined blockID in `recordInBasicBlock()"),t.blockInstructions[r]=t.blockInstructions[r]||[],t.blockInstructions[r].push(n)}Object.fromEntries(Object.entries(G).map(([t,r])=>[r,t]));let eo={...{acos:[{params:[L.FLOAT],returnType:L.FLOAT,isp5Function:!0}],acosh:[{params:[L.FLOAT],returnType:L.FLOAT,isp5Function:!1}],asin:[{params:[L.FLOAT],returnType:L.FLOAT,isp5Function:!0}],asinh:[{params:[L.FLOAT],returnType:L.FLOAT,isp5Function:!1}],atan:[{params:[L.FLOAT],returnType:L.FLOAT,isp5Function:!0}
1,{params:[L.FLOAT,L.FLOAT],returnType:L.FLOAT,isp5Function:!0}],atanh:[{params:[L.FLOAT],returnType:L.FLOAT,isp5Function:!1}],cos:[{params:[L.FLOAT],returnType:L.FLOAT,isp5Function:!0}],cosh:[{params:[L.FLOAT],returnType:L.FLOAT,isp5Function:!1}],degrees:[{params:[L.FLOAT],returnType:L.FLOAT,isp5Function:!0}],radians:[{params:[L.FLOAT],returnType:L.FLOAT,isp5Function:!0}],sin:[{params:[L.FLOAT],returnType:L.FLOAT,isp5Function:!0}],sinh:[{params:[L.FLOAT],returnType:L.FLOAT,isp5Function:!1}],tan:[{params:[L.FLOAT],returnType:L.FLOAT,isp5Function:!0}],tanh:[{params:[L.FLOAT],returnType:L.FLOAT,isp5Function:!1}],abs:[{params:[L.FLOAT],returnType:L.FLOAT,isp5Function:!0},{params:[L.FLOAT],returnType:L.INT,isp5Function:!0}],ceil:[{params:[L.FLOAT],returnType:L.FLOAT,isp5Function:!0}],clamp:[{params:[L.FLOAT,L.FLOAT,L.FLOAT],returnType:L.FLOAT,isp5Function:!1},{params:[L.FLOAT,k.float1,k.float1],returnType:L.FLOAT,isp5Function:!1},{params:[L.INT,L.INT,L.INT],returnType:L.INT,isp5Function:!1},{params:[L.INT,k.int1,k.int1],returnType:L.INT,isp5Function:!1}],dFdx:[{params:[L.FLOAT],returnType:L.FLOAT,isp5Function:!1}],dFdy:[{params:[L.FLOAT],returnType:L.FLOAT,isp5Function:!1}],exp:[{params:[L.FLOAT],returnType:L.FLOAT,isp5Function:!0}],exp2:[{params:[L.FLOAT],returnType:L.FLOAT,isp5Function:!1}],floor:[{params:[L.FLOAT],returnType:L.FLOAT,isp5Function:!0}],fma:[{params:[L.FLOAT,L.FLOAT,L.FLOAT],returnType:L.FLOAT,isp5Function:!1}],fract:[{params:[L.FLOAT],returnType:L.FLOAT,isp5Function:!0}],fwidth:[{params:[L.FLOAT],returnType:L.FLOAT,isp5Function:!1}],inversesqrt:[{params:[L.FLOAT],returnType:L.FLOAT,isp5Function:!0}],log:[{params:[L.FLOAT],returnType:L.FLOAT,isp5Function:!0}],log2:[{params:[L.FLOAT],returnType:L.FLOAT,isp5Function:!1}],max:[{params:[L.FLOAT,L.FLOAT],returnType:L.FLOAT,isp5Function:!0},{params:[L.FLOAT,k.float1],returnType:L.FLOAT,isp5Function:!0},{params:[L.INT,L.INT],returnType:L.INT,isp5Function:!0},{params:[L.INT,k.int1],returnType:L.INT,isp5Function:!0}],min:[{params:[L.FLOAT,L.FLOAT],returnType:L.FLOAT,isp5Function:!0},{params:[L.FLOAT,k.float1],returnType:L.FLOAT,isp5Function:!0},{params:[L.INT,L.INT],returnType:L.INT,isp5Function:!0},{params:[L.INT,k.int1],returnType:L.INT,isp5Function:!0}],mix:[{params:[L.FLOAT,L.FLOAT,L.FLOAT],returnType:L.FLOAT,isp5Function:!1},{params:[L.FLOAT,L.FLOAT,k.float1],returnType:L.FLOAT,isp5Function:!1},{params:[L.FLOAT,L.FLOAT,L.BOOL],returnType:L.FLOAT,isp5Function:!1}],mod:[{params:[L.FLOAT,L.FLOAT],returnType:L.FLOAT,isp5Function:!0},{params:[L.FLOAT,k.float1],returnType:L.FLOAT,isp5Function:!0}],pow:[{params:[L.FLOAT,L.FLOAT],returnType:L.FLOAT,isp5Function:!0}],round:[{params:[L.FLOAT],returnType:L.FLOAT,isp5Function:!0}],roundEven:[{params:[L.FLOAT],returnType:L.FLOAT,isp5Function:!1}],sign:[{params:[L.FLOAT],returnType:L.FLOAT,isp5Function:!1},{params:[L.INT],returnType:L.INT,isp5Function:!1}],smoothstep:[{params:[L.FLOAT,L.FLOAT,L.FLOAT],returnType:L.FLOAT,isp5Function:!1},{params:[k.float1,k.float1,L.FLOAT],returnType:L.FLOAT,isp5Function:!1}],sqrt:[{params:[L.FLOAT],returnType:L.FLOAT,isp5Function:!0}],step:[{params:[L.FLOAT,L.FLOAT],returnType:L.FLOAT,isp5Function:!1}],trunc:[{params:[L.FLOAT],returnType:L.FLOAT,isp5Function:!1}],cross:[{params:[k.float3,k.float3],returnType:k.float3,isp5Function:!0}],distance:[{params:[L.FLOAT,L.FLOAT],returnType:k.float1,isp5Function:!0}],dot:[{params:[L.FLOAT,L.FLOAT],returnType:k.float1,isp5Function:!0}],equal:[{params:[L.FLOAT,L.FLOAT],returnType:L.BOOL,isp5Function:!1},{params:[L.INT,L.INT],returnType:L.BOOL,isp5Function:!1},{params:[L.BOOL,L.BOOL],returnType:L.BOOL,isp5Function:!1}],faceforward:[{params:[L.FLOAT,L.FLOAT,L.FLOAT],returnType:L.FLOAT,isp5Function:!1}],length:[{params:[L.FLOAT],returnType:k.float1,isp5Function:!1}],normalize:[{params:[L.FLOAT],returnType:L.FLOAT,isp5Function:!0}],notEqual:[{params:[L.FLOAT,L.FLOAT],returnType:L.BOOL,isp5Function:!1},{params:[L.INT,L.INT],returnType:L.BOOL,isp5Function:!1},{params:[L.BOOL,L.BOOL],returnType:L.BOOL,isp5Function:!1}],reflect:[{params:[L.FLOAT,L.FLOAT],returnType:L.FLOAT,isp5Function:!1}
1],refract:[{params:[L.FLOAT,L.FLOAT,k.float1],returnType:L.FLOAT,isp5Function:!1}]}};class ea{constructor(t,r,n){this.id=t,this.strandsContext=n,this.dimension=r,this.structProperties=null,this.isStrandsNode=!0;let i=X(this.strandsContext.dag,this.id);i&&i.identifier&&(this._originalIdentifier=i.identifier),i&&(this._originalBaseType=i.baseType,this._originalDimension=i.dimension)}withStructProperties(t){return this.structProperties=t,this}copy(){return el(this.id,this.dimension,this.strandsContext)}typeInfo(){return{baseType:this._originalBaseType||I.FLOAT,dimension:this.dimension}}bridge(t){let r,{dag:n,cfg:i}=this.strandsContext,s=X(n,this.id),o=s?.baseType??I.FLOAT;if(r=t?.isStrandsNode?t.id:ef(this.strandsContext,{baseType:o,dimension:this.dimension},t).id,this._originalIdentifier){let{id:t}=eh(this.strandsContext,{baseType:this._originalBaseType,dimension:this._originalDimension},this._originalIdentifier),s=J(n,Z({nodeType:S.ASSIGNMENT,dependsOn:[t,r],phiBlocks:[]}));es(i,i.currentBlock,s);let o=J(n,Z({nodeType:S.VARIABLE,baseType:this._originalBaseType,dimension:this._originalDimension,identifier:this._originalIdentifier}));this.id=o}else this.id=r;return this}bridgeSwizzle(t,r){let n,{dag:i,cfg:s}=this.strandsContext,o=X(i,this.id),a=o?.baseType??I.FLOAT;if(n=r?.isStrandsNode?r.id:ef(this.strandsContext,{baseType:a,dimension:this.dimension},r).id,this._originalIdentifier){let{id:r}=eh(this.strandsContext,{baseType:this._originalBaseType,dimension:this._originalDimension},this._originalIdentifier),o=J(i,Z({nodeType:S.OPERATION,opCode:P.Unary.SWIZZLE,baseType:this._originalBaseType,dimension:t.length,swizzle:t,dependsOn:[r]})),a=J(i,Z({nodeType:S.ASSIGNMENT,dependsOn:[o,n],phiBlocks:[]}));es(s,s.currentBlock,a);let l=J(i,Z({nodeType:S.VARIABLE,baseType:this._originalBaseType,dimension:this._originalDimension,identifier:this._originalIdentifier}));this.id=l}else this.id=n;return this}getValue(){if(this._originalIdentifier){let{id:t,dimension:r}=eh(this.strandsContext,{baseType:this._originalBaseType,dimension:this._originalDimension},this._originalIdentifier);return el(t,r,this.strandsContext)}return this}}function el(t,r,n,i){return new Proxy(new ea(t,r,n),function(t,r,n,i){let s=[["x","y","z","w"],["r","g","b","a"],["s","t","p","q"]].map(t=>t.slice(0,r));return{get(t,r,i){if(r in t)return Reflect.get(...arguments);for(let i of s)if([...r.toString()].every(t=>i.includes(t))){let o=ey(n,t,[...r].map(t=>{let r=i.indexOf(t);return s[0][r]}).join(""));return el(o.id,o.dimension,n)}},set(t,r,o,a){for(let a of s){let s=[...r];if(!(s.every(t=>a.includes(t))&&new Set(s).size===s.length&&t.dimension>=s.length))continue;let l=t.dimension,u=Array(l);for(let r=0;r<l;r++){let{id:i,dimension:s}=ey(n,t,"xyzw"[r]);u[r]=el(i,s,n)}let h=[];if(o?.isStrandsNode)if(1===o.dimension)h=Array(s.length).fill(o);else if(o.dimension===s.length)for(let t=0;t<s.length;t++){let{id:r,dimension:i}=ey(n,o,"xyzw"[t]);h.push(el(r,i,n))}else q("type error",`Swizzle assignment: RHS vector does not match LHS vector (need ${s.length}, got ${o.dimension}).`);else if(Array.isArray(o)){let t=o.flat(1/0);1===t.length?h=Array(s.length).fill(t[0]):t.length===s.length?h=t:q("type error",`Swizzle assignment: RHS length ${t.length} does not match ${s.length}.`)}else"number"==typeof o?h=Array(s.length).fill(o):q("type error",`Unsupported RHS for swizzle assignment: ${o}`);for(let t=0;t<s.length;t++)u[a.indexOf(s[t])]=h[t];let c=X(n.dag,t.id),{id:d}=ef(n,{baseType:c?.baseType??I.FLOAT,dimension:l},u);return t.id=d,"function"==typeof i&&i(d),!0}return Reflect.set(...arguments)}}}(0,r,n,i))}function eu(t,r,n){let{cfg:i,dag:s}=t,{dimension:o,baseType:a}=r;1!==o&&H("Created a scalar literal node with dimension > 1.");let l=J(s,Z({nodeType:S.LITERAL,dimension:o,baseType:a,value:n}));return es(i,i.currentBlock,l),{id:l,dimension:o}}function eh(t,r,n){let{cfg:i,dag:s}=t,{dimension:o,baseType:a}=r,l=J(s,Z({nodeType:S.VARIABLE,dimension:o,baseType:a,identifier:n}));return es(i,i.currentBlock,l),{id:l,dimension:o}}function ec(t,r,n,i){let{cfg:s,dag:o}=t;if(0===i.length)for(let t of r.properties){let r=t.dataType,a=J(o,Z({nodeType:S.VARIABLE,baseType:r.baseType,dimension:r.dimension,identifier:`${n}.${t.name}`}));es(s,s.currentBlock,a),i.push(a)}let a=J(o,Z({nodeType:S.VARIABLE,dimension:r.properties.length,baseType:r.typeName,identifier:n,dependsOn:i}));return es(s,s.currentBlock,a),{id:a,dimension:0,components:i}}function ed(t,r,n){let i=Array.isArray(n)?n:[n],s=[],{dimension:o,baseType:a}=r,l=t.dag,u=0,h=null;for(let r of i.flat(1/0))if(r&&r.isStrandsNode){let t=X(l,r.id);if(h=r.id,a=t.baseType,t.opCode===P.Nary.CONSTRUCTOR)for(let r of t.depen
1dsOn)s.push(r);else s.push(r.id);u+=t.dimension;continue}else if("number"==typeof r){let{id:n,dimension:i}=eu(t,{dimension:1,baseType:a},r);s.push(n),u+=i;continue}else if("boolean"==typeof r){let{id:n,dimension:i}=eu(t,{dimension:1,baseType:I.BOOL},r);s.push(n),u+=i,a!==I.BOOL&&(a=I.BOOL);continue}else q("type error",`You've tried to construct a scalar or vector type with a non-numeric value: ${r}`);return null===o?o=u:o>u&&1===u?u=o:1!==u&&u!==o&&q("type error",`You've tried to construct a ${a+o} with ${u} components`),{originalNodeID:h,mappedDependencies:s,inferredTypeInfo:{dimension:o,baseType:a,priority:O[a]}}}function ep(t,r,n){let i=Z({nodeType:S.OPERATION,opCode:P.Nary.CONSTRUCTOR,dimension:r.dimension,baseType:r.baseType,dependsOn:n});return J(t.dag,i)}function ef(t,r,n){let i=t.cfg;n=(Array.isArray(n)?n:[n]).flat(1/0).map(r=>r.isStrandsNode&&r.typeInfo().baseType===I.INT&&1===r.typeInfo().dimension?function(t,r){let{id:n,dimension:i}=em(t,t.backend.getTypeName("float",r.typeInfo().dimension),[r],{overloads:[{params:[r.typeInfo()],returnType:{...r.typeInfo(),baseType:I.FLOAT}}]});return el(n,i,t)}(t,r):r);let{mappedDependencies:s,inferredTypeInfo:o}=ed(t,r,n),a={baseType:o.baseType===I.BOOL?I.BOOL:r.baseType,dimension:o.dimension},l=ep(t,a,s);return r.baseType!==I.DEFER&&es(i,i.currentBlock,l),{id:l,dimension:a.dimension,components:s}}function em(t,r,n,{overloads:i}={}){let{cfg:s,dag:o}=t,a=i||eo[r],l=n.map(r=>ed(t,k.defer,r)),u=a.filter(t=>t.params.length===l.length);if(0===u.length){let t=new Set,n=[];a.forEach(r=>t.add(r.params.length)),t.forEach(t=>n.push(`${t}`));let i=n.join(", or ");q("parameter validation error",`Function '${r}' has ${a.length} variants which expect ${i} arguments, but ${l.length} arguments were provided.`)}let h=t=>null===t.dimension,c=null,d=0,p=null,f=null;for(let t of u){let r=!0,n=0;for(let i=0;i<l.length;i++){let s=l[i].inferredTypeInfo,o=t.params[i],a=o.dimension;h(o)?((null===f||1===f)&&(f=s.dimension),f===s.dimension||1===s.dimension&&f>=1||(r=!1),a=f):s.dimension>a&&(r=!1),s.baseType===o.baseType?n+=2:o.priority>s.priority&&(n+=1)}r&&(!c||n>d)&&(c=t,d=n,h(p={...t.returnType})&&(p.dimension=f))}null===c&&q("parameter validation",`No matching overload for ${r} was found!`);let m=[];for(let r=0;r<c.params.length;r++){var g;let n=l[r],i={...c.params[r]};if(h(i)&&(i.dimension=f),n.originalNodeID&&(g=n.inferredTypeInfo,g.dimension===i.dimension&&g.baseType===i.baseType))m.push(n.originalNodeID);else{let r=ep(t,i,n.mappedDependencies);es(s,s.currentBlock,r),m.push(r)}}let y=J(o,Z({nodeType:S.OPERATION,opCode:P.Nary.FUNCTION_CALL,identifier:r,dependsOn:m,baseType:p.baseType,dimension:p.dimension}));return es(s,s.currentBlock,y),{id:y,dimension:p.dimension}}function eg(t,r){let{dag:n,cfg:i}=t,s=J(n,Z({nodeType:S.STATEMENT,statementType:r}));return es(i,i.currentBlock,s),s}function ey(t,r,n){let{dag:i,cfg:s}=t,o=i.baseTypes[r.id],a=J(i,Z({nodeType:S.OPERATION,baseType:o,dimension:n.length,opCode:P.Unary.SWIZZLE,dependsOn:[r.id],swizzle:n}));return es(s,s.currentBlock,a),{id:a,dimension:n.length}}function ev(t,r){return t.nodeTypes[r]===S.OPERATION&&t.baseTypes[r]!==I.SAMPLER2D&&(t.usedBy[r]||[]).length>1}let eb={float1:"float",float2:"vec2",float3:"vec3",float4:"vec4",int1:"int",int2:"ivec2",int3:"ivec3",int4:"ivec4",bool1:"bool",bool2:"bvec2",bool3:"bvec3",bool4:"bvec4",mat2:"mat2x2",mat3:"mat3x3",mat4:"mat4x4"},ex={[G.DEFAULT]:(t,r,n)=>{let{dag:i,cfg:s}=r;for(let r of s.blockInstructions[t]||[]){let t=i.nodeTypes[r];if(ev(i,r)){let t=e_.generateDeclaration(n,i,r);n.write(t)}t===S.STATEMENT&&e_.generateStatement(n,i,r),t===S.ASSIGNMENT&&(e_.generateAssignment(n,i,r),n.visitedNodes.add(r))}},[G.BRANCH](t,r,n){let{dag:i,cfg:s}=r;for(let r of s.blockInstructions[t]||[]){let t=X(i,r);if(t.nodeType===S.PHI){let s=t.dependsOn||[];if(s.length>0){let t=s[0],i=n.tempNames[t];if(i){n.tempNames[r]=i;continue}}let o=`T${n.nextTempID++}`;n.tempNames[r]=o;let a=Y(i,r),l=e_.getTypeName(a.baseType,a.dimension);n.write(`${l} ${o};`)}}this[G.DEFAULT](t,r,n)},[G.IF_COND](t,r,n){let{dag:i,cfg:s}=r,o=s.blockConditions[t],a=e_.generateExpression(n,i,o);n.write(`if (${a})`),this[G.DEFAULT](t,r,n)},[G.ELSE_COND](t,r,n){n.write("else"),this[G.DEFAULT](t,r,n)},[G.IF_BODY](t,r,n){this[G.DEFAULT](t,r,n),this.assignPhiNodeValues(t,r,n)},[G.SCOPE_START](t,r,n){n.write("{"),n.indent++},[G.SCOPE_END](t,r,n){n.indent--,n.write("}")},[G.MERGE](t,r,n){this[G.DEFAULT](t,r,n)},[G.FUNCTION](t,r,n){this[G.DEFAULT](t,r,n)},[G.FOR](t,r,n){let{dag:i,cfg:s}=r,o=s.blockInstructions[t]||[];n.write("for (");let a=n.suppressSemicolon;for(let t=0;t<o.length;t++){let r=o[t],s=X(i,r);if(n.suppressSemicolon=t===o.length-1,ev(i,r)){let t=e_.generateDeclaration(n,i,r);n.write(t)}
1s.nodeType===S.STATEMENT&&e_.generateStatement(n,i,r),s.nodeType===S.ASSIGNMENT&&(e_.generateAssignment(n,i,r),n.visitedNodes.add(r))}n.suppressSemicolon=a,n.write(")")},assignPhiNodeValues(t,r,n){let{dag:i,cfg:s}=r;for(let r of s.outgoingEdges[t]||[])for(let o of s.blockInstructions[r]||[]){let r=X(i,o);if(r.nodeType===S.PHI){let s=r.phiBlocks?.indexOf(t);if(-1!==s&&s<r.dependsOn.length){let t=r.dependsOn[s],a=n.tempNames[o];if(a&&null!==t){let r=e_.generateExpression(n,i,t);n.write(`${a} = ${r};`)}}}}}},e_={hookEntry:t=>`(${t.parameters.flatMap(t=>`${t.qualifiers?.length?t.qualifiers.join(" "):""}${t.type.typeName} ${t.name}`).join(", ")}) {`,getTypeName(t,r){let n=eb[t+r];return n||t},generateHookUniformKey(t,r){return`${this.getTypeName(r.baseType,r.dimension)} ${t}`},generateVaryingVariable:(t,r)=>`${r.fnName} ${t}`,generateLocalDeclaration(t,r){let n=r.fnName;return`${n} ${t};`},generateStatement(t,r,n){let i=X(r,n),s=t.suppressSemicolon?"":";";if(i.statementType===N.DISCARD)t.write(`discard${s}`);else if(i.statementType===N.BREAK)t.write(`break${s}`);else if(i.statementType===N.EXPRESSION){let n=i.dependsOn[0],o=this.generateExpression(t,r,n);t.write(`${o}${s}`)}else if(i.statementType===N.EMPTY)t.write(s);else if(i.statementType===N.EARLY_RETURN){let n=i.dependsOn[0],o=this.generateExpression(t,r,n);t.write(`return ${o}${s}`)}},generateAssignment(t,r,n){let i=X(r,n),s=i.dependsOn[0],o=i.dependsOn[1],a=this.generateExpression(t,r,s),l=this.generateExpression(t,r,o),u=t.suppressSemicolon?"":";";a&&l&&a!==l&&t.write(`${a} = ${l}${u}`)},generateDeclaration(t,r,n){let i=this.generateExpression(t,r,n),s=`T${t.nextTempID++}`;t.tempNames[n]=s;let o=Y(r,n),a=this.getTypeName(o.baseType,o.dimension);return`${a} ${s} = ${i};`}
1,generateReturnStatement(t,r,n,i){let s=t.dag,o=X(s,n);if(B(i))for(let t=0;t<i.properties.length;t++){let n=i.properties[t],a=this.generateExpression(r,s,o.dependsOn[t]);n.name!==a&&r.write(`${o.identifier}.${n.name} = ${a};`)}r.write(`return ${this.generateExpression(r,s,n)};`)},generateExpression(t,r,n){let i=X(r,n);if(t.tempNames?.[n])return t.tempNames[n];switch(i.nodeType){case S.LITERAL:if(i.baseType===I.FLOAT)return i.value.toFixed(4);return i.value;case S.VARIABLE:if(t.shaderContext&&t.strandsContext?.sharedVariables?.has(i.identifier)){let r=t.strandsContext.sharedVariables.get(i.identifier);"vertex"===t.shaderContext?r.usedInVertex=!0:"fragment"===t.shaderContext&&(r.usedInFragment=!0)}return i.identifier;case S.OPERATION:let s=i.usedBy.length>0;if(i.opCode===P.Nary.CONSTRUCTOR){if(i.baseType===I.SAMPLER2D)return this.generateExpression(t,r,i.dependsOn[0]);let n=this.getTypeName(i.baseType,i.dimension),s=i.dependsOn.map(n=>this.generateExpression(t,r,n));return`${n}(${s.join(", ")})`}if(i.opCode===P.Nary.FUNCTION_CALL){let n=i.dependsOn.map(n=>this.generateExpression(t,r,n));return`${i.identifier}(${n.join(", ")})`}if(i.opCode===P.Binary.MEMBER_ACCESS){let[n,s]=i.dependsOn,o=this.generateExpression(t,r,n),a=this.generateExpression(t,r,s);return`${o}.${a}`}if(i.opCode===P.Unary.SWIZZLE){let n=i.dependsOn[0],s=this.generateExpression(t,r,n);return`${s}.${i.swizzle}`}if(2===i.dependsOn.length){let[n,o]=i.dependsOn,a=this.generateExpression(t,r,n),l=this.generateExpression(t,r,o);if(i.opCode===P.Binary.MODULO){let t=X(r,n),i=X(r,o);if(t.baseType===I.FLOAT||i.baseType===I.FLOAT)return`mod(${a}, ${l})`;return`(${a} % ${l})`}let u=U[i.opCode];if(s)return`(${a} ${u} ${l})`;return`${a} ${u} ${l}`}if(i.opCode===P.Unary.LOGICAL_NOT||i.opCode===P.Unary.NEGATE||i.opCode===P.Unary.PLUS){let[n]=i.dependsOn,s=this.generateExpression(t,r,n),o=U[i.opCode];return`${o}${s}`}case S.PHI:if(i.identifier)return i.identifier;if(t.tempNames?.[n])return t.tempNames[n];{let n=i.dependsOn.filter(t=>null!==t);if(n.length>0)return this.generateExpression(t,r,n[0]);throw Error("No valid inputs for node")}case S.ASSIGNMENT:H("ASSIGNMENT nodes should not be used as expressions");default:H(`${F[i.nodeType]} code generation not implemented yet`)}},generateBlock(t,r,n){(ex[r.cfg.blockTypes[t]]||ex[G.DEFAULT]).call(ex,t,r,n)},createGetTextureCall(t,r){let{id:n,dimension:i}=em(t,"getTexture",r,{overloads:[{params:[k.sampler2D,k.float2],returnType:k.float4}]});return{id:n,dimension:i}},instanceIdReference:()=>"gl_InstanceID"};function eA(t,r){let n=t._vertSrc,i=t.hooks.vertex[r];if(i||(i=t.hooks.fragment[r],n=t._fragSrc),!i)throw Error(`Can't find hook ${r}!`);let s=r.split(/\s+/g),o=s.pop(),a=s.pop(),l=[...s],u=/\(([^\)]*)\)/.exec(i);if(!u)throw Error(`Couldn't find function parameters in hook body:
2${i}`);let h=t=>{let r=RegExp(`struct\\s+${t}\\s*{([^}]*)}`).exec(n);if(!r)return;let i=[];for(let t of r[1].split(";")){let r=t.trim().split(/\s+|,/g),n=r.shift(),s=[...r],o=h(n);for(let t of s){let r=R[n]||null;i.push({name:t,type:{typeName:n,qualifiers:[],properties:o,dataType:r}})}}return i},c=u[1].split(",").map(t=>{let r=t.trim().split(/\s+/g),n=r.pop(),i=r.pop(),s=[...r],o=h(i),a=R[i]||null;return{name:n,type:{typeName:i,qualifiers:s,properties:o,dataType:a}}}),d=R[a]||null;return{name:o,returnType:{typeName:a,qualifiers:l,properties:h(a),dataType:d},parameters:c}}var eE=n(29998);n(17035);var eC=n(59748),eD=n(6439),ew=n(58093);n(95115);var eS=n(47689),eF=n(51032),eT=n(170),eN=n(31586);n(64665),n(82741);var eI=n(29777);n(7307),n(97679);var eO=n(81273),ek=n(43327),eM=n(39247);n(10726);var eB=n(75671),eL=n(43140),eR=n(54964);n(88124),n(41157);var eP=n(83301),ez=n(70878),eU=n(65411),e$=n(75386),ej=n(96898);class eV{constructor(t){this.parentRenderer=t,this.canvas=document.createElement("canvas"),this.canvas.width=t.width,this.canvas.height=t.height;let r=d.aa;if(this.gl=this.canvas.getContext("webgl2"),this.gl||(r=d.ac,this.gl=this.canvas.getContext("webgl")),!this.gl)return void console.error("WebGL not supported, cannot apply filter.");this.textures=new Map,this._renderer={GL:this.gl,registerEnabled:new Set,_curShader:null,_emptyTexture:null,webglVersion:r,states:{textureWrapX:d.C,textureWrapY:d.C},_arraysEqual:(t,r)=>JSON.stringify(t)===JSON.stringify(r),_getEmptyTexture:()=>{if(!this._emptyTexture){let t=new y.I(1,1);t.set(0,0,255),this._emptyTexture=new g.T(this._renderer,t)}return this._emptyTexture},_initShader:t=>{let r=this.gl,n=r.createShader(r.VERTEX_SHADER);if(r.shaderSource(n,t.vertSrc()),r.compileShader(n),!r.getShaderParameter(n,r.COMPILE_STATUS))throw Error(`Yike
2s! An error occurred compiling the vertex shader: ${r.getShaderInfoLog(n)}`);let i=r.createShader(r.FRAGMENT_SHADER);if(r.shaderSource(i,t.fragSrc()),r.compileShader(i),!r.getShaderParameter(i,r.COMPILE_STATUS))throw Error(`Darn! An error occurred compiling the fragment shader: ${r.getShaderInfoLog(i)}`);let s=r.createProgram();if(r.attachShader(s,n),r.attachShader(s,i),r.linkProgram(s),!r.getProgramParameter(s,r.LINK_STATUS))throw Error(`Snap! Error linking shader program: ${r.getProgramInfoLog(s)}`);t._glProgram=s,t._vertShader=n,t._fragShader=i},getTexture:t=>{let r=t;r instanceof Framebuffer&&(r=r.color);let n=this.textures.get(r);if(n)return n;let i=new g.T(this._renderer,r);return this.textures.set(r,i),i},populateHooks:(t,r,n)=>(0,g.j)(t,r,n),_getShaderAttributes:t=>(0,g.h)(t,this.gl),getUniformMetadata:t=>(0,g.g)(t,this.gl),_finalizeShader:()=>{},_useShader:t=>{this.gl.useProgram(t._glProgram)},bindTexture:t=>{this.gl.bindTexture(this.gl.TEXTURE_2D,t.getTexture().texture)},unbindTexture:()=>{this.gl.bindTexture(this.gl.TEXTURE_2D,null)},_unbindFramebufferTexture:t=>{let r=this.gl,n=this._getEmptyTexture();r.activeTexture(r.TEXTURE0+t.samplerIndex),n.bindTexture(),r.uniform1i(t.location,t.samplerIndex)},createTexture:({width:t,height:r,format:n,dataType:i})=>{let s=this.gl,o=s.createTexture();return s.bindTexture(s.TEXTURE_2D,o),s.texImage2D(s.TEXTURE_2D,0,s.RGBA,t,r,0,s.RGBA,s.UNSIGNED_BYTE,null),{texture:o,glFormat:s.RGBA,glDataType:s.UNSIGNED_BYTE}},uploadTextureFromSource:({texture:t,glFormat:r,glDataType:n},i)=>{let s=this.gl;s.bindTexture(s.TEXTURE_2D,t),s.texImage2D(s.TEXTURE_2D,0,r,r,n,i)},uploadTextureFromData:({texture:t,glFormat:r,glDataType:n},i,s,o)=>{let a=this.gl;a.bindTexture(a.TEXTURE_2D,t),a.texImage2D(a.TEXTURE_2D,0,r,s,o,0,r,n,i)},setTextureParams:t=>(0,g.e)(t,this.gl,this._renderer.webglVersion),updateUniformValue:(t,r,n)=>(0,g.s)(t,r,n,t=>this._renderer.getTexture(t),this.gl),_enableAttrib:(t,r,n,i,s,o,a)=>{let l=r.location,u=this.gl;this._renderer.registerEnabled.has(l)||(u.enableVertexAttribArray(l),this._renderer.registerEnabled.add(l)),u.vertexAttribPointer(l,n,i||u.FLOAT,s||!1,o||0,a||0)},_disableRemainingAttributes:t=>{for(let r of this._renderer.registerEnabled.values())Object.keys(t.attributes).some(n=>t.attributes[n].location===r)||(this.gl.disableVertexAttribArray(r),this._renderer.registerEnabled.delete(r))},_updateTexture:(t,r)=>{let n=this.gl;n.activeTexture(n.TEXTURE0+t.samplerIndex),r.bindTexture(),r.update(),n.uniform1i(t.location,t.samplerIndex)},baseFilterShader:()=>this.baseFilterShader(),strandsBackend:e_,getShaderHookTypes:(t,r)=>eA(t,r),uniformNameFromHookKey:t=>t.slice(t.indexOf(" ")+1)},this._baseFilterShader=void 0,this.filterShaders={},this.operation=null,this.filterParameter=1,this.customShader=null,this._shader=null,this.vertexBuffer=this.gl.createBuffer(),this.texcoordBuffer=this.gl.createBuffer(),this.vertices=new Float32Array([-1,-1,1,-1,-1,1,1,1]),this.texcoords=new Float32Array([0,1,1,1,0,0,1,0]),this._bindBufferData(this.vertexBuffer,this.gl.ARRAY_BUFFER,this.vertices),this._bindBufferData(this.texcoordBuffer,this.gl.ARRAY_BUFFER,this.texcoords)}_webGL2CompatibilityPrefix(t,r){let n="";return this._renderer.webglVersion===d.aa&&(n+="#version 300 es\n#define WEBGL2\n"),"vert"===t?n+="#define VERTEX_SHADER\n":"frag"===t&&(n+="#define FRAGMENT_SHADER\n"),r&&(n+=`precision ${r} float;
3`),n}baseFilterShader(){return this._baseFilterShader||(this._baseFilterShader=new _.M(this._renderer,this._webGL2CompatibilityPrefix("vert","highp")+D+C,this._webGL2CompatibilityPrefix("frag","highp")+D+E,{vertex:{},fragment:{"vec4 getColor":`(FilterInputs inputs, in sampler2D canvasContent) {
4              return getTexture(canvasContent, inputs.texCoord);
5            }`}})),this._baseFilterShader}getNoiseShaderSnippet(){return w}setOperation(t,r,n=null){this.operation=t,this.filterParameter=r,t in A.k&&void 0===r&&(this.filterParameter=A.k[t]),this.customShader=n,this._initializeShader()}_initializeShader(){if(this.customShader){this._shader=this.customShader;return}if(!this.operation)return void console.error("No operation set for FilterRenderer2D, cannot initialize shader.");if(this.filterShaders[this.operation]){this._shader=this.filterShaders[this.operation];return}let t=(0,eE.C)(this._renderer,this.operation,this.parentRenderer._pInst);this.filterShaders[this.operation]=t,this._shader=t}_bindBufferData(t,r,n){let i=this.gl;i.bindBuffer(r,t),i.bufferData(r,n,i.STATIC_DRAW)}get canvasTexture(){return this._canvasTexture||(this._canvasTexture=new g.T(this._renderer,this.parentRenderer.wrappedElt)),this._canvasTexture}_renderPass(){let t=this.gl;this._shader.bindShader("fill");let r=this.parentRenderer.pixelDensity?this.parentRenderer.pixelDensity():1,n=[1/(this.parentRenderer.width*r),1/(this.parentRenderer.height*r)],i=this.canvasTexture;this._shader.setUniform("tex0",i),this._shader.setUniform("texelSize",n),this._shader.setUniform("canvasSize",[this.parentRenderer.width,this.parentRenderer.height]),this._shader.setUniform("radius",Math.max(1,this.filterParameter)),this._shader.setUniform("filterParameter",this.filterParameter),this._shader.setDefaultUniforms(),this.parentRenderer.states.setValue("rectMode",d.p),this.parentRenderer.states.setValue("imageMode",d.p),this.parentRenderer.blendMode(d.B),this.parentRenderer.resetMatrix();let s=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];this._shader.setUniform("uModelViewMatrix",s),this._shader.setUniform("uProjectionMatrix",s),t.bindBuffer(t.ARRAY_BUFFER,this.vertexBuffer),this._shader.enableAttrib(this._shader.attributes.aPosition,2),t.bindBuffer(t.ARRAY_BUFFER,this.texcoordBuffer),this._shader.enableAttrib(this._shader.attributes.aTexCoord,2),this._shader.bindTextures(),this._renderer._disableRemainingAttributes(this._shader),t.drawArrays(t.TRIANGLE_STRIP,0,4),this._shader.unbindShader()}applyFilter(){if(!this._shader)return void console.error("Cannot apply filter: shader not initialized.");this.parentRenderer.push(),this.parentRenderer.resetMatrix(),this.operation!==d.ab||this.customShader?(this._renderPass(),this.parentRenderer.clear(),this.parentRenderer.blendMode(d.B)):(this._shader.setUniform("direction",[1,0]),this._renderPass(),this.parentRenderer.clear(),this.parentRenderer.drawingContext.drawImage(this.canvas,0,0,this.parentRenderer.width,this.parentRenderer.height),this._shader.setUniform("direction",[0,1]),this._renderPass(),this.parentRenderer.clear()),this.parentRenderer.drawingContext.drawImage(this.canvas,0,0,this.parentRenderer.width,this.parentRenderer.height),this.parentRenderer.pop()}}let eG="rgba(0,0,0,0)";class eH extends y.R{constructor(t,r,n,i,s,o={}){for(let o of(super(t,r,n,i),this.canvas=this.elt=s||document.createElement("canvas"),i?(this._pInst._curElement=this,this._pInst.canvas=this.canvas):this.canvas.style.display="none",this.elt.id="defaultCanvas0",this.elt.classList.add("p5Canvas"),Object.getOwnPropertyNames(v.H.prototype)))"constructor"!==o&&"_"!==o[0]&&Object.defineProperty(this,o,{get(){return this.wrappedElt[o]}});if(this.elt.width=r*this._pixelDensity,this.elt.height=n*this._pixelDensity,this.elt.style.width=`${r}px`,this.elt.style.height=`${n}px`,this._pInst._userNode)this._pInst._userNode.appendChild(this.elt);else{if(0===document.getElementsByTagName("main").length){let t=document.createElement("main");document.body.appendChild(t)}document.getElementsByTagName("main")[0].appendChild(this.elt)}this.drawingContext=this.canvas.getContext("2d",o),"display-p3"===o.colorSpace&&(this.states.colorMode=x.b),this.scale(this._pixelDensity,this._pixelDensity),this.wrappedElt=new v.H(this.elt,this._pInst),this.clipPath=null}get filterRenderer(){return this._filterRenderer||(this._filterRenderer=new eV(this)),this._filterRenderer}remove(){this.wrappedElt.remove(),this.wrappedElt=null,this.canvas=null,this.elt=null}getFilterGraphicsLayer(){if(!this.filterGraphicsLayer){let t=this._pInst;this.filterGraphicsLayer=new g.G(this.width,this.height,d.ac,t)}return(this.filterGraphicsLayer.width!==this.width||this.filterGraphicsLayer.height!==this.height)&&this.filterGraphicsLayer.resizeCanvas(this.width,this.height),this.filterGraphicsLayer.pixelDensity()!==this._pInst.pixelDensity()&&this.filterGraphicsLayer.pixelDensity(this._pInst.pixelDensity()),this.filterGraphicsLayer}_applyDefaults(){this.states.setValue("_cachedFillStyle",void 0),this.states.setValue("_cachedStrokeStyle",void 0),this._cachedBlendMode=d.B,this._setFill(d.al),this._setStroke(d.am),this.drawingContext.lineCap=d.w,this.drawingContext.font="normal 12px sans-serif"}resize(t,r){super.resize(t,r);let n={};for(let t in this.drawingContext){let r=this.drawingContext[t];"object"!=typeof r&&"function"!=typeof r&&(n[t]=r)}for(let i in this.canvas.width=t*this._pixelDensity,this.canvas.height=r*this._pixelDensity,this.canvas.style.width=`${t}px`,this.canvas.style.height=`${r}px`,this.drawingContext.scale(this._pixelDensity,this._pixelDensity),n)try{this.drawingContext[i]=n[i]}catch(t){}}background(...t){if(this.push(),this.resetMatrix(),t[0]instanceof y.I)if(t[1]>=0){let r=t[0];this.drawingContext.globalAlpha=t[1]/255,this._pInst.image(r,0,0,this.width,this.height)}else this._pInst.image(t[0],0,0,this.width,this.height);else{let r=this._pInst.color(...t);
5this._pInst._addAccsOutput?.()&&this._pInst._accsBackground?.(r._getRGBA([255,255,255,255]));let n=r.toString();this._setFill(n),this._isErasing&&this.blendMode(this._cachedBlendMode),this.drawingContext.fillRect(0,0,this.width,this.height),this._isErasing&&this._pInst.erase()}this.pop()}clear(){this.drawingContext.save(),this.resetMatrix(),this.drawingContext.clearRect(0,0,this.width,this.height),this.drawingContext.restore()}fill(...t){super.fill(...t);let r=this.states.fillColor;this._setFill(r.toString()),this._pInst._addAccsOutput?.()&&this._pInst._accsCanvasColors?.("fill",r._getRGBA([255,255,255,255]))}stroke(...t){super.stroke(...t);let r=this.states.strokeColor;this._setStroke(r.toString()),this._pInst._addAccsOutput?.()&&this._pInst._accsCanvasColors?.("stroke",r._getRGBA([255,255,255,255]))}erase(t,r){if(!this._isErasing){this.states.setValue("_cachedFillStyle",this.drawingContext.fillStyle);let n=this._pInst.color(255,t).toString();this.drawingContext.fillStyle=n,this.states.setValue("_cachedStrokeStyle",this.drawingContext.strokeStyle);let i=this._pInst.color(255,r).toString();this.drawingContext.strokeStyle=i;let s=this._cachedBlendMode;this.blendMode(d.b),this._cachedBlendMode=s,this._isErasing=!0}}noErase(){this._isErasing&&(this.drawingContext.fillStyle=this.states._cachedFillStyle,this.drawingContext.strokeStyle=this.states._cachedStrokeStyle,this.blendMode(this._cachedBlendMode),this._isErasing=!1)}drawShape(t){let r=new ez.AQ({strokeWeight:this.states.strokeWeight});if(t.accept(r),this._clipping){let t=this.drawingContext.getTransform(),n=this._clipBaseTransform.inverse().multiply(t);this.clipPath.addPath(r.path,n),this.clipPath.closePath()}else this.states.fillColor&&this.drawingContext.fill(r.path),this.states.strokeColor&&this.drawingContext.stroke(r.path)}beginClip(t={}){super.beginClip(t),this._clipBaseTransform=this.drawingContext.getTransform(),this.states.setValue("_cachedFillStyle",this.drawingContext.fillStyle);let r=this._pInst.color(255,0).toString();this.drawingContext.fillStyle=r,this.states.setValue("_cachedStrokeStyle",this.drawingContext.strokeStyle);let n=this._pInst.color(255,0).toString();this.drawingContext.strokeStyle=n;let i=this._cachedBlendMode;this.blendMode(d.B),this._cachedBlendMode=i,this.clipPath=new Path2D,this._clipBaseTransform=this.drawingContext.getTransform(),this._clipInvert&&(this.clipPath.moveTo(-2*this.width,-2*this.height),this.clipPath.lineTo(-2*this.width,2*this.height),this.clipPath.lineTo(2*this.width,2*this.height),this.clipPath.lineTo(2*this.width,-2*this.height),this.clipPath.closePath())}endClip(){let t=this.drawingContext.getTransform();this.drawingContext.setTransform(this._clipBaseTransform),this.drawingContext.clip(this.clipPath),this.drawingContext.setTransform(t),this.clipPath=null,super.endClip(),this.drawingContext.fillStyle=this.states._cachedFillStyle,this.drawingContext.strokeStyle=this.states._cachedStrokeStyle,this.blendMode(this._cachedBlendMode)}image(t,r,n,i,s,o,a,l,u){let h;t.gifProperties&&t._animateGif(this._pInst);try{t instanceof b.z&&t._ensureCanvas(),this.states.tint&&t.canvas&&(h=this._getTintedImageCanvas(t)),h||(h=t.canvas||t.elt);let c=1;t.width&&t.width>0&&(c=h.width/t.width),this._isErasing&&this.blendMode(this._cachedBlendMode),this.drawingContext.drawImage(h,c*r,c*n,c*i,c*s,o,a,l,u),this._isErasing&&this._pInst.erase()}catch(t){if("NS_ERROR_NOT_AVAILABLE"!==t.name)throw t}}_getTintedImageCanvas(t){if(!t.canvas)return t;t.tintCanvas||(t.tintCanvas=document.createElement("canvas")),t.tintCanvas.width!==t.canvas.width&&(t.tintCanvas.width=t.canvas.width),t.tintCanvas.height!==t.canvas.height&&(t.tintCanvas.height=t.canvas.height);let r=t.tintCanvas.getContext("2d");
5return r.save(),r.clearRect(0,0,t.canvas.width,t.canvas.height),(this.states.tint[0]<255||this.states.tint[1]<255||this.states.tint[2]<255)&&(r.drawImage(t.canvas,0,0),r.globalCompositeOperation="luminosity",r.drawImage(t.canvas,0,0),r.globalCompositeOperation="color",r.drawImage(t.canvas,0,0),r.globalCompositeOperation="multiply",r.fillStyle=`rgb(${this.states.tint.slice(0,3).join(", ")})`,r.fillRect(0,0,t.canvas.width,t.canvas.height),r.globalCompositeOperation="destination-in"),r.globalAlpha=this.states.tint[3]/255,r.drawImage(t.canvas,0,0),r.restore(),t.tintCanvas}blendMode(t){if(t===d.S)console.warn("blendMode(SUBTRACT) only works in WEBGL mode.");else if(t===d.B||t===d.b||t===d.D||t===d.L||t===d.an||t===d.M||t===d.E||t===d.a||t===d.R||t===d.ao||t===d.ap||t===d.aq||t===d.ar||t===d.as||t===d.A)this._cachedBlendMode=t,this.drawingContext.globalCompositeOperation=t;else throw Error(`Mode ${t} not recognized.`)}blend(...t){let r=this.drawingContext.globalCompositeOperation,n=t[t.length-1],i=Array.prototype.slice.call(t,0,t.length-1);this.drawingContext.globalCompositeOperation=n,eq.prototype.copy.apply(this,i),this.drawingContext.globalCompositeOperation=r}_getPixel(t,r){let n;return[(n=this.drawingContext.getImageData(t,r,1,1).data)[0],n[1],n[2],n[3]]}loadPixels(){let t=this._pixelDensity,r=this.width*t,n=this.height*t,i=this.drawingContext.getImageData(0,0,r,n);this.imageData=i,this.pixels=i.data}set(t,r,n){if(t=Math.floor(t),r=Math.floor(r),n instanceof g.G||n instanceof y.I){this.drawingContext.save(),this.drawingContext.setTransform(1,0,0,1,0,0),this.drawingContext.scale(this._pixelDensity,this._pixelDensity);let i=n.width,s=n.height;this.drawingContext.clearRect(t,r,i,s),this.drawingContext.drawImage(n.canvas,t,r,i,s)}else{let i=0,s=0,o=0,a=0,l=4*(r*this._pixelDensity*(this.width*this._pixelDensity)+t*this._pixelDensity);if(this.imageData||this.loadPixels(),"number"==typeof n)l<this.pixels.length&&(i=n,s=n,o=n,a=255);else if(Array.isArray(n)){if(n.length<4)throw Error("pixel array must be of the form [R, G, B, A]");l<this.pixels.length&&(i=n[0],s=n[1],o=n[2],a=n[3])}else n instanceof eq.Color&&l<this.pixels.length&&([i,s,o,a]=n._getRGBA([255,255,255,255]));for(let n=0;n<this._pixelDensity;n++)for(let u=0;u<this._pixelDensity;u++)l=4*((r*this._pixelDensity+u)*this.width*this._pixelDensity+(t*this._pixelDensity+n)),this.pixels[l]=i,this.pixels[l+1]=s,this.pixels[l+2]=o,this.pixels[l+3]=a}}updatePixels(t,r,n,i){let s=this._pixelDensity;void 0===t&&void 0===r&&void 0===n&&void 0===i&&(t=0,r=0,n=this.width,i=this.height),t*=s,r*=s,n*=s,i*=s,this.gifProperties&&(this.gifProperties.frames[this.gifProperties.displayIndex].image=this.imageData),this.drawingContext.putImageData(this.imageData,0,0,t,r,n,i)}arc(t,r,n,i,s,o,a){let l=this.drawingContext,u=t+n/2,h=r+i/2,c=n/2,p=i/2;if(this._clipping){let t=new Path2D;t.ellipse(u,h,c,p,0,s,o);let r=this.drawingContext.getTransform(),n=this._clipBaseTransform.inverse().multiply(r);return this.clipPath.addPath(t,n),this}let f=a!==d.au&&a!==d.Q&&(o-s)%d.q!=0;return this.states.fillColor&&(l.beginPath(),l.ellipse(u,h,c,p,0,s,o),f&&l.lineTo(u,h),l.closePath(),l.fill()),this.states.strokeColor&&(l.beginPath(),l.ellipse(u,h,c,p,0,s,o),a===d.at&&f&&l.lineTo(u,h),(a===d.at||a===d.au)&&l.closePath(),l.stroke()),this}ellipse(t){let r=this.drawingContext,n=!!this.states.fillColor,i=this.states.strokeColor,s=parseFloat(t[0]),o=parseFloat(t[1]),a=parseFloat(t[2]),l=parseFloat(t[3]);if(n&&!i){if(this._getFill()===eG)return this}else if(!n&&i&&this._getStroke()===eG)return this;let u=s+a/2,h=o+l/2,c=a/2,d=l/2;if(this._clipping){let t=new Path2D;t.ellipse(u,h,c,d,0,0,2*Math.PI);let r=this.drawingContext.getTransform(),n=this._clipBaseTransform.inverse().multiply(r);return this.clipPath.addPath(t,n),this}return r.beginPath(),r.ellipse(u,h,c,d,0,0,2*Math.PI),r.closePath(),n&&r.fill(),i&&r.stroke(),this}line(t,r,n,i){let s=this.drawingContext;if(!this.states.strokeColor||this._getStroke()===eG)return this;if(this._clipping){let s=new Path2D;s.moveTo(t,r),s.lineTo(n,i);let o=this.drawingContext.getTransform(),a=this._clipBaseTransform.inverse().multiply(o);return this.clipPath.addPath(s,a),this}return s.beginPath(),s.moveTo(t,r),s.lineTo(n,i),s.stroke(),this}point(t,r){let n=this.drawingContext;if(!this.states.strokeColor||this._getStroke()===eG)return this;let i=this._getStroke(),s=this._getFill();if(this._clipping){let n=new Path2D,i=this.drawingContext.lineWidth;n.arc(t,r,i/2,0,d.q);let s=this.drawingContext.getTransform(),o=this._clipBaseTransform.inverse().multiply(s);return this.clipPath.addPath(n,o),this}return this._setFill(i),n.beginPath(),n.arc(t,r,n.lineWidth/2,0,d.q,!1),n.fill(),this._setFill(s),this}quad(t,r,n,i,s,o,a,l){let u=this.drawingContext,h=!!this.states.fillColor,c=this.states.strokeColor;if(h&&!c){if(this._getFill()===eG)return this}else if(!h&&c&&this._getStroke()===eG)return this;if(this._clipping){let u=new Path2D;u.moveTo(t,r),u.lineTo(n,i),u.lineTo(s,o),u.lineTo(a,l),u.closePath();let h=this.drawingContext.getTransform(),c=this._clipBaseTransform.inverse().multiply(h);return this.clipPath.addPath(u,c),this}return u.beginPath(),u.moveTo(t,r),u.lineTo(n,i),u.lineTo(s,o),u.lineTo(a,l),u.closePath(),h&&u.fill(),c&&u.stroke(),this}rect(t){let r=t[0],n=t[1],i=t[2],s=t[3],o=t[4],a=t[5],l=t[6],u=t[7],h=this.drawingContext,c=!!this.states.fillColor,d=this.states.strokeColor;
5if(c&&!d){if(this._getFill()===eG)return this}else if(!c&&d&&this._getStroke()===eG)return this;if(this._clipping){let t=new Path2D;void 0===o?t.rect(r,n,i,s):t.roundRect(r,n,i,s,[o,a,l,u]);let h=this.drawingContext.getTransform(),c=this._clipBaseTransform.inverse().multiply(h);return this.clipPath.addPath(t,c),this}if(h.beginPath(),void 0===o)h.rect(r,n,i,s);else{void 0===a&&(a=o),void 0===l&&(l=a),void 0===u&&(u=l);let t=Math.abs(i),c=Math.abs(s),d=t/2,p=c/2;t<2*o&&(o=d),c<2*o&&(o=p),t<2*a&&(a=d),c<2*a&&(a=p),t<2*l&&(l=d),c<2*l&&(l=p),t<2*u&&(u=d),c<2*u&&(u=p),h.roundRect(r,n,i,s,[o,a,l,u])}return c&&h.fill(),d&&h.stroke(),this}triangle(t){let r=this.drawingContext,n=!!this.states.fillColor,i=this.states.strokeColor,s=t[0],o=t[1],a=t[2],l=t[3],u=t[4],h=t[5];if(n&&!i){if(this._getFill()===eG)return this}else if(!n&&i&&this._getStroke()===eG)return this;if(this._clipping){let t=new Path2D;t.moveTo(s,o),t.lineTo(a,l),t.lineTo(u,h),t.closePath();let r=this.drawingContext.getTransform(),n=this._clipBaseTransform.inverse().multiply(r);return this.clipPath.addPath(t,n),this}return r.beginPath(),r.moveTo(s,o),r.lineTo(a,l),r.lineTo(u,h),r.closePath(),n&&r.fill(),i&&r.stroke(),this}strokeCap(t){return(t===d.w||t===d.x||t===d.y)&&(this.drawingContext.lineCap=t),this}strokeJoin(t){return(t===d.w||t===d.z||t===d.I)&&(this.drawingContext.lineJoin=t),this}strokeWeight(t){return super.strokeWeight(t),void 0===t||0===t?this.drawingContext.lineWidth=1e-4:this.drawingContext.lineWidth=t,this}_getFill(){return this.states._cachedFillStyle||this.states.setValue("_cachedFillStyle",this.drawingContext.fillStyle),this.states._cachedFillStyle}_setFill(t){t!==this.states._cachedFillStyle&&(this.drawingContext.fillStyle=t,this.states.setValue("_cachedFillStyle",t))}_getStroke(){return this.states._cachedStrokeStyle||this.states.setValue("_cachedStrokeStyle",this.drawingContext.strokeStyle),this.states._cachedStrokeStyle}_setStroke(t){t!==this.states._cachedStrokeStyle&&(this.drawingContext.strokeStyle=t,this.states.setValue("_cachedStrokeStyle",t))}applyMatrix(t,r,n,i,s,o){this.drawingContext.transform(t,r,n,i,s,o)}getWorldToScreenMatrix(){let t=new DOMMatrix().scale(1/this._pixelDensity).multiply(this.drawingContext.getTransform());return new ek.uq(t.toFloat32Array())}resetMatrix(){return this.drawingContext.setTransform(1,0,0,1,0,0),this.drawingContext.scale(this._pixelDensity,this._pixelDensity),this}rotate(t){this.drawingContext.rotate(t)}scale(t,r){return this.drawingContext.scale(t,r),this}translate(t,r){return t instanceof eq.Vector&&(r=t.y,t=t.x),this.drawingContext.translate(t,r),this}push(){return this.drawingContext.save(),super.push()}pop(t){this.drawingContext.restore(),super.pop(t)}textCanvas(){return this.canvas}textDrawingContext(){return this.drawingContext}_renderText(t,r,n,i,s){let o=this.states,a=this.textDrawingContext();n<s||n>=i||(this.push(),o.strokeColor&&o.strokeSet&&a.strokeText(t,r,n),!this._clipping&&o.fillColor&&(o.fillSet||this._setFill(eU.be),a.fillText(t,r,n)),this.pop())}_positionLines(t,r,n,i,s){let{textLeading:o,textAlign:a}=this.states,l,u=Array(s.length),h=void 0===n?0:n;for(let n=0;n<s.length;n++){switch(a){case eU.wU.START:throw Error("textBounds: START not yet supported for textAlign");case d.av:l=t;break;case d.v:l=t+h/2;break;case d.a9:l=t+h;break;case eU.wU.END:throw Error("textBounds: END not yet supported for textAlign")}u[n]={text:s[n],x:l,y:r+n*o}}return this._yAlignOffset(u,void 0===i?0:i)}_yAlignOffset(t,r){if(void 0===r)throw Error("_yAlignOffset: height is required");let{textLeading:n,textBaseline:i}=this.states,s=0,o=r-n*(t.length-1);switch(i){case d.ay:case d.ax:break;case eU.wU._CTX_MIDDLE:s=o/2+this._middleAlignOffset();break;case d.aw:s=o;break;case eU.wU.IDEOGRAPHIC:console.warn("textBounds: IDEOGRAPHIC not yet supported for textBaseline");break;case eU.wU.HANGING:console.warn("textBounds: HANGING not yet supported for textBaseline")}return t.forEach(t=>t.y+=s),t}}class eq{static VERSION=d.az;static instance=null;static lifecycleHooks={presetup:[],postsetup:[],predraw:[],postdraw:[],remove:[]};static _checkForUserDefinedFunctions=()=>{};static _friendlyFileLoadError=()=>{};constructor(t,r){eq.decorations.size>0&&(function t(r,n,i){for(let s in i??=r.name,r)if(!s.startsWith("_")){for(let[t,o]of n)if(t({path:`${i}.${s}`}
5))if("function"==typeof r[s]){let t=o(r[s],{kind:"method",name:s,static:!0});t&&Object.defineProperty(r,s,{enumerable:!0,writable:!0,value:t})}else{let t=o(void 0,{kind:"field",name:s,static:!0});t&&"function"==typeof t&&(r[s]=t(r[s]))}"function"==typeof r[s]&&r[s].prototype&&t(r[s],n,`${i}.${s}`)}for(let t of Object.getOwnPropertyNames(r.prototype))if("constructor"!==t&&!t.startsWith("_")){for(let[s,o]of n)if(s({path:`${i}.prototype.${t}`}))if("function"==typeof r.prototype[t]){let n=o(r.prototype[t],{kind:"method",name:t,static:!1});n&&Object.defineProperty(r.prototype,t,{enumerable:!0,writable:!0,value:n})}else{let n=Object.getOwnPropertyDescriptor(r.prototype,t);if(n.hasOwnProperty("value")){let n=o(void 0,{kind:"field",name:t,static:!1});Object.defineProperty(r.prototype,t,{enumerable:!0,writable:!0,value:n&&"function"==typeof n?n(r.prototype[t]):r.prototype[t]})}else{let{get:i,set:s}=n,a=o(i,{kind:"getter",name:t,static:!1}),l=o(s,{kind:"setter",name:t,static:!1});Object.defineProperty(r.prototype,t,{enumerable:!0,get:a??i,set:l??s})}}}}(eq,eq.decorations),eq.decorations.clear()),this.hitCriticalError=!1,this._setupDone=!1,this._userNode=r,this._curElement=null,this._elements=[],this._glAttributes=null,this._webgpuAttributes=null,this._requestAnimId=0,this._isGlobal=!1,this._loop=!0,this._startListener=null,this._initializeInstanceVariables(),this._events={},this._removeAbortController=new AbortController,this._removeSignal=this._removeAbortController.signal,this._millisStart=-1,this._recording=!1,this._lcg_random_state=null,this._gaussian_previous=!1,this._updateWindowSize();let n=function(t){return function(r){let n;if("constructor"===r)return;let i=Object.getOwnPropertyDescriptor(t,r),s=Object.getOwnPropertyDescriptor(eq.prototype,r),o=i&&i.get||s&&s.get,a=!1,l=!1;if(!o){let t=eq.prototype[r];(a="function"==typeof t)||void 0===d.a3[r]||(l=!0,n=t)}if(a){let n=eq.prototype[r].bind(t);Object.defineProperty(window,r,{configurable:!0,enumerable:!0,value:n})}else if(l)Object.defineProperty(window,r,{configurable:!0,enumerable:!0,value:n});else if(o||!a){let n=null,i=null,s=null;Object.defineProperty(window,r,{configurable:!0,enumerable:!0,get:()=>{let o=t[r];return null===s?(s="function"==typeof o)?(n=o,i=o.bind(t)):o:s?(o!==n&&(n=o,i=o.bind(t)),i):o}})}}}(this);if(t)t(this),eq._checkForUserDefinedFunctions(this);else{if(this._isGlobal=!0,window.hitCriticalError)return;for(let t of(eq.instance=this,Object.getOwnPropertyNames(eq.prototype)))"_"!==t[0]&&n(t);let t=["constructor","length"];for(let r in this)if(this.hasOwnProperty(r)){if("_"===r[0]||t.includes(r))continue;n(r)}}let i=()=>{this.focused=!0},s=()=>{this.focused=!1};window.addEventListener("focus",i),window.addEventListener("blur",s),eq.lifecycleHooks.remove.push(function(){window.removeEventListener("focus",i),window.removeEventListener("blur",s)}),"complete"===document.readyState?this.#e():(this._startListener=this.#e.bind(this),window.addEventListener("load",this._startListener,!1))}get pixels(){return this._renderer?.pixels}get drawingContext(){return this._renderer?.drawingContext}static _registeredAddons=new Set;static registerAddon(t){let r={};if(!eq._registeredAddons.has(t))for(let n of(eq._registeredAddons.add(t),t(eq,eq.prototype,r),Object.keys(eq.lifecycleHooks)))"function"==typeof r[n]&&eq.lifecycleHooks[n].push(r[n])}static decorations=new Map;static registerDecorator(t,r){if("string"==typeof t){let r=t;t=({path:t})=>r===t}else if(Array.isArray(t)&&t.every(t=>"string"==typeof t)){let r=t;t=({path:t})=>r.includes(t)}else if("function"!=typeof t)throw Error("Decorator matching pattern must be a function, a string, or an array of strings");eq.decorations.set(t,r)}#t={};_customActions=new Proxy({},{get:(t,r)=>{if(!this.#t[r]){let t=this._isGlobal?window:this;"function"==typeof t[r]&&(this.#t[r]=t[r].bind(this))}return this.#t[r]}});async #e(){this.hitCriticalError||(this._userNode&&"string"==typeof this._userNode&&(this._userNode=document.getElementById(this._userNode)),await this.#r(),!this.hitCriticalError&&(this._recording||this._draw()))}
5async #r(){if(await this._runLifecycleHook("presetup"),this.hitCriticalError)return;this.createCanvas(100,100,d.P),this._millisStart=window.performance.now();let t=this._isGlobal?window:this;if("function"==typeof t.setup&&await t.setup(),!this.hitCriticalError){for(let t of document.getElementsByTagName("canvas"))t.style.touchAction="none","true"===t.dataset.hidden&&(t.style.visibility="",delete t.dataset.hidden);this._lastTargetFrameTime=window.performance.now(),this._lastRealFrameTime=window.performance.now(),this._setupDone=!0,(this._accessibleOutputs.grid||this._accessibleOutputs.text)&&this._updateAccsOutput(),await this._runLifecycleHook("postsetup"),this._millisStart=window.performance.now()}}async _draw(t){if(this.hitCriticalError)return;let r=t||window.performance.now(),n=r-this._lastTargetFrameTime,i=1e3/this._targetFrameRate;(!this._loop||n>=i-5)&&(this.deltaTime=r-this._lastRealFrameTime,this._frameRate=1e3/this.deltaTime,await this.redraw(),this._lastTargetFrameTime=Math.max(this._lastTargetFrameTime+i,r),this._lastRealFrameTime=r,void 0!==this._updateMouseCoords&&(this._updateMouseCoords(),this.movedX=0,this.movedY=0)),this._loop&&(this._requestAnimId=window.requestAnimationFrame(this._draw.bind(this)))}async remove(){if(this._startListener&&window.removeEventListener("load",this._startListener,!1),this._curElement){for(let t of(this._loop=!1,this._requestAnimId&&window.cancelAnimationFrame(this._requestAnimId),this._removeAbortController.abort(),this._elements))t.elt&&t.elt.parentNode&&t.elt.parentNode.removeChild(t.elt);await this._runLifecycleHook("remove")}if(this._isGlobal){for(let t in eq.prototype)try{delete window[t]}catch(r){window[t]=void 0}for(let t in this)if(this.hasOwnProperty(t))try{delete window[t]}catch(r){window[t]=void 0}eq.instance=null}}async _runLifecycleHook(t){await Promise.all(eq.lifecycleHooks[t].map(t=>t.call(this)))}_initializeInstanceVariables(){this._accessibleOutputs={text:!1,grid:!1,textLabel:!1,gridLabel:!1},this._styles=[],this._downKeys={},this._downKeyCodes={}}}for(let t in d.a3)eq.prototype[t]=d.a3[t];function eW(t,r){let n="_Description",i="_fallbackDesc",s="_fallbackTable",o="_fte_",a="_Label",l="_labelDesc",u="_labelTable",h="_lte_";function c(t){if("label"===t||"fallback"===t)throw Error("description should not be LABEL or FALLBACK");return t.endsWith(".")||t.endsWith(";")||t.endsWith(",")||t.endsWith("?")||t.endsWith("!")||(t+="."),t}r.describe=function(t,r){if("string"!=typeof t)return;let n=this.canvas.id;t=c(t),this.dummyDOM||(this.dummyDOM=document.getElementById(n).parentNode),this.descriptions||(this.descriptions={}),this.descriptions.fallback?this.descriptions.fallback.innerHTML!==t&&(this.descriptions.fallback.innerHTML=t):this._describeHTML("fallback",t),r===this.LABEL&&(this.descriptions.label?this.descriptions.label.innerHTML!==t&&(this.descriptions.label.innerHTML=t):this._describeHTML("label",t))},r.describeElement=function(t,r,n){if("string"!=typeof r||"string"!=typeof t)return;let i=this.canvas.id;r=c(r);let s=function(t){if("label"===t||"fallback"===t)throw Error("element name should not be LABEL or FALLBACK");return t.endsWith(".")||t.endsWith(";")||t.endsWith(",")?t=t.replace(/.$/,":"):t.endsWith(":")||(t+=":"),t}(t);t=t.replace(/[^a-zA-Z0-9]/g,"");let o=`<th scope="row">${s}</th><td>${r}</td>`;this.dummyDOM||(this.dummyDOM=document.getElementById(i).parentNode),this.descriptions?this.descriptions.fallbackElements||(this.descriptions.fallbackElements={}):this.descriptions={fallbackElements:{}},this.descriptions.fallbackElements[t]?this.descriptions.fallbackElements[t].innerHTML!==o&&(this.descriptions.fallbackElements[t].innerHTML=o):this._describeElementHTML("fallback",t,o),n===this.LABEL&&(this.descriptions.labelElements||(this.descriptions.labelElements={}),this.descriptions.labelElements[t]?this.descriptions.labelElements[t].innerHTML!==o&&(this.descriptions.labelElements[t].innerHTML=o):this._describeElementHTML("label",t,o))},r._describeHTML=function(t,r){let o=this.canvas.id;if("fallback"===t){if(this.dummyDOM.querySelector(`#${o+n}`))this.dummyDOM.querySelector("#"+o+s).insertAdjacentHTML("beforebegin",`<p id="${o+i}"></p>`);else{let t=`<div id="${o}${n}" role="region" aria-label="Canvas Description"><p id="${o}${i}"></p></div>`;this.dummyDOM.querySelector(`#${o}accessibleOutput`)?this.dummyDOM.querySelector(`#${o}accessibleOutput`).insertAdjacentHTML("beforebegin",t):this.dummyDOM.querySelector(`#${o}`).innerHTML=t}this.descriptions.fallback=this.dummyDOM.querySelector(`#${o}${i}`),this.descriptions.fallback.innerHTML=r;return}if("label"===t){if(this.dummyDOM.querySelector(`#${o+a}`))this.dummyDOM.querySelector(`#${o+u}`)&&this.dummyDOM.querySelector(`#${o+u}`).insertAdjacentHTML("beforebegin",`<p id="${o}${l}"></p>`);else{let t=`<div id="${o}${a}" class="p5Label"><p id="${o}${l}"></p></div>`;this.dummyDOM.querySelector(`#${o}accessibleOutputLabel`)?this.dummyDOM.querySelector(`#${o}accessibleOutputLabel`).insertAdjacentHTML("beforebegin",t):this.dummyDOM.querySelector("#"+o).insertAdjacentHTML("afterend",t)}this.descriptions.label=this.dummyDOM.querySelector("#"+o+l),this.descriptions.label.innerHTML=r;return}},r._describeElementHTML=function(t,r,c){let d=this.canvas.id;if("fallback"===t){if(this.dummyDOM.querySelector(`#${d+n}`))this.dummyDOM.querySelector("#"+d+s)||this.dummyDOM.querySelector("#"+d+i).insertAdjacentHTML("afterend",`<table id="${d}${s}"><caption>Canvas elements and their descriptions</caption></table>`);else{let t=`<div id="${d}${n}" role="region" aria-label="Canvas Description"><table id="${d}${s}"><caption>Canvas elements and their descriptions</caption></table></div>`;this.dummyDOM.querySelector(`#${d}accessibleOutput`)?this.dummyDOM.querySelector(`#${d}accessibleOutput`).insertAdjacentHTML("beforebegin",t):this.dummyDOM.querySelector("#"+d).innerHTML=t}let t=document.createElement("tr");t.id=d+o+r,this.dummyDOM.querySelector("#"+d+s).appendChild(t),this.descriptions.fallbackElements[r]=this.dummyDOM.querySelector(`#${d}${o}${r}`),this.descriptions.fallbackElements[r].innerHTML=c;return}if("label"===t){if(this.dummyDOM.querySelector(`#${d+a}`))this.dummyDOM.querySelector(`#${d+u}`)||this.dummyDOM.querySelector("#"+d+l).insertAdjacentHTML("afterend",`<table id="${d+u}"></table>`);else{let t=`<div id="${d}${a}" class="p5Label"><table id="${d}${u}"></table></div>`;this.dummyDOM.querySelector(`#${d}accessibleOutputLabel`)?this.dummyDOM.querySelector(`#${d}accessibleOutputLabel`).insertAdjacentHTML("beforebegin",t):this.dummyDOM.querySelector("#"+d).insertAdjacentHTML("afterend",t)}let t=document.createElement("tr");t.id=d+h+r,this.dummyDOM.querySelector("#"+d+u).appendChild(t),this.descriptions.labelElements[r]=this.dummyDOM.querySelector(`#${d}${h}${r}`),this.descriptions.labelElements[r].innerHTML=c}}}function eZ(t,r){r._updateGridOutput=function(t){var r,n,i,s;let o;if(this._renderer&&this._renderer.isP3D){this._didOutputGridWebGLMessage||(this._didOutputGridWebGLMessage=!0,console.error("gridOutput() does not yet work in WebGL mode."));return}if(!this.dummyDOM.querySelector(`#${t}_summary`))return;let a=this._accessibleOutputs[t],l=function(t,r){let n="",i="",s=0;for(let o in r){let a=0;for(let i in r[o]){let l=`<li id="${t}shape${s}">${r[o][i].color} ${o},`;"line"===o?l+=` location = ${r[o][i].pos}, length = ${r[o][i].length} pixels`:(l+=` location = ${r[o][i].pos}`,"point"!==o&&(l+=`, area = ${r[o][i].area} %`),l+="</li>"),n+=l,a++,s++}i=a>1?`${i} ${a} ${o}s`:`${i} ${a} ${o}`}return{numShapes:[s,i],details:n}}(t,this.ingredients.shapes),u=(r=l.numShapes,n=this.ingredients.colors.background,i=this.width,s=this.height,o=`${n} canvas, ${i} by ${s} pixels, contains ${r[0]}`,1===r[0]?`${o} shape: ${r[1]}`:`${o} shapes: ${r[1]}`),h=function(t,r){let n=0,i="",s=Array.from(Array(10),()=>Array(10));for(let i in r)for(let o in r[i]){let a;a="line"!==i?`<a href="#${t}shape${n}">${r[i][o].color} ${i}</a>`:`<a href="#${t}shape${n}">${r[i][o].color} ${i} midpoint</a>`,r[i][o].loc.locY<s.length&&r[i][o].loc.locX<s[r[i][o].loc.locY].length&&(s[r[i][o].loc.locY][r[i][o].loc.locX]?s[r[i][o].loc.locY][r[i][o].loc.locX]=s[r[i][o].loc.locY][r[i][o].loc.locX]+"  "+a:s[r[i][o].loc.locY][r[i][o].loc.locX]=a,n++)}for(let t in s){let r="<tr>";for(let n in s[t])r+="<td>",void 0!==s[t][n]&&(r+=s[t][n]),r+="</td>";i=i+r+"</tr>"}return i}(t,this.ingredients.shapes);u!==a.summary.innerHTML&&(a.summary.innerHTML=u),h!==a.map.innerHTML&&(a.map.innerHTML=h),l.details!==a.shapeDetails.innerHTML&&(a.shapeDetails.innerHTML=l.details),this._accessibleOutputs[t]=a}}function eX(t,r){r._updateTextOutput=function(t){var r,n,i,s;let o;if(this._renderer&&this._renderer.isP3D){this._didOutputTextWebGLMessage||(this._didOutputTextWebGLMessage=!0,console.error("textOutput() does not yet work in WebGL mode."));return}if(!this.dummyDOM.querySelector(`#${t}_summary`))return;let a=this._accessibleOutputs[t],l=function(t,r){let n="",i=0;for(let s in r)for(let o in r[s]){let a=`<li><a href="#${t}shape${i}">${r[s][o].color} ${s}</a>`;"line"===s?a+=`, ${r[s][o].pos}, ${r[s][o].length} pixels long.</li>`:(a+=`, at ${r[s][o].pos}`,"point"!==s&&(a+=`, covering ${r[s][o].area}% of the canvas`),a+=".</li>"),n+=a,i++}return{numShapes:i,listShapes:n}}(t,this.ingredients.shapes),u=(r=l.numShapes,n=this.ingredients.colors.background,i=this.width,s=this.height,o=`Your output is a, ${i} by ${s} pixels, ${n} canvas containing the following`,1===r?`${o} shape:`:`${o} ${r} shapes:`),h=function(t,r){let n="",i=0;for(let s in r)for(let o in r[s]){let a=`<tr id="${t}shape${i}"><th>${r[s][o].color} ${s}</th>`;"line"===s?a+=`<td>location = ${r[s][o].pos}</td><td>length = ${r[s][o].length} pixels</td></tr>`:(a+=`<td>location = ${r[s][o].pos}</td>`,"point"!==s&&(a+=`<td> area = ${r[s][o].area}%</td>`),a+="</tr>"),n+=a,i++}return n}(t,this.ingredients.shapes);u!==a.summary.innerHTML&&(a.summary.innerHTML=u),l.listShapes!==a.list.innerHTML&&(a.list.innerHTML=l.listShapes),h!==a.shapeDetails.innerHTML&&(a.shapeDetails.innerHTML=h),this._accessibleOutputs[t]=a}}function eY(t,r){function n(t,r,n){let i=Math.floor(t[0]/r*10),s=Math.floor(t[1]/n*10);return 10===i&&(i-=1),10===s&&(s-=1),{locX:i,locY:s}}r.textOutput=function(t){this._accessibleOutputs.text||(this._accessibleOutputs.text=!0,this._createOutput("textOutput","Fallback"),t===this.LABEL&&(this._accessibleOutputs.textLabel=!0,this._createOutput("textOutput","Label")))},r.gridOutput=function(t){this._accessibleOutputs.grid||(this._accessibleOutputs.grid=!0,this._createOutput("gridOutput","Fallback"),t===this.LABEL&&(this._accessibleOutputs.gridLabel=!0,this._createOutput("gridOutput","Label")))},r._addAccsOutput=function(){return this._accessibleOutputs||(this._accessibleOutputs={text:!1,grid:!1,textLabel:!1,gridLabel:!1}),this._accessibleOutputs.grid||this._accessibleOutputs.text},r._createOutput=function(t,r){let n,i,s,o=this.canvas.id;this.ingredients||(this.ingredients={shapes:{},colors:{background:"white",fill:"white",stroke:"black"}
5,pShapes:"",pBackground:""}),this.dummyDOM||(this.dummyDOM=document.getElementById(o).parentNode);let a="";"Fallback"===r?(n=o+t,i=o+"accessibleOutput",this.dummyDOM.querySelector(`#${i}`)||(this.dummyDOM.querySelector(`#${o}_Description`)?this.dummyDOM.querySelector(`#${o}_Description`).insertAdjacentHTML("afterend",`<div id="${i}" role="region" aria-label="Canvas Outputs"></div>`):this.dummyDOM.querySelector(`#${o}`).innerHTML=`<div id="${i}" role="region" aria-label="Canvas Outputs"></div>`)):"Label"===r&&(a=r,n=o+t+r,i=o+"accessibleOutput"+r,this.dummyDOM.querySelector(`#${i}`)||(this.dummyDOM.querySelector(`#${o}_Label`)?this.dummyDOM.querySelector(`#${o}_Label`).insertAdjacentHTML("afterend",`<div id="${i}"></div>`):this.dummyDOM.querySelector(`#${o}`).insertAdjacentHTML("afterend",`<div id="${i}"></div>`))),this._accessibleOutputs[n]={},"textOutput"===t?(a=`#${o}gridOutput${a}`,s=`<div id="${n}">Text Output<div id="${n}Summary" aria-label="text output summary"><p id="${n}_summary"></p><ul id="${n}_list"></ul></div><table id="${n}_shapeDetails" summary="text output shape details"></table></div>`,this.dummyDOM.querySelector(a)?this.dummyDOM.querySelector(a).insertAdjacentHTML("beforebegin",s):this.dummyDOM.querySelector(`#${i}`).innerHTML=s,this._accessibleOutputs[n].list=this.dummyDOM.querySelector(`#${n}_list`)):"gridOutput"===t&&(a=`#${o}textOutput${a}`,s=`<div id="${n}">Grid Output<p id="${n}_summary" aria-label="grid output summary"><table id="${n}_map" summary="grid output content"></table><ul id="${n}_shapeDetails" aria-label="grid output shape details"></ul></div>`,this.dummyDOM.querySelector(a)?this.dummyDOM.querySelector(a).insertAdjacentHTML("afterend",s):this.dummyDOM.querySelector(`#${i}`).innerHTML=s,this._accessibleOutputs[n].map=this.dummyDOM.querySelector(`#${n}_map`)),this._accessibleOutputs[n].shapeDetails=this.dummyDOM.querySelector(`#${n}_shapeDetails`),this._accessibleOutputs[n].summary=this.dummyDOM.querySelector(`#${n}_summary`)},r._updateAccsOutput=function(){let t=this.canvas.id;(JSON.stringify(this.ingredients.shapes)!==this.ingredients.pShapes||this.ingredients.colors.background!==this.ingredients.pBackground)&&(this.ingredients.pShapes=JSON.stringify(this.ingredients.shapes),this._accessibleOutputs.text&&this._updateTextOutput(t+"textOutput"),this._accessibleOutputs.grid&&this._updateGridOutput(t+"gridOutput"),this._accessibleOutputs.textLabel&&this._updateTextOutput(t+"textOutputLabel"),this._accessibleOutputs.gridLabel&&this._updateGridOutput(t+"gridOutputLabel"))},r._accsBackground=function(t){this.ingredients.pShapes=JSON.stringify(this.ingredients.shapes),this.ingredients.pBackground=this.ingredients.colors.background,this.ingredients.shapes={},this.ingredients.colors.backgroundRGBA!==t&&(this.ingredients.colors.backgroundRGBA=t,this.ingredients.colors.background=this._rgbColorName(t))},r._accsCanvasColors=function(t,r){"fill"===t?this.ingredients.colors.fillRGBA!==r&&(this.ingredients.colors.fillRGBA=r,this.ingredients.colors.fill=this._rgbColorName(r)):"stroke"===t&&this.ingredients.colors.strokeRGBA!==r&&(this.ingredients.colors.strokeRGBA=r,this.ingredients.colors.stroke=this._rgbColorName(r))},r._accsOutput=function(t,r){var i,s;let o,a;"ellipse"===t&&r[2]===r[3]?t="circle":"rectangle"===t&&r[2]===r[3]&&(t="square");let l={}
5,u=!0,h=(i=t,s=r,"rectangle"===i||"ellipse"===i||"arc"===i||"circle"===i||"square"===i?(o=Math.round(s[0]+s[2]/2),a=Math.round(s[1]+s[3]/2)):"triangle"===i?(o=(s[0]+s[2]+s[4])/3,a=(s[1]+s[3]+s[5])/3):"quadrilateral"===i?(o=(s[0]+s[2]+s[4]+s[6])/4,a=(s[1]+s[3]+s[5]+s[7])/4):"line"===i?(o=(s[0]+s[2])/2,a=(s[1]+s[3])/2):(o=s[0],a=s[1]),[o,a]);if("line"===t){l.color=this.ingredients.colors.stroke,l.length=Math.round(Math.hypot(r[2]-r[0],r[3]-r[1]));let t=this._getPos(r[0],[1]),i=this._getPos(r[2],[3]);l.loc=n(h,this.width,this.height),t===i?l.pos=`at ${t}`:l.pos=`from ${t} to ${i}`}else"point"===t?l.color=this.ingredients.colors.stroke:(l.color=this.ingredients.colors.fill,l.area=this._getArea(t,r)),l.pos=this._getPos(...h),l.loc=n(h,this.width,this.height);if(this.ingredients.shapes[t]){for(let r in this.ingredients.shapes[t])JSON.stringify(this.ingredients.shapes[t][r])===JSON.stringify(l)&&(u=!1);!0===u&&this.ingredients.shapes[t].push(l)}else this.ingredients.shapes[t]=[l]},r._getPos=function(r,n){let{x:i,y:s}=this.worldToScreen(new t.Vector(r,n)),o=this.width,a=this.height;if(i<.4*o)if(s<.4*a)return"top left";else if(s>.6*a)return"bottom left";else return"mid left";if(i>.6*o)if(s<.4*a)return"top right";else if(s>.6*a)return"bottom right";else return"mid right";return s<.4*a?"top middle":s>.6*a?"bottom middle":"middle"},r._getArea=function(t,r){let n=0;if("arc"===t){let t=((r[5]-r[4])%(2*Math.PI)+2*Math.PI)%(2*Math.PI);if(n=t*r[2]*r[3]/8,"open"===r[6]||"chord"===r[6]){let i=r[0],s=r[1],o=r[0]+r[2]/2*Math.cos(r[4]).toFixed(2),a=r[1]+r[3]/2*Math.sin(r[4]).toFixed(2),l=r[0]+r[2]/2*Math.cos(r[5]).toFixed(2),u=r[1]+r[3]/2*Math.sin(r[5]).toFixed(2),h=Math.abs(i*(a-u)+o*(u-s)+l*(s-a))/2;t>Math.PI?n+=h:n-=h}}else"ellipse"===t||"circle"===t?n=3.14*r[2]/2*r[3]/2:"line"===t||"point"===t?n=0:"quadrilateral"===t?n=Math.abs((r[6]+r[0])*(r[7]-r[1])+(r[0]+r[2])*(r[1]-r[3])+(r[2]+r[4])*(r[3]-r[5])+(r[4]+r[6])*(r[5]-r[7]))/2:"rectangle"===t||"square"===t?n=r[2]*r[3]:"triangle"===t&&(n=Math.abs(r[0]*(r[3]-r[5])+r[2]*(r[5]-r[1])+r[4]*(r[1]-r[3]))/2);let i=this.width*this._renderer._pixelDensity,s=this.height*this._renderer._pixelDensity,o=[new DOMPoint(0,0),new DOMPoint(i,0),new DOMPoint(i,s),new DOMPoint(0,s)],a=(this._renderer.isP3D?new DOMMatrix(this._renderer.uMVMatrix.mat4):this.drawingContext.getTransform()).inverse(),l=o.map(t=>t.matrixTransform(a));return Math.round(100*n/(Math.abs((l[3].x+l[0].x)*(l[3].y-l[0].y)+(l[0].x+l[1].x)*(l[0].y-l[1].y)+(l[1].x+l[2].x)*(l[1].y-l[2].y)+(l[2].x+l[3].x)*(l[2].y-l[3].y))/2))}}eq.registerAddon(p.A),eq.registerAddon(f),eq.registerAddon(m),eq.registerAddon(g.k),eq.registerAddon(y.r),eq.registerAddon(function(t,r){t.Renderer2D=eH,t.renderers[d.P]=eH,t.renderers["p2d-hdr"]=new Proxy(eH,{construct:(t,[r,n,i,s,o])=>new t(r,n,i,s,o,{colorSpace:"display-p3"})})}),eq.registerAddon(g.n),"undefined"!=typeof p5&&eW(p5,p5.prototype),"undefined"!=typeof p5&&eZ(p5,p5.prototype),"undefined"!=typeof p5&&eX(p5,p5.prototype),"undefined"!=typeof p5&&eY(p5,p5.prototype),eq.ColorConversion={_hsbaToHSLA(t){let r=t[0],n=t[1],i=t[2],s=(2-n)*i/2;return 0!==s&&(1===s?n=0:s<.5?n/=2-n:n=n*i/(2-2*s)),[r,n,s,t[3]]},_hsbaToRGBA(t){let r=6*t[0],n=t[1],i=t[2],s=[];if(0===n)s=[i,i,i,t[3]];else{let o,a,l,u=Math.floor(r),h=i*(1-n),c=i*(1-n*(r-u)),d=i*(1-n*(1+u-r));1===u?(o=c,a=i,l=h):2===u?(o=h,a=i,l=d):3===u?(o=h,a=c,l=i):4===u?(o=d,a=h,l=i):5===u?(o=i,a=h,l=c):(o=i,a=d,l=h),s=[o,a,l,t[3]]}return s},_hslaToHSBA(t){let r,n=t[0],i=t[1],s=t[2];return[n,i=2*((r=s<.5?(1+i)*s:s+i-s*i)-s)/r,r,t[3]]},_hslaToRGBA(t){let r=6*t[0],n=t[1],i=t[2],s=[];if(0===n)s=[i,i,i,t[3]];else{let o;o=i<.5?(1+n)*i:i+n-i*n;let a=2*i-o,l=(t,r,n)=>(t<0?t+=6:t>=6&&(t-=6),t<1)?r+(n-r)*t:t<3?n:t<4?r+(n-r)*(4-t):r;s=[l(r+2,a,o),l(r,a,o),l(r-2,a,o),t[3]]}return s},_rgbaToHSBA(t){let r,n,i=t[0],s=t[1],o=t[2],a=Math.max(i,s,o),l=a-Math.min(i,s,o);return 0===l?(r=0,n=0):(n=l/a,i===a?r=(s-o)/l:s===a?r=2+(o-i)/l:o===a&&(r=4+(i-s)/l),r<0?r+=6:r>=6&&(r-=6)),[r/6,n,a,t[3]]},_rgbaToHSLA(t){let r,n,i=t[0],s=t[1],o=t[2],a=Math.max(i,s,o),l=Math.min(i,s,o),u=a+l,h=a-l;return 0===h?(r=0,n=0):(n=u<1?h/u:h/(2-u),i===a?r=(s-o)/h:s===a?r=2+(o-i)/h:o===a&&(r=4+(i-s)/h),r<0?r+=6:r>
5=6&&(r-=6)),[r/6,n,u/2,t[3]]}};var eK=eq.ColorConversion;function eJ(t,r){let n,i=[{h:0,s:0,b:.8275,name:"gray"},{h:0,s:0,b:.8627,name:"gray"},{h:0,s:0,b:.7529,name:"gray"},{h:.0167,s:.1176,b:1,name:"light pink"}],s=[{h:0,s:0,b:0,name:"black"},{h:0,s:0,b:.5,name:"gray"},{h:0,s:0,b:1,name:"white"},{h:0,s:.5,b:.5,name:"dark maroon"},{h:0,s:.5,b:1,name:"salmon pink"},{h:0,s:1,b:0,name:"black"},{h:0,s:1,b:.5,name:"dark red"},{h:0,s:1,b:1,name:"red"},{h:5,s:0,b:1,name:"very light peach"},{h:5,s:.5,b:.5,name:"brown"},{h:5,s:.5,b:1,name:"peach"},{h:5,s:1,b:.5,name:"brick red"},{h:5,s:1,b:1,name:"crimson"},{h:10,s:0,b:1,name:"light peach"},{h:10,s:.5,b:.5,name:"brown"},{h:10,s:.5,b:1,name:"light orange"},{h:10,s:1,b:.5,name:"brown"},{h:10,s:1,b:1,name:"orange"},{h:15,s:0,b:1,name:"very light yellow"},{h:15,s:.5,b:.5,name:"olive green"},{h:15,s:.5,b:1,name:"light yellow"},{h:15,s:1,b:0,name:"dark olive green"},{h:15,s:1,b:.5,name:"olive green"},{h:15,s:1,b:1,name:"yellow"},{h:20,s:0,b:1,name:"very light yellow"},{h:20,s:.5,b:.5,name:"olive green"},{h:20,s:.5,b:1,name:"light yellow green"},{h:20,s:1,b:0,name:"dark olive green"},{h:20,s:1,b:.5,name:"dark yellow green"},{h:20,s:1,b:1,name:"yellow green"},{h:25,s:.5,b:.5,name:"dark yellow green"},{h:25,s:.5,b:1,name:"light green"},{h:25,s:1,b:.5,name:"dark green"},{h:25,s:1,b:1,name:"green"},{h:30,s:.5,b:1,name:"light green"},{h:30,s:1,b:.5,name:"dark green"},{h:30,s:1,b:1,name:"green"},{h:35,s:0,b:.5,name:"light green"},{h:35,s:0,b:1,name:"very light green"},{h:35,s:.5,b:.5,name:"dark green"},{h:35,s:.5,b:1,name:"light green"},{h:35,s:1,b:0,name:"very dark green"},{h:35,s:1,b:.5,name:"dark green"},{h:35,s:1,b:1,name:"green"},{h:40,s:0,b:1,name:"very light green"},{h:40,s:.5,b:.5,name:"dark green"},{h:40,s:.5,b:1,name:"light green"},{h:40,s:1,b:.5,name:"dark green"},{h:40,s:1,b:1,name:"green"},{h:45,s:.5,b:1,name:"light turquoise"},{h:45,s:1,b:.5,name:"dark turquoise"},{h:45,s:1,b:1,name:"turquoise"},{h:50,s:0,b:1,name:"light sky blue"},{h:50,s:.5,b:.5,name:"dark cyan"},{h:50,s:.5,b:1,name:"light cyan"},{h:50,s:1,b:.5,name:"dark cyan"},{h:50,s:1,b:1,name:"cyan"},{h:55,s:0,b:1,name:"light sky blue"},{h:55,s:.5,b:1,name:"light sky blue"},{h:55,s:1,b:.5,name:"dark blue"},{h:55,s:1,b:1,name:"sky blue"},{h:60,s:0,b:.5,name:"gray"},{h:60,s:0,b:1,name:"very light blue"},{h:60,s:.5,b:.5,name:"blue"},{h:60,s:.5,b:1,name:"light blue"},{h:60,s:1,b:.5,name:"navy blue"},{h:60,s:1,b:1,name:"blue"},{h:65,s:0,b:1,name:"lavender"},{h:65,s:.5,b:.5,name:"navy blue"},{h:65,s:.5,b:1,name:"light purple"},{h:65,s:1,b:.5,name:"dark navy blue"},{h:65,s:1,b:1,name:"blue"},{h:70,s:0,b:1,name:"lavender"},{h:70,s:.5,b:.5,name:"navy blue"},{h:70,s:.5,b:1,name:"lavender blue"},{h:70,s:1,b:.5,name:"dark navy blue"},{h:70,s:1,b:1,name:"blue"},{h:75,s:.5,b:1,name:"lavender"},{h:75,s:1,b:.5,name:"dark purple"},{h:75,s:1,b:1,name:"purple"},{h:80,s:.5,b:1,name:"pinkish purple"},{h:80,s:1,b:.5,name:"dark purple"},{h:80,s:1,b:1,name:"purple"},{h:85,s:0,b:1,name:"light pink"},{h:85,s:.5,b:.5,name:"purple"},{h:85,s:.5,b:1,name:"light fuchsia"},{h:85,s:1,b:.5,name:"dark fuchsia"},{h:85,s:1,b:1,name:"fuchsia"},{h:90,s:.5,b:.5,name:"dark fuchsia"},{h:90,s:.5,b:1,name:"hot pink"},{h:90,s:1,b:.5,name:"dark fuchsia"},{h:90,s:1,b:1,name:"fuchsia"},{h:95,s:0,b:1,name:"pink"},{h:95,s:.5,b:1,name:"light pink"},{h:95,s:1,b:.5,name:"dark magenta"},{h:95,s:1,b:1,name:"magenta"}];r._rgbColorName=function(t){let r=eK._rgbaToHSBA(t);return n=r,function(t){let r;if(0!==t[0]){t[0]=Math.round(100*t[0]);let r=t[0].toString().split(""),n=r.length-1;r[n]=parseInt(r[n]),r[n]<2.5?r[n]=0:r[n]>=2.5&&r[n]<7.5&&(r[n]=5),2===r.length?(r[0]=parseInt(r[0]),r[n]>=7.5&&(r[n]=0,r[0]=r[0]+1),t[0]=10*r[0]+r[1]):r[n]>=7.5?t[0]=10:t[0]=r[n]}t[2]=t[2]/255;for(let r=t.length-1;r>=1;r--)t[r]<=.25?t[r]=0:t[r]>.25&&t[r]<.75?t[r]=.5:t[r]=1;if(0===t[0]&&0===t[1]&&1===t[2]){for(let t=2;t>=0;t--)n[t]=Math.round(1e4*n[t])/1e4;for(let t=0;t<i.length;t++)if(i[t].h===n[0]&&i[t].s===n[1]&&i[t].b===n[2]){r=i[t].name;break}else r="white"}else for(let n=0;n<s.length;n++)if(s[n].h===t[0]&&s[n].s===t[1]&&s[n].b===t[2]){r=s[n].name;break}return r}([r[0],r[1],r[2]])}}function eQ(t){return(eQ="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function e0(t){var r=function(t,r){if("object"!=eQ(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,r||"default");if("object"!=eQ(i))return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}
5(t,"string");return"symbol"==eQ(r)?r:r+""}function e1(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?Object(arguments[r]):{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&i.push.apply(i,Object.getOwnPropertySymbols(n).filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})),i.forEach(function(r){var i,s;i=r,s=n[r],(i=e0(i))in t?Object.defineProperty(t,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[i]=s})}return t}function e2(t,r){if(!(t instanceof r))throw TypeError("Cannot call a class as a function")}function e5(t,r){for(var n=0;n<r.length;n++){var i=r[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,e0(i.key),i)}}function e3(t,r,n){return r&&e5(t.prototype,r),n&&e5(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function e4(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function e8(t,r){if(r&&("object"==eQ(r)||"function"==typeof r))return r;if(void 0!==r)throw TypeError("Derived constructors may only return object or undefined");return e4(t)}function e6(t){return(e6=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function e9(t,r){return(e9=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,r){return t.__proto__=r,t})(t,r)}function e7(t,r){if("function"!=typeof r&&null!==r)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),r&&e9(t,r)}"undefined"!=typeof p5&&eJ(p5,p5.prototype);var te={type:"logger",log:function(t){this.output("log",t)},warn:function(t){this.output("warn",t)},error:function(t){this.output("error",t)},output:function(t,r){console&&console[t]&&console[t].apply(console,r)}},tt=new(function(){function t(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e2(this,t),this.init(r,n)}return e3(t,[{key:"init",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=r.prefix||"i18next:",this.logger=t||te,this.options=r,this.debug=r.debug}},{key:"setDebug",value:function(t){this.debug=t}},{key:"log",value:function(){for(var t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];return this.forward(r,"log","",!0)}},{key:"warn",value:function(){for(var t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];return this.forward(r,"warn","",!0)}},{key:"error",value:function(){for(var t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];return this.forward(r,"error","")}},{key:"deprecate",value:function(){for(var t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];return this.forward(r,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(t,r,n,i){return i&&!this.debug?null:("string"==typeof t[0]&&(t[0]="".concat(n).concat(this.prefix," ").concat(t[0])),this.logger[r](t))}},{key:"create",value:function(r){return new t(this.logger,e1({},{prefix:"".concat(this.prefix,":").concat(r,":")},this.options))}}]),t}()),tr=function(){function t(){e2(this,t),this.observers={}}return e3(t,[{key:"on",value:function(t,r){var n=this;return t.split(" ").forEach(function(t){n.observers[t]=n.observers[t]||[],n.observers[t].push(r)}),this}},{key:"off",value:function(t,r){if(this.observers[t]){if(!r)return void delete this.observers[t];this.observers[t]=this.observers[t].filter(function(t){return t!==r})}}},{key:"emit",value:function(t){for(var r=arguments.length,n=Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];this.observers[t]&&[].concat(this.observers[t]).forEach(function(t){t.apply(void 0,n)}),this.observers["*"]&&[].concat(this.observers["*"]).forEach(function(r){r.apply(r,[t].concat(n))})}}]),t}();function tn(){var t,r,n=new Promise(function(n,i){t=n,r=i});return n.resolve=t,n.reject=r,n}function ti(t){return null==t?"":""+t}function ts(t,r,n){function i(t){return t&&t.indexOf("###")>-1?t.replace(/###/g,"."):t}function s(){return!t||"string"==typeof t}for(var o="string"!=typeof r?[].concat(r):r.split(".");o.length>1;){if(s())return{};var a=i(o.shift());!t[a]&&n&&(t[a]=new n),t=Object.prototype.hasOwnProperty.call(t,a)?t[a]:{}}return s()?{}:{obj:t,k:i(o.shift())}}function to(t,r,n){var i=ts(t,r,Object);i.obj[i.k]=n}function ta(t,r){var n=ts(t,r),i=n.obj,s=n.k;if(i)return i[s]}function tl(t,r,n){var i=ta(t,n);return void 0!==i?i:ta(r,n)}function tu(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var th={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function tc(t){return"string"==typeof t?t.replace(/[&<>
5"'\/]/g,function(t){return th[t]}):t}var td="undefined"!=typeof window&&window.navigator&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,tp=function(t){function r(t){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return e2(this,r),n=e8(this,e6(r).call(this)),td&&tr.call(e4(n)),n.data=t||{},n.options=i,void 0===n.options.keySeparator&&(n.options.keySeparator="."),n}return e7(r,t),e3(r,[{key:"addNamespaces",value:function(t){0>this.options.ns.indexOf(t)&&this.options.ns.push(t)}},{key:"removeNamespaces",value:function(t){var r=this.options.ns.indexOf(t);r>-1&&this.options.ns.splice(r,1)}},{key:"getResource",value:function(t,r,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},s=void 0!==i.keySeparator?i.keySeparator:this.options.keySeparator,o=[t,r];return n&&"string"!=typeof n&&(o=o.concat(n)),n&&"string"==typeof n&&(o=o.concat(s?n.split(s):n)),t.indexOf(".")>-1&&(o=t.split(".")),ta(this.data,o)}},{key:"addResource",value:function(t,r,n,i){var s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},o=this.options.keySeparator;void 0===o&&(o=".");var a=[t,r];n&&(a=a.concat(o?n.split(o):n)),t.indexOf(".")>-1&&(a=t.split("."),i=r,r=a[1]),this.addNamespaces(r),to(this.data,a,i),s.silent||this.emit("added",t,r,n,i)}},{key:"addResources",value:function(t,r,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var s in n)("string"==typeof n[s]||"[object Array]"===Object.prototype.toString.apply(n[s]))&&this.addResource(t,r,s,n[s],{silent:!0});i.silent||this.emit("added",t,r,n)}},{key:"addResourceBundle",value:function(t,r,n,i,s){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},a=[t,r];t.indexOf(".")>-1&&(a=t.split("."),i=n,n=r,r=a[1]),this.addNamespaces(r);var l=ta(this.data,a)||{};i?function t(r,n,i){for(var s in n)"__proto__"!==s&&"constructor"!==s&&(s in r?"string"==typeof r[s]||r[s]instanceof String||"string"==typeof n[s]||n[s]instanceof String?i&&(r[s]=n[s]):t(r[s],n[s],i):r[s]=n[s]);return r}(l,n,s):l=e1({},l,n),to(this.data,a,l),o.silent||this.emit("added",t,r,n)}},{key:"removeResourceBundle",value:function(t,r){this.hasResourceBundle(t,r)&&delete this.data[t][r],this.removeNamespaces(r),this.emit("removed",t,r)}},{key:"hasResourceBundle",value:function(t,r){return void 0!==this.getResource(t,r)}},{key:"getResourceBundle",value:function(t,r){return(r||(r=this.options.defaultNS),"v1"===this.options.compatibilityAPI)?e1({},{},this.getResource(t,r)):this.getResource(t,r)}},{key:"getDataByLanguage",value:function(t){return this.data[t]}},{key:"toJSON",value:function(){return this.data}}]),r}(tr),tf={processors:{},addPostProcessor:function(t){this.processors[t.name]=t},handle:function(t,r,n,i,s){var o=this;return t.forEach(function(t){o.processors[t]&&(r=o.processors[t].process(r,n,i,s))}),r}},tm={},tg=function(t){function r(t){var n,i,s,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e2(this,r),s=e8(this,e6(r).call(this)),td&&tr.call(e4(s)),n=["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","
5i18nFormat","utils"],i=e4(s),n.forEach(function(r){t[r]&&(i[r]=t[r])}),s.options=o,void 0===s.options.keySeparator&&(s.options.keySeparator="."),s.logger=tt.create("translator"),s}return e7(r,t),e3(r,[{key:"changeLanguage",value:function(t){t&&(this.language=t)}},{key:"exists",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}},n=this.resolve(t,r);return n&&void 0!==n.res}},{key:"extractFromKey",value:function(t,r){var n=void 0!==r.nsSeparator?r.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");var i=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,s=r.ns||this.options.defaultNS;if(n&&t.indexOf(n)>-1){var o=t.match(this.interpolator.nestingRegexp);if(o&&o.length>0)return{key:t,namespaces:s};var a=t.split(n);(n!==i||n===i&&this.options.ns.indexOf(a[0])>-1)&&(s=a.shift()),t=a.join(i)}return"string"==typeof s&&(s=[s]),{key:t,namespaces:s}}},{key:"translate",value:function(t,n,i){var s=this;if("object"!==eQ(n)&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),n||(n={}),null==t)return"";Array.isArray(t)||(t=[String(t)]);var o=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,a=this.extractFromKey(t[t.length-1],n),l=a.key,u=a.namespaces,h=u[u.length-1],c=n.lng||this.language,d=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(c&&"cimode"===c.toLowerCase())return d?h+(n.nsSeparator||this.options.nsSeparator)+l:l;var p=this.resolve(t,n),f=p&&p.res,m=p&&p.usedKey||l,g=p&&p.exactUsedKey||l,y=Object.prototype.toString.apply(f),v=void 0!==n.joinArrays?n.joinArrays:this.options.joinArrays,b=!this.i18nFormat||this.i18nFormat.handleAsObject,x="string"!=typeof f&&"boolean"!=typeof f&&"number"!=typeof f;if(b&&f&&x&&0>["[object Number]","[object Function]","[object RegExp]"].indexOf(y)&&("string"!=typeof v||"[object Array]"!==y)){if(!n.returnObjects&&!this.options.returnObjects)return this.logger.warn("accessing an object - but returnObjects options is not enabled!"),this.options.returnedObjectHandler?this.options.returnedObjectHandler(m,f,n):"key '".concat(l," (").concat(this.language,")' returned an object instead of string.");if(o){var _="[object Array]"===y,A=_?[]:{},E=_?g:m;for(var C in f)if(Object.prototype.hasOwnProperty.call(f,C)){var D="".concat(E).concat(o).concat(C);A[C]=this.translate(D,e1({},n,{joinArrays:!1,ns:u})),A[C]===D&&(A[C]=f[C])}f=A}}else if(b&&"string"==typeof v&&"[object Array]"===y)(f=f.join(v))&&(f=this.extendTranslation(f,t,n,i));else{var w=!1,S=!1,F=void 0!==n.count&&"string"!=typeof n.count,T=r.hasDefaultValue(n),N=F?this.pluralResolver.getSuffix(c,n.count):"",I=n["defaultValue".concat(N)]||n.defaultValue;!this.isValidLookup(f)&&T&&(w=!0,f=I),this.isValidLookup(f)||(S=!0,f=l);var O=T&&I!==f&&this.options.updateMissing;if(S||w||O){if(this.logger.log(O?"updateKey":"missingKey",c,h,l,O?I:f),o){var k=this.resolve(l,e1({},n,{keySeparator:!1}));k&&k.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var M=[],B=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if("fallback"===this.options.saveMissingTo&&B&&B[0])for(var L=0;L<B.length;L++)M.push(B[L]);else"all"===this.options.saveMissingTo?M=this.languageUtils.toResolveHierarchy(n.lng||this.language):M.push(n.lng||this.language);var R=function(t,r,i){s.options.missingKeyHandler?s.options.missingKeyHandler(t,h,r,O?i:f,O,n):s.backendConnector&&s.backendConnector.saveMissing&&s.backendConnector.saveMissing(t,h,r,O?i:f,O,n),s.emit("missingKey",t,h,r,f)};this.options.saveMissing&&(this.options.saveMissingPlurals&&F?M.forEach(function(t){s.pluralResolver.getSuffixes(t).forEach(function(r){R([t],l+r,n["defaultValue".concat(r)]||I)})}):R(M,l,I))}f=this.extendTranslation(f,t,n,p,i),S&&f===l&&this.options.appendNamespaceToMissingKey&&(f="".concat(h,":").concat(l)),S&&this.options.parseMissingKeyHandler&&(f=this.options.parseMissingKeyHandler(f))}return f}},{key:"extendTranslation",value:function(t,r,n,i,s){var o=this;if(this.i18nFormat&&this.i18nFormat.parse)t=this.i18nFormat.parse(t,n,i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init(e1({},n,{interpolation:e1({},this.options.interpolation,n.interpolation)}));var a,l=n.interpolation&&n.interpolation.skipOnVariables||this.options.interpolation.skipOnVariables;if(l){var u=t.match(this.interpolator.nestingRegexp);a=u&&u.length}var h=n.replace&&"string"!=typeof n.replace?n.replace:n;if(this.options.interpolation.defaultVariables&&(h=e1({},this.options.interpolation.defaultVariables,h)),t=this.interpolator.interpolate(t,h,n.lng||this.language,n),l){var c=t.match(this.interpolator.nestingRegexp);a<(c&&c.length)&&(n.nest=!1)}!1!==n.nest&&(t=this.interpolator.nest(t,function(){for(var t=arguments.length,i=Array(t),a=0;a<t;a++)i[a]=arguments[a];return s&&s[0]===i[0]&&!n.context?(o.logger.warn("It seems you are nesting recursively key: ".concat(i[0]," in key: ").concat(r[0])),null):o.translate.apply(o,i.concat([r]))}
5,n)),n.interpolation&&this.interpolator.reset()}var d=n.postProcess||this.options.postProcess,p="string"==typeof d?[d]:d;return null!=t&&p&&p.length&&!1!==n.applyPostProcessor&&(t=tf.handle(p,t,r,this.options&&this.options.postProcessPassResolved?e1({i18nResolved:i},n):n,this)),t}},{key:"resolve",value:function(t){var r,n,i,s,o,a=this,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof t&&(t=[t]),t.forEach(function(t){if(!a.isValidLookup(r)){var u=a.extractFromKey(t,l),h=u.key;n=h;var c=u.namespaces;a.options.fallbackNS&&(c=c.concat(a.options.fallbackNS));var d=void 0!==l.count&&"string"!=typeof l.count,p=void 0!==l.context&&"string"==typeof l.context&&""!==l.context,f=l.lngs?l.lngs:a.languageUtils.toResolveHierarchy(l.lng||a.language,l.fallbackLng);c.forEach(function(t){a.isValidLookup(r)||(o=t,!tm["".concat(f[0],"-").concat(t)]&&a.utils&&a.utils.hasLoadedNamespace&&!a.utils.hasLoadedNamespace(o)&&(tm["".concat(f[0],"-").concat(t)]=!0,a.logger.warn('key "'.concat(n,'" for languages "').concat(f.join(", "),'" won\'t get resolved as namespace "').concat(o,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),f.forEach(function(n){if(!a.isValidLookup(r)){s=n;var o,u,c=h,f=[c];for(a.i18nFormat&&a.i18nFormat.addLookupKeys?a.i18nFormat.addLookupKeys(f,h,n,t,l):(d&&(o=a.pluralResolver.getSuffix(n,l.count)),d&&p&&f.push(c+o),p&&f.push(c+="".concat(a.options.contextSeparator).concat(l.context)),d&&f.push(c+=o));u=f.pop();)a.isValidLookup(r)||(i=u,r=a.getResource(n,t,u,l))}}))})}}),{res:r,usedKey:n,exactUsedKey:i,usedLng:s,usedNS:o}}},{key:"isValidLookup",value:function(t){return void 0!==t&&!(!this.options.returnNull&&null===t)&&!(!this.options.returnEmptyString&&""===t)}},{key:"getResource",value:function(t,r,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(t,r,n,i):this.resourceStore.getResource(t,r,n,i)}}],[{key:"hasDefaultValue",value:function(t){var r="defaultValue";for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&r===n.substring(0,r.length)&&void 0!==t[n])return!0;return!1}}]),r}(tr);function ty(t){return t.charAt(0).toUpperCase()+t.slice(1)}var tv=function(){function t(r){e2(this,t),this.options=r,this.whitelist=this.options.supportedLngs||!1,this.supportedLngs=this.options.supportedLngs||!1,this.logger=tt.create("languageUtils")}return e3(t,[{key:"getScriptPartFromCode",value:function(t){if(!t||0>t.indexOf("-"))return null;var r=t.split("-");return 2===r.length||(r.pop(),"x"===r[r.length-1].toLowerCase())?null:this.formatLanguageCode(r.join("-"))}},{key:"getLanguagePartFromCode",value:function(t){if(!t||0>t.indexOf("-"))return t;var r=t.split("-");return this.formatLanguageCode(r[0])}},{key:"formatLanguageCode",value:function(t){if("string"==typeof t&&t.indexOf("-")>-1){var r=["hans","hant","latn","cyrl","cans","mong","arab"],n=t.split("-");return this.options.lowerCaseLng?n=n.map(function(t){return t.toLowerCase()}):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),r.indexOf(n[1].toLowerCase())>-1&&(n[1]=ty(n[1].toLowerCase()))):3===n.length&&(n[0]=n[0].toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),"sgn"!==n[0]&&2===n[2].length&&(n[2]=n[2].toUpperCase()),r.indexOf(n[1].toLowerCase())>-1&&(n[1]=ty(n[1].toLowerCase())),r.indexOf(n[2].toLowerCase())>-1&&(n[2]=ty(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}},{key:"isWhitelisted",value:function(t){return this.logger.deprecate("languageUtils.isWhitelisted",'function "isWhitelisted" will be renamed to "isSupportedCode" in the next major - please make sure to rename it\'s usage asap.'),this.isSupportedCode(t)}},{key:"isSupportedCode",value:function(t){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}},{key:"getBestMatchFromCodes",value:function(t){var r,n=this;return t?(t.forEach(function(t){if(!r){var i=n.formatLanguageCode(t);(!n.options.supportedLngs||n.isSupportedCode(i))&&(r=i)}}),!r&&this.options.supportedLngs&&t.forEach(function(t){if(!r){var i=n.getLanguagePartFromCode(t);if(n.isSupportedCode(i))return r=i;r=n.options.supportedLngs.find(function(t){if(0===t.indexOf(i))return t})}}),r||(r=this.getFallbackCodes(this.options.fallbackLng)[0]),r):null}},{key:"getFallbackCodes",value:function(t,r){if(!t)return[];if("function"==typeof t&&(t=t(r)),"string"==typeof t&&(t=[t]),"[object Array]"===Object.prototype.toString.apply(t))return t;if(!r)return t.default||[];var n=t[r];
5return n||(n=t[this.getScriptPartFromCode(r)]),n||(n=t[this.formatLanguageCode(r)]),n||(n=t[this.getLanguagePartFromCode(r)]),n||(n=t.default),n||[]}},{key:"toResolveHierarchy",value:function(t,r){var n=this,i=this.getFallbackCodes(r||this.options.fallbackLng||[],t),s=[],o=function(t){t&&(n.isSupportedCode(t)?s.push(t):n.logger.warn("rejecting language code not found in supportedLngs: ".concat(t)))};return"string"==typeof t&&t.indexOf("-")>-1?("languageOnly"!==this.options.load&&o(this.formatLanguageCode(t)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&o(this.getScriptPartFromCode(t)),"currentOnly"!==this.options.load&&o(this.getLanguagePartFromCode(t))):"string"==typeof t&&o(this.formatLanguageCode(t)),i.forEach(function(t){0>s.indexOf(t)&&o(n.formatLanguageCode(t))}),s}}]),t}(),tb=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","kk","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],tx={1:function(t){return Number(t>1)},2:function(t){return Number(1!=t)},3:function(t){return 0},4:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},5:function(t){return Number(0==t?0:1==t?1:2==t?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5)},6:function(t){return Number(1==t?0:t>=2&&t<=4?1:2)},7:function(t){return Number(1==t?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},8:function(t){return Number(1==t?0:2==t?1:8!=t&&11!=t?2:3)},9:function(t){return Number(t>=2)},10:function(t){return Number(1==t?0:2==t?1:t<7?2:t<11?3:4)},11:function(t){return Number(1==t||11==t?0:2==t||12==t?1:t>2&&t<20?2:3)},12:function(t){return Number(t%10!=1||t%100==11)},13:function(t){return Number(0!==t)},14:function(t){return Number(1==t?0:2==t?1:3==t?2:3)},15:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2)},16:function(t){return Number(t%10==1&&t%100!=11?0:0!==t?1:2)},17:function(t){return Number(+(1!=t&&(t%10!=1||t%100==11)))},18:function(t){return Number(0==t?0:1==t?1:2)},19:function(t){return Number(1==t?0:0==t||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3)},20:function(t){return Number(1==t?0:0==t||t%100>0&&t%100<20?1:2)},21:function(t){return Number(t%100==1?1:t%100==2?2:3*(t%100==3||t%100==4))},22:function(t){return Number(1==t?0:2==t?1:(t<0||t>10)&&t%10==0?2:3)}},t_=function(){function t(r){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e2(this,t),this.languageUtils=r,this.options=i,this.logger=tt.create("pluralResolver"),this.rules=(n={},tb.forEach(function(t){t.lngs.forEach(function(r){n[r]={numbers:t.nr,plurals:tx[t.fc]}})}),n)}return e3(t,[{key:"addRule",value:function(t,r){this.rules[t]=r}},{key:"getRule",value:function(t){return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}},{key:"needsPlural",value:function(t){var r=this.getRule(t);return r&&r.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(t,r){return this.getSuffixes(t).map(function(t){return r+t})}},{key:"getSuffixes",value:function(t){var r=this,n=this.getRule(t);return n?n.numbers.map(function(n){return r.getSuffix(t,n)}):[]}},{key:"getSuffix",value:function(t,r){var n=this,i=this.getRule(t);if(i){var s=i.noAbs?i.plurals(r):i.plurals(Math.abs(r)),o=i.numbers[s];this.options.simplifyPluralSuffix&&2===i.numbers.length&&1===i.numbers[
50]&&(2===o?o="plural":1===o&&(o=""));var a=function(){return n.options.prepend&&o.toString()?n.options.prepend+o.toString():o.toString()};return"v1"===this.options.compatibilityJSON?1===o?"":"number"==typeof o?"_plural_".concat(o.toString()):a():"v2"===this.options.compatibilityJSON?a():this.options.simplifyPluralSuffix&&2===i.numbers.length&&1===i.numbers[0]?a():this.options.prepend&&s.toString()?this.options.prepend+s.toString():s.toString()}return this.logger.warn("no plural rule found for: ".concat(t)),""}}]),t}(),tA=function(){function t(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e2(this,t),this.logger=tt.create("interpolator"),this.options=r,this.format=r.interpolation&&r.interpolation.format||function(t){return t},this.init(r)}return e3(t,[{key:"init",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});var r=t.interpolation;this.escape=void 0!==r.escape?r.escape:tc,this.escapeValue=void 0===r.escapeValue||r.escapeValue,this.useRawValueToEscape=void 0!==r.useRawValueToEscape&&r.useRawValueToEscape,this.prefix=r.prefix?tu(r.prefix):r.prefixEscaped||"{{",this.suffix=r.suffix?tu(r.suffix):r.suffixEscaped||"}}",this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||",",this.unescapePrefix=r.unescapeSuffix?"":r.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":r.unescapeSuffix||"",this.nestingPrefix=r.nestingPrefix?tu(r.nestingPrefix):r.nestingPrefixEscaped||tu("$t("),this.nestingSuffix=r.nestingSuffix?tu(r.nestingSuffix):r.nestingSuffixEscaped||tu(")"),this.nestingOptionsSeparator=r.nestingOptionsSeparator?r.nestingOptionsSeparator:r.nestingOptionsSeparator||",",this.maxReplaces=r.maxReplaces?r.maxReplaces:1e3,this.alwaysFormat=void 0!==r.alwaysFormat&&r.alwaysFormat,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var t="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=RegExp(t,"g");var r="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=RegExp(r,"g");var n="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=RegExp(n,"g")}},{key:"interpolate",value:function(t,r,n,i){var s,o,a,l=this,u=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function h(t){return t.replace(/\$/g,"$$$$")}var c=function(t){if(0>t.indexOf(l.formatSeparator)){var s=tl(r,u,t);return l.alwaysFormat?l.format(s,void 0,n):s}var o=t.split(l.formatSeparator),a=o.shift().trim(),h=o.join(l.formatSeparator).trim();return l.format(tl(r,u,a),h,n,i)};this.resetRegExp();var d=i&&i.missingInterpolationHandler||this.options.missingInterpolationHandler,p=i&&i.interpolation&&i.interpolation.skipOnVariables||this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:function(t){return h(t)}},{regex:this.regexp,safeValue:function(t){return l.escapeValue?h(l.escape(t)):h(t)}}].forEach(function(r){for(a=0;s=r.regex.exec(t);){if(void 0===(o=c(s[1].trim())))if("function"==typeof d){var n=d(t,s,i);o="string"==typeof n?n:""}else if(p){o=s[0];continue}else l.logger.warn("missed to pass in variable ".concat(s[1]," for interpolating ").concat(t)),o="";else"string"==typeof o||l.useRawValueToEscape||(o=ti(o));if(t=t.replace(s[0],r.safeValue(o)),r.regex.lastIndex=0,++a>=l.maxReplaces)break}}),t}},{key:"nest",value:function(t,r){var n,i,s=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=e1({},o);function l(t,r){var n=this.nestingOptionsSeparator;if(0>t.indexOf(n))return t;var i=t.split(new RegExp("".concat(n,"[ ]*{"))),s="{".concat(i[1]);t=i[0],s=(s=this.interpolate(s,a)).replace(/'/g,'"');try{a=JSON.parse(s),r&&(a=e1({},r,a))}catch(r){return this.logger.warn("failed parsing options string in nesting for key ".concat(t),r),"".concat(t).concat(n).concat(s)}return delete a.defaultValue,t}for(a.applyPostProcessor=!1,delete a.defaultValue;n=this.nestingRegexp.exec(t);){var u=[],h=!1;if(n[0].includes(this.formatSeparator)&&!/{.*}/.test(n[1])){var c=n[1].split(this.formatSeparator).map(function(t){return t.trim()});n[1]=c.shift(),u=c,h=!0}if((i=r(l.call(this,n[1].trim(),a),a))&&n[0]===t&&"string"!=typeof i)return i;"string"!=typeof i&&(i=ti(i)),i||(this.logger.warn("missed to resolve ".concat(n[1]," for nesting ").concat(t)),i=""),h&&(i=u.reduce(function(t,r){return s.format(t,r,o.lng,o)},i.trim())),t=t.replace(n[0],i),this.regexp.lastIndex=0}return t}}]),t}(),tE=function(t){function r(t,n,i){var s,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return e2(this,r),s=e8(this,e6(r).call(this)),td&&tr.call(e4(s)),s.backend=t,s.store=n,s.services=i,s.languageUtils=i.languageUtils,s.options=o,s.logger=tt.create("backendConnector"),s.state={},s.queue=[],s.backend&&s.backend.init&&s.backend.init(i,o.backend,o),s}return e7(r,t),e3(r,[{key:"queueLoad",value:function(t,r,n,i){var s=this,o=[],a=[],l=[],u=[];return t.forEach(function(t){var i=!0;r.forEach(function(r){var l="".concat(t,"|").concat(r);!n.reload&&s.store.hasResourceBundle(t,r)?s.state[l]=2:s.state[l]<0||(1===s.state[l]?0>a.indexOf(l)&&a.push(l):(s.state[l]=1,i=!1,0>a.indexOf(l)&&a.push(l),0>o.indexOf(l)&&o.push(l),0>u.indexOf(r)&&u.push(r)))}),i||l.push(t)}),(o.length||a.length)&&this.queue.push({pending:a,loaded:{},errors:[],callback:i}),{toLoad:o,pending:a,toLoadLanguages:l,toLoadNamespaces:u}}},{key:"loaded",value:function(t,r,n){var i=t.split("|"),s=i[0],o=i[1];
5r&&this.emit("failedLoading",s,o,r),n&&this.store.addResourceBundle(s,o,n),this.state[t]=r?-1:2;var a={};this.queue.forEach(function(n){i=n.loaded,(h=(u=ts(i,[s],Object)).obj)[c=u.k]=h[c]||[],l||h[c].push(o);for(var i,l,u,h,c,d=n.pending,p=d.indexOf(t);-1!==p;)d.splice(p,1),p=d.indexOf(t);r&&n.errors.push(r),0!==n.pending.length||n.done||(Object.keys(n.loaded).forEach(function(t){a[t]||(a[t]=[]),n.loaded[t].length&&n.loaded[t].forEach(function(r){0>a[t].indexOf(r)&&a[t].push(r)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(function(t){return!t.done})}},{key:"read",value:function(t,r,n){var i=this,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:350,a=arguments.length>5?arguments[5]:void 0;return t.length?this.backend[n](t,r,function(l,u){if(l&&u&&s<5)return void setTimeout(function(){i.read.call(i,t,r,n,s+1,2*o,a)},o);a(l,u)}):a(null,{})}},{key:"prepareLoading",value:function(t,r){var n=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();"string"==typeof t&&(t=this.languageUtils.toResolveHierarchy(t)),"string"==typeof r&&(r=[r]);var o=this.queueLoad(t,r,i,s);if(!o.toLoad.length)return o.pending.length||s(),null;o.toLoad.forEach(function(t){n.loadOne(t)})}},{key:"load",value:function(t,r,n){this.prepareLoading(t,r,{},n)}},{key:"reload",value:function(t,r,n){this.prepareLoading(t,r,{reload:!0},n)}},{key:"loadOne",value:function(t){var r=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=t.split("|"),s=i[0],o=i[1];this.read(s,o,"read",void 0,void 0,function(i,a){i&&r.logger.warn("".concat(n,"loading namespace ").concat(o," for language ").concat(s," failed"),i),!i&&a&&r.logger.log("".concat(n,"loaded namespace ").concat(o," for language ").concat(s),a),r.loaded(t,i,a)})}},{key:"saveMissing",value:function(t,r,n,i,s){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(r))return void this.logger.warn('did not save key "'.concat(n,'" as the namespace "').concat(r,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");null!=n&&""!==n&&(this.backend&&this.backend.create&&this.backend.create(t,r,n,i,null,e1({},o,{isUpdate:s})),t&&t[0]&&this.store.addResource(t[0],r,n,i))}}]),r}(tr);function tC(t){return"string"==typeof t.ns&&(t.ns=[t.ns]),"string"==typeof t.fallbackLng&&(t.fallbackLng=[t.fallbackLng]),"string"==typeof t.fallbackNS&&(t.fallbackNS=[t.fallbackNS]),t.whitelist&&(t.whitelist&&0>t.whitelist.indexOf("cimode")&&(t.whitelist=t.whitelist.concat(["cimode"])),t.supportedLngs=t.whitelist),t.nonExplicitWhitelist&&(t.nonExplicitSupportedLngs=t.nonExplicitWhitelist),t.supportedLngs&&0>t.supportedLngs.indexOf("cimode")&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),t}function tD(){}var tw=new(function(t){function r(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;if(e2(this,r),t=e8(this,e6(r).call(this)),td&&tr.call(e4(t)),t.options=tC(n),t.services={},t.logger=tt,t.modules={external:[]},i&&!t.isInitialized&&!n.isClone){if(!t.options.initImmediate)return t.init(n,i),e8(t,e4(t));setTimeout(function(){t.init(n,i)},0)}return t}return e7(r,t),e3(r,[{key:"init",value:function(){var t=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;function i(t){return t?"function"==typeof t?new t:t:null}if("function"==typeof r&&(n=r,r={}),r.whitelist&&!r.supportedLngs&&this.logger.deprecate("whitelist",'option "whitelist" will be renamed to "supportedLngs" in the next major - please make sure to rename this option asap.'),r.nonExplicitWhitelist&&!r.nonExplicitSupportedLngs&&this.logger.deprecate("whitelist",'options "
5nonExplicitWhitelist" will be renamed to "nonExplicitSupportedLngs" in the next major - please make sure to rename this option asap.'),this.options=e1({},{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,whitelist:!1,nonExplicitWhitelist:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(t){var r={};if("object"===eQ(t[1])&&(r=t[1]),"string"==typeof t[1]&&(r.defaultValue=t[1]),"string"==typeof t[2]&&(r.tDescription=t[2]),"object"===eQ(t[2])||"object"===eQ(t[3])){var n=t[3]||t[2];Object.keys(n).forEach(function(t){r[t]=n[t]})}return r},interpolation:{escapeValue:!0,format:function(t,r,n,i){return t},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!1}},this.options,tC(r)),this.format=this.options.interpolation.format,n||(n=tD),!this.options.isClone){this.modules.logger?tt.init(i(this.modules.logger),this.options):tt.init(null,this.options);var s=new tv(this.options);this.store=new tp(this.options.resources,this.options);var o=this.services;o.logger=tt,o.resourceStore=this.store,o.languageUtils=s,o.pluralResolver=new t_(s,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),o.interpolator=new tA(this.options),o.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},o.backendConnector=new tE(i(this.modules.backend),o.resourceStore,o,this.options),o.backendConnector.on("*",function(r){for(var n=arguments.length,i=Array(n>1?n-1:0),s=1;s<n;s++)i[s-1]=arguments[s];t.emit.apply(t,[r].concat(i))}),this.modules.languageDetector&&(o.languageDetector=i(this.modules.languageDetector),o.languageDetector.init(o,this.options.detection,this.options)),this.modules.i18nFormat&&(o.i18nFormat=i(this.modules.i18nFormat),o.i18nFormat.init&&o.i18nFormat.init(this)),this.translator=new tg(this.services,this.options),this.translator.on("*",function(r){for(var n=arguments.length,i=Array(n>1?n-1:0),s=1;s<n;s++)i[s-1]=arguments[s];t.emit.apply(t,[r].concat(i))}),this.modules.external.forEach(function(r){r.init&&r.init(t)})}if(this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var a=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);a.length>0&&"dev"!==a[0]&&(this.options.lng=a[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(function(r){t[r]=function(){var n;return(n=t.store)[r].apply(n,arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(function(r){t[r]=function(){var n;return(n=t.store)[r].apply(n,arguments),t}});var l=tn(),u=function(){var r=function(r,i){t.isInitialized&&t.logger.warn("init: i18next is already initialized. You should call init just once!"),t.isInitialized=!0,t.options.isClone||t.logger.log("initialized",t.options),t.emit("initialized",t.options),l.resolve(i),n(r,i)};if(t.languages&&"v1"!==t.options.compatibilityAPI&&!t.isInitialized)return r(null,t.t.bind(t));t.changeLanguage(t.options.lng,r)};return this.options.resources||!this.options.initImmediate?u():setTimeout(u,0),l}},{key:"loadResources",value:function(t){var r=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tD,i=n,s="string"==typeof t?t:this.language;if("function"==typeof t&&(i=t),!this.options.resources||this.options.partialBundledLanguages){if(s&&"cimode"===s.toLowerCase())return i();var o=[],a=function(t){t&&r.services.languageUtils.toResolveHierarchy(t).forEach(function(t){0>o.indexOf(t)&&o.push(t)})};s?a(s):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(function(t){return a(t)}
5),this.options.preload&&this.options.preload.forEach(function(t){return a(t)}),this.services.backendConnector.load(o,this.options.ns,i)}else i(null)}},{key:"reloadResources",value:function(t,r,n){var i=tn();return t||(t=this.languages),r||(r=this.options.ns),n||(n=tD),this.services.backendConnector.reload(t,r,function(t){i.resolve(),n(t)}),i}},{key:"use",value:function(t){if(!t)throw Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===t.type&&(this.modules.backend=t),("logger"===t.type||t.log&&t.warn&&t.error)&&(this.modules.logger=t),"languageDetector"===t.type&&(this.modules.languageDetector=t),"i18nFormat"===t.type&&(this.modules.i18nFormat=t),"postProcessor"===t.type&&tf.addPostProcessor(t),"3rdParty"===t.type&&this.modules.external.push(t),this}},{key:"changeLanguage",value:function(t,r){var n=this;this.isLanguageChangingTo=t;var i=tn();this.emit("languageChanging",t);var s=function(t,s){s?(n.language=s,n.languages=n.services.languageUtils.toResolveHierarchy(s),n.translator.changeLanguage(s),n.isLanguageChangingTo=void 0,n.emit("languageChanged",s),n.logger.log("languageChanged",s)):n.isLanguageChangingTo=void 0,i.resolve(function(){return n.t.apply(n,arguments)}),r&&r(t,function(){return n.t.apply(n,arguments)})},o=function(t){var r="string"==typeof t?t:n.services.languageUtils.getBestMatchFromCodes(t);r&&(n.language||(n.language=r,n.languages=n.services.languageUtils.toResolveHierarchy(r)),n.translator.language||n.translator.changeLanguage(r),n.services.languageDetector&&n.services.languageDetector.cacheUserLanguage(r)),n.loadResources(r,function(t){s(t,r)})};return t||!this.services.languageDetector||this.services.languageDetector.async?!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(o):o(t):o(this.services.languageDetector.detect()),i}},{key:"getFixedT",value:function(t,r){var n=this,i=function t(r,i){var s;if("object"!==eQ(i)){for(var o=arguments.length,a=Array(o>2?o-2:0),l=2;l<o;l++)a[l-2]=arguments[l];s=n.options.overloadTranslationOptionHandler([r,i].concat(a))}else s=e1({},i);return s.lng=s.lng||t.lng,s.lngs=s.lngs||t.lngs,s.ns=s.ns||t.ns,n.t(r,s)};return"string"==typeof t?i.lng=t:i.lngs=t,i.ns=r,i}},{key:"t",value:function(){var t;return this.translator&&(t=this.translator).translate.apply(t,arguments)}},{key:"exists",value:function(){var t;return this.translator&&(t=this.translator).exists.apply(t,arguments)}},{key:"setDefaultNamespace",value:function(t){this.options.defaultNS=t}},{key:"hasLoadedNamespace",value:function(t){var r=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;
5if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var i=this.languages[0],s=!!this.options&&this.options.fallbackLng,o=this.languages[this.languages.length-1];if("cimode"===i.toLowerCase())return!0;var a=function(t,n){var i=r.services.backendConnector.state["".concat(t,"|").concat(n)];return -1===i||2===i};if(n.precheck){var l=n.precheck(this,a);if(void 0!==l)return l}return!!(this.hasResourceBundle(i,t)||!this.services.backendConnector.backend||a(i,t)&&(!s||a(o,t)))}},{key:"loadNamespaces",value:function(t,r){var n=this,i=tn();return this.options.ns?("string"==typeof t&&(t=[t]),t.forEach(function(t){0>n.options.ns.indexOf(t)&&n.options.ns.push(t)}),this.loadResources(function(t){i.resolve(),r&&r(t)}),i):(r&&r(),Promise.resolve())}},{key:"loadLanguages",value:function(t,r){var n=tn();"string"==typeof t&&(t=[t]);var i=this.options.preload||[],s=t.filter(function(t){return 0>i.indexOf(t)});return s.length?(this.options.preload=i.concat(s),this.loadResources(function(t){n.resolve(),r&&r(t)}),n):(r&&r(),Promise.resolve())}},{key:"dir",value:function(t){return(t||(t=this.languages&&this.languages.length>0?this.languages[0]:this.language),t)?["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam"].indexOf(this.services.languageUtils.getLanguagePartFromCode(t))>=0?"rtl":"ltr":"rtl"}},{key:"createInstance",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new r(t,n)}},{key:"cloneInstance",value:function(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tD,s=e1({},this.options,n,{isClone:!0}),o=new r(s);return["store","services","language"].forEach(function(r){o[r]=t[r]}),o.services=e1({},this.services),o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o.translator=new tg(o.services,o.options),o.translator.on("*",function(t){for(var r=arguments.length,n=Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];o.emit.apply(o,[t].concat(n))}),o.init(s,i),o.translator.options=o.options,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}}]),r}(tr)),tS=[],tF=tS.forEach,tT=tS.slice,tN={create:function(t,r,n,i){var s,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{path:"/"};if(n){var a=new Date;a.setTime(a.getTime()+60*n*1e3),s="; expires="+a.toUTCString()}else s="";i=i?"domain="+i+";":"",o=Object.keys(o).reduce(function(t,r){return t+";"+r.replace(/([A-Z])/g,function(t){return"-"+t.toLowerCase()})+"="+o[r]},""),document.cookie=t+"="+encodeURIComponent(r)+s+";"+i+o},read:function(t){for(var r=t+"=",n=document.cookie.split(";"),i=0;i<n.length;i++){for(var s=n[i];" "===s.charAt(0);)s=s.substring(1,s.length);if(0===s.indexOf(r))return s.substring(r.length,s.length)}return null},remove:function(t){this.create(t,"",-1)}},tI={name:"cookie",lookup:function(t){var r;if(t.lookupCookie&&"undefined"!=typeof document){var n=tN.read(t.lookupCookie);n&&(r=n)}return r},cacheUserLanguage:function(t,r){r.lookupCookie&&"undefined"!=typeof document&&tN.create(r.lookupCookie,t,r.cookieMinutes,r.cookieDomain,r.cookieOptions)}},tO={name:"querystring",lookup:function(t){var r;if("undefined"!=typeof window)for(var n=window.location.search.substring(1).split("&"),i=0;i<n.length;i++){var s=n[i].indexOf("=");s>0&&n[i].substring(0,s)===t.lookupQuerystring&&(r=n[i].substring(s+1))}return r}};try{i="undefined"!==window&&null!==window.localStorage;var tk="i18next.translate.boo";window.localStorage.setItem(tk,"foo"),window.localStorage.removeItem(tk)}catch(t){i=!1}var tM={name:"localStorage",lookup:function(t){var r;if(t.lookupLocalStorage&&i){var n=window.localStorage.getItem(t.lookupLocalStorage);
vendor: 3,219 bytes, line 5
5n&&(r=n)}return r},cacheUserLanguage:function(t,r){r.lookupLocalStorage&&i&&window.localStorage.setItem(r.lookupLocalStorage,t)}};try{s="undefined"!==window&&null!==window.sessionStorage;var tB="i18next.translate.boo";window.sessionStorage.setItem(tB,"foo"),window.sessionStorage.removeItem(tB)}catch(t){s=!1}var tL={name:"sessionStorage",lookup:function(t){var r;if(t.lookupsessionStorage&&s){var n=window.sessionStorage.getItem(t.lookupsessionStorage);n&&(r=n)}return r},cacheUserLanguage:function(t,r){r.lookupsessionStorage&&s&&window.sessionStorage.setItem(r.lookupsessionStorage,t)}},tR={name:"navigator",lookup:function(t){var r=[];if("undefined"!=typeof navigator){if(navigator.languages)for(var n=0;n<navigator.languages.length;n++)r.push(navigator.languages[n]);navigator.userLanguage&&r.push(navigator.userLanguage),navigator.language&&r.push(navigator.language)}return r.length>0?r:void 0}},tP={name:"htmlTag",lookup:function(t){var r,n=t.htmlTag||("undefined"!=typeof document?document.documentElement:null);return n&&"function"==typeof n.getAttribute&&(r=n.getAttribute("lang")),r}},tz={name:"path",lookup:function(t){var r;if("undefined"!=typeof window){var n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(n instanceof Array)if("number"==typeof t.lookupFromPathIndex){if("string"!=typeof n[t.lookupFromPathIndex])return;r=n[t.lookupFromPathIndex].replace("/","")}else r=n[0].replace("/","")}return r}},tU={name:"subdomain",lookup:function(t){var r;if("undefined"!=typeof window){var n=window.location.href.match(/(?:http[s]*\:\/\/)*(.*?)\.(?=[^\/]*\..{2,5})/gi);n instanceof Array&&(r="number"==typeof t.lookupFromSubdomainIndex?n[t.lookupFromSubdomainIndex].replace("http://","").replace("https://","").replace(".",""):n[0].replace("http://","").replace("https://","").replace(".",""))}return r}},t$=function(){function t(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e2(this,t),this.type="languageDetector",this.detectors={},this.init(r,n)}return e3(t,[{key:"init",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.services=t,this.options=function(t){return tF.call(tT.call(arguments,1),function(r){if(r)for(var n in r)void 0===t[n]&&(t[n]=r[n])}),t}(r,this.options||{},{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],checkWhitelist:!0,checkForSimilarInWhitelist:!1}),this.options.checkForSimilarInWhitelist&&(this.options.checkWhitelist=!0),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=n,this.addDetector(tI),this.addDetector(tO),this.addDetector(tM),this.addDetector(tL),this.addDetector(tR),this.addDetector(tP),this.addDetector(tz),this.addDetector(tU)}},{key:"addDetector",value:function(t){this.detectors[t.name]=t}},{key:"detect",value:function(t){var r,n=this;t||(t=this.options.order);var i=[];if(t.forEach(function(t){if(n.detectors[t]){var r=n.detectors[t].lookup(n.options);r&&"string"==typeof r&&(r=[r]),r&&(i=i.concat(r))}}
5),i.forEach(function(t){if(!r){var i=n.services.languageUtils.formatLanguageCode(t);(!n.options.checkWhitelist||n.services.languageUtils.isWhitelisted(i))&&(r=i),!r&&n.options.checkForSimilarInWhitelist&&(r=n.getSimilarInWhitelist(i))}}),!r){var s=this.i18nOptions.fallbackLng;"string"==typeof s&&(s=[s]),s||(s=[]),r="[object Array]"===Object.prototype.toString.apply(s)?s[0]:s[0]||s.default&&s.default[0]}return r}},{key:"cacheUserLanguage",value:function(t,r){var n=this;r||(r=this.options.caches),r&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(t)>-1||r.forEach(function(r){n.detectors[r]&&n.detectors[r].cacheUserLanguage(t,n.options)}))}},{key:"getSimilarInWhitelist",value:function(t){var r=this;if(this.i18nOptions.whitelist){if(t.includes("-")){var n=t.split("-")[0],i=this.services.languageUtils.formatLanguageCode(n);if(this.services.languageUtils.isWhitelisted(i))return i;t=i}var s=this.i18nOptions.whitelist.find(function(n){var i=r.services.languageUtils.formatLanguageCode(n);if(i.startsWith(t))return i});if(s)return s}}}]),t}();t$.type="languageDetector";var tj={en:{translation:{fes:{autoplay:"The media that tried to play (with '{{src}}') wasn't allowed to by this browser, most likely due to the browser's autoplay policy.\n\n+ More info: {{url}}",checkUserDefinedFns:"It seems that you may have accidentally written {{name}} instead of {{actualName}}. Please correct it if it's not intentional.",fileLoadError:{bytes:"It looks like there was a problem loading your file. {{suggestion}}",font:"It looks like there was a problem loading your font. {{suggestion}}",gif:"There was some trouble loading your GIF. Make sure that your GIF is using 87a or 89a encoding.",image:"It looks like there was a problem loading your image. {{suggestion}}",json:"It looks like there was a problem loading your JSON file. {{suggestion}}",large:"If your large file isn't fetched successfully, we recommend splitting the file into smaller segments and fetching those.",strings:"It looks like there was a problem loading your text file. {{suggestion}}",suggestion:"Try checking if the file path ({{filePath}}) is correct, hosting the file online, or running a local server.\n\n+ More info: {{url}}",table:"It looks like there was a problem loading your table file. {{suggestion}}",xml:"It looks like there was a problem loading your XML file. {{suggestion}}"},friendlyParamError:{type_EMPTY_VAR:"{{location}} {{func}}() was expecting {{formatType}} for the {{position}} parameter, received an empty variable instead. If not intentional, this is often a problem with scope.\n\n+ More info: {{url}}",type_TOO_FEW_ARGUMENTS:"{{location}} {{func}}() was expecting at least {{minParams}} arguments, but received only {{argCount}}.",type_TOO_MANY_ARGUMENTS:"{{location}} {{func}}() was expecting no more than {{maxParams}} arguments, but received {{argCount}}.",type_WRONG_TYPE:"{{location}} {{func}}() was expecting {{formatType}} for the {{position}} parameter, received {{argType}} instead."},globalErrors:{reference:{cannotAccess:'\n{{location}} "{{symbol}}" is used before declaration. Make sure you have declared the variable before using it.\n\n+ More info: {{url}}',notDefined:'\n{{location}} "{{symbol}}" is not defined in the current scope. If you have defined it in your code, you should check its scope, spelling, and letter-casing (JavaScript is case-sensitive).\n\n+ More info: {{url}}'},stackSubseq:"└[{{location}}] \n	 Called from line {{line}} in {{func}}()\n",stackTop:"┌[{{location}}] \n	 Error at line {{line}} in {{func}}()\n",syntax:{badReturnOrYield:"\nSyntax Error - return lies outside of a function. Make sure you’re not missing any brackets, so that return lies inside a function.\n\n+ More info: {{url}}",invalidToken:"\nSyntax Error - Found a symbol that JavaScript doesn't recognize or didn't expect at it's place.\n\n+ More info: {{url}}",missingInitializer:"\nSyntax Error - A const variable is declared but not initialized. In JavaScript, an initializer for a const is required. A value must be specified in the same statement in which the variable is declared. Check the line number in the error and assign the const variable a value.\n\n+ More info: {{url}}",redeclaredVariable:'\nSyntax Error - "{{symbol}}" is being redeclared. JavaScript doesn\'t allow declaring a variable more than once. Check the line number in error for redeclaration of the variable.\n\n+ More info: {{url}}',unexpectedToken:"\nSyntax Error - Symbol present at a place that wasn't expected.\nUsually this is due to a typo. Check the line number in the error for anything missing/extra.\n\n+ More info: {{url}}"}
5,type:{constAssign:"\n{{location}} A const variable is being re-assigned. In javascript, re-assigning a value to a constant is not allowed. If you want to re-assign new values to a variable, make sure it is declared as var or let.\n\n+ More info: {{url}}",notfunc:'\n{{location}} "{{symbol}}" could not be called as a function.\nCheck the spelling, letter-casing (JavaScript is case-sensitive) and its type.\n\n+ More info: {{url}}',notfuncObj:'\n{{location}} "{{symbol}}" could not be called as a function.\nVerify whether "{{obj}}" has "{{symbol}}" in it and check the spelling, letter-casing (JavaScript is case-sensitive) and its type.\n\n+ More info: {{url}}',readFromNull:"\n{{location}} The property of null can't be read. In javascript the value null indicates that an object has no value.\n\n+ More info: {{url}}",readFromUndefined:"\n{{location}} Cannot read property of undefined. Check the line number in error and make sure the variable which is being operated is not undefined.\n\n + More info: {{url}}"}},libraryError:'{{location}} An error with message "{{error}}" occurred inside the p5js library when {{func}} was called. If not stated otherwise, it might be an issue with the arguments passed to {{func}}.',location:"[{{file}}, line {{line}}]",misspelling:'{{location}} It seems that you may have accidentally written "{{name}}" instead of "{{actualName}}". Please correct it to {{actualName}} if you wish to use the {{type}} from p5.js.',misspelling_plural:'{{location}} It seems that you may have accidentally written "{{name}}".\nYou may have meant one of the following: \n{{suggestions}}',misusedTopLevel:"Did you just try to use p5.js's {{symbolName}} {{symbolType}}? If so, you may want to move it into your sketch's setup() function.\n\n+ More info: {{url}}",preloadDisabled:"The preload() function has been removed in p5.js 2.0. Please load assets in setup() using async / await keywords or callbacks instead. See https://github.com/processing/p5.js-compatibility for more information about 2.0 and compatibility, or https://dev.to/limzykenneth/asynchronous-p5js-20-458f for more information about promises and async/await.",positions:{p_1:"first",p_10:"tenth",p_11:"eleventh",p_12:"twelfth",p_2:"second",p_3:"third",p_4:"fourth",p_5:"fifth",p_6:"sixth",p_7:"seventh",p_8:"eighth",p_9:"ninth"},pre:"\n\uD83C\uDF38 p5.js says: {{message}}",sketchReaderErrors:{reservedConst:'you have used a p5.js reserved variable "{{symbol}}" make sure you change the variable name to something else.\n\n+ More info: {{url}}',reservedFunc:'you have used a p5.js reserved function "{{symbol}}" make sure you change the function name to something else.\n\n+ More info: {{url}}'},welcome:"Welcome! This is your friendly debugger. To turn me off, switch to using p5.min.js.",wrongPreload:'{{location}} An error with message "{{error}}" occurred inside the p5js library when "{{func}}" was called. If not stated otherwise, it might be due to "{{func}}" being called from preload. Nothing besides load calls (loadImage, loadJSON, loadFont, loadStrings, etc.) should be inside the preload function.'}}}};let tV=["en","es","ko","zh","hi","ja"];if("undefined"==typeof IS_MINIFIED&&"undefined"!=typeof P5_DEV_BUILD){let t=require("../../translations/dev");for(let r of Object.keys(t)){let n=r.split("_"),i=n.slice(0,n.length-1).join("-"),s=n[n.length-1];tj[i]=tj[i]||{},tj[i][s]=t[r]}}class tG{constructor(t,r){this.init(t,r)}fetchWithTimeout(t,r,n=2e3){return Promise.race([fetch(t,r),new Promise((t,r)=>setTimeout(()=>r(Error("timeout")),n))])}init(t,r={}){this.services=t,this.options=r}read(t,r,n){let i=this.options.loadPath;if(t===this.options.fallback)n(null,tj[t][r]);else if(tV.includes(t)){let s=this.services.interpolator.interpolate(i,{lng:t,ns:r});this.loadUrl(s,n)}else n("Not found",!1)}loadUrl(t,r){this.fetchWithTimeout(t).then(r=>{if(!r.ok)throw Error(`failed loading ${t}`);return r.json()},()=>{throw Error(`failed loading ${t}`)}).then(t=>r(null,t)).catch(r)}}tG.type="backend";let tH=(t,r)=>{console.debug("p5.js translator called before translations were loaded"),tw.t(t,r)},tq={ReferenceError:[{msg:"{{}} is not defined",type:"NOTDEFINED",browser:"all"},{msg:"Can't find variable: {{}}",type:"NOTDEFINED",browser:"Safari"},{msg:"Cannot access '{{.}}' before initialization",type:"CANNOTACCESS",browser:"Chrome"},{msg:"can't access lexical declaration '{{.}}' before initialization",type:"CANNOTACCESS",browser:"Firefox"}],SyntaxError:[{msg:"illegal character",type:"INVALIDTOKEN",browser:"Firefox"},{msg:"Invalid character",type:"INVALIDTOKEN",browser:"Safari"},{msg:"Invalid or unexpected token",type:"INVALIDTOKEN",browser:"Chrome"},{msg:"Unexpected token '{{.}}'",type:"UNEXPECTEDTOKEN",browser:"Chrome"},{msg:"expected {{.}}, got '{{.}}'",type:"UNEXPECTEDTOKEN",browser:"Chrome"},{msg:"Identifier '{{.}}' has already been declared",type:"REDECLAREDVARIABLE",browser:"Chrome"},{msg:"redeclaration of {} {{.}}",type:"REDECLAREDVARIABLE",browser:"Firefox"},{msg:"Missing initializer in const declaration",type:"MISSINGINITIALIZER",browser:"Chrome"},{msg:"missing = in const declaration",type:"MISSINGINITIALIZER",browser:"Firefox"},{msg:"Illegal return statement",type:"BADRETURNORYIELD",browser:"Chrome"},{msg:"return not in function",type:"BADRETURNORYIELD",browser:"Firefox"}],TypeError:[{msg:"{{.}} is not a function",type:"NOTFUNC",browser:"all"},{msg:"Cannot read {{.}} null",type:"READNULL",browser:"Chrome"},{msg:"{{.}} is null",type:"READNULL",browser:"Firefox"},{msg:"Cannot read {{.}} undefined",type:"READUDEFINED",browser:"Chrome"},{msg:"{{.}} is undefined",type:"READUDEFINED",browser:"Firefox"},{msg:"Assignment to constant variable",type:"CONSTASSIGN",browser:"Chrome"},{msg:"invalid assignment to const '{{.}}'",type:"CONSTASSIGN",browser:"Firefox"}]};function tW(t,r){let n=["#2D7BB6","#EE9900","#4DB200","#C83C00"],i=null,s=null;
5class o extends Error{}if("undefined"!=typeof IS_MINIFIED)t._friendlyError=t._checkForUserDefinedFunctions=t._fesErrorMonitor=()=>{};else{let a={},l=a.toString,u=["Boolean","Number","String","Function","Array","Date","RegExp","Object","Error"];for(let t=0;t<u.length;t++)a[`[object ${u[t]}]`]=u[t].toLowerCase();let h=t=>null==t?`${t}`:"object"==typeof t||"function"==typeof t?a[l.call(t)]||"object":typeof t,c=["setup","draw","deviceMoved","deviceTurned","deviceShaken","doubleClicked","mousePressed","mouseReleased","mouseMoved","mouseDragged","mouseClicked","mouseWheel","touchStarted","touchMoved","touchEnded","keyPressed","keyReleased","keyTyped","windowResized"],d=(t,r)=>{let n="";if(null==r||"load"===r.substring(0,4))n=t;else{let i=r.split("."),s=i.length>1?`${i[0]}.${i[1]}`:"p5",o=1===i.length?r:i.slice(2).join("/");n=o.startsWith("p5.")?`${t} (https://p5js.org/reference/${s}.${o})`:`${t} (https://p5js.org/reference/${s}/${o})`}return n};t._report=(r,i,s)=>{let o=null==t._fesLogger?console.log.bind(console):t._fesLogger;"undefined"===h(s)?s="#B40033":"number"===h(s)&&(s=n[s]),r=d(r,i),o(tH("fes.pre",{message:r}))},t._error=(r,n,i)=>{throw t._report(n,i),r.hitCriticalError=!0,new o("Stopping sketch to prevent more errors")},t._friendlyError=function(r,n,i){t.disableFriendlyErrors||t._report(r,n,i)},t._friendlyAutoplayError=function(t){let r=tH("fes.autoplay",{src:t,url:"https://developer.mozilla.org/docs/Web/Media/Autoplay_guide"});console.log(tH("fes.pre",{message:r}))},t.isPreloadSupported=function(){return!1};let p=r=>{if(t.disableFriendlyErrors)return;(r=r instanceof t?r:window).preload&&!t.isPreloadSupported()&&t._error(r,tH("fes.preloadDisabled"));let n={};for(let i of(c.forEach(t=>{n[t.toLowerCase()]=t}),Object.keys(r))){let s=i.toLowerCase();if(n.hasOwnProperty(s)&&!r[n[s]]&&"function"==typeof r[i]){let r=tH("fes.checkUserDefinedFns",{name:i,actualName:n[s]});t._friendlyError(r,n[s])}}},f=r=>{let n=t._fesLogger&&"function"==typeof t._fesLogger?t._fesLogger:console.log.bind(console);if(r.length>1){let t="";r.forEach((r,n)=>{let i=`${r.fileName}:${r.lineNumber}:${r.columnNumber}`,s,o={func:r.functionName,line:r.lineNumber,location:i,file:r.fileName.split("/").slice(-1)};s=0===n?tH("fes.globalErrors.stackTop",o):tH("fes.globalErrors.stackSubseq",o),t+=s}),n(t)}};t._fesErrorMonitor=n=>{let a,l,u;if(t.disableFriendlyErrors||n&&(n instanceof o||n.reason instanceof o))return;if(n instanceof Error)a=n;else if(n instanceof ErrorEvent)a=n.error;else if(n instanceof PromiseRejectionEvent&&!((a=n.reason)instanceof Error))return;if(!a)return;let h=t._getErrorStackParser().parse(a),[p,m]=((n,i)=>{let s,o,a;if(!i)return[!1,null];i.forEach(t=>{t.functionName=t.functionName||""});let l=!1;try{throw Error()}catch(r){s=t._getErrorStackParser().parse(r)[0].fileName}for(let t=i.length-1;t>=0;t--){let r=i[t].functionName.split(".");if(c.includes(r[r.length-1])){o=i.slice(0,t+1),a=r[r.length-1],i[0].fileName===s&&(l=!0);break}}if(o||(o=i),l){let l;if(0===(o=o.map((t,r)=>(t.frameIndex=r,t)).filter(t=>t.fileName!==s)).length)return[!0,null];let u=i[o[0].frameIndex-1].functionName.split(".").slice(-1)[0];if(o[0].fileName&&o[0].lineNumber&&o[0].columnNumber&&(l={location:`${o[0].fileName}:${o[0].lineNumber}:${o[0].columnNumber}`,file:o[0].fileName.split("/").slice(-1),line:o[0].lineNumber},t._fesLogCache[l.location]))return[!0,null];"preload"===a&&null==r._preloadMethods[u]?t._friendlyError(tH("fes.wrongPreload",{func:u,location:l?tH("fes.location",l):"",error:n.message}),"preload"):t._friendlyError(tH("fes.libraryError",{func:u,location:l?tH("fes.location",l):"",error:n.message}),u),o&&o.length&&f(o)}return[l,o]})(a,h);if(p)return;let g=tq[a.name];if(g){for(let t of g){let r=t.msg;r=(r=(r=r.replace(/{{}}/g,"([a-zA-Z0-9_]+)")).replace(RegExp("{{.}}","g"),"(.+)")).replace(/{}/g,"(?:[a-zA-Z0-9_]+)");let n=a.message.match(r);if(n){(l=Object.assign({},t)).match=n;break}}if(l)switch(h&&h[0].fileName&&h[0].lineNumber&&h[0].columnNumber&&(u={location:`${h[0].fileName}:${h[0].lineNumber}:${h[0].columnNumber}`,file:h[0].fileName.split("/").slice(-1),line:m[0].lineNumber}),a.name){case"SyntaxError":switch(l.type){case"INVALIDTOKEN":t._friendlyError(tH("fes.globalErrors.syntax.invalidToken",{url:"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Errors/Illegal_character#What_went_wrong"}));break;case"UNEXPECTEDTOKEN":t._friendlyError(tH("fes.globalErrors.syntax.unex
5pectedToken",{url:"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Errors/Unexpected_token#What_went_wrong"}));break;case"REDECLAREDVARIABLE":{let r=l.match[1];t._friendlyError(tH("fes.globalErrors.syntax.redeclaredVariable",{symbol:r,url:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Redeclared_parameter#what_went_wrong"}));break}case"MISSINGINITIALIZER":t._friendlyError(tH("fes.globalErrors.syntax.missingInitializer",{url:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Missing_initializer_in_const#what_went_wrong"}));break;case"BADRETURNORYIELD":t._friendlyError(tH("fes.globalErrors.syntax.badReturnOrYield",{url:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Bad_return_or_yield#what_went_wrong"}))}break;case"ReferenceError":switch(l.type){case"NOTDEFINED":{let r=l.match[1];if(r&&((r,n)=>{i||s();let o={},a=999999;if(i.forEach(t=>{let n=((t,r)=>{let n=t.length,i=r.length;if(0===n)return r;if(0===i)return t;let s=[],o=[];for(let t=0;t<i+1;t++)o[t]=t;s=o;for(let a=1;a<n+1;a++){o=[];for(let n=0;n<i+1;n++)if(0===n)o[n]=a;else{let i=t[a-1],l=r[n-1],u=999999,h=+(i.toLowerCase()!==l.toLowerCase());u=(u=(u=u>h+s[n-1]?h+s[n-1]:u)>1+o[n-1]?1+o[n-1]:u)>1+s[n]?1+s[n]:u,o[n]=u}s=o}return o[i]})(r,t.name);o[n]?o[n].push(t):o[n]=[t],n<a&&(a=n)}),a>Math.min(2,r.length))return!1;let l=o[a].filter(t=>t.name!==r);if(0!==l.length){let i,s,o=t._getErrorStackParser().parse(n);if(o&&o[0]&&o[0].fileName&&o[0].lineNumber&&o[0].columnNumber&&(i={location:`${o[0].fileName}:${o[0].lineNumber}:${o[0].columnNumber}`,file:o[0].fileName.split("/").slice(-1),line:o[0].lineNumber}),1===l.length)s=tH("fes.misspelling",{name:r,actualName:l[0].name,type:l[0].type,location:i?tH("fes.location",i):"",count:l.length});else{let t=l.map(t=>d("▶️ "+t.name+("function"===t.type?"()":""),t.name)).join("\n");s=tH("fes.misspelling",{name:r,suggestions:t,location:i?tH("fes.location",i):"",count:l.length})}return t._friendlyError(s,1===l.length?l[0].name:void 0),!0}return!1})(r,a))break;t._friendlyError(tH("fes.globalErrors.reference.notDefined",{url:"https://p5js.org/examples/data-variable-scope.html",symbol:r,location:u?tH("fes.location",u):""})),m&&f(m);break}case"CANNOTACCESS":{let r=l.match[1];t._friendlyError(tH("fes.globalErrors.reference.cannotAccess",{url:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Cant_access_lexical_declaration_before_init#what_went_wrong",symbol:r,location:u?tH("fes.location",u):""})),m&&f(m)}}break;case"TypeError":switch(l.type){case"NOTFUNC":{let r=l.match[1].split("."),n={url:"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Errors/Not_a_function#What_went_wrong",symbol:r[r.length-1],obj:r.slice(0,r.length-1).join("."),location:u?tH("fes.location",u):""};r.length>1?t._friendlyError(tH("fes.globalErrors.type.notfuncObj",n)):t._friendlyError(tH("fes.globalErrors.type.notfunc",n)),m&&f(m);break}case"READNULL":{let r=l.match[1];t._friendlyError(tH("fes.globalErrors.type.readFromNull",{url:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Cant_access_property#what_went_wrong",symbol:r,location:u?tH("fes.location",u):""})),m&&f(m);break}case"READUDEFINED":{let r=l.match[1];t._friendlyError(tH("fes.globalErrors.type.readFromUndefined",{url:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Cant_access_property#what_went_wrong",symbol:r,location:u?tH("fes.location",u):""})),m&&f(m);break}case"CONSTASSIGN":t._friendlyError(tH("fes.globalErrors.type.constAssign",{url:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Invalid_const_assignment#what_went_wrong",location:u?tH("fes.location",u):""})),m&&f(m)}}}},t._checkForUserDefinedFunctions=p,t._fesLogger=null,t._fesLogCache={},window.addEventListener("load",p,!1),window.addEventListener("error",t._fesErrorMonitor,!1),window.addEventListener("unhandledrejection",t._fesErrorMonitor,!1)}i=null;let a="https://github.com/processing/p5.js/wiki/p5.js-overview#why-cant-i-assign-variables-using-p5-functions-and-variables-before-setup";s=()=>{let t={},n=r=>Object.getOwnPropertyNames(r).filter(r=>"_"!==r[0]&&!(r in t)&&(t[r]=!0,!0)).map(t=>{let n;return n="function"==typeof r[t]?"function":t===t.toUpperCase()?"constant":"variable",{name:t,type:n}});(i=[].concat(n(r),n(d.a3))).sort((t,r)=>r.name.length-t.name.length)};let l=(t,r)=>{r||(r=console.log.bind(console)),i||s(),i.some(n=>{if(t.message&&null!==t.message.match(`\\W?${n.name}\\W`)){let t="function"===n.type?`${n.name}()`:n.name;return"undefined"!=typeof IS_MINIFIED?r(`Did you just try to use p5.js's ${t} ${n.type}? If so, you may want to move it into your sketch's setup() function.
6
7For more details, see: ${a}`):r(tH("fes.misusedTopLevel",{symbolName:t,symbolType:n.type,url:a})),!0}})};r._helpForMisusedAtTopLevelCode=l,"complete"!==document.readyState&&(window.addEventListener("error",l,!1),window.addEventListener("load",()=>{window.removeEventListener("error",l,!1)}))}function tZ(){let t=/(^|@)\S+:\d+/,r=/^\s*at .*(\S+:\d+|\(native\))/m,n=/^(eval@)?(\[native code])?$/;return{parse:function(t){return void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(r)?this.parseV8OrIE(t):t.stack?this.parseFFOrSafari(t):void 0},extractLocation:function(t){if(-1===t.indexOf(":"))return[t];let r=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(t.replace(/[()]/g,""));return[r[1],r[2]||void 0,r[3]||void 0]},parseV8OrIE:function(t){return t.stack.split("\n").filter(function(t){return!!t.match(r)},this).map(function(t){t.indexOf("(eval ")>-1&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));let r=t.replace(/^\s+/,"").replace(/\(eval code/g,"("),n=r.match(/ (\((.+):(\d+):(\d+)\)$)/),i=(r=n?r.replace(n[0],""):r).split(/\s+/).slice(1),s=this.extractLocation(n?n[1]:i.pop());return{functionName:i.join(" ")||void 0,fileName:["eval","<anonymous>"].indexOf(s[0])>-1?void 0:s[0],lineNumber:s[1],columnNumber:s[2],source:t}},this)},parseFFOrSafari:function(t){return t.stack.split("\n").filter(function(t){return!t.match(n)},this).map(function(t){if(t.indexOf(" > eval")>-1&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===t.indexOf("@")&&-1===t.indexOf(":"))return{functionName:t};{let r=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=t.match(r),i=n&&n[1]?n[1]:void 0,s=this.extractLocation(t.replace(r,""));return{functionName:i,fileName:s[0],lineNumber:s[1],columnNumber:s[2],source:t}}},this)},parseOpera:function(t){return!t.stacktrace||t.message.indexOf("\n")>-1&&t.message.split("\n").length>t.stacktrace.split("\n").length?this.parseOpera9(t):t.stack?this.parseOpera11(t):this.parseOpera10(t)},parseOpera9:function(t){let r=/Line (\d+).*script (?:in )?(\S+)/i,n=t.message.split("\n"),i=[];for(let t=2,s=n.length;t<s;t+=2){let s=r.exec(n[t]);
7s&&i.push({fileName:s[2],lineNumber:s[1],source:n[t]})}return i},parseOpera10:function(t){let r=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=t.stacktrace.split("\n"),i=[];for(let t=0,s=n.length;t<s;t+=2){let s=r.exec(n[t]);s&&i.push({functionName:s[3]||void 0,fileName:s[2],lineNumber:s[1],source:n[t]})}return i},parseOpera11:function(r){return r.stack.split("\n").filter(function(r){return!!r.match(t)&&!r.match(/^Error created at/)},this).map(function(t){let r,n=t.split("@"),i=this.extractLocation(n.pop()),s=n.shift()||"",o=s.replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return s.match(/\(([^)]*)\)/)&&(r=s.replace(/^[^(]+\(([^)]*)\)$/,"$1")),{functionName:o,args:void 0===r||"[arguments not available]"===r?void 0:r.split(","),fileName:i[0],lineNumber:i[1],columnNumber:i[2],source:t}},this)}}}function tX(t,r){t._getErrorStackParser=function(){return new tZ}}function tY(t,r,n){function i(n,i){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:i,constr:a,traits:new Set},enumerable:!1}),n._zod.traits.has(t))return;n._zod.traits.add(t),r(n,i);let s=a.prototype,o=Object.keys(s);for(let t=0;t<o.length;t++){let r=o[t];r in n||(n[r]=s[r].bind(n))}}let s=n?.Parent??Object;class o extends s{}function a(t){var r;let s=n?.Parent?new o:this;for(let n of(i(s,t),(r=s._zod).deferred??(r.deferred=[]),s._zod.deferred))n();return s}return Object.defineProperty(o,"name",{value:t}),Object.defineProperty(a,"init",{value:i}),Object.defineProperty(a,Symbol.hasInstance,{value:r=>!!n?.Parent&&r instanceof n.Parent||r?._zod?.traits?.has(t)}),Object.defineProperty(a,"name",{value:t}),a}"undefined"!=typeof p5&&tW(p5,p5.prototype),"undefined"!=typeof p5&&tX(p5,p5.prototype),Object.freeze({status:"aborted"}),Symbol("zod_brand");class tK extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class tJ extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}let tQ={};function t0(t){return t&&Object.assign(tQ,t),tQ}function t1(t){let r=Object.values(t).filter(t=>"number"==typeof t);return Object.entries(t).filter(([t,n])=>-1===r.indexOf(+t)).map(([t,r])=>r)}function t2(t,r="|"){return t.map(t=>rd(t)).join(r)}function t5(t,r){return"bigint"==typeof r?r.toString():r}function t3(t){return{get value(){{let r=t();return Object.defineProperty(this,"value",{value:r}),r}}}}function t4(t){return null==t}function t8(t){let r=+!!t.startsWith("^"),n=t.endsWith("$")?t.length-1:t.length;return t.slice(r,n)}let t6=Symbol("evaluating");function t9(t,r,n){let i;
7Object.defineProperty(t,r,{get(){if(i!==t6)return void 0===i&&(i=t6,i=n()),i},set(n){Object.defineProperty(t,r,{value:n})},configurable:!0})}function t7(t,r,n){Object.defineProperty(t,r,{value:n,writable:!0,enumerable:!0,configurable:!0})}function re(...t){let r={};for(let n of t)Object.assign(r,Object.getOwnPropertyDescriptors(n));return Object.defineProperties({},r)}function rt(t){return JSON.stringify(t)}let rr="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function rn(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}let ri=t3(()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return Function(""),!0}catch(t){return!1}});function rs(t){if(!1===rn(t))return!1;let r=t.constructor;if(void 0===r||"function"!=typeof r)return!0;let n=r.prototype;return!1!==rn(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}function ro(t){return rs(t)?{...t}:Array.isArray(t)?[...t]:t}let ra=new Set(["string","number","symbol"]),rl=new Set(["string","number","bigint","boolean","symbol","undefined"]);function ru(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function rh(t,r,n){let i=new t._zod.constr(r??t._zod.def);return(!r||n?.parent)&&(i._zod.parent=t),i}function rc(t){if(!t)return{};if("string"==typeof t)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,"string"==typeof t.error)?{...t,error:()=>t.error}:t}function rd(t){return"bigint"==typeof t?t.toString()+"n":"string"==typeof t?`"${t}"`:`${t}`}let rp={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-0x80000000,0x7fffffff],uint32:[0,0xffffffff],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]}
7,rf={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function rm(t,r=0){if(!0===t.aborted)return!0;for(let n=r;n<t.issues.length;n++)if(t.issues[n]?.continue!==!0)return!0;return!1}function rg(t,r){return r.map(r=>(r.path??(r.path=[]),r.path.unshift(t),r))}function ry(t){return"string"==typeof t?t:t?.message}function rv(t,r,n){let i={...t,path:t.path??[]};return t.message||(i.message=ry(t.inst?._zod.def?.error?.(t))??ry(r?.error?.(t))??ry(n.customError?.(t))??ry(n.localeError?.(t))??"Invalid input"),delete i.inst,delete i.continue,r?.reportInput||delete i.input,i}function rb(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}function rx(t){return Array.isArray(t)?"array":"string"==typeof t?"string":"unknown"}function r_(...t){let[r,n,i]=t;return"string"==typeof r?{message:r,code:"custom",input:n,inst:i}:{...r}}let rA=(t,r)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:r,enumerable:!1}),t.message=JSON.stringify(r,t5,2),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:!1})},rE=tY("$ZodError",rA),rC=tY("$ZodError",rA,{Parent:Error}),rD=t=>(r,n,i,s)=>{let o=i?Object.assign(i,{async:!1}):{async:!1},a=r._zod.run({value:n,issues:[]},o);if(a instanceof Promise)throw new tK;if(a.issues.length){let r=new(s?.Err??t)(a.issues.map(t=>rv(t,o,t0())));throw rr(r,s?.callee),r}return a.value},rw=rD(rC),rS=t=>async(r,n,i,s)=>{let o=i?Object.assign(i,{async:!0}):{async:!0},a=r._zod.run({value:n,issues:[]},o);if(a instanceof Promise&&(a=await a),a.issues.length){let r=new(s?.Err??t)(a.issues.map(t=>rv(t,o,t0())));throw rr(r,s?.callee),r}return a.value},rF=rS(rC),rT=t=>(r,n,i)=>{let s=i?{...i,async:!1}:{async:!1},o=r._zod.run({value:n,issues:[]},s);if(o instanceof Promise)throw new tK;return o.issues.length?{success:!1,error:new(t??rE)(o.issues.map(t=>rv(t,s,t0())))}:{success:!0,data:o.value}},rN=rT(rC),rI=t=>async(r,n,i)=>{let s=i?Object.assign(i,{async:!0}):{async:!0},o=r._zod.run({value:n,issues:[]},s);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new t(o.issues.map(t=>rv(t,s,t0())))}:{success:!0,data:o.value}},rO=rI(rC),rk=/^[cC][^\s-]{8,}$/,rM=/^[0-9a-z]+$/,rB=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,rL=/^[0-9a-vA-V]{20}$/,rR=/^[A-Za-z0-9]{27}$/,rP=/^[a-zA-Z0-9_-]{21}$/,rz=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,rU=/^[-+]?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)?)??$/,r$=/^([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})$/,rj=t=>t?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,rV=rj(4),rG=rj(6),rH=rj(7),rq=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,rW=/^[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])?)*$/,rZ=/^(([^<>()\[\]\\.,;:\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,}))$/,rX=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,rY=rX,rK=/^[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])?)*$/;function rJ(){return RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")}let rQ=/^(?:(?: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])$/,r0=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,r1=t=>{let r=ru(t??":");return RegExp(`^(?:[0-9A-F]{2}${r}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${r}){5}[0-9a-f]{2}$`)},r2=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,r5=/^(([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])$/,r3=/^$|^(?:[0-9a-zA-Z+/]{4}
7)*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,r4=/^[A-Za-z0-9_-]*$/,r8=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,r6=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,r9=/^\+[1-9]\d{6,14}$/,r7="(?:(?:\\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])))",ne=RegExp(`^${r7}$`);function nt(t){let r="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof t.precision?-1===t.precision?`${r}`:0===t.precision?`${r}:[0-5]\\d`:`${r}:[0-5]\\d\\.\\d{${t.precision}}`:`${r}(?::[0-5]\\d(?:\\.\\d+)?)?`}function nr(t){return RegExp(`^${nt(t)}$`)}function nn(t){let r=nt({precision:t.precision}),n=["Z"];t.local&&n.push(""),t.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let i=`${r}(?:${n.join("|")})`;return RegExp(`^${r7}T(?:${i})$`)}let ni=t=>{let r=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return RegExp(`^${r}$`)},ns=/^-?\d+n?$/,no=/^-?\d+$/,na=/^-?\d+(?:\.\d+)?$/,nl=/^(?:true|false)$/i,nu=/^null$/i,nh=/^undefined$/i,nc=/^[^A-Z]*$/,nd=/^[^a-z]*$/,np=/^[0-9a-fA-F]*$/;function nf(t,r){return RegExp(`^[A-Za-z0-9+/]{${t}}${r}$`)}function nm(t){return RegExp(`^[A-Za-z0-9_-]{${t}}$`)}let ng=/^[0-9a-fA-F]{32}$/,ny=nf(22,"=="),nv=nm(22),nb=/^[0-9a-fA-F]{40}$/,nx=nf(27,"="),n_=nm(27),nA=/^[0-9a-fA-F]{64}$/,nE=nf(43,"="),nC=nm(43),nD=/^[0-9a-fA-F]{96}$/,nw=nf(64,""),nS=nm(64),nF=/^[0-9a-fA-F]{128}$/,nT=nf(86,"=="),nN=nm(86),nI=tY("$ZodCheck",(t,r)=>{var n;t._zod??(t._zod={}),t._zod.def=r,(n=t._zod).onattach??(n.onattach=[])}),nO={number:"number",bigint:"bigint",object:"date"},nk=tY("$ZodCheckLessThan",(t,r)=>{nI.init(t,r);let n=nO[typeof r.value];t._zod.onattach.push(t=>{let n=t._zod.bag,i=(r.inclusive?n.maximum:n.exclusiveMaximum)??1/0;r.value<i&&(r.inclusive?n.maximum=r.value:n.exclusiveMaximum=r.value)}),t._zod.check=i=>{(r.inclusive?i.value<=r.value:i.value<r.value)||i.issues.push({origin:n,code:"too_big",maximum:"object"==typeof r.value?r.value.getTime():r.value,input:i.value,inclusive:r.inclusive,inst:t,continue:!r.abort})}}),nM=tY("$ZodCheckGreaterThan",(t,r)=>{nI.init(t,r);let n=nO[typeof r.value];t._zod.onattach.push(t=>{let n=t._zod.bag,i=(r.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;r.value>i&&(r.inclusive?n.minimum=r.value:n.exclusiveMinimum=r.value)}),t._zod.check=i=>{(r.inclusive?i.value>=r.value:i.value>r.value)||i.issues.push({origin:n,code:"too_small",minimum:"object"==typeof r.value?r.value.getTime():r.value,input:i.value,inclusive:r.inclusive,inst:t,continue:!r.abort})}}),nB=tY("$ZodCheckMultipleOf",(t,r)=>{nI.init(t,r),t._zod.onattach.push(t=>{var n;(n=t._zod.bag).multipleOf??(n.multipleOf=r.value)}),t._zod.check=n=>{if(typeof n.value!=typeof r.value)throw Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof n.value?n.value%r.value===BigInt(0):0===function(t,r){let n=(t.toString().split(".")[1]||"").length,i=r.toString(),s=(i.split(".")[1]||"").length;if(0===s&&/\d?e-\d?/.test(i)){let t=i.match(/\d?e-(\d?)/);t?.[1]&&(s=Number.parseInt(t[1]))}let o=n>s?n:s;return Number.parseInt(t.toFixed(o).replace(".",""))%Number.parseInt(r.toFixed(o).replace(".",""))/10**o}(n.value,r.value))||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:r.value,input:n.value,inst:t,continue:!r.abort})}}),nL=tY("$ZodCheckNumberFormat",(t,r)=>{nI.init(t,r),r.format=r.format||"float64";let n=r.format?.includes("int"),i=n?"int":"number",[s,o]=rp[r.format];t._zod.onattach.push(t=>{let i=t._zod.bag;i.format=r.format,i.minimum=s,i.maximum=o,n&&(i.pattern=no)}),t._zod.check=a=>{let l=a.value;if(n){if(!Number.isInteger(l))return void a.issues.push({expected:i,format:r.format,code:"invalid_type",continue:!1,input:l,inst:t});if(!Number.isSafeInteger(l))return void(l>0?a.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:i,inclusive:!0,continue:!r.abort}):a.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:i,inclusive:!0,
7continue:!r.abort}))}l<s&&a.issues.push({origin:"number",input:l,code:"too_small",minimum:s,inclusive:!0,inst:t,continue:!r.abort}),l>o&&a.issues.push({origin:"number",input:l,code:"too_big",maximum:o,inclusive:!0,inst:t,continue:!r.abort})}}),nR=tY("$ZodCheckBigIntFormat",(t,r)=>{nI.init(t,r);let[n,i]=rf[r.format];t._zod.onattach.push(t=>{let s=t._zod.bag;s.format=r.format,s.minimum=n,s.maximum=i}),t._zod.check=s=>{let o=s.value;o<n&&s.issues.push({origin:"bigint",input:o,code:"too_small",minimum:n,inclusive:!0,inst:t,continue:!r.abort}),o>i&&s.issues.push({origin:"bigint",input:o,code:"too_big",maximum:i,inclusive:!0,inst:t,continue:!r.abort})}}),nP=tY("$ZodCheckMaxSize",(t,r)=>{var n;nI.init(t,r),(n=t._zod.def).when??(n.when=t=>{let r=t.value;return!t4(r)&&void 0!==r.size}),t._zod.onattach.push(t=>{let n=t._zod.bag.maximum??1/0;r.maximum<n&&(t._zod.bag.maximum=r.maximum)}),t._zod.check=n=>{let i=n.value;i.size<=r.maximum||n.issues.push({origin:rb(i),code:"too_big",maximum:r.maximum,inclusive:!0,input:i,inst:t,continue:!r.abort})}}),nz=tY("$ZodCheckMinSize",(t,r)=>{var n;nI.init(t,r),(n=t._zod.def).when??(n.when=t=>{let r=t.value;return!t4(r)&&void 0!==r.size}),t._zod.onattach.push(t=>{let n=t._zod.bag.minimum??-1/0;r.minimum>n&&(t._zod.bag.minimum=r.minimum)}),t._zod.check=n=>{let i=n.value;i.size>=r.minimum||n.issues.push({origin:rb(i),code:"too_small",minimum:r.minimum,inclusive:!0,input:i,inst:t,continue:!r.abort})}}),nU=tY("$ZodCheckSizeEquals",(t,r)=>{var n;nI.init(t,r),(n=t._zod.def).when??(n.when=t=>{let r=t.value;return!t4(r)&&void 0!==r.size}),t._zod.onattach.push(t=>{let n=t._zod.bag;n.minimum=r.size,n.maximum=r.size,n.size=r.size}),t._zod.check=n=>{let i=n.value,s=i.size;if(s===r.size)return;let o=s>r.size;n.issues.push({origin:rb(i),...o?{code:"too_big",maximum:r.size}:{code:"too_small",minimum:r.size},inclusive:!0,exact:!0,input:n.value,inst:t,continue:!r.abort})}}),n$=tY("$ZodCheckMaxLength",(t,r)=>{var n;nI.init(t,r),(n=t._zod.def).when??(n.when=t=>{let r=t.value;return!t4(r)&&void 0!==r.length}),t._zod.onattach.push(t=>{let n=t._zod.bag.maximum??1/0;r.maximum<n&&(t._zod.bag.maximum=r.maximum)}),t._zod.check=n=>{let i=n.value;if(i.length<=r.maximum)return;let s=rx(i);n.issues.push({origin:s,code:"too_big",maximum:r.maximum,inclusive:!0,input:i,inst:t,continue:!r.abort})}}),nj=tY("$ZodCheckMinLength",(t,r)=>{var n;nI.init(t,r),(n=t._zod.def).when??(n.when=t=>{let r=t.value;return!t4(r)&&void 0!==r.length}),t._zod.onattach.push(t=>{let n=t._zod.bag.minimum??-1/0;r.minimum>n&&(t._zod.bag.minimum=r.minimum)}),t._zod.check=n=>{let i=n.value;if(i.length>=r.minimum)return;let s=rx(i);n.issues.push({origin:s,code:"too_small",minimum:r.minimum,inclusive:!0,input:i,inst:t,continue:!r.abort})}}),nV=tY("$ZodCheckLengthEquals",(t,r)=>{var n;nI.init(t,r),(n=t._zod.def).when??(n.when=t=>{let r=t.value;return!t4(r)&&void 0!==r.length}),t._zod.onattach.push(t=>{let n=t._zod.bag;n.minimum=r.length,n.maximum=r.length,n.length=r.length}),t._zod.check=n=>{let i=n.value,s=i.length;if(s===r.length)return;let o=rx(i),a=s>r.length;n.issues.push({origin:o,...a?{code:"too_big",maximum:r.length}:{code:"too_small",minimum:r.length},inclusive:!0,exact:!0,input:n.value,inst:t,continue:!r.abort})}}),nG=tY("$ZodCheckStringFormat",(t,r)=>{var n,i;nI.init(t,r),t._zod.onattach.push(t=>{let n=t._zod.bag;n.format=r.format,r.pattern&&(n.patterns??(n.patterns=new Set),n.patterns.add(r.pattern))}),r.pattern?(n=t._zod).check??(n.check=n=>{r.pattern.lastIndex=0,r.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:r.format,input:n.value,...r.pattern?{pattern:r.pattern.toString()}:{},inst:t,continue:!r.abort})}):(i=t._zod).check??(i.check=()=>{})}),nH=tY("$ZodCheckRegex",(t,r)=>{nG.init(t,r),t._zod.check=n=>{r.pattern.lastIndex=0,r.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:r.pattern.toString(),inst:t,continue:!r.abort})}}),nq=tY("$ZodCheckLowerCase",(t,r)=>{r.pattern??(r.pattern=nc),nG.init(t,r)}),nW=tY("$ZodCheckUpperCase",(t,r)=>{r.pattern??(r.pattern=nd),nG.init(t,r)}),nZ=tY("$ZodCheckIncludes",(t,r)=>{nI.init(t,r);let n=ru(r.includes),i=new RegExp("number"==typeof r.position?`^.{${r.position}}${n}`:n);r.pattern=i,t._zod.onattach.push(t=>{let r=t._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(i)}),t._zod.check=n=>
vendor: 1,573 bytes, line 7
7{n.value.includes(r.includes,r.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:r.includes,input:n.value,inst:t,continue:!r.abort})}}),nX=tY("$ZodCheckStartsWith",(t,r)=>{nI.init(t,r);let n=RegExp(`^${ru(r.prefix)}.*`);r.pattern??(r.pattern=n),t._zod.onattach.push(t=>{let r=t._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(n)}),t._zod.check=n=>{n.value.startsWith(r.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:r.prefix,input:n.value,inst:t,continue:!r.abort})}}),nY=tY("$ZodCheckEndsWith",(t,r)=>{nI.init(t,r);let n=RegExp(`.*${ru(r.suffix)}$`);r.pattern??(r.pattern=n),t._zod.onattach.push(t=>{let r=t._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(n)}),t._zod.check=n=>{n.value.endsWith(r.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:r.suffix,input:n.value,inst:t,continue:!r.abort})}});function nK(t,r,n){t.issues.length&&r.issues.push(...rg(n,t.issues))}let nJ=tY("$ZodCheckProperty",(t,r)=>{nI.init(t,r),t._zod.check=t=>{let n=r.schema._zod.run({value:t.value[r.property],issues:[]},{});if(n instanceof Promise)return n.then(n=>nK(n,t,r.property));nK(n,t,r.property)}}),nQ=tY("$ZodCheckMimeType",(t,r)=>{nI.init(t,r);let n=new Set(r.mime);t._zod.onattach.push(t=>{t._zod.bag.mime=r.mime}),t._zod.check=i=>{n.has(i.value.type)||i.issues.push({code:"invalid_value",values:r.mime,input:i.value.type,inst:t,continue:!r.abort})}}),n0=tY("$ZodCheckOverwrite",(t,r)=>{nI.init(t,r),t._zod.check=t=>{t.value=r.tx(t.value)}});
7class n1{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if("function"==typeof t){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let r=t.split("\n").filter(t=>t),n=Math.min(...r.map(t=>t.length-t.trimStart().length));for(let t of r.map(t=>t.slice(n)).map(t=>" ".repeat(2*this.indent)+t))this.content.push(t)}compile(){return Function(...this?.args,[...(this?.content??[""]).map(t=>`  ${t}`)].join("\n"))}}let n2={major:4,minor:3,patch:6},n5=tY("$ZodType",(t,r)=>{var n;t??(t={}),t._zod.def=r,t._zod.bag=t._zod.bag||{},t._zod.version=n2;let i=[...t._zod.def.checks??[]];for(let r of(t._zod.traits.has("$ZodCheck")&&i.unshift(t),i))for(let n of r._zod.onattach)n(t);if(0===i.length)(n=t._zod).deferred??(n.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{let r=(t,r,n)=>{let i,s=rm(t);for(let o of r){if(o._zod.def.when){if(!o._zod.def.when(t))continue}else if(s)continue;let r=t.issues.length,a=o._zod.check(t);if(a instanceof Promise&&n?.async===!1)throw new tK;if(i||a instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await a,t.issues.length!==r&&(s||(s=rm(t,r)))});else{if(t.issues.length===r)continue;s||(s=rm(t,r))}}return i?i.then(()=>t):t},n=(n,s,o)=>{if(rm(n))return n.aborted=!0,n;let a=r(s,i,o);if(a instanceof Promise){if(!1===o.async)throw new tK;return a.then(r=>t._zod.parse(r,o))}return t._zod.parse(a,o)};t._zod.run=(s,o)=>{if(o.skipChecks)return t._zod.parse(s,o);if("backward"===o.direction){let r=t._zod.parse({value:s.value,issues:[]},{...o,skipChecks:!0});return r instanceof Promise?r.then(t=>n(t,s,o)):n(r,s,o)}let a=t._zod.parse(s,o);if(a instanceof Promise){if(!1===o.async)throw new tK;return a.then(t=>r(t,i,o))}return r(a,i,o)}}t9(t,"~standard",()=>({validate:r=>{try{let n=rN(t,r);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return rO(t,r).then(t=>t.success?{value:t.data}:{issues:t.error?.issues})}},vendor:"zod",version:1}))}),n3=tY("$ZodString",(t,r)=>{n5.init(t,r),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??ni(t._zod.bag),t._zod.parse=(n,i)=>{if(r.coerce)try{n.value=String(n.value)}catch(t){}return"string"==typeof n.value||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:t}),n}}),n4=tY("$ZodStringFormat",(t,r)=>{nG.init(t,r),n3.init(t,r)}),n8=tY("$ZodGUID",(t,r)=>{r.pattern??(r.pattern=r$),n4.init(t,r)}),n6=tY("$ZodUUID",(t,r)=>{if(r.version){let t={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[r.version];if(void 0===t)throw Error(`Invalid UUID version: "${r.version}"`);r.pattern??(r.pattern=rj(t))}else r.pattern??(r.pattern=rj());n4.init(t,r)}),n9=tY("$ZodEmail",(t,r)=>{r.pattern??(r.pattern=rq),n4.init(t,r)}),n7=tY("$ZodURL",(t,r)=>{n4.init(t,r),t._zod.check=n=>{try{let i=n.value.trim(),s=new URL(i);r.hostname&&(r.hostname.lastIndex=0,r.hostname.test(s.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:r.hostname.source,input:n.value,inst:t,continue:!r.abort})),r.protocol&&(r.protocol.lastIndex=0,r.protocol.test(s.protocol.endsWith(":")?s.protocol.slice(0,-1):s.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:r.protocol.source,input:n.value,inst:t,continue:!r.abort})),r.normalize?n.value=s.href:n.value=i;return}catch(i){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:t,continue:!r.abort})}}}),ie=tY("$ZodEmoji",(t,r)=>{r.pattern??(r.pattern=rJ()),n4.init(t,r)}),it=tY("$ZodNanoID",(t,r)=>{r.pattern??(r.pattern=rP),n4.init(t,r)}),ir=tY("$ZodCUID",(t,r)=>{r.pattern??(r.pattern=rk),n4.init(t,r)}),ii=tY("$ZodCUID2",(t,r)=>{r.pattern??(r.pattern=rM),n4.init(t,r)}),is=tY("$ZodULID",(t,r)=>{r.pattern??(r.pattern=rB),n4.init(t,r)}),io=tY("$ZodXID",(t,r)=>{r.pattern??(r.pattern=rL),n4.init(t,r)}),ia=tY("$ZodKSUID",(t,r)=>{r.pattern??(r.pattern=rR),n4.init(t,r)}),il=tY("$ZodISODateTime",(t,r)=>{r.pattern??(r.pattern=nn(r)),n4.init(t,r)}),iu=tY("$ZodISODate",(t,r)=>{r.pattern??(r.pattern=ne),n4.init(t,r)}),ih=tY("$ZodISOTime",(t,r)=>{r.pattern??(r.pattern=nr(r)),n4.init(t,r)}),ic=tY("$ZodISODuration",(t,r)=>{r.pattern??(r.pattern=rz),n4.init(t,r)}),id=tY("$ZodIPv4",(t,r)=>{r.pattern??(r.pattern=rQ),n4.init(t,r),t._zod.bag.format="ipv4"}),ip=tY("$ZodIPv6",(t,r)=>{r.pattern??(r.pattern=r0),n4.init(t,r),t._zod.bag.format="ipv6",t._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:t,continue:!r.abort})}}}),im=tY("$ZodMAC",(t,r)=>{r.pattern??(r.pattern=r1(r.delimiter)),n4.init(t,r),t._zod.bag.format="mac"}),ig=tY("$ZodCIDRv4",(t,r)=>{r.pattern??(r.pattern=r2),n4.init(t,r)}),iy=tY("$ZodCIDRv6",(t,r)=>{r.pattern??(r.pattern=r5),n4.init(t,r),t._zod.check=n=>{let i=n.value.split("/");try{if(2!==i.length)throw Error();let[t,r]=i;if(!r)throw Error();let n=Number(r);
7if(`${n}`!==r||n<0||n>128)throw Error();new URL(`http://[${t}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:t,continue:!r.abort})}}});function iv(t){if(""===t)return!0;if(t.length%4!=0)return!1;try{return atob(t),!0}catch{return!1}}let ib=tY("$ZodBase64",(t,r)=>{r.pattern??(r.pattern=r3),n4.init(t,r),t._zod.bag.contentEncoding="base64",t._zod.check=n=>{iv(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:t,continue:!r.abort})}}),ix=tY("$ZodBase64URL",(t,r)=>{r.pattern??(r.pattern=r4),n4.init(t,r),t._zod.bag.contentEncoding="base64url",t._zod.check=n=>{!function(t){if(!r4.test(t))return!1;let r=t.replace(/[-_]/g,t=>"-"===t?"+":"/");return iv(r.padEnd(4*Math.ceil(r.length/4),"="))}(n.value)&&n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:t,continue:!r.abort})}}),i_=tY("$ZodE164",(t,r)=>{r.pattern??(r.pattern=r9),n4.init(t,r)}),iA=tY("$ZodJWT",(t,r)=>{n4.init(t,r),t._zod.check=n=>{!function(t,r=null){try{let n=t.split(".");if(3!==n.length)return!1;let[i]=n;if(!i)return!1;let s=JSON.parse(atob(i));if("typ"in s&&s?.typ!=="JWT"||!s.alg||r&&(!("alg"in s)||s.alg!==r))return!1;return!0}catch{return!1}}(n.value,r.alg)&&n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:t,continue:!r.abort})}}),iE=tY("$ZodCustomStringFormat",(t,r)=>{n4.init(t,r),t._zod.check=n=>{r.fn(n.value)||n.issues.push({code:"invalid_format",format:r.format,input:n.value,inst:t,continue:!r.abort})}}),iC=tY("$ZodNumber",(t,r)=>{n5.init(t,r),t._zod.pattern=t._zod.bag.pattern??na,t._zod.parse=(n,i)=>{if(r.coerce)try{n.value=Number(n.value)}catch(t){}let s=n.value;if("number"==typeof s&&!Number.isNaN(s)&&Number.isFinite(s))return n;let o="number"==typeof s?Number.isNaN(s)?"NaN":Number.isFinite(s)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:s,inst:t,...o?{received:o}:{}}),n}}),iD=tY("$ZodNumberFormat",(t,r)=>{nL.init(t,r),iC.init(t,r)}),iw=tY("$ZodBoolean",(t,r)=>{n5.init(t,r),t._zod.pattern=nl,t._zod.parse=(n,i)=>{if(r.coerce)try{n.value=!!n.value}catch(t){}let s=n.value;return"boolean"==typeof s||n.issues.push({expected:"boolean",code:"invalid_type",input:s,inst:t}),n}}),iS=tY("$ZodBigInt",(t,r)=>{n5.init(t,r),t._zod.pattern=ns,t._zod.parse=(n,i)=>{if(r.coerce)try{n.value=BigInt(n.value)}catch(t){}return"bigint"==typeof n.value||n.issues.push({expected:"bigint",code:"invalid_type",input:n.value,inst:t}),n}}),iF=tY("$ZodBigIntFormat",(t,r)=>{nR.init(t,r),iS.init(t,r)}),iT=tY("$ZodSymbol",(t,r)=>{n5.init(t,r),t._zod.parse=(r,n)=>{let i=r.value;return"symbol"==typeof i||r.issues.push({expected:"symbol",code:"invalid_type",input:i,inst:t}),r}}),iN=tY("$ZodUndefined",(t,r)=>{n5.init(t,r),t._zod.pattern=nh,t._zod.values=new Set([void 0]),t._zod.optin="optional",t._zod.optout="optional",t._zod.parse=(r,n)=>{let i=r.value;return void 0===i||r.issues.push({expected:"undefined",code:"invalid_type",input:i,inst:t}),r}}),iI=tY("$ZodNull",(t,r)=>{n5.init(t,r),t._zod.pattern=nu,t._zod.values=new Set([null]),t._zod.parse=(r,n)=>{let i=r.value;return null===i||r.issues.push({expected:"null",code:"invalid_type",input:i,inst:t}),r}}),iO=tY("$ZodAny",(t,r)=>{n5.init(t,r),t._zod.parse=t=>t}),ik=tY("$ZodUnknown",(t,r)=>{n5.init(t,r),t._zod.parse=t=>t}),iM=tY("$ZodNever",(t,r)=>{n5.init(t,r),t._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:t}),r)}),iB=tY("$ZodVoid",(t,r)=>{n5.init(t,r),t._zod.parse=(r,n)=>{let i=r.value;return void 0===i||r.issues.push({expected:"void",code:"invalid_type",input:i,inst:t}),r}}),iL=tY("$ZodDate",(t,r)=>{n5.init(t,r),t._zod.parse=(n,i)=>{if(r.coerce)try{n.value=new Date(n.value)}catch(t){}let s=n.value,o=s instanceof Date;return o&&!Number.isNaN(s.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:s,...o?{received:"Invalid Date"}:{},inst:t}),n}});function iR(t,r,n){t.issues.length&&r.issues.push(...rg(n,t.issues)),r.value[n]=t.value}let iP=tY("$ZodArray",(t,r)=>{n5.init(t,r),t._zod.parse=(n,i)=>{let s=n.value;if(!Array.isArray(s))return n.issues.push({expected:"array",code:"invalid_type",input:s,inst:t}),n;n.value=Array(s.length);let o=[];for(let t=0;t<s.length;t++){let a=s[t],l=r.element._zod.run({value:a,issues:[]},i);l instanceof Promise?o.push(l.then(r=>iR(r,n,t))):iR(l,n,t)}return o.length?Promise.all(o).then(()=>n):n}});function iz(t,r,n,i,s){if(t.issues.length){if(s&&!(n in i))return;r.issues.push(...rg(n,t.issues))}void 0===t.value?n in i&&(r.value[n]=void 0):r.value[n]=t.value}function iU(t){var r;let n=Object.keys(t.shape);for(let r of n)if(!t.shape?.[r]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${r}": expected a Zod schema`);let i=Object.keys(r=t.shape).filter(t=>"optional"===r[t]._zod.optin&&"optional"===r[t]._zod.optout);return{...t,keys:n,keySet:new Set(n),numKeys:n.length,optionalKeys:new Set(i)}}function i$(t,r,n,i,s,o){let a=[],l=s.keySet,u=s.catchall._zod,h=u.def.type,c="optional"===u.optout;for(let s in r){if(l.has(s))continue;if("never"===h){a.push(s);continue}let o=u.run({value:r[s],issues:[]},i);o instanceof Promise?t.push(o.then(t=>iz(t,n,s,r,c))):iz(o,n,s,r,c)}return(a.length&&n.issues.push({code:"unrecognized_keys",keys:a,input:r,inst:o}),t.length)?Promise.all(t).then(()=>n):n}let ij=tY("$ZodObject",(t,r)=>{let n;n5.init(t,r);let i=Object.getOwnPropertyDescriptor(r,"shape");if(!i?.get){let t=r.shape;Object.defineProperty(r,"shape",{get:()=>{let n={...t};return Object.defineProperty(r,"shape",{value:n}),n}})}let s=t3(()=>iU(r));t9(t._zod,"propValues",()=>{let t=r.shape,n={};for(let r in t){let i=t[r]._zod;if(i.values)for(let t of(n[r]??(n[r]=new Set),i.values))n[r].add(t)}return n});let o=r.catchall;t._zod.parse=(r,i)=>{n??(n=s.value);let a=r.value;if(!rn(a))return r.issues.push({expected:"object",code:"invalid_type",input:a,inst:t}),r;r.value={};let l=[],u=n.shape;for(let t of n.keys){let n=u[t],s="optional"===n._zod.optout,o=n._zod.run({value:a[t],issues:[]},i);o instanceof Promise?l.push(o.then(n=>iz(n,r,t,a,s))):iz(o,r,t,a,s)}return o?i$(l,a,r,i,s.value,t):l.length?Promise.all(l).then(()=>r):r}}),iV=tY("$ZodObjectJIT",(t,r)=>{let n,i;ij.init(t,r);let s=t._zod.parse,o=t3(()=>iU(r)),a=!tQ.jitless,l=a&&ri.value,u=r.catchall;t._zod.parse=(h,c)=>{i??(i=o.value);let d=h.value;return rn(d)?a&&l&&c?.async===!1&&!0!==c.jitless?(n||(n=(t=>{let r=new n1(["shape","payload","ctx"]),n=o.value,i=t=>{let r=rt(t);return`shape[${r}]._zod.run({ value: input[${r}], issues: [] }, ctx)`};r.write("const input = payload.value;");let s=Object.create(null),a=0;for(let t of n.keys)s[t]=`key_${a++}`;for(let o of(r.write("const newResult = {};"),n.keys)){let n=s[o],a=rt(o),l=t[o],u=l?._zod?.optout==="optional";r.write(`const ${n} = ${i(o)};`),u?r.write(`
8        if (${n}.issues.length) {
9          if (${a} in input) {
10            payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
11              ...iss,
12              path: iss.path ? [${a}, ...iss.path] : [${a}]
13            })));
14          }
15        }
16        
17        if (${n}.value === undefined) {
18          if (${a} in input) {
19            newResult[${a}] = undefined;
20          }
21        } else {
22          newResult[${a}] = ${n}.value;
23        }
24        
25      `):r.write(`
26        if (${n}.issues.length) {
27          payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
28            ...iss,
29            path: iss.path ? [${a}, ...iss.path] : [${a}]
30          })));
31        }
32        
33        if (${n}.value === undefined) {
34          if (${a} in input) {
35            newResult[${a}] = undefined;
36          }
37        } else {
38          newResult[${a}] = ${n}.value;
39        }
40        
41      `)}r.write("payload.value = newResult;"),r.write("return payload;");let l=r.compile();return(r,n)=>l(t,r,n)})(r.shape)),h=n(h,c),u)?i$([],d,h,c,i,t):h:s(h,c):(h.issues.push({expected:"object",code:"invalid_type",input:d,inst:t}),h)}});function iG(t,r,n,i){for(let n of t)if(0===n.issues.length)return r.value=n.value,r;let s=t.filter(t=>!rm(t));return 1===s.length?(r.value=s[0].value,s[0]):(r.issues.push({code:"invalid_union",input:r.value,inst:n,errors:t.map(t=>t.issues.map(t=>rv(t,i,t0())))}),r)}let iH=tY("$ZodUnion",(t,r)=>{n5.init(t,r),t9(t._zod,"optin",()=>r.options.some(t=>
41"optional"===t._zod.optin)?"optional":void 0),t9(t._zod,"optout",()=>r.options.some(t=>"optional"===t._zod.optout)?"optional":void 0),t9(t._zod,"values",()=>{if(r.options.every(t=>t._zod.values))return new Set(r.options.flatMap(t=>Array.from(t._zod.values)))}),t9(t._zod,"pattern",()=>{if(r.options.every(t=>t._zod.pattern)){let t=r.options.map(t=>t._zod.pattern);return RegExp(`^(${t.map(t=>t8(t.source)).join("|")})$`)}});let n=1===r.options.length,i=r.options[0]._zod.run;t._zod.parse=(s,o)=>{if(n)return i(s,o);let a=!1,l=[];for(let t of r.options){let r=t._zod.run({value:s.value,issues:[]},o);if(r instanceof Promise)l.push(r),a=!0;else{if(0===r.issues.length)return r;l.push(r)}}return a?Promise.all(l).then(r=>iG(r,s,t,o)):iG(l,s,t,o)}});function iq(t,r,n,i){let s=t.filter(t=>0===t.issues.length);return 1===s.length?r.value=s[0].value:0===s.length?r.issues.push({code:"invalid_union",input:r.value,inst:n,errors:t.map(t=>t.issues.map(t=>rv(t,i,t0())))}):r.issues.push({code:"invalid_union",input:r.value,inst:n,errors:[],inclusive:!1}),r}let iW=tY("$ZodXor",(t,r)=>{iH.init(t,r),r.inclusive=!1;let n=1===r.options.length,i=r.options[0]._zod.run;t._zod.parse=(s,o)=>
41{if(n)return i(s,o);let a=!1,l=[];for(let t of r.options){let r=t._zod.run({value:s.value,issues:[]},o);r instanceof Promise?(l.push(r),a=!0):l.push(r)}return a?Promise.all(l).then(r=>iq(r,s,t,o)):iq(l,s,t,o)}}),iZ=tY("$ZodDiscriminatedUnion",(t,r)=>{r.inclusive=!1,iH.init(t,r);let n=t._zod.parse;t9(t._zod,"propValues",()=>{let t={};for(let n of r.options){let i=n._zod.propValues;if(!i||0===Object.keys(i).length)throw Error(`Invalid discriminated union option at index "${r.options.indexOf(n)}"`);for(let[r,n]of Object.entries(i))for(let i of(t[r]||(t[r]=new Set),n))t[r].add(i)}return t});let i=t3(()=>{let t=r.options,n=new Map;for(let i of t){let t=i._zod.propValues?.[r.discriminator];if(!t||0===t.size)throw Error(`Invalid discriminated union option at index "${r.options.indexOf(i)}"`);for(let r of t){if(n.has(r))throw Error(`Duplicate discriminator value "${String(r)}"`);n.set(r,i)}}return n});t._zod.parse=(s,o)=>{let a=s.value;if(!rn(a))return s.issues.push({code:"invalid_type",expected:"object",input:a,inst:t}),s;let l=i.value.get(a?.[r.discriminator]);return l?l._zod.run(s,o):r.unionFallback?n(s,o):(s.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:r.discriminator,input:a,path:[r.discriminator],inst:t}),s)}}),iX=tY("$ZodIntersection",(t,r)=>{n5.init(t,r),t._zod.parse=(t,n)=>{let i=t.value,s=r.left._zod.run({value:i,issues:[]},n),o=r.right._zod.run({value:i,issues:[]},n);return s instanceof Promise||o instanceof Promise?Promise.all([s,o]).then(([r,n])=>iY(t,r,n)):iY(t,s,o)}});function iY(t,r,n){let i,s=new Map;for(let n of r.issues)if("unrecognized_keys"===n.code)for(let t of(i??(i=n),n.keys))s.has(t)||s.set(t,{}),s.get(t).l=!0;else t.issues.push(n);for(let r of n.issues)if("unrecognized_keys"===r.code)for(let t of r.keys)s.has(t)||s.set(t,{}),s.get(t).r=!0;else t.issues.push(r);let o=[...s].filter(([,t])=>t.l&&t.r).map(([t])=>t);if(o.length&&i&&t.issues.push({...i,keys:o}),rm(t))return t;let a=function t(r,n){if(r===n||r instanceof Date&&n instanceof Date&&+r==+n)return{valid:!0,data:r};if(rs(r)&&rs(n)){let i=Object.keys(n),s=Object.keys(r).filter(t=>-1!==i.indexOf(t)),o={...r,...n};for(let i of s){let s=t(r[i],n[i]);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};o[i]=s.data}return{valid:!0,data:o}}if(Array.isArray(r)&&Array.isArray(n)){if(r.length!==n.length)return{valid:!1,mergeErrorPath:[]};let i=[];for(let s=0;s<r.length;s++){let o=t(r[s],n[s]);if(!o.valid)return{valid:!1,mergeErrorPath:[s,...o.mergeErrorPath]};i.push(o.data)}return{valid:!0,data:i}}return{valid:!1,mergeErrorPath:[]}}(r.value,n.value);if(!a.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return t.value=a.data,t}let iK=tY("$ZodTuple",(t,r)=>{n5.init(t,r);let n=r.items;t._zod.parse=(i,s)=>{let o=i.value;if(!Array.isArray(o))return i.issues.push({input:o,inst:t,expected:"tuple",code:"invalid_type"}),i;i.value=[];let a=[],l=[...n].reverse().findIndex(t=>"optional"!==t._zod.optin),u=-1===l?0:n.length-l;if(!r.rest){let r=o.length>n.length,s=o.length<u-1;if(r||s)return i.issues.push({...r?{code:"too_big",maximum:n.length,inclusive:!0}:{code:"too_small",minimum:n.length},input:o,inst:t,origin:"array"}),i}let h=-1;for(let t of n){if(++h>=o.length&&h>=u)continue;let r=t._zod.run({value:o[h],issues:[]},s);r instanceof Promise?a.push(r.then(t=>iJ(t,i,h))):iJ(r,i,h)}if(r.rest)for(let t of o.slice(n.length)){h++;let n=r.rest._zod.run({value:t,issues:[]},s);n instanceof Promise?a.push(n.then(t=>iJ(t,i,h))):iJ(n,i,h)}return a.length?Promise.all(a).then(()=>i):i}});function iJ(t,r,n){t.issues.length&&r.issues.push(...rg(n,t.issues)),r.value[n]=t.value}let iQ=tY("$ZodRecord",(t,r)=>{n5.init(t,r),t._zod.parse=(n,i)=>{let s=n.value;if(!rs(s))return n.issues.push({expected:"record",code:"invalid_type",input:s,inst:t}),n;let o=[],a=r.keyType._zod.values;if(a){let l;n.value={};let u=new Set;for(let t of a)if("string"==typeof t||"number"==typeof t||"symbol"==typeof t){u.add("number"==typeof t?t.toString():t);let a=r.valueType._zod.run({value:s[t],issues:[]},i);a instanceof Promise?o.push(a.then(r=>{r.issues.length&&n.issues.push(...rg(t,r.issues)),n.value[t]=r.value})):(a.issues.length&&n.issues.push(...rg(t,a.issues)),n.value[t]=a.value)}for(let t in s)u.has(t)||(l=l??[]).push(t);l&&l.length>0&&n.issues.push({code:"unrecognized_keys",input:s,inst:t,keys:l})}else for(let a of(n.value={},Reflect.ownKeys(s))){if("__proto__"===a)continue;let l=r.keyType._zod.run({value:a,issues:[]},i);if(l instanceof Promise)throw Error("Async schemas not supported in object keys currently");if("string"==typeof a&&na.test(a)&&l.issues.length){let t=r.keyType._zod.run({value:Number(a),issues:[]},i);if(t instanceof Promise)throw Error("Async schemas not supported in object keys currently");0===t.issues.length&&(l=t)}if(l.issues.length){"loose"===r.mode?n.value[a]=s[a]:n.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(t=>
41rv(t,i,t0())),input:a,path:[a],inst:t});continue}let u=r.valueType._zod.run({value:s[a],issues:[]},i);u instanceof Promise?o.push(u.then(t=>{t.issues.length&&n.issues.push(...rg(a,t.issues)),n.value[l.value]=t.value})):(u.issues.length&&n.issues.push(...rg(a,u.issues)),n.value[l.value]=u.value)}return o.length?Promise.all(o).then(()=>n):n}}),i0=tY("$ZodMap",(t,r)=>{n5.init(t,r),t._zod.parse=(n,i)=>{let s=n.value;if(!(s instanceof Map))return n.issues.push({expected:"map",code:"invalid_type",input:s,inst:t}),n;let o=[];for(let[a,l]of(n.value=new Map,s)){let u=r.keyType._zod.run({value:a,issues:[]},i),h=r.valueType._zod.run({value:l,issues:[]},i);u instanceof Promise||h instanceof Promise?o.push(Promise.all([u,h]).then(([r,o])=>{i1(r,o,n,a,s,t,i)})):i1(u,h,n,a,s,t,i)}return o.length?Promise.all(o).then(()=>n):n}});function i1(t,r,n,i,s,o,a){t.issues.length&&(ra.has(typeof i)?n.issues.push(...rg(i,t.issues)):n.issues.push({code:"invalid_key",origin:"map",input:s,inst:o,issues:t.issues.map(t=>rv(t,a,t0()))})),r.issues.length&&(ra.has(typeof i)?n.issues.push(...rg(i,r.issues)):n.issues.push({origin:"map",code:"invalid_element",input:s,inst:o,key:i,issues:r.issues.map(t=>rv(t,a,t0()))})),n.value.set(t.value,r.value)}let i2=tY("$ZodSet",(t,r)=>{n5.init(t,r),t._zod.parse=(n,i)=>{let s=n.value;if(!(s instanceof Set))return n.issues.push({input:s,inst:t,expected:"set",code:"invalid_type"}),n;let o=[];for(let t of(n.value=new Set,s)){let s=r.valueType._zod.run({value:t,issues:[]},i);s instanceof Promise?o.push(s.then(t=>i5(t,n))):i5(s,n)}return o.length?Promise.all(o).then(()=>n):n}});function i5(t,r){t.issues.length&&r.issues.push(...t.issues),r.value.add(t.value)}let i3=tY("$ZodEnum",(t,r)=>{n5.init(t,r);let n=t1(r.entries),i=new Set(n);t._zod.values=i,t._zod.pattern=RegExp(`^(${n.filter(t=>ra.has(typeof t)).map(t=>"string"==typeof t?ru(t):t.toString()).join("|")})$`),t._zod.parse=(r,s)=>{let o=r.value;return i.has(o)||r.issues.push({code:"invalid_value",values:n,input:o,inst:t}),r}}),i4=tY("$ZodLiteral",(t,r)=>{if(n5.init(t,r),0===r.values.length)throw Error("Cannot create literal schema with no valid values");let n=new Set(r.values);t._zod.values=n,t._zod.pattern=RegExp(`^(${r.values.map(t=>"string"==typeof t?ru(t):t?ru(t.toString()):String(t)).join("|")})$`),t._zod.parse=(i,s)=>{let o=i.value;return n.has(o)||i.issues.push({code:"invalid_value",values:r.values,input:o,inst:t}),i}}),i8=tY("$ZodFile",(t,r)=>{n5.init(t,r),t._zod.parse=(r,n)=>{let i=r.value;return i instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:i,inst:t}),r}}),i6=tY("$ZodTransform",(t,r)=>{n5.init(t,r),t._zod.parse=(n,i)=>{if("backward"===i.direction)throw new tJ(t.constructor.name);let s=r.transform(n.value,n);if(i.async)return(s instanceof Promise?s:Promise.resolve(s)).then(t=>(n.value=t,n));if(s instanceof Promise)throw new tK;return n.value=s,n}});function i9(t,r){return t.issues.length&&void 0===r?{issues:[],value:void 0}:t}let i7=tY("$ZodOptional",(t,r)=>{n5.init(t,r),t._zod.optin="optional",t._zod.optout="optional",t9(t._zod,"values",()=>r.innerType._zod.values?new Set([...r.innerType._zod.values,void 0]):void 0),t9(t._zod,"pattern",()=>{let t=r.innerType._zod.pattern;return t?RegExp(`^(${t8(t.source)})?$`):void 0}),t._zod.parse=(t,n)=>{if("optional"===r.innerType._zod.optin){let i=r.innerType._zod.run(t,n);return i instanceof Promise?i.then(r=>i9(r,t.value)):i9(i,t.value)}return void 0===t.value?t:r.innerType._zod.run(t,n)}}),se=tY("$ZodExactOptional",(t,r)=>{i7.init(t,r),t9(t._zod,"values",()=>r.innerType._zod.values),t9(t._zod,"pattern",()=>r.innerType._zod.pattern),t._zod.parse=(t,n)=>r.innerType._zod.run(t,n)}),st=tY("$ZodNullable",(t,r)=>{n5.init(t,r),t9(t._zod,"optin",()=>r.innerType._zod.optin),t9(t._zod,"optout",()=>r.innerType._zod.optout),t9(t._zod,"pattern",()=>{let t=r.innerType._zod.pattern;return t?RegExp(`^(${t8(t.source)}|null)$`):void 0}),t9(t._zod,"values",()=>r.innerType._zod.values?new Set([...r.innerType._zod.values,null]):void 0),t._zod.parse=(t,n)=>null===t.value?t:r.innerType._zod.run(t,n)}),sr=tY("$ZodDefault",(t,r)=>{n5.init(t,r),t._zod.optin="optional",t9(t._zod,"values",()=>r.innerType._zod.values),t._zod.parse=(t,n)=>{if("backward"===n.direction)return r.innerType._zod.run(t,n);if(void 0===t.value)return t.value=r.defaultValue,t;let i=r.innerType._zod.run(t,n);return i instanceof Promise?i.then(t=>sn(t,r)):sn(i,r)}});function sn(t,r){return void 0===t.value&&(t.value=r.defaultValue),t}let si=tY("$ZodPrefault",(t,r)=>{n5.init(t,r),t._zod.optin="optional",t9(t._zod,"values",()=>r.innerType._zod.values),t._zod.parse=(t,n)=>("backward"===n.direction||void 0===t.value&&(t.value=r.defaultValue),r.innerType._zod.run(t,n))}),ss=tY("$ZodNonOptional",(t,r)=>{n5.init(t,r),t9(t._zod,"values",()=>{let t=r.innerType._zod.values;return t?new Set([...t].filter(t=>void 0!==t)):void 0}),t._zod.parse=(n,i)=>{let s=r.innerType._zod.run(n,i);return s instanceof Promise?s.then(r=>so(r,t)):so(s,t)}});function so(t,r){return t.issues.length||void 0!==t.value||t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:r}),t}let sa=tY("$ZodSuccess",(t,r)=>{n5.init(t,r),t._zod.parse=(t,n)=>{if("backward"===n.direction)throw new tJ("ZodSuccess");let i=r.innerType._zod.run(t,n);return i instanceof Promise?i.then(r=>(t.value=0===r.issues.length,t)):(t.value=0===i.issues.length,t)}}),sl=tY("$ZodCatch",(t,r)=>{n5.init(t,r),t9(t._zod,"optin",()=>r.innerType._zod.optin),t9(t._zod,"optout",()=>r.innerType._zod.optout),t9(t._zod,"values",()=>r.innerType._zod.values),t._zod.parse=(t,n)=>{if("backward"===n.direction)return r.innerType._zod.run(t,n);let i=r.innerType._zod.run(t,n);return i instanceof Promise?i.then(i=>(t.value=i.value,i.issues.length&&(t.value=r.catchValue({...t,error:{issues:i.issues.map(t=>rv(t,n,t0()))},input:t.value}),t.issues=[]),t)):(t.value=i.value,i.issues.length&&(t.value=r.catchValue({...t,error:{issues:i.issues.map(t=>rv(t,n,t0()))},input:t.value}),t.issues=[]),t)}}),su=tY("$ZodNaN",(t,r)=>{n5.init(t,r),t._zod.parse=(r,n)=>("number"==typeof r.value&&Number.isNaN(r.value)||r.issues.push({input:r.value,inst:t,expected:"nan",code:"invalid_type"}),r)}),sh=tY("$ZodPipe",(t,r)=>{n5.init(t,r),t9(t._zod,"values",()=>r.in._zod.values),t9(t._zod,"optin",()=>r.in._zod.optin),t9(t._zod,"optout",()=>r.out._zod.optout),t9(t._zod,"propValues",()=>r.in._zod.propValues),t._zod.parse=(t,n)=>{if("backward"===n.direction){let i=r.out._zod.run(t,n);return i instanceof Promise?i.then(t=>sc(t,r.in,n)):sc(i,r.in,n)}let i=r.in._zod.run(t,n);return i instanceof Promise?i.then(t=>sc(t,r.out,n)):sc(i,r.out,n)}});function sc(t,r,n){return t.issues.length?(t.aborted=!0,t):r._zod.run({value:t.value,issues:t.issues},n)}let sd=tY("$ZodCodec",(t,r)=>{n5.init(t,r),t9(t._zod,"values",()=>r.in._zod.values),t9(t._zod,"optin",()=>r.in._zod.optin),t9(t._zod,"optout",()=>r.out._zod.optout),t9(t._zod,"propValues",()=>r.in._zod.propValues),t._zod.parse=(t,n)=>{if("forward"===(n.direction||"forward")){let i=r.in._zod.run(t,n);return i instanceof Promise?i.then(t=>sp(t,r,n)):sp(i,r,n)}{let i=r.out._zod.run(t,n);return i instanceof Promise?i.then(t=>sp(t,r,n)):sp(i,r,n)}}});function sp(t,r,n){if(t.issues.length)return t.aborted=!0,t;if("forward"===(n.direction||"forward")){let i=r.transform(t.value,t);return i instanceof Promise?i.then(i=>sf(t,i,r.out,n)):sf(t,i,r.out,n)}{let i=r.reverseTransform(t.value,t);return i instanceof Promise?i.then(i=>sf(t,i,r.in,n)):sf(t,i,r.in,n)}}function sf(t,r,n,i){return t.issues.length?(t.aborted=!0,t):n._zod.run({value:r,issues:t.issues},i)}let sm=tY("$ZodReadonly",(t,r)=>{n5.init(t,r),t9(t._zod,"propValues",()=>r.innerType._zod.propValues),t9(t._zod,"values",()=>r.innerType._zod.values),t9(t._zod,"optin",()=>r.innerType?._zod?.optin),t9(t._zod,"optout",()=>r.innerType?._zod?.optout),t._zod.parse=(t,n)=>{if("backward"===n.direction)return r.innerType._zod.run(t,n);let i=r.innerType._zod.run(t,n);return i instanceof Promise?i.then(sg):sg(i)}});function sg(t){return t.value=Object.freeze(t.value),t}let sy=tY("$ZodTemplateLiteral",(t,r)=>{n5.init(t,r);let n=[];for(let t of r.parts)if("object"==typeof t&&null!==t){if(!t._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...t._zod.traits].shift()}`);let r=t._zod.pattern instanceof RegExp?t._zod.pattern.source:t._zod.pattern;if(!r)throw Error(`Invalid template literal part: ${t._zod.traits}`);let i=+!!r.startsWith("^"),s=r.endsWith("$")?r.length-1:r.length;n.push(r.slice(i,s))}else if(null===t||rl.has(typeof t))n.push(ru(`${t}`));else throw Error(`Invalid template literal part: ${t}`);t._zod.pattern=RegExp(`^${n.join("")}$`),t._zod.parse=(n,i)=>
41("string"!=typeof n.value?n.issues.push({input:n.value,inst:t,expected:"string",code:"invalid_type"}):(t._zod.pattern.lastIndex=0,t._zod.pattern.test(n.value)||n.issues.push({input:n.value,inst:t,code:"invalid_format",format:r.format??"template_literal",pattern:t._zod.pattern.source})),n)}),sv=tY("$ZodFunction",(t,r)=>(n5.init(t,r),t._def=r,t._zod.def=r,t.implement=r=>{if("function"!=typeof r)throw Error("implement() must be called with a function");return function(...n){let i=Reflect.apply(r,this,t._def.input?rw(t._def.input,n):n);return t._def.output?rw(t._def.output,i):i}},t.implementAsync=r=>{if("function"!=typeof r)throw Error("implementAsync() must be called with a function");return async function(...n){let i=t._def.input?await rF(t._def.input,n):n,s=await Reflect.apply(r,this,i);return t._def.output?await rF(t._def.output,s):s}},t._zod.parse=(r,n)=>("function"!=typeof r.value?r.issues.push({code:"invalid_type",expected:"function",input:r.value,inst:t}):t._def.output&&"promise"===t._def.output._zod.def.type?r.value=t.implementAsync(r.value):r.value=t.implement(r.value),r),t.input=(...r)=>{let n=t.constructor;return new n(Array.isArray(r[0])?{type:"function",input:new iK({type:"tuple",items:r[0],rest:r[1]}),output:t._def.output}:{type:"function",input:r[0],output:t._def.output})},t.output=r=>new t.constructor({type:"function",input:t._def.input,output:r}),t)),sb=tY("$ZodPromise",(t,r)=>{n5.init(t,r),t._zod.parse=(t,n)=>Promise.resolve(t.value).then(t=>r.innerType._zod.run({value:t,issues:[]},n))}),sx=tY("$ZodLazy",(t,r)=>{n5.init(t,r),t9(t._zod,"innerType",()=>r.getter()),t9(t._zod,"pattern",()=>t._zod.innerType?._zod?.pattern),t9(t._zod,"propValues",()=>t._zod.innerType?._zod?.propValues),t9(t._zod,"optin",()=>t._zod.innerType?._zod?.optin??void 0),t9(t._zod,"optout",()=>t._zod.innerType?._zod?.optout??void 0),t._zod.parse=(r,n)=>t._zod.innerType._zod.run(r,n)}),s_=tY("$ZodCustom",(t,r)=>{nI.init(t,r),n5.init(t,r),t._zod.parse=(t,r)=>t,t._zod.check=n=>{let i=n.value,s=r.fn(i);if(s instanceof Promise)return s.then(r=>sA(r,n,i,t));sA(s,n,i,t)}});function sA(t,r,n,i){if(!t){let t={code:"custom",input:n,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(t.params=i._zod.def.params),r.issues.push(r_(t))}}Symbol("ZodOutput"),Symbol("ZodInput");class sE{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let n=r[0];return this._map.set(t,n),n&&"object"==typeof n&&"id"in n&&this._idmap.set(n.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&"object"==typeof r&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let i={...n,...this._map.get(t)};return Object.keys(i).length?i:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}(o=globalThis).__zod_globalRegistry??(o.__zod_globalRegistry=new sE);let sC=globalThis.__zod_globalRegistry;function sD(t,r){return new t({type:"string",format:"email",check:"string_format",abort:!1,...rc(r)})}function sw(t,r){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...rc(r)})}function sS(t,r){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...rc(r)})}function sF(t,r){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...rc(r)})}function sT(t,r){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...rc(r)})}function sN(t,r){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...rc(r)})}function sI(t,r){return new t({type:"string",format:"url",check:"string_format",abort:!1,...rc(r)})}function sO(t,r){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...rc(r)})}function sk(t,r){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...rc(r)})}function sM(t,r){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...rc(r)})}function sB(t,r){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...rc(r)})}function sL(t,r){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...rc(r)})}function sR(t,r){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...rc(r)})}function sP(t,r){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...rc(r)})}function sz(t,r){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...rc(r)})}function sU(t,r){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...rc(r)})}function s$(t,r){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...rc(r)})}function sj(t,r){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...rc(r)})}function sV(t,r){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...rc(r)})}function sG(t,r){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...rc(r)})}function sH(t,r){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...rc(r)})}function sq(t,r){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...rc(r)})}function sW(t,r){return new nk({check:"less_than",...rc(r),value:t,inclusive:!1})}function sZ(t,r){return new nk({check:"less_than",...rc(r),value:t,inclusive:!0})}function sX(t,r){return new nM({check:"greater_than",...rc(r),value:t,inclusive:!1})}function sY(t,r){return new nM({check:"greater_than",...rc(r),value:t,inclusive:!0})}function sK(t){return sX(0,t)}function sJ(t){return sW(0,t)}function sQ(t){return sZ(0,t)}function s0(t){return sY(0,t)}function s1(t,r){return new nB({check:"multiple_of",...rc(r),value:t})}function s2(t,r){return new nP({check:"max_size",...rc(r),maximum:t})}function s5(t,r){return new nz({check:"min_size",...rc(r),minimum:t})}function s3(t,r){return new nU({check:"size_equals",...rc(r),size:t})}function s4(t,r){return new n$({check:"max_length",...rc(r),maximum:t})}function s8(t,r){return new nj({check:"min_length",...rc(r),minimum:t})}function s6(t,r){return new nV({check:"length_equals",...rc(r),length:t})}function s9(t,r){return new nH({check:"string_format",format:"regex",...rc(r),pattern:t})}function s7(t){return new nq({check:"string_format",format:"lowercase",...rc(t)})}
41function oe(t){return new nW({check:"string_format",format:"uppercase",...rc(t)})}function ot(t,r){return new nZ({check:"string_format",format:"includes",...rc(r),includes:t})}function or(t,r){return new nX({check:"string_format",format:"starts_with",...rc(r),prefix:t})}function on(t,r){return new nY({check:"string_format",format:"ends_with",...rc(r),suffix:t})}function oi(t,r,n){return new nJ({check:"property",property:t,schema:r,...rc(n)})}function os(t,r){return new nQ({check:"mime_type",mime:t,...rc(r)})}function oo(t){return new n0({check:"overwrite",tx:t})}function oa(t){return oo(r=>r.normalize(t))}function ol(){return oo(t=>t.trim())}function ou(){return oo(t=>t.toLowerCase())}function oh(){return oo(t=>t.toUpperCase())}function oc(){return oo(t=>t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,""))}function od(t,r,n,i={}){let s=rc(i),o={...rc(i),check:"string_format",type:"string",format:r,fn:"function"==typeof n?n:t=>n.test(t),...s};return n instanceof RegExp&&(o.pattern=n),new t(o)}function op(t){let r=t?.target??"draft-2020-12";return"draft-4"===r&&(r="draft-04"),"draft-7"===r&&(r="draft-07"),{processors:t.processors??{},metadataRegistry:t?.metadata??sC,target:r,unrepresentable:t?.unrepresentable??"throw",override:t?.override??(()=>{}),io:t?.io??"output",counter:0,seen:new Map,cycles:t?.cycles??"ref",reused:t?.reused??"inline",external:t?.external??void 0}}function of(t,r,n={path:[],schemaPath:[]}){var i;let s=t._zod.def,o=r.seen.get(t);if(o)return o.count++,n.schemaPath.includes(t)&&(o.cycle=n.path),o.schema;let a={schema:{},count:1,cycle:void 0,path:n.path};r.seen.set(t,a);let l=t._zod.toJSONSchema?.();if(l)a.schema=l;else{let i={...n,schemaPath:[...n.schemaPath,t],path:n.path};if(t._zod.processJSONSchema)t._zod.processJSONSchema(r,a.schema,i);else{let n=a.schema,o=r.processors[s.type];if(!o)throw Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);o(t,r,n,i)}let o=t._zod.parent;o&&(a.ref||(a.ref=o),of(o,r,i),r.seen.get(o).isParent=!0)}let u=r.metadataRegistry.get(t);return u&&Object.assign(a.schema,u),"input"===r.io&&function t(r,n){let i=n??{seen:new Set};if(i.seen.has(r))return!1;i.seen.add(r);let s=r._zod.def;if("transform"===s.type)return!0;if("array"===s.type)return t(s.element,i);if("set"===s.type)return t(s.valueType,i);if("lazy"===s.type)return t(s.getter(),i);if("promise"===s.type||"optional"===s.type||"nonoptional"===s.type||"nullable"===s.type||"readonly"===s.type||"default"===s.type||"prefault"===s.type)return t(s.innerType,i);if("intersection"===s.type)return t(s.left,i)||t(s.right,i);if("record"===s.type||"map"===s.type)return t(s.keyType,i)||t(s.valueType,i);if("pipe"===s.type)return t(s.in,i)||t(s.out,i);if("object"===s.type){for(let r in s.shape)if(t(s.shape[r],i))return!0;return!1}if("union"===s.type){for(let r of s.options)if(t(r,i))return!0;return!1}if("tuple"===s.type){for(let r of s.items)if(t(r,i))return!0;if(s.rest&&t(s.rest,i))return!0}return!1}(t)&&(delete a.schema.examples,delete a.schema.default),"input"===r.io&&a.schema._prefault&&((i=a.schema).default??(i.default=a.schema._prefault)),delete a.schema._prefault,r.seen.get(t).schema}function om(t,r){let n=t.seen.get(r);if(!n)throw Error("Unprocessed schema. This is a bug in Zod.");let i=new Map;for(let r of t.seen.entries()){let n=t.metadataRegistry.get(r[0])?.id;if(n){let t=i.get(n);if(t&&t!==r[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);i.set(n,r[0])}}let s=r=>{if(r[1].schema.$ref)return;let i=r[1],{ref:s,defId:o}=(r=>{let i="draft-2020-12"===t.target?"$defs":"definitions";if(t.external){let n=t.external.registry.get(r[0])?.id,s=t.external.uri??(t=>t);if(n)return{ref:s(n)};let o=r[1].defId??r[1].schema.id??`schema${t.counter++}`;return r[1].defId=o,{defId:o,ref:`${s("__shared")}#/${i}/${o}`}}if(r[1]===n)return{ref:"#"};let s=`#/${i}/`,o=r[1].schema.id??`__schema${t.counter++}`;return{defId:o,ref:s+o}})(r);i.def={...i.schema},o&&(i.defId=o);let a=i.schema;for(let t in a)delete a[t];a.$ref=s};if("throw"===t.cycles)for(let r of t.seen.entries()){let t=r[1];if(t.cycle)throw Error(`Cycle detected: #/${t.cycle?.join("/")}/<root>
42
43Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of t.seen.entries()){let i=n[1];if(r===n[0]){s(n);continue}if(t.external){let i=t.external.registry.get(n[0])?.id;if(r!==n[0]&&i){s(n);continue}}if(t.metadataRegistry.get(n[0])?.id||i.cycle||i.count>1&&"ref"===t.reused){s(n);continue}}}function og(t,r){let n=t.seen.get(r);if(!n)throw Error("Unprocessed schema. This is a bug in Zod.");let i=r=>{let n=t.seen.get(r);if(null===n.ref)return;let s=n.def??n.schema,o={...s},a=n.ref;if(n.ref=null,a){i(a);let n=t.seen.get(a),l=n.schema;if(l.$ref&&("draft-07"===t.target||"draft-04"===t.target||"openapi-3.0"===t.target)?(s.allOf=s.allOf??[],s.allOf.push(l)):Object.assign(s,l),Object.assign(s,o),r._zod.parent===a)for(let t in s)"$ref"!==t&&"allOf"!==t&&(t in o||delete s[t]);if(l.$ref&&n.def)for(let t in s)"$ref"!==t&&"allOf"!==t&&t in n.def&&JSON.stringify(s[t])===JSON.stringify(n.def[t])&&delete s[t]}let l=r._zod.parent;if(l&&l!==a){i(l);let r=t.seen.get(l);if(r?.schema.$ref&&(s.$ref=r.schema.$ref,r.def))for(let t in s)"$ref"!==t&&"allOf"!==t&&t in r.def&&JSON.stringify(s[t])===JSON.stringify(r.def[t])&&delete s[t]}t.override({zodSchema:r,jsonSchema:s,path:n.path??[]})};for(let r of[...t.seen.entries()].reverse())i(r[0]);let s={};
43if("draft-2020-12"===t.target?s.$schema="https://json-schema.org/draft/2020-12/schema":"draft-07"===t.target?s.$schema="http://json-schema.org/draft-07/schema#":"draft-04"===t.target?s.$schema="http://json-schema.org/draft-04/schema#":t.target,t.external?.uri){let n=t.external.registry.get(r)?.id;if(!n)throw Error("Schema is missing an `id` property");s.$id=t.external.uri(n)}Object.assign(s,n.def??n.schema);let o=t.external?.defs??{};for(let r of t.seen.entries()){let t=r[1];t.def&&t.defId&&(o[t.defId]=t.def)}t.external||Object.keys(o).length>0&&("draft-2020-12"===t.target?s.$defs=o:s.definitions=o);try{let n=JSON.parse(JSON.stringify(s));return Object.defineProperty(n,"~standard",{value:{...r["~standard"],jsonSchema:{input:oy(r,"input",t.processors),output:oy(r,"output",t.processors)}},enumerable:!1,writable:!1}),n}catch(t){throw Error("Error converting schema to JSON.")}}let oy=(t,r,n={})=>i=>{let{libraryOptions:s,target:o}=i??{},a=op({...s??{},target:o,io:r,processors:n});return of(t,a),om(a,t),og(a,t)},ov={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},ob=(t,r,n,i)=>{let s=t._zod.def,o=!1===s.inclusive,a=s.options.map((t,n)=>of(t,r,{...i,path:[...i.path,o?"oneOf":"anyOf",n]}));o?n.oneOf=a:n.anyOf=a},ox=(t,r,n,i)=>{let s=t._zod.def;of(s.innerType,r,i),r.seen.get(t).ref=s.innerType},o_=tY("ZodISODateTime",(t,r)=>{il.init(t,r),oW.init(t,r)});function oA(t){return new o_({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...rc(t)})}let oE=tY("ZodISODate",(t,r)=>{iu.init(t,r),oW.init(t,r)});function oC(t){return new oE({type:"string",format:"date",check:"string_format",...rc(t)})}let oD=tY("ZodISOTime",(t,r)=>{ih.init(t,r),oW.init(t,r)});function ow(t){return new oD({type:"string",format:"time",check:"string_format",precision:null,...rc(t)})}let oS=tY("ZodISODuration",(t,r)=>{ic.init(t,r),oW.init(t,r)});function oF(t){return new oS({type:"string",format:"duration",check:"string_format",...rc(t)})}let oT=(t,r)=>{rE.init(t,r),t.name="ZodError",Object.defineProperties(t,{format:{value:r=>(function(t,r=t=>t.message){let n={_errors:[]},i=t=>{for(let s of t.issues)if("invalid_union"===s.code&&s.errors.length)s.errors.map(t=>i({issues:t}));else if("invalid_key"===s.code)i({issues:s.issues});else if("invalid_element"===s.code)i({issues:s.issues});else if(0===s.path.length)n._errors.push(r(s));else{let t=n,i=0;for(;i<s.path.length;){let n=s.path[i];i===s.path.length-1?(t[n]=t[n]||{_errors:[]},t[n]._errors.push(r(s))):t[n]=t[n]||{_errors:[]},t=t[n],i++}}};return i(t),n})(t,r)},flatten:{value:r=>(function(t,r=t=>t.message){let n={},i=[];for(let s of t.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(r(s))):i.push(r(s));return{formErrors:i,fieldErrors:n}})(t,r)},addIssue:{value:r=>{t.issues.push(r),t.message=JSON.stringify(t.issues,t5,2)}},addIssues:{value:r=>{t.issues.push(...r),t.message=JSON.stringify(t.issues,t5,2)}},isEmpty:{get:()=>0===t.issues.length}})};tY("ZodError",oT);let oN=tY("ZodError",oT,{Parent:Error}),oI=rD(oN),oO=rS(oN),ok=rT(oN),oM=rI(oN),oB=(t,r,n)=>{let i=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return rD(oN)(t,r,i)},oL=(t,r,n)=>rD(oN)(t,r,n),oR=async(t,r,n)=>{let i=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return rS(oN)(t,r,i)},oP=async(t,r,n)=>rS(oN)(t,r,n),oz=(t,r,n)=>{let i=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return rT(oN)(t,r,i)},oU=(t,r,n)=>rT(oN)(t,r,n),o$=async(t,r,n)=>{let i=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return rI(oN)(t,r,i)},oj=async(t,r,n)=>rI(oN)(t,r,n),oV=tY("ZodType",(t,r)=>(n5.init(t,r),Object.assign(t["~standard"],{jsonSchema:{input:oy(t,"input"),output:oy(t,"output")}}),t.toJSONSchema=((t,r={})=>n=>{let i=op({...n,processors:r});return of(t,i),om(i,t),og(i,t)})(t,{}),t.def=r,t.type=r.type,Object.defineProperty(t,"_def",{value:r}),t.check=(...n)=>t.clone(re(r,{checks:[...r.checks??[],...n.map(t=>"function"==typeof t?{_zod:{check:t,def:{check:"custom"},onattach:[]}}:t)]}),{parent:!0}),t.with=t.check,t.clone=(r,n)=>rh(t,r,n),t.brand=()=>t,t.register=(r,n)=>(r.add(t,n),t),t.parse=(r,n)=>oI(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>ok(t,r,n),t.parseAsync=async(r,n)=>oO(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>oM(t,r,n),t.spa=t.safeParseAsync,t.encode=(r,n)=>oB(t,r,n),t.decode=(r,n)=>oL(t,r,n),t.encodeAsync=async(r,n)=>oR(t,r,n),t.decodeAsync=async(r,n)=>oP(t,r,n),t.safeEncode=(r,n)=>oz(t,r,n),t.safeDecode=(r,n)=>oU(t,r,n),t.safeEncodeAsync=async(r,n)=>o$(t,r,n),t.safeDecodeAsync=async(r,n)=>oj(t,r,n),t.refine=(r,n)=>t.check(uo(r,n)),t.superRefine=r=>t.check(ua(r)),t.overwrite=r=>t.check(oo(r)),t.optional=()=>lB(t),t.exactOptional=()=>lR(t),t.nullable=()=>lz(t),t.nullish=()=>lB(lz(t)),t.nonoptional=r=>lq(t,r),t.array=()=>lt(t),t.or=r=>ll([t,r]),t.and=r=>lf(t,r),t.transform=r=>l0(t,lk(r)),t.default=r=>lj(t,r),t.prefault=r=>lG(t,r),t.catch=r=>lY(t,r),t.pipe=r=>l0(t,r),t.readonly=()=>l3(t),t.describe=r=>{let n=t.clone();return sC.add(n,{description:r}),n},Object.defineProperty(t,"description",{get:()=>sC.get(t)?.description,configurable:!0}),t.meta=(...r)=>{if(0===r.length)return sC.get(t);let n=t.clone();return sC.add(n,r[0]),n},t.isOptional=()=>t.safeParse(void 0).success,t.isNullable=()=>t.safeParse(null).success,t.apply=r=>r(t),t)),oG=tY("_ZodString",(t,r)=>{n3.init(t,r),oV.init(t,r),t._zod.processJSONSchema=(r,n,i)=>((t,r,n,i)=>{n.type="string";let{minimum:s,maximum:o,format:a,patterns:l,contentEncoding:u}=t._zod.bag;if("number"==typeof s&&(n.minLength=s),"number"==typeof o&&(n.maxLength=o),a&&(n.format=ov[a]??a,""===n.format&&delete n.format,"time"===a&&delete n.format),u&&(n.contentEncoding=u),l&&l.size>0){let t=[...l];1===t.length?n.pattern=t[0].source:t.length>1&&(n.allOf=[...t.map(t=>({..."draft-07"===r.target||"draft-04"===r.target||"openapi-3.0"===r.target?{type:"string"}:{},pattern:t.source}))])}})(t,r,n,0);let n=t._zod.bag;t.format=n.format??null,t.minLength=n.minimum??null,t.maxLength=n.maximum??null,t.regex=(...r)=>t.check(s9(...r)),t.includes=(...r)=>t.check(ot(...r)),t.startsWith=(...r)=>t.check(or(...r)),t.endsWith=(...r)=>t.check(on(...r)),t.min=(...r)=>t.check(s8(...r)),t.max=(...r)=>t.check(s4(...r)),t.length=(...r)=>t.check(s6(...r)),t.nonempty=(...r)=>t.check(s8(1,...r)),t.lowercase=r=>t.check(s7(r)),t.uppercase=r=>t.check(oe(r)),t.trim=()=>t.check(ol()),t.normalize=(...r)=>t.check(oa(...r)),t.toLowerCase=()=>t.check(ou()),t.toUpperCase=()=>t.check(oh()),t.slugify=()=>t.check(oc())}),oH=tY("ZodString",(t,r)=>{n3.init(t,r),oG.init(t,r),t.email=r=>t.check(sD(oZ,r)),t.url=r=>t.check(sI(o5,r)),t.jwt=r=>t.check(sq(aw,r)),t.emoji=r=>t.check(sO(o8,r)),t.guid=r=>t.check(sw(oY,r)),t.uuid=r=>t.check(sS(oJ,r)),t.uuidv4=r=>t.check(sF(oJ,r)),t.uuidv6=r=>t.check(sT(oJ,r)),t.uuidv7=r=>t.check(sN(oJ,r)),t.nanoid=r=>t.check(sk(o9,r)),t.guid=r=>t.check(sw(oY,r)),t.cuid=r=>t.check(sM(ae,r)),t.cuid2=r=>t.check(sB(ar,r)),t.ulid=r=>t.check(sL(ai,r)),t.base64=r=>t.check(sV(ax,r)),t.base64url=r=>t.check(sG(aA,r)),t.xid=r=>t.check(sR(ao,r)),t.ksuid=r=>t.check(sP(al,r)),t.ipv4=r=>t.check(sz(ah,r)),t.ipv6=r=>t.check(sU(af,r)),t.cidrv4=r=>t.check(s$(ag,r)),t.cidrv6=r=>t.check(sj(av,r)),t.e164=r=>t.check(sH(aC,r)),t.datetime=r=>t.check(oA(r)),t.date=r=>t.check(oC(r)),t.time=r=>t.check(ow(r)),t.duration=r=>t.check(oF(r))});function oq(t){return new oH({type:"string",...rc(t)})}let oW=tY("ZodStringFormat",(t,r)=>{n4.init(t,r),oG.init(t,r)}),oZ=tY("ZodEmail",(t,r)=>{n9.init(t,r),oW.init(t,r)});function oX(t){return sD(oZ,t)}let oY=tY("ZodGUID",(t,r)=>{n8.init(t,r),oW.init(t,r)});function oK(t){return sw(oY,t)}let oJ=tY("ZodUUID",(t,r)=>{n6.init(t,r),oW.init(t,r)});function oQ(t){return sS(oJ,t)}function o0(t){return sF(oJ,t)}function o1(t){return sT(oJ,t)}function o2(t){return sN(oJ,t)}let o5=tY("ZodURL",(t,r)=>{n7.init(t,r),oW.init(t,r)});function o3(t){return sI(o5,t)}function o4(t){return sI(o5,{protocol:/^https?$/,hostname:r6,...rc(t)})}let o8=tY("ZodEmoji",(t,r)=>{ie.init(t,r),oW.init(t,r)});function o6(t){return sO(o8,t)}let o9=tY("ZodNanoID",(t,r)=>{it.init(t,r),oW.init(t,r)});function o7(t){return sk(o9,t)}let ae=tY("ZodCUID",(t,r)=>{ir.init(t,r),oW.init(t,r)});function at(t){return sM(ae,t)}let ar=tY("ZodCUID2",(t,r)=>{ii.init(t,r),oW.init(t,r)});function an(t){return sB(ar,t)}
43let ai=tY("ZodULID",(t,r)=>{is.init(t,r),oW.init(t,r)});function as(t){return sL(ai,t)}let ao=tY("ZodXID",(t,r)=>{io.init(t,r),oW.init(t,r)});function aa(t){return sR(ao,t)}let al=tY("ZodKSUID",(t,r)=>{ia.init(t,r),oW.init(t,r)});function au(t){return sP(al,t)}let ah=tY("ZodIPv4",(t,r)=>{id.init(t,r),oW.init(t,r)});function ac(t){return sz(ah,t)}let ad=tY("ZodMAC",(t,r)=>{im.init(t,r),oW.init(t,r)});function ap(t){return new ad({type:"string",format:"mac",check:"string_format",abort:!1,...rc(t)})}let af=tY("ZodIPv6",(t,r)=>{ip.init(t,r),oW.init(t,r)});function am(t){return sU(af,t)}let ag=tY("ZodCIDRv4",(t,r)=>{ig.init(t,r),oW.init(t,r)});function ay(t){return s$(ag,t)}let av=tY("ZodCIDRv6",(t,r)=>{iy.init(t,r),oW.init(t,r)});function ab(t){return sj(av,t)}let ax=tY("ZodBase64",(t,r)=>{ib.init(t,r),oW.init(t,r)});function a_(t){return sV(ax,t)}let aA=tY("ZodBase64URL",(t,r)=>{ix.init(t,r),oW.init(t,r)});function aE(t){return sG(aA,t)}let aC=tY("ZodE164",(t,r)=>{i_.init(t,r),oW.init(t,r)});function aD(t){return sH(aC,t)}let aw=tY("ZodJWT",(t,r)=>{iA.init(t,r),oW.init(t,r)});function aS(t){return sq(aw,t)}let aF=tY("ZodCustomStringFormat",(t,r)=>{iE.init(t,r),oW.init(t,r)});function aT(t,r,n={}){return od(aF,t,r,n)}function aN(t){return od(aF,"hostname",r8,t)}function aI(t){return od(aF,"hex",np,t)}function aO(t,r){let n=r?.enc??"hex",i=`${t}_${n}`,s=l[i];if(!s)throw Error(`Unrecognized hash format: ${i}`);return od(aF,i,s,r)}let ak=tY("ZodNumber",(t,r)=>{iC.init(t,r),oV.init(t,r),t._zod.processJSONSchema=(r,n,i)=>((t,r,n,i)=>{let{minimum:s,maximum:o,format:a,multipleOf:l,exclusiveMaximum:u,exclusiveMinimum:h}=t._zod.bag;"string"==typeof a&&a.includes("int")?n.type="integer":n.type="number","number"==typeof h&&("draft-04"===r.target||"openapi-3.0"===r.target?(n.minimum=h,n.exclusiveMinimum=!0):n.exclusiveMinimum=h),"number"==typeof s&&(n.minimum=s,"number"==typeof h&&"draft-04"!==r.target&&(h>=s?delete n.minimum:delete n.exclusiveMinimum)),"number"==typeof u&&("draft-04"===r.target||"openapi-3.0"===r.target?(n.maximum=u,n.exclusiveMaximum=!0):n.exclusiveMaximum=u),"number"==typeof o&&(n.maximum=o,"number"==typeof u&&"draft-04"!==r.target&&(u<=o?delete n.maximum:delete n.exclusiveMaximum)),"number"==typeof l&&(n.multipleOf=l)})(t,r,n,0),t.gt=(r,n)=>t.check(sX(r,n)),t.gte=(r,n)=>t.check(sY(r,n)),t.min=(r,n)=>t.check(sY(r,n)),t.lt=(r,n)=>t.check(sW(r,n)),t.lte=(r,n)=>t.check(sZ(r,n)),t.max=(r,n)=>t.check(sZ(r,n)),t.int=r=>t.check(aL(r)),t.safe=r=>t.check(aL(r)),t.positive=r=>t.check(sX(0,r)),t.nonnegative=r=>t.check(sY(0,r)),t.negative=r=>t.check(sW(0,r)),t.nonpositive=r=>t.check(sZ(0,r)),t.multipleOf=(r,n)=>t.check(s1(r,n)),t.step=(r,n)=>t.check(s1(r,n)),t.finite=()=>t;let n=t._zod.bag;t.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,t.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,t.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),t.isFinite=!0,t.format=n.format??null});function aM(t){return new ak({type:"number",checks:[],...rc(t)})}let aB=tY("ZodNumberFormat",(t,r)=>{iD.init(t,r),ak.init(t,r)});function aL(t){return new aB({type:"number",check:"number_format",abort:!1,format:"safeint",...rc(t)})}function aR(t){return new aB({type:"number",check:"number_format",abort:!1,format:"float32",...rc(t)})}function aP(t){return new aB({type:"number",check:"number_format",abort:!1,format:"float64",...rc(t)})}function az(t){return new aB({type:"number",check:"number_format",abort:!1,format:"int32",...rc(t)})}function aU(t){return new aB({type:"number",check:"number_format",abort:!1,format:"uint32",...rc(t)})}let a$=tY("ZodBoolean",(t,r)=>{iw.init(t,r),oV.init(t,r),t._zod.processJSONSchema=(t,r,n)=>{r.type="boolean"}});function aj(t){return new a$({type:"boolean",...rc(t)})}let aV=tY("ZodBigInt",(t,r)=>{iS.init(t,r),oV.init(t,r),t._zod.processJSONSchema=(t,r,n)=>((t,r,n,i)=>{if("throw"===r.unrepresentable)throw Error("BigInt cannot be represented in JSON Schema")})(0,t,0,0),t.gte=(r,n)=>t.check(sY(r,n)),t.min=(r,n)=>t.check(sY(r,n)),t.gt=(r,n)=>t.check(sX(r,n)),t.gte=(r,n)=>t.check(sY(r,n)),t.min=(r,n)=>t.check(sY(r,n)),t.lt=(r,n)=>t.check(sW(r,n)),t.lte=(r,n)=>t.check(sZ(r,n)),t.max=(r,n)=>t.check(sZ(r,n)),t.positive=r=>t.check(sX(BigInt(0),r)),t.negative=r=>t.check(sW(BigInt(0),r)),t.nonpositive=r=>t.check(sZ(BigInt(0),r)),t.nonnegative=r=>t.check(sY(BigInt(0),r)),t.multipleOf=(r,n)=>t.check(s1(r,n));let n=t._zod.bag;t.minValue=n.minimum??null,t.maxValue=n.maximum??null,t.format=n.format??null});function aG(t){return new aV({type:"bigint",...rc(t)})}let aH=tY("ZodBigIntFormat",(t,r)=>{iF.init(t,r),aV.init(t,r)});function aq(t){return new aH({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...rc(t)})}function aW(t){return new aH({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...rc(t)})}let aZ=tY("ZodSymbol",(t,r)=>{iT.init(t,r),oV.init(t,r),t._zod.processJSONSchema=(t,r,n)=>((t,r,n,i)=>{if("throw"===r.unrepresentable)throw Error("Symbols cannot be represented in JSON Schema")})(0,t,0,0)});function aX(t){return new aZ({type:"symbol",...rc(t)})}let aY=tY("ZodUndefined",(t,r)=>{iN.init(t,r),oV.init(t,r),t._zod.processJSONSchema=(t,r,n)=>((t,r,n,i)=>{if("throw"===r.unrepresentable)throw Error("Undefined cannot be represented in JSON Schema")})(0,t,0,0)});function aK(t){return new aY({type:"undefined",...rc(t)})}let aJ=tY("ZodNull",(t,r)=>{iI.init(t,r),oV.init(t,r),t._zod.processJSONSchema=(t,r,n)=>((t,r,n,i)=>{"openapi-3.0"===r.target?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"})(0,t,r,0)});function aQ(t){return new aJ({type:"null",...rc(t)})}let a0=tY("ZodAny",(t,r)=>{iO.init(t,r),oV.init(t,r),t._zod.processJSONSchema=(t,r,n)=>{}});function a1(){return new a0({type:"any"})}let a2=tY("ZodUnknown",(t,r)=>{ik.init(t,r),oV.init(t,r),t._zod.processJSONSchema=(t,r,n)=>{}});function a5(){return new a2({type:"unknown"})}let a3=tY("ZodNever",(t,r)=>{iM.init(t,r),oV.init(t,r),t._zod.processJSONSchema=(t,r,n)=>{r.not={}}});function a4(t){return new a3({type:"never",...rc(t)})}let a8=tY("ZodVoid",(t,r)=>{iB.init(t,r),oV.init(t,r),t._zod.processJSONSchema=(t,r,n)=>((t,r,n,i)=>{if("throw"===r.unrepresentable)throw Error("Void cannot be represented in JSON Schema")})(0,t,0,0)});function a6(t){return new a8({type:"void",...rc(t)})}let a9=tY("ZodDate",(t,r)=>{iL.init(t,r),oV.init(t,r),t._zod.processJSONSchema=(t,r,n)=>((t,r,n,i)=>{if("throw"===r.unrepresentable)throw Error("Date cannot be represented in JSON Schema")})(0,t,0,0),t.min=(r,n)=>t.check(sY(r,n)),t.max=(r,n)=>t.check(sZ(r,n));let n=t._zod.bag;t.minDate=n.minimum?new Date(n.minimum):null,t.maxDate=n.maximum?new Date(n.maximum):null});function a7(t){return new a9({type:"date",...rc(t)})}let le=tY("ZodArray",(t,r)=>{iP.init(t,r),oV.init(t,r),t._zod.processJSONSchema=(r,n,i)=>((t,r,n,i)=>{let s=t._zod.def,{minimum:o,maximum:a}=t._zod.bag;"number"==typeof o&&(n.minItems=o),"number"==typeof a&&(n.maxItems=a),n.type="array",n.items=of(s.element,r,{...i,path:[...i.path,"items"]})})(t,r,n,i),t.element=r.element,t.min=(r,n)=>t.check(s8(r,n)),t.nonempty=r=>t.check(s8(1,r)),t.max=(r,n)=>t.check(s4(r,n)),t.length=(r,n)=>t.check(s6(r,n)),t.unwrap=()=>t.element});function lt(t,r){return new le({type:"array",element:t,...rc(r)})}function lr(t){return lw(Object.keys(t._zod.def.shape))}let ln=tY("ZodObject",(t,r)=>{iV.init(t,r),oV.init(t,r),t._zod.processJSONSchema=(r,n,i)=>((t,r,n,i)=>{let s=t._zod.def;n.type="object",n.properties={};let o=s.shape;for(let t in o)n.properties[t]=of(o[t],r,{...i,path:[...i.path,"properties",t]});let a=new Set([...new Set(Object.keys(o))].filter(t=>{let n=s.shape[t]._zod;return"input"===r.io?void 0===n.optin:void 0===n.optout}));a.size>0&&(n.required=Array.from(a)),s.catchall?._zod.def.type==="never"?n.additionalProperties=!1:s.catchall?s.catchall&&(n.additionalProperties=of(s.catchall,r,{...i,path:[...i.path,"additionalProperties"]}
43)):"output"===r.io&&(n.additionalProperties=!1)})(t,r,n,i),t9(t,"shape",()=>r.shape),t.keyof=()=>lw(Object.keys(t._zod.def.shape)),t.catchall=r=>t.clone({...t._zod.def,catchall:r}),t.passthrough=()=>t.clone({...t._zod.def,catchall:a5()}),t.loose=()=>t.clone({...t._zod.def,catchall:a5()}),t.strict=()=>t.clone({...t._zod.def,catchall:a4()}),t.strip=()=>t.clone({...t._zod.def,catchall:void 0}),t.extend=r=>(function(t,r){if(!rs(r))throw Error("Invalid input to extend: expected a plain object");let n=t._zod.def.checks;if(n&&n.length>0){let n=t._zod.def.shape;for(let t in r)if(void 0!==Object.getOwnPropertyDescriptor(n,t))throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let i=re(t._zod.def,{get shape(){let n={...t._zod.def.shape,...r};return t7(this,"shape",n),n}});return rh(t,i)})(t,r),t.safeExtend=r=>(function(t,r){if(!rs(r))throw Error("Invalid input to safeExtend: expected a plain object");let n=re(t._zod.def,{get shape(){let n={...t._zod.def.shape,...r};return t7(this,"shape",n),n}});return rh(t,n)})(t,r),t.merge=r=>(function(t,r){let n=re(t._zod.def,{get shape(){let n={...t._zod.def.shape,...r._zod.def.shape};return t7(this,"shape",n),n},get catchall(){return r._zod.def.catchall},checks:[]});return rh(t,n)})(t,r),t.pick=r=>(function(t,r){let n=t._zod.def,i=n.checks;if(i&&i.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let s=re(t._zod.def,{get shape(){let t={};for(let i in r){if(!(i in n.shape))throw Error(`Unrecognized key: "${i}"`);r[i]&&(t[i]=n.shape[i])}return t7(this,"shape",t),t},checks:[]});return rh(t,s)})(t,r),t.omit=r=>(function(t,r){let n=t._zod.def,i=n.checks;if(i&&i.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let s=re(t._zod.def,{get shape(){let i={...t._zod.def.shape};for(let t in r){if(!(t in n.shape))throw Error(`Unrecognized key: "${t}"`);r[t]&&delete i[t]}return t7(this,"shape",i),i},checks:[]});return rh(t,s)})(t,r),t.partial=(...r)=>(function(t,r,n){let i=r._zod.def.checks;if(i&&i.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let s=re(r._zod.def,{get shape(){let i=r._zod.def.shape,s={...i};if(n)for(let r in n){if(!(r in i))throw Error(`Unrecognized key: "${r}"`);n[r]&&(s[r]=t?new t({type:"optional",innerType:i[r]}):i[r])}else for(let r in i)s[r]=t?new t({type:"optional",innerType:i[r]}):i[r];return t7(this,"shape",s),s},checks:[]});return rh(r,s)})(lM,t,r[0]),t.required=(...r)=>(function(t,r,n){let i=re(r._zod.def,{get shape(){let i=r._zod.def.shape,s={...i};if(n)for(let r in n){if(!(r in s))throw Error(`Unrecognized key: "${r}"`);n[r]&&(s[r]=new t({type:"nonoptional",innerType:i[r]}))}else for(let r in i)s[r]=new t({type:"nonoptional",innerType:i[r]});return t7(this,"shape",s),s}});return rh(r,i)})(lH,t,r[0])});function li(t,r){return new ln({type:"object",shape:t??{},...rc(r)})}function ls(t,r){return new ln({type:"object",shape:t,catchall:a4(),...rc(r)})}function lo(t,r){return new ln({type:"object",shape:t,catchall:a5(),...rc(r)})}let la=tY("ZodUnion",(t,r)=>{iH.init(t,r),oV.init(t,r),t._zod.processJSONSchema=(r,n,i)=>ob(t,r,n,i),t.options=r.options});function ll(t,r){return new la({type:"union",options:t,...rc(r)})}let lu=tY("ZodXor",(t,r)=>{la.init(t,r),iW.init(t,r),t._zod.processJSONSchema=(r,n,i)=>ob(t,r,n,i),t.options=r.options});function lh(t,r){return new lu({type:"union",options:t,inclusive:!1,...rc(r)})}let lc=tY("ZodDiscriminatedUnion",(t,r)=>{la.init(t,r),iZ.init(t,r)});function ld(t,r,n){return new lc({type:"union",options:r,discriminator:t,...rc(n)})}let lp=tY("ZodIntersection",(t,r)=>{iX.init(t,r),oV.init(t,r),t._zod.processJSONSchema=(r,n,i)=>((t,r,n,i)=>{let s=t._zod.def,o=of(s.left,r,{...i,path:[...i.path,"allOf",0]}),a=of(s.right,r,{...i,path:[...i.path,"allOf",1]}),l=t=>"allOf"in t&&1===Object.keys(t).length;n.allOf=[...l(o)?o.allOf:[o],...l(a)?a.allOf:[a]]})(t,r,n,i)});function lf(t,r){return new lp({type:"intersection",left:t,right:r})}let lm=tY("ZodTuple",(t,r)=>{iK.init(t,r),oV.init(t,r),t._zod.processJSONSchema=(r,n,i)=>((t,r,n,i)=>{let s=t._zod.def;n.type="array";
43let o="draft-2020-12"===r.target?"prefixItems":"items",a="draft-2020-12"===r.target||"openapi-3.0"===r.target?"items":"additionalItems",l=s.items.map((t,n)=>of(t,r,{...i,path:[...i.path,o,n]})),u=s.rest?of(s.rest,r,{...i,path:[...i.path,a,..."openapi-3.0"===r.target?[s.items.length]:[]]}):null;"draft-2020-12"===r.target?(n.prefixItems=l,u&&(n.items=u)):"openapi-3.0"===r.target?(n.items={anyOf:l},u&&n.items.anyOf.push(u),n.minItems=l.length,u||(n.maxItems=l.length)):(n.items=l,u&&(n.additionalItems=u));let{minimum:h,maximum:c}=t._zod.bag;"number"==typeof h&&(n.minItems=h),"number"==typeof c&&(n.maxItems=c)})(t,r,n,i),t.rest=r=>t.clone({...t._zod.def,rest:r})});function lg(t,r,n){let i=r instanceof n5,s=i?n:r;return new lm({type:"tuple",items:t,rest:i?r:null,...rc(s)})}let ly=tY("ZodRecord",(t,r)=>{iQ.init(t,r),oV.init(t,r),t._zod.processJSONSchema=(r,n,i)=>((t,r,n,i)=>{let s=t._zod.def;n.type="object";let o=s.keyType,a=o._zod.bag,l=a?.patterns;if("loose"===s.mode&&l&&l.size>0){let t=of(s.valueType,r,{...i,path:[...i.path,"patternProperties","*"]});for(let r of(n.patternProperties={},l))n.patternProperties[r.source]=t}else("draft-07"===r.target||"draft-2020-12"===r.target)&&(n.propertyNames=of(s.keyType,r,{...i,path:[...i.path,"propertyNames"]})),n.additionalProperties=of(s.valueType,r,{...i,path:[...i.path,"additionalProperties"]});let u=o._zod.values;if(u){let t=[...u].filter(t=>"string"==typeof t||"number"==typeof t);t.length>0&&(n.required=t)}})(t,r,n,i),t.keyType=r.keyType,t.valueType=r.valueType});function lv(t,r,n){return new ly({type:"record",keyType:t,valueType:r,...rc(n)})}function lb(t,r,n){let i=rh(t);return i._zod.values=void 0,new ly({type:"record",keyType:i,valueType:r,...rc(n)})}function lx(t,r,n){return new ly({type:"record",keyType:t,valueType:r,mode:"loose",...rc(n)})}let l_=tY("ZodMap",(t,r)=>{i0.init(t,r),oV.init(t,r),t._zod.processJSONSchema=(t,r,n)=>((t,r,n,i)=>{if("throw"===r.unrepresentable)throw Error("Map cannot be represented in JSON Schema")})(0,t,0,0),t.keyType=r.keyType,t.valueType=r.valueType,t.min=(...r)=>t.check(s5(...r)),t.nonempty=r=>t.check(s5(1,r)),t.max=(...r)=>t.check(s2(...r)),t.size=(...r)=>t.check(s3(...r))});function lA(t,r,n){return new l_({type:"map",keyType:t,valueType:r,...rc(n)})}let lE=tY("ZodSet",(t,r)=>{i2.init(t,r),oV.init(t,r),t._zod.processJSONSchema=(t,r,n)=>((t,r,n,i)=>{if("throw"===r.unrepresentable)throw Error("Set cannot be represented in JSON Schema")})(0,t,0,0),t.min=(...r)=>t.check(s5(...r)),t.nonempty=r=>t.check(s5(1,r)),t.max=(...r)=>t.check(s2(...r)),t.size=(...r)=>t.check(s3(...r))});function lC(t,r){return new lE({type:"set",valueType:t,...rc(r)})}let lD=tY("ZodEnum",(t,r)=>{i3.init(t,r),oV.init(t,r),t._zod.processJSONSchema=(r,n,i)=>((t,r,n,i)=>{let s=t1(t._zod.def.entries);s.every(t=>"number"==typeof t)&&(n.type="number"),s.every(t=>"string"==typeof t)&&(n.type="string"),n.enum=s})(t,0,n,0),t.enum=r.entries,t.options=Object.values(r.entries);let n=new Set(Object.keys(r.entries));t.extract=(t,i)=>{let s={};for(let i of t)if(n.has(i))s[i]=r.entries[i];else throw Error(`Key ${i} not found in enum`);return new lD({...r,checks:[],...rc(i),entries:s})},t.exclude=(t,i)=>{let s={...r.entries};for(let r of t)if(n.has(r))delete s[r];else throw Error(`Key ${r} not found in enum`);return new lD({...r,checks:[],...rc(i),entries:s})}});function lw(t,r){return new lD({type:"enum",entries:Array.isArray(t)?Object.fromEntries(t.map(t=>[t,t])):t,...rc(r)})}function lS(t,r){return new lD({type:"enum",entries:t,...rc(r)})}let lF=tY("ZodLiteral",(t,r)=>{i4.init(t,r),oV.init(t,r),t._zod.processJSONSchema=(r,n,i)=>((t,r,n,i)=>{let s=t._zod.def,o=[];for(let t of s.values)if(void 0===t){if("throw"===r.unrepresentable)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if("bigint"==typeof t)if("throw"===r.unrepresentable)throw Error("BigInt literals cannot be represented in JSON Schema");else o.push(Number(t));else o.push(t);if(0===o.length);else if(1===o.length){let t=o[0];n.type=null===t?"null":typeof t,"draft-04"===r.target||"openapi-3.0"===r.target?n.enum=[t]:n.const=t}else o.every(t=>"number"==typeof t)&&(n.type="number"),o.every(t=>"string"==typeof t)&&(n.type="string"),o.every(t=>"boolean"==typeof t)&&(n.type="boolean"),o.every(t=>null===t)&&(n.type="null"),n.enum=o})(t,r,n,0),t.values=new Set(r.values),Object.defineProperty(t,"value",{get(){if
43(r.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return r.values[0]}})});function lT(t,r){return new lF({type:"literal",values:Array.isArray(t)?t:[t],...rc(r)})}let lN=tY("ZodFile",(t,r)=>{i8.init(t,r),oV.init(t,r),t._zod.processJSONSchema=(r,n,i)=>((t,r,n,i)=>{let s={type:"string",format:"binary",contentEncoding:"binary"},{minimum:o,maximum:a,mime:l}=t._zod.bag;void 0!==o&&(s.minLength=o),void 0!==a&&(s.maxLength=a),l?1===l.length?(s.contentMediaType=l[0],Object.assign(n,s)):(Object.assign(n,s),n.anyOf=l.map(t=>({contentMediaType:t}))):Object.assign(n,s)})(t,0,n,0),t.min=(r,n)=>t.check(s5(r,n)),t.max=(r,n)=>t.check(s2(r,n)),t.mime=(r,n)=>t.check(os(Array.isArray(r)?r:[r],n))});function lI(t){return new lN({type:"file",...rc(t)})}let lO=tY("ZodTransform",(t,r)=>{i6.init(t,r),oV.init(t,r),t._zod.processJSONSchema=(t,r,n)=>((t,r,n,i)=>{if("throw"===r.unrepresentable)throw Error("Transforms cannot be represented in JSON Schema")})(0,t,0,0),t._zod.parse=(n,i)=>{if("backward"===i.direction)throw new tJ(t.constructor.name);n.addIssue=i=>{"string"==typeof i?n.issues.push(r_(i,n.value,r)):(i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=n.value),i.inst??(i.inst=t),n.issues.push(r_(i)))};let s=r.transform(n.value,n);return s instanceof Promise?s.then(t=>(n.value=t,n)):(n.value=s,n)}});function lk(t){return new lO({type:"transform",transform:t})}let lM=tY("ZodOptional",(t,r)=>{i7.init(t,r),oV.init(t,r),t._zod.processJSONSchema=(r,n,i)=>ox(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function lB(t){return new lM({type:"optional",innerType:t})}let lL=tY("ZodExactOptional",(t,r)=>{se.init(t,r),oV.init(t,r),t._zod.processJSONSchema=(r,n,i)=>ox(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function lR(t){return new lL({type:"optional",innerType:t})}let lP=tY("ZodNullable",(t,r)=>{st.init(t,r),oV.init(t,r),t._zod.processJSONSchema=(r,n,i)=>((t,r,n,i)=>{let s=t._zod.def,o=of(s.innerType,r,i),a=r.seen.get(t);"openapi-3.0"===r.target?(a.ref=s.innerType,n.nullable=!0):n.anyOf=[o,{type:"null"}]})(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function lz(t){return new lP({type:"nullable",innerType:t})}function lU(t){return lB(lz(t))}let l$=tY("ZodDefault",(t,r)=>{sr.init(t,r),oV.init(t,r),t._zod.processJSONSchema=(r,n,i)=>((t,r,n,i)=>{let s=t._zod.def;of(s.innerType,r,i),r.seen.get(t).ref=s.innerType,n.default=JSON.parse(JSON.stringify(s.defaultValue))})(t,r,n,i),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function lj(t,r){return new l$({type:"default",innerType:t,get defaultValue(){return"function"==typeof r?r():ro(r)}})}let lV=tY("ZodPrefault",(t,r)=>{si.init(t,r),oV.init(t,r),t._zod.processJSONSchema=(r,n,i)=>((t,r,n,i)=>{let s=t._zod.def;of(s.innerType,r,i),r.seen.get(t).ref=s.innerType,"input"===r.io&&(n._prefault=JSON.parse(JSON.stringify(s.defaultValue)))})(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function lG(t,r){return new lV({type:"prefault",innerType:t,get defaultValue(){return"function"==typeof r?r():ro(r)}})}let lH=tY("ZodNonOptional",(t,r)=>{ss.init(t,r),oV.init(t,r),t._zod.processJSONSchema=(r,n,i)=>((t,r,n,i)=>{let s=t._zod.def;of(s.innerType,r,i),r.seen.get(t).ref=s.innerType})(t,r,0,i),t.unwrap=()=>t._zod.def.innerType});function lq(t,r){return new lH({type:"nonoptional",innerType:t,...rc(r)})}let lW=tY("ZodSuccess",(t,r)=>{sa.init(t,r),oV.init(t,r),t._zod.processJSONSchema=(t,r,n)=>{r.type="boolean"},t.unwrap=()=>t._zod.def.innerType});function lZ(t){return new lW({type:"success",innerType:t})}let lX=tY("ZodCatch",(t,r)=>{sl.init(t,r),oV.init(t,r),t._zod.processJSONSchema=(r,n,i)=>((t,r,n,i)=>{let s,o=t._zod.def;of(o.innerType,r,i),r.seen.get(t).ref=o.innerType;try{s=o.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}n.default=s})(t,r,n,i),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function lY(t,r){return new lX({type:"catch",innerType:t,catchValue:"function"==typeof r?r:()=>r})}let lK=tY("ZodNaN",(t,r)=>{su.init(t,r),oV.init(t,r),t._zod.processJSONSchema=(t,r,n)=>((t,r,n,i)=>{if("throw"===r.unrepresentable)throw Error("NaN cannot be represented in JSON Schema")})(0,t,0,0)});function lJ(t){return new lK({type:"nan",...rc(t)})}let lQ=tY("ZodPipe",(t,r)=>{sh.init(t,r),oV.init(t,r),t._zod.processJSONSchema=(r,n,i)=>((t,r,n,i)=>{let s=t._zod.def,o="input"===r.io?"transform"===s.in._zod.def.type?s.out:s.in:s.out;of(o,r,i),r.seen.get(t).ref=o})(t,r,0,i),t.in=r.in,t.out=r.out});function l0(t,r){return new lQ({type:"pipe",in:t,out:r})}let l1=tY("ZodCodec",(t,r)=>{lQ.init(t,r),sd.init(t,r)});function l2(t,r,n){return new l1({type:"pipe",in:t,out:r,transform:n.decode,reverseTransform:n.encode})}let l5=tY("ZodReadonly",(t,r)=>{sm.init(t,r),oV.init(t,r),t._zod.processJSONSchema=(r,n,i)=>((t,r,n,i)=>{let s=t._zod.def;of(s.innerType,r,i),r.seen.get(t).ref=s.innerType,n.readOnly=!0})(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function l3(t){return new l5({type:"readonly",innerType:t})}let l4=tY("ZodTemplateLiteral",(t,r)=>{sy.init(t,r),oV.init(t,r),t._zod.processJSONSchema=(r,n,i)=>((t,r,n,i)=>{let s=t._zod.pattern;if(!s)throw Error("Pattern not found in template literal");n.type="string",n.pattern=s.source})(t,0,n,0)});function l8(t,r){return new l4({type:"template_literal",parts:t,...rc(r)})}let l6=tY("ZodLazy",(t,r)=>{sx.init(t,r),oV.init(t,r),t._zod.processJSONSchema=(r,n,i)=>((t,r,n,i)=>{let s=t._zod.innerType;of(s,r,i),r.seen.get(t).ref=s})(t,r,0,i),t.unwrap=()=>t._zod.def.getter()});function l9(t){return new l6({type:"lazy",getter:t})}let l7=tY("ZodPromise",(t,r)=>{sb.init(t,r),oV.init(t,r),t._zod.processJSONSchema=(r,n,i)=>((t,r,n,i)=>{let s=t._zod.def;of(s.innerType,r,i),r.seen.get(t).ref=s.innerType})(t,r,0,i),t.unwrap=()=>t._zod.def.innerType});function ue(t){return new l7({type:"promise",innerType:t})}let ut=tY("ZodFunction",(t,r)=>{sv.init(t,r),oV.init(t,r),t._zod.processJSONSchema=(t,r,n)=>((t,r,n,i)=>{if("throw"===r.unrepresentable)throw Error("Function types cannot be represented in JSON Schema")})(0,t,0,0)});function ur(t){return new ut({type:"function",input:Array.isArray(t?.input)?lg(t?.input):t?.input??lt(a5()),output:t?.output??a5()})}let un=tY("ZodCustom",(t,r)=>{s_.init(t,r),oV.init(t,r),t._zod.processJSONSchema=(t,r,n)=>((t,r,n,i)=>{if("throw"===r.unrepresentable)throw Error("Custom types cannot be represented in JSON Schema")})(0,t,0,0)});function ui(t){let r=new nI({check:"custom"});return r._zod.check=t,r}function us(t,r){let n=rc(r);return n.abort??(n.abort=!0),new un({type:"custom",check:"custom",fn:t??(()=>!0),...n})}function uo(t,r={}){return new un({type:"custom",check:"custom",fn:t,...rc(r)})}function ua(t){let r=function(t,r){let n=new nI({check:"custom",...rc(void 0)});return n._zod.check=t,n}(n=>(n.addIssue=t=>{"string"==typeof t?n.issues.push(r_(t,n.value,r._zod.def)):(t.fatal&&(t.continue=!1),t.code??(t.code="custom"),t.input??(t.input=n.value),t.inst??(t.inst=r),t.continue??(t.continue=!r._zod.def.abort),n.issues.push(r_(t)))}
43,t(n.value,n)));return r}let ul=function(t){let r=new nI({check:"describe"});return r._zod.onattach=[r=>{let n=sC.get(r)??{};sC.add(r,{...n,description:t})}],r._zod.check=()=>{},r},uu=function(t){let r=new nI({check:"meta"});return r._zod.onattach=[r=>{let n=sC.get(r)??{};sC.add(r,{...n,...t})}],r._zod.check=()=>{},r};function uh(t,r={}){let n=new un({type:"custom",check:"custom",fn:r=>r instanceof t,abort:!0,...rc(r)});return n._zod.bag.Class=t,n._zod.check=r=>{r.value instanceof t||r.issues.push({code:"invalid_type",expected:t.name,input:r.value,inst:n,path:[...n._zod.def.path??[]]})},n}let uc=(...t)=>(function(t,r){let n=rc(r),i=n.truthy??["true","1","yes","on","y","enabled"],s=n.falsy??["false","0","no","off","n","disabled"];"sensitive"!==n.case&&(i=i.map(t=>"string"==typeof t?t.toLowerCase():t),s=s.map(t=>"string"==typeof t?t.toLowerCase():t));let o=new Set(i),a=new Set(s),l=t.Codec??sd,u=t.Boolean??iw,h=new l({type:"pipe",in:new(t.String??n3)({type:"string",error:n.error}),out:new u({type:"boolean",error:n.error}),transform:(t,r)=>{let i=t;return"sensitive"!==n.case&&(i=i.toLowerCase()),!!o.has(i)||!a.has(i)&&(r.issues.push({code:"invalid_value",expected:"stringbool",values:[...o,...a],input:r.value,inst:h,continue:!1}),{})},reverseTransform:(t,r)=>!0===t?i[0]||"true":s[0]||"false",error:n.error});return h})({Codec:l1,Boolean:a$,String:oH},...t);function ud(t){let r=l9(()=>ll([oq(t),aM(),aj(),aQ(),lt(r),lv(oq(),r)]));return r}function up(t,r){return l0(lk(t),r)}a||(a={}),t0({localeError:(()=>{let t={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}},r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let t=n[i.expected]??i.expected,r=function(t){let r=typeof t;switch(r){case"number":return Number.isNaN(t)?"nan":"number";case"object":if(null===t)return"null";if(Array.isArray(t))return"array";if(t&&Object.getPrototypeOf(t)!==Object.prototype&&"constructor"in t&&t.constructor)return t.constructor.name}return r}(i.input),s=n[r]??r;return`Invalid input: expected ${t}, received ${s}`}case"invalid_value":if(1===i.values.length)return`Invalid input: expected ${rd(i.values[0])}`;return`Invalid option: expected one of ${t2(i.values,"|")}`;case"too_big":{let r=i.inclusive?"<=":"<",n=t[i.origin]??null;if(n)return`Too big: expected ${i.origin??"value"} to have ${r}${i.maximum.toString()} ${n.unit??"elements"}`;return`Too big: expected ${i.origin??"value"} to be ${r}${i.maximum.toString()}`}case"too_small":{let r=i.inclusive?">=":">",n=t[i.origin]??null;if(n)return`Too small: expected ${i.origin} to have ${r}${i.minimum.toString()} ${n.unit}`;return`Too small: expected ${i.origin} to be ${r}${i.minimum.toString()}`}case"invalid_format":if("starts_with"===i.format)return`Invalid string: must start with "${i.prefix}"`;if("ends_with"===i.format)return`Invalid string: must end with "${i.suffix}"`;if("includes"===i.format)return`Invalid string: must include "${i.includes}"`;if("regex"===i.format)return`Invalid string: must match pattern ${i.pattern}`;return`Invalid ${r[i.format]??i.format}`;case"not_multiple_of":return`Invalid number: must be a multiple of ${i.divisor}`;case"unrecognized_keys":return`Unrecognized key${i.keys.length>1?"s":""}: ${t2(i.keys,", ")}`;case"invalid_key":return`Invalid key in ${i.origin}`;case"invalid_union":default:return"Invalid input";case"invalid_element":return`Invalid value in ${i.origin}`}}})()});var uf={"p5.Image":{pixelDensity:{overloads:[["Number?"]]},loadPixels:{overloads:[[]]},updatePixels:{overloads:[["Integer?","Integer?","Integer?","Integer?"]]},get:{overloads:[["Number","Number","Number","Number"],[],["Number","Number"]]},set:{overloads:[["Number","Number","Number|Number[]|Object"]]},resize:{overloads:[["Number","Number"]]},copy:{overloads:[["p5.Image|p5.Element","Integer","Integer","Integer","Integer","Integer","Integer","Integer","Integer"],["Integer","Integer","Integer","Integer","Integer","Integer","Integer","Integer"]]},mask:{overloads:[["p5.Image"]]},filter:{overloads:[["THRESHOLD|GRAY|OPAQUE|INVERT|POSTERIZE|ERODE|DILATE|BLUR","Number?"]]},blend:{overloads:[["p5.Image","Integer","Integer","Integer","Integer","Integer","Integer","Integer","Integer","BLEND|DARKEST|LIGHTEST|DIFFERENCE|MULTIPLY|EXCLUSION|SCREEN|REPLACE|OVERLAY|HARD_LIGHT|SOFT_LIGHT|DODGE|BURN|ADD|NORMAL"],["Integer","Integer","Integer","Integer","Integer","Integer","Integer","Integer","BLEND|DARKEST|LIGHTEST|DIFFERENCE|MULTIPLY|EXCLUSION|SCREEN|REPLACE|OVERLAY|HARD_LIGHT|SOFT_LIGHT|DODGE|BURN|ADD|NORMAL"]
vendor: 4,124 bytes, line 43
43]},save:{overloads:[["String","String?"]]},reset:{overloads:[[]]},getCurrentFrame:{overloads:[[]]},setFrame:{overloads:[["Number"]]},numFrames:{overloads:[[]]},play:{overloads:[[]]},pause:{overloads:[[]]},delay:{overloads:[["Number","Number?"]]}},"p5.Color":{toString:{overloads:[["String?"]]},contrast:{overloads:[["Color"]]},setRed:{overloads:[["Number"]]},setGreen:{overloads:[["Number"]]},setBlue:{overloads:[["Number"]]},setAlpha:{overloads:[["Number"]]}},p5:{remove:{overloads:[[]]},p5:{overloads:[["Object","String|HTMLElement"]]},fromAxisAngle:{overloads:[["Number?","Number?","Number?","Number?"]]},day:{overloads:[[]]},abs:{overloads:[["Number"]]},mult:{overloads:[["p5.Quat?"]]},print:{overloads:[["Any"],["String|Number|Array"]]},hour:{overloads:[[]]},randomSeed:{overloads:[["Number"]]},float:{overloads:[["String"],["String[]"]]},rotateBy:{overloads:[["p5.Quat?"]]},ceil:{overloads:[["Number"]]},ellipseMode:{overloads:[["CENTER|RADIUS|CORNER|CORNERS"]]},nf:{overloads:[["Number|String","Integer|String?","Integer|String?"],["Number[]","Integer|String?","Integer|String?"]]},strokeMode:{overloads:[["String"]]},select:{overloads:[["String","String|p5.Element|HTMLElement?"]]},loadImage:{overloads:[["String|Request","function(p5.Image)?","function(Event)?"]]},createVector:{overloads:[["...Number[]"]]},minute:{overloads:[[]]},noLoop:{overloads:[[]]},describe:{overloads:[["String","FALLBACK|LABEL?"]]},storeItem:{overloads:[["String","String|Number|Boolean|Object|Array"]]},createCanvas:{overloads:[["Number?","Number?","P2D|WEBGL|P2DHDR|WEBGPU?","HTMLCanvasElement?"],["Number?","Number?","HTMLCanvasElement?"]]},textOutput:{overloads:[["FALLBACK|LABEL?"]]},blend:{overloads:[["p5.Image","Integer","Integer","Integer","Integer","Integer","Integer","Integer","Integer","BLEND|DARKEST|LIGHTEST|DIFFERENCE|MULTIPLY|EXCLUSION|SCREEN|REPLACE|OVERLAY|HARD_LIGHT|SOFT_LIGHT|DODGE|BURN|ADD|NORMAL"],["Integer","Integer","Integer","Integer","Integer","Integer","Integer","Integer","BLEND|DARKEST|LIGHTEST|DIFFERENCE|MULTIPLY|EXCLUSION|SCREEN|REPLACE|OVERLAY|HARD_LIGHT|SOFT_LIGHT|DODGE|BURN|ADD|NORMAL"]]},loadShader:{overloads:[["String|Request","String|Request","Function?","Function?"]]},constrain:{overloads:[["Number","Number","Number"]]},createImage:{overloads:[["Integer","Integer"]]},acos:{overloads:[["Number"]]},noSmooth:{overloads:[[]]},orbitControl:{overloads:[["Number?","Number?","Number?","Object?"]]},beginClip:{overloads:[["Object?"]]},smoothstep:{overloads:[["Number","Number","Number"]]},getTexture:{overloads:[[null,null]]},getWorldInputs:{overloads:[["Function"]]},getPixelInputs:{overloads:[["Function"]]},getFinalColor:{overloads:[["Function"]]},getColor:{overloads:[["Function"]]},getObjectInputs:{overloads:[["Function"]]},getCameraInputs:{overloads:[["Function"]]},ambientLight:{overloads:[["Number","Number","Number","Number?"],["Number","Number?"],["String"],["Number[]"],["p5.Color"]]},selectAll:{overloads:[["String","String|p5.Element|HTMLElement?"]]},bezier:{overloads:[["Number","Number","Number","Number","Number","Number","Number","Number"],["Number","Number","Number","Number","Number","Number","Number","Number","Number","Number","Number","Number"]]},int:{overloads:[["String|Boolean|Number"],["Array"]]},endClip:{overloads:[[]]},copy:{overloads:[["p5.Image|p5.Element","Integer","Integer","Integer","Integer","Integer","Integer","Integer","Integer"],["Integer","Integer","Integer","Integer","Integer","Integer","Integer","Integer"]]},loop:{overloads:[[]]},dist:{overloads:[["Number","Number","Number","Number"],["Number","Number","Number","Number","Number","Number"]]},asin:{overloads:[["Number"]]},millis:{overloads:[[]]},nfc:{overloads:[["Number|String","Integer|String?"],["Number[]","Integer|String?"]]},applyMatrix:{overloads:[["Number[]"],["Number","Number","Number","Number","Number","Number"],["Number","Number","Number","Number","Number","Number","Number","Number","Number","Number","Number","Number","Number","Number","Number","Number"]]},resizeCanvas:{overloads:[["Number","Number","Boolean?"]]},push:{overloads:[[]]},noise:{overloads:[["Number","Number?","Number?"]]}
vendor: 14,980 bytes, line 43
43,describeElement:{overloads:[["String","String","FALLBACK|LABEL?"]]},saveGif:{overloads:[["String","Number","Object?"]]},month:{overloads:[[]]},random:{overloads:[["Number?","Number?"],["Array"]]},isLooping:{overloads:[[]]},gridOutput:{overloads:[["FALLBACK|LABEL?"]]},saveCanvas:{overloads:[["p5.Framebuffer|p5.Element|HTMLCanvasElement","String?","String?"],["String?","String?"]]},rectMode:{overloads:[["CENTER|RADIUS|CORNER|CORNERS"]]},atan:{overloads:[["Number"]]},noCanvas:{overloads:[[]]},resetMatrix:{overloads:[[]]},getItem:{overloads:[["String"]]},exp:{overloads:[["Number"]]},second:{overloads:[[]]},loadJSON:{overloads:[["String|Request","Function?","Function?"]]},arc:{overloads:[["Number","Number","Number","Number","Number","Number","CHORD|PIE|OPEN?","Integer?"]]},cursor:{overloads:[["ARROW|CROSS|HAND|MOVE|TEXT|WAIT|String","Number?","Number?"]]},createElement:{overloads:[["String","String?"]]},year:{overloads:[[]]},floor:{overloads:[["Number"]]},str:{overloads:[["String|Boolean|Number"]]},byte:{overloads:[["String|Boolean|Number"],["Array"]]},bezierPoint:{overloads:[["Number","Number","Number","Number","Number"]]},buildGeometry:{overloads:[["Function"]]},loadModel:{overloads:[["String|Request","String?","Boolean?","function(p5.Geometry)?","function(Event)?"],["String|Request","String?","function(p5.Geometry)?","function(Event)?"],["String|Request","Object?"]]},randomGaussian:{overloads:[["Number?","Number?"]]},redraw:{overloads:[["Integer?"]]},atan2:{overloads:[["Number","Number"]]},smooth:{overloads:[[]]},clearStorage:{overloads:[[]]},nfp:{overloads:[["Number","Integer?","Integer?"],["Number[]","Integer?","Integer?"]]},removeElements:{overloads:[[]]},beginShape:{overloads:[["POINTS|LINES|TRIANGLES|TRIANGLE_FAN|TRIANGLE_STRIP|QUADS|QUAD_STRIP|PATH?"]]},saveObj:{overloads:[["String?"]]},addElement:{overloads:[[]]},color:{overloads:[["Number","Number?"],["Number","Number","Number","Number?"],["String"],["Number[]"],["p5.Color"]]},clip:{overloads:[["Function","Object?"]]},noiseDetail:{overloads:[["Number","Number?"]]},createGraphics:{overloads:[["Number","Number","P2D|WEBGL?","HTMLCanvasElement?"],["Number","Number","HTMLCanvasElement?"]]},strokeCap:{overloads:[["ROUND|SQUARE|PROJECT"]]},lerp:{overloads:[["Number","Number","Number"]]},frameRate:{overloads:[["Number"],[]]},cos:{overloads:[["Number"]]},specularColor:{overloads:[["Number","Number","Number"],["Number"],["String"],["Number[]"],["p5.Color"]]},createDiv:{overloads:[["String?"]]},loadStrings:{overloads:[["String|Request","Function?","Function?"]]},boolean:{overloads:[["String|Boolean|Number"],["Array"]]},removeItem:{overloads:[["String"]]},rotate:{overloads:[["Number","p5.Vector|Number[]?"]]},freeGeometry:{overloads:[["p5.Geometry"]]},setMoveThreshold:{overloads:[["Number"]]},bezierTangent:{overloads:[["Number","Number","Number","Number","Number"]]},noiseSeed:{overloads:[["Number"]]},ellipse:{overloads:[["Number","Number","Number","Number?"],["Number","Number","Number","Number","Integer?"]]},log:{overloads:[["Number"]]},createP:{overloads:[["String?"]]},createShader:{overloads:[["String","String","Object?"]]},getTargetFrameRate:{overloads:[[]]},nfs:{overloads:[["Number","Integer?","Integer?"],["Array","Integer?","Integer?"]]},setShakeThreshold:{overloads:[["Number"]]},saveStl:{overloads:[["String?","Object?"]]},sin:{overloads:[["Number"]]},strokeJoin:{overloads:[["MITER|BEVEL|ROUND"]]},noCursor:{overloads:[[]]},circle:{overloads:[["Number","Number","Number"]]},mag:{overloads:[["Number","Number"]]},loadTable:{overloads:[["String|Request","String?","String?","Function?","Function?"]]},red:{overloads:[["p5.Color|Number[]|String"]]},filter:{overloads:[["THRESHOLD|GRAY|OPAQUE|INVERT|POSTERIZE|BLUR|ERODE|DILATE|BLUR","Number?","Boolean?"],["p5.Shader"]]},tan:{overloads:[["Number"]]},createSpan:{overloads:[["String?"]]},loadFilterShader:{overloads:[["String","Function?","Function?"]]},plane:{overloads:[["Number?","Number?","Integer?","Integer?"]]},createFramebuffer:{overloads:[["Object?"]]},strokeWeight:{overloads:[["Number"]]},degrees:{overloads:[["Number"]]},rotateX:{overloads:[["Number"]]},setup:{overloads:[[]]},draw:{overloads:[[]]},registerAddon:{overloads:[["Function"]]},map:{overloads:[["Number","Number","Number","Number","Number","Boolean?"]]},createImg:{overloads:[["String","String"],["String","String","String?","Function?"]]},radians:{overloads:[["Number"]]},deviceMoved:{overloads:[[]]},deviceTurned:{overloads:[[]]},deviceShaken:{overloads:[[]]},directionalLight:{overloads:[["Number","Number","Number","Number","Number","Number"],["Number","Number","Number","p5.Vector"],["p5.Color|Number[]|String","Number","Number","Number"],["p5.Color|Number[]|String","p5.Vector"]]},background:{overloads:[["p5.Color"],["String","Number?"],["Number","Number?"],["Number","Number","Number","Number?"],["Number[]"],["p5.Image","Number?"]]},clearDepth:{overloads:[["Number?"]]},splitTokens:{overloads:[["String","String?"]]},keyPressed:{overloads:[["KeyboardEvent?"]]},green:{overloads:[["p5.Color|Number[]|String"]]},max:{overloads:[["Number","Number"],["Number[]"]]},bezierVertex:{overloads:[["Number","Number","Number?","Number?"],["Number","Number","Number","Number?","Number?"]]},createA:{overloads:[["String","String","String?"]]},saveFrames:{overloads:[["String","String","Number","Number","function(Array)?"]]},line:{overloads:[["Number","Number","Number","Number"],["Number","Number","Number","Number","Number","Number"]]},clear:{overloads:[["Number?","Number?","Number?","Number?"],[]]},box:{overloads:[["Number?","Number?","Number?","Integer?","Integer?"]]},char:{overloads:[["String|Number"],["Array"]]},rotateY:{overloads:[["Number"]]},debugMode:{overloads:[[],["GRID|AXES"],["GRID|AXES","Number?","Number?","Number?","Number?","Number?"],["GRID|AXES","Number?","Number?","Number?","Number?"],["Number?","Number?","Number?","Number?","Number?","Number?","Number?","Number?","Number?"]]},roll:{overloads:[["Number"]]},spline:{overloads:[["Number","Number","Number","Number","Number","Number","Number","Number"],["Number","Number","Number","Number","Number","Number","Number","Number","Number","Number","Number","Number"]]},loadXML:{overloads:[["String|Request","Function?","Function?"]]},get:{overloads:[["Number","Number","Number","Number"],[],["Number","Number"]]},min:{overloads:[["Number","Number"],["Number[]"]]},windowResized:{overloads:[["Event?"]]},shuffle:{overloads:[["Array","Boolean?"]]},loadBytes:{overloads:[["String|Request","Function?","Function?"]]},noDebugMode:{overloads:[[]]},blue:{overloads:[["p5.Color|Number[]|String"]]},unchar:{overloads:[["String"],["String[]"]]},angleMode:{overloads:[["RADIANS|DEGREES"],[]]},loadPixels:{overloads:[[]]},buildFilterShader:{overloads:[["Function","Object?"],["Object","Object?"]]},createSlider:{overloads:[["Number","Number","Number?","Number?"]]},norm:{overloads:[["Number","Number","Number"]]},sphere:{overloads:[["Number?","Integer?","Integer?"]]},keyReleased:{overloads:[["KeyboardEvent?"]]},rotateZ:{overloads:[["Number"]]},loadBlob:{overloads:[["String|Request","Function?","Function?"]]},pow:{overloads:[["Number","Number"]]},fullscreen:{overloads:[["Boolean?"]]},pointLight:{overloads:[["Number","Number","Number","Number","Number","Number"],["Number","Number","Number","p5.Vector"],["p5.Color|Number[]|String","Number","Number","Number"],["p5.Color|Number[]|String","p5.Vector"]]},point:{overloads:[["Number","Number","Number?"],["p5.Vector"]]},alpha:{overloads:[["p5.Color|Number[]|String"]]},createButton:{overloads:[["String","String?"]]},createFilterShader:{overloads:[["String"]]},endShape:{overloads:[["CLOSE?","Integer?"]]},set:{overloads:[["Number","Number","Number|Number[]|Object"]]},round:{overloads:[["Number","Number?"]]},hex:{overloads:[["Number","Number?"],["Number[]","Number?"]]},splinePoint:{overloads:[["Number","Number","Number","Number","Number"]]},httpGet:{overloads:[["String|Request","String?","Function?","Function?"],["String|Request","Function","Function?"]]},pixelDensity:{overloads:[["Number?"],[]]},imageLight:{overloads:[["p5.Image"]]},updatePixels:{overloads:[["Number?","Number?","Number?","Number?"],[]]},sq:{overloads:[["Number"]]},displayDensity:{overloads:[[]]},panorama:{overloads:[["p5.Image"]]},createCheckbox:{overloads:[["String?","Boolean?"]]},keyTyped:{overloads:[["KeyboardEvent?"]]},hue:{overloads:[["p5.Color|Number[]|String"]]},scale:{overloads:[["Number|p5.Vector|Number[]","Number?","Number?"],["p5.Vector|Number[]"]]},httpPost:{overloads:[["String|Request","Object|Boolean?","String?","Function?","Function?"],["String|Request","Object|Boolean","Function?","Function?"],["String|Request","Function?","Function?"]]},unhex:{overloads:[["String"],["String[]"]]},quad:{overloads:[["Number","Number","Number","Number","Number","Number","Number","Number","Integer?","Integer?"],["Number","Number","Number","Number","Number","Number","Number","Number","Number","Number","Number","Number","Integer?","Integer?"]]},sqrt:{overloads:[["Number"]]},cylinder:{overloads:[["Number?","Number?","Integer?","Integer?","Boolean?","Boolean?"]]},getURL:{overloads:[[]]},lights:{overloads:[[]]},fract:{overloads:[["Number"]]},getURLPath:{overloads:[[]]},splineTangent:{overloads:[["Number","Number","Number","Number","Number"]]},normal:{overloads:[["p5.Vector"],["Number","Number","Number"]]},image:{overloads:[["p5.Image|p5.Element|p5.Texture|p5.Framebuffer|p5.FramebufferTexture|p5.Renderer|p5.Graphics","Number","Number","Number?","Number?"],["p5.Image|p5.Element|p5.Texture|p5.Framebuffer|p5.FramebufferTexture","Number","Number","Number","Number","Number","Number","Number?","Number?","CONTAIN|COVER?","LEFT|RIGHT|CENTER?","TOP|BOTTOM|CENTER?"]]},getURLParams:{overloads:[[]]},colorMode:{overloads:[["RGB|HSB|HSL|RGBHDR|HWB|LAB|LCH|OKLAB|OKLCH","Number?"],["RGB|HSB|HSL|RGBHDR|HWB|LAB|LCH|OKLAB|OKLCH","Number","Number","Number","Number?"],[]]},shearX:{overloads:[["Number"]]},lightFalloff:{overloads:[["Number","Number","Number"]]},mouseMoved:{overloads:[["MouseEvent?"]]},mouseDragged:{overloads:[["MouseEvent?"]]},keyIsDown:{overloads:[["Number|String"]]},shader:{overloads:[["p5.Shader"]]},model:{overloads:[["p5.Geometry","Number?"]]},setContent:{overloads:[["String"]]},httpDo:{overloads:[["String|Request","String?","String?","Object?","Function?","Function?"],["String|Request","Function?","Function?"]]},rect:{overloads:[["Number","Number","Number","Number?","Number?","Number?","Number?","Number?"],["Number","Number","Number","Number","Integer?","Integer?"]]},shearY:{overloads:[["Number"]]},saturation:{overloads:[["p5.Color|Number[]|String"]]},createSelect:{overloads:[["Boolean?"],["Object"]]},worldToScreen:{overloads:[["Number|p5.Vector","Number","Number?"]]},cone:{overloads:[["Number?","Number?","Integer?","Integer?","Boolean?"]]},createModel:{overloads:[["String","String?","Boolean?","function(p5.Geometry)?","function(Event)?"],["String","String?","function(p5.Geometry)?","function(Event)?"],["String","String?","Object?"]]},vertexProperty:{overloads:[["String","Number|Number[]"]]},square:{overloads:[["Number","Number","Number","Number?","Number?","Number?","Number?"]]},screenToWorld:{overloads:[["Number|p5.Vector","Number","Number?"]]},mousePressed:{overloads:[["MouseEvent?"]]},strokeShader:{overloads:[["p5.Shader"]]},tint:{overloads:[["Number","Number","Number","Number?"],["String"],["Number","Number?"],["Number[]"],["p5.Color"]]},brightness:{overloads:[["p5.Color|Number[]|String"]]},createWriter:{overloads:[["String","String?"]]},spotLight:{overloads:[["Number","Number","Number","Number","Number","Number","Number","Number","Number","Number?","Number?"],["p5.Color|Number[]|String","p5.Vector","p5.Vector","Number?","Number?"],["Number","Number","Number","p5.Vector","p5.Vector","Number?","Number?"],["p5.Color|Number[]|String","Number","Number","Number","p5.Vector","Number?","Number?"],["p5.Color|Number[]|String","p5.Vector","Number","Number","Number","Number?","Number?"],["Number","Number","Number","Number","Number","Number","p5.Vector","Number?","Number?"],["Number","Number","Number","p5.Vector","Number","Number","Number","Number?","Number?"],["p5.Color|Number[]|String","Number","Number","Number","Number","Number","Number","Number?","Number?"]]},translate:{overloads:[["Number","Number","Number?"],["p5.Vector"]]},noTint:{overloads:[[]]},fill:{overloads:[["Number","Number","Number","Number?"],["String"],["Number","Number?"],["Number[]"],["p5.Color"]]},triangle:{overloads:[["Number","Number","Number","Number","Number","Number"]]},text:{overloads:[["String|Object|Array|Number|Boolean","Number","Number","Number?","Number?"]]},textAlign:{overloads:[["LEFT|CENTER|RIGHT?","TOP|BOTTOM|CENTER|BASELINE?"]]},textAscent:{overloads:[["String?"]]},textDescent:{overloads:[["String?"]]},textLeading:{overloads:[["Number?"]]},textFont:{overloads:[["p5.Font|String|Object?","Number?"]]},textSize:{overloads:[["Number"],[]]},textStyle:{overloads:[["NORMAL|ITALIC|BOLD|BOLDITALIC"],[]]},textWidth:{overloads:[["String"]]},textWrap:{overloads:[["WORD|CHAR"],[]]},textBounds:{overloads:[["String","Number","Number","Number?","Number?"]]},textDirection:{overloads:[["String"],[]]},textProperty:{overloads:[["String",null],["String"]]},textProperties:{overloads:[["Object"],[]]},fontBounds:{overloads:[["String","Number","Number","Number?","Number?"]]},fontWidth:{overloads:[["String"]]},fontAscent:{overloads:[[]]},fontDescent:{overloads:[[]]},textWeight:{overloads:[["Number"],[]]},ellipsoid:{overloads:[["Number?","Number?","Number?","Integer?","Integer?"]]},noFill:{overloads:[[]]},noLights:{overloads:[[]]},write:{overloads:[["String|Number|Array"]]},lightness:{overloads:[["p5.Color|Number[]|String"]]},imageMode:{overloads:[["CORNER|CORNERS|CENTER"]]},mouseReleased:{overloads:[["MouseEvent?"]]},imageShader:{overloads:[["p5.Shader"]]},noStroke:{overloads:[[]]},createRadio:{overloads:[["Object?"],["String?"],[]]},createVideo:{overloads:[["String|String[]?","Function?"]]},loadFont:{overloads:[["String","String?","Object?","Function?","Function?"],["String","Function?","Function?"]]},lerpColor:{overloads:[["p5.Color","p5.Color","Number"]]},createAudio:{overloads:[["String|String[]?","Function?"]]},paletteLerp:{overloads:[["[p5.Color|String|Number|Number[], Number][]","Number"]]},torus:{overloads:[["Number?","Number?","Integer?","Integer?"]]},close:{overloads:[[]]},mouseClicked:{overloads:[["MouseEvent?"]]},buildMaterialShader:{overloads:[["Function","Object?"],["Object","Object?"]]},createCapture:{overloads:[["AUDIO|VIDEO|Object?","Object?","Function?"]]},stroke:{overloads:[["Number","Number","Number","Number?"],["String"],["Number","Number?"],["Number[]"],["p5.Color"]]},createColorPicker:{overloads:[["String|p5.Color?"]]},save:{overloads:[["Object|String?","String?","Boolean|String?"]]},loadMaterialShader:{overloads:[["String","Function?","Function?"]]},bezierOrder:{overloads:[["Number"],[]]},doubleClicked:{overloads:[["MouseEvent?"]]},baseMaterialShader:{overloads:[[]]}
43,erase:{overloads:[["Number?","Number?"]]},baseFilterShader:{overloads:[[]]},noErase:{overloads:[[]]},createInput:{overloads:[["String?","String?"],["String?"]]},saveJSON:{overloads:[["Array|Object","String","Boolean?"]]},buildNormalShader:{overloads:[["Function","Object?"],["Object","Object?"]]},mouseWheel:{overloads:[["WheelEvent?"]]},pop:{overloads:[[]]},createFileInput:{overloads:[["Function","Boolean?"]]},requestPointerLock:{overloads:[[]]},loadNormalShader:{overloads:[["String","Function?","Function?"]]},baseNormalShader:{overloads:[[]]},exitPointerLock:{overloads:[[]]},saveStrings:{overloads:[["String[]","String","String?","Boolean?"]]},buildColorShader:{overloads:[["Function","Object?"],["Object","Object?"]]},splineVertex:{overloads:[["Number","Number"],["Number","Number","Number?"],["Number","Number","Number?","Number?"],["Number","Number","Number","Number?","Number?"]]},saveTable:{overloads:[["p5.Table","String","String?"]]},loadColorShader:{overloads:[["String","Function?","Function?"]]},baseColorShader:{overloads:[[]]},setAttributes:{overloads:[["String","Boolean"],["Object"]]},blendMode:{overloads:[["BLEND|DARKEST|LIGHTEST|DIFFERENCE|MULTIPLY|EXCLUSION|SCREEN|REPLACE|OVERLAY|HARD_LIGHT|SOFT_LIGHT|DODGE|BURN|ADD|REMOVE|SUBTRACT"]]},camera:{overloads:[["Number?","Number?","Number?","Number?","Number?","Number?","Number?","Number?","Number?"]]},buildStrokeShader:{overloads:[["Function","Object?"],["Object","Object?"]]},splineProperty:{overloads:[["String",null],["String"]]},perspective:{overloads:[["Number?","Number?","Number?","Number?"]]},loadStrokeShader:{overloads:[["String","Function?","Function?"]]},baseStrokeShader:{overloads:[[]]},splineProperties:{overloads:[["Object"]]},linePerspective:{overloads:[["Boolean"],[]]},resetShader:{overloads:[[]]},ortho:{overloads:[["Number?","Number?","Number?","Number?","Number?","Number?"]]},texture:{overloads:[["p5.Image|p5.MediaElement|p5.Graphics|p5.Texture|p5.Framebuffer|p5.FramebufferTexture"]]},vertex:{overloads:[["Number","Number"],["Number","Number","Number?","Number?"],["Number","Number","Number","Number?","Number?"]]},frustum:{overloads:[["Number?","Number?","Number?","Number?","Number?","Number?"]]},curveDetail:{overloads:[["Number"]]},createCamera:{overloads:[[]]},beginContour:{overloads:[[]]},textureMode:{overloads:[["IMAGE|NORMAL"]]},setCamera:{overloads:[["p5.Camera"]]},endContour:{overloads:[["OPEN|CLOSE?"]]},textureWrap:{overloads:[["CLAMP|REPEAT|MIRROR","CLAMP|REPEAT|MIRROR?"]]},normalMaterial:{overloads:[[]]},ambientMaterial:{overloads:[["Number","Number","Number"],["Number"],["p5.Color|Number[]|String"]]},emissiveMaterial:{overloads:[["Number","Number","Number","Number?"],["Number"],["p5.Color|Number[]|String"]]},specularMaterial:{overloads:[["Number","Number?"],["Number","Number","Number","Number?"],["p5.Color|Number[]|String"]]},shininess:{overloads:[["Number"]]},metalness:{overloads:[["Number"]]}},"p5.Element":{remove:{overloads:[[]]},parent:{overloads:[["String|p5.Element|Object"],[]]},child:{overloads:[[],["String|p5.Element?"]]},html:{overloads:[[],["String?","Boolean?"]]},id:{overloads:[["String"],[]]},class:{overloads:[["String"],[]]},addClass:{overloads:[["String"]]},removeClass:{overloads:[["String"]]},hasClass:{overloads:[[null]]},toggleClass:{overloads:[[null]]},center:{overloads:[["String?"]]},position:{overloads:[[],["Number?","Number?","String?"]]},show:{overloads:[[]]},hide:{overloads:[[]]},size:{overloads:[[],["Number|AUTO?","Number|AUTO?"]]},style:{overloads:[["String"],["String","String|p5.Color"]]},attribute:{overloads:[[],["String","String"]]},removeAttribute:{overloads:[["String"]]},value:{overloads:[[],["String|Number"]]},mousePressed:{overloads:[["Function|Boolean"]]},doubleClicked:{overloads:[["Function|Boolean"]]},mouseWheel:{overloads:[["Function|Boolean"]]},mouseReleased:{overloads:[["Function|Boolean"]]},mouseClicked:{overloads:[["Function|Boolean"]]},mouseMoved:{overloads:[["Function|Boolean"]]},mouseOver:{overloads:[["Function|Boolean"]]},mouseOut:{overloads:[["Function|Boolean"]]},dragOver:{overloads:[["Function|Boolean"]]},dragLeave:{overloads:[["Function|Boolean"]]},changed:{overloads:[["Function|Boolean"]]},input:{overloads:[["Function|Boolean"]]},drop:{overloads:[["Function","Function?"]]},draggable:{overloads:[["p5.Element?"]]}},"p5.XML":{getParent:{overloads:[[]]},getName:{overloads:[[]]},setName:{overloads:[["String"]]},hasChildren:{overloads:[[]]},listChildren:{overloads:[[]]},getChildren:{overloads:[["String?"]]},getChild:{overloads:[["String|Integer"]]},addChild:{overloads:[["p5.XML"]]},removeChild:{overloads:[["String|Integer"]]},getAttributeCount:{overloads:[[]]},listAttributes:{overloads:[[]]},hasAttribute:{overloads:[["String"]]},getNum:{overloads:[["String","Number?"]]},getString:{overloads:[["String","Number?"]]},setAttribute:{overloads:[["String","Number|String|Boolean"]]},getContent:{overloads:[["String?"]]},serialize:{overloads:[[]]}},"p5.TableRow":{set:{overloads:[["String|Integer","String|Number"]]},setNum:{overloads:[["String|Integer","Number|String"]]},setString:{overloads:[["String|Integer","String|Number|Boolean|Object"]]},get:{overloads:[["String|Integer"]]},getNum:{overloads:[["String|Integer"]]},getString:{overloads:[["String|Integer"]]}},"p5.Vector":{getValue:{overloads:[["Number"]]},setValue:{overloads:[["Number","Number"]]},set:{overloads:[["Number?","Number?","Number?"],["p5.Vector|Number[]"]]},copy:{overloads:[[]]},add:{overloads:[["Number|Array","Number?","Number?"],["p5.Vector|Number[]"]]},rem:{overloads:[["Number","Number","Number"],["p5.Vector|Number[]"]]},sub:{overloads:[["Number","Number?","Number?"],["p5.Vector|Number[]"]]},mult:{overloads:[["Number"],["Number","Number","Number?"],["Number[]"],["p5.Vector"]]},div:{overloads:[["Number"],["Number","Number","Number?"],["Number[]"],["p5.Vector"]]},mag:{overloads:[[]]},magSq:{overloads:[[]]},dot:{overloads:[["Number","Number?","Number?"],["p5.Vector"]]},cross:{overloads:[["p5.Vector"]]},dist:{overloads:[["p5.Vector"]]},normalize:{overloads:[[]]},limit:{overloads:[["Number"]]},setMag:{overloads:[["Number"]]},heading:{overloads:[[]]},setHeading:{overloads:[["Number"]]},rotate:{overloads:[["Number"]]},angleBetween:{overloads:[["p5.Vector"]]},lerp:{overloads:[["Number","Number","Number","Number"],["p5.Vector","Number"]]},slerp:{overloads:[["p5.Vector","Number"]]},reflect:{overloads:[["p5.Vector"]]},array:{overloads:[[]]},equals:{overloads:[["Number?","Number?","Number?"],["p5.Vector|Array"]]},clampToZero:{overloads:[[]]},fromAngle:{overloads:[["Number","Number?"]]},fromAngles:{overloads:[["Number","Number","Number?"]]},random2D:{overloads:[[]]},random3D:{overloads:[[]]}},"p5.Font":{textToPaths:{overloads:[["String","Number","Number","Number?","Number?"]]},textToPoints:{overloads:[["String","Number","Number","Object?"]]},textToContours:{overloads:[["String","Number","Number","Object?"]]},textToModel:{overloads:[["String","Number","Number","Number","Number","Object?"]]}},"p5.Shader":{version:{overloads:[[]]},inspectHooks:{overloads:[[]]},modify:{overloads:[["Function","Object?"],["Object?"]]},copyToContext:{overloads:[["p5|p5.Graphics"]]},setUniform:{overloads:[["String","Boolean|Number|Number[]|p5.Image|p5.Graphics|p5.MediaElement|p5.Texture"]]}},"p5.Table":{addRow:{overloads:[["p5.TableRow?"]]},removeRow:{overloads:[["Integer"]]},getRow:{overloads:[["Integer"]]},getRows:{overloads:[[]]},findRow:{overloads:[["String","Integer|String"]]},findRows:{overloads:[["String","Integer|String"]]},matchRow:{overloads:[["String|RegExp","String|Integer"]]},matchRows:{overloads:[["String","String|Integer?"]]},getColumn:{overloads:[["String|Number"]]},clearRows:{overloads:[[]]},addColumn:{overloads:[["String?"]]},getColumnCount:{overloads:[[]]},getRowCount:{overloads:[[]]},removeTokens:{overloads:[["String","String|Integer?"]]},trim:{overloads:[["String|Integer?"]]},removeColumn:{overloads:[["String|Integer"]]},set:{overloads:[["Integer","String|Integer","String|Number"]]},setNum:{overloads:[["Integer","String|Integer","Number"]]},setString:{overloads:[["Integer","String|Integer","String"]]},get:{overloads:[["Integer","String|Integer"]]},getNum:{overloads:[["Integer","String|Integer"]]},getString:{overloads:[["Integer","String|Integer"]]},getObject:{overloads:[["String?"]]},getArray:{overloads:[[]]}},"p5.MediaElement":{play:{overloads:[[]]},stop:{overloads:[[]]},pause:{overloads:[[]]},loop:{overloads:[[]]},noLoop:{overloads:[[]]},autoplay:{overloads:[["Boolean?"]]},volume:{overloads:[[],["Number"]]},speed:{overloads:[[],["Number"]]},time:{overloads:[["Number?"]]},duration:{overloads:[[]]},onended:{overloads:[["Function"]]},connect:{overloads:[["AudioNode|Object"]]},disconnect:{overloads:[[]]},showControls:{overloads:[[]]},hideControls:{overloads:[[]]},addCue:{overloads:[["Number","Function","Object?"]]},removeCue:{overloads:[["Number"]]},clearCues:{overloads:[[]]}},"p5.Geometry":{calculateBoundingBox:{overloads:[[]]},clearColors:{overloads:[[]]},flipU:{overloads:[[]]},computeFaces:{overloads:[[]]},computeNormals:{overloads:[["FLAT|SMOOTH?","Object?"]]},makeEdgesFromFaces:{overloads:[[]]},normalize:{overloads:[[]]},vertexProperty:{overloads:[["String","Number|Number[]","Number?"]]},flipV:{overloads:[[]]}},"p5.Framebuffer":{resize:{overloads:[["Number","Number"]]},pixelDensity:{overloads:[["Number?"]]},autoSized:{overloads:[["Boolean?"]]},createCamera:{overloads:[[]]},remove:{overloads:[[]]},begin:{overloads:[[]]},end:{overloads:[[]]},draw:{overloads:[["Function"]]},loadPixels:{overloads:[[]]},get:{overloads:[["Number","Number","Number","Number"],[],["Number","Number"]]}},"p5.Camera":{perspective:{overloads:[["Number?","Number?","Number?","Number?"]]},ortho:{overloads:[["Number?","Number?","Number?","Number?","Number?","Number?"]]},frustum:{overloads:[["Number?","Number?","Number?","Number?","Number?","Number?"]]},pan:{overloads:[["Number"]]},tilt:{overloads:[["Number"]]},lookAt:{overloads:[["Number","Number","Number"]]},camera:{overloads:[["Number?","Number?","Number?","Number?","Number?","Number?","Number?","Number?","Number?"]]},move:{overloads:[["Number","Number","Number"]]},setPosition:{overloads:[["Number","Number","Number"]]},set:{overloads:[["p5.Camera"]]},slerp:{overloads:[["p5.Camera","p5.Camera","Number"]]}},"p5.Graphics":{reset:{overloads:[[]]},remove:{overloads:[[]]},createFramebuffer:{overloads:[["Object?"]]}}};function um(t,r,n){let i=new Map,s=Object.keys(t).reduce((r,n)=>(n.match(/^[A-Z]/)&&!n.match(/^[A-Z][A-Z0-9]*$/)&&t[n]instanceof Function&&(r[n]=t[n]),r),{}),o={};for(let[t,r]of Object.entries(d.a3))o[t]=r;let a={Any:a1(),Array:lt(a1()),Boolean:aj(),Function:ur(),Integer:aM().int(),Number:aM(),Object:li({}),String:oq()};Object.assign(a,["AudioNode","HTMLCanvasElement","HTMLElement","KeyboardEvent","MouseEvent","RegExp","TouchEvent","UIEvent","WheelEvent"].reduce((t,r)=>(t[r]=us(t=>t instanceof globalThis[r],{message:`Expected a ${r}`}),t),{}));let l=["first","second","third","fourth","fifth","sixth","seventh","eighth","ninth","tenth"];function u(t){let r=t.lastIndexOf(".");
43return{funcName:t.slice(r+1),funcClass:t.slice(0,-1!==r?r:0)||"p5"}}function h(t){let r=0;for(let n=0;n<t.length;n++)if("["===t[n])r++;else if("]"===t[n]&&--r<0)return!1;return 0===r}let c=function(t){let{funcName:n,funcClass:i}=u(t),l=uf[i][n];if(!l)return;let c=[];l.hasOwnProperty("overloads")&&(c=l.overloads);let d=t=>{let n;if(!t)return a1();if(t in o)n=lT(o[t]);else if(t.match(/^[A-Z][A-Z0-9]*$/)&&t in r)n=lT(r[t]);else if(t.startsWith("function"))n=ur();else if(/^p5\.[a-zA-Z0-9]+$/.exec(t)||"p5"===t)n=uh(s[t.substring(t.indexOf(".")+1)]);else if(a[t])n=a[t];else if(t.startsWith("[")&&t.endsWith("]")&&h(t.slice(1,-1)))n=lg(t.slice(1,-1).split(/, */g).map(t=>d(t)));else if(t.match(/^[A-Z]/)&&t in window)n=uh(window[t]);else if(t.includes("|")&&t.split("|").every(t=>h(t)))n=ll(t.split("|").map(t=>d(t)).filter(t=>void 0!==t));else if(t.endsWith("[]"))n=lt(d(t.slice(0,-2)));else throw Error(`Unsupported type '${t}' in parameter validation. Please report this issue.`);return n},p=c.flatMap(t=>(t=>{if(!t.some(t=>t?.endsWith("?")))return[t];let r=t.filter(t=>null===t||!t.endsWith("?")).length,n=[];for(let i=r;i<=t.length;i++)n.push(t.slice(0,i));return n})(t).map(t=>{let r,n=t.map(t=>(t=>{let r=t?.endsWith("?");t=t?.replace(/\?$/,"");let n=t?.startsWith("...")&&t?.endsWith("[]"),i=d(t=t?.replace(/^\.\.\.(.+)\[\]$/,"$1"));return"function"===i.def.type&&(i=us(t=>t instanceof Function)),r&&(i=i.optional()),{schema:i,rest:n}})(t)).filter(t=>void 0!==t.schema);n.at(-1)?.rest&&(r=n.pop());let i=lg(n.map(t=>t.schema));return r&&(i=i.rest(r.schema)),i}));return 1===p.length?p[0]:ll(p)},p=function(t,r){if(!(t instanceof la))return t;let n=t.def.options[0],i=1/0;return t.def.options.forEach(t=>{let s=(t=>{let n=1/0;if(!(t instanceof lm))return console.warn("Schema below is not a tuple: "),printZodSchema(t),n;let i=r.length,s=t.def.items,o=s.length,a=s.filter(t=>!t.isOptional()).length;n=i>=a&&i<=o?0:4*Math.abs(i<a?a-i:i-o);for(let t=0;t<Math.min(s.length,r.length);t++){let i=s[t],o=r[t];!i.safeParse(o).success&&n++}return n})(t);s<i&&(n=t,i=s)}),n},f=function(r,n,i){let s="\uD83C\uDF38 p5.js says: ",o=!1,a=r.issues[0],h=(t,r,n)=>{let i=n?`at the ${l[n]} parameter`:"",s=t?`, but received ${t}`:"";return`Expected ${r} ${i}${s}`};switch(a.code){case"invalid_union":(t=>{let r,n=new Set;if(t.errors.forEach(s=>{let o=s[0];if(o){if(r||(r=o.message),"invalid_type"===o.code)r=o.message.split(", received ")[1],n.add(o.expected);else if("invalid_value"===o.code)n.add("constant (please refer to documentation for allowed values)"),r=i[t.path[0]];else if("custom"===o.code){let t=o.message.match(/Input not instance of (\w+)/);t&&n.add(t[1]),r=void 0}}}),n.size>0){t.path?.length>0&&i[t.path[0]]instanceof Promise&&(s+="Did you mean to put `await` before a loading function? An unexpected Promise was found. ",o=!0);let a=Array.from(n).join(" or "),l=t.path.join(".");s+=h(r,a,l)}})(a);break;case"too_small":{let t=a.minimum;s+=`Expected at least ${t} argument${t>1?"s":""}, but received fewer`;break}case"invalid_type":s+=h(a.message.split(", received ")[1],a.expected,a.path.join("."));break;case"too_big":{let t=a.maximum;s+=`Expected at most ${t} argument${t>1?"s":""}, but received more`;break}default:console.log("Zod error object",a)}if(s+=` in ${n}().`,"too_big"===a.code||"too_small"===a.code){let t=(t=>{let{funcName:r,funcClass:n}=u(t);return`https://p5js.org/reference/${n}/${r}`})(n);s+=` For more information, see ${t}.`}return o?t._error(this,s):console.log(s),s},m=function(r,n){if(t.disableFriendlyErrors)return;if(Array.isArray(n)||(n=Array.from(n)),Array.isArray(n)&&n.length>0&&n.every(t=>void 0===t))return{success:!1,error:`🌸 p5.js says: All arguments for ${r}() are undefined. There is likely an error in the code.`};let s=i.get(r);if(!s){if(!(s=c(r)))return;i.set(r,s)}try{return{success:!0,data:s.parse(n)}}catch(t){return{success:!1,error:f(p(s,n).safeParse(n).error,r,n)}}};r._validate=m,r._internal=function(t){let r=this._isUserCall;this._isUserCall=!0;try{return t()}finally{this._isUserCall=r}},t.registerDecorator(({path:t})=>t.startsWith("p5.prototype"),function(r,{kind:n,name:i}){if("method"===n)return function(...n){let s=this._isUserCall;this._isUserCall=!0;try{return s||t.disableFriendlyErrors||t.disableParameterValidator||m(i,n),r.apply(this,n)}finally{this._isUserCall=s}}}),n.presetup=function(){for(let r of Object.keys(t))"function"==typeof t[r]&&r[0]!==r[0].toLowerCase()&&(s[r]=t[r])}}"undefined"!=typeof p5&&um(p5,p5.prototype);var ug=n(81646);function uy(t,r,n,i,s){var o=[];n||(n=uA),function t(i,s,a){var l=a||i.type,u=i!==o[o.length-1];u&&o.push(i),u_(n,l,i,s,t),r[l]&&r[l](i,s||o,o),u&&o.pop()}(t,i,s)}function uv(t,r,n,i,s){var o=n?function(t,r){var n=Object.create(r||uA);for(var i in t)n[i]=t[i];return n}(n,i||void 0):i;!function t(r,n,i){o[i||r.type](r,n,t)}(t,r,s)}function ub(t,r,n){n(t,r)}function ux(t,r,n){}function u_(t,r,n,i,s){if(null==t[r])throw Error("No walker function defined for node type "+r);t[r](n,i,s)}var uA={};uA.Program=uA.BlockStatement=uA.StaticBlock=function(t,r,n){for(var i=0,s=t.body;i<s.length;i+=1)n(s[i],r,"Statement")},uA.Statement=ub,uA.EmptyStatement=ux,uA.ExpressionStatement=uA.ParenthesizedExpression=uA.ChainExpression=function(t,r,n){return n(t.expression,r,"Expression")},uA.IfStatement=function(t,r,n){n(t.test,r,"Expression"),n(t.consequent,r,"Statement"),t.alternate&&n(t.alternate,r,"Statement")},uA.LabeledStatement=function(t,r,n){return n(t.body,r,"Statement")},uA.BreakStatement=uA.ContinueStatement=ux,uA.WithStatement=function(t,r,n){n(t.object,r,"Expression"),n(t.body,r,"Statement")},uA.SwitchStatement=function(t,r,n){n(t.discriminant,r,"Expression");for(var i=0,s=t.cases;i<s.length;i+=1)n(s[i],r)},uA.SwitchCase=function(t,r,n){t.test&&n(t.test,r,"Expression");for(var i=0,s=t.consequent;i<s.length;i+=1)n(s[i],r,"Statement")},uA.ReturnStatement=uA.YieldExpression=uA.AwaitExpression=function(t,r,n){t.argument&&n(t.argument,r,"Expression")},uA.ThrowStatement=uA.SpreadElement=function(t,r,n){return n(t.argument,r,"Expression")},uA.TryStatement=function(t,r,n){n(t.block,r,"Statement"),t.handler&&n(t.handler,r),t.finalizer&&n(t.finalizer,r,"Statement")},uA.CatchClause=function(t,r,n){t.param&&n(t.param,r,"Pattern"),n(t.body,r,"Statement")},uA.WhileStatement=uA.DoWhileStatement=function(t,r,n){n(t.test,r,"Expression"),n(t.body,r,"Statement")},uA.ForStatement=function(t,r,n){t.init&&n(t.init,r,"ForInit"),t.test&&n(t.test,r,"Expression"),t.update&&n(t.update,r,"Expression"),n(t.body,r,"Statement")},uA.ForInStatement=uA.ForOfStatement=function(t,r,n){n(t.left,r,"ForInit"),n(t.right,r,"Expression"),n(t.body,r,"Statement")},uA.ForInit=function(t,r,n){"VariableDeclaration"===t.type?n(t,r):n(t,r,"Expression")},uA.DebuggerStatement=ux,uA.FunctionDeclaration=function(t,r,n){return n(t,r,"Function")},uA.VariableDeclaration=function(t,r,n){for(var i=0,s=t.declarations;i<s.length;i+=1)n(s[i],r)},uA.VariableDeclarator=function(t,r,n){n(t.id,r,"Pattern"),t.init&&n(t.init,r,"Expression")},uA.Function=function(t,r,n){t.id&&n(t.id,r,"Pattern");for(var i=0,s=t.params;i<s.length;i+=1)n(s[i],r,"Pattern");n(t.body,r,t.expression?"Expression":"Statement")},uA.Pattern=function(t,r,n){"Identifier"===t.type?n(t,r,"VariablePattern"):"MemberExpression"===t.type?n(t,r,"MemberPattern"):n(t,r)},uA.VariablePattern=ux,uA.MemberPattern=ub,uA.RestElement=function(t,r,n){return n(t.argument,r,"Pattern")},uA.ArrayPattern=function(t,r,n){for(var i=0,s=t.elements;i<s.length;i+=1){var o=s[i];o&&n(o,r,"Pattern")}},uA.ObjectPattern=function(t,r,n){for(var i=0,s=t.properties;i<s.length;i+=1){var o=s[i];"Property"===o.type?(o.computed&&n(o.key,r,"Expression"),n(o.value,r,"Pattern")):"RestElement"===o.type&&n(o.argument,r,"Pattern")}}
43,uA.Expression=ub,uA.ThisExpression=uA.Super=uA.MetaProperty=ux,uA.ArrayExpression=function(t,r,n){for(var i=0,s=t.elements;i<s.length;i+=1){var o=s[i];o&&n(o,r,"Expression")}},uA.ObjectExpression=function(t,r,n){for(var i=0,s=t.properties;i<s.length;i+=1)n(s[i],r)},uA.FunctionExpression=uA.ArrowFunctionExpression=uA.FunctionDeclaration,uA.SequenceExpression=function(t,r,n){for(var i=0,s=t.expressions;i<s.length;i+=1)n(s[i],r,"Expression")},uA.TemplateLiteral=function(t,r,n){for(var i=0,s=t.quasis;i<s.length;i+=1)n(s[i],r);for(var o=0,a=t.expressions;o<a.length;o+=1)n(a[o],r,"Expression")},uA.TemplateElement=ux,uA.UnaryExpression=uA.UpdateExpression=function(t,r,n){n(t.argument,r,"Expression")},uA.BinaryExpression=uA.LogicalExpression=function(t,r,n){n(t.left,r,"Expression"),n(t.right,r,"Expression")},uA.AssignmentExpression=uA.AssignmentPattern=function(t,r,n){n(t.left,r,"Pattern"),n(t.right,r,"Expression")},uA.ConditionalExpression=function(t,r,n){n(t.test,r,"Expression"),n(t.consequent,r,"Expression"),n(t.alternate,r,"Expression")},uA.NewExpression=uA.CallExpression=function(t,r,n){if(n(t.callee,r,"Expression"),t.arguments)for(var i=0,s=t.arguments;i<s.length;i+=1)n(s[i],r,"Expression")},uA.MemberExpression=function(t,r,n){n(t.object,r,"Expression"),t.computed&&n(t.property,r,"Expression")},uA.ExportNamedDeclaration=uA.ExportDefaultDeclaration=function(t,r,n){if(t.declaration&&n(t.declaration,r,"ExportNamedDeclaration"===t.type||t.declaration.id?"Statement":"Expression"),t.source&&n(t.source,r,"Expression"),t.attributes)for(var i=0,s=t.attributes;i<s.length;i+=1)n(s[i],r)},uA.ExportAllDeclaration=function(t,r,n){if(t.exported&&n(t.exported,r),n(t.source,r,"Expression"),t.attributes)for(var i=0,s=t.attributes;i<s.length;i+=1)n(s[i],r)},uA.ImportAttribute=function(t,r,n){n(t.value,r,"Expression")},uA.ImportDeclaration=function(t,r,n){for(var i=0,s=t.specifiers;i<s.length;i+=1)n(s[i],r);if(n(t.source,r,"Expression"),t.attributes)for(var o=0,a=t.attributes;o<a.length;o+=1)n(a[o],r)},uA.ImportExpression=function(t,r,n){n(t.source,r,"Expression"),t.options&&n(t.options,r,"Expression")},uA.ImportSpecifier=uA.ImportDefaultSpecifier=uA.ImportNamespaceSpecifier=uA.Identifier=uA.PrivateIdentifier=uA.Literal=ux,uA.TaggedTemplateExpression=function(t,r,n){n(t.tag,r,"Expression"),n(t.quasi,r,"Expression")},uA.ClassDeclaration=uA.ClassExpression=function(t,r,n){return n(t,r,"Class")},uA.Class=function(t,r,n){t.id&&n(t.id,r,"Pattern"),t.superClass&&n(t.superClass,r,"Expression"),n(t.body,r)},uA.ClassBody=function(t,r,n){for(var i=0,s=t.body;i<s.length;i+=1)n(s[i],r)},uA.MethodDefinition=uA.PropertyDefinition=uA.Property=function(t,r,n){t.computed&&n(t.key,r,"Expression"),t.value&&n(t.value,r,"Expression")};let uE=["setup","draw","preload","deviceMoved","deviceTurned","deviceShaken","doubleClicked","mousePressed","mouseReleased","mouseMoved","mouseDragged","mouseClicked","mouseWheel","touchStarted","touchMoved","touchEnded","keyPressed","keyReleased","keyTyped","windowResized"],uC={fetchScript:async function(t){if(!t.src)return t.textContent;try{return await fetch(t.src).then(t=>t.text())}catch(t){return console.error("Error fetching script:",t),""}},extractUserDefinedVariablesAndFuncs:function(t){let r={variables:[],functions:[]};try{var n,i,s;n=(0,ug.qg)(t,{ecmaVersion:"latest",sourceType:"module",locations:!0}),i={VariableDeclarator(t){"Identifier"===t.id.type&&r[t.init&&["ArrowFunctionExpression","FunctionExpression"].includes(t.init.type)?"functions":"variables"].push({name:t.id.name,line:t.loc.start.line+-1})},FunctionDeclaration(t){t.id&&"Identifier"===t.id.type&&r.functions.push({name:t.id.name,line:t.loc.start.line+-1})},ClassDeclaration(t){t.id&&"Identifier"===t.id.type&&r.variables.push({name:t.id.name,line:t.loc.start.line+-1})}},s||(s=uA),function t(r,n,o){var a=o||r.type;u_(s,a,r,n,t),i[a]&&i[a](r,n)}(n,void 0,void 0)}catch(t){console.error("Error parsing code:",t)}return r},checkForConstsAndFuncs:function(t,r){let n=[...t.variables,...t.functions];function i(t,r,n){let i=`https://p5js.org/reference/p5/${r}`;return`${t} "${r}" on line ${n} is being redeclared and conflicts with a p5.js ${t.toLowerCase()}. p5.js reference: ${i}`}for(let{name:t,line:r}of n)if(void 0!==d.a3[t])return console.log(i("Constant",t,r)),!0;let s=new Set(Object.getOwnPropertyNames(r.prototype).filter(t=>!t.startsWith("_")&&"constructor"!==t));for(let{name:t,line:r}
43of n)if(!uE.includes(t)&&s.has(t))return console.log(i("Function",t,r)),!0;return!1},getUserCode:async function(){let t=document.querySelectorAll("script"),r=t[t.length-1];return await uC.fetchScript(r)},runFES:async function(t){let r=await uC.getUserCode(),n=uC.extractUserDefinedVariablesAndFuncs(r);uC.checkForConstsAndFuncs(n,t)}};function uD(t,r,n){n.presetup=async function(){t.disableFriendlyErrors||t.disableSketchChecker||uC.runFES(t)}}function uw(t,r){t._friendlyFileLoadError=function(r,n){let{message:i,method:s}=((t,r)=>{let n=tH("fes.fileLoadError.suggestion",{filePath:r,url:"https://github.com/processing/p5.js/wiki/Local-server"});switch(t){case 0:return{message:tH("fes.fileLoadError.image",{suggestion:n}),method:"loadImage"};case 1:return{message:tH("fes.fileLoadError.xml",{suggestion:n}),method:"loadXML"};case 2:return{message:tH("fes.fileLoadError.table",{suggestion:n}),method:"loadTable"};case 3:return{message:tH("fes.fileLoadError.strings",{suggestion:n}),method:"loadStrings"};case 4:return{message:tH("fes.fileLoadError.font",{suggestion:n}),method:"loadFont"};case 5:return{message:tH("fes.fileLoadError.json",{suggestion:n}),method:"loadJSON"};case 6:return{message:tH("fes.fileLoadError.bytes",{suggestion:n}),method:"loadBytes"};case 7:return{message:tH("fes.fileLoadError.large"),method:"loadX"};case 8:return{message:tH("fes.fileLoadError.gif"),method:"loadImage"}}})(r,n);t._friendlyError(i,s,3)}}function uS(t,r){r.storeItem=function(r,n){"string"!=typeof r&&t._friendlyError(`The argument that you passed to storeItem() - ${r} is not a string.`,"storeItem"),r.endsWith("p5TypeID")&&t._friendlyError(`The argument that you passed to storeItem() - ${r} must not end with 'p5TypeID'.`,"storeItem"),void 0===n&&t._friendlyError("You cannot store undefined variables using storeItem().","storeItem");let i=typeof n;switch(i){case"number":case"boolean":n=n.toString();break;case"object":n instanceof t.Color?(i="p5.Color",n=n.toString()):n instanceof t.Vector&&(i="p5.Vector",n=n.values),n=JSON.stringify(n)}localStorage.setItem(r,n);let s=`${r}p5TypeID`;localStorage.setItem(s,i)},r.getItem=function(r){let n=localStorage.getItem(r),i=localStorage.getItem(`${r}p5TypeID`);if(void 0===i)t._friendlyError(`Unable to determine type of item stored under ${r}in local storage. Did you save the item with something other than setItem()?`,"getItem");else if(null!==n)switch(i){case"number":n=parseFloat(n);break;case"boolean":n="true"===n;break;case"object":n=JSON.parse(n);break;case"p5.Color":n=this.color(JSON.parse(n));break;case"p5.Vector":n=JSON.parse(n),n=this.createVector(...n)}return n},r.clearStorage=function(){Object.keys(localStorage).forEach(t=>{t.endsWith("p5TypeID")&&this.removeItem(t.replace("p5TypeID",""))})},r.removeItem=function(r){"string"!=typeof r&&t._friendlyError(`The argument that you passed to removeItem() - ${r} is not a string.`,"removeItem"),localStorage.removeItem(r),localStorage.removeItem(`${r}p5TypeID`)}}function uF(t,r){function n(t,r,n){(r._userNode?r._userNode:document.body).appendChild(t);let i=n?new b.z(t,r):new v.H(t,r);return r._elements.push(i),i}r.select=function(t,r){let n=this._getContainer(r).querySelector(t);return n?this._wrapElement(n):null},r.selectAll=function(t,r){let n=[],i=this._getContainer(r).querySelectorAll(t);if(i)for(let t=0;t<i.length;t++){let r=this._wrapElement(i[t]);n.push(r)}return n},r._getContainer=function(t){let r=document;return"string"==typeof t?r=document.querySelector(t)||document:t instanceof v.H?r=t.elt:t instanceof HTMLElement&&(r=t),r},r._wrapElement=function(t){let r=Array.prototype.slice.call(t.children);if("INPUT"===t.tagName&&"checkbox"===t.type){let r=new v.H(t,this);return r.checked=function(...t){return 0===t.length?this.elt.checked:(t[0]?this.elt.checked=!0:this.elt.checked=!1,this)},r}return"VIDEO"===t.tagName||"AUDIO"===t.tagName?new b.z(t,this):"SELECT"===t.tagName?this.createSelect(new v.H(t,this)):r.length>0&&r.every(function(t){return"INPUT"===t.tagName||"LABEL"===t.tagName})&&("DIV"===t.tagName||"SPAN"===t.tagName)?this.createRadio(new v.H(t,this)):new v.H(t,this)},r.createElement=function(t,r){let i=document.createElement(t);return void 0!==r&&(i.innerHTML=r),n(i,this)},r.removeElements=function(t){this._elements.filter(t=>!(t.elt instanceof HTMLCanvasElement)).map(t=>t.remove())},r.createDiv=function(t=""){let r=document.createElement("div");return r.innerHTML=t,n(r,this)},r.createP=function(t=""){let r=document.createElement("p");return r.innerHTML=t,n(r,this)},r.createSpan=function(t=""){let r=document.createElement("span");return r.innerHTML=t,n(r,this)},r.createImg=function(){let t,r=document.createElement("img"),i=arguments;return i.length>1&&"string"==typeof i[1]&&(r.alt=i[1]),i.length>2&&"string"==typeof i[2]&&(r.crossOrigin=i[2]),r.src=i[0],t=n(r,this),r.addEventListener("load",function(){t.width=r.offsetWidth||r.width,t.height=r.offsetHeight||r.height;let n=i[i.length-1];"function"==typeof n&&n(t)}),t},r.createA=function(t,r,i){let s=document.createElement("a");return s.href=t,s.innerHTML=r,i&&(s.target=i),n(s,this)},r.createSlider=function(t,r,i,s){let o=document.createElement("input");return o.type="range",o.min=t,o.max=r,0===s?o.step=1e-18:s&&(o.step=s),"number"==typeof i&&(o.value=i),n(o,this)},r.createButton=function(t,r){let i=document.createElement("button");return i.innerHTML=t,r&&(i.value=r),n(i,this)},r.createCheckbox=function(...t){let r=document.createElement("div"),i=document.createElement("input");i.type="checkbox";let s=document.createElement("label");s.appendChild(i),r.appendChild(s);let o=n(r,this);if(o.checked=function(...t){let r=o.elt.firstElementChild.getElementsByTagName("input")[0];if(r)if(0===t.length)return r.checked;else t[0]?r.checked=!0:r.checked=!1;return o},this.value=function(t){return o.value=t,this},t[0]){o.value(t[0]);let r=document.createElement("span");r.innerHTML=t[0],s.appendChild(r)}return t[1]&&(i.checked=!0),o},r.createSelect=function(...t){let r,i=t[0];if(i instanceof v.H&&i.elt instanceof HTMLSelectElement)r=i,this.elt=i.elt;else if(i instanceof HTMLSelectElement)r=n(i,this),this.elt=i;else{let t=document.createElement("select");i&&"boolean"==typeof i&&t.setAttribute("multiple","true"),r=n(t,this),this.elt=t}return r.option=function(t,r){let n;if(void 0!==t){for(let r=0;r<this.elt.length;r+=1)if(this.elt[r].textContent===t){n=r;break}if(void 0!==n)!1===r?this.elt.remove(n):this.elt[n].value=r;else{let n=document.createElement("option");n.textContent=t,n.value=void 0===r?t:r,this.elt.appendChild(n),this._pInst._elements.push(n)}}},r.selected=function(t){if(void 0!==t){for(let r=0;r<this.elt.length;r+=1)this.elt[r].value.toString()===t.toString()&&(this.elt.selectedIndex=r);return this}if(!this.elt.getAttribute("multiple"))return this.elt.value;{let t=[];for(let r of this.elt.selectedOptions)t.push(r.value);return t}},r.disable=function(t){if("string"==typeof t)for(let r=0;r<this.elt.length;r++)this.elt[r].value.toString()===t&&(this.elt[r].disabled=!0,this.elt[r].selected=!1);else this.elt.disabled=!0;return this},r.enable=function(t){if("string"==typeof t)for(let r=0;r<this.elt.length;r++)this.elt[r].value.toString()===t&&(this.elt[r].disabled=!1,this.elt[r].selected=!1);else{this.elt.disabled=!1;for(let t=0;t<this.elt.length;t++)this.elt[t].disabled=!1,this.elt[t].selected=!1}return this},r};let i=0;r.createRadio=function(...t){let r,s,o,a=t[0];a instanceof v.H&&(a.elt instanceof HTMLDivElement||a.elt instanceof HTMLSpanElement)?(r=a,this.elt=a.elt):a instanceof HTMLDivElement||a instanceof HTMLSpanElement?(r=n(a,this),this.elt=a,s=a,"string"==typeof t[1]&&(o=t[1])):("string"==typeof a&&(o=a),r=n(s=document.createElement("div"),this),this.elt=s),r._name=o||`radioOption_${i++}`;let l=t=>t instanceof HTMLInputElement&&"radio"===t.type,u=t=>t instanceof HTMLLabelElement;return r._getOptionsArray=function(){return Array.from(this.elt.children).filter(t=>l(t)||u(t)&&l(t.firstElementChild)).map(t=>l(t)?t:t.firstElementChild)},r.option=function(t,n){let i,s,o;for(let n of r._getOptionsArray())if(n.value===t){i=n;break}return void 0===i&&((i=document.createElement("input")).setAttribute("type","radio"),i.setAttribute("value",t)),i.setAttribute("name",r._name),u(i.parentElement)?s=i.parentElement:(s=document.createElement("label")).insertAdjacentElement("afterbegin",i),s.lastElementChild instanceof HTMLSpanElement?o=s.lastElementChild:(o=document.createElement("span"),i.insertAdjacentElement("afterend",o)),o.innerHTML=void 0===n?t:n,this.elt.appendChild(s),i},r.remove=function(t){for(let n of r._getOptionsArray())if(n.value===t)return void(u(n.parentElement)?n.parentElement.remove():n.remove())},r.value=function(){let t="";for(let n of r._getOptionsArray())if(n.checked){t=n.value;break}return t},r.selected=function(t){let n=null;if(void 0===t){for(let t of r._getOptionsArray())if(t.checked){n=t;break}}
43else for(let i of(r._getOptionsArray().forEach(t=>{t.checked=!1,t.removeAttribute("checked")}),r._getOptionsArray()))i.value===t&&(i.setAttribute("checked",!0),i.checked=!0,n=i);return n},r.disable=function(t=!0){for(let n of r._getOptionsArray())n.setAttribute("disabled",t)},r},r.createColorPicker=function(r){let i,s=document.createElement("input");s.type="color",r?r instanceof t.Color?s.value=r.toString("#rrggbb"):(this.push(),this.colorMode("rgb"),s.value=this.color(r).toString("#rrggbb"),this.pop()):s.value="#000000";let o=this;return(i=n(s,this)).color=function(){o.push(),r&&r.mode&&o.colorMode(r.mode,...r?.maxes&&r.maxes[r.mode]||[]);let t=o.color(this.elt.value);return o.pop(),t},i},r.createInput=function(t="",r="text"){let i=document.createElement("input");return i.setAttribute("value",t),i.setAttribute("type",r),n(i,this)},r.createFileInput=function(r,i=!1){if(!(window.File&&window.FileReader&&window.FileList&&window.Blob))return void t._friendlyError("The File APIs are not fully supported in this browser. Cannot create element.","createFileInput");let s=document.createElement("input");return s.setAttribute("type","file"),i&&s.setAttribute("multiple",!0),s.addEventListener("change",function(t){for(let n of t.target.files)eC.Z._load(n,r)},!1),n(s,this)}}function uT(t,r,n){n.presetup=function(){for(let t of["deviceorientation","devicemotion"])window.addEventListener(t,this[`_on${t}`].bind(this),{passive:!1,signal:this._removeSignal})},r.deviceOrientation=window.innerWidth/window.innerHeight>1?"landscape":"portrait",r.accelerationX=0,r.accelerationY=0,r.accelerationZ=0,r.pAccelerationX=0,r.pAccelerationY=0,r.pAccelerationZ=0,r._updatePAccelerations=function(){this.pAccelerationX=this.accelerationX,this.pAccelerationY=this.accelerationY,this.pAccelerationZ=this.accelerationZ},r.rotationX=0,r.rotationY=0,r.rotationZ=0,r.pRotationX=0,r.pRotationY=0,r.pRotationZ=0;let i=0,s=0,o=0,a="clockwise",l="clockwise",u="clockwise";r.pRotateDirectionX=void 0,r.pRotateDirectionY=void 0,r.pRotateDirectionZ=void 0,r._updatePRotations=function(){this.pRotationX=this.rotationX,this.pRotationY=this.rotationY,this.pRotationZ=this.rotationZ},r.turnAxis=void 0;let h=.5,c=30;r.setMoveThreshold=function(t){h=t},r.setShakeThreshold=function(t){c=t},r._ondeviceorientation=function(t){this._updatePRotations(),this.rotationX=this._fromDegrees(t.beta),this.rotationY=this._fromDegrees(t.gamma),this.rotationZ=this._fromDegrees(t.alpha),this._handleMotion()},r._ondevicemotion=function(t){this._updatePAccelerations(),this.accelerationX=2*t.acceleration.x,this.accelerationY=2*t.acceleration.y,this.accelerationZ=2*t.acceleration.z,this._handleMotion()},r._handleMotion=function(){if("landscape-primary"===screen.orientation.type||"landscape-secondary"===screen.orientation.type?this.deviceOrientation="landscape":"portrait-primary"===screen.orientation.type||"portrait-secondary"===screen.orientation.type?this.deviceOrientation="portrait":this.deviceOrientation="undefined","function"==typeof this._customActions.deviceMoved&&(Math.abs(this.accelerationX-this.pAccelerationX)>h||Math.abs(this.accelerationY-this.pAccelerationY)>h||Math.abs(this.accelerationZ-this.pAccelerationZ)>h)&&this._customActions.deviceMoved(),"function"==typeof this._customActions.deviceTurned){let t=this._toDegrees(this.rotationX)+180,r=this._toDegrees(this.pRotationX)+180,n=i+180;t-r>0&&t-r<270||t-r<-270?a="clockwise":(t-r<0||t-r>270)&&(a="counter-clockwise"),a!==this.pRotateDirectionX&&(n=t),Math.abs(t-n)>90&&270>Math.abs(t-n)&&(n=t,this.turnAxis="X",this._customActions.deviceTurned()),this.pRotateDirectionX=a,i=n-180;let h=this._toDegrees(this.rotationY)+180,c=this._toDegrees(this.pRotationY)+180,d=s+180;h-c>0&&h-c<270||h-c<-270?l="clockwise":(h-c<0||h-this.pRotationY>270)&&(l="counter-clockwise"),l!==this.pRotateDirectionY&&(d=h),Math.abs(h-d)>90&&270>Math.abs(h-d)&&(d=h,this.turnAxis="Y",this._customActions.deviceTurned()),this.pRotateDirectionY=l,s=d-180;let p=this._toDegrees(this.rotationZ),f=this._toDegrees(this.pRotationZ);p-f>0&&p-f<270||p-f<-270?u="clockwise":(p-f<0||p-f>270)&&(u="counter-clockwise"),u!==this.pRotateDirectionZ&&(o=p),Math.abs(p-o)>90&&270>Math.abs(p-o)&&(o=p,this.turnAxis="Z",this._customActions.deviceTurned()),this.pRotateDirectionZ=u,this.turnAxis=void 0}if("function"==typeof this._customActions.deviceShaken){let t,r;null!==this.pAccelerationX&&(t=Math.abs(this.accelerationX-this.pAccelerationX),r=Math.abs(this.accelerationY-this.pAccelerationY)),t+r>c&&this._customActions.deviceShaken()}}}function uN(t,r,n){n.presetup=function(){for(let t of["keydown","keyup","keypress","blur"])window.addEventListener(t,this[`_on${t}`].bind(this),{passive:!1,signal:this._removeSignal})},r.keyIsPressed=!1,r.key="",r.code="",r.keyCode=0,r._onkeydown=function(t){!this._downKeys[t.code]&&(this.keyIsPressed=!0,this.keyCode=t.which,this.key=t.key,this.code=t.code,this._downKeyCodes[t.code]=!0,this._downKeys[t.key]=!0,"function"!=typeof this._customActions.keyPressed||t.charCode||!1===this._customActions.keyPressed(t)&&t.preventDefault())},r._onkeyup=function(t){if("function"==typeof this._customActions.keyReleased&&!1===this._customActions.keyReleased(t)&&t.preventDefault(),delete this._downKeyCodes[t.code],delete this._downKeys[t.key],this._areDownKeys()){let t=Object.keys(this._downKeyCodes).pop();
43this.code=t;let r=Object.keys(this._downKeys).pop();this.key=r}else this.keyIsPressed=!1,this.key="",this.code=""},r._onkeypress=function(t){t.which===this._lastKeyCodeTyped&&t.repeat||(this._lastKeyCodeTyped=t.which,this.key=t.key||String.fromCharCode(t.which)||t.which,"function"==typeof this._customActions.keyTyped&&!1===this._customActions.keyTyped(t)&&t.preventDefault())},r._onblur=function(t){this._downKeys={}},r.keyIsDown=function(t){return!["Alt","Shift","Control","Meta"].includes(t)&&"string"==typeof t&&t.length>1?this._downKeyCodes[t]||this._downKeys[t]||!1:this._downKeys[t]||this._downKeyCodes[t]||!1},r._areDownKeys=function(){for(let t in this._downKeys)if(this._downKeys.hasOwnProperty(t)&&!0===this._downKeys[t])return!0;return!1}}function uI(t,r,n){n.presetup=function(){for(let t of["pointerdown","pointerup","pointermove","dragend","dragover","click","dblclick","wheel"])window.addEventListener(t,this[`_on${t}`].bind(this),{passive:!1,signal:this._removeSignal});window.addEventListener("blur",()=>{this.mouseIsPressed=!1},{signal:this._removeSignal})},r.movedX=0,r.movedY=0,r._hasMouseInteracted=!1,r.mouseX=0,r.mouseY=0,r.pmouseX=0,r.pmouseY=0,r.winMouseX=0,r.winMouseY=0,r.pwinMouseX=0,r.pwinMouseY=0,r.mouseButton={left:!1,right:!1,center:!1},r.touches=[],r._activePointers=new Map,r.mouseIsPressed=!1,r._updatePointerCoords=function(t){if(null!==this._curElement){let r=this._curElement.elt,n=r.scrollWidth/this.width||1,i=r.scrollHeight/this.height||1;if("touch"===t.pointerType){let t=[];for(let s of this._activePointers.values())t.push(function(t,r,n,i){let s=t.getBoundingClientRect();return{x:(i.clientX-s.left)/r,y:(i.clientY-s.top)/n,winX:i.clientX,winY:i.clientY,id:i.pointerId}}(r,n,i,s));this.touches=t}let s=function(t,r,n,i){let s=t.getBoundingClientRect();return{x:(i.clientX-s.left)/r,y:(i.clientY-s.top)/n,winX:i.clientX,winY:i.clientY}}(r,n,i,t);this.movedX=t.movementX||0,this.movedY=t.movementY||0,this.mouseX=s.x,this.mouseY=s.y,this.winMouseX=s.winX,this.winMouseY=s.winY,this._hasMouseInteracted||(this._updateMouseCoords(),this._hasMouseInteracted=!0)}},r._updateMouseCoords=function(){this.pmouseX=this.mouseX,this.pmouseY=this.mouseY,this.pwinMouseX=this.winMouseX,this.pwinMouseY=this.winMouseY,this._pmouseWheelDeltaY=this._mouseWheelDeltaY},r._setMouseButton=function(t){this.mouseButton.left=Array.from(this._activePointers.values()).some(t=>(1&t.buttons)!=0),this.mouseButton.center=Array.from(this._activePointers.values()).some(t=>(4&t.buttons)!=0),this.mouseButton.right=Array.from(this._activePointers.values()).some(t=>(2&t.buttons)!=0)},r._onpointermove=function(t){this._updatePointerCoords(t),this._activePointers.set(t.pointerId,t),this._setMouseButton(t),this.mouseIsPressed||"function"!=typeof this._customActions.mouseMoved?this.mouseIsPressed&&"function"==typeof this._customActions.mouseDragged&&!1===this._customActions.mouseDragged(t)&&t.preventDefault():!1===this._customActions.mouseMoved(t)&&t.preventDefault()},r._onpointerdown=function(t){this.mouseIsPressed=!0,this._activePointers.set(t.pointerId,t),this._setMouseButton(t),this._updatePointerCoords(t),"function"==typeof this._customActions.mousePressed&&!1===this._customActions.mousePressed(t)&&t.preventDefault()},r._onpointerup=function(t){this.mouseIsPressed=!1,this._activePointers.delete(t.pointerId),this._setMouseButton(t),this._updatePointerCoords(t),"function"==typeof this._customActions.mouseReleased&&!1===this._customActions.mouseReleased(t)&&t.preventDefault()},r._ondragend=r._onpointerup,r._ondragover=r._onpointermove,r._onclick=function(t){"function"==typeof this._customActions.mouseClicked&&!1===this._customActions.mouseClicked(t)&&t.preventDefault()},r._ondblclick=function(t){"function"==typeof this._customActions.doubleClicked&&!1===this._customActions.doubleClicked(t)&&t.preventDefault()},r._mouseWheelDeltaY=0,r._pmouseWheelDeltaY=0,r._onwheel=function(t){this._mouseWheelDeltaY=t.deltaY,"function"==typeof this._customActions.mouseWheel&&(t.delta=t.deltaY,!1===this._customActions.mouseWheel(t)&&t.preventDefault())},r.requestPointerLock=function(){let r=this._curElement.elt;return(r.requestPointerLock=r.requestPointerLock||r.mozRequestPointerLock,r.requestPointerLock)?(r.requestPointerLock(),!0):(t._friendlyError("requestPointerLock is not implemented in this browser","requestPointerLock"),!1)},r.exitPointerLock=function(){document.exitPointerLock()}}"undefined"!=typeof p5&&uD(p5,p5.prototype),"undefined"!=typeof p5&&uw(p5,p5.prototype),"undefined"!=typeof p5&&uS(p5,p5.prototype),"undefined"!=typeof p5&&uF(p5,p5.prototype),"undefined"!=typeof p5&&uT(p5,p5.prototype),"undefined"!=typeof p5&&uN(p5,p5.prototype),"undefined"!=typeof p5&&uI(p5,p5.prototype);var uO=n(45953);class uk{constructor(t){this.columns=[],this.rows=[]}toString(t=","){let r=this.rows.map(t=>t.arr);return this.columns.some(t=>null===t)||(r=[this.columns,...r]),(0,uO.A)(r,{separator:t})}addRow(t){let r=t||new p5.TableRow;if(void 0===r.arr||void 0===r.obj)throw Error(`invalid TableRow: ${r}`);return r.table=this,this.rows.push(r),r}removeRow(t){this.rows[t].table=null;let r=this.rows.splice(t+1,this.rows.length);this.rows.pop(),this.rows=this.rows.concat(r)}getRow(t){return this.rows[t]}getRows(){return this.rows}findRow(t,r){if("string"==typeof r){for(let n=0;n<this.rows.length;n++)if(this.rows[n].obj[this.columns.indexOf(r)]===t)return this.rows[n]}else for(let n=0;n<this.rows.length;n++)if(this.rows[n].arr[r]===t)return this.rows[n];return null}findRows(t,r){let n=[];if("string"==typeof r)for(let i=0;i<this.rows.length;i++)this.rows[i].obj[this.columns.indexOf(r)]===t&&n.push(this.rows[i]);else for(let i=0;i<this.rows.length;i++)this.rows[i].arr[r]===t&&n.push(this.rows[i]);return n}matchRow(t,r){if("number"==typeof r){for(let n=0;n<this.rows.length;n++)if(this.rows[n].arr[r].match(t))return this.rows[n]}else for(let n=0;n<this.rows.length;n++)if(this.rows[n].obj[this.columns.indexOf(r)].match(t))return this.rows[n];return null}matchRows(t,r){let n=[];if("number"==typeof r)for(let i=0;i<this.rows.length;i++)this.rows[i].arr[r].match(t)&&n.push(this.rows[i]);else for(let i=0;i<this.rows.length;i++)this.rows[i].obj[this.columns.indexOf(r)].match(t)&&n.push(this.rows[i]);return n}getColumn(t){let r=[];if("string"==typeof t)for(let n=0;n<this.rows.length;n++)r.push(this.rows[n].obj[this.columns.indexOf(t)]);else for(let n=0;n<this.rows.length;n++)r.push(this.rows[n].arr[t]);return r}clearRows(){delete this.rows,this.rows=[]}addColumn(t){this.columns.push(t||null)}getColumnCount(){return this.columns.length}getRowCount(){return this.rows.length}removeTokens(t,r){let n=t=>t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),i=[];for(let r=0;r<t.length;r++)i.push(n(t.charAt(r)));let s=RegExp(i.join("|"),"g");if(void 0===r)for(let t=0;t<this.columns.length;t++)for(let r=0;r<this.rows.length;r++){let n=this.rows[r].arr[t];n=n.replace(s,""),this.rows[r].arr[t]=n,this.rows[r].obj[this.columns[t]]=n}else if("string"==typeof r)for(let t=0;t<this.rows.length;t++){let n=this.rows[t].obj[r];n=n.replace(s,""),this.rows[t].obj[r]=n;let i=this.columns.indexOf(r);this.rows[t].arr[i]=n}else for(let t=0;t<this.rows.length;t++){let n=this.rows[t].arr[r];n=n.replace(s,""),this.rows[t].arr[r]=n,this.rows[t].obj[this.columns[r]]=n}}trim(t){let r=RegExp(" ","g");if(void 0===t)for(let t=0;t<this.columns.length;t++)for(let n=0;n<this.rows.length;n++){let i=this.rows[n].arr[t];i=i.replace(r,""),this.rows[n].arr[t]=i,this.rows[n].obj[this.columns[t]]=i}else if("string"==typeof t)for(let n=0;n<this.rows.length;n++){let i=this.rows[n].obj[t];i=i.replace(r,""),this.rows[n].obj[t]=i;let s=this.columns.indexOf(t);this.rows[n].arr[s]=i}else for(let n=0;n<this.rows.length;n++){let i=this.rows[n].arr[t];i=i.replace(r,""),this.rows[n].arr[t]=i,this.rows[n].obj[this.columns[t]]=i}}
43removeColumn(t){let r,n;"string"==typeof t?(r=t,n=this.columns.indexOf(t)):(n=t,r=this.columns[t]);let i=this.columns.splice(n+1,this.columns.length);this.columns.pop(),this.columns=this.columns.concat(i);for(let t=0;t<this.rows.length;t++){let i=this.rows[t].arr,s=i.splice(n+1,i.length);i.pop(),this.rows[t].arr=i.concat(s),delete this.rows[t].obj[r]}}set(t,r,n){this.rows[t].set(r,n)}setNum(t,r,n){this.rows[t].setNum(r,n)}setString(t,r,n){this.rows[t].setString(r,n)}get(t,r){return"string"==typeof r?this.rows[t].get(this.columns.indexOf(r)):this.rows[t].get(r)}getNum(t,r){return this.rows[t].getNum(r)}getString(t,r){return this.rows[t].getString(r)}getObject(t){let r,n={};for(let i=0;i<this.rows.length;i++)if(r=this.rows[i].obj,"string"==typeof t)if(this.columns.indexOf(t)>=0)n[r[t]]=r;else throw Error(`This table has no column named "${t}"`);else n[i]=this.rows[i].obj;return n}getArray(){let t=[];for(let r=0;r<this.rows.length;r++)t.push(this.rows[r].arr);return t}}function uM(t,r){t.Table=uk}"undefined"!=typeof p5&&uM(p5,p5.prototype);class uB{constructor(t=[]){this.arr=t,this.obj=Object.fromEntries(t.entries()),this.table=null}set(t,r){if("string"==typeof t){let n=this.table.columns.indexOf(t);if(n>=0)this.obj[t]=r,this.arr[n]=r;else throw Error(`This table has no column named "${t}"`)}else if(t<this.table.columns.length){this.arr[t]=r;let n=this.table.columns[t];this.obj[n]=r}else throw Error(`Column #${t} is out of the range of this table`)}setNum(t,r){let n=parseFloat(r);this.set(t,n)}setString(t,r){let n=r.toString();this.set(t,n)}get(t){return"string"==typeof t?this.obj[this.table.columns.indexOf(t)]:this.arr[t]}getNum(t){let r;if("NaN"===(r="string"==typeof t?parseFloat(this.obj[this.table.columns.indexOf(t)]):parseFloat(this.arr[t])).toString())throw`Error: ${this.obj[t]} is NaN (Not a Number)`;return r}getString(t){return"string"==typeof t?this.obj[this.table.columns.indexOf(t)].toString():this.arr[t].toString()}}function uL(t,r){t.TableRow=uB}function uR(t,r){r.abs=Math.abs,r.ceil=Math.ceil,r.constrain=function(t,r,n){return Math.max(Math.min(t,n),r)},r.dist=function(...t){return 4===t.length?Math.hypot(t[2]-t[0],t[3]-t[1]):6===t.length?Math.hypot(t[3]-t[0],t[4]-t[1],t[5]-t[2]):void 0},r.exp=Math.exp,r.floor=Math.floor,r.lerp=function(t,r,n){return n*(r-t)+t},r.log=Math.log,r.mag=function(t,r){return Math.hypot(t,r)},r.map=function(t,r,n,i,s,o){let a=(t-r)/(n-r)*(s-i)+i;return o?i<s?this.constrain(a,i,s):this.constrain(a,s,i):a},r.max=function(...t){let r=t=>{let r=-1/0;for(let n of t)r=Math.max(r,n);return r};return r(t[0]instanceof Array?t[0]:t)},r.min=function(...t){let r=t=>{let r=1/0;for(let n of t)r=Math.min(r,n);return r};return r(t[0]instanceof Array?t[0]:t)},r.norm=function(t,r,n){return this.map(t,r,n,0,1)},r.pow=Math.pow,r.round=function(t,r){if(!r)return Math.round(t);let n=Math.pow(10,r);return Math.round(t*n)/n},r.sq=t=>t*t,r.sqrt=Math.sqrt,r.fract=function(t){let r=0,n=Number(t);if(isNaN(n)||Math.abs(n)===1/0)return n;if(n<0&&(n=-n,r=1),String(n).includes(".")&&!String(n).includes("e")){let t=String(n);return Math.abs(r-(t=Number("0"+t.slice(t.indexOf(".")))))}return n<1?Math.abs(r-n):0}}function uP(t,r){let n,i=4,s=.5,o=t=>.5*(1-Math.cos(t*Math.PI));r.noise=function(t,r=0,a=0){let l,u,h,c,d;if(null==n){n=Array(4096);for(let t=0;t<4096;t++)n[t]=Math.random()}t<0&&(t=-t),r<0&&(r=-r),a<0&&(a=-a);let p=Math.floor(t),f=Math.floor(r),m=Math.floor(a),g=t-p,y=r-f,v=a-m,b=0,x=.5;for(let t=0;t<i;t++){let t=p+(f<<4)+(m<<8);l=o(g),u=o(y),h=n[4095&t],h+=l*(n[t+1&4095]-h),c=n[t+16&4095],c+=l*(n[t+16+1&4095]-c),h+=u*(c-h),t+=256,c=n[4095&t],c+=l*(n[t+1&4095]-c),d=n[t+16&4095],d+=l*(n[t+16+1&4095]-d),c+=u*(d-c),h+=o(v)*(c-h),b+=h*x,x*=s,p<<=1,f<<=1,y*=2,m<<=1,v*=2,(g*=2)>=1&&(p++,g--),y>=1&&(f++,y--),v>=1&&(m++,v--)}return b},r.noiseDetail=function(t,r=.5){t>0&&(i=t),r>0&&(s=r)},r._getNoiseOctaves=function(){return i},r._getNoiseAmpFalloff=function(){return s},r.noiseSeed=function(t){let r,i,s={setSeed(t){i=r=(null==t?0x100000000*Math.random():t)>>>0},getSeed:()=>r,rand:()=>(i=(1664525*i+0x3c6ef35f)%0x100000000)/0x100000000};s.setSeed(t),n=Array(4096);for(let t=0;t<4096;t++)n[t]=s.rand()}}function uz(t,r){let n="_lcg_random_state",i=0;r._lcg=function(t){return this[t]=(1664525*this[t]+0x3c6ef35f)%0x100000000,this[t]/0x100000000},r._lcgSetSeed=function(t,r){this[t]=(null==r?0x100000000*Math.random():r)>>>0},r.randomSeed=function(t){this._lcgSetSeed(n,t),this._gaussian_previous=!1},r.random=function(t,r){let i;if(i=null!=this[n]?this._lcg(n):Math.random(),void 0===t)return i;if(void 0===r)if(t instanceof Array)return t[Math.floor(i*t.length)];else return i*t;if(t>r){let n=t;t=r,r=n}return i*(r-t)+t},r.randomGaussian=function(t,r=1){let n,s,o,a;if(this._gaussian_previous)n=i,this._gaussian_previous=!1;else{do a=(s=this.random(2)-1)*s+(o=this.random(2)-1)*o;while(a>=1);n=s*(a=Math.sqrt(-2*Math.log(a)/a)),i=o*a,this._gaussian_previous=!0}return n*r+(t||0)}}function uU(t,r){r.createVector=function(r,n,i){return(0==arguments.length&&t._friendlyError("In 1.x, createVector() was a shortcut for createVector(0, 0, 0). In 2.x, p5.js has vectors of any dimension, so you must provide your desired number of zeros. Use createVector(0, 0) for a 2D vector and createVector(0, 0, 0) for a 3D vector."),this instanceof t)?new t.Vector(this._fromRadians.bind(this),this._toRadians.bind(this),...arguments):new t.Vector(r,n,i)},r.createMatrix=function(...r){return new t.Matrix(...r)}}function u$(t,r){r.float=function(t){return t instanceof Array?t.map(parseFloat):parseFloat(t)},r.int=function(t,n=10){if(t===1/0||"Infinity"===t)return 1/0;if(t===-1/0||"-Infinity"===t)return-1/0;if("string"==typeof t)return parseInt(t,n);if("number"==typeof t)return 0|t;if("boolean"==typeof t)return+!!t;else if(t instanceof Array)return t.map(t=>r.int(t,n))},r.str=function(t){return t instanceof Array?t.map(r.str):String(t)},r.boolean=function(t){return"number"==typeof t?0!==t:"string"==typeof t?"true"===t.toLowerCase():"boolean"==typeof t?t:t instanceof Array?t.map(r.boolean):void 0},r.byte=function(t){let n=r.int(t,10);return"number"==typeof n?(n+128)%256-128:n instanceof Array?n.map(r.byte):void 0},r.char=function(t){return"number"!=typeof t||isNaN(t)?t instanceof Array?t.map(r.char):"string"==typeof t?r.char(parseInt(t,10)):void 0:String.fromCharCode(t)},r.unchar=function(t){return"string"==typeof t&&1===t.length?t.charCodeAt(0):t instanceof Array?t.map(r.unchar):void 0},r.hex=function(t,n){if(n=null==n?n=8:n,t instanceof Array)return t.map(t=>r.hex(t,n));
43if(t===1/0||t===-1/0)return(t===1/0?"F":"0").repeat(n);if("number"==typeof t){t<0&&(t=0xffffffff+t+1);let r=Number(t).toString(16).toUpperCase();for(;r.length<n;)r=`0${r}`;return r.length>=n&&(r=r.substring(r.length-n,r.length)),r}},r.unhex=function(t){return t instanceof Array?t.map(r.unhex):parseInt(`0x${t}`,16)}}function uj(t,r){function n(t,r,n){let i=t<0,[s,o]=(t=Math.abs(t)).toString().split(".");if(void 0===n){s=s.padStart(r,"0");let t=o?s+"."+o:s;return i?"-"+t:t}{let a=t.toFixed(n);[s,o]=a.toString().split("."),s=s.padStart(r,"0");let l=void 0===o?s:s+"."+o;return i?"-"+l:l}}function i(t,r){let n=(t=t.toString()).indexOf("."),i=-1!==n?t.substring(n):"",s=-1!==n?t.substring(0,n):t;if(s=s.toString().replace(/\B(?=(\d{3})+(?!\d))/g,","),0===r)i="";else if(void 0!==r)if(r>i.length){let t=r-(i+=-1===n?".":"").length+1;for(let r=0;r<t;r++)i+="0"}else i=i.substring(0,r+1);return s+i}function s(t){return parseFloat(t)>0?`+${t.toString()}`:t.toString()}function o(t){return parseFloat(t)>=0?` ${t.toString()}`:t.toString()}r.nf=function(t,r,i){return t instanceof Array?t.map(t=>n(t,r,i)):"[object Arguments]"!==Object.prototype.toString.call(t)?n(t,r,i):3===t.length?this.nf(t[0],t[1],t[2]):2===t.length?this.nf(t[0],t[1]):this.nf(t[0])},r.nfc=function(t,r){return t instanceof Array?t.map(t=>i(t,r)):i(t,r)},r.nfp=function(...t){let n=r.nf.apply(this,t);return n instanceof Array?n.map(s):s(n)},r.nfs=function(...t){let n=r.nf.apply(this,t);return n instanceof Array?n.map(o):o(n)},r.splitTokens=function(t,r){let n;if(void 0!==r){let t=r,i=/\]/g.exec(t),s=/\[/g.exec(t);s&&i?(t=t.slice(0,i.index)+t.slice(i.index+1),s=/\[/g.exec(t),t=t.slice(0,s.index)+t.slice(s.index+1),n=RegExp(`[\\[${t}\\]]`,"g")):i?(t=t.slice(0,i.index)+t.slice(i.index+1),n=RegExp(`[${t}\\]]`,"g")):s?(t=t.slice(0,s.index)+t.slice(s.index+1),n=RegExp(`[${t}\\[]`,"g")):n=RegExp(`[${t}]`,"g")}else n=/\s/g;return t.split(n).filter(t=>t)},r.shuffle=function(t,r){let n=ArrayBuffer&&ArrayBuffer.isView&&ArrayBuffer.isView(t),i,s,o=(t=r||n?t
43:t.slice()).length;for(;o>1;)i=this.random(0,1)*o|0,s=t[--o],t[o]=t[i],t[i]=s;return t}}function uV(t,r){r.day=function(){return new Date().getDate()},r.hour=function(){return new Date().getHours()},r.minute=function(){return new Date().getMinutes()},r.millis=function(){return -1===this._millisStart?0:window.performance.now()-this._millisStart},r.month=function(){return new Date().getMonth()+1},r.second=function(){return new Date().getSeconds()},r.year=function(){return new Date().getFullYear()}}function uG(t,r){r.orbitControl=function(t,r,n,i){this._assert3d("orbitControl");let s=this._renderer.states.curCamera;void 0===t&&(t=1),void 0===r&&(r=t),void 0===n&&(n=1),"object"!=typeof i&&(i={}),!0!==this.contextMenuDisabled&&(this.canvas.oncontextmenu=()=>!1,this.contextMenuDisabled=!0),!0!==this.wheelDefaultDisabled&&(this.canvas.onwheel=()=>!1,this.wheelDefaultDisabled=!0);let{disableTouchActions:o=!0}=i;!0!==this.touchActionsDisabled&&o&&(this.canvas.style["touch-action"]="none",this.touchActionsDisabled=!0);let{freeRotation:a=!1}=i,l=[];this.touches.forEach(t=>{this._renderer.prevTouches.forEach(r=>{if(t.id===r.id){let n={x:t.x,y:t.y,px:r.x,py:r.y};l.push(n)}})}),this._renderer.prevTouches=this.touches;let u=0,h=0,c=0,d=0,p=0,f=this.height<this.width?this.height:this.width,m=!1;if(l.length>0){if(m=l[0].x>0&&l[0].x<this.width&&l[0].y>0&&l[0].y<this.height,1===l.length){let n=l[0];h=-t*(n.x-n.px)/f,c=r*(n.y-n.py)/f}else{let t=l[0],r=l[1],i=Math.hypot(t.x-r.x,t.y-r.y);u=-(i-Math.hypot(t.px-r.px,t.py-r.py))*n*4e-4,d=.5*(t.x+r.x)-.5*(t.px+r.px),p=.5*(t.y+r.y)-.5*(t.py+r.py)}this.touches.length>0?m&&(this._renderer.executeRotateAndMove=!0,this._renderer.executeZoom=!0):(this._renderer.executeRotateAndMove=!1,this._renderer.executeZoom=!1)}else m=this.mouseX>0&&this.mouseX<this.width&&this.mouseY>0&&this.mouseY<this.height,0!==this._mouseWheelDeltaY?(u=Math.sign(this._mouseWheelDeltaY)*n*.01,this._mouseWheelDeltaY=0,m&&(this._renderer.executeZoom=!0)):this._renderer.executeZoom=!1,this.mouseIsPressed?(this.mouseButton.left?(h=-t*this.movedX/f,c=r*this.movedY/f):this.mouseButton.right&&(d=this.movedX,p=this.movedY*s.yScale),m&&(this._renderer.executeRotateAndMove=!0)):this._renderer.executeRotateAndMove=!1;if(0!==u&&this._renderer.executeZoom&&(this._renderer.zoomVelocity+=u),Math.abs(this._renderer.zoomVelocity)>.001?(a?s._orbitFree(0,0,this._renderer.zoomVelocity):s._orbit(0,0,this._renderer.zoomVelocity),0!==s.projMatrix.mat4[15]&&(s.projMatrix.mat4[0]*=Math.pow(10,-this._renderer.zoomVelocity),s.projMatrix.mat4[5]*=Math.pow(10,-this._renderer.zoomVelocity),this._renderer.states.setValue("uPMatrix",this._renderer.states.uPMatrix.clone()),this._renderer.states.uPMatrix.mat4[0]=s.projMatrix.mat4[0],this._renderer.states.uPMatrix.mat4[5]=s.projMatrix.mat4[5]),this._renderer.zoomVelocity*=.85):this._renderer.zoomVelocity=0,(0!==h||0!==c)&&this._renderer.executeRotateAndMove&&this._renderer.rotateVelocity.add(.6*h,.6*c),this._renderer.rotateVelocity.magSq()>1e-6?(a?s._orbitFree(-this._renderer.rotateVelocity.x,this._renderer.rotateVelocity.y,0):s._orbit(this._renderer.rotateVelocity.x,this._renderer.rotateVelocity.y,0),this._renderer.rotateVelocity.mult(.85)):this._renderer.rotateVelocity.set(0,0),(0!==d||0!==p)&&this._renderer.executeRotateAndMove){let t=2*d/this.width,r=-(2*p)/this.height;this._renderer.moveVelocity.add(.15*t,.15*r)}if(this._renderer.moveVelocity.magSq()>1e-6){let t,r,n=s._getLocalAxes(),i=s.eyeX-s.centerX,o=s.eyeY-s.centerY,a=s.eyeZ-s.centerZ,l=Math.sqrt(i*i+o*o+a*a),u=new eM.M(s.centerX,s.centerY,s.centerZ);u=s.cameraMatrix.multiplyPoint(u),u=this._renderer.states.uPMatrix.multiplyAndNormalizePoint(u),u.x-=this._renderer.moveVelocity.x,u.y-=this._renderer.moveVelocity.y;let h=this._renderer.states.uPMatrix.mat4;0===h[15]?(t=(h[8]+u.x)/h[0]*l,r=(h[9]+u.y)/h[5]*l):(t=(u.x-h[12])/h[0],r=(u.y-h[13])/h[5]),s.setPosition(s.eyeX+t*n.x[0]+r*n.y[0],s.eyeY+t*n.x[1]+r*n.y[1],s.eyeZ+t*n.x[2]+r*n.y[2]),this._renderer.moveVelocity.mult(.85)}else this._renderer.moveVelocity.set(0,0);return this},r.debugMode=function(...r){this._assert3d("debugMode");for(let r=t.lifecycleHooks.postdraw.length-1;r>=0;r--)(t.lifecycleHooks.postdraw[r].toString()===this._grid().toString()||t.lifecycleHooks.postdraw[r].toString()===this._axesIcon().toString())&&t.lifecycleHooks.postdraw.splice(r,1);r[0]===d.G?t.lifecycleHooks.postdraw.push(this._grid(r[1],r[2],r[3],r[4],r[5])):r[0]===d.i?t.lifecycleHooks.postdraw.push(this._axesIcon(r[1],r[2],r[3],r[4])):(t.lifecycleHooks.postdraw.push(this._grid(r[0],r[1],r[2],r[3],r[4])),t.lifecycleHooks.postdraw.push(this._axesIcon(r[5],r[6],r[7],r[8])))},r.noDebugMode=function(){this._assert3d("noDebugMode");for(let r=t.lifecycleHooks.postdraw.length-1;r>=0;r--)(t.lifecycleHooks.postdraw[r].toString()===this._grid().toString()||t.lifecycleHooks.postdraw[r].toString()===this._axesIcon().toString())&&t.lifecycleHooks.postdraw.splice(r,1)},r._grid=function(t,r,n,i,s){void 0===t&&(t=this.width/2),void 0===r&&(r=4>Math.round(t/30)?4:Math.round(t/30)),void 0===n&&(n=0),void 0===i&&(i=0),void 0===s&&(s=0);let o=t/r,a=t/2;return function(){this.push(),this.stroke(255*this._renderer.states.curStrokeColor[0],255*this._renderer.states.curStrokeColor[1],255*this._renderer.states.curStrokeColor[2]),this._renderer.states.setValue("uModelMatrix",this._renderer.states.uModelMatrix.clone()),this._renderer.states.uModelMatrix.reset();for(let t=0;t<=r;t++)this.beginShape(this.LINES),this.vertex(-a+n,i,t*o-a+s),this.vertex(+a+n,i,t*o-a+s),this.endShape();for(let t=0;t<=r;t++)this.beginShape(this.LINES),this.vertex(t*o-a+n,i,-a+s),this.vertex(t*o-a+n,i,+a+s),this.endShape();this.pop()}},r._axesIcon=function(t,r,n,i){return void 0===t&&(t=this.width/20>40?this.width/20:40),void 0===r&&(r=-this.width/4),void 0===n&&(n=r),void 0===i&&(i=r),()=>{this.push(),this._renderer.states.setValue("uModelMatrix",this._renderer.states.uModelMatrix.clone()),this._renderer.states.uModelMatrix.reset(),this.strokeWeight(2),this.stroke(255,0,0),this.beginShape(this.LINES),this.vertex(r,n,i),this.vertex(r+t,n,i),this.endShape(),this.stroke(0,255,0),this.beginShape(this.LINES),this.vertex(r,n,i),this.vertex(r,n+t,i),this.endShape(),this.stroke(0,0,255),this.beginShape(this.LINES),this.vertex(r,n,i),this.vertex(r,n,i+t),this.endShape(),this.pop()}}}async function uH(t){try{return(await fetch(t,{method:"HEAD"})).ok}catch(t){return!1}}function uq(t,r){async function n(t){let r=null,n={},{data:i}=await (0,g.a)(t,"text"),s=i.split("\n");for(let t=0;t<s.length;++t){let i=s[t].trim().split(/\s+/);"newmtl"===i[0]?n[r=i[1]]={}:"Kd"===i[0]?n[r].diffuseColor=[parseFloat(i[1]),parseFloat(i[2]),parseFloat(i[3])]:"Ka"===i[0]?n[r].ambientColor=[parseFloat(i[1]),parseFloat(i[2]),parseFloat(i[3])]:"Ks"===i[0]?n[r].specularColor=[parseFloat(i[1]),parseFloat(i[2]),parseFloat(i[3])]:"map_Kd"===i[0]&&(n[r].texturePath=i[1])}return n}function i(t,r,n={}){let s={v:[],vt:[],vn:[]},o={},a=null,l=!1,u=!1;for(let i=0;i<r.length;++i){let h=r[i].trim().split(/\b\s+/);if(h.length>
430){if("usemtl"===h[0])a=h[1];else if("v"===h[0]||"vn"===h[0]){let t=new eM.M(parseFloat(h[1]),parseFloat(h[2]),parseFloat(h[3]));s[h[0]].push(t)}else if("vt"===h[0]){let t=[parseFloat(h[1]),1-parseFloat(h[2])];s[h[0]].push(t)}else if("f"===h[0])for(let r=3;r<h.length;++r){let i=[],c=[1,r-1,r];for(let r=0;r<c.length;++r){let d=h[c[r]],p=d.split("/");for(let t=0;t<p.length;t++){let r=parseInt(p[t]);r>0&&(r-=1),p[t]=r}if(o[d]||(o[d]={}),void 0===o[d][a]){let r=t.vertices.length;if(t.vertices.push(s.v.at(p[0]).copy()),t.uvs.push(s.vt.at(p[1])?s.vt.at(p[1]).slice():[0,0]),t.vertexNormals.push(s.vn.at(p[2])?s.vn.at(p[2]).copy():new eM.M),o[d][a]=r,i.push(r),a&&n[a]&&n[a].diffuseColor){l=!0;let r=n[a].diffuseColor;t.vertexColors.push(r[0]),t.vertexColors.push(r[1]),t.vertexColors.push(r[2]),t.vertexColors.push(1)}else u=!0}else i.push(o[d][a])}i[0]!==i[1]&&i[0]!==i[2]&&i[1]!==i[2]&&t.faces.push(i)}}}if(0===t.vertexNormals.length&&t.computeNormals(),l===u)throw Error("Model coloring is inconsistent. Either all vertices should have colors or none should.");return t}function s(t,r){if(function(t){let r=new DataView(t),n=[115,111,108,105,100];for(let t=0;t<5;t++)if(function(t,r,n){for(let i=0,s=t.length;i<s;i++)if(t[i]!==r.getUint8(n+i,!1))return!1;return!0}(n,r,t))return!1;return!0}(r))!function(t,r){let n,i,s,o=new DataView(r),a=o.getUint32(80,!0),l,u,h,c=!1,d;for(let t=0;t<70;t++)0x434f4c4f===o.getUint32(t,!1)&&82===o.getUint8(t+4)&&61===o.getUint8(t+5)&&(c=!0,d=[],n=o.getUint8(t+6)/255,i=o.getUint8(t+7)/255,s=o.getUint8(t+8)/255);for(let r=0;r<a;r++){let a=84+50*r,p=o.getFloat32(a,!0),f=o.getFloat32(a+4,!0),m=o.getFloat32(a+8,!0);if(c){let t=o.getUint16(a+48,!0);(32768&t)==0?(l=(31&t)/31,u=(t>>5&31)/31,h=(t>>10&31)/31):(l=n,u=i,h=s)}let g=new eM.M(p,f,m);for(let r=1;r<=3;r++){let n=a+12*r,i=new eM.M(o.getFloat32(n,!0),o.getFloat32(n+4,!0),o.getFloat32(n+8,!0));t.vertices.push(i),t.vertexNormals.push(g),c&&d.push(l,u,h)}t.faces.push([3*r,3*r+1,3*r+2]),t.uvs.push([0,0],[0,0],[0,0])}}(t,r);else{let n=new DataView(r);if(!("TextDecoder"in window))return console.warn("Sorry, ASCII STL loading only works in browsers that support TextDecoder (https://caniuse.com/#feat=textencoder)"),t;!function(t,r){let n,i,s="",o=[];for(let a=0;a<r.length;++a){let l=r[a].trim(),u=l.split(" ");for(let t=0;t<u.length;++t)""===u[t]&&u.splice(t,1);if(0!==u.length)switch(s){case"":if("solid"!==u[0]){console.error(l),console.error(`Invalid state "${u[0]}", should be "solid"`);return}s="solid";break;case"solid":if("facet"!==u[0]||"normal"!==u[1]){console.error(l),console.error(`Invalid state "${u[0]}", should be "facet normal"`);return}n=new eM.M(parseFloat(u[2]),parseFloat(u[3]),parseFloat(u[4])),t.vertexNormals.push(n,n,n),s="facet normal";break;case"facet normal":if("outer"!==u[0]||"loop"!==u[1]){console.error(l),console.error(`Invalid state "${u[0]}", should be "outer loop"`);return}s="vertex";break;case"vertex":if("vertex"===u[0])i=new eM.M(parseFloat(u[1]),parseFloat(u[2]),parseFloat(u[3])),t.vertices.push(i),t.uvs.push([0,0]),o.push(t.vertices.indexOf(i));else if("endloop"===u[0])t.faces.push(o),o=[],s="endloop";else{console.error(l),console.error(`Invalid state "${u[0]}", should be "vertex" or "endloop"`);return}break;case"endloop":if("endfacet"!==u[0]){console.error(l),console.error(`Invalid state "${u[0]}", should be "endfacet"`);return}s="endfacet";break;case"endfacet":if("endsolid"===u[0]);else if("facet"===u[0]&&"normal"===u[1])n=new eM.M(parseFloat(u[2]),parseFloat(u[3]),parseFloat(u[4])),t.vertexNormals.push(n,n,n),s="facet normal";else{console.error(l),console.error(`Invalid state "${u[0]}", should be "endsolid" or "facet normal"`);return}break;default:console.error(`Invalid state "${s}"`)}}}(t,new TextDecoder("utf-8").decode(n).split("\n"))}return t}r.loadModel=async function(r,o,a,l,u){let h=!1,c=!1;"object"==typeof o?(a=o.normalize||!1,l=o.successCallback,u=o.failureCallback,h=(o=o.fileType||o).flipU||!1,c=o.flipV||!1):("function"==typeof arguments[arguments.length-1]&&("function"==typeof arguments[arguments.length-2]?(l=arguments[arguments.length-2],u=arguments[arguments.length-1]):l=arguments[arguments.length-1]),"string"==typeof o?"boolean"!=typeof a&&(a=!1):"boolean"==typeof o?(a=o,o=r.slice(-4)):(o=r.slice(-4),a=!1)),".obj"!==o.toLowerCase()&&".stl"!==o.toLowerCase()&&(o=".obj");let d=new eB.V(void 0,void 0,void 0,this._renderer);async function p(t){let i=[];for(let s of t){let t=s.match(/^mtllib (.+)/);if(t){let s="",o=t[1],a=r.split("/");a.length>1?(a.pop(),s=a.join("/")+"/"+o):s=o,i.push(uH(s).then(t=>t?n(s):(console.warn(`MTL file not found or error in parsing; proceeding without materials: ${s}`),{})).catch(t=>(console.warn(`Error loading MTL file: ${s}`,t),{})))}}try{let t=await Promise.all(i);return Object.assign({},...t)}catch(t){return{}}}d.gid=`${r}|${a}`;try{if(o.match(/\.stl$/i)){let{data:t}=await (0,g.a)(r,"arrayBuffer"),n=()=>(s(d,t),a&&d.normalize(),h&&d.flipU(),c&&d.flipV(),d._makeTriangleEdges(),l)?l(d):d;return this._internal?this._internal(n):n()}if(o.match(/\.obj$/i)){let{data:t}=await (0,g.a)(r,"text"),n=t.split("\n"),s=await p(n),o=()=>(i(d,n,s),a&&d.normalize(),h&&d.flipU(),c&&d.flipV(),d._makeTriangleEdges(),l)?l(d):d;return this._internal?this._internal(o):o()}}catch(n){if(t._friendlyFileLoadError(3,r),u)return u(n);throw n}},r.model=function(t,r=1){this._assert3d("model"),this._renderer.model(t,r)};let o=0;r.createModel=function(r,n=" ",a){let l,u,h=!1,c=!1,d=!1;a&&"object"==typeof a?(h=a.normalize||!1,l=a.successCallback,u=a.failureCallback,c=a.flipU||!1,d=a.flipV||!1):"boolean"==typeof a?(h=a,l=arguments[3],u=arguments[4]):(l="function"==typeof arguments[2]?arguments[2]:void 0,u=arguments[3]);let p=new t.Geometry;if(p.gid=`${n}|${h}|${o++}`,n.match(/\.stl$/i))try{let t=new TextEncoder().encode(r).buffer;s(p,t)}catch(r){u?u(r):t._friendlyError("Error during parsing: "+r.message);return}else if(n.match(/\.obj$/i))try{let t=r.split("\n");
43i(p,t)}catch(r){u?u(r):t._friendlyError("Error during parsing: "+r.message);return}else t._friendlyFileLoadError(3,r),u?u():t._friendlyError("Sorry, the file type is invalid. Only OBJ and STL files are supported.");return h&&p.normalize(),c&&p.flipU(),d&&p.flipV(),p._makeTriangleEdges(),"function"==typeof l&&l(p),p}}"undefined"!=typeof p5&&uL(p5,p5.prototype),"undefined"!=typeof p5&&uR(p5,p5.prototype),"undefined"!=typeof p5&&uP(p5,p5.prototype),"undefined"!=typeof p5&&uz(p5,p5.prototype),"undefined"!=typeof p5&&uU(p5,p5.prototype),"undefined"!=typeof p5&&u$(p5,p5.prototype),"undefined"!=typeof p5&&uj(p5,p5.prototype),"undefined"!=typeof p5&&uV(p5,p5.prototype),"undefined"!=typeof p5&&uG(p5,p5.prototype),"undefined"!=typeof p5&&uq(p5,p5.prototype);var uW=n(59745);let uZ
vendor: 9,406 bytes, line 43
43=[{category:"control character",hexrange:["0000","001f"]},{category:"basic latin",hexrange:["0000","007f"]},{category:"latin-1 supplement",hexrange:["0080","00ff"]},{category:"latin extended-a",hexrange:["0100","017f"]},{category:"latin extended-b",hexrange:["0180","024f"]},{category:"ipa extensions",hexrange:["0250","02af"]},{category:"spacing modifier letters",hexrange:["02b0","02ff"]},{category:"combining diacritical marks",hexrange:["0300","036f"]},{category:"greek and coptic",hexrange:["0370","03ff"]},{category:"cyrillic",hexrange:["0400","04ff"]},{category:"cyrillic supplement",hexrange:["0500","052f"]},{category:"armenian",hexrange:["0530","058f"]},{category:"hebrew",hexrange:["0590","05ff"]},{category:"arabic",hexrange:["0600","06ff"]},{category:"syriac",hexrange:["0700","074f"]},{category:"arabic supplement",hexrange:["0750","077f"]},{category:"thaana",hexrange:["0780","07bf"]},{category:"nko",hexrange:["07c0","07ff"]},{category:"samaritan",hexrange:["0800","083f"]},{category:"mandaic",hexrange:["0840","085f"]},{category:"syriac supplement",hexrange:["0860","086f"]},{category:"arabic extended-b",hexrange:["0870","089f"]},{category:"arabic extended-a",hexrange:["08a0","08ff"]},{category:"devanagari",hexrange:["0900","097f"]},{category:"bengali",hexrange:["0980","09ff"]},{category:"gurmukhi",hexrange:["0a00","0a7f"]},{category:"gujarati",hexrange:["0a80","0aff"]},{category:"oriya",hexrange:["0b00","0b7f"]},{category:"tamil",hexrange:["0b80","0bff"]},{category:"telugu",hexrange:["0c00","0c7f"]},{category:"kannada",hexrange:["0c80","0cff"]},{category:"malayalam",hexrange:["0d00","0d7f"]},{category:"sinhala",hexrange:["0d80","0dff"]},{category:"thai",hexrange:["0e00","0e7f"]},{category:"lao",hexrange:["0e80","0eff"]},{category:"tibetan",hexrange:["0f00","0fff"]},{category:"myanmar",hexrange:["1000","109f"]},{category:"georgian",hexrange:["10a0","10ff"]},{category:"hangul jamo",hexrange:["1100","11ff"]},{category:"ethiopic",hexrange:["1200","137f"]},{category:"ethiopic supplement",hexrange:["1380","139f"]},{category:"cherokee",hexrange:["13a0","13ff"]},{category:"unified canadian aboriginal syllabics",hexrange:["1400","167f"]},{category:"ogham",hexrange:["1680","169f"]},{category:"runic",hexrange:["16a0","16ff"]},{category:"tagalog",hexrange:["1700","171f"]},{category:"hanunoo",hexrange:["1720","173f"]},{category:"buhid",hexrange:["1740","175f"]},{category:"tagbanwa",hexrange:["1760","177f"]},{category:"khmer",hexrange:["1780","17ff"]},{category:"mongolian",hexrange:["1800","18af"]},{category:"unified canadian aboriginal syllabics extended",hexrange:["18b0","18ff"]},{category:"limbu",hexrange:["1900","194f"]},{category:"tai le",hexrange:["1950","197f"]},{category:"new tai lue",hexrange:["1980","19df"]},{category:"khmer symbols",hexrange:["19e0","19ff"]},{category:"buginese",hexrange:["1a00","1a1f"]},{category:"tai tham",hexrange:["1a20","1aaf"]},{category:"combining diacritical marks extended",hexrange:["1ab0","1aff"]},{category:"balinese",hexrange:["1b00","1b7f"]},{category:"sundanese",hexrange:["1b80","1bbf"]},{category:"batak",hexrange:["1bc0","1bff"]},{category:"lepcha",hexrange:["1c00","1c4f"]},{category:"ol chiki",hexrange:["1c50","1c7f"]},{category:"cyrillic extended-c",hexrange:["1c80","1c8f"]},{category:"georgian extended",hexrange:["1c90","1cbf"]},{category:"sundanese supplement",hexrange:["1cc0","1ccf"]},{category:"vedic extensions",hexrange:["1cd0","1cff"]},{category:"phonetic extensions",hexrange:["1d00","1d7f"]},{category:"phonetic extensions supplement",hexrange:["1d80","1dbf"]},{category:"combining diacritical marks supplement",hexrange:["1dc0","1dff"]},{category:"latin extended additional",hexrange:["1e00","1eff"]},{category:"greek extended",hexrange:["1f00","1fff"]},{category:"general punctuation",hexrange:["2000","206f"]},{category:"superscripts and subscripts",hexrange:["2070","209f"]},{category:"currency symbols",hexrange:["20a0","20cf"]},{category:"combining diacritical marks for symbols",hexrange:["20d0","20ff"]},{category:"letterlike symbols",hexrange:["2100","214f"]},{category:"number forms",hexrange:["2150","218f"]},{category:"arrows",hexrange:["2190","21ff"]},{category:"mathematical operators",hexrange:["2200","22ff"]},{category:"miscellaneous technical",hexrange:["2300","23ff"]},{category:"control pictures",hexrange:["2400","243f"]},{category:"optical character recognition",hexrange:["2440","245f"]},{category:"enclosed alphanumerics",hexrange:["2460","24ff"]},{category:"box drawing",hexrange:["2500","257f"]},{category:"block elements",hexrange:["2580","259f"]},{category:"geometric shapes",hexrange:["25a0","25ff"]},{category:"miscellaneous symbols",hexrange:["2600","26ff"]},{category:"dingbats",hexrange:["2700","27bf"]},{category:"miscellaneous mathematical symbols-a",hexrange:["27c0","27ef"]},{category:"supplemental arrows-a",hexrange:["27f0","27ff"]},{category:"braille patterns",hexrange:["2800","28ff"]},{category:"supplemental arrows-b",hexrange:["2900","297f"]},{category:"miscellaneous mathematical symbols-b",hexrange:["2980","29ff"]},{category:"supplemental mathematical operators",hexrange:["2a00","2aff"]},{category:"miscellaneous symbols and arrows",hexrange:["2b00","2bff"]},{category:"glagolitic",hexrange:["2c00","2c5f"]},{category:"latin extended-c",hexrange:["2c60","2c7f"]},{category:"coptic",hexrange:["2c80","2cff"]},{category:"georgian supplement",hexrange:["2d00","2d2f"]},{category:"tifinagh",hexrange:["2d30","2d7f"]},{category:"ethiopic extended",hexrange:["2d80","2ddf"]},{category:"cyrillic extended-a",hexrange:["2de0","2dff"]},{category:"supplemental punctuation",hexrange:["2e00","2e7f"]},{category:"cjk radicals supplement",hexrange:["2e80","2eff"]},{category:"kangxi radicals",hexrange:["2f00","2fdf"]},{category:"ideographic description characters",hexrange:["2ff0","2fff"]},{category:"cjk symbols and punctuation",hexrange:["3000","303f"]},{category:"hiragana",hexrange:["3040","309f"]},{category:"katakana",hexrange:["30a0","30ff"]},{category:"bopomofo",hexrange:["3100","312f"]},{category:"hangul compatibility jamo",hexrange:["3130","318f"]},{category:"kanbun",hexrange:["3190","319f"]},{category:"bopomofo extended",hexrange:["31a0","31bf"]},{category:"cjk strokes",hexrange:["31c0","31ef"]},{category:"katakana phonetic extensions",hexrange:["31f0","31ff"]},{category:"enclosed cjk letters and months",hexrange:["3200","32ff"]},{category:"cjk compatibility",hexrange:["3300","33ff"]},{category:"cjk unified ideographs extension a",hexrange:["3400","4dbf"]},{category:"yijing hexagram symbols",hexrange:["4dc0","4dff"]},{category:"cjk unified ideographs",hexrange:["4e00","9fff"]},{category:"yi syllables",hexrange:["a000","a48f"]},{category:"yi radicals",hexrange:["a490","a4cf"]},{category:"lisu",hexrange:["a4d0","a4ff"]},{category:"vai",hexrange:["a500","a63f"]},{category:"cyrillic extended-b",hexrange:["a640","a69f"]},{category:"bamum",hexrange:["a6a0","a6ff"]},{category:"modifier tone letters",hexrange:["a700","a71f"]},{category:"latin extended-d",hexrange:["a720","a7ff"]},{category:"syloti nagri",hexrange:["a800","a82f"]},{category:"common indic number forms",hexrange:["a830","a83f"]},{category:"phags-pa",hexrange:["a840","a87f"]},{category:"saurashtra",hexrange:["a880","a8df"]},{category:"devanagari extended",hexrange:["a8e0","a8ff"]},{category:"kayah li",hexrange:["a900","a92f"]},{category:"rejang",hexrange:["a930","a95f"]},{category:"hangul jamo extended-a",hexrange:["a960","a97f"]},{category:"javanese",hexrange:["a980","a9df"]},{category:"myanmar extended-b",hexrange:["a9e0","a9ff"]},{category:"cham",hexrange:["aa00","aa5f"]},{category:"myanmar extended-a",hexrange:["aa60","aa7f"]},{category:"tai viet",hexrange:["aa80","aadf"]},{category:"meetei mayek extensions",hexrange:["aae0","aaff"]},{category:"ethiopic extended-a",hexrange:["ab00","ab2f"]},{category:"latin extended-e",hexrange:["ab30","ab6f"]},{category:"cherokee supplement",hexrange:["ab70","abbf"]},{category:"meetei mayek",hexrange:["abc0","abff"]},{category:"hangul syllables",hexrange:["ac00","d7af"]},{category:"hangul jamo extended-b",hexrange:["d7b0","d7ff"]},{category:"high surrogates",hexrange:["d800","db7f"]},{category:"high private use surrogates",hexrange:["db80","dbff"]},{category:"low surrogates",hexrange:["dc00","dfff"]},{category:"private use area",hexrange:["e000","f8ff"]},{category:"cjk compatibility ideographs",hexrange:["f900","faff"]},{category:"alphabetic presentation forms",hexrange:["fb00","fb4f"]},{category:"arabic presentation forms-a",hexrange:["fb50","fdff"]},{category:"variation selectors",hexrange:["fe00","fe0f"]},{category:"vertical forms",hexrange:["fe10","fe1f"]},{category:"combining half marks",hexrange:["fe20","fe2f"]},{category:"cjk compatibility forms",hexrange:["fe30","fe4f"]},{category:"small form variants",hexrange:["fe50","fe6f"]},{category:"arabic presentation forms-b",hexrange:["fe70","feff"]},{category:"halfwidth and fullwidth forms",hexrange:["ff00","ffef"]},{category:"specials",hexrange:["fff0","ffff"]},{category:"linear b syllabary",hexrange:["10000","1007f"]},{category:"linear b ideograms",hexrange:["10080","100ff"]},{category:"aegean numbers",hexrange:["10100","1013f"]},{category:"ancient greek numbers",hexrange:["10140","1018f"]},{category:"ancient symbols",hexrange:["10190","101cf"]},{category:"phaistos disc",hexrange:["101d0","101ff"]},{category:"lycian",hexrange:["10280","1029f"]}
vendor: 8,949 bytes, line 43
43,{category:"carian",hexrange:["102a0","102df"]},{category:"coptic epact numbers",hexrange:["102e0","102ff"]},{category:"old italic",hexrange:["10300","1032f"]},{category:"gothic",hexrange:["10330","1034f"]},{category:"old permic",hexrange:["10350","1037f"]},{category:"ugaritic",hexrange:["10380","1039f"]},{category:"old persian",hexrange:["103a0","103df"]},{category:"deseret",hexrange:["10400","1044f"]},{category:"shavian",hexrange:["10450","1047f"]},{category:"osmanya",hexrange:["10480","104af"]},{category:"osage",hexrange:["104b0","104ff"]},{category:"elbasan",hexrange:["10500","1052f"]},{category:"caucasian albanian",hexrange:["10530","1056f"]},{category:"vithkuqi",hexrange:["10570","105bf"]},{category:"linear a",hexrange:["10600","1077f"]},{category:"latin extended-f",hexrange:["10780","107bf"]},{category:"cypriot syllabary",hexrange:["10800","1083f"]},{category:"imperial aramaic",hexrange:["10840","1085f"]},{category:"palmyrene",hexrange:["10860","1087f"]},{category:"nabataean",hexrange:["10880","108af"]},{category:"hatran",hexrange:["108e0","108ff"]},{category:"phoenician",hexrange:["10900","1091f"]},{category:"lydian",hexrange:["10920","1093f"]},{category:"meroitic hieroglyphs",hexrange:["10980","1099f"]},{category:"meroitic cursive",hexrange:["109a0","109ff"]},{category:"kharoshthi",hexrange:["10a00","10a5f"]},{category:"old south arabian",hexrange:["10a60","10a7f"]},{category:"old north arabian",hexrange:["10a80","10a9f"]},{category:"manichaean",hexrange:["10ac0","10aff"]},{category:"avestan",hexrange:["10b00","10b3f"]},{category:"inscriptional parthian",hexrange:["10b40","10b5f"]},{category:"inscriptional pahlavi",hexrange:["10b60","10b7f"]},{category:"psalter pahlavi",hexrange:["10b80","10baf"]},{category:"old turkic",hexrange:["10c00","10c4f"]},{category:"old hungarian",hexrange:["10c80","10cff"]},{category:"hanifi rohingya",hexrange:["10d00","10d3f"]},{category:"rumi numeral symbols",hexrange:["10e60","10e7f"]},{category:"yezidi",hexrange:["10e80","10ebf"]},{category:"arabic extended-c",hexrange:["10ec0","10eff"]},{category:"old sogdian",hexrange:["10f00","10f2f"]},{category:"sogdian",hexrange:["10f30","10f6f"]},{category:"old uyghur",hexrange:["10f70","10faf"]},{category:"chorasmian",hexrange:["10fb0","10fdf"]},{category:"elymaic",hexrange:["10fe0","10fff"]},{category:"brahmi",hexrange:["11000","1107f"]},{category:"kaithi",hexrange:["11080","110cf"]},{category:"sora sompeng",hexrange:["110d0","110ff"]},{category:"chakma",hexrange:["11100","1114f"]},{category:"mahajani",hexrange:["11150","1117f"]},{category:"sharada",hexrange:["11180","111df"]},{category:"sinhala archaic numbers",hexrange:["111e0","111ff"]},{category:"khojki",hexrange:["11200","1124f"]},{category:"multani",hexrange:["11280","112af"]},{category:"khudawadi",hexrange:["112b0","112ff"]},{category:"grantha",hexrange:["11300","1137f"]},{category:"newa",hexrange:["11400","1147f"]},{category:"tirhuta",hexrange:["11480","114df"]},{category:"siddham",hexrange:["11580","115ff"]},{category:"modi",hexrange:["11600","1165f"]},{category:"mongolian supplement",hexrange:["11660","1167f"]},{category:"takri",hexrange:["11680","116cf"]},{category:"ahom",hexrange:["11700","1174f"]},{category:"dogra",hexrange:["11800","1184f"]},{category:"warang citi",hexrange:["118a0","118ff"]},{category:"dives akuru",hexrange:["11900","1195f"]},{category:"nandinagari",hexrange:["119a0","119ff"]},{category:"zanabazar square",hexrange:["11a00","11a4f"]},{category:"soyombo",hexrange:["11a50","11aaf"]},{category:"unified canadian aboriginal syllabics extended-a",hexrange:["11ab0","11abf"]},{category:"pau cin hau",hexrange:["11ac0","11aff"]},{category:"devanagari extended-a",hexrange:["11b00","11b5f"]},{category:"bhaiksuki",hexrange:["11c00","11c6f"]},{category:"marchen",hexrange:["11c70","11cbf"]},{category:"masaram gondi",hexrange:["11d00","11d5f"]},{category:"gunjala gondi",hexrange:["11d60","11daf"]},{category:"makasar",hexrange:["11ee0","11eff"]},{category:"kawi",hexrange:["11f00","11f5f"]},{category:"lisu supplement",hexrange:["11fb0","11fbf"]},{category:"tamil supplement",hexrange:["11fc0","11fff"]},{category:"cuneiform",hexrange:["12000","123ff"]},{category:"cuneiform numbers and punctuation",hexrange:["12400","1247f"]},{category:"early dynastic cuneiform",hexrange:["12480","1254f"]},{category:"cypro-minoan",hexrange:["12f90","12fff"]},{category:"egyptian hieroglyphs",hexrange:["13000","1342f"]},{category:"egyptian hieroglyph format controls",hexrange:["13430","1345f"]},{category:"anatolian hieroglyphs",hexrange:["14400","1467f"]},{category:"bamum supplement",hexrange:["16800","16a3f"]},{category:"mro",hexrange:["16a40","16a6f"]},{category:"tangsa",hexrange:["16a70","16acf"]},{category:"bassa vah",hexrange:["16ad0","16aff"]},{category:"pahawh hmong",hexrange:["16b00","16b8f"]},{category:"medefaidrin",hexrange:["16e40","16e9f"]},{category:"miao",hexrange:["16f00","16f9f"]},{category:"ideographic symbols and punctuation",hexrange:["16fe0","16fff"]},{category:"tangut",hexrange:["17000","187ff"]},{category:"tangut components",hexrange:["18800","18aff"]},{category:"khitan small script",hexrange:["18b00","18cff"]},{category:"tangut supplement",hexrange:["18d00","18d7f"]},{category:"kana extended-b",hexrange:["1aff0","1afff"]},{category:"kana supplement",hexrange:["1b000","1b0ff"]},{category:"kana extended-a",hexrange:["1b100","1b12f"]},{category:"small kana extension",hexrange:["1b130","1b16f"]},{category:"nushu",hexrange:["1b170","1b2ff"]},{category:"duployan",hexrange:["1bc00","1bc9f"]},{category:"shorthand format controls",hexrange:["1bca0","1bcaf"]},{category:"znamenny musical notation",hexrange:["1cf00","1cfcf"]},{category:"byzantine musical symbols",hexrange:["1d000","1d0ff"]},{category:"musical symbols",hexrange:["1d100","1d1ff"]},{category:"ancient greek musical notation",hexrange:["1d200","1d24f"]},{category:"kaktovik numerals",hexrange:["1d2c0","1d2df"]},{category:"mayan numerals",hexrange:["1d2e0","1d2ff"]},{category:"tai xuan jing symbols",hexrange:["1d300","1d35f"]},{category:"counting rod numerals",hexrange:["1d360","1d37f"]},{category:"mathematical alphanumeric symbols",hexrange:["1d400","1d7ff"]},{category:"sutton signwriting",hexrange:["1d800","1daaf"]},{category:"latin extended-g",hexrange:["1df00","1dfff"]},{category:"glagolitic supplement",hexrange:["1e000","1e02f"]},{category:"cyrillic extended-d",hexrange:["1e030","1e08f"]},{category:"nyiakeng puachue hmong",hexrange:["1e100","1e14f"]},{category:"toto",hexrange:["1e290","1e2bf"]},{category:"wancho",hexrange:["1e2c0","1e2ff"]},{category:"nag mundari",hexrange:["1e4d0","1e4ff"]},{category:"ethiopic extended-b",hexrange:["1e7e0","1e7ff"]},{category:"mende kikakui",hexrange:["1e800","1e8df"]},{category:"adlam",hexrange:["1e900","1e95f"]},{category:"indic siyaq numbers",hexrange:["1ec70","1ecbf"]},{category:"ottoman siyaq numbers",hexrange:["1ed00","1ed4f"]},{category:"arabic mathematical alphabetic symbols",hexrange:["1ee00","1eeff"]},{category:"mahjong tiles",hexrange:["1f000","1f02f"]},{category:"domino tiles",hexrange:["1f030","1f09f"]},{category:"playing cards",hexrange:["1f0a0","1f0ff"]},{category:"enclosed alphanumeric supplement",hexrange:["1f100","1f1ff"]},{category:"enclosed ideographic supplement",hexrange:["1f200","1f2ff"]},{category:"miscellaneous symbols and pictographs",hexrange:["1f300","1f5ff"]},{category:"emoticons (emoji)",hexrange:["1f600","1f64f"]},{category:"ornamental dingbats",hexrange:["1f650","1f67f"]},{category:"transport and map symbols",hexrange:["1f680","1f6ff"]},{category:"alchemical symbols",hexrange:["1f700","1f77f"]},{category:"geometric shapes extended",hexrange:["1f780","1f7ff"]},{category:"supplemental arrows-c",hexrange:["1f800","1f8ff"]},{category:"supplemental symbols and pictographs",hexrange:["1f900","1f9ff"]},{category:"chess symbols",hexrange:["1fa00","1fa6f"]},{category:"symbols and pictographs extended-a",hexrange:["1fa70","1faff"]},{category:"symbols for legacy computing",hexrange:["1fb00","1fbff"]},{category:"cjk unified ideographs extension b",hexrange:["20000","2a6df"]},{category:"cjk unified ideographs extension c",hexrange:["2a700","2b73f"]},{category:"cjk unified ideographs extension d",hexrange:["2b740","2b81f"]},{category:"cjk unified ideographs extension e",hexrange:["2b820","2ceaf"]},{category:"cjk unified ideographs extension f",hexrange:["2ceb0","2ebef"]},{category:"cjk unified ideographs extension i",hexrange:["2ebf0","2ee5f"]},{category:"cjk compatibility ideographs supplement",hexrange:["2f800","2fa1f"]},{category:"cjk unified ideographs extension g",hexrange:["30000","3134f"]},{category:"cjk unified ideographs extension h",hexrange:["31350","323af"]},{category:"tags",hexrange:["e0000","e007f"]},{category:"variation selectors supplement",hexrange:["e0100","e01ef"]},{category:"supplementary private use area-a",hexrange:["f0000","fffff"]},{category:"supplementary private use area-b",hexrange:["100000","10ffff"]}]
43,uX={inflate:n(15955).UD};var uY={};function uK(t){let r=[];for(let n=0;n<t;n++)r.push(n);return r}uY.parse=function(t){let r;var n=uY.B,i=function(t,r,n,i){var s=uY.T,o={cmap:s.cmap,head:s.head,hhea:s.hhea,maxp:s.maxp,hmtx:s.hmtx,name:s.name,"OS/2":s.OS2,post:s.post,loca:s.loca,kern:s.kern,glyf:s.glyf,"CFF ":s.CFF,GSUB:s.GSUB,CBLC:s.CBLC,CBDT:s.CBDT,"SVG ":s.SVG,COLR:s.colr,CPAL:s.cpal,sbix:s.sbix,fvar:s.fvar,gvar:s.gvar,avar:s.avar,HVAR:s.HVAR},a={_data:t,_index:r,_offset:n};for(var l in o){var u=uY.findTable(t,l,n);if(u){var h=u[0],c=i[h];null==c&&(c=o[l].parseTab(t,h,u[1],a)),a[l]=i[h]=c}}return a},s=new Uint8Array(t);119==s[0]&&(r=s,s=function(t){var r=n.readUshort(t,12),i=new Uint8Array(n.readUint(t,16)),s=12+16*r;n.writeASCII(i,0,"OTTO"),n.writeUshort(i,4,r);for(var o=44,a=0;a<r;a++){var l=n.readASCII(t,o,4),u=n.readUint(t,o+4),h=n.readUint(t,o+8),c=n.readUint(t,o+12);o+=20;var d=t.slice(u,u+h);h!=c&&(d=uX.inflate(d));var p=12+16*a;n.writeASCII(i,p,l),n.writeUint(i,p+8,s),n.writeUint(i,p+12,c),i.set(d,s),s+=c}return i}(s));var o={};if("ttcf"==n.readASCII(s,0,4)){var a=4;n.readUshort(s,a),a+=2,n.readUshort(s,a),a+=2;var l=n.readUint(s,a);a+=4;for(var u=[],h=0;h<l;h++){var c=n.readUint(s,a);a+=4,u.push(i(s,h,c,o))}return u}var d=i(s,0,0,o);d._compressedData=r;var p=d.fvar;if(p){for(var f=[d],h=0;h<p[1].length;h++){var m=p[1][h],g={};for(var y in f.push(g),d)g[y]=d[y];g._index=h;var v=g.name=JSON.parse(JSON.stringify(g.name));v.fontSubfamily=m[0],null==m[3]&&(m[3]=(v.fontFamily+"-"+v.fontSubfamily).replaceAll(" ","")),v.postScriptName=m[3]}return f}return[d]},uY.findTable=function(t,r,n){for(var i=uY.B,s=i.readUshort(t,n+4),o=n+12,a=0;a<s;a++){var l=i.readASCII(t,o,4);i.readUint(t,o+4);var u=i.readUint(t,o+8),h=i.readUint(t,o+12);if(l==r)return[u,h];o+=16}return null},uY.T={},uY.B={readFixed:function(t,r){return(t[r]<<8|t[r+1])+(t[r+2]<<8|t[r+3])/65540},readF2dot14:function(t,r){return uY.B.readShort(t,r)/16384},readInt:function(t,r){var n=uY.B.t.uint8;return n[0]=t[r+3],n[1]=t[r+2],n[2]=t[r+1],n[3]=t[r],uY.B.t.int32[0]},readInt8:function(t,r){return uY.B.t.uint8[0]=t[r],uY.B.t.int8[0]},readShort:function(t,r){return uY.B.t.uint16[0]=t[r]<<8|t[r+1],uY.B.t.int16[0]},readUshort:function(t,r){return t[r]<<8|t[r+1]},writeUshort:function(t,r,n){t[r]=n>>8&255,t[r+1]=255&n},readUshorts:function(t,r,n){for(var i=[],s=0;s<n;s++){var o=uY.B.readUshort(t,r+2*s);i.push(o)}return i},readUint:function(t,r){var n=uY.B.t.uint8;return n[3]=t[r],n[2]=t[r+1],n[1]=t[r+2],n[0]=t[r+3],uY.B.t.uint32[0]},writeUint:function(t,r,n){t[r]=n>>24&255,t[r+1]=n>>16&255,t[r+2]=n>>8&255,t[r+3]=(0|n)&255},readUint64:function(t,r){return 0x100000000*uY.B.readUint(t,r)+uY.B.readUint(t,r+4)},readASCII:function(t,r,n){for(var i="",s=0;s<n;s++)i+=String.fromCharCode(t[r+s]);return i},writeASCII:function(t,r,n){for(var i=0;i<n.length;i++)t[r+i]=n.charCodeAt(i)},readUnicode:function(t,r,n){for(var i="",s=0;s<n;s++)i+=String.fromCharCode(t[r++]<<8|t[r++]);return i},_tdec:window.TextDecoder?new window.TextDecoder:null,readUTF8:function(t,r,n){var i=uY.B._tdec;return i&&0==r&&n==t.length?i.decode(t):uY.B.readASCII(t,r,n)},readBytes:function(t,r,n){for(var i=[],s=0;s<n;s++)i.push(t[r+s]);return i},readASCIIArray:function(t,r,n){for(var i=[],s=0;s<n;s++)i.push(String.fromCharCode(t[r+s]));return i},t:function(){var t=new ArrayBuffer(8);return{buff:t,int8:new Int8Array(t),uint8:new Uint8Array(t),int16:new Int16Array(t),uint16:new Uint16Array(t),int32:new Int32Array(t),uint32:new Uint32Array(t)}}()},uY.T.CFF={parseTab:function(t,r,n){var i=uY.B,s=uY.T.CFF;(t=new Uint8Array(t.buffer,r,n))[r=0],t[++r],t[++r],t[++r],r++;var o=[];r=s.readIndex(t,r,o);for(var a=[],l=0;l<o.length-1;l++)a.push(i.readASCII(t,r+o[l],o[l+1]-o[l]));r+=o[o.length-1];var u=[];r=s.readIndex(t,r,u);for(var h=[],l=0;l<u.length-1;l++)h.push(s.readDict(t,r+u[l],r+u[l+1]));r+=u[u.length-1];var c=h[0],d=[];r=s.readIndex(t,r,d);for(var p=[],l=0;l<d.length-1;l++)p.push(i.readASCII(t,r+d[l],d[l+1]-d[l]));if(r+=d[d.length-1],s.readSubrs(t,r,c),c.CharStrings&&(c.CharStrings=s.readBytes(t,c.CharStrings)),c.ROS){r=c.FDArray;var f=[];r=s.readIndex(t,r,f),c.FDArray=[];for(var l=0;l<f.length-1;l++){var m=s.readDict(t,r+f[l],r+f[l+1]);s._readFDict(t,m,p),c.FDArray.push(m)}r+=f[f.length-1],r=c.FDSelect,c.FDSelect=[];var g=t[r];if(r++,3==g){var y=i.readUshort(t,r);r+=2;
43for(var l=0;l<y+1;l++)c.FDSelect.push(i.readUshort(t,r),t[r+2]),r+=3}else throw g}return c.charset&&(c.charset=s.readCharset(t,c.charset,c.CharStrings.length)),s._readFDict(t,c,p),c},_readFDict:function(t,r,n){var i,s=uY.T.CFF;for(var o in r.Private&&(i=r.Private[1],r.Private=s.readDict(t,i,i+r.Private[0]),r.Private.Subrs&&s.readSubrs(t,i+r.Private.Subrs,r.Private)),r)-1!=["FamilyName","FontName","FullName","Notice","version","Copyright"].indexOf(o)&&(r[o]=n[r[o]-426+35])},readSubrs:function(t,r,n){n.Subrs=uY.T.CFF.readBytes(t,r);var i=n.Subrs.length+1;n.Bias=i<1240?107:i<33900?1131:32768},readBytes:function(t,r){uY.B;var n=[];r=uY.T.CFF.readIndex(t,r,n);for(var i=[],s=n.length-1,o=t.byteOffset+r,a=0;a<s;a++){var l=n[a];i.push(new Uint8Array(t.buffer,o+l,n[a+1]-l))}return i},tableSE:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,0,111,112,113,114,0,115,116,117,118,119,120,121,122,0,123,0,124,125,126,127,128,129,130,131,0,132,133,0,134,135,136,137,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,138,0,139,0,0,0,0,140,141,142,143,0,0,0,0,0,144,0,0,0,145,0,0,146,147,148,149,0,0,0,0],glyphByUnicode:function(t,r){for(var n=0;n<t.charset.length;n++)if(t.charset[n]==r)return n;return -1},glyphBySE:function(t,r){return r<0||r>255?-1:uY.T.CFF.glyphByUnicode(t,uY.T.CFF.tableSE[r])},readCharset:function(t,r,n){var i=uY.B,s=[".notdef"],o=t[r];if(r++,0==o)for(var a=0;a<n;a++){var l=i.readUshort(t,r);r+=2,s.push(l)}else if(1==o||2==o)for(;s.length<n;){var l=i.readUshort(t,r);r+=2;var u=0;1==o?(u=t[r],r++):(u=i.readUshort(t,r),r+=2);for(var a=0;a<=u;a++)s.push(l),l++}else throw"error: format: "+o;return s},readIndex:function(t,r,n){var i=uY.B,s=i.readUshort(t,r)+1,o=t[r+=2];if(r++,1==o)for(var a=0;a<s;a++)n.push(t[r+a]);else if(2==o)for(var a=0;a<s;a++)n.push(i.readUshort(t,r+2*a));else if(3==o)for(var a=0;a<s;a++)n.push(0xffffff&i.readUint(t,r+3*a-1));else if(4==o)for(var a=0;a<s;a++)n.push(i.readUint(t,r+4*a));else if(1!=s)throw"unsupported offset size: "+o+", count: "+s;return(r+=s*o)-1},getCharString:function(t,r,n){var i=uY.B,s=t[r],o=t[r+1];t[r+2],t[r+3],t[r+4];var a=1,l=null,u=null;s<=20&&(l=s,a=1),12==s&&(l=100*s+o,a=2),21<=s&&s<=27&&(l=s,a=1),28==s&&(u=i.readShort(t,r+1),a=3),29<=s&&s<=31&&(l=s,a=1),32<=s&&s<=246&&(u=s-139,a=1),247<=s&&s<=250&&(u=(s-247)*256+o+108,a=2),251<=s&&s<=254&&(u=-(256*(s-251))-o-108,a=2),255==s&&(u=i.readInt(t,r+1)/65535,a=5),n.val=null!=u?u:"o"+l,n.size=a},readCharString:function(t,r,n){for(var i=r+n,s=uY.B,o=[];r<i;){var a=t[r],l=t[r+1];t[r+2],t[r+3],t[r+4];var u=1,h=null,c=null;a<=20&&(h=a,u=1),12==a&&(h=100*a+l,u=2),(19==a||20==a)&&(h=a,u=2),21<=a&&a<=27&&(h=a,u=1),28==a&&(c=s.readShort(t,r+1),u=3),29<=a&&a<=31&&(h=a,u=1),32<=a&&a<=246&&(c=a-139,u=1),247<=a&&a<=250&&(c=(a-247)*256+l+108,u=2),251<=a&&a<=254&&(c=-(256*(a-251))-l-108,u=2),255==a&&(c=s.readInt(t,r+1)/65535,u=5),o.push(null!=c?c:"o"+h),r+=u}return o},readDict:function(t,r,n){for(var i=uY.B,s={},o=[];r<n;){var a=t[r],l=t[r+1];t[r+2],t[r+3],t[r+4];var u=1,h=null,c=null;if(28==a&&(c=i.readShort(t,r+1),u=3),29==a&&(c=i.readInt(t,r+1),u=5),32<=a&&a<=246&&(c=a-139,u=1),247<=a&&a<=250&&(c=(a-247)*256+l+108,u=2),251<=a&&a<=254&&(c=-(256*(a-251))-l-108,u=2),255==a)throw c=i.readInt(t,r+1)/65535,u=5,"unknown number";if(30==a){var d=[];for(u=1;;){var p=t[r+u];u++;var f=p>>4,m=15&p;if(15!=f&&d.push(f),15!=m&&d.push(m),15==m)break}for(var g="",y=[0,1,2,3,4,5,6,7,8,9,".","e","e-","reserved","-","endOfNumber"],v=0;v<d.length;v++)g+=y[d[v]];c=parseFloat(g)}if(a<=21){var b=["version","Notice","FullName","FamilyName","Weight","FontBBox","BlueValues","OtherBlues","FamilyBlues","FamilyOtherBlues","StdHW","StdVW","escape","UniqueID","XUID","charset","Encoding","CharStrings","Private","Subrs","defaultWidthX","nominalWidthX"];if(h=b[a],u=1,12==a){var b=["Copyright","isFixedPitch","ItalicAngle","UnderlinePosition","UnderlineThickness","PaintType","CharstringType","FontMatrix","StrokeWidth","BlueScale","BlueShift","BlueFuzz","StemSnapH","StemSnapV","ForceBold","","","LanguageGroup","ExpansionFactor","initialRandomSeed","SyntheticBase","PostScript","BaseFontName","BaseFontBlend","","","","","","","ROS","CIDFontVersion","CIDFontRevision","CIDFontType","CIDCount","UIDBase","FDArray","FDSelect","FontName"];h=b[l],u=2}}null!=h?(s[h]=1==o.length?o[0]:o,o=[]):o.push(c),r+=u}return s}},uY.T.cmap={parseTab:function(t,r,n){var i={tables:[],ids:{},off:r};t=new Uint8Array(t.buffer,r,n),r=0;var s=uY.B,o=s.readUshort,a=uY.T.cmap;o(t,r);var l=o(t,r+=2);r+=2;
43for(var u=[],h=0;h<l;h++){var c=o(t,r),d=o(t,r+=2);r+=2;var p=s.readUint(t,r);r+=4;var f="p"+c+"e"+d,m=u.indexOf(p);if(-1==m){m=i.tables.length;var g={};u.push(p);var y=g.format=o(t,p);0==y?g=a.parse0(t,p,g):4==y?g=a.parse4(t,p,g):6==y?g=a.parse6(t,p,g):12==y&&(g=a.parse12(t,p,g)),i.tables.push(g)}null!=i.ids[f]&&console.log("multiple tables for one platform+encoding: "+f),i.ids[f]=m}return i},parse0:function(t,r,n){var i=uY.B;r+=2;var s=i.readUshort(t,r);r+=2,i.readUshort(t,r),r+=2,n.map=[];for(var o=0;o<s-6;o++)n.map.push(t[r+o]);return n},parse4:function(t,r,n){var i=uY.B,s=i.readUshort,o=i.readUshorts,a=r,l=s(t,r+=2);s(t,r+=2);var u=s(t,r+=2)>>>1;n.searchRange=s(t,r+=2),n.entrySelector=s(t,r+=2),n.rangeShift=s(t,r+=2),n.endCount=o(t,r+=2,u),r+=2*u,n.startCount=o(t,r+=2,u),r+=2*u,n.idDelta=[];for(var h=0;h<u;h++)n.idDelta.push(i.readShort(t,r)),r+=2;return n.idRangeOffset=o(t,r,u),n.glyphIdArray=o(t,r+=2*u,a+l-r>>1),n},parse6:function(t,r,n){var i=uY.B;r+=2,i.readUshort(t,r),r+=2,i.readUshort(t,r),r+=2,n.firstCode=i.readUshort(t,r),r+=2;var s=i.readUshort(t,r);r+=2,n.glyphIdArray=[];for(var o=0;o<s;o++)n.glyphIdArray.push(i.readUshort(t,r)),r+=2;return n},parse12:function(t,r,n){var i=uY.B.readUint;i(t,r+=4),i(t,r+=4);var s=3*i(t,r+=4);r+=4;for(var o=n.groups=new Uint32Array(s),a=0;a<s;a+=3)o[a]=i(t,r+(a<<2)),o[a+1]=i(t,r+(a<<2)+4),o[a+2]=i(t,r+(a<<2)+8);return n}},uY.T.CBLC={parseTab:function(t,r,n){var i=uY.B,s=r;i.readUshort(t,r),r+=2,i.readUshort(t,r),r+=2;var o=i.readUint(t,r);r+=4;for(var a=[],l=0;l<o;l++){var u=i.readUint(t,r);r+=4,i.readUint(t,r),r+=4,i.readUint(t,r),r+=4,r+=4,r+=24,i.readUshort(t,r),r+=2,i.readUshort(t,r),r+=2,r+=4;for(var h=s+u,c=0;c<3;c++){var d=i.readUshort(t,h);h+=2;var p=i.readUshort(t,h);h+=2;var f=i.readUint(t,h);h+=4;var m=p-d+1,g=s+u+f,y=i.readUshort(t,g);if(g+=2,1!=y)throw y;var v=i.readUshort(t,g);g+=2;var b=i.readUint(t,g);g+=4;for(var x=[],_=0;_<m;_++){var A=i.readUint(t,g+4*_);x.push(b+A)}a.push([d,p,v,x])}}return a}},uY.T.CBDT={parseTab:function(t,r,n){return uY.B,new Uint8Array(t.buffer,t.byteOffset+r,n)}},uY.T.glyf={parseTab:function(t,r,n,i){for(var s=[],o=i.maxp.numGlyphs,a=0;a<o;a++)s.push(null);return s},_parseGlyf:function(t,r){var n,i=uY.B,s=t._data,o=t.loca;if(o[r]==o[r+1])return null;var a=uY.findTable(s,"glyf",t._offset)[0]+o[r],l={};if(l.noc=i.readShort(s,a),a+=2,l.xMin=i.readShort(s,a),a+=2,l.yMin=i.readShort(s,a),a+=2,l.xMax=i.readShort(s,a),a+=2,l.yMax=i.readShort(s,a),a+=2,l.xMin>=l.xMax||l.yMin>=l.yMax)return null;if(l.noc>0){l.endPts=[];for(var u=0;u<l.noc;u++)l.endPts.push(i.readUshort(s,a)),a+=2;var h=i.readUshort(s,a);if(a+=2,s.length-a<h)return null;l.instructions=i.readBytes(s,a,h),a+=h;var c=l.endPts[l.noc-1]+1;l.flags=[];for(var u=0;u<c;u++){var d=s[a];if(a++,l.flags.push(d),(8&d)!=0){var p=s[a];a++;for(var f=0;f<p;f++)l.flags.push(d),u++}}l.xs=[];for(var u=0;u<c;u++){var m=(2&l.flags[u])!=0,g=(16&l.flags[u])!=0;m?(l.xs.push(g?s[a]:-s[a]),a++):g?l.xs.push(0):(l.xs.push(i.readShort(s,a)),a+=2)}l.ys=[];for(var u=0;u<c;u++){var m=(4&l.flags[u])!=0,g=(32&l.flags[u])!=0;m?(l.ys.push(g?s[a]:-s[a]),a++):g?l.ys.push(0):(l.ys.push(i.readShort(s,a)),a+=2)}for(var y=0,v=0,u=0;u<c;u++)y+=l.xs[u],v+=l.ys[u],l.xs[u]=y,l.ys[u]=v}else{l.parts=[];do{n=i.readUshort(s,a),a+=2;var b={m:{a:1,b:0,c:0,d:1,tx:0,ty:0},p1:-1,p2:-1};if(l.parts.push(b),b.glyphIndex=i.readUshort(s,a),a+=2,1&n){var x=i.readShort(s,a);a+=2;var _=i.readShort(s,a);a+=2}else{var x=i.readInt8(s,a);a++;var _=i.readInt8(s,a);a++}2&n?(b.m.tx=x,b.m.ty=_):(b.p1=x,b.p2=_),8&n?(b.m.a=b.m.d=i.readF2dot14(s,a),a+=2):64&n?(b.m.a=i.readF2dot14(s,a),a+=2,b.m.d=i.readF2dot14(s,a),a+=2):128&n&&(b.m.a=i.readF2dot14(s,a),a+=2,b.m.b=i.readF2dot14(s,a),a+=2,b.m.c=i.readF2dot14(s,a),a+=2,b.m.d=i.readF2dot14(s,a),a+=2)}while(32&n);if(256&n){var A=i.readUshort(s,a);a+=2,l.instr=[];for(var u=0;u<A;u++)l.instr.push(s[a]),a++}}return l}},uY.T.head={parseTab:function(t,r,n){var i=uY.B,s={};return i.readFixed(t,r),r+=4,s.fontRevision=i.readFixed(t,r),r+=4,i.readUint(t,r),r+=4,i.readUint(t,r),r+=4,s.flags=i.readUshort(t,r),r+=2,s.unitsPerEm=i.readUshort(t,r),r+=2,s.created=i.readUint64(t,r),r+=8,s.modified=i.readUint64(t,r),r+=8,s.xMin=i.readShort(t,r),r+=2,s.yMin=i.readShort(t,r),r+=2,s.xMax=i.readShort(t,r),r+=2,s.yMax=i.readShort(t,r),r+=2,s.macStyle=i.readUshort(t,r),r+=2,s.lowestRecPPEM=i.readUshort(t,r),r+=2,s.fontDirectionHint=i.readShort(t,r),r+=2,s.indexToLocFormat=i.readShort(t,r),r+=2,s.glyphDataFormat=i.readShort(t,r),r+=2,s}},uY.T.hhea={parseTab:function(t,r,n){var i=uY.B,s={};i.readFixed(t,r),r+=4;for(var o=["ascender","descender","lineGap","advanceWidthMax","minLeftSideBearing","minRightSideBearing","xMaxExtent","caretSlopeRise","caretSlopeRun","caretOffset","res0","res1","res2","res3","metricDataFormat","numberOfHMetrics"],a=0;a<o.length;a++){var l=o[a],u="advanceWidthMax"==l||"numberOfHMetrics"==l?i.readUshort:i.readShort;s[l]=u(t,r+2*a)}return s}},uY.T.hmtx={parseTab:function(t,r,n,i){for(var s=uY.B,o=[],a=[],l=i.maxp.numGlyphs,u=i.hhea.numberOfHMetrics,h=0,c=0,d=0;d<u;)h=s.readUshort(t,r+(d<<2)),c=s.readShort(t,r+(d<<2)+2),o.push(h),a.push(c),d++;for(;d<l;)o.push(h),a.push(c),d++;return{aWidth:o,lsBearing:a}}},uY.T.kern={parseTab:function(t,r,n,i){var s=uY.B,o=uY.T.kern;if(1==s.readUshort(t,r))return o.parseV1(t,r,n,i);var a=s.readUshort(t,r+2);r+=4;for(var l={glyph1:[],rval:[]},u=0;u<a;u++){r+=2;var n=s.readUshort(t,r);r+=2;var h=s.readUshort(t,r);r+=2;var c=h>>>8;0==(c&=15)&&(r=o.readFormat0(t,r,l))}return l},parseV1:function(t,r,n,i){var s=uY.B,o=uY.T.kern;s.readFixed(t,r);var a=s.readUint(t,r+4);r+=8;for(var l={glyph1:[],rval:[]},u=0;u<a;u++){s.readUint(t,r),r+=4;var h=s.readUshort(t,r);r+=2,s.readUshort(t,r),r+=2,0==(255&h)&&(r=o.readFormat0(t,r,l))}return l},readFormat0:function(t,r,n){var i=uY.B,s=i.readUshort,o=-1,a=s(t,r);s(t,r+2),s(t,r+4),s(t,r+6),r+=8;for(var l=0;l<a;l++){var u=s(t,r),h=s(t,r+=2);r+=2;var c=i.readShort(t,r);r+=2,u!=o&&(n.glyph1.push(u),n.rval.push({glyph2:[],vals:[]}));var d=n.rval[n.rval.length-1];d.glyph2.push(h),d.vals.push(c),o=u}return r}},uY.T.loca={parseTab:function(t,r,n,i){var s=uY.B,o=[],a=i.head.indexToLocFormat,l=i.maxp.numGlyphs+1;if(0==a)for(var u=0;u<l;u++)o.push(s.readUshort(t,r+(u<<1))<<1);if(1==a)for(var u=0;u<l;u++)o.push(s.readUint(t,r+(u<<2)));return o}},uY.T.maxp={parseTab:function(t,r,n){var i=uY.B,s=i.readUshort,o={};return i.readUint(t,r),o.numGlyphs=s(t,r+=4),r+=2,o}},uY.T.name={parseTab:function(t,r,n){var i=uY.B,s={};i.readUshort(t,r),r+=2;var o=i.readUshort(t,r);r+=2;
43for(var a=i.readUshort(t,r),l=(r+=2)-6+a,u=["copyright","fontFamily","fontSubfamily","ID","fullName","version","postScriptName","trademark","manufacturer","designer","description","urlVendor","urlDesigner","licence","licenceURL","---","typoFamilyName","typoSubfamilyName","compatibleFull","sampleText","postScriptCID","wwsFamilyName","wwsSubfamilyName","lightPalette","darkPalette"],h=i.readUshort,c=0;c<o;c++){var d,p=h(t,r),f=h(t,r+=2),m=h(t,r+=2),g=h(t,r+=2),y=h(t,r+=2),v=h(t,r+=2);r+=2;var b=l+v;0==p||3==p&&0==f||1==p&&25==f?d=i.readUnicode(t,b,y/2):0==f?d=i.readASCII(t,b,y):1==f||3==f||4==f||5==f||10==f?d=i.readUnicode(t,b,y/2):1==p?(d=i.readASCII(t,b,y),console.log("reading unknown MAC encoding "+f+" as ASCII")):(console.log("unknown encoding "+f+", platformID: "+p),d=i.readASCII(t,b,y));var x="p"+p+","+m.toString(16);null==s[x]&&(s[x]={});var _=u[g];null==_&&(_="_"+g),s[x][_]=d,s[x]._lang=m}var A=uY.T.name.selectOne(s),E="fontFamily";if(null==A[E])for(var C in s)null!=s[C][E]&&(A[E]=s[C][E]);return A},selectOne:function(t){var r,n="postScriptName";for(var i in t)if(null!=t[i][n]&&1033==t[i]._lang)return t[i];for(var i in t)if(null!=t[i][n]&&0==t[i]._lang)return t[i];for(var i in t)if(null!=t[i][n]&&3084==t[i]._lang)return t[i];for(var i in t)if(null!=t[i][n])return t[i];for(var i in t){r=t[i];break}return console.log("returning name table with languageID "+r._lang),null==r[n]&&null!=r.ID&&(r[n]=r.ID),r}},uY.T.OS2={parseTab:function(t,r,n){var i=uY.B.readUshort(t,r);r+=2;var s=uY.T.OS2,o={};if(0==i)s.version0(t,r,o);else if(1==i)s.version1(t,r,o);else if(2==i||3==i||4==i)s.version2(t,r,o);else if(5==i)s.version5(t,r,o);else throw"unknown OS/2 table version: "+i;return o},version0:function(t,r,n){var i=uY.B;return n.xAvgCharWidth=i.readShort(t,r),r+=2,n.usWeightClass=i.readUshort(t,r),r+=2,n.usWidthClass=i.readUshort(t,r),r+=2,n.fsType=i.readUshort(t,r),r+=2,n.ySubscriptXSize=i.readShort(t,r),r+=2,n.ySubscriptYSize=i.readShort(t,r),r+=2,n.ySubscriptXOffset=i.readShort(t,r),r+=2,n.ySubscriptYOffset=i.readShort(t,r),r+=2,n.ySuperscriptXSize=i.readShort(t,r),r+=2,n.ySuperscriptYSize=i.readShort(t,r),r+=2,n.ySuperscriptXOffset=i.readShort(t,r),r+=2,n.ySuperscriptYOffset=i.readShort(t,r),r+=2,n.yStrikeoutSize=i.readShort(t,r),r+=2,n.yStrikeoutPosition=i.readShort(t,r),r+=2,n.sFamilyClass=i.readShort(t,r),r+=2,n.panose=i.readBytes(t,r,10),r+=10,n.ulUnicodeRange1=i.readUint(t,r),r+=4,n.ulUnicodeRange2=i.readUint(t,r),r+=4,n.ulUnicodeRange3=i.readUint(t,r),r+=4,n.ulUnicodeRange4=i.readUint(t,r),r+=4,n.achVendID=i.readASCII(t,r,4),r+=4,n.fsSelection=i.readUshort(t,r),r+=2,n.usFirstCharIndex=i.readUshort(t,r),r+=2,n.usLastCharIndex=i.readUshort(t,r),r+=2,n.sTypoAscender=i.readShort(t,r),r+=2,n.sTypoDescender=i.readShort(t,r),r+=2,n.sTypoLineGap=i.readShort(t,r),r+=2,n.usWinAscent=i.readUshort(t,r),r+=2,n.usWinDescent=i.readUshort(t,r),r+=2},version1:function(t,r,n){var i=uY.B;return r=uY.T.OS2.version0(t,r,n),n.ulCodePageRange1=i.readUint(t,r),r+=4,n.ulCodePageRange2=i.readUint(t,r),r+=4},version2:function(t,r,n){var i=uY.B,s=i.readUshort;return r=uY.T.OS2.version1(t,r,n),n.sxHeight=i.readShort(t,r),r+=2,n.sCapHeight=i.readShort(t,r),n.usDefault=s(t,r+=2),n.usBreak=s(t,r+=2),n.usMaxContext=s(t,r+=2),r+=2},version5:function(t,r,n){var i=uY.B.readUshort;return r=uY.T.OS2.version2(t,r,n),n.usLowerOpticalPointSize=i(t,r),n.usUpperOpticalPointSize=i(t,r+=2),r+=2}},uY.T.post={parseTab:function(t,r,n){var i=uY.B,s={};return s.version=i.readFixed(t,r),r+=4,s.italicAngle=i.readFixed(t,r),r+=4,s.underlinePosition=i.readShort(t,r),r+=2,s.underlineThickness=i.readShort(t,r),r+=2,s}},uY.T.SVG={parseTab:function(t,r,n){var i=uY.B,s={entries:[],svgs:[]},o=r;i.readUshort(t,r),r+=2;var a=i.readUint(t,r);r+=4,i.readUint(t,r),r+=4,r=a+o;var l=i.readUshort(t,r);r+=2;for(var u=0;u<l;u++){var h=i.readUshort(t,r);r+=2;var c=i.readUshort(t,r);r+=2;var d=i.readUint(t,r);r+=4;var p=i.readUint(t,r);r+=4;var f=new Uint8Array(t.buffer,o+d+a,p);31==f[0]&&139==f[1]&&8==f[2]&&(f=uX.inflate(f));for(var m=i.readUTF8(f,0,f.length),g=h;g<=c;g++)s.entries[g]=s.svgs.length;s.svgs.push(m)}return s}},uY.T.sbix={parseTab:function(t,r,n,i){for(var s=i.maxp.numGlyphs,o=uY.B,a=o.readUint(t,r+4),l=[],u=a-1;u<a;u++)for(var h=r+o.readUint(t,r+8+4*u),c=0;c<s;c++){var d=o.readUint(t,h+4+4*c),p=o.readUint(t,h+4+4*c+4);if(d==p){l[c]=null;continue}var f=h+d,m=o.readASCII(t,f+4,4);if("png "!=m)throw m;l[c]=new Uint8Array(t.buffer,t.byteOffset+f+8,p-d-8)}return l}},uY.T.colr={parseTab:function(t,r,n){var i=uY.B,s=r;r+=2;var o=i.readUshort(t,r);r+=2;var a=i.readUint(t,r);r+=4;var l=i.readUint(t,r);r+=4;var u=i.readUshort(t,r);r+=2;
43for(var h={},c=s+a,d=0;d<o;d++)h["g"+i.readUshort(t,c)]=[i.readUshort(t,c+2),i.readUshort(t,c+4)],c+=6;var p=[];c=s+l;for(var d=0;d<u;d++)p.push(i.readUshort(t,c),i.readUshort(t,c+2)),c+=4;return[h,p]}},uY.T.cpal={parseTab:function(t,r,n){var i=uY.B,s=r,o=i.readUshort(t,r);if(r+=2,0==o){i.readUshort(t,r),r+=2,i.readUshort(t,r),r+=2;var a=i.readUshort(t,r);r+=2;var l=i.readUint(t,r);return r+=4,new Uint8Array(t.buffer,s+l,4*a)}throw o}},uY.T.GSUB={parseTab:function(t,r,n,i){var s=uY.B,o=s.readUshort;s.readUint;var a=r;o(t,a),o(t,a+=2),o(t,a+=2);var l=o(t,a+=2);o(t,a+=2),a+=2;var u={},h=o(t,a=r+l);a+=2;for(var c=0;c<h;c++){var d=s.readASCII(t,a,4);o(t,a+=4),a+=2,u[d]=!0}return u}},uY.T.fvar={parseTab:function(t,r,n,i){var s=i.name,o=r,a=uY.B,l=[],u=[];o+=8;var h=a.readUshort(t,o);o+=2,o+=2;var c=a.readUshort(t,o);o+=2;var d=a.readUshort(t,o);o+=2;for(var p=0;p<h;p++){var f=a.readASCII(t,o,4),m=a.readFixed(t,o+4),g=a.readFixed(t,o+8),y=a.readFixed(t,o+12),v=a.readUshort(t,o+16),b=a.readUshort(t,o+18);l.push([f,m,g,y,v,s["_"+b]]),o+=20}for(var p=0;p<c;p++){for(var x=a.readUshort(t,o),_=null,v=a.readUshort(t,o+2),A=[],E=0;E<h;E++)A.push(a.readFixed(t,o+4+4*E));o+=4+4*h,(3&d)==2&&(_=a.readUshort(t,o),o+=2),u.push([s["_"+x],v,A,_])}return[l,u]}},uY.T.gvar=function(){var t=uY.B;function r(r,n,i){for(var s=[],o=0;o<i;o++)s.push(t.readF2dot14(r,n+2*o));return s}function n(r,n,i){var s=r[n];if(n++,0==s)return[[],n];127<s&&(s=(127&s)<<8|r[n++]);for(var o=[],a=0;o.length<s;){var l=r[n];n++;var u=(128&l)!=0;l=(127&l)+1;for(var h=0;h<l;h++){var c=0;u?(c=t.readUshort(r,n),n+=2):(c=r[n],n++),a+=c,o.push(a)}}return[o,n]}return{parseTab:function(i,s,o,a){var l=s+4,u=t.readUshort(i,l);l+=2;var h=t.readUshort(i,l);l+=2;var c=t.readUint(i,l);l+=4;var d=t.readUshort(i,l);l+=2,t.readUshort(i,l),l+=2;var p=t.readUint(i,l);l+=4;for(var f=[],m=0;m<d+1;m++)f.push(t.readUint(i,l+4*m));var g=[],y=[],v=[];l=s+c;for(var m=0;m<h;m++){var b=r(i,l+m*u*2,u),x=[],_=[];g.push(b),y.push(x),v.push(_);for(var A=0;A<u;A++)x[A]=Math.min(b[A],0),_[A]=Math.max(b[A],0)}for(var E=new Int8Array(i.buffer),C=[],m=0;m<d;m++){l=s+p+f[m];var D=t.readUshort(i,l);l+=2;var w=32768&D;D&=4095;var S=t.readUshort(i,l),F=function(n,i,s,o,a){for(var l=[],u=0;u<s;u++){var h=t.readUshort(n,i);i+=2;var c=t.readUshort(n,i),d=61440&c;c&=4095,i+=2;var p=null,f=null,m=null;32768&d&&(p=r(n,i,o),i+=2*o),16384&d&&(f=r(n,i,o),i+=2*o),16384&d&&(m=r(n,i,o),i+=2*o),l.push([h,c,d,f,p,m])}return l}(i,l+=2,D,u),T=[];C.push(T),l=s+p+f[m]+S;var N=null;if(w){var I=n(i,l);N=I[0],l=I[1]}for(var O=0;O<D;O++){var k=F[O],M=l+k[0],B=N;if(8192&k[2]){var I=n(i,l);B=I[0],l=I[1]}for(var L=[];l<M;){var R=i[l++],P=(63&R)+1;if(128&R)for(var A=0;A<P;A++)L.push(0);else if(64&R){for(var A=0;A<P;A++)L.push(t.readShort(i,l+2*A));l+=2*P}else{for(var A=0;A<P;A++)L.push(E[l+A]);l+=P}}var z=k[1];if(T.push([[k[3]?k[3]:y[z],k[4]?k[4]:g[z],k[5]?k[5]:v[z]],L,0==B.length?null:B]),0!=B.length&&2*B.length!=L.length)throw"e"}}return C}}}(),uY.T.avar={parseTab:function(t,r,n,i){var s=r,o=uY.B,a=[];s+=6;var l=o.readUshort(t,s);s+=2;for(var u=0;u<l;u++){var h=o.readUshort(t,s);s+=2;var c=[];a.push(c);for(var d=0;d<h;d++){var p=o.readF2dot14(t,s),f=o.readF2dot14(t,s+2);s+=4,c.push(p,f)}}return a}},uY.T.HVAR={parseTab:function(t,r,n,i){var s=r,o=uY.B;s+=4;var a=o.readUint(t,s);s+=4;var l=o.readUint(t,s);s+=4;var u=o.readUint(t,s);s+=4;var h=o.readUint(t,s);if(s+=4,0!=u||0!=h)throw u;var c=s=r+a,d=o.readUshort(t,s);if(s+=2,1!=d)throw"e";var p=o.readUint(t,s);s+=4;var f=o.readUshort(t,s);s+=2;for(var m=[],g=0;g<f;g++)m.push(o.readUint(t,s+4*g));s+=4*f,s=c+p;var y=o.readUshort(t,s);s+=2;var v=o.readUshort(t,s);s+=2;for(var b=[],g=0;g<v;g++){var x=[[],[],[]];b.push(x);for(var _=0;_<y;_++)x[0].push(o.readF2dot14(t,s+0)),x[1].push(o.readF2dot14(t,s+2)),x[2].push(o.readF2dot14(t,s+4)),s+=6}for(var A=new Int8Array(t.buffer),E=[],g=0;g<m.length;g++){s=r+a+m[g];var C=[];E.push(C);var D=o.readUshort(t,s);s+=2;var w=o.readUshort(t,s);if(s+=2,32768&w)throw"e";var v=o.readUshort(t,s);s+=2;for(var S=[],_=0;_<v;_++)S.push(o.readUshort(t,s+2*_));s+=2*v;for(var F=0;F<D;F++){for(var T=[],N=0;N<v;N++)T.push(N<w?o.readShort(t,s):A[s]),s+=N<w?2:1;var I=Array(b.length);I.fill(0),C.push(I);for(var _=0;_<S.length;_++)I[S[_]]=T[_]}}s=r+l;var d=t[s++];if(0!=d)throw"e";var O=t[s++],k=o.readUshort(t,s);s+=2;for(var M=((48&O)>>4)+1,B=[],g=0;g<k;g++){var L=0;1==M?L=t[s++]:(L=o.readUshort(t,s),s+=2);var R=L>>
43(15&O)+1,P=L&(1<<(15&O)+1)-1;B.push(E[R][P])}return[b,B]}},uY.U=function(){var t,r,n=function(t,r,n){t.cmds.push("M"),t.crds.push(r,n)},i=function(t,r,n){t.cmds.push("L"),t.crds.push(r,n)},s=function(t,r,n,i,s,o,a){t.cmds.push("C"),t.crds.push(r,n,i,s,o,a)},o=function(t,r,n,i,s){t.cmds.push("Q"),t.crds.push(r,n,i,s)},a=function(t){t.cmds.push("Z")};function l(t,r,n){for(var i=0,s=~~(t.length/r);i+1!=s;){var o=i+(s-i>>>1);t[o*r]<=n?i=o:s=o}return i*r}for(var u=[9,10,11,12,13,32,133,160,5760,6158,8232,8233,8239,8288,12288,65279],h={},c=0;c<u.length;c++)h[u[c]]=1;for(var c=8192;c<=8205;c++)h[c]=1;function d(t,r){if(null==t._ctab){for(var n=t.cmap,i=-1,s=["p3e10","p0e4","p3e1","p1e0","p0e3","p0e1","p3e0","p3e5"],o=0;o<s.length;o++)if(null!=n.ids[s[o]]){i=n.ids[s[o]];break}if(-1==i)throw"no familiar platform and encoding!";t._ctab=n.tables[i]}var a=t._ctab,u=a.format,c=-1;if(0==u)c=r>=a.map.length?0:a.map[r];else if(4==u){var d=a.endCount;if(c=0,r<=d[d.length-1]){var p=l(d,1,r);(d[p]<r&&p++,r>=a.startCount[p])&&(c=65535&(0!=a.idRangeOffset[p]?a.glyphIdArray[r-a.startCount[p]+(a.idRangeOffset[p]>>1)-(a.idRangeOffset.length-p)]:r+a.idDelta[p]))}}else if(6==u){var f=r-a.firstCode,m=a.glyphIdArray;c=f<0||f>=m.length?0:m[f]}else if(12==u){var g=a.groups;if(c=0,r<=g[g.length-2]){var o=l(g,3,r);g[o]<=r&&r<=g[o+1]&&(c=g[o+2]+(r-g[o]))}}else throw"unknown cmap table format "+a.format;var y=t["SVG "],v=t.loca;return 0!=c&&null==t["CFF "]&&(null==y||null==y.entries[c])&&v&&v[c]==v[c+1]&&null==h[r]&&(c=0),c}function p(t,r,l,u){var h={cmds:[],crds:[]};t.fvar&&(null==u&&(u=t.fvar[1][t._index][2]),u=m(t,u));var c=t["SVG "],d=t["CFF "],g=t.COLR,y=t.CBLC,v=t.CBDT,b=t.sbix,x=window.UPNG,_=null;if(y&&x)for(var A=0;A<y.length;A++)y[A][0]<=r&&r<=y[A][1]&&(_=y[A]);if(_||b&&b[r]){if(_&&17!=_[2])throw"not a PNG";null==t.__tmp&&(t.__tmp={});var E=t.__tmp["g"+r];if(null==E){if(b)D=(C=b[r]).length;else{var C,D,w=_[3][r-_[0]]+5;D=v[w+1]<<16|v[w+2]<<8|v[w+3],w+=4,C=new Uint8Array(v.buffer,v.byteOffset+w,D)}for(var S="",A=0;A<D;A++)S+=String.fromCharCode(C[A]);E=t.__tmp["g"+r]="data:image/png;base64,"+btoa(S)}h.cmds.push(E);var F=1.15*t.head.unitsPerEm,T=Math.round(F),N=Math.round(F),I=Math.round(-(.15*N));h.crds.push(0,N+I,T,N+I,T,I,0,I)}else if(c&&c.entries[r]){var O=c.entries[r];if(null!=O){if("number"==typeof O){var k=c.svgs[O];if("string"==typeof k){var M=new DOMParser().parseFromString(k,"image/svg+xml");k=c.svgs[O]=M.getElementsByTagName("svg")[0]}
43O=uY.U.SVG.toPath(k,r),c.entries[r]=O}h=O}}else if(!0!=l&&g&&g[0]["g"+r]&&g[0]["g"+r][1]>1){function B(t){var r=t.toString(16);return(1==r.length?"0":"")+r}for(var L=t.CPAL,R=g[0]["g"+r],A=0;A<R[1];A++){var P=R[0]+A,z=g[1][2*P],U=4*g[1][2*P+1],$=p(t,z,z==r),j="#"+B(L[U+2])+B(L[U+1])+B(L[U+0]);h.cmds.push(j),h.cmds=h.cmds.concat($.cmds),h.crds=h.crds.concat($.crds),h.cmds.push("X")}}else if(d){var V=d.Private,G={x:0,y:0,stack:[],nStems:0,haveWidth:!1,width:V?V.defaultWidthX:0,open:!1};if(d.ROS){for(var H=0;d.FDSelect[H+2]<=r;)H+=2;V=d.FDArray[d.FDSelect[H+1]].Private}!function t(r,o,l,u,h){for(var c=o.stack,d=o.nStems,p=o.haveWidth,f=o.width,m=o.open,g=0,y=o.x,v=o.y,b=0,x=0,_=0,A=0,E=0,C=0,D=0,w=0,S=0,F=0,T=uY.T.CFF,N=u.nominalWidthX,I={val:0,size:0};g<r.length;){T.getCharString(r,g,I);var O=I.val;if(g+=I.size,"o1"==O||"o18"==O)c.length%2==0||p||(f=c.shift()+N),d+=c.length>>1,c.length=0,p=!0;else if("o3"==O||"o23"==O)c.length%2==0||p||(f=c.shift()+N),d+=c.length>>1,c.length=0,p=!0;else if("o4"==O)c.length>1&&!p&&(f=c.shift()+N,p=!0),m&&a(h),n(h,y,v+=c.pop()),m=!0;else if("o5"==O)for(;c.length>0;)y+=c.shift(),i(h,y,v+=c.shift());else if("o6"==O||"o7"==O)for(var k=c.length,M="o6"==O,B=0;B<k;B++){var L=c.shift();M?y+=L:v+=L,M=!M,i(h,y,v)}else if("o8"==O||"o24"==O){for(var k=c.length,R=0;R+6<=k;)b=y+c.shift(),x=v+c.shift(),_=b+c.shift(),A=x+c.shift(),y=_+c.shift(),v=A+c.shift(),s(h,b,x,_,A,y,v),R+=6;"o24"==O&&(y+=c.shift(),i(h,y,v+=c.shift()))}else if("o11"==O)break;else if("o1234"==O||"o1235"==O||"o1236"==O||"o1237"==O)"o1234"==O&&(b=y+c.shift(),x=v,_=b+c.shift(),A=x+c.shift(),S=_+c.shift(),F=A,E=S+c.shift(),C=A,D=E+c.shift(),w=v,y=D+c.shift(),s(h,b,x,_,A,S,F),s(h,E,C,D,w,y,v)),"o1235"==O&&(b=y+c.shift(),x=v+c.shift(),_=b+c.shift(),A=x+c.shift(),S=_+c.shift(),F=A+c.shift(),E=S+c.shift(),C=F+c.shift(),D=E+c.shift(),w=C+c.shift(),y=D+c.shift(),v=w+c.shift(),c.shift(),s(h,b,x,_,A,S,F),s(h,E,C,D,w,y,v)),"o1236"==O&&(b=y+c.shift(),x=v+c.shift(),_=b+c.shift(),A=x+c.shift(),S=_+c.shift(),F=A,E=S+c.shift(),C=A,D=E+c.shift(),w=C+c.shift(),y=D+c.shift(),s(h,b,x,_,A,S,F),s(h,E,C,D,w,y,v)),"o1237"==O&&(b=y+c.shift(),x=v+c.shift(),_=b+c.shift(),A=x+c.shift(),S=_+c.shift(),F=A+c.shift(),E=S+c.shift(),C=F+c.shift(),Math.abs((D=E+c.shift())-y)>Math.abs((w=C+c.shift())-v)?y=D+c.shift():v=w+c.shift(),s(h,b,x,_,A,S,F),s(h,E,C,D,w,y,v));else if("o14"==O){if(c.length>0&&4!=c.length&&!p&&(f=c.shift()+l.nominalWidthX,p=!0),4==c.length){var P=c.shift(),z=c.shift(),U=c.shift(),$=c.shift(),j=T.glyphBySE(l,U),V=T.glyphBySE(l,$);t(l.CharStrings[j],o,l,u,h),o.x=P,o.y=z,t(l.CharStrings[V],o,l,u,h)}m&&(a(h),m=!1)}else if("o19"==O||"o20"==O)c.length%2==0||p||(f=c.shift()+N),d+=c.length>>1,c.length=0,p=!0,g+=d+7>>3;else if("o21"==O)c.length>2&&!p&&(f=c.shift()+N,p=!0),v+=c.pop(),y+=c.pop(),m&&a(h),n(h,y,v),m=!0;else if("o22"==O)c.length>1&&!p&&(f=c.shift()+N,p=!0),y+=c.pop(),m&&a(h),n(h,y,v),m=!0;else if("o25"==O){for(;c.length>6;)y+=c.shift(),i(h,y,v+=c.shift());b=y+c.shift(),x=v+c.shift(),_=b+c.shift(),A=x+c.shift(),y=_+c.shift(),v=A+c.shift(),s(h,b,x,_,A,y,v)}else if("o26"==O)for(c.length%2&&(y+=c.shift());c.length>0;)b=y,x=v+c.shift(),_=b+c.shift(),A=x+c.shift(),y=_,v=A+c.shift(),s(h,b,x,_,A,y,v);else if("o27"==O)for(c.length%2&&(v+=c.shift());c.length>0;)b=y+c.shift(),x=v,_=b+c.shift(),A=x+c.shift(),y=_+c.shift(),v=A,s(h,b,x,_,A,y,v);else if("o10"==O||"o29"==O){var G="o10"==O?u:l;if(0==c.length)console.log("error: empty stack");else{var H=c.pop(),q=G.Subrs[H+G.Bias];o.x=y,o.y=v,o.nStems=d,o.haveWidth=p,o.width=f,o.open=m,t(q,o,l,u,h),y=o.x,v=o.y,d=o.nStems,p=o.haveWidth,f=o.width,m=o.open}}else if("o30"==O||"o31"==O){var k,W=c.length,R=0,Z="o31"==O;for(k=-3&W,R+=W-k;R<k;)Z?(b=y+c.shift(),x=v,_=b+c.shift(),v=(A=x+c.shift())+c.shift(),k-R==5?(y=_+c.shift(),R++):y=_,Z=!1):(b=y,x=v+c.shift(),_=b+c.shift(),A=x+c.shift(),y=_+c.shift(),k-R==5?(v=A+c.shift(),R++):v=A,Z=!0),s(h,b,x,_,A,y,v),R+=4}else if("o"==(O+"").charAt(0))throw console.log("Unknown operation: "+O,r),O;else c.push(O)}o.x=y,o.y=v,o.nStems=d,o.haveWidth=p,o.width=f,o.open=m}(d.CharStrings[r],G,d,V,h)}else t.glyf&&function t(r,s,l,u){var h=s.glyf[r];null==h&&(h=s.glyf[r]=uY.T.glyf._parseGlyf(s,r)),null!=h&&(h.noc>-1?function(t,r,s,l,u){var h=t.xs,c=t.ys;if(r.fvar&&u){h=h.slice(0),c=c.slice(0);for(var d=r.gvar,p=d?d[s]:null,m=0;m<p.length;m++){var g=f(p[m][0],u);if(!(g<1e-9)){var y=p[m][1],v=p[m][2];if(v&&(y=p[m][1]=function(t,r,n,i,s){var o=n.length,a=Array(2*o+8);a.fill(0);for(var l=0;l<o;l++){var u=0,h=0,c=r.indexOf(l);if(-1!=c)u=t[c],h=t[r.length+c];else{for(var d=0;s[d]<l;)d++;for(var p=0==d?0:s[d-1]+1,f=s[d],m=-1,g=-1,y=0;y<r.length;y++){var v=r[y];v<p||v>f||v>=o||(m=y,-1==g&&(g=y))}for(var y=0;y<r.length;y++){var v=r[y];if(!(v<p)&&!(v>f)&&!(v>=o)&&(v<l&&(m=y),l<v)){g=y;break}}for(var b=0;b<2;b++){var x=0==b?n:i,_=b*r.length,A=0,E=x[r[m]],C=x[r[g]],D=x[l],w=t[_+m],S=t[_+g];
43if(E==C)A=w==S?w:0;else if(D<=Math.min(E,C))A=E<C?w:S;else if(Math.max(E,C)<=D)A=E<C?S:w;else{var F=(D-E)/(C-E);A=F*S+(1-F)*w}0==b?u=A:h=A}}a[l]=u,a[o+4+l]=h}return a}(y,v,h,c,t.endPts),p[m][2]=null),y.length==2*h.length+8)for(var b=0;b<h.length;b++)h[b]+=g*y[b],c[b]+=g*y[b+h.length+4]}}}for(var x=0;x<t.noc;x++){for(var _=0==x?0:t.endPts[x-1]+1,A=t.endPts[x],b=_;b<=A;b++){var E=b==_?A:b-1,C=b==A?_:b+1,D=1&t.flags[b],w=1&t.flags[E],S=1&t.flags[C],F=h[b],T=c[b];if(b==_)if(D)if(w)n(l,h[E],c[E]);else{n(l,F,T);continue}else w?n(l,h[E],c[E]):n(l,Math.floor((h[E]+F)*.5),Math.floor((c[E]+T)*.5));D?w&&i(l,F,T):S?o(l,F,T,h[C],c[C]):o(l,F,T,Math.floor((F+h[C])*.5),Math.floor((T+c[C])*.5))}a(l)}}(h,s,r,l,u):function(r,n,i,s,o){var a=[0,0,0,0,0,0],l=[0,0,0,0,0,0],u=r.parts.length;if(n.fvar&&o)for(var h=n.gvar,c=h?h[i]:null,d=0;d<c.length;d++){var p=f(c[d][0],o);if(!(p<1e-6)){var m=c[d][1],g=c[d][2];if(null==g)for(var y=0;y<u;y++)a[y]+=p*m[y],l[y]+=p*m[y+u+4];else for(var v=0;v<g.length;v++){var y=g[v];a[y]+=p*m[0],l[y]+=p*m[0+u]}}}for(var v=0;v<u;v++){var b={cmds:[],crds:[]},x=r.parts[v];t(x.glyphIndex,n,b,o);for(var _=x.m,A=_.tx+a[v],E=_.ty+l[v],y=0;y<b.crds.length;y+=2){var C=b.crds[y],D=b.crds[y+1];s.crds.push(C*_.a+D*_.c+A),s.crds.push(C*_.b+D*_.d+E)}for(var y=0;y<b.cmds.length;y++)s.cmds.push(b.cmds[y])}}(h,s,r,l,u))}(r,t,h,u);return{cmds:h.cmds,crds:h.crds}}function f(t,r){r.length;for(var n=1,i=t[0],s=t[1],o=t[2],a=0;a<r.length;a++)n*=i[a]>s[a]||s[a]>o[a]||i[a]<0&&o[a]>0&&0!=s[a]||0==s[a]?1:r[a]<i[a]||r[a]>o[a]?0:r[a]==s[a]?1:r[a]<s[a]?(r[a]-i[a])/(s[a]-i[a]):(o[a]-r[a])/(o[a]-s[a]);return n}function m(t,r){for(var n=t.fvar,i=t.avar,s=n?n[0]:null,o=[],a=0;a<s.length;a++){var l=s[a][1],u=s[a][2],h=s[a][3],c=Math.max(l,Math.min(h,r[a]));if(c<u?o[a]=(u-c)/(l-u):c>u?o[a]=(c-u)/(h-u):o[a]=0,i&&-1!=o[a]){for(var d=i[a],p=0;p<d.length&&!(d[p]>=o[a]);p+=2);var f=(o[a]-d[p-2])/(d[p]-d[p-2]);o[a]=f*d[p+1]+(1-f)*d[p-1]}}return o}return{shape:function(t,r,n){null==n&&(n={}),n.ltr,n.fts;var i=n.axs;t.fvar&&null==i&&(i=t.fvar[1][t._index][2]);var s=t.HVAR;i&&s&&(i=m(t,i));for(var o=[],a=0;a<r.length;a++){var l=r.codePointAt(a);l>65535&&a++,o.push(d(t,l))}for(var u=[],a=0;a<o.length;a++){var h=function(t,r,n,i){var s=r[n],o=r[n+1],a=t.kern;if(a){var l=a.glyph1.indexOf(s);if(-1!=l){var u=a.rval[l].glyph2.indexOf(o);if(-1!=u)return[0,0,a.rval[l].vals[u],0]}}return[0,0,0,0]}(t,o,a),c=o[a],p=t.hmtx.aWidth[c]+h[2];if(s&&s[1][c])for(var g=s[1][c],y=0;y<s[0].length;y++)p+=f(s[0][y],i)*g[y];u.push({g:c,cl:a,dx:0,dy:0,ax:p,ay:0})}return u},shapeToPath:function(t,r,n){var i,s,o=[],a=[],l=0,u=0;n&&(i=n.clr,s=n.axs);for(var h=0;h<r.length;h++){for(var c=r[h],d=p(t,c.g,!1,s),f=d.crds,m=0;m<f.length;m+=2)a.push(f[m]+l+c.dx),a.push(f[m+1]+u+c.dy);i&&o.push(i);for(var m=0;m<d.cmds.length;m++)o.push(d.cmds[m]);var g=o.length;i&&0!=g&&"X"!=o[g-1]&&o.push("X"),l+=c.ax,u+=c.ay}return{cmds:o,crds:a}},codeToGlyph:d,glyphToPath:p,pathToSVG:function(t,r){var n=t.cmds,i=t.crds;function s(t){return parseFloat(t.toFixed(r))}null==r&&(r=5);for(var o=[],a=0,l={M:2,L:2,Q:4,C:6},u=0,h=0,c=0,d=0,p=0,f=0,m=0;m<n.length;m++){var g,y,v,b,x=n[m],_=l[x]?l[x]:0,A=[];if("L"==x)g=i[a]-u,y=i[a+1]-h,v=s(g+c),b=s(y+d),"Z"==n[m+1]&&i[a]==p&&i[a+1]==f?(v=g,b=y):0==v&&0==b||(0==v?A.push("v",b):0==b?A.push("h",v):A.push("l",v,b));else{A.push(x.toLowerCase());for(var E=0;E<_;E+=2)g=i[a+E]-u,y=i[a+E+1]-h,v=s(g+c),b=s(y+d),A.push(v,b)}0!=_&&(c+=g-v,d+=y-b);for(var E=0;E<A.length;E++)o.push(A[E]);0!=_&&(a+=_,u=i[a-2],h=i[a-1]),"M"==x&&(p=u,f=h),"Z"==x&&(u=p,h=f)}return function(t){for(var r=[],n=!1,i="",s=0;s<t.length;s++){var o=t[s],a="number"==typeof o;if(!a){if(o==i&&1==o.length&&"m"!=o)continue;i=o}n&&a&&o>=0&&r.push(" "),r.push(o),n=a}return r.join("")}(o)},SVGToPath:function(t){var r={cmds:[],crds:[]};return uY.U.SVG.svgToPath(t,r),{cmds:r.cmds,crds:r.crds}},pathToContext:function(n,i){for(var s=0,o=n.cmds,a=n.crds,l=0;l<o.length;l++){var u=o[l];if("M"==u)i.moveTo(a[s],a[s+1]),s+=2;else if("L"==u)i.lineTo(a[s],a[s+1]),s+=2;else if("C"==u)i.bezierCurveTo(a[s],a[s+1],a[s+2],a[s+3],a[s+4],a[s+5]),s+=6;else if("Q"==u)i.quadraticCurveTo(a[s],a[s+1],a[s+2],a[s+3]),s+=4;else if("d"==u[0]){var h=window.UPNG,c=a[s],d=a[s+1],p=a[s+2],f=a[s+3],m=a[s+4],g=a[s+5],y=a[s+6],v=a[s+7];if(s+=8,null==h){i.moveTo(c,d),i.lineTo(p,f),i.lineTo(m,g),i.lineTo(y,v),i.closePath();continue}for(var b=p-c,x=f-d,_=y-c,A=v-d,E=atob(u.slice(22)),C=new Uint8Array(E.length),D=0;D<E.length;D++)C[D]=E.charCodeAt(D);for(var w=h.decode(C.buffer),S=w.width,F=w.height,T=new Uint8Array(h.toRGBA8(w)[0]),N=i.getTransform(),I=Math.sqrt(Math.abs(N.a*N.d-N.b*N.c))*Math.sqrt(_*_+A*A)/F;I<.5;){var O=function(t,r,n,i){for(var s=r>>1,o=n>>1,a=new Uint8Array(s*o*4),l=new Uint32Array(t.buffer),u=new Uint32Array(a.buffer),h=0;h<o;h++)for(var c=0;c<s;c++){var d=h*s+c,p=(h<<1)*r+(c<<1),f=l[p],m=l[p+1],g=l[p+r],y=l[p+r+1],v=f>>>24,b=m>>>24,x=g>>>24,_=y>>>24,A=v+b+x+_;if(1020==A){var E=(f>>>0&255)+(m>>>0&255)+(g>>>0&255)+(y>
43>>0&255)+2>>>2,C=(f>>>8&255)+(m>>>8&255)+(g>>>8&255)+(y>>>8&255)+2>>>2,D=(f>>>16&255)+(m>>>16&255)+(g>>>16&255)+(y>>>16&255)+2>>>2;u[d]=-0x1000000|D<<16|C<<8|E}else if(0==A)u[d]=0;else{var E=(f>>>0&255)*v+(m>>>0&255)*b+(g>>>0&255)*x+(y>>>0&255)*_,C=(f>>>8&255)*v+(m>>>8&255)*b+(g>>>8&255)*x+(y>>>8&255)*_,D=(f>>>16&255)*v+(m>>>16&255)*b+(g>>>16&255)*x+(y>>>16&255)*_,w=1/A;E=~~(E*w+.5),C=~~(C*w+.5),D=~~(D*w+.5),u[d]=A+2>>>2<<24|D<<16|C<<8|E}}return{buff:a,w:s,h:o}}(T,S,F);T=O.buff,S=O.w,F=O.h,I*=2}null==t&&(r=(t=document.createElement("canvas")).getContext("2d")),(t.width!=S||t.height!=F)&&(t.width=S,t.height=F),r.putImageData(new ImageData(new Uint8ClampedArray(T.buffer),S,F),0,0),i.save(),i.transform(b,x,_,A,c,d),i.scale(1/S,1/F),i.drawImage(t,0,0),i.restore()}else if("#"==u.charAt(0)||"r"==u.charAt(0))i.beginPath(),i.fillStyle=u;else if("O"==u.charAt(0)&&"OX"!=u){i.beginPath();var k=u.split("-");i.lineWidth=parseFloat(k[2]),i.lineCap=["butt","round","square"][parseFloat(k[3])],i.lineJoin=["miter","round","bevel"][parseFloat(k[4])],i.miterLimit=parseFloat(k[5]),i.lineDashOffset=parseFloat(k[6]),i.setLineDash(k[7].split(",").map(parseFloat)),i.strokeStyle=k[1]}else"Z"==u?i.closePath():"X"==u?i.fill():"OX"==u&&i.stroke()}},initHB:function(t,r){var n=function(t){var r=0;return(0xffffff80&t)==0?r=1:(0xfffff800&t)==0?r=2:(0xffff0000&t)==0?r=3:(0xffe00000&t)==0&&(r=4),r};fetch(t).then(function(t){return t.arrayBuffer()}).then(function(t){return WebAssembly.instantiate(t)}).then(function(t){console.log("HB ready");var i,s,o,a,l,u,h,c,d,p,f,m=t.instance.exports,g=m.memory;uY.U.shapeHB=(s=function(t){for(var r=m.hb_buffer_get_length(t),n=[],i=m.hb_buffer_get_glyph_infos(t,0)>>>2,s=m.hb_buffer_get_glyph_positions(t,0)>>>2,o=0;o<r;++o){var u=i+5*o,h=s+5*o;n.push({g:a[u+0],cl:a[u+2],ax:l[h+0],ay:l[h+1],dx:l[h+2],dy:l[h+3]})}return n},function(t,r,y){var v=t._data,b=t.name.postScriptName,x=y.ltr,_=y.fts,A=y.axs;if(t.fvar&&null==A&&(A=t.fvar[1][t._index][2]),o=new Uint8Array(g.buffer),a=new Uint32Array(g.buffer),l=new Int32Array(g.buffer),u=new Float32Array(g.buffer),h!=b&&(null!=c&&(m.hb_blob_destroy(c),m.free(d),m.hb_face_destroy(p),m.hb_font_destroy(f)),d=m.malloc(v.byteLength),o.set(v,d),c=m.hb_blob_create(d,v.byteLength,2,0,0),p=m.hb_face_create(c,t._index),f=m.hb_font_create(p),h=b),null==window.TextEncoder)return void alert("Your browser is too old. Please, update it.");null==i&&(i=new window.TextEncoder("utf8"));var E=m.hb_buffer_create(),C=i.encode(r),D=C.length,w=m.malloc(D);o.set(C,w),m.hb_buffer_add_utf8(E,w,D,0,D),m.free(w);var S=uY.B,F=0;if(_){F=m.malloc(16*_.length);for(var T=0;T<_.length;T++){var N=_[T],I=F+16*T,O=I>>>2;S.writeASCII(o,I,N[0].split("").reverse().join("")),a[O+1]=N[1],a[O+2]=N[2],a[O+3]=N[3]}}var k=0;if(A&&t.fvar){var M=t.fvar[0];k=m.malloc(8*A.length);for(var T=0;T<A.length;T++){var I=k+8*T,O=I>>>2;S.writeASCII(o,I,M[T][0].split("").reverse().join("")),u[O+1]=A[T]}}A&&m.hb_font_set_variations(f,k,A.length),m.hb_buffer_set_direction(E,x?4:5),m.hb_buffer_guess_segment_properties(E),m.hb_shape(f,E,F,_?_.length:0);var B=s(E);m.hb_buffer_destroy(E),_&&m.free(F),A&&m.free(k);var L=B.slice(0);x||L.reverse();for(var R=0,P=0,T=1;T<L.length;T++){for(var z=L[T],U=z.cl;;){var $=r.codePointAt(R),j=n($);if(P+j<=U)P+=j,R+=$<=65535?1:2;else break}z.cl=R}return B}),r()})}}}();class uJ{constructor(t,r,n,i){this._totalLength=void 0,this.A=t,this.B=r,this.C=n,this.D=i}static sampleSpacing(){return 2}tangentAtParameter(t){let r=Math.max(0,Math.min(1,t));if(0===r||1===r){let t,n;0===r?this.A.x===this.B.x&&this.A.y===this.B.y?(t=this.C.x-this.A.x,n=this.C.y-this.A.y):(t=this.B.x-this.A.x,n=this.B.y-this.A.y):this.D.x===this.C.x&&this.D.y===this.C.y?(t=this.D.x-this.B.x,n=this.D.y-this.B.y):(t=this.D.x-this.C.x,n=this.D.y-this.C.y);let i=Math.hypot(t,n);return Math.abs(i)>1e-4&&(t/=i,n/=i),{x:t,y:n}}let n=1-r,i=3*this.D.x*Math.pow(r,2)-3*this.C.x*Math.pow(r,2)+6*this.C.x*n*r-6*this.B.x*n*r+3*this.B.x*Math.pow(n,2)-3*this.A.x*Math.pow(n,2),s=3*this.D.y*Math.pow(r,2)-3*this.C.y*Math.pow(r,2)+6*this.C.y*n*r-6*this.B.y*n*r+3*this.B.y*Math.pow(n,2)-3*this.A.y*Math.pow(n,2),o=Math.hypot(i,s);return Math.abs(o)>1e-4&&(i/=o,s/=o),{x:i,y:s}}isLinear(){return this.A.x===this.B.x&&this.A.y===this.B.y&&this.C.x===this.D.x&&this.C.y===this.D.y}pointAtParameter(t){let r=Math.max(0,Math.min(1,t));return{x:Math.pow(1-r,3)*this.A.x+3*Math.pow(1-r,2)*r*this.B.x+3*(1-r)*Math.pow(r,2)*this.C.x+Math.pow(r,3)*this.D.x,y:Math.pow(1-r,3)*this.A.y+3*Math.pow(1-r,2)*r*this.B.y+3*(1-r)*Math.pow(r,2)*this.C.y+Math.pow(r,3)*this.D.y}}getTotalLength(){if(void 0===this._totalLength)if(this.isLinear())this._totalLength=Math.hypot(this.D.x-this.A.x,this.D.y-this.A.y);else{let t=Math.max(10,Math.ceil((Math.hypot(this.B.x-this.A.x,this.B.y-this.A.y)+Math.hypot(this.C.x-this.B.x,this.C.y-this.B.y)+Math.hypot(this.D.x-this.C.x,this.D.y-this.C.y))/uJ.sampleSpacing())),r=uK(t).map(r=>
43this.pointAtParameter(r/(t-1))),n=0;for(let t=1;t<r.length;t++)n+=Math.hypot(r[t].x-r[t-1].x,r[t].y-r[t-1].y);this._totalLength=n}return this._totalLength}}class uQ{constructor(t){this.samples=[],this.segments=t;let r=t.map(t=>t.getTotalLength()),n=[0];for(let t=1;t<r.length;t++)n.push(n[t-1]+r[t-1]);this._totalLength=n[n.length-1]+r[r.length-1];let i=t.map(t=>Math.max(4,Math.ceil(t.getTotalLength()/uJ.sampleSpacing()))),s=i.reduce((t,r)=>t+r),o=1/s/10,a=this._totalLength/s;this.samples.push({dist:0,pt:this.segments[0].A,tan:this.segments[0].tangentAtParameter(0),segIdx:0,t:0}),t.forEach((t,r)=>{let s,l=i[r],u=uK(l+1).map(t=>t/l),h=u.map(r=>t.pointAtParameter(r));for(let r=0;r<4;r++){let r=(s=uK(l).map(t=>Math.hypot(h[t+1].x-h[t].x,h[t+1].y-h[t].y))).map(t=>t-a),n=0;for(let i=1;i<u.length-1;i++)n+=r[i-1],u[i]-=o*n,h[i]=t.pointAtParameter(u[i])}let c=0;h.slice(1).forEach((t,i)=>{c+=s[i],this.samples.push({dist:n[r]+c,pt:t,tan:this.segments[r].tangentAtParameter(u[i+1]),segIdx:r,t:u[i+1]})})}),this._jumps=[],this.segmentStartEnds=[{start:0,end:0}];for(let t=1;t<this.samples.length;t++){let r=this.samples[t-1],n=this.samples[t];if(n.segIdx===r.segIdx)this.segmentStartEnds[this.segmentStartEnds.length-1].end=n.dist;else{let i=n.dist-Math.hypot(this.segments[n.segIdx].A.x-n.pt.x,this.segments[n.segIdx].A.y-n.pt.y);if(this.segments[r.segIdx].D.x!==this.segments[n.segIdx].A.x||this.segments[r.segIdx].D.y!==this.segments[n.segIdx].A.y){let s={dist:i-1e-8,pt:this.segments[r.segIdx].D,tan:this.segments[r.segIdx].tangentAtParameter(1),segIdx:r.segIdx,t:1},o={dist:i+1e-8,pt:this.segments[n.segIdx].A,tan:this.segments[n.segIdx].tangentAtParameter(0),segIdx:n.segIdx,t:0};this._jumps.push(i),this.samples.splice(t,0,s,o),this.segmentStartEnds[s.segIdx].end=s.dist,this.segmentStartEnds[o.segIdx]={start:o.dist,end:n.dist},t+=2}else if(0!==n.t){let r=Object.assign(Object.assign({},n),{t:0,pt:this.segments[n.segIdx].A,tan:this.segments[n.segIdx].tangentAtParameter(0),dist:i});this.samples.splice(t,0,r),this.segmentStartEnds[n.segIdx]={start:r.dist,end:n.dist},t++}else this.segmentStartEnds[n.segIdx]={start:n.dist,end:n.dist}}}}jumps(){return[...this._jumps]}getTotalLength(){return this._totalLength}findClosestSampleIdx(t){let r=0,n=this.samples.length-1;for(;r<n;){let i=Math.floor((r+n)/2);if(this.samples[i].dist>t)n=i-1;else{if(!(this.samples[i].dist<t))return i;r=i+1}}return Math.max(0,Math.min(this.samples.length-1,Math.floor((r+n)/2)))}getPointAtLength(t,r=!1){if(t<=0)return this.samples[0].pt;if(t>=this._totalLength)return this.samples[this.samples.length-1].pt;let n=this.findClosestSampleIdx(t),i=this.samples[n].dist<t?Math.min(n+1,this.samples.length-1):Math.max(0,n-1),s=1e-6>Math.abs(this.samples[i].dist-this.samples[n].dist)?0:(t-this.samples[n].dist)/(this.samples[i].dist-this.samples[n].dist);if(r||this.samples[n].segIdx>this.samples[i].segIdx)return{x:(1-s)*this.samples[n].pt.x+s*this.samples[i].pt.x,y:(1-s)*this.samples[n].pt.y+s*this.samples[i].pt.y};if(this.samples[n].segIdx!==this.samples[i].segIdx){let t=1-this.samples[n].t+this.samples[i].t,r=t>0?(1-this.samples[n].t)/t:.5;if(s<r){let t=this.segments[this.samples[n].segIdx],i=s/r,o=(1-i)*this.samples[n].t+i;return t.pointAtParameter(o)}{let t=this.segments[this.samples[i].segIdx],n=(s-r)/(1-r)*this.samples[i].t;return t.pointAtParameter(n)}}{let t=this.segments[this.samples[n].segIdx],r=(1-s)*this.samples[n].t+s*this.samples[i].t;return t.pointAtParameter(r)}}getAngleAtLength(t,r=!1){let n=this.getTangentAtLength(t,r);return Math.atan2(n.y,n.x)}getTangentAtLength(t,r=!1){if(t<=0)return this.samples[0].tan;if(t>=this._totalLength)return this.samples[this.samples.length-1].tan;let n=this.findClosestSampleIdx(t),i=this.samples[n].dist<t?Math.min(n+1,this.samples.length-1):Math.max(0,n-1),s=(t-this.samples[n].dist)/(this.samples[i].dist-this.samples[n].dist);if(r||this.samples[n].segIdx>this.samples[i].segIdx){let t=(1-s)*this.samples[n].tan.x+s*this.samples[i].tan.x,r=(1-s)*this.samples[n].tan.y+s*this.samples[i].tan.y,o=Math.max(Math.hypot(t,r),1e-4);return{x:t/=o,y:r/=o}}if(this.samples[n].segIdx!==this.samples[i].segIdx)if(s<.5){let t=this.segments[this.samples[n].segIdx],r=2*s,i=(1-r)*this.samples[n].t+r;return t.tangentAtParameter(i)}else{let t=this.segments[this.samples[i].segIdx],r=2*(s-.5)*this.samples[i].t;return t.tangentAtParameter(r)}{let t=this.segments[this.samples[n].segIdx],r=(1-s)*this.samples[n].t+s*this.samples[i].t;return t.tangentAtParameter(r)}}}let u0={M:2,L:2,C:6,Q:4},u1=["ttf","otf","woff"],u2=RegExp(`\\.(${u1.join("|")})`,"i"),u5=RegExp(`([^/]+)(\\.(?:${u1.join("|")}
43))`,"i"),u3="Sorry, only TTF, OTF and WOFF files are supported.",u4=["weight","stretch","style"];class u8{constructor(t,r,n,i,s){if(!(r instanceof FontFace))throw Error("FontFace is required");this._pInst=t,this.name=n,this.path=i,this.data=s,this.face=r}static hasGlyphData(t){let{font:r}=t;return"object"==typeof r&&void 0!==r.data}fontBounds(t,r,n,i,s,o){({width:i,height:s,options:o}=this._parseArgs(i,s,o));let a=o?.graphics?._renderer||this._pInst._renderer;if(!a)throw Error("p5 or graphics required for fontBounds()");return a.fontBounds(t,r,n,i,s)}textBounds(t,r,n,i,s,o){({width:i,height:s,options:o}=this._parseArgs(i,s,o));let a=o?.graphics?._renderer||this._pInst._renderer;if(!a)throw Error("p5 or graphics required for fontBounds()");return a.textBounds(t,r,n,i,s)}textToPaths(t,r,n,i,s,o){if({width:i,height:s,options:o}=this._parseArgs(i,s,o),!this.data)throw Error('No font data available for "'+this.name+'"\nTry downloading a local copy of the font file');return this._lineateAndPathify(t,r,n,i,s,o).map(t=>t.glyphs).flat().map(t=>t.path.commands).flat()}textToPoints(t,r,n,i,s,o){return this.textToContours(t,r,n,i,s,o).reduce((t,r)=>(t.push(...r),t),[])}textToContours(t,r=0,n=0,i,s,o){({width:i,height:s,options:o}=this._parseArgs(i,s,o));let a=this.textToPaths(t,r,n,i,s,o),l=[];for(let t of a)"M"===t[0]&&l.push([]),l[l.length-1].push(t);return l.map(t=>(function(t,r,n){let i=(t,r)=>{let n=t.length;return t[r<0?r%n+n:r%n]},s=(t,r,n,i)=>{if(!i)return 0===o(t,r,n);void 0===s.tmpPoint1&&(s.tmpPoint1=[],s.tmpPoint2=[]);let a=s.tmpPoint1,l=s.tmpPoint2;a.x=r.x-t.x,a.y=r.y-t.y,l.x=n.x-r.x,l.y=n.y-r.y;let u=a.x*l.x+a.y*l.y;return Math.acos(u/(Math.sqrt(a.x*a.x+a.y*a.y)*Math.sqrt(l.x*l.x+l.y*l.y)))<i},o=(t,r,n)=>(r[0]-t[0])*(n[1]-t[1])-(n[0]-t[0])*(r[1]-t[1]),a=(t=>{let r=t.slice();if(r.length<2)throw Error(`Path doesn't have enough commands: ${JSON.stringify(r)}`);if("M"!==r[0].type)throw Error(`Path starts with ${r[0].type} instead of M!`);let n={x:r[0].x,y:r[0].y},i=Object.assign({},n),s=[];for(;r.length>0;){let t=r.shift();if("M"===t.type)n=i={x:t.x,y:t.y};else if("C"===t.type)s.push(new uJ(n,{x:t.x1,y:t.y1},{x:t.x2,y:t.y2},{x:t.x,y:t.y})),n={x:t.x,y:t.y};else if("L"===t.type)(t.x!==n.x||t.y!==n.y)&&s.push(new uJ(n,n,{x:t.x,y:t.y},{x:t.x,y:t.y})),n={x:t.x,y:t.y};else if("H"===t.type)t.x!==n.x&&s.push(new uJ(n,n,{x:t.x,y:n.y},{x:t.x,y:n.y})),n={x:t.x,y:n.y};else if("V"===t.type)t.y!==n.y&&s.push(new uJ(n,n,{x:n.x,y:t.y},{x:n.x,y:t.y})),n={x:n.x,y:t.y};else if("Q"===t.type)s.push(new uJ(n,{x:n.x+2/3*(t.x1-n.x),y:n.y+2/3*(t.y1-n.y)},{x:t.x+2/3*(t.x1-t.x),y:t.y+2/3*(t.y1-t.y)},{x:t.x,y:t.y})),n={x:t.x,y:t.y};else if("Z"===t.type)Math.hypot(n.x-i.x,n.y-i.y)>0&&s.push(new uJ(n,n,i,i));else throw Error(`Unsupported path command ${t.type}; use only H, V, M, L, C, Z!`)}return new uQ(s)})(u7(t)),l=((t,r)=>{if("object"!=typeof t)t=r;else for(let n in r)void 0===t[n]&&(t[n]=r[n]);return t})(r,{sampleFactor:.1,simplifyThreshold:0}),u=Math.max(1,Math.ceil(a.getTotalLength()*l.sampleFactor)),h=[],c=n._pInst.angleMode(),d=n._pInst.DEGREES;for(let t=0;t<u;t++){let r=a.getTotalLength()*(1===u?0:t/(u-1));h.push({...a.getPointAtLength(r),get angle(){let t=a.getAngleAtLength(r);if(c===d)return 180*t/Math.PI;return t},get alpha(){return this.angle}})}return l.simplifyThreshold&&((t,r)=>{r=r||0;for(let n=t.length-1;t.length>3&&n>=0;--n)s(i(t,n-1),i(t,n),i(t,n+1),r)&&t.splice(n%t.length,1)})(h,l.simplifyThreshold),h})(t,o,this))}textToModel(t,r,n,i,s,o){({width:i,height:s,options:o}=this._parseArgs(i,s,o));let a=o?.extrude||0,l=this.textToContours(t,r,n,i,s,o);if(!l||0===l.length)return new p5.Geometry;let u=this._pInst.buildGeometry(()=>{let t=this._pInst._renderer._validateFaces;for(let t of(this._pInst._renderer._validateFaces=!0,this._pInst.beginShape(),l)){for(let r of(this._pInst.beginContour(),t))this._pInst.vertex(r.x,r.y,0);this._pInst.endContour(this._pInst.CLOSE)}this._pInst.endShape(this._pInst.CLOSE),this._pInst._renderer._validateFaces=t});if(0===a)return u;let h={},c=t=>`${t.x.toFixed(6)}-${t.y.toFixed(6)}-${t.z.toFixed(6)}`,d=[],p=[];for(let t of u.vertices){let r=c(t);if(!(r in h)){let n=d.length;h[r]=n,d.push(t.copy())}p.push(h[r])}let f=u.faces.map(t=>t.map(t=>p[t])),m={};for(let t of f)for(let r=0;r<t.length;r++){let n=t[r],i=t[(r+1)%t.length],s=`${Math.min(n,i)}-${Math.max(n,i)}`;m[s]||(m[s]=[]),m[s].push([n,i])}let g=[];for(let t in m)1===m[t].length&&g.push(m[t][0]);let y=this._pInst.buildGeometry(()=>{}),v=.5*a;for(let[t,r]of(y.vertices=[],y.faces=[],y.edges=[],g)){let n=d[t],i=d[r],s=new eM.M(i.x-n.x,i.y-n.y,i.z-n.z),o=new eM.M(0,0,a),l=eM.M.cross(s,o),u=s.mag();if(1e-4>l.mag()||u<1e-4)continue;let h=y.vertices.length;y.vertices.push(new eM.M(n.x,n.y,n.z+v));let c=y.vertices.length;y.vertices.push(new eM.M(i.x,i.y,i.z+v));let p=y.vertices.length;y.vertices.push(new eM.M(n.x,n.y,n.z-v));let f=y.vertices.length;y.vertices.push(new eM.M(i.x,i.y,i.z-v)),y.faces.push([h,p,f]),y.faces.push([h,f,c]),y.edges.push([h,c]),y.edges.push([p,f]),y.edges.push([h,p]),y.edges.push([c,f])}let b=y.vertices.length;for(let t of d)y.vertices.push(new eM.M(t.x,t.y,t.z+v));for(let t of f){if(t.length<3)continue;let r=t.map(t=>t+b);y.faces.push(r);for(let t=0;t<r.length;t++){let n=(t+1)%r.length;y.edges.push([r[t],r[n]])}}let x=y.vertices.length;for(let t of d)y.vertices.push(new eM.M(t.x,t.y,t.z-v));for(let t of f){if(t.length<3)continue;let r=[...t].reverse().map(t=>t+x);y.faces.push(r);for(let t=0;t<r.length;t++){let n=(t+1)%r.length;y.edges.push([r[t],r[n]])}}return y.computeNormals(),y}variations(){let t={};if(this.data){let r=this.face?.axes;r&&r.forEach(r=>{t[r.tag]=r.value})}return u4.forEach(r=>{let n=this.face[r];"normal"!==n&&(t[r]=t[r]||n)}),t}metadata(){let t=this.data?.name||{};for(let r in this.face)/^load/.test(r)||(t[r]=t[r]||this.face[r]);return t}static async list(t=!1){if(t){console.log("There are",document.fonts.size,"font-faces\n");let t=0;for(let r of document.fonts.values()){for(let t in console.log("FontFace: {"),r)console.log("  "+t+": "+r[t]);console.log("}\n"),"loaded"===r.status&&t++}console.log(t+" loaded")}return await Array.from(document.fonts)}_lineateAndPathify(t,r,n,i,s,o={}){let a=o?.graphics?._renderer||this._pInst._renderer;a.push(),a.textFont(this);let{lines:l,bounds:u}=a._computeBounds(eU.wU._FONT_BOUNDS,t,r,n,i,s,{ignoreRectMode:!0,...o});l=this._position(a,l,u,i,s);let h=this.data?.head?.unitsPerEm||1e3,c=a.states.textSize/h,d=this._currentAxes(a),p=l.map(t=>this._lineToGlyphs(t,{scale:c,axs:d}));return a.pop(),p}_currentAxes(t){let r;return(this.data?.fvar?.length??0)>0&&(r=this.data.fvar[0].map(([r,n,i,s,o,a])=>{if(!t)return i;if("wght"===r)return t.states.fontWeight;if("wdth"===r)return 100;if(!t.textCanvas().style.fontVariationSettings)return i;{let n=RegExp(`\\b${r}s+(d+)`).exec(t.textCanvas().style.fontVariationSettings);return n?parseInt(n[1]):i}})),r}_textToPathPoints(t,r,n,i,s,o){({width:i,height:s,options:o}=this._parseArgs(i,s,o));let a=this.textToPaths(t,r,n,i,s,o),l=(t,r,n,i)=>{if(fn.dist(r.x,r.y,n.x,n.y)>i){let s={x:(r.x+n.x)/2,y:(r.y+n.y)/2};t.push(s),l(t,r,s,i),l(t,s,n,i)}},u=[],{textSize:h}=this._pInst._renderer.states,c=h/this.data.head.unitsPerEm*500;for(let t=0;t<a.length;t++){let{type:r,data:n}=a[t];if("Z"!==r){let t={x:n[n.length-2],y:n[n.length-1]};"L"===r&&u.length&&!o?.nodivide>0&&l(u,u[u.length-1],t,c),u.push(t)}}return u}_parseArgs(t,r,n={}){return"object"==typeof t?(n=t,t=r=void 0):"object"==typeof r&&(n=r,r=void 0),{width:t,height:r,options:n}}_position(t,r,n,i,s){let{textAlign:o,textLeading:a,textSize:l}=t.states,u=this._measureTextDefault(t,"X").fontBoundingBoxAscent;return r.map((r,l)=>{let h=n.x,c=n.y+l*a+u,p=t._fontWidthSingle(r);if(o===d.v?h+=(n.w-p)/2:o===d.a9&&(h+=n.w-p),void 0!==i)switch(t.states.rectMode){case d.v:h-=i/2,c-=s/2;break;case d.u:h-=i,c-=s}return{text:r,x:h,y:c}})}_lineToGlyphs(t,{scale:r=1,axs:n}={}){if(!this.data)throw Error('No font data available for "'+this.name+'"\nTry downloading a local copy of the font file');let i=uY.U.shape(this.data,t.text,{axs:n});return t.glyphShapes=i,t.glyphs=this._shapeToPaths(i,t,{scale:r,axs:n}),t}_positionGlyphs(t,r){let n=r?.graphics?._renderer||this._pInst._renderer,i=this._currentAxes(n),s=uY.U.shape(this.data,t,{axs:i}),o=[],a=0;for(let t of s)o.push({x:a,index:t.g,shape:t}),a+=t.ax;return o}_singleShapeToPath(t,{scale:r=1,x:n=0,y:i=0,lineX:s=0,lineY:o=0,axs:a}={}){let l=this.data,u=0,{g:h,ax:c,ay:d,dx:p,dy:f}=t,{crds:m,cmds:g}=uY.U.glyphToPath(l,h,!0,a),y={path:{commands:[]}};for(let t=0;t<g.length;t++){let a=g[t],l=[a];if(a in u0){let t=u0[a];for(let a=0;a<t;a+=2){let t=m[a+u]+n+p,h=m[a+u+1]+i+f,c=s+t*r,d=o+-(h*r);l.push(c),l.push(d)}u+=t}y.path.commands.push(l)}return{glyph:y,ax:c,ay:d}}_shapeToPaths(t,r,{scale:n=1,axs:i}={}){let s=0,o=0,a=[];if(t.length!==r.text.length)throw Error("Invalid shape data");for(let l=0;l<t.length;l++){let{glyph:u,ax:h,ay:c}=this._singleShapeToPath(t[l],{scale:n,x:s,y:o,lineX:r.x,lineY:r.y,axs:i});a.push(u),s+=h,o+=c}return a}_measureTextDefault(t,r){let{textAlign:n,textBaseline:i}=t.states,s=t.textDrawingContext();s.textAlign="left",s.textBaseline="alphabetic";let o=s.measureText(r);return s.textAlign=n,s.textBaseline=i,o}drawPaths(t,r,n){t.strokeStyle=n?.stroke||t.strokeStyle,t.fillStyle=n?.fill||t.fillStyle,t.beginPath(),r.forEach(([r,...n])=>{"M"===r?t.moveTo(...n):"L"===r?t.lineTo(...n):"C"===r?t.bezierCurveTo(...n):"Q"===r?t.quadraticCurveTo(...n):"Z"===r&&t.closePath()}),n?.fill&&t.fill(),n?.stroke&&t.stroke()}_pathsToCommands(t,r){let n=[];for(let i=0;i<t.length;i++){let{x:s,y:o,path:a}=t[i],{crds:l,cmds:u}=a;for(let t=0,i=0;i<u.length;i++){let a=u[i],h={type:a,data:[]};if("M"===a||"L"===a)h.data.push(s+l[t]*r,o+-(l[t+1]*r)),t+=2;else if("C"===a){for(let n=0;n<6;n+=2)h.data.push(s+l[t+n]*r,o+-(l[t+n+1]*r));t+=6}else if("Q"===a){for(let n=0;n<4;n+=2)h.data.push(s+l[t+n]*r,o+-(l[t+n+1]*r));t+=4}n.push(h)}}return n}}async function u6(t,r,n,i,s){let o=function(t,r,n,i){var s;s=t,/^[A-Za-z][A-Za-z0-9_-]*$/.test(s)||(s="'"+String(s).replace(/'/g,"\\'")+"'"),t=s;let o=i?._compressedData??i?._data;if(!o){if(!u2.test(r))throw Error(u3);r.startsWith("url(")||(r="url("+r+")"),o=r}if((i?.fvar?.length??0)>0)for(let[t,r,s,o,a,l]of(n=n||{}
43,i.fvar[0]))"wght"===t?n.weight=`${r} ${o}`:"wdth"===t&&(n.stretch=`${r}% ${o}%`);let a=new FontFace(t,o,n);if("error"===a.status)throw Error('Failed to create FontFace for "'+t+'"');return a}(r,n,i,s);return"loaded"!==o.status&&await o.load(),document.fonts.add(o),await document.fonts.ready,new u8(t,o,r,n,s)}function u9(t,r){t.Font=u8,r.parseFontData=async function(t){let n=t instanceof Uint8Array?t:await r.loadBytes(t);if(!n)throw Error("Failed to load font data");let i=uY.parse(n);if(0===i.length||void 0===i[0].cmap)throw Error("parsing font data");return i[0]},r.loadFont=async function(...t){let n,{path:i,name:s,success:o,error:a,options:{sets:l,...u}={}}=function(...t){let r,n,i,s,o=t.shift();("string"!=typeof o||0===o.length)&&p5._friendlyError(u3,"p5.loadFont"),"string"==typeof t[0]&&(r=t.shift());for(let r=0;r<t.length;r++){let o=t[r];"function"==typeof o?n?i=o:n=o:"object"==typeof o&&(s=o)}return{path:o,name:r,success:n,error:i,options:s}}(...t),h=i.includes("@font-face");if(!h){let t;try{t=await fetch(i,{method:"HEAD"})}catch(r){t=await fetch(i)}t.headers.get("content-type")?.startsWith("text/css")&&(h=!0,i=await fetch(i).then(t=>t.text()))}if(h){let t,n=new CSSStyleSheet;await n.replace(i);let s=[];for(let t of n.cssRules)if(t instanceof CSSFontFaceRule){var c;let n=t.style,i=((c=n.getPropertyValue("font-family")).startsWith('"')||c.startsWith("'"))&&c.at(0)===c.at(-1)?c.slice(1,-1).replace(/\/(['"])/g,"$1"):c,o=n.getPropertyValue("src"),a={...u||{}};for(let t of n)"font-family"!==t&&"src"!==t&&(a[t.replace(/^font-/,"").split("-").map((t,r)=>0===r?t:`${t[0].toUpperCase()}${t.slice(1)}`).join("")]=n.getPropertyValue(t));s.push({name:i,src:o,fontDescriptors:a,loadWithData:async()=>{let t;try{let n=/url\(([^\)]+)\)/.exec(o);if(n){let i=n[1];/^['"]/.exec(i)&&i.at(0)===i.at(-1)&&(i=i.slice(1,-1)),t=await r.parseFontData(i)}}catch(t){}return u6(this,i,o,a,t)},loadWithoutData:()=>u6(this,i,o,a)})}let o=((l=l||["latin"])instanceof Array?l:[l]).map(t=>t.toLowerCase()),a=uZ.filter(t=>o.some(r=>t.category.includes(r)&&t.category.includes("ext")===r.includes("ext"))),h=new Set(uW.T.parse(a.map(t=>`U+${t.hexrange[0]}-${t.hexrange[1]}`))),d=0,p=0;for(let r of s){if(!r.fontDescriptors.unicodeRange)continue;let n=[...new Set(uW.T.parse(r.fontDescriptors.unicodeRange.split(/,\s*/g))).values()].filter(t=>h.has(t)).length,i={style:"normal",weight:400,...u},s=Object.keys(r.fontDescriptors).filter(t=>r.fontDescriptors[t]===i[t]).length;(s>p||s===p&&n>=d)&&(p=s,d=n,t=r)}let f=t||s.at(-1);for(let t of s)t!==f&&t.loadWithoutData();return f?.loadWithData()}try{let t=await r.parseFontData(i);s=s||function(t,r){let n,i=t?.name;if(i){if(i.fullName)return i.fullName;i.familyName&&(n=i.familyName)}if(!n){let t=u5.exec(r);n=t&&t.length>=3?t[1]:r}return n.includes(" ")&&(n=n.replace(/ /g,"_")),n}(t,i),n=await u6(this,s,i,u,t)}catch(r){let t=s||i.substring(i.lastIndexOf("/")+1).replace(/\.[^/.]+$/,"");console.warn(`WARN: No glyph data for '${t}', retrying as FontFace`);try{n=await u6(this,t,i,u)}catch(t){if(a)return a(t);throw t}}let d=()=>o?o(n):n;return this._internal?this._internal(d):d()}}let u7=t=>t.map(t=>{let r=t[0];switch(r){case"Z":return{type:r};case"M":case"L":{let[,n,i]=t;return{type:r,x:n,y:i}}case"Q":{let[,n,i,s,o]=t;return{type:r,x1:n,y1:i,x:s,y:o}}case"C":{let[,n,i,s,o,a,l]=t;return{type:r,x1:n,y1:i,x2:s,y2:o,x:a,y:l}}default:throw Error(`Unexpected path command: ${r}`)}});function he(t,r){g.R.prototype.maxCachedGlyphs=function(){return 200},u8.prototype._getFontInfo=function(t){this._fontInfos=this._fontInfos||{};let r=JSON.stringify(t);if(this._fontInfos[r])return this._fontInfos[r];{let n=new o(this,{axs:t});return this._fontInfos[r]=n,n}};class n{constructor(t,r){this.width=t,this.height=r,this.infos=[]}findImage(t){let r,n,i=this.width*this.height;if(t>i)throw Error("font is too complex to render in 3D");for(let s=this.infos.length-1;s>=0;--s){let o=this.infos[s];if(o.index+t<i){r=o,n=o.imageData;break}}if(!r){try{n=new ImageData(this.width,this.height)}catch(s){let t=document.getElementsByTagName("canvas")[0],r=!t;t||((t=document.createElement("canvas")).style.display="none",document.body.appendChild(t));let i=t.getContext("2d");i&&(n=i.createImageData(this.width,this.height)),r&&document.body.removeChild(t)}r={index:0,imageData:n},this.infos.push(r)}let s=r.index;return r.index+=t,n._dirty=!0,{imageData:n,index:s}}}function i(t,r,n,i,s){let o=t.imageData.data,a=4*t.index++;o[a++]=r,o[a++]=n,o[a++]=i,o[a++]=s}let s=Math.sqrt(3);class o{constructor(t,{axs:r}={}){this.font=t,this.axs=r,this.strokeImageInfos=new n(64,64),this.colDimImageInfos=new n(64,64),this.rowDimImageInfos=new n(64,64),this.colCellImageInfos=new n(64,64),this.rowCellImageInfos=new n(64,64),this.glyphInfos={}}getGlyphInfo(t){let r,n,o,a,l,u=this.glyphInfos[t.index];if(u)return u;let h=this.axs,{glyph:{path:{commands:c}}}=this.font._singleShapeToPath(t.shape,{axs:h}),d=1/0,p=-1/0,f=1/0,m=-1/0;for(let t of c)for(let r=1;r<t.length;r+=2)d=Math.min(d,t[r]),p=Math.max(p,t[r]),f=Math.min(f,t[r+1]),m=Math.max(m,t[r+1]);if(d>=p||f>=m||!c.length)return this.glyphInfos[t.index]={};let g=p-d,y=m-f,v=u7(c),b=[],x=[],_=[];for(r=8;r>=0;--r)_.push([]);for(r=8;r>=0;--r)x.push([]);function A(t,r,n){let i=b.length;function s(t,r,n){for(let i=t.length;i-- >0;){let s=t[i];r>s&&(r=s),n<s&&(n=s)}return{min:r,max:n}}b.push(n);
43let o=s(t,1,0),a=Math.max(Math.floor(9*o.min-.5),0),l=Math.min(Math.ceil(9*o.max+.5),9);for(let t=a;t<l;++t)_[t].push(i);let u=s(r,1,0),h=Math.max(Math.floor(9*u.min-.5),0),c=Math.min(Math.ceil(9*u.max+.5),9);for(let t=h;t<c;++t)x[t].push(i)}function E(t){var r;return(r=255*t)<0?0:r>255?255:r}class C{constructor(t,r,n,i){this.p0=t,this.c0=r,this.c1=n,this.p1=i}toQuadratic(){return{x:this.p0.x,y:this.p0.y,x1:this.p1.x,y1:this.p1.y,cx:((this.c0.x+this.c1.x)*3-(this.p0.x+this.p1.x))/4,cy:((this.c0.y+this.c1.y)*3-(this.p0.y+this.p1.y))/4}}quadError(){return eM.M.sub(eM.M.sub(this.p1,this.p0),eM.M.mult(eM.M.sub(this.c1,this.c0),3)).mag()/2}split(t){let r=eM.M.lerp(this.p0,this.c0,t),n=eM.M.lerp(this.c0,this.c1,t),i=eM.M.lerp(r,n,t);this.c1=eM.M.lerp(this.c1,this.p1,t),this.c0=eM.M.lerp(n,this.c1,t);let s=eM.M.lerp(i,this.c0,t),o=new C(this.p0,r,i,s);return this.p0=s,o}splitInflections(){let t=eM.M.sub(this.c0,this.p0),r=eM.M.sub(eM.M.sub(this.c1,this.c0),t),n=eM.M.sub(eM.M.sub(eM.M.sub(this.p1,this.c1),t),eM.M.mult(r,2)),i=[],s=r.x*n.y-r.y*n.x;if(0!==s){let o=t.x*n.y-t.y*n.x,a=t.x*r.y-t.y*r.x,l=o*o-4*s*a;if(l>=0){s<0&&(s=-s,o=-o,a=-a);let t=Math.sqrt(l),r=(-o-t)/(2*s),n=(-o+t)/(2*s);r>0&&r<1&&(i.push(this.split(r)),n=1-(1-n)/(1-r)),n>0&&n<1&&i.push(this.split(n))}}return i.push(this),i}}function D(t,r,n,i){let s=(t+n)/2,o=(r+i)/2;A([t,n],[r,i],{x:t,y:r,cx:s,cy:o})}function w(t,r,n,i){return 1e-5>Math.abs(n-t)&&1e-5>Math.abs(i-r)}for(let t of v){let r=(t.x-d)/g,i=(t.y-f)/y;if(!w(n,o,r,i)){switch(t.type){case"M":a=r,l=i;break;case"L":D(n,o,r,i);break;case"Q":{let s=(t.x1-d)/g,a=(t.y1-f)/y;A([n,r,s],[o,i,a],{x:n,y:o,cx:s,cy:a});break}case"Z":w(n,o,a,l)?b.push({x:n,y:o}):(D(n,o,a,l),b.push({x:a,y:l}));break;case"C":{let a=(t.x1-d)/g,l=(t.y1-f)/y,u=function(t,r,n,i,o,a,l,u){let h=new C(new eM.M(t,r),new eM.M(n,i),new eM.M(o,a),new eM.M(l,u)).splitInflections(),c=[],d=30/s;for(let t of h){let r,n=[];for(;!((r=d/t.quadError())>=.125);){let i=Math.pow(r,1/3),s=t.split(i),o=t.split(1-i/(1-i));c.push(s),n.push(t),t=o}r<1&&c.push(t.split(.5)),c.push(t),Array.prototype.push.apply(c,n.reverse())}return c}(n,o,a,l,(t.x2-d)/g,(t.y2-f)/y,r,i);for(let t=0;t<u.length;t++){let r=u[t].toQuadratic();A([r.x,r.x1,r.cx],[r.y,r.y1,r.cy],r)}break}default:throw Error(`unknown command type: ${t.type}`)}n=r,o=i}}let S=b.length,F=this.strokeImageInfos.findImage(S),T=F.index;for(let t=0;t<S;++t){let r=b[t];i(F,E(r.x),E(r.y),E(r.cx),E(r.cy))}function N(t,r,n){let s=t.length,o=r.findImage(s),a=o.index,l=0;for(let r=0;r<s;++r)l+=t[r].length;let u=n.findImage(l);for(let r=0;r<s;++r){let n=t[r],s=n.length,a=u.index;i(o,a>>7,127&a,s>>7,127&s);for(let t=0;t<s;++t){let r=n[t]+T;i(u,r>>7,127&r,0,0)}}return{cellImageInfo:u,dimOffset:a,dimImageInfo:o}}return(u=this.glyphInfos[t.index]={glyph:t,uGlyphRect:[d,f,p,m],strokeImageInfo:F,strokes:b,colInfo:N(_,this.colDimImageInfos,this.colCellImageInfos),rowInfo:N(x,this.rowDimImageInfos,this.rowCellImageInfos)}).uGridOffset=[u.colInfo.dimOffset,u.rowInfo.dimOffset],u}}g.R.prototype._renderText=function(r,n,i,s,o){if(!this.states.textFont||"string"==typeof this.states.textFont)return void console.log("WEBGL: you must load and set a font before drawing text. See `loadFont` and `textFont` for more details.");if(i>=s||!this.states.fillColor)return;if(!t.Font.hasGlyphData(this.states.textFont))return void console.log("WEBGL: only Opentype (.otf) and Truetype (.ttf) fonts with glyph data are supported. Make sure to set the font using textFont() before drawing text.");this.push();let a=this.states.strokeColor,l=this.states.drawMode;this.states.setValue("strokeColor",null),this.states.setValue("drawMode",d.h);let{font:u}=this.states.textFont;if(!u)throw Error("In WebGL mode, textFont() needs to be given the result of loadFont() instead of a font family name.");let h=u._currentAxes(this),c=u._getFontInfo(h),p=this.states.textSize/(u.data?.head?.unitsPerEm||1e3);this.translate(n,i,0),this.scale(p,p,1);let f=!this._defaultFontShader,m=this._getFontShader();m.init(),m.bindShader("text"),f&&(m.setUniform("uGridImageSize",[64,64]),m.setUniform("uCellsImageSize",[64,64]),m.setUniform("uStrokeImageSize",[64,64]),m.setUniform("uGridSize",[9,9]));let g=this.states.fillSet?this.states.curFillColor:[0,0,0,1];this._setGlobalUniforms(m),this._applyColorBlend(g);let y=this.geometryBufferCache.getGeometryByID("glyph");for(let t of(y||((y=this._textGeom=new eB.V(1,1,function(){for(let t=0;t<=1;t++)for(let r=0;r<=1;r++)this.vertices.push(new eM.M(r,t,0)),this.uvs.push(r,t)},this)).gid="glyph",y.computeFaces().computeNormals(),this.geometryBufferCache.ensureCached(y)),this.buffers.text))t._prepareBuffer(y,m);m.setUniform("uMaterialColor",g),this._disableRemainingAttributes(m),this._beforeDrawText(),this.glyphDataCache=this.glyphDataCache||new Set;try{for(let t of u._positionGlyphs(r)){let r=c.getGlyphInfo(t);if(r.uGlyphRect){let n=r.rowInfo,i=r.colInfo;for(let t of[r.strokeImageInfo.imageData,n.cellImageInfo.imageData,n.dimImageInfo.imageData,i.cellImageInfo.imageData,i.dimImageInfo.imageData])this.glyphDataCache.delete(t),this.glyphDataCache.add(t);for(;this.glyphDataCache.size>this.maxCachedGlyphs();){let t=this.glyphDataCache.values().next().value;this.glyphDataCache.delete(t);let r=this.textures.get(t);r&&(r.remove(),this.textures.delete(t))}m.setUniform("uSamplerStrokes",r.strokeImageInfo.imageData),m.setUniform("uSamplerRowStrokes",n.cellImageInfo.imageData),m.setUniform("uSamplerRows",n.dimImageInfo.imageData),m.setUniform("uSamplerColStrokes",
43i.cellImageInfo.imageData),m.setUniform("uSamplerCols",i.dimImageInfo.imageData),m.setUniform("uGridOffset",r.uGridOffset),m.setUniform("uGlyphRect",r.uGlyphRect),m.setUniform("uGlyphOffset",t.x),m.bindTextures(),this._drawBuffers(y,{mode:d.c,count:1})}}}finally{m.unbindShader(),this.states.setValue("strokeColor",a),this.states.setValue("drawMode",l),this._afterDrawText(),this.pop()}}}"undefined"!=typeof p5&&u9(p5,p5.prototype);var ht='#define PI 3.141592\n\nprecision highp float;\nprecision highp int;\n\nuniform mat4 uViewMatrix;\nuniform mat3 uCameraNormalMatrix;\n\nuniform bool uUseLighting;\n\nuniform int uDirectionalLightCount;\nuniform vec3 uLightingDirection[5];\nuniform vec3 uDirectionalDiffuseColors[5];\nuniform vec3 uDirectionalSpecularColors[5];\n\nuniform int uPointLightCount;\nuniform vec3 uPointLightLocation[5];\nuniform vec3 uPointLightDiffuseColors[5];	\nuniform vec3 uPointLightSpecularColors[5];\n\nuniform int uSpotLightCount;\nuniform float uSpotLightAngle[5];\nuniform float uSpotLightConc[5];\nuniform vec3 uSpotLightDiffuseColors[5];\nuniform vec3 uSpotLightSpecularColors[5];\nuniform vec3 uSpotLightLocation[5];\nuniform vec3 uSpotLightDirection[5];\n\nuniform bool uSpecular;\nuniform float uShininess;\nuniform float uMetallic;\n\nuniform float uConstantAttenuation;\nuniform float uLinearAttenuation;\nuniform float uQuadraticAttenuation;\n\n// setting from  _setImageLightUniforms()\n// boolean to initiate the calculateImageDiffuse and calculateImageSpecular\nuniform bool uUseImageLight;\n// texture for use in calculateImageDiffuse\nuniform sampler2D environmentMapDiffused;\n// texture for use in calculateImageSpecular\nuniform sampler2D environmentMapSpecular;\n\nconst float specularFactor = 2.0;\nconst float diffuseFactor = 0.73;\n\nstruct LightResult {\n  float specular;\n  float diffuse;\n};\n\nfloat _phongSpecular(\n  vec3 lightDirection,\n  vec3 viewDirection,\n  vec3 surfaceNormal,\n  float shininess) {\n\n  vec3 R = reflect(lightDirection, surfaceNormal);\n  return pow(max(0.0, dot(R, viewDirection)), shininess);\n}\n\nfloat _lambertDiffuse(vec3 lightDirection, vec3 surfaceNormal) {\n  return max(0.0, dot(-lightDirection, surfaceNormal));\n}\n\nLightResult _light(vec3 viewDirection, vec3 normal, vec3 lightVector, float shininess, float metallic) {\n\n  vec3 lightDir = normalize(lightVector);\n\n  //compute our diffuse & specular terms\n  LightResult lr;\n  float specularIntensity = mix(1.0, 0.4, metallic);\n  float diffuseIntensity = mix(1.0, 0.1, metallic);\n  if (uSpecular)\n    lr.specular = (_phongSpecular(lightDir, viewDirection, normal, shininess)) * specularIntensity;\n    lr.diffuse = _lambertDiffuse(lightDir, normal) * diffuseIntensity;\n  return lr;\n}\n\n// converts the range of "value" from [min1 to max1] to [min2 to max2]\nfloat map(float value, float min1, float max1, float min2, float max2) {\n  return min2 + (value - min1) * (max2 - min2) / (max1 - min1);\n}\n\nvec2 mapTextureToNormal( vec3 v ){\n  // x = r sin(phi) cos(theta)   \n  // y = r cos(phi)  \n  // z = r sin(phi) sin(theta)\n  float phi = acos( v.y );\n  // if phi is 0, then there are no x, z components\n  float theta = 0.0;\n  // else \n  theta = acos(v.x / sin(phi));\n  float sinTheta = v.z / sin(phi);\n  if (sinTheta < 0.0) {\n    // Turn it into -theta, but in the 0-2PI range\n    theta = 2.0 * PI - theta;\n  }\n  theta = theta / (2.0 * 3.14159);\n  phi = phi / 3.14159 ;\n  \n  vec2 angles = vec2( fract(theta + 0.25), 1.0 - phi );\n  return angles;\n}\n\n\nvec3 calculateImageDiffuse(vec3 vNormal, vec3 vViewPosition, float metallic){\n  // make 2 seperate builds \n  vec3 worldCameraPosition =  vec3(0.0, 0.0, 0.0);  // hardcoded world camera position\n  vec3 worldNormal = normalize(vNormal * uCameraNormalMatrix);\n  vec2 newTexCoor = mapTextureToNormal( worldNormal );\n  vec4 texture = TEXTURE( environmentMapDiffused, newTexCoor );\n  // this is to make the darker sections more dark\n  // png and jpg usually flatten the brightness so it is to reverse that\n  return mix(smoothstep(vec3(0.0), vec3(1.0), texture.xyz), vec3(0.0), metallic);\n}\n\nvec3 calculateImageSpecular(vec3 vNormal, vec3 vViewPosition, float shininess, float metallic){\n  vec3 worldCameraPosition =  vec3(0.0, 0.0, 0.0);\n  vec3 worldNormal = normalize(vNormal);\n  vec3 lightDirection = normalize( vViewPosition - worldCameraPosition );\n  vec3 R = reflect(lightDirection, worldNormal) * uCameraNormalMatrix;\n  vec2 newTexCoor = mapTextureToNormal( R );\n#ifdef WEBGL2\n  // In p5js the range of shininess is >= 1,\n  // Therefore roughness range will be ([0,1]*8)*20 or [0, 160]\n  // The factor of 8 is because currently the getSpecularTexture\n  // only calculated 8 different levels of roughness\n  // The factor of 20 is just to spread up this range so that,\n  // [1, max] of shininess is converted to [0,160] of roughness\n  float roughness = 20. / shininess;\n  vec4 outColor = textureLod(environmentMapSpecular, newTexCoor, roughness * 8.);\n#else\n  vec4 outColor = TEXTURE(environmentMapSpecular, newTexCoor);\n#endif\n  // this is to make the darker sections more dark\n  // png and jpg usually flatten the brightness so it is to reverse that\n  return mix(\n    pow(outColor.xyz, vec3(10)),\n    pow(outColor.xyz, vec3(1.2)),\n    metallic \n  );\n}\n\nvoid totalLight(\n  vec3 modelPosition,\n  vec3 normal,\n  float shininess,\n  float metallic,\n  out vec3 totalDiffuse,\n  out vec3 totalSpecular\n) {\n\n  totalSpecular = vec3(0.0);\n\n  if (!uUseLighting) {\n    totalDiffuse = vec3(1.0);\n    return;\n  }\n\n  totalDiffuse = vec3(0.0);\n\n  vec3 viewDirection = normalize(-modelPosition);\n\n  for (int j = 0; j < 5;
43 j++) {\n    if (j < uDirectionalLightCount) {\n      vec3 lightVector = (uViewMatrix * vec4(uLightingDirection[j], 0.0)).xyz;\n      vec3 lightColor = uDirectionalDiffuseColors[j];\n      vec3 specularColor = uDirectionalSpecularColors[j];\n      LightResult result = _light(viewDirection, normal, lightVector, shininess, metallic);\n      totalDiffuse += result.diffuse * lightColor;\n      totalSpecular += result.specular * lightColor * specularColor;\n    }\n\n    if (j < uPointLightCount) {\n      vec3 lightPosition = (uViewMatrix * vec4(uPointLightLocation[j], 1.0)).xyz;\n      vec3 lightVector = modelPosition - lightPosition;\n      //calculate attenuation\n      float lightDistance = length(lightVector);\n      float lightFalloff = 1.0 / (uConstantAttenuation + lightDistance * uLinearAttenuation + (lightDistance * lightDistance) * uQuadraticAttenuation);\n      vec3 lightColor = lightFalloff * uPointLightDiffuseColors[j];\n      vec3 specularColor = lightFalloff * uPointLightSpecularColors[j];\n\n      LightResult result = _light(viewDirection, normal, lightVector, shininess, metallic);\n      totalDiffuse += result.diffuse * lightColor;\n      totalSpecular += result.specular * lightColor * specularColor;\n    }\n\n    if(j < uSpotLightCount) {\n      vec3 lightPosition = (uViewMatrix * vec4(uSpotLightLocation[j], 1.0)).xyz;\n      vec3 lightVector = modelPosition - lightPosition;\n    \n      float lightDistance = length(lightVector);\n      float lightFalloff = 1.0 / (uConstantAttenuation + lightDistance * uLinearAttenuation + (lightDistance * lightDistance) * uQuadraticAttenuation);\n\n      vec3 lightDirection = (uViewMatrix * vec4(uSpotLightDirection[j], 0.0)).xyz;\n      float spotDot = dot(normalize(lightVector), normalize(lightDirection));\n      float spotFalloff;\n      if(spotDot < uSpotLightAngle[j]) {\n        spotFalloff = 0.0;\n      }\n      else {\n        spotFalloff = pow(spotDot, uSpotLightConc[j]);\n      }\n      lightFalloff *= spotFalloff;\n\n      vec3 lightColor = uSpotLightDiffuseColors[j];\n      vec3 specularColor = uSpotLightSpecularColors[j];\n     \n      LightResult result = _light(viewDirection, normal, lightVector, shininess, metallic);\n      \n      totalDiffuse += result.diffuse * lightColor * lightFalloff;\n      totalSpecular += result.specular * lightColor * specularColor * lightFalloff;\n    }\n  }\n\n  if( uUseImageLight ){\n    totalDiffuse += calculateImageDiffuse(normal, modelPosition, metallic);\n    totalSpecular += calculateImageSpecular(normal, modelPosition, shininess, metallic);\n  }\n\n  totalDiffuse *= diffuseFactor;\n  totalSpecular *= specularFactor;\n}\n';let{lineDefs:hr}=(0,e$.x)((t,r)=>`#define ${t} ${r}
44`),hn={normalVert:"IN vec3 aPosition;\nIN vec3 aNormal;\nIN vec2 aTexCoord;\nIN vec4 aVertexColor;\n\n#define HOOK_DEFINES\n\n#ifdef AUGMENTED_HOOK_getWorldInputs\nuniform mat4 uModelMatrix;\nuniform mat4 uViewMatrix;\nuniform mat3 uModelNormalMatrix;\nuniform mat3 uCameraNormalMatrix;\n#else\nuniform mat4 uModelViewMatrix;\nuniform mat3 uNormalMatrix;\n#endif\nuniform mat4 uProjectionMatrix;\n\nuniform vec4 uMaterialColor;\nuniform bool uUseVertexColor;\n\nOUT vec3 vVertexNormal;\nOUT highp vec2 vVertTexCoord;\nOUT vec4 vColor;\n\nstruct Vertex {\n  vec3 position;\n  vec3 normal;\n  vec2 texCoord;\n  vec4 color;\n};\n\nvoid main(void) {\n  HOOK_beforeVertex();\n\n  Vertex inputs;\n  inputs.position = aPosition;\n  inputs.normal = aNormal;\n  inputs.texCoord = aTexCoord;\n  inputs.color = (uUseVertexColor && aVertexColor.x >= 0.0) ? aVertexColor : uMaterialColor;\n#ifdef AUGMENTED_HOOK_getObjectInputs\n  inputs = HOOK_getObjectInputs(inputs);\n#endif\n\n#ifdef AUGMENTED_HOOK_getWorldInputs\n  inputs.position = (uModelMatrix * vec4(inputs.position, 1.)).xyz;\n  inputs.normal = uModelNormalMatrix * inputs.normal;\n  inputs = HOOK_getWorldInputs(inputs);\n#endif\n\n#ifdef AUGMENTED_HOOK_getWorldInputs\n  // Already multiplied by the model matrix, just apply view\n  inputs.position = (uViewMatrix * vec4(inputs.position, 1.)).xyz;\n  inputs.normal = uCameraNormalMatrix * inputs.normal;\n#else\n  // Apply both at once\n  inputs.position = (uModelViewMatrix * vec4(inputs.position, 1.)).xyz;\n  inputs.normal = uNormalMatrix * inputs.normal;\n#endif\n#ifdef AUGMENTED_HOOK_getCameraInputs\n  inputs = HOOK_getCameraInputs(inputs);\n#endif\n\n  // Pass varyings to fragment shader\n  vVertTexCoord = input
44s.texCoord;\n  vVertexNormal = normalize(inputs.normal);\n  vColor = inputs.color;\n\n  gl_Position = uProjectionMatrix * vec4(inputs.position, 1.);\n\n  HOOK_afterVertex();\n}\n",normalFrag:"IN vec3 vVertexNormal;\nvoid main(void) {\n  HOOK_beforeFragment();\n  OUT_COLOR = HOOK_getFinalColor(vec4(vVertexNormal, 1.0));\n  HOOK_afterFragment();\n}\n",basicFrag:"IN vec4 vColor;\nvoid main(void) {\n  HOOK_beforeFragment();\n  OUT_COLOR = HOOK_getFinalColor(vColor);\n  OUT_COLOR.rgb *= OUT_COLOR.a; // Premultiply alpha before rendering\n  HOOK_afterFragment();\n}\n",lightVert:ht+"// include lighting.glgl\n\nIN vec3 aPosition;\nIN vec3 aNormal;\nIN vec2 aTexCoord;\nIN vec4 aVertexColor;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform mat3 uNormalMatrix;\n\nuniform bool uUseVertexColor;\nuniform vec4 uMaterialColor;\n\nOUT highp vec2 vVertTexCoord;\nOUT vec3 vDiffuseColor;\nOUT vec3 vSpecularColor;\nOUT vec4 vColor;\n\nvoid main(void) {\n\n  vec4 viewModelPosition = uModelViewMatrix * vec4(aPosition, 1.0
44);\n  gl_Position = uProjectionMatrix * viewModelPosition;\n\n  vec3 vertexNormal = normalize(uNormalMatrix * aNormal);\n  vVertTexCoord = aTexCoord;\n\n  totalLight(viewModelPosition.xyz, vertexNormal, vDiffuseColor, vSpecularColor);\n\n  for (int i = 0; i < 8; i++) {\n    if (i < uAmbientLightCount) {\n      vDiffuseColor += uAmbientColor[i];\n    }\n  }\n  \n  vColor = ((uUseVertexColor && aVertexColor.x >= 0.0) ? aVertexColor : uMaterialColor);\n}\n",lightTextureFrag:"uniform vec4 uTint;\nuniform sampler2D uSampler;\nuniform bool isTexture;\nuniform bool uEmissive;\n\nIN highp vec2 vVertTexCoord;\nIN vec3 vDiffuseColor;\nIN vec3 vSpecularColor;\nIN vec4 vColor;\n\nvoid main(void) {\n  if(uEmissive && !isTexture) {\n    OUT_COLOR = vColor;\n  }\n  else {\n    vec4 baseColor = isTexture\n      // Textures come in with premultiplied alpha. To apply tint and still have\n      // premultiplied alpha output, we need to multiply the RGB channels by the\n      // tint RGB, and all channels by the tint alpha.\n      ? TEXTURE(uSampler, vVertTexCoord) * vec4(uTint.rgb/255., 1.) * (uTint.a/255.)\n      // Colors come in with unmultiplied alpha, so we need to multiply the RGB\n      // channels by alpha to convert it to premultiplied alpha.\n      : vec4(vColor.rgb * vColor.a, vColor.a);\n    OUT_COLOR = vec4(baseColor.rgb * vDiffuseColor + vSpecularColor, baseColor.a);\n  }\n}\n",phongVert:"precision highp int;\n\n#define HOOK_DEFINES\n\nIN vec3 aPosition;\nIN vec3 aNormal;\nIN vec2 aTexCoord;\nIN vec4 aVertexColor;\n\n#ifdef AUGMENTED_HOOK_getWorldInputs\nuniform mat4 uModelMatrix;\nuniform mat4 uViewMatrix;\nuniform mat3 uModelNormalMatrix;\nuniform mat3 uCameraNormalMatrix;\n#else\nuniform mat4 uModelViewMatrix;\nuniform mat3 uNormalMatrix;\n#endif\nuniform mat4 uProjectionMatrix;\n\nuniform bool uUseVertexColor;\nuniform vec4 uMaterialColor;\n\nOUT vec3 vNormal;\nOUT vec2 vTexCoord;\nOUT vec3 vViewPosition;\nOUT vec3 vAmbientColor;\nOUT vec4 vColor;\n\nstruct Vertex {\n  vec3 position;\n  vec3 normal;\n  vec2 texCoord;\n  vec4 color;\n};\n\nvoid main(void) {\n  HOOK_beforeVertex();\n\n  Vertex inputs;\n  inputs.position = aPosition;\n  inputs.normal = aNormal;\n  inputs.texCoord = aTexCoord;\n  inputs.color = (uUseVertexColor && aVertexColor.x >= 0.0) ? aVertexColor : uMaterialColor;\n#ifdef AUGMENTED_HOOK_getObjectInputs\n  inputs = HOOK_getObjectInputs(inputs);\n#endif\n\n#ifdef AUGMENTED_HOOK_getWorldInputs\n  inputs.position = (uModelMatrix * vec4(inputs.position, 1.)).xyz;\n  inputs.normal = uModelNormalMatrix * inputs.normal;\n  inputs = HOOK_getWorldInputs(inputs);\n#endif\n\n#ifdef AUGMENTED_HOOK_getWorldInputs\n  // Already multiplied by the model matrix, just apply view\n  inputs.position = (uViewMatrix * vec4(inputs.position, 1.)).xyz;\n  inputs.normal = uCameraNormalMatrix * inputs.normal;\n#else\n  // Apply both at once\n  inputs.position = (uModelViewMatrix * vec4(inputs.position, 1.)).xyz;\n  inputs.normal = uNormalMatrix * inputs.normal;\n#endif\n#ifdef AUGMENTED_HOOK_getCameraInputs\n  inputs = HOOK_getCameraInputs(inputs);\n#endif\n\n  // Pass varyings to fragment shader\n  vViewPosition = inputs.position;\n  vTexCoord = inputs.texCoord;\n  vNormal = inputs.normal;\n  vColor = inputs.color;\n\n  gl_Position = uProjectionMatrix * vec4(inputs.position, 1.);\n  HOOK_afterVertex();\n}\n",phongFrag:ht+"// include lighting.glsl\nprecision highp int;\n\nuniform bool uHasSetAmbient;\nuniform vec3 uAmbientColor;\nuniform vec4 uSpecularMatColor;\nuniform vec4 uAmbientMatColor;\nuniform vec4 uEmissiveMatColor;\n\nuniform vec4 uTint;\nuniform sampler2D uSampler;\nuniform bool isTexture;\n\nIN vec3 vNormal;\nIN vec2 vTexCoord;\nIN vec3 vViewPosition;\nIN vec4 vColor;\n\nstruct ColorComponents {\n  vec3 baseColor;\n  float opacity;\n  vec3 ambientColor;\n  vec3 specularColor;\n  vec3 diffuse;\n  vec3 ambient;\n  vec3 specular;\n  vec3 emissive;\n};\n\nstruct Inputs {\n  vec3 normal;\n  vec2 texCoord;\n  vec3 ambientLight;\n  vec3 ambientMaterial;\n  vec3 specularMaterial;\n  vec3 emissiveMaterial;\n  vec4 color;\n  float shininess;\n  float metalness;\n};\n\nvoid main(void) {\n  HOOK_beforeFragment();
44\n\n  Inputs inputs;\n  inputs.normal = normalize(vNormal);\n  inputs.texCoord = vTexCoord;\n  inputs.ambientLight = uAmbientColor;\n  inputs.color = isTexture\n      ? TEXTURE(uSampler, vTexCoord) * (vec4(uTint.rgb/255., 1.) * uTint.a/255.)\n      : vColor;\n  if (isTexture && inputs.color.a > 0.0) {\n    // Textures come in with premultiplied alpha. Temporarily unpremultiply it\n    // so hooks users don't have to think about premultiplied alpha.\n    inputs.color.rgb /= inputs.color.a;\n  }\n  inputs.shininess = uShininess;\n  inputs.metalness = uMetallic;\n  inputs.ambientMaterial = uHasSetAmbient ? uAmbientMatColor.rgb : inputs.color.rgb;\n  inputs.specularMaterial = uSpecularMatColor.rgb;\n  inputs.emissiveMaterial = uEmissiveMatColor.rgb;\n  inputs = HOOK_getPixelInputs(inputs);\n\n  vec3 diffuse;\n  vec3 specular;\n  totalLight(vViewPosition, inputs.normal, inputs.shininess, inputs.metalness, diffuse, specular);\n\n  // Calculating final color as result of all lights (plus emissive term).\n\n  vec4 baseColor = inputs.color;\n  ColorComponents c;\n  c.opacity = baseColor.a;\n  c.baseColor = baseColor.rgb;\n  c.ambientColor = inputs.ambientMaterial;\n  c.specularColor = inputs.specularMaterial;\n  c.diffuse = diffuse;\n  c.ambient = inputs.ambientLight;\n  c.specular = specular;\n  c.emissive = inputs.emissiveMaterial;\n  OUT_COLOR = HOOK_getFinalColor(HOOK_combineColors(c));\n  OUT_COLOR.rgb *= OUT_COLOR.a; // Premultiply alpha before rendering\n  HOOK_afterFragment();\n}\n",fontVert:"IN vec3 aPosition;\nIN vec2 aTexCoord;\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\n\nuniform vec4 uGlyphRect;\nuniform float uGlyphOffset;\n\nOUT vec2 vTexCoord;
44\n\nvoid main() {\n  vec4 positionVec4 = vec4(aPosition, 1.0);\n\n  // scale by the size of the glyph's rectangle\n  positionVec4.xy *= uGlyphRect.zw - uGlyphRect.xy;\n\n  // Expand glyph bounding boxes by 1px on each side to give a bit of room\n  // for antialiasing\n  vec3 newOrigin = (uModelViewMatrix * vec4(0., 0., 0., 1.)).xyz;\n  vec3 newDX = (uModelViewMatrix * vec4(1., 0., 0., 1.)).xyz;\n  vec3 newDY = (uModelViewMatrix * vec4(0., 1., 0., 1.)).xyz;\n  vec2 pixelScale = vec2(\n    1. / length(newOrigin - newDX),\n    1. / length(newOrigin - newDY)\n  );\n  vec2 offset = pixelScale * normalize(aTexCoord - vec2(0.5, 0.5));\n  vec2 textureOffset = offset * (1. / vec2(\n    uGlyphRect.z - uGlyphRect.x,\n    uGlyphRect.w - uGlyphRect.y\n  ));\n\n  // move to the corner of the glyph\n  positionVec4.xy += uGlyphRect.xy;\n\n  // move to the letter's line offset\n  positionVec4.x += uGlyphOffset;\n\n  positionVec4.xy += offset;\n  \n  gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n  vTexCoord = aTexCoord + textureOffset;\n}\n",fontFrag:"#ifndef WEBGL2\n#extension GL_OES_standard_derivatives : enable\n#endif\n\n#if 0\n  // simulate integer math using floats\n	#define int float\n	#define ivec2 vec2\n	#define INT(x) float(x)\n\n	int ifloor(float v) { return floor(v); }\n	ivec2 ifloor(vec2 v) { return floor(v); }\n\n#else\n  // use native integer math\n	precision highp int;\n	#define INT(x) x\n\n	int ifloor(float v) { return int(v); }\n	int ifloor(int v) { return v; }\n	ivec2 ifloor(vec2 v) { return ivec2(v); }\n\n#endif\n\nuniform sampler2D uSamplerStrokes;\nuniform sampler2D uSamplerRowStrokes;\nuniform sampler2D uSamplerRows;\nuniform sampler2D uSamplerColStrokes;\nuniform sampler2D uSamplerCols;\n\nuniform ivec2 uStrokeImageSize;\nuniform ivec2 uCellsImageSize;\nuniform ivec2 uGridImageSize;\n\nuniform ivec2 uGridOffset;\nuniform ivec2 uGridSize;\nuniform vec4 uMaterialColor;\n\nIN vec2 vTexCoord;\n\n// some helper functions\nint ROUND(float v) { return ifloor(v + 0.5); }\nivec2 ROUND(vec2 v) { return ifloor(v + 0.5); }\nfloat saturate(float v) { return clamp(v, 0.0, 1.0); }\nvec2 saturate(vec2 v) { return clamp(v, 0.0, 1.0); }\n\nint mul(float v1, int v2) {\n  return ifloor(v1 * float(v2));\n}\n\nivec2 mul(vec2 v1, ivec2 v2) {\n  return ifloor(v1 * vec2(v2) + 0.5);\n}\n\n// unpack a 16-bit integer from a float vec2\nint getInt16(vec2 v) {\n  ivec2 iv = ROUND(v * 255.0);\n  return iv.x * INT(128) + iv.y;\n}\n\nvec2 pixelScale;\nvec2 coverage = vec2(0.0);\nvec2 weight = vec2(0.5);\nconst float minDistance = 1.0/8192.0;\nconst float hardness = 1.05; // amount of antialias\n\n// the maximum number of curves in a glyph\nconst int N = INT(250);\n\n// retrieves an indexed pixel from a sampler\nvec4 getTexel(sampler2D sampler, int pos, ivec2 size) {\n  int width = size.x;\n  int y = ifloor(pos / width);\n  int x = pos - y * width;  // pos % width\n\n  return TEXTURE(sampler, (vec2(x, y) + 0.5) / vec2(size));\n}\n\nvoid calulateCrossings(vec2 p0, vec2 p1, vec2 p2, out vec2 C1, out vec2 C2) {\n\n  // get the coefficients of the quadratic in t\n  vec2 a = p0 - p1 * 2.0 + p2;\n  vec2 b = p0 - p1;\n  vec2 c = p0 - vTexCoord;\n\n  // found out which values of 't' it crosses the axes\n  vec2 surd = sqrt(max(vec2(0.0), b * b - a * c));\n  vec2 t1 = ((b - surd) / a).yx;\n  vec2 t2 = ((b + surd) / a).yx;\n\n  // approximate straight lines to avoid rounding errors\n  if (abs(a.y) < 0.001)\n    t1.x = t2.x = c.y / (2.0 * b.y);\n\n  if (abs(a.x) < 0.001)\n    t1.y = t2.y = c.x / (2.0 * b.x);\n\n  // plug into quadratic formula to find the corrdinates of the crossings\n  C1 = ((a * t1 - b * 2.0) * t1 + c) * pixelScale;\n  C2 = ((a * t2 - b * 2.0) * t2 + c) * pixelScale;\n}\n\nvoid coverageX(vec2 p0, vec2 p1, vec2 p2) {\n\n  vec2 C1, C2;\n  calulateCrossings(p0, p1, p2, C1, C2);\n\n  // determine on which side of the x-axis the points lie\n  bool y0 = p0.y > vTexCoord.y;\n  bool y1 = p1.y > vTexCoord.y;\n  bool y2 = p2.y > vTexCoord.y;\n\n  // could web be under the curve (after t1)?\n  if (y1 ? !y2 : y0) {\n    // add the coverage for t1\n    coverage.x += saturate(C1.x + 0.5);
44\n    // calculate the anti-aliasing for t1\n    weight.x = min(weight.x, abs(C1.x));\n  }\n\n  // are we outside the curve (after t2)?\n  if (y1 ? !y0 : y2) {\n    // subtract the coverage for t2\n    coverage.x -= saturate(C2.x + 0.5);\n    // calculate the anti-aliasing for t2\n    weight.x = min(weight.x, abs(C2.x));\n  }\n}\n\n// this is essentially the same as coverageX, but with the axes swapped\nvoid coverageY(vec2 p0, vec2 p1, vec2 p2) {\n\n  vec2 C1, C2;\n  calulateCrossings(p0, p1, p2, C1, C2);\n\n  bool x0 = p0.x > vTexCoord.x;\n  bool x1 = p1.x > vTexCoord.x;\n  bool x2 = p2.x > vTexCoord.x;\n\n  if (x1 ? !x2 : x0) {\n    coverage.y -= saturate(C1.y + 0.5);\n    weight.y = min(weight.y, abs(C1.y));\n  }\n\n  if (x1 ? !x0 : x2) {\n    coverage.y += saturate(C2.y + 0.5);\n    weight.y = min(weight.y, abs(C2.y));\n  }\n}\n\nvoid main() {\n\n  // calculate the pixel scale based on screen-coordinates\n  pixelScale = hardness / fwidth(vTexCoord);\n\n  // which grid cell is this pixel in?\n  ivec2 gridCoord = ifloor(vTexCoord * vec2(uGridSize));\n\n  // intersect curves in this row\n  {\n    // the index into the row info bitmap\n    int rowIndex = gridCoord.y + uGridOffset.y;\n    // fetch the info texel\n    vec4 rowInfo = getTexel(uSamplerRows, rowIndex, uGridImageSize);\n    // unpack the rowInfo\n    int rowStrokeIndex = getInt16(rowInfo.xy);\n    int rowStrokeCount = getInt16(rowInfo.zw);\n\n    for (int iRowStroke = INT(0); iRowStroke < N; iRowStroke++) {\n      if (iRowStroke >= rowStrokeCount)\n        break;\n\n      // each stroke is made up of 3 points: the start and control point\n      // and the start of the next curve.\n      // fetch the indices of this pair of strokes:\n      vec4 strokeIndices = getTexel(uSamplerRowStrokes, rowStrokeIndex++, uCellsImageSize);\n\n      // unpack the stroke index\n      int strokePos = getInt16(strokeIndices.xy);\n\n      // fetch the two strokes\n      vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n      vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n\n      // calculate the coverage\n      coverageX(stroke0.xy, stroke0.zw, stroke1.xy);\n    }\n  }\n\n  // intersect curves in this column\n  {\n    int colIndex = gridCoord.x + uGridOffset.x;\n    vec4 colInfo = getTexel(uSamplerCols, colIndex, uGridImageSize);\n    int colStrokeIndex = getInt16(colInfo.xy);\n    int colStrokeCount = getInt16(colInfo.zw);\n    \n    for (int iColStroke = INT(0); iColStroke < N; iColStroke++) {\n      if (iColStroke >= colStrokeCount)\n        break;\n\n      vec4 strokeIndices = getTexel(uSamplerColStrokes, colStrokeIndex++, uCellsImageSize);\n\n      int strokePos = getInt16(strokeIndices.xy);\n      vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n      vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n      coverageY(stroke0.xy, stroke0.zw, stroke1.xy);\n    }\n  }\n\n  weight = saturate(1.0 - weight * 2.0);\n  float distance = max(weight.x + weight.y, minDistance); // manhattan approx.\n  float antialias = abs(dot(coverage, weight) / distance);\n  float cover = min(abs(coverage.x), abs(coverage.y));\n  OUT_COLOR = vec4(uMaterialColor.rgb, 1.) * uMaterialColor.a;\n  OUT_COLOR *= saturate(max(antialias, cover));\n}\n",lineVert:hr
vendor: 10,871 bytes, line 44
44+"/*\n  Part of the Processing project - http://processing.org\n  Copyright (c) 2012-15 The Processing Foundation\n  Copyright (c) 2004-12 Ben Fry and Casey Reas\n  Copyright (c) 2001-04 Massachusetts Institute of Technology\n  This library is free software; you can redistribute it and/or\n  modify it under the terms of the GNU Lesser General Public\n  License as published by the Free Software Foundation, version 2.1.\n  This library is distributed in the hope that it will be useful,\n  but WITHOUT ANY WARRANTY; without even the implied warranty of\n  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n  Lesser General Public License for more details.\n  You should have received a copy of the GNU Lesser General\n  Public License along with this library; if not, write to the\n  Free Software Foundation, Inc., 59 Temple Place, Suite 330,\n  Boston, MA  02111-1307  USA\n*/\n\n#define PROCESSING_LINE_SHADER\n\n#define HOOK_DEFINES\n\nprecision highp int;\nprecision highp float;\n\n#ifdef AUGMENTED_HOOK_getWorldInputs\nuniform mat4 uModelMatrix;\nuniform mat4 uViewMatrix;\n#else\nuniform mat4 uModelViewMatrix;\n#endif\n\nuniform mat4 uProjectionMatrix;\nuniform float uStrokeWeight;\n\nuniform bool uUseLineColor;\nuniform bool uSimpleLines;\nuniform vec4 uMaterialColor;\n\nuniform vec4 uViewport;\nuniform int uPerspective;\nuniform int uStrokeJoin;\n\nIN vec3 aPosition;\nIN vec3 aTangentIn;\nIN vec3 aTangentOut;\nIN float aSide;\nIN vec4 aVertexColor;\n\nOUT vec4 vColor;\nOUT vec2 vTangent;\nOUT vec2 vCenter;\nOUT vec2 vPosition;\nOUT float vMaxDist;\nOUT float vCap;\nOUT float vJoin;\nOUT float vStrokeWeight;\n\nvec2 lineIntersection(vec2 aPoint, vec2 aDir, vec2 bPoint, vec2 bDir) {\n  // Rotate and translate so a starts at the origin and goes out to the right\n  bPoint -= aPoint;\n  vec2 rotatedBFrom = vec2(\n    bPoint.x*aDir.x + bPoint.y*aDir.y,\n    bPoint.y*aDir.x - bPoint.x*aDir.y\n  );\n  vec2 bTo = bPoint + bDir;\n  vec2 rotatedBTo = vec2(\n    bTo.x*aDir.x + bTo.y*aDir.y,\n    bTo.y*aDir.x - bTo.x*aDir.y\n  );\n  float intersectionDistance =\n    rotatedBTo.x + (rotatedBFrom.x - rotatedBTo.x) * rotatedBTo.y /\n    (rotatedBTo.y - rotatedBFrom.y);\n  return aPoint + aDir * intersectionDistance;\n}\n\nstruct StrokeVertex {\n  vec3 position;\n  vec3 tangentIn;\n  vec3 tangentOut;\n  vec4 color;\n  float weight;\n};\n\nvoid main() {\n  HOOK_beforeVertex();\n\n  if (!uSimpleLines) {\n      // Caps have one of either the in or out tangent set to 0\n      vCap = (aTangentIn == vec3(0.)) != (aTangentOut == vec3(0.)) ? 1. : 0.;\n\n      // Joins have two unique, defined tangents\n      vJoin = (\n          aTangentIn != vec3(0.) &&\n          aTangentOut != vec3(0.) &&\n          aTangentIn != aTangentOut\n      ) ? 1. : 0.;\n  }\n\n  StrokeVertex inputs;\n  inputs.position = aPosition.xyz;\n  inputs.color = uUseLineColor ? aVertexColor : uMaterialColor;\n  inputs.weight = uStrokeWeight;\n  inputs.tangentIn = aTangentIn;\n  inputs.tangentOut = aTangentOut;\n\n#ifdef AUGMENTED_HOOK_getObjectInputs\n  inputs = HOOK_getObjectInputs(inputs);\n#endif\n\n#ifdef AUGMENTED_HOOK_getWorldInputs\n  inputs.position = (uModelMatrix * vec4(inputs.position, 1.)).xyz;\n  inputs.tangentIn = (uModelMatrix * vec4(aTangentIn, 0.)).xyz;\n  inputs.tangentOut = (uModelMatrix * vec4(aTangentOut, 0.)).xyz;\n  inputs = HOOK_getWorldInputs(inputs);\n#endif\n\n#ifdef AUGMENTED_HOOK_getWorldInputs\n  // Already multiplied by the model matrix, just apply view\n  inputs.position = (uViewMatrix * vec4(inputs.position, 1.)).xyz;\n  inputs.tangentIn = (uViewMatrix * vec4(aTangentIn, 0.)).xyz;\n  inputs.tangentOut = (uViewMatrix * vec4(aTangentOut, 0.)).xyz;\n#else\n  // Apply both at once\n  inputs.position = (uModelViewMatrix * vec4(inputs.position, 1.)).xyz;\n  inputs.tangentIn = (uModelViewMatrix * vec4(aTangentIn, 0.)).xyz;\n  inputs.tangentOut = (uModelViewMatrix * vec4(aTangentOut, 0.)).xyz;\n#endif\n#ifdef AUGMENTED_HOOK_getCameraInputs\n  inputs = HOOK_getCameraInputs(inputs);\n#endif\n\n  vec4 posp = vec4(inputs.position, 1.);\n  vec4 posqIn = vec4(inputs.position + inputs.tangentIn, 1.);\n  vec4 posqOut = vec4(inputs.position + inputs.tangentOut, 1.);\n  vStrokeWeight = inputs.weight;\n\n  float facingCamera = pow(\n    // The word space tangent's z value is 0 if it's facing the camera\n    abs(normalize(posqIn-posp).z),\n\n    // Using pow() here to ramp `facingCamera` up from 0 to 1 really quickly\n    // so most lines get scaled and don't get clipped\n    0.25\n  );\n\n  // Moving vertices slightly toward the camera\n  // to avoid depth-fighting with the fill triangles.\n  // A mix of scaling and offsetting is used based on distance\n  // Discussion here:\n  // https://github.com/processing/p5.js/issues/7200 \n\n  // using a scale <1 moves the lines towards nearby camera\n  // in order to prevent popping effects due to half of\n  // the line disappearing behind the geometry faces.\n  float zDistance = -posp.z; \n  float distanceFactor = smoothstep(0.0, 800.0, zDistance); \n  \n  // Discussed here:\n  // http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=252848  \n  float scale = mix(1., 0.995, facingCamera);\n  float dynamicScale = mix(scale, 1.0, distanceFactor); // Closer = more scale, farther = less\n\n  posp.xyz = posp.xyz * dynamicScale;\n  posqIn.xyz = posqIn.xyz * dynamicScale;\n  posqOut.xyz = posqOut.xyz * dynamicScale;\n\n  // Moving vertices slightly toward camera when far away \n  // https://github.com/processing/p5.js/issues/6956 \n  float zOffset = mix(0., -1., facingCamera);\n  float dynamicZAdjustment = mix(0.0, zOffset, distanceFactor); // Closer = less zAdjustment, farther = more\n\n  posp.z -= dynamicZAdjustment;\n  posqIn.z -= dynamicZAdjustment;\n  posqOut.z -= dynamicZAdjustment;\n  \n  vec4 p = uProjectionMatrix * posp;\n  vec4 qIn = uProjectionMatrix * posqIn;\n  vec4 qOut = uProjectionMatrix * posqOut;\n\n  // formula to convert from clip space (range -1..1) to screen space (range 0..[width or height])\n  // screen_p = (p.xy/p.w + <1,1>) * 0.5 * uViewport.zw\n\n  // prevent division by W by transforming the tangent formula (div by 0 causes\n  // the line to disappear, see https://github.com/processing/processing/issues/5183)\n  // t = screen_q - screen_p\n  //\n  // tangent is normalized and we don't care which aDirection it points to (+-)\n  // t = +- normalize( screen_q - screen_p )\n  // t = +- normalize( (q.xy/q.w+<1,1>)*0.5*uViewport.zw - (p.xy/p.w+<1,1>)*0.5*uViewport.zw )\n  //\n  // extract common factor, <1,1> - <1,1> cancels out\n  // t = +- normalize( (q.xy/q.w - p.xy/p.w) * 0.5 * uViewport.zw )\n  //\n  // convert to common divisor\n  // t = +- normalize( ((q.xy*p.w - p.xy*q.w) / (p.w*q.w)) * 0.5 * uViewport.zw )\n  //\n  // remove the common scalar divisor/factor, not needed due to normalize and +-\n  // (keep uViewport - can't remove because it has different components for x and y\n  //  and corrects for aspect ratio, see https://github.com/processing/processing/issues/5181)\n  // t = +- normalize( (q.xy*p.w - p.xy*q.w) * uViewport.zw )\n\n  vec2 tangentIn = normalize((qIn.xy*p.w - p.xy*qIn.w) * uViewport.zw);\n  vec2 tangentOut = normalize((qOut.xy*p.w - p.xy*qOut.w) * uViewport.zw);\n\n  vec2 curPerspScale;\n  if(uPerspective == 1) {\n    // Perspective ---\n    // convert from world to clip by multiplying with projection scaling factor\n    // to get the right thickness (see https://github.com/processing/processing/issues/5182)\n\n    // The y value of the projection matrix may be flipped if rendering to a Framebuffer.\n    // Multiplying again by its sign here negates the flip to get just the scale.\n    curPerspScale = (uProjectionMatrix * vec4(1, sign(uProjectionMatrix[1][1]), 0, 0)).xy;\n  } else {\n    // No Perspective ---\n    // multiply by W (to cancel out division by W later in the pipeline) and\n    // convert from screen to clip (derived from clip to screen above)\n    curPerspScale = p.w / (0.5 * uViewport.zw);\n  }\n\n  vec2 offset;\n  if (vJoin == 1. && !uSimpleLines) {\n    vTangent = normalize(tangentIn + tangentOut);\n    vec2 normalIn = vec2(-tangentIn.y, tangentIn.x);\n    vec2 normalOut = vec2(-tangentOut.y, tangentOut.x);\n    float side = sign(aSide);\n    float sideEnum = abs(aSide);\n\n    // We generate vertices for joins on either side of the centerline, but\n    // the \"elbow\" side is the only one needing a join. By not setting the\n    // offset for the other side, all its vertices will end up in the same\n    // spot and not render, effectively discarding it.\n    if (sign(dot(tangentOut, vec2(-tangentIn.y, tangentIn.x))) != side) {\n      // Side enums:\n      //   1: the side going into the join\n      //   2: the middle of the join\n      //   3: the side going out of the join\n      if (sideEnum == 2.) {\n        // Calculate the position + tangent on either side of the join, and\n        // find where the lines intersect to find the elbow of the join\n        vec2 c = (posp.xy/posp.w + vec2(1.,1.)) * 0.5 * uViewport.zw;\n        vec2 intersection = lineIntersection(\n          c + (side * normalIn * inputs.weight / 2.),\n          tangentIn,\n          c + (side * normalOut * inputs.weight / 2.),\n          tangentOut\n        );\n        offset = (intersection - c);\n\n        // When lines are thick and the angle of the join approaches 180, the\n        // elbow might be really far from the center. We'll apply a limit to\n        // the magnitude to avoid lines going across the whole screen when this\n        // happens.\n        float mag = length(offset);\n        float maxMag = 3. * inputs.weight;\n        if (mag > maxMag) {\n          offset *= maxMag / mag;\n        }\n      } else if (sideEnum == 1.) {\n        offset = side * normalIn * inputs.weight / 2.;\n      } else if (sideEnum == 3.) {\n        offset = side * normalOut * inputs.weight / 2.;\n      }\n    }\n    if (uStrokeJoin == STROKE_JOIN_BEVEL) {\n      vec2 avgNormal = vec2(-vTangent.y, vTangent.x);\n      vMaxDist = abs(dot(avgNormal, normalIn * inputs.weight / 2.));\n    } else {\n      vMaxDist = inputs.weight / 2.;\n    }\n  } else {\n    vec2 tangent = aTangentIn == vec3(0.) ? tangentOut : tangentIn;\n\n    vTangent = tangent;\n    vec2 normal = vec2(-tangent.y, tangent.x);\n\n    float normalOffset = sign(aSide);\n    // Caps will have side values of -2 or 2 on the edge of the cap that\n    // extends out from the line\n    float tangentOffset = abs(aSide) - 1.;\n    offset = (normal * normalOffset + tangent * tangentOffset) *\n      inputs.weight * 0.5;\n    vMaxDist = inputs.weight / 2.;\n  }\n\n  vCenter = p.xy;\n  vPosition = vCenter + offset;\n  vColor = inputs.color;\n\n  gl_Position.xy = p.xy + offset.xy * curPerspScale;\n  gl_Position.zw = p.zw;\n  \n  HOOK_afterVertex();\n}\n",lineFrag:
44hr+"precision highp int;\nprecision highp float;\n\nuniform vec4 uMaterialColor;\nuniform int uStrokeCap;\nuniform int uStrokeJoin;\n\nIN vec4 vColor;\nIN vec2 vTangent;\nIN vec2 vCenter;\nIN vec2 vPosition;\nIN float vStrokeWeight;\nIN float vMaxDist;\nIN float vCap;\nIN float vJoin;\n\nfloat distSquared(vec2 a, vec2 b) {\n  vec2 aToB = b - a;\n  return dot(aToB, aToB);\n}\n\nstruct Inputs {\n  vec4 color;\n  vec2 tangent;\n  vec2 center;\n  vec2 position;\n  float strokeWeight;\n};\n\nvoid main() {\n  HOOK_beforeFragment();\n\n  Inputs inputs;\n  inputs.color = vColor;\n  inputs.tangent = vTangent;\n  inputs.center = vCenter;\n  inputs.position = vPosition;\n  inputs.strokeWeight = vStrokeWeight;\n  inputs = HOOK_getPixelInputs(inputs);\n\n  if (vCap > 0.) {\n    if (\n      uStrokeCap == STROKE_CAP_ROUND &&\n      HOOK_shouldDiscard(distSquared(inputs.position, inputs.center) > inputs.strokeWeight * inputs.strokeWeight * 0.25)\n    ) {\n      discard;\n    } else if (\n      uStrokeCap == STROKE_CAP_SQUARE &&\n      HOOK_shouldDiscard(dot(inputs.position - inputs.center, inputs.tangent) > 0.)\n    ) {\n      discard;\n    // Use full area for PROJECT\n    } else if (HOOK_shouldDiscard(false)) {\n      discard;\n    }\n  } else if (vJoin > 0.) {\n    if (\n      uStrokeJoin == STROKE_JOIN_ROUND &&\n      HOOK_shouldDiscard(distSquared(inputs.position, inputs.center) > inputs.strokeWeight * inputs.strokeWeight * 0.25)\n    ) {\n      discard;\n    } else if (uStrokeJoin == STROKE_JOIN_BEVEL) {\n      vec2 normal = vec2(-inputs.tangent.y, inputs.tangent.x);\n      if (HOOK_shouldDiscard(abs(dot(inputs.position - inputs.center, normal)) > vMaxDist)) {\n        discard;\n      }\n    // Use full area for MITER\n    } else if (HOOK_shouldDiscard(false)) {\n      discard;\n    }\n  }\n  OUT_COLOR = HOOK_getFinalColor(vec4(inputs.color.rgb, 1.) * inputs.color.a);\n  HOOK_afterFragment();\n}\n",imageLightVert:"precision highp float;\nIN vec3 aPosition;\nIN vec3 aNormal;\nIN vec2 aTexCoord;\n\nOUT vec3 localPos;\nOUT vec3 vWorldNormal;\nOUT vec3 vWorldPosition;\nOUT vec2 vTexCoord;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform mat3 uNormalMatrix;\n\nvoid main() {\n  // Multiply the position by the matrix.\n  vec4 viewModelPosition = uModelViewMatrix * vec4(aPosition, 1.0
44);\n  gl_Position = uProjectionMatrix * viewModelPosition;  \n  \n  // orient the normals and pass to the fragment shader\n  vWorldNormal = uNormalMatrix * aNormal;\n  \n  // send the view position to the fragment shader\n  vWorldPosition = (uModelViewMatrix * vec4(aPosition, 1.0)).xyz;\n  \n  localPos = vWorldPosition;\n  vTexCoord = aTexCoord;\n}\n\n\n/*\nin the vertex shader we'll compute the world position and world oriented normal of the vertices and pass those to the fragment shader as varyings.\n*/\n",imageLightDiffusedFrag:"precision highp float;\nIN vec3 localPos;\n\n// the HDR cubemap converted (can be from an equirectangular environment map.)\nuniform sampler2D environmentMap;\nIN vec2 vTexCoord;\n\nconst float PI = 3.14159265359;\n\nvec2 nTOE( vec3 v ){\n  // x = r sin(phi) cos(theta)   \n  // y = r cos(phi)  \n  // z = r sin(phi) sin(theta)\n  float phi = acos( v.y );\n  // if phi is 0, then there are no x, z components\n  float theta = 0.0;\n  // else \n  theta = acos(v.x / sin(phi));\n  float sinTheta = v.z / sin(phi);\n  if (sinTheta < 0.0) {\n    // Turn it into -theta, but in the 0-2PI range\n    theta = 2.0 * PI - theta;\n  }\n  theta = theta / (2.0 * 3.14159);\n  phi = phi / 3.14159 ;\n  \n  vec2 angles = vec2( phi, theta );\n  return angles;\n}\n\nfloat random(vec2 p) {\n  vec3 p3  = fract(vec3(p.xyx) * .1031);\n  p3 += dot(p3, p3.yzx + 33.33);\n  return fract((p3.x + p3.y) * p3.z);\n}\n\nvoid main()\n{   	 \n	// the sample direction equals the hemisphere's orientation\n  float phi = vTexCoord.x * 2.0 * PI;\n  float theta = vTexCoord.y * PI;\n  float x = sin(theta) * cos(phi);\n  float y = sin(theta) * sin(phi);\n  float z = cos(theta);\n  vec3 normal = vec3( x, y, z);\n\n	// Discretely sampling the hemisphere given the integral's\n  // spherical coordinates translates to the following fragment code:\n	vec3 irradiance = vec3(0.0);  \n	vec3 up	= vec3(0.0, 1.0, 0.0);\n	vec3 right = normalize(cross(up, normal));\n	up = normalize(cross(normal, right));\n\n	//  We specify a fixed sampleDelta delta value to traverse\n  // the hemisphere; decreasing or increasing the sample delta\n  // will increase or decrease the accuracy respectively.\n	const float sampleDelta = 0.100;\n	float nrSamples = 0.0;\n  float randomOffset = random(gl_FragCoord.xy) * sampleDelta;\n	for(float rawPhi = 0.0; rawPhi < 2.0 * PI; rawPhi += sampleDelta)\n	{\n    float phi = rawPhi + randomOffset;\n    for(float rawTheta = 0.0; rawTheta < ( 0.5 ) * PI; rawTheta += sampleDelta)\n    {\n      float theta = rawTheta + randomOffset;\n      // spherical to cartesian (in tangent space) // tangent space to world // add each sample result to irradiance\n      float x = sin(theta) * cos(phi);\n      float y = sin(theta) * sin(phi);\n      float z = cos(theta);\n      vec3 tangentSample = vec3( x, y, z);\n      \n      vec3 sampleVec = tangentSample.x * right + tangentSample.y * up + tangentSample.z * normal;\n        irradiance += (TEXTURE(environmentMap, nTOE(sampleVec)).xyz) * cos(theta) * sin(theta);\n      nrSamples++;\n    }\n	}\n	// divide by the total number of samples taken, giving us the average sampled irradiance.\n	irradiance = PI * irradiance * (1.0 / float(nrSamples )) ;\n  \n \n	OUT_COLOR = vec4(irradiance, 1.0);\n}",imageLightSpecularFrag:"precision highp float;\r\nIN vec3 localPos;\r\nIN vec2 vTexCoord;\r\n\r\n// our texture\r\nuniform sampler2D environmentMap;\r\nuniform float roughness;\r\n\r\nconst float PI = 3.14159265359;\r\n\r\nfloat VanDerCorput(int bits);\r\nvec2 HammersleyNoBitOps(int i, int N);\r\nvec3 ImportanceSampleGGX(vec2 Xi, vec3 N, float roughness);\r\n\r\n\r\nvec2 nTOE( vec3 v ){\r\n  // x = r sin(phi) cos(theta)   \r\n  // y = r cos(phi)  \r\n  // z = r sin(phi) sin(theta)\r\n  float phi = acos( v.y );\r\n  // if phi is 0, then there are no x, z components\r\n  float theta = 0.0;\r\n  // else \r\n  theta = acos(v.x / sin(phi));\r\n  float sinTheta = v.z / sin(phi);\r\n  if (sinTheta < 0.0) {\r\n    // Turn it into -theta, but in the 0-2PI range\r\n    theta = 2.0 * PI - theta;\r\n  }\r\n  theta = theta / (2.0 * 3.14159);\r\n  phi = phi / 3.14159 ;\r\n  \r\n  vec2 angles = vec2( phi, theta );\r\n  return angles;\r\n}\r\n\r\n\r\nvoid main(){\r\n  const int SAMPLE_COUNT = 400; // 4096\r\n  int lowRoughnessLimit = int(pow(2.0,(roughness+0.1)*20.0));\r\n  float totalWeight = 0.0;\r\n  vec3 prefilteredColor = vec3(0.0);\r\n  float phi = vTexCoord.x * 2.0 * PI;\r\n  float theta = vTexCoord.y * PI;\r\n  float x = sin(theta) * cos(phi);\r\n  float y = sin(theta) * sin(phi);\r\n  float z = cos(theta);\r\n  vec3 N = vec3(x,y,z);\r\n  vec3 V = N;\r\n  for (int i = 0; i < SAMPLE_COUNT; ++i)\r\n  {\r\n    // break at smaller sample numbers for low roughness levels\r\n    if(i == lowRoughnessLimit)\r\n    {\r\n      break;\r\n    }\r\n    vec2 Xi = HammersleyNoBitOps(i, SAMPLE_COUNT);\r\n    vec3 H = ImportanceSampleGGX(Xi, N, roughness);\r\n    vec3 L = normalize(2.0 * dot(V, H) * H - V);\r\n\r\n    float NdotL = max(dot(N, L), 0.0);\r\n    if (NdotL > 0.0)\r\n    {\r\n      prefilteredColor += TEXTURE(environmentMap, nTOE(L)).xyz * NdotL;\r\n      totalWeight += NdotL;\r\n    }\r\n  }\r\n  prefilteredColor = prefilteredColor / totalWeight;\r\n\r\n OUT_COLOR  = vec4(prefilteredColor, 1.0);\r\n}\r\n\r\nvec3 ImportanceSampleGGX(vec2 Xi, vec3 N, float roughness){\r\n  float a = roughness * roughness;\r\n\r\n  float phi = 2.0 * PI * Xi.x;\r\n  float cosTheta = sqrt((1.0 - Xi.y) / (1.0 + (a * a - 1.0) * Xi.y));\r\n  float sinTheta = sqrt(1.0 - cosTheta * cosTheta);\r\n  // from spherical coordinates to cartesian coordinates\r\n  vec3 H;\r\n  H.x = cos(phi) * sinTheta;\r\n  H.y = sin(phi) * sinTheta;\r\n  H.z = cosTheta;\r\n\r\n  // from tangent-space vector to world-space sample vector\r\n  vec3 up = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0);\r\n  vec3 tangent = normalize(cross(up, N));\r\n  vec3 bitangent = cross(N, tangent);\r\n\r\n  vec3 sampleVec = tangent * H.x + bitangent * H.y + N * H.z;\r\n  return normalize(sampleVec);\r\n}\r\n\r\n\r\nfloat VanDerCorput(int n, int base)\r\n{\r\n#ifdef WEBGL2\r\n\r\n    uint bits = uint(n);\r\n    bits = (bits << 16u) | (bits >> 16u);\r\n    bits = ((bits & 0x55555555u) << 1u) | ((bits & 0xAAAAAAAAu) >> 1u);\r\n    bits = ((bits & 0x33333333u) << 2u) | ((bits & 0xCCCCCCCCu) >> 2u);\r\n    bits = ((bits & 0x0F0F0F0Fu) << 4u) | ((bits & 0xF0F0F0F0u) >> 4u);\r\n    bits = ((bits & 0x00FF00FFu) << 8u) | ((bits & 0xFF00FF00u) >> 8u);\r\n    return float(bits) * 2.3283064365386963e-10; // / 0x100000000\r\n\r\n#else\r\n\r\n  float invBase = 1.0 / float(base);\r\n  float denom = 1.0;\r\n  float result = 0.0;\r\n\r\n\r\n  for (int i = 0; i < 32; ++i)\r\n  {\r\n        if (n > 0)\r\n        {\r\n        denom = mod(float(n), 2.0);
44\r\n        result += denom * invBase;\r\n        invBase = invBase / 2.0;\r\n        n = int(float(n) / 2.0);\r\n        }\r\n  }\r\n\r\n\r\n  return result;\r\n\r\n#endif\r\n}\r\n\r\nvec2 HammersleyNoBitOps(int i, int N)\r\n{\r\n  return vec2(float(i) / float(N), VanDerCorput(i, 2));\r\n}\r\n",filterBaseVert:C,filterBaseFrag:E};for(let t in hn)hn[t]=D+hn[t];class hi extends g.R{constructor(t,r,n,i,s){super(t,r,n,i,s),this.webglVersion===d.aa?this.blendExt=this.GL:this.blendExt=this.GL.getExtension("EXT_blend_minmax"),this._userEnabledStencil=!1,this._internalEnable=this.drawingContext.enable,this._internalDisable=this.drawingContext.disable,this.drawingContext.enable=t=>(t!==this.drawingContext.STENCIL_TEST||this._clipping||(this._userEnabledStencil=!0),this._internalEnable.call(this.drawingContext,t)),this.drawingContext.disable=t=>(t===this.drawingContext.STENCIL_TEST&&(this._userEnabledStencil=!1),this._internalDisable.call(this.drawingContext,t)),this._cachedBlendMode=void 0,this.strandsBackend=e_}setupContext(){this._setAttributeDefaults(this._pInst),this._initContext(),this.GL=this.drawingContext}_applyBlendMode(){if(this._cachedBlendMode===this.states.curBlendMode)return;let t=this.GL;switch(this.states.curBlendMode){case d.B:t.blendEquation(t.FUNC_ADD),t.blendFunc(t.ONE,t.ONE_MINUS_SRC_ALPHA);break;case d.A:t.blendEquation(t.FUNC_ADD),t.blendFunc(t.ONE,t.ONE);break;case d.b:t.blendEquation(t.FUNC_ADD),t.blendFunc(t.ZERO,t.ONE_MINUS_SRC_ALPHA);break;case d.M:t.blendEquation(t.FUNC_ADD),t.blendFunc(t.DST_COLOR,t.ONE_MINUS_SRC_ALPHA);break;case d.a:t.blendEquation(t.FUNC_ADD),t.blendFunc(t.ONE,t.ONE_MINUS_SRC_COLOR);break;case d.E:t.blendEquationSeparate(t.FUNC_ADD,t.FUNC_ADD),t.blendFuncSeparate(t.ONE_MINUS_DST_COLOR,t.ONE_MINUS_SRC_COLOR,t.ONE,t.ONE);break;case d.R:t.blendEquation(t.FUNC_ADD),t.blendFunc(t.ONE,t.ZERO);break;case d.S:t.blendEquationSeparate(t.FUNC_REVERSE_SUBTRACT,t.FUNC_ADD),t.blendFuncSeparate(t.ONE,t.ONE,t.ONE,t.ONE_MINUS_SRC_ALPHA);break;case d.D:this.blendExt?(t.blendEquationSeparate(this.blendExt.MIN||this.blendExt.MIN_EXT,t.FUNC_ADD),t.blendFuncSeparate(t.ONE,t.ONE,t.ONE,t.ONE)):console.warn("blendMode(DARKEST) does not work in your browser in WEBGL mode.");break;case d.L:this.blendExt?(t.blendEquationSeparate(this.blendExt.MAX||this.blendExt.MAX_EXT,t.FUNC_ADD),t.blendFuncSeparate(t.ONE,t.ONE,t.ONE,t.ONE)):console.warn("blendMode(LIGHTEST) does not work in your browser in WEBGL mode.");break;default:console.error("Oops! Somehow Renderer3D set curBlendMode to an unsupported mode.")}this._cachedBlendMode=this.states.curBlendMode}_shaderOptions(){}_useShader(t){this.GL.useProgram(t._glProgram)}_disableRemainingAttributes(t){for(let r of this.registerEnabled.values())Object.keys(t.attributes).some(n=>t.attributes[n].location===r)||(this.GL.disableVertexAttribArray(r),this.registerEnabled.delete(r))}_drawBuffers(t,{mode:r=d.c,count:n}){let i=this.GL,s=this.geometryBufferCache.getCached(t);if(s)if("stroke"===this._curShader.shaderType)if(1===n)i.drawArrays(i.TRIANGLES,0,t.lineVertices.length/3);else try{i.drawArraysInstanced(i.TRIANGLES,0,t.lineVertices.length/3,n)}catch(t){console.log("\uD83C\uDF38 p5.js says: Instancing is only supported in WebGL2 mode")}else if("text"===this._curShader.shaderType)this._bindBuffer(s.indexBuffer,i.ELEMENT_ARRAY_BUFFER),i.drawElements(i.TRIANGLES,6,i.UNSIGNED_SHORT,0);else if(s.indexBuffer){if(this._bindBuffer(s.indexBuffer,i.ELEMENT_ARRAY_BUFFER),this._pInst.webglVersion!==d.aa&&s.indexBufferType===i.UNSIGNED_INT&&!i.getExtension("OES_element_index_uint"))throw Error("Unable to render a 3d model with > 65535 triangles. Your web browser does not support the WebGL Extension OES_element_index_uint.");if(1===n)i.drawElements(i.TRIANGLES,3*t.faces.length,s.indexBufferType,0);else try{i.drawElementsInstanced(i.TRIANGLES,3*t.faces.length,s.indexBufferType,0,n)}catch(t){console.log("\uD83C\uDF38 p5.js says: Instancing is only supported in WebGL2 mode")}}else{let s=r===d.c?i.TRIANGLES:i.TRIANGLE_STRIP;if(1===n)i.drawArrays(s,0,t.vertices.length);else try{i.drawArraysInstanced(s,0,t.vertices.length,n)}catch(t){console.log("\uD83C\uDF38 p5.js says: Instancing is only supported in WebGL2 mode")}}}_beforeDrawText(){this.GL.pixelStorei(this.GL.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1)}_afterDrawText(){this.GL.pixelStorei(this.GL.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0)}_setAttributeDefaults(t){let r={alpha:!0,depth:!0,stencil:!0,antialias:navigator.userAgent.toLowerCase().includes("safari"),premultipliedAlpha:!0,preserveDrawingBuffer:!0,perPixelLighting:!0,version:2};null===t._glAttributes?t._glAttributes=r:t._glAttributes=Object.assign(r,t._glAttributes)}_setAttributes(t,r){if(void 0===this._pInst._glAttributes)return void console.log("You are trying to use setAttributes on a p5.Graphics object that does not use a WEBGL renderer.");let n=!0;if(void 0!==r?(null===this._pInst._glAttributes&&(this._pInst._glAttributes={}),this._pInst._glAttributes[t]!==r&&(this._pInst._glAttributes[t]=r,n=!1)):t instanceof Object&&this._pInst._glAttributes!==t&&(this._pInst._glAttributes=t,n=!1),this.isP3D&&!n){if(!this._pInst._setupDone&&this.geometryBufferCache.numCached()>
440)return void p5._friendlyError("Sorry, Could not set the attributes, you need to call setAttributes() before calling the other drawing methods in setup()");this._resetContext(null,null,hi),this.states.curCamera&&(this.states.curCamera._renderer=this._renderer)}}_initContext(){if(this._pInst._glAttributes?.version!==1&&(this.drawingContext=this.canvas.getContext("webgl2",this._pInst._glAttributes)),this.webglVersion=this.drawingContext?d.aa:d.ac,this._pInst.webglVersion=this.webglVersion,this.drawingContext||(this.drawingContext=this.canvas.getContext("webgl",this._pInst._glAttributes)||this.canvas.getContext("experimental-webgl",this._pInst._glAttributes)),null===this.drawingContext)throw Error("Error creating webgl context");{let t=this.drawingContext;t.enable(t.DEPTH_TEST),t.depthFunc(t.LEQUAL),t.viewport(0,0,t.drawingBufferWidth,t.drawingBufferHeight),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),this._viewport=this.drawingContext.getParameter(this.drawingContext.VIEWPORT)}}_updateSize(){}_getMaxTextureSize(){let t=this.drawingContext;return t.getParameter(t.MAX_TEXTURE_SIZE)}_adjustDimensions(t,r){this._maxTextureSize||(this._maxTextureSize=this._getMaxTextureSize());let n=Math.floor(this._maxTextureSize/this._pixelDensity),i=Math.min(t,n),s=Math.min(r,n);return(i!==t||s!==r)&&console.warn(`Warning: The requested width/height exceeds hardware limits. Adjusting dimensions to width: ${i}, height: ${s}.`),{adjustedWidth:i,adjustedHeight:s}}_resetBuffersBeforeDraw(){this.GL.clearStencil(0),this.GL.clear(this.GL.DEPTH_BUFFER_BIT|this.GL.STENCIL_BUFFER_BIT),this._userEnabledStencil||this._internalDisable.call(this.GL,this.GL.STENCIL_TEST)}_applyClip(){let t=this.GL;t.clearStencil(0),t.clear(t.STENCIL_BUFFER_BIT),this._internalEnable.call(t,t.STENCIL_TEST),this._stencilTestOn=!0,t.stencilFunc(t.ALWAYS,1,255),t.stencilOp(t.KEEP,t.KEEP,t.REPLACE),t.disable(t.DEPTH_TEST)}_unapplyClip(){let t=this.GL;t.stencilOp(t.KEEP,t.KEEP,t.KEEP),t.stencilFunc(this._clipInvert?t.EQUAL:t.NOTEQUAL,0,255),t.enable(t.DEPTH_TEST)}_clearClipBuffer(){this.GL.clearStencil(1),this.GL.clear(this.GL.STENCIL_BUFFER_BIT),this._userEnabledStencil||this._internalDisable.call(this.GL,this.GL.STENCIL_TEST)}_getPixel(t,r){let n=this.GL;return(0,g.o)(n,null,t,r,n.RGBA,n.UNSIGNED_BYTE,this._pInst.height*this._pInst.pixelDensity())}loadPixels(){if(!0!==this._pInst._glAttributes.preserveDrawingBuffer)return void console.log("loadPixels only works in WebGL when preserveDrawingBuffer is true.");let t=this._pixelDensity,r=this.GL;this.pixels=(0,g.q)(this.pixels,r,null,0,0,this.width*t,this.height*t,r.RGBA,r.UNSIGNED_BYTE,this.height*t)}updatePixels(){let t=this._getTempFramebuffer();t.pixels=this.pixels,t.updatePixels(),this.push(),this.resetMatrix(),this.clear(),this.states.setValue("imageMode",d.p),this.image(t,0,0,t.width,t.height,-t.width/2,-t.height/2,t.width,t.height),this.pop(),this.GL.clearDepth(1),this.GL.clear(this.GL.DEPTH_BUFFER_BIT)}zClipRange(){return[-1,1]}defaultNearScale(){return .1}defaultFarScale(){return 10}viewport(t,r){this._viewport=[0,0,t,r],this.GL.viewport(0,0,t,r)}_updateViewport(){this._origViewport={width:this.GL.drawingBufferWidth,height:this.GL.drawingBufferHeight},this.viewport(this._origViewport.width,this._origViewport.height)}_createPixelsArray(){this.pixels=new Uint8Array(this.GL.drawingBufferWidth*this.GL.drawingBufferHeight*4)}clear(...t){let r=t[0]||0,n=t[1]||0,i=t[2]||0,s=t[3]||0,o=this.activeFramebuffer();o&&o.format===d.U&&!o.antialias&&0===s&&(s=1e-10),this.GL.clearColor(r*s,n*s,i*s,s),this.GL.clearDepth(1),this.GL.clear(this.GL.COLOR_BUFFER_BIT|this.GL.DEPTH_BUFFER_BIT)}clearDepth(t=1){this.GL.clearDepth(t),this.GL.clear(this.GL.DEPTH_BUFFER_BIT)}_applyStencilTestIfClipping(){let t=this.drawTarget();t._isClipApplied!==this._stencilTestOn&&(t._isClipApplied?(this._internalEnable.call(this.GL,this.GL.STENCIL_TEST),this._stencilTestOn=!0):(this._userEnabledStencil||this._internalDisable.call(this.GL,this.GL.STENCIL_TEST),this._stencilTestOn=!1))}baseMaterialShader(){if(!this._pInst._glAttributes.perPixelLighting)throw Error("The material shader does not support hooks without perPixelLighting. Try turning it back on.");return super.baseMaterialShader()}_getLightShader(){return this._defaultLightShader||(this._pInst._glAttributes.perPixelLighting?this._defaultLightShader=new _.M(this,this._webGL2CompatibilityPrefix("vert","highp")+hn.phongVert,this._webGL2CompatibilityPrefix("frag","highp")+hn.phongFrag,{vertex:{"void beforeVertex":"() {}
44","Vertex getObjectInputs":"(Vertex inputs) { return inputs; }","Vertex getWorldInputs":"(Vertex inputs) { return inputs; }","Vertex getCameraInputs":"(Vertex inputs) { return inputs; }","void afterVertex":"() {}"},fragment:{"void beforeFragment":"() {}","Inputs getPixelInputs":"(Inputs inputs) { return inputs; }","vec4 combineColors":`(ColorComponents components) {
45                vec4 color = vec4(0.);
46                color.rgb += components.diffuse * components.baseColor;
47                color.rgb += components.ambient * components.ambientColor;
48                color.rgb += components.specular * components.specularColor;
49                color.rgb += components.emissive;
50                color.a = components.opacity;
51                return color;
52              }`,"vec4 getFinalColor":"(vec4 color) { return color; }","void afterFragment":"() {}"}}):this._defaultLightShader=new _.M(this,this._webGL2CompatibilityPrefix("vert","highp")+hn.lightVert,this._webGL2CompatibilityPrefix("frag","highp")+hn.lightTextureFrag)),this._defaultLightShader}_getNormalShader(){return this._defaultNormalShader||(this._defaultNormalShader=new _.M(this,this._webGL2CompatibilityPrefix("vert","highp")+hn.normalVert,this._webGL2CompatibilityPrefix("frag","highp")+hn.normalFrag,{vertex:{"void beforeVertex":"() {}","Vertex getObjectInputs":"(Vertex inputs) { return inputs; }","Vertex getWorldInputs":"(Vertex inputs) { return inputs; }","Vertex getCameraInputs":"(Vertex inputs) { return inputs; }","void afterVertex":"() {}"},fragment:{"void beforeFragment":"() {}","vec4 getFinalColor":"(vec4 color) { return color; }","void afterFragment":"() {}"}})),this._defaultNormalShader}_getColorShader(){return this._defaultColorShader||(this._defaultColorShader=new _.M(this,this._webGL2CompatibilityPrefix("vert","highp")+hn.normalVert,this._webGL2CompatibilityPrefix("frag","highp")+hn.basicFrag,{vertex:{"void beforeVertex":"() {}","Vertex getObjectInputs":"(Vertex inputs) { return inputs; }","Vertex getWorldInputs":"(Vertex inputs) { return inputs; }","Vertex getCameraInputs":"(Vertex inputs) { return inputs; }","void afterVertex":"() {}"},fragment:{"void beforeFragment":"() {}","vec4 getFinalColor":"(vec4 color) { return color; }","void afterFragment":"() {}"}})),this._defaultColorShader}_getLineShader(){return this._defaultLineShader||(this._defaultLineShader=new _.M(this,this._webGL2CompatibilityPrefix("vert","highp")+hn.lineVert,this._webGL2CompatibilityPrefix("frag","highp")+hn.lineFrag,{vertex:{"void beforeVertex":"() {}","StrokeVertex getObjectInputs":"(StrokeVertex inputs) { return inputs; }","StrokeVertex getWorldInputs":"(StrokeVertex inputs) { return inputs; }","StrokeVertex getCameraInputs":"(StrokeVertex inputs) { return inputs; }","void afterVertex":"() {}"},fragment:{"void beforeFragment":"() {}","Inputs getPixelInputs":"(Inputs inputs) { return inputs; }","vec4 getFinalColor":"(vec4 color) { return color; }","bool shouldDiscard":"(bool outside) { return outside; }","void afterFragment":"() {}"}})),this._defaultLineShader}_getFontShader(){return this._defaultFontShader||(this.webglVersion===d.ac&&this.GL.getExtension("OES_standard_derivatives"),this._defaultFontShader=new _.M(this,this._webGL2CompatibilityPrefix("vert","highp")+hn.fontVert,this._webGL2CompatibilityPrefix("frag","highp")+hn.fontFrag)),this._defaultFontShader}baseFilterShader(){return this._baseFilterShader||(this._baseFilterShader=new _.M(this,this._webGL2CompatibilityPrefix("vert","highp")+hn.filterBaseVert,this._webGL2CompatibilityPrefix("frag","highp")+hn.filterBaseFrag,{vertex:{},fragment:{"vec4 getColor":`(FilterInputs inputs, in sampler2D canvasContent) {
53              return getTexture(canvasContent, inputs.texCoord);
54            }`},hookAliases:{getColor:["filterColor"]}})),this._baseFilterShader}_webGL2CompatibilityPrefix(t,r){let n="";return this.webglVersion===d.aa&&(n+="#version 300 es\n#define WEBGL2\n"),"vert"===t?n+="#define VERTEX_SHADER\n":"frag"===t&&(n+="#define FRAGMENT_SHADER\n"),r&&(n+=`precision ${r} float;
55`),n}_createImageLightShader(t){if("diffused"===t)return new _.M(this,this._webGL2CompatibilityPrefix("vert","highp")+hn.imageLightVert,this._webGL2CompatibilityPrefix("frag","highp")+hn.imageLightDiffusedFrag);if("specular"===t)return new _.M(this,this._webGL2CompatibilityPrefix("vert","highp")+hn.imageLightVert,this._webGL2CompatibilityPrefix("frag","highp")+hn.imageLightSpecularFrag);
55throw Error(`Unknown imageLight shader type: ${t}`)}_createMipmapTexture(t){return new g.M(this,t,{})}_prepareMipmapData(t,r){return{levels:[],size:t,mipLevels:r}}_accumulateMipLevel(t,r,n,i,s){let o=t.get().drawingContext.getImageData(0,0,i,s);r.levels.push(o)}_finalizeMipmapTexture(t){return new g.M(this,t.levels,{minFilter:d.aG,magFilter:d.g})}createMipmapTextureHandle({levels:t,format:r,dataType:n,width:i,height:s}){let o=this.GL,a=o.createTexture();o.bindTexture(o.TEXTURE_2D,a);let l=o.RGBA,u=o.UNSIGNED_BYTE;for(let r=0;r<t.length;r++)o.texImage2D(o.TEXTURE_2D,r,l,l,u,t[r]);return o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MAG_FILTER,o.LINEAR),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MIN_FILTER,o.LINEAR_MIPMAP_LINEAR),o.bindTexture(o.TEXTURE_2D,null),{texture:a,glFormat:l,glDataType:u}}_bindBuffer(t,r,n,i,s){let o=this.GL;if(r||(r=o.ARRAY_BUFFER),o.bindBuffer(r,t),void 0!==n){let t=this._normalizeBufferData(n,i);o.bufferData(r,t,s||o.STATIC_DRAW)}}_prepareBuffer(t,r,n){let i=n.attributes,s=this.GL,o=this._getOrMakeCachedBuffers(r),a=i[t.attr];if(!a)return;let l=o[t.dst],u=r[t.src];if(u&&u.length>0){let i=!l;if(i&&(o[t.dst]=l=s.createBuffer()),s.bindBuffer(s.ARRAY_BUFFER,l),i||!1!==r.dirtyFlags[t.src]){let n=t.map,i=n?n(u):u;this._bindBuffer(l,s.ARRAY_BUFFER,i),r.dirtyFlags[t.src]=!1}n.enableAttrib(a,t.size)}else{let t=a.location;if(-1===t||!this.registerEnabled.has(t))return;s.disableVertexAttribArray(t),this.registerEnabled.delete(t)}}_enableAttrib(t,r,n,i,s,o,a){let l=r.location,u=this.GL;this.registerEnabled.has(l)||(u.enableVertexAttribArray(l),this.registerEnabled.add(l)),u.vertexAttribPointer(l,n,i||u.FLOAT,s||!1,o||0,a||0)}_ensureGeometryBuffers(t,r,n){let i=this.GL;if(r){let s=t.indexBuffer;s||(s=i.createBuffer()),this._bindBuffer(s,i.ELEMENT_ARRAY_BUFFER,r,n),t.indexBuffer=s,t.indexBufferType=n===Uint32Array?i.UNSIGNED_INT:i.UNSIGNED_SHORT}else t.indexBuffer&&(i.deleteBuffer(t.indexBuffer),t.indexBuffer=null)}_freeBuffers(t){let r=this.GL;function n(n){for(let i of n)t[i.dst]&&(r.deleteBuffer(t[i.dst]),t[i.dst]=null)}t.indexBuffer&&r.deleteBuffer(t.indexBuffer),n(this.buffers.stroke),n(this.buffers.fill),n(this.buffers.user)}_initShader(t){let r=this.GL,n=r.createShader(r.VERTEX_SHADER);if(r.shaderSource(n,t.vertSrc()),r.compileShader(n),!r.getShaderParameter(n,r.COMPILE_STATUS))throw Error(`Yikes! An error occurred compiling the vertex shader: ${r.getShaderInfoLog(n)} in:
56
57${t.vertSrc()}`);let i=r.createShader(r.FRAGMENT_SHADER);if(r.shaderSource(i,t.fragSrc()),r.compileShader(i),!r.getShaderParameter(i,r.COMPILE_STATUS))throw Error(`Darn! An error occurred compiling the fragment shader: ${r.getShaderInfoLog(i)}`);let s=r.createProgram();if(r.attachShader(s,n),r.attachShader(s,i),r.linkProgram(s),!r.getProgramParameter(s,r.LINK_STATUS))throw Error(`Snap! Error linking shader program: ${r.getProgramInfoLog(s)}`);t._glProgram=s,t._vertShader=n,t._fragShader=i}_finalizeShader(){}_getShaderAttributes(t){return(0,g.h)(t,this.GL)}getUniformMetadata(t){return(0,g.g)(t,this.GL)}updateUniformValue(t,r,n){return(0,g.s)(t,r,n,t=>this.getTexture(t),this.GL)}_updateTexture(t,r){let n=this.GL;n.activeTexture(n.TEXTURE0+t.samplerIndex),r.bindTexture(),r.update(),n.uniform1i(t.location,t.samplerIndex)}bindTexture(t){this.GL.bindTexture(this.GL.TEXTURE_2D,t.getTexture().texture)}unbindTexture(){this.GL.bindTexture(this.GL.TEXTURE_2D,null)}_unbindFramebufferTexture(t){let r=this.GL,n=this._getEmptyTexture();r.activeTexture(r.TEXTURE0+t.samplerIndex),n.bindTexture(),r.uniform1i(t.location,t.samplerIndex)}createTexture({width:t,height:r,format:n,dataType:i}){let s=this.GL,o=s.createTexture();return s.bindTexture(s.TEXTURE_2D,o),s.texImage2D(s.TEXTURE_2D,0,s.RGBA,t,r,0,s.RGBA,s.UNSIGNED_BYTE,null),{texture:o,glFormat:s.RGBA,glDataType:s.UNSIGNED_BYTE}}createFramebufferTextureHandle(t){return null}uploadTextureFromSource({texture:t,glFormat:r,glDataType:n},i){let s=this.GL;s.texImage2D(s.TEXTURE_2D,0,r,r,n,i)}uploadTextureFromData({texture:t,glFormat:r,glDataType:n},i,s,o){let a=this.GL;a.texImage2D(a.TEXTURE_2D,0,r,s,o,0,r,n,i)}getSampler(t){}bindTextureToShader({texture:t},r,n,i){let s=this.GL;s.activeTexture(s.TEXTURE0+i),s.bindTexture(s.TEXTURE_2D,t);let o=s.getUniformLocation(glProgram,n);s.uniform1i(o,i)}
57setTextureParams(t){return(0,g.e)(t,this.GL,this.webglVersion)}deleteTexture({texture:t}){this.GL.deleteTexture(t)}_applyColorBlend(t,r){let n=this.GL,i=this.states.drawMode===d.h,s=r||this.states.userFillShader||this.states.userStrokeShader||i||this.states.curBlendMode!==d.B||t[t.length-1]<1||this._isErasing;return s!==this._isBlending&&(s||this.states.curBlendMode!==d.B&&this.states.curBlendMode!==d.A?n.enable(n.BLEND):n.disable(n.BLEND),n.depthMask(!0),this._isBlending=s),this._applyBlendMode(),t}uniformNameFromHookKey(t){return t.slice(t.indexOf(" ")+1)}populateHooks(t,r,n){return(0,g.j)(t,r,n)}getShaderHookTypes(t,r){return eA(t,r)}defaultFramebufferAlpha(){return this._pInst._glAttributes.alpha}defaultFramebufferAntialias(){return!!this.supportsFramebufferAntialias()&&this._pInst._glAttributes.antialias}supportsFramebufferAntialias(){return this.webglVersion===d.aa}createFramebufferResources(t){let r=this.GL;if(t.framebuffer=r.createFramebuffer(),!t.framebuffer)throw Error("Unable to create a framebuffer");if(t.antialias&&(t.aaFramebuffer=r.createFramebuffer(),!t.aaFramebuffer))throw Error("Unable to create a framebuffer for antialiasing")}validateFramebufferFormats(t){let r=this.GL;t.useDepth&&this.webglVersion===d.ac&&!r.getExtension("WEBGL_depth_texture")&&(console.warn("Unable to create depth textures in this environment. Falling back to a framebuffer without depth."),t.useDepth=!1),t.useDepth&&this.webglVersion===d.ac&&t.depthFormat===d.F&&(console.warn("FLOAT depth format is unavailable in WebGL 1. Defaulting to UNSIGNED_INT."),t.depthFormat=d.d),[d.U,d.F,d.H].includes(t.format)||(console.warn("Unknown Framebuffer format. Please use UNSIGNED_BYTE, FLOAT, or HALF_FLOAT. Defaulting to UNSIGNED_BYTE."),t.format=d.U),t.useDepth&&![d.d,d.F].includes(t.depthFormat)&&(console.warn("Unknown Framebuffer depth format. Please use UNSIGNED_INT or FLOAT. Defaulting to FLOAT."),t.depthFormat=d.F);let n=(0,g.u)(this);n.float||t.format!==d.F||(console.warn("This environment does not support FLOAT textures. Falling back to UNSIGNED_BYTE."),t.format=d.U),t.useDepth&&!n.float&&t.depthFormat===d.F&&(console.warn("This environment does not support FLOAT depth textures. Falling back to UNSIGNED_INT."),t.depthFormat=d.d),n.halfFloat||t.format!==d.H||(console.warn("This environment does not support HALF_FLOAT textures. Falling back to UNSIGNED_BYTE."),t.format=d.U),t.channels===x.R&&[d.F,d.H].includes(t.format)&&(console.warn("FLOAT and HALF_FLOAT formats do not work cross-platform with only RGB channels. Falling back to RGBA."),t.channels=x.h)}recreateFramebufferTextures(t){let r=this.GL,n=r.getParameter(r.TEXTURE_BINDING_2D),i=r.getParameter(r.FRAMEBUFFER_BINDING),s=r.createTexture();if(!s)throw Error("Unable to create color texture");r.bindTexture(r.TEXTURE_2D,s);let o=this._getFramebufferColorFormat(t);if(r.texImage2D(r.TEXTURE_2D,0,o.internalFormat,t.width*t.density,t.height*t.density,0,o.format,o.type,null),t.colorTexture=s,r.bindFramebuffer(r.FRAMEBUFFER,t.framebuffer),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,s,0),t.useDepth){let n=r.createTexture();if(!n)throw Error("Unable to create depth texture");let i=this._getFramebufferDepthFormat(t);r.bindTexture(r.TEXTURE_2D,n),r.texImage2D(r.TEXTURE_2D,0,i.internalFormat,t.width*t.density,t.height*t.density,0,i.format,i.type,null),r.framebufferTexture2D(r.FRAMEBUFFER,t.useStencil?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,r.TEXTURE_2D,n,0),t.depthTexture=n}if(t.antialias){if(t.colorRenderbuffer=r.createRenderbuffer(),r.bindRenderbuffer(r.RENDERBUFFER,t.colorRenderbuffer),r.renderbufferStorageMultisample(r.RENDERBUFFER,Math.max(0,Math.min(t.antialiasSamples,r.getParameter(r.MAX_SAMPLES))),o.internalFormat,t.width*t.density,t.height*t.density),t.useDepth){let n=this._getFramebufferDepthFormat(t);t.depthRenderbuffer=r.createRenderbuffer(),r.bindRenderbuffer(r.RENDERBUFFER,t.depthRenderbuffer),r.renderbufferStorageMultisample(r.RENDERBUFFER,Math.max(0,Math.min(t.antialiasSamples,r.getParameter(r.MAX_SAMPLES))),n.internalFormat,t.width*t.density,t.height*t.density)}r.bindFramebuffer(r.FRAMEBUFFER,t.aaFramebuffer),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.RENDERBUFFER,t.colorRen
57derbuffer),t.useDepth&&r.framebufferRenderbuffer(r.FRAMEBUFFER,t.useStencil?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,r.RENDERBUFFER,t.depthRenderbuffer)}r.bindTexture(r.TEXTURE_2D,n),r.bindFramebuffer(r.FRAMEBUFFER,i)}_getFramebufferColorFormat(t){let r,n,i=this.GL;return r=t.format===d.F?i.FLOAT:t.format===d.H?this.webglVersion===d.aa?i.HALF_FLOAT:i.getExtension("OES_texture_half_float").HALF_FLOAT_OES:i.UNSIGNED_BYTE,n=t.channels===x.h?i.RGBA:i.RGB,{internalFormat:this.webglVersion===d.aa?({[i.FLOAT]:{[i.RGBA]:i.RGBA32F},[i.HALF_FLOAT]:{[i.RGBA]:i.RGBA16F},[i.UNSIGNED_BYTE]:{[i.RGBA]:i.RGBA8,[i.RGB]:i.RGB8}})[r][n]:t.format===d.H?i.RGBA:n,format:n,type:r}}_getFramebufferDepthFormat(t){let r,n,i=this.GL;return r=t.useStencil?t.depthFormat===d.F?i.FLOAT_32_UNSIGNED_INT_24_8_REV:this.webglVersion===d.aa?i.UNSIGNED_INT_24_8:i.getExtension("WEBGL_depth_texture").UNSIGNED_INT_24_8_WEBGL:t.depthFormat===d.F?i.FLOAT:i.UNSIGNED_INT,n=t.useStencil?i.DEPTH_STENCIL:i.DEPTH_COMPONENT,{internalFormat:t.useStencil?t.depthFormat===d.F?i.DEPTH32F_STENCIL8:this.webglVersion===d.aa?i.DEPTH24_STENCIL8:i.DEPTH_STENCIL:this.webglVersion===d.aa?t.depthFormat===d.F?i.DEPTH_COMPONENT32F:i.DEPTH_COMPONENT24:i.DEPTH_COMPONENT,format:n,type:r}}_deleteFramebufferTexture(t){this.GL.deleteTexture(t.rawTexture().texture),this.textures.delete(t)}deleteFramebufferTextures(t){this._deleteFramebufferTexture(t.color),t.depth&&this._deleteFramebufferTexture(t.depth);let r=this.GL;t.colorRenderbuffer&&r.deleteRenderbuffer(t.colorRenderbuffer),t.depthRenderbuffer&&r.deleteRenderbuffer(t.depthRenderbuffer)}deleteFramebufferResources(t){let r=this.GL;r.deleteFramebuffer(t.framebuffer),t.aaFramebuffer&&r.deleteFramebuffer(t.aaFramebuffer),t.depthRenderbuffer&&r.deleteRenderbuffer(t.depthRenderbuffer),t.colorRenderbuffer&&r.deleteRenderbuffer(t.colorRenderbuffer)}getFramebufferToBind(t){return t.antialias?t.aaFramebuffer:t.framebuffer}updateFramebufferTexture(t,r){if(t.antialias){let n=this.GL;n.bindFramebuffer(n.READ_FRAMEBUFFER,t.aaFramebuffer),n.bindFramebuffer(n.DRAW_FRAMEBUFFER,t.framebuffer);let i={colorTexture:[n.COLOR_BUFFER_BIT,t.colorP5Texture.magFilter===d.g?n.LINEAR:n.NEAREST]};t.useDepth&&(i.depthTexture=[n.DEPTH_BUFFER_BIT,t.depthP5Texture.magFilter===d.g?n.LINEAR:n.NEAREST]);let[s,o]=i[r];n.blitFramebuffer(0,0,t.width*t.density,t.height*t.density,0,0,t.width*t.density,t.height*t.density,s,o);let a=this.activeFramebuffer();this.bindFramebuffer(a)}}bindFramebuffer(t){let r=this.GL;r.bindFramebuffer(r.FRAMEBUFFER,t?this.getFramebufferToBind(t):null)}framebufferYScale(){return -1}readFramebufferPixels(t){let r=this.GL,n=this.activeFramebuffer();r.bindFramebuffer(r.FRAMEBUFFER,t.framebuffer);let i=this._getFramebufferColorFormat(t),s=(0,g.q)(t.pixels,r,t.framebuffer,0,0,t.width*t.density,t.height*t.density,i.format,i.type);return this.bindFramebuffer(n),s}readFramebufferPixel(t,r,n){let i=this._getFramebufferColorFormat(t);return(0,g.o)(this.GL,t.framebuffer,r,n,i.format,i.type)}readFramebufferRegion(t,r,n,i,s){let o=this.GL,a=this._getFramebufferColorFormat(t),l=(0,g.q)(void 0,o,t.framebuffer,r*t.density,n*t.density,i*t.density,s*t.density,a.format,a.type),u=new Uint8ClampedArray(i*s*t.density*t.density
57*4);u.fill(255);let h=a.format===o.RGB?3:4;for(let r=0;r<s*t.density;r++)for(let n=0;n<i*t.density;n++)for(let s=0;s<4;s++){let o=(r*i*t.density+n)*4+s;if(s<h){let a=4===h?o:(r*i*t.density+n)*h+s;u[o]=l[a]}}let c=new y.I(i*t.density,s*t.density);return c.imageData=c.canvas.getContext("2d").createImageData(c.width,c.height),c.imageData.data.set(u),c.pixels=c.imageData.data,c.updatePixels(),1!==t.density&&c.pixelDensity(t.density),c}updateFramebufferPixels(t){let r=this.GL;t.colorP5Texture.bindTexture();let n=this._getFramebufferColorFormat(t),i=n.format===r.RGBA?4:3,s=t.width*t.height*t.density*t.density*i,o=n.type===r.UNSIGNED_BYTE?Uint8Array:Float32Array;if(!(t.pixels instanceof o)||t.pixels.length!==s)throw Error("The pixels array has not been set correctly. Please call loadPixels() before updatePixels().");r.texImage2D(r.TEXTURE_2D,0,n.internalFormat,t.width*t.density,t.height*t.density,0,n.format,n.type,t.pixels),t.colorP5Texture.unbindTexture(),t.dirty.colorTexture=!1;let a=this.activeFramebuffer();t.antiali
57as?(t.begin(),this.push(),this.states.setValue("imageMode",d.p),this.setCamera(t.filterCamera),this.resetMatrix(),this.states.setValue("strokeColor",null),this.clear(),this._drawingFilter=!0,this.image(t,0,0,t.width,t.height,-this.width/2,-this.height/2,this.width,this.height),this._drawingFilter=!1,this.pop(),t.useDepth&&(r.clearDepth(1),r.clear(r.DEPTH_BUFFER_BIT)),t.end()):(r.bindFramebuffer(r.FRAMEBUFFER,t.framebuffer),t.useDepth&&(r.clearDepth(1),r.clear(r.DEPTH_BUFFER_BIT)),this.bindFramebuffer(a))}getNoiseShaderSnippet(){return w}}function hs(t,r){t.RendererGL=hi,r.setAttributes=function(t,r){return this._renderer._setAttributes(t,r)},r._assert3d=function(t){if(!this._renderer.isP3D)throw Error(`${t}() is only supported in WEBGL mode. If you'd like to use 3D graphics and WebGL, see  https://p5js.org/examples/form-3d-primitives.html for more information.`)},t.renderers[d.ac]=t.RendererGL,t.renderers[d.aa]=t.RendererGL}"undefined"!=typeof p5&&hs(p5,p5.prototype);var ho=n(90200);let ha=0,hl=0;function hu(t){switch(t){case"+":return"add";case"-":return"sub";case"*":return"mult";case"/":return"div";case"%":return"mod";case"==":case"===":return"equalTo";case"!=":case"!==":return"notEqual";case">":return"greaterThan";case">=":return"greaterEqual";case"<":return"lessThan";case"<=":return"lessEqual";case"&&":return"and";case"||":return"or"}}function hh(t){return t&&"CallExpression"===t.type&&(t.callee?.type==="Identifier"&&t.callee?.name.startsWith("uniform")||t.callee?.type==="MemberExpression"&&t.callee?.property.name.startsWith("uniform"))}function hc(t){return"VariableDeclaration"===t.type&&t.declarations.some(t=>t.init?.type==="CallExpression"&&(t.init?.callee?.type==="MemberExpression"&&t.init?.callee?.object?.type==="Identifier"&&t.init?.callee?.object?.name==="__p5"&&(t.init?.callee?.property?.name==="strandsFor"||t.init?.callee?.property?.name==="strandsIf")||t.init?.callee?.type==="Identifier"&&(t.init?.callee?.name==="__p5.strandsFor"||t.init?.callee?.name==="__p5.strandsIf")))}function hd(t){return!!t&&"string"==typeof t&&[["x","y","z","w"],["r","g","b","a"],["s","t","p","q"]].some(r=>[...t].every(t=>r.includes(t)))}function hp(t){let r=[],n=t;for(;"MemberExpression"===n.type;){if(n.computed)return null;let t=n.property.name||n.property.value;if(hd(t)){n=n.object;break}r.unshift(t),n=n.object}return"Identifier"!==n.type?null:(r.unshift(n.name),r.join("."))}function hf(t,r){let n=t=>{if(t&&"object"==typeof t){if("MemberExpression"===t.type){if(hd(t.property.name||t.property.value))return void n(t.object);let i=hp(t);if(i&&r.has(i))return void Object.assign(t,{type:"Identifier",name:r.get(i)})}if("Identifier"===t.type&&r.has(t.name)&&(t.name=r.get(t.name)),"AssignmentExpression"===t.type){let n=null;"Identifier"===t.left.type?n=t.left.name:"MemberExpression"===t.left.type&&(n=hp(t.left)),n&&r.has(n)&&("Literal"===t.right.type||"ArrayExpression"===t.right.type)&&(t.right={type:"CallExpression",callee:{type:"Identifier",name:"__p5.strandsNode"},arguments:[t.right]})}for(let r in t)if(t.hasOwnProperty(r)&&"parent"!==r){if("MemberExpression"===t.type&&"property"===r&&!t.computed)continue;Array.isArray(t[r])?t[r].forEach(n):"object"==typeof t[r]&&n(t[r])}}};n(t)}let hm={UnaryExpression(t,r,n){if(n.some(hh))return;let i=$[t.operator],s=t=>{t.type="CallExpression",t.callee={type:"Identifier",name:`__p5.${i}`},t.arguments=[t.argument]};if("MemberExpression"===t.type){let r=t.argument.property.name;[["x","y","z","w"],["r","g","b","a"],["s","t","p","q"]].some(t=>[...r].every(r=>t.includes(r)))&&"MemberExpression"===t.argument.type?(t.type="MemberExpression",t.object={type:"CallExpression",callee:{type:"Identifier",name:`__p5.${i}`},arguments:[t.argument.object]},t.property={type:"Identifier",name:r}):s(t)}else s(t);delete t.argument,delete t.operator},BreakStatement(t,r,n){n.some(hh)||(t.callee={type:"Identifier",name:"__p5.break"},t.arguments=[],t.type="CallExpression")},VariableDeclarator(t,r,n){if(!n.some(hh)){var i;if(hh(t.init)&&(0===t.init.arguments.length||"Literal"!==t.init.arguments[0].type||"string"!=typeof t.init.arguments[0].value)){let r={type:"Literal",value:t.id.name};t.init.arguments.unshift(r)}
57if((i=t.init)&&"CallExpression"===i.type&&(i.callee?.type==="Identifier"&&(i.callee?.name.startsWith("varying")||i.callee?.name.startsWith("shared"))||i.callee?.type==="MemberExpression"&&(i.callee?.property.name.startsWith("varying")||i.callee?.property.name.startsWith("shared"))))if(0===t.init.arguments.length||"Literal"!==t.init.arguments[0].type||"string"!=typeof t.init.arguments[0].value){let n={type:"Literal",value:t.id.name};t.init.arguments.unshift(n),r.varyings[t.id.name]=n}else r.varyings[t.id.name]=t.init.arguments[0]}},Identifier(t,r,n){n.some(hh)||r.varyings[t.name]&&!n.some(r=>"AssignmentExpression"===r.type&&r.left===t)&&(t.type="CallExpression",t.callee={type:"MemberExpression",object:{type:"Identifier",name:t.name},property:{type:"Identifier",name:"getValue"}},t.arguments=[])},ArrayExpression(t,r,n){if(n.some(hh))return;let i=JSON.parse(JSON.stringify(t));t.type="CallExpression",t.callee={type:"Identifier",name:"__p5.strandsNode"},t.arguments=[i]},AssignmentExpression(t,r,n){if(!n.some(hh)){if("="!==t.operator){let r=hu(t.operator.replace("=","")),n={type:"CallExpression",callee:{type:"MemberExpression",object:["Literal","ArrayExpression","Identifier"].includes(t.left.type)?{type:"CallExpression",callee:{type:"Identifier",name:"__p5.strandsNode"},arguments:[t.left]}:t.left,property:{type:"Identifier",name:r}},arguments:[t.right]};t.operator="=",t.right=n}if(r.varyings[t.left.name])t.type="ExpressionStatement",t.expression={type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:t.left.name},property:{type:"Identifier",name:"bridge"}},arguments:[t.right]};else if("MemberExpression"===t.left.type){let n=null;if("Identifier"===t.left.object.type&&r.varyings[t.left.object.name]?n=t.left.object.name:"CallExpression"===t.left.object.type&&t.left.object.callee?.type==="MemberExpression"&&t.left.object.callee.property?.name==="getValue"&&t.left.object.callee.object?.type==="Identifier"&&r.varyings[t.left.object.callee.object.name]&&(n=t.left.object.callee.object.name),n){let r=t.left.property.name;t.type="ExpressionStatement",t.expression={type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:n},property:{type:"Identifier",name:"bridgeSwizzle"}},arguments:[{type:"Literal",value:r},t.right]}}}}},BinaryExpression(t,r,n){if(!n.some(hh)){if(["Literal","ArrayExpression","Identifier"].includes(t.left.type)){let r={type:"CallExpression",callee:{type:"Identifier",name:"__p5.strandsNode"},arguments:[t.left]};t.left=r}t.type="CallExpression",t.callee={type:"MemberExpression",object:t.left,property:{type:"Identifier",name:hu(t.operator)}},t.arguments=[t.right]}},LogicalExpression(t,r,n){if(!n.some(hh)){if(["Literal","ArrayExpression","Identifier"].includes(t.left.type)){let r={type:"CallExpression",callee:{type:"Identifier",name:"__p5.strandsNode"},arguments:[t.left]};t.left=r}t.type="CallExpression",t.callee={type:"MemberExpression",object:t.left,property:{type:"Identifier",name:hu(t.operator)}},t.arguments=[t.right]}},IfStatement(t,r,n){let i;if(n.some(hh))return;let s=t.test,o={type:"ArrowFunctionExpression",params:[],body:"BlockStatement"===t.consequent.type?t.consequent:{type:"BlockStatement",body:[t.consequent]}},a={type:"CallExpression",callee:{type:"Identifier",name:"__p5.strandsIf"},arguments:[s,o]};a={type:"CallExpression",callee:{type:"MemberExpression",object:a,property:{type:"Identifier",name:"Else"}},arguments:[i=t.alternate?{type:"ArrowFunctionExpression",params:[],body:"BlockStatement"===t.alternate.type?t.alternate:{type:"BlockStatement",body:[t.alternate]}}:{type:"ArrowFunctionExpression",params:[],body:{type:"BlockStatement",body:[]}}]};let l=new Set,u=t=>{let r=new Set;uy(t,{VariableDeclarator(t,n){n.some(hc)||"Identifier"===t.id.type&&r.add(t.id.name)}}),uy(t,{AssignmentExpression(t,n){if(n.some(hc))return;let i=t.left;if("Identifier"===i.type)r.has(i.name)||l.add(i.name);else if("MemberExpression"===i.type){let t=hp(i);if(t){let n=t.split(".")[0];r.has(n)||l.add(t)}}}})};if(u(o.body),u(i.body),l.size>0){let r=(t,r)=>{if("BlockStatement"===t.type){let n=new Map,i=[];for(let t of r){let r=t.split("."),s=`__copy_${r.join("_")}_${ha++}`;n.set(t,s);let o={type:"Identifier",name:r[0]};for(let t=1;t<r.length;t++)o={type:"MemberExpression",object:o,property:{type:"Identifier",name:r[t]},computed:!1};i.push({type:"VariableDeclaration",declarations:[{type:"VariableDeclarator",id:{type:"Identifier",name:s},init:{type:"CallExpression",callee:{type:"MemberExpression",object:o,property:{type:"Identifier",name:"copy"},computed:!1},arguments:[]}}],kind:"let"})}t.body.forEach(t=>hf(t,n)),t.body.unshift(...i);let s={type:"ObjectExpression",properties:Array.from(r).map(t=>({type:"Property",key:{type:"Literal",value:t},value:{type:"Identifier",name:n.get(t)},kind:"init",computed:!1,shorthand:!1}))};t.body.push({type:"ReturnStatement",argument:s})}};r(o.body,l),r(i.body,l);let n=`__block_${ha++}`,s=[];for(let t of l){let r=t.split("."),n={type:"Identifier",name:r[0]};for(let t=1;t<r.length;t++)n={type:"MemberExpression",object:n,property:{type:"Identifier",name:r[t]},computed:!1};let i={type:"Identifier",name:r[0]};for(let t=1;t<r.length;t++)i={type:"MemberExpression",object:i,property:{type:"Identifier",name:r[t]},computed:!1};s.push({type:"ExpressionStatement",expression:{type:"AssignmentExpression",operator:"=",left:n,right:{type:"CallExpression",callee:{type:"Identifier",name:"__p5.strandsNode"},arguments:[i]}}})}for(let t of(s.push({type:"VariableDeclaration",declarations:[{type:"VariableDeclarator",id:{type:"Identifier",name:n},init:a}],kind:"const"}),l)){let r=t.split("."),i={type:"Identifier",name:r[0]};for(let t=1;t<r.length;t++)i={type:"MemberExpression",object:i,property:{type:"Identifier",name:r[t]},computed:!1};let o={type:"MemberExpression",object:{type:"Identifier",name:n},property:{type:"Literal",value:t},computed:!0};s.push({type:"ExpressionStatement",expression:{type:"AssignmentExpression",operator:"=",left:i,right:o}})}t.type="BlockStatement",t.body=s}else t.type="ExpressionStatement",t.expression=a;delete t.test,delete t.consequent,delete t.alternate},UpdateExpression(t,r,n){let i;if(n.some(hh))return;if("++"===t.operator)i="+";else{if("--"!==t.operator)return;i="-"}let s={type:"AssignmentExpression",operator:"=",left:t.argument,right:{type:"BinaryExpression",operator:i,left:t.argument,right:{type:"Literal",value:1}}};Object.assign(t,s),delete t.prefix,this.BinaryExpression(t.right,r,[...n,t]),this.AssignmentExpression(t,r,n)}
57,ForStatement(t,r,n){let i,s;if(n.some(hh))return;let o=`loopVar${hl++}`;if(t.init&&"VariableDeclaration"===t.init.type){let r=t.init.declarations[0].init;i={type:"ArrowFunctionExpression",params:[],body:{type:"BlockStatement",body:[{type:"ReturnStatement",argument:r=({type:"ExpressionStatement",expression:r}).expression}]}}}else i={type:"ArrowFunctionExpression",params:[],body:{type:"BlockStatement",body:[{type:"ReturnStatement",argument:{type:"Literal",value:0}}]}};let a=t.test||{type:"Literal",value:!0};if(t.init?.type==="VariableDeclaration"){let r=t.init.declarations[0].id.name;a=this.replaceIdentifierReferences(a,r,o)}let l={type:"ArrowFunctionExpression",params:[{type:"Identifier",name:o}],body:a=({type:"ExpressionStatement",expression:a}).expression};if(t.update){let r=t.update;if(t.init?.type==="VariableDeclaration"){let n=t.init.declarations[0].id.name;r=this.replaceIdentifierReferences(r,n,o)}s={type:"ArrowFunctionExpression",params:[{type:"Identifier",name:o}],body:{type:"BlockStatement",body:[{type:"ReturnStatement",argument:r=({type:"ExpressionStatement",expression:r}).expression}]}}}else s={type:"ArrowFunctionExpression",params:[{type:"Identifier",name:o}],body:{type:"BlockStatement",body:[{type:"ReturnStatement",argument:{type:"Identifier",name:o}}]}};let u="BlockStatement"===t.body.type?t.body:{type:"BlockStatement",body:[t.body]};if(t.init?.type==="VariableDeclaration"){let r=t.init.declarations[0].id.name;u=this.replaceIdentifierReferences(u,r,o)}let h={type:"ArrowFunctionExpression",params:[{type:"Identifier",name:o},{type:"Identifier",name:"vars"}],body:u},c=new Set,d=new Set;if(uy(h.body,{VariableDeclarator(t,r){r.some(hc)||"Identifier"===t.id.type&&d.add(t.id.name)}}),uy(h.body,{AssignmentExpression(t,r){if(r.some(hc))return;let n=t.left;if("Identifier"===n.type)d.has(n.name)||c.add(n.name);else if("MemberExpression"===n.type){let t=hp(n);if(t){let r=t.split(".")[0];d.has(r)||c.add(t)}}}}),c.size>0){((t,r)=>{if("BlockStatement"===t.type){let n=new Map,i=[];for(let t of r){let r=t.split("."),s=`__copy_${r.join("_")}_${ha++}`;n.set(t,s);let o={type:"Identifier",name:"vars"};for(let t of r)o={type:"MemberExpression",object:o,property:{type:"Identifier",name:t},computed:!1};i.push({type:"VariableDeclaration",declarations:[{type:"VariableDeclarator",id:{type:"Identifier",name:s},init:{type:"CallExpression",callee:{type:"MemberExpression",object:o,property:{type:"Identifier",name:"copy"},computed:!1},arguments:[]}}],kind:"let"})}t.body.forEach(t=>hf(t,n)),t.body.unshift(...i);let s={type:"ObjectExpression",properties:Array.from(r).map(t=>({type:"Property",key:{type:"Literal",value:t},value:{type:"Identifier",name:n.get(t)},kind:"init",computed:!1,shorthand:!1}))};t.body.push({type:"ReturnStatement",argument:s})}})(h.body,c);let r=`__block_${ha++}`,n=[],o={type:"CallExpression",callee:{type:"Identifier",name:"__p5.strandsFor"},arguments:[i,l,s,h,{type:"ObjectExpression",properties:Array.from(c).map(t=>{let r=t.split("."),n={type:"Identifier",name:r[0]};for(let t=1;t<r.length;t++)n={type:"MemberExpression",object:n,property:{type:"Identifier",name:r[t]},computed:!1};return{type:"Property",key:{type:"Literal",value:t},value:{type:"CallExpression",callee:{type:"Identifier",name:"__p5.strandsNode"},arguments:[n]},kind:"init",computed:!1,shorthand:!1}})}]};for(let t of(n.push({type:"VariableDeclaration",declarations:[{type:"VariableDeclarator",id:{type:"Identifier",name:r},init:o}],kind:"const"}),c)){let i=t.split("."),s={type:"Identifier",name:i[0]};for(let t=1;t<i.length;t++)s={type:"MemberExpression",object:s,property:{type:"Identifier",name:i[t]},computed:!1};let o={type:"Identifier",name:r};for(let t of i)o={type:"MemberExpression",object:o,property:{type:"Identifier",name:t},computed:!1};n.push({type:"ExpressionStatement",expression:{type:"AssignmentExpression",operator:"=",left:s,right:o}})}t.type="BlockStatement",t.body=n}else t.type="ExpressionStatement",t.expression={type:"CallExpression",callee:{type:"Identifier",name:"__p5.strandsFor"},arguments:[i,l,s,h,{type:"ObjectExpression",properties:[]}]};delete t.init,delete t.test,delete t.update},replaceIdentifierReferences(t,r,n){if(!t||"object"!=typeof t)return t;let i=t=>{if(!t||"object"!=typeof t)return t;if("Identifier"===t.type&&t.name===r)return{...t,name:n};let s={...t};for(let r in t)t.hasOwnProperty(r)&&"parent"!==r&&(Array.isArray(t[r])?s[r]=t[r].map(i):"object"==typeof t[r]&&(s[r]=i(t[r])));return s};return i(t)}};function hg(t){let r=!1,n=0;return t.body&&"BlockStatement"===t.body.type&&uv(t.body,{}
57,{IfStatement(t,r,i){n++,t.test&&i(t.test,r),t.consequent&&i(t.consequent,r),t.alternate&&i(t.alternate,r),n--},ForStatement(t,r,i){n++,t.init&&i(t.init,r),t.test&&i(t.test,r),t.update&&i(t.update,r),t.body&&i(t.body,r),n--},ReturnStatement(t){n>0&&(r=!0)}}),r}function hy(t){let r=!1,n=0;return t.body&&"BlockStatement"===t.body.type&&uv(t.body,{},{IfStatement(t,r,i){n++,t.test&&i(t.test,r),t.consequent&&i(t.consequent,r),t.alternate&&i(t.alternate,r),n--},ForStatement(t,r,i){n++,t.init&&i(t.init,r),t.test&&i(t.test,r),t.update&&i(t.update,r),t.body&&i(t.body,r),n--},CallExpression(t){n>0&&t.callee?.type==="MemberExpression"&&t.callee?.property?.name==="set"&&(r=!0)}}),r}function hv(t,r,n){let i=r.filter(t=>null!==t.value.id);if(0===i.length)throw Error(`No valid inputs for phi node for variable ${n}`);let s=i.map(r=>X(t.dag,r.value.id)),o=s.find(t=>t.baseType!==I.ASSIGN_ON_USE&&t.dimension)??s.find(t=>t.baseType!==I.ASSIGN_ON_USE);o||(o=s[0]);let a=o.dimension,l=o.baseType;if(l!==I.ASSIGN_ON_USE)for(let r of s)r.baseType===I.ASSIGN_ON_USE&&K(t.dag,r.id,l,a);let u={nodeType:S.PHI,dimension:a,baseType:l,dependsOn:r.map(t=>t.value.id).filter(t=>null!==t),phiBlocks:r.map(t=>t.blockId)},h=J(t.dag,u);return es(t.cfg,t.cfg.currentBlock,h),{id:h,dimension:a,baseType:l}}class hb{constructor(t,r,n){this.branches=[{condition:r,branchCallback:n,blockType:G.IF_BODY}],this.ctx=t}ElseIf(t,r){return this.branches.push({condition:t,branchCallback:r,blockType:G.IF_BODY}),this}Else(t=()=>({})){this.branches.push({condition:null,branchCallback:t,blockType:G.IF_BODY});let r=function(t,r){let n=t.cfg,i=r.branches,s=en(n,G.MERGE),o=[],a=[],l={},u={},h=en(n,G.BRANCH);ei(n,n.currentBlock,h),ei(n,h,s);let c=h;for(let r=0;r<i.length;r++){let{condition:l,branchCallback:h,blockType:d}=i[r];if(null!==l){let t=en(n,G.IF_COND);ei(n,c,t),ee(n,t),n.blockConditions[t]=l.id,c=t,et(n)}else{let t=en(n,G.ELSE_COND);ei(n,c,t),c=t}let p=en(n,G.SCOPE_START);ei(n,c,p);let f=en(n,d);ei(n,p,f),ee(n,f);let m=h();for(let r in m)m[r]=t.p5.strandsNode(m[r]);for(let t in m)u[t]?u[t].push({value:m[t],blockId:f}):u[t]=[{value:m[t],blockId:f}];o.push(m);let g=en(n,G.DEFAULT);ei(n,n.currentBlock,g),a.push(g),et(n);let y=en(n,G.SCOPE_END);ei(n,g,y),ei(n,y,s),c=p}for(let r in er(n,h),u)l[r]=hv(t,u[r],r);et(n);for(let r=0;r<o.length;r++){let i=o[r],s=a[r];for(let r in er(n,s),i)if(l[r]){let o=l[r].id,a=i[r].id,u={nodeType:S.ASSIGNMENT,dependsOn:[o,a],phiBlocks:[]};es(n,s,J(t.dag,u))}et(n)}return ee(n,s),l}(this.ctx,this),n={};for(let[t,i]of Object.entries(r))n[t]=el(i.id,i.dimension,this.ctx);return n}}class hx{constructor(t,r,n,i,s,o){this.strandsContext=t,this.initialCb=r,this.conditionCb=n,this.updateCb=i,this.bodyCb=s,this.initialVars=o}build(){let t=this.strandsContext.cfg,r=en(t,G.MERGE),n=en(t,G.BRANCH);ei(t,t.currentBlock,n),ei(t,n,r);let{initialVar:i,phiNode:s}=this.initializeLoopVariable(t,n);ee(t,t.currentBlock);let o=el(s.id,s.dimension,this.strandsContext),a=this.conditionCb(o),l=this.updateCb(o);et(t),this.loopIsBounded(i,a,l)?this.buildBoundedLoop(t,n,r,i,s,a,l):this.buildUnboundedLoop(t,n,r,i,s,a,l);let u=this.phiNodesForBody;for(let[r,i]of(er(t,n),Object.entries(this.bodyResults)))if("loopVar"!==r&&u[r]){let t=u[r].id,n=X(this.strandsContext.dag,t);n.dependsOn.length>1&&(n.dependsOn[1]=i.id),n.phiInputs&&n.phiInputs.length>1&&(n.phiInputs[1].value=i)}for(let[r,i]of(et(t),er(t,n),Object.entries(this.initialVars)))if("loopVar"!==r&&u[r]){let s=u[r].id,o=i.id,a=Z({nodeType:S.ASSIGNMENT,dependsOn:[s,o],phiBlocks:[]});es(t,n,J(this.strandsContext.dag,a))}for(let[r,n]of(et(t),er(t,this.finalBodyBlock),Object.entries(this.bodyResults)))if("loopVar"!==r&&u[r]){let i=u[r].id,s=n.id,o=Z({nodeType:S.ASSIGNMENT,dependsOn:[i,s],phiBlocks:[]}),a=J(this.strandsContext.dag,o);es(t,this.finalBodyBlock,a)}et(t);let h={};for(let[t,r]of Object.entries(u))h[t]=el(r.id,r.dimension,this.strandsContext);return ee(t,r),h}buildBoundedLoop(t,r,n,i,s,o,a){let l=en(t,G.FOR);if(ei(t,r,l),ee(t,l),i){let r=Z({nodeType:S.ASSIGNMENT,dependsOn:[s.id,i.id],phiBlocks:[]});es(t,l,J(this.strandsContext.dag,r))}let u=Z({nodeType:S.STATEMENT,statementType:N.EXPRESSION,dependsOn:[o.id],phiBlocks:[]});es(t,l,J(this.strandsContext.dag,u));
57let h=Z({nodeType:S.ASSIGNMENT,dependsOn:[s.id,a.id],phiBlocks:[]});es(t,l,J(this.strandsContext.dag,h)),et(t);let c=t.blockInstructions[l]||[],d=i?3:2;if(c.length!==d)throw Error(`FOR block must have exactly ${d} statements, got ${c.length}`);let p=en(t,G.SCOPE_START);ei(t,l,p);let f=en(t,G.DEFAULT);this.bodyBlock=f,ei(t,p,f),this.executeBodyCallback(t,r,f,s);let m=en(t,G.SCOPE_END);ei(t,f,m),ei(t,m,n)}buildUnboundedLoop(t,r,n,i,s,o,a){let l=en(t,G.FOR);if(ei(t,r,l),ee(t,l),i){let r=Z({nodeType:S.ASSIGNMENT,dependsOn:[s.id,i.id],phiBlocks:[]});es(t,l,J(this.strandsContext.dag,r))}else{let r=Z({nodeType:S.STATEMENT,statementType:N.EMPTY,dependsOn:[],phiBlocks:[]});es(t,l,J(this.strandsContext.dag,r))}let u=Z({nodeType:S.STATEMENT,statementType:N.EMPTY,dependsOn:[],phiBlocks:[]});es(t,l,J(this.strandsContext.dag,u));let h=Z({nodeType:S.STATEMENT,statementType:N.EMPTY,dependsOn:[],phiBlocks:[]});es(t,l,J(this.strandsContext.dag,h)),et(t);let c=en(t,G.SCOPE_START);ei(t,l,c);let d=en(t,G.DEFAULT);ei(t,c,d),ee(t,d);let p=this.createLogicalNotNode(o),f=en(t,G.IF_COND);ei(t,d,f),t.blockConditions[f]=p.id;let m=en(t,G.SCOPE_START);ei(t,f,m);let g=en(t,G.DEFAULT);ei(t,m,g),ee(t,g);let y=Z({nodeType:S.STATEMENT,statementType:N.BREAK,dependsOn:[],phiBlocks:[]});es(t,g,J(this.strandsContext.dag,y)),et(t);let v=en(t,G.SCOPE_END);ei(t,g,v),ei(t,v,n),et(t);let b=en(t,G.DEFAULT);this.bodyBlock=b,ei(t,d,b),this.executeBodyCallback(t,r,b,s);let x=en(t,G.DEFAULT);ei(t,b,x),ee(t,x);let _=Z({nodeType:S.ASSIGNMENT,dependsOn:[s.id,a.id],phiBlocks:[]});es(t,x,J(this.strandsContext.dag,_)),et(t);let A=en(t,G.SCOPE_END);ei(t,x,A),ei(t,A,n),ei(t,d,n)}initializeLoopVariable(t,r){ee(t,r);let n=this.initialCb();if(!n?.isStrandsNode){let{id:t,dimension:r}=ef(this.strandsContext,{baseType:I.FLOAT,dimension:1},n);n=el(t,r,this.strandsContext)}let i=hv(this.strandsContext,[{value:n,blockId:r},{value:n,blockId:r}],"loopVar");return et(t),{initialVar:n,phiNode:i}}createLogicalNotNode(t){let r=Z({nodeType:S.OPERATION,opCode:P.Unary.LOGICAL_NOT,baseType:I.BOOL,dimension:1,dependsOn:[t.id],phiBlocks:[],usedBy:[]});return el(J(this.strandsContext.dag,r),1,this.strandsContext)}executeBodyCallback(t,r,n,i){ee(t,n);let s={},o={};for(let[i,a]of(er(t,r),Object.entries(this.initialVars)))if("loopVar"!==i){let t=hv(this.strandsContext,[{value:a,blockId:r},{value:a,blockId:n}],i);o[i]=t,s[i]=el(t.id,t.dimension,this.strandsContext)}et(t);let a=el(i.id,i.dimension,this.strandsContext);for(let t in this.bodyResults=this.bodyCb(a,s)||{},this.bodyResults)this.bodyResults[t]=this.strandsContext.p5.strandsNode(this.bodyResults[t]);this.phiNodesForBody=o,this.finalBodyBlock=t.currentBlock,et(t)}loopIsBounded(t,r,n){if(!r)return!1;let i=X(this.strandsContext.dag,r.id);if(i.nodeType!==S.OPERATION||!i.dependsOn||2!==i.dependsOn.length)return!1;let s=el(i.dependsOn[0],1,this.strandsContext),o=el(i.dependsOn[1],1,this.strandsContext),a=this.nodeUsesOnlyLiterals(s),l=this.nodeUsesOnlyLiterals(o);return a||l}nodeUsesOnlyLiterals(t){let r=X(this.strandsContext.dag,t.id);switch(r.nodeType){case S.LITERAL:return!0;case S.VARIABLE:case S.PHI:return!1;case S.OPERATION:if(r.dependsOn)for(let t of r.dependsOn){let r=el(t,1,this.strandsContext);if(!this.nodeUsesOnlyLiterals(r))return!1}return!0;default:return!1}}}let h_={width:{typeInfo:k.float1,get:t=>t.width},height:{typeInfo:k.float1,get:t=>t.height},mouseX:{typeInfo:k.float1,get:t=>t.mouseX},mouseY:{typeInfo:k.float1,get:t=>t.mouseY},pmouseX:{typeInfo:k.float1,get:t=>t.pmouseX},pmouseY:{typeInfo:k.float1,get:t=>t.pmouseY},winMouseX:{typeInfo:k.float1,get:t=>t.winMouseX},winMouseY:{typeInfo:k.float1,get:t=>t.winMouseY},pwinMouseX:{typeInfo:k.float1,get:t=>t.pwinMouseX},pwinMouseY:{typeInfo:k.float1,get:t=>t.pwinMouseY},frameCount:{typeInfo:k.float1,get:t=>t.frameCount},deltaTime:{typeInfo:k.float1,get:t=>t.deltaTime},displayWidth:{typeInfo:k.float1,get:t=>t.displayWidth},displayHeight:{typeInfo:k.float1,get:t=>t.displayHeight},windowWidth:{typeInfo:k.float1,get:t=>t.windowWidth},windowHeight:{typeInfo:k.float1,get:t=>t.windowHeight},mouseIsPressed:{typeInfo:k.bool1,get:t=>t.mouseIsPressed}};function hA(t,r,n,i){let s=(t._builtinGlobals&&t._builtinGlobals.dag===t.dag||(t._builtinGlobals={dag:t.dag,nodes:new Map,uniformsAdded:new Set}),t._builtinGlobals),o=s.nodes.get(r);if(o)return o;s.uniformsAdded.has(r)||(s.uniformsAdded.add(r),t.uniforms.push({name:r,typeInfo:n,defaultValue:i}));let{id:a,dimension:l}=eh(t,n,r),u=el(a,l,t);return s.nodes.set(r,u),u}function hE(t,r,n,i){t[n]=i;let s=r?.Graphics?.prototype;s&&(s[n]=i)}function hC(t,r,n,i){if(!n?.isStrandsNode)return ef(t,r,n).id;let s=t.dag,o=n.id,a={baseType:s.baseTypes[o],dimension:s.dimensions[o]};if(a.dimension!==r.dimension)if(1!==a.dimension){let t=a.baseType+(a.dimension>1?a.dimension:""),n=r.baseType+r.dimension;q("type error",`You have returned a ${t} in ${i} when a ${n} was expected!
58
59Make sure your hook returns the correct type.`)}else o=ef(t,r,n).id;else a.baseType!==r.baseType&&(o=ef(t,r,n).id);return o}function hD(t,r){function n(r,i,{active:s=!1,renderer:o=null,baseShader:a=null}={}){r.dag=W(),r.cfg=Q(),r.uniforms=[],r.vertexDeclarations=new Set,r.fragmentDeclarations=new Set,r.hooks=[],r.backend=i,r.active=s,r.renderer=o,r.baseShader=a,r.previousFES=t.disableFriendlyErrors,r.windowOverrides={},r.fnOverrides={},r.graphicsOverrides={},s&&(t.disableFriendlyErrors=!0),r.p5=t}r._runStrandsInGlobalMode=!1;let i={};n(i),function(t,r,n){for(let{name:r,arity:i,opCode:s}of z)"binary"===i&&(ea.prototype[r]=function(...t){let{id:r,dimension:i}=function(t,r,n,i){let s,{dag:o,cfg:a}=t;if(n[0]instanceof ea&&1===n.length)s=n[0];else{let{id:r,dimension:i}=ef(t,{baseType:I.FLOAT,dimension:null},n);s=el(r,i,t)}let l=r.id,u=s.id,h=Y(o,r.id),c=Y(o,s.id);h.baseType===I.ASSIGN_ON_USE&&c.baseType!==I.ASSIGN_ON_USE?(K(o,r.id,c.baseType,c.dimension),h=Y(o,r.id)):c.baseType===I.ASSIGN_ON_USE&&h.baseType!==I.ASSIGN_ON_USE&&(K(o,s.id,h.baseType,h.dimension),c=Y(o,s.id));let d={node:null,toType:h};if(h.baseType===c.baseType&&h.baseType===I.DEFER){d.toType.baseType=I.FLOAT,h.dimension===c.dimension?d.toType.dimension=h.dimension:1===h.dimension&&c.dimension>1?d.toType.dimension=c.dimension:1===c.dimension&&h.dimension>1?d.toType.dimension=h.dimension:q("type error",`You have tried to perform a binary operation:
60${h.baseType+h.dimension} ${U[i]} ${c.baseType+c.dimension}
61It's only possible to operate on two nodes with the same dimension, or a scalar value and a vector.`);let n=ef(t,d.toType,r),o=ef(t,d.toType,s);l=n.id,u=o.id}else if(h.baseType!==c.baseType||h.dimension!==c.dimension){1===h.dimension&&c.dimension>1?(d.node=r,d.toType=c):1===c.dimension&&h.dimension>1||h.priority>c.priority?(d.node=s,d.toType=h):c.priority>h.priority?(d.node=r,d.toType=c):q("type error",`A vector of length ${h.dimension}
61 operated with a vector of length ${c.dimension} is not allowed.`);let n=ef(t,d.toType,d.node);d.node===r?l=(r=el(n.id,n.dimension,t)).id:u=(s=el(n.id,n.dimension,t)).id}V[i]&&(d.toType.baseType=I.BOOL,d.toType.dimension=1);let p=Z({nodeType:S.OPERATION,opCode:i,dependsOn:[l,u],baseType:d.toType.baseType,dimension:d.toType.dimension}),f=J(o,p);return es(a,a.currentBlock,f),{id:f,dimension:p.dimension}}(n,this,t,s);return el(r,i,n)}),"unary"===i&&(t[r]=function(t){let{id:r,dimension:i}=function(t,r,n){let i,s,{dag:o,cfg:a}=t;if(r?.isStrandsNode)s=r;else{let{id:n,dimension:i}=ef(t,{baseType:I.FLOAT,dimension:null},r);s=el(n,i,t)}i=[s.id];let l={baseType:o.baseTypes[s.id],dimension:s.dimension};V[n]&&(l.baseType=I.BOOL,l.dimension=1);let u=J(o,Z({nodeType:S.OPERATION,opCode:n,dependsOn:i,baseType:l.baseType,dimension:l.dimension}));return es(a,a.currentBlock,u),{id:u,dimension:s.dimension}}(n,t,s);return el(r,i,n)});for(let[i,s]of(hE(r,t,"discard",function(){eg(n,N.DISCARD)}),hE(r,t,"break",function(){eg(n,N.BREAK)}),t.break=r.break,hE(r,t,"instanceID",function(){let t=eh(n,{baseType:I.INT,dimension:1},n.backend.instanceIdReference());return el(t.id,t.dimension,n)}),t.strandsIf=function(t,r){return new hb(n,t,r)},hE(r,t,"strandsIf",t.strandsIf),t.strandsFor=function(t,r,i,s,o){return new hx(n,t,r,i,s,o).build()},hE(r,t,"strandsFor",t.strandsFor),t.strandsEarlyReturn=function(r){let{dag:i,cfg:s}=n;if(!n.activeHook)throw Error("strandsEarlyReturn can only be used inside a hook callback");let o=r?.isStrandsNode?r:t.strandsNode(r),a=en(s,G.DEFAULT);ei(s,s.currentBlock,a),ee(s,a);let l=J(i,Z({nodeType:S.STATEMENT,statementType:N.EARLY_RETURN,dependsOn:[o.id]}));return es(s,s.currentBlock,l),n.activeHook.earlyReturns.push({earlyReturnID:l,valueNode:o}),et(s),o},hE(r,t,"strandsEarlyReturn",t.strandsEarlyReturn),t.strandsNode=function(...t){if(1===t.length&&t[0]instanceof ea)return t[0];t.length>4&&q("type error","It looks like you've tried to construct a p5.strands node implicitly, with more than 4 components. This is currently not supported.");let r=t.flat().filter(t=>null!=t);if(0===r.length){let{id:t,dimension:r}=ef(n,{baseType:I.ASSIGN_ON_USE,dimension:null},[0]);return el(t,r,n)}let{id:i,dimension:s}=ef(n,{baseType:I.FLOAT,dimension:null},r);return el(i,s,n)},Object.entries(eo)))if(s[0].isp5Function){let s=r[i];hE(r,t,i,function(...t){if(!n.active)return s.apply(this,t);{let{id:r,dimension:s}=em(n,i,t);return el(r,s,n)}})}else hE(r,t,i,function(...r){if(n.active){let{id:t,dimension:s}=em(n,i,r);return el(t,s,n)}t._friendlyError(`It looks like you've called ${i} outside of a shader's modify() function.`)});hE(r,t,"getTexture",function(...r){if(n.active){let{id:t,dimension:i}=n.backend.createGetTextureCall(n,r);return el(t,i,n)}t._friendlyError("It looks like you've called getTexture outside of a shader's modify() function.")});let i=r.texture;hE(r,t,"texture",function(...t){return n.active?this.getTexture(...t):i.apply(this,t)});let s=r.noise,o=r.noiseDetail,a=r.millis;for(let i in n._noiseOctaves=null,n._noiseAmpFalloff=null,hE(r,t,"noiseDetail",function(t,r=.5){if(!n.active)return o.apply(this,arguments);n._noiseOctaves=t,n._noiseAmpFalloff=r}),hE(r,t,"noise",function(...i){let o;if(!n.active)return s.apply(this,i);let a=this._renderer.getNoiseShaderSnippet();n.vertexDeclarations.add(a),n.fragmentDeclarations.add(a);let l=i.flat().map(r=>t.strandsNode(r));3===l.length?o=[r.vec3(l[0],l[1],l[2])]:2===l.length?o=[r.vec3(l[0],l[1],0)]:1===l.length&&l[0].dimension<=3?o=3===l[0].dimension?l:2===l[0].dimension?[r.vec3(l[0],0)]:[r.vec3(l[0],0,0)]:t._friendlyError(`It looks like you've called noise() with ${i.length} arguments. It only supports 1D to 3D input.`);let u=null!==n._noiseOctaves?n._noiseOctaves:r._getNoiseOctaves(),h=null!==n._noiseAmpFalloff?n._noiseAmpFalloff:r._getNoiseAmpFalloff();o.push(u),o.push(h);let{id:c,dimension:d}=em(n,"noise",o,{overloads:[{params:[k.float3,k.int1,k.float1],returnType:k.float1}]});return el(c,d,n)}),hE(r,t,"millis",function(...t){if(!n.active)return a.apply(this,t);let r=n.renderer?._pInst||n.p5?.instance;return hA(n,"_p5_global_millis",k.float1,()=>r?r.millis():void 0)}),k){let s;if(i===I.DEFER||i===I.ASSIGN_ON_USE||"sampler"===i)continue;let o=k[i],a=[];for(let i of(/^[ib]vec/.test(o.fnName)?a.push((s=o.fnName.slice(0,2).toUpperCase()+o.fnName.slice(2).toLowerCase()).replace("Vec","Vector")):"Sampler2D"===(s=o.fnName.charAt(0).toUpperCase()+o.fnName.slice(1))?a.push("Texture"):/^vec/.test(o.fnName)&&a.push(s.replace("Vec","Vector")),hE(r,t,`uniform${s}`,function(t,r){let{id:i,dimension:s}=eh(n,o,t);return n.uniforms.push({name:t,typeInfo:o,defaultValue:r}),el(i,s,n)}),hE(r,t,`shared${s}`,function(t){let{id:r,dimension:i}=eh(n,o,t);return n.sharedVariables||(n.sharedVariables=new Map),n.sharedVariables.set(t,{typeInfo:o,usedInVertex:!1,usedInFragment:!1}),el(r,i,n)}),hE(r,t,`varying${s}`,r[`shared${s}`]),a))hE(r,t,`uniform${i}`,r[`uniform${s}`]),hE(r,t,`varying${i}`,r[`varying${s}`]),hE(r,t,`shared${i}`,r[`shared${s}`]);let l=r[o.fnName];hE(r,t,o.fnName,function(...r){if(n.active)if(1===r.length&&r[0].dimension&&r[0].dimension===o.dimension){let{id:t,dimension:i}=em(n,n.backend.getTypeName(o.baseType,o.dimension),r,{overloads:[{params:[r[0].typeInfo()],returnType:o}]});return el(t,i,n)}else{!(o.dimension>1)||1!==r.length||Array.isArray(r[0])||r[0]instanceof ea&&r[0].dimension>1||o.baseType!==I.FLOAT&&o.baseType!==I.INT&&o.baseType!==I.BOOL||(r=Array(o.dimension).fill(r[0]));let{id:t,dimension:i}=ef(n,o,r);return el(t,i,n)}if(l)return l.apply(this,r);t._friendlyError(`It looks like you've called ${o.fnName} outside of a shader's modify() function.`)})}}(t,r,i);let s=t.Shader.prototype.modify;
61t.Shader.prototype.modify=function(o,a={}){try{if(!(o instanceof Function)&&"string"!=typeof o)return s.call(this,o);{let l;n(i,this._renderer.strandsBackend,{active:!0,renderer:this._renderer,baseShader:this}),function(t,r,n){!function(t){if(t._builtinGlobalsAccessorsInstalled)return;let r=()=>t.renderer?._pInst||t.p5?.instance;for(let n of Object.keys(h_)){let i=h_[n];Object.defineProperty(window,n,{get:()=>{if(t.active){let r=h_[n];if(!r)return null;let i=`_p5_global_${n}`,s=t.renderer?._pInst||t.p5?.instance,o=hA(t,i,r.typeInfo,()=>s?r.get(s):void 0);return o._originalBuiltinName=n,o}let s=r();return i.get(s)}})}t._builtinGlobalsAccessorsInstalled=!0}(t);let i=Object.fromEntries(Object.entries(n.hooks.vertex).map(([t,r])=>[t,{...r,shaderContext:"vertex"}])),s=Object.fromEntries(Object.entries(n.hooks.fragment).map(([t,r])=>[t,{...r,shaderContext:"fragment"}])),o={...i,...s},a=Object.keys(o).map(t=>n.hookTypes(t)),{cfg:l,dag:u}=t;for(let n of a){let i,s=function(t){s._result=t(...h())??s._result,c()};function h(){t.activeHook=s,i=en(l,G.FUNCTION),ei(l,l.currentBlock,i),ee(l,i);let r=function(t,r){let n=[],i=t.dag;for(let s of r)if(B(s.type)){let r=M(s),{id:o,dimension:a}=ec(t,r,s.name,[]),l=el(o,a,t).withStructProperties(r.properties.map(t=>t.name));for(let n=0;n<r.properties.length;n++){let o=r.properties[n];Object.defineProperty(l,o.name,{get(){let o=X(i,i.dependsOn[l.id][n]),a=o=>{let a=i.dependsOn[l.id].slice();a[n]=o,l.id=ec(t,r,s.name,a).id};return el(o.id,o.dimension,t,a)},set(a){let u,h=[...i.dependsOn[l.id]];u=a?.isStrandsNode?a.id:ef(t,o.dataType,a).id,h[n]=u,l.id=ec(t,r,s.name,h).id}})}n.push(l)}else{if("sampler"===s.type.typeName)continue;if(!s.type.dataType)throw Error(`Missing dataType for parameter ${s.name} of type ${s.type.typeName}`);let{id:r,dimension:i}=eh(t,s.type.dataType,s.name),o=el(r,i,t);n.push(o)}return n}(t,n.parameters),o=n.parameters.filter(t=>t.type.properties).length,a=-1;1===o&&(a=n.parameters.findIndex(t=>t.type.properties));for(let t=0;t<r.length;t++)if(t===a){for(let t of r[a].structProperties||[])Object.defineProperty(s,t,{get:()=>r[a][t],set(n){r[a][t]=n},enumerable:!0});n.returnType?.typeName===n.parameters[a].type.typeName&&s.set(r[a])}else s[n.parameters[t].name]=r[t];return r}function c(){let r=s._result;t.activeHook=void 0;let a=n.returnType,h=null,c=r=>{if(B(a)){let i=M(a);if(r?.isStrandsNode){let s=X(t.dag,r.id);if(s.baseType!==i.typeName){let t=s.baseType||"undefined",o=u.dimensions[r.id],a=o>1?`${t}${o}`:t,l=i.properties.map(t=>t.name).join(", ");q("type error",`You have returned a ${a} from ${n.name} when a ${i.typeName} was expected.
62
63The ${i.typeName} struct has these properties: { ${l} }
64
65Instead of returning a different type, you should modify and return the ${i.typeName} struct that was passed to your hook.
66
67For example:
68${n.name}((inputs) => {
69  // Modify properties of inputs
70  inputs.someProperty = ...;
71  return inputs; // Return the modified struct
72})`)}let o=s.dependsOn.slice();for(let a=0;a<i.properties.length;a++){let l=i.properties[a].dataType,h=el(s.dependsOn[a],u.dependsOn[r.id],t);o[a]=hC(t,l,h,n.name)}return u.dependsOn[r.id]=o,r.id}{let s=i.properties,o=[];for(let l=0;l<s.length;l++){let u=s[l],h=r[u.name];if(void 0===h){let t=a.properties.map(t=>t.name).join(", "),s=Object.keys(r).join(", ");q("type error",`You've returned an incomplete ${i.typeName} struct from ${n.name}.
73
74Expected properties: { ${t} }
75Received properties: { ${s} }
76
77All properties are required! Make sure to include all properties in the returned struct.`)}let c=hC(t,u.dataType,h,n.name);o.push(c)}return function(t,r,n){let{cfg:i,dag:s}=t,{identifer:o,properties:a}=r;n.length!==a.length&&q("type error",`You've tried to construct a ${r.typeName} struct with ${n.length} properties, but it expects ${a.length} properties.
78The properties it expects are:
79${a.map(t=>t.name+" "+t.DataType.baseType+t.DataType.dimension)}`);let l=[];for(let r=0;r<a.length;r++){let i=a[r],{originalNodeID:s,mappedDependencies:o}=ed(t,i.dataType,n[r]);s?l.push(s):l.push(ep(t,i.dataType,o))}let u=J(s,Z({nodeType:S.OPERATION,opCode:P.Nary.CONSTRUCTOR,dimension:a.length,baseType:r.typeName,dependsOn:l}));return es(i,i.currentBlock,u),{id:u,dimension:a.length,components:r.components}}(t,i,o).id}}if(!a.dataType)throw Error(`Missing dataType for return type ${a.typeName}`);return hC(t,a.dataType,r,n.name)};for(let{valueNode:t,earlyReturnID:r}of s.earlyReturns){let n=c(t);u.dependsOn[r]=[n]}h=r?c(r):void 0;let d=o[`${n.returnType.typeName} ${n.name}`];t.hooks.push({hookType:n,entryBlockID:i,rootNodeID:h,shaderContext:d?.shaderContext}),et(l)}s.set=function(t){s._result=t},s.begin=h,s.end=c;let a=[n.name];t.baseShader?.hooks?.hookAliases?.[n.name]&&a.push(...t.baseShader.hooks.hookAliases[n.name]);let d=/^get([A-Z0-9]\w*)$/.exec(n.name);if(d){let t=d[1][0].toLowerCase()+d[1].slice(1);r[t]||a.push(t)}for(let n of a){t.windowOverrides[n]=window[n],t.fnOverrides[n]=r[n],window[n]=s,r[n]=s;let i=t.p5?.Graphics?.prototype;i&&(t.graphicsOverrides[n]=Object.prototype.hasOwnProperty.call(i,n)?i[n]:void 0,i[n]=s)}s.earlyReturns=[]}}(i,r,this);1;{let r="string"==typeof o?`(${o})`:`(${o.toString()})`;l=function(t,r,n,i){let s,o;ha=0,hl=0;
79let a=(0,ug.qg)(r,{ecmaVersion:2021,locations:n}),l=[];for(let t of(uy(a,{ArrowFunctionExpression(t,r){hy(t)&&l.push(t)},FunctionExpression(t,r){hy(t)&&l.push(t)},FunctionDeclaration(t,r){hy(t)&&l.push(t)}}),l))!function(t){if(!t.body||"BlockStatement"!==t.body.type)return;let r=new Map;if(uv(t.body,{},{CallExpression(t){if(t.callee?.type==="MemberExpression"&&t.callee?.property?.name==="set"&&t.callee?.object){let n=t.callee.object,i=ho.generate(n);r.has(i)||r.set(i,n)}}}),0!==r.size)for(let[n,i]of r){let r=n.replace(/[^a-zA-Z0-9_]/g,"_"),s=`__${r}_value`,o={type:"VariableDeclaration",declarations:[{type:"VariableDeclarator",id:{type:"Identifier",name:s},init:null}],kind:"let"},a=-1;for(let r=0;r<t.body.body.length;r++){let i=t.body.body[r];if("ExpressionStatement"===i.type&&i.expression?.type==="CallExpression"&&i.expression?.callee?.type==="MemberExpression"&&i.expression?.callee?.property?.name==="begin"&&ho.generate(i.expression.callee.object)===n){a=r;break}}-1!==a?t.body.body.splice(a+1,0,o):t.body.body.unshift(o);let l={CallExpression(t,r,i){if(t.callee?.type==="MemberExpression"&&t.callee?.property?.name==="set"&&t.callee?.object&&ho.generate(t.callee.object)===n&&t.arguments.length>0){let r=null;for(let t=i.length-1;t>=0;t--)if("ExpressionStatement"===i[t].type){r=i[t];break}r&&(r.type="ExpressionStatement",r.expression={type:"AssignmentExpression",operator:"=",left:{type:"Identifier",name:s},right:t.arguments[0]})}}};uy(t.body,l);let u={type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"MemberExpression",object:JSON.parse(JSON.stringify(i)),property:{type:"Identifier",name:"set"},computed:!1},arguments:[{type:"Identifier",name:s}]}},h=-1;for(let r=0;r<t.body.body.length;r++){let i=t.body.body[r];if("ExpressionStatement"===i.type&&i.expression?.type==="CallExpression"&&i.expression?.callee?.type==="MemberExpression"&&i.expression?.callee?.property?.name==="end"&&ho.generate(i.expression.callee.object)===n){h=r;break}}if(-1!==h)t.body.body.splice(h,0,u);else{let r=t.body.body[t.body.body.length-1];r&&"ReturnStatement"===r.type?t.body.body.splice(t.body.body.length-1,0,u):t.body.body.push(u)}}}(t);let u={...hm};delete u.IfStatement,delete u.ForStatement,uy(a,u,void 0,{varyings:{}});let h=[];for(let t of(uy(a,{VariableDeclarator(t,r){let n=t.init;n&&("ArrowFunctionExpression"===n.type||"FunctionExpression"===n.type)&&hg(n)&&h.push(n)},FunctionDeclaration(t,r){hg(t)&&h.push(t)},CallExpression(t,r){}}),h)){var c;(c=t).body&&"BlockStatement"===c.body.type&&(c.body.body.unshift({type:"VariableDeclaration",declarations:[{type:"VariableDeclarator",id:{type:"Identifier",name:"__returnValue"},init:null}],kind:"let"}),function t(r){for(let n=0;n<r.length;n++){let i=r[n];if("IfStatement"===i.type&&function(t){let r=!1;return t&&uv(t,{}
79,{ReturnStatement(){r=!0}}),r}(i.consequent)&&!i.alternate){let s=r.slice(n+1);s.length>0&&(i.alternate={type:"BlockStatement",body:s},r.splice(n+1),t(i.alternate.body))}"IfStatement"===i.type?(i.consequent&&"BlockStatement"===i.consequent.type&&t(i.consequent.body),i.alternate&&"BlockStatement"===i.alternate.type&&t(i.alternate.body)):"ForStatement"===i.type&&i.body&&"BlockStatement"===i.body.type?t(i.body.body):"BlockStatement"===i.type&&t(i.body)}}(c.body.body),uv(c.body,{},{ReturnStatement(t){t.type="ExpressionStatement",t.expression={type:"AssignmentExpression",operator:"=",left:{type:"Identifier",name:"__returnValue"},right:t.argument||{type:"Identifier",name:"undefined"}},delete t.argument}}),c.body.body.push({type:"ReturnStatement",argument:{type:"Identifier",name:"__returnValue"}}))}uv(a,{varyings:{},inControlFlow:0},{IfStatement(t,r,n){r.inControlFlow++,t.test&&n(t.test,r),t.consequent&&n(t.consequent,r),t.alternate&&n(t.alternate,r),hm.IfStatement(t,r,[]),r.inControlFlow--},ForStatement(t,r,n){r.inControlFlow++,t.init&&n(t.init,r),t.test&&n(t.test,r),t.update&&n(t.update,r),t.body&&n(t.body,r),hm.ForStatement(t,r,[]),r.inControlFlow--}
79,ReturnStatement(t,r,n){r.inControlFlow&&(t.type="ExpressionStatement",t.expression={type:"CallExpression",callee:{type:"Identifier",name:"__p5.strandsEarlyReturn"},arguments:t.argument?[t.argument]:[]},delete t.argument)}});let d=ho.generate(a),p=Object.keys(i),f=/\(?\s*(?:function)?\s*\w*\s*\(([^)]*)\)\s*(?:=>)?\s*{((?:.|\n)*)}\s*;?\s*\)?/.exec(d);if(!f)throw console.log(d),Error("Could not parse p5.strands function!");let m=f[1].split(/,\s*/).filter(t=>!!t.trim());m.length>0?(o=m,s=[i]):(o=p,s=p.map(t=>i[t]));let g=f[2];try{let r=Function("__p5",...o,g);return()=>r(t,...s)}catch(t){throw console.error(t),console.log(o),console.log(g),Error("Error transpiling p5.strands callback!")}}(t,r,!1,a)}let u=en(i.cfg,G.GLOBAL);ee(i.cfg,u),i.renderer?._pInst?._runStrandsInGlobalMode?function(t,n){if(t._isGlobal)return n();let i={};for(let n of Object.getOwnPropertyNames(r)){let s=Object.getOwnPropertyDescriptor(r,n);s&&!s.get&&"function"==typeof r[n]&&(i[n]=window[n],window[n]=r[n].bind(t))}try{n()}finally{for(let t in i)window[t]=i[t]}}(i.renderer._pInst,l):l(),et(i.cfg);let h=function(t){let{cfg:r,backend:n,vertexDeclarations:i,fragmentDeclarations:s}=t,o={uniforms:{},varyingVariables:[]};for(let{name:r,typeInfo:i,defaultValue:s}of t.uniforms){let t=n.generateHookUniformKey(r,i);null!==t&&(o.uniforms[t]=s)}for(let{hookType:i,rootNodeID:s,entryBlockID:a,shaderContext:l}of(n.addTextureBindingsToDeclarations&&n.addTextureBindingsToDeclarations(t),t.hooks)){let u,h={indent:1,codeLines:[],write(t){this.codeLines.push("  ".repeat(this.indent)+t)},tempNames:{},declarations:[],nextTempID:0,visitedNodes:new Set,shaderContext:l,strandsContext:t};for(let i of function(t,r){let n=new Set,i=[];return!function r(s){if(!n.has(s)){for(let i of(n.add(s),t[s].sort((t,r)=>r-t)||[]))r(i);i.push(s)}}(r),i.reverse()}(r.outgoingEdges,a))n.generateBlock(i,t,h);let c=n.hookEntry(i);if(i.returnType.properties)u=M(i.returnType);else{if(!i.returnType.dataType)throw Error(`Missing dataType for return type ${i.returnType.typeName}`);u=i.returnType.dataType}
79s&&n.generateReturnStatement(t,h,s,u),o[`${i.returnType.typeName} ${i.name}`]=[c,...h.codeLines,"}"].join("\n")}if(t.sharedVariables)for(let[r,a]of t.sharedVariables)a.usedInVertex&&a.usedInFragment?o.varyingVariables.push(n.generateVaryingVariable(r,a.typeInfo)):a.usedInVertex?i.add(n.generateLocalDeclaration(r,a.typeInfo)):a.usedInFragment&&s.add(n.generateLocalDeclaration(r,a.typeInfo));return o.vertexDeclarations=[...i].join("\n"),o.fragmentDeclarations=[...s].join("\n"),o}(i);return s.call(this,h)}}finally{for(let r in i.dag=W(),i.cfg=Q(),i.uniforms=[],i.vertexDeclarations=new Set,i.fragmentDeclarations=new Set,i.hooks=[],i.active=!1,t.disableFriendlyErrors=i.previousFES,i.windowOverrides)window[r]=i.windowOverrides[r];for(let t in i.fnOverrides)r[t]=i.fnOverrides[t];let n=t.Graphics?.prototype;if(n)for(let t in i.graphicsOverrides)void 0===i.graphicsOverrides[t]?delete n[t]:n[t]=i.graphicsOverrides[t]}}}"undefined"!=typeof p5&&p5.registerAddon(hD);let hw="undefined"==typeof IS_MINIFIED?tw.use(t$).use(tG).init({fallbackLng:"en",nestingPrefix:"$tr(",nestingSuffix:")",defaultNS:"translation",returnEmptyString:!1,interpolation:{escapeValue:!1},detection:{checkWhitelist:!1,order:["querystring","navigator","htmlTag","path","subdomain"],caches:[]},backend:{fallback:"en",loadPath:`https://cdn.jsdelivr.net/npm/p5@${d.az.replace(/^(\d+\.\d+)\.\d+.*$/,"$1")}/translations/{{lng}}/{{ns}}.json`},partialBundledLanguages:!0,resources:tj}).then(t=>{tH=t},t=>console.debug(`Translations failed to load (${t})`)):Promise.resolve();!function(t){t.registerAddon(ew.A),t.registerAddon(eS.A),t.registerAddon(eF.A),t.registerAddon(eT.A),t.registerAddon(ez.Ay)}(eq),function(t){t.registerAddon(eW),t.registerAddon(eZ),t.registerAddon(eX),t.registerAddon(eY),t.registerAddon(eJ)}(eq),function(t){t.registerAddon(x.c),t.registerAddon(x.a),t.registerAddon(eN.A)}(eq),function(t){t.registerAddon(tW),t.registerAddon(tX),t.registerAddon(um),t.registerAddon(uD),t.registerAddon(uw)}(eq),eq.registerAddon(uS),function(t){t.registerAddon(uF),t.registerAddon(v.A),t.registerAddon(b.A),t.registerAddon(eC.A)}(eq),function(t){t.registerAddon(uT),t.registerAddon(uN),t.registerAddon(uI)}(eq),function(t){t.registerAddon(g.i),t.registerAddon(g.b),t.registerAddon(y.i),t.registerAddon(eI.A),t.registerAddon(_.A),t.registerAddon(g.t)}(eq),function(t){t.registerAddon(g.d),t.registerAddon(uM),t.registerAddon(uL),t.registerAddon(eD.A)}(eq),function(t){t.registerAddon(uR),t.registerAddon(uP),t.registerAddon(uz),t.registerAddon(ej.A),t.registerAddon(uU),t.registerAddon(eM.A)}(eq),function(t){t.registerAddon(u$),t.registerAddon(uj),t.registerAddon(uV)}(eq),function(t){t.registerAddon(g.r),t.registerAddon(hs),t.registerAddon(g.p),t.registerAddon(uG),t.registerAddon(g.l),t.registerAddon(uq),t.registerAddon(g.m),t.registerAddon(he),t.registerAddon(eP.A),t.registerAddon(eR.A),t.registerAddon(eO.A),t.registerAddon(eB.A),t.registerAddon(g.c),t.registerAddon(g.f),t.registerAddon(eL.A),t.registerAddon(g.t)}(eq),function(t){t.registerAddon(eU.Ay),t.registerAddon(u9)}(eq),eq.registerAddon(_.A),eq.registerAddon(hD),Promise.all([new Promise((t,r)=>{"complete"===document.readyState?t():window.addEventListener("load",t,!1)}),hw]).then(()=>{if(void 0!==window._setupDone)return void console.warn("p5.js seems to have been imported multiple times. Please remove the duplicate import");if(!window.mocha){let t=new Event("p5Ready");window.dispatchEvent(t),(window.setup&&"function"==typeof window.setup||window.draw&&"function"==typeof window.draw)&&!eq.instance&&new eq}})},3694:(t,r,n)=>{"use strict";n.d(r,{A:()=>u,z:()=>l});var i=n(20498);n(59748),n(6439),n(45950),n(17035),n(58905);let s="video",o="audio";class a{constructor(t,r,n,i){this.callback=t,this.time=r,this.id=n,this.val=i}}class l extends i.H{constructor(t,r){super(t,r);let n=this;this.elt.crossOrigin="anonymous",this._prevTime=0,this._cueIDCounter=0,this._cues=[],this.pixels=[],this._pixelsState=this,this._pixelDensity=1,this._modified=!1,this._frameOnCanvas=-1,Object.defineProperty(n,"src",{get(){let t=n.elt.children[0].src,r=n.elt.src===window.location.href?"":n.elt.src;return t===window.location.href?r:t},set(r){for(let t=0;t<n.elt.children.length;t++)n.elt.removeChild(n.elt.children[t]);let i=document.createElement("source");i.src=r,t.appendChild(i),n.elt.src=r,n._modified=!0}}),n._onended=function(){},n.elt.onended=function(){n._onended(n)}}play(){let t;return this.elt.currentTime===this.elt.duration&&(this.elt.currentTime=0),this.elt.readyState>1||this.elt.load(),(t=this.elt.play())&&t.catch&&t.catch(t=>{"NotAllowedError"===t.name?"undefined"==typeof IS_MINIFIED?p5._friendlyAutoplayError(this.src):console.error(t):console.error("Media play method encountered an unexpected error",t)}),this}stop(){return this.elt.pause(),this.elt.currentTime=0,this}pause(){return this.elt.pause(),this}loop(){return this.elt.setAttribute("loop",!0),this.play(),this}noLoop(){return this.elt.removeAttribute("loop"),this}_setupAutoplayFailDetection(){let t=setTimeout(()=>{"undefined"==typeof IS_MINIFIED?p5._friendlyAutoplayError(this.src):console.error(e)},500);this.elt.addEventListener("play",()=>clearTimeout(t),{passive:!0,once:!0})}autoplay(t){let r=this.elt.getAttribute("autoplay");if(this.elt.setAttribute("autoplay",t),t&&!r){let t=()=>this._setupAutoplayFailDetection();4===this.elt.readyState?t():this.elt.addEventListener("canplay",t,{passive:!0,once:!0})}return this}volume(t){if(void 0===t)return this.elt.volume;this.elt.volume=t}speed(t){if(void 0===t)return this.presetPlaybackRate||this.elt.playbackRate;this.loadedmetadata?this.elt.playbackRate=t:this.presetPlaybackRate=t}time(t){return void 0!==t&&(this.elt.currentTime=t),this.elt.currentTime}duration(){return this.elt.duration}_checkIfTextureNeedsUpdate(){this._frameOnTexture!==this._pInst.frameCount&&(this.setModified(!0),this._frameOnTexture=this._pInst.frameCount)}
79_ensureCanvas(){this.canvas||(this.canvas=document.createElement("canvas"),this.drawingContext=this.canvas.getContext("2d"),this.setModified(!0));let t=this._frameOnCanvas!==this._pInst.frameCount;this.loadedmetadata&&t&&(this.canvas.width!==this.elt.width&&(this.canvas.width=this.elt.width,this.canvas.height=this.elt.height,this.width=this.canvas.width,this.height=this.canvas.height),this.drawingContext.clearRect(0,0,this.canvas.width,this.canvas.height),!0===this.flipped&&(this.drawingContext.save(),this.drawingContext.scale(-1,1),this.drawingContext.translate(-this.canvas.width,0)),this.drawingContext.drawImage(this.elt,0,0,this.canvas.width,this.canvas.height),!0===this.flipped&&this.drawingContext.restore(),this.setModified(!0),this._frameOnCanvas=this._pInst.frameCount)}loadPixels(...t){return this._ensureCanvas(),p5.Renderer2D.prototype.loadPixels.apply(this,t)}updatePixels(t,r,n,i){return this.loadedmetadata&&(this._ensureCanvas(),p5.Renderer2D.prototype.updatePixels.call(this,t,r,n,i)),this.setModified(!0),this}get(...t){return this._ensureCanvas(),p5.Renderer2D.prototype.get.apply(this,t)}_getPixel(...t){return this.loadPixels(),p5.Renderer2D.prototype._getPixel.apply(this,t)}set(t,r,n){this.loadedmetadata&&(this._ensureCanvas(),p5.Renderer2D.prototype.set.call(this,t,r,n),this.setModified(!0))}copy(...t){this._ensureCanvas(),p5.prototype.copy.apply(this,t)}mask(...t){this.loadPixels(),this.setModified(!0),p5.Image.prototype.mask.apply(this,t)}isModified(){return this._modified}setModified(t){this._modified=t}onended(t){return this._onended=t,this}_getAudioContext(){}_getSoundOut(){}connect(t){let r,n;if(this._getAudioContext()&&this._getSoundOut())r=this._getAudioContext(),n=this._getSoundOut().input;else try{n=(r=t.context).destination}catch(t){throw"connect() is meant to be used with Web Audio API or p5.sound.js"}this.audioSourceNode||(this.audioSourceNode=r.createMediaElementSource(this.elt),this.audioSourceNode.connect(n)),t?t.input?this.audioSourceNode.connect(t.input):this.audioSourceNode.connect(t):this.audioSourceNode.connect(n)}disconnect(){if(this.audioSourceNode)this.audioSourceNode.disconnect();else throw"nothing to disconnect"}showControls(){this.elt.style["text-align"]="inherit",this.elt.controls=!0}hideControls(){this.elt.controls=!1}addCue(t,r,n){let i=this._cueIDCounter++,s=new a(r,t,i,n);return this._cues.push(s),this.elt.ontimeupdate||(this.elt.ontimeupdate=this._onTimeUpdate.bind(this)),i}removeCue(t){for(let r=0;r<this._cues.length;r++)this._cues[r].id===t&&this._cues.splice(r,1);0===this._cues.length&&(this.elt.ontimeupdate=null)}clearCues(){this._cues=[],this.elt.ontimeupdate=null}_onTimeUpdate(){let t=this.time();for(let r=0;r<this._cues.length;r++){let n=this._cues[r].time,i=this._cues[r].val;this._prevTime<n&&n<=t&&this._cues[r].callback(i)}this._prevTime=t}}function u(t,r){function n(t,r,n){(r._userNode?r._userNode:document.body).appendChild(t);let s=n?new l(t,r):new i.H(t,r);return r._elements.push(s),s}function a(t,r,i,s){let o=document.createElement(r);for(let t of("string"==typeof(i=i||"")&&(i=[i]),i)){let r=document.createElement("source");r.setAttribute("src",t),o.appendChild(r)}let a=n(o,t,!0);if(a.loadedmetadata=!1,o.addEventListener("loadedmetadata",()=>{a.width=o.videoWidth,a.height=o.videoHeight,0===a.elt.width&&(a.elt.width=o.videoWidth),0===a.elt.height&&(a.elt.height=o.videoHeight),a.presetPlaybackRate&&(a.elt.playbackRate=a.presetPlaybackRate,delete a.presetPlaybackRate),a.loadedmetadata=!0}),"function"==typeof s){let t=()=>{s(a),o.removeEventListener("canplaythrough",t)};o.addEventListener("canplaythrough",t)}return a}r.createVideo=function(t,r){return a(this,s,t,r)},r.createAudio=function(t,r){return a(this,o,t,r)},r.VIDEO=s,r.AUDIO=o,void 0===navigator.mediaDevices&&(navigator.mediaDevices={}),void 0===navigator.mediaDevices.getUserMedia&&(navigator.mediaDevices.getUserMedia=function(t){let r=navigator.webkitGetUserMedia||navigator.mozGetUserMedia;return r?new Promise(function(n,i){r.call(navigator,t,n,i)}):Promise.reject(Error("getUserMedia is not implemented in this browser"))}),r.createCapture=function(...i){let o,a;if(!(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia))throw new DOMException("getUserMedia not supported in this browser");let l=!0,u=!0,h=!1;for(let t of i)t===r.VIDEO?u=!1:t===r.AUDIO?l=!1:"object"==typeof t?(void 0!==t.flipped&&(h=t.flipped,delete t.flipped),o=Object.assign({},o,t)):"function"==typeof t&&(a=t);o=Object.assign({},{video:l,audio:u},o);let c=document.createElement(s);c.setAttribute("playsinline",""),navigator.mediaDevices.getUserMedia(o).then(function(t){try{"srcObject"in c?c.srcObject=t:c.src=window.URL.createObjectURL(t)}catch(r){c.src=t}}).catch(r=>{"NotFoundError"===r.name&&t._friendlyError("No webcam found on this device","createCapture"),"NotAllowedError"===r.name&&t._friendlyError("Access to the camera was denied","createCapture"),console.error(r)});let d=n(c,this,!0);return d.loadedmetadata=!1,c.addEventListener("loadedmetadata",function(){c.play(),c.width?(d.width=c.width,d.height=c.height):(d.width=d.elt.width=c.videoWidth,d.height=d.elt.height=c.videoHeight),h&&(d.elt.style.transform="scaleX(-1)"),d.loadedmetadata=!0,a&&a(c.srcObject)}),d.flipped=h,d},t.MediaElement=l,l.prototype._getSoundOut=function(){return t.soundOut},l.prototype._getAudioContext=function(){return"function"==typeof r.getAudioContext?r.getAudioContext():void 0}}"undefined"!=typeof p5&&u(p5,p5.prototype)},6439:(t,r,n)=>{"use strict";n.d(r,{A:()=>
79o,_:()=>i});class i{constructor(t){if(t)this.DOM=t;else{let t=document.implementation.createDocument(null,"doc");this.DOM=t.createElement("root")}}getParent(){return new i(this.DOM.parentElement)}getName(){return this.DOM.tagName}setName(t){let r=this.DOM.innerHTML,n=this.DOM.attributes,i=document.implementation.createDocument(null,"default").createElement(t);i.innerHTML=r;for(let t=0;t<n.length;t++)i.setAttribute(n[t].nodeName,n[t].nodeValue);this.DOM=i}hasChildren(){return this.DOM.children.length>0}listChildren(){let t=[];for(let r=0;r<this.DOM.childNodes.length;r++)t.push(this.DOM.childNodes[r].nodeName);return t}getChildren(t){return t?s(this.DOM.getElementsByTagName(t)):s(this.DOM.children)}getChild(t){if("string"!=typeof t)return new i(this.DOM.children[t]);for(let r of this.DOM.children)if(r.tagName===t)return new i(r)}addChild(t){t instanceof i&&this.DOM.appendChild(t.DOM)}removeChild(t){let r=-1;if("string"==typeof t){for(let n=0;n<this.DOM.children.length;n++)if(this.DOM.children[n].tagName===t){r=n;break}}else r=t;-1!==r&&this.DOM.removeChild(this.DOM.children[r])}getAttributeCount(){return this.DOM.attributes.length}listAttributes(){let t=[];for(let r of this.DOM.attributes)t.push(r.nodeName);return t}hasAttribute(t){let r={};for(let t of this.DOM.attributes)r[t.nodeName]=t.nodeValue;return!!r[t]}getNum(t,r){let n={};for(let t of this.DOM.attributes)n[t.nodeName]=t.nodeValue;return Number(n[t])||r||0}getString(t,r){let n={};for(let t of this.DOM.attributes)n[t.nodeName]=t.nodeValue;return n[t]?String(n[t]):r||null}setAttribute(t,r){this.DOM.setAttribute(t,r)}getContent(t){return this.DOM.textContent.replace(/\s\s+/g,",")||t||null}setContent(t){this.DOM.children.length||(this.DOM.textContent=t)}serialize(){return new XMLSerializer().serializeToString(this.DOM)}}function s(t){let r=[];for(let n=0;n<t.length;n++)r.push(new i(t[n]));return r}function o(t,r){t.XML=i}"undefined"!=typeof p5&&o(p5,p5.prototype)},6977:t=>{"use strict";t.exports={version:"2.1.0"}},7307:(t,r,n)=>{"use strict";let i,s,o,a;n.d(r,{A:()=>l});let l={_toPixels(t){if(t instanceof ImageData)return t.data;if(t.getContext("2d"))return t.getContext("2d").getImageData(0,0,t.width,t.height).data;if(t.getContext("webgl")){let r=t.getContext("webgl"),n=new Uint8Array(r.drawingBufferWidth*r.drawingBufferHeight*4);return r.readPixels(0,0,t.width,t.height,r.RGBA,r.UNSIGNED_BYTE,n),n}},_getARGB(t,r){let n=4*r;return t[n+3]<<24&0xff000000|t[n]<<16&0xff0000|t[n+1]<<8&65280|255&t[n+2]},_setPixels(t,r){let n=0;for(let i=0,s=t.length;i<s;i++)t[(n=4*i)+0]=(0xff0000&r[i])>>>16,t[n+1]=(65280&r[i])>>>8,t[n+2]=255&r[i],t[n+3]=(0xff000000&r[i])>>>24},_toImageData:t=>t instanceof ImageData?t:t.getContext("2d").getImageData(0,0,t.width,t.height),_createImageData(t,r){return l._tmpCanvas=document.createElement("canvas"),l._tmpCtx=l._tmpCanvas.getContext("2d"),this._tmpCtx.createImageData(t,r)},apply(t,r,n){let i=t.getContext("2d"),s=i.getImageData(0,0,t.width,t.height),o=r(s,n);o instanceof ImageData?i.putImageData(o,0,0,0,0,t.width,t.height):i.putImageData(s,0,0,0,0,t.width,t.height)},threshold(t,r=.5){let n=l._toPixels(t),i=Math.floor(255*r);for(let t=0;t<n.length;t+=4){let r,s=n[t];r=255*(.2126*s+.7152*n[t+1]+.0722*n[t+2]>=i),n[t]=n[t+1]=n[t+2]=r}},gray(t){let r=l._toPixels(t);for(let t=0;t<r.length;t+=4){let n=r[t],i=.2126*n+.7152*r[t+1]+.0722*r[t+2];r[t]=r[t+1]=r[t+2]=i}},opaque(t){let r=l._toPixels(t);for(let t=0;t<r.length;t+=4)r[t+3]=255;return r},invert(t){let r=l._toPixels(t);for(let t=0;t<r.length;t+=4)r[t]=255-r[t],r[t+1]=255-r[t+1],r[t+2]=255-r[t+2]},posterize(t,r=4){let n=l._toPixels(t);if(r<2||r>255)throw Error("Level must be greater than 2 and less than 255 for posterize");let i=r-1;for(let t=0;t<n.length;t+=4){let s=n[t],o=n[t+1],a=n[t+2];n[t]=(s*r>>8)*255/i,n[t+1]=(o*r>>8)*255/i,n[t+2]=(a*r>>8)*255/i}},dilate(t){let r,n,i,s,o,a,u,h,c,d,p,f,m,g,y,v,b,x=l._toPixels(t),_=0,A=x.length?x.length/4:0,E=new Int32Array(A);for(;_<A;)for(r=_,n=_+t.width;_<n;)i=s=l._getARGB(x,_),u=_-1,a=_+1,h=_-t.width,c=_+t.width,u<r&&(u=_),a>=n&&(a=_),h<0&&(h=0),c>=A&&(c=_),f=l._getARGB(x,h),p=l._getARGB(x,u),m=l._getARGB(x,c),d=l._getARGB(x,a),o=77*(i>>16&255)+151*(i>>8&255)+28*(255&i),y=77*(p>>16&255)+151*(p>>8&255)+28*(255&p),g=77*(d>>16&255)+151*(d>>8&255)+28*(255&d),v=77*(f>>16&255)+151*(f>>
798&255)+28*(255&f),b=77*(m>>16&255)+151*(m>>8&255)+28*(255&m),y>o&&(s=p,o=y),g>o&&(s=d,o=g),v>o&&(s=f,o=v),b>o&&(s=m,o=b),E[_++]=s;l._setPixels(x,E)},erode(t){let r,n,i,s,o,a,u,h,c,d,p,f,m,g,y,v,b,x=l._toPixels(t),_=0,A=x.length?x.length/4:0,E=new Int32Array(A);for(;_<A;)for(r=_,n=_+t.width;_<n;)i=s=l._getARGB(x,_),u=_-1,a=_+1,h=_-t.width,c=_+t.width,u<r&&(u=_),a>=n&&(a=_),h<0&&(h=0),c>=A&&(c=_),f=l._getARGB(x,h),p=l._getARGB(x,u),m=l._getARGB(x,c),d=l._getARGB(x,a),o=77*(i>>16&255)+151*(i>>8&255)+28*(255&i),y=77*(p>>16&255)+151*(p>>8&255)+28*(255&p),g=77*(d>>16&255)+151*(d>>8&255)+28*(255&d),v=77*(f>>16&255)+151*(f>>8&255)+28*(255&f),b=77*(m>>16&255)+151*(m>>8&255)+28*(255&m),y<o&&(s=p,o=y),g<o&&(s=d,o=g),v<o&&(s=f,o=v),b<o&&(s=m,o=b),E[_++]=s;l._setPixels(x,E)},blur(t,r){!function(t,r){let n,u,h,c,d,p,f,m,g,y,v,b,x,_,A=l._toPixels(t),E=t.width,C=t.height,D=E*C,w=new Int32Array(D);for(let t=0;t<D;t++)w[t]=l._getARGB(A,t);let S=new Int32Array(D),F=new Int32Array(D),T=new Int32Array(D),N=new Int32Array(D),I=0;for(!function(t){let r=3.5*t|0;if(i!==(r=r<1?1:r<248?r:248)){let t,n,l,u;o=new Int32Array(s=1+(i=r)<<1),a=Array(s);for(let t=0;t<s;t++)a[t]=new Int32Array(256);for(let t=1,i=r-1;t<r;t++){o[r+t]=o[i]=n=i*i,l=a[r+t],u=a[i--];for(let t=0;t<256;t++)l[t]=u[t]=n*t}t=o[r]=r*r,l=a[r];for(let r=0;r<256;r++)l[r]=t*r}}(r),b=0;b<C;b++){for(v=0;v<E;v++){if(c=h=u=d=n=0,(p=v-i)<0)y=-p,p=0;else{if(p>=E)break;y=0}for(x=y;x<s&&!(p>=E);x++){let t=w[p+I];d+=(_=a[x])[(-0x1000000&t)>>>24],u+=_[(0xff0000&t)>>16],h+=_[(65280&t)>>8],c+=_[255&t],n+=o[x],p++}S[f=I+v]=d/n,F[f]=u/n,T[f]=h/n,N[f]=c/n}I+=E}for(b=0,I=0,g=(m=-i)*E;b<C;b++){for(v=0;v<E;v++){if(c=h=u=d=n=0,m<0)y=f=-m,p=v;else{if(m>=C)break;y=0,f=m,p=v+g}for(x=y;x<s&&!(f>=C);x++)d+=(_=a[x])[S[p]],u+=_[F[p]],h+=_[T[p]],c+=_[N[p]],n+=o[x],f++,p+=E;w[v+I]=d/n<<24|u/n<<16|h/n<<8|c/n}I+=E,g+=E,m++}l._setPixels(A,w)}(t,r)}}},10057:(t,r,n)=>{"use strict";n.d(r,{A:()=>i});let i=(0,n(64454).A)("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]])},10726:(t,r,n)=>{"use strict";n.d(r,{zE:()=>i});"undefined"!=typeof Float32Array&&Float32Array;class i{#n=null;constructor(...t){if(this.constructor===i)throw Error("Class is of abstract type and can't be instantiated")}}},12229:(t,r,n)=>{"use strict";n.d(r,{A:()=>i});let i=(0,n(64454).A)("Star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]])},13040:(t,r,n)=>{"use strict";n.d(r,{T:()=>i});class i{constructor(t){this.renderer=t,this.cache={}}numCached(){return Object.keys(this.cache).length}isCached(t){return void 0!==this.cache[t]}getGeometryByID(t){return this.cache[t]?.geometry}getCached(t){return this.getCachedID(t.gid)}getCachedID(t){return this.cache[t]}ensureCached(t){let r=t.gid;if(!r)throw Error("The p5.Geometry you passed in has no gid property!");if(this.isCached(r))return this.getCached(t);if(this.freeBuffers(r),Object.keys(this.cache).length>1e3){let t=Object.keys(this.cache)[0];this.freeBuffers(t)}let n={geometry:t};this.cache[r]=n;let i=t.faces.length?t.faces.flat():null,s=null;return i&&(s=i.some(t=>t>65535)?Uint32Array:Uint16Array),this.renderer._ensureGeometryBuffers(n,i,s),n}freeBuffers(t){let r=this.cache[t];r&&(delete this.cache[t],this.renderer._freeBuffers(r))}}},13185:(t,r,n)=>{"use strict";n.d(r,{Mz:()=>H,UC:()=>Z,ZL:()=>W,bL:()=>G,l9:()=>q});var i=n(11180),s=n(54435),o=n(50318),a=n(36104),l=n(5883),u=n(7759),h=n(31820),c=n(20417),d=n(34262),p=n(15104),f=n(72882),m=n(72248),g=n(97182),y=n(91309),v=n(2679),b=n(21270),x=n(95296),_="Popover",[A,E]=(0,a.A)(_,[d.Bk]),C=(0,d.Bk)(),[D,w]=A(_),S=t=>{let{__scopePopover:r,children:n,open:s,defaultOpen:o,onOpenChange:a,modal:l=!1}=t,u=C(r),h=i.useRef(null),[p,f]=i.useState(!1),[m,g]=(0,y.i)({prop:s,defaultProp:null!=o&&o,onChange:a,caller:_});return(0,x.jsx)(d.bL,{...u,children:(0,x.jsx)(D,{scope:r,contentId:(0,c.B)(),triggerRef:h,open:m,onOpenChange:g,onOpenToggle:i.useCallback(()=>g(t=>!t),[g]),hasCustomAnchor:p,onCustomAnchorAdd:i.useCallback(()=>f(!0),[]),onCustomAnchorRemove:i.useCallback(()=>f(!1),[]),modal:l,children:n})})};S.displayName=_;var F="PopoverAnchor",T=i.forwardRef((t,r)=>{let{__scopePopover:n,...s}=t,o=w(F,n),a=C(n),{onCustomAnchorAdd:l,onCustomAnchorRemove:u}=o;return i.useEffect(()=>(l(),()=>u()),[l,u]),(0,x.jsx)(d.Mz,{...a,...s,ref:r})});T.displayName=F;var N="PopoverTrigger",I=i.forwardRef((t,r)=>{let{__scopePopover:n,...i}=t,a=w(N,n),l=C(n),u=(0,o.s)(r,a.triggerRef),h=(0,x.jsx)(m.sG.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":V(a.open),...i,ref:u,onClick:(0,s.mK)(t.onClick,a.onOpenToggle)});return a.hasCustomAnchor?h:(0,x.jsx)(d.Mz,{asChild:!0,...l,children:h})});I.displayName=N;var O="PopoverPortal",[k,M]=A(O,{forceMount:void 0}),B=t=>{let{__scopePopover:r,forceMount:n,children:i,container:s}=t,o=w(O,r);return(0,x.jsx)(k,{scope:r,forceMount:n,children:(0,x.jsx)(f.C,{present:n||o.open,children:(0,x.jsx)(p.Z,{asChild:!0,container:s,children:i})})})};B.displayName=O;var L="PopoverContent",R=i.forwardRef((t,r)=>{let n=M(L,t.__scopePopover),{forceMount:i=n.forceMount,...s}=t,o=w(L,t.__scopePopover);return(0,x.jsx)(f.C,{present:i||o.open,children:o.modal?(0,x.jsx)(z,{...s,ref:r}):(0,x.jsx)(U,{...s,ref:r})})});R.displayName=L;var P=(0,g.TL)("PopoverContent.RemoveScroll"),z=i.forwardRef((t,r)=>{let n=w(L,t.__scopePopover),a=i.useRef(null),l=(0,o.s)(r,a),u=i.useRef(!1);return i.useEffect(()=>{let t=a.current;
79if(t)return(0,v.Eq)(t)},[]),(0,x.jsx)(b.A,{as:P,allowPinchZoom:!0,children:(0,x.jsx)($,{...t,ref:l,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:(0,s.mK)(t.onCloseAutoFocus,t=>{var r;t.preventDefault(),u.current||null==(r=n.triggerRef.current)||r.focus()}),onPointerDownOutside:(0,s.mK)(t.onPointerDownOutside,t=>{let r=t.detail.originalEvent,n=0===r.button&&!0===r.ctrlKey;u.current=2===r.button||n},{checkForDefaultPrevented:!1}),onFocusOutside:(0,s.mK)(t.onFocusOutside,t=>t.preventDefault(),{checkForDefaultPrevented:!1})})})}),U=i.forwardRef((t,r)=>{let n=w(L,t.__scopePopover),s=i.useRef(!1),o=i.useRef(!1);return(0,x.jsx)($,{...t,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:r=>{var i,a;null==(i=t.onCloseAutoFocus)||i.call(t,r),r.defaultPrevented||(s.current||null==(a=n.triggerRef.current)||a.focus(),r.preventDefault()),s.current=!1,o.current=!1},onInteractOutside:r=>{var i,a;null==(i=t.onInteractOutside)||i.call(t,r),r.defaultPrevented||(s.current=!0,"pointerdown"===r.detail.originalEvent.type&&(o.current=!0));let l=r.target;(null==(a=n.triggerRef.current)?void 0:a.contains(l))&&r.preventDefault(),"focusin"===r.detail.originalEvent.type&&o.current&&r.preventDefault()}})}),$=i.forwardRef((t,r)=>{let{__scopePopover:n,trapFocus:i,onOpenAutoFocus:s,onCloseAutoFocus:o,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:p,onFocusOutside:f,onInteractOutside:m,...g}=t,y=w(L,n),v=C(n);return(0,u.Oh)(),(0,x.jsx)(h.n,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:s,onUnmountAutoFocus:o,children:(0,x.jsx)(l.qW,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:m,onEscapeKeyDown:c,onPointerDownOutside:p,onFocusOutside:f,onDismiss:()=>y.onOpenChange(!1),children:(0,x.jsx)(d.UC,{"data-state":V(y.open),role:"dialog",id:y.contentId,...v,...g,ref:r,style:{...g.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),j="PopoverClose";function V(t){return t?"open":"closed"}i.forwardRef((t,r)=>{let{__scopePopover:n,...i}=t,o=w(j,n);return(0,x.jsx)(m.sG.button,{type:"button",...i,ref:r,onClick:(0,s.mK)(t.onClick,()=>o.onOpenChange(!1))})}).displayName=j,i.forwardRef((t,r)=>{let{__scopePopover:n,...i}=t,s=C(n);return(0,x.jsx)(d.i3,{...s,...i,ref:r})}).displayName="PopoverArrow";var G=S,H=T,q=I,W=B,Z=R},17035:(t,r,n)=>{"use strict";n.d(r,{A:()=>o});var i=n(87442),s=n(80841),o=new i.A({id:"hsb",name:"HSB",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},s:{range:[0,100],name:"Saturation"},b:{range:[0,100],name:"Brightness"}},base:s.A,fromBase:t=>{let r,n,i=Math.max(...t),s=i-Math.min(...t),[o,a,l]=t;return 0===s?(r=0,n=0):(n=s/i,o===i?r=(a-l)/s:a===i?r=2+(l-o)/s:l===i&&(r=4+(o-a)/s),r<0?r+=6:r>=6&&(r-=6)),[r/6*360,100*n,100*i]},toBase:a,formats:{default:{type:"custom",serialize:(t,r)=>{let n=a(t),i=`rgb(${Math.round(100*n[0]*100)/100}% ${Math.round(100*n[1]*100)/100}% ${Math.round(100*n[2]*100)/100}%`;return r<1&&(i+=` / ${r}`),i+=")"}},hsb:{coords:["<number> | <angle>","<percentage>","<percentage>"]},hsba:{coords:["<number> | <angle>","<percentage>","<percentage>"],commans:!0,lastAlpha:!0}}});function a(t){let r=t[0]/360*6,n=t[1]/100,i=t[2]/100,s=[];if(0===n)s=[i,i,i];else{let t,o,a,l=Math.floor(r),u=i*(1-n),h=i*(1-n*(r-l)),c=i*(1-n*(1+l-r));1===l?(t=h,o=i,a=u):2===l?(t=u,o=i,a=c):3===l?(t=u,o=h,a=i):4===l?(t=c,o=u,a=i):5===l?(t=i,o=u,a=h):(t=i,o=c,a=u),s=[t,o,a]}return s}},19892:t=>{!function(){"use strict";var r,n,i,s,o,a;function l(t){return t<=65535?String.fromCharCode(t):String.fromCharCode(Math.floor((t-65536)/1024)+55296)+String.fromCharCode((t-65536)%1024+56320)}for(n
vendor: 9,464 bytes, line 79
79={NonAsciiIdentifierStart:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,NonAsciiIdentifierPart:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/},
79r
vendor: 15,269 bytes, line 79
79={NonAsciiIdentifierStart:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/,NonAsciiIdentifierPart:/[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/},
79i=[5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279],a=0,s=Array(128);a<128;++a)s[a]=a>=97&&a<=122||a>=65&&a<=90||36===a||95===a;for(a=0,o=Array(128);a<128;++a)o[a]=a>=97&&a<=122||a>=65&&a<=90||a>=48&&a<=57||36===a||95===a;t.exports={isDecimalDigit:function(t){return 48<=t&&t<=57},isHexDigit:function(t){return 48<=t&&t<=57||97<=t&&t<=102||65<=t&&t<=70},isOctalDigit:function(t){return t>=48&&t<=55},isWhiteSpace:function(t){return 32===t||9===t||11===t||12===t||160===t||t>=5760&&i.indexOf(t)>=0},isLineTerminator:function(t){return 10===t||13===t||8232===t||8233===t},isIdentifierStartES5:function(t){return t<128?s[t]:n.NonAsciiIdentifierStart.test(l(t))},isIdentifierPartES5:function(t){return t<128?o[t]:n.NonAsciiIdentifierPart.test(l(t))},isIdentifierStartES6:function(t){return t<128?s[t]:r.NonAsciiIdentifierStart.test(l(t))},isIdentifierPartES6:function(t){return t<128?o[t]:r.NonAsciiIdentifierPart.test(l(t))}}}()},20498:(t,r,n)=>{"use strict";n.d(r,{A:()=>l,H:()=>a});var i=n(59748),s=n(45950),o=n(58905);n(6439),n(17035);class a{width;height;elt;constructor(t,r){this.elt=t,this._pInst=this._pixelsState=r,this._events={},this.width=this.elt.offsetWidth,this.height=this.elt.offsetHeight}remove(){if(this.stop){this.stop();let t=this.elt.srcObject;null!==t&&t.getTracks().forEach(t=>{t.stop()})}let t=this._pInst;if(t&&!t._elements&&t._pInst&&(t=t._pInst),t&&t._elements){let r=t._elements.indexOf(this);-1!==r&&t._elements.splice(r,1)}for(let t in this._events)this.elt.removeEventListener(t,this._events[t]);this.elt&&this.elt.parentNode&&this.elt.parentNode.removeChild(this.elt)}parent(t){return void 0===t?this.elt.parentNode:("string"==typeof t?("#"===t[0]&&(t=t.substring(1)),t=document.getElementById(t)):t instanceof a&&(t=t.elt),t.appendChild(this.elt),this)}child(t){return void 0===t?this.elt.childNodes:("string"==typeof t?("#"===t[0]&&(t=t.substring(1)),t=document.getElementById(t)):t instanceof a&&(t=t.elt),t instanceof HTMLElement&&this.elt.appendChild(t),this)}html(...t){return 0===t.length?this.elt.innerHTML:(t[1]?this.elt.insertAdjacentHTML("beforeend",t[0]):this.elt.innerHTML=t[0],this)}id(t){return void 0===t?this.elt.id:(this.elt.id=t,this.width=this.elt.offsetWidth,this.height=this.elt.offsetHeight,this)}class(t){return void 0===t?this.elt.className:(this.elt.className=t,this)}addClass(t){return this.elt.className?this.hasClass(t)||(this.elt.className=this.elt.className+" "+t):this.elt.className=t,this}removeClass(t){return this.elt.classList.remove(t),this}hasClass(t){return this.elt.classList.contains(t)}toggleClass(t){return this.elt.classList.contains(t)?this.elt.classList.remove(t):this.elt.classList.add(t),this}center(t){let r=this.elt.style.display,n="none"===this.elt.style.display,i="none"===this.parent().style.display,s={x:this.elt.offsetLeft,y:this.elt.offsetTop};n&&this.show(),i&&this.parent().show(),this.elt.style.display="block",this.position(0,0);let o=Math.abs(this.parent().offsetWidth-this.elt.offsetWidth),a=Math.abs(this.parent().offsetHeight-this.elt.offsetHeight);return"both"===t||void 0===t?this.position(o/2+this.parent().offsetLeft,a/2+this.parent().offsetTop):"horizontal"===t?this.position(o/2+this.parent().offsetLeft,s.y):"vertical"===t&&this.position(s.x,a/2+this.parent().offsetTop),this.style("display",r),n&&this.hide(),i&&this.parent().hide(),this}position(...t){if(0===t.length)return{x:this.elt.offsetLeft,y:this.elt.offsetTop};{let r="absolute";return("static"===t[2]||"fixed"===t[2]||"relative"===t[2]||"sticky"===t[2]||"initial"===t[2]||"inherit"===t[2])&&(r=t[2]),this.elt.style.position=r,this.elt.style.left=t[0]+"px",this.elt.style.top=t[1]+"px",this.x=t[0],this.y=t[1],this}}show(){return this.elt.style.display="block",this}hide(){return this.elt.style.display="none",this}size(t,r){if(0==arguments.length)return{width:this.elt.offsetWidth,height:this.elt.offsetHeight};{let n=t,i=r,s=o.a4;if(n!==s||i!==s){if(n===s?n=r*this.width/this.height:i===s&&(i=t*this.height/this.width),this.elt instanceof HTMLCanvasElement){let t,r={},s=this.elt.getContext("2d");for(t in s)r[t]=s[t];for(t in this.elt.setAttribute("width",n*this._pInst._pixelDensity),this.elt.setAttribute("height",i*this._pInst._pixelDensity),this.elt.style.width=n+"px",this.elt.style.height=i+"px",this._pInst.scale(this._pInst._pixelDensity,this._pInst._pixelDensity),r)this.elt.getContext("2d")[t]=r[t]}else this.elt.style.width=n+"px",this.elt.style.height=i+"px",this.elt.width=n,this.elt.height=i;this.width=n,this.height=i,this._pInst&&this._pInst._curElement&&this._pInst._curElement.elt===this.elt&&(this._pInst.width=n,this._pInst.height=i)}return this}}style(t,r){if(r instanceof s.C&&(r=r.toString()),void 0===r)if(-1===t.indexOf(":"))return window.getComputedStyle(this.elt).getPropertyValue(t);else{let r=t.split(";");for(let t=0;t<r.length;t++){let n=r[t].split(":");
79n[0]&&n[1]&&(this.elt.style[n[0].trim()]=n[1].trim())}}else if(this.elt.style[t]=r,"width"===t||"height"===t||"left"===t||"top"===t){let r=window.getComputedStyle(this.elt).getPropertyValue(t).replace(/[^\d.]/g,"");this[t]=Math.round(parseFloat(r,10))}return this}_translate(...t){this.elt.style.position="absolute";let r="";return this.elt.style.transform&&(r=(r=this.elt.style.transform.replace(/translate3d\(.*\)/g,"")).replace(/translate[X-Z]?\(.*\)/g,"")),2===t.length?this.elt.style.transform="translate("+t[0]+"px, "+t[1]+"px)":t.length>2&&(this.elt.style.transform="translate3d("+t[0]+"px,"+t[1]+"px,"+t[2]+"px)",3===t.length?this.elt.parentElement.style.perspective="1000px":this.elt.parentElement.style.perspective=t[3]+"px"),this.elt.style.transform+=r,this}_rotate(...t){let r="";return this.elt.style.transform&&(r=(r=this.elt.style.transform.replace(/rotate3d\(.*\)/g,"")).replace(/rotate[X-Z]?\(.*\)/g,"")),1===t.length?this.elt.style.transform="rotate("+t[0]+"deg)":2===t.length?this.elt.style.transform="rotate("+t[0]+"deg, "+t[1]+"deg)":3===t.length&&(this.elt.style.transform="rotateX("+t[0]+"deg)",this.elt.style.transform+="rotateY("+t[1]+"deg)",this.elt.style.transform+="rotateZ("+t[2]+"deg)"),this.elt.style.transform+=r,this}attribute(t,r){if(null==this.elt.firstChild||"checkbox"!==this.elt.firstChild.type&&"radio"!==this.elt.firstChild.type)return void 0===r?this.elt.getAttribute(t):(this.elt.setAttribute(t,r),this);if(void 0===r)return this.elt.firstChild.getAttribute(t);for(let n=0;n<this.elt.childNodes.length;n++)this.elt.childNodes[n].setAttribute(t,r)}removeAttribute(t){if(null!=this.elt.firstChild&&("checkbox"===this.elt.firstChild.type||"radio"===this.elt.firstChild.type))for(let r=0;r<this.elt.childNodes.length;r++)this.elt.childNodes[r].removeAttribute(t);return this.elt.removeAttribute(t),this}value(...t){return t.length>0?(this.elt.value=t[0],this):"range"===this.elt.type?parseFloat(this.elt.value):this.elt.value}mousePressed(t){return a._adjustListener("pointerdown",function(r){return this._pInst.mouseIsPressed=!0,this._pInst._activePointers.set(r.pointerId,r),this._pInst._setMouseButton(r),this._pInst._updatePointerCoords(r),t.call(this,r)},this),this}doubleClicked(t){return a._adjustListener("dblclick",t,this),this}mouseWheel(t){return a._adjustListener("wheel",t,this),this}mouseReleased(t){return a._adjustListener("pointerup",t,this),this}mouseClicked(t){return a._adjustListener("click",t,this),this}mouseMoved(t){return a._adjustListener("pointermove",t,this),this}mouseOver(t){return a._adjustListener("pointerover",t,this),this}mouseOut(t){return a._adjustListener("pointerout",t,this),this}dragOver(t){return a._adjustListener("dragover",t,this),this}dragLeave(t){return a._adjustListener("dragleave",t,this),this}changed(t){return a._adjustListener("change",t,this),this}input(t){return a._adjustListener("input",t,this),this}drop(t,r){if(window.File&&window.FileReader&&window.FileList&&window.Blob){if(!this._dragDisabled){this._dragDisabled=!0;let t=function(t){t.preventDefault()};this.elt.addEventListener("dragover",t),this.elt.addEventListener("dragleave",t)}a._attachListener("drop",function(n){for(let s of(n.preventDefault(),"function"==typeof r&&r.call(this,n),n.dataTransfer.files))i.Z._load(s,t)},this)}else console.log("The File APIs are not fully supported in this browser.");return this}draggable(t){let r="ontouchstart"in window,n=0,i=0,s=0,o=0,a,l=r?"touchend":"mou
79seup",u=r?"touchmove":"mousemove";function h(a){if(a=a||window.event,r){let t=a.changedTouches;n=s-parseInt(t[0].clientX),i=o-parseInt(t[0].clientY),s=parseInt(t[0].clientX),o=parseInt(t[0].clientY)}else n=s-parseInt(a.clientX),i=o-parseInt(a.clientY),s=parseInt(a.clientX),o=parseInt(a.clientY);t.style.left=t.offsetLeft-n+"px",t.style.top=t.offsetTop-i+"px"}function c(){document.removeEventListener(l,c,!1),document.removeEventListener(u,h,!1)}return void 0===t?a=t=this.elt:t!==this.elt&&t.elt!==this.elt&&(t=t.elt,a=this.elt),a.addEventListener(r?"touchstart":"mousedown",function(t){if(t=t||window.event,r){let r=t.changedTouches;s=parseInt(r[0].clientX),o=parseInt(r[0].clientY)}else s=parseInt(t.clientX),o=parseInt(t.clientY);return document.addEventListener(l,c,!1),document.addEventListener(u,h,!1),!1},!1),a.style.cursor="move",this}static _adjustListener(t,r,n){return!1===r?a._detachListener(t,n):a._attachListener(t,r,n),this}static _attachListener(t,r,n){n._events[t]&&a._detachListener(t,n);let i=r.bind(n);n.elt.addEventListener(t,i,{capture:!1,signal:n._pInst._removeSignal}),n._events[t]=i}static _detachListener(t,r){let n=r._events[t];r.elt.removeEventListener(t,n,!1),r._events[t]=null}}function l(t,r){t.Element=a}"undefined"!=typeof p5&&l(p5,p5.prototype)},23721:(t,r,n)=>{n(25425).x,n(36496),r.SourceNode=n(89709).SourceNode},25425:(t,r,n)=>{var i=n(86556),s=n(70051),o=n(38325).C,a=n(35054).P;function l(t){t||(t={}),this._file=s.getArg(t,"file",null),this._sourceRoot=s.getArg(t,"sourceRoot",null),this._skipValidation=s.getArg(t,"skipValidation",!1),this._sources=new o,this._names=new o,this._mappings=new a,this._sourcesContents=null}l.prototype._version=3,l.fromSourceMap=function(t){var r=t.sourceRoot,n=new l({file:t.file,sourceRoot:r});return t.eachMapping(function(t){var i={generated:{line:t.generatedLine,column:t.generatedColumn}};null!=t.source&&(i.source=t.source,null!=r&&(i.source=s.relative(r,i.source)),i.original={line:t.originalLine,column:t.originalColumn},null!=t.name&&(i.name=t.name)),n.addMapping(i)}),t.sources.forEach(function(i){var o=i;null!==r&&(o=s.relative(r,i)),n._sources.has(o)||n._sources.add(o);var a=t.sourceContentFor(i);null!=a&&n.setSourceContent(i,a)}),n},l.prototype.addMapping=function(t){var r=s.getArg(t,"generated"),n=s.getArg(t,"original",null),i=s.getArg(t,"source",null),o=s.getArg(t,"name",null);this._skipValidation||this._validateMapping(r,n,i,o),null!=i&&(i=String(i),this._sources.has(i)||this._sources.add(i)),null!=o&&(o=String(o),this._names.has(o)||this._names.add(o)),this._mappings.add({generatedLine:r.line,generatedColumn:r.column,originalLine:null!=n&&n.line,originalColumn:null!=n&&n.column,source:i,name:o})},l.prototype.setSourceContent=function(t,r){var n=t;null!=this._sourceRoot&&(n=s.relative(this._sourceRoot,n)),null!=r?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[s.toSetString(n)]=r):this._sourcesContents&&(delete this._sourcesContents[s.toSetString(n)],0===Object.keys(this._sourcesContents).length&&(this._sourcesContents=null))},l.prototype.applySourceMap=function(t,r,n){var i=r;if(null==r){if(null==t.file)throw Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map\'s "file" property. Both were omitted.');i=t.file}var a=this._sourceRoot;null!=a&&(i=s.relative(a,i));var l=new o,u=new o;this._mappings.unsortedForEach(function(r){if(r.source===i&&null!=r.originalLine){var o=t.originalPositionFor({line:r.originalLine,column:r.originalColumn});null!=o.source&&(r.source=o.source,null!=n&&(r.source=s.join(n,r.source)),null!=a&&(r.source=s.relative(a,r.source)),r.originalLine=o.line,r.originalColumn=o.column,null!=o.name&&(r.name=o.name))}var h=r.source;null==h||l.has(h)||l.add(h);var c=r.name;null==c||u.has(c)||u.add(c)},this),this._sources=l,this._names=u,t.sources.forEach(function(r){var i=t.sourceContentFor(r);null!=i&&(null!=n&&(r=s.join(n,r)),null!=a&&(r=s.relative(a,r)),this.setSourceContent(r,i))},this)},l.prototype._validateMapping=function(t,r,n,i){if(r&&"number"!=typeof r.line&&"number"!=typeof r.column)throw Error("original.line and original.column are not numbers -- y
79ou probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(!t||!("line"in t)||!("column"in t)||!(t.line>0)||!(t.column>=0)||r||n||i){if(!t||!("line"in t)||!("column"in t)||!r||!("line"in r)||!("column"in r)||!(t.line>0)||!(t.column>=0)||!(r.line>0)||!(r.column>=0)||!n)throw Error("Invalid mapping: "+JSON.stringify({generated:t,source:n,original:r,name:i}))}},l.prototype._serializeMappings=function(){for(var t,r,n,o,a=0,l=1,u=0,h=0,c=0,d=0,p="",f=this._mappings.toArray(),m=0,g=f.length;m<g;m++){if(r=f[m],t="",r.generatedLine!==l)for(a=0;r.generatedLine!==l;)t+=";",l++;else if(m>0){if(!s.compareByGeneratedPositionsInflated(r,f[m-1]))continue;t+=","}t+=i.encode(r.generatedColumn-a),a=r.generatedColumn,null!=r.source&&(o=this._sources.indexOf(r.source),t+=i.encode(o-d),d=o,t+=i.encode(r.originalLine-1-h),h=r.originalLine-1,t+=i.encode(r.originalColumn-u),u=r.originalColumn,null!=r.name&&(n=this._names.indexOf(r.name),t+=i.encode(n-c),c=n)),p+=t}return p},l.prototype._generateSourcesContent=function(t,r){return t.map(function(t){if(!this._sourcesContents)return null;null!=r&&(t=s.relative(r,t));var n=s.toSetString(t);return Object.prototype.hasOwnProperty.call(this._sourcesContents,n)?this._sourcesContents[n]:null},this)},l.prototype.toJSON=function(){var t={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return null!=this._file&&(t.file=this._file),null!=this._sourceRoot&&(t.sourceRoot=this._sourceRoot),this._sourcesContents&&(t.sourcesContent=this._generateSourcesContent(t.sources,t.sourceRoot)),t},l.prototype.toString=function(){return JSON.stringify(this.toJSON())},r.x=l},25617:(t,r)=>{r.GREATEST_LOWER_BOUND=1,r.LEAST_UPPER_BOUND=2,r.search=function(t,n,i,s){if(0===n.length)return -1;var o=function t(n,i,s,o,a,l){var u=Math.floor((i-n)/2)+n,h=a(s,o[u],!0);return 0===h?u:h>0?i-u>1?t(u,i,s,o,a,l):l==r.LEAST_UPPER_BOUND?i<o.length?i:-1:u:u-n>1?t(n,u,s,o,a,l):l==r.LEAST_UPPER_BOUND?u:n<0?-1:n}(-1,n.length,t,n,i,s||r.GREATEST_LOWER_BOUND);if(o<0)return -1;for(;o-1>=0&&0===i(n[o],n[o-1],!0);)--o;return o}},25680:(t,r,n)=>{!function(){"use strict";var r=n(19892);function i(t,r){return(!!r||"yield"!==t)&&s(t,r)}function s(t,r){if(r&&function(t){switch(t){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"let":return!0;default:return!1}}(t))return!0;switch(t.length){case 2:return"if"===t||"in"===t||"do"===t;case 3:return"var"===t||"for"===t||"new"===t||"try"===t;case 4:return"this"===t||"else"===t||"case"===t||"void"===t||"with"===t||"enum"===t;case 5:return"while"===t||"break"===t||"catch"===t||"throw"===t||"const"===t||"yield"===t||"class"===t||"super"===t;case 6:return"return"===t||"typeof"===t||"delete"===t||"switch"===t||"export"===t||"import"===t;case 7:return"default"===t||"finally"===t||"extends"===t;case 8:return"function"===t||"continue"===t||"debugger"===t;case 10:return"instanceof"===t;default:return!1}}function o(t,r){return"null"===t||"true"===t||"false"===t||i(t,r)}function a(t,r){return"null"===t||"true"===t||"false"===t||s(t,r)}function l(t){var n,i,s;if(0===t.length||(s=t.charCodeAt(0),!r.isIdentifierStartES5(s)))return!1;for(n=1,i=t.length;n<i;++n)if(s=t.charCodeAt(n),!r.isIdentifierPartES5(s))return!1;return!0}function u(t){var n,i,s,o,a;if(0===t.length)return!1;for(n=0,a=r.isIdentifierStartES6,i=t.length;n<i;++n){if(55296<=(s=t.charCodeAt(n))&&s<=56319){if(++n>=i||!(56320<=(o=t.charCodeAt(n))&&o<=57343))return!1;s=(s-55296)*1024+(o-56320)+65536}if(!a(s))return!1;a=r.isIdentifierPartES6}return!0}t.exports={isKeywordES5:i,isKeywordES6:s,isReservedWordES5:o,isReservedWordES6:a,isRestrictedWord:function(t){return"eval"===t||"arguments"===t},isIdentifierNameES5:l,isIdentifierNameES6:u,isIdentifierES5:function(t,r){return l(t)&&!o(t,r)},isIdentifierES6:function(t,r){return u(t)&&!a(t,r)}}}()},28499:(t,r,n)=>{"use strict";n.d(r,{I:()=>c,R:()=>f,i:()=>d,r:()=>m});var i=n(45950),s=n(58905),o=n(7307),a=n(39247),l=n(70878);class u{#i={};constructor(t){for(let r in t)this[r]=t[r]}setValue(t,r){t in this.#i||(this.#i[t]=this[t]),this[t]=r}getDiff(){let t=this.#i;return this.#i={},t}getModified(){return this.#i}applyDiff(t){for(let t in this.#i)this[t]=this.#i[t];this.#i=t}}var h=n(69689);class c{constructor(t,r){this.width=t,this.height=r,this.canvas=document.createElement("canvas"),this.canvas.width=this.width,this.canvas.height=this.height,this.drawingContext=this.canvas.getContext("2d"),this._pixelsState=this,this._pixelDensity=1,this.gifProperties=null,this._modified=!1,this.pixels=[]}pixelDensity(t){return void 0!==t?(t<=0&&(t=1),this._pixelDensity=t,this.width/=t,this.height/=t,this):this._pixelDensity}_animateGif(t){let r=this.gifProperties,n=t._lastRealFrameTime||window.performance.now();if(0===r.lastChangeTime&&(r.lastChangeTime=n),r.playing){r.timeDisplayed=n-r.lastChangeTime;let t=r.frames[r.displayIndex].delay;if(r.timeDisplayed>=t){let i=Math.floor(r.timeDisplayed/t);if(r.timeDisplayed=0,r.lastChangeTime=n,r.displayIndex+=i,r.loopCount=Math.floor(r.displayIndex/r.numFrames),null!==r.loopLimit&&r.loopCount>=r.loopLimit)r.playing=!1;else{let t=r.displayIndex%r.numFrames;
79this.drawingContext.putImageData(r.frames[t].image,0,0),r.displayIndex=t,this.setModified(!0)}}}}loadPixels(){let t=this._pixelsState,r=this._pixelDensity,n=this.width*r,i=this.height*r,s=this.drawingContext.getImageData(0,0,n,i);t.imageData=s,this.pixels=t.pixels=s.data,this.setModified(!0)}updatePixels(t,r,n,i){let s=this._pixelsState,o=this._pixelDensity;void 0===t&&void 0===r&&void 0===n&&void 0===i&&(t=0,r=0,n=this.width,i=this.height),t*=o,r*=o,n*=o,i*=o,this.gifProperties&&(this.gifProperties.frames[this.gifProperties.displayIndex].image=s.imageData),this.drawingContext.putImageData(s.imageData,t,r,0,0,n,i),this.setModified(!0)}get(t,r,n,i){let s=this._pixelsState,o=this._pixelDensity,a=this.canvas;if(void 0===t&&void 0===r)t=r=0,n=s.width,i=s.height;else if(t*=o,r*=o,void 0===n&&void 0===i)return t<0||r<0||t>=a.width||r>=a.height?[0,0,0,0]:this._getPixel(t,r);let l=new c(n*o,i*o);return l.pixelDensity(o),l.canvas.getContext("2d").drawImage(a,t,r,n*o,i*o,0,0,n*o,i*o),l}_getPixel(t,r){let n;return[(n=this.drawingContext.getImageData(t,r,1,1).data)[0],n[1],n[2],n[3]]}set(t,r,n){t=Math.floor(t),r=Math.floor(r);let i=this._pixelsState;if(n instanceof c)this.drawingContext.save(),this.drawingContext.setTransform(1,0,0,1,0,0),this.drawingContext.scale(this._pixelDensity,this._pixelDensity),this.drawingContext.clearRect(t,r,n.width,n.height),this.drawingContext.drawImage(n.canvas,t,r),this.drawingContext.restore();else{let s=0,o=0,a=0,l=0,u=4*(r*this._pixelDensity*(this.width*this._pixelDensity)+t*this._pixelDensity);if(i.imageData||i.loadPixels(),"number"==typeof n)u<i.pixels.length&&(s=n,o=n,a=n,l=255);else if(Array.isArray(n)){if(n.length<4)throw Error("pixel array must be of the form [R, G, B, A]");u<i.pixels.length&&(s=n[0],o=n[1],a=n[2],l=n[3])}else n instanceof p5.Color&&u<i.pixels.length&&([s,o,a,l]=n._getRGBA([255,255,255,255]));for(let n=0;n<this._pixelDensity;n++)for(let h=0;h<this._pixelDensity;h++)u=4*((r*this._pixelDensity+h)*this.width*this._pixelDensity+(t*this._pixelDensity+n)),i.pixels[u]=s,i.pixels[u+1]=o,i.pixels[u+2]=a,i.pixels[u+3]=l}this.setModified(!0)}resize(t,r){0===t&&0===r?(t=this.canvas.width,r=this.canvas.height):0===t?t=this.canvas.width*r/this.canvas.height:0===r&&(r=this.canvas.height*t/this.canvas.width),t=Math.floor(t),r=Math.floor(r);let n=document.createElement("canvas");if(n.width=t,n.height=r,this.gifProperties){let n=this.gifProperties,i=(t,r)=>{let n=0;for(let i=0;i<r.height;i++)for(let s=0;s<r.width;s++){let o=Math.floor(s*t.width/r.width),a=(Math.floor(i*t.height/r.height)*t.width+o)*4;r.data[n++]=t.data[a++],r.data[n++]=t.data[a++],r.data[n++]=t.data[a++],r.data[n++]=t.data[a++]}};for(let s=0;s<n.numFrames;s++){let o=this.drawingContext.createImageData(t,r);i(n.frames[s].image,o),n.frames[s].image=o}}n.getContext("2d").drawImage(this.canvas,0,0,this.canvas.width,this.canvas.height,0,0,n.width,n.height),this.canvas.width=this.width=t,this.canvas.height=this.height=r,this.drawingContext.drawImage(n,0,0,t,r,0,0,t,r),this.pixels.length>0&&this.loadPixels(),this.setModified(!0)}copy(...t){let r,n,i,s,o,a,l,u,h;if(9===t.length)r=t[0],n=t[1],i=t[2],s=t[3],o=t[4],a=t[5],l=t[6],u=t[7],h=t[8];else if(8===t.length)r=this,n=t[0],i=t[1],s=t[2],o=t[3],a=t[4],l=t[5],u=t[6],h=t[7];else throw Error("Signature not supported");this._copyHelper(this,r,n,i,s,o,a,l,u,h)}_copyHelper(t,r,n,i,s,o,a,l,u,h){let c=r.canvas.width/r.width,d=0,p=0;r._renderer&&r._renderer.isP3D&&(d=r.width/2,p=r.height/2),t._renderer&&t._renderer.isP3D?(t.push(),t.resetMatrix(),t.noLights(),t.blendMode(t.BLEND),t.imageMode(t.CORNER),t._renderer.image(r,n+d,i+p,s,o,a,l,u,h),t.pop()):t.drawingContext.drawImage(r.canvas,c*(n+d),c*(i+p),c*s,c*o,a,l,u,h)}mask(t){void 0===t&&(t=this);let r=this.drawingContext.globalCompositeOperation,n=this._pixelDensity,i=1;t instanceof f&&(i=t._pInst._renderer._pixelDensity);let s=[t,0,0,i*t.width,i*t.height,0,0,n*this.width,n*this.height];if(this.drawingContext.globalCompositeOperation="destination-in",this.gifProperties){for(let t=0;t<this.gifProperties.frames.length;t++)this.drawingContext.putImageData(this.gifProperties.frames[t].image,0,0
79),this.copy(...s),this.gifProperties.frames[t].image=this.drawingContext.getImageData(0,0,n*this.width,n*this.height);this.drawingContext.putImageData(this.gifProperties.frames[this.gifProperties.displayIndex].image,0,0)}else this.copy(...s);this.drawingContext.globalCompositeOperation=r,this.setModified(!0)}filter(t,r){o.A.apply(this.canvas,o.A[t],r),this.setModified(!0)}blend(...t){let r=this.drawingContext.globalCompositeOperation,n=t[t.length-1],i=Array.prototype.slice.call(t,0,t.length-1);this.drawingContext.globalCompositeOperation=n,this.copy(...i),this.drawingContext.globalCompositeOperation=r,this.setModified(!0)}setModified(t){this._modified=t}isModified(){return this._modified}save(t,r){if(this.gifProperties)!function(t,r){let n=t.gifProperties,i=n.loopLimit;1===i?i=null:null===i&&(i=0);let s=new Uint8Array(t.width*t.height*n.numFrames),o=[],a={};for(let r=0;r<n.numFrames;r++){let i=new Set,s=n.frames[r].image.data,l=s.length,u=new Uint32Array(t.width*t.height);for(let t=0,r=0;t<l;t+=4,r++){let n=s[t+0],o=n<<16|s[t+1]<<8|(0|s[t+2]);i.add(o),u[r]=o}let h=[...i].sort().toString();void 0===a[h]?a[h]={freq:1,frames:[r]}:(a[h].freq+=1,a[h].frames.push(r)),o.push(u)}let l=[],u=Object.keys(a).sort(function(t,r){return a[r].freq-a[t].freq}),c=u[0].split(",").map(t=>parseInt(t));l=l.concat(a[c].frames);let d=new Set(c);for(let t=1;t<u.length;t++){let r=u[t].split(",").map(t=>parseInt(t)).filter(t=>!d.has(t));if(c.length+r.length<=256){for(let t=0;t<r.length;t++)c.push(r[t]),d.add(r[t]);l=l.concat(a[u[t]].frames)}}l=new Set(l);let p={};for(let t=0;t<c.length;t++)p[c[t]]||(p[c[t]]=t);let f=1;for(;f<c.length;)f<<=1;c.length=f;let m={loop:i,palette:new Uint32Array(c)},g=new omggif.GifWriter(s,t.width,t.height,m),y={};for(let r=0;r<n.numFrames;r++){let i=!l.has(r),s=i?[]:c,a=new Uint8Array(t.width*t.height),u={},h=new Set;o[r].forEach((t,n)=>{i?(void 0===u[t]&&(u[t]=s.length,s.push(t)),a[n]=u[t]):a[n]=p[t],r>0&&o[r-1][n]!==t&&h.add(t)});let d={},f=s.filter(t=>!h.has(t));if(f.length>0){let t=f[0],n=i?u[t]:p[t];if(r>0){for(let t=0;t<o[r].length;t++)o[r-1][t]===o[r][t]&&(a[t]=n);d.transparent=n,y.frameOpts.disposal=1}}if(d.delay=n.frames[r].delay/10,i){let t=1;for(;t<s.length;)t<<=1;s.length=t,d.palette=new Uint32Array(s)}r>0&&g.addFrame(0,0,t.width,t.height,y.pixelPaletteIndex,y.frameOpts),y={pixelPaletteIndex:a,frameOpts:d}}y.frameOpts.disposal=1,g.addFrame(0,0,t.width,t.height,y.pixelPaletteIndex,y.frameOpts);let v=new Blob([s.slice(0,g.end())],{type:"image/gif"});(0,h.P)(v,r,"gif")}(this,t);else{let n,i=this.canvas;switch(r=r||(0,h.N)(t,r)[1]||"png"){default:n="image/png";break;case"webp":n="image/webp";break;case"jpeg":case"jpg":n="image/jpeg"}i.toBlob(n=>{(0,h.P)(n,t,r)},n)}}async toBlob(){return new Promise(t=>{this.canvas.toBlob(t)})}reset(){if(this.gifProperties){let t=this.gifProperties;t.playing=!0,t.timeSinceStart=0,t.timeDisplayed=0,t.lastChangeTime=0,t.loopCount=0,t.displayIndex=0,this.drawingContext.putImageData(t.frames[0].image,0,0)}}getCurrentFrame(){if(this.gifProperties){let t=this.gifProperties;return t.displayIndex%t.numFrames}}setFrame(t){if(this.gifProperties){let r=this.gifProperties;t<r.numFrames&&t>=0?(r.timeDisplayed=0,r.lastChangeTime=0,r.displayIndex=t,this.drawingContext.putImageData(r.frames[t].image,0,0)):p5._friendlyError("Cannot set GIF to a frame number that is higher than total number of frames or below zero.","setFrame")}}numFrames(){if(this.gifProperties)return this.gifProperties.numFrames}play(){this.gifProperties&&(this.gifProperties.playing=!0)}pause(){this.gifProperties&&(this.gifProperties.playing=!1)}delay(t,r){if(this.gifProperties){let n=this.gifProperties;if(r<n.numFrames&&r>=0)n.frames[r].delay=t;else for(let r of n.frames)r.delay=t}}}function d(t,r){t.Image=c}"undefined"!=typeof p5&&d(p5,p5.prototype);class p{constructor(t={}){for(let r in t)this[r]=t[r]}clone(){return new p(this)}}class f{static states={strokeColor:null,strokeSet:!1,fillColor:null,fillSet:!1,tint:null,imageMode:s.p,rectMode:s.p,ellipseMode:s.v,strokeWeight:1,textFont:{family:"sans-serif"},textLeading:15,leadingSet:!1,textSize:12,textAlign:s.av,textBaseline:s.ax,bezierOrder:3,splineProperties:new p({ends:s.J,tightness:0}),textWrap:s.aA,fontStyle:s.a2,fontStretch:s.a2,fontWeight:s.a2,lineHeight:s.a2,fontVariant:s.a2,direction:"inherit"};constructor(t,r,n,s){if(this._pInst=t,this._isMainCanvas=s,this.pixels=[],s)this._pixelDensity=Math.ceil(window.devicePixelRatio)||1;else{let r=t._pInst?._renderer?._pixelDensity;this._pixelDensity=r||Math.ceil(window.devicePixelRatio)||1}this.width=r,this.height=n,this._events={},s&&(this._isMainCanvas=!0),this.states=new u(f.states),this.states.strokeColor=new i.C([0,0,0]),this.states.fillColor=new i.C([1,1,1]),this._pushPopStack=[],this._pushPopDepth=0,this._clipping=!1,this._clipInvert=!1,this._currentShape=void 0}get currentShape(){return this._currentShape||(this._currentShape=new l.yp(this.getCommonVertexProperties())),this._currentShape}remove(){}pixelDensity(t){let r;return"number"==typeof t?(t!==this._pixelDensity&&(this._pixelDensity=t),r=this,this.resize(this.width,this.height)):r=this._pixelDensity,r}push(){this._pushPopDepth++,this._pushPopStack.push(this.states.getDiff())}pop(){this._pushPopDepth--;let t=this._pushPopStack.pop()||{},r=this.states.getModified();this.states.applyDiff(t),this.updateShapeVertexProperties(r),this.updateShapeProperties(r)}bezierOrder(t){if(void 0===t)return this.states.bezierOrder;this.states.setValue("bezierOrder",t),this.updateShapeProperties()}bezierVertex(t,r,n=0,i=0,s=0){let o=new a.M(t,r,n),l=this.getSupportedIndividualVertexProperties().textureCoordinates?new a.M(i,s):void 0;this.currentShape.bezierVertex(o,l)}splineProperty(t,r){if(void 0===r)return this.states.splineProperties[t];this.states.setValue("splineProperties",this.states.splineProperties.clone()),this.states.splineProperties[t]=r,this.updateShapeProperties()}splineProperties(t){if(!t)return{...this.states.splineProperties};for(let r in t)this.splineProperty(r,t[r])}splineVertex(t,r,n=0,i=0,s=0){let o=new a.M(t,r,n),l=this.getSupportedIndividualVertexProperties().textureCoordinates?new a.M(i,s):void 0;this.currentShape.splineVertex(o,l)}curveDetail(t){if(void 0===t)return this.states.curveDetail;this.states.setValue("curveDetail",t)}beginShape(...t){this.currentShape.reset(),this.updateShapeVertexProperties(),this.currentShape.beginShape(...t)}endShape(...t){this.currentShape.endShape(...t),this.drawShape(this.currentShape)}beginContour(t){this.currentShape.beginContour(t)}endContour(t){this.currentShape.endContour(t)}drawShape(t,r){throw Error("Unimplemented")}vertex(t,r,n=0,i=0,s=0){let o=new a.M(t,r,n),l=this.getSupportedIndividualVertexProperties().textureCoordinates?new a.M(i,s):void 0;this.currentShape.vertex(o,l)}bezier(t,r,n,i,s,o,a,l){let u=this._pInst.bezierOrder();return this._pInst.bezierOrder(u),this._pInst.beginShape(),this._pInst.bezierVertex(t,r),this._pInst.bezierVertex(n,i),this._pInst.bezierVertex(s,o),this._pInst.bezierVertex(a,l),this._pInst.endShape(),this}spline(...t){if(8===t.length){let[r,n,i,s,o,a,l,u]=t;this._pInst.beginShape(),this._pInst.splineVertex(r,n),this._pInst.splineVertex(i,s),this._pInst.splineVertex(o,a),this._pInst.splineVertex(l,u),this._pInst.endShape()}else if(12===t.length){let[r,n,i,s,o,a,l,u,h,c,d,p]=t;this._pInst.beginShape(),this._pInst.splineVertex(r,n,i),this._pInst.splineVertex(s,o,a),this._pInst.splineVertex(l,u,h),this._pInst.splineVertex(c,d,p),this._pInst.endShape()}return this}beginClip(t={}){if(this._clipping)throw Error("It looks like you're trying to clip while already in the middle of clipping. Did you forget to endClip()?");this._clipping=!0,this._clipInvert=t.invert}endClip(){if(!this._clipping)throw Error("It looks like you've called endClip() without beginClip(). Did 
79you forget to call beginClip() first?");this._clipping=!1}resize(t,r){this.width=t,this.height=r}get(t,r,n,i){let s=this._pixelDensity,o=this.canvas;if(void 0===t&&void 0===r)t=r=0,n=this.width,i=this.height;else if(t*=s,r*=s,void 0===n&&void 0===i)return t<0||r<0||t>=o.width||r>=o.height?[0,0,0,0]:this._getPixel(t,r);let a=new c(n*s,i*s);return a.pixelDensity(s),a.canvas.getContext("2d").drawImage(o,t,r,n*s,i*s,0,0,n*s,i*s),a}scale(t,r){}fill(...t){this.states.setValue("fillSet",!0),this.states.setValue("fillColor",this._pInst.color(...t)),this.updateShapeVertexProperties()}noFill(){this.states.setValue("fillColor",null)}strokeWeight(t){if(void 0===t)return this.states.strokeWeight;this.states.setValue("strokeWeight",t)}stroke(...t){this.states.setValue("strokeSet",!0),this.states.setValue("strokeColor",this._pInst.color(...t)),this.updateShapeVertexProperties()}noStroke(){this.states.setValue("strokeColor",null)}getCommonVertexProperties(){return{}}getSupportedIndividualVertexProperties(){return{textureCoordinates:!1}}updateShapeProperties(t){if(!t||t.bezierOrder||t.splineProperties){let t=this.currentShape;t.bezierOrder(this.states.bezierOrder),t.splineProperty("ends",this.states.splineProperties.ends),t.splineProperty("tightness",this.states.splineProperties.tightness)}}updateShapeVertexProperties(t){let r=this.getCommonVertexProperties();if(!t||Object.keys(t).some(t=>t in r)){let t=this.currentShape;for(let n in r)t[n](r[n])}}_applyDefaults(){return this}finishDraw(){}_middleAlignOffset=function(){let{textFont:t,textSize:r}=this.states,n=t?.font,i=this.textDrawingContext().measureText("X"),s=(n?.data||{})["OS/2"]?.sCapHeight;return s?s*=r/n.data.head.unitsPerEm:s=i.fontBoundingBoxAscent,i.alphabeticBaseline+s/2}}function m(t,r){t.Renderer=f}},28935:(t,r,n)=>{"use strict";n.d(r,{A:()=>i});let i=(0,n(64454).A)("Trophy",[["path",{d:"M6 9H4.5a2.5 2.5 0 0 1 0-5H6",key:"17hqa7"}],["path",{d:"M18 9h1.5a2.5 2.5 0 0 0 0-5H18",key:"lmptdp"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22",key:"1nw9bq"}],["path",{d:"M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22",key:"1np0yb"}],["path",{d:"M18 2H6v7a6 6 0 0 0 12 0V2Z",key:"u46fv3"}]])},29777:(t,r,n)=>{"use strict";n.d(r,{A:()=>s});var i=n(7307);function s(t,r){r.blend=function(...r){this._renderer?this._renderer.blend(...r):t.Renderer2D.prototype.blend.apply(this,r)},r.copy=function(...t){let n,i,s,o,a,l,u,h,c;if(9===t.length)n=t[0],i=t[1],s=t[2],o=t[3],a=t[4],l=t[5],u=t[6],h=t[7],c=t[8];else if(8===t.length)n=this,i=t[0],s=t[1],o=t[2],a=t[3],l=t[4],u=t[5],h=t[6],c=t[7];else throw Error("Signature not supported");r._copyHelper(this,n,i,s,o,a,l,u,h,c)},r._copyHelper=(t,r,n,i,s,o,a,l,u,h)=>{let c=r.canvas.width/r.width,d=0,p=0;r._renderer&&r._renderer.isP3D&&(d=r.width/2,p=r.height/2),t._renderer&&t._renderer.isP3D?(t.push(),t.resetMatrix(),t.noLights(),t.blendMode(t.BLEND),t.imageMode(t.CORNER),t._renderer.image(r,n+d,i+p,s,o,a,l,u,h),t.pop()):t.drawingContext.drawImage(r.canvas,c*(n+d),c*(i+p),c*s,c*o,a,l,u,h)},r.getFilterGraphicsLayer=function(){return this._renderer.getFilterGraphicsLayer()},r.filter=function(...r){let{shader:n,operation:s,value:o,useWebGL:a}=function(...r){let n={shader:void 0,operation:void 0,value:void 0,useWebGL:!0};return r[0]instanceof t.Shader?n.shader=r[0]:(n.operation=r[0],r.length>1&&"number"==typeof r[1]&&(n.value=r[1]),!1===r[r.length-1]&&(n.useWebGL=!1)),n}(...r);return this._renderer.isP3D&&n?void this._renderer.filter(n):a||this._renderer.isP3D?void(!a&&this._renderer.isP3D&&console.warn("filter() with useWebGL=false is not supported in WEBGL"),this._renderer.isP3D?this._renderer.filter(s,o):(n?this._renderer.filterRenderer.setOperation(s,o,n):this._renderer.filterRenderer.setOperation(s,o),this._renderer.filterRenderer.applyFilter())):void(void 0!==this.canvas?i.A.apply(this.canvas,i.A[s],o):i.A.apply(this.elt,i.A[s],o))},r.get=function(t,r,n,i){return this._renderer.get(...arguments)},r.loadPixels=function(){return this._renderer.loadPixels()},r.set=function(t,r,n){this._renderer.set(t,r,n)},r.updatePixels=function(t,r,n,i){0!==this.pixels.length&&this._renderer.updatePixels(t,r,n,i)}}"undefined"!=typeof p5&&s(p5,p5.prototype)},29998:(t,r,n)=>{"use strict";n.d(r,{C:()=>s});var i=n(58905);function s(t,r,n){switch(r){case i.ak:return t.baseFilterShader().modify(({p5:t})=>{t.getColor((r,n)=>{let i=t.getTexture(n,r.texCoord),s=t.dot(i.rgb,t.vec3(.2126,.7152,.0722));return t.vec4(s,s,s,i.a)})},{p5:n});case i.aj:return t.baseFilterShader().modify(({p5:t})=>{t.getColor((r,n)=>{let i=t.getTexture(n,r.texCoord),s=t.vec3(1)-i.rgb;return t.vec4(s,i.a)})},{p5:n});case i.ae:return t.baseFilterShader().modify(({p5:t})=>{let r=t.uniformFloat("filterParameter");t.getColor((n,i)=>{let s=t.getTexture(i,n.texCoord),o=t.dot(s.rgb,t.vec3(.2126,.7152,.0722)),a=t.floor(255*r)/255,l=t.step(a,o);return t.vec4(t.vec3(l),s.a)})},{p5:n});case i.af:return t.baseFilterShader().modify(({p5:t})=>{let r=t.uniformFloat("filterParameter");t.getColor((n,i)=>{var s;let o=t.getTexture(i,n.texCoord),a=(s=o.rgb*r,s=t.floor(s)/(r-1));return t.vec4(a,o.a)})},{p5:n});case i.ab:return t.baseFilterShader().modify(({p5:t})=>{let r=t.uniformFloat("radius"),n=t.uniformVec2("direction"),i=(r,n)=>t.pow(n-t.abs(r),2);t.getColor((s,o)=>{var a;
79let l,u=s.texCoord,h=t.floor(7*r);0==t.mod(h,2)&&h++;let c=t.vec4(0),d=0,p=1;h>64&&(p=h/64,h=64);let f=(p-1)*t.mix(-.5,.5,(a=u*s.canvasSize,l=t.fract(.1031*a.xyx),l+=t.dot(l,l.yzx+33.33),t.fract((l.x+l.y)*l.z)));for(let r=0;r<h;r++){let a=r*p-(h-1)*.5*p+f,l=u+t.vec2(a,a)/s.canvasSize*n,m=i(a,(h-1)*.5*p),g=t.getTexture(o,l);c+=m*g*t.vec4(g.a,g.a,g.a,1),d+=m}let m=c/d;return t.vec4(m.r/m.a,m.g/m.a,m.b/m.a,m.a)})},{p5:n});case i.ai:return t.baseFilterShader().modify(({p5:t})=>{let r=r=>t.dot(r.rgb,t.vec3(.2126,.7152,.0722));t.getColor((n,i)=>{let s=n.texCoord,o=t.getTexture(i,s),a=r(o);for(let l=-1;l<=1;l++)for(let u=-1;u<=1;u++)if(0!=l||0!=u){let h=t.vec2(l,u)*n.texelSize,c=t.getTexture(i,s+h),d=r(c);d<a&&(a=d,o=c)}return o})},{p5:n});case i.ah:return t.baseFilterShader().modify(({p5:t})=>{let r=r=>t.dot(r.rgb,t.vec3(.2126,.7152,.0722));t.getColor((n,i)=>{let s=n.texCoord,o=t.getTexture(i,s),a=r(o);for(let l=-1;l<=1;l++)for(let u=-1;u<=1;u++)if(0!=l||0!=u){let h=t.vec2(l,u)*n.texelSize,c=t.getTexture(i,s+h),d=r(c);d>a&&(a=d,o=c)}return o})},{p5:n});case i.ag:return t.baseFilterShader().modify(({p5:t})=>{t.getColor((r,n)=>{let i=t.getTexture(n,r.texCoord);return t.vec4(i.rgb,1)})},{p5:n});default:throw Error(`Unknown filter: ${r}`)}}},31586:(t,r,n)=>{"use strict";n.d(r,{A:()=>o});var i=n(58905),s=n(45950);function o(t,r){r.beginClip=function(t={}){this._renderer.beginClip(t)},r.endClip=function(){this._renderer.endClip()},r.clip=function(t,r){this._renderer.beginClip(r),t(),this._renderer.endClip(r)},r.background=function(...t){return this._renderer.background(...t),this},r.clear=function(...t){let r=t[0]||0,n=t[1]||0,i=t[2]||0,s=t[3]||0;return this._renderer.clear(r,n,i,s),this},r.colorMode=function(t,r,n,i,o){if([s.R,s.b,s.H,s.d,s.e,s.L,s.f,s.O,s.g].includes(t)){this._renderer.states.setValue("colorMode",t),this._renderer.states.setValue("colorMaxes",this._renderer.states.colorMaxes.clone());let s=this._renderer.states.colorMaxes[t];2==arguments.length?(s[0]=r,s[1]=r,s[2]=r,s[3]=r):4==arguments.length?(s[0]=r,s[1]=n,s[2]=i):5==arguments.length&&(s[0]=r,s[1]=n,s[2]=i,s[3]=o)}return this._renderer.states.colorMode},r.fill=function(...t){return this._renderer.fill(...t),this},r.noFill=function(){return this._renderer.noFill(),this},r.noStroke=function(){return this._renderer.states.setValue("strokeColor",null),this},r.stroke=function(...t){return this._renderer.stroke(...t),this},r.erase=function(t=255,r=255){return this._renderer.erase(t,r),this},r.noErase=function(){return this._renderer.noErase(),this},r.blendMode=function(t){t===i.a2&&(console.warn("NORMAL has been deprecated for use in blendMode. defaulting to BLEND instead."),t=i.B),this._renderer.blendMode(t)}}n(17035),"undefined"!=typeof p5&&o(p5,p5.prototype)},35054:(t,r,n)=>{var i=n(70051);function s(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}s.prototype.unsortedForEach=function(t,r){this._array.forEach(t,r)},s.prototype.add=function(t){var r,n,s,o,a;(r=this._last,n=r.generatedLine,s=t.generatedLine,o=r.generatedColumn,a=t.generatedColumn,s>n||s==n&&a>=o||0>=i.compareByGeneratedPositionsInflated(r,t))?this._last=t:this._sorted=!1,this._array.push(t)},s.prototype.toArray=function(){return this._sorted||(this._array.sort(i.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},r.P=s},35889:(t,r)=>{function n(t,r,n){var i=t[r];t[r]=t[n],t[n]=i}r.g=function(t,r){!function t(r,i,s,o){if(s<o){var a=Math.round(s+Math.random()*(o-s)),l=s-1;n(r,a,o);for(var u=r[o],h=s;h<o;h++)0>=i(r[h],u)&&n(r,l+=1,h);n(r,l+1,h);var c=l+1;t(r,i,s,c-1),t(r,i,c+1,o)}}(t,r,0,t.length-1)}},36496:(t,r,n)=>{var i=n(70051),s=n(25617),o=n(38325).C,a=n(86556),l=n(35889).g;function u(t,r){var n=t;return"string"==typeof t&&(n=i.parseSourceMapInput(t)),null!=n.sections?new d(n,r):new h(n,r)}function h(t,r){var n=t;"string"==typeof t&&(n=i.parseSourceMapInput(t));var s=i.getArg(n,"version"),a=i.getArg(n,"sources"),l=i.getArg(n,"names",[]),u=i.getArg(n,"sourceRoot",null),h=i.getArg(n,"sourcesContent",null),c=i.getArg(n,"mappings"),d=i.getArg(n,"file",null);if(s!=this._version)throw Error("Unsupported version: "+s);u&&(u=i.normalize(u)),a=a.map(String).map(i.normalize).map(function(t){return u&&i.isAbsolute(u)&&i.isAbsolute(t)?i.relative(u,t):t}),this._names=o.fromArray(l.map(String),!0),this._sources=o.fromArray(a,!0),this._absoluteSources=this._sources.toArray().map(function(t){return i.computeSourceURL(u,t,r)}),this.sourceRoot=u,this.sourcesContent=h,this._mappings=c,this._sourceMapURL=r,this.file=d}function c(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}function d(t,r){var n=t;"string"==typeof t&&(n=i.parseSourceMapInput(t));var s=i.getArg(n,"version"),a=i.getArg(n,"sections");
vendor: 9,590 bytes, line 79
79if(s!=this._version)throw Error("Unsupported version: "+s);this._sources=new o,this._names=new o;var l={line:-1,column:0};this._sections=a.map(function(t){if(t.url)throw Error("Support for url field in sections not implemented.");var n=i.getArg(t,"offset"),s=i.getArg(n,"line"),o=i.getArg(n,"column");if(s<l.line||s===l.line&&o<l.column)throw Error("Section offsets must be ordered and non-overlapping.");return l=n,{generatedOffset:{generatedLine:s+1,generatedColumn:o+1},consumer:new u(i.getArg(t,"map"),r)}})}u.fromSourceMap=function(t,r){return h.fromSourceMap(t,r)},u.prototype._version=3,u.prototype.__generatedMappings=null,Object.defineProperty(u.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}}),u.prototype.__originalMappings=null,Object.defineProperty(u.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}}),u.prototype._charIsMappingSeparator=function(t,r){var n=t.charAt(r);return";"===n||","===n},u.prototype._parseMappings=function(t,r){throw Error("Subclasses must implement _parseMappings")},u.GENERATED_ORDER=1,u.ORIGINAL_ORDER=2,u.GREATEST_LOWER_BOUND=1,u.LEAST_UPPER_BOUND=2,u.prototype.eachMapping=function(t,r,n){switch(n||u.GENERATED_ORDER){case u.GENERATED_ORDER:s=this._generatedMappings;break;case u.ORIGINAL_ORDER:s=this._originalMappings;break;default:throw Error("Unknown order of iteration.")}var s,o=this.sourceRoot;s.map(function(t){var r=null===t.source?null:this._sources.at(t.source);return{source:r=i.computeSourceURL(o,r,this._sourceMapURL),generatedLine:t.generatedLine,generatedColumn:t.generatedColumn,originalLine:t.originalLine,originalColumn:t.originalColumn,name:null===t.name?null:this._names.at(t.name)}},this).forEach(t,r||null)},u.prototype.allGeneratedPositionsFor=function(t){var r=i.getArg(t,"line"),n={source:i.getArg(t,"source"),originalLine:r,originalColumn:i.getArg(t,"column",0)};if(n.source=this._findSourceIndex(n.source),n.source<0)return[];var o=[],a=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",i.compareByOriginalPositions,s.LEAST_UPPER_BOUND);if(a>=0){var l=this._originalMappings[a];if(void 0===t.column)for(var u=l.originalLine;l&&l.originalLine===u;)o.push({line:i.getArg(l,"generatedLine",null),column:i.getArg(l,"generatedColumn",null),lastColumn:i.getArg(l,"lastGeneratedColumn",null)}),l=this._originalMappings[++a];else for(var h=l.originalColumn;l&&l.originalLine===r&&l.originalColumn==h;)o.push({line:i.getArg(l,"generatedLine",null),column:i.getArg(l,"generatedColumn",null),lastColumn:i.getArg(l,"lastGeneratedColumn",null)}),l=this._originalMappings[++a]}return o},h.prototype=Object.create(u.prototype),h.prototype.consumer=u,h.prototype._findSourceIndex=function(t){var r,n=t;if(null!=this.sourceRoot&&(n=i.relative(this.sourceRoot,n)),this._sources.has(n))return this._sources.indexOf(n);for(r=0;r<this._absoluteSources.length;++r)if(this._absoluteSources[r]==t)return r;return -1},h.fromSourceMap=function(t,r){var n=Object.create(h.prototype),s=n._names=o.fromArray(t._names.toArray(),!0),a=n._sources=o.fromArray(t._sources.toArray(),!0);n.sourceRoot=t._sourceRoot,n.sourcesContent=t._generateSourcesContent(n._sources.toArray(),n.sourceRoot),n.file=t._file,n._sourceMapURL=r,n._absoluteSources=n._sources.toArray().map(function(t){return i.computeSourceURL(n.sourceRoot,t,r)});for(var u=t._mappings.toArray().slice(),d=n.__generatedMappings=[],p=n.__originalMappings=[],f=0,m=u.length;f<m;f++){var g=u[f],y=new c;y.generatedLine=g.generatedLine,y.generatedColumn=g.generatedColumn,g.source&&(y.source=a.indexOf(g.source),y.originalLine=g.originalLine,y.originalColumn=g.originalColumn,g.name&&(y.name=s.indexOf(g.name)),p.push(y)),d.push(y)}return l(n.__originalMappings,i.compareByOriginalPositions),n},h.prototype._version=3,Object.defineProperty(h.prototype,"sources",{get:function(){return this._absoluteSources.slice()}}),h.prototype._parseMappings=function(t,r){for(var n,s,o,u,h,d=1,p=0,f=0,m=0,g=0,y=0,v=t.length,b=0,x={},_={},A=[],E=[];b<v;)if(";"===t.charAt(b))d++,b++,p=0;else if(","===t.charAt(b))b++;else{for((n=new c).generatedLine=d,u=b;u<v&&!this._charIsMappingSeparator(t,u);u++);if(o=x[s=t.slice(b,u)])b+=s.length;else{for(o=[];b<u;)a.decode(t,b,_),h=_.value,b=_.rest,o.push(h);if(2===o.length)throw Error("Found a source, but no line and column");if(3===o.length)throw Error("Found a source and line, but no column");x[s]=o}n.generatedColumn=p+o[0],p=n.generatedColumn,o.length>1&&(n.source=g+o[1],g+=o[1],n.originalLine=f+o[2],f=n.originalLine,n.originalLine+=1,n.originalColumn=m+o[3],m=n.originalColumn,o.length>4&&(n.name=y+o[4],y+=o[4])),E.push(n),"number"==typeof n.originalLine&&A.push(n)}l(E,i.compareByGeneratedPositionsDeflated),this.__generatedMappings=E,l(A,i.compareByOriginalPositions),this.__originalMappings=A},h.prototype._findMapping=function(t,r,n,i,o,a){if(t[n]<=0)throw TypeError("Line must be greater than or equal to 1, got "+t[n]);if(t[i]<0)throw TypeError("Column must be greater than or equal to 0, got "+t[i]);return s.search(t,r,o,a)},h.prototype.computeColumnSpans=function(){for(var t=0;t<this._generatedMappings.length;++t){var r=this._generatedMappings[t];if(t+1<this._generatedMappings.length){var n=this._generatedMappings[t+1];if(r.generatedLine===n.generatedLine){r.lastGeneratedColumn=n.generatedColumn-1;continue}}r.lastGeneratedColumn=1/0}},h.prototype.originalPositionFor=function(t){var r={generatedLine:i.getArg(t,"line"),generatedColumn:i.getArg(t,"column")},n=this._findMapping(r,this._generatedMappings,"generatedLine","generatedColumn",i.compareByGeneratedPositionsDeflated,i.getArg(t,"bias",u.GREATEST_LOWER_BOUND));if(n>=0){var s=this._generatedMappings[n];if(s.generatedLine===r.generatedLine){var o=i.getArg(s,"source",null);null!==o&&(o=this._sources.at(o),o=i.computeSourceURL(this.sourceRoot,o,this._sourceMapURL));var a=i.getArg(s,"name",null);return null!==a&&(a=this._names.at(a)),{source:o,line:i.getArg(s,"originalLine",null),column:i.getArg(s,"originalColumn",null),name:a}}}return{source:null,line:null,column:null,name:null}},h.prototype.hasContentsOfAllSources=function(){return!!this.sourcesContent&&this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(t){return null==t})},h.prototype.sourceContentFor=function(t,r){if(!this.sourcesContent)return null;var n,s=this._findSourceIndex(t);if(s>=0)return this.sourcesContent[s];var o=t;if(null!=this.sourceRoot&&(o=i.relative(this.sourceRoot,o)),null!=this.sourceRoot&&(n=i.urlParse(this.sourceRoot))){var a=o.replace(/^file:\/\//,"");if("file"==n.scheme&&this._sources.has(a))return this.sourcesContent[this._sources.indexOf(a)];if((!n.path||"/"==n.path)&&this._sources.has("/"+o))return this.sourcesContent[this._sources.indexOf("/"+o)]}if(r)return null;throw Error('"'+o+'" is not in the SourceMap.')},h.prototype.generatedPositionFor=function(t){var r=i.getArg(t,"source");if((r=this._findSourceIndex(r))<0)return{line:null,column:null,lastColumn:null};var n={source:r,originalLine:i.getArg(t,"line"),originalColumn:i.getArg(t,"column")},s=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",i.compareByOriginalPositions,i.getArg(t,"bias",u.GREATEST_LOWER_BOUND));if(s>=0){var o=this._originalMappings[s];if(o.source===n.source)return{line:i.getArg(o,"generatedLine",null),column:i.getArg(o,"generatedColumn",null),lastColumn:i.getArg(o,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},d.prototype=Object.create(u.prototype),d.prototype.constructor=u,d.prototype._version=3,Object.defineProperty(d.prototype,"sources",{get:function(){for(var t=[],r=0;r<this._sections.length;r++)for(var n=0;n<this._sections[r].consumer.sources.length;n++)t.push(this._sections[r].consumer.sources[n]);return t}}),d.prototype.originalPositionFor=function(t){var r={generatedLine:i.getArg(t,"line"),generatedColumn:i.getArg(t,"column")},n=s.search(r,this._sections,function(t,r){var n=t.generatedLine-r.generatedOffset.generatedLine;return n||t.generatedColumn-r.generatedOffset.generatedColumn}),o=this._sections[n];return o?o.consumer.originalPositionFor({line:r.generatedLine-(o.generatedOffset.generatedLine-1),column:r.generatedColumn-(o.generatedOffset.generatedLine===r.generatedLine?o.generatedOffset.generatedColumn-1:0),bias:t.bias}):{source:null,line:null,column:null,name:null}},d.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(t){return t.consumer.hasContentsOfAllSources()})},d.prototype.sourceContentFor=function(t,r){for(var n=0;n<this._sections.length;n++){var i=this._sections[n].consumer.sourceContentFor(t,!0);if(i)return i}if(r)return null;throw Error('"'+t+'" is not in the SourceMap.')},d.prototype.generatedPositionFor=function(t){for(var r=0;r<this._sections.length;r++){var n=this._sections[r];if(-1!==n.consumer._findSourceIndex(i.getArg(t,"source"))){var s=n.consumer.generatedPositionFor(t);if(s)return{line:s.line+(n.generatedOffset.generatedLine-1),column:s.column+(n.generatedOffset.generatedLine===s.line?n.generatedOffset.generatedColumn-1:0)}}}return{line:null,column:null}},d.prototype._parseMappings=function(t,r){this.__generatedMappings=[],this.__originalMappings=[];for(var n=0;n<this._sections.length;n++)for(var s=this._sections[n],o=s.consumer._generatedMappings,a=0;a<o.length;a++){var u=o[a],h=s.consumer._sources.at(u.source);
79h=i.computeSourceURL(s.consumer.sourceRoot,h,this._sourceMapURL),this._sources.add(h),h=this._sources.indexOf(h);var c=null;u.name&&(c=s.consumer._names.at(u.name),this._names.add(c),c=this._names.indexOf(c));var d={source:h,generatedLine:u.generatedLine+(s.generatedOffset.generatedLine-1),generatedColumn:u.generatedColumn+(s.generatedOffset.generatedLine===u.generatedLine?s.generatedOffset.generatedColumn-1:0),originalLine:u.originalLine,originalColumn:u.originalColumn,name:c};this.__generatedMappings.push(d),"number"==typeof d.originalLine&&this.__originalMappings.push(d)}l(this.__generatedMappings,i.compareByGeneratedPositionsDeflated),l(this.__originalMappings,i.compareByOriginalPositions)}},38325:(t,r,n)=>{var i=n(70051),s=Object.prototype.hasOwnProperty,o="undefined"!=typeof Map;function a(){this._array=[],this._set=o?new Map:Object.create(null)}a.fromArray=function(t,r){for(var n=new a,i=0,s=t.length;i<s;i++)n.add(t[i],r);return n},a.prototype.size=function(){return o?this._set.size:Object.getOwnPropertyNames(this._set).length},a.prototype.add=function(t,r){var n=o?t:i.toSetString(t),a=o?this.has(t):s.call(this._set,n),l=this._array.length;(!a||r)&&this._array.push(t),a||(o?this._set.set(t,l):this._set[n]=l)},a.prototype.has=function(t){if(o)return this._set.has(t);var r=i.toSetString(t);return s.call(this._set,r)},a.prototype.indexOf=function(t){if(o){var r=this._set.get(t);if(r>=0)return r}else{var n=i.toSetString(t);if(s.call(this._set,n))return this._set[n]}throw Error('"'+t+'" is not in the set.')},a.prototype.at=function(t){if(t>=0&&t<this._array.length)return this._array[t];throw Error("No element indexed by "+t)},a.prototype.toArray=function(){return this._array.slice()},r.C=a},39247:(t,r,n)=>{"use strict";n.d(r,{A:()=>l,M:()=>a});var i=n(58905);let s=function(t,r){return 0!==t&&(this.x=this.x%t),0!==r&&(this.y=this.y%r),this},o=function(t,r,n){return 0!==t&&(this.x=this.x%t),0!==r&&(this.y=this.y%r),0!==n&&(this.z=this.z%n),this};class a{constructor(...t){let r=t;"function"==typeof t[0]&&(this.isPInst=!0,this._fromRadians=t[0],this._toRadians=t[1],r=t.slice(2));let n=r.length;0===n?(this.dimensions=2,this._values=[0,0,0]):(this.dimensions=n,this._values=r)}get values(){return this._values}set values(t){let r=t.length;0===r?(this.dimensions=2,this._values=[0,0,0]):(this.dimensions=r,this._values=t.slice())}get x(){return this._values[0]||0}getValue(t){if(t<this._values.length)return this._values[t];p5._friendlyError("The index parameter is trying to set a value outside the bounds of the vector","p5.Vector.setValue")}setValue(t,r){t<this._values.length?this._values[t]=r:p5._friendlyError("The index parameter is trying to set a value outside the bounds of the vector","p5.Vector.setValue")}get y(){return this._values[1]||0}get z(){return this._values[2]||0}get w(){return this._values[3]||0}set x(t){this._values.length>1&&(this._values[0]=t)}set y(t){this._values.length>1&&(this._values[1]=t)}set z(t){this._values.length>2&&(this._values[2]=t)}set w(t){this._values.length>3&&(this._values[3]=t)}toString(){return`vector[${this._values.join(", ")}]`}set(...t){return t[0]instanceof a?this._values=t[0].values.slice():Array.isArray(t[0])?this._values=t[0].map(t=>t||0):this._values=t.map(t=>t||0),this.dimensions=this._values.length,this}copy(){return this.isPInst?new a(this._fromRadians,this._toRadians,...this._values):new a(...this._values)}add(...t){return t[0]instanceof a?t=t[0].values:Array.isArray(t[0])&&(t=t[0]),t.forEach((t,r)=>{this._values[r]=(this._values[r]||0)+(t||0)}),this}rem(t,r,n){if(t instanceof a){if([t.x,t.y,t.z].every(Number.isFinite)){let r=parseFloat(t.x),n=parseFloat(t.y),i=parseFloat(t.z);return o.call(this,r,n,i)}}else if(Array.isArray(t)){if(t.every(t=>Number.isFinite(t))){if(2===t.length)return s.call(this,t[0],t[1]);if(3===t.length)return o.call(this,t[0],t[1],t[2])}}else if(1==arguments.length){if(Number.isFinite(arguments[0])&&0!==arguments[0])return this.x=this.x%arguments[0],this.y=this.y%arguments[0],this.z=this.z%arguments[0],this}else if(2==arguments.length){let t=[...arguments];if(t.every(t=>Number.isFinite(t))&&2===t.length)return s.call(this,t[0],t[1])}else if(3==arguments.length){let t=[...arguments];if(t.every(t=>Number.isFinite(t))&&3===t.length)return o.call(this,t[0],t[1],t[2])}}
79sub(...t){return t[0]instanceof a?t[0].values.forEach((t,r)=>{this._values[r]-=t||0}):Array.isArray(t[0])?t[0].forEach((t,r)=>{this._values[r]-=t||0}):t.forEach((t,r)=>{this._values[r]-=t||0}),this}mult(...t){if(1===t.length&&t[0]instanceof a){let r=t[0],n=Math.min(this._values.length,r.values.length);for(let t=0;t<n;t++)if(Number.isFinite(r.values[t])&&"number"==typeof r.values[t])this._values[t]*=r.values[t];else{console.warn("p5.Vector.prototype.mult:","v contains components that are either undefined or not finite numbers");break}}else if(1===t.length&&Array.isArray(t[0])){let r=t[0],n=Math.min(this._values.length,r.length);for(let t=0;t<n;t++)if(Number.isFinite(r[t])&&"number"==typeof r[t])this._values[t]*=r[t];else{console.warn("p5.Vector.prototype.mult:","arr contains elements that are either undefined or not finite numbers");break}}else if(1===t.length&&"number"==typeof t[0]&&Number.isFinite(t[0]))for(let r=0;r<this._values.length;r++)this._values[r]*=t[0];return this}div(...t){if(0===t.length)return this;if(1===t.length&&t[0]instanceof a){let r=t[0];if(r._values.every(t=>Number.isFinite(t)&&"number"==typeof t)){if(r._values.some(t=>0===t))return console.warn("p5.Vector.prototype.div:","divide by 0"),this;this._values=this._values.map((t,n)=>t/r._values[n])}else console.warn("p5.Vector.prototype.div:","vector contains components that are either undefined or not finite numbers");return this}if(1===t.length&&Array.isArray(t[0])){let r=t[0];if(r.every(t=>Number.isFinite(t)&&"number"==typeof t)){if(r.some(t=>0===t))return console.warn("p5.Vector.prototype.div:","divide by 0"),this;this._values=this._values.map((t,n)=>t/r[n])}else console.warn("p5.Vector.prototype.div:","array contains components that are either undefined or not finite numbers");return this}if(t.every(t=>Number.isFinite(t)&&"number"==typeof t)){if(t.some(t=>0===t))return console.warn("p5.Vector.prototype.div:","divide by 0"),this;this._values=this._values.map((r,n)=>r/t[0])}else console.warn("p5.Vector.prototype.div:","arguments contain components that are either undefined or not finite numbers");return this}mag(){return Math.sqrt(this.magSq())}magSq(){return this._values.reduce((t,r)=>t+r*r,0)}dot(...t){return t[0]instanceof a?this.dot(...t[0]._values):this._values.reduce((r,n,i)=>r+n*(t[i]||0),0)}cross(t){let r=this.y*t.z-this.z*t.y,n=this.z*t.x-this.x*t.z,i=this.x*t.y-this.y*t.x;return this.isPInst?new a(this._fromRadians,this._toRadians,r,n,i):new a(r,n,i)}dist(t){return t.copy().sub(this).mag()}normalize(){let t=this.mag();return 0!==t&&this.mult(1/t),this}limit(t){let r=this.magSq();return r>t*t&&this.div(Math.sqrt(r)).mult(t),this}setMag(t){return this.normalize().mult(t)}heading(){let t=Math.atan2(this.y,this.x);return this.isPInst?this._fromRadians(t):t}setHeading(t){this.isPInst&&(t=this._toRadians(t));let r=this.mag();return this.x=r*Math.cos(t),this.y=r*Math.sin(t),this}rotate(t){let r=this.heading()+t;this.isPInst&&(r=this._toRadians(r));let n=this.mag();return this.x=Math.cos(r)*n,this.y=Math.sin(r)*n,this}angleBetween(t){if(0==this.magSq()*t.magSq())return NaN;let r=this.cross(t),n=Math.atan2(r.mag(),this.dot(t))*Math.sign(r.z||1);return this.isPInst&&(n=this._fromRadians(n)),n}lerp(t,r,n,i){return t instanceof a?this.lerp(t.x,t.y,t.z,r):(this.x+=(t-this.x)*i||0,this.y+=(r-this.y)*i||0,this.z+=(n-this.z)*i||0,this)}slerp(t,r){if(0===r)return this;if(1===r)return this.set(t);let n=this.mag(),i=t.mag();if(0==n*i)return this.mult(1-r).add(t.x*r,t.y*r,t.z*r),this;let s=this.cross(t),o=s.mag(),a=Math.atan2(o,this.dot(t));if(o>0)s.x/=o,s.y/=o,s.z/=o;else{if(a<.5*Math.PI)return this.mult(1-r).add(t.x*r,t.y*r,t.z*r),this;0===this.z&&0===t.z?s.set(0,0,1):0!==this.x?s.set(this.y,-this.x,0).normalize():s.set(1,0,0)}let l=s.cross(this),u=1-r+r*i/n,h=u*Math.cos(r*a),c=u*Math.sin(r*a);return this.x=this.x*h+l.x*c,this.y=this.y*h+l.y*c,this.z=this.z*h+l.z*c,this}reflect(t){let r=a.normalize(t);return this.sub(r.mult(2*this.dot(r)))}array(){return[this.x||0,this.y||0,this.z||0]}equals(...t){let r;r=t[0]instanceof a?t[0]._values:Array.isArray(t[0])?t[0]:t;for(let t=0;t<this._values.length;t++)if(this._values[t]!==(r[t]||0))return!1;return!0}clampToZero(){for(let t=0;t<this._values.length;t++)this._values[t]=this._clampToZero(this._values[t]);return this}_clampToZero(t){return Math.abs((t||0)-0)<=Number.EPSILON?0:t}static fromAngle(t,r){return void 0===r&&(r=1),new a(r*Math.cos(t),r*Math.sin(t))}static fromAngles(t,r,n){void 0===n&&(n=1);let i=Math.cos(r),s=Math.cos(t),o=Math.sin(t);return new a(n*o*Math.sin(r),-n*s,n*o*i)}static random2D(){return this.fromAngle(Math.random()*i.q)}static random3D(){let t=Math.random()*i.q,r=2*Math.random()-1,n=Math.sqrt(1-r*r);return new a(n*Math.cos(t),n*Math.sin(t),r)}static copy(t){return t.copy(t)}static add(t,r,n){return n?n.set(t):(n=t.copy(),3==arguments.length&&p5._friendlyError("The target parameter is undefined, it should be of type p5.Vector","p5.Vector.add")),n.add(r),n}static rem(t,r){if(t instanceof a&&r instanceof a){let n=t.copy();return n.rem(r),n}}static sub(t,r,n){return n?n.set(t):(n=t.copy(),3==arguments.length&&p5._friendlyError("The target parameter is undefined, it should be of type p5.Vector","p5.Vector.sub")),n.sub(r),n}static mult(t,r,n){return n?n.set(t):(n=t.copy(),3==arguments.length&&p5._friendlyError("The target parameter is undefined, it should be of type p5.Vector","p5.Vector.mult")),n.mult(r),n}static rotate(t,r,n){return 2==arguments.length?n=t.copy():(n instanceof a||p5._friendlyError("The target parameter should be of type p5.Vector","p5.Vector.rotate"),n.set(t)),n.rotate(r),n}static div(t,r,n){return n?n.set(t):(n=t.copy(),3==arguments.length&&p5._friendlyError("The target parameter is undefined, it should be of type p5.Vector","p5.Vector.div")),n.div(r),n}static dot(t,r){return t.dot(r)}static cross(t,r){return t.cross(r)}static dist(t,r){return t.dist(r)}static lerp(t,r,n,i){return i?i.set(t):(i=t.copy(),4==arguments.length&&p5._friendlyError("The target parameter is undefined, it should be of type p5.Vector","p5.Vector.lerp")),i.lerp(r,n),i}static slerp(t,r,n,i){return i?i.set(t):(i=t.copy(),4==arguments.length&&p5._friendlyError("The target parameter is undefined, it should be of type p5.Vector","p5.Vector.slerp")),i.slerp(r,n),i}static mag(t){return t.mag()}static magSq(t){return t.magSq()}static normalize(t,r){return arguments.length<2?r=t.copy():(r instanceof a||p5._friendlyError("The target parameter should be of type p5.Vector","p5.Vector.normalize"),r.set(t)),r.n
79ormalize()}static limit(t,r,n){return arguments.length<3?n=t.copy():(n instanceof a||p5._friendlyError("The target parameter should be of type p5.Vector","p5.Vector.limit"),n.set(t)),n.limit(r)}static setMag(t,r,n){return arguments.length<3?n=t.copy():(n instanceof a||p5._friendlyError("The target parameter should be of type p5.Vector","p5.Vector.setMag"),n.set(t)),n.setMag(r)}static heading(t){return t.heading()}static angleBetween(t,r){return t.angleBetween(r)}static reflect(t,r,n){return arguments.length<3?n=t.copy():(n instanceof a||p5._friendlyError("The target parameter should be of type p5.Vector","p5.Vector.reflect"),n.set(t)),n.reflect(r)}static array(t){return t.array()}static equals(t,r){let n;return t instanceof a?n=t:t instanceof Array?n=new a().set(t):p5._friendlyError("The v1 parameter should be of type Array or p5.Vector","p5.Vector.equals"),n.equals(r)}}function l(t,r){t.Vector=a}"undefined"!=typeof p5&&l(p5,p5.prototype)},39446:(t,r,n)=>{"use strict";n.d(r,{A:()=>s});class i{add(t,r,n){if("string"!=typeof arguments[0]){for(var t in arguments[0])this.add(t,arguments[0][t],arguments[1]);return}(Array.isArray(t)?t:[t]).forEach(function(t){this[t]=this[t]||[],r&&this[t][n?"unshift":"push"](r)},this)}run(t,r){this[t]=this[t]||[],this[t].forEach(function(t){t.call(r&&r.context?r.context:r,r)})}}let s=new i},39607:(t,r,n)=>{"use strict";n.d(r,{uB:()=>k});var i=/[\\\/_+.#"@\[\(\{&]/,s=/[\\\/_+.#"@\[\(\{&]/g,o=/[\s-]/,a=/[\s-]/g;function l(t){return t.toLowerCase().replace(a," ")}var u=n(75344),h=n(11180),c=n(44990),d=n(20417),p=n(50318),f='[cmdk-group=""]',m='[cmdk-group-items=""]',g='[cmdk-item=""]',y="".concat(g,':not([aria-disabled="true"])'),v="cmdk-item-select",b="data-value",x=(t,r,n)=>(function(t,r,n){return function t(r,n,l,u,h,c,d){if(c===n.length)return h===r.length?1:.99;var p=`${h},${c}`;if(void 0!==d[p])return d[p];for(var f,m,g,y,v=u.charAt(c),b=l.indexOf(v,h),x=0;b>=0;)(f=t(r,n,l,u,b+1,c+1,d))>x&&(b===h?f*=1:i.test(r.charAt(b-1))?(f*=.8,(g=r.slice(h,b-1).match(s))&&h>0&&(f*=Math.pow(.999,g.length))):o.test(r.charAt(b-1))?(f*=.9,(y=r.slice(h,b-1).match(a))&&h>0&&(f*=Math.pow(.999,y.length))):(f*=.17,h>0&&(f*=Math.pow(.999,b-h))),r.charAt(b)!==n.charAt(c)&&(f*=.9999)),(f<.1&&l.charAt(b-1)===u.charAt(c+1)||u.charAt(c+1)===u.charAt(c)&&l.charAt(b-1)!==u.charAt(c))&&.1*(m=t(r,n,l,u,b+1,c+2,d))>f&&(f=.1*m),f>x&&(x=f),b=l.indexOf(v,b+1);return d[p]=x,x}(t=n&&n.length>0?`${t+" "+n.join(" ")}`:t,r,l(t),l(r),0,0,{})})(t,r,n),_=h.createContext(void 0),A=()=>h.useContext(_),E=h.createContext(void 0),C=()=>h.useContext(E),D=h.createContext(void 0),w=h.forwardRef((t,r)=>{let n=L(()=>{var r,n;return{search:"",value:null!=(n=null!=(r=t.value)?r:t.defaultValue)?n:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),i=L(()=>new Set),s=L(()=>new Map),o=L(()=>new Map),a=L(()=>new Set),l=M(t),{label:u,children:p,value:A,onValueChange:C,filter:D,shouldFilter:w,loop:S,disablePointerSelection:F=!1,vimBindings:T=!0,...N}=t,I=(0,d.B)(),O=(0,d.B)(),k=(0,d.B)(),R=h.useRef(null),P=z();B(()=>{if(void 0!==A){let t=A.trim();n.current.value=t,j.emit()}},[A]),B(()=>{P(6,Z)},[]);let j=h.useMemo(()=>({subscribe:t=>(a.current.add(t),()=>a.current.delete(t)),snapshot:()=>n.current,setState:(t,r,i)=>{var s,o,a,u;if(!Object.is(n.current[t],r)){if(n.current[t]=r,"search"===t)W(),H(),P(1,q);else if("value"===t){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let t=document.getElementById(k);t?t.focus():null==(s=document.getElementById(I))||s.focus()}if(P(7,()=>{var t;n.current.selectedItemId=null==(t=X())?void 0:t.id,j.emit()}),i||P(5,Z),(null==(o=l.current)?void 0:o.value)!==void 0){null==(u=(a=l.current).onValueChange)||u.call(a,null!=r?r:"");return}}j.emit()}},emit:()=>{a.current.forEach(t=>t())}}),[]),V=h.useMemo(()=>({value:(t,r,i)=>{var s;r!==(null==(s=o.current.get(t))?void 0:s.value)&&(o.current.set(t,{value:r,keywords:i}),n.current.filtered.items.set(t,G(r,i)),P(2,()=>{H(),j.emit()}))},item:(t,r)=>(i.current.add(t),r&&(s.current.has(r)?s.current.get(r).add(t):s.current.set(r,new Set([t]))),P(3,()=>{W(),H(),n.current.value||q(),j.emit()}),()=>{o.current.delete(t),i.current.delete(t),n.current.filtered.items.delete(t);let r=X();P(4,()=>{W(),(null==r?void 0:r.getAttribute("id"))===t&&q(),j.emit()})}),group:t=>(s.current.has(t)||s.current.set(t,new Set),()=>{o.current.delete(t),s.current.delete(t)}),filter:()=>l.current.shouldFilter,label:u||t["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:I,inputId:k,labelId:O,listInnerRef:R}),[]);function G(t,r){var i,s;let o=null!=(s=null==(i=l.current)?void 0:i.filter)?s:x;return t?o(t,n.current.search,r):0}function H(){if(!n.current.search||!1===l.current.shouldFilter)return;let t=n.current.filtered.items,r=[];n.current.filtered.groups.forEach(n=>{let i=s.current.get(n),o=0;
79i.forEach(r=>{o=Math.max(t.get(r),o)}),r.push([n,o])});let i=R.current;Y().sort((r,n)=>{var i,s;let o=r.getAttribute("id"),a=n.getAttribute("id");return(null!=(i=t.get(a))?i:0)-(null!=(s=t.get(o))?s:0)}).forEach(t=>{let r=t.closest(m);r?r.appendChild(t.parentElement===r?t:t.closest("".concat(m," > *"))):i.appendChild(t.parentElement===i?t:t.closest("".concat(m," > *")))}),r.sort((t,r)=>r[1]-t[1]).forEach(t=>{var r;let n=null==(r=R.current)?void 0:r.querySelector("".concat(f,"[").concat(b,'="').concat(encodeURIComponent(t[0]),'"]'));null==n||n.parentElement.appendChild(n)})}function q(){let t=Y().find(t=>"true"!==t.getAttribute("aria-disabled")),r=null==t?void 0:t.getAttribute(b);j.setState("value",r||void 0)}function W(){var t,r,a,u;if(!n.current.search||!1===l.current.shouldFilter){n.current.filtered.count=i.current.size;return}n.current.filtered.groups=new Set;let h=0;for(let s of i.current){let i=G(null!=(r=null==(t=o.current.get(s))?void 0:t.value)?r:"",null!=(u=null==(a=o.current.get(s))?void 0:a.keywords)?u:[]);n.current.filtered.items.set(s,i),i>0&&h++}for(let[t,r]of s.current)for(let i of r)if(n.current.filtered.items.get(i)>0){n.current.filtered.groups.add(t);break}n.current.filtered.count=h}function Z(){var t,r,n;let i=X();i&&((null==(t=i.parentElement)?void 0:t.firstChild)===i&&(null==(n=null==(r=i.closest(f))?void 0:r.querySelector('[cmdk-group-heading=""]'))||n.scrollIntoView({block:"nearest"})),i.scrollIntoView({block:"nearest"}))}function X(){var t;return null==(t=R.current)?void 0:t.querySelector("".concat(g,'[aria-selected="true"]'))}function Y(){var t;return Array.from((null==(t=R.current)?void 0:t.querySelectorAll(y))||[])}function K(t){let r=Y()[t];r&&j.setState("value",r.getAttribute(b))}function J(t){var r;let n=X(),i=Y(),s=i.findIndex(t=>t===n),o=i[s+t];null!=(r=l.current)&&r.loop&&(o=s+t<0?i[i.length-1]:s+t===i.length?i[0]:i[s+t]),o&&j.setState("value",o.getAttribute(b))}function Q(t){let r=X(),n=null==r?void 0:r.closest(f),i;for(;n&&!i;)i=null==(n=t>0?function(t,r){let n=t.nextElementSibling;for(;n;){if(n.matches(r))return n;n=n.nextElementSibling}}(n,f):function(t,r){let n=t.previousElementSibling;for(;n;){if(n.matches(r))return n;n=n.previousElementSibling}}(n,f))?void 0:n.querySelector(y);i?j.setState("value",i.getAttribute(b)):J(t)}let ee=()=>K(Y().length-1),et=t=>{t.preventDefault(),t.metaKey?ee():t.altKey?Q(1):J(1)},er=t=>{t.preventDefault(),t.metaKey?K(0):t.altKey?Q(-1):J(-1)};return h.createElement(c.sG.div,{ref:r,tabIndex:-1,...N,"cmdk-root":"",onKeyDown:t=>{var r;null==(r=N.onKeyDown)||r.call(N,t);let n=t.nativeEvent.isComposing||229===t.keyCode;if(!(t.defaultPrevented||n))switch(t.key){case"n":case"j":T&&t.ctrlKey&&et(t);break;case"ArrowDown":et(t);break;case"p":case"k":T&&t.ctrlKey&&er(t);break;case"ArrowUp":er(t);break;case"Home":t.preventDefault(),K(0);break;case"End":t.preventDefault(),ee();break;case"Enter":{t.preventDefault();let r=X();if(r){let t=new Event(v);r.dispatchEvent(t)}}}}},h.createElement("label",{"cmdk-label":"",htmlFor:V.inputId,id:V.labelId,style:$},u),U(t,t=>h.createElement(E.Provider,{value:j},h.createElement(_.Provider,{value:V},t))))}),S=h.forwardRef((t,r)=>{var n,i;let s=(0,d.B)(),o=h.useRef(null),a=h.useContext(D),l=A(),u=M(t),f=null!=(i=null==(n=u.current)?void 0:n.forceMount)?i:null==a?void 0:a.forceMount;B(()=>{if(!f)return l.item(s,null==a?void 0:a.id)},[f]);let m=P(s,o,[t.value,t.children,o],t.keywords),g=C(),y=R(t=>t.value&&t.value===m.current),b=R(t=>!!f||!1===l.filter()||!t.search||t.filtered.items.get(s)>0);function x(){var t,r;_(),null==(r=(t=u.current).onSelect)||r.call(t,m.current)}function _(){g.setState("value",m.current,!0)}if(h.useEffect(()=>{let r=o.current;if(!(!r||t.disabled))return r.addEventListener(v,x),()=>r.removeEventListener(v,x)},[b,t.onSelect,t.disabled]),!b)return null;let{disabled:E,value:w,onSelect:S,forceMount:F,keywords:T,...N}=t;return h.createElement(c.sG.div,{ref:(0,p.t)(o,r),...N,id:s,"cmdk-item":"",role:"option","aria-disabled":!!E,"aria-selected":!!y,"data-disabled":!!E,"data-selected":!!y,onPointerMove:E||l.getDisablePointerSelection()?void 0:_,onClick:E?void 0:x},t.children)}),F=h.forwardRef((t,r)=>{let{heading:n,children:i,forceMount:s,...o}=t,a=(0,d.B)(),l=h.useRef(null),u=h.useRef(null),f=(0,d.B)(),m=A(),g=R(t=>!!s||!1===m.filter()||!t.search||t.filtered.groups.has(a));B(()=>m.group(a),[]),P(a,l,[t.value,t.heading,u]);let y=h.useMemo(()=>({id:a,forceMount:s}),[s]);return h.createElement(c.sG.div,{ref:(0,p.t)(l,r),...o,"cmdk-group":"",role:"presentation",hidden:!g||void 0},n&&h.createElement("div",{ref:u,"cmdk-group-heading":"","aria-hidden":!0,id:f},n),U(t,t=>h.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?f:void 0},h.createElement(D.Provider,{value:y},t))))}),T=h.forwardRef((t,r)=>{let{alwaysRender:n,...i}=t,s=h.useRef(null),o=R(t=>!t.search);return n||o?h.createElement(c.sG.div,{ref:(0,p.t)(s,r),...i,"cmdk-separator":"",role:"separator"}):null}),N=h.forwardRef((t,r)=>{let{onValueChange:n,...i}=t,s=null!=t.value,o=C(),a=R(t=>t.search),l=R(t=>t.selectedItemId),u=A();return h.useEffect(()=>{null!=t.value&&o.setState("search",t.value)},[t.value]),h.createElement(c.sG.input,{ref:r,...i,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":u.listId,"aria-labelledby":u.labelId,"aria-activedescendant":l,id:u.inputId,type:"text",value:s?t.value:a,onChange:t=>{s||o.setState("search",t.target.value),null==n||n(t.target.value)}})}),I=h.forwardRef((t,r)=>{let{children:n,label:i="Suggestions",...s}=t,o=h.useRef(null),a=h.useRef(null),l=R(t=>t.selectedItemId),u=A();return h.useEffect(()=>{if(a.current&&o.current){let t=a.current,r=o.current,n,i=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=t.offsetHeight;r.style.setProperty("--cmdk-list-height",n.toFixed(1)+"px")})});return i.observe(t),()=>{cancelAnimationFrame(n),i.unobserve(t)}}},[]),h.createElement(c.sG.div,{ref:(0,p.t)(o,r),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":l,"aria-label":i,id:u.listId},U(t,t=>h.createElement("div",{ref:(0,p.t)(a,u.listInnerRef),"cmdk-list-sizer":""},t)))}),O=h.forwardRef((t,r)=>{let{open:n,onOpenChange:i,overlayClassName:s,contentClassName:o,container:a,...l}=t;return h.createElement(u.bL,{open:n,onOpenChange:i},h.createElement(u.ZL,{container:a},h.createElement(u.hJ,{"cmdk-overlay":"",className:s}),h.createElement(u.UC,{"aria-label":t.label,"cmdk-dialog":"",className:o},h.createElement(w,{ref:r,...l}))))}),k=Object.assign(w,{List:I,Item:S,Input:N,Group:F,Separator:T,Dialog:O,Empty:h.forwardRef((t,r)=>R(t=>0===t.filtered.count)?h.createElement(c.sG.div,{ref:r,...t,"cmdk-empty":"",role:"presentation"}):null),Loading:h.forwardRef((t,r)=>{let{progress:n,children:i,label:s="Loading...",...o}=t;return h.createElement(c.sG.div,{ref:r,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},U(t,t=>h.createElement("div",{"aria-hidden":!0},t)))})});function M(t){let r=h.useRef(t);return B(()=>{r.current=t}),r}var B="undefined"==typeof window?h.useEffect:h.useLayoutEffect;function L(t){let r=h.useRef();return void 0===r.current&&(r.current=t()),r}function R(t){let r=C(),n=()=>t(r.snapshot());return h.useSyncExternalStore(r.subscribe,n,n)}function P(t,r,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],s=h.useRef(),o=A();return B(()=>{var a;let l=(()=>{var t;for(let r of n){if("string"==typeof r)return r.trim();if("object"==typeof r&&"current"in r)return r.current?null==(t=r.current.textContent)?void 0:t.trim():s.current}})(),u=i.map(t=>t.trim());o.value(t,l,u),null==(a=r.current)||a.setAttribute(b,l),s.current=l}),s}var z=()=>{let[t,r]=h.useState(),n=L(()=>new Map);return B(()=>{n.current.forEach(t=>
79t()),n.current=new Map},[t]),(t,i)=>{n.current.set(t,i),r({})}};function U(t,r){let n,{asChild:i,children:s}=t;return i&&h.isValidElement(s)?h.cloneElement("function"==typeof(n=s.type)?n(s.props):"render"in n?n.render(s.props):s,{ref:s.ref},r(s.props.children)):r(s)}var $={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"}},41157:function(t){"use strict";function r(t,r){return t.b===r.b&&t.a===r.a}function n(t,r){return t.b<r.b||t.b===r.b&&t.a<=r.a}function i(t,r,n){var i=r.b-t.b,s=n.b-r.b;return 0<i+s?i<s?r.a-t.a+i/(i+s)*(t.a-n.a):r.a-n.a+s/(i+s)*(n.a-t.a):0}function s(t,r,n){var i=r.b-t.b,s=n.b-r.b;return 0<i+s?(r.a-n.a)*i+(r.a-t.a)*s:0}function o(t,r){return t.a<r.a||t.a===r.a&&t.b<=r.b}function a(t,r,n){var i=r.a-t.a,s=n.a-r.a;return 0<i+s?i<s?r.b-t.b+i/(i+s)*(t.b-n.b):r.b-n.b+s/(i+s)*(n.b-t.b):0}function l(t,r,n){var i=r.a-t.a,s=n.a-r.a;return 0<i+s?(r.b-n.b)*i+(r.b-t.b)*s:0}function u(t,r,n,i){return(t=0>t?0:t)<=(n=0>n?0:n)?0===n?(r+i)/2:r+t/(t+n)*(i-r):i+n/(t+n)*(r-i)}function h(t){var r=m(t.b);return y(r,t.c),y(r.b,t.c),v(r,t.a),r}function c(t,r){var n=!1,i=!1;t!==r&&(r.a!==t.a&&(i=!0,x(r.a,t.a)),r.d!==t.d&&(n=!0,_(r.d,t.d)),g(r,t),i||(y(r,t.a),t.a.c=t),n||(v(r,t.d),t.d.a=t))}function d(t){var r=t.b,n=!1;t.d!==t.b.d&&(n=!0,_(t.d,t.b.d)),t.c===t?x(t.a,null):(t.b.d.a=K(t),t.a.c=t.c,g(t,K(t)),n||v(t,t.d)),r.c===r?(x(r.a,null),_(r.d,null)):(t.d.a=K(r),r.a.c=r.c,g(r,K(r))),b(t)}function p(t){var r=m(t),n=r.b;return g(r,t.e),r.a=t.b.a,y(n,r.a),r.d=n.d=t.d,r=r.b,g(t.b,K(t.b)),g(t.b,r),t.b.a=r.a,r.b.a.c=r.b,r.b.d=t.b.d,r.f=t.f,r.b.f=t.b.f,r}function f(t,r){var n=!1,i=m(t),s=i.b;return r.d!==t.d&&(n=!0,_(r.d,t.d)),g(i,t.e),g(s,r),i.a=t.b.a,s.a=r.a,i.d=s.d=t.d,t.d.a=s,n||v(i,t.d),i}function m(t){var r=new Y,n=new Y,i=t.b.h;return n.h=i,i.b.h=r,r.h=t,t.b.h=n,r.b=n,r.c=r,r.e=n,n.b=r,n.c=n,n.e=r}function g(t,r){var n=t.c,i=r.c;n.b.e=r,i.b.e=t,t.c=i,r.c=n}function y(t,r){var n=r.f,i=new Q(r,n);n.e=i,r.f=i,n=i.c=t;do n.a=i,n=n.c;while(n!==t)}function v(t,r){var n=r.d,i=new X(r,n);n.b=i,r.d=i,i.a=t,i.c=r.c,n=t;do n.d=i,n=n.e;while(n!==t)}function b(t){var r=t.h;t=t.b.h,r.b.h=t,t.b.h=r}function x(t,r){var n=t.c,i=n;do i.a=r,i=i.c;while(i!==n);n=t.f,(i=t.e).f=n,n.e=i}function _(t,r){var n=t.a,i=n;do i.d=r,i=i.e;while(i!==n);n=t.d,(i=t.b).d=n,n.b=i}function A(t){var r=0;return Math.abs(t[1])>Math.abs(t[0])&&(r=1),Math.abs(t[2])>Math.abs(t[r])&&(r=2),r}var E,C=4*1e150;function D(t,r){t.f+=r.f,t.b.f+=r.b.f}function w(t,r,o){return(t=t.a,r=r.a,o=o.a,r.b.a===t)?o.b.a===t?n(r.a,o.a)?0>=s(o.b.a,r.a,o.a):0<=s(r.b.a,o.a,r.a):0>=s(o.b.a,t,o.a):o.b.a===t?0<=s(r.b.a,t,r.a):(r=i(r.b.a,t,r.a))>=(t=i(o.b.a,t,o.a))}function S(t){t.a.i=null;var r=t.e;r.a.c=r.c,r.c.a=r.a,t.e=null}function F(t,r){d(t.a),t.c=!1,t.a=r,r.i=t}function T(t){var r=t.a.a;do t=ec(t);while(t.a.a===r);return t.c&&(r=f(eh(t).a.b,t.a.e),F(t,r),t=ec(t)),t}function N(t,r,n){var i=new eu;return i.a=n,i.e=V(t.f,r.e,i),n.i=i}function I(t,r){switch(t.s){case 100130:return 0!=(1&r);case 100131:return 0!==r;case 100132:return 0<r;case 100133:return 0>r;case 100134:return 2<=r||-2>=r}return!1}function O(t){var r=t.a,n=r.d;n.c=t.d,n.a=r,S(t)}function k(t,r,n){for(t=r,r=r.a;t!==n;){t.c=!1;var i=eh(t),s=i.a;if(s.a!==r.a){if(!i.c){O(t);break}F(i,s=f(r.c.b,s.b))}r.c!==s&&(c(K(s),s),c(r,s)),O(t),r=i.a,t=i}return r}function M(t,r,n,i,s,o){var a=!0;do N(t,r,n.b),n=n.c;while(n!==i);for(null===s&&(s=eh(r).a.b.c);(n=(i=eh(r)).a.b).a===s.a;)n.c!==s&&(c(K(n),n),c(K(s),n)),i.f=r.f-n.f,i.d=I(t,i.f),r.b=!0,!a&&P(t,r)&&(D(n,s),S(r),d(s)),a=!1,r=i,s=n;r.b=!0,o&&U(t,r)}function B(t,r,n,i,s){var o=[r.g[0],r.g[1],r.g[2]];r.d=null,r.d=t.o&&t.o(o,n,i,t.c)||null,null===r.d&&(s?t.n||(Z(t,100156),t.n=!0):r.d=n[0])}function L(t,r,n){var i=[null,null,null,null];i[0]=r.a.d,i[1]=n.a.d,B(t,r.a,i,[.5,.5,0,0],!1),c(r,n)}function R(t,r,n,i,s){var o=Math.abs(r.b-t.b)+Math.abs(r.a-t.a),a=Math.abs(n.b-t.b)+Math.abs(n.a-t.a),l=s+1;i[s]=.5*a/(o+a),i[l]=.5*o/(o+a),t.g[0]+=i[s]*r.g[0]+i[l]*n.g[0],t.g[1]+=i[s]*r.g[1]+i[l]*n.g[1],t.g[2]+=i[s]*r.g[2]+i[l]*n.g[2]}function P(t,i){var o=eh(i),a=i.a,l=o.a;if(n(a.a,l.a)){if(0<s(l.b.a,a.a,l.a))return!1;if(r(a.a,l.a)){if(a.a!==l.a){var o=t.e,u=a.a.h;if(0<=u){var o=o.b,h=o.d,d=o.e,f=o.c,m=f[u];h[m]=h[o.a],f[h[m]]=m,m<=--o.a&&(1>=m||n(d[h[m>>1]],d[h[m]])?ea(o,m):el(o,m)),d[u]=null,f[u]=o.b,o.b=u}else for(o.c[-(u+1)]=null;0<o.a&&null===o.c[o.d[o.a-1]];)--o.a;L(t,K(l),a)}}else p(l.b),c(a,K(l)),i.b=o.b=!0}else{if(0>s(a.b.a,l.a,a.a))return!1;ec(i).b=i.b=!0,p(a.b),c(K(l),a)}return!0}function z(t,h){var d=eh(h),f=h.a,m=d.a,g=f.a,y=m.a,v=f.b.a,b=m.b.a,x=new Q;if(s(v,t.a,g),s(b,t.a,y),g===y||Math.min(g.a,v.a)>Math.max(y.a,b.a))return!1;if(n(g,y)){if(0<s(b,g,y))return!1}else if(0>s(v,y,g))return!1;
vendor: 5,735 bytes, line 79
79var _,A,E=v,C=g,D=b,w=y;if(n(E,C)||(_=E,E=C,C=_),n(D,w)||(_=D,D=w,w=_),n(E,D)||(_=E,E=D,D=_,_=C,C=w,w=_),n(D,C)?n(C,w)?(0>(_=i(E,D,C))+(A=i(D,C,w))&&(_=-_,A=-A),x.b=u(_,D.b,A,C.b)):(0>(_=s(E,D,C))+(A=-s(E,w,C))&&(_=-_,A=-A),x.b=u(_,D.b,A,w.b)):x.b=(D.b+C.b)/2,o(E,C)||(_=E,E=C,C=_),o(D,w)||(_=D,D=w,w=_),o(E,D)||(_=E,E=D,D=_,_=C,C=w,w=_),o(D,C)?o(C,w)?(0>(_=a(E,D,C))+(A=a(D,C,w))&&(_=-_,A=-A),x.a=u(_,D.a,A,C.a)):(0>(_=l(E,D,C))+(A=-l(E,w,C))&&(_=-_,A=-A),x.a=u(_,D.a,A,w.a)):x.a=(D.a+C.a)/2,n(x,t.a)&&(x.b=t.a.b,x.a=t.a.a),E=n(g,y)?g:y,n(E,x)&&(x.b=E.b,x.a=E.a),r(x,g)||r(x,y))return P(t,h),!1;if(!r(v,t.a)&&0<=s(v,t.a,x)||!r(b,t.a)&&0>=s(b,t.a,x)){if(b===t.a)return p(f.b),c(m.b,f),f=eh(h=T(h)).a,k(t,eh(h),d),M(t,h,K(f),f,f,!0),!0;if(v===t.a){p(m.b),c(f.e,K(m)),y=(g=d=h).a.b.a;do g=ec(g);while(g.a.b.a===y);return g=eh(h=g).a.b.c,d.a=K(m),m=k(t,d,null),M(t,h,m.c,f.b.c,g,!0),!0}return 0<=s(v,t.a,x)&&(ec(h).b=h.b=!0,p(f.b),f.a.b=t.a.b,f.a.a=t.a.a),0>=s(b,t.a,x)&&(h.b=d.b=!0,p(m.b),m.a.b=t.a.b,m.a.a=t.a.a),!1}return p(f.b),p(m.b),c(K(m),f),f.a.b=x.b,f.a.a=x.a,f.a.h=et(t.e,f.a),f=f.a,m=[0,0,0,0],x=[g.d,v.d,y.d,b.d],f.g[0]=f.g[1]=f.g[2]=0,R(f,g,v,m,0),R(f,y,b,m,2),B(t,f,x,m,!0),ec(h).b=h.b=d.b=!0,!1}function U(t,r){for(var i=eh(r);;){for(;i.b;)r=i,i=eh(i);if(!r.b&&(i=r,null===(r=ec(r))||!r.b))break;r.b=!1;var o,a=r.a,l=i.a;if(o=a.b.a!==l.b.a)e:{var u=eh(o=r),h=o.a,f=u.a,m=void 0;if(n(h.b.a,f.b.a)){if(0>s(h.b.a,f.b.a,h.a)){o=!1;break e}ec(o).b=o.b=!0,m=p(h),c(f.b,m),m.d.c=o.d}else{if(0<s(f.b.a,h.b.a,f.a)){o=!1;break e}o.b=u.b=!0,m=p(f),c(h.e,f.b),m.b.d.c=o.d}o=!0}if(o&&(i.c?(S(i),d(l),l=(i=eh(r)).a):r.c&&(S(r),d(a),a=(r=ec(i)).a)),a.a!==l.a){if(a.b.a===l.b.a||r.c||i.c||a.b.a!==t.a&&l.b.a!==t.a)P(t,r);else if(z(t,r))break}a.a===l.a&&a.b.a===l.b.a&&(D(l,a),S(r),d(a),r=ec(i))}}function $(t,r){var n=new eu,i=h(t.b);i.a.b=C,i.a.a=r,i.b.a.b=-C,i.b.a.a=r,t.a=i.b.a,n.a=i,n.f=0,n.d=!1,n.c=!1,n.h=!0,n.b=!1,i=V(i=t.f,i.a,n),n.e=i}function j(t){this.a=new G,this.b=t,this.c=w}function V(t,r,n){do r=r.c;while(null!==r.b&&!t.c(t.b,r.b,n));return t=new G(n,r.a,r),r.a.c=t,r.a=t}function G(t,r,n){this.b=t||null,this.a=r||this,this.c=n||this}function H(){this.d=q,this.p=this.b=this.q=null,this.j=[0,0,0],this.s=100130,this.n=!1,this.o=this.a=this.e=this.f=null,this.m=!1,this.c=this.r=this.i=this.k=this.l=this.h=null}var q=0;function W(t,r){if(t.d!==r)for(;t.d!==r;)if(t.d<r)switch(t.d){case q:Z(t,100151),t.u(null);break;case 1:Z(t,100152),t.t()}else switch(t.d){case 2:Z(t,100154),t.v();break;case 1:Z(t,100153),t.w()}}function Z(t,r){t.p&&t.p(r,t.c)}function X(t,r){this.b=t||this,this.d=r||this,this.a=null,this.c=!1}function Y(){this.h=this,this.i=this.d=this.a=this.e=this.c=this.b=null,this.f=0}function K(t){return t.b.e}function J(){this.c=new Q,this.a=new X,this.b=new Y,this.d=new Y,this.b.b=this.d,this.d.b=this.b}function Q(t,r){this.e=t||this,this.f=r||this,this.d=this.c=null,this.g=[0,0,0],this.h=this.a=this.b=0}function ee(){this.c=[],this.d=null,this.a=0,this.e=!1,this.b=new en}function et(t,r){if(t.e){var n,i=t.b,s=++i.a;return 2*s>i.f&&(i.f*=2,i.c=ei(i.c,i.f+1)),0===i.b?n=s:(n=i.b,i.b=i.c[i.b]),i.e[n]=r,i.c[n]=s,i.d[s]=n,i.h&&el(i,s),n}return i=t.a++,t.c[i]=r,-(i+1)}function er(t){if(0===t.a)return eo(t.b);var r=t.c[t.d[t.a-1]];if(0!==t.b.a&&n(es(t.b),r))return eo(t.b);do--t.a;while(0<t.a&&null===t.c[t.d[t.a-1]]);return r}function en(){this.d=ei([0],33),this.e=[null,null],this.c=[0,0],this.a=0,this.f=32,this.b=0,this.h=!1,this.d[1]=1}function ei(t,r){for(var n=Array(r),i=0;i<t.length;i++)n[i]=t[i];for(;i<r;i++)n[i]=0;return n}function es(t){return t.e[t.d[1]]}function eo(t){var r=t.d,n=t.e,i=t.c,s=r[1],o=n[s];return 0<t.a&&(r[1]=r[t.a],i[r[1]]=1,n[s]=null,i[s]=t.b,t.b=s,0<--t.a&&ea(t,1)),o}function ea(t,r){for(var i=t.d,s=t.e,o=t.c,a=r,l=i[a];;){var u=a<<1;u<t.a&&n(s[i[u+1]],s[i[u]])&&(u+=1);var h=i[u];if(u>t.a||n(s[l],s[h])){i[a]=l,o[l]=a;break}i[a]=h,o[h]=a,a=u}}function el(t,r){for(var i=t.d,s=t.e,o=t.c,a=r,l=i[a];;){var u=a>>1,h=i[u];if(0===u||n(s[h],s[l])){i[a]=l,o[l]=a;break}i[a]=h,o[h]=a,a=u}}function eu(){this.e=this.a=null,this.f=0,this.c=this.b=this.h=this.d=!1}function eh(t){return t.e.c.b}function ec(t){return t.e.a.b}(E=H.prototype).x=function(){W(this,q)},E.B=function(t,r){switch(t){case 100142:return;case 100140:switch(r){case 100130:case 100131:case 100132:case 100133:case 100134:this.s=r;return}break;case 100141:this.m=!!r;return;default:Z(this,100900);return}Z(this,100901)},E.y=function(t){switch(t){case 100142:return 0;case 100140:return this.s;case 100141:return this.m;default:Z(this,100900)}return!1},E.A=function(t,r,n){this.j[0]=t,this.j[1]=r,this.j[2]=n},E.z=function(t,r){var n=r||null;switch(t){case 100100:case 100106:this.h=n;break;case 100104:case 100110:this.l=n;break;case 100101:case 100107:this.k=n;break;case 100102:case 100108:this.i=n;break;case 100103:case 100109:this.p=n;break;case 100105:case 100111:this.o=n;break;case 100112:this.r=n;break;default:Z(this,100900)}},E.C=function(t,r){var n=!1,i=[0,0,0];W(this,2);for(var s=0;3>s;++s){var o=t[s];-1e150>o&&(o=-1e150,n=!0),1e150<o&&(o=1e150,n=!0),i[s]=o}n&&Z(this,100155),null===(n=this.q)?c(n=h(this.b),n.b):(p(n),n=n.e),n.a.d=r,n.a.g[0]=i[0],n.a.g[1]=i[1],n.a.g[2]=i[2],n.f=1,n.b.f=-1,this.q=n},E.u=function(t){W(this,q),this.d=1,this.b=new J,this.c=t},E.t=function(){W(this,1),this.d=2,this.q=null},E.v=function(){W(this,2),this.d=1},E.w=function(){W(this,1),this.d=q;var t,i,o=this.j[0],a=this.j[1],l=this.j[2],u=!1,h=[o,a,l];if(0===o&&0===a&&0===l){for(var a=[-2*1e150,-2*1e150,-2*1e150],m=[2*1e150,2*1e150,2*1e150],l=[],y=[],u=this.b.c,o=u.e;o!==u;o=o.e)for(var v=0;3>v;++v){var _=o.g[v];_<m[v]&&(m[v]=_,y[v]=o),_>a[v]&&(a[v]=_,l[v]=o)}if(o=0,a[1]-m[1]>a[0]-m[0]&&(o=1),a[2]-m[2]>
79a[o]-m[o]&&(o=2),m[o]>=a[o])h[0]=0,h[1]=0,h[2]=1;else{for(a=0,m=y[o],l=l[o],y=[0,0,0],m=[m.g[0]-l.g[0],m.g[1]-l.g[1],m.g[2]-l.g[2]],v=[0,0,0],o=u.e;o!==u;o=o.e)v[0]=o.g[0]-l.g[0],v[1]=o.g[1]-l.g[1],v[2]=o.g[2]-l.g[2],y[0]=m[1]*v[2]-m[2]*v[1],y[1]=m[2]*v[0]-m[0]*v[2],y[2]=m[0]*v[1]-m[1]*v[0],(_=y[0]*y[0]+y[1]*y[1]+y[2]*y[2])>a&&(a=_,h[0]=y[0],h[1]=y[1],h[2]=y[2]);0>=a&&(h[0]=h[1]=h[2]=0,h[A(m)]=1)}u=!0}for(y=A(h),o=this.b.c,a=(y+1)%3,l=(y+2)%3,y=0<h[y]?1:-1,h=o.e;h!==o;h=h.e)h.b=h.g[a],h.a=y*h.g[l];if(u){for(h=0,o=(u=this.b.a).b;o!==u;o=o.b)if(!(0>=(a=o.a).f))do h+=(a.a.b-a.b.a.b)*(a.a.a+a.b.a.a),a=a.e;while(a!==o.a);if(0>h)for(u=(h=this.b.c).e;u!==h;u=u.e)u.a=-u.a}for(this.n=!1,o=(h=this.b.b).h;o!==h;o=u)u=o.h,a=o.e,r(o.a,o.b.a)&&o.e.e!==o&&(L(this,a,o),d(o),a=(o=a).e),a.e===o&&(a!==o&&((a===u||a===u.b)&&(u=u.h),d(a)),(o===u||o===u.b)&&(u=u.h),d(o));for(this.e=h=new ee,o=(u=this.b.c).e;o!==u;o=o.e)o.h=et(h,o);for(function(t){t.d=[];for(var r,i=0;i<t.a;i++)t.d[i]=i;t.d.sort((r=t.c,function(t,i){return n(r[t],r[i])?1:-1})),t.e=!0,function(t){for(var r=t.a;1<=r;--r)ea(t,r);t.h=!0}(t.b)}(h),this.f=new j(this),$(this,-C),$(this,C);null!==(h=er(this.e));){for(;;){e:if(0===(o=this.e).a)u=es(o.b);else if(u=o.c[o.d[o.a-1]],0!==o.b.a&&n(o=es(o.b),u)){u=o;break e}if(null===u||!r(u,h))break;u=er(this.e),L(this,h.c,u.c)}!function t(i,o){i.a=o;for(var a=o.c;null===a.i;)if((a=a.c)===o.c){var a=i,l=o,u=new eu;u.a=l.c.b;var h=a.f,m=h.a;do m=m.a;while(null!==m.b&&!h.c(h.b,u,m.b));var h=m.b,g=eh(h),u=h.a,m=g.a;if(0===s(u.b.a,l,u.a))r((u=h.a).a,l)||r(u.b.a,l)||(p(u.b),h.c&&(d(u.c),h.c=!1),c(l.c,u),t(a,l));else{var y=n(m.b.a,u.b.a)?h:g,g=void 0;h.d||y.c?(g=y===h?f(l.c.b,u.e):f(m.b.c.b,l.c).b,y.c?F(y,g):(u=a,(h=N(a,h,g)).f=ec(h).f+h.a.f,h.d=I(u,h.f)),t(a,l)):M(a,h,l.c,l.c,null,!0)}return}if(h=(u=eh(a=T(a.i))).a,(u=k(i,u,null)).c===h){var h=u,u=h.c,m=eh(a),g=a.a,y=m.a,v=!1;g.b.a!==y.b.a&&z(i,a),r(g.a,i.a)&&(c(K(u),g),u=eh(a=T(a)).a,k(i,eh(a),m),v=!0),r(y.a,i.a)&&(c(h,K(y)),h=k(i,m,null),v=!0),v?M(i,a,h.c,u,u,!0):(l=n(y.a,g.a)?K(y):g,M(i,a,l=f(h.c.b,l),l.c,l.c,!1),l.b.i.c=!0,U(i,a))}else M(i,a,u.c,h,h,!0)}(this,h)}for(h=0,this.a=this.f.a.a.b.a.a;null!==(u=this.f.a.a.b);)u.h||++h,S(u);for(this.f=null,(h=this.e).b=null,h.d=null,this.e=h.c=null,o=(h=this.b).a.b;o!==h.a;o=u)u=o.b,(o=o.a).e.e===o&&(D(o.c,o),d(o));
79if(!this.n){if(h=this.b,this.m)for(o=h.b.h;o!==h.b;o=u)u=o.h,o.b.d.c!==o.d.c?o.f=o.d.c?1:-1:d(o);else for(o=h.a.b;o!==h.a;o=u)if(u=o.b,o.c){for(o=o.a;n(o.b.a,o.a);o=o.c.b);for(;n(o.a,o.b.a);o=o.e);for(a=o.c.b,l=void 0;o.e!==a;)if(n(o.b.a,a.a)){for(;a.e!==o&&(n((t=a.e).b.a,t.a)||0>=s(a.a,a.b.a,a.e.b.a));)a=(l=f(a.e,a)).b;a=a.c.b}else{for(;a.e!==o&&(n((i=o.c.b).a,i.b.a)||0<=s(o.b.a,o.a,o.c.b.a));)o=(l=f(o,o.c.b)).b;o=o.e}for(;a.e.e!==o;)a=(l=f(a.e,a)).b}if(this.h||this.i||this.k||this.l)if(this.m){for(u=(h=this.b).a.b;u!==h.a;u=u.b)if(u.c){this.h&&this.h(2,this.c),o=u.a;do this.k&&this.k(o.a.d,this.c),o=o.e;while(o!==u.a);this.i&&this.i(this.c)}}else{for(h=this.b,u=!!this.l,o=!1,a=-1,l=h.a.d;l!==h.a;l=l.d)if(l.c){o||(this.h&&this.h(4,this.c),o=!0),y=l.a;do u&&a!==(m=+!y.b.d.c)&&(a=m,this.l&&this.l(!!a,this.c)),this.k&&this.k(y.a.d,this.c),y=y.e;while(y!==l.a)}o&&this.i&&this.i(this.c)}if(this.r){for(o=(h=this.b).a.b;o!==h.a;o=u)if(u=o.b,!o.c){l=(a=o.a).e,y=void 0;do l=(y=l).e,y.d=null,null===y.b.d&&(y.c===y?x(y.a,null):(y.a.c=y.c,g(y,K(y))),(m=y.b).c===m?x(m.a,null):(m.a.c=m.c,g(m,K(m))),b(y));while(y!==a);a=o.d,(o=o.b).d=a,a.b=o}this.r(this.b),this.c=this.b=null;return}}this.b=this.c=null},this.libtess={GluTesselator:H,windingRule:{GLU_TESS_WINDING_ODD:100130,GLU_TESS_WINDING_NONZERO:100131,GLU_TESS_WINDING_POSITIVE:100132,GLU_TESS_WINDING_NEGATIVE:100133,GLU_TESS_WINDING_ABS_GEQ_TWO:100134},primitiveType:{GL_LINE_LOOP:2,GL_TRIANGLES:4,GL_TRIANGLE_STRIP:5,GL_TRIANGLE_FAN:6},errorType:{GLU_TESS_MISSING_BEGIN_POLYGON:100151,GLU_TESS_MISSING_END_POLYGON:100153,GLU_TESS_MISSING_BEGIN_CONTOUR:100152,GLU_TESS_MISSING_END_CONTOUR:100154,GLU_TESS_COORD_TOO_LARGE:100155,GLU_TESS_NEED_COMBINE_CALLBACK:100156},gluEnum:{GLU_TESS_MESH:100112,GLU_TESS_TOLERANCE:100142,GLU_TESS_WINDING_RULE:100140,GLU_TESS_BOUNDARY_ONLY:100141,GLU_INVALID_ENUM:100900,GLU_INVALID_VALUE:100901,GLU_TESS_BEGIN:100100,GLU_TESS_VERTEX:100101,GLU_TESS_END:100102,GLU_TESS_ERROR:100103,GLU_TESS_EDGE_FLAG:100104,GLU_TESS_COMBINE:100105,GLU_TESS_BEGIN_DATA:100106,GLU_TESS_VERTEX_DATA:100107,GLU_TESS_END_DATA:100108,GLU_TESS_ERROR_DATA:100109,GLU_TESS_EDGE_FLAG_DATA:100110,GLU_TESS_COMBINE_DATA:100111}},H.prototype.gluDeleteTess=H.prototype.x,H.prototype.gluTessProperty=H.prototype.B,H.prototype.gluGetTessProperty=H.prototype.y,H.prototype.gluTessNormal=H.prototype.A,H.prototype.gluTessCallback=H.prototype.z,H.prototype.gluTessVertex=H.prototype.C,H.prototype.gluTessBeginPolygon=H.prototype.u,H.prototype.gluTessBeginContour=H.prototype.t,H.prototype.gluTessEndContour=H.prototype.v,H.prototype.gluTessEndPolygon=H.prototype.w,t.exports=this.libtess},43140:(t,r,n)=>{"use strict";n.d(r,{A:()=>s,U:()=>i});class i{constructor(t=128){this.length=0,this.data=new Float32Array(t),this.initialLength=t}dataArray(){return this.subArray(0,this.length)}clear(){this.length=0}rescale(){if(this.length<this.data.length/2){let t=new Float32Array(1<<Math.ceil(Math.log2(this.length)));t.set(this.data.subarray(0,this.length),0),this.data=t}}reset(){this.clear(),this.data=new Float32Array(this.initialLength)}push(...t){this.ensureLength(this.length+t.length),this.data.set(t,this.length),this.length+=t.length}slice(t,r){return this.data.slice(t,Math.min(r,this.length))}subArray(t,r){return this.data.subarray(t,Math.min(r,this.length))}ensureLength(t){for(;this.data.length<t;){let t=new Float32Array(2*this.data.length);t.set(this.data,0),this.data=t}}}function s(t,r){t.DataArray=i}"undefined"!=typeof p5&&s(p5,p5.prototype)},43327:(t,r,n)=>{"use strict";n.d(r,{uq:()=>u});var i=n(39247),s=n(10726);n(58905);let o=t=>{if(Math.sqrt(t.length)%1!=0)throw Error("Array length must be a perfect square.");return!0},a=Array,l=t=>Array.isArray(t);"undefined"!=typeof Float32Array&&(a=Float32Array,l=t=>Array.isArray(t)||t instanceof Float32Array);class u extends s.zE{matrix;#s;constructor(...t){if(super(...t),l(t[0])&&o(t[0])){let r=Math.sqrt(t[0].length);this.#s=r,this.matrix=a.from(t[0])}else"number"==typeof t[0]&&(this.#s=Number(t[0]),this.matrix=this.#o(t[0]));return this}get mat3(){return 3===this.#s?this.matrix:void 0}get mat4(){return 4===this.#s?this.matrix:void 0}
79add(t){if(this.matrix.length!==t.matrix.length)throw Error("Matrices must be of the same dimension to add.");for(let r=0;r<this.matrix.length;r++)this.matrix[r]+=t.matrix[r];return this}setElement(t,r){return t>=0&&t<this.matrix.length&&(this.matrix[t]=r),this}reset(){return this.matrix=this.#o(this.#s),this}set(t){let r=a.from([...arguments]);return(t instanceof u?r=a.from(t.matrix):l(t)&&(r=a.from(t)),r.length!==this.matrix.length)?p5._friendlyError(`Expected same dimensions values but received different ${r.length}.`,"p5.Matrix.set"):this.matrix=r,this}get(){return new u(this.matrix)}copy(){return new u(this.matrix)}clone(){return this.copy()}diagonal(){let t=[];for(let r=0;r<this.#s;r++)t.push(this.matrix[r*(this.#s+1)]);return t}row(t){let r=[];for(let n=0;n<this.#s;n++)r.push(this.matrix[n*this.#s+t]);return new i.M(...r)}column(t){let r=[];for(let n=0;n<this.#s;n++)r.push(this.matrix[t*this.#s+n]);return new i.M(...r)}transpose(t){return 4===this.#s?this.#a(t):3===this.#s?this.#l(t):this.#u(t)}mult(t){let r;return(t===this||t===this.matrix?r=this.copy().matrix:t instanceof u?r=t.matrix:l(t)&&o(t)?r=t:o(Array.from(arguments))&&(r=Array.from(arguments)),4===this.#s&&16===r.length)?this.#h(r):3===this.#s&&9===r.length?this.#c(r):this.#d(r)}multiplyVec(t,r){void 0===r&&(r=t.copy());for(let n=0;n<this.#s;n++)r.values[n]=this.row(n).dot(t);return r}invert(t){if(4===this.#s)return this.#p(t);if(3===this.#s)return this.#f(t);throw Error("Invert is not implemented for N>4 at the moment, we are working on it")}createSubMatrix3x3(){if(4===this.#s){let t=new u(3);return t.mat3[0]=this.matrix[0],t.mat3[1]=this.matrix[1],t.mat3[2]=this.matrix[2],t.mat3[3]=this.matrix[4],t.mat3[4]=this.matrix[5],t.mat3[5]=this.matrix[6],t.mat3[6]=this.matrix[8],t.mat3[7]=this.matrix[9],t.mat3[8]=this.matrix[10],t}throw Error("Matrix dimension must be 4 to create a 3x3 submatrix.")}inverseTranspose4x4({mat4:t}){if(3!==this.#s)throw Error("This function only works with 3\xd73 matrices.");this.matrix[0]=t[0],this.matrix[1]=t[1],this.matrix[2]=t[2],this.matrix[3]=t[4],this.matrix[4]=t[5],this.matrix[5]=t[6],this.matrix[6]=t[8],this.matrix[7]=t[9],this.matrix[8]=t[10];let r=this.invert();if(r)r.transpose(this.matrix);else for(let t=0;t<9;t++)this.matrix[t]=0;return this}apply(t){let r;if(t===this||t===this.matrix)r=this.copy().matrix;else if(t instanceof u)r=t.matrix;else if(l(t))r=t;else{if(16!=arguments.length)return;r=arguments}let n=this.matrix,i=n[0],s=n[4],o=n[8],a=n[12];n[0]=r[0]*i+r[1]*s+r[2]*o+r[3]*a,n[4]=r[4]*i+r[5]*s+r[6]*o+r[7]*a,n[8]=r[8]*i+r[9]*s+r[10]*o+r[11]*a,n[12]=r[12]*i+r[13]*s+r[14]*o+r[15]*a;let h=n[1],c=n[5],d=n[9],p=n[13];n[1]=r[0]*h+r[1]*c+r[2]*d+r[3]*p,n[5]=r[4]*h+r[5]*c+r[6]*d+r[7]*p,n[9]=r[8]*h+r[9]*c+r[10]*d+r[11]*p,n[13]=r[12]*h+r[13]*c+r[14]*d+r[15]*p;let f=n[2],m=n[6],g=n[10],y=n[14];n[2]=r[0]*f+r[1]*m+r[2]*g+r[3]*y,n[6]=r[4]*f+r[5]*m+r[6]*g+r[7]*y,n[10]=r[8]*f+r[9]*m+r[10]*g+r[11]*y,n[14]=r[12]*f+r[13]*m+r[14]*g+r[15]*y;let v=n[3],b=n[7],x=n[11],_=n[15];return n[3]=r[0]*v+r[1]*b+r[2]*x+r[3]*_,n[7]=r[4]*v+r[5]*b+r[6]*x+r[7]*_,n[11]=r[8]*v+r[9]*b+r[10]*x+r[11]*_,n[15]=r[12]*v+r[13]*b+r[14]*x+r[15]*_,this}scale(t,r,n){return t instanceof i.M?(r=t.y,n=t.z,t=t.x):t instanceof Array&&(r=t[1],n=t[2],t=t[0]),this.matrix[0]*=t,this.matrix[1]*=t,this.matrix[2]*=t,this.matrix[3]*=t,this.matrix[4]*=r,this.matrix[5]*=r,this.matrix[6]*=r,this.matrix[7]*=r,this.matrix[8]*=n,this.matrix[9]*=n,this.matrix[10]*=n,this.matrix[11]*=n,this}rotate4x4(t,r,n,s){r instanceof i.M?(n=r.y,s=r.z,r=r.x):r instanceof Array&&(n=r[1],s=r[2],r=r[0]);let o=Math.sqrt(r*r+n*n+s*s);r*=1/o,n*=1/o,s*=1/o;let a=this.matrix[0],l=this.matrix[1],u=this.matrix[2],h=this.matrix[3],c=this.matrix[4],d=this.matrix[5],p=this.matrix[6],f=this.matrix[7],m=this.matrix[8],g=this.matrix[9],y=this.matrix[10],v=this.matrix[11],b=Math.sin(t),x=Math.cos(t),_=1-x,A=r*r*_+x,E=n*r*_+s*b,C=s*r*_-n*b,D=r*n*_-s*b,w=n*n*_+x,S=s*n*_+r*b,F=r*s*_+n*b,T=n*s*_-r*b,N=s*s*_+x;return this.matrix[0]=a*A+c*E+m*C,this.matrix[1]=l*A+d*E+g*C,this.matrix[2]=u*A+p*E+y*C,this.matrix[3]=h*A+f*E+v*C,this.matrix[4]=a*D+c*w+m*S,this.matrix[5]=l*D+d*w+g*S,this.matrix[6]=u*D+p*w+y*S,this.matrix[7]=h*D+f*w+v*S,this.matrix[8]=a*F+c*T+m*N,this.matrix[9]=l*F+d*T+g*N,this.matrix[
7910]=u*F+p*T+y*N,this.matrix[11]=h*F+f*T+v*N,this}translate(t){let r=t[0],n=t[1],i=t[2]||0;return this.matrix[12]+=this.matrix[0]*r+this.matrix[4]*n+this.matrix[8]*i,this.matrix[13]+=this.matrix[1]*r+this.matrix[5]*n+this.matrix[9]*i,this.matrix[14]+=this.matrix[2]*r+this.matrix[6]*n+this.matrix[10]*i,this.matrix[15]+=this.matrix[3]*r+this.matrix[7]*n+this.matrix[11]*i,this}rotateX(t){this.rotate4x4(t,1,0,0)}rotateY(t){this.rotate4x4(t,0,1,0)}rotateZ(t){this.rotate4x4(t,0,0,1)}perspective(t,r,n,i){let s=1/Math.tan(t/2),o=1/(n-i);return this.matrix[0]=s/r,this.matrix[1]=0,this.matrix[2]=0,this.matrix[3]=0,this.matrix[4]=0,this.matrix[5]=s,this.matrix[6]=0,this.matrix[7]=0,this.matrix[8]=0,this.matrix[9]=0,this.matrix[10]=(i+n)*o,this.matrix[11]=-1,this.matrix[12]=0,this.matrix[13]=0,this.matrix[14]=2*i*n*o,this.matrix[15]=0,this}ortho(t,r,n,i,s,o){let a=1/(t-r),l=1/(n-i),u=1/(s-o);return this.matrix[0]=-2*a,this.matrix[1]=0,this.matrix[2]=0,this.matrix[3]=0,this.matrix[4]=0,this.matrix[5]=-2*l,this.matrix[6]=0,this.matrix[7]=0,this.matrix[8]=0,this.matrix[9]=0,this.matrix[10]=2*u,this.matrix[11]=0,this.matrix[12]=(t+r)*a,this.matrix[13]=(i+n)*l,this.matrix[14]=(o+s)*u,this.matrix[15]=1,this}multiplyVec4(t,r,n,i){let s=[,,,,],o=this.matrix;return s[0]=o[0]*t+o[4]*r+o[8]*n+o[12]*i,s[1]=o[1]*t+o[5]*r+o[9]*n+o[13]*i,s[2]=o[2]*t+o[6]*r+o[10]*n+o[14]*i,s[3]=o[3]*t+o[7]*r+o[11]*n+o[15]*i,s}multiplyPoint({x:t,y:r,z:n}){let s=this.multiplyVec4(t,r,n,1);return new i.M(s[0],s[1],s[2])}multiplyAndNormalizePoint({x:t,y:r,z:n}){let s=this.multiplyVec4(t,r,n,1);return s[0]/=s[3],s[1]/=s[3],s[2]/=s[3],new i.M(s[0],s[1],s[2])}multiplyDirection({x:t,y:r,z:n}){let s=this.multiplyVec4(t,r,n,0);return new i.M(s[0],s[1],s[2])}multiplyVec3(t,r){return void 0===r&&(r=t.copy()),r.x=this.row(0).dot(t),r.y=this.row(1).dot(t),r.z=this.row(2).dot(t),r}#o(t){if(3===t)return new a([1,0,0,0,1,0,0,0,1]);if(4===t)return new a([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);let r=new a(t*t).fill(0);for(let n=0;n<t;n++)r[n*t+n]=1;return r}#h(t){let r=this.matrix[0],n=this.matrix[1],i=this.matrix[2],s=this.matrix[3];return this.matrix[0]=r*t[0]+n*t[4]+i*t[8]+s*t[12],this.matrix[1]=r*t[1]+n*t[5]+i*t[9]+s*t[13],this.matrix[2]=r*t[2]+n*t[6]+i*t[10]+s*t[14],this.matrix[3]=r*t[3]+n*t[7]+i*t[11]+s*t[15],r=this.matrix[4],n=this.matrix[5],i=this.matrix[6],s=this.matrix[7],this.matrix[4]=r*t[0]+n*t[4]+i*t[8]+s*t[12],this.matrix[5]=r*t[1]+n*t[5]+i*t[9]+s*t[13],this.matrix[6]=r*t[2]+n*t[6]+i*t[10]+s*t[14],this.matrix[7]=r*t[3]+n*t[7]+i*t[11]+s*t[15],r=this.matrix[8],n=this.matrix[9],i=this.matrix[10],s=this.matrix[11],this.matrix[8]=r*t[0]+n*t[4]+i*t[8]+s*t[12],this.matrix[9]=r*t[1]+n*t[5]+i*t[9]+s*t[13],this.matrix[10]=r*t[2]+n*t[6]+i*t[10]+s*t[14],this.matrix[11]=r*t[3]+n*t[7]+i*t[11]+s*t[15],r=this.matrix[12],n=this.matrix[13],i=this.matrix[14],s=this.matrix[15],this.matrix[12]=r*t[0]+n*t[4]+i*t[8]+s*t[12],this.matrix[13]=r*t[1]+n*t[5]+i*t[9]+s*t[13],this.matrix[14]=r*t[2]+n*t[6]+i*t[10]+s*t[14],this.matrix[15]=r*t[3]+n*t[7]+i*t[11]+s*t[15],this}#d(t){if(t.length!==this.matrix.length)throw Error("Matrices must be of the same dimension to multiply.");let r=new a(this.matrix.length).fill(0);for(let n=0;n<this.#s;n++)for(let i=0;i<this.#s;i++)for(let s=0;s<this.#s;s++)r[n*this.#s+i]+=this.matrix[n*this.#s+s]*t[s*this.#s+i];return this.matrix=r,this}#c(t){let r=this.mat3[0],n=this.mat3[1],i=this.mat3[2];return this.mat3[0]=r*t[0]+n*t[3]+i*t[6],this.mat3[1]=r*t[1]+n*t[4]+i*t[7],this.mat3[2]=r*t[2]+n*t[5]+i*t[8],r=this.mat3[3],n=this.mat3[4],i=this.mat3[5],this.mat3[3]=r*t[0]+n*t[3]+i*t[6],this.mat3[4]=r*t[1]+n*t[4]+i*t[7],this.mat3[5]=r*t[2]+n*t[5]+i*t[8],r=this.mat3[6],n=this.mat3[7],i=this.mat3[8],this.mat3[6]=r*t[0]+n*t[3]+i*t[6],this.mat3[7]=r*t[1]+n*t[4]+i*t[7],this.mat3[8]=r*t[2]+n*t[5]+i*t[8],this}#u(){let t=this.#s;for(let r=0;r<t;r++)for(let n=0;n<t;n++)this.matrix[r*t+n]=this.matrix[n*t+r];return this}#a(t){let r,n,i,s,o,a;return console.log("====> 4x4"),t instanceof u?(r=t.matrix[1],n=t.matrix[2],i=t.matrix[3],s=t.matrix[6],o=t.matrix[7],a=t.matrix[11],this.matrix[0]=t.matrix[0],this.matrix[
791]=t.matrix[4],this.matrix[2]=t.matrix[8],this.matrix[3]=t.matrix[12],this.matrix[4]=r,this.matrix[5]=t.matrix[5],this.matrix[6]=t.matrix[9],this.matrix[7]=t.matrix[13],this.matrix[8]=n,this.matrix[9]=s,this.matrix[10]=t.matrix[10],this.matrix[11]=t.matrix[14],this.matrix[12]=i,this.matrix[13]=o,this.matrix[14]=a,this.matrix[15]=t.matrix[15]):l(t)&&(r=t[1],n=t[2],i=t[3],s=t[6],o=t[7],a=t[11],this.matrix[0]=t[0],this.matrix[1]=t[4],this.matrix[2]=t[8],this.matrix[3]=t[12],this.matrix[4]=r,this.matrix[5]=t[5],this.matrix[6]=t[9],this.matrix[7]=t[13],this.matrix[8]=n,this.matrix[9]=s,this.matrix[10]=t[10],this.matrix[11]=t[14],this.matrix[12]=i,this.matrix[13]=o,this.matrix[14]=a,this.matrix[15]=t[15]),this}#l(t){void 0===t&&(t=this.mat3);let r=t[1],n=t[2],i=t[5];return this.mat3[0]=t[0],this.mat3[1]=t[3],this.mat3[2]=t[6],this.mat3[3]=r,this.mat3[4]=t[4],this.mat3[5]=t[7],this.mat3[6]=n,this.mat3[7]=i,this.mat3[8]=t[8],this}#p(t){let r,n,i,s,o,a,h,c,d,p,f,m,g,y,v,b;t instanceof u?(r=t.matrix[0],n=t.matrix[1],i=t.matrix[2],s=t.matrix[3],o=t.matrix[4],a=t.matrix[5],h=t.matrix[6],c=t.matrix[7],d=t.matrix[8],p=t.matrix[9],f=t.matrix[10],m=t.matrix[11],g=t.matrix[12],y=t.matrix[13],v=t.matrix[14],b=t.matrix[15]):l(t)&&(r=t[0],n=t[1],i=t[2],s=t[3],o=t[4],a=t[5],h=t[6],c=t[7],d=t[8],p=t[9],f=t[10],m=t[11],g=t[12],y=t[13],v=t[14],b=t[15]);let x=r*a-n*o,_=r*h-i*o,A=r*c-s*o,E=n*h-i*a,C=n*c-s*a,D=i*c-s*h,w=d*y-p*g,S=d*v-f*g,F=d*b-m*g,T=p*v-f*y,N=p*b-m*y,I=f*b-m*v,O=x*I-_*N+A*T+E*F-C*S+D*w;return O?(O=1/O,this.matrix[0]=(a*I-h*N+c*T)*O,this.matrix[1]=(i*N-n*I-s*T)*O,this.matrix[2]=(y*D-v*C+b*E)*O,this.matrix[3]=(f*C-p*D-m*E)*O,this.matrix[4]=(h*F-o*I-c*S)*O,this.matrix[5]=(r*I-i*F+s*S)*O,this.matrix[6]=(v*A-g*D-b*_)*O,this.matrix[7]=(d*D-f*A+m*_)*O,this.matrix[8]=(o*N-a*F+c*w)*O,this.matrix[9]=(n*F-r*N-s*w)*O,this.matrix[10]=(g*C-y*A+b*x)*O,this.matrix[11]=(p*A-d*C-m*x)*O,this.matrix[12]=(a*S-o*T-h*w)*O,this.matrix[13]=(r*T-n*S+i*w)*O,this.matrix[14]=(y*_-g*E-v*x)*O,this.matrix[15]=(d*E-p*_+f*x)*O,this):null}#f(){let t=this.mat3[0],r=this.mat3[1],n=this.mat3[2],i=this.mat3[3],s=this.mat3[4],o=this.mat3[5],a=this.mat3[6],l=this.mat3[7],u=this.mat3[8],h=u*s-o*l,c=-u*i+o*a,d=l*i-s*a,p=t*h+r*c+n*d;return p?(p=1/p,this.mat3[0]=h*p,this.mat3[1]=(-u*r+n*l)*p,this.mat3[2]=(o*r-n*s)*p,this.mat3[3]=c*p,this.mat3[4]=(u*t-n*a)*p,this.mat3[5]=(-o*t+n*i)*p,this.mat3[6]=d*p,this.mat3[7]=(-l*t+r*a)*p,this.mat3[8]=(s*t-r*i)*p,this):null}#m(){if(4!==this.#s)throw Error("Determinant is only implemented for 4x4 matrices. We are working on it.");let t=this.matrix[0]*this.matrix[5]-this.matrix[1]*this.matrix[4],r=this.matrix[0]*this.matrix[6]-this.matrix[2]*this.matrix[4],n=this.matrix[0]*this.matrix[7]-this.matrix[3]*this.matrix[4],i=this.matrix[1]*this.matrix[6]-this.matrix[2]*this.matrix[5],s=this.matrix[1]*this.matrix[7]-this.matrix[3]*this.matrix[5],o=this.matrix[2]*this.matrix[7]-this.matrix[3]*this.matrix[6],a=this.matrix[8]*this.matrix[13]-this.matrix[9]*this.matrix[12],l=this.matrix[8]*this.matrix[14]-this.matrix[10]*this.matrix[12],u=this.matrix[8]*this.matrix[15]-this.matrix[11]*this.matrix[12],h=this.matrix[9]*this.matrix[14]-this.matrix[10]*this.matrix[13],c=this.matrix[9]*this.matrix[15]-this.matrix[11]*this.matrix[13];return t*(this.matrix[10]*this.matrix[15]-this.matrix[11]*this.matrix[14])-r*c+n*h+i*u-s*l+o*a}}},45950:(t,r,n)=>{"use strict";n.d(r,{C:()=>eX,H:()=>eQ,L:()=>e2,O:()=>e3,R:()=>eK,a:()=>eY,b:()=>eJ,c:()=>e6,d:()=>e0,e:()=>e1,f:()=>e5,g:()=>e4,h:()=>e8});var i=n(87442),s=n(93421),o=n(56062),a=n(72672),l=n(1818),u=n(50565);let h=new i.A({id:"xyz-d50",name:"XYZ D50",white:"D50",base:u.A,fromBase:t=>(0,l.Ay)(u.A.white,"D50",t),toBase:t=>(0,l.Ay)("D50",u.A.white,t)}),c=216/24389,d=24/116,p=24389/27,f=l.FL.D50,m=new i.A({id:"lab",name:"Lab",coords:{l:{refRange:[0,100],name:"Lightness"},a:{refRange:[-125,125]},b:{refRange:[-125,125]}}
79,white:f,base:h,fromBase(t){let r=t.map((t,r)=>t/f[r]).map(t=>t>c?Math.cbrt(t):(p*t+16)/116);return[116*r[1]-16,500*(r[0]-r[1]),200*(r[1]-r[2])]},toBase(t){let[r,n,i]=t,s=[];return s[1]=(r+16)/116,s[0]=n/500+s[1],s[2]=s[1]-i/200,[s[0]>d?Math.pow(s[0],3):(116*s[0]-16)/p,t[0]>8?Math.pow((t[0]+16)/116,3):t[0]/p,s[2]>d?Math.pow(s[2],3):(116*s[2]-16)/p].map((t,r)=>t*f[r])},formats:{lab:{coords:["<percentage> | <number>","<number> | <percentage>","<number> | <percentage>"]}}});function g(t){return"number"!=typeof t?t:(t%360+360)%360}let y=new i.A({id:"lch",name:"LCH",coords:{l:{refRange:[0,100],name:"Lightness"},c:{refRange:[0,150],name:"Chroma"},h:{refRange:[0,360],type:"angle",name:"Hue"}},base:m,fromBase(t){if(void 0===this.ε){let t=Object.values(this.base.coords)[1].refRange,r=t[1]-t[0];this.ε=r/1e5}let[r,n,i]=t,s=Math.abs(n)<this.ε&&Math.abs(i)<this.ε,o=s?null:g(180*Math.atan2(i,n)/Math.PI);return[r,s?0:Math.sqrt(n**2+i**2),o]},toBase(t){let[r,n,i]=t,s=null,a=null;return(0,o.$I)(i)||(s=(n=n<0?0:n)*Math.cos(i*Math.PI/180),a=n*Math.sin(i*Math.PI/180)),[r,s,a]},formats:{lch:{coords:["<percentage> | <number>","<number> | <percentage>","<number> | <angle>"]}}}),v=Math.PI,b=180/v,x=v/180;function _(t){let r=t*t;return r*r*r*t}function A(t,r,{kL:n=1,kC:i=1,kH:o=1}={}){let l,u;[t,r]=(0,s.A)([t,r]);let[h,c,d]=m.from(t),p=y.from(m,[h,c,d])[1],[f,g,E]=m.from(r),C=y.from(m,[f,g,E])[1];p<0&&(p=0),C<0&&(C=0);let D=_((p+C)/2),w=.5*(1-Math.sqrt(D/(D+0x16bcc41e9))),S=(1+w)*c,F=(1+w)*g,T=Math.sqrt(S**2+d**2),N=Math.sqrt(F**2+E**2),I=0===S&&0===d?0:Math.atan2(d,S),O=0===F&&0===E?0:Math.atan2(E,F);I<0&&(I+=2*v),O<0&&(O+=2*v),I*=b;let k=f-h,M=N-T,B=(O*=b)-I,L=I+O,R=Math.abs(B);T*N==0?l=0:R<=180?l=B:B>180?l=B-360:B<-180?l=B+360:a.A.warn("the unthinkable has happened");let P=2*Math.sqrt(N*T)*Math.sin(l*x/2),z=(h+f)/2,U=(T+N)/2,$=_(U),j=(z-50)**2,V=1+.015*j/Math.sqrt(20+j),G=1+.045*U,H=1+.015*U*(1-.17*Math.cos(((u=T*N==0?L:R<=180?L/2:L<360?(L+360)/2:(L-360)/2)-30)*x)+.24*Math.cos(2*u*x)+.32*Math.cos((3*u+6)*x)-.2*Math.cos((4*u-63)*x)),q=(k/(n*V))**2;return Math.sqrt(q+=(M/(i*G))**2+(P/(o*H))**2+M/(i*G)*(-1*Math.sin(2*(30*Math.exp(-1*((u-275)/25)**2))*x)*(2*Math.sqrt($/($+0x16bcc41e9))))*(P/(o*H)))}var E=n(67449);let C=[[.819022437996703,.3619062600528904,-.1288737815209879],[.0329836539323885,.9292868615863434,.0361446663506424],[.0481771893596242,.2642395317527308,.6335478284694309]],D=[[1.2268798758459243,-.5578149944602171,.2813910456659647],[-.0405757452148008,1.112286803280317,-.0717110580655164],[-.0763729366746601,-.4214933324022432,1.5869240198367816]],w=[[.210454268309314,.7936177747023054,-.0040720430116193],[1.9779985324311684,-2.42859224204858,.450593709617411],[.0259040424655478,.7827717124575296,-.8086757549230774]],S=[[1,.3963377773761749,.2158037573099136],[1,-.1055613458156586,-.0638541728258133],[1,-.0894841775298119,-1.2914855480194092]],F=new i.A({id:"oklab",name:"Oklab",coords:{l:{refRange:[0,1],name:"Lightness"},a:{refRange:[-.4,.4]},b:{refRange:[-.4,.4]}},white:"D65",base:u.A,fromBase(t){let r=(0,E.R)(t,C);return r[0]=Math.cbrt(r[0]),r[1]=Math.cbrt(r[1]),r[2]=Math.cbrt(r[2]),(0,E.R)(r,w,r)},toBase(t){let r=(0,E.R)(t,S);return r[0]=r[0]**3,r[1]=r[1]**3,r[2]=r[2]**3,(0,E.R)(r,D,r)},formats:{oklab:{coords:["<percentage> | <number>","<number> | <percentage>","<number> | <percentage>"]}}});function T(t,r){[t,r]=(0,s.A)([t,r]);let[n,i,o]=F.from(t),[a,l,u]=F.from(r);return Math.sqrt((n-a)**2+(i-l)**2+(o-u)**2)}function N(t,r,{epsilon:n=75e-6}={}){t=(0,s.A)(t),r||(r=t.space),r=i.A.get(r);let o=t.coords;return r!==t.space&&(o=r.from(t)),r.inGamut(o,{epsilon:n})}function I(t,r){let n;t=(0,s.A)(t);let a=i.A.get(r,r?.space),l=r?.precision;return n=!a||t.space.equals(a)?t.coords.slice():a.from(t),void 0===l?n:n.map(t=>(0,o.QX)(t,l))}function O(t,r){if(t=(0,s.A)(t),"alpha"===r)return t.alpha??1;let{space:n,index:o}=i.A.resolveCoord(r,t.space);return I(t,n)[o]}function k(t,r,n,o){return t=(0,s.A)(t),Array.isArray(r)&&([r,n,o]=[t.space,r,n]),r=i.A.get(r),t.coords=r===t.space?n.slice():r.to(t.space,n),void 0!==o&&(t.alpha=o),t}function M(t,r,n){if(t=(0,s.A)(t),2==arguments.length&&"object"===(0,o.NW)(arguments[1])){let r=arguments[1];for(let n in r)M(t,n,r[n])}else if("function"==typeof n&&(n=n(O(t,r))),"alpha"===r)t.alpha=n;else{let{space:s,index:o}
79=i.A.resolveCoord(r,t.space),a=I(t,s);a[o]=n,k(t,s,a)}return t}function B(t){return{space:t.space,coords:t.coords.slice(),alpha:t.alpha}}k.returns="color",M.returns="color";let L=Math.PI/180,R=new i.A({id:"xyz-abs-d65",cssId:"--xyz-abs-d65",name:"Absolute XYZ D65",coords:{x:{refRange:[0,9504.7],name:"Xa"},y:{refRange:[0,1e4],name:"Ya"},z:{refRange:[0,10888.3],name:"Za"}},base:u.A,fromBase:t=>t.map(t=>203*t),toBase:t=>t.map(t=>t/203)}),P=2610/16384,z=16384/2610,U=1.7*2523/32,$=32/(1.7*2523),j=[[.41478972,.579999,.014648],[-.20151,1.120649,.0531008],[-.0166008,.2648,.6684799]],V=[[1.9242264357876067,-1.0047923125953657,.037651404030618],[.35031676209499907,.7264811939316552,-.06538442294808501],[-.09098281098284752,-.3127282905230739,1.5227665613052603]],G=[[.5,.5,0],[3.524,-4.066708,.542708],[.199076,1.096799,-1.295875]],H=[[1,.13860504327153927,.05804731615611883],[1,-.1386050432715393,-.058047316156118904],[1,-.09601924202631895,-.811891896056039]],q=new i.A({id:"jzazbz",name:"Jzazbz",coords:{jz:{refRange:[0,1],name:"Jz"},az:{refRange:[-.21,.21]},bz:{refRange:[-.21,.21]}},base:R,fromBase(t){let[r,n,i]=t,s=(0,E.R)([1.15*r-(1.15-1)*i,.66*n-(.66-1)*r,i],j).map(function(t){let r=.8359375+18.8515625*(0,o.kR)(t/1e4,P),n=1+18.6875*(0,o.kR)(t/1e4,P);return(0,o.kR)(r/n,U)}),[a,l,u]=(0,E.R)(s,G);return[.43999999999999995*a/(1+-.56*a)-16295499532821565e-27,l,u]},toBase(t){let[r,n,i]=t,s=(0,E.R)([(r+16295499532821565e-27)/(.43999999999999995- -.56*(r+16295499532821565e-27)),n,i],H).map(function(t){let r=.8359375-(0,o.kR)(t,$),n=18.6875*(0,o.kR)(t,$)-18.8515625;return 1e4*(0,o.kR)(r/n,z)}),[a,l,u]=(0,E.R)(s,V),h=(a+(1.15-1)*u)/1.15;return[h,(l+(.66-1)*h)/.66,u]},formats:{jzazbz:{coords:["<percentage> | <number>","<number> | <percentage>","<number> | <percentage>"]}}}),W=new i.A({id:"jzczhz",name:"JzCzHz",coords:{jz:{refRange:[0,1],name:"Jz"},cz:{refRange:[0,.26],name:"Chroma"},hz:{refRange:[0,360],type:"angle",name:"Hue"}},base:q,fromBase:y.fromBase,toBase:y.toBase,formats:{jzczhz:{coords:["<percentage> | <number>","<number> | <percentage>","<number> | <angle>"]}}}),Z=2413/128,X=2610/16384,Y=2523/32,K=16384/2610,J=32/2523,Q=[[.3592832590121217,.6976051147779502,-.035891593232029],[-.1920808463704993,1.100476797037432,.0753748658519118],[.0070797844607479,.0748396662186362,.8433265453898765]],ee=[[.5,.5,0],[6610/4096,-13613/4096,7003/4096],[17933/4096,-17390/4096,-543/4096]],et=[[.9999999999999998,.0086090370379328,.111029625003026],[.9999999999999998,-.0086090370379328,-.1110296250030259],[.9999999999999998,.5600313357106791,-.3206271749873188]],er=[[2.0701522183894223,-1.3263473389671563,.2066510476294053],[.3647385209748072,.6805660249472273,-.0453045459220347],[-.0497472075358123,-.0492609666966131,1.1880659249923042]],en=new i.A({id:"ictcp",name:"ICTCP",coords:{i:{refRange:[0,1],name:"I"},ct:{refRange:[-.5,.5],name:"CT"},cp:{refRange:[-.5,.5],name:"CP"}},base:R,fromBase:t=>(function(t){let r=t.map(function(t){return((.8359375+Z*(t/1e4)**X)/(1+18.6875*(t/1e4)**X))**Y});return(0,E.R)(r,ee)})((0,E.R)(t,Q)),toBase(t){var r;let n=(r=t,(0,E.R)(r,et).map(function(t){let r=Math.max(t**J-.8359375,0);return 1e4*(r/(Z-18.6875*t**J))**K}));return(0,E.R)(n,er)},formats:{ictcp:{coords:["<percentage> | <number>","<number> | <percentage>","<number> | <percentage>"]}}}),ei=l.FL.D65,es=2*Math.PI,eo=[[.401288,.650173,-.051461],[-.250268,1.204414,.045854],[-.002079,.048952,.953127]],ea=[[1.8620678550872327,-1.0112546305316843,.14918677544445175],[.38752654323613717,.6214474419314753,-.008973985167612518],[-.015841498849333856,-.03412293802851557,1.0499644368778496]],el=[[460,451,288],[460,-891,-261],[460,-220,-6300]],eu={dark:[.8,.525,.8],dim:[.9,.59,.9],average:[1,.69,1]},eh={h:[20.14,90,164.25,237.53,380.14],e:[.8,.7,1,1.2,.8],H:[0,100,200,300,400]},ec=180/Math.PI,ed=Math.PI/180;function ep(t,r){return t.map(t=>{let n=(0,o.kR)(r*Math.abs(t)*.01,.42);return 400*(0,o.pG)(n,t)/(n+27.13)})}function ef(t,r,n,i,s){let a={};a.discounting=s,a.refWhite=t,a.surround=i;let l=t.map(t=>100*t);a.la=r,a.yb=n;let u=l[1],h=(0,E.R)(l,eo),c=eu[a.surround],d=c[0];a.c=c[1],a.nc=c[2];let p=(1/(5*a.la+1))**4;a.fl=p*a.la+.1*(1-p)*(1-p)*Math.cbrt(5*a.la),a.flRoot=a.fl**.25,a.n=a.yb/u,a.z=1.48+Math.sqrt(a.n),a.nbb=.725*a.n**-.2,a.ncb=a.nbb;let f=s?1:Math.max(Math.min(d*(1-1/3.6*Math.exp((-a.la-42)/92)),1),0);a.dRgb=h.map(t=>(0,o.GW)(1,u/t,f)),a.dRgbInv=a.dRgb.map(t=>1/t);let m=ep(h.map((t,r)=>t*a.dRgb[r]),a.fl);return a.aW=a.nbb*(2*m[0]+m[1]+.05*m[2]),a}let em=ef(ei,64/Math.PI*.2,20,"average",!1);function eg(t,r){if(!(void 0!==t.J^void 0!==t.Q))throw Error("Conversion requires one and only one: 'J' or 'Q'");if(!(void 0!==t.C^void 0!==t.M^void 0!==t.s))throw Error("Conversion requires one and only one: 'C', 'M' or 's'");if(!(void 0!==t.h^void 0!==t.H))throw Error("Conversion requires one and only one: 'h' or 'H'");if(0===t.J||0===t.Q)return[0,0,0];let n=0,i=Math.cos(n=void 0!==t.h?g(t.h)*ed:function(t){let r=(t%400+400)%400,n=Math.floor(.01*r);r%=100;let[i,s]=eh.h.slice(n,n+2),[o,a]=eh.e.slice(n,n+2);return g((r*(a*i-o*s)-100*i*a)/(r*(a-o)-100*a))}(t.H)*ed),s=Math.sin(n),a=0;void 0!==t.J?a=.1*(0,o.kR)(t.J,.5):void 0!==t.Q&&(a=.25*r.c*t.Q/((r.aW+4)*r.flRoot));let l=0;
79void 0!==t.C?l=t.C/a:void 0!==t.M?l=t.M/r.flRoot/a:void 0!==t.s&&(l=4e-4*t.s**2*(r.aW+4)/r.c);let u=(0,o.kR)(l*Math.pow(1.64-Math.pow(.29,r.n),-.73),10/9),h=.25*(Math.cos(n+2)+3.8),c=r.aW*(0,o.kR)(a,2/r.c/r.z),d=5e4/13*r.nc*r.ncb*h,p=c/r.nbb,f=23*(p+.305)*(0,o.Ed)(u,23*d+u*(11*i+108*s)),m=function(t,r){let n=100/r*2588.068098016295;return t.map(t=>{let r=Math.abs(t);return(0,o.pG)(n*(0,o.kR)(r/(400-r),2.380952380952381),t)})}((0,E.R)([p,f*i,f*s],el).map(t=>t/1403),r.fl);return(0,E.R)(m.map((t,n)=>t*r.dRgbInv[n]),ea).map(t=>t/100)}function ey(t,r){let n=t.map(t=>100*t),i=ep((0,E.R)(n,eo).map((t,n)=>t*r.dRgb[n]),r.fl),s=i[0]+(-12*i[1]+i[2])/11,a=(i[0]+i[1]-2*i[2])/9,l=(Math.atan2(a,s)%es+es)%es,u=.25*(Math.cos(l+2)+3.8),h=5e4/13*r.nc*r.ncb*(0,o.Ed)(u*Math.sqrt(s**2+a**2),i[0]+i[1]+1.05*i[2]+.305),c=(0,o.kR)(h,.9)*Math.pow(1.64-Math.pow(.29,r.n),.73),d=r.nbb*(2*i[0]+i[1]+.05*i[2]),p=(0,o.kR)(d/r.aW,.5*r.c*r.z),f=100*(0,o.kR)(p,2),m=4/r.c*p*(r.aW+4)*r.flRoot,y=c*p,v=y*r.flRoot,b=g(l*ec),x=function(t){let r=g(t);r<=eh.h[0]&&(r+=360);let n=(0,o.ah)(eh.h,r)-1,[i,s]=eh.h.slice(n,n+2),[a,l]=eh.e.slice(n,n+2),u=eh.H[n],h=(r-i)/a;return u+100*h/(h+(s-r)/l)}(b);return{J:f,C:y,h:b,s:50*(0,o.kR)(r.c*c/(r.aW+4),.5),Q:m,M:v,H:x}}new i.A({id:"cam16-jmh",cssId:"--cam16-jmh",name:"CAM16-JMh",coords:{j:{refRange:[0,100],name:"J"},m:{refRange:[0,105],name:"Colorfulness"},h:{refRange:[0,360],type:"angle",name:"Hue"}},base:u.A,fromBase(t){void 0===this.ε&&(this.ε=Object.values(this.coords)[1].refRange[1]/1e5);let r=ey(t,em),n=Math.abs(r.M)<this.ε;return[r.J,n?0:r.M,n?null:r.h]},toBase:t=>eg({J:t[0],M:t[1],h:t[2]},em)});let ev=l.FL.D65,eb=216/24389,ex=24389/27;function e_(t){return t>8?Math.pow((t+16)/116,3):t/ex}let eA=ef(ev,200/Math.PI*e_(50),100*e_(50),"average",!1),eE=new i.A({id:"hct",name:"HCT",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},c:{refRange:[0,145],name:"Colorfulness"},t:{refRange:[0,100],name:"Tone"}},base:u.A,fromBase(t){void 0===this.ε&&(this.ε=Object.values(this.coords)[1].refRange[1]/1e5);let r=function(t,r){var n;let i=116*((n=t[1])>eb?Math.cbrt(n):(ex*n+16)/116)-16;if(0===i)return[0,0,0];let s=ey(t,eA);return[g(s.h),s.C,i]}(t,0);return r[1]<this.ε&&(r[1]=0,r[0]=null),r},toBase:t=>(function(t,r){let[n,i,s]=t,o=[],a=0;if(0===s)return[0,0,0];let l=e_(s);a=s>0?.00379058511492914*s**2+.608983189401032*s+.9155088574762233:9514440756550361e-21*s**2+.08693057439788597*s-21.928975842194614;let u=0,h=1/0;for(;u<=15;){let t=Math.abs((o=eg({J:a,C:i,h:n},r))[1]-l);if(t<h){if(t<=2e-12)return o;h=t}a-=(o[1]-l)*a/(2*o[1]),u+=1}return eg({J:a,C:i,h:n},r)})(t,eA),formats:{color:{id:"--hct",coords:["<number> | <angle>","<percentage> | <number>","<percentage> | <number>"]}}}),eC=Math.PI/180;function eD(t){t[1]<0&&(t=eE.fromBase(eE.toBase(t)));let r=Math.log(Math.max(1+.0228*t[1]*eA.flRoot,1))/.0228,n=t[0]*eC,i=r*Math.cos(n),s=r*Math.sin(n);return[t[2],i,s]}let ew={deltaE76:function(t,r){return function(t,r,n="lab"){let s=(n=i.A.get(n)).from(t),a=n.from(r);return Math.sqrt(s.reduce((t,r,n)=>{let i=a[n];return(0,o.$I)(r)||(0,o.$I)(i)?t:t+(i-r)**2},0))}(t,r,"lab")},deltaECMC:function(t,r,{l:n=2,c:i=1}={}){[t,r]=(0,s.A)([t,r]);let[a,l,u]=m.from(t),[,h,c]=y.from(m,[a,l,u]),[d,p,f]=m.from(r),g=y.from(m,[d,p,f])[1];h<0&&(h=0),g<0&&(g=0);let v=a-d,b=h-g,x=l-p,_=u-f,A=.511;a>=16&&(A=.040975*a/(1+.01765*a));let E=.0638*h/(1+.0131*h)+.638;(0,o.$I)(c)&&(c=0);let C=Math.pow(h,4),D=Math.sqrt(C/(C+1900)),w=E*(D*(c>=164&&c<=345?.56+Math.abs(.2*Math.cos((c+168)*L)):.36+Math.abs(.4*Math.cos((c+35)*L)))+1-D),S=(v/(n*A))**2;return Math.sqrt(S+=(b/(i*E))**2+(x**2+_**2-b**2)/w**2)},deltaE2000:A,deltaEJz:function(t,r){[t,r]=(0,s.A)([t,r]);let[n,i,a]=W.from(t),[l,u,h]=W.from(r);(0,o.$I)(a)&&(0,o.$I)(h)?(a=0,h=0):(0,o.$I)(a)?a=h:(0,o.$I)(h)&&(h=a);let c=2*Math.sqrt(i*u)*Math.sin((a-h)/2*(Math.PI/180));return Math.sqrt((n-l)**2+(i-u)**2+c**2)},deltaEITP:function(t,r){[t,r]=(0,s.A)([t,r]);let[n,i,o]=en.from(t),[a,l,u]=en.from(r);return 720*Math.sqrt((n-a)**2+.25*(i-l)**2+(o-u)**2)},deltaEOK:T,deltaEOK2:function(t,r){[t,r]=(0,s.A)([t,r]);let[n,i,o]=F.from(t),[a,l,u]=F.from(r);return Math.sqrt((n-a)**2+(2*(i-l))**2+(2*(o-u))**2)},deltaEHCT:function(t,r){[t,r]=(0,s.A)([t,r]);let[n,i,o]=eD(eE.from(t)),[a,l,u]=eD(eE.from(r));return Math.sqrt((n-a)**2+(i-l)**2+(o-u)**2)}},eS={hct:{method:"hct.c",jnd:2,deltaEMethod:"hct",blackWhiteClamp:{}},"hct-tonal":{method:"hct.c",jnd:0,deltaEMethod:"hct",blackWhiteClamp:{channel:"hct.t",min:0,max:100}}};
79function eF(t,{method:r=a.A.gamut_mapping,space:n,deltaEMethod:u="",jnd:h=2,blackWhiteClamp:c}={}){let d;if(t=(0,s.A)(t),o.Kg(arguments[1])?n=arguments[1]:n||(n=t.space),N(t,n=i.A.get(n),{epsilon:0}))return t;if("css"===r)d=function(t,{space:r}={}){t=(0,s.A)(t),r||(r=t.space),r=i.A.get(r);let n=i.A.get("oklch");if(r.isUnbounded)return eN(t,r);let a=eN(t,n),l=a.coords[0];if(l>=1){let n=eN(eT.WHITE,r);return n.alpha=t.alpha,eN(n,r)}if(l<=0){let n=eN(eT.BLACK,r);return n.alpha=t.alpha,eN(n,r)}if(N(a,r,{epsilon:0}))return eN(a,r);function u(t){let n=eN(t,r),i=Object.values(r.coords);return n.coords=n.coords.map((t,r)=>{if("range"in i[r]){let[n,s]=i[r].range;return o.qE(n,t,s)}return t}),n}let h=0,c=a.coords[1],d=!0,p=B(a),f=u(p),m=T(f,p);if(m<.02)return f;for(;c-h>1e-4;){let t=(h+c)/2;if(p.coords[1]=t,d&&N(p,r,{epsilon:0}))h=t;else if((m=T(f=u(p),p))<.02)if(.02-m<1e-4)break;else d=!1,h=t;else c=t}return f}(t,{space:n});else{if("clip"===r||N(t,n))d=eN(t,n);else{Object.prototype.hasOwnProperty.call(eS,r)&&({method:r,jnd:h,deltaEMethod:u,blackWhiteClamp:c}=eS[r]);let s=A;if(""!==u){for(let t in ew)if("deltae"+u.toLowerCase()===t.toLowerCase()){s=ew[t];break}}0===h&&(h=1e-16);let a=eF(eN(t,n),{method:"clip",space:n});if(s(t,a)>h){if(c&&3===Object.keys(c).length){let r=i.A.resolveCoord(c.channel),n=O(eN(t,r.space),r.id);if(o.$I(n)&&(n=0),n>=c.max)return eN({space:"xyz-d65",coords:l.FL.D65},t.space);if(n<=c.min)return eN({space:"xyz-d65",coords:[0,0,0]},t.space)}let a=i.A.resolveCoord(r),u=a.space,p=a.id,f=eN(t,u);f.coords.forEach((t,r)=>{o.$I(t)&&(f.coords[r]=0)});let m=(a.range||a.refRange)[0],g=function(t){let r=t?Math.floor(Math.log10(Math.abs(t))):0;return Math.max(parseFloat(`1e${r-2}`),1e-6)}(h),y=m,v=O(f,p);for(;v-y>g;){let t=B(f);s(f,t=eF(t,{space:n,method:"clip"}))-h<g?y=O(f,p):v=O(f,p),M(f,p,(y+v)/2)}d=eN(f,n)}else d=a}if("clip"===r||!N(d,n,{epsilon:0})){let t=Object.values(n.coords).map(t=>t.range||[]);d.coords=d.coords.map((r,n)=>{let[i,s]=t[n];return void 0!==i&&(r=Math.max(i,r)),void 0!==s&&(r=Math.min(r,s)),r})}}return n!==t.space&&(d=eN(d,t.space)),t.coords=d.coords,t}eF.returns="color";let eT={WHITE:{space:F,coords:[1,0,0],alpha:1},BLACK:{space:F,coords:[0,0,0],alpha:1}};function eN(t,r,{inGamut:n}={}){t=(0,s.A)(t);let o=(r=i.A.get(r)).from(t),a={space:r,coords:o,alpha:t.alpha};return n&&(a=eF(a,!0===n?void 0:n)),a}eN.returns="color";var eI=n(52497);function eO(t){return O(t,[u.A,"y"])}function ek(t,r){t=(0,s.A)(t),r=(0,s.A)(r);let n=Math.max(eO(t),0),i=Math.max(eO(r),0);return i>n&&([n,i]=[i,n]),(n+.05)/(i+.05)}function eM(t){return t>=.022?t:t+(.022-t)**1.414}function eB(t){let r=Math.abs(t);return(t<0?-1:1)*Math.pow(r,2.4)}function eL(t,r){let n,i,a,l;r=(0,s.A)(r),t=(0,s.A)(t),r=eN(r,"srgb"),[i,a,l]=r.coords.map(t=>(0,o.$I)(t)?0:t);let u=.2126729*eB(i)+.7151522*eB(a)+.072175*eB(l);t=eN(t,"srgb"),[i,a,l]=t.coords.map(t=>(0,o.$I)(t)?0:t);let h=.2126729*eB(i)+.7151522*eB(a)+.072175*eB(l),c=eM(u),d=eM(h);return 100*(.1>Math.abs(n=5e-4>Math.abs(d-c)?0:d>c?1.14*(d**.56-c**.57):1.14*(d**.65-c**.62))?0:n>0?n-.027:n+.027)}a.A.interpolationSpace="lab";var eR=n(80841),eP=n(70598);let ez=new eP.A({id:"p3-linear",cssId:"display-p3-linear",name:"Linear P3",white:"D65",toXYZ_M:[[.4865709486482162,.26566769316909306,.1982172852343625],[.2289745640697488,.6917385218365064,.079286914093745],[0,.04511338185890264,1.043944368900976]],fromXYZ_M:[[2.493496911941425,-.9313836179191239,-.40271078445071684],[-.8294889695615747,1.7626640603183463,.023624685841943577],[.03584583024378447,-.07617238926804182,.9568845240076872]]}),eU=new eP.A({id:"p3",cssId:"display-p3",name:"P3",base:ez,fromBase:eR.A.fromBase,toBase:eR.A.toBase}),e$=new i.A({id:"hsl",name:"HSL",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},s:{range:[0,100],name:"Saturation"},l:{range:[0,100],name:"Lightness"}},base:eR.A,fromBase:t=>{let r=Math.max(...t),n=Math.min(...t),[i,s,o]=t,[a,l,u]=[null,0,(n+r)/2],h=r-n;if(0!==h){switch(l=0===u||1===u?0:(r-u)/Math.min(u,1-u),r){case i:a=(s-o)/h+6*(s<o);break;case s:a=(o-i)/h+2;break;case o:a=(i-s)/h+4}a*=60}return l<0&&(a+=180,l=Math.abs(l)),a>=360&&(a-=360),[a,100*l,100*u]},toBase:t=>{let[r,n,i]=t;function s(t){let s=(t+r/30)%12,o=n*Math.min(i,1-i);
79return i-o*Math.max(-1,Math.min(s-3,9-s,1))}return(r%=360)<0&&(r+=360),n/=100,i/=100,[s(0),s(8),s(4)]},formats:{hsl:{coords:["<number> | <angle>","<percentage> | <number>","<percentage> | <number>"]},hsla:{coords:["<number> | <angle>","<percentage> | <number>","<percentage> | <number>"],commas:!0,alpha:!0}}}),ej=new i.A({id:"hsv",name:"HSV",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},s:{range:[0,100],name:"Saturation"},v:{range:[0,100],name:"Value"}},base:eR.A,fromBase(t){let r=Math.max(...t),n=Math.min(...t),[i,s,o]=t,[a,l,u]=[null,0,r],h=r-n;if(0!==h){switch(r){case i:a=(s-o)/h+6*(s<o);break;case s:a=(o-i)/h+2;break;case o:a=(i-s)/h+4}a*=60}return u&&(l=h/u),a>=360&&(a-=360),[a,100*l,100*u]},toBase(t){let[r,n,i]=t;function s(t){let s=(t+r/60)%6;return i-i*n*Math.max(0,Math.min(s,4-s,1))}return(r%=360)<0&&(r+=360),n/=100,i/=100,[s(5),s(3),s(1)]},formats:{color:{id:"--hsv",coords:["<number> | <angle>","<percentage> | <number>","<percentage> | <number>"]}}}),eV=new i.A({id:"hwb",name:"HWB",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},w:{range:[0,100],name:"Whiteness"},b:{range:[0,100],name:"Blackness"}},base:ej,fromBase(t){let[r,n,i]=t;return[r,i*(100-n)/100,100-i]},toBase(t){let[r,n,i]=t,s=(n/=100)+(i/=100);if(s>=1)return[r,0,n/s*100];let o=1-i;return[r,100*(0===o?0:1-n/o),100*o]},formats:{hwb:{coords:["<number> | <angle>","<percentage> | <number>","<percentage> | <number>"]}}}),eG=new i.A({id:"oklch",name:"OkLCh",coords:{l:{refRange:[0,1],name:"Lightness"},c:{refRange:[0,.4],name:"Chroma"},h:{refRange:[0,360],type:"angle",name:"Hue"}},white:"D65",base:F,fromBase:y.fromBase,toBase:y.toBase,formats:{oklch:{coords:["<percentage> | <number>","<number> | <percentage>","<number> | <angle>"]}}});var eH=n(17035);let eq=(t,r,n,i,s,o)=>{let a=(t-r)/(n-r)*(s-i)+i;return o&&(a=Math.min(a=Math.max(a,Math.min(i,s)),Math.max(i,s))),a},eW=t=>{let r=(~~(255*t)).toString(16);return r.length<2?"0"+r:r},eZ=new Map;class eX{static colorMap={};static #g={};static #y={};static addColorMode(t,r){i.A.register(r),eX.colorMap[t]=r.id,eX.#g[t]=Object.values(r.coords).reduce((t,r)=>(t.push(r.refRange||r.range),t),[]),eX.#g[t].push([0,1]),eX.#y[t]=r.fromGray}constructor(t,r,n,{clamp:i=!1}={}){if(this._cachedMode=r||eK,t instanceof eX){let n=r?eX.colorMap[r]:eX.colorMap[t.mode];this._initialize=()=>{this._cachedColor=eN(t._color,n),this._cachedMode=n}}else if("object"!=typeof t||Array.isArray(t)||null===t)if("string"==typeof t[0])this._defaultStringValue=t[0],this._initialize=()=>{try{this._cachedColor=(0,eI.Ay)(t[0]);let[r]=Object.entries(eX.colorMap).find(([t,r])=>r===this._cachedColor.spaceId);this._cachedMode=r,this._cachedColor=eN(this._cachedColor,this._cachedColor.spaceId)}catch(t){throw Error("Invalid color string")}};else{let r;if(n)if(4===t.length)r=eX.mapColorRange(t,this._cachedMode,n,i);else if(3===t.length)(r=eX.mapColorRange([t[0],t[1],t[2]],this._cachedMode,n,i)).push(1);else if(2===t.length){r=eX.#y[this._cachedMode]?eX.#y[this._cachedMode](t[0],n,i):eX.mapColorRange([t[0],t[0],t[0]],this._cachedMode,n,i);let s=Array.isArray(n[n.length-1])?n[n.length-1]:[0,n[n.length-1]];
79r.push(eq(t[1],s[0],s[1],0,1,i))}else if(1===t.length)(r=eX.#y[this._cachedMode]?eX.#y[this._cachedMode](t[0],n,i):eX.mapColorRange([t[0],t[0],t[0]],this._cachedMode,n,i)).push(1);else throw Error("Invalid color");else r=t;this._cachedMode===eK&&(1===r[3]?this._defaultStringValue="#"+eW(r[0])+eW(r[1])+eW(r[2]):this._defaultStringValue="#"+eW(r[0])+eW(r[1])+eW(r[2])+eW(r[3])),this._initialize=()=>{let t=eX.colorMap[this._cachedMode]||console.error("Invalid color mode"),n={space:t,coords:r.slice(0,3),alpha:r[3]};this._cachedColor=eN(n,t)}}else{let n=r?eX.colorMap[r]:t.spaceId;this._initialize=()=>{this._cachedColor=eN(t,n),this._cachedMode=r||Object.entries(eX.colorMap).find(([t,r])=>r===this._cachedColor.spaceId)}}}get mode(){return this._initialize&&(this._initialize(),this._initialize=void 0),this._cachedMode}get _color(){return this._initialize&&(this._initialize(),this._initialize=void 0),this._cachedColor}set _color(t){this._initialize&&(this._initialize(),this._initialize=void 0),this._cachedColor=t}static mapColorRange(t,r,n,i){let s=n.map(t=>Array.isArray(t)?t:[0,t]),o=eX.#g[r];return t.map((t,r)=>eq(t,s[r][0],s[r][1],o[r][0],o[r][1],i))}static unmapColorRange(t,r,n){let i=n.map(t=>Array.isArray(t)?t:[0,t]),s=eX.#g[r];return t.map((t,r)=>eq(t,s[r][0],s[r][1],i[r][0],i[r][1]))}#v(t){return new eX(this._color,t)}get _array(){return this._getRGBA()}array(){return this._array}lerp(t,r,n){let l=-1;for(;(l+1<this._color.space.path.length||l+1<t._color.space.path.length)&&this._color.space.path[l+1]===t._color.space.path[l+1];)l+=1;if(-1===l)throw Error("Cannot lerp colors. No common color space found");return new eX((function t(r,n,l={}){var u;if(u=r,"function"===(0,o.NW)(u)&&u.rangeArgs){let[i,s]=[r,n];return t(...i.rangeArgs.colors,{...i.rangeArgs.options,...s})}let{space:h,outputSpace:c,progression:d,premultiplied:p}=l;r=(0,s.A)(r),n=(0,s.A)(n),r=B(r),n=B(n);let f={colors:[r,n],options:l};if(h=h?i.A.get(h):i.A.registry[a.A.interpolationSpace]||r.space,c=c?i.A.get(c):h,r=eN(r,h),n=eN(n,h),r=eF(r),n=eF(n),h.coords.h&&"angle"===h.coords.h.type){let t=l.hue=l.hue||"shorter",i=[h,"h"],[s,a]=[O(r,i),O(n,i)];(0,o.$I)(s)&&!(0,o.$I)(a)?s=a:(0,o.$I)(a)&&!(0,o.$I)(s)&&(a=s),[s,a]=function(t,r){let[n,i]=r,s=o.$I(n),a=o.$I(i);if(s&&a)return[n,i];if(s?n=i:a&&(i=n),"raw"===t)return r;n=g(n);let l=(i=g(i))-n;return"increasing"===t?l<0&&(i+=360):"decreasing"===t?l>0&&(n+=360):"longer"===t?-180<l&&l<180&&(l>0?n+=360:i+=360):"shorter"===t&&(l>180?n+=360:l<-180&&(i+=360)),[n,i]}(t,[s,a]),M(r,i,s),M(n,i,a)}return p&&(r.coords=r.coords.map(t=>t*r.alpha),n.coords=n.coords.map(t=>t*n.alpha)),Object.assign(t=>{t=d?d(t):t;let i=r.coords.map((r,i)=>{let s=n.coords[i];return(0,o.GW)(r,s,t)}),s=(0,o.GW)(r.alpha,n.alpha,t),a={space:h,coords:i,alpha:s};return p&&(a.coords=a.coords.map(t=>t/s)),c!==h&&(a=eN(a,c)),a},{rangeArgs:f})})(this._color,t._color,{space:this._color.space.path[l].id})(r),n||this.mode)}toString(t){if(void 0===t&&void 0!==this._defaultStringValue)return this._defaultStringValue;let r=t;"#rrggbb"===t&&(r="hex");let n=`${this._color.space.id}-${this._color.coords.join(",")}-${this._color.alpha}-${t}`,l=eZ.get(n);if(!l){if(l=function(t,r={}){let n,{precision:l=a.A.precision,format:u,inGamut:h=!0,coords:c,alpha:d,commas:p}=r,f=(0,s.A)(t),m=u,g=f.parseMeta;g&&!u&&(g.format.canSerialize()&&(u=g.format,m=g.formatId),c??=g.types,d??=g.alphaType,p??=g.commas),m&&(u=f.space.getFormat(u)??i.A.findFormat(m)),u||(m=(u=f.space.getFormat("default")??i.A.DEFAULT_FORMAT).name),u&&u.space&&u.space!==f.space&&(f=eN(f,u.space));let y=f.coords.slice();if((h||=u.toGamut)&&!N(f)&&(y=eF(B(f),!0===h?void 0:h).coords),"custom"===u.type)if(u.serialize)n=u.serialize(y,f.alpha,r);else throw TypeError(`format ${m} can only be used to parse colors, not for serialization`);else{let t=u.name||"color",r=u.serializeCoords(y,l,c);if("color"===t){let t=u.id||u.ids?.[0]||f.space.cssId||f.space.id;r.unshift(t)}let i=f.alpha;void 0!==d&&"object"!=typeof d&&(d="string"==typeof d?{type:d}:{include:d});let s=d?.type??"<number>",a=d?.include===!0||!0===u.alpha||d?.include!==!1&&!1!==u.alpha&&i<1,h="";if(p??=u.commas,a){if(null!==l){let t;"<percentage>"===s&&(t="%",i*=100),i=o.g1(i,{precision:l,unit:t})}h=`${p?",":" /"} ${i}`}n=`${t}(${r.join(p?", ":" ")}${h})`}return n}(this._color,{format:r}),"#rrggbb"===t){if(4===(l=String(l)).length){let t=l[1],r=l[2],n=l[3];l=`#${t}${t}${r}${r}${n}${n}`}l.length>7&&(l=l.slice(0,7)),l=l.toLowerCase()}eZ.size>1e3&&eZ.delete(eZ.keys().next().value),eZ.set(n,l)}return l}contrast(t,r="WCAG21"){if("all"!==r){let n,i;switch(r){case"WCAG21":n=ek(this._color,t._color),i=4.5;break;case"APCA":n=Math.abs(eL(this._color,t._color)),i=75;break;default:return null}return n>=i}{let r=ek(this._color,t._color),n=eL(this._color,t._color);return{WCAG21:{value:r,passedMinimum:r>=4.5,passedAAA:r>=7},APCA:{value:n,passedMinimum:Math.abs(n)>=75}}}}setRed(t,r=[0,1]){this._defaultStringValue=void 0,Array.isArray(r)||(r=[0,r]);let n=eX.#g[eK][0],i=eq(t,r[0],r[1],n[0],n[1]);if(this.mode===eK||this.mode===eJ)this._color.coords[0]=i;else{let t=this._color.space.id,r=eN(this._color,"srgb");r.coords[0]=i,this._color=eN(r,t)}}setGreen(t,r=[0,1]){this._defaultStringValue=void 0,Array.isArray(r)||(r=[0,r]);let n=eX.#g[eK][1],i=eq(t,r[0],r[1],n[0],n[1]);if(this.mode===eK||this.mode===eJ)this._color.coords[1]=i;else{let t=this._color.space.id,r=eN(this._color,"srgb");r.coords[1]=i,this._color=eN(r,t)}}setBlue(t,r=[0,1]){this._defaultStringValue=void 0,Array.isArray(r)||(r=[0,r]);let n=eX.#g[eK][2],i=eq(t,r[0],r[1],n[0],n[1]);if(this.mode===eK||this.mode===eJ)this._color.coords[2]=i;else{let t=this._color.space.id,r=eN(this._color,"srgb");r.coords[2]=i,this._color=eN(r,t)}}setAlpha(t,r=[0,1]){this._defaultStringValue=void 0,Array.isArray(r)||(r=[0,r]);let n=eX.#g[this.mode][3],i=eq(t,r[0],r[1],n[0],n[1]);this._color.alpha=i}_getRGBA(t=[1,1,1,1]){let r=eX.#g[eK],n=structuredClone(eN(this._color,"srgb").coords);n.push(this._color.alpha);let i=t.map(t=>Array.isArray(t)?t:[0,t]);return n.map((t,n)=>eq(t,r[n][0],r[n][1],i[n][0],i[n][1]))}_getMode(){return this.mode}_getRed(t=[0,1]){if(Array.isArray(t)||(t=[0,t]),this.mode===eK||this.mode===eJ){let r=eX.#g[this.mode][0];return eq(this._color.coords[0],r[0],r[1],t[0],t[1])}{let r=eX.#g[eK][0];return eq(eN(this._color,"srgb").coords[0],r[0],r[1],t[0],t[1])}}_getGreen(t=[0,1]){if(Array.isArray(t)||(t=[0,t]),this.mode===eK||this.mode===eJ){let r=eX.#g[this.mode][1];return eq(this._color.coords[1],r[0],r[1],t[0],t[1])}{let r=eX.#g[eK][1];return eq(eN(this._color,"srgb").coords[1],r[0],r[1],t[0],t[1])}}_getBlue(t=[0,1]){if(Array.isArray(t)||(t=[0,t]),this.mode===eK||this.mode===eJ){let r=eX.#g[this.mode][2];return eq(this._color.coords[2],r[0],r[1],t[0],t[1])}{let r=eX.#g[eK][2];return eq(eN(this._color,"srgb").coords[2],r[0],r[1],t[0],t[1])}}_getAlpha(t=[0,1]){Array.isArray(t)||(t=[0,t]);let r=eX.#g[this.mode][3];return eq(this._color.alpha,r[0],r[1],t[0],t[1])}_getHue(t=[0,360]){if(Array.isArray(t)||(t=[0,t]),this.mode===eQ||this.mode===e0){let r=eX.#g[this.mode][0];return eq(this._color.coords[0],r[0],r[1],t[0],t[1])}{let r=eX.#g[e0][0];return eq(eN(this._color,"hsl").coords[0],r[0],r[1],t[0],t[1])}}_getSaturation(t=[0,100]){if(Array.isArray(t)||(t=[0,t]),this.mode===eQ||this.mode===e0){let r=eX.#g[this.mode][1];return eq(this._color.coords[1],r[0],r[1],t[0],t[1])}{let r=eX.#g[e0][1];return eq(eN(this._color,"hsl").coords[1],r[0],r[1],t[0],t[1])}}_getBrightness(t=[0,100]){if(Array.isArray(t)||(t=[0,t]),this.mode===eQ){let r=eX.#g[this.mode][2];return eq(this._color.coords[2],r[0],r[1],t[0],t[1])}{let r=eX.#g[eQ][2];return eq(eN(this._color,"hsb").coords[2],r[0],r[1],t[0],t[1])}}_getLightness(t=[0,100]){if(Array.isArray(t)||(t=[0,t]),this.mode===e0){let r=eX.#g[this.mode][2];return eq(this._color.coords[2],r[0],r[1],t[0],t[1])}{let r=eX.#g[e0][2];return eq(eN(this._color,"hsl").coords[2],r[0],r[1],t[0],t[1])}}}function eY(t,r,n){t.Color=eX,eR.A.fromGray=eU.fromGray=function(t,r,n){let i=r.map(t=>Array.isArray(t)?t:[0,t]),s=eq(t,i[2][0],i[2][1],0,1,n);return[s,s,s]},eH.A.fromGray=e$.fromGray=function(t,r,n){let i=r.map(t=>Array.isArray(t)?t:[0,t]);return[0,0,eq(t,i[2][0],i[2][1],0,100,n)]},eV.fromGray=function(t,r,n){let i,s,o=r.map(t=>Array.isArray(t)?t:[0,t]),a=eq(t,0,Math.abs(o[1][0]-o[1][1])/2+Math.abs(o[2][0]-o[2][1])/2,0,100);return a<50?(s=a,i=100-a):a>=50&&(i=a,s=100-a),[0,i,s]},m.fromGray=y.fromGray=F.fromGray=eG.fromGray=function(t,r,n){let i=r.map(t=>Array.isArray(t)?t:[0,t]);return[eq(t,i[0][0],i[0][1],0,100,n),0,0]},t.Color.addColorMode(eK,eR.A),t.Color.addColorMode(eJ,eU),t.Color.addColorMode(eQ,eH.A),t.Color.addColorMode(e0,e$),t.Color.addColorMode(e1,eV),t.Color.addColorMode(e2,m),t.Color.addColorMode(e5,y),t.Color.addColorMode(e3,F),t.Color.addColorMode(e4,eG),n.presetup=function(){let r=this,n=["Red","Green","Blue","Alpha"];for(let i in n){let s=n[i],o=t.Color.prototype["set"+s];t.Color.prototype["set"+s]=function(t,n){return n=n||r?._renderer?.states?.colorMaxes?.[eK][i],o.call(this,t,n)}}function i(n,i){let s=t.Color.prototype["_get"+n];t.Color.prototype["_get"+n]=function(t){if(Object.keys(i).includes(this.mode))t=t||r?._renderer?.states?.colorMaxes?.[this.mode][i[this.mode]];else{let n=Object.keys(i)[0];t=t||r?._renderer?.states?.colorMaxes?.[n][i[n]]}return s.call(this,t)}}i("Red",{[eK]:0,[eJ]:0}),i("Green",{[eK]:1,[eJ]:1}),i("Blue",{[eK]:2,[eJ]:2}),i("Alpha",{[eK]:3,[eJ]:3,[eQ]:3,[e0]:3,[e1]:3,[e2]:3,[e5]:3,[e3]:3,[e4]:3}),i("Hue",{[e0]:0,[eQ]:0,[e1]:0,[e5]:2,[e4]:2}),i("Saturation",{[e0]:1,[eQ]:1}),i("Brightness",{[eQ]:2}),i("Lightness",{[e0]:2})}}
79"undefined"!=typeof p5&&eY(p5,p5.prototype);let eK="rgb",eJ="rgbhdr",eQ="hsb",e0="hsl",e1="hwb",e2="lab",e5="lch",e3="oklab",e4="oklch",e8="rgba";function e6(t,r){r.RGB=eK,r.RGBHDR=eJ,r.HSB=eQ,r.HSL=e0,r.HWB=e1,r.LAB=e2,r.LCH=e5,r.OKLAB=e3,r.OKLCH=e4,r.RGBA=e8,t.Renderer.states.colorMode=eK,t.Renderer.states.colorMaxes={[eK]:[255,255,255,255],[eJ]:[255,255,255,255],[eQ]:[360,100,100,1],[e0]:[360,100,100,1],[e1]:[360,100,100,1],[e2]:[100,[-125,125],[-125,125],1],[e5]:[100,150,360,1],[e3]:[100,[-125,125],[-125,125],1],[e4]:[100,150,360,1],clone:function(){let t={...this};for(let r in t)t[r]instanceof Array&&(t[r]=[...t[r]]);return t}},r.color=function(...t){return t[0]instanceof eX?t[0]:new eX(Array.isArray(t[0])?t[0]:t,this._renderer.states.colorMode,this._renderer.states.colorMaxes[this._renderer.states.colorMode],{clamp:!0})},r.red=function(t){return this.color(t)._getRed()},r.green=function(t){return this.color(t)._getGreen()},r.blue=function(t){return this.color(t)._getBlue()},r.alpha=function(t){return this.color(t)._getAlpha()},r.hue=function(t){let r=e0,n=0;return this._renderer.states.colorMode===eQ||this._renderer.states.colorMode===e0?r=this._renderer.states.colorMode:(this._renderer.states.colorMode===e5||this._renderer.states.colorMode===e4)&&(r=this._renderer.states.colorMode,n=2),this.color(t)._getHue(this._renderer.states.colorMaxes[r][n])},r.saturation=function(t){let r=this._renderer.states.colorMode===eQ?eQ:e0;return this.color(t)._getSaturation(this._renderer.states.colorMaxes[r][1])},r.brightness=function(t){return this.color(t)._getBrightness(this._renderer.states.colorMaxes.hsb[2])},r.lightness=function(t){return this.color(t)._getLightness(this._renderer.states.colorMaxes.hsl[2])},r.lerpColor=function(t,r,n){return t.lerp(r,n,this._renderer.states.colorMode)},r.paletteLerp=function(t,r){let n=t[0];if(r<n[1])return this.color(n[0]);for(let n=1;n<t.length;n++){let i=t[n];if(r<i[1]){let s=t[n-1];return this.lerpColor(this.color(s[0]),this.color(i[0]),(r-s[1])/(i[1]-s[1]))}}return this.color(t[t.length-1][0])}}"undefined"!=typeof p5&&e6(p5,p5.prototype)},45953:(t,r,n)=>{"use strict";function i(t,r,n=t=>t){let s=Object.create(null);if(s.options=r||{},s.reviver=n,s.value="",s.entry=[],s.output=[],s.col=1,s.row=1,s.options.delimiter=void 0===s.options.delimiter?'"':r.delimiter,s.options.delimiter.length>1||0===s.options.delimiter.length)throw Error(`CSVError: delimiter must be one character [${s.options.separator}]`);if(s.options.separator=void 0===s.options.separator?",":r.separator,s.options.separator.length>1||0===s.options.separator.length)throw Error(`CSVError: separator must be one character [${s.options.separator}]`);let u=RegExp(`${l(s.options.delimiter)}|${l(s.options.separator)}|\r
80|
81|\r|[^${l(s.options.delimiter)}${l(s.options.separator)}\r
82]+`,"y"),h=/^(\r\n|\n|\r)$/,c=[],d="",p=0;for(;null!==(c=u.exec(t));)switch(d=c[0],p){case 0:switch(!0){case d===s.options.delimiter:p=3;break;case d===s.options.separator:p=0,o(s);break;case h.test(d):p=0,o(s),a(s);break;default:s.value+=d,p=2}break;case 2:switch(!0){case d===s.options.separator:p=0,o(s);break;case h.test(d):p=0,o(s),a(s);break;default:throw p=4,Error(`CSVError: Illegal state [row:${s.row}, col:${s.col}]`)}break;case 3:!0==(d===s.options.delimiter)?p=4:(p=3,s.value+=d);break;case 4:switch(!0){case d===s.options.delimiter:p=3,s.value+=d;break;case d===s.options.separator:p=0,o(s);break;case h.test(d):p=0,o(s),a(s);break;default:throw Error(`CSVError: Illegal state [row:${s.row}, col:${s.col}]`)}}return 0!==s.entry.length&&(o(s),a(s)),s.output}function s(t,r={},n=t=>t){let i=Object.create(null);if(i.options=r,i.options.eof=void 0===i.options.eof||i.options.eof,i.row=1,i.col=1,i.output="",i.options.delimiter=void 0===i.options.delimiter?'"':r.delimiter,i.options.delimiter.length>1||0===i.options.delimiter.length)throw Error(`CSVError: delimiter must be one character [${i.options.separator}]`);if(i.options.separator=void 0===i.options.separator?",":r.separator,i.options.separator.length>1||0===i.options.separator.length)throw Error(`CSVError: separator must be one character [${i.options.separator}]`);let o=RegExp(`${l(i.options.delimiter)}|${l(i.options.separator)}|\r
83|
84|\r`);return t.forEach((r,s)=>{let a="";switch(i.col=1,r.forEach((t,s)=>{"string"==typeof t&&(t=t.replace(RegExp(i.options.delimiter,"g"),`${i.options.delimiter}${i.options.delimiter}`),t=o.test(t)?`${i.options.delimiter}${t}${i.options.delimiter}`:t),a+=n(t,i.row,i.col),s!==r.length-1&&(a+=i.options.separator),i.col++}),!0){case i.options.eof:case!i.options.eof&&s!==t.length-1:i.output+=`${a}
85`;break;default:i.output+=`${a}`}i.row++}),i.output}function o(t){let r=t.options.typed?function(t){switch(!0){case"true"===t:case"false"===t:return"true"===t;case/.\./.test(t):return parseFloat(t);case isFinite(t):return parseInt(t);default:return t}}(t.value):t.value;t.entry.push(t.reviver(r,t.row,t.col)),t.value="",t.col++}function a(t){t.output.push(t.entry),t.entry=[],t.row++,t.col=1}function l(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}n.d(r,{A:()=>s,q:()=>i})},46556:(t,r,n)=>{"use strict";n.d(r,{A:()=>i});let i=(0,n(64454).A)("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]])},47689:(t,r,n)=>{"use strict";n.d(r,{A:()=>s});var i=n(58905);function s(t,r){r.ellipseMode=function(t){return(t===i.p||t===i.t||t===i.u||t===i.v)&&this._renderer.states.setValue("ellipseMode",t),this},r.noSmooth=function(){return this._renderer.isP3D?this.setAttributes("antialias",!1):"imageSmoothingEnabled"in this.drawingContext&&(this.drawingContext.
85imageSmoothingEnabled=!1),this},r.rectMode=function(t){return(t===i.p||t===i.t||t===i.u||t===i.v)&&this._renderer.states.setValue("rectMode",t),this},r.smooth=function(){return this._renderer.isP3D?this.setAttributes("antialias",!0):"imageSmoothingEnabled"in this.drawingContext&&(this.drawingContext.imageSmoothingEnabled=!0),this},r.strokeCap=function(t){return(t===i.w||t===i.x||t===i.y)&&this._renderer.strokeCap(t),this},r.strokeJoin=function(t){return(t===i.w||t===i.z||t===i.I)&&this._renderer.strokeJoin(t),this},r.strokeWeight=function(t){return this._renderer.strokeWeight(t),this}}"undefined"!=typeof p5&&s(p5,p5.prototype)},49570:(t,r,n)=>{"use strict";n.d(r,{A:()=>o,M:()=>s});let i=Object.getPrototypeOf(Uint8Array);class s{constructor(t,r,n,i={}){this._renderer=t,this._vertSrc=r,this._fragSrc=n,this._vertShader=-1,this._fragShader=-1,this._glProgram=0,this._loadedAttributes=!1,this.attributes={},this._loadedUniforms=!1,this.uniforms={},this._bound=!1,this.samplers=[],this.hooks={uniforms:i.uniforms||{},declarations:i.declarations,varyingVariables:i.varyingVariables||[],helpers:i.helpers||{},vertex:i.vertex||{},fragment:i.fragment||{},hookAliases:i.hookAliases||{},modified:{vertex:i.modified&&i.modified.vertex||{},fragment:i.modified&&i.modified.fragment||{}}}}hookTypes(t){return this._renderer.getShaderHookTypes(this,t)}shaderSrc(t,r){return this._renderer.populateHooks(this,t,r)}version(){let t=/#version (.+)$/.exec(this.vertSrc());return t?t[1]:"100 es"}vertSrc(){return this.shaderSrc(this._vertSrc,"vertex")}fragSrc(){return this.shaderSrc(this._fragSrc,"fragment")}inspectHooks(){for(let t in console.log("==== Vertex shader hooks: ===="),this.hooks.vertex)console.log((this.hooks.modified.vertex[t]?"[MODIFIED] ":"")+t+this.hooks.vertex[t]);for(let t in console.log(""),console.log("==== Fragment shader hooks: ===="),this.hooks.fragment)console.log((this.hooks.modified.fragment[t]?"[MODIFIED] ":"")+t+this.hooks.fragment[t]);for(let t in console.log(""),console.log("==== Helper functions: ===="),this.hooks.helpers)console.log(t+this.hooks.helpers[t])}modify(t){let r={vertex:{},fragment:{},helpers:{}};for(let n in t)"declarations"!==n&&"uniforms"!==n&&"varyingVariables"!==n&&("vertexDeclarations"===n?r.vertex.declarations=(r.vertex.declarations||"")+"\n"+t[n]:"fragmentDeclarations"===n?r.fragment.declarations=(r.fragment.declarations||"")+"\n"+t[n]:this.hooks.vertex[n]?r.vertex[n]=t[n]:this.hooks.fragment[n]?r.fragment[n]=t[n]:r.helpers[n]=t[n]);let n=Object.assign({},this.hooks.modified.vertex),i=Object.assign({},this.hooks.modified.fragment);for(let t in r.vertex||{})"declarations"!==t&&(n[t]=!0);for(let t in r.fragment||{})"declarations"!==t&&(i[t]=!0);return new s(this._renderer,this._vertSrc,this._fragSrc,{declarations:(this.hooks.declarations||"")+"\n"+(t.declarations||""),uniforms:Object.assign({},this.hooks.uniforms,t.uniforms||{}),varyingVariables:(t.varyingVariables||[]).concat(this.hooks.varyingVariables||[]),fragment:Object.assign({},this.hooks.fragment,r.fragment||{}),vertex:Object.assign({},this.hooks.vertex,r.vertex||{}),helpers:Object.assign({},this.hooks.helpers,r.helpers||{}),hookAliases:Object.assign({},this.hooks.hookAliases,r.hookAliases||{}),modified:{vertex:n,fragment:i}})}init(){if(!this._initialized){try{this._renderer._initShader(this)}catch(t){throw Error(`Whoops! Something went wrong initializing the shader:
86${t.message||t}`)}this._loadAttributes(),this._loadUniforms(),this._renderer._finalizeShader(this),this._initialized=!0}return this}setDefaultUniforms(){for(let t in this.hooks.uniforms){let r,n=this._renderer.uniformNameFromHookKey(t),i=this.hooks.uniforms[t];null!=(r=i instanceof Function?i():i)&&this.setUniform(n,r)}}copyToContext(t){let r=new s(t._renderer,this._vertSrc,this._fragSrc);return r.ensureCompiledOnContext(t._renderer),r}ensureCompiledOnContext(t){if(0!==this._glProgram&&this._renderer!==t)throw Error("The shader being run is attached to a different context. Do you need to copy it to this context first with .copyToContext()?");0===this._glProgram&&(this._renderer=t?._renderer?.filterRenderer?._renderer||t,this.init())}_loadAttributes(){this._loadedAttributes||(this.attributes=this._renderer._getShaderAttributes(this),this._loadedAttributes=!0)}_loadUniforms(){if(!this._loadedUniforms){for(let t of(this.uniforms={},this.samplers=[],this._renderer.getUniformMetadata(this))){let r={...t,_cachedData:void 0};r.isSampler&&this.samplers.push(r),this.uniforms[r.name]=r}this._loadedUniforms=!0}}bindShader(t,r){if(this.shaderType&&this.shaderType!==t)throw Error(`You've already used this shader as a ${this.shaderType} shader, but are now using it as a ${t}.`);this.shaderType=t,this.init(),this._bound||(this.useProgram(r),this._bound=!0)}unbindShader(){return this._bound&&(this.unbindTextures(),this._bound=!1),this}bindTextures(){let t=this._renderer._getEmptyTexture();for(let r of this.samplers){if(r.noData)continue;let n=r.texture;(void 0===n||n.isFramebufferTexture&&!n.src.framebuffer.antialias&&n.src.framebuffer===this._renderer.activeFramebuffer())&&(r.texture=n=t),this._renderer._updateTexture(r,
86n)}}unbindTextures(){for(let t of this.samplers)t.texture?.isFramebufferTexture&&this._renderer._unbindFramebufferTexture(t)}useProgram(t){return this._renderer._curShader!==this&&(this._renderer._useShader(this),this._renderer._curShader=this),this}setUniform(t,r){this.init();let n=this.uniforms[t];if(n){if(n.isArray)if(n._cachedData&&this._renderer._arraysEqual(n._cachedData,r))return;else n._cachedData=r.slice(0);else if(n._cachedData&&n._cachedData===r)return;else if(Array.isArray(r)||r instanceof i){if(n._cachedData&&this._renderer._arraysEqual(n._cachedData,r))return;n._cachedData=r.slice(0)}else{if(n._cachedData===r)return;n._cachedData=r}this._renderer.updateUniformValue(this,n,r)}}enableAttrib(t,r,n,i,s,o){return t&&("undefined"==typeof IS_MINIFIED&&this.attributes[t.name]!==t&&console.warn(`The attribute "${t.name}"passed to enableAttrib does not belong to this shader.`),-1!==t.location&&this._renderer._enableAttrib(this,t,r,n,i,s,o)),this}}function o(t,r){t.Shader=s}"undefined"!=typeof p5&&o(p5,p5.prototype)},50565:(t,r,n)=>{"use strict";n.d(r,{A:()=>i});let i=new(n(87442)).A({id:"xyz-d65",name:"XYZ D65",coords:{x:{refRange:[0,1],name:"X"},y:{refRange:[0,1],name:"Y"},z:{refRange:[0,1],name:"Z"}},white:"D65",formats:{color:{ids:["xyz-d65","xyz"]}},aliases:["xyz"]})},51032:(t,r,n)=>{"use strict";function i(t,r){r.bezier=function(...t){return(this._renderer.states.strokeColor||this._renderer.states.fillColor)&&this._renderer.bezier(...t),this},r.bezierPoint=function(t,r,n,i,s){let o=1-s;return Math.pow(o,3)*t+3*Math.pow(o,2)*s*r+3*o*Math.pow(s,2)*n+Math.pow(s,3)*i},r.bezierTangent=function(t,r,n,i,s){let o=1-s;return 3*i*Math.pow(s,2)-3*n*Math.pow(s,2)+6*n*o*s-6*r*o*s+3*r*Math.pow(o,2)-3*t*Math.pow(o,2)},r.spline=function(...t){return(this._renderer.states.strokeColor||this._renderer.states.fillColor)&&this._renderer.spline(...t),this},r.splinePoint=function(t,r,n,i,s){let o=this._renderer.states.splineProperties.tightness,a=s*s*s,l=s*s;return t*((o-1)/2*a+(1-o)*l+(o-1)/2*s)+r*((o+3)/2*a+(-5-o)/2*l+1)+n*((-3-o)/2*a+(o+2)*l+(1-o)/2*s)+i*((1-o)/2*a+(o-1)/2*l)},r.splineTangent=function(t,r,n,i,s){let o=this._renderer.states.splineProperties.tightness,a=s*s*3,l=2*s;return t*((o-1)/2*a+(1-o)*l+(o-1)/2)+r*((o+3)/2*a+(-5-o)/2*l)+n*((-3-o)/2*a+(o+2)*l+(1-o)/2)+i*((1-o)/2*a+(o-1)/2*l)}}n.d(r,{A:()=>i}),"undefined"!=typeof p5&&i(p5,p5.prototype)},52497:(t,r,n)=>{"use strict";n.d(r,{Ay:()=>l});var i=n(56062),s=n(39446),o=n(87442),a=n(72672);function l(t,r){let n,l={str:String(t)?.trim(),options:r};if(s.A.run("parse-start",l),l.color)return l.color;l.parsed=function(t){if(!t)return;let r=(t=t.trim()).match(h.function);if(r){let t=[],n=[],i=!1,s=r[1].toLowerCase(),o=r[2].replace(h.singleArgument,(r,o)=>{let a,l,c,{value:d,meta:p}=(a={},l=o.match(h.unitValue)?.[0],c=a.raw=o,l?(a.type="%"===l?"<percentage>":"<angle>",a.unit=l,a.unitless=Number(c.slice(0,-l.length)),c=a.unitless*u[l]):h.number.test(c)?(c=Number(c),a.type="<number>"):"none"===c?c=null:"NaN"===c||"calc(NaN)"===c?(c=NaN,a.type="<number>"):a.type="<ident>",{value:c,meta:a});return(r.startsWith("/")||"color"!==s&&3===t.length)&&(i=!0),t.push(d),n.push(p),""});return{name:s,args:t,argMeta:n,lastAlpha:i,commas:o.includes(","),rawName:r[1],rawArgs:r[2]}}}(l.str);let c=l.options?l.options.parseMeta??l.options.meta:null;if(l.parsed){let r,i,s=l.parsed.name,u=l.parsed.args,h=u.map((t,r)=>l.parsed.argMeta[r]?.type);if("color"===s){let n=u.shift();h.shift();let c=n.startsWith("--")?n.substring(2):`--${n}`,d=[n,c];if(!(r=o.A.findFormat({name:s,id:d,type:"function"}))){let r,i=n in o.A.registry?n:c;if(i in o.A.registry){let s=o.A.registry[i].formats?.color?.id;if(s){let i=t.replace("color("+n,"color("+s);r=`Did you mean ${i}?`}}throw TypeError(`Cannot parse ${l.str}. `+(r??"Missing a plugin?"))}i=r.space,r.id.startsWith("--")&&!n.startsWith("--")&&a.A.warn(`${i.name} is a non-standard space and not currently supported in the CSS spec. Use prefixed color(${r.id}) instead of color(${n}).`),n.startsWith("--")&&!r.id.startsWith("--")&&a.A.warn(`${i.name} is a standard space and supported in the CSS spec. Use color(${r.id}) instead of prefixed color(${n}).`)}else i=(r=o.A.findFormat({name:s,type:"function"})).space;c&&Object.assign(c,{format:r,formatId:r.name,types:h,commas:l.parsed.commas});let d=1;
86l.parsed.lastAlpha&&(d=l.parsed.args.pop(),c&&(c.alphaType=h.pop()));let p=r.coords.length;if(u.length!==p)throw TypeError(`Expected ${p} coordinates for ${i.id} in ${l.str}), got ${u.length}`);u=r.coerceCoords(u,h),n={spaceId:i.id,coords:u,alpha:d}}else t:for(let t of o.A.all)for(let r in t.formats){let i=t.formats[r];if("custom"!==i.type||i.test&&!i.test(l.str))continue;let s=t.getFormat(i),o=s.parse(l.str);if(o){c&&Object.assign(c,{format:s,formatId:r}),n=o;break t}}if(!n)throw TypeError(`Could not parse ${t} as a color. Missing a plugin?`);return n.alpha=(0,i.$I)(n.alpha)?n.alpha:void 0===n.alpha?1:(0,i.qE)(0,n.alpha,1),n}let u={"%":.01,deg:1,grad:.9,rad:180/Math.PI,turn:360},h={function:/^([a-z]+)\(((?:calc\(NaN\)|.)+?)\)$/i,number:/^([-+]?(?:[0-9]*\.)?[0-9]+(e[-+]?[0-9]+)?)$/i,unitValue:RegExp(`(${Object.keys(u).join("|")})$`),singleArgument:/\/?\s*(none|NaN|calc\(NaN\)|[-+\w.]+(?:%|deg|g?rad|turn)?)/g}},54931:t=>{!function(){"use strict";function r(t){if(null==t)return!1;switch(t.type){case"BlockStatement":case"BreakStatement":case"ContinueStatement":case"DebuggerStatement":case"DoWhileStatement":case"EmptyStatement":case"ExpressionStatement":case"ForInStatement":case"ForStatement":case"IfStatement":case"LabeledStatement":case"ReturnStatement":case"SwitchStatement":case"ThrowStatement":case"TryStatement":case"VariableDeclaration":case"WhileStatement":case"WithStatement":return!0}return!1}function n(t){switch(t.type){case"IfStatement":if(null!=t.alternate)return t.alternate;return t.consequent;case"LabeledStatement":case"ForStatement":case"ForInStatement":case"WhileStatement":case"WithStatement":return t.body}return null}t.exports={isExpression:function(t){if(null==t)return!1;switch(t.type){case"ArrayExpression":case"AssignmentExpression":case"BinaryExpression":case"CallExpression":case"ConditionalExpression":case"FunctionExpression":case"Identifier":case"Literal":case"LogicalExpression":case"MemberExpression":case"NewExpression":case"ObjectExpression":case"SequenceExpression":case"ThisExpression":case"UnaryExpression":case"UpdateExpression":return!0}return!1},isStatement:r,isIterationStatement:function(t){if(null==t)return!1;switch(t.type){case"DoWhileStatement":case"ForInStatement":case"ForStatement":case"WhileStatement":return!0}return!1},isSourceElement:function(t){return r(t)||null!=t&&"FunctionDeclaration"===t.type},isProblematicIfStatement:function(t){var r;if("IfStatement"!==t.type||null==t.alternate)return!1;r=t.consequent;do{if("IfStatement"===r.type&&null==r.alternate)return!0;r=n(r)}while(r);return!1},trailingStatement:n}}()},54964:(t,r,n)=>{"use strict";n.d(r,{A:()=>o,k:()=>s});var i=n(39247);n(58905);class s{constructor(t,r,n,s){this.w=t,this.vec=new i.M(r,n,s)}static fromAxisAngle(t,r,n,o){let a=Math.cos(t/2),l=new i.M(r,n,o).normalize().mult(Math.sin(t/2));return new s(a,l.x,l.y,l.z)}conjugate(){return new s(this.w,-this.vec.x,-this.vec.y,-this.vec.z)}multiply(t){return new s(this.w*t.w-this.vec.x*t.vec.x-this.vec.y*t.vec.y-this.vec.z-t.vec.z,this.w*t.vec.x+this.vec.x*t.w+this.vec.y*t.vec.z-this.vec.z*t.vec.y,this.w*t.vec.y-this.vec.x*t.vec.z+this.vec.y*t.w+this.vec.z*t.vec.x,this.w*t.vec.z+this.vec.x*t.vec.y-this.vec.y*t.vec.x+this.vec.z*t.w)}rotateVector(t){return i.M.mult(t,this.w*this.w-this.vec.dot(this.vec)).add(i.M.mult(this.vec,2*t.dot(this.vec))).add(i.M.mult(this.vec,2*this.w).cross(t)).clampToZero()}rotateBy(t){return t.multiply(this).multiply(t.conjugate()).vec.clampToZero()}}function o(t,r){t.Quat=s}"undefined"!=typeof p5&&o(p5,p5.prototype)},56062:(t,r,n)=>{"use strict";function i(t){return"string"===s(t)}function s(t){return(Object.prototype.toString.call(t).match(/^\[object\s+(.*?)\]$/)[1]||"").toLowerCase()}function o(t,{precision:r=16,unit:n}){return a(t)?"none":(t=+l(t,r))+(n??"")}function a(t){return null===t}function l(t,r){if(0===t)return 0;let n=~~t,i=0;n&&r&&(i=~~Math.log10(Math.abs(n))+1);let s=10**(r-i);return Math.floor(t*s+.5)/s}function u(t,r,n){return isNaN(t)?r:isNaN(r)?t:t+(r-t)*n}function h(t,r,n){var i;return!t||!r||t===r||t[0]===r[0]&&t[1]===r[1]||isNaN(n)||null===n?n:u(r[0],r[1],(i=t[0],(n-i)/(t[1]-i)))}function c(t,r,n){return Math.max(Math.min(n,r),t)}function d(t,r){return Math.sign(t)===Math.sign(r)?t:-t}function p(t,r){return d(Math.abs(t)**r,t)}function f(t,r){return 0===r?0:t/r}function m(t,r,n=0,i=t.length){for(;n<i;){let s=n+i>>1;t[s]<r?n=s+1:i=s}return n}function g(t,r){if(t instanceof r)return!0;let n=r.name;for(;t;){let r=Object.getPrototypeOf(t),i=r?.constructor?.name;if(i===n)return!0;
86if(!i||"Object"===i)break;t=r}return!1}n.d(r,{$I:()=>a,Ed:()=>f,GW:()=>u,Kg:()=>i,NW:()=>s,QX:()=>l,Qs:()=>g,_b:()=>h,ah:()=>m,g1:()=>o,kR:()=>p,pG:()=>d,qE:()=>c})},56247:(t,r,n)=>{"use strict";n.d(r,{k:()=>s});var i=n(58905);let s={[i.ab]:3,[i.af]:4,[i.ae]:.5}},56426:(t,r,n)=>{!function(){"use strict";r.ast=n(54931),r.code=n(19892),r.keyword=n(25680)}()},58093:(t,r,n)=>{"use strict";n.d(r,{A:()=>o});var i=n(58905),s=n(95115);function o(t,r){r._normalizeArcAngles=(t,r,n,s,o)=>{let a;return t-=i.q*Math.floor(t/i.q),r-=i.q*Math.floor(r/i.q),a=Math.min(Math.abs(t-r),i.q-Math.abs(t-r)),o&&(t=t<=i.r?Math.atan(n/s*Math.tan(t)):t>i.r&&t<=3*i.r?Math.atan(n/s*Math.tan(t))+i.s:Math.atan(n/s*Math.tan(t))+i.q,r=r<=i.r?Math.atan(n/s*Math.tan(r)):r>i.r&&r<=3*i.r?Math.atan(n/s*Math.tan(r))+i.s:Math.atan(n/s*Math.tan(r))+i.q),t>r&&(r+=i.q),{start:t,stop:r,correspondToSamePoint:a<1e-5}},r.arc=function(t,r,n,i,o,a,l,u){if(!this._renderer.states.strokeColor&&!this._renderer.states.fillColor||o===a)return this;o=this._toRadians(o),a=this._toRadians(a);let h=s.A.modeAdjust(t,r,n,i,this._renderer.states.ellipseMode),c=this._normalizeArcAngles(o,a,h.w,h.h,!0);return c.correspondToSamePoint?this._renderer.ellipse([h.x,h.y,h.w,h.h,u]):(this._renderer.arc(h.x,h.y,h.w,h.h,c.start,c.stop,l,u),(this._accessibleOutputs.grid||this._accessibleOutputs.text)&&this._accsOutput("arc",[h.x,h.y,h.w,h.h,c.start,c.stop,l])),this},r.ellipse=function(t,r,n,i,s){return this._renderEllipse(...arguments)},r.circle=function(...t){let r=t.slice(0,2);return r.push(t[2],t[2]),this._renderEllipse(...r)},r._renderEllipse=function(t,r,n,i,o){if(!this._renderer.states.strokeColor&&!this._renderer.states.fillColor)return this;void 0===i&&(i=n);let a=s.A.modeAdjust(t,r,n,i,this._renderer.states.ellipseMode);return this._renderer.ellipse([a.x,a.y,a.w,a.h,o]),(this._accessibleOutputs.grid||this._accessibleOutputs.text)&&this._accsOutput("ellipse",[a.x,a.y,a.w,a.h]),this},r.line=function(...t){return this._renderer.states.strokeColor&&this._renderer.line(...t),(this._accessibleOutputs.grid||this._accessibleOutputs.text)&&this._accsOutput("line",t),this},r.point=function(...r){return this._renderer.states.strokeColor&&(1===r.length&&r[0]instanceof t.Vector?this._renderer.point.call(this._renderer,r[0].x,r[0].y,r[0].z):(this._renderer.point(...r),(this._accessibleOutputs.grid||this._accessibleOutputs.text)&&this._accsOutput("point",r))),this},r.quad=function(...t){return(this._renderer.states.strokeColor||this._renderer.states.fillColor)&&(this._renderer.isP3D&&t.length<12?this._renderer.quad.call(this._renderer,t[0],t[1],0,t[2],t[3],0,t[4],t[5],0,t[6],t[7],0,t[8],t[9]):(this._renderer.quad(...t),(this._accessibleOutputs.grid||this._accessibleOutputs.text)&&this._accsOutput("quadrilateral",t))),this},r.rect=function(...t){return this._renderRect(...t)},r.square=function(t,r,n,i,s,o,a){return this._renderRect.call(this,t,r,n,n,i,s,o,a)},r._renderRect=function(){if(this._renderer.states.strokeColor||this._renderer.states.fillColor){3==arguments.length&&(arguments[3]=arguments[2]);let t=s.A.modeAdjust(arguments[0],arguments[1],arguments[2],arguments[3],this._renderer.states.rectMode);this._renderer.states.rectMode===i.p&&(t.w=arguments[2],t.h=arguments[3]);let r=[t.x,t.y,t.w,t.h];for(let t=4;t<arguments.length;t++)r[t]=arguments[t];this._renderer.rect(r),(this._accessibleOutputs.grid||this._accessibleOutputs.text)&&this._accsOutput("rectangle",[t.x,t.y,t.w,t.h])}return this},r.triangle=function(...t){return(this._renderer.states.strokeColor||this._renderer.states.fillColor)&&this._renderer.triangle(t),(this._accessibleOutputs.grid||this._accessibleOutputs.text)&&this._accsOutput("triangle",t),this}}"undefined"!=typeof p5&&o(p5,p5.prototype)},58905:(t,r,n)=>{"use strict";n.d(r,{$:()=>R,A:()=>J,B:()=>Y,C:()=>eT,D:()=>Q,E:()=>en,F:()=>e$,G:()=>eB,H:()=>ej,I:()=>Z,J:()=>eV,K:()=>z,L:()=>ee,M:()=>ei,N:()=>eS,O:()=>P,P:()=>o,Q:()=>$,R:()=>eo,S:()=>er,T:()=>B,U:()=>ez,V:()=>U,X:()=>I,Y:()=>O,Z:()=>L,_:()=>M,a:()=>es,a0:()=>eG,a1:()=>eH,a2:()=>ex,a3:()=>eq,a4:()=>X,a5:()=>_,a6:()=>x,a7:()=>eI,a8:()=>eO,a9:()=>D,aA:()=>e_,aB:()=>eP,aC:()=>eR,aD:()=>eE,aE:()=>h,aF:()=>c,aG:()=>ew,aa:()=>l,ab:()=>eb,ac:()=>a,ad:()=>eD,ae:()=>ed,af:()=>eg,ag:()=>ef,ah:()=>ey,ai:()=>ev,aj:()=>em,ak:()=>ep,al:()=>
86eM,am:()=>ek,an:()=>et,ao:()=>ea,ap:()=>el,aq:()=>eu,ar:()=>eh,as:()=>ec,at:()=>V,au:()=>j,av:()=>w,aw:()=>T,ax:()=>N,ay:()=>F,az:()=>s,b:()=>K,c:()=>k,d:()=>eU,e:()=>eN,f:()=>eF,g:()=>eA,h:()=>eC,i:()=>eL,j:()=>u,k:()=>d,l:()=>p,m:()=>f,n:()=>m,o:()=>g,p:()=>A,q:()=>b,r:()=>y,s:()=>v,t:()=>E,u:()=>C,v:()=>S,w:()=>q,x:()=>H,y:()=>G,z:()=>W});let i=Math.PI,s="2.2.3",o="p2d",a="webgl",l="webgl2",u="default",h="simple",c="full",d="crosshair",p="pointer",f="move",m="text",g="wait",y=i/2,v=i,b=2*i,x=i/180,_=180/i,A="corner",E="corners",C="radius",D="right",w="left",S="center",F="top",T="bottom",N="alphabetic",I=0,O=1,k=4,M=6,B=5,L="quads",R="quad_strip",P=7,z=8,U="close",$="open",j="chord",V="pie",G="square",H="butt",q="round",W="bevel",Z="miter",X="auto",Y="source-over",K="destination-out",J="lighter",Q="darken",ee="lighten",et="difference",er="subtract",en="exclusion",ei="multiply",es="screen",eo="copy",ea="overlay",el="hard-light",eu="soft-light",eh="color-dodge",ec="color-burn",ed="threshold",ep="gray",ef="opaque",em="invert",eg="posterize",ey="dilate",ev="erode",eb="blur",ex="normal",e_="WORD",eA="linear",eE="fill",eC="texture",eD="image",ew="linear_mipmap",eS="nearest",eF="repeat",eT="clamp",eN="mirror",eI="flat",eO="smooth",ek="#000000",eM="#FFFFFF",eB="grid",eL="axes",eR="contain",eP="cover",ez="unsigned-byte",eU="unsigned-int",e$="float",ej="half-float",eV=Symbol("include"),eG=Symbol("exclude"),eH=Symbol("join");var eq=Object.freeze({__proto__:null,ADD:J,ALT:"Alt",ARROW:u,AUTO:X,AXES:eL,BACKSPACE:"Backspace",BASELINE:N,BEVEL:W,BEZIER:"bezier",BLEND:Y,BLUR:eb,BOLD:"bold",BOLDITALIC:"bold italic",BOTTOM:T,BURN:ec,CENTER:S,CHAR:"CHAR",CHORD:j,CLAMP:eT,CLOSE:U,CONTAIN:eR,CONTROL:"Control",CORNER:A,CORNERS:E,COVER:eP,CROSS:d,CURVE:"curve",DARKEST:Q,DEG_TO_RAD:x,DELETE:"Delete",DIFFERENCE:et,DILATE:ey,DODGE:eh,DOWN_ARROW:"ArrowDown",EMPTY_PATH:P,ENTER:"Enter",ERODE:ev,ESCAPE:"Escape",EXCLUDE:eG,EXCLUSION:en,FALLBACK:"fallback",FILL:eE,FLAT:eI,FLOAT:e$,FULL:c,GRAY:ep,GRID:eB,HALF_FLOAT:ej,HALF_PI:y,HAND:p,HARD_LIGHT:el,IMAGE:eD,IMMEDIATE:"immediate",INCLUDE:eV,INVERT:em,ITALIC:"italic",JOIN:eH,LABEL:"label",LANDSCAPE:"landscape",LEFT:w,LEFT_ARROW:"ArrowLeft",LIGHTEST:ee,LINEAR:eA,LINEAR_MIPMAP:ew,LINES:O,LINE_LOOP:2,LINE_STRIP:3,MIRROR:eN,MITER:Z,MOVE:f,MULTIPLY:ei,NEAREST:eS,NORMAL:ex,OPAQUE:ef,OPEN:$,OPTION:"Alt",OVERLAY:ea,P2D:o,P2DHDR:"p2d-hdr",PATH:z,PI:v,PIE:V,POINTS:I,PORTRAIT:"portrait",POSTERIZE:eg,PROJECT:G,QUADRATIC:"quadratic",QUADS:L,QUAD_STRIP:R,QUARTER_PI:i/4,RADIUS:C,RAD_TO_DEG:_,REMOVE:K,REPEAT:eF,REPLACE:eo,RETURN:"Enter",RIGHT:D,RIGHT_ARROW:"ArrowRight",ROUND:q,SCREEN:es,SHIFT:"Shift",SIMPLE:h,SMOOTH:eO,SOFT_LIGHT:eu,SQUARE:H,STROKE:"stroke",SUBTRACT:er,TAB:"Tab",TAU:2*i,TESS:"tess",TEXT:m,TEXTURE:eC,THRESHOLD:ed,TOP:F,TRIANGLES:k,TRIANGLE_FAN:M,TRIANGLE_STRIP:B,TWO_PI:b,UNSIGNED_BYTE:ez,UNSIGNED_INT:eU,UP_ARROW:"ArrowUp",VERSION:s,WAIT:g,WEBGL:a,WEBGL2:l,WEBGPU:"webgpu",WORD:e_,_CTX_MIDDLE:"middle",_DEFAULT_FILL:eM,_DEFAULT_LEADMULT:1.25,_DEFAULT_STROKE:ek,_DEFAULT_TEXT_FILL:"#000000"})},59745:(t,r)=>{"use strict";r.T=function(){function t(){}return t.parse=function(r){for(var n=new Set,i=0;i<r.length;i++){var s=r[i];if(!t.REGEXP.test(s))throw TypeError('"'+s+'" is invalid unicode-range.');var o=s.match(t.REGEXP),a=o[1],l=o[2],u=o[3];if(a){if(/\?[^?]+$/.test(a))throw TypeError('"'+s+'" is invalid unicode-range.');if(a.includes("?"))for(var h=a.replace(/\?/g,"0"),c=a.replace(/\?/g,"F"),d=t.parse(["U+"+h+"-"+c]),p=0;p<d.length;p++){var f=d[p];n.add(f)}else n.add(parseInt(a,16))}if(l&&u)for(var m=parseInt(l,16),g=parseInt(u,16),f=m;f<=g;f++)n.add(f)}return Array.from(n).sort(function(t,r){return t-r})},t.stringify=function(r){for(var n,i=Array.from(new Set(r)).sort(function(t,r){return t-r}),s=[],o=0;o<i.length;o++){var a=i[o],l=i[o-1];n&&a-l!=1&&(s.push(t.rangeString(n,l)),n=a),n||(n=a),o===i.length-1&&(n===a?s.push(t.rangeString(a)):s.push(t.rangeString(n,a)))}return s},t.rangeString=function(t,r){return r&&t!==r?"U+"+t.toString(16)+"-"+r.toString(16):"U+"+t.toString(16)},t.REGEXP=/^u\+(?:([0-9a-f]?[0-9a-f?]{1,5})|([0-9a-f]{1,6})-([0-9a-f]{1,6}))?$/i,t}()},59748:(t,r,n)=>{"use strict";n.d(r,{A:()=>
86o,Z:()=>s});var i=n(6439);class s{constructor(t,r){this.file=t,this._pInst=r;let n=t.type.split("/");this.type=n[0],this.subtype=n[1],this.name=t.name,this.size=t.size,this.data=void 0}static _createLoader(t,r){let n=new FileReader;return n.onload=function(n){let o=new s(t);if("application/json"===o.file.type)o.data=JSON.parse(n.target.result);else if("text/xml"===o.file.type){let t=new DOMParser().parseFromString(n.target.result,"text/xml");o.data=new i._(t.documentElement)}else o.data=n.target.result;r(o)},n}static _load(t,r){if(/^text\//.test(t.type)||"application/json"===t.type)s._createLoader(t,r).readAsText(t);else if(/^(video|audio)\//.test(t.type)){let n=new s(t);n.data=URL.createObjectURL(t),r(n)}else s._createLoader(t,r).readAsDataURL(t)}}function o(t,r){t.File=s}"undefined"!=typeof p5&&o(p5,p5.prototype)},64665:(t,r)=>{"use strict";function n(t,r,n,i){for(var s=t[r++],o=1<<s,a=o+1,l=a+1,u=s+1,h=(1<<u)-1,c=0,d=0,p=0,f=t[r++],m=new Int32Array(4096),g=null;;){for(;c<16&&0!==f;)d|=t[r++]<<c,c+=8,1===f?f=t[r++]:--f;if(c<u)break;var y=d&h;if(d>>=u,c-=u,y===o){l=a+1,h=(1<<(u=s+1))-1,g=null;continue}if(y===a)break;for(var v=y<l?y:g,b=0,x=v;x>o;)x=m[x]>>8,++b;var _=x;if(p+b+ +(v!==y)>i)return void console.log("Warning, gif stream longer than expected.");n[p++]=_;var A=p+=b;for(v!==y&&(n[p++]=_),x=v;b--;)x=m[x],n[--A]=255&x,x>>=8;null!==g&&l<4096&&(m[l++]=g<<8|_,l>=h+1&&u<12&&(++u,h=h<<1|1)),g=y}return p!==i&&console.log("Warning, gif stream shorter than expected."),n}try{r.e=function(t,r,n,i){var s=0,i=void 0===i?{}:i,o=void 0===i.loop?null:i.loop,a=void 0===i.palette?null:i.palette;if(r<=0||n<=0||r>65535||n>65535)throw Error("Width/Height invalid.");function l(t){var r=t.length;if(r<2||r>256||r&r-1)throw Error("Invalid code/color length, must be power of 2 and 2 .. 256.");return r}t[s++]=71,t[s++]=73,t[s++]=70,t[s++]=56,t[s++]=57,t[s++]=97;var u=0,h=0;if(null!==a){for(var c=l(a);c>>=1;)++u;if(c=1<<u,--u,void 0!==i.background){if((h=i.background)>=c)throw Error("Background index out of range.");if(0===h)throw Error("Background index explicitly passed as 0.")}}if(t[s++]=255&r,t[s++]=r>>8&255,t[s++]=255&n,t[s++]=n>>8&255,t[s++]=128*(null!==a)|u,t[s++]=h,t[s++]=0,null!==a)for(var d=0,p=a.length;d<p;++d){var f=a[d];t[s++]=f>>16&255,t[s++]=f>>8&255,t[s++]=255&f}if(null!==o){if(o<0||o>65535)throw Error("Loop count invalid.");t[s++]=33,t[s++]=255,t[s++]=11,t[s++]=78,t[s++]=69,t[s++]=84,t[s++]=83,t[s++]=67,t[s++]=65,t[s++]=80,t[
86s++]=69,t[s++]=50,t[s++]=46,t[s++]=48,t[s++]=3,t[s++]=1,t[s++]=255&o,t[s++]=o>>8&255,t[s++]=0}var m=!1;this.addFrame=function(r,n,i,o,u,h){if(!0===m&&(--s,m=!1),h=void 0===h?{}:h,r<0||n<0||r>65535||n>65535)throw Error("x/y invalid.");if(i<=0||o<=0||i>65535||o>65535)throw Error("Width/Height invalid.");if(u.length<i*o)throw Error("Not enough pixels for the frame size.");var c=!0,d=h.palette;if(null==d&&(c=!1,d=a),null==d)throw Error("Must supply either a local or global palette.");for(var p=l(d),f=0;p>>=1;)++f;p=1<<f;var g=void 0===h.delay?0:h.delay,y=void 0===h.disposal?0:h.disposal;if(y<0||y>3)throw Error("Disposal out of range.");var v=!1,b=0;if(void 0!==h.transparent&&null!==h.transparent&&(v=!0,(b=h.transparent)<0||b>=p))throw Error("Transparent color index.");if((0!==y||v||0!==g)&&(t[s++]=33,t[s++]=249,t[s++]=4,t[s++]=y<<2|!0===v,t[s++]=255&g,t[s++]=g>>8&255,t[s++]=b,t[s++]=0),t[s++]=44,t[s++]=255&r,t[s++]=r>>8&255,t[s++]=255&n,t[s++]=n>>8&255,t[s++]=255&i,t[s++]=i>>8&255,t[s++]=255&o,t[s++]=o>>8&255,t[s++]=!0===c?128|f-1:0,!0===c)for(var x=0,_=d.length;x<_;++x){var A=d[x];t[s++]=A>>16&255,t[s++]=A>>8&255,t[s++]=255&A}return s=function(t,r,n,i){t[r++]=n;var s=r++,o=1<<n,a=o-1,l=o+1,u=l+1,h=n+1,c=0,d=0;function p(n){for(;c>=n;)t[r++]=255&d,d>>=8,c-=8,r===s+256&&(t[s]=255,s=r++)}function f(t){d|=t<<c,c+=h,p(8)}var m=i[0]&a,g={};f(o);for(var y=1,v=i.length;y<v;++y){var b=i[y]&a,x=m<<8|b,_=g[x];if(void 0===_){for(d|=m<<c,c+=h;c>=8;)t[r++]=255&d,d>>=8,c-=8,r===s+256&&(t[s]=255,s=r++);4096===u?(f(o),u=l+1,h=n+1,g={}):(u>=1<<h&&++h,g[x]=u++),m=b}else m=_}return f(m),f(l),p(1),s+1===r?t[s]=0:(t[s]=r-s-1,t[r++]=0),r}(t,s,f<2?2:f,u)},this.end=function(){return!1===m&&(t[s++]=59,m=!0),s},this.getOutputBuffer=function(){return t},this.setOutputBuffer=function(r){t=r},this.getOutputBufferPosition=function(){return s},this.setOutputBufferPosition=function(t){s=t}},r.u=function(t){var r=0;if(71!==t[r++]||73!==t[r++]||70!==t[r++]||56!==t[r++]||(t[r++]+1&253)!=56||97!==t[r++])throw Error("Invalid GIF 87a/89a header.");var i=t[r++]|t[r++]<<8,s=t[r++]|t[r++]<<8,o=t[r++],a=1<<(7&o)+1;t[r++],t[r++];var l=null,u=null;o>>7&&(l=r,u=a,r+=3*a);var h=!0,c=[],d=0,p=null,f=0,m=null;for(this.width=i,this.height=s;h&&r<t.length;)switch(t[r++]){case 33:switch(t[r++]){case 255:if(11!==t[r]||78==t[r+1]&&69==t[r+2]&&84==t[r+3]&&83==t[r+4]&&67==t[r+5]&&65==t[r+6]&&80==t[r+7]&&69==t[r+8]&&50==t[r+9]&&46==t[r+10]&&48==t[r+11]&&3==t[r+12]&&1==t[r+13]&&0==t[r+16])r+=14,m=t[r++]|t[r++]<<8,r++;else for(r+=12;;){var g=t[r++];if(!(g>=0))throw Error("Invalid block size");if(0===g)break;r+=g}break;case 249:if(4!==t[r++]||0!==t[r+4])throw Error("Invalid graphics extension block.");var y=t[r++];d=t[r++]|t[r++]<<8,p=t[r++],(1&y)==0&&(p=null),f=y>>2&7,r++;break;case 254:for(;;){var g=t[r++];if(!(g>=0))throw Error("Invalid block size");if(0===g)break;r+=g}break;default:throw Error("Unknown graphic control label: 0x"+t[r-1].toString(16))}break;case 44:var v=t[r++]|t[r++]<<8,b=t[r++]|t[r++]<<8,x=t[r++]|t[r++]<<8,_=t[r++]|t[r++]<<8,A=t[r++],E=A>>7,C=A>>6&1,D=1<<(7&A)+1,w=l,S=u,F=!1;if(E){var F=!0;w=r,S=D,r+=3*D}var T=r;for(r++;;){var g=t[r++];if(!(g>=0))throw Error("Invalid block size");if(0===g)break;r+=g}c.push({x:v,y:b,width:x,height:_,has_local_palette:F,palette_offset:w,palette_size:S,data_offset:T,data_length:r-T,transparent_index:p,interlaced:!!C,delay:d,disposal:f});break;case 59:h=!1;break;default:throw Error("Unknown gif block: 0x"+t[r-1].toString(16))}this.numFrames=function(){return c.length},this.loopCount=function(){return m},this.frameInfo=function(t){if(t<0||t>=c.length)throw Error("Frame index out of range.");return c[t]},this.decodeAndBlitFrameBGRA=function(r,s){var o=this.frameInfo(r),a=o.width*o.height,l=new Uint8Array(a);n(t,o.data_offset,l,a);var u=o.palette_offset,h=o.transparent_index;null===h&&(h=256);var c=o.width,d=i-c,p=c,f=(o.y*i+o.x)*4,m=((o.y+o.height)*i+o.x)*4,g=f,y=4*d;!0===o.interlaced&&(y+=4*i*7);for(var v=8,b=0,x=l.length;b<x;++b){var _=l[b];if(0===p&&(g+=y,p=c,g>=m&&(y=4*d+4*i*(v-1),g=f+(c+d)*(v<<1),v>>=1)),_===h)g+=4;else{var A=t[u+3*_],E=t[u+3*_+1],C=t[u+3*_+2];s[g++]=C,s[g++]=E,s[g++]=A,s[g++]=255}--p}},this.decodeAndBlitFrameRGBA=function(r,s){var o=this.frameInfo(r),a=o.width*o.height,l=new Uint8Array(a);n(t,o.data_offset,l,a);var u=o.palette_offset,h=o.transparent_index;
86null===h&&(h=256);var c=o.width,d=i-c,p=c,f=(o.y*i+o.x)*4,m=((o.y+o.height)*i+o.x)*4,g=f,y=4*d;!0===o.interlaced&&(y+=4*i*7);for(var v=8,b=0,x=l.length;b<x;++b){var _=l[b];if(0===p&&(g+=y,p=c,g>=m&&(y=4*d+4*i*(v-1),g=f+(c+d)*(v<<1),v>>=1)),_===h)g+=4;else{var A=t[u+3*_],E=t[u+3*_+1],C=t[u+3*_+2];s[g++]=A,s[g++]=E,s[g++]=C,s[g++]=255}--p}}}}catch(t){}},65411:(t,r,n)=>{"use strict";n.d(r,{Ay:()=>a,be:()=>s,wU:()=>o});var i=n(28499);n(45950),n(17035),n(58905),n(7307),n(39247),n(70878);let s="#000000",o={IDEOGRAPHIC:"ideographic",RIGHT_TO_LEFT:"rtl",LEFT_TO_RIGHT:"ltr",_CTX_MIDDLE:"middle",_TEXT_BOUNDS:"_textBoundsSingle",_FONT_BOUNDS:"_fontBoundsSingle",HANGING:"hanging",START:"start",END:"end"};function a(t,r){let n,s,a=/\r?\n/g,l=/,\s+/,u=/^".*"$/,h=/[^\x00-\x7F]/,c=/\t/g,d=RegExp("(?:wght|wdth|ital|slnt|opsz)");["text","textAlign","textAscent","textDescent","textLeading","textMode","textFont","textSize","textStyle","textWidth","textWrap","textBounds","textDirection","textProperty","textProperties","fontBounds","fontWidth","fontAscent","fontDescent","textWeight"].forEach(n=>{r[n]=function(...t){if(!(n in i.R.prototype))throw Error(`Renderer2D.prototype.${n} is not defined.`);return this._renderer[n](...t)},t.Graphics.prototype[n]=function(...t){return this._renderer[n](...t)}});let p={textAlign:{default:r.LEFT,type:"Context2d"},textBaseline:{default:r.BASELINE,type:"Context2d"},textFont:{default:{family:"sans-serif"}},textLeading:{default:15},textSize:{default:12},textWrap:{default:r.WORD},fontStretch:{default:r.NORMAL,isShorthand:!0},fontWeight:{default:r.NORMAL,isShorthand:!0},lineHeight:{default:r.NORMAL,isShorthand:!0},fontVariant:{default:r.NORMAL,isShorthand:!0},fontStyle:{default:r.NORMAL,isShorthand:!0},direction:{default:"inherit"}},f=["font","direction","fontKerning","fontStretch","fontVariantCaps","letterSpacing","textAlign","textBaseline","textRendering","wordSpacing"],m=Object.keys(p).filter(t=>p[t].isShorthand),g=["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded"];i.R.prototype.text=function(t,r,n,i,s){let o=this.textDrawingContext().textBaseline;({x:r,y:n,width:i,height:s}=this._handleRectMode(r,n,i,s));let a=this._processLines(t,i,s);(a=this._positionLines(r,n,i,s,a)).forEach(t=>this._renderText(t.text,t.x,t.y)),this.textDrawingContext().textBaseline=o},i.R.prototype.textBounds=function(t,r,n,i,s){return this._computeBounds(o._TEXT_BOUNDS,t,r,n,i,s).bounds},i.R.prototype.fontBounds=function(t,r,n,i,s){return this._computeBounds(o._FONT_BOUNDS,t,r,n,i,s).bounds},i.R.prototype.textWidth=function(t){return Math.max(...this._processLines(t).map(t=>this._textWidthSingle(t)))},i.R.prototype.fontWidth=function(t){return Math.max(...this._processLines(t).map(t=>this._fontWidthSingle(t)))},i.R.prototype.textAscent=function(t=""){return t.length?this.textDrawingContext().measureText(t).actualBoundingBoxAscent:this.fontAscent()},i.R.prototype.fontAscent=function(){return this.textDrawingContext().measureText("_").fontBoundingBoxAscent},i.R.prototype.textDescent=function(t=""){return t.length?this.textDrawingContext().measureText(t).actualBoundingBoxDescent:this.fontDescent()},i.R.prototype.fontDescent=function(){return this.textDrawingContext().measureText("_").fontBoundingBoxDescent},i.R.prototype.textAlign=function(t,n){return void 0!==t?(this.states.setValue("textAlign",t),void 0!==n&&(n===r.CENTER&&(n=o._CTX_MIDDLE),this.states.setValue("textBaseline",n)),this._applyTextProperties()):{horizontal:this.states.textAlign,vertical:this.states.textBaseline}},i.R.prototype._currentTextFont=function(){return this.states.textFont.font||this.states.textFont.family},i.R.prototype.textFont=function(r,n,i){if(0==arguments.length)return this._currentTextFont();let s=r;if(r instanceof t.Font?s=r.face.family:r.data instanceof Uint8Array?(s=r.name.fontFamily,r.name?.fontSubfamily&&(s+="-"+r.name.fontSubfamily)):"string"==typeof r&&void 0===n&&/[.0-9]+(%|em|p[xt])/.test(s)&&({family:s,size:n}=this._directSetFontString(s)),"string"!=typeof s)throw Error("null font in textFont()");return 2==arguments.length&&"object"==typeof n&&(i=n,n=void 0),this.states.setValue("textFont",{font:r,family:s,size:n}),void 0!==n&&this._setTextSize(n),"object"==typeof i&&this.textProperties(i),this._applyTextProperties()},i.R.prototype._directSetFontString=function(t,r=0){r&&console.log('_directSetFontString"'+t+'"');let n=m.reduce((t,r)=>(t[r]=p[r].default,t),{}),i=this._cachedDiv(n);i.style.font=t;let s=getComputedStyle(i);return m.forEach(t=>{this.states[t]=s[t],r&&console.log("  this.states."+t+'="'+s[t]+'"')}),{family:s.fontFamily,size:s.fontSize}},i.R.prototype.textLeading=function(t){return"number"==typeof t?(this.states.setValue("leadingSet",!0),this.states.setValue("textLeading",t),this._applyTextProperties()):this.states.textLeading},i.R.prototype.textWeight=function(r){if("number"==typeof r){this.states.setValue("fontWeight",r),this._applyTextProperties(),t.prototype._isSafari()||this._setCanvasStyleProperty("font-variation-settings",`"wght" ${r}`);return}return this.states.fontWeight},i.R.prototype.textSize=function(t){return void 0!==t?(this._setTextSize(t),this._applyTextProperties()):this.states.textSize},i.R.prototype.textStyle=function(t){return void 0!==t?(this.states.setValue("fontStyle",t),this._applyTextProperties()):this.states.fontStyle},i.R.prototype.textWrap=function(t){return t===r.WORD||t===r.CHAR?(this.states.setValue("textWrap",t),this._pInst):this.states.textWrap},i.R.prototype.textDirection=function(t){return void 0!==t?(this.states.setValue("direction",t),this._applyTextProperties()):this.states.direction},i.R.prototype.textProperty=function(t,r,n){let i=!1,s=n?.debug||!1;if(void 0===r){let r=this.textProperties();if(t in r)return r[t];throw Error('Unknown text option "'+t+'"')}return t in this.states&&this.states[t]!==r?(this.states[t]=r,i=!0,s&&console.log("this.states."+t+'="'+options[t]+'"')):t in this.textDrawingContext()?(this._setContextProperty(t,r,s),i=!0):t in this.textCanvas().style?(this._setCanvasStyleProperty(t,r,s),i=!0):console.warn('Ignoring unknown text option: "'+t+'"\n'),i?this._applyTextProperties():this._pInst},i.R.prototype.textProperties=function(t){if(void 0!==t)return Object.keys(t).forEach(r=>{this.textProperty(r,t[r])}),this._pInst;let r=this.textDrawingContext();return t=f.reduce((t,n)=>(t[n]=r[n],t),{}
86),Object.keys(p).forEach(n=>{if(p[n]?.type==="Context2d")t[n]=r[n];else if("textFont"===n){let r=this._currentTextFont();"object"==typeof r&&"_pInst"in r&&(r=Object.assign({},r),delete r._pInst),t[n]=r}else t[n]=this.states[n]}),t},i.R.prototype.textMode=function(){},i.R.prototype._currentTextFont=function(){return this.states.textFont.font||this.states.textFont.family},i.R.prototype._computeBounds=function(r,n,i,s,o,a,l){let u=this.textDrawingContext(),h=u.textBaseline,{textLeading:c,textAlign:d}=this.states;({width:o,height:a}=this._rectModeAdjust(i,s,o,a));let p=this._processLines(n,o,a),f=p.map((t,n)=>this[r].bind(this)(t,i,s+n*c));p.length>1&&void 0!==o&&f.forEach(r=>r.x+=t.Renderer2D.prototype._xAlignOffset.call(this,d,o)),t.Renderer2D.prototype._yAlignOffset.call(this,f,a||0);let m=f[0];return p.length>1&&(m=this._aggregateBounds(f),l?.ignoreRectMode||this._rectModeAlign(m,o||0,a||0)),u.textBaseline=h,{bounds:m,lines:p}},i.R.prototype._rectModeAdjust=function(t,n,i,s){if(void 0!==i)switch(this.states.rectMode){case r.CENTER:break;case r.CORNERS:i-=t,s-=n;break;case r.RADIUS:i*=2,s*=2}return{x:t,y:n,width:i,height:s}},i.R.prototype._setCanvasStyleProperty=function(t,r,n){let i=r.toString();n&&console.log("canvas.style."+t+'="'+i+'"'),"fontVariationSettings"===t&&this._handleFontVariationSettings(i),this.textCanvas().style[t]=i,this.textCanvas().style[t]},i.R.prototype._handleFontVariationSettings=function(t,r=!1){"object"==typeof t&&(t=Object.keys(t).map(r=>r+" "+t[r]).join(", ")),t.split(l).forEach(t=>{t=t.replace(/["']/g,"");let n=d.exec(t);if(n&&n.length){let i=n[0],s=parseFloat(parseFloat(t.replace(i,"").trim()).toFixed(3));switch(i){case"wght":return r&&console.log("setting font-weight="+s),this.states.fontWeight!==s&&this.textWeight(s),s;case"wdth":break;case"ital":r&&console.log("setting font-style="+(s?"italic":"normal"));break;case"slnt":r&&console.log("setting font-style="+(s?"oblique":"normal"));break;case"opsz":r&&console.log("setting font-optical-size="+s)}}})},i.R.prototype._setContextProperty=function(t,r,i=!1){if(this.textDrawingContext()[t]===r)return this._pInst;(n??=[]).push([t,r]),i&&console.log("queued context2d."+t+'="'+r+'"')},i.R.prototype._handleRectMode=function(t,n,i,s){let o=this.states.rectMode;if(void 0!==i)switch(o){case r.RADIUS:i*=2,t-=i/2,void 0!==s&&(s*=2,n-=s/2);break;case r.CENTER:t-=i/2,void 0!==s&&(n-=s/2);break;case r.CORNERS:i-=t,void 0!==s&&(s-=n)}return{x:t,y:n,width:i,height:s}},i.R.prototype._fontSizePx=function(t,{family:r}=this.states.textFont){if(!isNaN(t)&&""!==t.trim())return parseFloat(t);let n=this._cachedDiv({fontSize:t});n.style.fontSize=t,n.style.fontFamily=r;let i=parseFloat(getComputedStyle(n).fontSize);if("number"!=typeof i)throw Error("textSize: invalid font-size");return i},i.R.prototype._cachedDiv=function(t){if(void 0===s){let r=document.createElement("div");r.ariaHidden="true",r.style.display="none",Object.entries(t).forEach(([t,n])=>{r.style[t]=n}),this.textCanvas().appendChild(r),s=r}return s},i.R.prototype._aggregateBounds=function(t){let r=Math.min(...t.map(t=>t.x)),n=Math.min(...t.map(t=>t.y)),i=Math.max(...t.map(t=>t.y+t.h));return{x:r,y:n,w:Math.max(...t.map(t=>t.x+t.w))-r,h:i-n}},i.R.prototype._processLines=function(t,n,i){void 0!==n&&this.textDrawingContext().textBaseline===r.BASELINE&&(this.drawingContext.textBaseline=r.TOP);let s=this._splitOnBreaks(t.toString()),o=s.length>1,a=void 0!==n,l=a&&s.some(t=>this._textWidthSingle(t)>n),{textLeading:u,textWrap:h}=this.states;if((o||l)&&a&&(s=this._lineate(h,s,n)),a&&void 0!==i){if(void 0===u)throw Error("leading is required if height is specified");for(let t=0;t<s.length;t++)if(u*(t+1)>i){s=s.slice(0,t);break}}return s},i.R.prototype._xAlignOffset=function(t,n){switch(t){case r.LEFT:return 0;case r.CENTER:return n/2;case r.RIGHT:return n;case o.START:return 0;case o.END:throw Error("textBounds: END not yet supported for textAlign");default:return 0}},i.R.prototype._rectModeAlign=function(t,n,i){if(void 0!==n){switch(this.states.rectMode){case r.CENTER:t.x-=(n-t.w)/2,t.y-=(i-t.h)/2;break;case r.CORNERS:t.w+=t.x,t.h+=t.y;break;case r.RADIUS:t.x-=(n-t.w)/2,t.y-=(i-t.h)/2,t.w/=2,t.h/=2}return t}},i.R.prototype._rectModeAlignRevert=function(t,n,i){if(void 0!==n){switch(this.states.rectMode){case r.CENTER:t.x+=(n-t.w)/2,t.y+=(i-t.h)/2;break;case r.CORNERS:t.w-=t.x,t.h-=t.y;break;case r.RADIUS:t.x+=(n-t.w)/2,t.y+=(i-t.h)/2,t.w*=2,t.h*=2}return t}},i.R.prototype._textWidthSingle=function(t){let r=this.textDrawingContext().measureText(t),n=r.actualBoundingBoxLeft;return r.actualBoundingBoxRight+n},i.R.prototype._fontWidthSingle=function(t){return this.textDrawingContext().measureText(t).width},i.R.prototype._textBoundsSingle=function(t,r=0,n=0){let i=this.textDrawingContext().measureText(t),s=i.actualBoundingBoxAscent,o=i.actualBoundingBoxDescent,a=i.actualBoundingBoxLeft;return{x:r-a,y:n-s,w:i.actualBoundingBoxRight+a,h:s+o}},i.R.prototype._fontBoundsSingle=function(t,r=0,n=0){let i=this.textDrawingContext().measureText(t),s=i.fontBoundingBoxAscent,o=i.fontBoundingBoxDescent;return{x:r-=this._xAlignOffset(this.states.textAlign,i.width),y:n-s,w:i.width,h:s+o}},i.R.prototype._setTextSize=function(t){if("string"==typeof t&&(t=this._fontSizePx(t)),"number"==typeof t){if(this.states.textSize!==t)return this.states.setValue("textSize",t),this.states.leadingSet||this.states.setValue("textLeading",1.275*this.states.textSize),!0}else console.warn("textSize: invalid size: "+t);return!1},i.R.prototype._lineate=function(t,n,i=1/0,s={}){let o=s.splitChar??(t===r.WORD?" ":""),a,l,u,h,c=[];for(let t=0;t<n.length;t++){a="",h=n[t].split(o);for(let t=0;t<h.length;t++)l=`${a+h[t]}`+o,u=this._textWidthSingle(l),a.length>0&&u>i?(c.push(a.trim()),a=`${h[t]}`+o):a=l;c.push(a.trim())}return c},i.R.prototype._splitOnBreaks=function(t){return t&&0!==t.length?t.replace(c,"  ").split(a):[""]},i.R.prototype._parseFontFamily=function(t){return t.split(l).map(t=>(((t=t.trim()).indexOf(" ")>-1||h.test(t))&&!u.test(t)&&(t=`"${t}"`),t)).join(", ")},i.R.prototype._applyFontString=function(){let{textFont:t,textSize:n,lineHeight:i,fontStyle:s,fontWeight:o,fontVariant:a}=this.states,l=this.textDrawingContext(),u=this._parseFontFamily(t.family),h=s!==r.NORMAL?`${s} `:"",c=o!==r.NORMAL?`${o} `:"",d=a!==r.NORMAL?`${a} `:"",p=`${n}px`+(i!==r.NORMAL?`/${i} `:" "),f=`${h}${d}${c}${p}${u}`.trim();return l.font=f,(l.font===f||f===l.font)&&!0},i.R.prototype._applyTextProperties=function(t=!1){this._applyFontString();let r=this.textDrawingContext();r.direction=this.states.direction,r.textAlign=this.states.textAlign,r.textBaseline=this.states.textBaseline;let i=this.states.fontStretch;for(g.includes(i)&&r.fontStretch!==i&&(r.fontStretch=i);n?.length;){let[i,s]=n.shift();t&&console.log('apply context property "'+i+'" = "'+s+'"'),r[i]=s,r[i]!==s&&(console.warn(`Unable to set '${i}' property on context2d. It may not be supported.`),console.log('Expected "'+s+'" but got: "'+r[i]+'"'))}return this._pInst}}"undefined"!=typeof p5&&a(p5,p5.prototype)},67449:(t,r,n)=>{"use strict";function i(t,r){return t[0]*r[0]+t[1]*r[1]+t[2]*r[2]}function s(t,r,n=[0,0,0]){let o=i(t,r[0]),a=i(t,r[1]),l=i(t,r[2]);return n[0]=o,n[1]=a,n[2]=l,n}n.d(r,{R:()=>s})},69689:(t,r,n)=>{"use strict";function i(t,r,n){let i=s(r,n)[0],o=t;if(o instanceof Blob||(o=new Blob([t])),document){let t=URL.createObjectURL(o),r
86=document.createElement("a");r.href=t,r.download=i,r.click(),URL.revokeObjectURL(t)}}function s(t,r){r&&!0!==r&&"true"!==r||(r=""),t||(t="untitled");let n="";return t&&t.includes(".")&&(n=t.split(".").pop()),r&&n!==r&&(n=r,t=`${t}.${n}`),[t,n]}n.d(r,{N:()=>s,P:()=>i})},70051:(t,r)=>{r.getArg=function(t,r,n){if(r in t)return t[r];if(3==arguments.length)return n;throw Error('"'+r+'" is a required argument.')};var n=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,i=/^data:.+\,.+$/;function s(t){var r=t.match(n);return r?{scheme:r[1],auth:r[2],host:r[3],port:r[4],path:r[5]}:null}function o(t){var r="";return t.scheme&&(r+=t.scheme+":"),r+="//",t.auth&&(r+=t.auth+"@"),t.host&&(r+=t.host),t.port&&(r+=":"+t.port),t.path&&(r+=t.path),r}function a(t){var n=t,i=s(t);if(i){if(!i.path)return t;n=i.path}for(var a,l=r.isAbsolute(n),u=n.split(/\/+/),h=0,c=u.length-1;c>=0;c--)"."===(a=u[c])?u.splice(c,1):".."===a?h++:h>0&&(""===a?(u.splice(c+1,h),h=0):(u.splice(c,2),h--));return(""===(n=u.join("/"))&&(n=l?"/":"."),i)?(i.path=n,o(i)):n}function l(t,r){""===t&&(t="."),""===r&&(r=".");var n=s(r),l=s(t);if(l&&(t=l.path||"/"),n&&!n.scheme)return l&&(n.scheme=l.scheme),o(n);if(n||r.match(i))return r;if(l&&!l.host&&!l.path)return l.host=r,o(l);var u="/"===r.charAt(0)?r:a(t.replace(/\/+$/,"")+"/"+r);return l?(l.path=u,o(l)):u}r.urlParse=s,r.urlGenerate=o,r.normalize=a,r.join=l,r.isAbsolute=function(t){return"/"===t.charAt(0)||n.test(t)},r.relative=function(t,r){""===t&&(t="."),t=t.replace(/\/$/,"");for(var n=0;0!==r.indexOf(t+"/");){var i=t.lastIndexOf("/");if(i<0||(t=t.slice(0,i)).match(/^([^\/]+:\/)?\/*$/))return r;++n}return Array(n+1).join("../")+r.substr(t.length+1)};var u=!("__proto__"in Object.create(null));function h(t){return t}function c(t){if(!t)return!1;var r=t.length;if(r<9||95!==t.charCodeAt(r-1)||95!==t.charCodeAt(r-2)||111!==t.charCodeAt(r-3)||116!==t.charCodeAt(r-4)||111!==t.charCodeAt(r-5)||114!==t.charCodeAt(r-6)||112!==t.charCodeAt(r-7)||95!==t.charCodeAt(r-8)||95!==t.charCodeAt(r-9))return!1;for(var n=r-10;n>=0;n--)if(36!==t.charCodeAt(n))return!1;return!0}function d(t,r){return t===r?0:null===t?1:null===r?-1:t>r?1:-1}r.toSetString=u?h:function(t){return c(t)?"$"+t:t},r.fromSetString=u?h:function(t){return c(t)?t.slice(1):t},r.compareByOriginalPositions=function(t,r,n){var i=d(t.source,r.source);return 0!==i||0!=(i=t.originalLine-r.originalLine)||0!=(i=t.originalColumn-r.originalColumn)||n||0!=(i=t.generatedColumn-r.generatedColumn)||0!=(i=t.generatedLine-r.generatedLine)?i:d(t.name,r.name)},r.compareByGeneratedPositionsDeflated=function(t,r,n){var i=t.generatedLine-r.generatedLine;return 0!==i||0!=(i=t.generatedColumn-r.generatedColumn)||n||0!==(i=d(t.source,r.source))||0!=(i=t.originalLine-r.originalLine)||0!=(i=t.originalColumn-r.originalColumn)?i:d(t.name,r.name)},r.compareByGeneratedPositionsInflated=function(t,r){var n=t.generatedLine-r.generatedLine;return 0!==n||0!=(n=t.generatedColumn-r.generatedColumn)||0!==(n=d(t.source,r.source))||0!=(n=t.originalLine-r.originalLine)||0!=(n=t.originalColumn-r.originalColumn)?n:d(t.name,r.name)},r.parseSourceMapInput=function(t){return JSON.parse(t.replace(/^\)]}'[^\n]*\n/,""))},r.computeSourceURL=function(t,r,n){if(r=r||"",t&&("/"!==t[t.length-1]&&"/"!==r[0]&&(t+="/"),r=t+r),n){var i=s(n);if(!i)throw Error("sourceMapURL could not be parsed");if(i.path){var u=i.path.lastIndexOf("/");u>=0&&(i.path=i.path.substring(0,u+1))}r=l(o(i),r)}return a(r)}},70598:(t,r,n)=>{"use strict";n.d(r,{A:()=>l});var i=n(87442),s=n(67449),o=n(1818),a=n(50565);class l extends i.A{constructor(t){t.coords||(t.coords={r:{range:[0,1],name:"Red"},g:{range:[0,1],name:"Green"},b:{range:[0,1],name:"Blue"}}),t.base||(t.base=a.A),t.toXYZ_M&&t.fromXYZ_M&&(t.toBase??=r=>{let n=(0,s.R)(r,t.toXYZ_M);return this.white!==this.base.white&&(n=(0,o.Ay)(this.white,this.base.white,n)),n},t.fromBase??=r=>(r=(0,o.Ay)(this.base.white,this.white,r),(0,s.R)(r,t.fromXYZ_M))),t.referred??="display",super(t)}}},70878:(t,r,n)=>{"use strict";n.d(r,{AQ:()=>w,Ay:()=>T,Om:()=>S,yp:()=>C});var i=n(45950),s=n(39247),o=n(58905);function a(t){let r=0;for(let n=1;n<t.length;n++)r+=t[n-1].position.dist(t[n].position);return r}n(17035);class l{constructor(t){for(let[r,n]of Object.entries(t))this[r]=n}}class u{vertices;_shape=null;_primitivesIndex=null;_contoursIndex=null;isClosing=!1;constructor(...t){if(this.constructor===u)throw Error("ShapePrimitive is an abstract class: it cannot be instantiated.");
86if(t.length>0)this.vertices=t;else throw Error("At least one vertex must be passed to the constructor.")}get vertexCount(){return this.vertices.length}get vertexCapacity(){throw Error("Getter vertexCapacity must be implemented.")}get _firstInterpolatedVertex(){return this.startVertex()}get canOverrideAnchor(){return!1}accept(t){throw Error("Method accept() must be implemented.")}addToShape(t){let r=t.at(-1);if(0===r.primitives.length)r.primitives.push(this);else{let n,i,s=t.at(-1,-1),o=s instanceof this.constructor,a=s.vertexCapacity-s.vertexCount;o&&a>0?(n=this.vertices.splice(0,a),i=this.vertices,s.vertices.push(...n),i.length>0&&r.primitives.push(this)):r.primitives.push(this)}if(this.vertices.length>0){let r=t.at(-1);this._primitivesIndex=r.primitives.length-1,this._contoursIndex=t.contours.length-1,this._shape=t}return t.at(-1,-1)}get _nextPrimitive(){return this._belongsToShape?this._shape.at(this._contoursIndex,this._primitivesIndex+1):null}get _belongsToShape(){return null!==this._shape}handlesClose(){return!1}close(t){throw Error("Unimplemented!")}}class h{#b;primitives;constructor(t=o.K){this.#b=t,this.primitives=[]}get kind(){let t=0===this.primitives.length,r=this.#b===o.K;return t&&r?o.O:this.#b}accept(t){for(let r of this.primitives)r.accept(t)}}class c extends u{#x=1;get vertexCapacity(){return this.#x}accept(t){t.visitAnchor(this)}getEndVertex(){return this.vertices[0]}}class d extends u{constructor(...t){if(super(...t),this.constructor===d)throw Error("Segment is an abstract class: it cannot be instantiated.")}get _previousPrimitive(){return this._belongsToShape?this._shape.at(this._contoursIndex,this._primitivesIndex-1):null}getStartVertex(){return this._previousPrimitive.getEndVertex()}getEndVertex(){return this.vertices.at(-1)}}class p extends d{#x=1;get vertexCapacity(){return this.#x}accept(t){t.visitLineSegment(this)}}class f extends d{#_;#x;constructor(t,...r){super(...r);let n=Array.isArray(t)?t[0]:t;this.#_=n,this.#x=n}get order(){return this.#_}get vertexCapacity(){return this.#x}#A;hullLength(){return void 0===this.#A&&(this.#A=a([this.getStartVertex(),...this.vertices])),this.#A}accept(t){t.visitBezierSegment(this)}}class m extends d{#x=1/0;_splineProperties={ends:o.J,tightness:0};get vertexCapacity(){return this.#x}accept(t){t.visitSplineSegment(this)}get _comesAfterSegment(){return this._previousPrimitive instanceof d}get canOverrideAnchor(){return this._splineProperties.ends===o.a0}get _firstInterpolatedVertex(){return this._splineProperties.ends===o.a0?this._comesAfterSegment?this.vertices[1]:this.vertices[0]:this.getStartVertex()}get _chainedToSegment(){if(!this._belongsToShape||!this._comesAfterSegment)return!1;{let t=this._firstInterpolatedVertex.position;return this.getStartVertex().position.equals(t)}}addToShape(t){let r=super.addToShape(t);if(this._splineProperties.ends=t._splineProperties.ends,this._splineProperties.tightness=t._splineProperties.tightness,this._splineProperties.ends!==o.a0)return r;let n=!this._belongsToShape,i=t.at(-1,-1);if(n&&2===i.vertices.length&&i._comesAfterSegment&&!i._chainedToSegment){let t,r,n=i._firstInterpolatedVertex.position,s=i.getStartVertex().position;console.warn((t=n.array(),r=s.array(),`Spline does not start where previous path segment ends:
87      second spline vertex at (${t})
88      expected to be at (${r}).`))}return r}getEndVertex(){return this._splineProperties.ends===o.J?super.getEndVertex():this._splineProperties.ends===o.a0?this.vertices.at(-2):this.getStartVertex()}getControlPoints(){let t=[];for(let r of(this._comesAfterSegment&&t.push(this.getStartVertex()),t.push(this.getStartVertex()),this.vertices))t.push(r);let r=this.getStartVertex();return this._splineProperties.ends===o.J?(t.unshift(r),t.push(this.vertices.at(-1))):this._splineProperties.ends===o.a1&&(t.unshift(this.vertices.at(-1)),t.push(r,this.vertices.at(0))),t}handlesClose(){return!!this._belongsToShape&&2===this._shape.at(this._contoursIndex).primitives.length&&1===this._primitivesIndex}close(){this._splineProperties.ends=o.a1}}class g extends u{#x=1;get vertexCapacity(){return this.#x}accept(t){t.visitPoint(this)}}class y extends u{#x=2;get vertexCapacity(){return this.#x}accept(t){t.visitLine(this)}}class v extends u{#x=3;get vertexCapacity(){return this.#x}accept(t){t.visitTriangle(this)}}class b extends u{#x=4;get vertexCapacity(){return this.#x}accept(t){t.visitQuad(this)}}class x extends u{#x=1/0;get vertexCapacity(){return this.#x}accept(t){t.visitTriangleFan(this)}}class _ extends u{#x=1/0;get vertexCapacity(){return this.#x}accept(t){t.visitTriangleStrip(this)}}class A extends u{#x=1/0;get vertexCapacity(){return this.#x}accept(t){t.visitQuadStrip(this)}}class E{creators;constructor(){let t=new Map;t.set(`vertex-${o.O}`,(...t)=>new c(...t)),t.set(`vertex-${o.K}`,(...t)=>new p(...t)),t.set(`vertex-${o.X}`,(...t)=>new g(...t)),t.set(`vertex-${o.Y}`,(...t)=>new y(...t)),t.set(`vertex-${o.c}`,(...t)=>new v(...t)),t.set(`vertex-${o.Z}`,(...t)=>new b(...t)),t.set(`vertex-${o._}`,(...t)=>new x(...t)),t.set(`vertex-${o.T}`,(...t)=>new _(...t)),t.set(`vertex-${o.$}`,(...t)=>new A(...t)),t.set(`bezierVertex-${o.O}`,(t,...r)=>new c(...r)),t.set(`bezierVertex-${o.K}`,(t,...r)=>new f(t,...r)),t.set(`splineVertex-${o.O}`,(...t)=>new c(...t)),t.set(`splineVertex-${o.K}`,(...t)=>new m(...t)),this.creators=t}get(t,r){let n=`${t}-${r}`;return this.creators.get(n)}set(t,r,n){let i=`${t}-${r}`;this.creators.set(i,n)}clear(){this.creators.clear()}}class C{#E;#C;#D;#w=3;kind=null;contours=[];_splineProperties={tightness:0,ends:o.J};userVertexProperties=null;
88constructor(t,r=new E){for(let n in this.#C=t,this.#E=t,this.#D=r,this.#E)"position"!==n&&"textureCoordinates"!==n&&(this[n]=function(t){this.#E[n]=t})}serializeToArray(t){if(null==t)return[];if(t instanceof Number)return[t];if(t instanceof Array)return t;if(t.array instanceof Function)return t.array();throw Error(`Can't convert ${t} to array!`)}vertexToArray(t){let r=[];for(let n in this.#E){if(this.userVertexProperties&&n in this.userVertexProperties)continue;let i=t[n];r.push(...this.serializeToArray(i))}for(let n in this.userVertexProperties)n in t?r.push(...this.serializeToArray(t[n])):r.push(...Array(this.userVertexProperties[n]).fill(0));return r}hydrateValue(t,r){if(null===r)return null;if(r instanceof Number)return t.shift();if(r instanceof Array){let n=[];for(let i=0;i<r.length;i++)n.push(t.shift());return n}if(r instanceof s.M)return new s.M(t.shift(),t.shift(),t.shift());if(r instanceof i.C){let r=[t.shift(),t.shift(),t.shift(),t.shift()];return new i.C(r)}}arrayToVertex(t){let r={},n=[...t];for(let t in this.#
88E){if(this.userVertexProperties&&t in this.userVertexProperties)continue;let i=this.#E[t];r[t]=this.hydrateValue(n,i)}for(let t in this.userVertexProperties){let i=this.#E[t];r[t]=this.hydrateValue(n,i)}return r}arrayScale(t,r){return t.map(t=>t*r)}arraySum(t,...r){return t.map((t,n)=>{let i=t;for(let t=0;t<r.length;t++)i+=r[t][n];return i})}arrayMinus(t,r){return t.map((t,n)=>t-r[n])}evaluateCubicBezier([t,r,n,i],s){return this.arraySum(this.arrayScale(t,Math.pow(1-s,3)),this.arrayScale(r,3*Math.pow(1-s,2)*s),this.arrayScale(n,3*(1-s)*Math.pow(s,2)),this.arrayScale(i,Math.pow(s,3)))}evaluateQuadraticBezier([t,r,n],i){return this.arraySum(this.arrayScale(t,Math.pow(1-i,2)),this.arrayScale(r,2*(1-i)*i),this.arrayScale(n,i*i))}catmullRomToBezier(t,r){let n=1-r,i=[];for(let r=0;r+3<t.length;r++){let[s,o,a,l]=t.slice(r,r+4),u=this.arraySum(o,this.arrayScale(this.arrayMinus(a,s),n/6)),h=this.arraySum(a,this.arrayScale(this.arrayMinus(o,l),n/6));i.push([u,h,a])}return i}at(t,r,n){let i;switch(i=this.contours.at(t),arguments.length){case 1:return i;case 2:return i.primitives.at(r);case 3:return i.primitives.at(r).vertices.at(n)}}reset(){this.#E={...this.#C},this.kind=null,this.contours=[],this.userVertexProperties=null}vertexProperty(t,r){this.userVertexProperties=this.userVertexProperties||{};let n=this.vertexPropertyKey(t),i=Array.isArray(r)?r:[r];this.userVertexProperties[n]||(this.userVertexProperties[n]=i.length),this.#E[n]=i}vertexPropertyName(t){return t.replace(/Src$/,"")}vertexPropertyKey(t){return t+"Src"}bezierOrder(...t){this.#w=t}splineProperty(t,r){this._splineProperties[t]=r}splineProperties(t){if(!t)return this._splineProperties;for(let r in t)this.splineProperty(r,t[r])}#S(t,r){return this.#E.position=t,void 0!==r&&(this.#E.textureCoordinates=r),new l(this.#E)}#F(t,r,...n){let i=this.#D.get(t,r);return"bezierVertex"===t?i(this.#w,...n):i(...n)}#T(t,r,n){let i=this.at(-1).kind,s=this.#S(r,n);return this.#F(t,i,s).addToShape(this)}vertex(t,r,{isClosing:n=!1}={}){this.#T("vertex",t,r).isClosing=n}bezierVertex(t,r){this.#T("bezierVertex",t,r)}splineVertex(t,r){this.#T("splineVertex",t,r)}arcVertex(t,r){this.#T("arcVertex",t,r)}beginContour(t=o.K){this.at(-1)?.kind===o.O&&this.contours.pop(),this.contours.push(new h(t))}endContour(t=o.Q,r=this.contours.length-1){let n=this.at(r);if(t===o.V){let t=n.kind===o.K,i=this.at(r,0,0),s=Object.hasOwn(i,"position"),a=this.at(r,-1);if(t&&s)if(a.handlesClose())a.close(i);else{let t=this.contours.splice(r+1,this.contours.length-r-1),n=this.#E;
88for(let t in this.#E={...n},i)["position","textureCoordinates"].includes(t)||(this.#E[t]=i[t]);this.vertex(i.position,i.textureCoordinates,{isClosing:!0}),this.#E=n,this.contours.push(...t)}}}beginShape(t=o.K){this.kind=t,this.beginContour(t)}endShape(t=o.Q){t===o.V&&this.endContour(t,0)}accept(t){for(let r of this.contours)r.accept(t)}}class D{constructor(){if(this.constructor===D)throw Error("PrimitiveVisitor is an abstract class: it cannot be instantiated.")}visitAnchor(t){throw Error("Method visitAnchor() has not been implemented.")}visitLineSegment(t){throw Error("Method visitLineSegment() has not been implemented.")}visitBezierSegment(t){throw Error("Method visitBezierSegment() has not been implemented.")}visitSplineSegment(t){throw Error("Method visitSplineSegment() has not been implemented.")}visitArcSegment(t){throw Error("Method visitArcSegment() has not been implemented.")}visitPoint(t){throw Error("Method visitPoint() has not been implemented.")}visitLine(t){throw Error("Method visitLine() has not been implemented.")}visitTriangle(t){throw Error("Method visitTriangle() has not been implemented.")}visitQuad(t){throw Error("Method visitQuad() has not been implemented.")}visitTriangleFan(t){throw Error("Method visitTriangleFan() has not been implemented.")}visitTriangleStrip(t){throw Error("Method visitTriangleStrip() has not been implemented.")}visitQuadStrip(t){throw Error("Method visitQuadStrip() has not been implemented.")}}class w extends D{path=new Path2D;strokeWeight;constructor({strokeWeight:t}){super(),this.strokeWeight=t}visitAnchor(t){let r=t.getEndVertex();this.path.moveTo(r.position.x,r.position.y)}visitLineSegment(t){if(t.isClosing)this.path.closePath();else{let r=t.getEndVertex();this.path.lineTo(r.position.x,r.position.y)}}visitBezierSegment(t){let[r,n,i]=t.vertices;switch(t.order){case 2:this.path.quadraticCurveTo(r.position.x,r.position.y,n.position.x,n.position.y);break;case 3:this.path.bezierCurveTo(r.position.x,r.position.y,n.position.x,n.position.y,i.position.x,i.position.y)}}visitSplineSegment(t){let r=t._shape;if(t._splineProperties.ends===o.a0&&!t._comesAfterSegment){let r=t._firstInterpolatedVertex;this.path.moveTo(r.position.x,r.position.y)}let n=t.getControlPoints().map(t=>r.vertexToArray(t));for(let i of r.catmullRomToBezier(n,t._splineProperties.tightness).map(t=>t.map(t=>r.arrayToVertex(t)))){let t=i.flatMap(t=>[t.position.x,t.position.y]);this.path.bezierCurveTo(...t)}}visitPoint(t){let{x:r,y:n}=t.vertices[0].position;this.path.moveTo(r,n),this.path.lineTo(r+1e-5,n)}visitLine(t){let{x:r,y:n}=t.vertices[0].position,{x:i,y:s}=t.vertices[1].position;this.path.moveTo(r,n),this.path.lineTo(i,s)}visitTriangle(t){let[r,n,i]=t.vertices;this.path.moveTo(r.position.x,r.position.y),this.path.lineTo(n.position.x,n.position.y),this.path.lineTo(i.position.x,i.position.y),this.path.closePath()}visitQuad(t){let[r,n,i,s]=t.vertices;this.path.moveTo(r.position.x,r.position.y),this.path.lineTo(n.position.x,n.position.y),this.path.lineTo(i.position.x,i.position.y),this.path.lineTo(s.position.x,s.position.y),this.path.closePath()}visitTriangleFan(t){let[r,...n]=t.vertices;for(let t=0;t<n.length-1;t++){let i=n[t],s=n[t+1];this.path.moveTo(r.position.x,r.position.y),this.path.lineTo(i.position.x,i.position.y),this.path.lineTo(s.position.x,s.position.y),this.path.closePath()}}visitTriangleStrip(t){for(let r=0;r<t.vertices.length-2;r++){let n=t.vertices[r],i=t.vertices[r+1],s=t.vertices[r+2];this.path.moveTo(n.position.x,n.position.y),this.path.lineTo(i.position.x,i.position.y),this.path.lineTo(s.position.x,s.position.y),this.path.closePath()}}visitQuadStrip(t){for(let r=0;r<t.vertices.length-3;r+=2){let n=t.vertices[r],i=t.vertices[r+1],s=t.vertices[r+2],o=t.vertices[r+3];this.path.moveTo(n.position.x,n.position.y),this.path.lineTo(i.position.x,i.position.y),this.path.lineTo(o.position.x,o.position.y),this.path.lineTo(s.position.x,s.position.y),this.path.closePath()}}}class S extends D{contours=[];curveDetail;pointsToLines;constructor({curveDetail:t=1,pointsToLines:r=!0}={}){super(),this.curveDetail=t,this.pointsToLines=r}lastContour(){return this.contours[this.contours.length-1]}visitAnchor(t){this.contours.push([]);let r=t._nextPrimitive;r?.canOverrideAnchor?this.lastContour().push(r._firstInterpolatedVertex):this.lastContour().push(t.getEndVertex())}visitLineSegment(t){this.lastContour().push(t.getEndVertex())}visitBezierSegment(t){let r=this.lastContour(),n=Math.max(1,Math.ceil(t.hullLength()*this.curveDetail)),i=[t.getStartVertex(),...t.vertices].map(r=>t._shape.vertexToArray(r));for(let s=0;s<n;s++){let o=(s+1)/n;r.push(t._shape.arrayToVertex(3===t.order?t._shape.evaluateCubicBezier(i,o):t._shape.evaluateQuadraticBezier(i,o)))}}visitSplineSegment(t){let r=t._shape,n=this.lastContour(),i=t.getControlPoints().map(t=>r.vertexToArray(t)),s=r.catmullRomToBezier(i,t._splineProperties.tightness),o=r.vertexToArray(t._firstInterpolatedVertex);for(let t of s){let i=[o,...t],s=Math.max(1,Math.ceil(a(i.map(t=>r.arrayToVertex(t)))*this.curveDetail));for(let t=0;t<s;t++){let o=(t+1)/s;n.push(r.arrayToVertex(r.evaluateCubicBezier(i,o)))}o=t[2]}}visitPoint(t){this.pointsToLines?this.contours.push(...t.vertices.map(t=>[t,t])):this.contours.push(t.vertices.slice())}visitLine(t){this.contours.push(t.vertices.slice())}visitTriangle(t){this.contours.push(t.vertices.slice())}visitQuad(t){this.contours.push(t.vertices.slice())}visitTriangleFan(t){this.contours.push(t.vertices.slice())}visitTriangleStrip(t){this.contours.push(t.vertices.slice())}visitQuadStrip(t){this.contours.push(t.vertices.slice())}}class F extends D{constructor(){super()}}function T(t,r){t.Shape=C,t.Contour=h,t.ShapePrimitive=u,t.Vertex=l,t.Anchor=c,t.Segment=d,t.LineSegment=p,t.BezierSegment=f,t.SplineSegment=m,t.Point=g,t.Line=y,t.Triangle=v,t.Quad=b,t.TriangleFan=x,t.TriangleStrip=_,t.QuadStrip=A,t.PrimitiveVisitor=
88D,t.PrimitiveToPath2DConverter=w,t.PrimitiveToVerticesConverter=S,t.PointAtLengthGetter=F,r.bezierOrder=function(t){return this._renderer.bezierOrder(t)},r.splineVertex=function(...t){let r=0,n=0,i=0,s=0,o=0;2===t.length?[r,n]=t:4===t.length?[r,n,s,o]=t:3===t.length?[r,n,i]=t:5===t.length&&([r,n,i,s,o]=t),this._renderer.splineVertex(r,n,i,s,o)},r.splineProperty=function(t,r){return this._renderer.splineProperty(t,r)},r.splineProperties=function(t){return this._renderer.splineProperties(t)},r.vertex=function(t,r){let n,i,s;n=i=s=0,3==arguments.length?n=arguments[2]:4==arguments.length?(i=arguments[2],s=arguments[3]):5==arguments.length&&(n=arguments[2],i=arguments[3],s=arguments[4]),this._renderer.vertex(t,r,n,i,s)},r.beginContour=function(t){this._renderer.beginContour(t)},r.endContour=function(t=o.Q){this._renderer.endContour(t)}}"undefined"!=typeof p5&&T(p5,p5.prototype)},72672:(t,r,n)=>{"use strict";n.d(r,{A:()=>i});let i={gamut_mapping:"css",precision:5,deltaE:"76",verbose:globalThis?.process?.env?.NODE_ENV?.toLowerCase()!=="test",warn:function(t){this.verbose&&globalThis?.console?.warn?.(t)}}},75386:(t,r,n)=>{"use strict";n.d(r,{x:()=>s});var i=n(58905);function s(t){let r={},n={},s="",o=function(n,o){s+=t(`STROKE_CAP_${n}`,`${o}`,"u32"),r[i.a3[n]]=o},a=function(r,o){s+=t(`STROKE_JOIN_${r}`,`${o}`,"u32"),n[i.a3[r]]=o};return o("ROUND",0),o("PROJECT",1),o("SQUARE",2),a("ROUND",0),a("MITER",1),a("BEVEL",2),{STROKE_CAP_ENUM:r,STROKE_JOIN_ENUM:n,lineDefs:s}}},75516:(t,r)=>{var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");r.encode=function(t){if(0<=t&&t<n.length)return n[t];throw TypeError("Must be between 0 and 63: "+t)},r.decode=function(t){return 65<=t&&t<=90?t-65:97<=t&&t<=122?t-97+26:48<=t&&t<=57?t-48+52:43==t?62:47==t?63:-1}},75671:(t,r,n)=>{"use strict";n.d(r,{A:()=>u,V:()=>l});var i=n(58905),s=n(43140),o=n(39247),a=n(69689);class l{constructor(t,r,n,i){this.renderer=i,this.vertices=[],this.boundingBoxCache=null,this.lineVertices=new s.U,this.lineTangentsIn=new s.U,this.lineTangentsOut=new s.U,this.lineSides=new s.U,this.vertexNormals=[],this.faces=[],this.uvs=[],this.edges=[],this.vertexColors=[],this.vertexStrokeColors=[],this.userVertexProperties={},this.lineVertexColors=new s.U,this.detailX=void 0!==t?t:1,this.detailY=void 0!==r?r:1,this.dirtyFlags={},this._hasFillTransparency=void 0,this._hasStrokeTransparency=void 0,this.gid=`_p5_Geometry_${l.nextId}`,l.nextId++,n instanceof Function&&n.call(this)}calculateBoundingBox(){if(this.boundingBoxCache)return this.boundingBoxCache;let t=new o.M(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),r=new o.M(5e-324,5e-324,5e-324);for(let n=0;n<this.vertices.length;n++){let i=this.vertices[n];t.x=Math.min(t.x,i.x),t.y=Math.min(t.y,i.y),t.z=Math.min(t.z,i.z),r.x=Math.max(r.x,i.x),r.y=Math.max(r.y,i.y),r.z=Math.max(r.z,i.z)}let n=new o.M(r.x-t.x,r.y-t.y,r.z-t.z),i=new o.M((t.x+r.x)/2,(t.y+r.y)/2,(t.z+r.z)/2);return this.boundingBoxCache={min:t,max:r,size:n,offset:i},this.boundingBoxCache}reset(){for(let t in this.renderer?.onReset?.(this),this._hasFillTransparency=void 0,this._hasStrokeTransparency=void 0,this.lineVertices.clear(),this.lineTangentsIn.clear(),this.lineTangentsOut.clear(),this.lineSides.clear(),this.vertices.length=0,this.edges.length=0,this.vertexColors.length=0,this.vertexStrokeColors.length=0,this.lineVertexColors.clear(),this.vertexNormals.length=0,this.uvs.length=0,this.userVertexProperties)this.userVertexProperties[t].delete();this.userVertexProperties={},this.dirtyFlags={}}hasFillTransparency(){if(void 0===this._hasFillTransparency){this._hasFillTransparency=!1;for(let t=0;t<this.vertexColors.length;t+=4)if(this.vertexColors[t+3]<1){this._hasFillTransparency=!0;break}}return this._hasFillTransparency}hasStrokeTransparency(){if(void 0===this._hasStrokeTransparency){this._hasStrokeTransparency=!1;for(let t=0;t<this.lineVertexColors.length;t+=4)if(this.lineVertexColors[t+3]<1){this._hasStrokeTransparency=!0;break}}return this._hasStrokeTransparency}clearColors(){return this.vertexColors=[],this}saveObj(t="model.obj"){let r="";
88if(this.vertices.forEach(t=>{r+=`v ${t.x} ${t.y} ${t.z}
89`}),this.uvs&&this.uvs.length>0)for(let t=0;t<this.uvs.length;t+=2)r+=`vt ${this.uvs[t]} ${this.uvs[t+1]}
90`;this.vertexNormals&&this.vertexNormals.length>0&&this.vertexNormals.forEach(t=>{r+=`vn ${t.x} ${t.y} ${t.z}
91`}),this.faces.forEach(t=>{let n="f";t.forEach(t=>{n+=" ",n+=t+1,(this.vertexNormals.length>0||this.uvs.length>0)&&(n+="/",this.uvs.length>0&&(n+=t+1),n+="/",this.vertexNormals.length>0&&(n+=t+1))}),r+=n+"\n"});let n=new Blob([r],{type:"text/plain"});(0,a.P)(n,t,"obj")}saveStl(t="model.stl",{binary:r=!1}={}){let n,i=t.substring(0,t.lastIndexOf(".")),s=[];for(let t of this.faces){let r=o.M.sub(this.vertices[t[1]],this.vertices[t[0]]),n=o.M.sub(this.vertices[t[2]],this.vertices[t[0]]),i=r.y*n.z-r.z*n.y,a=r.z*n.x-r.x*n.z,l=r.x*n.y-r.y*n.x;s.push(new o.M(i,a,l).normalize())}if(r){let t=80;for(let[r,i]of((n=new DataView(new ArrayBuffer(2*this.faces.length+3*this.faces.length*16+80+4))).setUint32(t,this.faces.length,!0),t+=4,Object.entries(this.faces))){let o=s[r];for(let r of(n.setFloat32(t,o.x,!0),t+=4,n.setFloat32(t,o.y,!0),t+=4,n.setFloat32(t,o.z,!0),t+=4,i)){let i=this.vertices[r];n.setFloat32(t,i.x,!0),t+=4,n.setFloat32(t,i.y,!0),t+=4,n.setFloat32(t,i.z,!0),t+=4}n.setUint16(t,0,!0),t+=2}}else{for(let[t,r]of(n="solid "+i+"\n",Object.entries(this.faces))){let i=s[t];for(let t of(n+=" facet norm "+i.x+" "+i.y+" "+i.z+"\n",n+="  outer loop\n",r)){let r=this.vertices[t];n+="   vertex "+r.x+" "+r.y+" "+r.z+"\n"}n+="  endloop\n",n+=" endfacet\n"}n+="endsolid "+i+"\n"}let l=new Blob([n],{type:"text/plain"});(0,a.P)(l,t,"stl")}flipU(){this.uvs=this.uvs.flat().map((t,r)=>r%2==0?1-t:t)}flipV(){this.uvs=this.uvs.flat().map((t,r)=>r%2==0?t:1-t)}computeFaces(){let t,r,n,i;this.faces.length=0;let s=this.detailX+1;for(let o=0;o<this.detailY;o++)for(let a=0;a<this.detailX;a++)t=o*s+a,r=o*s+a+1,n=(o+1)*s+a+1,i=(o+1)*s+a,this.faces.push([t,r,i]),this.faces.push([i,r,n]);return this}
91_getFaceNormal(t){let r=this.faces[t],n=this.vertices[r[0]],i=this.vertices[r[1]],s=this.vertices[r[2]],a=o.M.sub(i,n),l=o.M.sub(s,n),u=o.M.cross(a,l),h=o.M.mag(u),c=h/(o.M.mag(a)*o.M.mag(l));return 0===c||isNaN(c)?(console.warn("p5.Geometry.prototype._getFaceNormal:","face has colinear sides or a repeated vertex"),u):(c>1&&(c=1),u.mult(Math.asin(c)/h))}computeNormals(t=i.a7,{roundToPrecision:r=3}={}){let n,s=this.vertexNormals,a=this.vertices,l=this.faces;if(t===i.a8){let t={},n=[],i=Math.pow(10,r),s=t=>Math.round(t*i)/i,o=t=>`${s(t.x)},${s(t.y)},${s(t.z)}`;for(let r=0;r<a.length;r++){let i=a[r],s=o(i);void 0===t[s]&&(t[s]=n.length,n.push(i))}l.forEach(r=>{for(let n=0;n<3;++n){let i=o(a[r[n]]);r[n]=t[i]}}),this.edges.forEach(r=>{for(let n=0;n<2;++n){let i=o(a[r[n]]);r[n]=t[i]}}),this.vertices=a=n}for(n=0,s.length=0;n<a.length;++n)s.push(new o.M);for(l.forEach((t,r)=>{let n=this._getFaceNormal(r);for(let r=0;r<3;++r)s[t[r]].add(n)}),n=0;n<a.length;++n)s[n].normalize();return this}averageNormals(){for(let t=0;t<=this.detailY;t++){let r=this.detailX+1,n=o.M.add(this.vertexNormals[t*r],this.vertexNormals[t*r+this.detailX]);n=o.M.div(n,2),this.vertexNormals[t*r]=n,this.vertexNormals[t*r+this.detailX]=n}return this}averagePoleNormals(){let t=new o.M(0,0,0);for(let r=0;r<this.detailX;r++)t.add(this.vertexNormals[r]);t=o.M.div(t,this.detailX);for(let r=0;r<this.detailX;r++)this.vertexNormals[r]=t;t=new o.M(0,0,0);for(let r=this.vertices.length-1;r>this.vertices.length-1-this.detailX;r--)t.add(this.vertexNormals[r]);t=o.M.div(t,this.detailX);for(let r=this.vertices.length-1;r>this.vertices.length-1-this.detailX;r--)this.vertexNormals[r]=t;return this}_makeTriangleEdges(){this.edges.length=0;for(let t=0;t<this.faces.length;t++)this.edges.push([this.faces[t][0],this.faces[t][1]]),this.edges.push([this.faces[t][1],this.faces[t][2]]),this.edges.push([this.faces[t][2],this.faces[t][0]]);return this}makeEdgesFromFaces(){this._makeTriangleEdges()}_edgesToVertices(){let t;this.lineVertices.clear(),this.lineTangentsIn.clear(),this.lineTangentsOut.clear(),this.lineSides.clear();let r=new Map,n=new Set;for(let i=0;i<this.edges.length;i++){let s=this.edges[i-1],a=this.edges[i],l=a[0]===a[1],u=this.vertices[a[0]],h=this.vertices[a[1]],c=this.vertexStrokeColors.length>0&&s?this.vertexStrokeColors.slice(4*s[1],(s[1]+1)*4):[0,0,0,0],d=this.vertexStrokeColors.length>0?this.vertexStrokeColors.slice(4*a[0],(a[0]+1)*4):[0,0,0,0],p=this.vertexStrokeColors.length>0?this.vertexStrokeColors.slice(4*a[1],(a[1]+1)*4):[0,0,0,0],f=l?new o.M(0,1,0):h.copy().sub(u).normalize(),m=f.magSq()>0;if(m&&this._addSegment(u,h,d,p,f),!this.renderer?._simpleLines){if(i>0&&s[1]===a[0])!n.has(a[0])&&(n.add(a[0]),r.delete(a[0]),t&&m&&f.dot(t)<1-1e-8&&this._addJoin(u,t,f,d));else if(l)this._addCap(u,f.copy().mult(-1),d),this._addCap(u,f,d);else{if(m&&!n.has(a[0])){let t=r.get(a[0]);t?(this._addJoin(u,t.dir,f,d),r.delete(a[0]),n.add(a[0])):r.set(a[0],{point:u,dir:f.copy().mult(-1),color:d})}if(!l&&t&&!n.has(s[1])){let i=r.get(s[1]);i?(this._addJoin(this.vertices[s[1]],t,i.dir.copy().mult(-1),c),r.delete(s[1]),n.add(s[1])):r.set(s[1],{point:this.vertices[s[1]],dir:t,color:c}),t=void 0}}if(i===this.edges.length-1&&!n.has(a[1])){let t=r.get(a[1]);t?(this._addJoin(h,f,t.dir.copy().mult(-1),p),r.delete(a[1]),n.add(a[1])):r.set(a[1],{point:h,dir:f,color:p})}m&&(t=f)}}for(let{point:t,dir:n,color:i}of r.values())this._addCap(t,n,i);return this}_addSegment(t,r,n,i,s){let o=t.array(),a=r.array(),l=s.array();for(let t of(this.lineSides.push(1,1,-1,1,-1,-1),[this.lineTangentsIn,this.lineTangentsOut]))for(let r=0;r<6;r++)t.push(...l);return this.lineVertices.push(...o,...a,...o,...a,...a,...o),this.renderer?._simpleLines||this.lineVertexColors.push(...n,...i,...n,...i,...i,...n),this}_addCap(t,r,n){let i=t.array(),s=r.array(),o=[0,0,0];for(let t=0;t<6;t++)this.lineVertices.push(...i),this.lineTangentsIn.push(...s),this.lineTangentsOut.push(...o),this.lineVertexColors.push(...n);return this.lineSides.push(-1,2,-2,1,2,-1),this}_addJoin(t,r,n,i){let s=t.array(),o=r.array(),a=n.array();for(let t=0;t<12;t++)this.lineVertices.push(...s),this.lineTangentsIn.push(...o),this.lineTangentsOut.push(...a),this.lineVertexColors.push(...i);return this.lineSides.push(-1,-3,-2,-1,0,-3),this.lineSides.push(3,1,2,3,0,1),this}normalize(){if(this.vertices.length>0){let t=this.vertices[0].copy(),r=this.vertices[0].copy();for(let n=0;n<this.vertices.length;n++)t.x=Math.max(t.x,this.vertices[n].x),r.x=Math.min(r.x,this.vertices[n].x),t.y=Math.max(t.y,this.vertices[n].y),r.y=Math.min(r.y,this.vertices[n].y),t.z=Math.max(t.z,this.vertices[n].z),r.z=Math.min(r.z,this.vertices[n].z);let n=o.M.lerp(t,r,.5),i=o.M.sub(t,r),s=200/Math.max(Math.max(i.x,i.y),i.z);for(let t=0;t<this.vertices.length;t++)this.vertices[t].sub(n),this.vertices[t].mult(s)}return this}vertexProperty(t,r,n){let i;this.userVertexProperties[t]||(i=this.userVertexProperties[t]=this._userVertexPropertyHelper(t,r,n)),i=this.userVertexProperties[t],n?i.pushDirect(r):(i.setCurrentData(r),i.pushCurrentData())}_userVertexPropertyHelper(t,r,n){return this[(this.userVertexProperties[t]={name:t,dataSize:n||(r.length?r.length:1),geometry:this,getName(){return this.name},getCurrentData(){return void 0===this.currentData&&(this.currentData=Array(this.getDataSize()).fill(0)),this.currentData},getDataSize(){return this.dataSize},getSrcName(){return this.name.concat("Src")},getDstName(){return this.name.concat("Buffer")},getSrcArray(){let t=this.getSrcName();return this.geometry[t]},setCurrentData(t){t.length&&t.length,this.currentData=t},pushCurrentData(){let t=this.getCurrentData();this.pushDirect(t)}
91,pushDirect(t){t.length?this.getSrcArray().push(...t):this.getSrcArray().push(t)},resetSrcArray(){this.geometry[this.getSrcName()]=[]},delete(){let t=this.getSrcName();delete this.geometry[t],delete this}}).getSrcName()]=[],this.userVertexProperties[t]}}function u(t,r){t.Geometry=l}l.nextId=0,"undefined"!=typeof p5&&u(p5,p5.prototype)},76988:(t,r)=>{!function t(r){"use strict";var n,i,s,o,a,l;function u(t){var r,n,i={};for(r in t)t.hasOwnProperty(r)&&("object"==typeof(n=t[r])&&null!==n?i[r]=u(n):i[r]=n);return i}function h(t,r){this.parent=t,this.key=r}function c(t,r,n,i){this.node=t,this.path=r,this.wrap=n,this.ref=i}function d(){}function p(t){return null!=t&&"object"==typeof t&&"string"==typeof t.type}function f(t,r){return(t===n.ObjectExpression||t===n.ObjectPattern)&&"properties"===r}function m(t,r){for(var n=t.length-1;n>=0;--n)if(t[n].node===r)return!0;return!1}function g(t,r){return new d().traverse(t,r)}return n={AssignmentExpression:"AssignmentExpression",AssignmentPattern:"AssignmentPattern",ArrayExpression:"ArrayExpression",ArrayPattern:"ArrayPattern",ArrowFunctionExpression:"ArrowFunctionExpression",AwaitExpression:"AwaitExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ChainExpression:"ChainExpression",ClassBody:"ClassBody",ClassDeclaration:"ClassDeclaration",ClassExpression:"ClassExpression",ComprehensionBlock:"ComprehensionBlock",ComprehensionExpression:"ComprehensionExpression",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DebuggerStatement:"DebuggerStatement",DirectiveStatement:"DirectiveStatement",DoWhileStatement:"DoWhileStatement",EmptyStatement:"EmptyStatement",ExportAllDeclaration:"ExportAllDeclaration",ExportDefaultDeclaration:"ExportDefaultDeclaration",ExportNamedDeclaration:"ExportNamedDeclaration",ExportSpecifier:"ExportSpecifier",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForInStatement:"ForInStatement",ForOfStatement:"ForOfStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",GeneratorExpression:"GeneratorExpression",Identifier:"Identifier",IfStatement:"IfStatement",ImportExpression:"ImportExpression",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",ImportNamespaceSpecifier:"ImportNamespaceSpecifier",ImportSpecifier:"ImportSpecifier",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",MetaProperty:"MetaProperty",MethodDefinition:"MethodDefinition",ModuleSpecifier:"ModuleSpecifier",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",ObjectPattern:"ObjectPattern",PrivateIdentifier:"PrivateIdentifier",Program:"Program",Property:"Property",PropertyDefinition:"PropertyDefinition",RestElement:"RestElement",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SpreadElement:"SpreadElement",Super:"Super",SwitchStatement:"SwitchStatement",SwitchCase:"SwitchCase",TaggedTemplateExpression:"TaggedTemplateExpression",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement",YieldExpression:"YieldExpression"},s={AssignmentExpression:["left","right"],AssignmentPattern:["left","right"],ArrayExpression:["elements"],ArrayPattern:["elements"],ArrowFunctionExpression:["params","body"],AwaitExpression:["argument"],BlockStatement:["body"],BinaryExpression:["left","right"],BreakStatement:["label"],CallExpression:["callee","arguments"],CatchClause:["param","body"],ChainExpression:["expression"],ClassBody:["body"],ClassDeclaration:["id","superClass","body"],ClassExpression:["id","superClass","body"],ComprehensionBlock:["left","right"],ComprehensionExpression:["blocks","filter","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DirectiveStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExportAllDeclaration:["source"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source"],ExportSpecifier:["exp
91orted","local"],ExpressionStatement:["expression"],ForStatement:["init","test","update","body"],ForInStatement:["left","right","body"],ForOfStatement:["left","right","body"],FunctionDeclaration:["id","params","body"],FunctionExpression:["id","params","body"],GeneratorExpression:["blocks","filter","body"],Identifier:[],IfStatement:["test","consequent","alternate"],ImportExpression:["source"],ImportDeclaration:["specifiers","source"],ImportDefaultSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["imported","local"],Literal:[],LabeledStatement:["label","body"],LogicalExpression:["left","right"],MemberExpression:["object","property"],MetaProperty:["meta","property"],MethodDefinition:["key","value"],ModuleSpecifier:[],NewExpression:["callee","arguments"],ObjectExpression:["properties"],ObjectPattern:["properties"],PrivateIdentifier:[],Program:["body"],Property:["key","value"],PropertyDefinition:["key","value"],RestElement:["argument"],ReturnStatement:["argument"],SequenceExpression:["expressions"],SpreadElement:["argument"],Super:[],SwitchStatement:["discriminant","cases"],SwitchCase:["test","consequent"],TaggedTemplateExpression:["tag","quasi"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],YieldExpression:["argument"]},i={Break:o={},Skip:a={},Remove:l={}},h.prototype.replace=function(t){this.parent[this.key]=t},h.prototype.remove=function(){return Array.isArray(this.parent)?(this.parent.splice(this.key,1),!0):(this.replace(null),!1)},d.prototype.path=function(){var t,r,n,i,s;function o(t,r){if(Array.isArray(r))for(n=0,i=r.length;n<i;++n)t.push(r[n]);else t.push(r)}if(!this.__current.path)return null;for(t=2,s=[],r=this.__leavelist.length;t<r;++t)o(s,this.__leavelist[t].path);return o(s,this.__current.path),s},d.prototype.type=function(){return this.current().type||this.__current.wrap},d.prototype.parents=function(){var t,r,n;for(t=1,n=[],r=this.__leavelist.length;t<r;++t)n.push(this.__leavelist[t].node);return n},d.prototype.current=function(){return this.__current.node},d.prototype.__execute=function(t,r){var n,i;return i=void 0,n=this.__current,this.__current=r,this.__state=null,t&&(i=t.call(this,r.node,this.__leavelist[this.__leavelist.length-1].node)),this.__current=n,i},d.prototype.notify=function(t){this.__state=t},d.prototype.skip=function(){this.notify(a)},d.prototype.break=function(){this.notify(o)},d.prototype.remove=function(){this.notify(l)},d.prototype.__initialize=function(t,r){this.visitor=r,this.root=t,this.__worklist=[],this.__leavelist=[],this.__current=null,this.__state=null,this.__fallback=null,"iteration"===r.fallback?this.__fallback=Object.keys:"function"==typeof r.fallback&&(this.__fallback=r.fallback),this.__keys=s,r.keys&&(this.__keys=Object.assign(Object.create(this.__keys),r.keys))},d.prototype.traverse=function(t,r){var n,i,s,l,u,h,d,g,y,v,b,x;for(this.__initialize(t,r),x={},n=this.__worklist,i=this.__leavelist,n.push(new c(t,null,null,null)),i.push(new c(null,null,null,null));n.length;){if((s=n.pop())===x){if(s=i.pop(),h=this.__execute(r.leave,s),this.__state===o||h===o)return;continue}if(s.node){if(h=this.__execute(r.enter,s),this.__state===o||h===o)return;if(n.push(x),i.push(s),this.__state===a||h===a)continue;if(u=(l=s.node).type||s.wrap,!(v=this.__keys[u]))if(this.__fallback)v=this.__fallback(l);else throw Error("Unknown node type "+u+".");for(g=v.length;(g-=1)>=0;)if(b=l[d=v[g]]){if(Array.isArray(b)){for(y=b.length;(y-=1)>=0;)if(!(!b[y]||m(i,b[y]))){if(f(u,v[g]))s=new c(b[y],[d,y],"Property",null);else{if(!p(b[y]))continue;s=new c(b[y],[d,y],null,null)}n.push(s)}}else if(p(b)){if(m(i,b))continue;n.push(new c(b,d,null,null))}}}}},d.prototype.replace=function(t,r){var n,i,s,u,d,m,g,y,v,b,x,_,A;function E(t){var r,i,s,o;if(t.ref.remove()){for(i=t.ref.key,o=t.ref.parent,r=n.length;r--;)if((s=n[r]).ref&&s.ref.parent===o){if(s.ref.key<i)break;--s.ref.key}}}for(this.__initialize(t,r),x={},n=this.__worklist,i=this.__leavelist,_={root:t},m=new c(t,null,null,new h(_,"root")),n.push(m),i.push(m);n.length;){if((m=n.pop())===x){if(m=i.pop(),void 0!==(d=this.__execute(r.leave,m))&&d!==o&&d!==a&&d!==l&&m.ref.replace(d),(this.__state===l||d===l)&&E(m),this.__state===o||d===o)return _.root;continue}if(void 0!==(d=this.__execute(r.enter,m))&&d!==o&&d!==a&&d!==l&&(m.ref.replace(d),m.node=d),(this.__state===l||d===l)&&(E(m),m.node=null),this.__state===o||d===o)break;if(s=m.node){if(n.push(x),i.push(m),this.__state!==a&&d!==a){if(u=s.type||m.wrap,!(v=this.__keys[u]))if(this.__fallback)v=this.__fallback(s);else throw Error("Unknown node type "+u+".");for(g=v.length;(g-=1)>=0;)if(b=s[A=v[g]])if(Array.isArray(b)){for(y=b.length;(y-=1)>=0;
91)if(b[y]){if(f(u,v[g]))m=new c(b[y],[A,y],"Property",new h(b,y));else{if(!p(b[y]))continue;m=new c(b[y],[A,y],null,new h(b,y))}n.push(m)}}else p(b)&&n.push(new c(b,A,null,new h(s,A)))}}}return _.root},r.Syntax=n,r.traverse=g,r.replace=function(t,r){return new d().replace(t,r)},r.attachComments=function(t,r,n){var s,o,a,l,h=[];if(!t.range)throw Error("attachComments needs range information");if(!n.length){if(r.length){for(a=0,o=r.length;a<o;a+=1)(s=u(r[a])).extendedRange=[0,t.range[0]],h.push(s);t.leadingComments=h}return t}for(a=0,o=r.length;a<o;a+=1)h.push(function(t,r){var n;return n=function(t,r){var n,i,s,o;for(i=t.length,s=0;i;)r(t[o=s+(n=i>>>1)])?i=n:(s=o+1,i-=n+1);return s}(r,function(r){return r.range[0]>t.range[0]}),t.extendedRange=[t.range[0],t.range[1]],n!==r.length&&(t.extendedRange[1]=r[n].range[0]),(n-=1)>=0&&(t.extendedRange[0]=r[n].range[1]),t}(u(r[a]),n));return l=0,g(t,{enter:function(t){for(var r;l<h.length&&!((r=h[l]).extendedRange[1]>t.range[0]);)r.extendedRange[1]===t.range[0]?(t.leadingComments||(t.leadingComments=[]),t.leadingComments.push(r),h.splice(l,1)):l+=1;return l===h.length?i.Break:h[l].extendedRange[0]>t.range[1]?i.Skip:void 0}}),l=0,g(t,{leave:function(t){for(var r;l<h.length&&(r=h[l],!(t.range[1]<r.extendedRange[0]));)t.range[1]===r.extendedRange[0]?(t.trailingComments||(t.trailingComments=[]),t.trailingComments.push(r),h.splice(l,1)):l+=1;return l===h.length?i.Break:h[l].extendedRange[0]>t.range[1]?i.Skip:void 0}}),t},r.VisitorKeys=s,r.VisitorOption=i,r.Controller=d,r.cloneEnvironment=function(){return t({})},r}(r)},79690:(t,r,n)=>{"use strict";function i(t,r){r.applyMatrix=function(...t){let r=t[0]instanceof Object.getPrototypeOf(Uint8Array);return Array.isArray(t[0])||r?this._renderer.applyMatrix(...t[0]):this._renderer.applyMatrix(...t),this},r.resetMatrix=function(){return this._renderer.resetMatrix(),this},r.rotate=function(t,r){return this._renderer.rotate(this._toRadians(t),r),this},r.rotateX=function(t){return this._assert3d("rotateX"),this._renderer.rotateX(this._toRadians(t)),this},r.rotateY=function(t){return this._assert3d("rotateY"),this._renderer.rotateY(this._toRadians(t)),this},r.rotateZ=function(t){return this._assert3d("rotateZ"),this._renderer.rotateZ(this._toRadians(t)),this},r.scale=function(r,n,i){if(r instanceof t.Vector){let t=r;r=t.x,n=t.y,i=t.z}else if(Array.isArray(r)){let t=r;r=t[0],n=t[1],i=t[2]||1}return isNaN(n)?n=i=r:isNaN(i)&&(i=1),this._renderer.scale(r,n,i),this},r.shearX=function(t){let r=this._toRadians(t);return this._renderer.applyMatrix(1,0,Math.tan(r),1,0,0),this},r.shearY=function(t){let r=this._toRadians(t);return this._renderer.applyMatrix(1,Math.tan(r),0,1,0,0),this},r.translate=function(t,r,n){return this._renderer.isP3D?this._renderer.translate(t,r,n):this._renderer.translate(t,r),this},r.push=function(){this._renderer.push()},r.pop=function(){this._renderer.pop()}}n.d(r,{A:()=>i}),"undefined"!=typeof p5&&i(p5,p5.prototype)},80841:(t,r,n)=>{"use strict";n.d(r,{A:()=>u});var i=n(70598);let s=new i.A({id:"srgb-linear",name:"Linear sRGB",white:"D65",toXYZ_M:[[.41239079926595934,.357584339383878,.1804807884018343],[.21263900587151027,.715168678767756,.07219231536073371],[.01933081871559182,.11919477979462598,.9505321522496607]],fromXYZ_M:[[3.2409699419045226,-1.537383177570094,-.4986107602930034],[-.9692436362808796,1.8759675015077202,.04155505740717559],[.05563007969699366,-.20397695888897652,1.0569715142428786]]}),o={aliceblue:[240/255,248/255,1],antiquewhite:[250/255,235/255,215/255],aqua:[0,1,1],aquamarine:[127/255,1,212/255],azure:[240/255,1,1],beige:[245/255,245/255,220/255],bisque:[1,228/255,196/255],black:[0,0,0],blanchedalmond:[1,235/255,205/255],blue:[0,0,1],blueviolet:[138/255,43/255,226/255],brown:[165/255,42/255,42/255],burlywood:[222/255,184/255,135/255],cadetblue:[95/255,158/255,160/255],chartreuse:[127/255,1,0],chocolate:[210/255,105/255,30/255],coral:[1,127/255,80/255],cornflowerblue:[100/255,149/255,237/255],cornsilk:[1,248/255,220/255],crimson:[220/255,20/255,60/255],cyan:[0,1,1],darkblue:[0,0,139/255],darkcyan:[0,139/255,139/255],darkgoldenrod:[184/255,134/255,11/255],darkgray:[169/255,169/255,169/255],darkgreen:[0,100/255,0],darkgrey:[169/255,169/255,169/255],darkkhaki:[189/255,183/255,107/255],darkmagenta:[139/255,0,139/255],darkolivegreen:[85/255,107/255,47/255],darkorange:[1,140/255,0],darkorchid:[.6,50/255,.8],darkred:[139/255,0,0],darksalmon:[233/255,150/255,122/255],darkseagreen:[143/255,188/255,143/255],darkslateblue:[72/255,61/255,139/255],darkslategray:[47/255,79/255,79/255],darkslategrey:[47/255,79/255,79/255],darkturquoise:[0,206/255,209/255],darkviolet:[148/255,0,211/255],deeppink:[1,20/255,147/255],deepskyblue:[0,191/255,1],dimgray:[105/255,105/255,105/255],dimgrey:[105/255,105/255,105/255],dodgerblue:[30/255,144/255,1],firebrick:[178/255,34/255,34/255],floralwhite:[1,250/255,240/255],forestgreen:[34/255,139/255,34/255],fuchsia:[1,0,1],gainsboro:[220/255,220/255,220/255],ghostwhite:[248/255,248/255,1],gold:[1,215/255,0],goldenrod:[218/255,165/255,32/255],gray:[128/255,128/255,128/255],green:[0,128/255,0],greenyellow:[173/255,1,47/255],grey:[128/255,128/255,128/255],honeydew:[240/255,1,240/255],hotpink:[1,105/255,180/255],indianred:[205/255,92/255,92/255],indigo:[75/255,0,130/255],ivory:[1,1,240/255],khaki:[240/255,230/255,140/255],lavender:[230/255,230/255,250/255],lavenderblush:[1,240/255,245/255],lawngreen:[124/255,252/255,0],lemonchiffon:[1,250/255,205/255],lightblue:[173/255,216/255,230/255],lightcoral:[240/255,128/255,128/255],lightcyan:[224/255,1,1],lightgoldenrodyellow:[250/255,250/255,210/255],lightgray:[211/255,211/255,211/255],lightgreen:[144/255,238/255,144/255],lightgrey:[211/255,211/255,211/255],lightpink:[1,182/255,193/255],lightsalmon:[1,160/255,122/255],lightseagreen:[32/255,178/255,170/255],lightskyblue:[135/255,206/255,250/255],lightslategray:[119/255,136/255,.6],lightslategrey:[119/255,136/255,.6],lightsteelblue:[176/255,196/255,222/255],lightyellow:[1,1,224/255],lime:[0,1,0],limegreen:[50/255,205/255,50/255],linen:[250/255,240/255,230/255],magenta:[1,0,1],maroon:[128/255,0,0],mediumaquamarine:[.4,205/255,170/255],mediumblue:[0,0,205/255],mediumorchid:[186/255,85/255,211/255],mediumpurple:[147/255,112/255,219/255],mediumseagreen:[60/255,179/255,113/255],mediumslateblue:[123/255,104/255,238/255],mediumspringgreen:[0,250/255,154/255],mediumturquoise:[72/255,209/255,.8],mediumvioletred:[199/255,21/255,133/255],midnightblue:[25/255,25/255,112/255],mintcream:[245/255,1,250/255],mistyrose:[1,228/255,225/255],moccasin:[1,228/255,181/255],navajowhite:[1,222/255,173/255],navy:[0,0,128/255],oldlace:[253/255,245/255,230/255],olive:[128/255,128/255,0],olivedrab:[107/255,142/255,35/255],orange:[1,165/255,0],orangered:[1,69/255,0],orchid:[218/255,112/255,214/255],palegoldenrod:[238/255,232/255,170/255],palegreen:[152/255,251/255,152/255],paleturquoise:[175/255,238/255,238/255],palevioletred:[219/255,112/255,147/255],papayawhip:[1,239/255,213/255],peachpuff:[1,218/255,185/255],peru:[205/255,133/255,63/255],pink:[1,192/255,203/255],plum:[221/255,160/255,221/255],powderblue:[176/255,224/255,230/255],purple:[128/255,0,128/255],rebeccapurple:[.4,.2,.6],red:[1,0,0],rosybrown:[188/255,143/255,143/255],royalblue:[65/255,105/255,225/255],saddlebrown:[139/255,69/255,19/255],salmon:[250/255,128/255,114/255],sandybrown:[244/255,164/255,96/255],seagreen:[46/255,139/255,87/255],seashell:[1,245/255,238/255],sienna:[160/255,82/255,45/255],silver:[192/255,192/255,192/255],skyblue:[135/255,206/255,235/255],slateblue:[106/255,90/255,205/255],slategray:[112/255,128/255,144/255],slategrey:[112/255,128/255,144/255],snow:[1,250/255,250/255],springgreen:[0,1,127/255],steelblue:[70/255,130/255,180/255],tan:[210/255,180/255,140/255],teal:[0,128/255,128/255],thistle:[216/255,191/255,216/255],tomato:[1,99/255,71/255],turquoise:[64/255,224/255,208/255],violet:[238/255,130/255,238/255],wheat:[245/255,222/255,179/255],white:[1,1,1],whitesmoke:[245/255,245/255,245/255],yellow:[1,1,0],yellowgreen:[154/255,205/255,50/255]},a=[,,,].fill("<percentage> | <number>[0, 255]"),l=[,,,].fill("<number>[0, 255]"),u=new i.A({id:"srgb",name:"sRGB",base:s,fromBase:t=>t.map(t=>{let r=t<0?-1:1,n=t*r;return n>.0031308?r*(1.055*n**(1/2.4)-.055):12.92*t}),toBase:t=>t.map(t=>{let r=t<0?-1:1,n=t*r;return n<=.04045?t/12.92:r*((n+.055)/1.055)**2.4}),formats:{rgb:{coords:a},rgb_number:{name:"rgb",commas:!0,coords:l,alpha:!1},color:{},rgba:{coords:a,commas:!0,alpha:!0},rgba_number:{name:"rgba",commas:!0,coords:l},hex:{type:"custom",toGamut:!0,test:t=>/^#(([a-f0-9]{2}){3,4}|[a-f0-9]{3,4})$/i.test(t),parse(t){t.length<=5&&(t=t.replace(/[a-f0-9]/gi,"$&$&"));let r=[];return t.replace(/[a-f0-9]{2}/gi,t=>{r.push(parseInt(t,16)/255)}),{spaceId:"srgb",coords:r.slice(0,3),alpha:r.slice(3)[0]}},serialize:(t,r,{collapse:n=!0,alpha:i}={})=>{(!1!==i&&r<1||!0===i)&&t.push(r),t=t.map(t=>Math.round(255*t));let s=n&&t.every(t=>t%17==0);return"#"+t.map(t=>s?(t/17).toString(16):t.toString(16).padStart(2,"0")).join("")}},keyword:{type:"custom",test:t=>/^[a-z]+$/i.test(t),parse(t){t=t.toLowerCase();let r={spaceId:"srgb",coords:null,alpha:1};if("transparent"===t?(r.coords=o.black,r.alpha=0):r.coords=o[t],r.coords)return r}}}})},81273:(t,r,n)=>{"use strict";n.d(r,{A:()=>s});var i=n(43327);function s(t,r){t.Matrix=i.uq}n(39247),n(58905),n(10726),"undefined"!=typeof p5&&s(p5,p5.prototype)},82741:(t,r)=>{var n=Object.defineProperty;
91n(r,"__esModule",{value:!0}),((t,r)=>{for(var i in r)n(t,i,{get:r[i],enumerable:!0})})(r,{GIFEncoder:()=>E,applyPalette:()=>v,default:()=>F,nearestColor:()=>A,nearestColorIndex:()=>x,nearestColorIndexWithDistance:()=>_,prequantize:()=>y,quantize:()=>f,snapColorsToPalette:()=>b});var i={trailer:59};function s(t=256){let r=0,n=new Uint8Array(t);return{get buffer(){return n.buffer},reset(){r=0},bytesView:()=>n.subarray(0,r),bytes:()=>n.slice(0,r),writeByte(t){i(r+1),n[r]=t,r++},writeBytes(t,s=0,o=t.length){i(r+o);for(let i=0;i<o;i++)n[r++]=t[i+s]},writeBytesView(t,s=0,o=t.byteLength){i(r+o),n.set(t.subarray(s,s+o),r),r+=o}};function i(t){var i=n.length;if(i>=t)return;t=Math.max(t,i*(i<1048576?2:1.125)>>>0),0!=i&&(t=Math.max(t,256));let s=n;n=new Uint8Array(t),r>0&&n.set(s.subarray(0,r),0)}}var o=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],a=function(t,r,n,i,a=s(512),l=new Uint8Array(256),u=new Int32Array(5003),h=new Int32Array(5003)){let c=u.length,d=Math.max(2,i);l.fill(0),h.fill(0),u.fill(-1);let p=0,f=0,m=d+1,g=!1,y=m,v=(1<<y)-1,b=1<<m-1,x=b+1,_=b+2,A=0,E=n[0],C=0;for(let t=c;t<65536;t*=2)++C;C=8-C,a.writeByte(d),w(b);let D=n.length;for(let t=1;t<D;t++)r:{let r=n[t],i=(r<<12)+E,s=r<<C^E;if(u[s]===i){E=h[s];break r}let o=0===s?1:c-s;for(;u[s]>=0;)if((s-=o)<0&&(s+=c),u[s]===i){E=h[s];break r}w(E),E=r,_<4096?(h[s]=_++,u[s]=i):(u.fill(-1),_=b+2,g=!0,w(b))}return w(E),w(x),a.writeByte(0),a.bytesView();function w(t){for(p&=o[f],f>0?p|=t<<f:p=t,f+=y;f>=8;)l[A++]=255&p,A>=254&&(a.writeByte(A),a.writeBytesView(l,0,A),A=0),p>>=8,f-=8;if((_>v||g)&&(g?(v=(1<<(y=m))-1,g=!1):v=12==++y?1<<y:(1<<y)-1),t==x){for(;f>0;)l[A++]=255&p,A>=254&&(a.writeByte(A),a.writeBytesView(l,0,A),A=0),p>>=8,f-=8;A>0&&(a.writeByte(A),a.writeBytesView(l,0,A),A=0)}}};function l(t,r,n){return t<<8&63488|r<<2&992|n>>3}function u(t,r,n,i){return t>>4|240&r|(240&n)<<4|(240&i)<<8}function h(t,r,n){return t>>4<<8|240&r|n>>4}function c(t,r,n){return t<r?r:t>n?n:t}function d(t,r,n){var i=0,s=1e100;let o=t[r],a=o.cnt,l=o.ac,u=o.rc,h=o.gc,c=o.bc;for(var d=o.fw;0!=d;d=t[d].fw){let r=t[d],o=r.cnt,v=a*o/(a+o);if(v>=s)continue;var p,f,m,g,y=0;if(n&&(y+=v*((p=r.ac-l)*p))>=s)continue;if(!((y+=v*((f=r.rc-u)*f))>=s))!((y+=v*((m=r.gc-h)*m))>=s)&&((y+=v*((g=r.bc-c)*g))>=s||(s=y,i=d))}o.err=s,o.nn=i}function p(){return{ac:0,rc:0,gc:0,bc:0,cnt:0,nn:0,fw:0,bk:0,tm:0,mtm:0,err:0}}function f(t,r,n={}){let{format:i="rgb565",clearAlpha:s=!0,clearAlphaColor:o=0,clearAlphaThreshold:a=0,oneBitAlpha:m=!1}=n;if(!t||!t.buffer||!(t instanceof Uint8Array)&&!(t instanceof Uint8ClampedArray))throw Error("quantize() expected RGBA Uint8Array data");let g=new Uint32Array(t.buffer),y=!1!==n.useSqrt,v="rgba4444"===i,b=function(t,r){let n=Array("rgb444"===r?4096:65536),i=t.length;if("rgba4444"===r)for(let r=0;r<i;++r){let i=t[r],s=i>>24&255,o=i>>16&255,a=i>>8&255,l=255&i,h=u(l,a,o,s),c=h in n?n[h]:n[h]=p();c.rc+=l,c.gc+=a,c.bc+=o,c.ac+=s,c.cnt++}else if("rgb444"===r)for(let r=0;r<i;++r){let i=t[r],s=i>>16&255,o=i>>8&255,a=255&i,l=h(a,o,s),u=l in n?n[l]:n[l]=p();u.rc+=a,u.gc+=o,u.bc+=s,u.cnt++}else for(let r=0;r<i;++r){let i=t[r],s=i>>16&255,o=i>>8&255,a=255&i,u=l(a,o,s),h=u in n?n[u]:n[u]=p();h.rc+=a,h.gc+=o,h.bc+=s,h.cnt++}return n}(g,i),x=b.length,_=x-1,A=new Uint32Array(x+1);for(var E=0,C=0;C<x;++C){let t=b[C];if(null!=t){var D=1/t.cnt;v&&(t.ac*=D),t.rc*=D,t.gc*=D,t.bc*=D,b[E++]=t}}r*r/E<.022&&(y=!1);for(var C=0;C<E-1;++C)b[C].fw=C+1,b[C+1].bk=C,y&&(b[C].cnt=Math.sqrt(b[C].cnt));for(y&&(b[C].cnt=Math.sqrt(b[C].cnt)),C=0;C<E;++C){d(b,C,!1);var w=b[C].err;for(T=++A[0];T>1&&!(b[F=A[N=T>>1]].err<=w);T=N)A[T]=F;A[T]=C}var S=E-r;for(C=0;C<S;){for(;;){var F,T,N,I,O=A[1];if((I=b[O]).tm>=I.mtm&&b[I.nn].mtm<=I.tm)break;I.mtm==_?O=A[1]=A[A[0]--]:(d(b,O,!1),I.tm=C);var w=b[O].err;for(T=1;(N=T+T)<=A[0]&&(N<A[0]&&b[A[N]].err>b[A[N+1]].err&&N++,!(w<=b[F=A[N]].err));T=N)A[T]=F;A[T]=O}var k=b[I.nn],M=I.cnt,B=k.cnt,D=1/(M+B);v&&(I.ac=D*(M*I.ac+B*k.ac)),I.rc=D*(M*I.rc+B*k.rc),I.gc=D*(M*I.gc+B*k.gc),I.bc=D*(M*I.bc+B*k.bc),I.cnt+=k.cnt,I.mtm=++C,b[k.bk].fw=k.fw,b[k.fw].bk=k.bk,k.mtm=_}let L=[];var R=0;for(C=0;;++R){let t=c(Math.round(b[C].rc),0,255),r=c(Math.round(b[C].gc),0,255),n=c(Math.round(b[C].bc),0,255),i=255;v&&(i=c(Math.round(b[C].ac),0,255),m&&(i=i<=("number"==typeof m?m:127)?0:255),s&&i<=a&&(t=r=n=o,i=0));let l=v?[t,r,n,i]:[t,r,n];if(!function(t,r){for(let n=0;n<t.length;n++){let i=t[n],s=i[0]===r[0]&&i[1]===r[1]&&i[2]===r[2],o=!(i.length>=4)||!(r.length>=4)||i[3]===r[3];if(s&&o)return!0}return!1}(L,l)&&L.push(l),0==(C=b[C].fw))break}return L}function m(t,r){var n,i=0;for(n=0;n<t.length;n++){let s=t[n]-r[n];i+=s*s}return i}function g(t,r){return r>1?Math.round(t/r)*r:t}function y(t,{roundRGB:r=5,roundAlpha:n=10,oneBitAlpha:i=null}={}){let s=new Uint32Array(t.buffer);for(let t=0;t<s.length;t++){let o=s[t],a=o>>24&255,l=o>>16&255,u=o>>8&255,h=255&o;a=g(a,n),i&&(a=a<=("number"==typeof i?i:127)?0:255),h=g(h,r),u=g(u,r),l=g(l,r),s[t]=a<<24|l<<16|u<<8|(0|h)}}function v(t,r,n="rgb565"){if(!t||!t.buffer||!(t instanceof Uint8Array)&&!(t instanceof Uint8ClampedArray))throw Error("quantize() expected RGBA Uint8Array data");if(r.length>
91256)throw Error("applyPalette() only works with 256 colors or less");let i=new Uint32Array(t.buffer),s=i.length,o=new Uint8Array(s),a=Array("rgb444"===n?4096:65536);if("rgba4444"===n)for(let t=0;t<s;t++){let n=i[t],s=n>>24&255,l=n>>16&255,h=n>>8&255,c=255&n,d=u(c,h,l,s),p=d in a?a[d]:a[d]=function(t,r,n,i,s){let o=0,a=1e100;for(let l=0;l<s.length;l++){let u=s[l],h=function(t){return t*t}(u[3]-i);!(h>a||(h+=function(t){return t*t}(u[0]-t))>a||(h+=function(t){return t*t}(u[1]-r))>a)&&((h+=function(t){return t*t}(u[2]-n))>a||(a=h,o=l))}return o}(c,h,l,s,r);o[t]=p}else{let t="rgb444"===n?h:l;for(let n=0;n<s;n++){let s=i[n],l=s>>16&255,u=s>>8&255,h=255&s,c=t(h,u,l),d=c in a?a[c]:a[c]=function(t,r,n,i){let s=0,o=1e100;for(let a=0;a<i.length;a++){let l=i[a],u=function(t){return t*t}(l[0]-t);!(u>o||(u+=function(t){return t*t}(l[1]-r))>o)&&((u+=function(t){return t*t}(l[2]-n))>o||(o=u,s=a))}return s}(h,u,l,r);o[n]=d}}return o}function b(t,r,n=5){if(!t.length||!r.length)return;let i=t.map(t=>t.slice(0,3)),s=n*n,o=t[0].length;for(let n=0;n<r.length;n++){let a=r[n],l=_(i,(a=a.length<o?[a[0],a[1],a[2],255]:a.length>o?a.slice(0,3):a.slice()).slice(0,3),m),u=l[0],h=l[1];h>0&&h<=s&&(t[u]=a)}}function x(t,r,n=m){let i=1/0,s=-1;for(let o=0;o<t.length;o++){let a=n(r,t[o]);a<i&&(i=a,s=o)}return s}function _(t,r,n=m){let i=1/0,s=-1;for(let o=0;o<t.length;o++){let a=n(r,t[o]);a<i&&(i=a,s=o)}return[s,i]}function A(t,r,n=m){return t[x(t,r,n)]}function E(t={}){let{initialCapacity:r=4096,auto:n=!0}=t,o=s(r),l=new Uint8Array(256),u=new Int32Array(5003),h=new Int32Array(5003),c=!1;return{reset(){o.reset(),c=!1},finish(){o.writeByte(i.trailer)},bytes:()=>o.bytes(),bytesView:()=>o.bytesView(),get buffer(){return o.buffer},get stream(){return o},writeHeader:d,writeFrame(t,r,i,s={}){var p,f,m,g,y,v,b,x,_;let{transparent:A=!1,transparentIndex:E=0,delay:F=0,palette:T=null,repeat:N=0,colorDepth:I=8,dispose:O=-1}=s,k=!1;if(n?c||(k=!0,d(),c=!0):k=!!s.first,r=Math.max(0,Math.floor(r)),i=Math.max(0,Math.floor(i)),k){if(!T)throw Error("First frame must include a { palette } option");(function(t,r,n,i,s=8){let o=S(i.length)-1;D(t,r),D(t,n),t.writeBytes([128|s-1<<4|o,0,0])})(o,r,i,T,I),C(o,T),N>=0&&(p=o,f=N,p.writeByte(33),p.writeByte(255),p.writeByte(11),w(p,"NETSCAPE2.0"),p.writeByte(3),p.writeByte(1),D(p,f),p.writeByte(0))}m=o,g=O,y=Math.round(F/10),v=A,b=E,m.writeByte(33),m.writeByte(249),m.writeByte(4),b<0&&(b=0,v=!1),v?(x=1,_=2):(x=0,_=0),g>=0&&(_=7&g),_<<=2,m.writeByte(0|_|x),D(m,y),m.writeByte(b||0),m.writeByte(0);let M=!!T&&!k;(function(t,r,n,i){if(t.writeByte(44),D(t,0),D(t,0),D(t,r),D(t,n),i){let r=S(i.length)-1;t.writeByte(128|r)}else t.writeByte(0)})(o,r,i,M?T:null),M&&C(o,T),function(t,r,n,i,s=8,o,l,u){a(n,i,r,s,t,o,l,u)}(o,t,r,i,I,l,u,h)}};function d(){w(o,"GIF89a")}}function C(t,r){let n=1<<S(r.length);for(let i=0;i<n;i++){let n=[0,0,0];i<r.length&&(n=r[i]),t.writeByte(n[0]),t.writeByte(n[1]),t.writeByte(n[2])}}function D(t,r){t.writeByte(255&r),t.writeByte(r>>8&255)}function w(t,r){for(var n=0;n<r.length;n++)t.writeByte(r.charCodeAt(n))}function S(t){return Math.max(Math.ceil(Math.log2(t)),1)}var F=E},83301:(t,r,n)=>{"use strict";n.d(r,{A:()=>s,f:()=>i});class i{constructor(t,r,n,i,s,o){this.size=t,this.src=r,this.dst=n,this.attr=i,this._renderer=s,this.map=o}default(t){return this.default=t,this}_prepareBuffer(t,r){this._renderer._prepareBuffer(this,t,r)}}function s(t,r){t.RenderBuffer=i}"undefined"!=typeof p5&&s(p5,p5.prototype)},83472:(t,r,n)=>{"use strict";n.d(r,{A:()=>i});let i=(0,n(64454).A)("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]])},84297:(t,r,n)=>{"use strict";n.d(r,{A:()=>i});let i=(0,n(64454).A)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]])},86556:(t,r,n)=>{var i=n(75516);r.encode=function(t){var r,n="",s=t<0?(-t<<1)+1:(t<<1)+0;do r=31&s,(s>>>=5)>0&&(r|=32),n+=i.encode(r);while(s>0);return n},r.decode=function(t,r,n){var s,o,a,l,u=t.length,h=0,c=0;do{if(r>=u)throw Error("Expected more digits in base 64 VLQ value.");if(-1===(l=i.decode(t.charCodeAt(r++))))throw Error("Invalid base64 digit: "+t.charAt(r-1));a=!!(32&l),l&=31,h+=l<<c,c+=5}while(a);o=(s=h)>>1,n.value=(1&s)==1?-o:o,n.rest=r}},87442:(t,r,n)=>{"use strict";n.d(r,{A:()=>c});var i=n(56062);class s{type;coordMeta;coordRange;range;constructor(t,r){if("object"==typeof t&&(this.coordMeta=t),r&&(this.coordMeta=r,this.coordRange=r.range??r.refRange),"string"==typeof t){let r=t.trim().match(/^(?<type><[a-z]+>)(\[(?<min>-?[.\d]+),\s*(?<max>-?[.\d]+)\])?$/);if(!r)throw TypeError(`Cannot parse ${t} as a type definition.`);this.type=r.groups.type;let{min:n,max:i}=r.groups;(n||i)&&(this.range=[+n,+i])}}get computedRange(){return this.range?this.range:"<percentage>"===this.type?this.percentageRange():"<angle>"===this.type?[0,360]:null}get unit(){return"<percentage>
91"===this.type?"%":"<angle>"===this.type?"deg":""}resolve(t){if("<angle>"===this.type)return t;let r=this.computedRange,n=this.coordRange;return"<percentage>"===this.type&&(n??=this.percentageRange()),(0,i._b)(r,n,t)}serialize(t,r){let n="<percentage>"===this.type?this.percentageRange(100):this.computedRange,s=this.unit;return t=(0,i._b)(this.coordRange,n,t),(0,i.g1)(t,{unit:s,precision:r})}toString(){let t=this.type;if(this.range){let[r="",n=""]=this.range;t+=`[${r},${n}]`}return t}percentageRange(t=1){let r;return[(r=this.coordMeta&&this.coordMeta.range||this.coordRange&&this.coordRange[0]>=0?[0,1]:[-1,1])[0]*t,r[1]*t]}static get(t,r){return(0,i.Qs)(t,this)?t:new this(t,r)}}let o=Symbol("instance");class a{type;name;spaceCoords;coords;id;alpha;constructor(t,r=t.space){if(t[o]=this,this.type="function",this.name="color",Object.assign(this,t),this.space=r,"custom"===this.type)return;this.spaceCoords=Object.values(r.coords),this.coords||(this.coords=this.spaceCoords.map(t=>{let r=["<number>","<percentage>"];return"angle"===t.type&&r.push("<angle>"),r})),this.coords=this.coords.map((t,r)=>{let n=this.spaceCoords[r];return"string"==typeof t&&(t=t.trim().split(/\s*\|\s*/)),t.map(t=>s.get(t,n))})}serializeCoords(t,r,n){return n=t.map((t,r)=>s.get(n?.[r]??this.coords[r][0],this.spaceCoords[r])),t.map((t,i)=>n[i].serialize(t,r))}coerceCoords(t,r){return Object.entries(this.space.coords).map(([n,s],o)=>{let a=t[o];if((0,i.$I)(a)||isNaN(a))return a;let l=r[o],u=this.coords[o].find(t=>t.type==l);if(!u){let t=s.name||n;throw TypeError(`${l??a?.raw??a} not allowed for ${t} in ${this.name}()`)}return a=u.resolve(a),u.range&&(r[o]=u.toString()),a})}canSerialize(){return"function"===this.type||this.serialize}parse(t){return null}static get(t,...r){return!t||(0,i.Qs)(t,this)?t:t[o]?t[o]:new a(t,...r)}}var l=n(1818),u=n(39446),h=n(93421);class c{constructor(t){this.id=t.id,this.name=t.name,this.base=t.base?c.get(t.base):null,this.aliases=t.aliases,this.base&&(this.fromBase=t.fromBase,this.toBase=t.toBase);let r=t.coords??this.base.coords;for(let t in r)"name"in r[t]||(r[t].name=t);this.coords=r;let n=t.white??this.base.white??"D65";for(let r in this.white=(0,l.ie)(n),this.formats=t.formats??{},this.formats){let t=this.formats[r];t.type||="function",t.name||=r}this.formats.color?.id||(this.formats.color={...this.formats.color??{},id:t.cssId||this.id}),t.gamutSpace?this.gamutSpace="self"===t.gamutSpace?this:c.get(t.gamutSpace):this.isPolar?this.gamutSpace=this.base:this.gamutSpace=this,this.gamutSpace.isUnbounded&&(this.inGamut=(t,r)=>!0),this.referred=t.referred,Object.defineProperty(this,"path",{value:(function(t){let r=[t];for(let n=t;n=n.base;)r.push(n);return r})(this).reverse(),writable:!1,enumerable:!0,configurable:!0}),u.A.run("colorspace-init-end",this)}inGamut(t,{epsilon:r=75e-6}={}){if(!this.equals(this.gamutSpace))return t=this.to(this.gamutSpace,t),this.gamutSpace.inGamut(t,{epsilon:r});let n=Object.values(this.coords);return t.every((t,s)=>{let o=n[s];if("angle"!==o.type&&o.range){if((0,i.$I)(t))return!0;let[n,s]=o.range;return(void 0===n||t>=n-r)&&(void 0===s||t<=s+r)}return!0})}get isUnbounded(){return Object.values(this.coords).every(t=>!("range"in t))}get cssId(){return this.formats?.color?.id||this.id}get isPolar(){for(let t in this.coords)if("angle"===this.coords[t].type)return!0;return!1}getFormat(t){if(!t)return null;"default"===t?t=Object.values(this.formats)[0]:"string"==typeof t&&(t=this.formats[t]);let r=a.get(t,this);return r!==t&&t.name in this.formats&&(this.formats[t.name]=r),r}equals(t){return!!t&&(this===t||this.id===t||this.id===t.id)}to(t,r){let n,s;if(1==arguments.length){let n=(0,h.A)(t);[t,r]=[n.space,n.coords]}if(t=c.get(t),this.equals(t))return r;r=r.map(t=>(0,i.$I)(t)?0:t);let o=this.path,a=t.path;for(let t=0;t<o.length;t++)if(o[t].equals(a[t]))n=o[t],s=t;else break;if(!n)throw Error(`Cannot convert between color spaces ${this} and ${t}: no connection space was found`);for(let t=o.length-1;t>s;t--)r=o[t].toBase(r);for(let t=s+1;t<a.length;t++)r=a[t].fromBase(r);return r}from(t,r){if(1==arguments.length){let n=(0,h.A)(t);[t,r]=[n.space,n.coords]}return(t=c.get(t)).to(this,r)}toString(){return`${this.name} (${this.id})`}getMinCoords(){let t=[];for(let r in this.coords){let n=this.coords[r],i=n.range||n.refRange;t.push(i?.min??0)}return t}static registry={};static get all(){return[...new Set(Object.values(c.registry))]}static register(t,r){if(1==arguments.length&&(r=arguments[0],t=r.id),r=this.get(r),this.registry[t]&&this.registry[t]!==r)throw Error(`Duplicate color space registration: '${t}'`);if(this.registry[t]=r,1==arguments.length&&r.aliases)for(let t of r.aliases)this.register(t,r);return r}static get(t,...r){if(!t||(0,i.Qs)(t,this))return t;if("string"===(0,i.NW)(t)){let r=c.registry[t.toLowerCase()];if(!r)throw TypeError(`No color space found with id = "${t}"`);return r}if(r.length)return c.get(...r);throw TypeError(`${t} is not a valid color space`)}static findFormat(t,r=c.all){if(!t)return null;for(let n of("string"==typeof t&&(t={name:t}),r))for(let[r,i]of Object.entries(n.formats)){i.name??=r,i.type??="function";let s=(!t.name||i.name===t.name)&&(!t.type||i.type===t.type);if(t.id){let r=i.ids||[i.id],n=Array.isArray(t.id)?t.id:[t.id];s&&=n.some(t=>
91r.includes(t))}if(s){let t=a.get(i,n);return t!==i&&(n.formats[i.name]=t),t}}return null}static resolveCoord(t,r){let n,s,o=(0,i.NW)(t);if("string"===o?t.includes(".")?[n,s]=t.split("."):[n,s]=[,t]:Array.isArray(t)?[n,s]=t:(n=t.space,s=t.coordId),(n=c.get(n))||(n=r),!n)throw TypeError(`Cannot resolve coordinate reference ${t}: No color space specified and relative references are not allowed here`);if("number"===(o=(0,i.NW)(s))||"string"===o&&s>=0){let t=Object.entries(n.coords)[s];if(t)return{space:n,id:t[0],index:s,...t[1]}}n=c.get(n);let a=s.toLowerCase(),l=0;for(let t in n.coords){let r=n.coords[t];if(t.toLowerCase()===a||r.name?.toLowerCase()===a)return{space:n,id:t,index:l,...r};l++}throw TypeError(`No "${s}" coordinate found in ${n.name}. Its coordinates are: ${Object.keys(n.coords).join(", ")}`)}static DEFAULT_FORMAT={type:"functions",name:"color"}}},88124:(t,r,n)=>{"use strict";n.d(r,{V:()=>c});var i=n(58905),s=n(75671),o=n(41157),a=n(39247),l=n(83301);n(43140);let u={vertices:1,vertexNormals:1,vertexColors:4,vertexStrokeColors:4,uvs:2},h=Object.values(u).reduce((t,r)=>t+r);class c{constructor(t){this.renderer=t,this.shapeMode=i.K,this.geometry=new s.V(void 0,void 0,void 0,this.renderer),this.geometry.gid="__IMMEDIATE_MODE_GEOMETRY__",this.contourIndices=[],this._useUserVertexProperties=void 0,this._bezierVertex=[],this._quadraticVertex=[],this._curveVertex=[],this.isProcessingVertices=!1,this._tessy=this._initTessy(),this.tessyVertexSize=h,this.bufferStrides={...u}}constructFromContours(t,r){this._useUserVertexProperties&&this._resetUserVertexProperties(),this.geometry.reset(),this.contourIndices=[],this.shapeMode=t.contours[0].kind;let n=!!this.renderer.states.strokeColor,s={};if(t.userVertexProperties)for(let r in this._useUserVertexProperties=!0,t.userVertexProperties){let n=t.vertexPropertyName(r),i=this.geometry._userVertexPropertyHelper(n,[],t.userVertexProperties[r]);s[r]=i,this.tessyVertexSize+=i.getDataSize(),this.bufferStrides[i.getSrcName()]=i.getDataSize(),this.renderer.buffers.user.push(new l.f(i.getDataSize(),i.getSrcName(),i.getDstName(),n,this.renderer))}else this._useUserVertexProperties=!1;for(let t of r)for(let r of(this.contourIndices.push(this.geometry.vertices.length),t)){if(this.shapeMode===i.Z&&this.geometry.vertices.length%6==3)for(let t in this.bufferStrides){let r=this.bufferStrides[t],n=this.geometry[t];n.push(...n.slice(n.length-3*r,n.length-2*r),...n.slice(n.length-r,n.length))}for(let t in this.geometry.vertices.push(r.position),this.geometry.vertexNormals.push(r.normal||new a.M(0,0,0)),this.geometry.uvs.push(r.textureCoordinates.x,r.textureCoordinates.y),this.renderer.states.fillColor?this.geometry.vertexColors.push(...r.fill.array()):this.geometry.vertexColors.push(0,0,0,0),this.renderer.states.strokeColor?this.geometry.vertexStrokeColors.push(...r.stroke.array()):this.geometry.vertexStrokeColors.push(0,0,0,0),s){let n=s[t];t in r&&n.setCurrentData(r[t]),n.pushCurrentData()}}n&&(this.geometry.edges=this._calculateEdges(this.shapeMode,this.geometry.vertices)),n&&!this.renderer.geometryBuilder&&this.geometry._edgesToVertices(),this.shapeMode===i.K?(this.isProcessingVertices=!0,this._tesselateShape(),this.isProcessingVertices=!1):this.shapeMode===i.$?this.shapeMode=i.T:this.shapeMode===i.Z&&(this.shapeMode=i.c),this.renderer.states.textureMode===i.ad&&null!==this.renderer.states._tex&&this.renderer.states._tex.width>0&&this.renderer.states._tex.height>0&&(this.geometry.uvs=this.geometry.uvs.map((t,r)=>r%2==0?t/this.renderer.states._tex.width:t/this.renderer.states._tex.height))}_resetUserVertexProperties(){let t=this.geometry.userVertexProperties;for(let r in t){let n=t[r];delete this.bufferStrides[r],n.delete()}this._useUserVertexProperties=!1,this.tessyVertexSize=h,this.geometry.userVertexProperties={}}_calculateEdges(t,r){let n=[],s=0,o=this.contourIndices.slice(),a=-1;switch(t){case i.T:for(s=0;s<r.length-2;s++)n.push([s,s+1]),n.push([s,s+2]);n.push([s,s+1]);break;case i._:for(s=1;s<r.length-1;s++)n.push([0,s]),n.push([s,s+1]);n.push([0,r.length-1]);break;case i.c:for(s=0;s<r.length-2;s+=3)n.push([s,s+1]),n.push([s+1,s+2]),n.push([s+2,s]);break;case i.Y:for(s=0;s<r.length-1;s+=2)n.push([s,s+1]);break;case i.Z:for(s=0;s<r.length-5;s+=6)n.push([s,s+1]),n.push([s+1,s+2]),n.push([s+2,s+5]),n.push([s+5,s]);break;case i.$:for(s=0;s<r.length-2;s+=2)n.push([s,s+1]),n.push([s+1,s+3]),n.push([s,s+2]);n.push([s,s+1]);break;default:for(s=0;s<r.length;s++)s===o[0]?a=o.shift():r[a]&&r[s].equals(r[a])?n.push([s-1,a]):n.push([s-1,s])}return n}_tesselateShape(){let t=[];for(let r=0;r<this.geometry.vertices.length;r++)for(let n in this.contourIndices.length>0&&this.contourIndices[0]===r&&(this.contourIndices.shift(),t.push([])),t[t.length-1].push(this.geometry.vertices[r].x,this.geometry.vertices[r].y,this.geometry.vertices[r].z,this.geometry.uvs[2*r],this.geometry.uvs[2*r+1],this.geometry.vertexColors[4*r],this.geometry.vertexColors[4*r+1],this.geometry.vertexColors[4*r+2],this.geometry.vertexColors[4*r+3],this.geometry.vertexNormals[r].x,this.geometry.vertexNormals[r].y,this.geometry.vertexNormals[r].z),this.geometry.userVertexProperties){let i=this.geometry.userVertexProperties[n],s=r*i.getDataSize(),o=s+i.getDataSize(),a=i.getSrcArray().slice(s,o);t[t.length-1].push(...a)}for(let r of t){let t=this.tessyVertexSize;for(let n=t;n<r.length;n+=t){let i=r[n-t],s=r[n-t+1],o=r[n],a=r[n+1];1e-6>Math.abs(o-i)&&(r[n]=i),1e-6>Math.abs(a-s)&&(r[n+1]=s)}}let r=this._triangulate(t);if(0===r.length)return;this.shapeMode=i.c;let n=this.geometry.vertices;for(let t in this.geometry.vertices=[],this.geometry.vertexNormals=[],this.geometry.uvs=[],this.geometry.userVertexProperties)this.geometry.userVertexProperties[t].resetSrcArray();let s=[];for(let t=0,n=r.length;t<n;t+=this.tessyVertexSize){s.push(...r.slice(t+5,t+9)),this.geometry.vertexNormals.push(new a.M(...r.slice(t+9,t+12)));{let n=12;for(let i in this.geometry.userVertexProperties){let s=this.geometry.userVertexProperties[i],o=s.getDataSize(),a=t+n,l=a+o;s.setCurrentData(r.slice(a,l)),s.pushCurrentData(),n+=o}}this.geometry.vertices.push(new a.M(...r.slice(t,t+3))),this.geometry.uvs.push(...r.slice(t+3,t+5))}if(this.renderer.geometryBuilder){let t=new Map;this.geometry.edges=this.geometry.edges.map(r=>r.map(r=>{if(!t.has(r)){let i=n[r],s=this.geometry.vertices.findIndex(t=>i.x===t.x&&i.y===t.y&&i.z===t.z);if(-1===s){let t=1/0,r=0;for(let n=0;n<this.geometry.vertices.length;n++){let s=this.geometry.vertices[n],o=i.x-s.x,a=i.y-s.y,l=i.z-s.z,u=o*o+a*a+l*l;u<t&&(t=u,r=n)}s=r}t.set(r,s)}return t.get(r)}))}this.geometry.vertexColors=s}_initTessy(){let t=(t,r,n)=>{let i=Array(this.tessyVertexSize).fill(0);for(let t=0;t<n.length;t++)for(let s=0;s<i.length;s++)0!==n[t]&&r[t]&&(i[s]+=r[t][s]*n[t]);return i},r=new o.GluTesselator;return r.gluTessCallback(o.gluEnum.GLU_TESS_VERTEX_DATA,function(t,r){for(let n of t)r.push(n)}),r.gluTessCallback(o.gluEnum.GLU_TESS_BEGIN,function(t){t!==o.primitiveType.GL_TRIANGLES&&console.log(`expected TRIANGLES but got type: ${t}`)}),r.gluTessCallback(o.gluEnum.GLU_TESS_ERROR,function(t){console.log("error callback"),
91console.log(`error number: ${t}`)}),r.gluTessCallback(o.gluEnum.GLU_TESS_COMBINE,t),r.gluTessCallback(o.gluEnum.GLU_TESS_EDGE_FLAG,function(t){}),r.gluTessProperty(o.gluEnum.GLU_TESS_WINDING_RULE,o.windingRule.GLU_TESS_WINDING_NONZERO),r}_triangulate(t){let r=t[0]?t[0][2]:void 0,n=!0;for(let i of t)for(let t=0;t<i.length;t+=this.tessyVertexSize)if(i[t+2]!==r){n=!1;break}n?this._tessy.gluTessNormal(0,0,1):this._tessy.gluTessNormal(0,0,0);let i=[];for(let r of(this._tessy.gluTessBeginPolygon(i),t)){this._tessy.gluTessBeginContour();for(let t=0;t<r.length;t+=this.tessyVertexSize){let n=r.slice(t,t+this.tessyVertexSize);this._tessy.gluTessVertex(n,n)}this._tessy.gluTessEndContour()}return this._tessy.gluTessEndPolygon(),i}}},89709:(t,r,n)=>{var i=n(25425).x,s=n(70051),o=/(\r?\n)/,a="$$$isSourceNode$$$";function l(t,r,n,i,s){this.children=[],this.sourceContents={},this.line=null==t?null:t,this.column=null==r?null:r,this.source=null==n?null:n,this.name=null==s?null:s,this[a]=!0,null!=i&&this.add(i)}l.fromStringWithSourceMap=function(t,r,n){var i=new l,a=t.split(o),u=0,h=function(){return t()+(t()||"");function t(){return u<a.length?a[u++]:void 0}},c=1,d=0,p=null;return r.eachMapping(function(t){if(null!==p)if(c<t.generatedLine)f(p,h()),c++,d=0;else{var r=a[u]||"",n=r.substr(0,t.generatedColumn-d);a[u]=r.substr(t.generatedColumn-d),d=t.generatedColumn,f(p,n),p=t;return}for(;c<t.generatedLine;)i.add(h()),c++;if(d<t.generatedColumn){var r=a[u]||"";i.add(r.substr(0,t.generatedColumn)),a[u]=r.substr(t.generatedColumn),d=t.generatedColumn}p=t},this),u<a.length&&(p&&f(p,h()),i.add(a.splice(u).join(""))),r.sources.forEach(function(t){var o=r.sourceContentFor(t);null!=o&&(null!=n&&(t=s.join(n,t)),i.setSourceContent(t,o))}),i;function f(t,r){if(null===t||void 0===t.source)i.add(r);else{var o=n?s.join(n,t.source):t.source;i.add(new l(t.originalLine,t.originalColumn,o,r,t.name))}}},l.prototype.add=function(t){if(Array.isArray(t))t.forEach(function(t){this.add(t)},this);else if(t[a]||"string"==typeof t)t&&this.children.push(t);else throw TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+t);return this},l.prototype.prepend=function(t){if(Array.isArray(t))for(var r=t.length-1;r>=0;r--)this.prepend(t[r]);else if(t[a]||"string"==typeof t)this.children.unshift(t);else throw TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+t);return this},l.prototype.walk=function(t){for(var r,n=0,i=this.children.length;n<i;n++)(r=this.children[n])[a]?r.walk(t):""!==r&&t(r,{source:this.source,line:this.line,column:this.column,name:this.name})},l.prototype.join=function(t){var r,n,i=this.children.length;if(i>0){for(n=0,r=[];n<i-1;n++)r.push(this.children[n]),r.push(t);r.push(this.children[n]),this.children=r}return this},l.prototype.replaceRight=function(t,r){var n=this.children[this.children.length-1];return n[a]?n.replaceRight(t,r):"string"==typeof n?this.children[this.children.length-1]=n.replace(t,r):this.children.push("".replace(t,r)),this},l.prototype.setSourceContent=function(t,r){this.sourceContents[s.toSetString(t)]=r},l.prototype.walkSourceContents=function(t){for(var r=0,n=this.children.length;r<n;r++)this.children[r][a]&&this.children[r].walkSourceContents(t);for(var i=Object.keys(this.sourceContents),r=0,n=i.length;r<n;r++)t(s.fromSetString(i[r]),this.sourceContents[i[r]])},l.prototype.toString=function(){var t="";return this.walk(function(r){t+=r}),t},l.prototype.toStringWithSourceMap=function(t){var r={code:"",line:1,column:0},n=new i(t),s=!1,o=null,a=null,l=null,u=null;return this.walk(function(t,i){r.code+=t,null!==i.source&&null!==i.line&&null!==i.column?((o!==i.source||a!==i.line||l!==i.column||u!==i.name)&&n.addMapping({source:i.source,original:{line:i.line,column:i.column},generated:{line:r.line,column:r.column},name:i.name}),o=i.source,a=i.line,l=i.column,u=i.name,s=!0):s&&(n.addMapping({generated:{line:r.line,column:r.column}}),o=null,s=!1);for(var h=0,c=t.length;h<c;h++)10===t.charCodeAt(h)?(r.line++,r.column=0,h+1===c?(o=null,s=!1):s&&n.addMapping({source:i.source,original:{line:i.line,column:i.column},generated:{line:r.line,column:r.column},name:i.name})):r.column++}),this.walkSourceContents(function(t,r){n.setSourceContent(t,r)}),{code:r.code,map:n}},r.SourceNode=l},90200:(t,r,n)=>{!function(){"use strict";function t(t){return H.Statement.hasOwnProperty(t.type)}a=n(76988),l=n(56426),i=a.Syntax;var i,s,o,a,l,u,h,c,d,p,f,m,g,y,v,b,x,_,A,E,C,D,w,S,F={"??":(s={
91Sequence:0,Yield:1,Assignment:1,Conditional:2,ArrowFunction:2,Coalesce:3,LogicalOR:4,LogicalAND:5,BitwiseOR:6,BitwiseXOR:7,BitwiseAND:8,Equality:9,Relational:10,BitwiseSHIFT:11,Additive:12,Multiplicative:13,Exponentiation:14,Await:15,Unary:15,Postfix:16,OptionalChaining:17,Call:18,New:19,TaggedTemplate:20,Member:21,Primary:22}).Coalesce,"||":s.LogicalOR,"&&":s.LogicalAND,"|":s.BitwiseOR,"^":s.BitwiseXOR,"&":s.BitwiseAND,"==":s.Equality,"!=":s.Equality,"===":s.Equality,"!==":s.Equality,is:s.Equality,isnt:s.Equality,"<":s.Relational,">":s.Relational,"<=":s.Relational,">=":s.Relational,in:s.Relational,instanceof:s.Relational,"<<":s.BitwiseSHIFT,">>":s.BitwiseSHIFT,">>>":s.BitwiseSHIFT,"+":s.Additive,"-":s.Additive,"*":s.Multiplicative,"%":s.Multiplicative,"/":s.Multiplicative,"**":s.Exponentiation};function T(){return{indent:null,base:null,parse:null,comment:!1,format:{indent:{style:"    ",base:0,adjustMultilineComment:!1},newline:"\n",space:" ",json:!1,renumber:!1,hexadecimal:!1,quotes:"single",escapeless:!1,compact:!1,parentheses:!0,semicolons:!0,safeConcatenation:!1,preserveBlankLines:!1},moz:{comprehensionExpressionStartsWithAssignment:!1,starlessGenerator:!1},sourceMap:null,sourceMapRoot:null,sourceMapWithCode:!1,directive:!1,raw:!0,verbatim:null,sourceCode:null}}function N(t,r){var n="";for(r|=0;r>0;r>>>=1,t+=t)1&r&&(n+=t);return n}function I(t){var r=t.length;return r&&l.code.isLineTerminator(t.charCodeAt(r-1))}function O(t,r){var n;for(n in r)r.hasOwnProperty(n)&&(t[n]=r[n]);return t}function k(t,r){var n,i;function s(t){return"object"==typeof t&&t instanceof Object&&!(t instanceof RegExp)}for(n in r)r.hasOwnProperty(n)&&(s(i=r[n])?s(t[n])?k(t[n],i):t[n]=k({},i):t[n]=i);return t}function M(t,r){return(-2&t)==8232?(r?"u":"\\u")+(8232===t?"2028":"2029"):10===t||13===t?(r?"":"\\")+(10===t?"n":"r"):String.fromCharCode(t)}function B(t,r){if(!C)if(Array.isArray(t))return function t(r){var n,i,s,o="";for(n=0,i=r.length;n<i;++n)o+=Array.isArray(s=r[n])?t(s):s;return o}(t);else return t;if(null==r)if(t instanceof o)return t;else r={};return null==r.loc?new o(null,null,C,t,r.name||null):new o(r.loc.start.line,r.loc.start.column,!0===C?r.loc.source||null:C,t,r.name||null)}function L(){return y||" "}function R(t,r){var n,i,s,o;return 0===(n=B(t).toString()).length?[r]:0===(i=B(r).toString()).length?[t]:(s=n.charCodeAt(n.length-1),o=i.charCodeAt(0),(43===s||45===s)&&s===o||l.code.isIdentifierPartES5(s)&&l.code.isIdentifierPartES5(o)||47===s&&105===o)?[t,L(),r]:l.code.isWhiteSpace(s)||l.code.isLineTerminator(s)||l.code.isWhiteSpace(o)||l.code.isLineTerminator(o)?[t,r]:[t,y,r]}function P(t){return[u,t]}function z(t){var r;r=u,t(u+=h),u=r}function U(t,r){if("Line"===t.type)if(I(t.value))return"//"+t.value;else{var n="//"+t.value;return w||(n+="\n"),n}return A.format.indent.adjustMultilineComment&&/[\n\r]/.test(t.value)?function(t,r){var n,i,s,o,a,h,c,d;for(i=1,n=t.split(/\r\n|[\r\n]/),h=Number.MAX_VALUE,s=n.length;i<s;++i){for(o=n[i],a=0;a<o.length&&l.code.isWhiteSpace(o.charCodeAt(a));)++a;h>a&&(h=a)}for(void 0!==r?(c=u,"*"===n[1][h]&&(r+=" "),u=r):(1&h&&--h,c=u),i=1,s=n.length;i<s;++i)d=B(P(n[i].slice(h))),n[i]=C?d.join(""):d;return u=c,n.join("\n")}("/*"+t.value+"*/",r):"/*"+t.value+"*/"}function $(t,r){var n,s,o,a,c,d,p,f,m,g,y,v;if(t.leadingComments&&t.leadingComments.length>0){if(a=r,w){for(o=t.leadingComments[0],r=[],f=o.extendedRange,m=o.range,(v=((y=D.substring(f[0],m[0])).match(/\n/g)||[]).length)>0?(r.push(N("\n",v)),r.push(P(U(o)))):(r.push(y),r.push(U(o))),g=m,n=1,s=t.leadingComments.length;n<s;n++)m=(o=t.leadingComments[n]).range,v=(D.substring(g[1],m[0]).match(/\n/g)||[]).length,r.push(N("\n",v)),r.push(P(U(o))),g=m;v=(D.substring(m[1],f[1]).match(/\n/g)||[]).length,r.push(N("\n",v))}else for(o=t.leadingComments[0],r=[],x&&t.type===i.Program&&0===t.body.length&&r.push("\n"),r.push(U(o)),I(B(r).toString())||r.push("\n"),n=1,s=t.leadingComments.length;n<s;++n)I(B(p=[U(o=t.leadingComments[n])]).toString())||p.push("\n"),r.push(P(p));r.push(P(a))}if(t.trailingComments)if(w)f=(o=t.trailingComments[0]).extendedRange,m=o.range,(v=((y=D.substring(f[0],m[0])).match(/\n/g)||[]).length)>0?(r.push(N("\n",v)),r.push(P(U(o)))):(r.push(y),r.push(U(o)));else for(n=0,c=!I(B(r).toString()),d=N(" ",function(t){var r;for(r=t.length-1;r>=0&&!l.code.isLineTerminator(t.charCodeAt(r));--r);return t.length-1-r}(B([u,r,h]).toString())),s=t.trailingComments.length;n<s;++n)o=t.trailingComments[n],c?(r=0===n?[r,h]:[r,d]).push(U(o,d)):r=[r,P(U(o))],n===s-1||I(B(r).toString())||(r=[r,"\n"]);return r}function j(t,r,n){var i,s=0;for(i=t;i<r;i++)"\n"===D[i]&&s++;for(i=1;i<s;i++)n.push(g)}function V(t,r,n){return r<n?["(",t,")"]:t}function G(t){var r,n,i;for(r=1,n=(i=t.split(/\r\n|\n/)).length;r<n;r++)i[r]=g+u+i[r];return i}function H(){}function q(t){return B(t.name,t)}function W(t,r){return t.async?"async"+(r?L():y):""}function Z(t){return t.generator&&!A.moz.starlessGenerator?"*"+y:""}function X(t){var r=t.value,n="";return r.async&&(n+=W(r,!t.computed)),r.generator&&(n+=Z(r)?"*":""),n}H.prototype.maybeBlock=function(t,r){var n,s,o=this;return(s=!A.comment||!t.leadingComments,t.type===i.BlockStatement&&s)?[y,this.generateStatement
vendor: 4,665 bytes, line 91
91(t,r)]:t.type===i.EmptyStatement&&s?";":(z(function(){n=[g,P(o.generateStatement(t,r))]}),n)},H.prototype.maybeBlockSuffix=function(t,r){var n=I(B(r).toString());return t.type!==i.BlockStatement||A.comment&&t.leadingComments||n?n?[r,u]:[r,g,u]:[r,y]},H.prototype.generatePattern=function(t,r,n){return t.type===i.Identifier?q(t):this.generateExpression(t,r,n)},H.prototype.generateFunctionParams=function(t){var r,n,o,a;if(a=!1,t.type!==i.ArrowFunctionExpression||t.rest||t.defaults&&0!==t.defaults.length||1!==t.params.length||t.params[0].type!==i.Identifier){for((o=t.type===i.ArrowFunctionExpression?[W(t,!1)]:[]).push("("),t.defaults&&(a=!0),r=0,n=t.params.length;r<n;++r)a&&t.defaults[r]?o.push(this.generateAssignment(t.params[r],t.defaults[r],"=",s.Assignment,7)):o.push(this.generatePattern(t.params[r],s.Assignment,7)),r+1<n&&o.push(","+y);t.rest&&(t.params.length&&o.push(","+y),o.push("..."),o.push(q(t.rest))),o.push(")")}else o=[W(t,!0),q(t.params[0])];return o},H.prototype.generateFunctionBody=function(t){var r,n;return r=this.generateFunctionParams(t),t.type===i.ArrowFunctionExpression&&(r.push(y),r.push("=>")),t.expression?(r.push(y),"{"===(n=this.generateExpression(t.body,s.Assignment,7)).toString().charAt(0)&&(n=["(",n,")"]),r.push(n)):r.push(this.maybeBlock(t.body,9)),r},H.prototype.generateIterationForStatement=function(t,r,n){var o=["for"+(r.await?L()+"await":"")+y+"("],a=this;return z(function(){r.left.type===i.VariableDeclaration?z(function(){o.push(r.left.kind+L()),o.push(a.generateStatement(r.left.declarations[0],0))}):o.push(a.generateExpression(r.left,s.Call,7)),o=R(o,t),o=[R(o,a.generateExpression(r.right,s.Assignment,7)),")"]}),o.push(this.maybeBlock(r.body,n)),o},H.prototype.generatePropertyKey=function(t,r){var n=[];return r&&n.push("["),n.push(this.generateExpression(t,s.Assignment,7)),r&&n.push("]"),n},H.prototype.generateAssignment=function(t,r,n,i,o){return s.Assignment<i&&(o|=1),V([this.generateExpression(t,s.Call,o),y+n+y,this.generateExpression(r,s.Assignment,o)],s.Assignment,i)},H.prototype.semicolon=function(t){return!b&&32&t?"":";"},H.Statement={BlockStatement:function(t,r){var n,i,s=["{",g],o=this;return z(function(){var a,l,u,h;for(0===t.body.length&&w&&(n=t.range)[1]-n[0]>2&&("\n"===(i=D.substring(n[0]+1,n[1]-1))[0]&&(s=["{"]),s.push(i)),h=1,8&r&&(h|=16),a=0,l=t.body.length;a<l;++a)w&&(0===a&&(t.body[0].leadingComments&&(n=t.body[0].leadingComments[0].extendedRange,"\n"===(i=D.substring(n[0],n[1]))[0]&&(s=["{"])),t.body[0].leadingComments||j(t.range[0],t.body[0].range[0],s)),!(a>0)||t.body[a-1].trailingComments||t.body[a].leadingComments||j(t.body[a-1].range[1],t.body[a].range[0],s)),a===l-1&&(h|=32),u=t.body[a].leadingComments&&w?o.generateStatement(t.body[a],h):P(o.generateStatement(t.body[a],h)),s.push(u),!I(B(u).toString())&&(w&&a<l-1&&t.body[a+1].leadingComments||s.push(g)),w&&a===l-1&&!t.body[a].trailingComments&&j(t.body[a].range[1],t.range[1],s)}),s.push(P("}")),s},BreakStatement:function(t,r){return t.label?"break "+t.label.name+this.semicolon(r):"break"+this.semicolon(r)},ContinueStatement:function(t,r){return t.label?"continue "+t.label.name+this.semicolon(r):"continue"+this.semicolon(r)},ClassBody:function(t,r){var n=["{",g],i=this;return z(function(r){var o,a;for(o=0,a=t.body.length;o<a;++o)n.push(r),n.push(i.generateExpression(t.body[o],s.Sequence,7)),o+1<a&&n.push(g)}),I(B(n).toString())||n.push(g),n.push(u),n.push("}"),n},ClassDeclaration:function(t,r){var n,i;return n=["class"],t.id&&(n=R(n,this.generateExpression(t.id,s.Sequence,7))),t.superClass&&(i=R("extends",this.generateExpression(t.superClass,s.Unary,7)),n=R(n,i)),n.push(y),n.push(this.generateStatement(t.body,33)),n},DirectiveStatement:function(t,r){return A.raw&&t.raw?t.raw+this.semicolon(r):function(t){var r,n,i,s;for(r=0,s="double"===f?'"':"'",n=t.length;r<n;++r){if(39===(i=t.charCodeAt(r))){s='"';break}if(34===i){s="'";break}92===i&&++r}return s+t+s}(t.directive)+this.semicolon(r)},DoWhileStatement:function(t,r){var n=R("do",this.maybeBlock(t.body,1));return R(n=this.maybeBlockSuffix(t.body,n),["while"+y+"(",this.generateExpression(t.test,s.Sequence,7),")"+this.semicolon(r)])},CatchClause:function(t,r){var n,i=this;return z(function(){var r;t.param?(n=["catch"+y+"(",i.generateExpression(t.param,s.Sequence,7),")"],t.guard&&(r=i.generateExpression(t.guard,s.Sequence,7),n.splice(2,0," if ",r))):n=["catch"]}),n.push(this.maybeBlock(t.body,1)),n},DebuggerStatement:function(t,r){return"debugger"+this.semicolon(r)},EmptyStatement:function(t,r){return";"},ExportDefaultDeclaration:function(r,n){var i=["export"];return i=R(i,"default"),i=t(r.declaration)?R(i,this.generateStatement
91(r.declaration,32&n?33:1)):R(i,this.generateExpression(r.declaration,s.Assignment,7)+this.semicolon(n))},ExportNamedDeclaration:function(t,r){var n,o=["export"],a=this;return(n=32&r?33:1,t.declaration)?R(o,this.generateStatement(t.declaration,n)):(t.specifiers&&(0===t.specifiers.length?o=R(o,"{"+y+"}"):t.specifiers[0].type===i.ExportBatchSpecifier?o=R(o,this.generateExpression(t.specifiers[0],s.Sequence,7)):(o=R(o,"{"),z(function(r){var n,i;for(o.push(g),n=0,i=t.specifiers.length;n<i;++n)o.push(r),o.push(a.generateExpression(t.specifiers[n],s.Sequence,7)),n+1<i&&o.push(","+g)}),I(B(o).toString())||o.push(g),o.push(u+"}")),t.source?o=R(o,["from"+y,this.generateExpression(t.source,s.Sequence,7),this.semicolon(r)]):o.push(this.semicolon(r))),o)},ExportAllDeclaration:function(t,r){return["export"+y,"*"+y,"from"+y,this.generateExpression(t.source,s.Sequence,7),this.semicolon(r)]},ExpressionStatement:function(t,r){var n,o,a,u;return 123===(o=B(n=[this.generateExpression(t.expression,s.Sequence,7)]).toString()).charCodeAt(0)||"class"===o.slice(0,5)&&(123===(a=o.charCodeAt(5))||l.code.isWhiteSpace(a)||l.code.isLineTerminator(a))||"function"===o.slice(0,8)&&(40===(u=o.charCo
vendor: 4,322 bytes, line 91
91deAt(8))||l.code.isWhiteSpace(u)||42===u||l.code.isLineTerminator(u))||function(t){var r,n,i;if("async"!==t.slice(0,5)||!l.code.isWhiteSpace(t.charCodeAt(5)))return!1;for(n=6,i=t.length;n<i&&l.code.isWhiteSpace(t.charCodeAt(n));++n);return n!==i&&"function"===t.slice(n,n+8)&&(40===(r=t.charCodeAt(n+8))||l.code.isWhiteSpace(r)||42===r||l.code.isLineTerminator(r))}(o)||_&&16&r&&t.expression.type===i.Literal&&"string"==typeof t.expression.value?n=["(",n,")"+this.semicolon(r)]:n.push(this.semicolon(r)),n},ImportDeclaration:function(t,r){var n,o,a=this;return 0===t.specifiers.length?["import",y,this.generateExpression(t.source,s.Sequence,7),this.semicolon(r)]:(n=["import"],o=0,t.specifiers[o].type===i.ImportDefaultSpecifier&&(n=R(n,[this.generateExpression(t.specifiers[o],s.Sequence,7)]),++o),t.specifiers[o]&&(0!==o&&n.push(","),t.specifiers[o].type===i.ImportNamespaceSpecifier?n=R(n,[y,this.generateExpression(t.specifiers[o],s.Sequence,7)]):(n.push(y+"{"),t.specifiers.length-o==1?(n.push(y),n.push(this.generateExpression(t.specifiers[o],s.Sequence,7)),n.push(y+"}"+y)):(z(function(r){var i,l;for(n.push(g),i=o,l=t.specifiers.length;i<l;++i)n.push(r),n.push(a.generateExpression(t.specifiers[i],s.Sequence,7)),i+1<l&&n.push(","+g)}),I(B(n).toString())||n.push(g),n.push(u+"}"+y)))),n=R(n,["from"+y,this.generateExpression(t.source,s.Sequence,7),this.semicolon(r)]))},VariableDeclarator:function(t,r){var n=1&r?7:6;return t.init?[this.generateExpression(t.id,s.Assignment,n),y,"=",y,this.generateExpression(t.init,s.Assignment,n)]:this.generatePattern(t.id,s.Assignment,n)},VariableDeclaration:function(t,r){var n,i,s,o,a,l=this;function u(){for(o=t.declarations[0],A.comment&&o.leadingComments?(n.push("\n"),n.push(P(l.generateStatement(o,a)))):(n.push(L()),n.push(l.generateStatement(o,a))),i=1,s=t.declarations.length;i<s;++i)o=t.declarations[i],A.comment&&o.leadingComments?(n.push(","+g),n.push(P(l.generateStatement(o,a)))):(n.push(","+y),n.push(l.generateStatement(o,a)))}return n=[t.kind],a=1&r?1:0,t.declarations.length>1?z(u):u(),n.push(this.semicolon(r)),n},ThrowStatement:function(t,r){return[R("throw",this.generateExpression(t.argument,s.Sequence,7)),this.semicolon(r)]},TryStatement:function(t,r){var n,i,s,o;if(n=["try",this.maybeBlock(t.block,1)],n=this.maybeBlockSuffix(t.block,n),t.handlers)for(i=0,s=t.handlers.length;i<s;++i)n=R(n,this.generateStatement(t.handlers[i],1)),(t.finalizer||i+1!==s)&&(n=this.maybeBlockSuffix(t.handlers[i].body,n));else{for(i=0,s=(o=t.guardedHandlers||[]).length;i<s;++i)n=R(n,this.generateStatement(o[i],1)),(t.finalizer||i+1!==s)&&(n=this.maybeBlockSuffix(o[i].body,n));if(t.handler)if(Array.isArray(t.handler))for(i=0,s=t.handler.length;i<s;++i)n=R(n,this.generateStatement(t.handler[i],1)),(t.finalizer||i+1!==s)&&(n=this.maybeBlockSuffix(t.handler[i].body,n));else n=R(n,this.generateStatement(t.handler,1)),t.finalizer&&(n=this.maybeBlockSuffix(t.handler.body,n))}return t.finalizer&&(n=R(n,["finally",this.maybeBlock(t.finalizer,1)])),n},SwitchStatement:function(t,r){var n,i,o,a,l,u=this;if(z(function(){n=["switch"+y+"(",u.generateExpression(t.discriminant,s.Sequence,7),")"+y+"{"+g]}),t.cases)for(o=0,l=1,a=t.cases.length;o<a;++o)o===a-1&&(l|=32),i=P(this.generateStatement(t.cases[o],l)),n.push(i),I(B(i).toString())||n.push(g);return n.push(P("}")),n},SwitchCase:function(t,r){var n,o,a,l,u,h=this;return z(function(){for(n=t.test?[R("case",h.generateExpression(t.test,s.Sequence,7)),":"]:["default:"],a=0,(l=t.consequent.length)&&t.consequent[0].type===i.BlockStatement&&(o=h.maybeBlock(t.consequent[0],1),n.push(o),a=1),a===l||I(B(n).toString())||n.push(g),u=1;a<l;++a)a===l-1&&32&r&&(u|=32),o=P(h.generateStatement(t.consequent[a],u)),n.push(o),a+1===l||I(B(o).toString())||n.push(g)}),n},IfStatement:function(t,r){var n,o,a=this;return z(function(){n=["if"+y+"(",a.generateExpression(t.test,s.Sequence,7),")"]}),o=1,32&r&&(o|=32),t.alternate?(n.push(this.maybeBlock(t.consequent,1)),n=this.maybeBlockSuffix(t.consequent,n),n=t.alternate.type===i.IfStatement?R(n,["else ",this.generateStatement(t.alternate,o)]):R(n,R("else",this.maybeBlock(t.alternate,o)))):n.push(this.maybeBlock(t.consequent,o)),n},ForStatement:function(t,r){var n,o=this;return z(function(){n=["for"+y+"("],t.init?t.init.type===i.VariableDeclaration?n.push(o.generateStatement
91(t.init,0)):(n.push(o.generateExpression(t.init,s.Sequence,6)),n.push(";")):n.push(";"),t.test&&(n.push(y),n.push(o.generateExpression(t.test,s.Sequence,7))),n.push(";"),t.update&&(n.push(y),n.push(o.generateExpression(t.update,s.Sequence,7))),n.push(")")}),n.push(this.maybeBlock(t.body,32&r?33:1)),n},ForInStatement:function(t,r){return this.generateIterationForStatement("in",t,32&r?33:1)},ForOfStatement:function(t,r){return this.generateIterationForStatement("of",t,32&r?33:1)},LabeledStatement:function(t,r){return[t.label.name+":",this.maybeBlock(t.body,32&r?33:1)]},Program:function(t,r){var n,i,s,o,a;for(s=0,o=t.body.length,n=[x&&o>0?"\n":""],a=17;s<o;++s)x||s!==o-1||(a|=32),w&&(0!==s||t.body[0].leadingComments||j(t.range[0],t.body[s].range[0],n),!(s>0)||t.body[s-1].trailingComments||t.body[s].leadingComments||j(t.body[s-1].range[1],t.body[s].range[0],n)),i=P(this.generateStatement(t.body[s],a)),n.push(i),s+1<o&&!I(B(i).toString())&&(w&&t.body[s+1].leadingComments||n.push(g)),w&&s===o-1&&!t.body[s].trailingComments&&j(t.body[s].range[1],t.range[1],n);return n},FunctionDeclaration:function(t,r){return[W(t,!0),"function",Z(t)||L(),t.id?q(t.id):"",this.generateFunctionBody(t)]},ReturnStatement:function(t,r){return t.argument?[R("return",this.generateExpression(t.argument,s.Sequence,7)),this.semicolon(r)]:["return"+this.semicolon(r)]},WhileStatement:function(t,r){var n,i=this;return z(function(){n=["while"+y+"(",i.generateExpression(t.test,s.Sequence,7),")"]}),n.push(this.maybeBlock(t.body,32&r?33:1)),n},WithStatement:function(t,r){var n,i=this;return z(function(){n=["with"+y+"(",i.generateExpression(t.object,s.Sequence,7),")"]}),n.push(this.maybeBlock(t.body,32&r?33:1)),n}},O(H.prototype,H.Statement),H.Expression={SequenceExpression:function(t,r,n){var i,o,a;for(s.Sequence<r&&(n|=1),i=[],o=0,a=t.expressions.length;o<a;++o)i.push(this.generateExpression(t.expressions[o],s.Assignment,n)),o+1<a&&i.push(","+y);return V(i,s.Sequence,r)},AssignmentExpression:function(t,r,n){return this.generateAssignment(t.left,t.right,t.operator,r,n)},ArrowFunctionExpression:function(t,r,n){return V(this.generateFunctionBody(t),s.ArrowFunction,r)},ConditionalExpression:function(t,r,n){return s.Conditional<r&&(n|=1),V([this.generateExpression(t.test,s.Coalesce,n),y+"?"+y,this.generateExpression(t.consequent,s.Assignment,n),y+":"+y,this.generateExpression(t.alternate,s.Assignment,n)],s.Conditional,r)},LogicalExpression:function(t,r,n){return"??"===t.operator&&(n|=64),this.BinaryExpression(t,r,n)},BinaryExpression:function(t,r,n){var i,o,a,u,h,c;return(u=F[t.operator],o="**"===t.operator?s.Postfix:u,a="**"===t.operator?u:u+1,u<r&&(n|=1),i=47===(c=(h=this.generateExpression(t.left,o,n)).toString()).charCodeAt(c.length-1)&&l.code.isIdentifierPartES5(t.operator.charCodeAt(0))?[h,L(),t.operator]:R(h,t.operator),h=this.generateExpression(t.right,a,n),"/"===t.operator&&"/"===h.toString().charAt(0)||"<"===t.operator.slice(-1)&&"!--"===h.toString().slice(0,3)?(i.push(L()),i.push(h)):i=R(i,h),"in"===t.operator&&!(1&n)||("||"===t.operator||"&&"===t.operator)&&64&n)?["(",i,")"]:V(i,u,r)},CallExpression:function(t,r,n){var i,o,a;for(i=[this.generateExpression(t.callee,s.Call,3)],t.optional&&i.push("?."),i.push("("),o=0,a=t.arguments.length;o<a;++o)i.push(this.generateExpression(t.arguments[o],s.Assignment,7)),o+1<a&&i.push(","+y);return(i.push(")"),2&n)?V(i,s.Call,r):["(",i,")"]},ChainExpression:function(t,r,n){return s.OptionalChaining<r&&(n|=2),V(this.generateExpression(t.expression,s.OptionalChaining,n),s.OptionalChaining,r)},NewExpression:function(t,r,n){var i,o,a,l;if(o=t.arguments.length,l=4&n&&!v&&0===o?5:1,i=R("new",this.generateExpression(t.callee,s.New,l)),!(4&n)||v||o>0){for(i.push("("),a=0;a<o;++a)i.push(this.generateExpression(t.arguments[a],s.Assignment,7)),a+1<o&&i.push(","+y);i.push(")")}return V(i,s.New,r)},MemberExpression:function(t,r,n){var o,a;return o=[this.generateExpression(t.object,s.Call,2&n?3:1)],t.computed?(t.optional&&o.push("?."),o.push("["),o.push(this.generateExpression(t.property,s.Sequence,2&n?7:5)),o.push("]")):(!t.optional&&t.object.type===i.Literal&&"number"==typeof t.object.value&&0>(a=B(o).toString()).indexOf(".")&&!/[eExX]/.test(a)&&l.code.isDecimalDigit(a.charCo
vendor: 4,580 bytes, line 91
91deAt(a.length-1))&&!(a.length>=2&&48===a.charCodeAt(0))&&o.push(" "),o.push(t.optional?"?.":"."),o.push(q(t.property))),V(o,s.Member,r)},MetaProperty:function(t,r,n){var i;return(i=[]).push("string"==typeof t.meta?t.meta:q(t.meta)),i.push("."),i.push("string"==typeof t.property?t.property:q(t.property)),V(i,s.Member,r)},UnaryExpression:function(t,r,n){var i,o,a,u,h;return o=this.generateExpression(t.argument,s.Unary,7),""===y?i=R(t.operator,o):(i=[t.operator],t.operator.length>2?i=R(i,o):(h=(u=B(i).toString()).charCodeAt(u.length-1),a=o.toString().charCodeAt(0),((43===h||45===h)&&h===a||l.code.isIdentifierPartES5(h)&&l.code.isIdentifierPartES5(a))&&i.push(L()),i.push(o))),V(i,s.Unary,r)},YieldExpression:function(t,r,n){var i;return i=t.delegate?"yield*":"yield",t.argument&&(i=R(i,this.generateExpression(t.argument,s.Yield,7))),V(i,s.Yield,r)},AwaitExpression:function(t,r,n){return V(R(t.all?"await*":"await",this.generateExpression(t.argument,s.Await,7)),s.Await,r)},UpdateExpression:function(t,r,n){return t.prefix?V([t.operator,this.generateExpression(t.argument,s.Unary,7)],s.Unary,r):V([this.generateExpression(t.argument,s.Postfix,7),t.operator],s.Postfix,r)},FunctionExpression:function(t,r,n){var i=[W(t,!0),"function"];return t.id?(i.push(Z(t)||L()),i.push(q(t.id))):i.push(Z(t)||y),i.push(this.generateFunctionBody(t)),i},ArrayPattern:function(t,r,n){return this.ArrayExpression(t,r,n,!0)},ArrayExpression:function(t,r,n,i){var o,a,l=this;return t.elements.length?(o=["[",(a=!i&&t.elements.length>1)?g:""],z(function(r){var n,i;for(n=0,i=t.elements.length;n<i;++n)t.elements[n]?(o.push(a?r:""),o.push(l.generateExpression(t.elements[n],s.Assignment,7))):(a&&o.push(r),n+1===i&&o.push(",")),n+1<i&&o.push(","+(a?g:y))}),a&&!I(B(o).toString())&&o.push(g),o.push(a?u:""),o.push("]"),o):"[]"},RestElement:function(t,r,n){return"..."+this.generatePattern(t.argument)},ClassExpression:function(t,r,n){var i,o;return i=["class"],t.id&&(i=R(i,this.generateExpression(t.id,s.Sequence,7))),t.superClass&&(o=R("extends",this.generateExpression(t.superClass,s.Unary,7)),i=R(i,o)),i.push(y),i.push(this.generateStatement(t.body,33)),i},MethodDefinition:function(t,r,n){var i,s;return i=t.static?["static"+y]:[],s="get"===t.kind||"set"===t.kind?[R(t.kind,this.generatePropertyKey(t.key,t.computed)),this.generateFunctionBody(t.value)]:[X(t),this.generatePropertyKey(t.key,t.computed),this.generateFunctionBody(t.value)],R(i,s)},Property:function(t,r,n){return"get"===t.kind||"set"===t.kind?[t.kind,L(),this.generatePropertyKey(t.key,t.computed),this.generateFunctionBody(t.value)]:t.shorthand?"AssignmentPattern"===t.value.type?this.AssignmentPattern(t.value,s.Sequence,7):this.generatePropertyKey(t.key,t.computed):t.method?[X(t),this.generatePropertyKey(t.key,t.computed),this.generateFunctionBody(t.value)]:[this.generatePropertyKey(t.key,t.computed),":"+y,this.generateExpression(t.value,s.Assignment,7)]},ObjectExpression:function(t,r,n){var i,o,a,l,h=this;return t.properties.length?(o=t.properties.length>1,z(function(){l=h.generateExpression(t.properties[0],s.Sequence,7)}),o||(i=B(l).toString(),/[\r\n]/g.test(i)))?(z(function(r){var n,i;if(a=["{",g,r,l],o)for(a.push(","+g),n=1,i=t.properties.length;n<i;++n)a.push(r),a.push(h.generateExpression(t.properties[n],s.Sequence,7)),n+1<i&&a.push(","+g)}),I(B(a).toString())||a.push(g),a.push(u),a.push("}"),a):["{",y,l,y,"}"]:"{}"},AssignmentPattern:function(t,r,n){return this.generateAssignment(t.left,t.right,"=",r,n)},ObjectPattern:function(t,r,n){var o,a,l,h,c,d=this;if(!t.properties.length)return"{}";if(h=!1,1===t.properties.length)(c=t.properties[0]).type===i.Property&&c.value.type!==i.Identifier&&(h=!0);else for(a=0,l=t.properties.length;a<l;++a)if((c=t.properties[a]).type===i.Property&&!c.shorthand){h=!0;break}return o=["{",h?g:""],z(function(r){var n,i;for(n=0,i=t.properties.length;n<i;++n)o.push(h?r:""),o.push(d.generateExpression(t.properties[n],s.Sequence,7)),n+1<i&&o.push(","+(h?g:y))}),h&&!I(B(o).toString())&&o.push(g),o.push(h?u:""),o.push("}"),o},ThisExpression:function(t,r,n){return"this"},Super:function(t,r,n){return"super"},Identifier:function(t,r,n){return q(t)},ImportDefaultSpecifier:function(t,r,n){return q(t.id||t.local)},ImportNamespaceSpecifier:function(t,r,n){var i=["*"],s=t.id||t.local;return s&&i.push(y+"as"+L()+q(s)),i},ImportSpecifier:function(t,r,n){var i=t.imported,s=[i.name],o=t.local;return o&&o.name!==i.name&&s.push(L()+"as"+L()+q(o)),s},ExportSpecifier:function(t,r,n){var i=t.local,s=[i.name],o=t.exported;return o&&o.name!==i.name&&s.push(L()+"as"+L()+q(o)),s}
91,Literal:function(t,r,n){var s;if(t.hasOwnProperty("raw")&&E&&A.raw)try{if((s=E(t.raw).body[0].expression).type===i.Literal&&s.value===t.value)return t.raw}catch(t){}return t.regex?"/"+t.regex.pattern+"/"+t.regex.flags:"bigint"==typeof t.value?t.value.toString()+"n":t.bigint?t.bigint+"n":null===t.value?"null":"string"==typeof t.value?function(t){var r,n,i,s,o,a="",u=0,h=0;for(r=0,n=t.length;r<n;++r){if(39===(i=t.charCodeAt(r)))++u;else if(34===i)++h;else if(47===i&&c)a+="\\";else if(l.code.isLineTerminator(i)||92===i){a+=function(t){if(92===t)return"\\\\";if(10===t)return"\\n";if(13===t)return"\\r";if(8232===t)return"\\u2028";if(8233===t)return"\\u2029";throw Error("Incorrectly classified character")}(i);continue}else if(!l.code.isIdentifierPartES5(i)&&(c&&i<32||!c&&!m&&(i<32||i>126))){a+=function(t,r){var n;return 8===t?"\\b":12===t?"\\f":9===t?"\\t":(n=t.toString(16).toUpperCase(),c||t>255)?"\\u"+"0000".slice(n.length)+n:0!==t||l.code.isDecimalDigit(r)?11===t?"\\x0B":"\\x"+"00".slice(n.length)+n:"\\0"}(i,t.charCodeAt(r+1));continue}a+=String.fromCharCode(i)}if(o=(s=!("double"===f||"auto"===f&&h<u))?"'":'"',!(s?u:h))return o+a+o;for(r=0,t=a,a=o,n=t.length;r<n;++r)(39===(i=t.charCodeAt(r))&&s||34===i&&!s)&&(a+="\\"),a+=String.fromCharCode(i);return a+o}(t.value):"number"==typeof t.value?function(t){var r,n,i,s,o;if(t!=t)throw Error("Numeric literal whose value is NaN");if(t<0||0===t&&1/t<0)throw Error("Numeric literal whose value is negative");if(t===1/0)return c?"null":d?"1e400":"1e+400";if(r=""+t,!d||r.length<3)return r;for(n=r.indexOf("."),c||48!==r.charCodeAt(0)||1!==n||(n=0,r=r.slice(1)),i=r,r=r.replace("e+","e"),s=0,(o=i.indexOf("e"))>0&&(s=+i.slice(o+1),i=i.slice(0,o)),n>=0&&(s-=i.length-n-1,i=+(i.slice(0,n)+i.slice(n+1))+""),o=0;48===i.charCodeAt(i.length+o-1);)--o;return 0!==o&&(s-=o,i=i.slice(0,o)),0!==s&&(i+="e"+s),(i.length<r.length||p&&t>1e12&&Math.floor(t)===t&&(i="0x"+t.toString(16)).length<r.length)&&+i===t&&(r=i),r}(t.value):"boolean"==typeof t.value?t.value?"true":"false":function(t){var r,n,i,s,o,a,l,u;if(n=t.toString(),t.source){if(!(r=n.match(/\/([^/]*)$/)))return n;for(s=0,i=r[1],n="",l=!1,u=!1,o=t.source.length;s<o;++s)a=t.source.charCodeAt(s),u?(n+=M(a,u),u=!1):(l?93===a&&(l=!1):47===a?n+="\\":91===a&&(l=!0),n+=M(a,u),u=92===a);return"/"+n+"/"+i}return n}(t.value)},GeneratorExpression:function(t,r,n){return this.ComprehensionExpression(t,r,n)},ComprehensionExpression:function(t,r,n){var o,a,l,u,h=this;return o=t.type===i.GeneratorExpression?["("]:["["],A.moz.comprehensionExpressionStartsWithAssignment&&(u=this.generateExpression(t.body,s.Assignment,7),o.push(u)),t.blocks&&z(function(){for(a=0,l=t.blocks.length;a<l;++a)u=h.generateExpression(t.blocks[a],s.Sequence,7),a>0||A.moz.comprehensionExpressionStartsWithAssignment?o=R(o,u):o.push(u)}),t.filter&&(o=R(o,"if"+y),u=this.generateExpression(t.filter,s.Sequence,7),o=R(o,["(",u,")"])),A.moz.comprehensionExpressionStartsWithAssignment||(u=this.generateExpression(t.body,s.Assignment,7),o=R(o,u)),o.push(t.type===i.GeneratorExpression?")":"]"),o},ComprehensionBlock:function(t,r,n){var o;return o=R(o=t.left.type===i.VariableDeclaration?[t.left.kind,L(),this.generateStatement(t.left.declarations[0],0)]:this.generateExpression(t.left,s.Call,7),t.of?"of":"in"),o=R(o,this.generateExpression(t.right,s.Sequence,7)),["for"+y+"(",o,")"]},SpreadElement:function(t,r,n){return["...",this.generateExpression(t.argument,s.Assignment,7)]},TaggedTemplateExpression:function(t,r,n){var i=3;return 2&n||(i=1),V([this.generateExpression(t.tag,s.Call,i),this.generateExpression(t.quasi,s.Primary,4)],s.TaggedTemplate,r)},TemplateElement:function(t,r,n){return t.value.raw},TemplateLiteral:function(t,r,n){var i,o,a;for(o=0,i=["`"],a=t.quasis.length;o<a;++o)i.push(this.generateExpression(t.quasis[o],s.Primary,7)),o+1<a&&(i.push("${"+y),i.push(this.generateExpression(t.expressions[o],s.Sequence,7)),i.push(y+"}"));return i.push("`"),i},ModuleSpecifier:function(t,r,n){return this.Literal(t,r,n)},ImportExpression:function(t,r,n){return V(["import(",this.generateExpression(t.source,s.Assignment,7),")"],s.Call,r)}},O(H.prototype,H.Expression),H.prototype.generateExpression=function(t,r,n){var o,a,l,u;return(a=t.type||i.Property,A.verbatim&&t.hasOwnProperty(A.verbatim))?B(u="string"==typeof(l=t[A.verbatim])?V(G(l),s.Sequence,r):V(u=G(l.content),null!=l.precedence?l.precedence:s.Sequence,r),t):(o=this[a](t,r,n),A.comment&&(o=$(t,o)),B(o,t))},H.prototype.generateStatement=function(t,r){var n,s;return n=this[t.type](t,r),A.comment&&(n=$(t,n)),s=B(n).toString(),t.type!==i.Program||x||""!==g||"\n"!==s.charAt(s.length-1)||(n=C?B(n).replaceRight(/\s+$/,""):s.replace(/\s+$/,"")),B(n,t)},S=T().format,r.version=n(6977).version,r.generate=function(i,a){var l,S,F=T();return(null!=a?("string"==typeof a.indent&&(F.format.indent.style=a.indent),"number"==typeof a.base&&(F.format.indent.base=a.base),h=(a=k(F,a)).format.indent.style,u="string"==typeof a.base?a.base:N(h,a.format.indent.base)):u=N(h=(a=F).format.indent.style,a.format.indent.base),c=a.format.json,d=a.format.renumber,p=!c&&a.format.hexadecimal,f=c?"double":a.format.quotes,m=a.format.escapeless,g=
91a.format.newline,y=a.format.space,a.format.compact&&(g=y=h=u=""),v=a.format.parentheses,b=a.format.semicolons,x=a.format.safeConcatenation,_=a.directive,E=c?null:a.parse,C=a.sourceMap,D=a.sourceCode,w=a.format.preserveBlankLines&&null!==D,A=a,C&&(o=r.browser?n.g.sourceMap.SourceNode:n(23721).SourceNode),l=function(r){var n;if(n=new H,t(r))return n.generateStatement(r,1);if(H.Expression.hasOwnProperty(r.type))return n.generateExpression(r,s.Sequence,7);throw Error("Unknown node type: "+r.type)}(i),C)?(S=l.toStringWithSourceMap({file:a.file,sourceRoot:a.sourceMapRoot}),a.sourceContent&&S.map.setSourceContent(a.sourceMap,a.sourceContent),a.sourceMapWithCode)?S:S.map.toString():(S={code:l.toString(),map:null},a.sourceMapWithCode?S:S.code)},r.attachComments=a.attachComments,r.Precedence=k({},s),r.browser=!1,r.FORMAT_MINIFY={indent:{style:"",base:0},renumber:!0,hexadecimal:!0,quotes:"auto",escapeless:!0,compact:!0,parentheses:!1,semicolons:!1},r.FORMAT_DEFAULTS=S}()},93421:(t,r,n)=>{"use strict";n.d(r,{A:()=>function t(r,n){if(Array.isArray(r))return r.map(r=>t(r,n));if(!r)throw TypeError("Empty color reference");(0,s.Kg)(r)&&(r=(0,o.Ay)(r,n));let a=r.space||r.spaceId;return"string"==typeof a&&(r.space=i.A.get(a)),void 0===r.alpha&&(r.alpha=1),r}});var i=n(87442),s=n(56062),o=n(52497)},95115:(t,r,n)=>{"use strict";n.d(r,{A:()=>s});var i=n(58905),s={modeAdjust:function(t,r,n,s,o){let a;return o===i.p?a={x:t,y:r,w:Math.abs(n),h:Math.abs(s)}:o===i.t?a={x:Math.min(t,n),y:Math.min(r,s),w:Math.abs(n-t),h:Math.abs(s-r)}:o===i.u?a={x:t-(n=Math.abs(n)),y:r-(s=Math.abs(s)),w:2*n,h:2*s}:o===i.v&&(a={x:t-.5*(n=Math.abs(n)),y:r-.5*(s=Math.abs(s)),w:n,h:s}),a}}},96898:(t,r,n)=>{"use strict";n.d(r,{A:()=>s});var i=n(58905);function s(t,r){let n=r.DEGREES="degrees",s=r.RADIANS="radians";r._angleMode=s,r.acos=function(t){return this._fromRadians(Math.acos(t))},r.asin=function(t){return this._fromRadians(Math.asin(t))},r.atan=function(t){return this._fromRadians(Math.atan(t))},r.atan2=function(t,r){return this._fromRadians(Math.atan2(t,r))},r.cos=function(t){return Math.cos(this._toRadians(t))},r.sin=function(t){return Math.sin(this._toRadians(t))},r.tan=function(t){return Math.tan(this._toRadians(t))},r.degrees=t=>t*i.a5,r.radians=t=>t*i.a6,r.angleMode=function(t){if(void 0===t)return this._angleMode;if(t===n||t===s){if(t===this._angleMode)return;t===s?(this.pRotationX=this.pRotationX*i.a6,this.pRotationY=this.pRotationY*i.a6,this.pRotationZ=this.pRotationZ*i.a6):(this.pRotationX=this.pRotationX*i.a5,this.pRotationY=this.pRotationY*i.a5,this.pRotationZ=this.pRotationZ*i.a5),this._angleMode=t}},r._toRadians=function(t){return this._angleMode===n?t*i.a6:t},r._toDegrees=function(t){return this._angleMode===s?t*i.a5:t},r._fromRadians=function(t){return this._angleMode===n?t*i.a5:t},r._fromDegrees=function(t){return this._angleMode===s?t*i.a6:t}}"undefined"!=typeof p5&&s(p5,p5.prototype)},97679:(t,r,n)=>{"use strict";n.d(r,{A:()=>a});var i=n(58905);n(81273);var s=n(75671),o=n(43327);n(39247),n(10726),n(43140);class a{constructor(t){this.renderer=t,t._pInst.push(),this.identityMatrix=new o.uq(4),t.states.setValue("uModelMatrix",new o.uq(4)),this.geometry=new s.V(void 0,void 0,void 0,this.renderer),this.geometry.gid=`_p5_GeometryBuilder_${a.nextGeometryId}`,a.nextGeometryId++,this.hasTransform=!1}transformVertices(t){return this.hasTransform?t.map(t=>this.renderer.states.uModelMatrix.multiplyPoint(t)):t}transformNormals(t){return this.hasTransform?t.map(t=>this.renderer.scratchMat3.multiplyVec(t)):t}addGeometry(t){this.hasTransform=!this.renderer.states.uModelMatrix.mat4.every((t,r)=>t===this.identityMatrix.mat4[r]),this.hasTransform&&this.renderer.scratchMat3.inverseTranspose4x4(this.renderer.states.uModelMatrix);let r=this.geometry.vertices.length;this.geometry.vertices.push(...this.transformVertices(t.vertices)),this.geometry.vertexNormals.push(...this.transformNormals(t.vertexNormals)),this.geometry.uvs.push(...t.uvs);let n=t.userVertexProperties,i=this.geometry.userVertexProperties,s=this.geometry.vertices.length-t.vertices.length;for(let r in i){if(r in n)continue;let s=i[r],o=Array(s.getDataSize()*t.vertices.length).fill(0);s.pushDirect(o)}for(let t in n){let r=n[t],o=r.getSrcArray(),a=r.getDataSize();if(s>0&&!(t in i)){let r=Array(a*s).fill(0);this.geometry.vertexProperty(t,r,a)}this.geometry.vertexProperty(t,o,a)}this.renderer.states.fillColor&&this.geometry.faces.push(...t.faces.map(t=>t.map(t=>t+r))),this.renderer.states.strokeColor&&this.geometry.edges.push(...t.edges.map(t=>t.map(t=>t+r)));let o=[...t.vertexColors];for(;o.length<4*t.vertices.length;)o.push(...this.renderer.states.curFillColor);this.geometry.vertexColors.push(...o)}addImmediate(t,r,{validateFaces:n=!1}={}){let s=[];if(this.renderer.states.fillColor){if(r===i.T||r===i.$)for(let r=2;r<t.vertices.length;r++)r%2==0?s.push([r,r-1,r-2]):s.push([r,r-2,r-1]);else if(r===i._)for(let r=2;r<t.vertices.length;r++)s.push([0,r-1,r]);else if(r===i.c)for(let r=0;r<t.vertices.length;r+=3)(!n||t.vertices[r].copy().sub(t.vertices[r+1]).cross(t.vertices[r].copy().sub(t.vertices[r+2])).magSq()>0)&&s.push([r,r+1,r+2])}this.addGeometry(Object.assign({},t,{faces:s}))}addRetained(t){this.addGeometry(t)}finish(){return this.renderer._pInst.pop(),this.geometry}}a.nextGeometryId=0}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.