@mapvx/web-kit 1.2.0-develop.11 → 1.2.0-develop.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/dist/cjs/chunks/{DRACOLoader-CjN7nfMz.cjs → DRACOLoader-gEI4jG0V.cjs} +2 -2
  2. package/dist/cjs/chunks/{GLTFLoader-C33v_eKh.cjs → GLTFLoader-Cd9ix-wY.cjs} +2 -2
  3. package/dist/cjs/chunks/{KTX2Loader-GfgRciKI.cjs → KTX2Loader-Dk2GlCFI.cjs} +2 -2
  4. package/dist/cjs/chunks/{accessibility-CamvBQ8h.cjs → accessibility-C9U1mv_p.cjs} +2 -2
  5. package/dist/cjs/chunks/{back_arrow-BrByZltA.cjs → back_arrow-tpfWrGJ9.cjs} +2 -2
  6. package/dist/cjs/chunks/{debug-hooks-C_m1SbH2.cjs → debug-hooks-xLx1YP8n.cjs} +2 -2
  7. package/dist/cjs/chunks/{dist-B3zxScE2.cjs → dist-1oZjernx.cjs} +2 -2
  8. package/dist/cjs/chunks/{dist-DRfr3UXp.cjs → dist-CYGLkXos.cjs} +2 -2
  9. package/dist/cjs/chunks/{dist-CpCOzc73.cjs → dist-ENDZf7Zh.cjs} +2 -2
  10. package/dist/cjs/chunks/{expression-EUvjFYH4.cjs → expression-q70ZQCYv.cjs} +2 -2
  11. package/dist/cjs/chunks/{globe-viewport-SZrSWKdf.cjs → globe-viewport-CIe_h8dV.cjs} +2 -2
  12. package/dist/cjs/chunks/{icon-origin-point-DW7v7TzN.cjs → icon-origin-point-D_DBb1gM.cjs} +2 -2
  13. package/dist/cjs/chunks/{meshopt_decoder.module-Dk924uu3.cjs → meshopt_decoder.module-B5j8Tze_.cjs} +2 -2
  14. package/dist/cjs/chunks/{repeat_icon-Bpef1DPh.cjs → repeat_icon-F6Q7hnPl.cjs} +2 -2
  15. package/dist/cjs/chunks/{rolldown-runtime-1If4f64F.cjs → rolldown-runtime-BOxlEPsq.cjs} +2 -2
  16. package/dist/cjs/chunks/{shader-type-decoder-BqFbHaKB.cjs → shader-type-decoder-B16cQ7H3.cjs} +2 -2
  17. package/dist/cjs/chunks/{styles-DP9KZtXl.cjs → styles-zP5lXn9p.cjs} +2 -2
  18. package/dist/cjs/chunks/{three.module-Drz560ge.cjs → three.module-BHURJnCD.cjs} +2 -2
  19. package/dist/cjs/chunks/{walking-BfKvsH3Y.cjs → walking-CMpmZTw3.cjs} +2 -2
  20. package/dist/cjs/chunks/{webgl-CxZNw2p_.cjs → webgl-CJbVWdD9.cjs} +2 -2
  21. package/dist/cjs/chunks/{webgl-device-Dpif38ir.cjs → webgl-device-D7wKHxQy.cjs} +2 -2
  22. package/dist/cjs/web-kit.cjs +22 -22
  23. package/dist/es/chunks/{DRACOLoader-CudX8012.js → DRACOLoader-r8VXQ8hj.js} +2 -2
  24. package/dist/es/chunks/{GLTFLoader-BLc_n6C7.js → GLTFLoader-IbJ3eCNr.js} +2 -2
  25. package/dist/es/chunks/{KTX2Loader-CnBac9vX.js → KTX2Loader-DZlQyAGv.js} +2 -2
  26. package/dist/es/chunks/{accessibility-BTRW5qzF.js → accessibility-BldDqm74.js} +2 -2
  27. package/dist/es/chunks/{back_arrow-DaE2mYq8.js → back_arrow-BeeCYF4P.js} +2 -2
  28. package/dist/es/chunks/{debug-hooks-A7fGcVSJ.js → debug-hooks-NzJ2oy3C.js} +2 -2
  29. package/dist/es/chunks/{dist-B8bewEN3.js → dist-B3-nPsaF.js} +2 -2
  30. package/dist/es/chunks/{dist-Cq65fMeu.js → dist-DNNWa2bQ.js} +2 -2
  31. package/dist/es/chunks/{dist-CeI9yzhC.js → dist-DOcsJa1u.js} +2 -2
  32. package/dist/es/chunks/{expression-BFfy7ZSj.js → expression-Dpos4VqC.js} +2 -2
  33. package/dist/es/chunks/{globe-viewport-C_lLyBu9.js → globe-viewport-BmqhgdhG.js} +2 -2
  34. package/dist/es/chunks/{icon-origin-point-bHQmYXyG.js → icon-origin-point-CkHTMtFu.js} +2 -2
  35. package/dist/es/chunks/{meshopt_decoder.module-ClKO_vyv.js → meshopt_decoder.module-YGVnWwV0.js} +2 -2
  36. package/dist/es/chunks/{repeat_icon-BDjNCPIN.js → repeat_icon-B_t3ecTa.js} +2 -2
  37. package/dist/es/chunks/{rolldown-runtime-CGJB3Nua.js → rolldown-runtime-BSTMnvUK.js} +2 -2
  38. package/dist/es/chunks/{shader-type-decoder-DV9QwQh3.js → shader-type-decoder-CFX5sij5.js} +2 -2
  39. package/dist/es/chunks/{styles-BPMrJs_x.js → styles-DTTMB3rI.js} +2 -2
  40. package/dist/es/chunks/{three.module-DUnMDXpm.js → three.module-Cj5xe6gn.js} +2 -2
  41. package/dist/es/chunks/{walking-CUOW_o2S.js → walking--SMEsH_B.js} +2 -2
  42. package/dist/es/chunks/{webgl-B16MrmDy.js → webgl-ZcaUll7k.js} +2 -2
  43. package/dist/es/chunks/{webgl-device-Bht0bA0i.js → webgl-device-KnEQ5CNv.js} +2 -2
  44. package/dist/es/web-kit.mjs +25 -25
  45. package/dist/iife/web-kit.iife.js +22 -22
  46. package/dist/sw/mvx-tiles-sw.js +97 -49
  47. package/dist/types/index.d.ts +40 -42
  48. package/package.json +1 -1
@@ -1,2 +1,2 @@
1
- /*! Web-kit v1.2.0-develop.11 | (c) 2026 MapVX */
2
- !function(){try{var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="598a1f28-2e3d-4618-a34d-f9e4b08c4f4f",e._sentryDebugIdIdentifier="sentry-dbid-598a1f28-2e3d-4618-a34d-f9e4b08c4f4f")}catch(e){}}();exports.default='<svg width="24" height="24" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path\n d="M23.3111 5.74765C23.3048 7.25788 22.0259 8.47682 20.4559 8.47028C18.8858 8.46374 17.6171 7.23418 17.6234 5.72394C17.6297 4.21371 18.9086 2.99477 20.4787 3.00131C22.0487 3.00785 23.3174 4.23741 23.3111 5.74765ZM15.6027 14.335C15.5493 14.3576 15.49 14.3801 15.4365 14.4027L14.7837 14.6791C13.8762 15.0627 13.1628 15.7662 12.7918 16.6476L12.7015 16.8637C12.3089 17.7964 11.2038 18.2476 10.2331 17.8675C9.26247 17.4875 8.79409 16.4259 9.18665 15.4932L9.27701 15.2771C10.0184 13.5198 11.4457 12.1073 13.2548 11.34L13.9076 11.0636C15.1445 10.5446 16.4254 10.2765 17.8236 10.2823C20.4661 10.2933 22.8414 11.83 23.8448 14.1756L24.6951 16.2757L26.0079 16.8907C26.9421 17.3447 27.3167 18.44 26.8449 19.3382C26.3731 20.2363 25.2341 20.5962 24.2998 20.1422L22.7211 19.378C22.1121 19.0792 21.6343 18.5816 21.3761 17.9766L20.8128 16.664L19.6538 20.3906L22.5736 23.4849C22.8922 23.8223 23.1215 24.2277 23.2323 24.6726L24.5731 29.9193C24.8238 30.9003 24.2035 31.8889 23.1894 32.124C22.1693 32.3647 21.1409 31.7679 20.8428 30.7925L19.6077 25.7627L15.4431 21.353C14.5701 20.4321 14.1962 19.1487 14.5864 17.9483L15.6027 14.335ZM12.1328 25.6404L13.6265 22.0917C13.7531 22.2631 13.8899 22.4232 14.0397 22.5834L16.4406 25.1228L15.5729 27.1815C15.4292 27.5284 15.2146 27.8408 14.941 28.096L11.2726 31.5958C10.5291 32.3048 9.32871 32.2998 8.59121 31.5846C7.85382 30.8694 7.85862 29.7186 8.60194 29.0096L12.1328 25.6404Z"\n fill="currentColor" />\n</svg>';
1
+ /*! Web-kit v1.2.0-develop.13 | (c) 2026 MapVX */
2
+ !function(){try{var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="6304e3a9-2d42-469a-89f1-8115cd399a66",e._sentryDebugIdIdentifier="sentry-dbid-6304e3a9-2d42-469a-89f1-8115cd399a66")}catch(e){}}();exports.default='<svg width="24" height="24" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path\n d="M23.3111 5.74765C23.3048 7.25788 22.0259 8.47682 20.4559 8.47028C18.8858 8.46374 17.6171 7.23418 17.6234 5.72394C17.6297 4.21371 18.9086 2.99477 20.4787 3.00131C22.0487 3.00785 23.3174 4.23741 23.3111 5.74765ZM15.6027 14.335C15.5493 14.3576 15.49 14.3801 15.4365 14.4027L14.7837 14.6791C13.8762 15.0627 13.1628 15.7662 12.7918 16.6476L12.7015 16.8637C12.3089 17.7964 11.2038 18.2476 10.2331 17.8675C9.26247 17.4875 8.79409 16.4259 9.18665 15.4932L9.27701 15.2771C10.0184 13.5198 11.4457 12.1073 13.2548 11.34L13.9076 11.0636C15.1445 10.5446 16.4254 10.2765 17.8236 10.2823C20.4661 10.2933 22.8414 11.83 23.8448 14.1756L24.6951 16.2757L26.0079 16.8907C26.9421 17.3447 27.3167 18.44 26.8449 19.3382C26.3731 20.2363 25.2341 20.5962 24.2998 20.1422L22.7211 19.378C22.1121 19.0792 21.6343 18.5816 21.3761 17.9766L20.8128 16.664L19.6538 20.3906L22.5736 23.4849C22.8922 23.8223 23.1215 24.2277 23.2323 24.6726L24.5731 29.9193C24.8238 30.9003 24.2035 31.8889 23.1894 32.124C22.1693 32.3647 21.1409 31.7679 20.8428 30.7925L19.6077 25.7627L15.4431 21.353C14.5701 20.4321 14.1962 19.1487 14.5864 17.9483L15.6027 14.335ZM12.1328 25.6404L13.6265 22.0917C13.7531 22.2631 13.8899 22.4232 14.0397 22.5834L16.4406 25.1228L15.5729 27.1815C15.4292 27.5284 15.2146 27.8408 14.941 28.096L11.2726 31.5958C10.5291 32.3048 9.32871 32.2998 8.59121 31.5846C7.85382 30.8694 7.85862 29.7186 8.60194 29.0096L12.1328 25.6404Z"\n fill="currentColor" />\n</svg>';
@@ -1,2 +1,2 @@
1
- /*! Web-kit v1.2.0-develop.11 | (c) 2026 MapVX */
2
- !function(){try{var n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},e=(new n.Error).stack;e&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[e]="5987c497-eaf6-4188-990e-f1d444664ebd",n._sentryDebugIdIdentifier="sentry-dbid-5987c497-eaf6-4188-990e-f1d444664ebd")}catch(n){}}();const n=require("./debug-hooks-C_m1SbH2.cjs"),e=require("./expression-EUvjFYH4.cjs"),t=require("./dist-CpCOzc73.cjs");function r(n,e,t=!1){if(t)return 1===e?"float":`vec${e}`;switch(n){case"uint8":case"uint16":case"uint32":return 1===e?"uint":`uvec${e}`;case"sint8":case"sint16":case"sint32":return 1===e?"int":`ivec${e}`;default:return 1===e?"float":`vec${e}`}}function i(n,e,t=!1){let r;if(t)switch(n){case"uint8":r="unorm8";break;case"sint8":r="snorm8";break;case"uint16":r="unorm16";break;case"sint16":r="snorm16";break;case"float32":r="float32";break;default:throw new Error(`Unsupported normalized vertex format for ${n}`)}else r=n;return 1===e?r:3!==e||r.startsWith("float32")||r.endsWith("32")?`${r}x${e}`:`${r}x3-webgl`}function s(n){switch(n[0]){case"u":return"0u";case"s":return"0";default:return"0."}}function u(n){switch(n){case"uint8":return"r8uint";case"sint8":return"r8sint";case"uint16":return"r16uint";case"sint16":return"r16sint";case"uint32":return"r32uint";case"sint32":return"r32sint";case"float32":return"r32float";default:throw new Error(`Unsupported WebGL gather texture format for ${n}`)}}var o=new n.GLSLShaderAssembler;function a({module:n,elementWise:i=!1,expression:u,inputs:a,output:d,operationType:p=d.type,outputBuffer:m}){const g=m.device,h=c("result",d.type,d.size,d.normalized),_=[n,h],x=[],v={},E=r(d.type,1,d.normalized),y=r(p,1,d.normalized);let b="",T=null;const $={TYPE:y,RESULT_LEN:d.size.toString()},w=function(n){return Array.isArray(n)?n.map((n,e)=>[`x${e}`,n]):Object.entries(n)}(a);for(const[t,r]of w)_.push(l(t,r.type,r.size,r.normalized,p)),x.push(f(t,r)),r instanceof e.GPUDataEvaluator?v[t]=r.buffer:(T=T||e.bufferPool.createOrReuse(g,m.byteLength),v[t]=T),b+=`TYPE ${t}[${r.size}]; get_${t}(${t});\n`,$[`${t.toUpperCase()}_LEN`]=r.size.toString();let S="";if(u)for(let e=0;e<d.size;e++)S+=`result[${e}]=${u(e)};\n`;else if(i)for(let e=0;e<d.size;e++){const t=s(y),r=w.map(([n,r])=>e<r.size?`${n}[${e}]`:t);S+=`result[${e}]=${n.name}(${r.join(", ")});\n`}else S=`${n.name}(${w.map(([n])=>n).join(", ")}, result);`;const L=`#version 300 es\n\nvoid main() {\n${b}\n${E} result[${d.size}];\n${S}\nset_result(result);\n}\n `,z=new t.BufferTransform(g,{vs:L,shaderAssembler:o,defines:$,modules:_,bufferLayout:x,vertexCount:1,instanceCount:d.length,attributes:v,feedbackBufferMode:"interleaved",outputs:h.varyings});g.statsManager.getStats("GPGPU Operation Counts").get("Transform Runs").incrementCount(),z.run({inputBuffers:v,outputBuffers:{[h.varyings[0]]:0===d.offset?m:{buffer:m,byteOffset:d.offset,byteLength:d.byteLength}}}),T&&e.bufferPool.recycle(T)}function l(n,e,t,i=!1,s=e){let u="",o="";for(let a=0;a<t;a+=4){const l=Math.min(t-a,4);u+=`in ${r(e,l,i)} a${n}_${a};\n`;for(let t=0;t<l;t++){let r=`a${n}_${a}`;l>1&&(r=`${r}[${t}]`),(i||e!==s)&&(r=`TYPE(${r})`),o+=`v[${a+t}]=${r};\n`}}return{name:n,vs:`\n${u}\nvoid get_${n}(out TYPE v[${t}]) {\n ${o}\n}\n`}}function f(n,e){const t={name:n,stepMode:e.isConstant?"vertex":"instance",byteStride:e.stride,attributes:[]};for(let r=0;r<e.size;r+=4){const s=Math.min(e.size-r,4);t.attributes.push({attribute:`a${n}_${r}`,format:i(e.type,s,e.normalized),byteOffset:e.offset+e.ValueType.BYTES_PER_ELEMENT*r})}return t}function c(n,e,t,i=!1){const s=[],u=r(e,1,i);let o="",a="";for(let l=0;l<t;l+=4){const u=Math.min(t-l,4),f=r(e,u,i);s.push(`${n}_${l}`),o+=`flat out ${f} ${n}_${l};\n`;const c=Array.from({length:u},(n,e)=>l+e);a+=`${n}_${l} = ${f}(${c.map(n=>`v[${n}]`).join(",")});\n`}return{name:n,varyings:s,vs:`\n${o}\nvoid set_${n}(in ${u} v[${t}]) {\n ${a}\n}\n`}}var d=({inputs:t,output:i,target:u})=>{const o=i.type,l=r(o,1,i.normalized),f=s(l),c=t.namedInputs;return a({module:{name:"arithmetic",dependencies:[n.fp32],vs:"TYPE arithmetic_add(TYPE x, TYPE y) {\n return x + y;\n}\n\nTYPE arithmetic_subtract(TYPE x, TYPE y) {\n return x - y;\n}\n\nTYPE arithmetic_multiply(TYPE x, TYPE y) {\n return x * y;\n}\n\nTYPE arithmetic_divide(TYPE x, TYPE y) {\n return x / y;\n}\n\nfloat arithmetic_tan(float x) {\n return tan_fp32(x);\n}\n"},inputs:c,output:i,operationType:o,outputBuffer:u,expression:n=>e.compileExpression(t.expression,{operations:e.ARITHMETIC_OPERATIONS,inputs:c,laneIndex:n,formatInput:e=>`${e}[${n}]`,formatOutOfBoundsInput:n=>1===c[n].size?`${n}[0]`:f,formatLiteral:e=>{const t=Array.isArray(e)?e[n]??0:e;return`${l}(${function(n,e){switch(n){case"uint8":case"uint16":case"uint32":return`${Math.trunc(e)}u`;case"sint8":case"sint16":case"sint32":return`${Math.trunc(e)}`;default:return Number.isInteger(e)?`${e}.0`:`${e}`}}(o,t)})`},formatCall:(n,e)=>`${n}(${e.join(", ")})`})}),{success:!0}},p=3e38;var m=`#define LE ${function(){const n=new Uint16Array([255]);return new Uint8Array(n.buffer)[0]>0}()?1:0}\nconst uint F32_NAN = 0xffffffffu;\nconst uint F32_INF = 0x7f800000u;\n\n// Find first set bit using binary search\n// https://en.wikipedia.org/wiki/Find_first_set#CLZ\nint countLeadingZeros(uint a) {\n if (a == 0u) return 32;\n int n = 0;\n if ((a & 0xffff0000u) == 0u) { n += 16; a = a << 16; }\n if ((a & 0xff000000u) == 0u) { n += 8; a = a << 8; }\n if ((a & 0xf0000000u) == 0u) { n += 4; a = a << 4; }\n if ((a & 0xc0000000u) == 0u) { n += 2; a = a << 2; }\n if ((a & 0x80000000u) == 0u) return n + 1;\n return n;\n}\n\nuint roundShiftRight(uint value, int shift) {\n if (shift <= 0) {\n return value << (-shift);\n }\n\n if (shift >= 32) {\n if (shift == 32 && value > 0x80000000u) {\n return 1u;\n }\n return 0u;\n }\n\n uint truncated = value >> shift;\n uint halfShift = 1u << (shift - 1);\n uint remainder = value & ((1u << shift) - 1u);\n if (remainder > halfShift || (remainder == halfShift && (truncated & 1u) == 1u)) {\n return truncated + 1u;\n }\n return truncated;\n}\n\nuint makeFloat_(uint sign, int exponent, uint mantissa) {\n return (sign << 31) | (uint(exponent + 127) << 23) | (mantissa & 0x7fffffu);\n}\n\n/**\n * Assemble a float32 in bit representation according to IEEE 754\n * https://en.wikipedia.org/wiki/Single-precision_floating-point_format\n */\nuint makeFloat(uint sign, int exponent, uint significand) {\n if (significand == 0u) {\n return sign << 31;\n }\n\n // Remove any extra leading zeros for better precision\n int lead_zeros = countLeadingZeros(significand);\n // Significand is encoded as 1.fraction\n int normalizedExponent = exponent + 31 - lead_zeros;\n\n if (normalizedExponent > 127) {\n return (sign << 31) | F32_INF;\n }\n\n uint mantissa;\n if (normalizedExponent >= -126) {\n mantissa = roundShiftRight(significand, 8 - lead_zeros);\n if (mantissa >= 0x1000000u) {\n mantissa >>= 1;\n normalizedExponent++;\n if (normalizedExponent > 127) {\n return (sign << 31) | F32_INF;\n }\n }\n return makeFloat_(sign, normalizedExponent, mantissa);\n }\n\n int subnormalShift = -149 - exponent;\n mantissa = roundShiftRight(significand, subnormalShift);\n if (mantissa >= 0x800000u) {\n return (sign << 31) | (1u << 23);\n }\n return (sign << 31) | mantissa;\n}\n\n/**\n * Parse 8-byte memory as a float64 number according to IEEE 754\n * https://en.wikipedia.org/wiki/Double-precision_floating-point_format\n * Returns 8-byte memory as 2 float32 numbers, consisting of\n * high part: fround(d)\n * low part: d - fround(d)\n */\nuvec2 parseAsDouble(uvec2 d) {\n #if LE\n d = d.yx; // to big endian\n #endif\n\n uint sign = (d[0] >> 31) & 1u; // first bit\n uint exponentBits = (d[0] >> 20) & 0x7ffu;\n int exponent = int(exponentBits) - 1023; // next 11 bits\n uint fractionHigh = d[0] & 0xfffffu;\n uint fractionLow = d[1];\n\n if (exponentBits == 0x7ffu) {\n if (fractionHigh == 0u && fractionLow == 0u) {\n return uvec2((sign << 31) | F32_INF, F32_NAN);\n }\n return uvec2(F32_NAN);\n }\n \n if (exponentBits == 0u) {\n // All float64 subnormals are too small to survive a float32 split.\n return uvec2(sign << 31);\n }\n\n if (exponent > 127) {\n return uvec2((sign << 31) | F32_INF, ((1u - sign) << 31) | F32_INF);\n }\n\n uint hi_part;\n uint low_part;\n\n // float64 significand has 52 bits\n // float32 significand has 23 bits\n // The significand of the high part is the significand of the double, trimmed\n uint f_hi = 0x800000u | (fractionHigh << 3) | (fractionLow >> 29);\n uint f_low = fractionLow & 0x1fffffffu;\n\n if (exponent < -126) {\n // For tiny normals, the top 24 significand bits still contribute to the float32\n // high part, but they land in the float32 subnormal range.\n hi_part = makeFloat(sign, exponent - 23, f_hi);\n\n // The residual keeps the remaining 29 significand bits at the original double scale.\n low_part = makeFloat(sign, exponent - 52, f_low);\n return uvec2(hi_part, low_part);\n }\n\n bool roundUp = f_low > 0x10000000u || (f_low == 0x10000000u && (f_hi & 1u) == 1u);\n\n uint f_rounded = f_hi + (roundUp ? 1u : 0u);\n int exponent_hi = exponent;\n if (f_rounded == 0x1000000u) {\n f_rounded = 0x800000u;\n exponent_hi++;\n }\n\n if (exponent_hi > 127) {\n // Overflows float32 limit\n hi_part = (sign << 31) | F32_INF;\n low_part = ((1u - sign) << 31) | F32_INF;\n return uvec2(hi_part, low_part);\n }\n \n hi_part = makeFloat_(sign, exponent_hi, f_rounded);\n\n int remainder = int(f_low);\n uint sign_low = sign;\n if (roundUp) {\n remainder -= 0x20000000;\n }\n if (remainder < 0) {\n sign_low = 1u - sign;\n remainder = -remainder;\n }\n low_part = makeFloat(sign_low, exponent - 52, uint(remainder));\n\n return uvec2(hi_part, low_part);\n}\n\nvoid fround(in uint x[X_LEN], out float result[X_LEN]) {\n int n = X_LEN / 2;\n for (int i = 0; i < n; i++) {\n uvec2 f = parseAsDouble(uvec2(x[i * 2], x[i * 2 + 1]));\n result[i] = uintBitsToFloat(f.x);\n result[i + n] = uintBitsToFloat(f.y);\n }\n}\n`;function g(n,e,t){const i=function(n){switch(n){case"uint32":return"usampler2D";case"sint32":return"isampler2D";case"float32":return"sampler2D";default:throw new Error(`Unsupported WebGL gather sampler type for ${n}`)}}(t),s=r(e,1),u=Array.from({length:n.size},(n,e)=>` v[${e}] = ${s}(texelFetch(source_values_texture, ivec2(${e}, rowIndex), 0).r);`).join("\n");return{name:"source_values_texture",vs:`\nuniform highp ${i} source_values_texture;\nvoid read_source_values(int rowIndex, out TYPE v[${n.size}]) {\n${u}\n}\n`}}function h(e,t,r){const i=r.createTexture({width:Math.max(e.size,1),height:e.length,format:u(t),usage:n.Texture.SAMPLE|n.Texture.COPY_DST});if(0===e.length)return i;const s=r.createCommandEncoder();return s.copyBufferToTexture({sourceBuffer:e.buffer,destinationTexture:i,byteOffset:e.offset,bytesPerRow:e.stride,rowsPerImage:e.length,size:[e.size,e.length,1]}),r.submit(s.finish()),i}function _(n,e){const t=r(n.type,1);let i="aids_0";return n.type!==function(n){switch(n){case"uint":return"uint32";case"int":return"sint32";default:return"float32"}}(e)&&(i=`${e}(${i})`),{name:"ids",vs:`\nin ${t} aids_0;\nvoid get_ids(out INDEX_TYPE v[1]) {\n v[0] = ${i};\n}\n`}}function x(n,e,t,r){return t<e.size?`${n}[${t}]`:1===e.size?`${n}[0]`:r}exports.arithmetic=d,exports.dot=({inputs:n,output:e,target:t})=>(a({module:{name:"row_dot",vs:"void row_dot(in TYPE x[X_LEN], in TYPE y[Y_LEN], out float result[1]) {\n float sum = 0.0;\n for (int i = 0; i < X_LEN; i++) {\n sum += float(x[i]) * float(y[i]);\n }\n result[0] = sum;\n}\n"},inputs:n,output:e,operationType:"float32",outputBuffer:t}),{success:!0}),exports.equalAll=({inputs:n,output:e,target:t})=>(a({module:{name:"equalAll",vs:"void equalAll(in TYPE x[X_LEN], in TYPE y[Y_LEN], out uint result[1]) {\n uint allEqual = uint(1);\n for (int i = 0; i < X_LEN; i++) {\n if (x[i] != y[i]) {\n allEqual = uint(0);\n break;\n }\n }\n result[0] = allEqual;\n}\n"},inputs:n,output:e,operationType:"uint32"===e.type?n.x.type:e.type,outputBuffer:t}),{success:!0}),exports.extent=({inputs:r,output:i,target:s})=>{const{sourceValues:u}=r,o=s.device;if(0===u.length){const n=new i.ValueType(i.length*i.size);return s.write(n),{success:!0,value:n}}if(u.isConstant){const n=u.value,e=new i.ValueType(i.length*i.size);for(let t=0;t<i.length;t++){const r=n[t];e[2*t]=r,e[2*t+1]=r}return s.write(e),{success:!0,value:e}}const a=o.createTexture({width:1,height:i.length,format:"rg32float",usage:n.Texture.RENDER|n.Texture.COPY_SRC|n.Texture.COPY_DST}),c=o.createFramebuffer({colorAttachments:[a]}),m=new t.Model(o,{vs:"#version 300 es\n\nflat out float extent_value;\n\nvoid main() {\n float sourceValues[SOURCE_VALUES_LEN];\n get_sourceValues(sourceValues);\n extent_value = sourceValues[gl_VertexID];\n\n float y = (float(gl_VertexID) + 0.5) / float(CHANNEL_COUNT) * 2.0 - 1.0;\n gl_Position = vec4(0.0, y, 0.0, 1.0);\n gl_PointSize = 1.0;\n}\n ",fs:"#version 300 es\n\nprecision highp float;\n\nflat in float extent_value;\nout vec2 fragColor;\n\nvoid main() {\n fragColor = vec2(-extent_value, extent_value);\n}\n ",topology:"point-list",parameters:{depthCompare:"always",blend:!0,blendColorSrcFactor:"one",blendColorDstFactor:"one",blendColorOperation:"max",blendAlphaSrcFactor:"one",blendAlphaDstFactor:"one",blendAlphaOperation:"max"},modules:[l("sourceValues",u.type,u.size,u.normalized)],defines:{TYPE:"float",SOURCE_VALUES_LEN:u.size.toString(),CHANNEL_COUNT:i.length.toString()},attributes:{sourceValues:u.buffer},bufferLayout:[f("sourceValues",u)],instanceCount:u.length,vertexCount:i.length,disableWarnings:!0}),g=e.bufferPool.createOrReuse(o,i.byteLength);try{const n=o.beginRenderPass({framebuffer:c,parameters:{viewport:[0,0,1,i.length]},clearColor:[-p,-p,0,0],clearDepth:!1,clearStencil:!1});o.statsManager.getStats("GPGPU Operation Counts").get("Transform Runs").incrementCount(),m.draw(n),n.end();const t=o.createCommandEncoder();return t.copyTextureToBuffer({sourceTexture:a,width:1,height:i.length,destinationBuffer:g,byteOffset:0,bytesPerRow:8}),o.submit(t.finish()),d({device:o,inputs:{expression:{kind:"call",op:"multiply",args:[{kind:"input",name:"x"},{kind:"literal",value:[-1,1]}]},namedInputs:{x:new e.GPUDataEvaluator({buffer:g,size:2,type:"float32",length:i.length})}},output:i,target:s})}finally{m.destroy(),e.bufferPool.recycle(g),c.destroy(),a.destroy()}},exports.fround=({inputs:n,output:e,target:t})=>(a({module:{name:"fround",vs:m},inputs:n,output:e,operationType:"uint32",outputBuffer:t}),{success:!0}),exports.gather=async({inputs:n,output:e,target:u})=>{const{ids:o,sourceValues:a}=n,l=u.device,f=c("result",e.type,e.size),d=r(o.type,1),p=r(e.type,1),m=e.type,x=h(a,m,l),v=`#version 300 es\n\nvoid main() {\n INDEX_TYPE ids[1];\n get_ids(ids);\n TYPE result[${e.size}];\n gather(ids, result);\n set_result(result);\n}\n `,E=new t.BufferTransform(l,{vs:v,defines:{INDEX_TYPE:d,TYPE:p,RESULT_LEN:e.size.toString(),SOURCE_VALUES_ROWS:a.length.toString()},modules:[_(o,d),g(a,e.type,m),(b=e.type,{name:"gather",vs:`\nvoid zero_result(out TYPE result[RESULT_LEN]) {\n for (int i = 0; i < RESULT_LEN; i++) {\n result[i] = ${s(b)};\n }\n}\n\nvoid gather(in INDEX_TYPE ids[1], out TYPE result[RESULT_LEN]) {\n int sourceIndex = int(ids[0]);\n if (sourceIndex < 0 || sourceIndex >= SOURCE_VALUES_ROWS) {\n zero_result(result);\n return;\n }\n read_source_values(sourceIndex, result);\n}\n`}),f],bindings:{source_values_texture:x},bufferLayout:[(y=o,{name:"ids",stepMode:y.isConstant?"vertex":"instance",byteStride:y.stride,attributes:[{attribute:"aids_0",format:i(y.type,1,y.normalized),byteOffset:y.offset}]})],vertexCount:1,instanceCount:e.length,feedbackBufferMode:"interleaved",outputs:f.varyings});var y,b;try{return E.run({inputBuffers:{ids:o.buffer},outputBuffers:{[f.varyings[0]]:u}}),{success:!0}}finally{E.destroy(),x.destroy()}},exports.interleave=({inputs:n,output:e,target:t})=>{const r=n.map((n,e)=>[`x${e}`,n]);!function(n,e){const t=e.reduce((n,[,e])=>n+Math.ceil(e.size/4),0);if(t>n)throw new Error(`interleave() requires ${t} vertex attributes, exceeding device limit ${n}`)}(t.device.limits.maxVertexAttributes,r),function(n,e){if(e.size>n)throw new Error(`interleave() output size ${e.size} exceeds device inter-stage component limit ${n}`)}(t.device.limits.maxInterStageShaderVariables,e);const i=r.map(([n,e])=>`in TYPE ${n}[${e.size}]`).join(", ");let s=0;return a({module:{name:"interleave",vs:`void interleave(${i}, out TYPE result[RESULT_LEN]) {\n${r.map(([n,e])=>{const t=Array.from({length:e.size},(e,t)=>` result[${s+t}] = ${n}[${t}];`).join("\n");return s+=e.size,t}).join("\n")}\n}\n`},inputs:n,output:e,outputBuffer:t}),{success:!0}},exports.length=({inputs:n,output:e,target:t})=>(a({module:{name:"row_length",vs:"void row_length(in TYPE x[X_LEN], out float result[1]) {\n float sum = 0.0;\n for (int i = 0; i < X_LEN; i++) {\n sum += float(x[i]) * float(x[i]);\n }\n result[0] = sqrt(sum);\n}\n"},inputs:n,output:e,operationType:"float32",outputBuffer:t}),{success:!0}),exports.segmentedMap=async({inputs:n,output:e,target:r})=>{const{segments:i}=n,s=r.device,u=c("result",e.type,e.size),o=i.type,a=h(i,o,s),l=new t.BufferTransform(s,{vs:"#version 300 es\n\nvoid main() {\n TYPE result[RESULT_LEN];\n segmentedMap(result);\n set_result(result);\n}\n",defines:{TYPE:"uint",RESULT_LEN:e.size.toString(),SEGMENTS_LENGTH:i.length.toString()},modules:[g(i,e.type,o),{name:"segmentedMap",vs:"\nuint read_segment_start(int segmentIndex) {\n TYPE value[1];\n read_source_values(segmentIndex, value);\n return uint(value[0]);\n}\n\nvoid segmentedMap(out TYPE result[RESULT_LEN]) {\n uint vertexIndex = uint(gl_InstanceID);\n int low = 0;\n int high = SEGMENTS_LENGTH;\n\n while (low < high) {\n int mid = low + (high - low) / 2;\n uint midStart = read_segment_start(mid);\n if (midStart <= vertexIndex) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n\n uint segmentIndex = uint(max(low - 1, 0));\n uint segmentStart = read_segment_start(int(segmentIndex));\n result[0] = segmentIndex;\n result[1] = vertexIndex - segmentStart;\n}\n"},u],bindings:{source_values_texture:a},vertexCount:1,instanceCount:e.length,feedbackBufferMode:"interleaved",outputs:u.varyings});try{return l.run({outputBuffers:{[u.varyings[0]]:r}}),{success:!0}}finally{l.destroy(),a.destroy()}},exports.select=async({inputs:n,output:e,target:t})=>{const i=s(r(e.type,1,e.normalized));return a({module:{name:"select",vs:""},inputs:n,output:e,operationType:e.type,outputBuffer:t,expression:e=>{const t=x("condition",n.condition,e,i),r=x("whenTrue",n.whenTrue,e,i),s=x("whenFalse",n.whenFalse,e,i);return`(${t} != ${i} ? ${r} : ${s})`}}),{success:!0}},exports.sequence=({inputs:n,output:e,target:r})=>{const i=c("result",e.type,e.size),s=new t.BufferTransform(r.device,{vs:"#version 300 es\n\nvoid main() {\n int result[1];\n result[0] = START + gl_InstanceID * STEP;\n set_result(result);\n}\n",defines:{START:n.start.toString(),STEP:n.step.toString()},modules:[i],vertexCount:1,instanceCount:e.length,feedbackBufferMode:"interleaved",outputs:i.varyings});try{return s.run({outputBuffers:{[i.varyings[0]]:r}}),{success:!0}}finally{s.destroy()}},exports.swizzle=({inputs:n,output:e,target:t})=>{const{columns:r}=n;return a({module:{name:"swizzle",vs:"// swizzle expression handled inline"},expression:n=>`x[${r[n]}]`,inputs:{x:n.x},output:e,outputBuffer:t}),{success:!0}};
1
+ /*! Web-kit v1.2.0-develop.13 | (c) 2026 MapVX */
2
+ !function(){try{var n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},e=(new n.Error).stack;e&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[e]="a173731b-abc7-4307-b12b-b11cc8a610b5",n._sentryDebugIdIdentifier="sentry-dbid-a173731b-abc7-4307-b12b-b11cc8a610b5")}catch(n){}}();const n=require("./debug-hooks-xLx1YP8n.cjs"),e=require("./expression-q70ZQCYv.cjs"),t=require("./dist-ENDZf7Zh.cjs");function r(n,e,t=!1){if(t)return 1===e?"float":`vec${e}`;switch(n){case"uint8":case"uint16":case"uint32":return 1===e?"uint":`uvec${e}`;case"sint8":case"sint16":case"sint32":return 1===e?"int":`ivec${e}`;default:return 1===e?"float":`vec${e}`}}function i(n,e,t=!1){let r;if(t)switch(n){case"uint8":r="unorm8";break;case"sint8":r="snorm8";break;case"uint16":r="unorm16";break;case"sint16":r="snorm16";break;case"float32":r="float32";break;default:throw new Error(`Unsupported normalized vertex format for ${n}`)}else r=n;return 1===e?r:3!==e||r.startsWith("float32")||r.endsWith("32")?`${r}x${e}`:`${r}x3-webgl`}function s(n){switch(n[0]){case"u":return"0u";case"s":return"0";default:return"0."}}function u(n){switch(n){case"uint8":return"r8uint";case"sint8":return"r8sint";case"uint16":return"r16uint";case"sint16":return"r16sint";case"uint32":return"r32uint";case"sint32":return"r32sint";case"float32":return"r32float";default:throw new Error(`Unsupported WebGL gather texture format for ${n}`)}}var o=new n.GLSLShaderAssembler;function a({module:n,elementWise:i=!1,expression:u,inputs:a,output:d,operationType:p=d.type,outputBuffer:m}){const g=m.device,h=c("result",d.type,d.size,d.normalized),_=[n,h],x=[],v={},E=r(d.type,1,d.normalized),y=r(p,1,d.normalized);let b="",T=null;const $={TYPE:y,RESULT_LEN:d.size.toString()},w=function(n){return Array.isArray(n)?n.map((n,e)=>[`x${e}`,n]):Object.entries(n)}(a);for(const[t,r]of w)_.push(l(t,r.type,r.size,r.normalized,p)),x.push(f(t,r)),r instanceof e.GPUDataEvaluator?v[t]=r.buffer:(T=T||e.bufferPool.createOrReuse(g,m.byteLength),v[t]=T),b+=`TYPE ${t}[${r.size}]; get_${t}(${t});\n`,$[`${t.toUpperCase()}_LEN`]=r.size.toString();let S="";if(u)for(let e=0;e<d.size;e++)S+=`result[${e}]=${u(e)};\n`;else if(i)for(let e=0;e<d.size;e++){const t=s(y),r=w.map(([n,r])=>e<r.size?`${n}[${e}]`:t);S+=`result[${e}]=${n.name}(${r.join(", ")});\n`}else S=`${n.name}(${w.map(([n])=>n).join(", ")}, result);`;const L=`#version 300 es\n\nvoid main() {\n${b}\n${E} result[${d.size}];\n${S}\nset_result(result);\n}\n `,z=new t.BufferTransform(g,{vs:L,shaderAssembler:o,defines:$,modules:_,bufferLayout:x,vertexCount:1,instanceCount:d.length,attributes:v,feedbackBufferMode:"interleaved",outputs:h.varyings});g.statsManager.getStats("GPGPU Operation Counts").get("Transform Runs").incrementCount(),z.run({inputBuffers:v,outputBuffers:{[h.varyings[0]]:0===d.offset?m:{buffer:m,byteOffset:d.offset,byteLength:d.byteLength}}}),T&&e.bufferPool.recycle(T)}function l(n,e,t,i=!1,s=e){let u="",o="";for(let a=0;a<t;a+=4){const l=Math.min(t-a,4);u+=`in ${r(e,l,i)} a${n}_${a};\n`;for(let t=0;t<l;t++){let r=`a${n}_${a}`;l>1&&(r=`${r}[${t}]`),(i||e!==s)&&(r=`TYPE(${r})`),o+=`v[${a+t}]=${r};\n`}}return{name:n,vs:`\n${u}\nvoid get_${n}(out TYPE v[${t}]) {\n ${o}\n}\n`}}function f(n,e){const t={name:n,stepMode:e.isConstant?"vertex":"instance",byteStride:e.stride,attributes:[]};for(let r=0;r<e.size;r+=4){const s=Math.min(e.size-r,4);t.attributes.push({attribute:`a${n}_${r}`,format:i(e.type,s,e.normalized),byteOffset:e.offset+e.ValueType.BYTES_PER_ELEMENT*r})}return t}function c(n,e,t,i=!1){const s=[],u=r(e,1,i);let o="",a="";for(let l=0;l<t;l+=4){const u=Math.min(t-l,4),f=r(e,u,i);s.push(`${n}_${l}`),o+=`flat out ${f} ${n}_${l};\n`;const c=Array.from({length:u},(n,e)=>l+e);a+=`${n}_${l} = ${f}(${c.map(n=>`v[${n}]`).join(",")});\n`}return{name:n,varyings:s,vs:`\n${o}\nvoid set_${n}(in ${u} v[${t}]) {\n ${a}\n}\n`}}var d=({inputs:t,output:i,target:u})=>{const o=i.type,l=r(o,1,i.normalized),f=s(l),c=t.namedInputs;return a({module:{name:"arithmetic",dependencies:[n.fp32],vs:"TYPE arithmetic_add(TYPE x, TYPE y) {\n return x + y;\n}\n\nTYPE arithmetic_subtract(TYPE x, TYPE y) {\n return x - y;\n}\n\nTYPE arithmetic_multiply(TYPE x, TYPE y) {\n return x * y;\n}\n\nTYPE arithmetic_divide(TYPE x, TYPE y) {\n return x / y;\n}\n\nfloat arithmetic_tan(float x) {\n return tan_fp32(x);\n}\n"},inputs:c,output:i,operationType:o,outputBuffer:u,expression:n=>e.compileExpression(t.expression,{operations:e.ARITHMETIC_OPERATIONS,inputs:c,laneIndex:n,formatInput:e=>`${e}[${n}]`,formatOutOfBoundsInput:n=>1===c[n].size?`${n}[0]`:f,formatLiteral:e=>{const t=Array.isArray(e)?e[n]??0:e;return`${l}(${function(n,e){switch(n){case"uint8":case"uint16":case"uint32":return`${Math.trunc(e)}u`;case"sint8":case"sint16":case"sint32":return`${Math.trunc(e)}`;default:return Number.isInteger(e)?`${e}.0`:`${e}`}}(o,t)})`},formatCall:(n,e)=>`${n}(${e.join(", ")})`})}),{success:!0}},p=3e38;var m=`#define LE ${function(){const n=new Uint16Array([255]);return new Uint8Array(n.buffer)[0]>0}()?1:0}\nconst uint F32_NAN = 0xffffffffu;\nconst uint F32_INF = 0x7f800000u;\n\n// Find first set bit using binary search\n// https://en.wikipedia.org/wiki/Find_first_set#CLZ\nint countLeadingZeros(uint a) {\n if (a == 0u) return 32;\n int n = 0;\n if ((a & 0xffff0000u) == 0u) { n += 16; a = a << 16; }\n if ((a & 0xff000000u) == 0u) { n += 8; a = a << 8; }\n if ((a & 0xf0000000u) == 0u) { n += 4; a = a << 4; }\n if ((a & 0xc0000000u) == 0u) { n += 2; a = a << 2; }\n if ((a & 0x80000000u) == 0u) return n + 1;\n return n;\n}\n\nuint roundShiftRight(uint value, int shift) {\n if (shift <= 0) {\n return value << (-shift);\n }\n\n if (shift >= 32) {\n if (shift == 32 && value > 0x80000000u) {\n return 1u;\n }\n return 0u;\n }\n\n uint truncated = value >> shift;\n uint halfShift = 1u << (shift - 1);\n uint remainder = value & ((1u << shift) - 1u);\n if (remainder > halfShift || (remainder == halfShift && (truncated & 1u) == 1u)) {\n return truncated + 1u;\n }\n return truncated;\n}\n\nuint makeFloat_(uint sign, int exponent, uint mantissa) {\n return (sign << 31) | (uint(exponent + 127) << 23) | (mantissa & 0x7fffffu);\n}\n\n/**\n * Assemble a float32 in bit representation according to IEEE 754\n * https://en.wikipedia.org/wiki/Single-precision_floating-point_format\n */\nuint makeFloat(uint sign, int exponent, uint significand) {\n if (significand == 0u) {\n return sign << 31;\n }\n\n // Remove any extra leading zeros for better precision\n int lead_zeros = countLeadingZeros(significand);\n // Significand is encoded as 1.fraction\n int normalizedExponent = exponent + 31 - lead_zeros;\n\n if (normalizedExponent > 127) {\n return (sign << 31) | F32_INF;\n }\n\n uint mantissa;\n if (normalizedExponent >= -126) {\n mantissa = roundShiftRight(significand, 8 - lead_zeros);\n if (mantissa >= 0x1000000u) {\n mantissa >>= 1;\n normalizedExponent++;\n if (normalizedExponent > 127) {\n return (sign << 31) | F32_INF;\n }\n }\n return makeFloat_(sign, normalizedExponent, mantissa);\n }\n\n int subnormalShift = -149 - exponent;\n mantissa = roundShiftRight(significand, subnormalShift);\n if (mantissa >= 0x800000u) {\n return (sign << 31) | (1u << 23);\n }\n return (sign << 31) | mantissa;\n}\n\n/**\n * Parse 8-byte memory as a float64 number according to IEEE 754\n * https://en.wikipedia.org/wiki/Double-precision_floating-point_format\n * Returns 8-byte memory as 2 float32 numbers, consisting of\n * high part: fround(d)\n * low part: d - fround(d)\n */\nuvec2 parseAsDouble(uvec2 d) {\n #if LE\n d = d.yx; // to big endian\n #endif\n\n uint sign = (d[0] >> 31) & 1u; // first bit\n uint exponentBits = (d[0] >> 20) & 0x7ffu;\n int exponent = int(exponentBits) - 1023; // next 11 bits\n uint fractionHigh = d[0] & 0xfffffu;\n uint fractionLow = d[1];\n\n if (exponentBits == 0x7ffu) {\n if (fractionHigh == 0u && fractionLow == 0u) {\n return uvec2((sign << 31) | F32_INF, F32_NAN);\n }\n return uvec2(F32_NAN);\n }\n \n if (exponentBits == 0u) {\n // All float64 subnormals are too small to survive a float32 split.\n return uvec2(sign << 31);\n }\n\n if (exponent > 127) {\n return uvec2((sign << 31) | F32_INF, ((1u - sign) << 31) | F32_INF);\n }\n\n uint hi_part;\n uint low_part;\n\n // float64 significand has 52 bits\n // float32 significand has 23 bits\n // The significand of the high part is the significand of the double, trimmed\n uint f_hi = 0x800000u | (fractionHigh << 3) | (fractionLow >> 29);\n uint f_low = fractionLow & 0x1fffffffu;\n\n if (exponent < -126) {\n // For tiny normals, the top 24 significand bits still contribute to the float32\n // high part, but they land in the float32 subnormal range.\n hi_part = makeFloat(sign, exponent - 23, f_hi);\n\n // The residual keeps the remaining 29 significand bits at the original double scale.\n low_part = makeFloat(sign, exponent - 52, f_low);\n return uvec2(hi_part, low_part);\n }\n\n bool roundUp = f_low > 0x10000000u || (f_low == 0x10000000u && (f_hi & 1u) == 1u);\n\n uint f_rounded = f_hi + (roundUp ? 1u : 0u);\n int exponent_hi = exponent;\n if (f_rounded == 0x1000000u) {\n f_rounded = 0x800000u;\n exponent_hi++;\n }\n\n if (exponent_hi > 127) {\n // Overflows float32 limit\n hi_part = (sign << 31) | F32_INF;\n low_part = ((1u - sign) << 31) | F32_INF;\n return uvec2(hi_part, low_part);\n }\n \n hi_part = makeFloat_(sign, exponent_hi, f_rounded);\n\n int remainder = int(f_low);\n uint sign_low = sign;\n if (roundUp) {\n remainder -= 0x20000000;\n }\n if (remainder < 0) {\n sign_low = 1u - sign;\n remainder = -remainder;\n }\n low_part = makeFloat(sign_low, exponent - 52, uint(remainder));\n\n return uvec2(hi_part, low_part);\n}\n\nvoid fround(in uint x[X_LEN], out float result[X_LEN]) {\n int n = X_LEN / 2;\n for (int i = 0; i < n; i++) {\n uvec2 f = parseAsDouble(uvec2(x[i * 2], x[i * 2 + 1]));\n result[i] = uintBitsToFloat(f.x);\n result[i + n] = uintBitsToFloat(f.y);\n }\n}\n`;function g(n,e,t){const i=function(n){switch(n){case"uint32":return"usampler2D";case"sint32":return"isampler2D";case"float32":return"sampler2D";default:throw new Error(`Unsupported WebGL gather sampler type for ${n}`)}}(t),s=r(e,1),u=Array.from({length:n.size},(n,e)=>` v[${e}] = ${s}(texelFetch(source_values_texture, ivec2(${e}, rowIndex), 0).r);`).join("\n");return{name:"source_values_texture",vs:`\nuniform highp ${i} source_values_texture;\nvoid read_source_values(int rowIndex, out TYPE v[${n.size}]) {\n${u}\n}\n`}}function h(e,t,r){const i=r.createTexture({width:Math.max(e.size,1),height:e.length,format:u(t),usage:n.Texture.SAMPLE|n.Texture.COPY_DST});if(0===e.length)return i;const s=r.createCommandEncoder();return s.copyBufferToTexture({sourceBuffer:e.buffer,destinationTexture:i,byteOffset:e.offset,bytesPerRow:e.stride,rowsPerImage:e.length,size:[e.size,e.length,1]}),r.submit(s.finish()),i}function _(n,e){const t=r(n.type,1);let i="aids_0";return n.type!==function(n){switch(n){case"uint":return"uint32";case"int":return"sint32";default:return"float32"}}(e)&&(i=`${e}(${i})`),{name:"ids",vs:`\nin ${t} aids_0;\nvoid get_ids(out INDEX_TYPE v[1]) {\n v[0] = ${i};\n}\n`}}function x(n,e,t,r){return t<e.size?`${n}[${t}]`:1===e.size?`${n}[0]`:r}exports.arithmetic=d,exports.dot=({inputs:n,output:e,target:t})=>(a({module:{name:"row_dot",vs:"void row_dot(in TYPE x[X_LEN], in TYPE y[Y_LEN], out float result[1]) {\n float sum = 0.0;\n for (int i = 0; i < X_LEN; i++) {\n sum += float(x[i]) * float(y[i]);\n }\n result[0] = sum;\n}\n"},inputs:n,output:e,operationType:"float32",outputBuffer:t}),{success:!0}),exports.equalAll=({inputs:n,output:e,target:t})=>(a({module:{name:"equalAll",vs:"void equalAll(in TYPE x[X_LEN], in TYPE y[Y_LEN], out uint result[1]) {\n uint allEqual = uint(1);\n for (int i = 0; i < X_LEN; i++) {\n if (x[i] != y[i]) {\n allEqual = uint(0);\n break;\n }\n }\n result[0] = allEqual;\n}\n"},inputs:n,output:e,operationType:"uint32"===e.type?n.x.type:e.type,outputBuffer:t}),{success:!0}),exports.extent=({inputs:r,output:i,target:s})=>{const{sourceValues:u}=r,o=s.device;if(0===u.length){const n=new i.ValueType(i.length*i.size);return s.write(n),{success:!0,value:n}}if(u.isConstant){const n=u.value,e=new i.ValueType(i.length*i.size);for(let t=0;t<i.length;t++){const r=n[t];e[2*t]=r,e[2*t+1]=r}return s.write(e),{success:!0,value:e}}const a=o.createTexture({width:1,height:i.length,format:"rg32float",usage:n.Texture.RENDER|n.Texture.COPY_SRC|n.Texture.COPY_DST}),c=o.createFramebuffer({colorAttachments:[a]}),m=new t.Model(o,{vs:"#version 300 es\n\nflat out float extent_value;\n\nvoid main() {\n float sourceValues[SOURCE_VALUES_LEN];\n get_sourceValues(sourceValues);\n extent_value = sourceValues[gl_VertexID];\n\n float y = (float(gl_VertexID) + 0.5) / float(CHANNEL_COUNT) * 2.0 - 1.0;\n gl_Position = vec4(0.0, y, 0.0, 1.0);\n gl_PointSize = 1.0;\n}\n ",fs:"#version 300 es\n\nprecision highp float;\n\nflat in float extent_value;\nout vec2 fragColor;\n\nvoid main() {\n fragColor = vec2(-extent_value, extent_value);\n}\n ",topology:"point-list",parameters:{depthCompare:"always",blend:!0,blendColorSrcFactor:"one",blendColorDstFactor:"one",blendColorOperation:"max",blendAlphaSrcFactor:"one",blendAlphaDstFactor:"one",blendAlphaOperation:"max"},modules:[l("sourceValues",u.type,u.size,u.normalized)],defines:{TYPE:"float",SOURCE_VALUES_LEN:u.size.toString(),CHANNEL_COUNT:i.length.toString()},attributes:{sourceValues:u.buffer},bufferLayout:[f("sourceValues",u)],instanceCount:u.length,vertexCount:i.length,disableWarnings:!0}),g=e.bufferPool.createOrReuse(o,i.byteLength);try{const n=o.beginRenderPass({framebuffer:c,parameters:{viewport:[0,0,1,i.length]},clearColor:[-p,-p,0,0],clearDepth:!1,clearStencil:!1});o.statsManager.getStats("GPGPU Operation Counts").get("Transform Runs").incrementCount(),m.draw(n),n.end();const t=o.createCommandEncoder();return t.copyTextureToBuffer({sourceTexture:a,width:1,height:i.length,destinationBuffer:g,byteOffset:0,bytesPerRow:8}),o.submit(t.finish()),d({device:o,inputs:{expression:{kind:"call",op:"multiply",args:[{kind:"input",name:"x"},{kind:"literal",value:[-1,1]}]},namedInputs:{x:new e.GPUDataEvaluator({buffer:g,size:2,type:"float32",length:i.length})}},output:i,target:s})}finally{m.destroy(),e.bufferPool.recycle(g),c.destroy(),a.destroy()}},exports.fround=({inputs:n,output:e,target:t})=>(a({module:{name:"fround",vs:m},inputs:n,output:e,operationType:"uint32",outputBuffer:t}),{success:!0}),exports.gather=async({inputs:n,output:e,target:u})=>{const{ids:o,sourceValues:a}=n,l=u.device,f=c("result",e.type,e.size),d=r(o.type,1),p=r(e.type,1),m=e.type,x=h(a,m,l),v=`#version 300 es\n\nvoid main() {\n INDEX_TYPE ids[1];\n get_ids(ids);\n TYPE result[${e.size}];\n gather(ids, result);\n set_result(result);\n}\n `,E=new t.BufferTransform(l,{vs:v,defines:{INDEX_TYPE:d,TYPE:p,RESULT_LEN:e.size.toString(),SOURCE_VALUES_ROWS:a.length.toString()},modules:[_(o,d),g(a,e.type,m),(b=e.type,{name:"gather",vs:`\nvoid zero_result(out TYPE result[RESULT_LEN]) {\n for (int i = 0; i < RESULT_LEN; i++) {\n result[i] = ${s(b)};\n }\n}\n\nvoid gather(in INDEX_TYPE ids[1], out TYPE result[RESULT_LEN]) {\n int sourceIndex = int(ids[0]);\n if (sourceIndex < 0 || sourceIndex >= SOURCE_VALUES_ROWS) {\n zero_result(result);\n return;\n }\n read_source_values(sourceIndex, result);\n}\n`}),f],bindings:{source_values_texture:x},bufferLayout:[(y=o,{name:"ids",stepMode:y.isConstant?"vertex":"instance",byteStride:y.stride,attributes:[{attribute:"aids_0",format:i(y.type,1,y.normalized),byteOffset:y.offset}]})],vertexCount:1,instanceCount:e.length,feedbackBufferMode:"interleaved",outputs:f.varyings});var y,b;try{return E.run({inputBuffers:{ids:o.buffer},outputBuffers:{[f.varyings[0]]:u}}),{success:!0}}finally{E.destroy(),x.destroy()}},exports.interleave=({inputs:n,output:e,target:t})=>{const r=n.map((n,e)=>[`x${e}`,n]);!function(n,e){const t=e.reduce((n,[,e])=>n+Math.ceil(e.size/4),0);if(t>n)throw new Error(`interleave() requires ${t} vertex attributes, exceeding device limit ${n}`)}(t.device.limits.maxVertexAttributes,r),function(n,e){if(e.size>n)throw new Error(`interleave() output size ${e.size} exceeds device inter-stage component limit ${n}`)}(t.device.limits.maxInterStageShaderVariables,e);const i=r.map(([n,e])=>`in TYPE ${n}[${e.size}]`).join(", ");let s=0;return a({module:{name:"interleave",vs:`void interleave(${i}, out TYPE result[RESULT_LEN]) {\n${r.map(([n,e])=>{const t=Array.from({length:e.size},(e,t)=>` result[${s+t}] = ${n}[${t}];`).join("\n");return s+=e.size,t}).join("\n")}\n}\n`},inputs:n,output:e,outputBuffer:t}),{success:!0}},exports.length=({inputs:n,output:e,target:t})=>(a({module:{name:"row_length",vs:"void row_length(in TYPE x[X_LEN], out float result[1]) {\n float sum = 0.0;\n for (int i = 0; i < X_LEN; i++) {\n sum += float(x[i]) * float(x[i]);\n }\n result[0] = sqrt(sum);\n}\n"},inputs:n,output:e,operationType:"float32",outputBuffer:t}),{success:!0}),exports.segmentedMap=async({inputs:n,output:e,target:r})=>{const{segments:i}=n,s=r.device,u=c("result",e.type,e.size),o=i.type,a=h(i,o,s),l=new t.BufferTransform(s,{vs:"#version 300 es\n\nvoid main() {\n TYPE result[RESULT_LEN];\n segmentedMap(result);\n set_result(result);\n}\n",defines:{TYPE:"uint",RESULT_LEN:e.size.toString(),SEGMENTS_LENGTH:i.length.toString()},modules:[g(i,e.type,o),{name:"segmentedMap",vs:"\nuint read_segment_start(int segmentIndex) {\n TYPE value[1];\n read_source_values(segmentIndex, value);\n return uint(value[0]);\n}\n\nvoid segmentedMap(out TYPE result[RESULT_LEN]) {\n uint vertexIndex = uint(gl_InstanceID);\n int low = 0;\n int high = SEGMENTS_LENGTH;\n\n while (low < high) {\n int mid = low + (high - low) / 2;\n uint midStart = read_segment_start(mid);\n if (midStart <= vertexIndex) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n\n uint segmentIndex = uint(max(low - 1, 0));\n uint segmentStart = read_segment_start(int(segmentIndex));\n result[0] = segmentIndex;\n result[1] = vertexIndex - segmentStart;\n}\n"},u],bindings:{source_values_texture:a},vertexCount:1,instanceCount:e.length,feedbackBufferMode:"interleaved",outputs:u.varyings});try{return l.run({outputBuffers:{[u.varyings[0]]:r}}),{success:!0}}finally{l.destroy(),a.destroy()}},exports.select=async({inputs:n,output:e,target:t})=>{const i=s(r(e.type,1,e.normalized));return a({module:{name:"select",vs:""},inputs:n,output:e,operationType:e.type,outputBuffer:t,expression:e=>{const t=x("condition",n.condition,e,i),r=x("whenTrue",n.whenTrue,e,i),s=x("whenFalse",n.whenFalse,e,i);return`(${t} != ${i} ? ${r} : ${s})`}}),{success:!0}},exports.sequence=({inputs:n,output:e,target:r})=>{const i=c("result",e.type,e.size),s=new t.BufferTransform(r.device,{vs:"#version 300 es\n\nvoid main() {\n int result[1];\n result[0] = START + gl_InstanceID * STEP;\n set_result(result);\n}\n",defines:{START:n.start.toString(),STEP:n.step.toString()},modules:[i],vertexCount:1,instanceCount:e.length,feedbackBufferMode:"interleaved",outputs:i.varyings});try{return s.run({outputBuffers:{[i.varyings[0]]:r}}),{success:!0}}finally{s.destroy()}},exports.swizzle=({inputs:n,output:e,target:t})=>{const{columns:r}=n;return a({module:{name:"swizzle",vs:"// swizzle expression handled inline"},expression:n=>`x[${r[n]}]`,inputs:{x:n.x},output:e,outputBuffer:t}),{success:!0}};